commit aeddf4ce6559cb8802ccf09b48b7bdf1998fe3d2 Author: yexingqiang Date: Mon Jun 8 17:14:28 2026 +0800 chore: 初始化 VPSA ASP.NET 管理端 diff --git a/App_Data/PublishProfiles/_system~.ini b/App_Data/PublishProfiles/_system~.ini new file mode 100644 index 0000000..e69de29 diff --git a/App_Data/PublishProfiles/web.pubxml b/App_Data/PublishProfiles/web.pubxml new file mode 100644 index 0000000..080284a --- /dev/null +++ b/App_Data/PublishProfiles/web.pubxml @@ -0,0 +1,21 @@ + + + + + FileSystem + Debug + Any CPU + + True + True + True + False + DonotMerge + True + C:\test + True + + \ No newline at end of file diff --git a/App_Data/_system~.ini b/App_Data/_system~.ini new file mode 100644 index 0000000..e69de29 diff --git a/App_code/CommonFunction.ExcelTable.cs b/App_code/CommonFunction.ExcelTable.cs new file mode 100644 index 0000000..1770df2 --- /dev/null +++ b/App_code/CommonFunction.ExcelTable.cs @@ -0,0 +1,543 @@ +using System; +using System.Data; +using System.Collections.Generic; +using System.Linq; +using System.Web; +using System.Web.UI.WebControls; + +/// +///CommonFunction 的摘要说明 +/// +public partial class CommonFunction +{ + /// + /// 基本报表 + /// + /// + public static void ExcelTable_QualityData_XR(string image) + { + + System.Web.HttpContext web = System.Web.HttpContext.Current; + string str; + + //if (table == null) return; + web.Response.Clear(); + web.Response.Charset = "GB2312"; + web.Response.Buffer = true; + web.Response.ContentEncoding = System.Text.Encoding.UTF8; + web.Response.AppendHeader("Content-Disposition", "attachment;filename=" + HttpUtility.UrlEncode("Sheet.xls", System.Text.Encoding.UTF8).ToString()); + HttpContext.Current.Response.Write(""); + web.Response.ContentType = "application/ms-excel"; + //表头 + int table_Columns_Count = 5; + string table_TableName = "标题"; + web.Response.Write(""); + web.Response.Write(""); + web.Response.Write(""); + web.Response.Write(""); + web.Response.Write(""); + //SPC.WebUI.PageBase.UrlBase + str = ""; + //str = ""; + //str = ""; + + string in_str = ""; + str = ""; + web.Response.Write(str); + web.Response.Write(""); + ////输出表字段 + //for (int i = 0; i < table.Columns.Count; i++) + //{ + // web.Response.Write(""); + //} + //foreach (DataRow dataRow in table.Rows) + //{ + // web.Response.Write(""); + + // for (int i = 0; i < table.Columns.Count; i++) + // { + // if (Convert.ToInt32(dataRow["合格标志"]) == 0) + // { + // web.Response.Write(""); + // } + // else + // { + // web.Response.Write(""); + // } + // } + // web.Response.Write(""); + + //} + web.Response.Write("
" + table_TableName + "
" + + "\"\"" + "" + + // "\"\"" + "" + + // "\"\"" + "" + + in_str + "
" + table.Columns[i].ColumnName + "
" + dataRow[i] + "" + dataRow[i] + "
"); + + web.Response.End(); + } + + //2012_04_17 chenghai + /// + /// 基本报表_图片 + /// + /// + public static void ExcelTable_QualityData_tupian(string path, string tupian_name) + { + + + int cloumn = 1; + int with = 800; + int height = 600; + string str; + System.Web.HttpContext web = System.Web.HttpContext.Current; + web.Response.Clear(); + web.Response.Charset = "GB2312"; + web.Response.Buffer = true; + web.Response.ContentEncoding = System.Text.Encoding.UTF8; + web.Response.AppendHeader("Content-Disposition", "attachment;filename=" + HttpUtility.UrlEncode("Sheet.xls", System.Text.Encoding.UTF8).ToString()); + HttpContext.Current.Response.Write(""); + web.Response.ContentType = "application/ms-excel"; + //表头 + web.Response.Write(""); + web.Response.Write(""); + web.Response.Write(""); + web.Response.Write(""); + web.Response.Write(""); + + str = ""; + "\"\"" + ""; + + web.Response.Write(str); + web.Response.Write(""); + //输出表字段 + web.Response.Write("
" + tupian_name + "
" + + // "\"\"" + "
"); + + web.Response.End(); + + + + } + //2012_04_17 chenghai + /// + /// 基本报表_图片_数据 + /// + /// + public static void ExcelTable_QualityData_tupian_and_data(string path, DataTable table) + { + //导出excel 时 每个字段宽度 统一 设置为100 + int excel_biaoge_width = 100; + //图片的高度 + int height = 400; + //图片所占用的excel表的行数 + int excel_tupian_gaodu_hangshu = 22; + string str; + if (table == null) return; + System.Web.HttpContext web = System.Web.HttpContext.Current; + + + web.Response.Clear(); + web.Response.Charset = "GB2312"; + web.Response.Buffer = true; + web.Response.ContentEncoding = System.Text.Encoding.UTF8; + web.Response.AppendHeader("Content-Disposition", "attachment;filename=" + HttpUtility.UrlEncode("Sheet.xls", System.Text.Encoding.UTF8).ToString()); + HttpContext.Current.Response.Write(""); + web.Response.ContentType = "application/ms-excel"; + //表头 + web.Response.Write(""); + web.Response.Write(""); + web.Response.Write(""); + web.Response.Write(""); + web.Response.Write(""); + + //string webPath = SPC.WebUI.PageBase.UrlBase; + //webPath = webPath.Remove(webPath.Length - 1, 1); + + str = ""; + + web.Response.Write(str); + web.Response.Write(""); + for (int i = 0; i < excel_tupian_gaodu_hangshu; i++) + { + web.Response.Write(""); + + } + //输出表字段 + + for (int i = 0; i < table.Columns.Count; i++) + { + web.Response.Write(""); + } + foreach (DataRow dataRow in table.Rows) + { + web.Response.Write(""); + + for (int i = 0; i < table.Columns.Count; i++) + { + web.Response.Write(""); + } + web.Response.Write(""); + + } + web.Response.Write("
" + table.TableName + "
" + + "\"\"" + "
" + table.Columns[i].ColumnName + "
" + dataRow[i] + "
"); + + web.Response.End(); + + } + /// + /// 基本报表 + /// + /// + public static void ExcelTable_QualityData_Query2(DataTable table) + { + + System.Web.HttpContext web = System.Web.HttpContext.Current; + string str; + if (table == null) return; + web.Response.Clear(); + web.Response.Charset = "GB2312"; + web.Response.Buffer = true; + web.Response.ContentEncoding = System.Text.Encoding.UTF8; + web.Response.AppendHeader("Content-Disposition", "attachment;filename=" + HttpUtility.UrlEncode("Sheet.xls", System.Text.Encoding.UTF8).ToString()); + HttpContext.Current.Response.Write(""); + web.Response.ContentType = "application/ms-excel"; + string tableName; + tableName = table.TableName; + /////////////////////////////////////////// + //图标 + web.Response.Write(""); + web.Response.Write(""); + str = ""; + "\"\"" + ""; + web.Response.Write(str); + web.Response.Write(""); + /////////////////////////////////////////// + //表头 + web.Response.Write(""); + web.Response.Write(""); + web.Response.Write(""); + web.Response.Write("
" + + //"\"\"" + "
" + table.TableName + "
"); + + web.Response.Write(""); + + //输出表字段 + for (int i = 0; i < table.Columns.Count; i++) + { + web.Response.Write(""); + } + string columnName; + foreach (DataRow dataRow in table.Rows) + { + web.Response.Write(""); + + for (int i = 0; i < table.Columns.Count; i++) + { + columnName = table.Columns[i].ColumnName; + switch (tableName) + { + case "不合格质量数据报表": + switch (columnName) + { + case "数据": + web.Response.Write(""); + break; + default: + web.Response.Write(""); + break; + } + break; + case "工序能力": + switch (columnName) + { + case "能力状况": + switch (Convert.ToInt32(dataRow["能力状况"])) + { + case 1: + web.Response.Write(""); + break; + case 2: + web.Response.Write(""); + break; + case 3: + web.Response.Write(""); + break; + } + break; + default: + web.Response.Write(""); + break; + } + break; + default: + switch (columnName) + { + case "工序状况": + //工序状况=0 不合格(NOK);=1 合格(OK) + if (Convert.ToInt32(dataRow["工序状况"]) == 0) + { + web.Response.Write(""); + } + else + { + web.Response.Write(""); + } + break; + case "总合格标志": + //工序状况=0 合格(OK);=1 合格(NOK) + if (Convert.ToInt32(dataRow["总合格标志"]) == 0) + { + web.Response.Write(""); + } + else + { + web.Response.Write(""); + } + break; + default: + web.Response.Write(""); + break; + + } + break; + } + + + + } + web.Response.Write(""); + + } + web.Response.Write("
" + GetColumnName_Ver(table.Columns[i].ColumnName) + "
" + dataRow[i] + "" + dataRow[i] + "" + "" + "" + "" + "" + "" + "" + dataRow[i] + "" + "NOK" + "" + "OK" + "" + "OK" + "" + "NOK" + "" + dataRow[i] + "
"); + + web.Response.End(); + } + /// + /// 字段名称各个字符中间增加回车,以保证文本竖着书写。 + /// + /// + /// + private static string GetColumnName_Ver(string columnName) + { + string columnName_tr; + columnName_tr = ""; + for (int i = 0; i < columnName.Length; i++) + { + columnName_tr = columnName_tr + columnName[i] + "
"; + } + return columnName_tr; + } + /// + /// 基本报表 + /// + /// + public static void ExcelTable_QualityData_Query(DataTable table) + { + + System.Web.HttpContext web = System.Web.HttpContext.Current; + + if (table == null) return; + web.Response.Clear(); + web.Response.Charset = "GB2312"; + web.Response.Buffer = true; + web.Response.ContentEncoding = System.Text.Encoding.UTF8; + web.Response.AppendHeader("Content-Disposition", "attachment;filename=" + HttpUtility.UrlEncode("Sheet.xls", System.Text.Encoding.UTF8).ToString()); + HttpContext.Current.Response.Write(""); + web.Response.ContentType = "application/ms-excel"; + //表头 + web.Response.Write(""); + web.Response.Write(""); + web.Response.Write(""); + web.Response.Write(""); + //输出表字段 + for (int i = 0; i < table.Columns.Count; i++) + { + web.Response.Write(""); + } + foreach (DataRow dataRow in table.Rows) + { + web.Response.Write(""); + + for (int i = 0; i < table.Columns.Count; i++) + { + //if (Convert.ToInt32(dataRow["合格标志"]) == 0) --20140919 wt + if (Convert.ToString(dataRow["合格标志"]) == "不合格") + { + web.Response.Write(""); + } + else + { + //去除科学计数法 + web.Response.Write(""); + } + } + web.Response.Write(""); + + } + web.Response.Write("
" + table.TableName + "
" + table.Columns[i].ColumnName + "
" + dataRow[i] + "" + dataRow[i] + "
"); + + web.Response.End(); + } + /// + /// 2012-07-19-chenghai基本报表_称重 (kg) + /// + /// + public static void ExcelTable_QualityData_Query_kg(DataTable table) + { + + System.Web.HttpContext web = System.Web.HttpContext.Current; + + if (table == null) return; + web.Response.Clear(); + web.Response.Charset = "GB2312"; + web.Response.Buffer = true; + web.Response.ContentEncoding = System.Text.Encoding.UTF8; + web.Response.AppendHeader("Content-Disposition", "attachment;filename=" + HttpUtility.UrlEncode("Sheet.xls", System.Text.Encoding.UTF8).ToString()); + HttpContext.Current.Response.Write(""); + web.Response.ContentType = "application/ms-excel"; + //表头 + web.Response.Write(""); + web.Response.Write(""); + web.Response.Write(""); + web.Response.Write(""); + //输出表字段 + for (int i = 0; i < table.Columns.Count; i++) + { + if (i == 2 || i == 3 || i == 4 || i == 6 || i == 7 ) + { + web.Response.Write(""); + + } + else + { + if (i == 5) + { + web.Response.Write(""); + } + else + { + web.Response.Write(""); + } + } + } + foreach (DataRow dataRow in table.Rows) + { + web.Response.Write(""); + + for (int i = 0; i < table.Columns.Count; i++) + { + //if (Convert.ToInt32(dataRow["合格标志"]) == 0) --20140919 wt + if (Convert.ToString(dataRow["合格标志"]) == "不合格") + { + web.Response.Write(""); + } + else + { + web.Response.Write(""); + } + } + web.Response.Write(""); + + } + web.Response.Write("
" + table.TableName + "
" + table.Columns[i].ColumnName + "(kg)" + "" + table.Columns[i].ColumnName + "(L)" + "" + table.Columns[i].ColumnName + "
" + dataRow[i] + "" + dataRow[i] + "
"); + + web.Response.End(); + } + /// + /// 基本报表 + /// + /// + public static void ExcelTable(DataTable table) + { + + System.Web.HttpContext web = System.Web.HttpContext.Current; + + if (table == null) return; + web.Response.Clear(); + web.Response.Charset = "GB2312"; + web.Response.Buffer = true; + web.Response.ContentEncoding = System.Text.Encoding.UTF8; + web.Response.AppendHeader("Content-Disposition", "attachment;filename=" + HttpUtility.UrlEncode("Sheet.xls", System.Text.Encoding.UTF8).ToString()); + HttpContext.Current.Response.Write(""); + web.Response.ContentType = "application/ms-excel"; + //表头 + web.Response.Write(""); + web.Response.Write(""); + web.Response.Write(""); + web.Response.Write(""); + //输出表字段 + for (int i = 0; i < table.Columns.Count; i++) + { + web.Response.Write(""); + } + foreach (DataRow dataRow in table.Rows) + { + web.Response.Write(""); + + for (int i = 0; i < table.Columns.Count; i++) + { + web.Response.Write(""); + } + web.Response.Write(""); + + } + web.Response.Write("
" + table.TableName + "
" + table.Columns[i].ColumnName + "
" + dataRow[i] + "
"); + + web.Response.End(); + } + + public static void ExcelTable_RecipeProof(int cutnum, int cutnum1, DataTable dt) + { + System.Web.HttpContext web = System.Web.HttpContext.Current; + web.Response.ClearContent(); + web.Response.Charset = "GB2312"; + web.Response.Buffer = true; + web.Response.ContentEncoding = System.Text.Encoding.UTF8; + web.Response.AppendHeader("Content-Disposition", "attachment;filename=" + HttpUtility.UrlEncode("Sheet.xls", System.Text.Encoding.UTF8).ToString()); + HttpContext.Current.Response.Write(""); + web.Response.ContentType = "application/ms-excel"; + + //SheetCount代表生成的 Sheet 数目。 + for (int i = 0; i < 2; i++) + { + //计算该 Sheet 中的数据起始行和结束行。 + int start = cutnum * i; + int end = cutnum; + if (i == 1) end = cutnum1 + cutnum; + + web.Response.Write(" < 配方校验:'Sheet" + (i + 1) + "'>"); + + web.Response.Write(""); + web.Response.Write(""); + web.Response.Write(""); + web.Response.Write(""); + //输出表字段 + for (int j = 0; j < dt.Columns.Count; j++) + { + web.Response.Write(""); + } + + for (int j = start; j < end; j++) + { + web.Response.Write(""); + + for (int r = 0; r < dt.Columns.Count; r++) + { + web.Response.Write(""); + } + web.Response.Write(""); + + } + web.Response.Write("
" + dt.TableName + "
" + dt.Columns[j].ColumnName + "
" + dt.Rows[j][r] + "
"); + web.Response.Write(""); + web.Response.Flush(); + } + //web.Response.Write(""); + web.Response.End(); + } + + + +} \ No newline at end of file diff --git a/App_code/CommonFunction.cs b/App_code/CommonFunction.cs new file mode 100644 index 0000000..30ecf63 --- /dev/null +++ b/App_code/CommonFunction.cs @@ -0,0 +1,115 @@ +using System; +using System.Data; +using System.Collections.Generic; +using System.Linq; +using System.Web; +using System.Web.UI.WebControls; + +/// +///CommonFunction 的摘要说明 +/// +public partial class CommonFunction +{ + public CommonFunction() + { + // + //TODO: 在此处添加构造函数逻辑 + // + } + /// + /// 保持GridView状态 + /// + /// + public static void SetGridViewSelection(GridView GridView1) + { + if (GridView1.Rows.Count > 0) + { + if (GridView1.SelectedIndex != -1) + { + if (GridView1.SelectedIndex >= GridView1.Rows.Count) + GridView1.SelectedIndex = GridView1.Rows.Count - 1; + } + else + GridView1.SelectedIndex = 0; + //去掉gridview的空格 + for (int i = 0; i < GridView1.Rows.Count; i++) + { + for (int j = 1; j < GridView1.Columns.Count-1; j++) + GridView1.Rows[i].Cells[j].Text = GridView1.Rows[i].Cells[j].Text.Trim().Replace(" ", ""); + } + } + else + { + GridView1.SelectedIndex = -1; + } + + } + public static void OutPutDataAndPic(string path, DataTable table) + { + //导出excel 时 每个字段宽度 统一 设置为100 + int excel_biaoge_width = 170; + //图片的高度 + int height = 400; + int with = 800; + //图片所占用的excel表的行数 + int excel_tupian_gaodu_hangshu = 22; + string str; + if (table == null) return; + System.Web.HttpContext web = System.Web.HttpContext.Current; + + + HttpContext.Current.Response.Clear(); + HttpContext.Current.Response.Charset = "GB2312"; + HttpContext.Current.Response.Buffer = true; + HttpContext.Current.Response.ContentEncoding = System.Text.Encoding.UTF8; + HttpContext.Current.Response.AppendHeader("Content-Disposition", "attachment;filename=" + HttpUtility.UrlEncode("Sheet.xls", System.Text.Encoding.UTF8).ToString()); + HttpContext.Current.Response.Write(""); + HttpContext.Current.Response.ContentType = "application/ms-excel"; + //表头 + HttpContext.Current.Response.Write(""); + HttpContext.Current.Response.Write(""); + HttpContext.Current.Response.Write(""); + HttpContext.Current.Response.Write(""); + HttpContext.Current.Response.Write(""); + + //string webPath = SPC.WebUI.PageBase.UrlBase; + //webPath = webPath.Remove(webPath.Length - 1, 1); + + //str = ""; + + str = ""; + "\"\"" + ""; + + + + HttpContext.Current.Response.Write(str); + HttpContext.Current.Response.Write(""); + for (int i = 0; i < excel_tupian_gaodu_hangshu; i++) + { + HttpContext.Current.Response.Write(""); + + } + //输出表字段 + + for (int i = 0; i < table.Columns.Count; i++) + { + HttpContext.Current.Response.Write(""); + } + foreach (DataRow dataRow in table.Rows) + { + HttpContext.Current.Response.Write(""); + + for (int i = 0; i < table.Columns.Count; i++) + { + HttpContext.Current.Response.Write(""); + } + HttpContext.Current.Response.Write(""); + + } + HttpContext.Current.Response.Write("
" + + //"\"\"" + "" + + // "\"\"" + "
" + table.Columns[i].ColumnName + "
" + dataRow[i] + "
"); + + HttpContext.Current.Response.End(); + } +} diff --git a/App_code/DirectExcel.cs b/App_code/DirectExcel.cs new file mode 100644 index 0000000..5e382d2 --- /dev/null +++ b/App_code/DirectExcel.cs @@ -0,0 +1,848 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Reflection; +//using ADODB; +using System.Data.SqlClient; +using System.Data; +using System.Drawing; +using MES_SPC; +//using Microsoft.Office.Core; + +public class DirectExcel +{//直接操作Excel + public DirectExcel() + { + //逻辑区域 + } + + /// + /// 质量数据查询 + /// 引用页质量数据查询页面QualityData_Query.aspx + /// + /// + /// + /// + public static void ExcelTable_QualityData_Query_Direct(ref string sql, ref string fileName, ref int Count,ref int ColCount,ref object[,] ColsArray) + { + //新建一个excel + //string connectionString = ApplicationConfiguration.ERP_ConnectionString; + + //Microsoft.Office.Interop.Excel.Application excel = new Microsoft.Office.Interop.Excel.Application(); + //excel.Application.Workbooks.Add(true); + //Microsoft.Office.Interop.Excel.Workbook wb = (Microsoft.Office.Interop.Excel.Workbook)excel.Application.Workbooks[1]; + //excel.Visible = false; + //Microsoft.Office.Interop.Excel.Worksheet ws = new Microsoft.Office.Interop.Excel.Worksheet(); + //ws = (Microsoft.Office.Interop.Excel.Worksheet)excel.ActiveSheet; + //ws.Name = "Sheet1";//新建的Table名称 + + + + //string LastCol = GetLastCellName(ColCount); + + + ////设置头 + //Microsoft.Office.Interop.Excel.Range rangeHeader =ws.get_Range("A1", LastCol+"1"); + //rangeHeader.Merge(0); + //ws.Cells[1, 1] = "合格质量数据"; + ////rangeHeader.Font.Name = "黑体"; + //rangeHeader.HorizontalAlignment = Microsoft.Office.Interop.Excel.XlHAlign.xlHAlignCenter; + ////rangeHeader.Borders.LineStyle = 1; //设置单元格边框的粗细 + ////rangeHeader.EntireColumn.AutoFit(); //自动调整列宽 + + + ////序号,订单号,发动机号,工位号,测量位置, 测量项目 ,测量值,测量单位,理论值 ,上限值,下限值,合格标志,生产日期 + + ////第二部设置列头 + //Microsoft.Office.Interop.Excel.Range rangeCol =ws.get_Range("A2", LastCol+"2"); + ////Excel.Range rangeCol = (Excel.Range)ws.get_Range(ws.Cells[2, 1], ws.Cells[2, ColCount]); + //object[,] arycol = (object[,])(rangeCol.Value2); + ////arycol = new object[,] { { "序号", "订单号", "发动机号", "工位号", "测量位置", "测量项目", "测量值", "测量单位", "理论值", "上限值", "下限值", "合格标志", "生产日期" } }; + //arycol = ColsArray; + + + ////for (int j = 1; j < SourceTable.Columns.Count + 1; j++) + ////{ + //// arycol[1, j] = SourceTable.Columns[j - 1].ColumnName.ToString(); + ////} + //rangeCol.Value2 = arycol; + //rangeCol.HorizontalAlignment = Microsoft.Office.Interop.Excel.XlHAlign.xlHAlignCenter; + //rangeCol.Borders.LineStyle = 1; //设置单元格边框的粗细 + ////rangeCol.EntireColumn.AutoFit(); //自动调整列宽 + + //try + //{ + // ADODB.Connection conn = new ADODB.Connection(); + // conn.CommandTimeout = 120; + // conn.Open("driver={SQL Server};" + connectionString, "", "", 0); + // ADODB.Recordset rs = new ADODB.Recordset(); + // rs.Open(sql, conn, ADODB.CursorTypeEnum.adOpenStatic, ADODB.LockTypeEnum.adLockReadOnly, 0); + // Microsoft.Office.Interop.Excel.Range range = ws.get_Range("A3", Missing.Value); + // //range.CopyFromRecordset(rs, SourceTable.Rows.Count + 3, SourceTable.Columns.Count);//rs, 65535, 65535 + // range.CopyFromRecordset(rs, 1000000, 30);//rs, 65535, 65535 + + + // //设置序号 + // Microsoft.Office.Interop.Excel.Range Drange = ws.get_Range("A3","A"+(Count+2).ToString()); + // Microsoft.Office.Interop.Excel.Range DrangeFirst = ws.get_Range("A3"); + // DrangeFirst.Value2 = 1; + // Drange.DataSeries(Missing.Value, Microsoft.Office.Interop.Excel.XlDataSeriesType.xlDataSeriesLinear, Microsoft.Office.Interop.Excel.XlDataSeriesDate.xlDay, 1, Count, false); + + + // //设置日期格式 + // //int index = SourceTable.Columns["生产日期"].Ordinal + 1; + // Microsoft.Office.Interop.Excel.Range rangeDate = ws.get_Range(LastCol + "3", LastCol + (Count + 2).ToString()); + // rangeDate.NumberFormatLocal = @"yyyy-mm-dd hh:mm";//日期型格式 + + // Microsoft.Office.Interop.Excel.Range RangeOfAll = ws.get_Range("A3", LastCol + (Count + 2).ToString()); + // RangeOfAll.Borders.LineStyle = 1; //设置单元格边框的粗细 + // RangeOfAll.HorizontalAlignment = Microsoft.Office.Interop.Excel.XlHAlign.xlHAlignCenter; + // RangeOfAll.EntireColumn.AutoFit(); //自动调整列宽 + + // //设置不合格的就为红色 + // Microsoft.Office.Interop.Excel.FormatCondition cond = + // (Microsoft.Office.Interop.Excel.FormatCondition)RangeOfAll.FormatConditions.Add(Microsoft.Office.Interop.Excel.XlFormatConditionType.xlExpression, + // Missing.Value, "=$L1=0", Missing.Value); + + // cond.Interior.PatternColorIndex = Microsoft.Office.Interop.Excel.Constants.xlAutomatic; + // cond.Interior.TintAndShade = 0; + // cond.Interior.Color = ColorTranslator.ToWin32(Color.Red); + // cond.StopIfTrue = false; + + //} + //catch (Exception ex) + //{ + // string str = ex.Message; + //} + //finally + //{ + // wb.Saved = true; + // wb.SaveCopyAs(fileName);//保存 + // //excel.SaveWorkspace(fileName); + // //app.Quit();//关闭进程 + // wb.Close(); + // excel.Quit(); + // GC.Collect(); + + //} + } + + + /// + /// 工件总成质量数据报表 + /// 引用页QualityData_Query_2.aspx(质量数据导出excel) + /// + /// + /// + /// + public static void ExcelTable_QualityData_Query_xml_Direct(ref string sql, ref string fileName, ref int Count, ref int ColCount, ref object[,] ColsArray) + { + //新建一个excel + string connectionString = ApplicationConfiguration.ERP_ConnectionString; + + //Microsoft.Office.Interop.Excel.Application excel = new Microsoft.Office.Interop.Excel.Application(); + //excel.Application.Workbooks.Add(true); + //Microsoft.Office.Interop.Excel.Workbook wb = (Microsoft.Office.Interop.Excel.Workbook)excel.Application.Workbooks[1]; + //excel.Visible = false; + //Microsoft.Office.Interop.Excel.Worksheet ws = new Microsoft.Office.Interop.Excel.Worksheet(); + //ws = (Microsoft.Office.Interop.Excel.Worksheet)excel.ActiveSheet; + //ws.Name = "Sheet1";//新建的Table名称 + + //string LastCol = GetLastCellName(ColCount); + ////设置头 + //Microsoft.Office.Interop.Excel.Range rangeHeader = ws.get_Range("A1", LastCol+"1"); + //rangeHeader.Merge(0); + //ws.Cells[1, 1] = "工件总成质量数据报表"; + ////rangeHeader.Font.Name = "黑体"; + //rangeHeader.HorizontalAlignment = Microsoft.Office.Interop.Excel.XlHAlign.xlHAlignCenter; + ////rangeHeader.Borders.LineStyle = 1; //设置单元格边框的粗细 + ////rangeHeader.EntireColumn.AutoFit(); //自动调整列宽 + + + ////序号,订单号,总成型号,总成流水号,工序号,工序名称,托盘编号,操作者,测量位置,数据1类型,数据1理论值上限,数据1,数据1理论值下限,数据1单位,数据2类型,数据2理论值上限,数据2,数据2理论值下限,数据2单位,工序状况,总合格标志,生产日期 + ////Orientation = 90以90度进行旋转 + + + ////第二部设置列头 + //Microsoft.Office.Interop.Excel.Range rangeCol = ws.get_Range("A2", LastCol+"2"); + ////Excel.Range rangeCol = (Excel.Range)ws.get_Range(ws.Cells[2, 1], ws.Cells[2, ColCount]); + //object[,] arycol = (object[,])(rangeCol.Value2); + ////arycol = new object[,] + ////{{ GetColumnName_Ver("序号"), + //// GetColumnName_Ver("订单号"), + //// GetColumnName_Ver("总成型号"), + //// GetColumnName_Ver("总成流水号"), + //// GetColumnName_Ver("工序号"), + //// GetColumnName_Ver("工序名称"), + //// GetColumnName_Ver("托盘编号"), + //// GetColumnName_Ver("操作者"), + //// GetColumnName_Ver("测量位置"), + //// GetColumnName_Ver("数据1类型"), + //// GetColumnName_Ver("数据1理论值上限 "), + //// GetColumnName_Ver("数据1"), + //// GetColumnName_Ver("数据1理论值下限 "), + //// GetColumnName_Ver("数据1单位"), + //// GetColumnName_Ver("数据2类型"), + //// GetColumnName_Ver("数据2理论值上限 "), + //// GetColumnName_Ver("数据2"), + //// GetColumnName_Ver("数据2理论值下限 "), + //// GetColumnName_Ver("数据2单位"), + //// GetColumnName_Ver("工序状况"), + //// GetColumnName_Ver("总合格标志"), + //// GetColumnName_Ver("生产日期") + ////} }; + + //arycol = ColsArray; + + //rangeCol.Value2 = arycol; + //rangeCol.HorizontalAlignment = Microsoft.Office.Interop.Excel.XlHAlign.xlHAlignCenter; + //rangeCol.VerticalAlignment = Microsoft.Office.Interop.Excel.Constants.xlTop; + //rangeCol.Borders.LineStyle = 1; //设置单元格边框的粗细 + ////rangeCol.EntireColumn.AutoFit(); //自动调整列宽 + ////rangeCol.Orientation = 90; + + //try + //{ + // ADODB.Connection conn = new ADODB.Connection(); + // conn.CommandTimeout = 120; + // conn.Open("driver={SQL Server};" + connectionString, "", "", 0); + // ADODB.Recordset rs = new ADODB.Recordset(); + // rs.Open(sql, conn, ADODB.CursorTypeEnum.adOpenStatic, ADODB.LockTypeEnum.adLockReadOnly, 0); + // Microsoft.Office.Interop.Excel.Range range = ws.get_Range("A3", Missing.Value); + // //range.CopyFromRecordset(rs, SourceTable.Rows.Count + 3, SourceTable.Columns.Count);//rs, 65535, 65535 + // range.CopyFromRecordset(rs, 1000000, 30);//rs, 65535, 65535 + + + // //设置序号 + // Microsoft.Office.Interop.Excel.Range Drange = ws.get_Range("A3", "A" + (Count + 2).ToString()); + // Microsoft.Office.Interop.Excel.Range DrangeFirst = ws.get_Range("A3"); + // DrangeFirst.Value2 = 1; + // Drange.DataSeries(Missing.Value, Microsoft.Office.Interop.Excel.XlDataSeriesType.xlDataSeriesLinear, Microsoft.Office.Interop.Excel.XlDataSeriesDate.xlDay, 1, Count, false); + + + // //设置日期格式 + // //int index = SourceTable.Columns["生产日期"].Ordinal + 1; + // Microsoft.Office.Interop.Excel.Range rangeDate = ws.get_Range(LastCol+"3", LastCol + (Count + 2).ToString()); + // rangeDate.NumberFormatLocal = @"yyyy-mm-dd hh:mm";//日期型格式 + + // Microsoft.Office.Interop.Excel.Range RangeOfAll = ws.get_Range("A3", LastCol + (Count + 2).ToString()); + // RangeOfAll.Borders.LineStyle = 1; //设置单元格边框的粗细 + // RangeOfAll.HorizontalAlignment = Microsoft.Office.Interop.Excel.XlHAlign.xlHAlignCenter; + // RangeOfAll.EntireColumn.AutoFit(); //自动调整列宽 + + // //设置工序状况不合格的就为红色 + // Microsoft.Office.Interop.Excel.Range RangeOfgongxu = ws.get_Range("T3", "T" + (Count + 2).ToString()); + // Microsoft.Office.Interop.Excel.FormatCondition cond = + // (Microsoft.Office.Interop.Excel.FormatCondition)RangeOfgongxu.FormatConditions.Add(Microsoft.Office.Interop.Excel.XlFormatConditionType.xlExpression, + // Missing.Value, @"=$T1=""NOK""", Missing.Value); + + // cond.Interior.PatternColorIndex = Microsoft.Office.Interop.Excel.Constants.xlAutomatic; + // cond.Interior.TintAndShade = 0; + // cond.Interior.Color = ColorTranslator.ToWin32(Color.Red); + // cond.StopIfTrue = false; + + // //设置工序状况不合格的就为红色 + // Microsoft.Office.Interop.Excel.Range RangeOfhege = ws.get_Range("U3", "U" + (Count + 2).ToString()); + // Microsoft.Office.Interop.Excel.FormatCondition cond2 = + // (Microsoft.Office.Interop.Excel.FormatCondition)RangeOfhege.FormatConditions.Add(Microsoft.Office.Interop.Excel.XlFormatConditionType.xlExpression, + // Missing.Value, @"=$U1=""NOK""", Missing.Value); + + // cond2.Interior.PatternColorIndex = Microsoft.Office.Interop.Excel.Constants.xlAutomatic; + // cond2.Interior.TintAndShade = 0; + // cond2.Interior.Color = ColorTranslator.ToWin32(Color.Red); + // cond2.StopIfTrue = false; + + //} + //catch (Exception ex) + //{ + // string str = ex.Message; + //} + //finally + //{ + // wb.Saved = true; + // wb.SaveCopyAs(fileName);//保存 + // //excel.SaveWorkspace(fileName); + // //app.Quit();//关闭进程 + // wb.Close(); + // excel.Quit(); + // GC.Collect(); + + //} + } + + + /// + /// 不合格质量数据报表 + /// + /// + /// + /// + public static void ExcelTable_QualityData_Query2(ref string sql, ref string fileName, ref int Count, ref int ColCount, ref object[,] ColsArray) + { + //新建一个excel + string connectionString = ApplicationConfiguration.ERP_ConnectionString; + + //Microsoft.Office.Interop.Excel.Application excel = new Microsoft.Office.Interop.Excel.Application(); + //excel.Application.Workbooks.Add(true); + //Microsoft.Office.Interop.Excel.Workbook wb = (Microsoft.Office.Interop.Excel.Workbook)excel.Application.Workbooks[1]; + //excel.Visible = false; + //Microsoft.Office.Interop.Excel.Worksheet ws = new Microsoft.Office.Interop.Excel.Worksheet(); + //ws = (Microsoft.Office.Interop.Excel.Worksheet)excel.ActiveSheet; + //ws.Name = "Sheet1";//新建的Table名称 + + //string LastCol = GetLastCellName(ColCount); + ////插入图片 + //float PicLeft,PicTop; + //string imgPath = System.Web.HttpContext.Current.Server.MapPath("~/images/report_icon.jpg"); + + ////转换成字节,再由字节转换成图片 + ////byte[] bytesArr = PicToByteArr(imgPath); + ////System.Drawing.Image bmp = ReturnPhoto(bytesArr);//图片数据 + ////string imgPath=System.Web.HttpContext.Current.Application. + + + //Microsoft.Office.Interop.Excel.Range rangePic = ws.get_Range("A1", LastCol+"1"); + //rangePic.Merge(0); + + //PicLeft = Convert.ToSingle(rangePic.Left)+2; + //PicTop = Convert.ToSingle(rangePic.Top)+ 1; + + //ws.Shapes.AddPicture(imgPath,Microsoft.Office.Core.MsoTriState.msoFalse, + //Microsoft.Office.Core.MsoTriState.msoTrue, + //PicLeft,PicTop,(float)305,(float)12); + + + + ////设置头 + //Microsoft.Office.Interop.Excel.Range rangeHeader = ws.get_Range("A2", LastCol+"2"); + //rangeHeader.Merge(0); + //ws.Cells[2, 1] = "不合格质量数据报表"; + ////rangeHeader.Font.Name = "黑体"; + //rangeHeader.HorizontalAlignment = Microsoft.Office.Interop.Excel.XlHAlign.xlHAlignCenter; + ////rangeHeader.Borders.LineStyle = 1; //设置单元格边框的粗细 + ////rangeHeader.EntireColumn.AutoFit(); //自动调整列宽 + + + ////序号,订单号,总成型号,总成流水号,工序号,工序名称,托盘编号,操作者,测量位置,数据1类型,数据1理论值上限,数据1,数据1理论值下限,数据1单位,数据2类型,数据2理论值上限,数据2,数据2理论值下限,数据2单位,工序状况,总合格标志,生产日期 + ////Orientation = 90以90度进行旋转 + + + ////第二部设置列头 + //Microsoft.Office.Interop.Excel.Range rangeCol = ws.get_Range("A3", LastCol+"3"); + ////Excel.Range rangeCol = (Excel.Range)ws.get_Range(ws.Cells[2, 1], ws.Cells[2, ColCount]); + //object[,] arycol = (object[,])(rangeCol.Value2); + ////arycol = new object[,] + ////{{ GetColumnName_Ver("序号"), + //// GetColumnName_Ver("订单号"), + //// GetColumnName_Ver("总成型号"), + //// GetColumnName_Ver("总成流水号"), + //// GetColumnName_Ver("工序号"), + //// GetColumnName_Ver("工序名称"), + //// GetColumnName_Ver("测量位置"), + //// GetColumnName_Ver("数据类型"), + //// GetColumnName_Ver("数据理论值上限"), + //// GetColumnName_Ver("数据"), + //// GetColumnName_Ver("数据理论值下限 "), + //// GetColumnName_Ver("备注"), + ////} }; + //arycol = ColsArray; + + //rangeCol.Value2 = arycol; + //rangeCol.HorizontalAlignment = Microsoft.Office.Interop.Excel.XlHAlign.xlHAlignCenter; + //rangeCol.VerticalAlignment = Microsoft.Office.Interop.Excel.Constants.xlTop; + //rangeCol.Borders.LineStyle = 1; //设置单元格边框的粗细 + ////rangeCol.EntireColumn.AutoFit(); //自动调整列宽 + ////rangeCol.Orientation = 90; + + //try + //{ + // ADODB.Connection conn = new ADODB.Connection(); + // conn.Open("driver={SQL Server};" + connectionString, "", "", 0); + // ADODB.Recordset rs = new ADODB.Recordset(); + // rs.Open(sql, conn, ADODB.CursorTypeEnum.adOpenStatic, ADODB.LockTypeEnum.adLockReadOnly, 0); + // Microsoft.Office.Interop.Excel.Range range = ws.get_Range("A4", Missing.Value); + // //range.CopyFromRecordset(rs, SourceTable.Rows.Count + 3, SourceTable.Columns.Count);//rs, 65535, 65535 + // range.CopyFromRecordset(rs, 1000000, 30);//rs, 65535, 65535 + + + // //设置序号 + // Microsoft.Office.Interop.Excel.Range Drange = ws.get_Range("A4", "A" + (Count + 3).ToString()); + // Microsoft.Office.Interop.Excel.Range DrangeFirst = ws.get_Range("A4"); + // DrangeFirst.Value2 = 1; + // Drange.DataSeries(Missing.Value, Microsoft.Office.Interop.Excel.XlDataSeriesType.xlDataSeriesLinear, Microsoft.Office.Interop.Excel.XlDataSeriesDate.xlDay, 1, Count, false); + + + // Microsoft.Office.Interop.Excel.Range RangeOfAll = ws.get_Range("A4", LastCol + (Count + 3).ToString()); + // RangeOfAll.Borders.LineStyle = 1; //设置单元格边框的粗细 + // RangeOfAll.HorizontalAlignment = Microsoft.Office.Interop.Excel.XlHAlign.xlHAlignCenter; + // RangeOfAll.EntireColumn.AutoFit(); //自动调整列宽 + + // //设置数据列为红色 + // Microsoft.Office.Interop.Excel.Range RangeOfshuju = ws.get_Range("J4", "J" + (Count + 3).ToString()); + // RangeOfshuju.Cells.Interior.Color = Color.Red; + + + //} + //catch (Exception ex) + //{ + // string str = ex.Message; + //} + //finally + //{ + // wb.Saved = true; + // wb.SaveCopyAs(fileName);//保存 + // //excel.SaveWorkspace(fileName); + // //app.Quit();//关闭进程 + // wb.Close(); + // excel.Quit(); + // GC.Collect(); + + //} + } + + + + /// + /// 合格质量数据 + /// 变速器称重 + /// + /// + /// + /// + public static void ExcelTable_QualityData_Query_kg(ref string sql, ref string fileName, ref int Count, ref int ColCount, ref object[,] ColsArray) + { + //新建一个excel + string connectionString = ApplicationConfiguration.ERP_ConnectionString; + + //Microsoft.Office.Interop.Excel.Application excel = new Microsoft.Office.Interop.Excel.Application(); + //excel.Application.Workbooks.Add(true); + //Microsoft.Office.Interop.Excel.Workbook wb = (Microsoft.Office.Interop.Excel.Workbook)excel.Application.Workbooks[1]; + //excel.Visible = false; + //Microsoft.Office.Interop.Excel.Worksheet ws = new Microsoft.Office.Interop.Excel.Worksheet(); + //ws = (Microsoft.Office.Interop.Excel.Worksheet)excel.ActiveSheet; + //ws.Name = "Sheet1";//新建的Table名称 + + //string LastCol = GetLastCellName(ColCount); + ////设置头 + //Microsoft.Office.Interop.Excel.Range rangeHeader = ws.get_Range("A1", LastCol+"1"); + //rangeHeader.Merge(0); + //ws.Cells[1, 1] = "合格质量数据"; + ////rangeHeader.Font.Name = "黑体"; + //rangeHeader.HorizontalAlignment = Microsoft.Office.Interop.Excel.XlHAlign.xlHAlignCenter; + ////rangeHeader.Borders.LineStyle = 1; //设置单元格边框的粗细 + ////rangeHeader.EntireColumn.AutoFit(); //自动调整列宽 + + + ////序号,发动机号,工件重量,抽油后重量,重量差,允许重量差,合格标志,操作时间 + ////Orientation = 90以90度进行旋转 + + + ////第二部设置列头 + //Microsoft.Office.Interop.Excel.Range rangeCol = ws.get_Range("A2", LastCol+"2"); + ////Excel.Range rangeCol = (Excel.Range)ws.get_Range(ws.Cells[2, 1], ws.Cells[2, ColCount]); + //object[,] arycol = (object[,])(rangeCol.Value2); + ////arycol = new object[,] { { "序号", "发动机号", "工件重量(kg)", "抽油后重量(kg)", "重量差(kg)", "允许重量差(kg)", "合格标志", "操作时间" } }; + //arycol = ColsArray; + + //rangeCol.Value2 = arycol; + //rangeCol.HorizontalAlignment = Microsoft.Office.Interop.Excel.XlHAlign.xlHAlignCenter; + //rangeCol.VerticalAlignment = Microsoft.Office.Interop.Excel.Constants.xlTop; + //rangeCol.Borders.LineStyle = 1; //设置单元格边框的粗细 + ////rangeCol.EntireColumn.AutoFit(); //自动调整列宽 + ////rangeCol.Orientation = 90; + + //try + //{ + // ADODB.Connection conn = new ADODB.Connection(); + // conn.Open("driver={SQL Server};" + connectionString, "", "", 0); + // ADODB.Recordset rs = new ADODB.Recordset(); + // rs.Open(sql, conn, ADODB.CursorTypeEnum.adOpenStatic, ADODB.LockTypeEnum.adLockReadOnly, 0); + // Microsoft.Office.Interop.Excel.Range range = ws.get_Range("A3", Missing.Value); + // //range.CopyFromRecordset(rs, SourceTable.Rows.Count + 3, SourceTable.Columns.Count);//rs, 65535, 65535 + // range.CopyFromRecordset(rs, 1000000, 30);//rs, 65535, 65535 + + + // //设置序号 + // Microsoft.Office.Interop.Excel.Range Drange = ws.get_Range("A3", "A" + (Count + 2).ToString()); + // Microsoft.Office.Interop.Excel.Range DrangeFirst = ws.get_Range("A3"); + // DrangeFirst.Value2 = 1; + // Drange.DataSeries(Missing.Value, Microsoft.Office.Interop.Excel.XlDataSeriesType.xlDataSeriesLinear, Microsoft.Office.Interop.Excel.XlDataSeriesDate.xlDay, 1, Count, false); + + + // //设置日期格式 + // //int index = SourceTable.Columns["生产日期"].Ordinal + 1; + // Microsoft.Office.Interop.Excel.Range rangeDate = ws.get_Range("J3", "J" + (Count + 2).ToString()); + // rangeDate.NumberFormatLocal = @"yyyy-mm-dd hh:mm";//日期型格式 + + // Microsoft.Office.Interop.Excel.Range RangeOfAll = ws.get_Range("A3", LastCol + (Count + 2).ToString()); + // RangeOfAll.Borders.LineStyle = 1; //设置单元格边框的粗细 + // RangeOfAll.HorizontalAlignment = Microsoft.Office.Interop.Excel.XlHAlign.xlHAlignCenter; + // RangeOfAll.EntireColumn.AutoFit(); //自动调整列宽 + + // //设置工序状况不合格的就为红色 + // Microsoft.Office.Interop.Excel.FormatCondition cond = + // (Microsoft.Office.Interop.Excel.FormatCondition)RangeOfAll.FormatConditions.Add(Microsoft.Office.Interop.Excel.XlFormatConditionType.xlExpression, + // Missing.Value, "=$I1=0", Missing.Value); + + // cond.Interior.PatternColorIndex = Microsoft.Office.Interop.Excel.Constants.xlAutomatic; + // cond.Interior.TintAndShade = 0; + // cond.Interior.Color = ColorTranslator.ToWin32(Color.Red); + // cond.StopIfTrue = false; + //} + //catch (Exception ex) + //{ + // string str = ex.Message; + //} + //finally + //{ + // wb.Saved = true; + // wb.SaveCopyAs(fileName);//保存 + // //excel.SaveWorkspace(fileName); + // //app.Quit();//关闭进程 + // wb.Close(); + // excel.Quit(); + // GC.Collect(); + + //} + } + + /// + /// 人工合格放行 + /// + /// + /// + /// + public static void ExcelTable_QualityData_Query_okgo(ref string sql, ref string fileName, ref int Count, ref int ColCount, ref object[,] ColsArray) + { + //新建一个excel + //string connectionString = ApplicationConfiguration.ERP_ConnectionString; + + //Microsoft.Office.Interop.Excel.Application excel = new Microsoft.Office.Interop.Excel.Application(); + //excel.Application.Workbooks.Add(true); + //Microsoft.Office.Interop.Excel.Workbook wb = (Microsoft.Office.Interop.Excel.Workbook)excel.Application.Workbooks[1]; + //excel.Visible = false; + //Microsoft.Office.Interop.Excel.Worksheet ws = new Microsoft.Office.Interop.Excel.Worksheet(); + //ws = (Microsoft.Office.Interop.Excel.Worksheet)excel.ActiveSheet; + //ws.Name = "Sheet1";//新建的Table名称 + + //string LastCol = GetLastCellName(ColCount); + ////设置头 + //Microsoft.Office.Interop.Excel.Range rangeHeader = ws.get_Range("A1", LastCol + "1"); + //rangeHeader.Merge(0); + //ws.Cells[1, 1] = "人工合格放行"; + ////rangeHeader.Font.Name = "黑体"; + //rangeHeader.HorizontalAlignment = Microsoft.Office.Interop.Excel.XlHAlign.xlHAlignCenter; + ////rangeHeader.Borders.LineStyle = 1; //设置单元格边框的粗细 + ////rangeHeader.EntireColumn.AutoFit(); //自动调整列宽 + + + ////序号,发动机号,工件重量,抽油后重量,重量差,允许重量差,合格标志,操作时间 + ////Orientation = 90以90度进行旋转 + + + ////第二部设置列头 + //Microsoft.Office.Interop.Excel.Range rangeCol = ws.get_Range("A2", LastCol + "2"); + ////Excel.Range rangeCol = (Excel.Range)ws.get_Range(ws.Cells[2, 1], ws.Cells[2, ColCount]); + //object[,] arycol = (object[,])(rangeCol.Value2); + ////arycol = new object[,] { { "序号", "发动机号", "工件重量(kg)", "抽油后重量(kg)", "重量差(kg)", "允许重量差(kg)", "合格标志", "操作时间" } }; + //arycol = ColsArray; + + //rangeCol.Value2 = arycol; + //rangeCol.HorizontalAlignment = Microsoft.Office.Interop.Excel.XlHAlign.xlHAlignCenter; + //rangeCol.VerticalAlignment = Microsoft.Office.Interop.Excel.Constants.xlTop; + //rangeCol.Borders.LineStyle = 1; //设置单元格边框的粗细 + ////rangeCol.EntireColumn.AutoFit(); //自动调整列宽 + ////rangeCol.Orientation = 90; + + //try + //{ + // ADODB.Connection conn = new ADODB.Connection(); + // conn.Open("driver={SQL Server};" + connectionString, "", "", 0); + // ADODB.Recordset rs = new ADODB.Recordset(); + // rs.Open(sql, conn, ADODB.CursorTypeEnum.adOpenStatic, ADODB.LockTypeEnum.adLockReadOnly, 0); + // Microsoft.Office.Interop.Excel.Range range = ws.get_Range("A3", Missing.Value); + // //range.CopyFromRecordset(rs, SourceTable.Rows.Count + 3, SourceTable.Columns.Count);//rs, 65535, 65535 + // range.CopyFromRecordset(rs, 1000000, 30);//rs, 65535, 65535 + + + // //设置序号 + // Microsoft.Office.Interop.Excel.Range Drange = ws.get_Range("A3", "A" + (Count + 2).ToString()); + // Microsoft.Office.Interop.Excel.Range DrangeFirst = ws.get_Range("A3"); + // DrangeFirst.Value2 = 1; + // Drange.DataSeries(Missing.Value, Microsoft.Office.Interop.Excel.XlDataSeriesType.xlDataSeriesLinear, Microsoft.Office.Interop.Excel.XlDataSeriesDate.xlDay, 1, Count, false); + + + // //设置日期格式 + // //int index = SourceTable.Columns["生产日期"].Ordinal + 1; + // Microsoft.Office.Interop.Excel.Range rangeDate = ws.get_Range("F3", "F" + (Count + 2).ToString()); + // rangeDate.NumberFormatLocal = @"yyyy-mm-dd hh:mm";//日期型格式 + + // Microsoft.Office.Interop.Excel.Range RangeOfAll = ws.get_Range("A3", LastCol + (Count + 2).ToString()); + // RangeOfAll.Borders.LineStyle = 1; //设置单元格边框的粗细 + // RangeOfAll.HorizontalAlignment = Microsoft.Office.Interop.Excel.XlHAlign.xlHAlignCenter; + // RangeOfAll.EntireColumn.AutoFit(); //自动调整列宽 + + // //设置工序状况不合格的就为红色 + // //Microsoft.Office.Interop.Excel.FormatCondition cond = + // // (Microsoft.Office.Interop.Excel.FormatCondition)RangeOfAll.FormatConditions.Add(Microsoft.Office.Interop.Excel.XlFormatConditionType.xlExpression, + // // Missing.Value, "=$I1=0", Missing.Value); + + // //cond.Interior.PatternColorIndex = Microsoft.Office.Interop.Excel.Constants.xlAutomatic; + // //cond.Interior.TintAndShade = 0; + // //cond.Interior.Color = ColorTranslator.ToWin32(Color.Red); + // //cond.StopIfTrue = false; + //} + //catch (Exception ex) + //{ + // string str = ex.Message; + //} + //finally + //{ + // wb.Saved = true; + // wb.SaveCopyAs(fileName);//保存 + // //excel.SaveWorkspace(fileName); + // //app.Quit();//关闭进程 + // wb.Close(); + // excel.Quit(); + // GC.Collect(); + + //} + } + + + //ExcelTable + /// + /// 物料数据 + /// + /// + /// + /// + public static void ExcelTable_Materials(ref string sql, ref string fileName, ref int Count, ref int ColCount, ref object[,] ColsArray) + { + //新建一个excel + //string connectionString = ApplicationConfiguration.ERP_ConnectionString; + + //Microsoft.Office.Interop.Excel.Application excel = new Microsoft.Office.Interop.Excel.Application(); + //excel.Application.Workbooks.Add(true); + //Microsoft.Office.Interop.Excel.Workbook wb = (Microsoft.Office.Interop.Excel.Workbook)excel.Application.Workbooks[1]; + //excel.Visible = false; + //Microsoft.Office.Interop.Excel.Worksheet ws = new Microsoft.Office.Interop.Excel.Worksheet(); + //ws = (Microsoft.Office.Interop.Excel.Worksheet)excel.ActiveSheet; + //ws.Name = "Sheet1";//新建的Table名称 + + //string LastCol = GetLastCellName(ColCount); + + ////设置头 + //Microsoft.Office.Interop.Excel.Range rangeHeader = ws.get_Range("A1", LastCol+"1"); + //rangeHeader.Merge(0); + //ws.Cells[1, 1] = "物料数据"; + //rangeHeader.Font.Name = "黑体"; + //rangeHeader.HorizontalAlignment = Microsoft.Office.Interop.Excel.XlHAlign.xlHAlignCenter; + ////rangeHeader.Borders.LineStyle = 1; //设置单元格边框的粗细 + ////rangeHeader.EntireColumn.AutoFit(); //自动调整列宽 + + + ////第二部设置列头 + //Microsoft.Office.Interop.Excel.Range rangeCol = ws.get_Range("A2", LastCol+"2"); + ////Excel.Range rangeCol = (Excel.Range)ws.get_Range(ws.Cells[2, 1], ws.Cells[2, ColCount]); + //object[,] arycol = (object[,])(rangeCol.Value2); + ////arycol = new object[,] { { "序号", "订单号", "发动机型号", "总成流水号", "工序号", "工序名称", "零件数量", "零件名称", "零件图号", "零件数量", "物料号", "生产厂家" } }; + //arycol = ColsArray; + + //rangeCol.Value2 = arycol; + //rangeCol.HorizontalAlignment = Microsoft.Office.Interop.Excel.XlHAlign.xlHAlignCenter; + //rangeCol.VerticalAlignment = Microsoft.Office.Interop.Excel.Constants.xlTop; + //rangeCol.Borders.LineStyle = 1; //设置单元格边框的粗细 + ////rangeCol.EntireColumn.AutoFit(); //自动调整列宽 + ////rangeCol.Orientation = 90; + + //try + //{ + // ADODB.Connection conn = new ADODB.Connection(); + // conn.Open("driver={SQL Server};" + connectionString, "", "", 0); + // ADODB.Recordset rs = new ADODB.Recordset(); + // rs.Open(sql, conn, ADODB.CursorTypeEnum.adOpenStatic, ADODB.LockTypeEnum.adLockReadOnly, 0); + // Microsoft.Office.Interop.Excel.Range range = ws.get_Range("A3", Missing.Value); + // //range.CopyFromRecordset(rs, SourceTable.Rows.Count + 3, SourceTable.Columns.Count);//rs, 65535, 65535 + // range.CopyFromRecordset(rs, 1000000, 30);//rs, 65535, 65535 + + + // //设置序号 + // Microsoft.Office.Interop.Excel.Range Drange = ws.get_Range("A3", "A" + (Count + 2).ToString()); + // Microsoft.Office.Interop.Excel.Range DrangeFirst = ws.get_Range("A3"); + // DrangeFirst.Value2 = 1; + // Drange.DataSeries(Missing.Value, Microsoft.Office.Interop.Excel.XlDataSeriesType.xlDataSeriesLinear, Microsoft.Office.Interop.Excel.XlDataSeriesDate.xlDay, 1, Count, false); + + + // ////设置日期格式 + // ////int index = SourceTable.Columns["生产日期"].Ordinal + 1; + // //Microsoft.Office.Interop.Excel.Range rangeDate = ws.get_Range("H3", "H" + (Count + 2).ToString()); + // //rangeDate.NumberFormatLocal = @"yyyy-mm-dd hh:mm";//日期型格式 + + // Microsoft.Office.Interop.Excel.Range RangeOfAll = ws.get_Range("A3", LastCol + (Count + 2).ToString()); + // RangeOfAll.Borders.LineStyle = 1; //设置单元格边框的粗细 + // RangeOfAll.HorizontalAlignment = Microsoft.Office.Interop.Excel.XlHAlign.xlHAlignCenter; + // RangeOfAll.EntireColumn.AutoFit(); //自动调整列宽 + + //} + //catch (Exception ex) + //{ + // string str = ex.Message; + //} + //finally + //{ + // wb.Saved = true; + // wb.SaveCopyAs(fileName);//保存 + // //excel.SaveWorkspace(fileName); + // //app.Quit();//关闭进程 + // wb.Close(); + // excel.Quit(); + // GC.Collect(); + + //} + } + + + /// + /// 字段名称各个字符中间增加回车,以保证文本竖着书写。 + /// + /// + /// + private static string GetColumnName_Ver(string columnName) + { + string columnName_tr; + columnName_tr = ""; + for (int i = 0; i < columnName.Length; i++) + { + columnName_tr = columnName_tr + columnName[i] + Environment.NewLine; + } + return columnName_tr; + } + + /// + /// 将图片转换为字节数组 + /// + /// 图片的路径 + /// 字节数组 + public static byte[] PicToByteArr(string path) + { + System.IO.FileStream fs = new System.IO.FileStream(path,System.IO.FileMode.Open);//将图片写入流中。 + int filelength = 0; + filelength = (int)fs.Length; //获得文件长度 + Byte[] byteArr = new Byte[filelength]; //建树一个字节数组 + fs.Read(byteArr,0,filelength); //按字节俭读取 + fs.Close(); + return byteArr; + } + + /// + /// 参数是byte返回图片 + /// + /// 字节数组 + /// 图片 + public static System.Drawing.Image ReturnPhoto(byte[] byteArr) + { + System.IO.MemoryStream ms = new System.IO.MemoryStream(byteArr); + System.Drawing.Image img = System.Drawing.Image.FromStream(ms); + ms.Close(); + return img; + } + + + /// + /// 根据列和行号得到最终 + /// + /// + /// + /// + public static string GetLastCellName(int ColCount) + { + string LastCellName = String.Empty; + switch (ColCount) + { + case 1: + LastCellName = "A"; + break; + case 2: + LastCellName = "B"; + break; + case 3: + LastCellName = "C"; + break; + case 4: + LastCellName = "D"; + break; + case 5: + LastCellName = "E"; + break; + case 6: + LastCellName = "F"; + break; + case 7: + LastCellName = "G"; + break; + case 8: + LastCellName = "H"; + break; + case 9: + LastCellName = "I"; + break; + case 10: + LastCellName = "J"; + break; + case 11: + LastCellName = "K"; + break; + case 12: + LastCellName = "L"; + break; + case 13: + LastCellName = "M"; + break; + case 14: + LastCellName = "N"; + break; + case 15: + LastCellName = "O"; + break; + case 16: + LastCellName = "P"; + break; + case 17: + LastCellName = "Q"; + break; + case 18: + LastCellName = "R"; + break; + case 19: + LastCellName = "S"; + break; + case 20: + LastCellName = "T"; + break; + case 21: + LastCellName = "U"; + break; + case 22: + LastCellName = "V"; + break; + case 23: + LastCellName = "W"; + break; + case 24: + LastCellName = "X"; + break; + case 25: + LastCellName = "Y"; + break; + case 26: + LastCellName = "Z"; + break; + default: break; + } + return LastCellName; + } + + +} diff --git a/App_code/DownLoadFromServer.cs b/App_code/DownLoadFromServer.cs new file mode 100644 index 0000000..6ca57a7 --- /dev/null +++ b/App_code/DownLoadFromServer.cs @@ -0,0 +1,69 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Web; +using System.IO; + +/// +///DownLoadFromServer 的摘要说明 +/// +public class DownLoadFromServer +{ + /// + /// 从服务器下载 + /// + public DownLoadFromServer() + { + // + //TODO: 在此处添加构造函数逻辑 + // + } + /// + /// 下载Excele文件 + /// + /// 服务器存放Excel路径 + public static void DownLoad(ref string ServerPath) + { + try + { + System.IO.FileInfo file = new System.IO.FileInfo(ServerPath); + if (file.Exists == true) + { + System.Web.HttpContext.Current.Response.Clear(); + System.Web.HttpContext.Current.Response.Charset = "GB2312"; + System.Web.HttpContext.Current.Response.ContentEncoding = System.Text.Encoding.UTF8; + // 添加头信息,为"文件下载/另存为"对话框指定默认文件名 + System.Web.HttpContext.Current.Response.AddHeader("Content-Disposition", "attachment; filename=" + System.Web.HttpContext.Current.Server.UrlEncode("Sheet1.xlsx")); + // 添加头信息,指定文件大小,让浏览器能够显示下载进度 + System.Web.HttpContext.Current.Response.AddHeader("Content-Length", file.Length.ToString()); + // 指定返回的是一个不能被客户端读取的流,必须被下载 + System.Web.HttpContext.Current.Response.ContentType = "application/ms-excel"; + // 把文件流发送到客户端 + System.Web.HttpContext.Current.Response.WriteFile(file.FullName); + // 停止页面的执行 + //Response.End(); + System.Web.HttpContext.Current.Response.Flush(); + //System.Web.HttpContext.Current.Response.End(); + HttpContext.Current.ApplicationInstance.CompleteRequest(); + } + else + { + System.Web.HttpContext.Current.Response.Write(""); + } + } + catch (Exception ex) + { + System.Web.HttpContext.Current.Response.Write(""); + } + } + + public static void DeleteExcel(ref string ServerPath) + { + System.IO.FileInfo file = new System.IO.FileInfo(ServerPath); + if (file.Exists == true) + { + File.Delete(ServerPath); + } + } + +} \ No newline at end of file diff --git a/App_code/DrawPicture.cs.2.exclude b/App_code/DrawPicture.cs.2.exclude new file mode 100644 index 0000000..a616272 --- /dev/null +++ b/App_code/DrawPicture.cs.2.exclude @@ -0,0 +1,1177 @@ +namespace SPC.WebUI +{ + using System; + using System.Data; + using System.Drawing; + using System.Drawing.Imaging; + using System.Web; + using System.Web.UI; + using System.Web.UI.WebControls; + using System.Xml; + using SPC.SystemFrameworks; + + using ASPNet_Drawing; + /// + /// DrawPicture ժҪ˵ + /// + public class DrawPicture + { + private Graph obGraph = null; + /// + /// ͼ + /// + public Bitmap DrawTrendChart(DataTable[] mytable,String[] trendName,out Unit height,out Unit width) + { + try + { + obGraph = new Spc_Trend_Graph2D(); + obGraph.HasXAxisLabel = true; + obGraph.HasYAxisLabel = true; + obGraph.XAxisLabel = " "; + obGraph.YAxisLabel = " ֵ"; + + obGraph.LoadAndSetGraph(); + height = obGraph.Height; + width = obGraph.Width; + + StatisticalFunction myStatisticalFunction = new StatisticalFunction( mytable, 2 ,trendName); + XmlDataDocument mydocument_Trend; + + myStatisticalFunction.SPC_Trend(out mydocument_Trend); + obGraph.HasLegends = true; + obGraph.SetGraphData (mydocument_Trend); + + obGraph.DrawGraph(ImageFormat.Jpeg); + return obGraph.m_obBitmap; + } + catch(Exception err) + { + ApplicationLog.WriteLog(err,"ͼ"); + height = 0; + width = 0; + return null; + } + + } + /// + /// ϸƷͼ + /// + public Bitmap DrawNPChart(DataTable newTable,out Unit height,out Unit width) + { + try + { + obGraph = new Spc_NP_Graph2D(); + obGraph.HasXAxisLabel = true; + obGraph.HasYAxisLabel = true; + obGraph.XAxisLabel = " "; + obGraph.YAxisLabel = "ϸƷ"; + + obGraph.LoadAndSetGraph(); + height = obGraph.Height; + width = obGraph.Width; + + StatisticalFunction myStatisticalFunction = new StatisticalFunction( newTable, 1 ); + XmlDataDocument mydocument_NP ; + myStatisticalFunction.SPC_NP(out mydocument_NP); + + //Ĵͼ + obGraph.SetGraphData (mydocument_NP); + + obGraph.DrawGraph(ImageFormat.Jpeg); + + return obGraph.m_obBitmap; + } + catch(Exception err) + { + ApplicationLog.WriteLog(err,"ͼ"); + height = 0; + width = 0; + return null; + } + + } + /// + /// ϸƷʿͼ + /// + public Bitmap DrawPChart(DataTable newTable,out Unit height,out Unit width) + { + try + { + obGraph = new Spc_P_Graph2D(); + obGraph.HasXAxisLabel = true; + obGraph.HasYAxisLabel = true; + obGraph.XAxisLabel = " "; + obGraph.YAxisLabel = "ϸƷ"; + + obGraph.LoadAndSetGraph(); + height = obGraph.Height; + width = obGraph.Width; + + StatisticalFunction myStatisticalFunction = new StatisticalFunction( newTable, 1 ); + XmlDataDocument mydocument_P ; + + myStatisticalFunction.SPC_P(out mydocument_P); + + obGraph.SetGraphData (mydocument_P); + + obGraph.DrawGraph(ImageFormat.Jpeg); + + return obGraph.m_obBitmap; + } + catch(Exception err) + { + ApplicationLog.WriteLog(err,"ͼ"); + height = 0; + width = 0; + return null; + } + + } + /// + /// ˮƽͼ + /// + public Bitmap DrawXZChart(DataTable newTable,out Unit height,out Unit width) + { + try + { + obGraph = new Spc_XZ_Graph2D(); + obGraph.HasXAxisLabel = true; + obGraph.HasYAxisLabel = true; + obGraph.XAxisLabel = " "; + obGraph.YAxisLabel = " ֵ"; + + obGraph.LoadAndSetGraph(); + height = obGraph.Height; + width = obGraph.Width; + + StatisticalFunction myStatisticalFunction = new StatisticalFunction( newTable, 2 ); + XmlDataDocument mydocument_H ; + myStatisticalFunction.SPC_H(out mydocument_H); + + obGraph.SetGraphData (mydocument_H); + + obGraph.DrawGraph(ImageFormat.Jpeg); + return obGraph.m_obBitmap; + } + catch(Exception err) + { + ApplicationLog.WriteLog(err,"ͼ"); + height = 0; + width = 0; + return null; + } + + } + /// + /// ˮƽͼ + /// + public Bitmap DrawXZChart(DataTable newTable,string columnName,out Unit height,out Unit width) + { + try + { + obGraph = new Spc_XZ_Graph2D(); + obGraph.HasXAxisLabel = true; + obGraph.HasYAxisLabel = true; + obGraph.XAxisLabel = " "; + obGraph.YAxisLabel = " ֵ"; + + obGraph.LoadAndSetGraph(); + height = obGraph.Height; + width = obGraph.Width; + + StatisticalFunction myStatisticalFunction = new StatisticalFunction( newTable, columnName ); + XmlDataDocument mydocument_H ; + myStatisticalFunction.SPC_H(out mydocument_H); + + obGraph.SetGraphData (mydocument_H); + + obGraph.DrawGraph(ImageFormat.Jpeg); + return obGraph.m_obBitmap; + } + catch(Exception err) + { + ApplicationLog.WriteLog(err,"ͼ"); + height = 0; + width = 0; + return null; + } + + } + /// + /// ֱͼ + /// + public Bitmap DrawBARChart(DataTable newTable,out Unit height,out Unit width,out XmlDataDocument xmlDocument) + { + try + { + obGraph = new Spc_Bar_Graph2D(); + + obGraph.HasXAxisLabel = true; + obGraph.HasYAxisLabel = true; + obGraph.XAxisLabel = "ݷ"; + obGraph.YAxisLabel = "ݵƵֲ"; + + obGraph.LoadAndSetGraph(); + height = obGraph.Height; + width = obGraph.Width; + + StatisticalFunction myStatisticalFunction = new StatisticalFunction( newTable, 1 ); + myStatisticalFunction.SPC_Bar(out xmlDocument); + + obGraph.SetGraphData (xmlDocument); + + obGraph.DrawGraph(ImageFormat.Jpeg); + return obGraph.m_obBitmap; + } + catch(Exception err) + { + ApplicationLog.WriteLog(err,"ֱͼ"); + xmlDocument = null; + height = 0; + width = 0; + return null; + } + + } + /// + /// ֱͼ޷ֵ + /// + public Bitmap DrawBARChart(DataTable newTable,out Unit height,out Unit width) + { + try + { + XmlDataDocument xmlDocument; + obGraph = new Spc_Bar_Graph2D(); + + obGraph.HasXAxisLabel = true; + obGraph.HasYAxisLabel = true; + obGraph.XAxisLabel = "ݷ"; + obGraph.YAxisLabel = "ݵƵֲ"; + + obGraph.LoadAndSetGraph(); + height = obGraph.Height; + width = obGraph.Width; + + StatisticalFunction myStatisticalFunction = new StatisticalFunction( newTable, 1 ); + myStatisticalFunction.SPC_Bar(out xmlDocument); + + obGraph.SetGraphData (xmlDocument); + + obGraph.DrawGraph(ImageFormat.Jpeg); + return obGraph.m_obBitmap; + } + catch(Exception err) + { + ApplicationLog.WriteLog(err,"ֱͼ޷ֵ"); + height = 0; + width = 0; + return null; + } + + } + /// + /// ֵ-ͼ + /// + public Bitmap DrawXRChart(DataTable newTable,int Spc_GroupCount,out Unit height,out Unit width,out XmlDataDocument xmlDocument_X,out XmlDataDocument xmlDocument_R) + { + try + { + obGraph = new Spc_XR_Graph2D(); + StatisticalFunction myStatisticalFunction = new StatisticalFunction( newTable, 1 ); + + Spc_XR_Graph2D obGraphXR = new Spc_XR_Graph2D(); + + obGraphXR.HasXAxisLabel = true; + obGraphXR.HasYAxisLabel = true; + obGraphXR.XAxisLabel = " "; + obGraphXR.YAxisLabel = " ֵ"; + + //ÿؼĸ߶ȣʹ֮XMLļһ + obGraphXR.LoadAndSetGraph(); + myStatisticalFunction.SPC_XR(Spc_GroupCount,obGraphXR.Spc_XR_X_Digits,obGraphXR.Spc_XR_R_Digits ,out xmlDocument_X,out xmlDocument_R); + + height = obGraphXR.Height; + width = obGraphXR.Width; + + obGraphXR.Width = obGraphXR.Width; + obGraphXR.Height = obGraphXR.Height/2; + obGraphXR.SetGraphData (xmlDocument_X); + + obGraphXR.Title = "ֵͼ"; + obGraphXR.DrawGraph(ImageFormat.Jpeg); + Bitmap m_obBitmap1 = obGraphXR.m_obBitmap; + + + obGraphXR = new Spc_XR_Graph2D(); + obGraphXR.HasXAxisLabel = true; + obGraphXR.HasYAxisLabel = true; + obGraphXR.XAxisLabel = " "; + obGraphXR.YAxisLabel = " "; + + obGraphXR.LoadAndSetGraph(); + + obGraphXR.Width = obGraphXR.Width; + obGraphXR.Height = obGraphXR.Height/2; + obGraphXR.SetGraphData (xmlDocument_R); + + obGraphXR.Title = "ͼ"; + obGraphXR.DrawGraph(ImageFormat.Jpeg); + Bitmap m_obBitmap2 = obGraphXR.m_obBitmap; + + //ͼεճͼʱֻҪٺϳɾͿ + Bitmap mybBitmap = new Bitmap(obGraphXR.Width, obGraphXR.Height * 2); + Graphics mybGraphics = Graphics.FromImage(mybBitmap); + mybGraphics.DrawImage(m_obBitmap1,0,0,obGraphXR.Width,obGraphXR.Height); + mybGraphics.DrawImage(m_obBitmap2,0,obGraphXR.Height,obGraphXR.Width,obGraphXR.Height); + + obGraph.m_obBitmap = mybBitmap; + + if( m_obBitmap1 != null ) + m_obBitmap1.Dispose(); + if( m_obBitmap2 != null ) + m_obBitmap2.Dispose(); + + return obGraph.m_obBitmap; + } + catch(Exception err) + { + ApplicationLog.WriteLog(err," ֵ-ͼ"); + xmlDocument_X = null; + xmlDocument_R= null; + height = 0; + width = 0; + return null; + } + + } + /// + /// ֵ-ͼ޷ֵ + /// + public Bitmap DrawXRChart(DataTable newTable,out Unit height,out Unit width) + { + try + { + XmlDataDocument xmlDocument_X,xmlDocument_R; + int Spc_GroupCount = 5; + obGraph = new Spc_XR_Graph2D(); + StatisticalFunction myStatisticalFunction = new StatisticalFunction( newTable, 1 ); + + Spc_XR_Graph2D obGraphXR = new Spc_XR_Graph2D(); + + obGraphXR.HasXAxisLabel = true; + obGraphXR.HasYAxisLabel = true; + obGraphXR.XAxisLabel = " "; + obGraphXR.YAxisLabel = " ֵ"; + + //ÿؼĸ߶ȣʹ֮XMLļһ + obGraphXR.LoadAndSetGraph(); + myStatisticalFunction.SPC_XR(Spc_GroupCount,obGraphXR.Spc_XR_X_Digits,obGraphXR.Spc_XR_R_Digits ,out xmlDocument_X,out xmlDocument_R); + + height = obGraphXR.Height; + width = obGraphXR.Width; + + obGraphXR.Width = obGraphXR.Width; + obGraphXR.Height = obGraphXR.Height/2; + obGraphXR.SetGraphData (xmlDocument_X); + + obGraphXR.Title = "ֵͼ"; + obGraphXR.DrawGraph(ImageFormat.Jpeg); + Bitmap m_obBitmap1 = obGraphXR.m_obBitmap; + + + obGraphXR = new Spc_XR_Graph2D(); + obGraphXR.HasXAxisLabel = true; + obGraphXR.HasYAxisLabel = true; + obGraphXR.XAxisLabel = " "; + obGraphXR.YAxisLabel = " "; + + obGraphXR.LoadAndSetGraph(); + + obGraphXR.Width = obGraphXR.Width; + obGraphXR.Height = obGraphXR.Height/2; + obGraphXR.SetGraphData (xmlDocument_R); + + obGraphXR.Title = "ͼ"; + obGraphXR.DrawGraph(ImageFormat.Jpeg); + Bitmap m_obBitmap2 = obGraphXR.m_obBitmap; + + //ͼεճͼʱֻҪٺϳɾͿ + Bitmap mybBitmap = new Bitmap(obGraphXR.Width, obGraphXR.Height * 2); + Graphics mybGraphics = Graphics.FromImage(mybBitmap); + mybGraphics.DrawImage(m_obBitmap1,0,0,obGraphXR.Width,obGraphXR.Height); + mybGraphics.DrawImage(m_obBitmap2,0,obGraphXR.Height,obGraphXR.Width,obGraphXR.Height); + + obGraph.m_obBitmap = mybBitmap; + + if( m_obBitmap1 != null ) + m_obBitmap1.Dispose(); + if( m_obBitmap2 != null ) + m_obBitmap2.Dispose(); + + return obGraph.m_obBitmap; + } + catch(Exception err) + { + ApplicationLog.WriteLog(err,"ֵ-ͼ޷ֵ"); + height = 0; + width = 0; + return null; + } + + } + /// + /// ֵ-ƫͼ + /// + public Bitmap DrawXSChart(DataTable newTable,int Spc_GroupCount,out Unit height,out Unit width,out XmlDataDocument xmlDocument_X,out XmlDataDocument xmlDocument_S) + { + try + { + obGraph = new Spc_XR_Graph2D(); + StatisticalFunction myStatisticalFunction = new StatisticalFunction( newTable, 1 ); + + //Ĵͼ + Spc_XS_Graph2D obGraphXR = new Spc_XS_Graph2D(); + obGraphXR.HasXAxisLabel = true; + obGraphXR.HasYAxisLabel = true; + obGraphXR.XAxisLabel = " "; + obGraphXR.YAxisLabel = " ֵ"; + + obGraphXR.LoadAndSetGraph(); + myStatisticalFunction.SPC_XS(Spc_GroupCount,obGraphXR.Spc_XS_X_Digits,obGraphXR.Spc_XS_S_Digits,out xmlDocument_X,out xmlDocument_S); + + height = obGraphXR.Height; + width = obGraphXR.Width; + + obGraphXR.Width = obGraphXR.Width; + obGraphXR.Height = obGraphXR.Height/2; + obGraphXR.SetGraphData (xmlDocument_X); + + obGraphXR.Title = "ֵͼ"; + obGraphXR.DrawGraph(ImageFormat.Jpeg); + Bitmap m_obBitmap1 = obGraphXR.m_obBitmap; + + obGraphXR = new Spc_XS_Graph2D(); + obGraphXR.HasXAxisLabel = true; + obGraphXR.HasYAxisLabel = true; + obGraphXR.XAxisLabel = " "; + obGraphXR.YAxisLabel = "ƫ ֵ"; + + obGraphXR.LoadAndSetGraph(); + + obGraphXR.Width = obGraphXR.Width; + obGraphXR.Height = obGraphXR.Height/2; + obGraphXR.SetGraphData (xmlDocument_S); + + obGraphXR.Title = "ƫͼ"; + obGraphXR.DrawGraph(ImageFormat.Jpeg); + Bitmap m_obBitmap2 = obGraphXR.m_obBitmap; + + //ͼεճͼʱֻҪٺϳɾͿ + Bitmap mybBitmap = new Bitmap(obGraphXR.Width, obGraphXR.Height * 2); + Graphics mybGraphics = Graphics.FromImage(mybBitmap); + mybGraphics.DrawImage(m_obBitmap1,0,0,obGraphXR.Width,obGraphXR.Height); + mybGraphics.DrawImage(m_obBitmap2,0,obGraphXR.Height,obGraphXR.Width,obGraphXR.Height); + obGraph.m_obBitmap = mybBitmap; + + if( m_obBitmap1 != null ) + m_obBitmap1.Dispose(); + if( m_obBitmap2 != null ) + m_obBitmap2.Dispose(); + + return obGraph.m_obBitmap; + } + catch(Exception err) + { + ApplicationLog.WriteLog(err,"ֵ-ƫͼ"); + xmlDocument_X = null; + xmlDocument_S = null; + height = 0; + width = 0; + return null; + } + + } + /// + /// ֵ-ƫͼ޷ֵ + /// + public Bitmap DrawXSChart(DataTable newTable,out Unit height,out Unit width) + { + try + { + XmlDataDocument xmlDocument_X,xmlDocument_S; + int Spc_GroupCount = 5; + obGraph = new Spc_XR_Graph2D(); + StatisticalFunction myStatisticalFunction = new StatisticalFunction( newTable, 1 ); + + //Ĵͼ + Spc_XS_Graph2D obGraphXR = new Spc_XS_Graph2D(); + obGraphXR.HasXAxisLabel = true; + obGraphXR.HasYAxisLabel = true; + obGraphXR.XAxisLabel = " "; + obGraphXR.YAxisLabel = " ֵ"; + + obGraphXR.LoadAndSetGraph(); + myStatisticalFunction.SPC_XS(Spc_GroupCount,obGraphXR.Spc_XS_X_Digits,obGraphXR.Spc_XS_S_Digits,out xmlDocument_X,out xmlDocument_S); + + height = obGraphXR.Height; + width = obGraphXR.Width; + + obGraphXR.Width = obGraphXR.Width; + obGraphXR.Height = obGraphXR.Height/2; + obGraphXR.SetGraphData (xmlDocument_X); + + obGraphXR.Title = "ֵͼ"; + obGraphXR.DrawGraph(ImageFormat.Jpeg); + Bitmap m_obBitmap1 = obGraphXR.m_obBitmap; + + obGraphXR = new Spc_XS_Graph2D(); + obGraphXR.HasXAxisLabel = true; + obGraphXR.HasYAxisLabel = true; + obGraphXR.XAxisLabel = " "; + obGraphXR.YAxisLabel = "ƫ ֵ"; + + obGraphXR.LoadAndSetGraph(); + + obGraphXR.Width = obGraphXR.Width; + obGraphXR.Height = obGraphXR.Height/2; + obGraphXR.SetGraphData (xmlDocument_S); + + obGraphXR.Title = "ƫͼ"; + obGraphXR.DrawGraph(ImageFormat.Jpeg); + Bitmap m_obBitmap2 = obGraphXR.m_obBitmap; + + //ͼεճͼʱֻҪٺϳɾͿ + Bitmap mybBitmap = new Bitmap(obGraphXR.Width, obGraphXR.Height * 2); + Graphics mybGraphics = Graphics.FromImage(mybBitmap); + mybGraphics.DrawImage(m_obBitmap1,0,0,obGraphXR.Width,obGraphXR.Height); + mybGraphics.DrawImage(m_obBitmap2,0,obGraphXR.Height,obGraphXR.Width,obGraphXR.Height); + obGraph.m_obBitmap = mybBitmap; + + if( m_obBitmap1 != null ) + m_obBitmap1.Dispose(); + if( m_obBitmap2 != null ) + m_obBitmap2.Dispose(); + + return obGraph.m_obBitmap; + } + catch(Exception err) + { + ApplicationLog.WriteLog(err,"ֵ-ƫͼ޷ֵ"); + height = 0; + width = 0; + return null; + } + + } + /// + /// ͼ + /// + public Bitmap DrawPLChart(DataTable newTable,out Unit height,out Unit width) + { + try + { + obGraph = new Spc_PL_Graph2D(); + obGraph.HasXAxisLabel = true; + obGraph.HasYAxisLabel = false; + obGraph.XAxisLabel = " "; + + obGraph.LoadAndSetGraph(); + height = obGraph.Height; + width = obGraph.Width; + + + StatisticalFunction myStatisticalFunction = new StatisticalFunction( newTable, 2 ); + XmlDataDocument mydocument_PL ; + + myStatisticalFunction.SPC_PL(out mydocument_PL); + + obGraph.SetGraphData (mydocument_PL); + + obGraph.DrawGraph(ImageFormat.Jpeg); + + return obGraph.m_obBitmap; + } + catch(Exception err) + { + ApplicationLog.WriteLog(err,"ͼ"); + height = 0; + width = 0; + return null; + } + + } + /// + /// ͼ + /// + /// + public Bitmap DrawPIEChart(DataTable newTable,out Unit height,out Unit width) + { + try + { + obGraph = new Spc_Pie_Graph2D(); + obGraph.LoadAndSetGraph(); + height = obGraph.Height; + width = obGraph.Width; + + StatisticalFunction myStatisticalFunction = new StatisticalFunction( newTable, 2 ); + XmlDataDocument mydocument_Pie ;//= new XmlDataDocument(); + myStatisticalFunction.SPC_Pie(out mydocument_Pie); + + obGraph.SetGraphData (mydocument_Pie); + + obGraph.DrawGraph(ImageFormat.Jpeg); + return obGraph.m_obBitmap; + } + catch(Exception err) + { + ApplicationLog.WriteLog(err,"ͼ"); + height = 0; + width = 0; + return null; + } + } + /// + /// + /// + public Bitmap DrawGXNL(DataTable newTable,out Unit height,out Unit width,double m_GXNL_UpParam,double m_GXNL_DownParam, + out XmlDataDocument xmlDocument,out string[] m_Spc_GXNL_Param) + { + try + { + obGraph = new Spc_GXNL_Graph2D(); + + Spc_GXNL_Graph2D obGraph_GXNL = new Spc_GXNL_Graph2D(); + obGraph_GXNL.HasXAxisLabel = true; + obGraph_GXNL.HasYAxisLabel = false; + obGraph_GXNL.XAxisLabel = "ݷ"; + + StatisticalFunction myStatisticalFunction = new StatisticalFunction( newTable, 1 ); + + obGraph_GXNL.LoadAndSetGraph(); + myStatisticalFunction.GXNL_Analysis( m_GXNL_UpParam,m_GXNL_DownParam,obGraph_GXNL.Spc_GXNL_ParamDigits, + out xmlDocument,out m_Spc_GXNL_Param); + + //زȷͼĴС + height = obGraph_GXNL.Height; + width = obGraph_GXNL.Width; + obGraph_GXNL.SetGraphData (xmlDocument); + + obGraph_GXNL.DrawGraph(ImageFormat.Jpeg); + + obGraph.m_obBitmap = obGraph_GXNL.m_obBitmap; + return obGraph.m_obBitmap; + } + catch(Exception err) + { + ApplicationLog.WriteLog(err,""); + xmlDocument = null; + m_Spc_GXNL_Param = null; + height = 0; + width = 0; + return null; + } + + } + + /// + /// + /// + /// ݱ + /// ݵ + /// ߶ + /// + /// + /// + /// ݵĵ + /// б + /// + public Bitmap DrawGXNL(DataTable newTable,string columnName,out Unit height,out Unit width,double m_GXNL_UpParam,double m_GXNL_DownParam, + out XmlDataDocument xmlDocument,out string[] m_Spc_GXNL_Param) + { + try + { + obGraph = new Spc_GXNL_Graph2D(); + + Spc_GXNL_Graph2D obGraph_GXNL = new Spc_GXNL_Graph2D(); + obGraph_GXNL.HasXAxisLabel = true; + obGraph_GXNL.HasYAxisLabel = false; + obGraph_GXNL.XAxisLabel = "ݷ"; + + StatisticalFunction myStatisticalFunction = new StatisticalFunction( newTable, columnName ); + + obGraph_GXNL.LoadAndSetGraph(); + + if(myStatisticalFunction.GXNL_Analysis( m_GXNL_UpParam,m_GXNL_DownParam,obGraph_GXNL.Spc_GXNL_ParamDigits, + out xmlDocument,out m_Spc_GXNL_Param)) + { + + //زȷͼĴС + height = obGraph_GXNL.Height; + width = obGraph_GXNL.Width; + obGraph_GXNL.SetGraphData (xmlDocument); + + obGraph_GXNL.DrawGraph(ImageFormat.Jpeg); + + obGraph.m_obBitmap = obGraph_GXNL.m_obBitmap; + return obGraph.m_obBitmap; + } + else + { + height = 0; + width = 0; + m_Spc_GXNL_Param = null; + return null; + + } + } + catch(Exception err) + { + ApplicationLog.WriteLog(err,""); + xmlDocument = null; + m_Spc_GXNL_Param = null; + height = 0; + width = 0; + return null; + } + + } + /// + /// ޷ֵ + /// + public Bitmap DrawGXNL(DataTable newTable,out Unit height,out Unit width,double m_GXNL_UpParam,double m_GXNL_DownParam) + { + try + { + XmlDataDocument xmlDocument; + string[] m_Spc_GXNL_Param; + obGraph = new Spc_GXNL_Graph2D(); + + Spc_GXNL_Graph2D obGraph_GXNL = new Spc_GXNL_Graph2D(); + obGraph_GXNL.HasXAxisLabel = true; + obGraph_GXNL.HasYAxisLabel = false; + obGraph_GXNL.XAxisLabel = "ݷ"; + + StatisticalFunction myStatisticalFunction = new StatisticalFunction( newTable, 1 ); + + obGraph_GXNL.LoadAndSetGraph(); + myStatisticalFunction.GXNL_Analysis( m_GXNL_UpParam,m_GXNL_DownParam,obGraph_GXNL.Spc_GXNL_ParamDigits, + out xmlDocument,out m_Spc_GXNL_Param); + + //زȷͼĴС + height = obGraph_GXNL.Height; + width = obGraph_GXNL.Width; + obGraph_GXNL.SetGraphData (xmlDocument); + + obGraph_GXNL.DrawGraph(ImageFormat.Jpeg); + + obGraph.m_obBitmap = obGraph_GXNL.m_obBitmap; + return obGraph.m_obBitmap; + } + catch(Exception err) + { + ApplicationLog.WriteLog(err,"޷ֵ"); + height = 0; + width = 0; + return null; + } + + } + /// + /// Ƴͼ + /// + /// + public Bitmap DrawGroupBarChart(DataTable newTable,out Unit height,out Unit width) + { + try + { + obGraph = new Spc_GroupBarGraph2D(); + obGraph.Title = "ȫ豸Чͳ"; + obGraph.HasGridLines = false; + obGraph.HasLegends = true; + + ((Spc_GroupBarGraph2D)obGraph).GraphAlignment = Alignment.Vertical; + + obGraph.LoadAndSetGraph(); + height = obGraph.Height; + width = obGraph.Width; + + StatisticalFunction myStatisticalFunction = new StatisticalFunction( newTable, 1 ); + XmlDataDocument mydocument_GroupBar ; + myStatisticalFunction.SPC_GroupBar(out mydocument_GroupBar); + + obGraph.SetGraphData (mydocument_GroupBar); + + obGraph.DrawGraph(ImageFormat.Jpeg); + return obGraph.m_obBitmap; + } + catch(Exception err) + { + ApplicationLog.WriteLog(err,"Ƴͼ"); + height = 0; + width = 0; + return null; + } + } + + /// + /// ݵͼxmlļ + /// + /// ݱ + /// + /// ߶ + /// + /// ݵxmlļ + /// + static public Bitmap DrawCustomBarChart(DataTable newTable,string textColumnName,string dataColumnName,out Unit height,out Unit width,out XmlDataDocument mydocument_CustomBar) + { + try + { + obGraph = new Spc_CustomBar_Graph2D(); + obGraph.HasXAxisLabel = true; + obGraph.HasYAxisLabel = false; + obGraph.XAxisLabel = " "; + + obGraph.LoadAndSetGraph(); + height = obGraph.Height; + width = obGraph.Width; + + StatisticalFunction myStatisticalFunction = new StatisticalFunction( newTable,textColumnName,dataColumnName ); + myStatisticalFunction.SPC_CustomBar(out mydocument_CustomBar); + obGraph.SetGraphData (mydocument_CustomBar); + + obGraph.DrawGraph(ImageFormat.Jpeg); + + return obGraph.m_obBitmap; + } + catch(Exception err) + { + ApplicationLog.WriteLog(err,"ݵͼxmlļ"); + mydocument_CustomBar = null; + height = 0; + width = 0; + return null; + } + + + } + /// + /// ݵͼ + /// + /// ݱ + /// + /// ߶ + /// + /// + public Bitmap DrawCustomBarChart(DataTable newTable,string textColumnName,string dataColumnName,out Unit height,out Unit width) + { + try + { + obGraph = new Spc_CustomBar_Graph2D(); + obGraph.HasXAxisLabel = true; + obGraph.HasYAxisLabel = false; + obGraph.XAxisLabel = " "; + + obGraph.LoadAndSetGraph(); + height = obGraph.Height; + width = obGraph.Width; + XmlDataDocument mydocument_CustomBar; + + StatisticalFunction myStatisticalFunction = new StatisticalFunction( newTable,textColumnName,dataColumnName ); + myStatisticalFunction.SPC_CustomBar(out mydocument_CustomBar); + obGraph.SetGraphData (mydocument_CustomBar); + + obGraph.DrawGraph(ImageFormat.Jpeg); + + return obGraph.m_obBitmap; + } + catch(Exception err) + { + ApplicationLog.WriteLog(err,"ݵͼ"); + height = 0; + width = 0; + return null; + } + + + } + /// + /// ݵֱͼ:xmlĵ + /// + /// ʵ + /// ݵ + /// + /// + /// ߶ + /// + /// + public Bitmap DrawCustomLineChart(DataTable newTable,string columnName,float UCL_Value,float LCL_Value,out Unit height,out Unit width,out XmlDataDocument xmlDocument) + { + try + { + Spc_CustomLine_Graph2D obGraph = new Spc_CustomLine_Graph2D(); + obGraph.Spc_CustomLine_UCL_Value = UCL_Value; + obGraph.Spc_CustomLine_LCL_Value= LCL_Value; + + StatisticalFunction myStatisticalFunction = new StatisticalFunction( newTable, columnName ); + obGraph.HasXAxisLabel = true; + obGraph.HasYAxisLabel = false; + obGraph.XAxisLabel = " "; + obGraph.YAxisLabel = " ֵ"; + + obGraph.LoadAndSetGraph(); + obGraph.Spc_CustomLine_UCL_Value = UCL_Value; + obGraph.Spc_CustomLine_LCL_Value = LCL_Value; + + myStatisticalFunction.UCL_Value = UCL_Value; + myStatisticalFunction.LCL_Value = LCL_Value; + + + height = obGraph.Height; + width = obGraph.Width; + + myStatisticalFunction.SPC_CustomLine( out xmlDocument ); + height = obGraph.Height; + width = obGraph.Width; + obGraph.SetGraphData (xmlDocument); + + obGraph.Title = " ͼ"; + + + obGraph.DrawGraph(ImageFormat.Jpeg); + return obGraph.m_obBitmap; + } + catch(Exception err) + { + ApplicationLog.WriteLog(err,"ݵֱͼ:xmlĵ"); + xmlDocument = null; + height = 0; + width = 0; + return null; + } + + } + /// + /// ݵֱͼ + /// + /// ʵ + /// + /// + /// ߶ + /// + /// + public Bitmap DrawCustomLineChart(DataTable newTable,float UCL_Value,float LCL_Value,out Unit height,out Unit width) + { + try + { + Spc_CustomLine_Graph2D obGraph = new Spc_CustomLine_Graph2D(); + StatisticalFunction myStatisticalFunction = new StatisticalFunction( newTable, 5 ); + + obGraph.HasXAxisLabel = true; + obGraph.HasYAxisLabel = false; + obGraph.XAxisLabel = " "; + obGraph.YAxisLabel = " ֵ"; + + obGraph.LoadAndSetGraph(); + + + height = obGraph.Height; + width = obGraph.Width; + + XmlDataDocument mydocument_CustomLine; + myStatisticalFunction.SPC_CustomLine( out mydocument_CustomLine ); + height = obGraph.Height; + width = obGraph.Width; + obGraph.SetGraphData (mydocument_CustomLine); + + obGraph.Title = " ͼ"; + + obGraph.Spc_CustomLine_LCL_Value= LCL_Value; + obGraph.Spc_CustomLine_UCL_Value = UCL_Value; + + obGraph.DrawGraph(ImageFormat.Jpeg); + return obGraph.m_obBitmap; + } + catch(Exception err) + { + ApplicationLog.WriteLog(err,"ݵֱͼ"); + height = 0; + width = 0; + return null; + } + + } + /// + /// ݵֱͼ:һ + /// + /// ݱ + /// ݵ + /// + /// + /// ߶ + /// + /// + public Bitmap DrawCustomLineChart(DataTable newTable,string columnName,float UCL_Value,float LCL_Value,out Unit height,out Unit width) + { + try + { + Spc_CustomLine_Graph2D obGraph = new Spc_CustomLine_Graph2D(); + StatisticalFunction myStatisticalFunction = new StatisticalFunction( newTable, 5 ); + + obGraph.HasXAxisLabel = true; + obGraph.HasYAxisLabel = false; + obGraph.XAxisLabel = " "; + obGraph.YAxisLabel = " ֵ"; + + obGraph.LoadAndSetGraph(); + + + height = obGraph.Height; + width = obGraph.Width; + + XmlDataDocument mydocument_CustomLine; + myStatisticalFunction.SPC_CustomLine( out mydocument_CustomLine ); + height = obGraph.Height; + width = obGraph.Width; + obGraph.SetGraphData (mydocument_CustomLine); + + obGraph.Title = " ͼ"; + + obGraph.Spc_CustomLine_LCL_Value= LCL_Value; + obGraph.Spc_CustomLine_UCL_Value = UCL_Value; + + obGraph.DrawGraph(ImageFormat.Jpeg); + return obGraph.m_obBitmap; + } + catch(Exception err) + { + ApplicationLog.WriteLog(err,"ݵֱͼ:һ"); + height = 0; + width = 0; + return null; + } + } + /// + /// ݵֱͼ:ͼԵ + /// + /// ʵ + /// ʵ + /// ߶ + /// + /// + public Bitmap DrawCustomLineChart(DataTable newTable,string columnName,out Unit height,out Unit width) + { + try + { + Spc_CustomLine_Graph2D obGraph = new Spc_CustomLine_Graph2D(); + StatisticalFunction myStatisticalFunction = new StatisticalFunction( newTable, columnName ); + + obGraph.HasXAxisLabel = true; + obGraph.HasYAxisLabel = false; + obGraph.XAxisLabel = " "; + obGraph.YAxisLabel = " ֵ"; + + obGraph.LoadAndSetGraph(); + + + height = obGraph.Height; + width = obGraph.Width; + + XmlDataDocument mydocument_CustomLine; + myStatisticalFunction.SPC_CustomLine( out mydocument_CustomLine ); + height = obGraph.Height; + width = obGraph.Width; + obGraph.SetGraphData (mydocument_CustomLine); + + obGraph.Title = " ͼ"; + + // obGraph.Spc_CustomLine_LCL_Value= LCL_Value; + // obGraph.Spc_CustomLine_UCL_Value = UCL_Value; + + obGraph.DrawGraph(ImageFormat.Jpeg); + return obGraph.m_obBitmap; + } + catch(Exception err) + { + ApplicationLog.WriteLog(err,"ݵֱͼ:ͼԵ"); + height = 0; + width = 0; + return null; + } + } + /// + /// Ƴͼ + /// + /// + static public Bitmap DrawOEEChart(DataTable newTable,out Unit height,out Unit width) + { + try + { + obGraph = new Spc_OEEGraph2D(); + + obGraph.Title = "ȫ豸Чͳ"; + obGraph.HasGridLines = false; + obGraph.HasLegends = false; + + ((Spc_OEEGraph2D)obGraph).GraphAlignment = Alignment.Vertical; + + obGraph.LoadAndSetGraph(); + height = obGraph.Height; + width = obGraph.Width; + + StatisticalFunction myStatisticalFunction = new StatisticalFunction( newTable, 1 ); + XmlDataDocument mydocument_GroupBar ; + myStatisticalFunction.SPC_GroupBar(out mydocument_GroupBar); + + obGraph.SetGraphData (mydocument_GroupBar); + + obGraph.DrawGraph(ImageFormat.Jpeg); + return obGraph.m_obBitmap; + } + catch(Exception err) + { + ApplicationLog.WriteLog(err,"Ƴͼ"); + height = 0; + width = 0; + return null; + } + + } + /// + /// Ʋͼ + /// + /// + public Bitmap DrawStackBarChart(DataTable[] newTable,string[] trendName,out Unit height,out Unit width) + { + try + { + Spc_StackBar_Graph2D obGraph = new Spc_StackBar_Graph2D(); + obGraph.Title = "豸ʷ״̬ͳ"; + obGraph.HasGridLines = false; + obGraph.HasLegends = true; + + ((Spc_StackBar_Graph2D)obGraph).GraphAlignment = Alignment.Horizontal; + + obGraph.LoadAndSetGraph(); + height = obGraph.Height; + width = obGraph.Width; + + StatisticalFunction myStatisticalFunction = new StatisticalFunction( newTable, 2 ,trendName); + XmlDataDocument mydocument_StackBar ; + myStatisticalFunction.SPC_Trend(out mydocument_StackBar); + obGraph.SetGraphData (mydocument_StackBar); + + obGraph.DrawGraph(ImageFormat.Jpeg); + return obGraph.m_obBitmap; + } + catch(Exception err) + { + ApplicationLog.WriteLog(err,"Ʋͼ"); + height = 0; + width = 0; + return null; + } + + } + + } +} diff --git a/App_code/DrawPicture.cs.exclude b/App_code/DrawPicture.cs.exclude new file mode 100644 index 0000000..3415e21 --- /dev/null +++ b/App_code/DrawPicture.cs.exclude @@ -0,0 +1,29 @@ +using System; +using System.Data; +using System.Drawing; +using System.Drawing.Imaging; +using System.Web; +using System.Web.UI; +using System.Web.UI.WebControls; +using System.Xml; +using SPC.SystemFrameworks; + +using ASPNet_Drawing; + +namespace SPC.WebUI +{ + /// + ///DrawPicture 的摘要说明 + /// + public class DrawPicture + { + private Graph obGraph = null; + + public DrawPicture() + { + // + //TODO: 在此处添加构造函数逻辑 + // + } + } +} diff --git a/App_code/GetSQL_Output.cs b/App_code/GetSQL_Output.cs new file mode 100644 index 0000000..f1772e1 --- /dev/null +++ b/App_code/GetSQL_Output.cs @@ -0,0 +1,587 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Web; +using System.Data.SqlClient; +using System.Data; +using System.Collections; +using MES_SPC; + +/// +///GetSQL_Output 的摘要说明 +/// +public class GetSQL_Output +{//返回新的SQL语句 + public GetSQL_Output() + { + // + //TODO: 在此处添加构造函数逻辑 + // + } + //-----------------------专门由于导出excel数据量过多,而造成下载速度慢和打开excel慢而做的存储过程-------------------------------------------------------------------- + + + /// + /// 质量数据查询 + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + public static void SelectGoodDataReport_ADODB_New + (bool EnginIDCheck, string EnginID, + bool OPNameCheck, string OPName, + bool shaftNameCheck, string shaftName, + bool itemNameCheck, string itemName, + string startTime, string endTime, int isOK, bool Isuse, out string sql, out int Count,out int ColCount,out object[,] ColsArray) + { + try + { + string procedureName; + procedureName = "质量数据查询_综合查询_ReturnSql"; + DateTime dt_startTime; + DateTime dt_endTime; + dt_startTime = DateTime.Parse(startTime); + dt_endTime = DateTime.Parse(endTime); + + string constr = ApplicationConfiguration.ERP_ConnectionString; + SqlConnection conn = new SqlConnection(constr); + conn.Open(); + SqlCommand MyCommand = new SqlCommand(procedureName, conn); + MyCommand.CommandType = CommandType.StoredProcedure; + MyCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@发动机号_ischeck", EnginIDCheck)); + MyCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@发动机号", EnginID)); + MyCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@工位号_ischeck", OPNameCheck)); + MyCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@工位号", OPName)); + MyCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@测量位置_ischeck", shaftNameCheck)); + MyCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@测量位置", shaftName)); + MyCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@测量项目_ischeck", itemNameCheck)); + MyCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@测量项目", itemName)); + MyCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@开始时间", dt_startTime)); + MyCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@结束时间", dt_endTime)); + MyCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@合格标志", isOK.ToString())); + MyCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@是否禁用", Isuse)); + + MyCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@selectStr_OutPut", SqlDbType.NVarChar,4000)); + MyCommand.Parameters["@selectStr_OutPut"].Direction = ParameterDirection.Output; + + MyCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Count", SqlDbType.Int)); + MyCommand.Parameters["@Count"].Direction = ParameterDirection.Output; + + MyCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@ColsArray", SqlDbType.NVarChar, 4000)); + MyCommand.Parameters["@ColsArray"].Direction = ParameterDirection.Output; + + MyCommand.ExecuteNonQuery(); + + sql = Convert.ToString(MyCommand.Parameters["@selectStr_OutPut"].Value); + Count = Convert.ToInt32(MyCommand.Parameters["@Count"].Value);//返回SQL语句 + + + string[] ColsArrayString = Convert.ToString(MyCommand.Parameters["@ColsArray"].Value).Split('|'); ;//所有列名的集合 + ColsArray = new object[1, ColsArrayString.Length]; + for (int i = 0; i < ColsArrayString.Length; i++) + { + ColsArray[0, i] = ColsArrayString[i]; + } + ColCount = ColsArrayString.Length; + } + catch + { + sql = ""; + Count = 0; + ColsArray = null; + ColCount = 0; + } + } + + /// + /// 质量数据查询_数据备份_综合查询_ReturnSql + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + public static void SelectGoodDataReport_ADODB_New_DataBak + (bool EngineTypeCheck, string EngineType, bool EnginIDCheck, string EnginID, + bool OPNameCheck, string OPName, + bool shaftNameCheck, string shaftName, + bool itemNameCheck, string itemName, + string startTime, string endTime, int isOK, bool Isuse, out string sql, out int Count, out int ColCount, out object[,] ColsArray) + { + try + { + string procedureName; + procedureName = "质量数据查询_数据备份_综合查询_ReturnSql"; + DateTime dt_startTime; + DateTime dt_endTime; + dt_startTime = DateTime.Parse(startTime); + dt_endTime = DateTime.Parse(endTime); + + string constr = ApplicationConfiguration.ERP_ConnectionString; + SqlConnection conn = new SqlConnection(constr); + conn.Open(); + SqlCommand MyCommand = new SqlCommand(procedureName, conn); + MyCommand.CommandTimeout = 120; + MyCommand.CommandType = CommandType.StoredProcedure; + MyCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@发动机型号_ischeck", EngineTypeCheck)); + MyCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@发动机型号", EngineType)); + MyCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@发动机号_ischeck", EnginIDCheck)); + MyCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@发动机号", EnginID)); + MyCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@工位号_ischeck", OPNameCheck)); + MyCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@工位号", OPName)); + MyCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@测量位置_ischeck", shaftNameCheck)); + MyCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@测量位置", shaftName)); + MyCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@测量项目_ischeck", itemNameCheck)); + MyCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@测量项目", itemName)); + MyCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@开始时间", dt_startTime)); + MyCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@结束时间", dt_endTime)); + MyCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@合格标志", isOK.ToString())); + MyCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@是否禁用", Isuse)); + + MyCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@selectStr_OutPut", SqlDbType.NVarChar, 4000)); + MyCommand.Parameters["@selectStr_OutPut"].Direction = ParameterDirection.Output; + + MyCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Count", SqlDbType.Int)); + MyCommand.Parameters["@Count"].Direction = ParameterDirection.Output; + + MyCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@ColsArray", SqlDbType.NVarChar, 4000)); + MyCommand.Parameters["@ColsArray"].Direction = ParameterDirection.Output; + + MyCommand.ExecuteNonQuery(); + + sql = Convert.ToString(MyCommand.Parameters["@selectStr_OutPut"].Value); + Count = Convert.ToInt32(MyCommand.Parameters["@Count"].Value);//返回SQL语句 + + + string[] ColsArrayString = Convert.ToString(MyCommand.Parameters["@ColsArray"].Value).Split('|'); ;//所有列名的集合 + ColsArray = new object[1, ColsArrayString.Length]; + for (int i = 0; i < ColsArrayString.Length; i++) + { + ColsArray[0, i] = ColsArrayString[i]; + } + ColCount = ColsArrayString.Length; + } + catch + { + sql = ""; + Count = 0; + ColsArray = null; + ColCount = 0; + } + } + + /// + /// 工件总成质量数据报表 + /// 引用页QualityData_Query_2.aspx(质量数据导出excel) + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + public static void SelectGoodDataReport_2_ADODB_New + (bool EnginIDCheck, string EnginID, + bool OPNameCheck, string OPName, + bool engineTypeIDCheck, int engineTypeID, + bool itemNameCheck, string itemName, + string startTime, string endTime, int isOK, out string sql, out int Count,out int ColCount,out object[,] ColsArray) + { + try + { + string procedureName; + procedureName = "测量数据合格_合并_视图_查询_ReturnSql"; + DateTime dt_startTime; + DateTime dt_endTime; + dt_startTime = DateTime.Parse(startTime); + dt_endTime = DateTime.Parse(endTime); + + + string constr = ApplicationConfiguration.ERP_ConnectionString; + SqlConnection conn = new SqlConnection(constr); + conn.Open(); + SqlCommand MyCommand = new SqlCommand(procedureName, conn); + MyCommand.CommandType = CommandType.StoredProcedure; + + + MyCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@发动机号_ischeck", EnginIDCheck)); + MyCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@发动机号", EnginID)); + MyCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@工位号_ischeck", OPNameCheck)); + MyCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@工位号", OPName)); + MyCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@发动机型号代码_ischeck", engineTypeIDCheck)); + MyCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@发动机型号代码", engineTypeID)); + + MyCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@测量位置_ischeck", itemNameCheck)); + MyCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@测量位置", itemName)); + MyCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@开始时间", dt_startTime)); + MyCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@结束时间", dt_endTime)); + MyCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@总合格标志", isOK.ToString())); + + + MyCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@selectStr_OutPut", SqlDbType.NVarChar, 4000)); + MyCommand.Parameters["@selectStr_OutPut"].Direction = ParameterDirection.Output; + + MyCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Count", SqlDbType.Int)); + MyCommand.Parameters["@Count"].Direction = ParameterDirection.Output; + + MyCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@ColsArray", SqlDbType.NVarChar, 4000)); + MyCommand.Parameters["@ColsArray"].Direction = ParameterDirection.Output; + MyCommand.CommandTimeout = 120; + MyCommand.ExecuteNonQuery(); + + sql = Convert.ToString(MyCommand.Parameters["@selectStr_OutPut"].Value); + Count = Convert.ToInt32(MyCommand.Parameters["@Count"].Value);//返回SQL语句 + + + + string[] ColsArrayString = Convert.ToString(MyCommand.Parameters["@ColsArray"].Value).Split('|'); ;//所有列名的集合 + ColsArray = new object[1, ColsArrayString.Length]; + for (int i = 0; i < ColsArrayString.Length; i++) + { + ColsArray[0, i] = GetColumnName_Ver(ColsArrayString[i]); + } + + ColCount = ColsArrayString.Length; + } + catch + { + sql = ""; + Count = 0; + ColsArray = null; + ColCount = 0; + } + } + + /// + /// 不合格质量数据 + /// 引用页QualityData_Query_2.aspx + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + public static void SelectGoodDataReport_2_ADODB_New + (bool EnginIDCheck, string EnginID, + bool OPNameCheck, string OPName, + bool engineTypeIDCheck, int engineTypeID, + bool itemNameCheck, string itemName, + string startTime, string endTime, out string sql, out int Count, out int ColCount, out object[,] ColsArray) + { + try + { + string procedureName; + procedureName = "测量数据合格_合并_视图_不合格数据_查询_ReturnSql"; + DateTime dt_startTime; + DateTime dt_endTime; + dt_startTime = DateTime.Parse(startTime); + dt_endTime = DateTime.Parse(endTime); + + string constr = ApplicationConfiguration.ERP_ConnectionString; + SqlConnection conn = new SqlConnection(constr); + conn.Open(); + SqlCommand MyCommand = new SqlCommand(procedureName, conn); + MyCommand.CommandType = CommandType.StoredProcedure; + + + MyCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@发动机号_ischeck", EnginIDCheck)); + MyCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@发动机号", EnginID)); + MyCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@工位号_ischeck", OPNameCheck)); + MyCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@工位号", OPName)); + MyCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@发动机型号代码_ischeck", engineTypeIDCheck)); + MyCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@发动机型号代码", engineTypeID)); + + MyCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@测量位置_ischeck", itemNameCheck)); + MyCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@测量位置", itemName)); + MyCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@开始时间", dt_startTime)); + MyCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@结束时间", dt_endTime)); + + MyCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@selectStr_OutPut", SqlDbType.NVarChar, 4000)); + MyCommand.Parameters["@selectStr_OutPut"].Direction = ParameterDirection.Output; + + MyCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Count", SqlDbType.Int)); + MyCommand.Parameters["@Count"].Direction = ParameterDirection.Output; + + MyCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@ColsArray", SqlDbType.NVarChar, 4000)); + MyCommand.Parameters["@ColsArray"].Direction = ParameterDirection.Output; + + MyCommand.ExecuteNonQuery(); + + sql = Convert.ToString(MyCommand.Parameters["@selectStr_OutPut"].Value); + Count = Convert.ToInt32(MyCommand.Parameters["@Count"].Value);//返回SQL语句 + + + string[] ColsArrayString = Convert.ToString(MyCommand.Parameters["@ColsArray"].Value).Split('|'); ;//所有列名的集合 + ColsArray = new object[1, ColsArrayString.Length]; + for (int i = 0; i < ColsArrayString.Length; i++) + { + ColsArray[0, i] = GetColumnName_Ver(ColsArrayString[i]); + } + + ColCount = ColsArrayString.Length; + } + catch + { + sql = ""; + Count = 0; + ColsArray = null; + ColCount = 0; + } + } + + /// + /// 测量数据合格_变速器总成称重_报表 + /// + /// + /// + /// + /// + /// + /// + /// + public static void SelectGoodData_weight_Report_ADODB_New +(bool EnginIDCheck, string EnginID, + string startTime, string endTime, int isOK, out string sql, out int Count, out int ColCount, out object[,] ColsArray) + { + try + { + string procedureName; + procedureName = "测量数据合格_变速器总成称重_报表_ReturnSql"; + DateTime dt_startTime; + DateTime dt_endTime; + dt_startTime = DateTime.Parse(startTime); + dt_endTime = DateTime.Parse(endTime); + + string constr = ApplicationConfiguration.ERP_ConnectionString; + SqlConnection conn = new SqlConnection(constr); + conn.Open(); + SqlCommand MyCommand = new SqlCommand(procedureName, conn); + MyCommand.CommandType = CommandType.StoredProcedure; + + MyCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@发动机号_ischeck", EnginIDCheck)); + MyCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@发动机号", EnginID)); + MyCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@开始时间", dt_startTime)); + MyCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@结束时间", dt_endTime)); + MyCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@合格标志", isOK.ToString())); + + MyCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@selectStr_OutPut", SqlDbType.NVarChar, 4000)); + MyCommand.Parameters["@selectStr_OutPut"].Direction = ParameterDirection.Output; + + MyCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Count", SqlDbType.Int)); + MyCommand.Parameters["@Count"].Direction = ParameterDirection.Output; + + MyCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@ColsArray", SqlDbType.NVarChar, 4000)); + MyCommand.Parameters["@ColsArray"].Direction = ParameterDirection.Output; + + MyCommand.ExecuteNonQuery(); + + sql = Convert.ToString(MyCommand.Parameters["@selectStr_OutPut"].Value); + Count = Convert.ToInt32(MyCommand.Parameters["@Count"].Value);//返回SQL语句 + + + string[] ColsArrayString = Convert.ToString(MyCommand.Parameters["@ColsArray"].Value).Split('|'); ;//所有列名的集合 + ColsArray = new object[1, ColsArrayString.Length]; + for (int i = 0; i < ColsArrayString.Length; i++) + { + ColsArray[0, i] = ColsArrayString[i]; + } + + ColCount = ColsArrayString.Length; + } + catch + { + sql = ""; + Count = 0; + ColsArray = null; + ColCount = 0; + } + } +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// + public static void SelectGoodData_OKGO_Report_ADODB +(bool EnginIDCheck, string EnginID, + string startTime, string endTime, out string sql, out int Count, out int ColCount, out object[,] ColsArray) + { + try + { + string procedureName; + procedureName = "电子看板_发动机号_人工合格放行记录_查询_ReturnSql"; + DateTime dt_startTime; + DateTime dt_endTime; + dt_startTime = DateTime.Parse(startTime); + dt_endTime = DateTime.Parse(endTime); + + string constr = ApplicationConfiguration.ERP_ConnectionString; + SqlConnection conn = new SqlConnection(constr); + conn.Open(); + SqlCommand MyCommand = new SqlCommand(procedureName, conn); + MyCommand.CommandType = CommandType.StoredProcedure; + + MyCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@领班工号_ischeck", EnginIDCheck)); + MyCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@领班工号", EnginID)); + MyCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@开始时间", dt_startTime)); + MyCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@结束时间", dt_endTime)); + + MyCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@selectStr_OutPut", SqlDbType.NVarChar, 4000)); + MyCommand.Parameters["@selectStr_OutPut"].Direction = ParameterDirection.Output; + + MyCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Count", SqlDbType.Int)); + MyCommand.Parameters["@Count"].Direction = ParameterDirection.Output; + + MyCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@ColsArray", SqlDbType.NVarChar, 4000)); + MyCommand.Parameters["@ColsArray"].Direction = ParameterDirection.Output; + + MyCommand.ExecuteNonQuery(); + + sql = Convert.ToString(MyCommand.Parameters["@selectStr_OutPut"].Value); + Count = Convert.ToInt32(MyCommand.Parameters["@Count"].Value);//返回SQL语句 + + + string[] ColsArrayString = Convert.ToString(MyCommand.Parameters["@ColsArray"].Value).Split('|'); ;//所有列名的集合 + ColsArray = new object[1, ColsArrayString.Length]; + for (int i = 0; i < ColsArrayString.Length; i++) + { + ColsArray[0, i] = ColsArrayString[i]; + } + + ColCount = ColsArrayString.Length; + } + catch + { + sql = ""; + Count = 0; + ColsArray = null; + ColCount = 0; + } + } + /// + /// 物料数据报表 + /// + /// + /// + /// + /// + /// + /// + /// + /// + public static void SelectMaterialReport_ADODB_New + (bool EnginIDCheck, string EnginID, + bool OPNameCheck, string OPName, + string startTime, string endTime, out string sql, out int Count, out int ColCount, out object[,] ColsArray) + { + try + { + string procedureName; + procedureName = "物料数据查询_报表_ReturnSql"; + DateTime dt_startTime; + DateTime dt_endTime; + dt_startTime = DateTime.Parse(startTime); + dt_endTime = DateTime.Parse(endTime); + + string constr = ApplicationConfiguration.ERP_ConnectionString; + SqlConnection conn = new SqlConnection(constr); + conn.Open(); + SqlCommand MyCommand = new SqlCommand(procedureName, conn); + MyCommand.CommandType = CommandType.StoredProcedure; + + MyCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@发动机号_ischeck", EnginIDCheck)); + MyCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@发动机号", EnginID)); + MyCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@工位号_ischeck", OPNameCheck)); + MyCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@工位号", OPName)); + MyCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@开始时间", dt_startTime)); + MyCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@结束时间", dt_endTime)); + + MyCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@selectStr_OutPut", SqlDbType.NVarChar, 4000)); + MyCommand.Parameters["@selectStr_OutPut"].Direction = ParameterDirection.Output; + + MyCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Count", SqlDbType.Int)); + MyCommand.Parameters["@Count"].Direction = ParameterDirection.Output; + + MyCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@ColsArray", SqlDbType.NVarChar, 4000)); + MyCommand.Parameters["@ColsArray"].Direction = ParameterDirection.Output; + + MyCommand.ExecuteNonQuery(); + + sql = Convert.ToString(MyCommand.Parameters["@selectStr_OutPut"].Value); + Count = Convert.ToInt32(MyCommand.Parameters["@Count"].Value);//返回SQL语句 + + + string[] ColsArrayString = Convert.ToString(MyCommand.Parameters["@ColsArray"].Value).Split('|'); ;//所有列名的集合 + ColsArray = new object[1, ColsArrayString.Length]; + for (int i = 0; i < ColsArrayString.Length; i++) + { + ColsArray[0, i] = ColsArrayString[i]; + } + + ColCount = ColsArrayString.Length; + } + catch + { + sql = ""; + Count = 0; + ColsArray = null; + ColCount = 0; + } + } + + + /// + /// 字段名称各个字符中间增加回车,以保证文本竖着书写。 + /// + /// + /// + private static string GetColumnName_Ver(string columnName) + { + string columnName_tr; + columnName_tr = ""; + for (int i = 0; i < columnName.Length; i++) + { + columnName_tr = columnName_tr + columnName[i] + Environment.NewLine; + } + return columnName_tr; + } +} \ No newline at end of file diff --git a/App_code/PageBase.cs b/App_code/PageBase.cs new file mode 100644 index 0000000..5d29402 --- /dev/null +++ b/App_code/PageBase.cs @@ -0,0 +1,190 @@ +using System; +using System.Web; +using System.Web.UI; +using System.ComponentModel; +using System.Data; + +//using SPC.Common; +//using SPC.Common.Data; + +/// +///PageBase 的摘要说明 +/// +namespace SPC.WebUI +{ + public class PageBase:System.Web.UI.Page + { + private const String UNHANDLED_EXCEPTION = "Unhandled Exception:"; + private const String KEY_CACHEUSERS = "Cache:Users"; + private const String KEY_CACHEASSEMBLELINEWORKPLACE = "Cache:AssembleLineWorkPlace"; + private const String KEY_CACHEWORKPLACEMEASUREPART = "Cache:WorkPlaceMeasurePart"; + private const String KEY_CACHEWORKPLACEMEASUREPARTCONTENT = "Cache:WorkPlaceMeasurePartContent"; + + private static string UrlSuffix + { + get + { + //return HttpContext.Current.Request.Url.Host + HttpContext.Current.Request.ApplicationPath; //多加端口号与网站发布方式有关,与发布网站带不带端口号有关 + return HttpContext.Current.Request.Url.Host + ":" + HttpContext.Current.Request.Url.Port + HttpContext.Current.Request.ApplicationPath; + } + } + + public static String SecureUrlBase + { + get + { + //return (SPCWebConfiguration.EnableSsl ? @"https://" : @"http://") + UrlSuffix; + return @"http://" + UrlSuffix; + } + } + public static String UrlBase + { + get + { + return @"http://" + UrlSuffix; + } + } + + public DataSet UserSys + { + get + { + try + { + return (DataSet)(Session[KEY_CACHEUSERS]); + } + catch + { + return (null); + } + } + set + { + if (null == value) + { + Session.Remove(KEY_CACHEUSERS); + } + else + { + Session[KEY_CACHEUSERS] = value; + } + } + } + ///// + ///// Retrieves the Cart for the session, forcing it to be created + ///// if it does not already exist. + ///// + //public MeasureContent AssembleLineWorkPlace() + //{ + // return AssembleLineWorkPlace(true); + //} + ///// + ///// Retrieves the Cart for the session, optionally forcing it to + ///// be created if it does not already exist. + ///// Create the shopping cart if it does not exist. + ///// + //public MeasureContent AssembleLineWorkPlace(bool forceCreate) + //{ + // // + // // Try to get the cart from the Session + // // + // MeasureContent returnValue = (MeasureContent)(Session[KEY_CACHEASSEMBLELINEWORKPLACE]); + + // if (null == returnValue) + // { + // // + // // If there is no cart, create it now + // // + // returnValue = new MeasureContent(); + + // // + // // Save it for later + // // + // Session.Add(KEY_CACHEASSEMBLELINEWORKPLACE, returnValue); + // } + + // if (forceCreate) returnValue.EnsureWritable(); + + // return returnValue; + //} + ///// + ///// Retrieves the Cart for the session, forcing it to be created + ///// if it does not already exist. + ///// + //public MeasureContent WorkPlaceMeasurePart() + //{ + // return WorkPlaceMeasurePart(true); + //} + ///// + ///// Retrieves the Cart for the session, optionally forcing it to + ///// be created if it does not already exist. + ///// Create the shopping cart if it does not exist. + ///// + //public MeasureContent WorkPlaceMeasurePart(bool forceCreate) + //{ + // // + // // Try to get the cart from the Session + // // + // MeasureContent returnValue = (MeasureContent)(Session[KEY_CACHEWORKPLACEMEASUREPART]); + + // if (null == returnValue) + // { + // // + // // If there is no cart, create it now + // // + // returnValue = new MeasureContent(); + + // // + // // Save it for later + // // + // Session.Add(KEY_CACHEWORKPLACEMEASUREPART, returnValue); + // } + + // if (forceCreate) returnValue.EnsureWritable(); + + // return returnValue; + //} + ///// + ///// Retrieves the Cart for the session, forcing it to be created + ///// if it does not already exist. + ///// + //public MeasureContent WorkPlaceMeasurePartContent() + //{ + // return WorkPlaceMeasurePartContent(true); + //} + ///// + ///// Retrieves the Cart for the session, optionally forcing it to + ///// be created if it does not already exist. + ///// Create the shopping cart if it does not exist. + ///// + //public MeasureContent WorkPlaceMeasurePartContent(bool forceCreate) + //{ + // // + // // Try to get the cart from the Session + // // + // MeasureContent returnValue = (MeasureContent)(Session[KEY_CACHEWORKPLACEMEASUREPARTCONTENT]); + + // if (null == returnValue) + // { + // // + // // If there is no cart, create it now + // // + // returnValue = new MeasureContent(); + + // // + // // Save it for later + // // + // Session.Add(KEY_CACHEWORKPLACEMEASUREPARTCONTENT, returnValue); + // } + + // if (forceCreate) returnValue.EnsureWritable(); + + // return returnValue; + //} + protected override void OnError(EventArgs e) + { + //ApplicationLog.WriteError(ApplicationLog.FormatException(Server.GetLastError(), UNHANDLED_EXCEPTION)); + base.OnError(e); + } + } +} \ No newline at end of file diff --git a/App_code/QualityData2.cs b/App_code/QualityData2.cs new file mode 100644 index 0000000..4571e38 --- /dev/null +++ b/App_code/QualityData2.cs @@ -0,0 +1,79 @@ +#region 程序集 MES_SPC, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null +// F:\项目文件备份\15.潍柴\MES_Manage\Bin\MES_SPC.dll +// Decompiled with ICSharpCode.Decompiler 8.1.1.7464 +#endregion + +using System; +using System.Data; +using System.Data.SqlClient; +using DataLinkMesWork; +using MES_SPC; + +namespace MES_SPC2 +{ + public class QualityData2 + { + public static void GetQualityDataEveryOpNameDataListTable_Trend(string startTime, string endTime, bool EngineTypeIDCheck, string EngineTypeID, bool EnginIDCheck, string EnginID, bool OPNameCheck, string OPName, bool shaftNameCheck, string shaftName, bool itemNameCheck, string itemName, int isOK, string uuidCheck,string uuid , int PageCurrent, int PageSize, out int PageCount, out int ItemCount, out DataTable dt) + { + dt = null; + PageCount = 0; + ItemCount = 0; + string procedureName = "[质量数据_发动机质量数据_各个工位_视图_综合查询_趋势图_LLJ]"; + SqlParameter[] sqlParameters = new SqlParameter[16] + { + new SqlParameter("@开始时间", startTime), + new SqlParameter("@结束时间", endTime), + new SqlParameter("@发动机型号代码_ischeck", EngineTypeIDCheck), + new SqlParameter("@发动机型号代码", EngineTypeID), + new SqlParameter("@工位号_ischeck", OPNameCheck), + new SqlParameter("@工位号", OPName), + new SqlParameter("@测量位置_ischeck", shaftNameCheck), + new SqlParameter("@测量位置", shaftName), + new SqlParameter("@测量项目_ischeck", itemName), + new SqlParameter("@测量项目", itemName), + new SqlParameter("@导入编号_ischeck", uuidCheck), + new SqlParameter("@导入编号", uuid), + new SqlParameter("@PageCurrent", PageCurrent), + new SqlParameter("@PageSize", PageSize), + new SqlParameter("@PageCount", PageCount), + new SqlParameter("@ItemCount", ItemCount) + }; + //sqlParameters[14].Direction = ParameterDirection.Output; + //sqlParameters[15].Direction = ParameterDirection.Output; + string errorMessage; + SQLCommon.ExecuteStoredProcedure(procedureName, ApplicationConfiguration.ERP_ConnectionString, ref sqlParameters, out dt, out errorMessage); + } + public static void SelectGoodDataReport_TrendPictureBasic(bool EnginIDCheck, string EnginID, bool OPNameCheck, string OPName, bool shaftNameCheck, string shaftName, bool itemNameCheck, string itemName, string startTime, string endTime, string uuidCheck, string uuid, out DataTable dt) + { + try + { + string procedureName = "质量数据查询_综合查询_绘趋势图"; + DateTime dateTime = DateTime.Parse(startTime); + DateTime dateTime2 = DateTime.Parse(endTime); + SqlParameter[] sqlParameters = new SqlParameter[12] + { + new SqlParameter("@发动机号_ischeck", EnginIDCheck), + new SqlParameter("@发动机号", EnginID), + new SqlParameter("@工位号_ischeck", OPNameCheck), + new SqlParameter("@工位号", OPName), + new SqlParameter("@测量位置_ischeck", shaftNameCheck), + new SqlParameter("@测量位置", shaftName), + new SqlParameter("@测量项目_ischeck", itemNameCheck), + new SqlParameter("@测量项目", itemName), + new SqlParameter("@导入编号_ischeck", uuidCheck), + new SqlParameter("@导入编号", uuid), + new SqlParameter("@开始时间", dateTime), + new SqlParameter("@结束时间", dateTime2) + }; + string errorMessage; + SQLCommon.ExecuteStoredProcedure(procedureName, ApplicationConfiguration.ERP_ConnectionString, ref sqlParameters, out dt, out errorMessage); + } + catch + { + dt = null; + } + } + } +} + + diff --git a/App_code/SendGPRS.cs b/App_code/SendGPRS.cs new file mode 100644 index 0000000..5b4e03f --- /dev/null +++ b/App_code/SendGPRS.cs @@ -0,0 +1,139 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Web; +using ChatClient; + +/// +///SendGPRS 的摘要说明 +/// +public static class SendGPRS +{ + + private static string GPRShead = "GPRS|WEB|"; + /// + ///1.通断器实时数据查询 + ///命令格式:CXTD|通断器编号||! + /// + /// + /// + public static void SendGPRS_CXTD(string CJQ,string TDQ) + { + //"GPRS|WEB|0001|CXTD|0002|!"; + string command = GPRShead + CJQ + "|" + "CXTD|" + TDQ + "||!"; + webChatClient.sentmessage(command); + } + /// + //2、 热量表实时数据查询 + //命令格式:CXRB|热量表类型|热量表编号|! + /// + public static void SendGPRS_CXRB(string CJQ, string RLBtype, string RLB) + { + string command = GPRShead + CJQ +"|" + "CXRB|" + RLBtype + "|" + RLB + "|!"; + webChatClient.sentmessage(command); + } + /// + //3、 中心统一校时命令 + //命令格式:TIME|采集器编号|时间(20130805171824)|! + /// + public static void SendGPRS_TIME(string CJQ) + { + string time = System.DateTime.Now.ToString("yyyyMMddHHmmss"); + string command = GPRShead + CJQ + "|" + "TIME|" + CJQ + "|" + time + "|!"; + webChatClient.sentmessage(command); + } + /// + //4,强制关断阀门 + //命令格式:QZGD|通断器编号|ON/OFF|! + //GPRS收到后回传格式:QZGD |通断器编号|OK|! + /// + public static void SendGPRS_QZGD(string CJQ, string TDQ, string ONorOFF) + { + string command = GPRShead + CJQ +"|" + "QZGD|" + TDQ+"|" + ONorOFF + "|!"; + webChatClient.sentmessage(command); + } + /// + //5、 设定用户温度 0005 0105 + //命令格式:TEMP|通断器编号|温度|! + //GPRS收到后回传格式:TEMP |通断器编号|OK|! + /// + public static void SendGPRS_TEMP(string CJQ, string TDQ, string WD) + { + if (WD.Length == 1) + { + WD = "0" + WD; + } + string command = GPRShead +CJQ + "|" + "TEMP|" + TDQ +"|"+WD+ "|!"; + webChatClient.sentmessage(command); + } + + /// + //7、 遥控器设温使能 00/01 + //命令格式:YKSN|通断器编号|遥控器不可以控制/遥控器可以控制|! + //GPRS收到后回传格式:YKSN|通断器编号|OK|! + /// + public static void SendGPRS_TEMPControl(string CJQ, string TDQ, string ONOFF) + { + + if (ONOFF == "ON") + { + ONOFF = "01"; + } + else + { + ONOFF = "00"; + } + string command = GPRShead + CJQ + "|" + "YKSN|" + TDQ + "|" + ONOFF + "|!"; + webChatClient.sentmessage(command); + } + /// + //6、 配置面积信息 + //命令格式:AREA|通断器编号|面积|! + //GPRS收到后回传格式:AREA|通断器编号|OK|! + /// + public static void SendGPRS_AREA(string CJQ, string TDQ, string AREA) + { + string command = GPRShead + CJQ +"|" + "AREA|" + TDQ + "|" + AREA + "|!"; + webChatClient.sentmessage(command); + } + + + /// + ///7 供暖启停 + /// 命令格式:GNQT|采集器编号| ON/OFF|! + ///GPRS收到后回传格式:GNQT|采集器编号|OK|! + /// + + public static void SendGPRS_GNQT(string CJQ,string ONOFF) + { + string command = GPRShead + CJQ + "|" + "GNQT|" + CJQ + "|" + ONOFF + "|!"; + webChatClient.sentmessage(command); + } + + /// + ///8更换热表 + /// 命令格式:GHRB|旧热表编号|新热表编号|! + ///GPRS收到后回传格式:GHRB |新热表编号|OK|! + /// + + public static void SendGPRS_GHRB(string CJQ, string OldNum, string NewNum, string newtype) + { + string command = GPRShead + CJQ + "|" + "GHRB|" + OldNum + "|" + newtype+"+" + NewNum + "|!"; + webChatClient.sentmessage(command); + } + + + /// + ///9更换通断 + /// 命令格式:GHTD|旧通断编号|新通断编号|! + ///GPRS收到后回传格式:GHTD |新通断编号|OK|! + /// + + public static void SendGPRS_GHTD(string CJQ, string OldNum, string NewNum) + { + string command = GPRShead + CJQ + "|" + "GHTD|" + OldNum + "|" + NewNum + "|!"; + webChatClient.sentmessage(command); + } + + +} \ No newline at end of file diff --git a/App_code/TcpClientConnector.cs b/App_code/TcpClientConnector.cs new file mode 100644 index 0000000..1a2d5f4 --- /dev/null +++ b/App_code/TcpClientConnector.cs @@ -0,0 +1,86 @@ +using System; +using System.Collections.Generic; +using System.Text; +using System.Threading; +using System.Net.Sockets; + +namespace ChatClient +{ + class TcpClientConnector + { + /// + /// 在指定时间内尝试连接指定主机上的指定端口。 + /// + /// 要连接到的远程主机的 DNS 名。 + /// 要连接到的远程主机的端口号。 + /// 要等待的毫秒数,或 -1 表示无限期等待。 + /// 已连接的一个 TcpClient 实例。 + /// 本方法可能抛出的异常与 TcpClient 的构造函数重载之一 + /// public TcpClient(string, int) 相同,并若指定的等待时间是个负数且不等于 + /// -1,将会抛出 ArgumentOutOfRangeException。 + public static TcpClient Connect(string hostname, int port, int millisecondsTimeout) + { + ConnectorState cs = new ConnectorState(); + cs.Hostname = hostname; + cs.Port = port; + ThreadPool.QueueUserWorkItem(new WaitCallback(ConnectThreaded), cs); + if (cs.Completed.WaitOne(millisecondsTimeout, false)) + { + if (cs.TcpClient != null) return cs.TcpClient; + throw cs.Exception; + } + else + { + cs.Abort(); + throw new SocketException(11001); // cannot connect + } + } + + private static void ConnectThreaded(object state) + { + ConnectorState cs = (ConnectorState)state; + cs.Thread = Thread.CurrentThread; + try + { + TcpClient tc = new TcpClient(cs.Hostname, cs.Port); + if (cs.Aborted) + { + try { tc.GetStream().Close(); } + catch { } + try { tc.Close(); } + catch { } + } + else + { + cs.TcpClient = tc; + cs.Completed.Set(); + } + } + catch (Exception e) + { + cs.Exception = e; + cs.Completed.Set(); + } + } + + private class ConnectorState + { + public string Hostname; + public int Port; + public volatile Thread Thread; + public readonly ManualResetEvent Completed = new ManualResetEvent(false); + public volatile TcpClient TcpClient; + public volatile Exception Exception; + public volatile bool Aborted; + public void Abort() + { + if (Aborted != true) + { + Aborted = true; + try { Thread.Abort(); } + catch { } + } + } + } + } +} \ No newline at end of file diff --git a/App_code/Utilities/ChartDataTableHelper/ChartDataTableHelper.cs b/App_code/Utilities/ChartDataTableHelper/ChartDataTableHelper.cs new file mode 100644 index 0000000..22f3862 --- /dev/null +++ b/App_code/Utilities/ChartDataTableHelper/ChartDataTableHelper.cs @@ -0,0 +1,623 @@ +using System; +using System.Drawing; +using System.Drawing.Drawing2D; +using System.Web.UI.DataVisualization.Charting; +using System.Collections; + +namespace System.Web.UI.DataVisualization.Charting.Utilities +{ + /// + /// . + /// + public class ChartDataTableHelper + { + #region Members + protected System.Web.UI.DataVisualization.Charting.Chart ChartObj = null; + protected ArrayList ChartAreas = null; + protected bool AddTableTotals = false; + protected System.Drawing.Color tableColor = Color.White; + protected System.Drawing.Color borderColor = Color.Black; + protected bool enabled = true; + protected bool Initialized = false; + + #endregion + + #region Properties + + /// + /// Enables or Disables the painting of the Data Table. + /// + public bool Enabled + { + get + { + return Enabled; + } + set + { + enabled = value; + } + } + + /// + /// Sets or gets the Chart object. + /// + public System.Web.UI.DataVisualization.Charting.Chart Chart + { + get + { + return ChartObj; + } + set + { + ChartObj = value; + } + } + + + /// + /// Sets or gets the Table Color that will be painted. + /// + public System.Drawing.Color TableColor + { + get + { + return tableColor; + } + set + { + tableColor = value; + } + } + + /// + /// Sets or gets the Table Border Color that will be painted. + /// + public System.Drawing.Color BorderColor + { + get + { + return borderColor; + } + set + { + borderColor = value; + } + } + + #endregion + + #region Constructors + /// + /// Construct a ChartDataTableHelper instance. + /// + public ChartDataTableHelper() + { + ChartObj = null; + ChartAreas = new ArrayList(); + } + + /// + /// Construct a ChartDataTableHelper instance and Initialize all ChartAreas with a table. + /// + public ChartDataTableHelper(System.Web.UI.DataVisualization.Charting.Chart chartObj) + { + ChartAreas = new ArrayList(); + Initialize(chartObj); + } + + + /// + /// Construct a ChartDataTableHelper instance and Initialize the specified ChartArea with a table. + /// + public ChartDataTableHelper(System.Web.UI.DataVisualization.Charting.Chart chartObj, string chartAreaName) + { + ChartAreas = new ArrayList(); + Initialize(chartObj, chartAreaName); + + } + + /// + /// Construct a ChartDataTableHelper instance, Initialize the specified ChartArea with a table and + /// set a boolean to show or hide total columns. + /// + public ChartDataTableHelper(System.Web.UI.DataVisualization.Charting.Chart chartObj, string chartAreaName, bool addTableTotals) + { + ChartAreas = new ArrayList(); + Initialize(chartObj, chartAreaName, addTableTotals); + + } + + #endregion + + #region Initialization Methods + /// + /// Initialize all ChartAreas with a table. + /// + public void Initialize(System.Web.UI.DataVisualization.Charting.Chart chartObj) + { + ChartObj = chartObj; + + foreach(ChartArea area in ChartObj.ChartAreas) + { + AddDataTable(area.Name); + } + + if(!Initialized) + ChartObj.PostPaint +=new EventHandler(this.Chart_PostPaint); + + Initialized = true; + } + + + + /// + /// Initialize all ChartAreas with a table and + /// set a boolean to show or hide total columns. + /// + public void Initialize(System.Web.UI.DataVisualization.Charting.Chart chartObj, bool addTableTotals) + { + AddTableTotals = addTableTotals; + Initialize(chartObj); + } + + /// + /// Initialize the specified ChartArea with a table. + /// + public void Initialize(System.Web.UI.DataVisualization.Charting.Chart chartObj, string chartAreaName) + { + ChartObj = chartObj; + + AddDataTable(chartAreaName); + + if(!Initialized) + ChartObj.PostPaint +=new EventHandler(this.Chart_PostPaint); + + Initialized = true; + } + + /// + /// Initialize the specified ChartArea with a table and + /// set a boolean to show or hide total columns. + /// + public void Initialize(System.Web.UI.DataVisualization.Charting.Chart chartObj, string chartAreaName, bool addTableTotals) + { + ChartObj = chartObj; + AddTableTotals = addTableTotals; + + AddDataTable(chartAreaName); + + if(!Initialized) + ChartObj.PostPaint +=new EventHandler(this.Chart_PostPaint); + + Initialized = true; + } + + /// + /// Initialize the specified ChartArea with a table. + /// + public void AddDataTable(string chartAreaName) + { + if(ChartObj == null || ChartAreas.IndexOf(chartAreaName) >= 0) + return; + + // add this chart area to the list of chart areas that need to + // have a data table attached + ChartAreas.Add(chartAreaName); + + int Row = 0; + + + if(AddTableTotals) + { + // create a dummy series that will not be shown but is used for + // showing the totals in the data table + ChartObj.Series.Add("DUMMY"); + ChartObj.Series["DUMMY"].ChartArea = chartAreaName; + ChartObj.Series["DUMMY"].Enabled = false; + ChartObj.Series["DUMMY"].Color = Color.Gainsboro; + } + + + // for each of the series that are attached to this + // named chart area, create a custom axis label. + // All tables lines will be drawn on a paint event. + // **************************************************** + // NOTE: ALL SERIES MUST HAVE THE SAME NUMBER OF POINTS! + // **************************************************** + foreach(Series ser in ChartObj.Series) + { + if(chartAreaName == ser.ChartArea) + { + if(AddTableTotals) + { + // shadows must be turned off otherwise + // they will still show up for the transparent points + ser.ShadowOffset = 0; + + // adjust the series values to ensure they are not + // indexed and they are sorted... plus adding each point + // to make the dummy series data + AdjustXValues(ser); + } + + + Row++; + double From = 0.0; + double To = 0.0; + bool firstPoint = true; + + double YValueTotal = 0; + + foreach(DataPoint dp in ser.Points) + { + if(AddTableTotals) + YValueTotal += dp.YValues[0]; + + if(firstPoint && dp.XValue == 0) + From = 0.5; + else if(firstPoint) + From = dp.XValue - 0.5; + + if(firstPoint) + { + ChartObj.ChartAreas[chartAreaName].AxisX.Minimum = From; + ChartObj.ChartAreas[chartAreaName].AxisX.MajorGrid.Interval = 1; + ChartObj.ChartAreas[chartAreaName].AxisX.MajorTickMark.Interval = 1; + ChartObj.ChartAreas[chartAreaName].AxisX.LabelStyle.Interval = 1; + ChartObj.ChartAreas[chartAreaName].AxisX.MajorGrid.IntervalOffset = 0.5; + ChartObj.ChartAreas[chartAreaName].AxisX.MajorTickMark.IntervalOffset = 0.5; + ChartObj.ChartAreas[chartAreaName].AxisX.LabelStyle.IntervalOffset = 0.5; + } + + To = From + 1; + + ChartObj.ChartAreas[chartAreaName].AxisX.CustomLabels.Add( + From, To, + " ", // space used as a placeholder + Row, LabelMarkStyle.None, GridTickTypes.None + ); + + firstPoint = false; + From += 1; + } + + if(AddTableTotals) + ser.Points[ser.Points.Count-1].YValues[0] = YValueTotal; + + ChartObj.ChartAreas[chartAreaName].AxisX.Maximum = To; + + } + } + + if(AddTableTotals) + AdjustYMaximum(chartAreaName); + + } + + /// + /// With the addition of Totals, the chart will try to set the maximum + /// values according to these totals. This will cause some series to be + /// barely visible. Since the points are transparent this is a poor behavior. + /// This method will find and explicitly set the YAxis maximum to something + /// a little more with the user expectations. + /// + private void AdjustYMaximum(string chartAreaName) + { + double MaxYValue = 0; + + // find the max YValue from all points in all series + foreach(Series ser in ChartObj.Series) + { + if(chartAreaName == ser.ChartArea && ser.Enabled) + { + // check agains all points except the last point + // which is the totals column + for(int index = 0; index < ser.Points.Count-1; index++) + { + DataPoint pt = ser.Points[index]; + if(pt.YValues[0] > MaxYValue) + MaxYValue = pt.YValues[0]; + } + } + } + + double LogValue = (int)(Math.Log10(MaxYValue)) + 1; + double NewMaxYValue = Math.Pow(10, LogValue); + double ratio = MaxYValue / NewMaxYValue; + double divisor = 1; + + if(ratio <= 0.1) + divisor = 10; + else if(ratio < 0.2) + divisor = 5; + else if(ratio < 0.25) + divisor = 4; + else if(ratio < 0.4) + divisor = 2.5; + else if(ratio < 0.5) + divisor = 2; + else if(ratio < 0.8) + divisor = 1.25; + + ChartObj.ChartAreas[chartAreaName].AxisY.Maximum = NewMaxYValue / divisor; + ChartObj.ChartAreas[chartAreaName].AxisY.RoundAxisValues(); + + } + + + /// + /// A cleanup method that ensures the XValues are sorted accordingly and set explicitly. + /// It will also create the totals for the DUMMY series. + /// + private void AdjustXValues(System.Web.UI.DataVisualization.Charting.Series series) + { + bool AddDummyPoints = true; + + if(series.Name == "DUMMY") + return; + else if(ChartObj.Series["DUMMY"].Points.Count > 0) + AddDummyPoints = false; + + // sort the series + series.Sort(PointSortOrder.Ascending, "X"); + + bool IsIndexed = false; + + if(series.IsXValueIndexed) + IsIndexed = true; + else + { + bool IsFirstPoint = true; + bool IsLastPointZero = false; + + // the series X values must be set and greater than zero + foreach(DataPoint pt in series.Points) + { + if(pt.XValue == 0 && !IsFirstPoint && IsLastPointZero) + { + IsIndexed = true; + break; + } + else if (pt.XValue == 0 && IsFirstPoint) + IsLastPointZero = true; + + IsFirstPoint = false; + } + } + + if(IsIndexed) + { + series.IsXValueIndexed = false; + int XValue = 0; + + foreach(DataPoint pt in series.Points) + pt.XValue = ++XValue; + } + + series.Points.AddXY(series.Points[series.Points.Count-1].XValue + 1, 0); + series.Points[series.Points.Count-1].AxisLabel = "Total"; + series.Points[series.Points.Count-1].Color = Color.Transparent; + series.Points[series.Points.Count-1].BorderColor = Color.Transparent; + + int index = 0; + foreach(DataPoint pt in series.Points) + { + if(AddDummyPoints) + { + ChartObj.Series["DUMMY"].Points.AddXY(pt.XValue, pt.YValues[0]); + } + else + { + ChartObj.Series["DUMMY"].Points[index].YValues[0] += pt.YValues[0]; + } + + index++; + } + } + + + #endregion + + #region Remove Table + + public void RemoveDataTable(string chartAreaName) + { + if (ChartObj.ChartAreas.IndexOf(chartAreaName) >= 0) + ChartObj.ChartAreas[chartAreaName].AxisX.CustomLabels.Clear(); + + if(ChartAreas.IndexOf(chartAreaName) >= 0) + { + ChartAreas.RemoveAt(ChartAreas.IndexOf(chartAreaName)); + } + } + + #endregion + + #region Paint Event Handling + + /// + /// Chart Paint event handler. + /// + private void Chart_PostPaint(object sender, System.Web.UI.DataVisualization.Charting.ChartPaintEventArgs e) + { + if( e.ChartElement is ChartArea ) + { + ChartArea area = (ChartArea)e.ChartElement; + // call the paint method. + if(ChartAreas.IndexOf(area.Name) >= 0 && enabled) + { + PaintDataTable(sender, e); + } + } + + } + + /// + /// This method does all the work for the painting of the data table. + /// + private void PaintDataTable(object sender, System.Web.UI.DataVisualization.Charting.ChartPaintEventArgs e) + { + ChartArea area = (ChartArea)e.ChartElement; + + // get the rect of the chart area + RectangleF rect = e.ChartGraphics.GetAbsoluteRectangle( area.Position.ToRectangleF() ); + + // get the inner plot position + ElementPosition elemPos = area.InnerPlotPosition; + + // find the coordinates of the inner plot position + float x = rect.X + (rect.Width / 100 * elemPos.X); + float y = rect.Y + (rect.Height / 100 * elemPos.Y); + float ChartAreaBottomY = rect.Y + rect.Height; + + float width = (rect.Width / 100 * elemPos.Width); + float height = (rect.Height / 100 * elemPos.Height); + + // find the height of the font that will be used + Font axisFont = area.AxisX.LabelStyle.Font; + string testString = "ForFontHeight"; + SizeF axisFontSize = e.ChartGraphics.Graphics.MeasureString(testString, axisFont); + + // find the height of the font that will be used + Font titleFont = area.AxisX.TitleFont; + testString = area.AxisX.Title; + SizeF titleFontSize = e.ChartGraphics.Graphics.MeasureString(testString, titleFont); + + int seriesCount = 0; + + // for each series that is attached to the chart area, + // draw some boxes around the labels in the color provided + for(int i = e.Chart.Series.Count-1; i >= 0; i--) + { + if(area.Name == e.Chart.Series[i].ChartArea) + { + seriesCount++; + } + } + + // now, if a box was actually drawn, then draw + // the verticle lines to separate the columns of the table. + if(seriesCount > 0) + { + for(int i = 0; i < e.Chart.Series.Count; i++) + { + if(area.Name == e.Chart.Series[i].ChartArea) + { + double min = area.AxisX.Minimum; + double max = area.AxisX.Maximum; + + // modify the min value for the current axis view + if(area.AxisX.ScaleView.Position-1 > min) + min = area.AxisX.ScaleView.Position-1; + + // modify the max value for the currect axis view + if( (area.AxisX.ScaleView.Position + area.AxisX.ScaleView.Size + 0.5) < max) + max = area.AxisX.ScaleView.Position + area.AxisX.ScaleView.Size + 0.5; + + + // find the starting point that will be display. + // this is dependent on the current axis view. + // this sample assumes the same number of points in each + // series so always take from the zeroth series + int pointIndex = 0; + foreach(DataPoint pt in ChartObj.Series[0].Points) + { + if(pt.XValue > min) + break; + + pointIndex++; + } + + bool TableLegendDrawn = false; + + for(double AxisValue = min; AxisValue < max; AxisValue++) + { + float pixelX = (float)e.ChartGraphics.GetPositionFromAxis(area.Name, AxisName.X, AxisValue); + float nextPixelX = (float)e.ChartGraphics.GetPositionFromAxis(area.Name, AxisName.X, AxisValue + 1); + float pixelY = ChartAreaBottomY - titleFontSize.Height - (seriesCount * axisFontSize.Height); + + PointF point1 = PointF.Empty; + PointF point2 = PointF.Empty; + + // Set Maximum and minimum points + point1.X = pixelX; + point1.Y = 0; + + // Convert relative coordinates to absolute coordinates. + point1 = e.ChartGraphics.GetAbsolutePoint(point1); + point2.X = point1.X; + point2.Y = ChartAreaBottomY - titleFontSize.Height; + point1.Y = pixelY; + + // Draw connection line + e.ChartGraphics.Graphics.DrawLine(new Pen(borderColor), point1,point2); + + + point2.X = nextPixelX; + point2.Y = 0; + point2 = e.ChartGraphics.GetAbsolutePoint(point2); + + StringFormat format = new StringFormat(); + format.Alignment = StringAlignment.Center; + format.LineAlignment = StringAlignment.Center; + + // for each series draw one value in the column + int row = 0; + foreach(Series ser in ChartObj.Series) + { + if(area.Name == ser.ChartArea) + { + if(!TableLegendDrawn) + { + // draw the series color box + e.ChartGraphics.Graphics.FillRectangle(new SolidBrush(ser.Color), + x-10, row*(axisFont.Height)+(point1.Y), 10, axisFontSize.Height); + + e.ChartGraphics.Graphics.DrawRectangle(new Pen(borderColor), + x-10, row*(axisFont.Height)+(point1.Y), 10, axisFontSize.Height); + + e.ChartGraphics.Graphics.FillRectangle(new SolidBrush(tableColor), + x, + row*(axisFont.Height)+(point1.Y), + width, + axisFontSize.Height); + + e.ChartGraphics.Graphics.DrawRectangle(new Pen(borderColor), + x, + row*(axisFont.Height)+(point1.Y), + width, + axisFontSize.Height); + + } + + if(pointIndex < ser.Points.Count) + { + string label = ser.Points[pointIndex].YValues[0].ToString(); + RectangleF textRect = new RectangleF(point1.X, row*(axisFont.Height)+(point1.Y+1), point2.X-point1.X, axisFont.Height); + e.ChartGraphics.Graphics.DrawString(label, axisFont, new SolidBrush(area.AxisX.LabelStyle.ForeColor), textRect, format); + } + + row++; + + } + } + + TableLegendDrawn = true; + + pointIndex++; + } + + // do this only once so break! + break; + } + } + } + } + + + #endregion + + + } +} \ No newline at end of file diff --git a/App_code/Utilities/ChartDataTableHelper/_system~.ini b/App_code/Utilities/ChartDataTableHelper/_system~.ini new file mode 100644 index 0000000..e69de29 diff --git a/App_code/Utilities/ChartDataTableHelper/vssver2.scc b/App_code/Utilities/ChartDataTableHelper/vssver2.scc new file mode 100644 index 0000000..293b675 Binary files /dev/null and b/App_code/Utilities/ChartDataTableHelper/vssver2.scc differ diff --git a/App_code/Utilities/HistogramchartHelper/HistogramchartHelper.cs b/App_code/Utilities/HistogramchartHelper/HistogramchartHelper.cs new file mode 100644 index 0000000..0347b7b --- /dev/null +++ b/App_code/Utilities/HistogramchartHelper/HistogramchartHelper.cs @@ -0,0 +1,258 @@ +using System; +using System.Drawing; +using System.Drawing.Drawing2D; +using System.Web.UI.DataVisualization.Charting; +using System.Collections; + +namespace System.Web.UI.DataVisualization.Charting.Utilities +{ + /// + /// Helper class that creates a histogram chart. Histogram is a data + /// distribution chart which shows how many values, from the data series, + /// are inside each segment interval. + /// + /// You can define how many intervals you want to have using the SegmentIntervalNumber + /// field or the exact length of the interval using the SegmentIntervalWidth + /// field. Actual segment interval number can be slightly different due + /// to the automatic interval rounding. + /// + public class HistogramChartHelper + { + #region Fields + + /// + /// Number of class intervals the data range is devided in. + /// This property only has affect when "SegmentIntervalWidth" is + /// set to double.NaN. + /// + public int SegmentIntervalNumber = 20; + + /// + /// Histogram class interval width. Setting this value to "double.NaN" + /// will result in automatic width calculation based on the data range + /// and number of required interval specified in "SegmentIntervalNumber". + /// + public double SegmentIntervalWidth = double.NaN; + + /// + /// Indicates that percent frequency should be shown on the right axis + /// + public bool ShowPercentOnSecondaryYAxis = true; + + #endregion // Fields + + #region Methods + + /// + /// Creates a histogram chart. + /// + /// Chart control reference. + /// Name of the series which stores the original data. + /// Name of the histogram series. + public void CreateHistogram( + Chart chartControl, + string dataSeriesName, + string histogramSeriesName) + { + // Validate input + if (chartControl == null) + { + throw (new ArgumentNullException("chartControl")); + } + if (chartControl.Series.IndexOf(dataSeriesName) < 0) + { + throw (new ArgumentException("Series with name'" + dataSeriesName + "' was not found.", "dataSeriesName")); + } + + // Make data series invisible + chartControl.Series[dataSeriesName].Enabled = false; + + // Check if histogram series exsists + Series histogramSeries = null; + if (chartControl.Series.IndexOf(histogramSeriesName) < 0) + { + // Add new series + histogramSeries = chartControl.Series.Add(histogramSeriesName); + + // Set new series chart type and other attributes + histogramSeries.ChartType = SeriesChartType.Column; + histogramSeries.BorderColor = Color.Black; + histogramSeries.BorderWidth = 1; + histogramSeries.BorderDashStyle = ChartDashStyle.Solid; + } + else + { + histogramSeries = chartControl.Series[histogramSeriesName]; + histogramSeries.Points.Clear(); + } + + // Get data series minimum and maximum values + double minValue = double.MaxValue; + double maxValue = double.MinValue; + int pointCount = 0; + foreach (DataPoint dataPoint in chartControl.Series[dataSeriesName].Points) + { + // Process only non-empty data points + if (!dataPoint.IsEmpty) + { + if (dataPoint.YValues[0] > maxValue) + { + maxValue = dataPoint.YValues[0]; + } + if (dataPoint.YValues[0] < minValue) + { + minValue = dataPoint.YValues[0]; + } + ++pointCount; + } + } + + // Calculate interval width if it's not set + if (double.IsNaN(this.SegmentIntervalWidth)) + { + this.SegmentIntervalWidth = (maxValue - minValue) / SegmentIntervalNumber; + this.SegmentIntervalWidth = RoundInterval(this.SegmentIntervalWidth); + } + + // Round minimum and maximum values + minValue = Math.Floor(minValue / this.SegmentIntervalWidth) * this.SegmentIntervalWidth; + maxValue = Math.Ceiling(maxValue / this.SegmentIntervalWidth) * this.SegmentIntervalWidth; + + // Create histogram series points + double currentPosition = minValue; + for (currentPosition = minValue; currentPosition <= maxValue; currentPosition += this.SegmentIntervalWidth) + { + // Count all points from data series that are in current interval + int count = 0; + foreach (DataPoint dataPoint in chartControl.Series[dataSeriesName].Points) + { + if (!dataPoint.IsEmpty) + { + double endPosition = currentPosition + this.SegmentIntervalWidth; + if (dataPoint.YValues[0] >= currentPosition && + dataPoint.YValues[0] < endPosition) + { + ++count; + } + + // Last segment includes point values on both segment boundaries + else if (endPosition >= maxValue) + { + if (dataPoint.YValues[0] >= currentPosition && + dataPoint.YValues[0] <= endPosition) + { + ++count; + } + } + } + } + + + // Add data point into the histogram series + histogramSeries.Points.AddXY(currentPosition + this.SegmentIntervalWidth / 2.0, count); + //histogramSeries.Points.AddXY("", count); + //histogramSeries.Points.AddY( count); + + } + + + // Adjust series attributes + histogramSeries["PointWidth"] = "1"; + + // Adjust chart area + ChartArea chartArea = chartControl.ChartAreas[histogramSeries.ChartArea]; + chartArea.AxisY.Title = "Ƶ"; + chartArea.AxisX.Minimum = minValue; + chartArea.AxisX.Maximum = maxValue; + + // Set axis interval based on the histogram class interval + // and do not allow more than 10 labels on the axis. + double axisInterval = this.SegmentIntervalWidth; + while ((maxValue - minValue) / axisInterval > 10.0) + { + axisInterval *= 2.0; + } + chartArea.AxisX.Interval = axisInterval; + + // Set chart area secondary Y axis + chartArea.AxisY2.Enabled = AxisEnabled.Auto; + if (this.ShowPercentOnSecondaryYAxis) + { + chartArea.RecalculateAxesScale(); + + chartArea.AxisY2.Enabled = AxisEnabled.True; + chartArea.AxisY2.LabelStyle.Format = "P0"; + chartArea.AxisY2.MajorGrid.Enabled = false; + chartArea.AxisY2.Title = "Percent of Total"; + + chartArea.AxisY2.Minimum = 0; + chartArea.AxisY2.Maximum = chartArea.AxisY.Maximum / (pointCount / 100.0); + double minStep = (chartArea.AxisY2.Maximum > 20.0) ? 5.0 : 1.0; + chartArea.AxisY2.Interval = Math.Ceiling((chartArea.AxisY2.Maximum / 5.0 / minStep)) * minStep; + + } + } + /// + /// Helper method which rounds specified axsi interval. + /// + /// Calculated axis interval. + /// Rounded axis interval. + public double RoundInterval( double interval ) + { + // If the interval is zero return error + if( interval == 0.0 ) + { + throw( new ArgumentOutOfRangeException("interval", "Interval can not be zero.")); + } + + // If the real interval is > 1.0 + double step = -1; + double tempValue = interval; + while( tempValue > 1.0 ) + { + step ++; + tempValue = tempValue / 10.0; + if( step > 1000 ) + { + throw( new InvalidOperationException( "Auto interval error due to invalid point values or axis minimum/maximum." ) ); + } + } + + // If the real interval is < 1.0 + tempValue = interval; + if( tempValue < 1.0 ) + { + step = 0; + } + + while( tempValue < 1.0 ) + { + step --; + tempValue = tempValue * 10.0; + if( step < -1000 ) + { + throw( new InvalidOperationException( "Auto interval error due to invalid point values or axis minimum/maximum." ) ); + } + } + + double tempDiff = interval / Math.Pow( 10.0, step ); + if( tempDiff < 3.0 ) + { + tempDiff = 2.0; + } + else if( tempDiff < 7.0 ) + { + tempDiff = 5.0; + } + else + { + tempDiff = 10.0; + } + + // Make a correction of the real interval + return tempDiff * Math.Pow( 10.0, step ); + } + + #endregion // Methods + } +} \ No newline at end of file diff --git a/App_code/Utilities/HistogramchartHelper/_system~.ini b/App_code/Utilities/HistogramchartHelper/_system~.ini new file mode 100644 index 0000000..e69de29 diff --git a/App_code/Utilities/HistogramchartHelper/vssver2.scc b/App_code/Utilities/HistogramchartHelper/vssver2.scc new file mode 100644 index 0000000..7c1694a Binary files /dev/null and b/App_code/Utilities/HistogramchartHelper/vssver2.scc differ diff --git a/App_code/Utilities/PassBandFilter/FFT.cs b/App_code/Utilities/PassBandFilter/FFT.cs new file mode 100644 index 0000000..55d12c6 --- /dev/null +++ b/App_code/Utilities/PassBandFilter/FFT.cs @@ -0,0 +1,326 @@ +//================================================================= +// File: FFT.cs +// +// Namespace: System.Web.UI.DataVisualization.Charting.Utilities +// +// Classes: FFT +// +// Purpose: Used for the fast fourier transformation algorithm +// +//=================================================================== +// Chart Control for ASP.Net +//=================================================================== + +using System; +using System.Collections.Generic; +using System.Text; + +namespace System.Web.UI.DataVisualization.Charting.Utilities +{ + /// + /// Helper class which implements the various window functions for determination of the filter + /// coefficients. + /// + class FFT + { + #region Members + /// + /// Filter type enumeration for identification of what type of filter we want coefficients + /// for. + /// + public enum FilterType { HighPass, LowPass, BandPass }; + + /// + /// Algorithm enumeration for choice of algorithm + /// + public enum Algorithm { Kaiser, Hann, Hamming, Blackman, Rectangular }; + + private float myRate; + private float myFreqFrom; + private float myFreqTo; + private float myAttenuation; + private float myBand; + private float myAlpha; + private int myOrder; + + /// + /// Shannon sampling frequency + /// + private float myFS; + #endregion + + #region Properties + /// + /// Sampling rate + /// + public float Rate + { + get { return myRate; } + set + { + myRate = value; + myFS = 0.5f * myRate; + } + } + + /// + /// Starting frequency for passband. Must be lower than the ending frequency. + /// + public float FreqFrom + { + get { return myFreqFrom; } + set { myFreqFrom = value; } + } + + /// + /// Ending frequency for passband. Must be higher than the starting frequency. + /// + public float FreqTo + { + get { return myFreqTo; } + set { myFreqTo = value; } + } + + /// + /// Stopband attenuation. + /// + public float StopBandAttenuation + { + get { return myAttenuation; } + set { myAttenuation = value; } + } + + /// + /// Transition band. + /// + public float TransitionBand + { + get { return myBand; } + set { myBand = value; } + } + + /// + /// Alpha value used for the Kaiser algorithm. + /// + public float Alpha + { + get { return myAlpha; } + set { myAlpha = value; } + } + + /// + /// Filter order. Must be an even number. + /// + public int Order + { + get { return myOrder; } + set { myOrder = value; } + } + #endregion + + #region Constructors + /// + /// Construct a FFT instance and initialize with default values. + /// + public FFT() + { + //default rate to 8000 + Rate = 8000; + + //default attenuation to 60db + this.myAttenuation = 60; + + //default transition band to 500hz + this.myBand = 500; + + //default order to 0 so that we'll know if it was changed by the user or not + this.myOrder = 0; + + //default Alpha to 4 + this.myAlpha = 4; + } + #endregion + + #region Mathematical Functions + /// + /// Bessel is the zeroth order Bessel function which is used in the Kaiser window. + /// This is a polynomial approximation of the zeroth order modified Bessel function found in: + /// W.H. Press, B.P. Flannery, S.A. Teukolsky, and W.T. Vetterling. + /// Numerical Recipes in C: The Art of Scientific Computing. + /// Cambridge UP, 1988. + /// P. 237 + /// + /// Input number which the Bessel will be performed on + private float Bessel(float x) + { + double ax, ans; + double y; + + ax = System.Math.Abs(x); + if (ax < 3.75) + { + y = x / 3.75; + y *= y; + ans = 1.0 + y * (3.5156229 + y * (3.0899424 + y * (1.2067492 + + y * (0.2659732 + y * (0.360768e-1 + y * 0.45813e-2))))); + } + else + { + y = 3.75 / ax; + ans = (System.Math.Exp(ax) / System.Math.Sqrt(ax)) * (0.39894228 + y * (0.1328592e-1 + + y * (0.225319e-2 + y * (-0.157565e-2 + y * (0.916281e-2 + + y * (-0.2057706e-1 + y * (0.2635537e-1 + y * (-0.1647633e-1 + + y * 0.392377e-2)))))))); + } + + return (float)ans; + } + #endregion + + #region Generate Coefficients + /// + /// Calculate the coefficients to be used by the filter function. + /// + /// Enum type which specifies the filter to be performed. + /// Enum type which specifies which algorithm to be used for the window + /// algorithm. + public float[] GenerateCoefficients(FilterType filterType, Algorithm alg) + { + //Calculate order if it hasn't been set + if (this.myOrder == 0) + this.myOrder = (int)(((this.myAttenuation - 7.95f) / (this.myBand * 14.36f / this.myFS) + 1.0f) * 2.0f) - 1; + + float[] window = new float[(this.myOrder / 2) + 1]; + float[] coEff = new float[this.myOrder + 1]; + float ps; + float pe; + const float PI = (float)System.Math.PI; + int o2 = this.myOrder / 2; + + //Switch based on algorithm + switch (alg) + { + case Algorithm.Kaiser: + //Kaiser Window function + for (int i = 1; i <= o2; i++) + { + window[i] = Bessel(this.myAlpha * (float)System.Math.Sqrt(1.0f - (float)System.Math.Pow((float)i / o2, 2))) / Bessel(this.myAlpha); + } + + //Stopband attenuation and transition band should be set by the user + break; + + case Algorithm.Hann: + //Hann window function + for (int i = 1; i <= o2; i++) + { + window[i] = 0.5f + 0.5f * (float)System.Math.Cos((PI / (o2 + 1)) * i); + } + + //Set the min stopband attenuation + this.StopBandAttenuation = 44.0f; + + //Set the transition band + this.TransitionBand = 6.22f * this.myFS / this.myOrder; + break; + + case Algorithm.Hamming: + //Hamming window function + for (int i = 1; i <= o2; i++) + { + window[i] = 0.54f + 0.46f * (float)System.Math.Cos((PI / o2) * i); + } + + //Set the min stopband attenuation + this.StopBandAttenuation = 53.0f; + + //Set the transition band + this.TransitionBand = 6.64f * this.myFS / this.myOrder; + break; + + case Algorithm.Blackman: + //Blackman window function + for (int i = 1; i <= o2; i++) + { + window[i] = 0.42f + 0.5f * (float)Math.Cos((PI / o2) * i) + 0.08f * (float)Math.Cos(2.0f * (PI / o2) * i); + } + + //Set the min stopband attenuation + this.StopBandAttenuation = 74.0f; + + //Set the transition band + this.TransitionBand = 11.13f * this.myFS / this.myOrder; + break; + + case Algorithm.Rectangular: + //Rectangular window function + for (int i = 1; i <= o2; i++) + { + window[i] = 1.0f; + } + + //Set the min stopband attenuation + this.StopBandAttenuation = 21.0f; + + //Set the transition band + this.TransitionBand = 1.84f * this.myFS / this.myOrder; + break; + + default: + //Zero all values if nothing was set (error) + for (int i = 1; i <= o2; i++) + { + window[i] = 0.0f; + } + break; + } + + //Switch based on filtertype + switch (filterType) + { + case FilterType.BandPass: + pe = PI / 2 * (this.FreqTo - this.FreqFrom + this.myBand) / this.myFS; + ps = PI / 2 * (this.FreqFrom + this.FreqTo) / this.myFS; + break; + + case FilterType.LowPass: + pe = PI * (this.FreqTo + this.myBand / 2) / this.myFS; + ps = 0.0f; + break; + + case FilterType.HighPass: + pe = PI * (1.0f - (this.FreqFrom - this.myBand / 2) / this.myFS); + ps = PI; + break; + + default: + pe = 0.0f; + ps = 0.0f; + break; + } + + //Set first coefficient value + coEff[0] = pe / PI; + + //Calculate coefficientsw + for (int i = 1; i <= o2; i++) + { + coEff[i] = window[i] * (float)System.Math.Sin(i * pe) * (float)System.Math.Cos(i * ps) / (i * PI); + } + + //Shift Impulse + for (int i = o2 + 1; i <= this.myOrder; i++) + { + coEff[i] = coEff[i - o2]; + } + for (int i = 0; i <= o2 - 1; i++) + { + coEff[i] = coEff[this.myOrder - i]; + } + coEff[o2] = pe / PI; + + return coEff; + } + #endregion + } +} diff --git a/App_code/Utilities/PassBandFilter/FIRFilters.cs b/App_code/Utilities/PassBandFilter/FIRFilters.cs new file mode 100644 index 0000000..aaef716 --- /dev/null +++ b/App_code/Utilities/PassBandFilter/FIRFilters.cs @@ -0,0 +1,324 @@ +//================================================================= +// File: FIRFilters.cs +// +// Namespace: System.Web.UI.DataVisualization.Charting.Utilities +// +// Classes: FIRFilters, FFT +// +// Purpose: Used to perform digital filters on charts +// +//=================================================================== +// Chart Control for ASP.Net +//=================================================================== + +using System; +using System.Collections.Generic; +using System.Text; +using System.Web.UI.DataVisualization.Charting; + +namespace System.Web.UI.DataVisualization.Charting.Utilities +{ + /// + /// Helper class which implements the filtering functions. Currently Low Pass, High Pass and + /// Band Pass are implemented. + /// + class FIRFilters + { + #region Members + /// + /// The number of samples is the same as the number of points + /// + private int mySamples; + + /// + /// Holds the coefficient from the window function + /// + private float[] myCoeff; + + /// + /// Holds the series which has the input data + /// + private Series myInputSeries; + + /// + /// Holds the series which we are outputting to + /// + private Series myFilterSeries; + + /// + /// FFT algorithm object + /// + private FFT myFFT; + + /// + /// Holds the current algorithm selected. Enumeration type is drawn from the FFT object. + /// + public FFT.Algorithm CurrentAlgorithm; + + private float myFreqFrom; + private float myFreqTo; + private float myAttenuation; + private float myBand; + private float myAlpha; + private int myTaps; + private int myOrder; + #endregion + + #region Properties + /// + /// The starting passband frequency, must be lower than ending frequency. + /// + public float FreqFrom + { + get { return myFreqFrom; } + set { myFreqFrom = value; } + } + + /// + /// The ending passband frequency, must be higher than starting frequency. + /// + public float FreqTo + { + get { return myFreqTo; } + set { myFreqTo = value; } + } + + /// + /// Stopband attenuation + /// + public float StopBandAttenuation + { + get { return myAttenuation; } + set { + myAttenuation = value; + this.myFFT.StopBandAttenuation = myAttenuation; + } + } + + /// + /// Transition band + /// + public float TransitionBand + { + get { return myBand; } + set { + myBand = value; + this.myFFT.TransitionBand = myBand; + } + } + + /// + /// Alpha value used for the Kaiser algorithm. + /// + public float Alpha + { + get { return myAlpha; } + set { + myAlpha = value; + this.myFFT.Alpha = myAlpha; + } + } + + /// + /// Number of taps to be used. Taps is the number of samples processed at any one time. + /// + public int Taps + { + get { return myTaps; } + set { myTaps = value; } + } + + /// + /// Filter order. Must be an even number. + /// + public int Order + { + get { return myOrder; } + set + { + //Assure value is even + if ((value % 2) == 0) + { + myOrder = value; + this.myFFT.Order = myOrder; + } + else + throw new ArgumentOutOfRangeException("Order", "Filter order must be an even number."); + } + } + #endregion + + #region Constructors + /// + /// Main constructor. Resets all settings within the FFT algorithm object. + /// + public FIRFilters() + { + //Create a new FFT object + this.myFFT = new FFT(); + + //Default algorithm to Kaiser + this.CurrentAlgorithm = FFT.Algorithm.Kaiser; + + //Default taps to 35 + this.myTaps = 35; + } + #endregion + + #region Methods + /// + /// Performs a low pass filter. Output series will be cleared before being + /// output to. If passband start and end frequencies are left at 0, defaults are used. + /// + /// Input series that contains input data. Input Y-Values must be contained in YValues[0] or unexpected output will occur + /// Output series to which filter will be written. Output Y-Values are written to YValues[0] + public void LowPassFilter(Series iseries, Series oseries) + { + //If no start and end frequencies are specified, default low pass frequency range to: + //0 - 1000hz + if (this.myFreqFrom == 0.0f && this.myFreqTo == 0.0f) + { + this.myFFT.FreqFrom = 0.0f; + this.myFFT.FreqTo = 1000.0f; + } + else + { + this.myFFT.FreqFrom = this.myFreqFrom; + this.myFFT.FreqTo = this.myFreqTo; + } + + //Generate the actual coefficients + this.myCoeff = this.myFFT.GenerateCoefficients(FFT.FilterType.LowPass, CurrentAlgorithm); + + //Filter the series based on the coefficients generated + Filter(iseries, oseries); + } + + /// + /// Performs a high pass filter. Output series will be cleared before being + /// output to. If passband start and end frequencies are left at 0, defaults are used. + /// + /// Input series that contains input data. Input Y-Values must be contained in YValues[0] or unexpected output will occur + /// Output series to which filter will be written. Output Y-Values are written to YValues[0] + public void HighPassFilter(Series iseries, Series oseries) + { + //If no start and end frequencies are specified, default high pass frequency range to: + //2000 - 4000hz + if (this.myFreqFrom == 0.0f && this.myFreqTo == 0.0f) + { + this.myFFT.FreqFrom = 2000.0f; + this.myFFT.FreqTo = 4000.0f; + } + else + { + this.myFFT.FreqFrom = this.myFreqFrom; + this.myFFT.FreqTo = this.myFreqTo; + } + + //Generate the actual coefficients + this.myCoeff = this.myFFT.GenerateCoefficients(FFT.FilterType.HighPass, CurrentAlgorithm); + + //Filter the series based on the coefficients generated + Filter(iseries, oseries); + } + + /// + /// Performs a band pass filter. Output series will be cleared before being + /// output to. If passband start and end frequencies are left at 0, defaults are used. + /// + /// Input series that contains input data. Input Y-Values must be contained in YValues[0] or unexpected output will occur + /// Output series to which filter will be written. Output Y-Values are written to YValues[0] + public void BandPassFilter(Series iseries, Series oseries) + { + //If no start and end frequencies are specified, default band pass frequency range to: + //1000 - 1000hz + if (this.myFreqFrom == 0.0f && this.myFreqTo == 0.0f) + { + this.myFFT.FreqFrom = 1000.0f; + this.myFFT.FreqTo = 1000.0f; + } + else + { + this.myFFT.FreqFrom = this.myFreqFrom; + this.myFFT.FreqTo = this.myFreqTo; + } + + //Generate the actual coefficients + this.myCoeff = this.myFFT.GenerateCoefficients(FFT.FilterType.BandPass, CurrentAlgorithm); + + //Filter the series based on the coefficients generated + Filter(iseries, oseries); + } + #endregion + + #region Initialization + /// + /// Initializes the FIRFilters object by setting the input and output series members for use + /// by the filter. + /// + /// Input series that contains input data + /// Output series to which filter will be written + private void SetIOSeries(Series iseries, Series oseries) + { + this.myInputSeries = iseries; + this.myFilterSeries = oseries; + + //Samples is the number of points contained in the input + this.mySamples = myInputSeries.Points.Count; + } + #endregion + + #region Filter + /// + /// Performs the actual filter. Coefficients should have already be generated by the calling + /// function, this function merely applies them and physically adds the points to the output series. + /// + /// Input series that contains input data + /// Output series to which filter will be written + private void Filter(Series iseries, Series oseries) + { + float[] x = new float[myTaps]; + float y; + + //Set the series + SetIOSeries(iseries, oseries); + + //Clear series + myFilterSeries.Points.Clear(); + + //Initialize x + for (int i = 1; i < myTaps; i++) + x[i] = 0.0f; + + //Loop through every data point + for (int i = 0; i < mySamples; i++) + { + //Initialize y + y = 0.0f; + + //Obtain the data value (Y value) at the specified X value (i) + x[0] = Convert.ToSingle(myInputSeries.Points[i].YValues[0]); + + //Loop through from 0 to number of taps and calculate the sum + try + { + for (int j = 0; j < myTaps; j++) + y = y + (x[j] * myCoeff[j]); + } + catch (Exception e) + { + System.Diagnostics.Debug.WriteLine(e.Message + " Check filter order."); + throw; + } + + //Shift all x values by 1 to the right + for (int j = myTaps - 1; j > 0; j--) + x[j] = x[j - 1]; + + //Add the y value to the output series at the current x value + myFilterSeries.Points.Add(new System.Web.UI.DataVisualization.Charting.DataPoint(i, y)); + } + } + #endregion + } +} diff --git a/App_code/Utilities/PassBandFilter/_system~.ini b/App_code/Utilities/PassBandFilter/_system~.ini new file mode 100644 index 0000000..e69de29 diff --git a/App_code/Utilities/PassBandFilter/vssver2.scc b/App_code/Utilities/PassBandFilter/vssver2.scc new file mode 100644 index 0000000..c003f68 Binary files /dev/null and b/App_code/Utilities/PassBandFilter/vssver2.scc differ diff --git a/App_code/Utilities/PieCollectedDataHelper/PieCollectedDataHelper.cs b/App_code/Utilities/PieCollectedDataHelper/PieCollectedDataHelper.cs new file mode 100644 index 0000000..1b60ba9 --- /dev/null +++ b/App_code/Utilities/PieCollectedDataHelper/PieCollectedDataHelper.cs @@ -0,0 +1,372 @@ +using System; +using System.Drawing; +using System.Drawing.Drawing2D; +using System.Web.UI.DataVisualization.Charting; +using System.Collections; + +namespace System.Web.UI.DataVisualization.Charting.Utilities +{ + /// + /// Helper class which improves the readability of the small segments in the Pie chart. + /// Pie segments which are too small are shown in a supplemental pie chart series. + /// + public class PieCollectedDataHelper + { + #region Fields + + /// + /// Specifies the percentage of the total series values. This value determines + /// if the data point value is a "small" value and should be shown as collected. + /// + public double CollectedPercentage = 5.0; + + /// + /// Position in relative coordinates ( 0,0 - top left corner; 100,100 - bottom right corner) + /// where original and supplemental pie charts should be placed. + /// + public RectangleF ChartAreaPosition = new RectangleF(5f, 5f, 90f, 90f); + + /// + /// Indicates if small segments should be shown as one "collected" segment in the original series + /// + public bool ShowCollectedDataAsOneSlice = false; + + /// + /// Spacing between the original and supplemental chart areas in percentage + /// + public float ChartAreaSpacing = 5f; + + /// + /// Size ratio between the original and supplemental chart areas. + /// Value of 1.0f indicates that same area size will be used. + /// + public float SupplementedAreaSizeRatio = 0.9f; + + /// + /// Color of the connection lines + /// + public Color ConnectionLinesColor = Color.FromArgb(64, 64, 64); + + /// + /// Collected pie segment label + /// + public string CollectedLabel = "Other"; + + + // Reference to the parameters + private Chart chartControl = null; + private Series series = null; + + // Internal use fields + private Series supplementalSeries = null; + private ChartArea originalChartArea = null; + private ChartArea supplementalChartArea = null; + private float collectedPieSliceAngle = 0f; + + #endregion // Fields + + #region Constructor + + /// + /// Public constructor. + /// + /// Reference to the chart control. + public PieCollectedDataHelper(Chart chartControl) + { + this.chartControl = chartControl; + + // Handle chart PostPaint event to draw the "connection" between the + // collected pie slice and supplemental chart. + this.chartControl.PostPaint +=new EventHandler(this.chart_PostPaint); + } + + #endregion // Constructor + + #region Methods + + /// + /// Shows small pie segments as supplemental pie chart series in the new chart area. + /// + /// Series name + public void ShowSmallSegmentsAsSupplementalPie(string seriesName) + { + // Validate input + if(this.chartControl == null) + { + throw(new ArgumentNullException("chartControl")); + } + if(this.CollectedPercentage > 100.0 || this.CollectedPercentage < 0.0) + { + throw(new ArgumentException("Value must be in range from 0 to 100 percent.", "CollectedPercentage")); + } + + // Initialize reference to the series + this.series = this.chartControl.Series[seriesName]; + + // Check input series type + if(this.series.ChartType != SeriesChartType.Pie && + this.series.ChartType != SeriesChartType.Doughnut) + { + throw(new InvalidOperationException("Only series with Pie or Doughnut chart type can be used.")); + } + + // Check if specified series has data points + if(series.Points.Count == 0) + { + throw(new InvalidOperationException("Cannot perform operatiuon on an empty series.")); + } + + // Create "collected" pie slice in original series + this.supplementalChartArea = null; + if( CreateCollectedPie() ) + { + // Calculate width of supplemental chart area + float supplementalWidth = (this.ChartAreaPosition.Width - this.ChartAreaSpacing) / 2f * this.SupplementedAreaSizeRatio; + + // Adjust position of the original chart area + this.originalChartArea = this.chartControl.ChartAreas[this.series.ChartArea]; + originalChartArea.Position.X = this.ChartAreaPosition.X; + originalChartArea.Position.Y = this.ChartAreaPosition.Y; + originalChartArea.Position.Width = this.ChartAreaPosition.Width - supplementalWidth - this.ChartAreaSpacing; + originalChartArea.Position.Height = this.ChartAreaPosition.Height; + + // Original chart area must be in 2D mode + originalChartArea.Area3DStyle.Enable3D = false; + + // Create and adjust position of the supplemental chart area + this.supplementalChartArea = new ChartArea(); + supplementalChartArea.Name = originalChartArea.Name + "_Supplemental"; + supplementalChartArea.Position.X = originalChartArea.Position.Right + this.ChartAreaSpacing; + supplementalChartArea.Position.Y = this.ChartAreaPosition.Y; + supplementalChartArea.Position.Width = supplementalWidth; + supplementalChartArea.Position.Height = this.ChartAreaPosition.Height; + this.chartControl.ChartAreas.Add(supplementalChartArea); + + // Create supplemental pie chart series to show all the collected data + this.supplementalSeries.Name = this.series.Name + "_Supplemental"; + this.supplementalSeries.ChartArea = supplementalChartArea.Name; + this.chartControl.Series.Add(supplementalSeries); + + // Copy some attributes from the original chart area + supplementalChartArea.BackColor = originalChartArea.BackColor; + supplementalChartArea.BorderColor = originalChartArea.BorderColor; + supplementalChartArea.BorderWidth = originalChartArea.BorderWidth; + supplementalChartArea.ShadowOffset = originalChartArea.ShadowOffset; + + // Copy some attributes from the original series + this.supplementalSeries.ChartType = this.series.ChartType; + this.supplementalSeries.Palette = this.series.Palette; + this.supplementalSeries.ShadowOffset = this.series.ShadowOffset; + this.supplementalSeries.BorderColor = this.series.BorderColor; + this.supplementalSeries.BorderWidth = this.series.BorderWidth; + this.supplementalSeries.IsValueShownAsLabel = this.series.IsValueShownAsLabel; + this.supplementalSeries.LabelBackColor = this.series.LabelBackColor; + this.supplementalSeries.LabelBorderColor = this.series.LabelBorderColor; + this.supplementalSeries.LabelBorderWidth = this.series.LabelBorderWidth; + this.supplementalSeries.LabelFormat = this.series.LabelFormat; + this.supplementalSeries.Font = this.series.Font; + } + } + + /// + /// Creates the "collected" pie slice data point by re moving and accumulating all + /// the values of the data points which values are less then specified percentage. + /// + /// True if collected pie slice was created. + private bool CreateCollectedPie() + { + // Create supplemental series + this.supplementalSeries = new Series(); + + // Calculate total vale of all point in series + double total = 0.0; + foreach(DataPoint dataPoint in this.series.Points) + { + total += Math.Abs(dataPoint.YValues[0]); + } + + // Count how many data points will be presented as collected + double minValue = total / 100.0 * this.CollectedPercentage; + int collectedPointsCount = 0; + for(int index = 0; index < this.series.Points.Count; index++) + { + double pointValue = Math.Abs(this.series.Points[index].YValues[0]); + if(pointValue <= minValue) + { + ++collectedPointsCount; + } + } + + // Do not collect data points if one or less points left in the original series + if( (this.series.Points.Count - collectedPointsCount) <= 1 || + collectedPointsCount <= 1) + { + return false; + } + + // Add Collected data point into series before applying palette colors + DataPoint colectedDataPoint = null; + if(this.ShowCollectedDataAsOneSlice) + { + colectedDataPoint = new DataPoint(this.series); + this.series.Points.Add(colectedDataPoint); + } + + + // Apply pallete colors to series to save same data point colors + // in supplemental series. + this.chartControl.ApplyPaletteColors(); + foreach(DataPoint dataPoint in this.series.Points) + { + // Setting data point color to itself will clear the internal flag which + // indicates that point color should be taken from the palette again when + // control is rendered next time. + dataPoint.Color = dataPoint.Color; + } + + // Remove points which value is less than specified percentage from total + double collectedValue = 0.0; + for(int index = 0; index < this.series.Points.Count; index++) + { + double pointValue = Math.Abs(this.series.Points[index].YValues[0]); + if(pointValue <= minValue && + this.series.Points[index] != colectedDataPoint) + { + // Add point value to the collected value + collectedValue += pointValue; + + // Add point to supplemental series + this.supplementalSeries.Points.Add(this.series.Points[index].Clone()); + + // Remove point from the series + this.series.Points.RemoveAt(index); + --index; + } + } + + // Add all collected data points at the end of the series + if(!ShowCollectedDataAsOneSlice) + { + foreach(DataPoint dataPoint in this.supplementalSeries.Points) + { + DataPoint dataPointCollected = dataPoint.Clone(); + dataPoint.IsVisibleInLegend = false; + this.series.Points.Add(dataPointCollected); + + // Disable labels in collected slices + dataPointCollected.Label = String.Empty; + dataPointCollected.LegendText = dataPointCollected.AxisLabel; + dataPointCollected.AxisLabel = String.Empty; + dataPointCollected.IsValueShownAsLabel = false; + } + } + + // Check if we need to add the "collected" data point + if(collectedValue > 0.0) + { + // Set collected data point value and other attributes + if(this.ShowCollectedDataAsOneSlice) + { + colectedDataPoint.YValues[0] = collectedValue; + colectedDataPoint.Label = this.CollectedLabel; + colectedDataPoint.IsVisibleInLegend = false; + + // Note: Collected data point may be exploded + //colectedDataPoint["Exploded"] = "true"; + } + + // Calculate collected pie slice angle + this.collectedPieSliceAngle = (float) ( (360f / 100f) * (collectedValue / (total / 100) ) ); + + // Adjust the Pie chart start angle, so that the middle of the + // collected slice looks directly at 3 o'clock. + int startAngle = (int)Math.Round(this.collectedPieSliceAngle / 2.0); + this.series["PieStartAngle"] = startAngle.ToString(); + + return true; + } + else if(colectedDataPoint != null) + { + // Remove collected data point + this.series.Points.Remove(colectedDataPoint); + } + + return false; + } + + /// + /// Chart post paint event handler. + /// Used to draw the "connection" lines between the original and supplemental pies. + /// + /// Event sender. + /// Event arguments. + private void chart_PostPaint(object sender, System.Web.UI.DataVisualization.Charting.ChartPaintEventArgs e) + { + if(sender is ChartArea) + { + ChartArea area = (ChartArea)sender; + if(this.supplementalChartArea != null && + area.Name == this.supplementalChartArea.Name) + { + // Get position of the plotting areas in pixels + RectangleF originalPosition = GetChartAreaPlottingPosition(this.originalChartArea, e.ChartGraphics); + RectangleF supplementalPosition = GetChartAreaPlottingPosition(this.supplementalChartArea, e.ChartGraphics); + + // Get coordinates of the "connection" lines + PointF p1 = GetRotatedPlotAreaPoint(supplementalPosition, 325f); + PointF p2 = GetRotatedPlotAreaPoint(supplementalPosition, 215f); + PointF p3 = GetRotatedPlotAreaPoint(originalPosition, 90f - this.collectedPieSliceAngle / 2f); + PointF p4 = GetRotatedPlotAreaPoint(originalPosition, 90f + this.collectedPieSliceAngle / 2f); + + // Draw "connection lines" + using( Pen pen = new Pen(this.ConnectionLinesColor, 1) ) + { + e.ChartGraphics.Graphics.DrawLine(pen, p1, p3); + e.ChartGraphics.Graphics.DrawLine(pen, p2, p4); + } + } + } + } + + /// + /// Helper method which calculates a point on the edje of the pie chart using + /// specified angle. + /// + /// Chart are position in pixels. + /// Point angle in degrees. + /// Point location in pixels. + private PointF GetRotatedPlotAreaPoint(RectangleF areaPosition, float angle) + { + PointF[] points = new PointF[1]; + points[0] = new PointF(areaPosition.X + areaPosition.Width / 2f, areaPosition.Y); + using( Matrix transformMatrix = new Matrix() ) + { + transformMatrix.RotateAt(angle, new PointF( + areaPosition.X + areaPosition.Width / 2f, + areaPosition.Y + areaPosition.Height / 2f) ); + + transformMatrix.TransformPoints(points); + } + return points[0]; + } + + /// + /// Helper method which calculates chart area plotting position in pixels. + /// + /// Chart area to get the plotting area position. + /// Chart graphics object. + /// Chart area ploting area position in pixels. + private RectangleF GetChartAreaPlottingPosition(ChartArea area, ChartGraphics chartGraphics) + { + RectangleF plottingRect = area.Position.ToRectangleF(); + plottingRect.X += (area.Position.Width / 100F) * area.InnerPlotPosition.X; + plottingRect.Y += (area.Position.Height / 100F) * area.InnerPlotPosition.Y; + plottingRect.Width = (area.Position.Width / 100F) * area.InnerPlotPosition.Width; + plottingRect.Height = (area.Position.Height / 100F) * area.InnerPlotPosition.Height; + plottingRect = chartGraphics.GetAbsoluteRectangle(plottingRect); + return plottingRect; + } + + #endregion // Methods + } +} \ No newline at end of file diff --git a/App_code/Utilities/PieCollectedDataHelper/_system~.ini b/App_code/Utilities/PieCollectedDataHelper/_system~.ini new file mode 100644 index 0000000..e69de29 diff --git a/App_code/Utilities/PieCollectedDataHelper/vssver2.scc b/App_code/Utilities/PieCollectedDataHelper/vssver2.scc new file mode 100644 index 0000000..0f7fcf1 Binary files /dev/null and b/App_code/Utilities/PieCollectedDataHelper/vssver2.scc differ diff --git a/App_code/Utilities/SixSigma/SixSigma.cs b/App_code/Utilities/SixSigma/SixSigma.cs new file mode 100644 index 0000000..3f3fbe5 --- /dev/null +++ b/App_code/Utilities/SixSigma/SixSigma.cs @@ -0,0 +1,1053 @@ +//================================================================= +// File: SixSigma.cs +// +// Namespace: System.Web.UI.DataVisualization.Charting.Utilities +// +// Classes: SixSigma +// +// Purpose: To create SixSigma charts. +// +//=================================================================== +// Chart Control for ASP.Net +// Copyright ?Microsoft Corporation, all rights reserved +//=================================================================== + +using System; +using System.Data; +using System.Configuration; +using System.Drawing; +using System.Web.UI.DataVisualization.Charting; + +namespace System.Web.UI.DataVisualization.Charting.Utilities +{ + /// + /// SixSigma is a utility that includes useful functions related to the Six Sigma strategy. + /// This utility mainly focuses on those parts of the strategy that involve charting, and producing + /// those charts. + /// + public class SixSigma + { + #region Members + /// + /// sBar holds a value if an schart has been created. sBar is used for a XBAR chart. + /// + private float mysBar = 0; + + /// + /// rBar holds a value if an rchart has been created. rBar is used for a XBAR chart. + /// + private float myrBar = 0; + + /// + /// Holds the n value passed into sChart or rChart for use by XBAR. + /// + private int mynValue = 0; + + private bool myAutoFitLines; + private bool myShowLineLabels; + private Color myLineColor; + private Color myForeColor; + private Font myFont; + #endregion + + #region Properties + /// + /// Controls whether the AxisY will have an automatic Maximum set so that the chart will always + /// contain the UCL annotation. If left to false, it is up to the user to set a maximum AxisY value + /// such that all annotations appear on the graph. + /// + public bool AutoFitLines + { + get { return myAutoFitLines; } + set { myAutoFitLines = value; } + } + + /// + /// Controls whether text is added to the lines to label what they are. + /// + public bool ShowLineLabels + { + get { return myShowLineLabels; } + set { myShowLineLabels = value; } + } + + /// + /// Specifies the colour of the line annotations added to each chart. + /// + public Color LineColor + { + get { return myLineColor; } + set { myLineColor = value; } + } + + /// + /// Specifies the colour of the text that will label the lines. + /// + public Color ForeColor + { + get { return myForeColor; } + set { myForeColor = value; } + } + + /// + /// Specifies the font of the text that will label the lines. + /// + public Font Font + { + get { return myFont; } + set { myFont = value; } + } + #endregion + + #region Constructors + /// + /// Default Constructor. + /// + public SixSigma() + { + myAutoFitLines = false; + myShowLineLabels = false; + myLineColor = Color.Red; + myForeColor = Color.Red; + myFont = new Font("Arial", 8); + } + #endregion + + #region Chart Creation Methods + /// + /// Creates a C-Chart with lines indicating cBar, UCL and LCL. A C-Chart is a measure of the number of + /// non-conformities per unit, where unit is a fixed rate. + /// + /// An array holding the subgroups. Must aline with the nonconform array. + /// An array holding the non-conformity data associated with the subgroups. Must aline with the subgroups. + /// The chart which will have the created series added to it. + /// Series which has been created and added to the output chart. + public Series cChart(float[] subgroup, float[] nonconform, Chart output) + { + //Assure the input all have the same number of items. + if (subgroup.Length != nonconform.Length) + throw new ArgumentException("Input arrays must all be the same length.", "subgroup, nonconform"); + + //c holds the total number of items (subgroups). + int c = subgroup.Length; + + //Declare and initialize cBar, LCL and UCL. + float cbar = 0; + float LCL = 0; + float UCL = 0; + + //Calculate cbar. + for (int i = 0; i < c; i++) + { + cbar += (float)(nonconform[i]); + } + cbar /= c; + + //Calculate UCL and LCL. + UCL = (float)(cbar + 3 * System.Math.Sqrt(cbar)); + LCL = (float)(cbar - 3 * System.Math.Sqrt(cbar)); + + //If LCL is less than zero, then it should be zero. + if (LCL < 0) + LCL = 0; + + //Create the series for the cchart data. + Series cseries = new Series("cseries"); + //Graph subgroups vs. non-conformities. + for (int i = 0; i < c; i++) + cseries.Points.AddXY(subgroup[i], nonconform[i]); + + //Set the series type to a line. + cseries.ChartType = SeriesChartType.Line; + + //Add the series to the chart. + output.Series.Add(cseries); + + //Add the lines to the graph as annotations. + //cBar line. + addLineAnnotation(output.ChartAreas[cseries.ChartArea].AxisX, output.ChartAreas[cseries.ChartArea].AxisY, + cseries.Points[0].XValue, cbar, cseries.Points[c - 1].XValue, 0, output); + + //UCL line. + addLineAnnotation(output.ChartAreas[cseries.ChartArea].AxisX, output.ChartAreas[cseries.ChartArea].AxisY, + cseries.Points[0].XValue, UCL, cseries.Points[c - 1].XValue, 0, output); + + //LCL line. + addLineAnnotation(output.ChartAreas[cseries.ChartArea].AxisX, output.ChartAreas[cseries.ChartArea].AxisY, + cseries.Points[0].XValue, LCL, cseries.Points[c - 1].XValue, 0, output); + + //Add Text Annotations (line labels) if the user desired. + if (myShowLineLabels) + { + addTextAnnotation("CBAR", output.ChartAreas[cseries.ChartArea].AxisX, output.ChartAreas[cseries.ChartArea].AxisY, + cseries.Points[0].XValue, cbar, output); + + addTextAnnotation("UCL", output.ChartAreas[cseries.ChartArea].AxisX, output.ChartAreas[cseries.ChartArea].AxisY, + cseries.Points[0].XValue, UCL, output); + + addTextAnnotation("LCL", output.ChartAreas[cseries.ChartArea].AxisX, output.ChartAreas[cseries.ChartArea].AxisY, + cseries.Points[0].XValue, LCL, output); + } + + //Scale the chart if the user has requested it. + FitChart(UCL, cseries.ChartArea, output); + + //Return the series. + return cseries; + } + + /// + /// Creates a P-Chart with lines indicating pBar, UCL and LCL. A P-Chart is the same as an NP-Chart except + /// with a variable number of items in each subgroup. + /// + /// An array holding the subgroups. Must aline with the nonconform array and the number tested. + /// An array holding the non-conformity data associated with the subgroups. Must aline with the subgroups and the number tested. + /// An array holding the number of items in each subgroup. Must aline with the subgroups and the nonconform array. + /// The chart which will have the created series added to it. + /// Series which has been created and added to the output chart. + public Series pChart(float[] subgroup, float[] nonconform, float[] numbertested, Chart output) + { + //Assure the input all have the same number of items. + if ((subgroup.Length != nonconform.Length) || (subgroup.Length != numbertested.Length) || (nonconform.Length != numbertested.Length)) + throw new ArgumentException("Input arrays must all be the same length.", "subgroup, nonconform, numbertested"); + + //c holds the total number of items (subgroups). + int c = subgroup.Length; + + //Declare and initialize phat, UCL, LCL and pBar. + float[] phat = new float[c]; + float[] UCL = new float[c]; + float[] LCL = new float[c]; + float pbar = 0; + + //Calculate phat(i). + for (int i = 0; i < c; i++) + phat[i] = nonconform[i] / numbertested[i]; + + //Calculate pbar. + for (int i = 0; i < c; i++) + { + pbar += phat[i]; + } + pbar /= c; + + //Calculate UCL and LCL. + for (int i = 0; i < c; i++) + { + UCL[i] = (float)(pbar + 3 * System.Math.Sqrt((pbar * (1 - pbar)) / numbertested[i])); + LCL[i] = (float)(pbar - 3 * System.Math.Sqrt((pbar * (1 - pbar)) / numbertested[i])); + } + + //Create the series for the pchart data. + Series pseries = new Series("pseries"); + //Graph subgroup vs. proportion. + for (int i = 0; i < c; i++) + pseries.Points.AddXY(subgroup[i], phat[i]); + + //Set the series type to a line. + pseries.ChartType = SeriesChartType.Line; + + //Add the series to the chart. + output.Series.Add(pseries); + + //Add the lines to the graph as annotations. + //PBAR line. + addLineAnnotation(output.ChartAreas[pseries.ChartArea].AxisX, output.ChartAreas[pseries.ChartArea].AxisY, + pseries.Points[0].XValue, pbar, pseries.Points[c - 1].XValue, 0, output); + + //Add the UCL and LCL line segments as individual line annotations. + for (int i = 0; i < c - 1; i++) + { + //UCL line. + addLineAnnotation(output.ChartAreas[pseries.ChartArea].AxisX, output.ChartAreas[pseries.ChartArea].AxisY, + subgroup[i], UCL[i], subgroup[i + 1] - subgroup[i], UCL[i + 1] - UCL[i], output); + + //LCL line. + addLineAnnotation(output.ChartAreas[pseries.ChartArea].AxisX, output.ChartAreas[pseries.ChartArea].AxisY, + subgroup[i], LCL[i], subgroup[i + 1] - subgroup[i], LCL[i + 1] - LCL[i], output); + } + + //Add Text Annotations (line labels) if the user desired. + if (myShowLineLabels) + { + addTextAnnotation("PBAR", output.ChartAreas[pseries.ChartArea].AxisX, output.ChartAreas[pseries.ChartArea].AxisY, + pseries.Points[0].XValue, pbar, output); + + addTextAnnotation("UCL", output.ChartAreas[pseries.ChartArea].AxisX, output.ChartAreas[pseries.ChartArea].AxisY, + pseries.Points[0].XValue, UCL[0], output); + + addTextAnnotation("LCL", output.ChartAreas[pseries.ChartArea].AxisX, output.ChartAreas[pseries.ChartArea].AxisY, + pseries.Points[0].XValue, LCL[0], output); + } + + //Find the maximum UCL value and store the index of it. + int maxUCL = 0; + for (int i = 1; i < c; i++) + if (UCL[maxUCL] < UCL[i]) + maxUCL = i; + + //Scale the chart if the user has requested it. + FitChart(UCL[maxUCL], pseries.ChartArea, output); + + //Return the series. + return pseries; + } + + /// + /// Creates an NP-Chart with lines indicating CL, UCL and LCL. An NP chart is the same as a P-chart except + /// that the number of items in each subgroup is the same. + /// + /// An array holding the subgroups. Must aline with the nonconform array. + /// An array holding the non-conformity data associated with the subgroups. Must aline with the subgroups. + /// An array holding the number of items in each subgroup. Must aline with the subgroups and the nonconform array. + /// The chart which will have the created series added to it. + /// Series which has been created and added to the output chart. + public Series npChart(float[] subgroup, float[] nonconform, int numbertested, Chart output) + { + //Assure the input all have the same number of items. + if (subgroup.Length != nonconform.Length) + throw new ArgumentException("Input arrays must all be the same length.", "subgroup, nonconform, numbertested"); + + //c holds the total number of items (subgroups). + int c = subgroup.Length; + + //Declare and initialize UCL, LCL and pBar. + float UCL = 0; + float LCL = 0; + float pbar = 0; + + //Calculate pbar. + for (int i = 0; i < c; i++) + { + pbar += nonconform[i]; + } + pbar /= (c * numbertested); + + //Calculate UCL and LCL. + UCL = (float)(numbertested * pbar + 3 * System.Math.Sqrt(numbertested * pbar * (1 - pbar))); + LCL = (float)(numbertested * pbar - 3 * System.Math.Sqrt(numbertested * pbar * (1 - pbar))); + + //If LCL is less than zero, then it should be zero. + if (LCL < 0) + LCL = 0; + + //Create the npseries + Series npseries = new Series("npseries"); + //Graph subgroup vs. non-conforming values. + for (int i = 0; i < c; i++) + npseries.Points.AddXY(subgroup[i], nonconform[i]); + + //Set the type to line series. + npseries.ChartType = SeriesChartType.Line; + + //Add the series to the chart. + output.Series.Add(npseries); + + //Add the lines to the graph as annotations. + //CL line. + addLineAnnotation(output.ChartAreas[npseries.ChartArea].AxisX, output.ChartAreas[npseries.ChartArea].AxisY, + npseries.Points[0].XValue, pbar * 100, npseries.Points[c - 1].XValue, 0, output); + + //UCL line. + addLineAnnotation(output.ChartAreas[npseries.ChartArea].AxisX, output.ChartAreas[npseries.ChartArea].AxisY, + npseries.Points[0].XValue, UCL, npseries.Points[c - 1].XValue, 0, output); + + //LCL line. + addLineAnnotation(output.ChartAreas[npseries.ChartArea].AxisX, output.ChartAreas[npseries.ChartArea].AxisY, + npseries.Points[0].XValue, LCL, npseries.Points[c - 1].XValue, 0, output); + + //Add Text Annotations (line labels) if the user desired. + if (myShowLineLabels) + { + addTextAnnotation("PBAR", output.ChartAreas[npseries.ChartArea].AxisX, output.ChartAreas[npseries.ChartArea].AxisY, + npseries.Points[0].XValue, pbar * 100, output); + + addTextAnnotation("UCL", output.ChartAreas[npseries.ChartArea].AxisX, output.ChartAreas[npseries.ChartArea].AxisY, + npseries.Points[0].XValue, UCL, output); + + addTextAnnotation("LCL", output.ChartAreas[npseries.ChartArea].AxisX, output.ChartAreas[npseries.ChartArea].AxisY, + npseries.Points[0].XValue, LCL, output); + } + + //Scale the chart if the user has requested it. + FitChart(UCL, npseries.ChartArea, output); + + //Return the series. + return npseries; + } + + /// + /// Creates a U-Chart with UBar, UCL and LCL lines. A U-Chart is used when the desired chart + /// is that of the number of non-conformities per inspection unit, where the inspection unit is variable size. + /// + /// An array holding the subgroups. Must aline with the nonconform array. + /// An array holding the non-conformity data associated with the subgroups. Must aline with the subgroups. + /// The number of items in each subgroup. + /// The chart which will have the created series added to it. + /// Series which has been created and added to the output chart. + public Series uChart(float[] subgroup, float[] nonconform, float[] numbertested, Chart output) + { + //Assure the input all have the same number of items. + if ((subgroup.Length != nonconform.Length) || (subgroup.Length != numbertested.Length) || (nonconform.Length != numbertested.Length)) + throw new ArgumentException("Input arrays must all be the same length.", "subgroup, nonconform, numbertested"); + + //c holds the total number of items (subgroups). + int c = subgroup.Length; + + //Declare and initialize UCL, LCL and uBar. + float[] UCL = new float[c]; + float[] LCL = new float[c]; + float ubar = 0; + + //Initialize temporary variables to hold temp sums for the ubar calculation + float sumNumerator = 0; + float sumDenominator = 0; + + //Calculate ubar. + for (int i = 0; i < c; i++) + { + sumNumerator += nonconform[i]; + sumDenominator += numbertested[i]; + } + ubar = sumNumerator / sumDenominator; + + //Calculate the Yvalues + float[] yvalues = new float[c]; + for (int i = 0; i < c; i++) + yvalues[i] = nonconform[i] / numbertested[i]; + + //Calculate UCL and LCL. + for (int i = 0; i < c; i++) + { + UCL[i] = (float)(ubar + 3 * System.Math.Sqrt(ubar / numbertested[i])); + LCL[i] = (float)(ubar - 3 * System.Math.Sqrt(ubar / numbertested[i])); + } + + //Create the series for the pchart data. + Series useries = new Series("useries"); + //Graph subgroup vs. proportion. + for (int i = 0; i < c; i++) + useries.Points.AddXY(subgroup[i], yvalues[i]); + + //Set the series type to a line. + useries.ChartType = SeriesChartType.Line; + + //Add the series to the chart. + output.Series.Add(useries); + + //Add the lines to the graph as annotations. + //UBAR line. + addLineAnnotation(output.ChartAreas[useries.ChartArea].AxisX, output.ChartAreas[useries.ChartArea].AxisY, + useries.Points[0].XValue, ubar, useries.Points[c - 1].XValue, 0, output); + + //Add the UCL and LCL line segments as individual line annotations. + for (int i = 0; i < c - 1; i++) + { + //UCL line. + addLineAnnotation(output.ChartAreas[useries.ChartArea].AxisX, output.ChartAreas[useries.ChartArea].AxisY, + subgroup[i], UCL[i], subgroup[i + 1] - subgroup[i], UCL[i + 1] - UCL[i], output); + + //LCL line. + addLineAnnotation(output.ChartAreas[useries.ChartArea].AxisX, output.ChartAreas[useries.ChartArea].AxisY, + subgroup[i], LCL[i], subgroup[i + 1] - subgroup[i], LCL[i + 1] - LCL[i], output); + } + + //Add Text Annotations (line labels) if the user desired. + if (myShowLineLabels) + { + addTextAnnotation("UBAR", output.ChartAreas[useries.ChartArea].AxisX, output.ChartAreas[useries.ChartArea].AxisY, + useries.Points[0].XValue, ubar, output); + + addTextAnnotation("UCL", output.ChartAreas[useries.ChartArea].AxisX, output.ChartAreas[useries.ChartArea].AxisY, + useries.Points[0].XValue, UCL[0], output); + + addTextAnnotation("LCL", output.ChartAreas[useries.ChartArea].AxisX, output.ChartAreas[useries.ChartArea].AxisY, + useries.Points[0].XValue, LCL[0], output); + } + + //Find the maximum UCL value and store the index of it. + int maxUCL = 0; + for (int i = 1; i < c; i++) + if (UCL[maxUCL] < UCL[i]) + maxUCL = i; + + //Scale the chart if the user has requested it. + FitChart(UCL[maxUCL], useries.ChartArea, output); + + //Return the series. + return useries; + } + + /// + /// Creates a Run Chart of the data and adds an average line. A run chart is a plot of the data without + /// manipulation along with a line indicating where the average of the points is. + /// + /// An array holding the subgroups. Must aline with the data array. + /// An array holding the data. Must aline with the subgroup array. + /// The chart which will have the created series added to it. + /// Series which has been created and added to the output chart. + public Series runChart(float[] subgroup, float[] data, Chart output) + { + //Assure the input all have the same number of items. + if (subgroup.Length != data.Length) + throw new ArgumentException("Input arrays must all be the same length.", "subgroup, data"); + + //c holds the total number of items (subgroups). + int c = subgroup.Length; + + //Declare and initialize a variable to hold the average. + float average = 0; + + //Create the series for the runchart data. + Series runseries = new Series("runseries"); + //Graph subgroups vs. data. + for (int i = 0; i < c; i++) + runseries.Points.AddXY(subgroup[i], data[i]); + + //Set the series type to a line. + runseries.ChartType = SeriesChartType.Line; + + //Add the series to the chart. + output.Series.Add(runseries); + + //Calculate the average. + average = (float)output.DataManipulator.Statistics.Mean("runseries"); + + //Add the lines to the graph as annotations. + //average line. + addLineAnnotation(output.ChartAreas[runseries.ChartArea].AxisX, output.ChartAreas[runseries.ChartArea].AxisY, + runseries.Points[0].XValue, average, runseries.Points[c - 1].XValue, 0, output); + + //Return the series. + return runseries; + } + + /// + /// Creates an S-Chart of prepared data that can be evaluated. If the data is deemed to be in statistical control + /// an XBAR chart can be created via XBARChart function. + /// + /// An array holding the subgroups. Must aline with the data array. There must be at least 20 subgroups. + /// Array holding the Standard Deviation of each subgroup. + /// Number of measurements per subgroup. Must be between 2 and 9. + /// Variable returning the process standard deviation estimation. + /// The chart which will have the created series added to it. + /// Series which has been created and added to the output chart. + public Series sChart(float[] subgroup, float[] data, int n, out float processStdDev, Chart output) + { + //Assure the input all have the same number of items. + if (subgroup.Length != data.Length) + throw new ArgumentException("Input arrays must all be the same length.", "subgroup, data"); + + //Assure there are at least 20 subgroups + if (subgroup.Length < 20) + throw new ArgumentOutOfRangeException("There must be at least 20 subgroups.", "subgroup"); + + //Assure n is between 2 and 9 + if (n < 2 || n > 9) + throw new ArgumentOutOfRangeException("n must be between 1 and 9.", "n"); + + //c holds the total number of items (subgroups). + int c = subgroup.Length; + + //Declare and initialize a variable to hold sbar, UCL and LCL. + float sbar = 0; + float UCL = 0; + float LCL = 0; + + //Declare the constants needed for calculations. + float[] B3 ={ 0, 0, 0, 0, 0.03F, 0.118F, 0.185F, 0.239F }; + float[] B4 ={ 3.267F, 2.568F, 2.266F, 2.089F, 1.970F, 1.882F, 1.815F, 1.761F }; + float[] C4 ={ 0.7979F, 0.8862F, 0.9213F, 0.9400F, 0.9515F, 0.9594F, 0.9650F, 0.9693F }; + + //Calculate sbar which is the center line of the standard deviation of each subgroup. + for (int i = 0; i < c; i++) + sbar += data[i]; + sbar /= c; + + //Calculate UCL and LCL. + //It is n-2 as the number is between 2 and 9, but the array starts at 0. + UCL = B4[n - 2] * sbar; + LCL = B3[n - 2] * sbar; + + //If LCL is less than zero, then it should be zero. + if (LCL < 0) + LCL = 0; + + //Create the series for the sChart data. + Series sseries = new Series("sseries"); + //Graph subgroups vs. data. + for (int i = 0; i < c; i++) + sseries.Points.AddXY(subgroup[i], data[i]); + + //Set the series type to a line. + sseries.ChartType = SeriesChartType.Line; + + //Add the series to the chart. + output.Series.Add(sseries); + + //Add the lines to the graph as annotations. + //sbar line. + addLineAnnotation(output.ChartAreas[sseries.ChartArea].AxisX, output.ChartAreas[sseries.ChartArea].AxisY, + sseries.Points[0].XValue, sbar, sseries.Points[c - 1].XValue, 0, output); + + //UCL line. + addLineAnnotation(output.ChartAreas[sseries.ChartArea].AxisX, output.ChartAreas[sseries.ChartArea].AxisY, + sseries.Points[0].XValue, UCL, sseries.Points[c - 1].XValue, 0, output); + + //LCL line. + addLineAnnotation(output.ChartAreas[sseries.ChartArea].AxisX, output.ChartAreas[sseries.ChartArea].AxisY, + sseries.Points[0].XValue, LCL, sseries.Points[c - 1].XValue, 0, output); + + //Add Text Annotations (line labels) if the user desired. + if (myShowLineLabels) + { + addTextAnnotation("SBAR", output.ChartAreas[sseries.ChartArea].AxisX, output.ChartAreas[sseries.ChartArea].AxisY, + sseries.Points[0].XValue, sbar, output); + + addTextAnnotation("UCL", output.ChartAreas[sseries.ChartArea].AxisX, output.ChartAreas[sseries.ChartArea].AxisY, + sseries.Points[0].XValue, UCL, output); + + addTextAnnotation("LCL", output.ChartAreas[sseries.ChartArea].AxisX, output.ChartAreas[sseries.ChartArea].AxisY, + sseries.Points[0].XValue, LCL, output); + } + + //Scale the chart if the user has requested it. + FitChart(UCL, sseries.ChartArea, output); + + //Calculate process standard deviation. + processStdDev = (float)((sbar / C4[n - 2]) * System.Math.Sqrt(1 - System.Math.Pow(C4[n - 2], 2))); + + //Set the sBar class variable and clear rBar. + this.mysBar = sbar; + this.myrBar = 0; + + //Store the n value for use by XBAR. + this.mynValue = n; + + //Return the series. + return sseries; + } + + /// + /// Creates an R-Chart of prepared data that can be evaluated. If the data is deemed to be in statistical control + /// an XBAR chart can be created via XBARChart function. + /// + /// An array holding the subgroups. Must aline with the data array. There must be at least 20 subgroups. + /// Array holding the Range (biggest value - smallest value) of each subgroup. + /// Number of measurements per subgroup. Must be between 2 and 9. + /// Variable returning the process standard deviation estimation. + /// The chart which will have the created series added to it. + /// Series which has been created and added to the output chart. + public Series rChart(float[] subgroup, float[] data, int n, out float processStdDev, Chart output) + { + //Assure the input all have the same number of items. + if (subgroup.Length != data.Length) + throw new ArgumentException("Input arrays must all be the same length.", "subgroup, data"); + + //Assure there are at least 20 subgroups + if (subgroup.Length < 20) + throw new ArgumentOutOfRangeException("There must be at least 20 subgroups.", "subgroup"); + + //Assure n is between 2 and 9 + if (n < 2 || n > 9) + throw new ArgumentOutOfRangeException("n must be between 1 and 9.", "n"); + + //c holds the total number of items (subgroups). + int c = subgroup.Length; + + //Declare and initialize a variable to hold sbar, UCL and LCL. + float rbar = 0; + float UCL = 0; + float LCL = 0; + + //Declare the constants needed for calculations. + float[] D3 ={ 0, 0, 0, 0, 0, 0.076F, 0.136F, 0.184F }; + float[] D4 ={ 3.267F, 2.574F, 2.282F, 2.114F, 2.004F, 1.924F, 1.864F, 1.816F }; + float[] D2 ={ 1.128F, 1.693F, 2.059F, 2.326F, 2.534F, 2.704F, 2.847F, 2.970F }; + + //Calculate rbar which is the center line of the range of each subgroup. + for (int i = 0; i < c; i++) + rbar += data[i]; + rbar /= c; + + //Calculate UCL and LCL. + //It is n-2 as the number is between 2 and 9, but the array starts at 0. + UCL = D4[n - 2] * rbar; + LCL = D3[n - 2] * rbar; + + //If LCL is less than zero, then it should be zero. + if (LCL < 0) + LCL = 0; + + //Create the series for the sChart data. + Series rseries = new Series("rseries"); + //Graph subgroups vs. data. + for (int i = 0; i < c; i++) + rseries.Points.AddXY(subgroup[i], data[i]); + + //Set the series type to a line. + rseries.ChartType = SeriesChartType.Line; + + //Add the series to the chart. + output.Series.Add(rseries); + + //Add the lines to the graph as annotations. + //sbar line. + addLineAnnotation(output.ChartAreas[rseries.ChartArea].AxisX, output.ChartAreas[rseries.ChartArea].AxisY, + rseries.Points[0].XValue, rbar, rseries.Points[c - 1].XValue, 0, output); + + //UCL line. + addLineAnnotation(output.ChartAreas[rseries.ChartArea].AxisX, output.ChartAreas[rseries.ChartArea].AxisY, + rseries.Points[0].XValue, UCL, rseries.Points[c - 1].XValue, 0, output); + + //LCL line. + addLineAnnotation(output.ChartAreas[rseries.ChartArea].AxisX, output.ChartAreas[rseries.ChartArea].AxisY, + rseries.Points[0].XValue, LCL, rseries.Points[c - 1].XValue, 0, output); + + //Add Text Annotations (line labels) if the user desired. + if (myShowLineLabels) + { + addTextAnnotation("RBAR", output.ChartAreas[rseries.ChartArea].AxisX, output.ChartAreas[rseries.ChartArea].AxisY, + rseries.Points[0].XValue, rbar, output); + + addTextAnnotation("UCL", output.ChartAreas[rseries.ChartArea].AxisX, output.ChartAreas[rseries.ChartArea].AxisY, + rseries.Points[0].XValue, UCL, output); + + addTextAnnotation("LCL", output.ChartAreas[rseries.ChartArea].AxisX, output.ChartAreas[rseries.ChartArea].AxisY, + rseries.Points[0].XValue, LCL, output); + } + + //Scale the chart if the user has requested it. + FitChart(UCL, rseries.ChartArea, output); + + //Calculate process standard deviation. + processStdDev = (float)(rbar / D2[n - 2]); + + //Set the rBar class variable and clear sBar. + this.myrBar = rbar; + this.mysBar = 0; + + //Store the n value for use by XBAR. + this.mynValue = n; + + //Return the series. + return rseries; + } + + /// + /// Creates an XBAR chart of the prepared data. sChart or rChart must have already been called to create a XBAR chart. + /// + /// An array holding the subgroups. Must aline with the data array. + /// Array holding the Mean of each subgroup. Must aline with the subgroup array. + /// The chart which will have the created series added to it. + /// Series which has been created and added to the output chart. + public Series XBARChart(float[] subgroup, float[] data, Chart output) + { + //Call the private function with no MRBAR to graph a separate XBAR chart. + return XBARChartImplementation(subgroup, data, output, 0); + } + + /// + /// Creates an Individuals Chart of the data and places the MRBar, XBAR, UCL and LCL upon it. + /// + /// An array holding the subgroups. Must aline with the data array. + /// An array holding the data. Must aline with the subgroup array. + /// Variable returning the process standard deviation estimation. + /// The chart which will have the created series added to it. + /// Series which has been created and added to the output chart. + public Series individualsChart(float[] subgroup, float[] data, out float processStdDev, Chart output) + { + //Assure the input all have the same number of items. + if (subgroup.Length != data.Length) + throw new ArgumentException("Input arrays must all be the same length.", "subgroup, data"); + + //c holds the total number of items (subgroups). + int c = subgroup.Length; + + //Declare and initialize MRBAR. + float mrbar = 0; + + //Calculate cbar. + for (int i = 0; i < c-1; i++) + { + mrbar += (float)System.Math.Abs(data[i + 1] - data[i]); + } + mrbar /= c - 1; + + //Calculate the process standard deviation. + processStdDev = (float)(mrbar / 1.128); + + //Return the series + return XBARChartImplementation(subgroup, data, output, mrbar); + } + + /// + /// Creates an XBAR chart of the prepared data. This function contains the implementation for the public function with one extra + /// parameter for MRBAR. If MRBAR is specified, then only one chart is created with all the values. + /// + /// An array holding the subgroups. Must aline with the data array. + /// Array holding the Mean of each subgroup. Must aline with the subgroup array. + /// The chart which will have the created series added to it. + /// The value of MRBAR if it has been calculated by Individuals Chart. + /// Series which has been created and added to the output chart. + private Series XBARChartImplementation(float[] subgroup, float[] data, Chart output, float mrbar) + { + //Assure the input all have the same number of items. + if (subgroup.Length != data.Length) + throw new ArgumentException("Input arrays must all be the same length.", "subgroup, nonconform, numbertested"); + + //Assure that either rBar or sBar have a value, and n has a value. If MRBAR has been specified, do not check. + if (mrbar == 0) + if ((this.myrBar == 0 && this.mysBar == 0) || (this.mynValue < 2 || this.mynValue > 9)) + throw new ArgumentException("sChart or rChart must be called before XBAR."); + + //c holds the total number of items (subgroups). + int c = subgroup.Length; + + //Declare and initialize a variable to hold sbar, UCL and LCL. + float xbar = 0; + float UCL = 0; + float LCL = 0; + + //Declare the constants needed for calculations. + float[] A2 ={ 1.880F, 1.023F, 0.729F, 0.577F, 0.483F, 0.419F, 0.373F, 0.337F }; + float[] A3 ={ 2.659F, 1.954F, 1.628F, 1.427F, 1.287F, 1.182F, 1.099F, 1.032F }; + + //Calculate xbar, which is the mean of all the subgroup means. + for (int i = 0; i < c; i++) + xbar += data[i]; + xbar /= c; + + //Calculate UCL and LCL. + //Switch based on if we're calculating from a rChart or a sChart, or if a MRBAR was given. + //It is n-2 as the number is between 2 and 9, but the array starts at 0 + if (mrbar != 0) + { + UCL = (float)(xbar + 2.66 * mrbar); + LCL = (float)(xbar - 2.66 * mrbar); + } + else if (this.mysBar != 0) + { + UCL = xbar + A3[this.mynValue - 2] * this.mysBar; + LCL = xbar - A3[this.mynValue - 2] * this.mysBar; + } + else if (this.myrBar != 0) + { + UCL = xbar + A2[this.mynValue - 2] * this.myrBar; + LCL = xbar - A2[this.mynValue - 2] * this.myrBar; + } + + //If LCL is less than zero, then it should be zero. + if (LCL < 0) + LCL = 0; + + //Create the series for the xbar data. + Series xbarseries = new Series("xbarseries"); + //Graph subgroups vs. data. + for (int i = 0; i < c; i++) + xbarseries.Points.AddXY(subgroup[i], data[i]); + + //Set the series type to a line. + xbarseries.ChartType = SeriesChartType.Line; + + //Add the series to the chart. + output.Series.Add(xbarseries); + + //Add the lines to the graph as annotations. + //xbar line. + addLineAnnotation(output.ChartAreas[xbarseries.ChartArea].AxisX, output.ChartAreas[xbarseries.ChartArea].AxisY, + xbarseries.Points[0].XValue, xbar, xbarseries.Points[c - 1].XValue, 0, output); + + //UCL line. + addLineAnnotation(output.ChartAreas[xbarseries.ChartArea].AxisX, output.ChartAreas[xbarseries.ChartArea].AxisY, + xbarseries.Points[0].XValue, UCL, xbarseries.Points[c - 1].XValue, 0, output); + + //LCL line. + addLineAnnotation(output.ChartAreas[xbarseries.ChartArea].AxisX, output.ChartAreas[xbarseries.ChartArea].AxisY, + xbarseries.Points[0].XValue, LCL, xbarseries.Points[c - 1].XValue, 0, output); + + //MBAR line if it has been specified + if (mrbar != 0) + addLineAnnotation(output.ChartAreas[xbarseries.ChartArea].AxisX, output.ChartAreas[xbarseries.ChartArea].AxisY, + xbarseries.Points[0].XValue, mrbar, xbarseries.Points[c - 1].XValue, 0, output); + + //Add Text Annotations (line labels) if the user desired. + if (myShowLineLabels) + { + addTextAnnotation("XBAR", output.ChartAreas[xbarseries.ChartArea].AxisX, output.ChartAreas[xbarseries.ChartArea].AxisY, + xbarseries.Points[0].XValue, xbar, output); + + addTextAnnotation("UCL", output.ChartAreas[xbarseries.ChartArea].AxisX, output.ChartAreas[xbarseries.ChartArea].AxisY, + xbarseries.Points[0].XValue, UCL, output); + + addTextAnnotation("LCL", output.ChartAreas[xbarseries.ChartArea].AxisX, output.ChartAreas[xbarseries.ChartArea].AxisY, + xbarseries.Points[0].XValue, LCL, output); + + if (mrbar!=0) + addTextAnnotation("MRBAR", output.ChartAreas[xbarseries.ChartArea].AxisX, output.ChartAreas[xbarseries.ChartArea].AxisY, + xbarseries.Points[0].XValue, mrbar, output); + } + + //Scale the chart if the user has requested it. + FitChart(UCL, xbarseries.ChartArea, output); + + //Return the series. + return xbarseries; + } + #endregion + + #region Math Methods + /// + /// Calculates the mean of an array of numbers. + /// + /// The input array of items of which the mean will be calculated. + /// The mean of the data. + public float Mean(float[] data) + { + //Create a temporary variable to hold the sum. + float sum = 0; + + //Calculate the sum of the data items. + for (int i = 0; i < data.Length; i++) + sum += data[i]; + + //Divide them by the total number of items. + sum /= data.Length; + + //Return the mean. + return sum; + } + + /// + /// Calculates the range of an array of numbers. + /// + /// The input array of items of which the range will be calculated. + /// The range of the data. + public float Range(float[] data) + { + //Create two variables: one to hold the index of the largest value and one to hold the index of the smallest value. + int maxIndex = 0; + int minIndex = 0; + + //Find the largest and smallest values in the array. + for (int i = 1; i < data.Length; i++) + { + if (data[maxIndex] < data[i]) + maxIndex = i; + if (data[minIndex] > data[i]) + minIndex = i; + } + + //Return the Range. + return (data[maxIndex] - data[minIndex]); + } + + /// + /// Calculates the standard deviation of an array of numbers. + /// + /// The input array of items of which the standard deviation will be calculated. + /// The standard deviation of the data. + public float StandardDeviation(float[] data) + { + //Create two variables: one to hold the sum of the deviations, and one to hold the mean of the data. + float sumdeviation = 0; + float mean = 0; + + //Calculate the mean. + mean = Mean(data); + + //Calculate the sum of the squared deviations. + for (int i = 0; i < data.Length; i++) + sumdeviation += (float)System.Math.Pow(data[i] - mean, 2); + + //Return the standard deviation. + return (float)System.Math.Sqrt(sumdeviation / (data.Length - 1)); + } + #endregion + + #region Private Methods + /// + /// Scales the chart so that the UCL line will always be within the chart. + /// + /// The maximum UCL value. + /// The name of the chart area we are plotting to. + /// The chart which contains the chart area. + private void FitChart(float UCL, string ChartArea, Chart output) + { + //Check to see if scaling is enabled. + if (myAutoFitLines) + { + //Force the chartarea to recalculate the axis values so that we can find the Y-axis maximum. + output.ChartAreas[ChartArea].RecalculateAxesScale(); + + //Check if UCL is outside the maximum Y value. + if (UCL > (float)output.ChartAreas[ChartArea].AxisY.Maximum) + //If so set the Y-axis maximum to be the UCL value. + output.ChartAreas[ChartArea].AxisY.Maximum = UCL; + } + } + + /// + /// Function to add a line annotation to the desired chart in the format which is followed by + /// all the line annotations in this add-on. + /// + /// X-Axis that the line annotation is to use for co-ordinates. + /// Y-Axis that the line annotation is to use for co-ordinates. + /// X value for the start of the line. + /// Y value for the start of the line. + /// Width of the line. + /// Height of the line. + /// The chart that the line annotation is being added to. + private void addLineAnnotation(Axis AxisX, Axis AxisY, double X, double Y, double Width, double Height, Chart output) + { + //Create a new line annotation. + LineAnnotation lineAnnotation = new LineAnnotation(); + + //Set each property to the parameters passed in. + lineAnnotation.AxisX = AxisX; + lineAnnotation.AxisY = AxisY; + lineAnnotation.Y = Y; + lineAnnotation.X = X; + lineAnnotation.Height = Height; + lineAnnotation.Width = Width; + + //Turn off relative size to get graph-oriented co-ordinates and set the line color. + lineAnnotation.IsSizeAlwaysRelative = false; + lineAnnotation.LineColor = myLineColor; + + //Add the annotation to the chart. + output.Annotations.Add(lineAnnotation); + } + + /// + /// Function to add text as an annotation to the chart. + /// + /// The text that we wish to display. + /// X-Axis that the text annotation is to use for co-ordinates. + /// Y-Axis that the text annotation is to use for co-ordinates. + /// X value for the start of the text. + /// Y value for the start of the text. + /// The chart that the line annotation is being added to. + private void addTextAnnotation(string text, Axis AxisX, Axis AxisY, double X, double Y, Chart output) + { + //Create a new line annotation. + TextAnnotation textAnnotation = new TextAnnotation(); + + //Set each property to the parameters passed in. + textAnnotation.AxisX = AxisX; + textAnnotation.AxisY = AxisY; + textAnnotation.Y = Y; + textAnnotation.X = X; + textAnnotation.Text = text; + + //Turn off relative size to get graph-oriented co-ordinates and set the aesthetic properties. + textAnnotation.IsSizeAlwaysRelative = false; + textAnnotation.ForeColor = myForeColor; + textAnnotation.Font = myFont; + + //Add the annotation to the chart. + output.Annotations.Add(textAnnotation); + } + #endregion + } +} diff --git a/App_code/Utilities/SixSigma/_system~.ini b/App_code/Utilities/SixSigma/_system~.ini new file mode 100644 index 0000000..e69de29 diff --git a/App_code/Utilities/SixSigma/vssver2.scc b/App_code/Utilities/SixSigma/vssver2.scc new file mode 100644 index 0000000..7ba358c Binary files /dev/null and b/App_code/Utilities/SixSigma/vssver2.scc differ diff --git a/App_code/Utilities/SpikeRemoval/SpikeRemoval.cs b/App_code/Utilities/SpikeRemoval/SpikeRemoval.cs new file mode 100644 index 0000000..901b112 --- /dev/null +++ b/App_code/Utilities/SpikeRemoval/SpikeRemoval.cs @@ -0,0 +1,187 @@ +//================================================================= +// File: SpikeRemoval.cs +// +// Namespace: System.Web.UI.DataVisualization.Charting.Utilities +// +// Classes: SpikeRemoval +// +// Purpose: Removes spikes from data +// +// +//=================================================================== +// Chart Control for ASP.Net +// Copyright ?Microsoft Corporation, all rights reserved +//=================================================================== + +using System; +using System.Data; +using System.Configuration; +using System.Drawing; +using System.Web.UI.DataVisualization.Charting; + +namespace System.Web.UI.DataVisualization.Charting.Utilities +{ + /// + /// Spike removal is a utility used to remove high and low spikes from a graph. This means that the + /// chart axis scaling will be changed so that data that was difficult to see and analyze will be easier + /// to see after anomaly spikes have been removed. + /// + public class SpikeRemoval + { + #region Members + private bool mySetCutoffLabels; + private MarkerStyle myRemovedPointStyle; + private float myMaximum; + private float myMinimum; + #endregion + + #region Properties + /// + /// Sets whether or not labels are set on each cut off point. If they are, they will show up on the chart and provide + /// extra clarification if the tooltip is not enough. + /// + public bool SetCutoffLabels + { + get { return mySetCutoffLabels; } + set { mySetCutoffLabels = value; } + } + + /// + /// Holds the style that is used for the marker of any deleted points. + /// + public MarkerStyle RemovedPointStyle + { + get { return myRemovedPointStyle; } + set { myRemovedPointStyle = value; } + } + + /// + /// Contains the maximum value of the data after it has had the spikes removed. This value also has + /// the tolerance factored in. + /// + public float Maximum + { + get { return myMaximum; } + } + + /// + /// Contains the minimum value of the data after it has had the spikes removed. This value also has + /// the tolerance factored in. + /// + public float Minimum + { + get { return myMinimum; } + } + #endregion + + #region Constructors + /// + /// Default Constructor. + /// + public SpikeRemoval() + { + //Default removed point style to a diamond. + myRemovedPointStyle = MarkerStyle.Diamond; + + //Default labels to off. + mySetCutoffLabels = false; + } + #endregion + + #region Public Methods + /// + /// RemoveSpikes will remove the high and low spikes off of a graph. The data within the series + /// provided will be modified, and for best results, the chart containing it should have axis + /// scaled automatically. + /// + /// The series which contains the data to be analyzed and modified. It is assumed that + /// Y-values are contained in YValues[0]. Cases contrary to this will produce unexpected results. + /// The percentage range of data to be kept. Anything that lies outside of the range + /// will be considered a spike. + /// The percentage a spike can be outside of the range but still included. The percentage + /// is based on the maximum or minimum value in the range. + public void RemoveSpikes(Series dataseries, int range, int tolerance) + { + //Assure range and tolerance are a percentage. + //Range is more strict in that at least 1% of the data must be included in the range, whereas it is + //possible to have 0% tolerance. + if ((range < 1 || range > 100)) + throw new ArgumentOutOfRangeException("range", "Range must be a percentage between 1 and 100"); + if ((tolerance < 0 || tolerance > 100)) + throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be a percentage between 0 and 100"); + + //Data values and indices hold the y values and the indices of the points in arrays. + float[] datavalues = new float[dataseries.Points.Count]; + int[] indices = new int[dataseries.Points.Count]; + + //Percent and number hold the actual values calculated from the range. + float percent = 0.0f; + int number = 0; + + //Copy all y values into an array and store the indices. + for (int i = 0; i < dataseries.Points.Count; i++) + { + datavalues[i] = (float)dataseries.Points[i].YValues[0]; + indices[i] = i; + } + + //Sort the array and indices. + Array.Sort(datavalues, indices); + + //Calculate the percent that has to come off each side of the data. + //ie. With a range of 80%, 20% of the data is being cut off, and 10% is coming off each side. + percent = ((100 - (float)range) / 2) / 100; + + //Calculate the actual number of points coming off of each side. + //ie. With a percent of 10% and 100 data points, 10 points are coming off of each side. + number = (int)System.Math.Round(dataseries.Points.Count * percent, 0); + + //Set the maximum and minimum values. + myMinimum = (float)(dataseries.Points[indices[number]].YValues[0] - System.Math.Abs(dataseries.Points[indices[number]].YValues[0] * (((float)tolerance / 100)))); + myMaximum = (float)(dataseries.Points[indices[dataseries.Points.Count - number - 1]].YValues[0] + System.Math.Abs(dataseries.Points[indices[dataseries.Points.Count - number - 1]].YValues[0] * (((float)tolerance / 100)))); + + //Cut the low spikes off. + for (int i = 0; i < number; i++) + { + //Don't cut the spike if it's within the tolerance value. + if (dataseries.Points[indices[i]].YValues[0] < (myMinimum)) + { + //Assign the tooltip to the point + dataseries.Points[indices[i]].ToolTip = "Value: " + dataseries.Points[indices[i]].YValues[0]; + + //Assign the label to the point + if (mySetCutoffLabels) + dataseries.Points[indices[i]].Label = "Value: " + dataseries.Points[indices[i]].YValues[0]; + + //Reassign the value to the minimum number allowed + dataseries.Points[indices[i]].YValues[0] = myMinimum; + + //Set the marker point + dataseries.Points[indices[i]].MarkerStyle = myRemovedPointStyle; + } + } + + //Cut the high spikes off. + for (int i = dataseries.Points.Count - number; i < dataseries.Points.Count; i++) + { + //Don't cut the spike if it's within the tolerance value. + if (dataseries.Points[indices[i]].YValues[0] > (myMaximum)) + { + //Assign the tooltip to the point + dataseries.Points[indices[i]].ToolTip = "Value: " + dataseries.Points[indices[i]].YValues[0]; + + //Assign the label to the point + if (mySetCutoffLabels) + dataseries.Points[indices[i]].Label = "Value: " + dataseries.Points[indices[i]].YValues[0]; + + //Reassign the value to the maximum number allowed + dataseries.Points[indices[i]].YValues[0] = myMaximum; + + //Set the marker point + dataseries.Points[indices[i]].MarkerStyle = myRemovedPointStyle; + } + } + } + #endregion + } +} diff --git a/App_code/Utilities/SpikeRemoval/_system~.ini b/App_code/Utilities/SpikeRemoval/_system~.ini new file mode 100644 index 0000000..e69de29 diff --git a/App_code/Utilities/SpikeRemoval/vssver2.scc b/App_code/Utilities/SpikeRemoval/vssver2.scc new file mode 100644 index 0000000..7216f4f Binary files /dev/null and b/App_code/Utilities/SpikeRemoval/vssver2.scc differ diff --git a/App_code/Utilities/_system~.ini b/App_code/Utilities/_system~.ini new file mode 100644 index 0000000..e69de29 diff --git a/App_code/_system~.ini b/App_code/_system~.ini new file mode 100644 index 0000000..e69de29 diff --git a/App_code/drawchart/CalculateData.cs b/App_code/drawchart/CalculateData.cs new file mode 100644 index 0000000..2ca308c --- /dev/null +++ b/App_code/drawchart/CalculateData.cs @@ -0,0 +1,144 @@ +using System; +using System.Drawing; +using System.Collections.Generic; +using System.Linq; +using System.Web; +using System.Data; +using System.Web.UI.DataVisualization.Charting; + +/// +///CalculateData 的摘要说明 +/// +public class CalculateData +{ + public CalculateData() + { + // + //TODO: 在此处添加构造函数逻辑 + // + } + /// + /// 观测值最大值 + /// + /// 子组观测值 + /// + static private double Max(double[] Xn) + { + double temp; + temp = Xn[0]; + for (int i = 0; i < Xn.Length; i++) + { + temp = (Xn[i] > temp) ? Xn[i] : temp; + } + return temp; + } + /// + /// 观测值最小值 + /// + /// 子组观测值 + /// + static private double Min(double[] Xn) + { + double temp; + temp = Xn[0]; + for (int i = 0; i < Xn.Length; i++) + { + temp = (Xn[i] < temp) ? Xn[i] : temp; + } + return temp; + } + /// + /// 计算X在区间[ValueDown,ValueUp]的数量 + /// + /// + /// + /// + /// + /// + static private void SumRang(double[] X, int GroupCount, double[] ValueDown, double[] ValueUp, out double[] Yk, out double[] YkCount) + { + int temp = 0; + //总数量 + int allCount = 0; + Yk = new double[GroupCount]; + YkCount = new double[GroupCount]; + for (int j = 0; j < GroupCount - 1; j++) + { + temp = 0; + for (int i = 0; i < X.Length; i++) + { + + if (X[i] >= ValueDown[j] & X[i] < ValueUp[j]) + { + temp = temp + 1; + allCount++; + } + } + Yk[j] = temp; + } + + for (int i = 0; i < X.Length; i++) + { + + if (X[i] >= ValueDown[GroupCount - 1] & X[i] <= ValueUp[GroupCount - 1]) + { + temp = temp + 1; + allCount++; + } + } + Yk[GroupCount - 1] = temp; + for (int i = 0; i < Yk.Length; i++) + { + YkCount[i] = Yk[i]; + Yk[i] = Yk[i] / (double)allCount * 100; + } + } + public static void DataPareto(double[] Data,int GroupCount) + { + Spc_Data_Pareto m_Spc_Data_Pareto = new Spc_Data_Pareto(); + //数组最大值 + double minValue = Min(Data); + //数组最小值 + double maxValue = Max(Data); + //X轴刻度 + double XSpan = (maxValue - minValue) / GroupCount; + //X轴下刻度线 + double[] XSpanDown = new double[GroupCount]; + //X轴上刻度线 + double[] XSpanUp = new double[GroupCount]; + double[] Yk=new double[GroupCount]; + + XSpanDown[0] = minValue; + XSpanUp[0] = minValue + XSpan; + for (int i = 1; i < GroupCount; i++) + { + XSpanDown[i] = minValue + i * XSpan; + XSpanUp[i] = minValue + (i + 1) * XSpan; + } + //数据在区间数组的数量 + SumRang(Data, GroupCount, XSpanDown, XSpanUp, out Yk, out m_Spc_Data_Pareto.YCount); + + for (int i = 0; i < GroupCount; i++) + { + if (i == 0) + { + m_Spc_Data_Pareto.AxisX[i] = minValue + XSpan / 2; + } + else + { + m_Spc_Data_Pareto.AxisX[i] = minValue + XSpan; + } + } + + } +} +/// +/// 排列图数据 +/// +public class Spc_Data_Pareto +{ + //X轴数据 + public double[] AxisX; + //所有数据在X轴各范围内的数量 + public double[] YCount; +} \ No newline at end of file diff --git a/App_code/drawchart/DrawChart.SpcCaculator.cs b/App_code/drawchart/DrawChart.SpcCaculator.cs new file mode 100644 index 0000000..6df1bf7 --- /dev/null +++ b/App_code/drawchart/DrawChart.SpcCaculator.cs @@ -0,0 +1,225 @@ +using System; +using System.Drawing; +using System.Collections.Generic; +using System.Linq; +using System.Web; +using System.Data; +using System.Web.UI.DataVisualization.Charting; +using System.Data.SqlClient; +using System.Web.UI.DataVisualization.Charting.Utilities; + +/// +///DrawChart 的摘要说明 +/// +public partial class DrawChart +{ + /// + /// 排列图 + /// + /// + /// + public static void ChartQualityData_Pareto(double[] X,Chart chart1) + { + int n=8; + chart1.Series["RawData"].Points.DataBindY(X); + + DrawPareto drawPareto = new DrawPareto(); + + drawPareto.SegmentIntervalNumber = n; + drawPareto.ShowPercentOnSecondaryYAxis = false; + drawPareto.CreatePareto(chart1, "RawData", "Histogram"); + drawPareto.MakeParetoChart(chart1, "Histogram", "Pareto"); + // Set chart types for output data + chart1.Series["Pareto"].ChartType = SeriesChartType.Line; + // set the markers for each point of the Pareto Line + chart1.Series["Pareto"].IsValueShownAsLabel = true; + chart1.Series["Pareto"].MarkerColor = Color.Red; + chart1.Series["Pareto"].MarkerBorderColor = Color.MidnightBlue; + chart1.Series["Pareto"].MarkerStyle = MarkerStyle.Circle; + chart1.Series["Pareto"].MarkerSize = 6; + chart1.Series["Pareto"].LabelFormat = "0.#"; // format with one decimal and leading zero + // Set Color of line Pareto chart + chart1.Series["Pareto"].Color = Color.FromArgb(252, 180, 65); + + + + } + /// + /// 直方图 + /// + /// + /// + public static void ChartQualityData_Histogram(double[] X, Chart chart1) + { + int n = 8; + chart1.Series["RawData"].Points.DataBindY(X); + // Populate single axis data distribution series. Show Y value of the + // data series as X value and set all Y values to 1. + foreach (DataPoint dataPoint in chart1.Series["RawData"].Points) + { + chart1.Series["DataDistribution"].Points.AddXY(dataPoint.YValues[0], 1); + } + // Create a histogram series + HistogramChartHelper histogramHelper = new HistogramChartHelper(); + histogramHelper.SegmentIntervalNumber = n; + histogramHelper.ShowPercentOnSecondaryYAxis = false; + // NOTE: Interval width may be specified instead of interval number + //histogramHelper.SegmentIntervalWidth = 15; + histogramHelper.CreateHistogram(chart1, "RawData", "Histogram"); + } + + /// + /// 分析正态分布图 + /// + /// 被分析数据组 + /// 理论上限 + /// 理论下限 + /// + public static void ChartQualityData_NormalDistribution(double[] X, double Usl, double Lsl, Chart chart1) + { + double x; + double s; + double QU; + double QL; + double cp; + double cpk; + double[] sx; + double[] sy; + + double ValueUp = Max(X); + double ValueDown = Min(X); + //计算SPC参数 + SpcCaculator.SpcValue(X, ref Usl, ref Lsl, out x, out s, out QU, out QL, out cp, out cpk, out sx, out sy); + + //坐标轴 + double ValueUpX = Convert.ToDouble(Max(sx).ToString("F4")); + double ValueDownX = Convert.ToDouble(Min(sx).ToString("F4")); + double ValueUpY = Convert.ToDouble(Max(sy).ToString("F4")); + + ValueDownX = Math.Min(ValueDownX, Lsl); + ValueDownX = Math.Min(ValueDownX, QL); + + ValueUpX = Math.Max(ValueUpX, Usl); + ValueUpX = Math.Max(ValueUpX, QU); + + + double X1 = (ValueUpX - ValueDownX) / 10; + chart1.ChartAreas["ChartArea1"].AxisX.Minimum = Math.Round(ValueDownX - X1, 4); + chart1.ChartAreas["ChartArea1"].AxisX.Maximum = Math.Round(ValueUpX + X1, 4); + chart1.ChartAreas["ChartArea1"].AxisY.Minimum = 0; + chart1.ChartAreas["ChartArea1"].AxisY.Maximum = Math.Round(ValueUpY + ValueUpY / 10, 4); + //绘图正态分布曲线(共取了11个点) + for (int i = 0; i < sx.Length; i++) + { + chart1.Series[0].Points.AddXY(Math.Round(sx[i], 4), Math.Round(sy[i], 4)); + } + + chart1.ChartAreas["ChartArea1"].AxisX.StripLines[1].IntervalOffset = sx[5]; + chart1.ChartAreas["ChartArea1"].AxisX.StripLines[1].Text = "SL=" + sx[5].ToString("F4"); + chart1.ChartAreas["ChartArea1"].AxisX.StripLines[2].IntervalOffset = Usl; + chart1.ChartAreas["ChartArea1"].AxisX.StripLines[2].Text = "USL=" + Usl.ToString("F4"); + chart1.ChartAreas["ChartArea1"].AxisX.StripLines[3].IntervalOffset = Lsl; + chart1.ChartAreas["ChartArea1"].AxisX.StripLines[3].Text = "LSL=" + Lsl.ToString("F4"); + chart1.ChartAreas["ChartArea1"].AxisX.StripLines[4].IntervalOffset = QL; + chart1.ChartAreas["ChartArea1"].AxisX.StripLines[4].Text = "QL=" + QL.ToString("F4"); + chart1.ChartAreas["ChartArea1"].AxisX.StripLines[5].IntervalOffset = QU; + chart1.ChartAreas["ChartArea1"].AxisX.StripLines[5].Text = "QU=" + QU.ToString("F4"); + + //将CpCpk绘制到图形中 + DarwCpCpk(chart1, cp, cpk); + //TextAnnotation annotation3; + //annotation3 = new TextAnnotation(); + //annotation3.Text = "Cp=" + cp.ToString("F2"); + //annotation3.ForeColor = Color.Black; + //annotation3.Font = new Font("Arial", 11); ; + //annotation3.X = 60; + //annotation3.Y = 90; + //chart1.Annotations.Add(annotation3); + //annotation3 = new TextAnnotation(); + //annotation3.Text = "Cpk=" + cpk.ToString("F2"); + //annotation3.ForeColor = Color.Black; + //annotation3.Font = new Font("Arial", 11); ; + //annotation3.X = 80; + //annotation3.Y = 90; + //chart1.Annotations.Add(annotation3); + } + /// + /// SPC分析基本趋势图 + /// + /// + /// + public static void ChartQualityData_TrendPictureBasic_new(DataTable dt, double Usl, double Lsl, Chart chart1) + { + + double x; + double s; + double QU; + double QL; + double cp; + double cpk; + double[] sx; + double[] sy; + + double[] X; + if (dt.Rows.Count < 3) return; + X = new double[dt.Rows.Count]; + for (int i = 0; i < dt.Rows.Count; i++) + { + X[i] = Convert.ToDouble(dt.Rows[i][0]); + } + + double ValueUp = Max(X); + double ValueDown = Min(X); + + + + + //计算SPC参数 + SpcCaculator.SpcValue(X, ref Usl, ref Lsl, out x, out s, out QU, out QL, out cp, out cpk, out sx, out sy); + + //坐标轴 + double ValueUpX; + double ValueDownX; + + ValueDownX = Math.Min(ValueDown, Lsl); + ValueDownX = Math.Min(ValueDownX, QL); + + ValueUpX = Math.Max(ValueUp, Usl); + ValueUpX = Math.Max(ValueUpX, QU); + + double X1 = (ValueUpX - ValueDownX) / 10; + chart1.ChartAreas["ChartArea1"].AxisY.Minimum = Math.Round(ValueDownX - X1, 4); + chart1.ChartAreas["ChartArea1"].AxisY.Maximum = Math.Round(ValueUpX + X1, 4); + + + chart1.ChartAreas["ChartArea1"].AxisY.StripLines[1].IntervalOffset = sx[5]; + chart1.ChartAreas["ChartArea1"].AxisY.StripLines[1].Text = "SL=" + sx[5].ToString("F4"); + chart1.ChartAreas["ChartArea1"].AxisY.StripLines[2].IntervalOffset = Usl; + chart1.ChartAreas["ChartArea1"].AxisY.StripLines[2].Text = "USL=" + Usl.ToString("F4"); + chart1.ChartAreas["ChartArea1"].AxisY.StripLines[3].IntervalOffset = Lsl; + chart1.ChartAreas["ChartArea1"].AxisY.StripLines[3].Text = "LSL=" + Lsl.ToString("F4"); + chart1.ChartAreas["ChartArea1"].AxisY.StripLines[4].IntervalOffset = QU; + chart1.ChartAreas["ChartArea1"].AxisY.StripLines[4].Text = "QU=" + QU.ToString("F4"); + chart1.ChartAreas["ChartArea1"].AxisY.StripLines[5].IntervalOffset = QL; + chart1.ChartAreas["ChartArea1"].AxisY.StripLines[5].Text = "QL=" + QL.ToString("F4"); + + chart1.Series[0].Points.DataBind(dt.DefaultView, "", "测量值", "Tooltip=ToolTip"); + //将CpCpk绘制到图形中 + DarwCpCpk(chart1, cp, cpk); + } + /// + /// 将CpCpk绘制到图形中 + /// + /// + /// + /// + static private void DarwCpCpk(Chart chart1,double cp,double cpk) + { + TextAnnotation annotation; + annotation = (TextAnnotation)chart1.Annotations["TextAnnotationCp"]; + annotation.Text = "Cp=" + cp.ToString("F2"); + annotation = (TextAnnotation)chart1.Annotations["TextAnnotationCpk"]; + annotation.Text = "Cpk=" + cpk.ToString("F2"); + } + +} diff --git a/App_code/drawchart/DrawChart.cs b/App_code/drawchart/DrawChart.cs new file mode 100644 index 0000000..3229d98 --- /dev/null +++ b/App_code/drawchart/DrawChart.cs @@ -0,0 +1,787 @@ +using System; +using System.Drawing; +using System.Collections.Generic; +using System.Linq; +using System.Web; +using System.Data; +using System.Web.UI.DataVisualization.Charting; +using System.Data.SqlClient; + + +/// +///DrawChart 的摘要说明 +/// +public partial class DrawChart +{ + + public static void ChartQualityData_Pareto(DataTable dt,int n, Chart chart1) + { + chart1.Series["RawData"].Points.DataBindY(dt.Rows, "测量值"); + + DrawPareto drawPareto = new DrawPareto(); + drawPareto.SegmentIntervalNumber = n; + drawPareto.ShowPercentOnSecondaryYAxis = false; + drawPareto.CreatePareto(chart1, "RawData", "Histogram"); + + + drawPareto.MakeParetoChart(chart1, "Histogram", "Pareto"); + + // Set chart types for output data + chart1.Series["Pareto"].ChartType = SeriesChartType.Line; + + // set the markers for each point of the Pareto Line + chart1.Series["Pareto"].IsValueShownAsLabel = true; + chart1.Series["Pareto"].MarkerColor = Color.Red; + chart1.Series["Pareto"].MarkerBorderColor = Color.MidnightBlue; + chart1.Series["Pareto"].MarkerStyle = MarkerStyle.Circle; + chart1.Series["Pareto"].MarkerSize = 6; + chart1.Series["Pareto"].LabelFormat = "0.#"; // format with one decimal and leading zero + + // Set Color of line Pareto chart + chart1.Series["Pareto"].Color = Color.FromArgb(252, 180, 65); + + + } + /// + /// SPC分析正态分布图 + /// + /// + /// + /// + public static void ChartQualityData_NormalDistribution(double[] X, int n, Chart chart1) + { + double ValueUp = Max(X); + double ValueDown = Min(X); + //绘图数据 + ASPNet_Drawing.CSpc_Data_Cpk Spc_Data_Cpk = ASPNet_Drawing.Spc_Data.Cpk(X, n, ValueUp, ValueDown); + //坐标轴 + double ValueUpX = Convert.ToDouble(Max(Spc_Data_Cpk.NormalDistributionX).ToString("F2")); + double ValueDownX = Convert.ToDouble(Min(Spc_Data_Cpk.NormalDistributionX).ToString("F2")); + double ValueUpY = Convert.ToDouble(Max(Spc_Data_Cpk.NormalDistributionY).ToString("F2")); + double X1 = (ValueUpX - ValueDownX) / 10; + chart1.ChartAreas["ChartArea1"].AxisX.Minimum = Math.Round(ValueDownX - X1, 2); + chart1.ChartAreas["ChartArea1"].AxisX.Maximum = Math.Round(ValueUpX + X1, 2); + chart1.ChartAreas["ChartArea1"].AxisY.Minimum = 0; + chart1.ChartAreas["ChartArea1"].AxisY.Maximum = Math.Round(ValueUpY + ValueUpY / 10, 2); + //绘图 + for (int i = 0; i < Spc_Data_Cpk.NormalDistributionX.Length; i++) + { + chart1.Series[0].Points.AddXY(Math.Round(Spc_Data_Cpk.NormalDistributionX[i], 2), Math.Round(Spc_Data_Cpk.NormalDistributionY[i], 2)); + } + // Set Strip line item + //chart1.ChartAreas["ChartArea1"].AxisX.StripLines[0].IntervalOffset = Spc_Data_Cpk.LSL; + //chart1.ChartAreas["ChartArea1"].AxisX.StripLines[0].StripWidth = Spc_Data_Cpk.USL - Spc_Data_Cpk.LSL; + + // Set Strip line item + //double SL = (ValueUpX + ValueDownX) / 2; + //double USL = SL + 3 * Spc_Data_Cpk.Singma; + //double LSL = SL - 3 * Spc_Data_Cpk.Singma; + chart1.ChartAreas["ChartArea1"].AxisX.StripLines[1].IntervalOffset = Spc_Data_Cpk.NormalDistributionX[4]; + chart1.ChartAreas["ChartArea1"].AxisX.StripLines[1].Text = "SL=" + Spc_Data_Cpk.NormalDistributionX[4].ToString("F2"); + chart1.ChartAreas["ChartArea1"].AxisX.StripLines[2].IntervalOffset = Spc_Data_Cpk.NormalDistributionX[1]; + chart1.ChartAreas["ChartArea1"].AxisX.StripLines[2].Text = "USL=" + Spc_Data_Cpk.NormalDistributionX[1].ToString("F2"); + chart1.ChartAreas["ChartArea1"].AxisX.StripLines[3].IntervalOffset = Spc_Data_Cpk.NormalDistributionX[7]; + chart1.ChartAreas["ChartArea1"].AxisX.StripLines[3].Text = "LSL=" + Spc_Data_Cpk.NormalDistributionX[7].ToString("F2"); + + //TextAnnotation annotation1 = new TextAnnotation(); + //annotation1.Text = "Cpk=" + Spc_Data_Cpk.Cpk.ToString("F2"); + //annotation1.ForeColor = Color.Black; + //annotation1.Font = new Font("Arial", 11); ; + //annotation1.X = 80; + //annotation1.Y = 8; + //chart1.Annotations.Add(annotation1); + + //TextAnnotation annotation2 = new TextAnnotation(); + //annotation2.Text = "CPL=" + Spc_Data_Cpk.CPL.ToString("F2"); + //annotation2.ForeColor = Color.Black; + //annotation2.Font = new Font("Arial", 11); ; + //annotation2.X = 80; + //annotation2.Y = 13; + //chart1.Annotations.Add(annotation2); + + //TextAnnotation annotation3 = new TextAnnotation(); + //annotation3.Text = "CPU=" + Spc_Data_Cpk.CPU.ToString("F2"); + //annotation3.ForeColor = Color.Black; + //annotation3.Font = new Font("Arial", 11); ; + //annotation3.X = 80; + //annotation3.Y = 18; + //chart1.Annotations.Add(annotation3); + + + } + + /// + /// SPC分析工序能力图 + /// 在均值级差图中 + /// + /// + /// + /// + public static void ChartQualityData_Cpk_XR(double[] X, int n, Chart chart1) + { + double ValueUp = Max(X); + double ValueDown = Min(X); + //绘图数据 + ASPNet_Drawing.CSpc_Data_Cpk Spc_Data_Cpk = ASPNet_Drawing.Spc_Data.Cpk(X, n, ValueUp, ValueDown); + //坐标轴 + double ValueUpX = Convert.ToDouble(Max(Spc_Data_Cpk.NormalDistributionX).ToString("F2")); + double ValueDownX = Convert.ToDouble(Min(Spc_Data_Cpk.NormalDistributionX).ToString("F2")); + double ValueUpY = Convert.ToDouble(Max(Spc_Data_Cpk.NormalDistributionY).ToString("F2")); + double X1 = (ValueUpX - ValueDownX) / 10; + chart1.ChartAreas["ChartArea_Cpk"].AxisX.Minimum = Math.Round(ValueDownX - X1, 2); + chart1.ChartAreas["ChartArea_Cpk"].AxisX.Maximum = Math.Round(ValueUpX + X1, 2); + chart1.ChartAreas["ChartArea_Cpk"].AxisY.Minimum = 0; + chart1.ChartAreas["ChartArea_Cpk"].AxisY.Maximum = Math.Round(ValueUpY + ValueUpY / 10, 2); + //绘图 + for (int i = 0; i < Spc_Data_Cpk.NormalDistributionX.Length; i++) + { + chart1.Series["Series_Cpk"].Points.AddXY(Math.Round(Spc_Data_Cpk.NormalDistributionX[i], 2), Math.Round(Spc_Data_Cpk.NormalDistributionY[i], 2)); + } + + ASPNet_Drawing.CSpc_Data_XR Spc_Data_XR = ASPNet_Drawing.Spc_Data.XR(X, n); + + chart1.ChartAreas["ChartArea_Cpk"].AxisX.StripLines[1].IntervalOffset = Spc_Data_Cpk.NormalDistributionX[4]; + chart1.ChartAreas["ChartArea_Cpk"].AxisX.StripLines[1].Text = "SL=" + Spc_Data_XR.CL_X.ToString("F2"); + chart1.ChartAreas["ChartArea_Cpk"].AxisX.StripLines[2].IntervalOffset = Spc_Data_Cpk.NormalDistributionX[1]; + chart1.ChartAreas["ChartArea_Cpk"].AxisX.StripLines[2].Text = "USL=" + Spc_Data_XR.UCL_X.ToString("F2"); + chart1.ChartAreas["ChartArea_Cpk"].AxisX.StripLines[3].IntervalOffset = Spc_Data_Cpk.NormalDistributionX[7]; + chart1.ChartAreas["ChartArea_Cpk"].AxisX.StripLines[3].Text = "LSL=" + Spc_Data_XR.LCL_X.ToString("F2"); + + TextAnnotation annotation1 = new TextAnnotation(); + annotation1.Text = "Cpk=" + Spc_Data_Cpk.Cpk.ToString("F2"); + annotation1.ForeColor = Color.Black; + annotation1.Font = new Font("Arial", 6); ; + annotation1.X = 27; + annotation1.Y = 3.5; + chart1.Annotations.Add(annotation1); + + TextAnnotation annotation2 = new TextAnnotation(); + annotation2.Text = "CPL=" + Spc_Data_Cpk.CPL.ToString("F2"); + annotation2.ForeColor = Color.Black; + annotation2.Font = new Font("Arial", 6); ; + annotation2.X = 27; + annotation2.Y = 5; + chart1.Annotations.Add(annotation2); + + TextAnnotation annotation3 = new TextAnnotation(); + annotation3.Text = "CPU=" + Spc_Data_Cpk.CPU.ToString("F2"); + annotation3.ForeColor = Color.Black; + annotation3.Font = new Font("Arial", 6); ; + annotation3.X = 27; + annotation3.Y = 6.5; + chart1.Annotations.Add(annotation3); + + + } + + /// + /// SPC分析工序能力图 + /// 在均值标准差图中 + /// + /// + /// + /// + public static void ChartQualityData_Cpk_XS(double[] X, int n, Chart chart1) + { + double ValueUp = Max(X); + double ValueDown = Min(X); + //绘图数据 + ASPNet_Drawing.CSpc_Data_Cpk Spc_Data_Cpk = ASPNet_Drawing.Spc_Data.Cpk(X, n, ValueUp, ValueDown); + //坐标轴 + double ValueUpX = Convert.ToDouble(Max(Spc_Data_Cpk.NormalDistributionX).ToString("F2")); + double ValueDownX = Convert.ToDouble(Min(Spc_Data_Cpk.NormalDistributionX).ToString("F2")); + double ValueUpY = Convert.ToDouble(Max(Spc_Data_Cpk.NormalDistributionY).ToString("F2")); + double X1 = (ValueUpX - ValueDownX) / 10; + chart1.ChartAreas["ChartArea_Cpk"].AxisX.Minimum = Math.Round(ValueDownX - X1, 2); + chart1.ChartAreas["ChartArea_Cpk"].AxisX.Maximum = Math.Round(ValueUpX + X1, 2); + chart1.ChartAreas["ChartArea_Cpk"].AxisY.Minimum = 0; + chart1.ChartAreas["ChartArea_Cpk"].AxisY.Maximum = Math.Round(ValueUpY + ValueUpY / 10, 2); + //绘图 + for (int i = 0; i < Spc_Data_Cpk.NormalDistributionX.Length; i++) + { + chart1.Series["Series_Cpk"].Points.AddXY(Math.Round(Spc_Data_Cpk.NormalDistributionX[i], 2), Math.Round(Spc_Data_Cpk.NormalDistributionY[i], 2)); + } + + ASPNet_Drawing.CSpc_Data_XR Spc_Data_XR = ASPNet_Drawing.Spc_Data.XR(X, n); + + chart1.ChartAreas["ChartArea_Cpk"].AxisX.StripLines[1].IntervalOffset = Spc_Data_Cpk.NormalDistributionX[4]; + chart1.ChartAreas["ChartArea_Cpk"].AxisX.StripLines[1].Text = "SL=" + Spc_Data_XR.CL_X.ToString("F2"); + chart1.ChartAreas["ChartArea_Cpk"].AxisX.StripLines[2].IntervalOffset = Spc_Data_Cpk.NormalDistributionX[1]; + chart1.ChartAreas["ChartArea_Cpk"].AxisX.StripLines[2].Text = "USL=" + Spc_Data_XR.UCL_X.ToString("F2"); + chart1.ChartAreas["ChartArea_Cpk"].AxisX.StripLines[3].IntervalOffset = Spc_Data_Cpk.NormalDistributionX[7]; + chart1.ChartAreas["ChartArea_Cpk"].AxisX.StripLines[3].Text = "LSL=" + Spc_Data_XR.LCL_X.ToString("F2"); + + TextAnnotation annotation1 = new TextAnnotation(); + annotation1.Text = "Cpk=" + Spc_Data_Cpk.Cpk.ToString("F2"); + annotation1.ForeColor = Color.Black; + annotation1.Font = new Font("Arial", 6); ; + annotation1.X = 27; + annotation1.Y = 3.5; + chart1.Annotations.Add(annotation1); + + TextAnnotation annotation2 = new TextAnnotation(); + annotation2.Text = "CPL=" + Spc_Data_Cpk.CPL.ToString("F2"); + annotation2.ForeColor = Color.Black; + annotation2.Font = new Font("Arial", 6); ; + annotation2.X = 27; + annotation2.Y = 5; + chart1.Annotations.Add(annotation2); + + TextAnnotation annotation3 = new TextAnnotation(); + annotation3.Text = "CPU=" + Spc_Data_Cpk.CPU.ToString("F2"); + annotation3.ForeColor = Color.Black; + annotation3.Font = new Font("Arial", 6); ; + annotation3.X = 27; + annotation3.Y = 6.5; + chart1.Annotations.Add(annotation3); + + + } + + + /// + /// SPC分析工序能力图 + /// + /// + /// + /// + public static void ChartQualityData_Cpk(double[] X, int n, Chart chart1) + { + double ValueUp = Max(X); + double ValueDown = Min(X); + //绘图数据 + ASPNet_Drawing.CSpc_Data_Cpk Spc_Data_Cpk = ASPNet_Drawing.Spc_Data.Cpk(X, n, ValueUp, ValueDown); + //坐标轴 + double ValueUpX = Convert.ToDouble(Max(Spc_Data_Cpk.NormalDistributionX).ToString("F2")); + double ValueDownX = Convert.ToDouble(Min(Spc_Data_Cpk.NormalDistributionX).ToString("F2")); + double ValueUpY = Convert.ToDouble(Max(Spc_Data_Cpk.NormalDistributionY).ToString("F2")); + double X1 = (ValueUpX - ValueDownX) / 10; + chart1.ChartAreas["ChartArea_Cpk"].AxisX.Minimum = Math.Round(ValueDownX - X1, 2); + chart1.ChartAreas["ChartArea_Cpk"].AxisX.Maximum = Math.Round(ValueUpX + X1, 2); + chart1.ChartAreas["ChartArea_Cpk"].AxisY.Minimum = 0; + chart1.ChartAreas["ChartArea_Cpk"].AxisY.Maximum = Math.Round(ValueUpY + ValueUpY / 10, 2); + //绘图 + for (int i = 0; i < Spc_Data_Cpk.NormalDistributionX.Length; i++) + { + chart1.Series["Series_Cpk"].Points.AddXY(Math.Round(Spc_Data_Cpk.NormalDistributionX[i], 2), Math.Round(Spc_Data_Cpk.NormalDistributionY[i], 2)); + } + // Set Strip line item + //chart1.ChartAreas["ChartArea1"].AxisX.StripLines[0].IntervalOffset = Spc_Data_Cpk.LSL; + //chart1.ChartAreas["ChartArea1"].AxisX.StripLines[0].StripWidth = Spc_Data_Cpk.USL - Spc_Data_Cpk.LSL; + + // Set Strip line item + //double SL = (ValueUpX + ValueDownX) / 2; + //double USL = SL + 3 * Spc_Data_Cpk.Singma; + //double LSL = SL - 3 * Spc_Data_Cpk.Singma; + chart1.ChartAreas["ChartArea_Cpk"].AxisX.StripLines[1].IntervalOffset = Spc_Data_Cpk.NormalDistributionX[4]; + chart1.ChartAreas["ChartArea_Cpk"].AxisX.StripLines[1].Text = "SL=" + Spc_Data_Cpk.NormalDistributionX[4].ToString("F2"); + chart1.ChartAreas["ChartArea_Cpk"].AxisX.StripLines[2].IntervalOffset = Spc_Data_Cpk.NormalDistributionX[1]; + chart1.ChartAreas["ChartArea_Cpk"].AxisX.StripLines[2].Text = "USL=" + Spc_Data_Cpk.NormalDistributionX[1].ToString("F2"); + chart1.ChartAreas["ChartArea_Cpk"].AxisX.StripLines[3].IntervalOffset = Spc_Data_Cpk.NormalDistributionX[7]; + chart1.ChartAreas["ChartArea_Cpk"].AxisX.StripLines[3].Text = "LSL=" + Spc_Data_Cpk.NormalDistributionX[7].ToString("F2"); + + TextAnnotation annotation1 = new TextAnnotation(); + annotation1.Text = "Cpk=" + Spc_Data_Cpk.Cpk.ToString("F2"); + annotation1.ForeColor = Color.Black; + annotation1.Font = new Font("Arial", 11); ; + annotation1.X = 80; + annotation1.Y = 8; + chart1.Annotations.Add(annotation1); + + TextAnnotation annotation2 = new TextAnnotation(); + annotation2.Text = "CPL=" + Spc_Data_Cpk.CPL.ToString("F2"); + annotation2.ForeColor = Color.Black; + annotation2.Font = new Font("Arial", 11); ; + annotation2.X = 80; + annotation2.Y = 13; + chart1.Annotations.Add(annotation2); + + TextAnnotation annotation3 = new TextAnnotation(); + annotation3.Text = "CPU=" + Spc_Data_Cpk.CPU.ToString("F2"); + annotation3.ForeColor = Color.Black; + annotation3.Font = new Font("Arial", 11); ; + annotation3.X = 80; + annotation3.Y = 18; + chart1.Annotations.Add(annotation3); + + + } + + /// + /// 机床报警频次分析 + /// + /// + /// + public static void ChartMachineAlarm(DataTable dt, Chart chart1) + { + if (dt.Rows.Count == 0) + return; + string seriesName = dt.Rows[0]["工位号"].ToString(); + chart1.Series.Add(seriesName); + chart1.Series[seriesName].ChartType = SeriesChartType.Column; + chart1.Series[seriesName].BorderWidth = 2; + chart1.Series[seriesName].ToolTip = "报警文本:#VALX \n报警数量:#VALY"; + chart1.Series[seriesName].Points.DataBindXY(dt.Rows, "报警文本", dt.Rows, "报警数量"); + //for (int i = 0; i < 10; i++) + //{ + // chart1.Series[seriesName].Points.AddXY(dt.Rows[i]["报警编号"], dt.Rows[i]["报警数量"]); + //} + //chart1.DataBind(); + } + + ///// + ///// 机床状态频次分析 + ///// + ///// + ///// + //public static void ChartMachineStatus(DataTable dt, Chart chart1) + //{ + + // foreach (DataRow row in dt.Rows) + // { + // // For each Row add a new series + // string seriesName = row["工位号"].ToString(); + // chart1.Series.Add(seriesName); + // chart1.Series[seriesName].ChartType = SeriesChartType.StackedBar; + // chart1.Series[seriesName].BorderWidth = 2; + // chart1.Series[seriesName].ToolTip = "工位号:" + seriesName + "\n 频次:= #VALY"; + + // for (int colIndex = 2; colIndex < dt.Columns.Count; colIndex++) + // { + // // For each column (column 1 and onward) add the value as a point + // string columnName = dt.Columns[colIndex].ColumnName; + // int YVal = (int)row[columnName]; + // chart1.Series[seriesName].Points.AddXY(columnName, YVal); + // } + // } + + //} + ///// + ///// 成海 2012-04-05 + ///// + ///// + ///// + public static void ChartMachineStatus(DataTable dt, Chart chart1) + { + string seriesNameA = "机床上电"; + chart1.Series.Add(seriesNameA); + chart1.Series[seriesNameA].ChartType = SeriesChartType.StackedColumn; + chart1.Series[seriesNameA].BorderWidth = 2; + chart1.Series[seriesNameA].ToolTip = "机床状态:" + seriesNameA + "\n 频次:= #VALY"; + chart1.Series[seriesNameA].Color = System.Drawing.Color.DeepPink; + string seriesNameB = "循环开始"; + chart1.Series.Add(seriesNameB); + chart1.Series[seriesNameB].ChartType = SeriesChartType.StackedColumn; + chart1.Series[seriesNameB].BorderWidth = 2; + chart1.Series[seriesNameB].ToolTip = "机床状态:" + seriesNameB + "\n 频次:= #VALY"; + chart1.Series[seriesNameB].Color = System.Drawing.Color.Green; + string seriesNameC = "机床故障"; + chart1.Series.Add(seriesNameC); + chart1.Series[seriesNameC].ChartType = SeriesChartType.StackedColumn; + chart1.Series[seriesNameC].BorderWidth = 2; + chart1.Series[seriesNameC].ToolTip = "机床状态:" + seriesNameC + "\n 频次:= #VALY"; + chart1.Series[seriesNameC].Color = System.Drawing.Color.Red; + string seriesNameD = "上料无件"; + chart1.Series.Add(seriesNameD); + chart1.Series[seriesNameD].ChartType = SeriesChartType.StackedColumn; + chart1.Series[seriesNameD].BorderWidth = 2; + chart1.Series[seriesNameD].ToolTip = "机床状态:" + seriesNameD + "\n 频次:= #VALY"; + chart1.Series[seriesNameD].Color = System.Drawing.Color.Blue; + string seriesNameE = "下料堵塞"; + chart1.Series.Add(seriesNameE); + chart1.Series[seriesNameE].ChartType = SeriesChartType.StackedColumn; + chart1.Series[seriesNameE].BorderWidth = 2; + chart1.Series[seriesNameE].ToolTip = "机床状态:" + seriesNameE + "\n 频次:= #VALY"; + chart1.Series[seriesNameE].Color = System.Drawing.Color.Yellow; + foreach (DataRow row in dt.Rows) + { + string opName = row["工位号"].ToString(); + int YValA = (int)row["机床上电"]; + chart1.Series[seriesNameA].Points.AddXY(opName, YValA); + int YValB = (int)row["循环开始"]; + chart1.Series[seriesNameB].Points.AddXY(opName, YValB); + int YValC = (int)row["机床故障"]; + chart1.Series[seriesNameC].Points.AddXY(opName, YValC); + int YValD = (int)row["上料无件"]; + chart1.Series[seriesNameD].Points.AddXY(opName, YValD); + int YValE = (int)row["下料堵塞"]; + chart1.Series[seriesNameE].Points.AddXY(opName, YValE); + + } + + + } + /// + /// SPC分析基本趋势图 + /// + /// + /// + public static void ChartQualityData_TrendPictureBasic(DataTable dt, Chart chart1) + { + //string seriesName = "series1"; + //chart1.Series.Add(seriesName); + //chart1.Series[seriesName].MarkerStyle = MarkerStyle.Circle; + //chart1.Series[seriesName].MarkerSize = 5; + //chart1.Series[seriesName].MasrkerColor = Color.Magenta; + + //chart1.Series[seriesName].ChartType = SeriesChartType.Line; + //chart1.Series[seriesName].BorderWidth = 1; + chart1.Series[0].Points.DataBind(dt.DefaultView, "", "测量值", "Tooltip=ToolTip"); + //chart1.DataBinds(); + + } + /// + /// 子组平均值的平均值 + /// n 子组大小。单个子组观测值的个数 + /// + /// 全部测量数据数组 + /// 子组大小。单个子组观测值的个数 + /// 子组平均值的数组 + /// + static private double Average(double[] X, int n) + { + //k 子组个数 + int k; + k = X.Length / n; + double[] Xi = new double[n]; + double[] Xk = new double[k]; + for (int j = 0; j < k; j++) + { + for (int i = 0; i < n; i++) + { + Xi[i] = X[j * n + i]; + } + //子组平均值 + Xk[j] = Average(Xi); + } + //子组平均值的平均值 + return Average(Xk); + } + /// + /// 一组观测值的均值 + /// + /// 子组观测值 + /// + static private double Average(double[] Xn) + { + if (Xn.Length < 1) return 0; + return Sum(Xn) / (double)Xn.Length; + } + /// + /// 观测值和 + /// + /// 子组观测值 + /// + static private double Sum(double[] Xn) + { + double temp; + temp = 0; + for (int i = 0; i < Xn.Length; i++) + { + temp = temp + Xn[i]; + } + return temp; + } + /// + /// 观测值最大值 + /// + /// 子组观测值 + /// + static private double Max(double[] Xn) + { + double temp; + temp = Xn[0]; + for (int i = 0; i < Xn.Length; i++) + { + temp = (Xn[i] > temp) ? Xn[i] : temp; + } + return temp; + } + /// + /// 观测值最小值 + /// + /// 子组观测值 + /// + static private double Min(double[] Xn) + { + double temp; + temp = Xn[0]; + for (int i = 0; i < Xn.Length; i++) + { + temp = (Xn[i] < temp) ? Xn[i] : temp; + } + return temp; + } + + + /// + /// 均值极差图 + /// + /// + /// + /// + public static void ChartQualityData_XR(double[] X, int n, Chart chart1) + { + //计算XR控制图的数据 + ASPNet_Drawing.CSpc_Data_XR Spc_Data_XR = ASPNet_Drawing.Spc_Data.XR(X, n); + for (int i = 0; i < Spc_Data_XR.CL_Xk.Length; i++) + { + //X + chart1.Series["Series_X"].Points.AddXY(i + 1, Spc_Data_XR.CL_Xk[i]); + //R + chart1.Series["Series_R"].Points.AddXY(i + 1, Spc_Data_XR.CL_Rk[i]); + } + chart1.Series["Series_X"].ToolTip = "测量值:= #VALY"; + chart1.Series["Series_R"].ToolTip = "测量值:= #VALY"; + + ////均值图Y轴范围 + double gapAxis_X = Spc_Data_XR.UCL_X - Spc_Data_XR.LCL_X; + //均值的最大值 + double maxXk = Max(Spc_Data_XR.CL_Xk); + //均值的最小值 + double minXk = Min(Spc_Data_XR.CL_Xk); + if (maxXk > Spc_Data_XR.UCL_X) + { + chart1.ChartAreas["ChartArea_X"].AxisY.Maximum = Convert.ToDouble((maxXk + gapAxis_X / 8).ToString("F2")); + } + else + { + chart1.ChartAreas["ChartArea_X"].AxisY.Maximum = Convert.ToDouble((Spc_Data_XR.UCL_X + gapAxis_X / 8).ToString("F2")); + } + if (minXk < Spc_Data_XR.LCL_X) + { + chart1.ChartAreas["ChartArea_X"].AxisY.Minimum = Convert.ToDouble((minXk - gapAxis_X / 8).ToString("F2")); + } + else + { + chart1.ChartAreas["ChartArea_X"].AxisY.Minimum = Convert.ToDouble((Spc_Data_XR.LCL_X - gapAxis_X / 8).ToString("F2")); + } + + ////极差图Y轴范围 + double gapAxis_R = Spc_Data_XR.UCL_R - Spc_Data_XR.LCL_R; + //极差最大值 + double maxRk = Max(Spc_Data_XR.CL_Rk); + //极差最小值 + double minRk = Min(Spc_Data_XR.CL_Rk); + if (maxRk > Spc_Data_XR.UCL_R) + { + chart1.ChartAreas["ChartArea_R"].AxisY.Maximum = Convert.ToDouble((maxRk + gapAxis_R / 8).ToString("F2")); + } + else + { + chart1.ChartAreas["ChartArea_R"].AxisY.Maximum = Convert.ToDouble((Spc_Data_XR.UCL_R + gapAxis_R / 8).ToString("F2")); + } + if (minRk < Spc_Data_XR.LCL_R) + { + chart1.ChartAreas["ChartArea_R"].AxisY.Minimum = Convert.ToDouble((minRk - gapAxis_R / 8).ToString("F2")); + } + else + { + chart1.ChartAreas["ChartArea_R"].AxisY.Minimum = Convert.ToDouble((Spc_Data_XR.LCL_R - gapAxis_R / 8).ToString("F2")); + } + + + // Set axis title + chart1.ChartAreas["ChartArea_X"].AxisY.Title = "均值图"; + chart1.ChartAreas["ChartArea_R"].AxisY.Title = "极差图"; + chart1.ChartAreas["ChartArea_X"].AxisY.TitleFont = new Font("Microsoft Sans Serif", 8); + chart1.ChartAreas["ChartArea_R"].AxisY.TitleFont = new Font("Microsoft Sans Serif", 8); + + + // Set Strip line item + chart1.ChartAreas["ChartArea_X"].AxisY.StripLines[0].IntervalOffset = Spc_Data_XR.LCL_X; + chart1.ChartAreas["ChartArea_X"].AxisY.StripLines[0].StripWidth = Spc_Data_XR.UCL_X - Spc_Data_XR.LCL_X; + + // Set Strip line item + chart1.ChartAreas["ChartArea_X"].AxisY.StripLines[1].IntervalOffset = Spc_Data_XR.CL_X; + chart1.ChartAreas["ChartArea_X"].AxisY.StripLines[1].Text = "CL=" + Spc_Data_XR.CL_X.ToString("F2"); + chart1.ChartAreas["ChartArea_X"].AxisY.StripLines[2].IntervalOffset = Spc_Data_XR.UCL_X; + chart1.ChartAreas["ChartArea_X"].AxisY.StripLines[2].Text = "UCL=" + Spc_Data_XR.UCL_X.ToString("F2"); + chart1.ChartAreas["ChartArea_X"].AxisY.StripLines[3].IntervalOffset = Spc_Data_XR.LCL_X; + chart1.ChartAreas["ChartArea_X"].AxisY.StripLines[3].Text = "LCL=" + Spc_Data_XR.LCL_X.ToString("F2"); + + // Set Strip line item + chart1.ChartAreas["ChartArea_R"].AxisY.StripLines[0].IntervalOffset = Spc_Data_XR.LCL_R; + chart1.ChartAreas["ChartArea_R"].AxisY.StripLines[0].StripWidth = Spc_Data_XR.UCL_R - Spc_Data_XR.LCL_R; + + // Set Strip line item + chart1.ChartAreas["ChartArea_R"].AxisY.StripLines[1].IntervalOffset = Spc_Data_XR.CL_R; + chart1.ChartAreas["ChartArea_R"].AxisY.StripLines[1].Text = "CL=" + Spc_Data_XR.CL_R.ToString("F2"); + chart1.ChartAreas["ChartArea_R"].AxisY.StripLines[2].IntervalOffset = Spc_Data_XR.UCL_R; + chart1.ChartAreas["ChartArea_R"].AxisY.StripLines[2].Text = "UCL=" + Spc_Data_XR.UCL_R.ToString("F2"); + chart1.ChartAreas["ChartArea_R"].AxisY.StripLines[3].IntervalOffset = Spc_Data_XR.LCL_R; + chart1.ChartAreas["ChartArea_R"].AxisY.StripLines[3].Text = "LCL=" + Spc_Data_XR.LCL_R.ToString("F2"); + + } + + /// + /// 均值标准差图 + /// + /// + /// + /// + public static void ChartQualityData_XS(double[] X, int n, Chart chart1) + { + //计算XS控制图的数据 + ASPNet_Drawing.CSpc_Data_XS Spc_Data_XS = ASPNet_Drawing.Spc_Data.XS(X, n); + for (int i = 0; i < Spc_Data_XS.CL_Xk.Length; i++) + { + //X + chart1.Series["Series_X"].Points.AddXY(i + 1, Spc_Data_XS.CL_Xk[i]); + //S + chart1.Series["Series_S"].Points.AddXY(i + 1, Spc_Data_XS.CL_Sk[i]); + } + chart1.Series["Series_X"].ToolTip = "测量值:= #VALY"; + chart1.Series["Series_S"].ToolTip = "测量值:= #VALY"; + + ////均值图Y轴范围 + double gapAxis_X = Spc_Data_XS.UCL_X - Spc_Data_XS.LCL_X; + //均值的最大值 + double maxXk = Max(Spc_Data_XS.CL_Xk); + //均值的最小值 + double minXk = Min(Spc_Data_XS.CL_Xk); + if (maxXk > Spc_Data_XS.UCL_X) + { + chart1.ChartAreas["ChartArea_X"].AxisY.Maximum = Convert.ToDouble((maxXk + gapAxis_X / 8).ToString("F2")); + } + else + { + chart1.ChartAreas["ChartArea_X"].AxisY.Maximum = Convert.ToDouble((Spc_Data_XS.UCL_X + gapAxis_X / 8).ToString("F2")); + } + if (minXk < Spc_Data_XS.LCL_X) + { + chart1.ChartAreas["ChartArea_X"].AxisY.Minimum = Convert.ToDouble((minXk - gapAxis_X / 8).ToString("F2")); + } + else + { + chart1.ChartAreas["ChartArea_X"].AxisY.Minimum = Convert.ToDouble((Spc_Data_XS.LCL_X - gapAxis_X / 8).ToString("F2")); + } + + ////标准差图Y轴范围 + double gapAxis_R = Spc_Data_XS.UCL_S - Spc_Data_XS.LCL_S; + //标准差最大值 + double maxRk = Max(Spc_Data_XS.CL_Sk); + //标准差最小值 + double minRk = Min(Spc_Data_XS.CL_Sk); + if (maxRk > Spc_Data_XS.UCL_S) + { + chart1.ChartAreas["ChartArea_S"].AxisY.Maximum = Convert.ToDouble((maxRk + gapAxis_R / 8).ToString("F2")); + } + else + { + chart1.ChartAreas["ChartArea_S"].AxisY.Maximum = Convert.ToDouble((Spc_Data_XS.UCL_S + gapAxis_R / 8).ToString("F2")); + } + if (minRk < Spc_Data_XS.LCL_S) + { + chart1.ChartAreas["ChartArea_S"].AxisY.Minimum = Convert.ToDouble((minRk - gapAxis_R / 8).ToString("F2")); + } + else + { + chart1.ChartAreas["ChartArea_S"].AxisY.Minimum = Convert.ToDouble((Spc_Data_XS.LCL_S - gapAxis_R / 8).ToString("F2")); + } + + + // Set axis title + chart1.ChartAreas["ChartArea_X"].AxisY.Title = "均值图"; + chart1.ChartAreas["ChartArea_S"].AxisY.Title = "标准差图"; + chart1.ChartAreas["ChartArea_X"].AxisY.TitleFont = new Font("Microsoft Sans Serif", 8); + chart1.ChartAreas["ChartArea_S"].AxisY.TitleFont = new Font("Microsoft Sans Serif", 8); + + + // Set Strip line item + chart1.ChartAreas["ChartArea_X"].AxisY.StripLines[0].IntervalOffset = Spc_Data_XS.LCL_X; + chart1.ChartAreas["ChartArea_X"].AxisY.StripLines[0].StripWidth = Spc_Data_XS.UCL_X - Spc_Data_XS.LCL_X; + + // Set Strip line item + chart1.ChartAreas["ChartArea_X"].AxisY.StripLines[1].IntervalOffset = Spc_Data_XS.CL_X; + chart1.ChartAreas["ChartArea_X"].AxisY.StripLines[1].Text = "CL=" + Spc_Data_XS.CL_X.ToString("F2"); + chart1.ChartAreas["ChartArea_X"].AxisY.StripLines[2].IntervalOffset = Spc_Data_XS.UCL_X; + chart1.ChartAreas["ChartArea_X"].AxisY.StripLines[2].Text = "UCL=" + Spc_Data_XS.UCL_X.ToString("F2"); + chart1.ChartAreas["ChartArea_X"].AxisY.StripLines[3].IntervalOffset = Spc_Data_XS.LCL_X; + chart1.ChartAreas["ChartArea_X"].AxisY.StripLines[3].Text = "LCL=" + Spc_Data_XS.LCL_X.ToString("F2"); + + // Set Strip line item + chart1.ChartAreas["ChartArea_S"].AxisY.StripLines[0].IntervalOffset = Spc_Data_XS.LCL_S; + chart1.ChartAreas["ChartArea_S"].AxisY.StripLines[0].StripWidth = Spc_Data_XS.UCL_S - Spc_Data_XS.LCL_S; + + // Set Strip line item + chart1.ChartAreas["ChartArea_S"].AxisY.StripLines[1].IntervalOffset = Spc_Data_XS.CL_S; + chart1.ChartAreas["ChartArea_S"].AxisY.StripLines[1].Text = "CL=" + Spc_Data_XS.CL_S.ToString("F2"); + chart1.ChartAreas["ChartArea_S"].AxisY.StripLines[2].IntervalOffset = Spc_Data_XS.UCL_S; + chart1.ChartAreas["ChartArea_S"].AxisY.StripLines[2].Text = "UCL=" + Spc_Data_XS.UCL_S.ToString("F2"); + chart1.ChartAreas["ChartArea_S"].AxisY.StripLines[3].IntervalOffset = Spc_Data_XS.LCL_S; + chart1.ChartAreas["ChartArea_S"].AxisY.StripLines[3].Text = "LCL=" + Spc_Data_XS.LCL_S.ToString("F2"); + } + + ///// + ///// 故障率 lvzhen + ///// + ///// + ///// + //public static void ChartFaultPercent(DataTable dt, Chart chart1) + //{ + // if (dt.Rows.Count == 0) + // return; + // foreach (DataRow row in dt.Rows) + // { + // string seriesName = row["工位号"].ToString(); + // chart1.Series.Add(seriesName); + // chart1.Series[seriesName].ChartType = SeriesChartType.Column; + // chart1.Series[seriesName].BorderWidth = 2; + // chart1.Series[seriesName].ToolTip = "工位号:" + row["工位号"].ToString() + "\n运行时间: " + row["运行时间"].ToString() + "\n故障时间: " + row["故障时间"].ToString() + "\n故障率:#VALY"; + // for (int colIndex = 3; colIndex < dt.Columns.Count; colIndex++) + // { + // // For each column (column 1 and onward) add the value as a point + // string columnName = dt.Columns[colIndex].ColumnName; + // string YVal = row[columnName].ToString(); + // chart1.Series[seriesName].Points.AddXY(columnName, YVal); + // } + // //for (int i = 0; i < 10; i++) + // //{ + // // chart1.Series[seriesName].Points.AddXY(dt.Rows[i]["报警编号"], dt.Rows[i]["报警数量"]); + // //} + // //chart1.DataBind(); + // } + //} + + ///// + ///// 故障率 lvzhen + ///// + ///// + ///// + //public static void ChartFaultPercentTrue(DataTable dt, Chart chart1) + //{ + // if (dt.Rows.Count == 0) + // return; + // foreach (DataRow row in dt.Rows) + // { + // string seriesName = row["工位号"].ToString(); + // chart1.Series.Add(seriesName); + // chart1.Series[seriesName].ChartType = SeriesChartType.Column; + // chart1.Series[seriesName].BorderWidth = 2; + // chart1.Series[seriesName].ToolTip = "工位号:" + row["工位号"].ToString() + " \n故障率:#VALY"; + // for (int colIndex = 3; colIndex < dt.Columns.Count; colIndex++) + // { + // // For each column (column 1 and onward) add the value as a point + // string columnName = dt.Columns[colIndex].ColumnName; + // string YVal = row[columnName].ToString(); + // chart1.Series[seriesName].Points.AddXY(columnName, YVal); + // } + // //for (int i = 0; i < 10; i++) + // //{ + // // chart1.Series[seriesName].Points.AddXY(dt.Rows[i]["报警编号"], dt.Rows[i]["报警数量"]); + // //} + // //chart1.DataBind(); + // } + //} + ///// + ///// 开机率 lvzhen + ///// + ///// + ///// + //public static void ChartKaijiProportion(DataTable dt, Chart chart1) + //{ + // chart1.Series[0].Points.DataBind(dt.DefaultView, "操作日期", "开机率", "Tooltip=ToolTip"); + //} + +} \ No newline at end of file diff --git a/App_code/drawchart/DrawChartAddition.cs b/App_code/drawchart/DrawChartAddition.cs new file mode 100644 index 0000000..82853e0 --- /dev/null +++ b/App_code/drawchart/DrawChartAddition.cs @@ -0,0 +1,88 @@ +using System; +using System.Drawing; +using System.Collections.Generic; +using System.Linq; +using System.Web; +using System.Data; +using System.Web.UI.DataVisualization.Charting; +using System.Data.SqlClient; + + +/// +///DrawChart 的摘要说明 +/// +public partial class DrawChart +{ + + /// + /// 故障率 lvzhen + /// + /// + /// + public static void ChartFaultPercent(DataTable dt, Chart chart1) + { + if (dt.Rows.Count == 0) + return; + foreach (DataRow row in dt.Rows) + { + string seriesName = row["工位号"].ToString(); + chart1.Series.Add(seriesName); + chart1.Series[seriesName].ChartType = SeriesChartType.Column; + chart1.Series[seriesName].BorderWidth = 2; + chart1.Series[seriesName].ToolTip = "工位号:" + row["工位号"].ToString() + "\n运行时间: " + row["运行时间"].ToString() + "\n故障时间: " + row["故障时间"].ToString() + "\n故障率:#VALY"; + for (int colIndex = 3; colIndex < dt.Columns.Count; colIndex++) + { + // For each column (column 1 and onward) add the value as a point + string columnName = dt.Columns[colIndex].ColumnName; + string YVal = row[columnName].ToString(); + chart1.Series[seriesName].Points.AddXY(columnName, YVal); + } + //for (int i = 0; i < 10; i++) + //{ + // chart1.Series[seriesName].Points.AddXY(dt.Rows[i]["报警编号"], dt.Rows[i]["报警数量"]); + //} + //chart1.DataBind(); + } + } + + /// + /// 故障率 lvzhen + /// + /// + /// + public static void ChartFaultPercentTrue(DataTable dt, Chart chart1) + { + if (dt.Rows.Count == 0) + return; + foreach (DataRow row in dt.Rows) + { + string seriesName = row["工位号"].ToString(); + chart1.Series.Add(seriesName); + chart1.Series[seriesName].ChartType = SeriesChartType.Column; + chart1.Series[seriesName].BorderWidth = 2; + chart1.Series[seriesName].ToolTip = "工位号:" + row["工位号"].ToString()+" \n故障率:#VALY"; + for (int colIndex = 3; colIndex < dt.Columns.Count; colIndex++) + { + // For each column (column 1 and onward) add the value as a point + string columnName = dt.Columns[colIndex].ColumnName; + string YVal = row[columnName].ToString(); + chart1.Series[seriesName].Points.AddXY(columnName, YVal); + } + //for (int i = 0; i < 10; i++) + //{ + // chart1.Series[seriesName].Points.AddXY(dt.Rows[i]["报警编号"], dt.Rows[i]["报警数量"]); + //} + //chart1.DataBind(); + } + } + /// + /// 开机率 lvzhen + /// + /// + /// + public static void ChartKaijiProportion(DataTable dt, Chart chart1) + { + chart1.Series[0].Points.DataBind(dt.DefaultView, "操作日期", "开机率", "Tooltip=ToolTip"); + } + +} \ No newline at end of file diff --git a/App_code/drawchart/DrawPareto.cs b/App_code/drawchart/DrawPareto.cs new file mode 100644 index 0000000..66e35aa --- /dev/null +++ b/App_code/drawchart/DrawPareto.cs @@ -0,0 +1,300 @@ +using System; +using System.Drawing; +using System.Drawing.Drawing2D; +using System.Web.UI.DataVisualization.Charting; +using System.Collections; + +/// +///DrawPareto 的摘要说明 +/// +public class DrawPareto +{ + public DrawPareto() + { + // + //TODO: 在此处添加构造函数逻辑 + // + } + + + /// + /// Number of class intervals the data range is devided in. + /// This property only has affect when "SegmentIntervalWidth" is + /// set to double.NaN. + /// + public int SegmentIntervalNumber = 20; + + /// + /// Histogram class interval width. Setting this value to "double.NaN" + /// will result in automatic width calculation based on the data range + /// and number of required interval specified in "SegmentIntervalNumber". + /// + public double SegmentIntervalWidth = double.NaN; + + /// + /// Indicates that percent frequency should be shown on the right axis + /// + public bool ShowPercentOnSecondaryYAxis = true; + + + public void CreatePareto( + Chart chartControl, + string dataSeriesName, + string histogramSeriesName) + { + // Validate input + if (chartControl == null) + { + throw (new ArgumentNullException("chartControl")); + } + if (chartControl.Series.IndexOf(dataSeriesName) < 0) + { + throw (new ArgumentException("Series with name'" + dataSeriesName + "' was not found.", "dataSeriesName")); + } + + // Make data series invisible + chartControl.Series[dataSeriesName].Enabled = false; + + // Check if histogram series exsists + Series histogramSeries = null; + if (chartControl.Series.IndexOf(histogramSeriesName) < 0) + { + // Add new series + histogramSeries = chartControl.Series.Add(histogramSeriesName); + + // Set new series chart type and other attributes + histogramSeries.ChartType = SeriesChartType.Column; + histogramSeries.BorderColor = Color.Black; + histogramSeries.BorderWidth = 1; + histogramSeries.BorderDashStyle = ChartDashStyle.Solid; + } + else + { + histogramSeries = chartControl.Series[histogramSeriesName]; + histogramSeries.Points.Clear(); + } + + // Get data series minimum and maximum values + double minValue = double.MaxValue; + double maxValue = double.MinValue; + int pointCount = 0; + foreach (DataPoint dataPoint in chartControl.Series[dataSeriesName].Points) + { + // Process only non-empty data points + if (!dataPoint.IsEmpty) + { + if (dataPoint.YValues[0] > maxValue) + { + maxValue = dataPoint.YValues[0]; + } + if (dataPoint.YValues[0] < minValue) + { + minValue = dataPoint.YValues[0]; + } + ++pointCount; + } + } + + // Calculate interval width if it's not set + if (double.IsNaN(this.SegmentIntervalWidth)) + { + this.SegmentIntervalWidth = (maxValue - minValue) / SegmentIntervalNumber; + this.SegmentIntervalWidth = RoundInterval(this.SegmentIntervalWidth); + } + + // Round minimum and maximum values + minValue = Math.Floor(minValue / this.SegmentIntervalWidth) * this.SegmentIntervalWidth; + maxValue = Math.Ceiling(maxValue / this.SegmentIntervalWidth) * this.SegmentIntervalWidth; + + // Create histogram series points + double currentPosition = minValue; + for (currentPosition = minValue; currentPosition <= maxValue; currentPosition += this.SegmentIntervalWidth) + { + // Count all points from data series that are in current interval + int count = 0; + foreach (DataPoint dataPoint in chartControl.Series[dataSeriesName].Points) + { + if (!dataPoint.IsEmpty) + { + double endPosition = currentPosition + this.SegmentIntervalWidth; + if (dataPoint.YValues[0] >= currentPosition && + dataPoint.YValues[0] < endPosition) + { + ++count; + } + + // Last segment includes point values on both segment boundaries + else if (endPosition >= maxValue) + { + if (dataPoint.YValues[0] >= currentPosition && + dataPoint.YValues[0] <= endPosition) + { + ++count; + } + } + } + } + + + // Add data point into the histogram series + //histogramSeries.Points.AddXY("", count); + histogramSeries.Points.AddY( count); + + } + + histogramSeries.Sort(PointSortOrder.Descending); + + // Adjust series attributes + histogramSeries["PointWidth"] = "1"; + + // Adjust chart area + ChartArea chartArea = chartControl.ChartAreas[histogramSeries.ChartArea]; + chartArea.AxisY.Title = "频数"; + //chartArea.AxisX.Minimum = minValue; + //chartArea.AxisX.Maximum = maxValue; + + // Set axis interval based on the histogram class interval + // and do not allow more than 10 labels on the axis. + double axisInterval = this.SegmentIntervalWidth; + while ((maxValue - minValue) / axisInterval > 10.0) + { + axisInterval *= 2.0; + } + chartArea.AxisX.Interval = axisInterval; + + // Set chart area secondary Y axis + chartArea.AxisY2.Enabled = AxisEnabled.Auto; + if (this.ShowPercentOnSecondaryYAxis) + { + chartArea.RecalculateAxesScale(); + + chartArea.AxisY2.Enabled = AxisEnabled.True; + chartArea.AxisY2.LabelStyle.Format = "P0"; + chartArea.AxisY2.MajorGrid.Enabled = false; + chartArea.AxisY2.Title = "Percent of Total"; + + chartArea.AxisY2.Minimum = 0; + chartArea.AxisY2.Maximum = chartArea.AxisY.Maximum / (pointCount / 100.0); + double minStep = (chartArea.AxisY2.Maximum > 20.0) ? 5.0 : 1.0; + chartArea.AxisY2.Interval = Math.Ceiling((chartArea.AxisY2.Maximum / 5.0 / minStep)) * minStep; + + } + } + + /// + /// Helper method which rounds specified axsi interval. + /// + /// Calculated axis interval. + /// Rounded axis interval. + public double RoundInterval(double interval) + { + // If the interval is zero return error + if (interval == 0.0) + { + throw (new ArgumentOutOfRangeException("interval", "Interval can not be zero.")); + } + + // If the real interval is > 1.0 + double step = -1; + double tempValue = interval; + while (tempValue > 1.0) + { + step++; + tempValue = tempValue / 10.0; + if (step > 1000) + { + throw (new InvalidOperationException("Auto interval error due to invalid point values or axis minimum/maximum.")); + } + } + + // If the real interval is < 1.0 + tempValue = interval; + if (tempValue < 1.0) + { + step = 0; + } + + while (tempValue < 1.0) + { + step--; + tempValue = tempValue * 10.0; + if (step < -1000) + { + throw (new InvalidOperationException("Auto interval error due to invalid point values or axis minimum/maximum.")); + } + } + + double tempDiff = interval / Math.Pow(10.0, step); + if (tempDiff < 3.0) + { + tempDiff = 2.0; + } + else if (tempDiff < 7.0) + { + tempDiff = 5.0; + } + else + { + tempDiff = 10.0; + } + + // Make a correction of the real interval + return tempDiff * Math.Pow(10.0, step); + } + + public void MakeParetoChart(Chart chart, string srcSeriesName, string destSeriesName) + { + + // get name of the ChartAre of the source series + string strChartArea = chart.Series[srcSeriesName].ChartArea; + + // ensure the source series is a column chart type + chart.Series[srcSeriesName].ChartType = SeriesChartType.Column; + + // sort the data in the series to be by values in descending order + chart.DataManipulator.Sort(PointSortOrder.Descending, srcSeriesName); + + // find the total of all points in the source series + double total = 0.0; + foreach (DataPoint pt in chart.Series[srcSeriesName].Points) + total += pt.YValues[0]; + + // set the max value on the primary axis to total + chart.ChartAreas[strChartArea].AxisY.Maximum = total; + + // create the destination series and add it to the chart + Series destSeries = new Series(destSeriesName); + chart.Series.Add(destSeries); + + // ensure the destination series is a Line or Spline chart type + destSeries.ChartType = SeriesChartType.Line; + + destSeries.BorderWidth = 3; + + // assign the series to the same chart area as the column chart + destSeries.ChartArea = chart.Series[srcSeriesName].ChartArea; + + // assign this series to use the secondary axis and set it maximum to be 100% + destSeries.YAxisType = AxisType.Secondary; + chart.ChartAreas[strChartArea].AxisY2.Maximum = 100; + + // locale specific percentage format with no decimals + chart.ChartAreas[strChartArea].AxisY2.LabelStyle.Format = "0.#"; + + // turn off the end point values of the primary X axis + chart.ChartAreas[strChartArea].AxisX.LabelStyle.IsEndLabelVisible = false; + + // for each point in the source series find % of total and assign to series + double percentage = 0.0; + + foreach (DataPoint pt in chart.Series[srcSeriesName].Points) + { + percentage += (pt.YValues[0] / total * 100.0); + //Chart1.Series["Default"].Points.AddXY(pt.XValue,Math.Round(percentage, 2)); + destSeries.Points.Add(Math.Round(percentage, 2)); + } + + } + + +} \ No newline at end of file diff --git a/App_code/drawchart/SpcCaculator.cs b/App_code/drawchart/SpcCaculator.cs new file mode 100644 index 0000000..5f3f323 --- /dev/null +++ b/App_code/drawchart/SpcCaculator.cs @@ -0,0 +1,512 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Web; +using System.Collections; +using System.Data; +using ASPNet_Drawing; +/// +///SpcCaculator 的摘要说明 +/// +public class SpcCaculator +{ + /// + /// SPC系数表 + ///(0)样本大小 (1)A (2)A2 (3)A3 (4)C4 (5)1/C4 (6)B3 (7)B4 (8)B5 (9)B6 (10)d2 (11)1/d2 (12)d3 (13)D1 (14)D2 (15)D3 (16)D4 (17)M3 (18)M3A2 + /// + static public double[,] SPC_coefficient = { {2,2.121,1.880,2.659,0.798,1.253,0,3.267,0,2.606,1.128,0.887,0.853,0,3.686,0,3.267,1.000,1.880}, +{3,1.732,1.023,1.954,0.886,1.128,0,2.568,0,2.276,1.693,0.591,0.888,0,4.358,0,2.574,1.160,1.187}, +{4,1.500,0.729,1.628,0.921,1.085,0,2.266,0,2.088,2.059,0.486,0.880,0,4.698,0,2.282,1.092,0.796}, +{5,1.342,0.572,1.427,0.940,1.064,0,2.089,0,1.964,2.326,0.430,0.864,0,4.918,0,2.114,1.198,0.691}, +{6,1.225,0.483,1.287,0.952,1.051,0.030,1.970,0.029,1.874,2.534,0.395,0.848,0,5.078,0,2.004,1.135,0.549}, +{7,1.134,0.419,1.182,0.959,1.042,0.118,1.882,0.113,1.806,2.704,0.370,0.833,0.204,5.204,0.076,1.924,1.214,0.509}, +{8,1.061,0.373,1.099,0.965,1.036,0.185,1.815,0.179,1.751,2.847,0.351,0.820,0.388,5.306,0.136,1.864,1.160,0.432}, +{9,1.00,0.377,1.032,0.969,1.032,0.29,1.761,0.232,1.707,2.970,0.337,0.808,0.547,5.393,0.184,1.816,1.223,0.412}, +{10,0.949,0.308,0.975,0.973,1.028,0.284,1.716,0.276,1.669,3.078,0.325,0.797,0.687,5.469,0.223,1.777,1.176,0.363}, +{11,0.905,0.285,0.927,0.975,1.025,0.321,1.679,0.313,1.637,3.173,0.315,0.787,0.811,5.535,0.256,1.744,0,0}, +{12,0.886,0.266,0.886,0.978,1.023,0.354,1.646,0.346,1.610,3.258,0.307,0.778,0.922,5.594,0.283,1.717,0,0}, +{13,0.832,0.249,0.850,0.979,1.021,0.382,1.618,0.374,1.585,3.336,0.300,0.770,1.025,5.647,0.307,1.693,0,0}, +{14,0.802,0.235,0.817,0.981,1.019,0.406,1.594,0.399,1.563,3.407,0.294,0.763,1.118,5.696,0.328,1.672,0,0}, +{15,0.775,0.223,0.789,0.982,1.018,0.428,1.157,0.421,1.544,3.472,0.288,0.756,1.203,5.741,0.347,1.653,0,0}, +{16,0.750,0.212,0.763,0.984,1.017,0.448,1.552,0.440,1.526,3.532,0.283,0.750,1.282,5.782,0.363,1.637,0,0}, +{17,0.728,0.203,0.739,0.985,1.016,0.466,1.534,0.458,1.511,3.588,0.279,0.744,1.356,5.820,0.378,1.622,0,0}, +{18,0.707,0.194,0.718,0.985,1.015,0.482,1.518,0.475,1.496,3.640,0.275,0.739,1.424,5.856,0.391,1.608,0,0}, +{19,0.688,0.187,0.698,0.986,1.014,0.497,1.503,0.490,1.483,3.689,0.271,0.734,1.487,5.891,0.403,1.597,0,0}, +{20,0.671,0.180,0.680,0.987,1.013,0.510,1.490,0.504,1.470,3.735,0.268,0.729,1.549,5.921,0.415,1.585,0,0}, +{21,0.655,0.173,0.663,0.988,1.013,0.253,1.477,0.516,1.459,3.778,0.265,0.724,1.605,5.951,0.425,1.575,0,0}, +{22,0.640,0.167,0.647,0.988,1.012,0.534,1.466,0.528,1.448,3.819,0.262,0.720,1.659,5.979,0.434,1.566,0,0}, +{23,0.626,0.126,0.633,0.989,1.011,0.545,1.455,0.539,1.438,3.858,0.259,0.716,1.710,6.006,0.443,1.557,0,0}, +{24,0.612,0.157,0.619,0989,1.011,0.555,1.445,0.549,1.429,3.895,0.257,0.712,1.759,6.031,0.451,1.548,0,0}, +{25,0.600,0.153,0.606,0.990,1.011,0.565,1.435,0.559,1.420,3.931,0.254,0.708,1.806,6.056,0.459,1.541,0,0} }; + + static double QU_k = 0.99865; + static double QL_k = 0.00135; + + /// + /// 计算SPC主要参数: + /// 输入:"X"被分析数据组;Usl理论上限;Lsl理论下限。 + /// 输出:x平均值;"s"均方差;"QU"百分比上限;"QL"百分比下限;"cp"工序能力;"cpk"工序能力指数 + /// + /// 被分析数据组 + /// 理论上限 + /// 理论下限 + /// 平均值 + /// 均方差 + /// 百分比上限 + /// 百分比下限 + /// 工序能力 + /// 工序能力指数 + public static void SpcValue(double[] X, ref double Usl, ref double Lsl, out double x, out double s, + out double QU, out double QL, out double cp, out double cpk, out double[] sx, out double[] sy) + { + x = AVERAGE(X); + s = STDEV(X); + if (Usl == Lsl) + { + Usl = x + 4.0 * s; + Lsl = x - 4.0 * s; + } + QU_QL(X, out QU, out QL); + cp = Cp(QU, QL, Usl, Lsl); + cpk = Cpk(x, QU, QL, Usl, Lsl); + sxy(s, x, out sx, out sy); + + } + + + + /// + /// 计算SPC主要参数: + /// 输入:"X"被分析数据组;Usl理论上限;Lsl理论下限。 + /// 输出:x平均值;"s"均方差;"QU"百分比上限;"QL"百分比下限;"cp"工序能力;"cpk"工序能力指数 + /// + /// 被分析数据组 + /// 理论上限 + /// 理论下限 + /// 平均值 + /// 均方差 + /// 百分比上限 + /// 百分比下限 + /// 工序能力 + /// 工序能力指数 + public static void SpcValue(int n,double[] X, ref double Usl, ref double Lsl, out double x, out double s, + out double QU, out double QL, out double cp, out double cpk, out double[] sx, out double[] sy) + { + + x = AVERAGE(X); + s = STDEV(X); + if (Usl == Lsl) + { + Usl = x + 4.0 * s; + Lsl = x - 4.0 * s; + } + QU_QL(X, out QU, out QL); + cp = Cp(QU, QL, Usl, Lsl); + cpk = Cpk(x, QU, QL, Usl, Lsl); + sxy(s, x, out sx, out sy); + + + double X2 = Spc_Data.Average(X, n); + double S2 = Spc_Data.StandardDeviation_S2(X, n); + double R2 = Spc_Data.Range_R2(X, n); + double xiGamaC4; + double xiGamaD2; + double c4 = (double)Spc_Data.Spc_Param.Tables[Xml_Spc_Param.Table_Name].Rows[n - 2][Xml_Spc_Param.Param_C4]; + double d2 = (double)Spc_Data.Spc_Param.Tables[Xml_Spc_Param.Table_Name].Rows[n - 2][Xml_Spc_Param.Param_L_D1]; + xiGamaC4 = S2 / c4; + xiGamaD2 = R2 / d2; + double USL = Usl; + double LSL = Lsl; + double T = USL - LSL; + double CP = T / (6 * xiGamaD2); + + double M = (USL + LSL) / 2.0; + double M1 = M - X2; + M1 = Math.Abs(M1); + double CPK = CP - M1 / (3 * xiGamaD2); + + + cp = CP; + cpk = CPK; + + + } + /// + /// 均方差 + /// + /// 被分析数据组 + /// 均方差 + public static double STDEV(double[] X) + { + if (X.Length < 2) + return 0; + double s = 0; + //平均值 + double x; + x = AVERAGE(X); + for (int i = 0; i < X.Length; i++) + { + s = s + (X[i] - x) * (X[i] - x); + } + s = Math.Sqrt(s / (double)(X.Length - 1)); + return s; + } + /// + /// 平均值 + /// + /// 被分析数据组 + /// 平均值 + public static double AVERAGE(double[] X) + { + return X.Average(); + } + /// + /// 排序 + /// + /// + /// + public static double[] Sort(double[] X) + { + ArrayList temp = new ArrayList(X); + temp.Sort(); + return X = (double[])temp.ToArray(typeof(double)); + } + + /// + /// 已知表格行数为m,各行的数值分别记为 ,其中 表示第 行的数值, + /// 将这 个数值由小到大排列,记排列后的数值为 ,其中 表示 个数值经排列之后第k个数值。 + /// 给定上下标线数值0.99865和0.00135。计算Q上和Q下的方法为: + ///a = (m - 1)* 0.99865 + ///取a的整数部分为i,小数部分为j。 + ///Q上 = (1 – j)* x(i+1)+ j * x(i+2) + ///同理: + ///b = (m - 1)* 0.00135 + ///取b的整数部分为i,小数部分为j。 + ///Q下 = (1 – j)* x(i+1)+ j * x(i+2) + /// + /// 被分析数据组 + /// 百分比上限 + /// 百分比下限 + public static void QU_QL(double[] X, out double QU, out double QL) + { + QU = 0; + QL = 0; + double QU_n; + int QU_n_i; + double QU_n_j; + double QL_n; + int QL_n_i; + double QL_n_j; + + X = Sort(X); + + QU_n = (double)(X.Length - 1) * QU_k; + QU_n_i = (int)QU_n; + QU_n_j = QU_n - QU_n_i; + //Q上 = (1 – j)* x(i+1)+ j * x(i+2) + QU = (1 - QU_n_j) * X[QU_n_i] + QU_n_j * X[QU_n_i + 1]; + + QL_n = (double)(X.Length - 1) * QL_k; + QL_n_i = (int)QL_n; + QL_n_j = QL_n - QL_n_i; + //Q下 = (1 – j)* x(i+1)+ j * x(i+2) + QL = (1 - QL_n_j) * X[QL_n_i] + QL_n_j * X[QL_n_i + 1]; + + return; + } + /// + /// 工序能力 + /// + /// 被分析数据组 + /// 理论上限 + /// 理论下限 + /// 工序能力 + public static double Cp(double[] X, double Usl, double Lsl) + { + + double QU; + double QL; + double cp = 0; + + QU_QL(X, out QU, out QL); + + cp = (Usl - Lsl) / (QU - QL); + return cp; + } + /// + /// 工序能力 + /// + /// 百分比上限 + /// 百分比下限 + /// 理论上限 + /// 理论下限 + /// + public static double Cp(double QU, double QL, double Usl, double Lsl) + { + + double cp = 0; + + + cp = (Usl - Lsl) / (QU - QL); + return cp; + } + /// + /// 工序能力指数 + /// + /// 被分析数据组 + /// 理论上限 + /// 理论下限 + /// + public static double Cpk(double[] X, double Usl, double Lsl) + { + double cpk; + double cpkU; + double cpkL; + double QU; + double QL; + double cp = 0; + //均方差 + double s; + //均值 + double x; + x = AVERAGE(X); + + QU_QL(X, out QU, out QL); + + cp = (Usl - Lsl) / (QU - QL); + + cpkU = (Usl - x) / (QU - x); + cpkL = (Lsl - x) / (QL - x); + cpk = Math.Min(cpkU, cpkL); + return cpk; + } + + + /// + /// 工序能力指数 + /// + /// 平均值 + /// 百分比上限 + /// 百分比下限 + /// 理论上限 + /// 理论下限 + /// + public static double Cpk(double x, double QU, double QL, double Usl, double Lsl) + { + double cpk; + double cpkU; + double cpkL; + + double cp = 0; + + + cp = Cp(QU, QL, Usl, Lsl); + + cpkU = (Usl - x) / (QU - x); + cpkL = (x - Lsl) / (x - QL); + cpk = Math.Min(cpkU, cpkL); + return cpk; + } + + /// + /// 计算正态分布的x坐标,y坐标 + /// + /// 均方差 + /// 平均值 + public static void sxy(double s, double x, out double[] sx, out double[] sy) + { + double S2; + double X2; + X2 = x; + S2 = s; + sx = new double[11]; + sy = new double[11]; + double tempmaxdouble = 1.0 / (s * Math.Sqrt(2.0 * Math.PI)); + sx[0] = X2 - 4.0 * S2; + sx[1] = X2 - 3.0 * S2; + sx[2] = X2 - 2.0 * S2; + sx[3] = X2 - 1.0 * S2; + sx[4] = X2 - 0.5 * S2; + sx[5] = X2; + sx[6] = X2 + 0.5 * S2; + sx[7] = X2 + 1.0 * S2; + sx[8] = X2 + 2.0 * S2; + sx[9] = X2 + 3.0 * S2; + sx[10] = X2 + 4.0 * S2; + + + sy[0] = tempmaxdouble * Math.Exp(-16.0F / 2.0F); + sy[1] = tempmaxdouble * Math.Exp(-9.0F / 2.0F); + sy[2] = tempmaxdouble * Math.Exp(-4.0F / 2.0F); + sy[3] = tempmaxdouble * Math.Exp(-1.0F / 2.0F); + sy[4] = tempmaxdouble * Math.Exp(-0.25F / 2.0F); + sy[5] = tempmaxdouble; + sy[6] = tempmaxdouble * Math.Exp(-0.25F / 2.0F); + sy[7] = tempmaxdouble * Math.Exp(-1.0F / 2.0F); + sy[8] = tempmaxdouble * Math.Exp(-4.0F / 2.0F); + sy[9] = tempmaxdouble * Math.Exp(-9.0F / 2.0F); + sy[10] = tempmaxdouble * Math.Exp(-16.0F / 2.0F); + + double sy_sum = 0; + for (int i = 0; i < sy.Length; i++) + { + sy_sum = sy_sum + sy[i]; + } + for (int i = 0; i < sy.Length; i++) + { + sy[i] = sy[i] / sy_sum; + } + } + /// + /// 根据查询的数据,获得理论上限,理论下限 + /// + /// + /// 理论上限 + /// 理论下限 + public static void GetUslLsl(DataTable dt, out double Usl, out double Lsl) + { + + Usl = 0; + Lsl = 0; + if (dt != null) + { + if (dt.Rows.Count > 0) + { + try + { + //Usl = Convert.ToDouble(dt.Rows[0]["上限值"]); + //Lsl = Convert.ToDouble(dt.Rows[0]["下限值"]); + Usl = 100; + Lsl = 100; + } + catch + { + Usl = 0; + Lsl = 0; + } + } + } + } + +} + +/// +/// 测试数据 +/// +public class Spc_Data_TestData +{ + /// + /// 子组大小。单个子组观测值的个数 + /// + static public int n = 5; + /// + /// 子组个数 + /// + static public int k = 30; + /// + /// 特征值上限 + /// + static public double USL = 1.7; + /// + /// 特征值下限 + /// + static public double LSL = 1.5; + /// + /// 特征值上限 + /// + static public double USL1 = 1.0; + /// + /// 特征值下限 + /// + static public double LSL1 = 0.9; + + /// + /// 特征值上限 + /// + static public double USL2 = 1.15; + /// + /// 特征值下限 + /// + static public double LSL2 = 1.10; + + + /// + /// 特征值上限 + /// + static public double USL3 = 129.01; + /// + /// 特征值下限 + /// + static public double LSL3 = 129; + static public double[] X3 = + { + 129.006,129.006,129.006,129.005,129.006, + 129.006,129.005,129.005,129.005,129.005, + 129.005,129.006,129.007,129.006,129.005, + 129.005,129.005,129.006,129.005,129.006, + 129.006,129.006,129.007,129.006,129.005, + 129.007,129.006,129.005,129.005,129.006, + 129.006,129.007,129.005,129.005,129.005, + 129.007,129.006,129.006,129.007,129.005, + 129.007,129.005,129.005,129.006,129.007, + 129.006,129.007,129.005,129.005,129.006 + + }; + static public double[] X2 = + { + 1.141,1.130,1.131,1.127,1.137, + 1.140,1.137,1.130,1.135,1.125, + 1.133,1.133,1.131,1.128,1.127, + 1.122,1.131,1.131,1.125,1.123, + 1.131,1.128,1.117,1.133,1.136, + 1.123,1.128,1.135,1.127,1.130, + 1.138,1.126,1.130,1.133,1.133, + 1.130,1.127,1.128,1.127,1.128, + 1.122,1.142,1.128,1.135,1.133, + 1.142,1.127,1.133,1.135,1.135 + }; + static public double[] X1 = + { 0.941,0.942,0.947,0.939,0.942,0.943, + 0.942,0.950,0.943,0.948,0.941,0.953, + 0.944,0.943,0.941,0.933,0.942,0.941, + 0.942,0.942,0.942,0.947,0.938,0.941, + 0.947,0.943,0.943,0.948,0.938,0.946, + 0.946,0.943,0.945,0.946,0.942,0.951, + 0.951,0.938,0.938,0.952,0.947,0.945, + 0.951,0.948,0.946,0.947,0.947,0.947, + 0.953,0.956 + }; + static public double[] X = + { 1.55,1.58,1.61,1.60,1.60,//1 + 1.58,1.63,1.63,1.62,1.63,//2 + 1.62,1.63,1.62,1.59,1.58,//3 + 1.58,1.60,1.61,1.62,1.63,//4 + 1.58,1.64,1.63,1.62,1.62,//5 + 1.62,1.62,1.63,1.61,1.57,//6 + 1.64,1.62,1.61,1.60,1.58,//7 + 1.57,1.59,1.61,1.62,1.63,//8 + 1.58,1.61,1.60,1.62,1.63,//9 + 1.60,1.61,1.64,1.64,1.63,//10 + 1.58,1.60,1.62,1.63,1.65,//11 + 1.62,1.58,1.59,1.57,1.58,//12 + 1.57,1.57,1.58,1.59,1.64,//13 + 1.61,1.64,1.62,1.60,1.59,//14 + 1.65,1.62,1.62,1.60,1.58,//15 + 1.57,1.59,1.57,1.59,1.62,//16 + 1.56,1.57,1.57,1.61,1.62,//17 + 1.56,1.58,1.59,1.60,1.62,//18 + 1.58,1.60,1.60,1.62,1.63,//19 + 1.58,1.59,1.60,1.63,1.62,//20 + 1.58,1.59,1.62,1.63,1.64,//21 + 1.58,1.59,1.62,1.63,1.61,//22 + 1.58,1.59,1.60,1.61,1.63,//23 + 1.57,1.59,1.61,1.61,1.62,//24 + 1.58,1.58,1.60,1.61,1.63,//25 + 1.62,1.58,1.58,1.58,1.57,//26 + 1.63,1.59,1.57,1.58,1.57,//27 + 1.58,1.62,1.61,1.63,1.61,//28 + 1.58,1.57,1.59,1.60,1.62,//29 + 1.62,1.60,1.60,1.57,1.57 //30 + }; + +} diff --git a/App_code/drawchart/_system~.ini b/App_code/drawchart/_system~.ini new file mode 100644 index 0000000..e69de29 diff --git a/App_code/drawchart/vssver2.scc b/App_code/drawchart/vssver2.scc new file mode 100644 index 0000000..4a50346 Binary files /dev/null and b/App_code/drawchart/vssver2.scc differ diff --git a/App_code/vssver2.scc b/App_code/vssver2.scc new file mode 100644 index 0000000..677b48c Binary files /dev/null and b/App_code/vssver2.scc differ diff --git a/App_code/webChatClient.cs b/App_code/webChatClient.cs new file mode 100644 index 0000000..0f803d9 --- /dev/null +++ b/App_code/webChatClient.cs @@ -0,0 +1,167 @@ +using System; +using System.Collections.Generic; +using System.Text; +using System.Net; +using System.Net.Sockets; +using System.Threading; +using MES_SPC; +namespace ChatClient +{ + public static class webChatClient + { + private static bool stopFlag; + /// + /// 服务器是否反馈 + /// + public static bool ServersResponse = false; + /// + /// 命令状态 + /// + public static bool commandstatus = false; + /// + /// 是否正忙 + /// + public static bool isworking = false; + //与服务器的连接 + static TcpClient tcpClient= new TcpClient(); + //与服务器数据交互的流通道 + private static NetworkStream Stream; + + ////客户端的状态 + //private static string CLOSED = "closed"; + //private static string CONNECTED = "connected"; + //private static string state = CLOSED; + ////private static bool stopFlag; + + static bool connect() + { + + string HostName = ApplicationConfiguration.GPRSDataHost; ; + //IPHostEntry dnstoip = new IPHostEntry(); + //dnstoip = Dns.GetHostEntry(HostName); + //string HostIP = dnstoip.AddressList[0].ToString(); + string Port = ApplicationConfiguration.GPRSDataPort; + return connect(HostName, Port); + } + private static bool connect(string HostName, string Port) + { + try + { + if (!tcpClient.Connected) + { + tcpClient = new TcpClient(); + tcpClient = TcpClientConnector.Connect(HostName, Int32.Parse(Port), 1000); + Stream = tcpClient.GetStream(); + //Thread thread = new Thread(new ThreadStart(ServerResponse)); + //thread.Start(); + string cmd = "CONN|" + "WEB" + "|!"; + Byte[] outbytes = System.Text.Encoding.Default.GetBytes( + cmd.ToCharArray()); + Stream.Write(outbytes, 0, outbytes.Length); + } + return true; + } + catch (Exception ex) + { + return false; + } + + } + + + //当单击“离开”按钮时,便进入了btnExit_Click 处理程序。 + //在btnExit_Click 处理程序中, + //将“EXIT”命令发送给服务器,此命令格式要与服务器端的命令格式一致 + private static void EXIT() + { + + try + { + if (tcpClient.Connected) + { + string message = "EXIT|" + "WEB" + "|!"; + //将字符串转化为字符数组 + Byte[] outbytes = System.Text.Encoding.Default.GetBytes( + message.ToCharArray()); + Stream.Write(outbytes, 0, outbytes.Length); + tcpClient.Close(); + } + } + + catch { } + } + + private static void ServerResponse() + { + //定义一个byte数组,用于接收从服务器端发送来的数据, + //每次所能接收的数据包的最大长度为1024个字节 + byte[] buff = new byte[1024]; + string msg; + int len; + try + { + if (!Stream.CanRead) + { + //return "不可读"; + return; + } + stopFlag = false; + while (!stopFlag) + { + //从流中得到数据,并存入到buff字符数组中 + len = Stream.Read(buff, 0, buff.Length); + if (len < 1) + { + Thread.Sleep(200); + continue; + } + ServersResponse = true; + } + tcpClient.Close(); + //关闭连接 + } + catch + { + //return "网络发生错误"; + } + } + static string command = ""; + //当点击“发送”按钮时,便会进入btnSend_Click处理程序。 + //在btnSend_Click处理程序中,如果不是私聊, + //将“CHAT”命令发送给服务器, + //否则(为私聊),将“PRIV”命令发送给服务器, + //注意命令格式一定要与服务器端的命令格式一致 + public static void sentmessage(string GPRScommand) + { + if (isworking) + { + return; + } + isworking = true; + try + { + command = GPRScommand; + commandstatus = false; + if (connect()) + { + byte[] outbytes = System.Text.Encoding.ASCII.GetBytes(command.ToCharArray()); + Stream.Write(outbytes, 0, outbytes.Length); + commandstatus = true; + } + else + { + commandstatus = false; + } + } + catch (Exception err) + { + tcpClient.Close(); + commandstatus = false; + } + isworking = false; + } + + + + } +} diff --git a/JS/_system~.ini b/JS/_system~.ini new file mode 100644 index 0000000..e69de29 diff --git a/JS/jquery-3.2.1.min.js b/JS/jquery-3.2.1.min.js new file mode 100644 index 0000000..644d35e --- /dev/null +++ b/JS/jquery-3.2.1.min.js @@ -0,0 +1,4 @@ +/*! jQuery v3.2.1 | (c) JS Foundation and other contributors | jquery.org/license */ +!function(a,b){"use strict";"object"==typeof module&&"object"==typeof module.exports?module.exports=a.document?b(a,!0):function(a){if(!a.document)throw new Error("jQuery requires a window with a document");return b(a)}:b(a)}("undefined"!=typeof window?window:this,function(a,b){"use strict";var c=[],d=a.document,e=Object.getPrototypeOf,f=c.slice,g=c.concat,h=c.push,i=c.indexOf,j={},k=j.toString,l=j.hasOwnProperty,m=l.toString,n=m.call(Object),o={};function p(a,b){b=b||d;var c=b.createElement("script");c.text=a,b.head.appendChild(c).parentNode.removeChild(c)}var q="3.2.1",r=function(a,b){return new r.fn.init(a,b)},s=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,t=/^-ms-/,u=/-([a-z])/g,v=function(a,b){return b.toUpperCase()};r.fn=r.prototype={jquery:q,constructor:r,length:0,toArray:function(){return f.call(this)},get:function(a){return null==a?f.call(this):a<0?this[a+this.length]:this[a]},pushStack:function(a){var b=r.merge(this.constructor(),a);return b.prevObject=this,b},each:function(a){return r.each(this,a)},map:function(a){return this.pushStack(r.map(this,function(b,c){return a.call(b,c,b)}))},slice:function(){return this.pushStack(f.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(a){var b=this.length,c=+a+(a<0?b:0);return this.pushStack(c>=0&&c0&&b-1 in a)}var x=function(a){var b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u="sizzle"+1*new Date,v=a.document,w=0,x=0,y=ha(),z=ha(),A=ha(),B=function(a,b){return a===b&&(l=!0),0},C={}.hasOwnProperty,D=[],E=D.pop,F=D.push,G=D.push,H=D.slice,I=function(a,b){for(var c=0,d=a.length;c+~]|"+K+")"+K+"*"),S=new RegExp("="+K+"*([^\\]'\"]*?)"+K+"*\\]","g"),T=new RegExp(N),U=new RegExp("^"+L+"$"),V={ID:new RegExp("^#("+L+")"),CLASS:new RegExp("^\\.("+L+")"),TAG:new RegExp("^("+L+"|[*])"),ATTR:new RegExp("^"+M),PSEUDO:new RegExp("^"+N),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+K+"*(even|odd|(([+-]|)(\\d*)n|)"+K+"*(?:([+-]|)"+K+"*(\\d+)|))"+K+"*\\)|)","i"),bool:new RegExp("^(?:"+J+")$","i"),needsContext:new RegExp("^"+K+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+K+"*((?:-\\d)?\\d*)"+K+"*\\)|)(?=[^-]|$)","i")},W=/^(?:input|select|textarea|button)$/i,X=/^h\d$/i,Y=/^[^{]+\{\s*\[native \w/,Z=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,$=/[+~]/,_=new RegExp("\\\\([\\da-f]{1,6}"+K+"?|("+K+")|.)","ig"),aa=function(a,b,c){var d="0x"+b-65536;return d!==d||c?b:d<0?String.fromCharCode(d+65536):String.fromCharCode(d>>10|55296,1023&d|56320)},ba=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g,ca=function(a,b){return b?"\0"===a?"\ufffd":a.slice(0,-1)+"\\"+a.charCodeAt(a.length-1).toString(16)+" ":"\\"+a},da=function(){m()},ea=ta(function(a){return a.disabled===!0&&("form"in a||"label"in a)},{dir:"parentNode",next:"legend"});try{G.apply(D=H.call(v.childNodes),v.childNodes),D[v.childNodes.length].nodeType}catch(fa){G={apply:D.length?function(a,b){F.apply(a,H.call(b))}:function(a,b){var c=a.length,d=0;while(a[c++]=b[d++]);a.length=c-1}}}function ga(a,b,d,e){var f,h,j,k,l,o,r,s=b&&b.ownerDocument,w=b?b.nodeType:9;if(d=d||[],"string"!=typeof a||!a||1!==w&&9!==w&&11!==w)return d;if(!e&&((b?b.ownerDocument||b:v)!==n&&m(b),b=b||n,p)){if(11!==w&&(l=Z.exec(a)))if(f=l[1]){if(9===w){if(!(j=b.getElementById(f)))return d;if(j.id===f)return d.push(j),d}else if(s&&(j=s.getElementById(f))&&t(b,j)&&j.id===f)return d.push(j),d}else{if(l[2])return G.apply(d,b.getElementsByTagName(a)),d;if((f=l[3])&&c.getElementsByClassName&&b.getElementsByClassName)return G.apply(d,b.getElementsByClassName(f)),d}if(c.qsa&&!A[a+" "]&&(!q||!q.test(a))){if(1!==w)s=b,r=a;else if("object"!==b.nodeName.toLowerCase()){(k=b.getAttribute("id"))?k=k.replace(ba,ca):b.setAttribute("id",k=u),o=g(a),h=o.length;while(h--)o[h]="#"+k+" "+sa(o[h]);r=o.join(","),s=$.test(a)&&qa(b.parentNode)||b}if(r)try{return G.apply(d,s.querySelectorAll(r)),d}catch(x){}finally{k===u&&b.removeAttribute("id")}}}return i(a.replace(P,"$1"),b,d,e)}function ha(){var a=[];function b(c,e){return a.push(c+" ")>d.cacheLength&&delete b[a.shift()],b[c+" "]=e}return b}function ia(a){return a[u]=!0,a}function ja(a){var b=n.createElement("fieldset");try{return!!a(b)}catch(c){return!1}finally{b.parentNode&&b.parentNode.removeChild(b),b=null}}function ka(a,b){var c=a.split("|"),e=c.length;while(e--)d.attrHandle[c[e]]=b}function la(a,b){var c=b&&a,d=c&&1===a.nodeType&&1===b.nodeType&&a.sourceIndex-b.sourceIndex;if(d)return d;if(c)while(c=c.nextSibling)if(c===b)return-1;return a?1:-1}function ma(a){return function(b){var c=b.nodeName.toLowerCase();return"input"===c&&b.type===a}}function na(a){return function(b){var c=b.nodeName.toLowerCase();return("input"===c||"button"===c)&&b.type===a}}function oa(a){return function(b){return"form"in b?b.parentNode&&b.disabled===!1?"label"in b?"label"in b.parentNode?b.parentNode.disabled===a:b.disabled===a:b.isDisabled===a||b.isDisabled!==!a&&ea(b)===a:b.disabled===a:"label"in b&&b.disabled===a}}function pa(a){return ia(function(b){return b=+b,ia(function(c,d){var e,f=a([],c.length,b),g=f.length;while(g--)c[e=f[g]]&&(c[e]=!(d[e]=c[e]))})})}function qa(a){return a&&"undefined"!=typeof a.getElementsByTagName&&a}c=ga.support={},f=ga.isXML=function(a){var b=a&&(a.ownerDocument||a).documentElement;return!!b&&"HTML"!==b.nodeName},m=ga.setDocument=function(a){var b,e,g=a?a.ownerDocument||a:v;return g!==n&&9===g.nodeType&&g.documentElement?(n=g,o=n.documentElement,p=!f(n),v!==n&&(e=n.defaultView)&&e.top!==e&&(e.addEventListener?e.addEventListener("unload",da,!1):e.attachEvent&&e.attachEvent("onunload",da)),c.attributes=ja(function(a){return a.className="i",!a.getAttribute("className")}),c.getElementsByTagName=ja(function(a){return a.appendChild(n.createComment("")),!a.getElementsByTagName("*").length}),c.getElementsByClassName=Y.test(n.getElementsByClassName),c.getById=ja(function(a){return o.appendChild(a).id=u,!n.getElementsByName||!n.getElementsByName(u).length}),c.getById?(d.filter.ID=function(a){var b=a.replace(_,aa);return function(a){return a.getAttribute("id")===b}},d.find.ID=function(a,b){if("undefined"!=typeof b.getElementById&&p){var c=b.getElementById(a);return c?[c]:[]}}):(d.filter.ID=function(a){var b=a.replace(_,aa);return function(a){var c="undefined"!=typeof a.getAttributeNode&&a.getAttributeNode("id");return c&&c.value===b}},d.find.ID=function(a,b){if("undefined"!=typeof b.getElementById&&p){var c,d,e,f=b.getElementById(a);if(f){if(c=f.getAttributeNode("id"),c&&c.value===a)return[f];e=b.getElementsByName(a),d=0;while(f=e[d++])if(c=f.getAttributeNode("id"),c&&c.value===a)return[f]}return[]}}),d.find.TAG=c.getElementsByTagName?function(a,b){return"undefined"!=typeof b.getElementsByTagName?b.getElementsByTagName(a):c.qsa?b.querySelectorAll(a):void 0}:function(a,b){var c,d=[],e=0,f=b.getElementsByTagName(a);if("*"===a){while(c=f[e++])1===c.nodeType&&d.push(c);return d}return f},d.find.CLASS=c.getElementsByClassName&&function(a,b){if("undefined"!=typeof b.getElementsByClassName&&p)return b.getElementsByClassName(a)},r=[],q=[],(c.qsa=Y.test(n.querySelectorAll))&&(ja(function(a){o.appendChild(a).innerHTML="",a.querySelectorAll("[msallowcapture^='']").length&&q.push("[*^$]="+K+"*(?:''|\"\")"),a.querySelectorAll("[selected]").length||q.push("\\["+K+"*(?:value|"+J+")"),a.querySelectorAll("[id~="+u+"-]").length||q.push("~="),a.querySelectorAll(":checked").length||q.push(":checked"),a.querySelectorAll("a#"+u+"+*").length||q.push(".#.+[+~]")}),ja(function(a){a.innerHTML="";var b=n.createElement("input");b.setAttribute("type","hidden"),a.appendChild(b).setAttribute("name","D"),a.querySelectorAll("[name=d]").length&&q.push("name"+K+"*[*^$|!~]?="),2!==a.querySelectorAll(":enabled").length&&q.push(":enabled",":disabled"),o.appendChild(a).disabled=!0,2!==a.querySelectorAll(":disabled").length&&q.push(":enabled",":disabled"),a.querySelectorAll("*,:x"),q.push(",.*:")})),(c.matchesSelector=Y.test(s=o.matches||o.webkitMatchesSelector||o.mozMatchesSelector||o.oMatchesSelector||o.msMatchesSelector))&&ja(function(a){c.disconnectedMatch=s.call(a,"*"),s.call(a,"[s!='']:x"),r.push("!=",N)}),q=q.length&&new RegExp(q.join("|")),r=r.length&&new RegExp(r.join("|")),b=Y.test(o.compareDocumentPosition),t=b||Y.test(o.contains)?function(a,b){var c=9===a.nodeType?a.documentElement:a,d=b&&b.parentNode;return a===d||!(!d||1!==d.nodeType||!(c.contains?c.contains(d):a.compareDocumentPosition&&16&a.compareDocumentPosition(d)))}:function(a,b){if(b)while(b=b.parentNode)if(b===a)return!0;return!1},B=b?function(a,b){if(a===b)return l=!0,0;var d=!a.compareDocumentPosition-!b.compareDocumentPosition;return d?d:(d=(a.ownerDocument||a)===(b.ownerDocument||b)?a.compareDocumentPosition(b):1,1&d||!c.sortDetached&&b.compareDocumentPosition(a)===d?a===n||a.ownerDocument===v&&t(v,a)?-1:b===n||b.ownerDocument===v&&t(v,b)?1:k?I(k,a)-I(k,b):0:4&d?-1:1)}:function(a,b){if(a===b)return l=!0,0;var c,d=0,e=a.parentNode,f=b.parentNode,g=[a],h=[b];if(!e||!f)return a===n?-1:b===n?1:e?-1:f?1:k?I(k,a)-I(k,b):0;if(e===f)return la(a,b);c=a;while(c=c.parentNode)g.unshift(c);c=b;while(c=c.parentNode)h.unshift(c);while(g[d]===h[d])d++;return d?la(g[d],h[d]):g[d]===v?-1:h[d]===v?1:0},n):n},ga.matches=function(a,b){return ga(a,null,null,b)},ga.matchesSelector=function(a,b){if((a.ownerDocument||a)!==n&&m(a),b=b.replace(S,"='$1']"),c.matchesSelector&&p&&!A[b+" "]&&(!r||!r.test(b))&&(!q||!q.test(b)))try{var d=s.call(a,b);if(d||c.disconnectedMatch||a.document&&11!==a.document.nodeType)return d}catch(e){}return ga(b,n,null,[a]).length>0},ga.contains=function(a,b){return(a.ownerDocument||a)!==n&&m(a),t(a,b)},ga.attr=function(a,b){(a.ownerDocument||a)!==n&&m(a);var e=d.attrHandle[b.toLowerCase()],f=e&&C.call(d.attrHandle,b.toLowerCase())?e(a,b,!p):void 0;return void 0!==f?f:c.attributes||!p?a.getAttribute(b):(f=a.getAttributeNode(b))&&f.specified?f.value:null},ga.escape=function(a){return(a+"").replace(ba,ca)},ga.error=function(a){throw new Error("Syntax error, unrecognized expression: "+a)},ga.uniqueSort=function(a){var b,d=[],e=0,f=0;if(l=!c.detectDuplicates,k=!c.sortStable&&a.slice(0),a.sort(B),l){while(b=a[f++])b===a[f]&&(e=d.push(f));while(e--)a.splice(d[e],1)}return k=null,a},e=ga.getText=function(a){var b,c="",d=0,f=a.nodeType;if(f){if(1===f||9===f||11===f){if("string"==typeof a.textContent)return a.textContent;for(a=a.firstChild;a;a=a.nextSibling)c+=e(a)}else if(3===f||4===f)return a.nodeValue}else while(b=a[d++])c+=e(b);return c},d=ga.selectors={cacheLength:50,createPseudo:ia,match:V,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(a){return a[1]=a[1].replace(_,aa),a[3]=(a[3]||a[4]||a[5]||"").replace(_,aa),"~="===a[2]&&(a[3]=" "+a[3]+" "),a.slice(0,4)},CHILD:function(a){return a[1]=a[1].toLowerCase(),"nth"===a[1].slice(0,3)?(a[3]||ga.error(a[0]),a[4]=+(a[4]?a[5]+(a[6]||1):2*("even"===a[3]||"odd"===a[3])),a[5]=+(a[7]+a[8]||"odd"===a[3])):a[3]&&ga.error(a[0]),a},PSEUDO:function(a){var b,c=!a[6]&&a[2];return V.CHILD.test(a[0])?null:(a[3]?a[2]=a[4]||a[5]||"":c&&T.test(c)&&(b=g(c,!0))&&(b=c.indexOf(")",c.length-b)-c.length)&&(a[0]=a[0].slice(0,b),a[2]=c.slice(0,b)),a.slice(0,3))}},filter:{TAG:function(a){var b=a.replace(_,aa).toLowerCase();return"*"===a?function(){return!0}:function(a){return a.nodeName&&a.nodeName.toLowerCase()===b}},CLASS:function(a){var b=y[a+" "];return b||(b=new RegExp("(^|"+K+")"+a+"("+K+"|$)"))&&y(a,function(a){return b.test("string"==typeof a.className&&a.className||"undefined"!=typeof a.getAttribute&&a.getAttribute("class")||"")})},ATTR:function(a,b,c){return function(d){var e=ga.attr(d,a);return null==e?"!="===b:!b||(e+="","="===b?e===c:"!="===b?e!==c:"^="===b?c&&0===e.indexOf(c):"*="===b?c&&e.indexOf(c)>-1:"$="===b?c&&e.slice(-c.length)===c:"~="===b?(" "+e.replace(O," ")+" ").indexOf(c)>-1:"|="===b&&(e===c||e.slice(0,c.length+1)===c+"-"))}},CHILD:function(a,b,c,d,e){var f="nth"!==a.slice(0,3),g="last"!==a.slice(-4),h="of-type"===b;return 1===d&&0===e?function(a){return!!a.parentNode}:function(b,c,i){var j,k,l,m,n,o,p=f!==g?"nextSibling":"previousSibling",q=b.parentNode,r=h&&b.nodeName.toLowerCase(),s=!i&&!h,t=!1;if(q){if(f){while(p){m=b;while(m=m[p])if(h?m.nodeName.toLowerCase()===r:1===m.nodeType)return!1;o=p="only"===a&&!o&&"nextSibling"}return!0}if(o=[g?q.firstChild:q.lastChild],g&&s){m=q,l=m[u]||(m[u]={}),k=l[m.uniqueID]||(l[m.uniqueID]={}),j=k[a]||[],n=j[0]===w&&j[1],t=n&&j[2],m=n&&q.childNodes[n];while(m=++n&&m&&m[p]||(t=n=0)||o.pop())if(1===m.nodeType&&++t&&m===b){k[a]=[w,n,t];break}}else if(s&&(m=b,l=m[u]||(m[u]={}),k=l[m.uniqueID]||(l[m.uniqueID]={}),j=k[a]||[],n=j[0]===w&&j[1],t=n),t===!1)while(m=++n&&m&&m[p]||(t=n=0)||o.pop())if((h?m.nodeName.toLowerCase()===r:1===m.nodeType)&&++t&&(s&&(l=m[u]||(m[u]={}),k=l[m.uniqueID]||(l[m.uniqueID]={}),k[a]=[w,t]),m===b))break;return t-=e,t===d||t%d===0&&t/d>=0}}},PSEUDO:function(a,b){var c,e=d.pseudos[a]||d.setFilters[a.toLowerCase()]||ga.error("unsupported pseudo: "+a);return e[u]?e(b):e.length>1?(c=[a,a,"",b],d.setFilters.hasOwnProperty(a.toLowerCase())?ia(function(a,c){var d,f=e(a,b),g=f.length;while(g--)d=I(a,f[g]),a[d]=!(c[d]=f[g])}):function(a){return e(a,0,c)}):e}},pseudos:{not:ia(function(a){var b=[],c=[],d=h(a.replace(P,"$1"));return d[u]?ia(function(a,b,c,e){var f,g=d(a,null,e,[]),h=a.length;while(h--)(f=g[h])&&(a[h]=!(b[h]=f))}):function(a,e,f){return b[0]=a,d(b,null,f,c),b[0]=null,!c.pop()}}),has:ia(function(a){return function(b){return ga(a,b).length>0}}),contains:ia(function(a){return a=a.replace(_,aa),function(b){return(b.textContent||b.innerText||e(b)).indexOf(a)>-1}}),lang:ia(function(a){return U.test(a||"")||ga.error("unsupported lang: "+a),a=a.replace(_,aa).toLowerCase(),function(b){var c;do if(c=p?b.lang:b.getAttribute("xml:lang")||b.getAttribute("lang"))return c=c.toLowerCase(),c===a||0===c.indexOf(a+"-");while((b=b.parentNode)&&1===b.nodeType);return!1}}),target:function(b){var c=a.location&&a.location.hash;return c&&c.slice(1)===b.id},root:function(a){return a===o},focus:function(a){return a===n.activeElement&&(!n.hasFocus||n.hasFocus())&&!!(a.type||a.href||~a.tabIndex)},enabled:oa(!1),disabled:oa(!0),checked:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&!!a.checked||"option"===b&&!!a.selected},selected:function(a){return a.parentNode&&a.parentNode.selectedIndex,a.selected===!0},empty:function(a){for(a=a.firstChild;a;a=a.nextSibling)if(a.nodeType<6)return!1;return!0},parent:function(a){return!d.pseudos.empty(a)},header:function(a){return X.test(a.nodeName)},input:function(a){return W.test(a.nodeName)},button:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&"button"===a.type||"button"===b},text:function(a){var b;return"input"===a.nodeName.toLowerCase()&&"text"===a.type&&(null==(b=a.getAttribute("type"))||"text"===b.toLowerCase())},first:pa(function(){return[0]}),last:pa(function(a,b){return[b-1]}),eq:pa(function(a,b,c){return[c<0?c+b:c]}),even:pa(function(a,b){for(var c=0;c=0;)a.push(d);return a}),gt:pa(function(a,b,c){for(var d=c<0?c+b:c;++d1?function(b,c,d){var e=a.length;while(e--)if(!a[e](b,c,d))return!1;return!0}:a[0]}function va(a,b,c){for(var d=0,e=b.length;d-1&&(f[j]=!(g[j]=l))}}else r=wa(r===g?r.splice(o,r.length):r),e?e(null,g,r,i):G.apply(g,r)})}function ya(a){for(var b,c,e,f=a.length,g=d.relative[a[0].type],h=g||d.relative[" "],i=g?1:0,k=ta(function(a){return a===b},h,!0),l=ta(function(a){return I(b,a)>-1},h,!0),m=[function(a,c,d){var e=!g&&(d||c!==j)||((b=c).nodeType?k(a,c,d):l(a,c,d));return b=null,e}];i1&&ua(m),i>1&&sa(a.slice(0,i-1).concat({value:" "===a[i-2].type?"*":""})).replace(P,"$1"),c,i0,e=a.length>0,f=function(f,g,h,i,k){var l,o,q,r=0,s="0",t=f&&[],u=[],v=j,x=f||e&&d.find.TAG("*",k),y=w+=null==v?1:Math.random()||.1,z=x.length;for(k&&(j=g===n||g||k);s!==z&&null!=(l=x[s]);s++){if(e&&l){o=0,g||l.ownerDocument===n||(m(l),h=!p);while(q=a[o++])if(q(l,g||n,h)){i.push(l);break}k&&(w=y)}c&&((l=!q&&l)&&r--,f&&t.push(l))}if(r+=s,c&&s!==r){o=0;while(q=b[o++])q(t,u,g,h);if(f){if(r>0)while(s--)t[s]||u[s]||(u[s]=E.call(i));u=wa(u)}G.apply(i,u),k&&!f&&u.length>0&&r+b.length>1&&ga.uniqueSort(i)}return k&&(w=y,j=v),t};return c?ia(f):f}return h=ga.compile=function(a,b){var c,d=[],e=[],f=A[a+" "];if(!f){b||(b=g(a)),c=b.length;while(c--)f=ya(b[c]),f[u]?d.push(f):e.push(f);f=A(a,za(e,d)),f.selector=a}return f},i=ga.select=function(a,b,c,e){var f,i,j,k,l,m="function"==typeof a&&a,n=!e&&g(a=m.selector||a);if(c=c||[],1===n.length){if(i=n[0]=n[0].slice(0),i.length>2&&"ID"===(j=i[0]).type&&9===b.nodeType&&p&&d.relative[i[1].type]){if(b=(d.find.ID(j.matches[0].replace(_,aa),b)||[])[0],!b)return c;m&&(b=b.parentNode),a=a.slice(i.shift().value.length)}f=V.needsContext.test(a)?0:i.length;while(f--){if(j=i[f],d.relative[k=j.type])break;if((l=d.find[k])&&(e=l(j.matches[0].replace(_,aa),$.test(i[0].type)&&qa(b.parentNode)||b))){if(i.splice(f,1),a=e.length&&sa(i),!a)return G.apply(c,e),c;break}}}return(m||h(a,n))(e,b,!p,c,!b||$.test(a)&&qa(b.parentNode)||b),c},c.sortStable=u.split("").sort(B).join("")===u,c.detectDuplicates=!!l,m(),c.sortDetached=ja(function(a){return 1&a.compareDocumentPosition(n.createElement("fieldset"))}),ja(function(a){return a.innerHTML="","#"===a.firstChild.getAttribute("href")})||ka("type|href|height|width",function(a,b,c){if(!c)return a.getAttribute(b,"type"===b.toLowerCase()?1:2)}),c.attributes&&ja(function(a){return a.innerHTML="",a.firstChild.setAttribute("value",""),""===a.firstChild.getAttribute("value")})||ka("value",function(a,b,c){if(!c&&"input"===a.nodeName.toLowerCase())return a.defaultValue}),ja(function(a){return null==a.getAttribute("disabled")})||ka(J,function(a,b,c){var d;if(!c)return a[b]===!0?b.toLowerCase():(d=a.getAttributeNode(b))&&d.specified?d.value:null}),ga}(a);r.find=x,r.expr=x.selectors,r.expr[":"]=r.expr.pseudos,r.uniqueSort=r.unique=x.uniqueSort,r.text=x.getText,r.isXMLDoc=x.isXML,r.contains=x.contains,r.escapeSelector=x.escape;var y=function(a,b,c){var d=[],e=void 0!==c;while((a=a[b])&&9!==a.nodeType)if(1===a.nodeType){if(e&&r(a).is(c))break;d.push(a)}return d},z=function(a,b){for(var c=[];a;a=a.nextSibling)1===a.nodeType&&a!==b&&c.push(a);return c},A=r.expr.match.needsContext;function B(a,b){return a.nodeName&&a.nodeName.toLowerCase()===b.toLowerCase()}var C=/^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i,D=/^.[^:#\[\.,]*$/;function E(a,b,c){return r.isFunction(b)?r.grep(a,function(a,d){return!!b.call(a,d,a)!==c}):b.nodeType?r.grep(a,function(a){return a===b!==c}):"string"!=typeof b?r.grep(a,function(a){return i.call(b,a)>-1!==c}):D.test(b)?r.filter(b,a,c):(b=r.filter(b,a),r.grep(a,function(a){return i.call(b,a)>-1!==c&&1===a.nodeType}))}r.filter=function(a,b,c){var d=b[0];return c&&(a=":not("+a+")"),1===b.length&&1===d.nodeType?r.find.matchesSelector(d,a)?[d]:[]:r.find.matches(a,r.grep(b,function(a){return 1===a.nodeType}))},r.fn.extend({find:function(a){var b,c,d=this.length,e=this;if("string"!=typeof a)return this.pushStack(r(a).filter(function(){for(b=0;b1?r.uniqueSort(c):c},filter:function(a){return this.pushStack(E(this,a||[],!1))},not:function(a){return this.pushStack(E(this,a||[],!0))},is:function(a){return!!E(this,"string"==typeof a&&A.test(a)?r(a):a||[],!1).length}});var F,G=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/,H=r.fn.init=function(a,b,c){var e,f;if(!a)return this;if(c=c||F,"string"==typeof a){if(e="<"===a[0]&&">"===a[a.length-1]&&a.length>=3?[null,a,null]:G.exec(a),!e||!e[1]&&b)return!b||b.jquery?(b||c).find(a):this.constructor(b).find(a);if(e[1]){if(b=b instanceof r?b[0]:b,r.merge(this,r.parseHTML(e[1],b&&b.nodeType?b.ownerDocument||b:d,!0)),C.test(e[1])&&r.isPlainObject(b))for(e in b)r.isFunction(this[e])?this[e](b[e]):this.attr(e,b[e]);return this}return f=d.getElementById(e[2]),f&&(this[0]=f,this.length=1),this}return a.nodeType?(this[0]=a,this.length=1,this):r.isFunction(a)?void 0!==c.ready?c.ready(a):a(r):r.makeArray(a,this)};H.prototype=r.fn,F=r(d);var I=/^(?:parents|prev(?:Until|All))/,J={children:!0,contents:!0,next:!0,prev:!0};r.fn.extend({has:function(a){var b=r(a,this),c=b.length;return this.filter(function(){for(var a=0;a-1:1===c.nodeType&&r.find.matchesSelector(c,a))){f.push(c);break}return this.pushStack(f.length>1?r.uniqueSort(f):f)},index:function(a){return a?"string"==typeof a?i.call(r(a),this[0]):i.call(this,a.jquery?a[0]:a):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(a,b){return this.pushStack(r.uniqueSort(r.merge(this.get(),r(a,b))))},addBack:function(a){return this.add(null==a?this.prevObject:this.prevObject.filter(a))}});function K(a,b){while((a=a[b])&&1!==a.nodeType);return a}r.each({parent:function(a){var b=a.parentNode;return b&&11!==b.nodeType?b:null},parents:function(a){return y(a,"parentNode")},parentsUntil:function(a,b,c){return y(a,"parentNode",c)},next:function(a){return K(a,"nextSibling")},prev:function(a){return K(a,"previousSibling")},nextAll:function(a){return y(a,"nextSibling")},prevAll:function(a){return y(a,"previousSibling")},nextUntil:function(a,b,c){return y(a,"nextSibling",c)},prevUntil:function(a,b,c){return y(a,"previousSibling",c)},siblings:function(a){return z((a.parentNode||{}).firstChild,a)},children:function(a){return z(a.firstChild)},contents:function(a){return B(a,"iframe")?a.contentDocument:(B(a,"template")&&(a=a.content||a),r.merge([],a.childNodes))}},function(a,b){r.fn[a]=function(c,d){var e=r.map(this,b,c);return"Until"!==a.slice(-5)&&(d=c),d&&"string"==typeof d&&(e=r.filter(d,e)),this.length>1&&(J[a]||r.uniqueSort(e),I.test(a)&&e.reverse()),this.pushStack(e)}});var L=/[^\x20\t\r\n\f]+/g;function M(a){var b={};return r.each(a.match(L)||[],function(a,c){b[c]=!0}),b}r.Callbacks=function(a){a="string"==typeof a?M(a):r.extend({},a);var b,c,d,e,f=[],g=[],h=-1,i=function(){for(e=e||a.once,d=b=!0;g.length;h=-1){c=g.shift();while(++h-1)f.splice(c,1),c<=h&&h--}),this},has:function(a){return a?r.inArray(a,f)>-1:f.length>0},empty:function(){return f&&(f=[]),this},disable:function(){return e=g=[],f=c="",this},disabled:function(){return!f},lock:function(){return e=g=[],c||b||(f=c=""),this},locked:function(){return!!e},fireWith:function(a,c){return e||(c=c||[],c=[a,c.slice?c.slice():c],g.push(c),b||i()),this},fire:function(){return j.fireWith(this,arguments),this},fired:function(){return!!d}};return j};function N(a){return a}function O(a){throw a}function P(a,b,c,d){var e;try{a&&r.isFunction(e=a.promise)?e.call(a).done(b).fail(c):a&&r.isFunction(e=a.then)?e.call(a,b,c):b.apply(void 0,[a].slice(d))}catch(a){c.apply(void 0,[a])}}r.extend({Deferred:function(b){var c=[["notify","progress",r.Callbacks("memory"),r.Callbacks("memory"),2],["resolve","done",r.Callbacks("once memory"),r.Callbacks("once memory"),0,"resolved"],["reject","fail",r.Callbacks("once memory"),r.Callbacks("once memory"),1,"rejected"]],d="pending",e={state:function(){return d},always:function(){return f.done(arguments).fail(arguments),this},"catch":function(a){return e.then(null,a)},pipe:function(){var a=arguments;return r.Deferred(function(b){r.each(c,function(c,d){var e=r.isFunction(a[d[4]])&&a[d[4]];f[d[1]](function(){var a=e&&e.apply(this,arguments);a&&r.isFunction(a.promise)?a.promise().progress(b.notify).done(b.resolve).fail(b.reject):b[d[0]+"With"](this,e?[a]:arguments)})}),a=null}).promise()},then:function(b,d,e){var f=0;function g(b,c,d,e){return function(){var h=this,i=arguments,j=function(){var a,j;if(!(b=f&&(d!==O&&(h=void 0,i=[a]),c.rejectWith(h,i))}};b?k():(r.Deferred.getStackHook&&(k.stackTrace=r.Deferred.getStackHook()),a.setTimeout(k))}}return r.Deferred(function(a){c[0][3].add(g(0,a,r.isFunction(e)?e:N,a.notifyWith)),c[1][3].add(g(0,a,r.isFunction(b)?b:N)),c[2][3].add(g(0,a,r.isFunction(d)?d:O))}).promise()},promise:function(a){return null!=a?r.extend(a,e):e}},f={};return r.each(c,function(a,b){var g=b[2],h=b[5];e[b[1]]=g.add,h&&g.add(function(){d=h},c[3-a][2].disable,c[0][2].lock),g.add(b[3].fire),f[b[0]]=function(){return f[b[0]+"With"](this===f?void 0:this,arguments),this},f[b[0]+"With"]=g.fireWith}),e.promise(f),b&&b.call(f,f),f},when:function(a){var b=arguments.length,c=b,d=Array(c),e=f.call(arguments),g=r.Deferred(),h=function(a){return function(c){d[a]=this,e[a]=arguments.length>1?f.call(arguments):c,--b||g.resolveWith(d,e)}};if(b<=1&&(P(a,g.done(h(c)).resolve,g.reject,!b),"pending"===g.state()||r.isFunction(e[c]&&e[c].then)))return g.then();while(c--)P(e[c],h(c),g.reject);return g.promise()}});var Q=/^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/;r.Deferred.exceptionHook=function(b,c){a.console&&a.console.warn&&b&&Q.test(b.name)&&a.console.warn("jQuery.Deferred exception: "+b.message,b.stack,c)},r.readyException=function(b){a.setTimeout(function(){throw b})};var R=r.Deferred();r.fn.ready=function(a){return R.then(a)["catch"](function(a){r.readyException(a)}),this},r.extend({isReady:!1,readyWait:1,ready:function(a){(a===!0?--r.readyWait:r.isReady)||(r.isReady=!0,a!==!0&&--r.readyWait>0||R.resolveWith(d,[r]))}}),r.ready.then=R.then;function S(){d.removeEventListener("DOMContentLoaded",S), +a.removeEventListener("load",S),r.ready()}"complete"===d.readyState||"loading"!==d.readyState&&!d.documentElement.doScroll?a.setTimeout(r.ready):(d.addEventListener("DOMContentLoaded",S),a.addEventListener("load",S));var T=function(a,b,c,d,e,f,g){var h=0,i=a.length,j=null==c;if("object"===r.type(c)){e=!0;for(h in c)T(a,b,h,c[h],!0,f,g)}else if(void 0!==d&&(e=!0,r.isFunction(d)||(g=!0),j&&(g?(b.call(a,d),b=null):(j=b,b=function(a,b,c){return j.call(r(a),c)})),b))for(;h1,null,!0)},removeData:function(a){return this.each(function(){X.remove(this,a)})}}),r.extend({queue:function(a,b,c){var d;if(a)return b=(b||"fx")+"queue",d=W.get(a,b),c&&(!d||Array.isArray(c)?d=W.access(a,b,r.makeArray(c)):d.push(c)),d||[]},dequeue:function(a,b){b=b||"fx";var c=r.queue(a,b),d=c.length,e=c.shift(),f=r._queueHooks(a,b),g=function(){r.dequeue(a,b)};"inprogress"===e&&(e=c.shift(),d--),e&&("fx"===b&&c.unshift("inprogress"),delete f.stop,e.call(a,g,f)),!d&&f&&f.empty.fire()},_queueHooks:function(a,b){var c=b+"queueHooks";return W.get(a,c)||W.access(a,c,{empty:r.Callbacks("once memory").add(function(){W.remove(a,[b+"queue",c])})})}}),r.fn.extend({queue:function(a,b){var c=2;return"string"!=typeof a&&(b=a,a="fx",c--),arguments.length\x20\t\r\n\f]+)/i,la=/^$|\/(?:java|ecma)script/i,ma={option:[1,""],thead:[1,"","
"],col:[2,"","
"],tr:[2,"","
"],td:[3,"","
"],_default:[0,"",""]};ma.optgroup=ma.option,ma.tbody=ma.tfoot=ma.colgroup=ma.caption=ma.thead,ma.th=ma.td;function na(a,b){var c;return c="undefined"!=typeof a.getElementsByTagName?a.getElementsByTagName(b||"*"):"undefined"!=typeof a.querySelectorAll?a.querySelectorAll(b||"*"):[],void 0===b||b&&B(a,b)?r.merge([a],c):c}function oa(a,b){for(var c=0,d=a.length;c-1)e&&e.push(f);else if(j=r.contains(f.ownerDocument,f),g=na(l.appendChild(f),"script"),j&&oa(g),c){k=0;while(f=g[k++])la.test(f.type||"")&&c.push(f)}return l}!function(){var a=d.createDocumentFragment(),b=a.appendChild(d.createElement("div")),c=d.createElement("input");c.setAttribute("type","radio"),c.setAttribute("checked","checked"),c.setAttribute("name","t"),b.appendChild(c),o.checkClone=b.cloneNode(!0).cloneNode(!0).lastChild.checked,b.innerHTML="",o.noCloneChecked=!!b.cloneNode(!0).lastChild.defaultValue}();var ra=d.documentElement,sa=/^key/,ta=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,ua=/^([^.]*)(?:\.(.+)|)/;function va(){return!0}function wa(){return!1}function xa(){try{return d.activeElement}catch(a){}}function ya(a,b,c,d,e,f){var g,h;if("object"==typeof b){"string"!=typeof c&&(d=d||c,c=void 0);for(h in b)ya(a,h,c,d,b[h],f);return a}if(null==d&&null==e?(e=c,d=c=void 0):null==e&&("string"==typeof c?(e=d,d=void 0):(e=d,d=c,c=void 0)),e===!1)e=wa;else if(!e)return a;return 1===f&&(g=e,e=function(a){return r().off(a),g.apply(this,arguments)},e.guid=g.guid||(g.guid=r.guid++)),a.each(function(){r.event.add(this,b,e,d,c)})}r.event={global:{},add:function(a,b,c,d,e){var f,g,h,i,j,k,l,m,n,o,p,q=W.get(a);if(q){c.handler&&(f=c,c=f.handler,e=f.selector),e&&r.find.matchesSelector(ra,e),c.guid||(c.guid=r.guid++),(i=q.events)||(i=q.events={}),(g=q.handle)||(g=q.handle=function(b){return"undefined"!=typeof r&&r.event.triggered!==b.type?r.event.dispatch.apply(a,arguments):void 0}),b=(b||"").match(L)||[""],j=b.length;while(j--)h=ua.exec(b[j])||[],n=p=h[1],o=(h[2]||"").split(".").sort(),n&&(l=r.event.special[n]||{},n=(e?l.delegateType:l.bindType)||n,l=r.event.special[n]||{},k=r.extend({type:n,origType:p,data:d,handler:c,guid:c.guid,selector:e,needsContext:e&&r.expr.match.needsContext.test(e),namespace:o.join(".")},f),(m=i[n])||(m=i[n]=[],m.delegateCount=0,l.setup&&l.setup.call(a,d,o,g)!==!1||a.addEventListener&&a.addEventListener(n,g)),l.add&&(l.add.call(a,k),k.handler.guid||(k.handler.guid=c.guid)),e?m.splice(m.delegateCount++,0,k):m.push(k),r.event.global[n]=!0)}},remove:function(a,b,c,d,e){var f,g,h,i,j,k,l,m,n,o,p,q=W.hasData(a)&&W.get(a);if(q&&(i=q.events)){b=(b||"").match(L)||[""],j=b.length;while(j--)if(h=ua.exec(b[j])||[],n=p=h[1],o=(h[2]||"").split(".").sort(),n){l=r.event.special[n]||{},n=(d?l.delegateType:l.bindType)||n,m=i[n]||[],h=h[2]&&new RegExp("(^|\\.)"+o.join("\\.(?:.*\\.|)")+"(\\.|$)"),g=f=m.length;while(f--)k=m[f],!e&&p!==k.origType||c&&c.guid!==k.guid||h&&!h.test(k.namespace)||d&&d!==k.selector&&("**"!==d||!k.selector)||(m.splice(f,1),k.selector&&m.delegateCount--,l.remove&&l.remove.call(a,k));g&&!m.length&&(l.teardown&&l.teardown.call(a,o,q.handle)!==!1||r.removeEvent(a,n,q.handle),delete i[n])}else for(n in i)r.event.remove(a,n+b[j],c,d,!0);r.isEmptyObject(i)&&W.remove(a,"handle events")}},dispatch:function(a){var b=r.event.fix(a),c,d,e,f,g,h,i=new Array(arguments.length),j=(W.get(this,"events")||{})[b.type]||[],k=r.event.special[b.type]||{};for(i[0]=b,c=1;c=1))for(;j!==this;j=j.parentNode||this)if(1===j.nodeType&&("click"!==a.type||j.disabled!==!0)){for(f=[],g={},c=0;c-1:r.find(e,this,null,[j]).length),g[e]&&f.push(d);f.length&&h.push({elem:j,handlers:f})}return j=this,i\x20\t\r\n\f]*)[^>]*)\/>/gi,Aa=/\s*$/g;function Ea(a,b){return B(a,"table")&&B(11!==b.nodeType?b:b.firstChild,"tr")?r(">tbody",a)[0]||a:a}function Fa(a){return a.type=(null!==a.getAttribute("type"))+"/"+a.type,a}function Ga(a){var b=Ca.exec(a.type);return b?a.type=b[1]:a.removeAttribute("type"),a}function Ha(a,b){var c,d,e,f,g,h,i,j;if(1===b.nodeType){if(W.hasData(a)&&(f=W.access(a),g=W.set(b,f),j=f.events)){delete g.handle,g.events={};for(e in j)for(c=0,d=j[e].length;c1&&"string"==typeof q&&!o.checkClone&&Ba.test(q))return a.each(function(e){var f=a.eq(e);s&&(b[0]=q.call(this,e,f.html())),Ja(f,b,c,d)});if(m&&(e=qa(b,a[0].ownerDocument,!1,a,d),f=e.firstChild,1===e.childNodes.length&&(e=f),f||d)){for(h=r.map(na(e,"script"),Fa),i=h.length;l")},clone:function(a,b,c){var d,e,f,g,h=a.cloneNode(!0),i=r.contains(a.ownerDocument,a);if(!(o.noCloneChecked||1!==a.nodeType&&11!==a.nodeType||r.isXMLDoc(a)))for(g=na(h),f=na(a),d=0,e=f.length;d0&&oa(g,!i&&na(a,"script")),h},cleanData:function(a){for(var b,c,d,e=r.event.special,f=0;void 0!==(c=a[f]);f++)if(U(c)){if(b=c[W.expando]){if(b.events)for(d in b.events)e[d]?r.event.remove(c,d):r.removeEvent(c,d,b.handle);c[W.expando]=void 0}c[X.expando]&&(c[X.expando]=void 0)}}}),r.fn.extend({detach:function(a){return Ka(this,a,!0)},remove:function(a){return Ka(this,a)},text:function(a){return T(this,function(a){return void 0===a?r.text(this):this.empty().each(function(){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||(this.textContent=a)})},null,a,arguments.length)},append:function(){return Ja(this,arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=Ea(this,a);b.appendChild(a)}})},prepend:function(){return Ja(this,arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=Ea(this,a);b.insertBefore(a,b.firstChild)}})},before:function(){return Ja(this,arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this)})},after:function(){return Ja(this,arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this.nextSibling)})},empty:function(){for(var a,b=0;null!=(a=this[b]);b++)1===a.nodeType&&(r.cleanData(na(a,!1)),a.textContent="");return this},clone:function(a,b){return a=null!=a&&a,b=null==b?a:b,this.map(function(){return r.clone(this,a,b)})},html:function(a){return T(this,function(a){var b=this[0]||{},c=0,d=this.length;if(void 0===a&&1===b.nodeType)return b.innerHTML;if("string"==typeof a&&!Aa.test(a)&&!ma[(ka.exec(a)||["",""])[1].toLowerCase()]){a=r.htmlPrefilter(a);try{for(;c1)}});function _a(a,b,c,d,e){return new _a.prototype.init(a,b,c,d,e)}r.Tween=_a,_a.prototype={constructor:_a,init:function(a,b,c,d,e,f){this.elem=a,this.prop=c,this.easing=e||r.easing._default,this.options=b,this.start=this.now=this.cur(),this.end=d,this.unit=f||(r.cssNumber[c]?"":"px")},cur:function(){var a=_a.propHooks[this.prop];return a&&a.get?a.get(this):_a.propHooks._default.get(this)},run:function(a){var b,c=_a.propHooks[this.prop];return this.options.duration?this.pos=b=r.easing[this.easing](a,this.options.duration*a,0,1,this.options.duration):this.pos=b=a,this.now=(this.end-this.start)*b+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),c&&c.set?c.set(this):_a.propHooks._default.set(this),this}},_a.prototype.init.prototype=_a.prototype,_a.propHooks={_default:{get:function(a){var b;return 1!==a.elem.nodeType||null!=a.elem[a.prop]&&null==a.elem.style[a.prop]?a.elem[a.prop]:(b=r.css(a.elem,a.prop,""),b&&"auto"!==b?b:0)},set:function(a){r.fx.step[a.prop]?r.fx.step[a.prop](a):1!==a.elem.nodeType||null==a.elem.style[r.cssProps[a.prop]]&&!r.cssHooks[a.prop]?a.elem[a.prop]=a.now:r.style(a.elem,a.prop,a.now+a.unit)}}},_a.propHooks.scrollTop=_a.propHooks.scrollLeft={set:function(a){a.elem.nodeType&&a.elem.parentNode&&(a.elem[a.prop]=a.now)}},r.easing={linear:function(a){return a},swing:function(a){return.5-Math.cos(a*Math.PI)/2},_default:"swing"},r.fx=_a.prototype.init,r.fx.step={};var ab,bb,cb=/^(?:toggle|show|hide)$/,db=/queueHooks$/;function eb(){bb&&(d.hidden===!1&&a.requestAnimationFrame?a.requestAnimationFrame(eb):a.setTimeout(eb,r.fx.interval),r.fx.tick())}function fb(){return a.setTimeout(function(){ab=void 0}),ab=r.now()}function gb(a,b){var c,d=0,e={height:a};for(b=b?1:0;d<4;d+=2-b)c=ca[d],e["margin"+c]=e["padding"+c]=a;return b&&(e.opacity=e.width=a),e}function hb(a,b,c){for(var d,e=(kb.tweeners[b]||[]).concat(kb.tweeners["*"]),f=0,g=e.length;f1)},removeAttr:function(a){return this.each(function(){r.removeAttr(this,a)})}}),r.extend({attr:function(a,b,c){var d,e,f=a.nodeType;if(3!==f&&8!==f&&2!==f)return"undefined"==typeof a.getAttribute?r.prop(a,b,c):(1===f&&r.isXMLDoc(a)||(e=r.attrHooks[b.toLowerCase()]||(r.expr.match.bool.test(b)?lb:void 0)),void 0!==c?null===c?void r.removeAttr(a,b):e&&"set"in e&&void 0!==(d=e.set(a,c,b))?d:(a.setAttribute(b,c+""),c):e&&"get"in e&&null!==(d=e.get(a,b))?d:(d=r.find.attr(a,b), +null==d?void 0:d))},attrHooks:{type:{set:function(a,b){if(!o.radioValue&&"radio"===b&&B(a,"input")){var c=a.value;return a.setAttribute("type",b),c&&(a.value=c),b}}}},removeAttr:function(a,b){var c,d=0,e=b&&b.match(L);if(e&&1===a.nodeType)while(c=e[d++])a.removeAttribute(c)}}),lb={set:function(a,b,c){return b===!1?r.removeAttr(a,c):a.setAttribute(c,c),c}},r.each(r.expr.match.bool.source.match(/\w+/g),function(a,b){var c=mb[b]||r.find.attr;mb[b]=function(a,b,d){var e,f,g=b.toLowerCase();return d||(f=mb[g],mb[g]=e,e=null!=c(a,b,d)?g:null,mb[g]=f),e}});var nb=/^(?:input|select|textarea|button)$/i,ob=/^(?:a|area)$/i;r.fn.extend({prop:function(a,b){return T(this,r.prop,a,b,arguments.length>1)},removeProp:function(a){return this.each(function(){delete this[r.propFix[a]||a]})}}),r.extend({prop:function(a,b,c){var d,e,f=a.nodeType;if(3!==f&&8!==f&&2!==f)return 1===f&&r.isXMLDoc(a)||(b=r.propFix[b]||b,e=r.propHooks[b]),void 0!==c?e&&"set"in e&&void 0!==(d=e.set(a,c,b))?d:a[b]=c:e&&"get"in e&&null!==(d=e.get(a,b))?d:a[b]},propHooks:{tabIndex:{get:function(a){var b=r.find.attr(a,"tabindex");return b?parseInt(b,10):nb.test(a.nodeName)||ob.test(a.nodeName)&&a.href?0:-1}}},propFix:{"for":"htmlFor","class":"className"}}),o.optSelected||(r.propHooks.selected={get:function(a){var b=a.parentNode;return b&&b.parentNode&&b.parentNode.selectedIndex,null},set:function(a){var b=a.parentNode;b&&(b.selectedIndex,b.parentNode&&b.parentNode.selectedIndex)}}),r.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){r.propFix[this.toLowerCase()]=this});function pb(a){var b=a.match(L)||[];return b.join(" ")}function qb(a){return a.getAttribute&&a.getAttribute("class")||""}r.fn.extend({addClass:function(a){var b,c,d,e,f,g,h,i=0;if(r.isFunction(a))return this.each(function(b){r(this).addClass(a.call(this,b,qb(this)))});if("string"==typeof a&&a){b=a.match(L)||[];while(c=this[i++])if(e=qb(c),d=1===c.nodeType&&" "+pb(e)+" "){g=0;while(f=b[g++])d.indexOf(" "+f+" ")<0&&(d+=f+" ");h=pb(d),e!==h&&c.setAttribute("class",h)}}return this},removeClass:function(a){var b,c,d,e,f,g,h,i=0;if(r.isFunction(a))return this.each(function(b){r(this).removeClass(a.call(this,b,qb(this)))});if(!arguments.length)return this.attr("class","");if("string"==typeof a&&a){b=a.match(L)||[];while(c=this[i++])if(e=qb(c),d=1===c.nodeType&&" "+pb(e)+" "){g=0;while(f=b[g++])while(d.indexOf(" "+f+" ")>-1)d=d.replace(" "+f+" "," ");h=pb(d),e!==h&&c.setAttribute("class",h)}}return this},toggleClass:function(a,b){var c=typeof a;return"boolean"==typeof b&&"string"===c?b?this.addClass(a):this.removeClass(a):r.isFunction(a)?this.each(function(c){r(this).toggleClass(a.call(this,c,qb(this),b),b)}):this.each(function(){var b,d,e,f;if("string"===c){d=0,e=r(this),f=a.match(L)||[];while(b=f[d++])e.hasClass(b)?e.removeClass(b):e.addClass(b)}else void 0!==a&&"boolean"!==c||(b=qb(this),b&&W.set(this,"__className__",b),this.setAttribute&&this.setAttribute("class",b||a===!1?"":W.get(this,"__className__")||""))})},hasClass:function(a){var b,c,d=0;b=" "+a+" ";while(c=this[d++])if(1===c.nodeType&&(" "+pb(qb(c))+" ").indexOf(b)>-1)return!0;return!1}});var rb=/\r/g;r.fn.extend({val:function(a){var b,c,d,e=this[0];{if(arguments.length)return d=r.isFunction(a),this.each(function(c){var e;1===this.nodeType&&(e=d?a.call(this,c,r(this).val()):a,null==e?e="":"number"==typeof e?e+="":Array.isArray(e)&&(e=r.map(e,function(a){return null==a?"":a+""})),b=r.valHooks[this.type]||r.valHooks[this.nodeName.toLowerCase()],b&&"set"in b&&void 0!==b.set(this,e,"value")||(this.value=e))});if(e)return b=r.valHooks[e.type]||r.valHooks[e.nodeName.toLowerCase()],b&&"get"in b&&void 0!==(c=b.get(e,"value"))?c:(c=e.value,"string"==typeof c?c.replace(rb,""):null==c?"":c)}}}),r.extend({valHooks:{option:{get:function(a){var b=r.find.attr(a,"value");return null!=b?b:pb(r.text(a))}},select:{get:function(a){var b,c,d,e=a.options,f=a.selectedIndex,g="select-one"===a.type,h=g?null:[],i=g?f+1:e.length;for(d=f<0?i:g?f:0;d-1)&&(c=!0);return c||(a.selectedIndex=-1),f}}}}),r.each(["radio","checkbox"],function(){r.valHooks[this]={set:function(a,b){if(Array.isArray(b))return a.checked=r.inArray(r(a).val(),b)>-1}},o.checkOn||(r.valHooks[this].get=function(a){return null===a.getAttribute("value")?"on":a.value})});var sb=/^(?:focusinfocus|focusoutblur)$/;r.extend(r.event,{trigger:function(b,c,e,f){var g,h,i,j,k,m,n,o=[e||d],p=l.call(b,"type")?b.type:b,q=l.call(b,"namespace")?b.namespace.split("."):[];if(h=i=e=e||d,3!==e.nodeType&&8!==e.nodeType&&!sb.test(p+r.event.triggered)&&(p.indexOf(".")>-1&&(q=p.split("."),p=q.shift(),q.sort()),k=p.indexOf(":")<0&&"on"+p,b=b[r.expando]?b:new r.Event(p,"object"==typeof b&&b),b.isTrigger=f?2:3,b.namespace=q.join("."),b.rnamespace=b.namespace?new RegExp("(^|\\.)"+q.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,b.result=void 0,b.target||(b.target=e),c=null==c?[b]:r.makeArray(c,[b]),n=r.event.special[p]||{},f||!n.trigger||n.trigger.apply(e,c)!==!1)){if(!f&&!n.noBubble&&!r.isWindow(e)){for(j=n.delegateType||p,sb.test(j+p)||(h=h.parentNode);h;h=h.parentNode)o.push(h),i=h;i===(e.ownerDocument||d)&&o.push(i.defaultView||i.parentWindow||a)}g=0;while((h=o[g++])&&!b.isPropagationStopped())b.type=g>1?j:n.bindType||p,m=(W.get(h,"events")||{})[b.type]&&W.get(h,"handle"),m&&m.apply(h,c),m=k&&h[k],m&&m.apply&&U(h)&&(b.result=m.apply(h,c),b.result===!1&&b.preventDefault());return b.type=p,f||b.isDefaultPrevented()||n._default&&n._default.apply(o.pop(),c)!==!1||!U(e)||k&&r.isFunction(e[p])&&!r.isWindow(e)&&(i=e[k],i&&(e[k]=null),r.event.triggered=p,e[p](),r.event.triggered=void 0,i&&(e[k]=i)),b.result}},simulate:function(a,b,c){var d=r.extend(new r.Event,c,{type:a,isSimulated:!0});r.event.trigger(d,null,b)}}),r.fn.extend({trigger:function(a,b){return this.each(function(){r.event.trigger(a,b,this)})},triggerHandler:function(a,b){var c=this[0];if(c)return r.event.trigger(a,b,c,!0)}}),r.each("blur focus focusin focusout resize scroll click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup contextmenu".split(" "),function(a,b){r.fn[b]=function(a,c){return arguments.length>0?this.on(b,null,a,c):this.trigger(b)}}),r.fn.extend({hover:function(a,b){return this.mouseenter(a).mouseleave(b||a)}}),o.focusin="onfocusin"in a,o.focusin||r.each({focus:"focusin",blur:"focusout"},function(a,b){var c=function(a){r.event.simulate(b,a.target,r.event.fix(a))};r.event.special[b]={setup:function(){var d=this.ownerDocument||this,e=W.access(d,b);e||d.addEventListener(a,c,!0),W.access(d,b,(e||0)+1)},teardown:function(){var d=this.ownerDocument||this,e=W.access(d,b)-1;e?W.access(d,b,e):(d.removeEventListener(a,c,!0),W.remove(d,b))}}});var tb=a.location,ub=r.now(),vb=/\?/;r.parseXML=function(b){var c;if(!b||"string"!=typeof b)return null;try{c=(new a.DOMParser).parseFromString(b,"text/xml")}catch(d){c=void 0}return c&&!c.getElementsByTagName("parsererror").length||r.error("Invalid XML: "+b),c};var wb=/\[\]$/,xb=/\r?\n/g,yb=/^(?:submit|button|image|reset|file)$/i,zb=/^(?:input|select|textarea|keygen)/i;function Ab(a,b,c,d){var e;if(Array.isArray(b))r.each(b,function(b,e){c||wb.test(a)?d(a,e):Ab(a+"["+("object"==typeof e&&null!=e?b:"")+"]",e,c,d)});else if(c||"object"!==r.type(b))d(a,b);else for(e in b)Ab(a+"["+e+"]",b[e],c,d)}r.param=function(a,b){var c,d=[],e=function(a,b){var c=r.isFunction(b)?b():b;d[d.length]=encodeURIComponent(a)+"="+encodeURIComponent(null==c?"":c)};if(Array.isArray(a)||a.jquery&&!r.isPlainObject(a))r.each(a,function(){e(this.name,this.value)});else for(c in a)Ab(c,a[c],b,e);return d.join("&")},r.fn.extend({serialize:function(){return r.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var a=r.prop(this,"elements");return a?r.makeArray(a):this}).filter(function(){var a=this.type;return this.name&&!r(this).is(":disabled")&&zb.test(this.nodeName)&&!yb.test(a)&&(this.checked||!ja.test(a))}).map(function(a,b){var c=r(this).val();return null==c?null:Array.isArray(c)?r.map(c,function(a){return{name:b.name,value:a.replace(xb,"\r\n")}}):{name:b.name,value:c.replace(xb,"\r\n")}}).get()}});var Bb=/%20/g,Cb=/#.*$/,Db=/([?&])_=[^&]*/,Eb=/^(.*?):[ \t]*([^\r\n]*)$/gm,Fb=/^(?:about|app|app-storage|.+-extension|file|res|widget):$/,Gb=/^(?:GET|HEAD)$/,Hb=/^\/\//,Ib={},Jb={},Kb="*/".concat("*"),Lb=d.createElement("a");Lb.href=tb.href;function Mb(a){return function(b,c){"string"!=typeof b&&(c=b,b="*");var d,e=0,f=b.toLowerCase().match(L)||[];if(r.isFunction(c))while(d=f[e++])"+"===d[0]?(d=d.slice(1)||"*",(a[d]=a[d]||[]).unshift(c)):(a[d]=a[d]||[]).push(c)}}function Nb(a,b,c,d){var e={},f=a===Jb;function g(h){var i;return e[h]=!0,r.each(a[h]||[],function(a,h){var j=h(b,c,d);return"string"!=typeof j||f||e[j]?f?!(i=j):void 0:(b.dataTypes.unshift(j),g(j),!1)}),i}return g(b.dataTypes[0])||!e["*"]&&g("*")}function Ob(a,b){var c,d,e=r.ajaxSettings.flatOptions||{};for(c in b)void 0!==b[c]&&((e[c]?a:d||(d={}))[c]=b[c]);return d&&r.extend(!0,a,d),a}function Pb(a,b,c){var d,e,f,g,h=a.contents,i=a.dataTypes;while("*"===i[0])i.shift(),void 0===d&&(d=a.mimeType||b.getResponseHeader("Content-Type"));if(d)for(e in h)if(h[e]&&h[e].test(d)){i.unshift(e);break}if(i[0]in c)f=i[0];else{for(e in c){if(!i[0]||a.converters[e+" "+i[0]]){f=e;break}g||(g=e)}f=f||g}if(f)return f!==i[0]&&i.unshift(f),c[f]}function Qb(a,b,c,d){var e,f,g,h,i,j={},k=a.dataTypes.slice();if(k[1])for(g in a.converters)j[g.toLowerCase()]=a.converters[g];f=k.shift();while(f)if(a.responseFields[f]&&(c[a.responseFields[f]]=b),!i&&d&&a.dataFilter&&(b=a.dataFilter(b,a.dataType)),i=f,f=k.shift())if("*"===f)f=i;else if("*"!==i&&i!==f){if(g=j[i+" "+f]||j["* "+f],!g)for(e in j)if(h=e.split(" "),h[1]===f&&(g=j[i+" "+h[0]]||j["* "+h[0]])){g===!0?g=j[e]:j[e]!==!0&&(f=h[0],k.unshift(h[1]));break}if(g!==!0)if(g&&a["throws"])b=g(b);else try{b=g(b)}catch(l){return{state:"parsererror",error:g?l:"No conversion from "+i+" to "+f}}}return{state:"success",data:b}}r.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:tb.href,type:"GET",isLocal:Fb.test(tb.protocol),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":Kb,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/\bxml\b/,html:/\bhtml/,json:/\bjson\b/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":JSON.parse,"text xml":r.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(a,b){return b?Ob(Ob(a,r.ajaxSettings),b):Ob(r.ajaxSettings,a)},ajaxPrefilter:Mb(Ib),ajaxTransport:Mb(Jb),ajax:function(b,c){"object"==typeof b&&(c=b,b=void 0),c=c||{};var e,f,g,h,i,j,k,l,m,n,o=r.ajaxSetup({},c),p=o.context||o,q=o.context&&(p.nodeType||p.jquery)?r(p):r.event,s=r.Deferred(),t=r.Callbacks("once memory"),u=o.statusCode||{},v={},w={},x="canceled",y={readyState:0,getResponseHeader:function(a){var b;if(k){if(!h){h={};while(b=Eb.exec(g))h[b[1].toLowerCase()]=b[2]}b=h[a.toLowerCase()]}return null==b?null:b},getAllResponseHeaders:function(){return k?g:null},setRequestHeader:function(a,b){return null==k&&(a=w[a.toLowerCase()]=w[a.toLowerCase()]||a,v[a]=b),this},overrideMimeType:function(a){return null==k&&(o.mimeType=a),this},statusCode:function(a){var b;if(a)if(k)y.always(a[y.status]);else for(b in a)u[b]=[u[b],a[b]];return this},abort:function(a){var b=a||x;return e&&e.abort(b),A(0,b),this}};if(s.promise(y),o.url=((b||o.url||tb.href)+"").replace(Hb,tb.protocol+"//"),o.type=c.method||c.type||o.method||o.type,o.dataTypes=(o.dataType||"*").toLowerCase().match(L)||[""],null==o.crossDomain){j=d.createElement("a");try{j.href=o.url,j.href=j.href,o.crossDomain=Lb.protocol+"//"+Lb.host!=j.protocol+"//"+j.host}catch(z){o.crossDomain=!0}}if(o.data&&o.processData&&"string"!=typeof o.data&&(o.data=r.param(o.data,o.traditional)),Nb(Ib,o,c,y),k)return y;l=r.event&&o.global,l&&0===r.active++&&r.event.trigger("ajaxStart"),o.type=o.type.toUpperCase(),o.hasContent=!Gb.test(o.type),f=o.url.replace(Cb,""),o.hasContent?o.data&&o.processData&&0===(o.contentType||"").indexOf("application/x-www-form-urlencoded")&&(o.data=o.data.replace(Bb,"+")):(n=o.url.slice(f.length),o.data&&(f+=(vb.test(f)?"&":"?")+o.data,delete o.data),o.cache===!1&&(f=f.replace(Db,"$1"),n=(vb.test(f)?"&":"?")+"_="+ub++ +n),o.url=f+n),o.ifModified&&(r.lastModified[f]&&y.setRequestHeader("If-Modified-Since",r.lastModified[f]),r.etag[f]&&y.setRequestHeader("If-None-Match",r.etag[f])),(o.data&&o.hasContent&&o.contentType!==!1||c.contentType)&&y.setRequestHeader("Content-Type",o.contentType),y.setRequestHeader("Accept",o.dataTypes[0]&&o.accepts[o.dataTypes[0]]?o.accepts[o.dataTypes[0]]+("*"!==o.dataTypes[0]?", "+Kb+"; q=0.01":""):o.accepts["*"]);for(m in o.headers)y.setRequestHeader(m,o.headers[m]);if(o.beforeSend&&(o.beforeSend.call(p,y,o)===!1||k))return y.abort();if(x="abort",t.add(o.complete),y.done(o.success),y.fail(o.error),e=Nb(Jb,o,c,y)){if(y.readyState=1,l&&q.trigger("ajaxSend",[y,o]),k)return y;o.async&&o.timeout>0&&(i=a.setTimeout(function(){y.abort("timeout")},o.timeout));try{k=!1,e.send(v,A)}catch(z){if(k)throw z;A(-1,z)}}else A(-1,"No Transport");function A(b,c,d,h){var j,m,n,v,w,x=c;k||(k=!0,i&&a.clearTimeout(i),e=void 0,g=h||"",y.readyState=b>0?4:0,j=b>=200&&b<300||304===b,d&&(v=Pb(o,y,d)),v=Qb(o,v,y,j),j?(o.ifModified&&(w=y.getResponseHeader("Last-Modified"),w&&(r.lastModified[f]=w),w=y.getResponseHeader("etag"),w&&(r.etag[f]=w)),204===b||"HEAD"===o.type?x="nocontent":304===b?x="notmodified":(x=v.state,m=v.data,n=v.error,j=!n)):(n=x,!b&&x||(x="error",b<0&&(b=0))),y.status=b,y.statusText=(c||x)+"",j?s.resolveWith(p,[m,x,y]):s.rejectWith(p,[y,x,n]),y.statusCode(u),u=void 0,l&&q.trigger(j?"ajaxSuccess":"ajaxError",[y,o,j?m:n]),t.fireWith(p,[y,x]),l&&(q.trigger("ajaxComplete",[y,o]),--r.active||r.event.trigger("ajaxStop")))}return y},getJSON:function(a,b,c){return r.get(a,b,c,"json")},getScript:function(a,b){return r.get(a,void 0,b,"script")}}),r.each(["get","post"],function(a,b){r[b]=function(a,c,d,e){return r.isFunction(c)&&(e=e||d,d=c,c=void 0),r.ajax(r.extend({url:a,type:b,dataType:e,data:c,success:d},r.isPlainObject(a)&&a))}}),r._evalUrl=function(a){return r.ajax({url:a,type:"GET",dataType:"script",cache:!0,async:!1,global:!1,"throws":!0})},r.fn.extend({wrapAll:function(a){var b;return this[0]&&(r.isFunction(a)&&(a=a.call(this[0])),b=r(a,this[0].ownerDocument).eq(0).clone(!0),this[0].parentNode&&b.insertBefore(this[0]),b.map(function(){var a=this;while(a.firstElementChild)a=a.firstElementChild;return a}).append(this)),this},wrapInner:function(a){return r.isFunction(a)?this.each(function(b){r(this).wrapInner(a.call(this,b))}):this.each(function(){var b=r(this),c=b.contents();c.length?c.wrapAll(a):b.append(a)})},wrap:function(a){var b=r.isFunction(a);return this.each(function(c){r(this).wrapAll(b?a.call(this,c):a)})},unwrap:function(a){return this.parent(a).not("body").each(function(){r(this).replaceWith(this.childNodes)}),this}}),r.expr.pseudos.hidden=function(a){return!r.expr.pseudos.visible(a)},r.expr.pseudos.visible=function(a){return!!(a.offsetWidth||a.offsetHeight||a.getClientRects().length)},r.ajaxSettings.xhr=function(){try{return new a.XMLHttpRequest}catch(b){}};var Rb={0:200,1223:204},Sb=r.ajaxSettings.xhr();o.cors=!!Sb&&"withCredentials"in Sb,o.ajax=Sb=!!Sb,r.ajaxTransport(function(b){var c,d;if(o.cors||Sb&&!b.crossDomain)return{send:function(e,f){var g,h=b.xhr();if(h.open(b.type,b.url,b.async,b.username,b.password),b.xhrFields)for(g in b.xhrFields)h[g]=b.xhrFields[g];b.mimeType&&h.overrideMimeType&&h.overrideMimeType(b.mimeType),b.crossDomain||e["X-Requested-With"]||(e["X-Requested-With"]="XMLHttpRequest");for(g in e)h.setRequestHeader(g,e[g]);c=function(a){return function(){c&&(c=d=h.onload=h.onerror=h.onabort=h.onreadystatechange=null,"abort"===a?h.abort():"error"===a?"number"!=typeof h.status?f(0,"error"):f(h.status,h.statusText):f(Rb[h.status]||h.status,h.statusText,"text"!==(h.responseType||"text")||"string"!=typeof h.responseText?{binary:h.response}:{text:h.responseText},h.getAllResponseHeaders()))}},h.onload=c(),d=h.onerror=c("error"),void 0!==h.onabort?h.onabort=d:h.onreadystatechange=function(){4===h.readyState&&a.setTimeout(function(){c&&d()})},c=c("abort");try{h.send(b.hasContent&&b.data||null)}catch(i){if(c)throw i}},abort:function(){c&&c()}}}),r.ajaxPrefilter(function(a){a.crossDomain&&(a.contents.script=!1)}),r.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/\b(?:java|ecma)script\b/},converters:{"text script":function(a){return r.globalEval(a),a}}}),r.ajaxPrefilter("script",function(a){void 0===a.cache&&(a.cache=!1),a.crossDomain&&(a.type="GET")}),r.ajaxTransport("script",function(a){if(a.crossDomain){var b,c;return{send:function(e,f){b=r(" + + + + + + + + + + + + + + + + + + + + + + PARAM示例:[{\"name\":\"检测点代码\",\"value\":15},{\"name\":\"原材料_check\",\"value\":1},{\"name\":\"原材料代码\",\"value\":12}] + + + + + + + + + + + +
URL:
TYPE:(11 查询 12 增删改)
NAME:(存储过程名称)
PARAM: (存储过程参数)
Pagination: (分页的参数)
返回数据:
+ + diff --git a/webpage/SQLDemo.html b/webpage/SQLDemo.html new file mode 100644 index 0000000..ef1cdc8 --- /dev/null +++ b/webpage/SQLDemo.html @@ -0,0 +1,95 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
URL:
TYPE:(1 表示 执行存储过程 2 表示执行sql语句)
NAME:(存储过程或者sql语句的名称)
PARAM: (存储过程或者sql的语句的参数)
Pagination: (分页的参数)
返回值:
返回数据:
+ + diff --git a/webpage/SQLDemo04.html b/webpage/SQLDemo04.html new file mode 100644 index 0000000..c3f6cc7 --- /dev/null +++ b/webpage/SQLDemo04.html @@ -0,0 +1,106 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
URL:
USERID:(1 表示 执行存储过程 2 表示执行sql语句)
TYPE:(1 表示 执行存储过程 2 表示执行sql语句)
NAME:(存储过程或者sql语句的名称)
PARAM: (存储过程或者sql的语句的参数)
MODULARID: (主模块编号)
Pagination: (分页的参数)
返回值:
返回数据:
+ + diff --git a/webpage/SQLDemo2.html b/webpage/SQLDemo2.html new file mode 100644 index 0000000..fe59d32 --- /dev/null +++ b/webpage/SQLDemo2.html @@ -0,0 +1,68 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + PARAM示例:[{\"name\":\"检测点代码\",\"value\":15},{\"name\":\"原材料_check\",\"value\":1},{\"name\":\"原材料代码\",\"value\":12}] + + + + + + + + + + + +
URL:
TYPE:(11 查询 12 增删改)
NAME:(存储过程名称)
PARAM: (存储过程参数)
Pagination: (分页的参数)
返回数据:
+ + diff --git a/webpage/SQLDemo2Excel.html b/webpage/SQLDemo2Excel.html new file mode 100644 index 0000000..94c22d4 --- /dev/null +++ b/webpage/SQLDemo2Excel.html @@ -0,0 +1,128 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + PARAM示例:[{\"name\":\"检测点代码\",\"value\":15},{\"name\":\"原材料_check\",\"value\":1},{\"name\":\"原材料代码\",\"value\":12}] + + + + + + + + + + + + + + + + + +
URL:
USERID:(日志用)
TYPE:(2001导出Excel报表;11 查询 12 增删改)
NAME:(存储过程名称)
PARAM: (存储过程参数)
MODULARID: (主模块编号)
Pagination: (分页的参数)
返回数据:
+ + diff --git a/webpage/SQLDemoAMS.html b/webpage/SQLDemoAMS.html new file mode 100644 index 0000000..c5a1493 --- /dev/null +++ b/webpage/SQLDemoAMS.html @@ -0,0 +1,128 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + PARAM示例:[{\"name\":\"检测点代码\",\"value\":15},{\"name\":\"原材料_check\",\"value\":1},{\"name\":\"原材料代码\",\"value\":12}] + + + + + + + + + + + + + + + + + +
URL:
USERID:(日志用)
TYPE:(2001导出Excel报表;11 查询 12 增删改)
NAME:(存储过程名称)
PARAM: (存储过程参数)
MODULARID: (主模块编号)
Pagination: (分页的参数)
返回数据:
+ + diff --git a/webpage/SQLDemoFile.html b/webpage/SQLDemoFile.html new file mode 100644 index 0000000..e510c1e --- /dev/null +++ b/webpage/SQLDemoFile.html @@ -0,0 +1,96 @@ + + + + + + + + + + + + +
+ + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
URL:
TYPE:(1 表示 执行存储过程 2 表示执行sql语句)
NAME:(存储过程或者sql语句的名称)
PARAM: (存储过程或者sql的语句的参数)
Pagination: (分页的参数)
返回值:
返回数据:
+ + diff --git a/webpage/SqlCommonDemo.htm b/webpage/SqlCommonDemo.htm new file mode 100644 index 0000000..7ea2034 --- /dev/null +++ b/webpage/SqlCommonDemo.htm @@ -0,0 +1,402 @@ + + + + + + + + + + + + + + + + + + + + +
+ +
+ +
+
+
+ +
+
+ +
+ + + + + + + + +
+
+
+ +
+
+ 上传 + + 确定 +
+ +
+ +
+ + + + + + + +
+ 添加 + + 编辑 + + 删除 + + 取消 +
+
+ + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ 用户姓名: + + +
+ 用户名: + + +
+ 密码: + + +
+ 角色: + + +
+ 员工编号: + + +
+ 班组: + + +
+ 工作岗位: + + +
+ 联系电话: + + +
+ + 提交 + + + 清空 +
+
+
+
+ +
+ + diff --git a/webpage/_system~.ini b/webpage/_system~.ini new file mode 100644 index 0000000..e69de29 diff --git a/webpage/dist/SQLDemo.html b/webpage/dist/SQLDemo.html new file mode 100644 index 0000000..ef1cdc8 --- /dev/null +++ b/webpage/dist/SQLDemo.html @@ -0,0 +1,95 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
URL:
TYPE:(1 表示 执行存储过程 2 表示执行sql语句)
NAME:(存储过程或者sql语句的名称)
PARAM: (存储过程或者sql的语句的参数)
Pagination: (分页的参数)
返回值:
返回数据:
+ + diff --git a/webpage/dist/_system~.ini b/webpage/dist/_system~.ini new file mode 100644 index 0000000..e69de29 diff --git a/webpage/dist/axios.js b/webpage/dist/axios.js new file mode 100644 index 0000000..32e9aad --- /dev/null +++ b/webpage/dist/axios.js @@ -0,0 +1,1533 @@ +/* axios v0.18.1 | (c) 2019 by Matt Zabriskie */ +(function webpackUniversalModuleDefinition(root, factory) { + if(typeof exports === 'object' && typeof module === 'object') + module.exports = factory(); + else if(typeof define === 'function' && define.amd) + define([], factory); + else if(typeof exports === 'object') + exports["axios"] = factory(); + else + root["axios"] = factory(); +})(this, function() { +return /******/ (function(modules) { // webpackBootstrap +/******/ // The module cache +/******/ var installedModules = {}; +/******/ +/******/ // The require function +/******/ function __webpack_require__(moduleId) { +/******/ +/******/ // Check if module is in cache +/******/ if(installedModules[moduleId]) +/******/ return installedModules[moduleId].exports; +/******/ +/******/ // Create a new module (and put it into the cache) +/******/ var module = installedModules[moduleId] = { +/******/ exports: {}, +/******/ id: moduleId, +/******/ loaded: false +/******/ }; +/******/ +/******/ // Execute the module function +/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); +/******/ +/******/ // Flag the module as loaded +/******/ module.loaded = true; +/******/ +/******/ // Return the exports of the module +/******/ return module.exports; +/******/ } +/******/ +/******/ +/******/ // expose the modules object (__webpack_modules__) +/******/ __webpack_require__.m = modules; +/******/ +/******/ // expose the module cache +/******/ __webpack_require__.c = installedModules; +/******/ +/******/ // __webpack_public_path__ +/******/ __webpack_require__.p = ""; +/******/ +/******/ // Load entry module and return exports +/******/ return __webpack_require__(0); +/******/ }) +/************************************************************************/ +/******/ ([ +/* 0 */ +/***/ (function(module, exports, __webpack_require__) { + + module.exports = __webpack_require__(1); + +/***/ }), +/* 1 */ +/***/ (function(module, exports, __webpack_require__) { + + 'use strict'; + + var utils = __webpack_require__(2); + var bind = __webpack_require__(3); + var Axios = __webpack_require__(5); + var defaults = __webpack_require__(6); + + /** + * 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(utils.merge(defaults, instanceConfig)); + }; + + // Expose Cancel & CancelToken + axios.Cancel = __webpack_require__(22); + axios.CancelToken = __webpack_require__(23); + axios.isCancel = __webpack_require__(19); + + // Expose all/spread + axios.all = function all(promises) { + return Promise.all(promises); + }; + axios.spread = __webpack_require__(24); + + module.exports = axios; + + // Allow use of default import syntax in TypeScript + module.exports.default = axios; + + +/***/ }), +/* 2 */ +/***/ (function(module, exports, __webpack_require__) { + + 'use strict'; + + var bind = __webpack_require__(3); + var isBuffer = __webpack_require__(4); + + /*global toString:true*/ + + // utils is a library of generic helper functions non-specific to axios + + var toString = Object.prototype.toString; + + /** + * Determine if a value is an Array + * + * @param {Object} val The value to test + * @returns {boolean} True if value is an Array, otherwise false + */ + function isArray(val) { + return toString.call(val) === '[object Array]'; + } + + /** + * Determine if a value is an ArrayBuffer + * + * @param {Object} val The value to test + * @returns {boolean} True if value is an ArrayBuffer, otherwise false + */ + function isArrayBuffer(val) { + return toString.call(val) === '[object ArrayBuffer]'; + } + + /** + * Determine if a value is a FormData + * + * @param {Object} val The value to test + * @returns {boolean} True if value is an FormData, otherwise false + */ + function isFormData(val) { + return (typeof FormData !== 'undefined') && (val instanceof FormData); + } + + /** + * Determine if a value is a view on an ArrayBuffer + * + * @param {Object} val The value to test + * @returns {boolean} True if value is a view on an ArrayBuffer, otherwise false + */ + function isArrayBufferView(val) { + var result; + if ((typeof ArrayBuffer !== 'undefined') && (ArrayBuffer.isView)) { + result = ArrayBuffer.isView(val); + } else { + result = (val) && (val.buffer) && (val.buffer instanceof ArrayBuffer); + } + return result; + } + + /** + * Determine if a value is a String + * + * @param {Object} val The value to test + * @returns {boolean} True if value is a String, otherwise false + */ + function isString(val) { + return typeof val === 'string'; + } + + /** + * Determine if a value is a Number + * + * @param {Object} val The value to test + * @returns {boolean} True if value is a Number, otherwise false + */ + function isNumber(val) { + return typeof val === 'number'; + } + + /** + * Determine if a value is undefined + * + * @param {Object} val The value to test + * @returns {boolean} True if the value is undefined, otherwise false + */ + function isUndefined(val) { + return typeof val === 'undefined'; + } + + /** + * Determine if a value is an Object + * + * @param {Object} val The value to test + * @returns {boolean} True if value is an Object, otherwise false + */ + function isObject(val) { + return val !== null && typeof val === 'object'; + } + + /** + * Determine if a value is a Date + * + * @param {Object} val The value to test + * @returns {boolean} True if value is a Date, otherwise false + */ + function isDate(val) { + return toString.call(val) === '[object Date]'; + } + + /** + * Determine if a value is a File + * + * @param {Object} val The value to test + * @returns {boolean} True if value is a File, otherwise false + */ + function isFile(val) { + return toString.call(val) === '[object File]'; + } + + /** + * Determine if a value is a Blob + * + * @param {Object} val The value to test + * @returns {boolean} True if value is a Blob, otherwise false + */ + function isBlob(val) { + return toString.call(val) === '[object Blob]'; + } + + /** + * Determine if a value is a Function + * + * @param {Object} val The value to test + * @returns {boolean} True if value is a Function, otherwise false + */ + function isFunction(val) { + return toString.call(val) === '[object Function]'; + } + + /** + * Determine if a value is a Stream + * + * @param {Object} val The value to test + * @returns {boolean} True if value is a Stream, otherwise false + */ + function isStream(val) { + return isObject(val) && isFunction(val.pipe); + } + + /** + * Determine if a value is a URLSearchParams object + * + * @param {Object} val The value to test + * @returns {boolean} True if value is a URLSearchParams object, otherwise false + */ + function isURLSearchParams(val) { + return typeof URLSearchParams !== 'undefined' && val instanceof URLSearchParams; + } + + /** + * Trim excess whitespace off the beginning and end of a string + * + * @param {String} str The String to trim + * @returns {String} The String freed of excess whitespace + */ + function trim(str) { + return str.replace(/^\s*/, '').replace(/\s*$/, ''); + } + + /** + * Determine if we're running in a standard browser environment + * + * This allows axios to run in a web worker, and react-native. + * Both environments support XMLHttpRequest, but not fully standard globals. + * + * web workers: + * typeof window -> undefined + * typeof document -> undefined + * + * react-native: + * navigator.product -> 'ReactNative' + */ + function isStandardBrowserEnv() { + if (typeof navigator !== 'undefined' && navigator.product === 'ReactNative') { + return false; + } + return ( + typeof window !== 'undefined' && + typeof document !== 'undefined' + ); + } + + /** + * Iterate over an Array or an Object invoking a function for each item. + * + * If `obj` is an Array callback will be called passing + * the value, index, and complete array for each item. + * + * If 'obj' is an Object callback will be called passing + * the value, key, and complete object for each property. + * + * @param {Object|Array} obj The object to iterate + * @param {Function} fn The callback to invoke for each item + */ + function forEach(obj, fn) { + // Don't bother if no value provided + if (obj === null || typeof obj === 'undefined') { + return; + } + + // Force an array if not already something iterable + if (typeof obj !== 'object') { + /*eslint no-param-reassign:0*/ + obj = [obj]; + } + + if (isArray(obj)) { + // Iterate over array values + for (var i = 0, l = obj.length; i < l; i++) { + fn.call(null, obj[i], i, obj); + } + } else { + // Iterate over object keys + for (var key in obj) { + if (Object.prototype.hasOwnProperty.call(obj, key)) { + fn.call(null, obj[key], key, obj); + } + } + } + } + + /** + * Accepts varargs expecting each argument to be an object, then + * immutably merges the properties of each object and returns result. + * + * When multiple objects contain the same key the later object in + * the arguments list will take precedence. + * + * Example: + * + * ```js + * var result = merge({foo: 123}, {foo: 456}); + * console.log(result.foo); // outputs 456 + * ``` + * + * @param {Object} obj1 Object to merge + * @returns {Object} Result of all merge properties + */ + function merge(/* obj1, obj2, obj3, ... */) { + var result = {}; + function assignValue(val, key) { + if (typeof result[key] === 'object' && typeof val === 'object') { + result[key] = merge(result[key], val); + } else { + result[key] = val; + } + } + + for (var i = 0, l = arguments.length; i < l; i++) { + forEach(arguments[i], assignValue); + } + return result; + } + + /** + * Extends object a by mutably adding to it the properties of object b. + * + * @param {Object} a The object to be extended + * @param {Object} b The object to copy properties from + * @param {Object} thisArg The object to bind function to + * @return {Object} The resulting value of object a + */ + function extend(a, b, thisArg) { + forEach(b, function assignValue(val, key) { + if (thisArg && typeof val === 'function') { + a[key] = bind(val, thisArg); + } else { + a[key] = val; + } + }); + return a; + } + + module.exports = { + isArray: isArray, + isArrayBuffer: isArrayBuffer, + isBuffer: isBuffer, + isFormData: isFormData, + isArrayBufferView: isArrayBufferView, + isString: isString, + isNumber: isNumber, + isObject: isObject, + isUndefined: isUndefined, + isDate: isDate, + isFile: isFile, + isBlob: isBlob, + isFunction: isFunction, + isStream: isStream, + isURLSearchParams: isURLSearchParams, + isStandardBrowserEnv: isStandardBrowserEnv, + forEach: forEach, + merge: merge, + extend: extend, + trim: trim + }; + + +/***/ }), +/* 3 */ +/***/ (function(module, exports) { + + 'use strict'; + + module.exports = function bind(fn, thisArg) { + return function wrap() { + var args = new Array(arguments.length); + for (var i = 0; i < args.length; i++) { + args[i] = arguments[i]; + } + return fn.apply(thisArg, args); + }; + }; + + +/***/ }), +/* 4 */ +/***/ (function(module, exports) { + + /*! + * Determine if an object is a Buffer + * + * @author Feross Aboukhadijeh + * @license MIT + */ + + module.exports = function isBuffer (obj) { + return obj != null && obj.constructor != null && + typeof obj.constructor.isBuffer === 'function' && obj.constructor.isBuffer(obj) + } + + +/***/ }), +/* 5 */ +/***/ (function(module, exports, __webpack_require__) { + + 'use strict'; + + var defaults = __webpack_require__(6); + var utils = __webpack_require__(2); + var InterceptorManager = __webpack_require__(16); + var dispatchRequest = __webpack_require__(17); + + /** + * 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 = utils.merge({ + url: arguments[0] + }, arguments[1]); + } + + config = utils.merge(defaults, {method: 'get'}, this.defaults, config); + config.method = config.method.toLowerCase(); + + // 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; + }; + + // 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(utils.merge(config || {}, { + method: method, + url: url + })); + }; + }); + + utils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) { + /*eslint func-names:0*/ + Axios.prototype[method] = function(url, data, config) { + return this.request(utils.merge(config || {}, { + method: method, + url: url, + data: data + })); + }; + }); + + module.exports = Axios; + + +/***/ }), +/* 6 */ +/***/ (function(module, exports, __webpack_require__) { + + 'use strict'; + + var utils = __webpack_require__(2); + var normalizeHeaderName = __webpack_require__(7); + + var DEFAULT_CONTENT_TYPE = { + 'Content-Type': 'application/x-www-form-urlencoded' + }; + + function setContentTypeIfUnset(headers, value) { + if (!utils.isUndefined(headers) && utils.isUndefined(headers['Content-Type'])) { + headers['Content-Type'] = value; + } + } + + function getDefaultAdapter() { + var adapter; + if (typeof XMLHttpRequest !== 'undefined') { + // For browsers use XHR adapter + adapter = __webpack_require__(8); + } else if (typeof process !== 'undefined') { + // For node use HTTP adapter + adapter = __webpack_require__(8); + } + return adapter; + } + + var defaults = { + adapter: getDefaultAdapter(), + + transformRequest: [function transformRequest(data, headers) { + normalizeHeaderName(headers, 'Content-Type'); + if (utils.isFormData(data) || + utils.isArrayBuffer(data) || + utils.isBuffer(data) || + utils.isStream(data) || + utils.isFile(data) || + utils.isBlob(data) + ) { + return data; + } + if (utils.isArrayBufferView(data)) { + return data.buffer; + } + if (utils.isURLSearchParams(data)) { + setContentTypeIfUnset(headers, 'application/x-www-form-urlencoded;charset=utf-8'); + return data.toString(); + } + if (utils.isObject(data)) { + setContentTypeIfUnset(headers, 'application/json;charset=utf-8'); + return JSON.stringify(data); + } + return data; + }], + + transformResponse: [function transformResponse(data) { + /*eslint no-param-reassign:0*/ + if (typeof data === 'string') { + try { + data = JSON.parse(data); + } catch (e) { /* Ignore */ } + } + return data; + }], + + /** + * A timeout in milliseconds to abort a request. If set to 0 (default) a + * timeout is not created. + */ + timeout: 0, + + xsrfCookieName: 'XSRF-TOKEN', + xsrfHeaderName: 'X-XSRF-TOKEN', + + maxContentLength: -1, + + validateStatus: function validateStatus(status) { + return status >= 200 && status < 300; + } + }; + + defaults.headers = { + common: { + 'Accept': 'application/json, text/plain, */*' + } + }; + + utils.forEach(['delete', 'get', 'head'], function forEachMethodNoData(method) { + defaults.headers[method] = {}; + }); + + utils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) { + defaults.headers[method] = utils.merge(DEFAULT_CONTENT_TYPE); + }); + + module.exports = defaults; + + +/***/ }), +/* 7 */ +/***/ (function(module, exports, __webpack_require__) { + + 'use strict'; + + var utils = __webpack_require__(2); + + module.exports = function normalizeHeaderName(headers, normalizedName) { + utils.forEach(headers, function processHeader(value, name) { + if (name !== normalizedName && name.toUpperCase() === normalizedName.toUpperCase()) { + headers[normalizedName] = value; + delete headers[name]; + } + }); + }; + + +/***/ }), +/* 8 */ +/***/ (function(module, exports, __webpack_require__) { + + 'use strict'; + + var utils = __webpack_require__(2); + var settle = __webpack_require__(9); + var buildURL = __webpack_require__(12); + var parseHeaders = __webpack_require__(13); + var isURLSameOrigin = __webpack_require__(14); + var createError = __webpack_require__(10); + + 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 || ''; + requestHeaders.Authorization = 'Basic ' + btoa(username + ':' + password); + } + + request.open(config.method.toUpperCase(), buildURL(config.url, 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 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() { + reject(createError('timeout of ' + config.timeout + 'ms exceeded', 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()) { + var cookies = __webpack_require__(15); + + // Add xsrf header + var xsrfValue = (config.withCredentials || isURLSameOrigin(config.url)) && 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 (config.withCredentials) { + request.withCredentials = true; + } + + // 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 === undefined) { + requestData = null; + } + + // Send the request + request.send(requestData); + }); + }; + + +/***/ }), +/* 9 */ +/***/ (function(module, exports, __webpack_require__) { + + 'use strict'; + + var createError = __webpack_require__(10); + + /** + * Resolve or reject a Promise based on response status. + * + * @param {Function} resolve A function that resolves the promise. + * @param {Function} reject A function that rejects the promise. + * @param {object} response The response. + */ + module.exports = function settle(resolve, reject, response) { + var validateStatus = response.config.validateStatus; + // Note: status is not exposed by XDomainRequest + if (!response.status || !validateStatus || validateStatus(response.status)) { + resolve(response); + } else { + reject(createError( + 'Request failed with status code ' + response.status, + response.config, + null, + response.request, + response + )); + } + }; + + +/***/ }), +/* 10 */ +/***/ (function(module, exports, __webpack_require__) { + + 'use strict'; + + var enhanceError = __webpack_require__(11); + + /** + * 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); + }; + + +/***/ }), +/* 11 */ +/***/ (function(module, exports) { + + 'use strict'; + + /** + * Update an Error with the specified config, error code, and response. + * + * @param {Error} error The error to update. + * @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 error. + */ + module.exports = function enhanceError(error, config, code, request, response) { + error.config = config; + if (code) { + error.code = code; + } + error.request = request; + error.response = response; + return error; + }; + + +/***/ }), +/* 12 */ +/***/ (function(module, exports, __webpack_require__) { + + 'use strict'; + + var utils = __webpack_require__(2); + + function encode(val) { + return encodeURIComponent(val). + replace(/%40/gi, '@'). + replace(/%3A/gi, ':'). + replace(/%24/g, '$'). + replace(/%2C/gi, ','). + replace(/%20/g, '+'). + replace(/%5B/gi, '['). + replace(/%5D/gi, ']'); + } + + /** + * Build a URL by appending params to the end + * + * @param {string} url The base of the url (e.g., http://www.google.com) + * @param {object} [params] The params to be appended + * @returns {string} The formatted url + */ + module.exports = function buildURL(url, params, paramsSerializer) { + /*eslint no-param-reassign:0*/ + if (!params) { + return url; + } + + var serializedParams; + if (paramsSerializer) { + serializedParams = paramsSerializer(params); + } else if (utils.isURLSearchParams(params)) { + serializedParams = params.toString(); + } else { + var parts = []; + + utils.forEach(params, function serialize(val, key) { + if (val === null || typeof val === 'undefined') { + return; + } + + if (utils.isArray(val)) { + key = key + '[]'; + } else { + val = [val]; + } + + utils.forEach(val, function parseValue(v) { + if (utils.isDate(v)) { + v = v.toISOString(); + } else if (utils.isObject(v)) { + v = JSON.stringify(v); + } + parts.push(encode(key) + '=' + encode(v)); + }); + }); + + serializedParams = parts.join('&'); + } + + if (serializedParams) { + url += (url.indexOf('?') === -1 ? '?' : '&') + serializedParams; + } + + return url; + }; + + +/***/ }), +/* 13 */ +/***/ (function(module, exports, __webpack_require__) { + + 'use strict'; + + var utils = __webpack_require__(2); + + // Headers whose duplicates are ignored by node + // c.f. https://nodejs.org/api/http.html#http_message_headers + var ignoreDuplicateOf = [ + 'age', 'authorization', 'content-length', 'content-type', 'etag', + 'expires', 'from', 'host', 'if-modified-since', 'if-unmodified-since', + 'last-modified', 'location', 'max-forwards', 'proxy-authorization', + 'referer', 'retry-after', 'user-agent' + ]; + + /** + * Parse headers into an object + * + * ``` + * Date: Wed, 27 Aug 2014 08:58:49 GMT + * Content-Type: application/json + * Connection: keep-alive + * Transfer-Encoding: chunked + * ``` + * + * @param {String} headers Headers needing to be parsed + * @returns {Object} Headers parsed into an object + */ + module.exports = function parseHeaders(headers) { + var parsed = {}; + var key; + var val; + var i; + + if (!headers) { return parsed; } + + utils.forEach(headers.split('\n'), function parser(line) { + i = line.indexOf(':'); + key = utils.trim(line.substr(0, i)).toLowerCase(); + val = utils.trim(line.substr(i + 1)); + + if (key) { + if (parsed[key] && ignoreDuplicateOf.indexOf(key) >= 0) { + return; + } + if (key === 'set-cookie') { + parsed[key] = (parsed[key] ? parsed[key] : []).concat([val]); + } else { + parsed[key] = parsed[key] ? parsed[key] + ', ' + val : val; + } + } + }); + + return parsed; + }; + + +/***/ }), +/* 14 */ +/***/ (function(module, exports, __webpack_require__) { + + 'use strict'; + + var utils = __webpack_require__(2); + + module.exports = ( + utils.isStandardBrowserEnv() ? + + // Standard browser envs have full support of the APIs needed to test + // whether the request URL is of the same origin as current location. + (function standardBrowserEnv() { + var msie = /(msie|trident)/i.test(navigator.userAgent); + var urlParsingNode = document.createElement('a'); + var originURL; + + /** + * Parse a URL to discover it's components + * + * @param {String} url The URL to be parsed + * @returns {Object} + */ + function resolveURL(url) { + var href = url; + + if (msie) { + // IE needs attribute set twice to normalize properties + urlParsingNode.setAttribute('href', href); + href = urlParsingNode.href; + } + + urlParsingNode.setAttribute('href', href); + + // urlParsingNode provides the UrlUtils interface - http://url.spec.whatwg.org/#urlutils + return { + href: urlParsingNode.href, + protocol: urlParsingNode.protocol ? urlParsingNode.protocol.replace(/:$/, '') : '', + host: urlParsingNode.host, + search: urlParsingNode.search ? urlParsingNode.search.replace(/^\?/, '') : '', + hash: urlParsingNode.hash ? urlParsingNode.hash.replace(/^#/, '') : '', + hostname: urlParsingNode.hostname, + port: urlParsingNode.port, + pathname: (urlParsingNode.pathname.charAt(0) === '/') ? + urlParsingNode.pathname : + '/' + urlParsingNode.pathname + }; + } + + originURL = resolveURL(window.location.href); + + /** + * Determine if a URL shares the same origin as the current location + * + * @param {String} requestURL The URL to test + * @returns {boolean} True if URL shares the same origin, otherwise false + */ + return function isURLSameOrigin(requestURL) { + var parsed = (utils.isString(requestURL)) ? resolveURL(requestURL) : requestURL; + return (parsed.protocol === originURL.protocol && + parsed.host === originURL.host); + }; + })() : + + // Non standard browser envs (web workers, react-native) lack needed support. + (function nonStandardBrowserEnv() { + return function isURLSameOrigin() { + return true; + }; + })() + ); + + +/***/ }), +/* 15 */ +/***/ (function(module, exports, __webpack_require__) { + + 'use strict'; + + var utils = __webpack_require__(2); + + module.exports = ( + utils.isStandardBrowserEnv() ? + + // Standard browser envs support document.cookie + (function standardBrowserEnv() { + return { + write: function write(name, value, expires, path, domain, secure) { + var cookie = []; + cookie.push(name + '=' + encodeURIComponent(value)); + + if (utils.isNumber(expires)) { + cookie.push('expires=' + new Date(expires).toGMTString()); + } + + if (utils.isString(path)) { + cookie.push('path=' + path); + } + + if (utils.isString(domain)) { + cookie.push('domain=' + domain); + } + + if (secure === true) { + cookie.push('secure'); + } + + document.cookie = cookie.join('; '); + }, + + read: function read(name) { + var match = document.cookie.match(new RegExp('(^|;\\s*)(' + name + ')=([^;]*)')); + return (match ? decodeURIComponent(match[3]) : null); + }, + + remove: function remove(name) { + this.write(name, '', Date.now() - 86400000); + } + }; + })() : + + // Non standard browser env (web workers, react-native) lack needed support. + (function nonStandardBrowserEnv() { + return { + write: function write() {}, + read: function read() { return null; }, + remove: function remove() {} + }; + })() + ); + + +/***/ }), +/* 16 */ +/***/ (function(module, exports, __webpack_require__) { + + 'use strict'; + + var utils = __webpack_require__(2); + + 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; + + +/***/ }), +/* 17 */ +/***/ (function(module, exports, __webpack_require__) { + + 'use strict'; + + var utils = __webpack_require__(2); + var transformData = __webpack_require__(18); + var isCancel = __webpack_require__(19); + var defaults = __webpack_require__(6); + var isAbsoluteURL = __webpack_require__(20); + var combineURLs = __webpack_require__(21); + + /** + * Throws a `Cancel` if cancellation has been requested. + */ + function throwIfCancellationRequested(config) { + if (config.cancelToken) { + config.cancelToken.throwIfRequested(); + } + } + + /** + * Dispatch a request to the server using the configured adapter. + * + * @param {object} config The config that is to be used for the request + * @returns {Promise} The Promise to be fulfilled + */ + module.exports = function dispatchRequest(config) { + throwIfCancellationRequested(config); + + // Support baseURL config + if (config.baseURL && !isAbsoluteURL(config.url)) { + config.url = combineURLs(config.baseURL, config.url); + } + + // Ensure headers exist + config.headers = config.headers || {}; + + // Transform request data + config.data = transformData( + config.data, + config.headers, + config.transformRequest + ); + + // Flatten headers + config.headers = utils.merge( + config.headers.common || {}, + config.headers[config.method] || {}, + config.headers || {} + ); + + utils.forEach( + ['delete', 'get', 'head', 'post', 'put', 'patch', 'common'], + function cleanHeaderConfig(method) { + delete config.headers[method]; + } + ); + + var adapter = config.adapter || defaults.adapter; + + return adapter(config).then(function onAdapterResolution(response) { + throwIfCancellationRequested(config); + + // Transform response data + response.data = transformData( + response.data, + response.headers, + config.transformResponse + ); + + return response; + }, function onAdapterRejection(reason) { + if (!isCancel(reason)) { + throwIfCancellationRequested(config); + + // Transform response data + if (reason && reason.response) { + reason.response.data = transformData( + reason.response.data, + reason.response.headers, + config.transformResponse + ); + } + } + + return Promise.reject(reason); + }); + }; + + +/***/ }), +/* 18 */ +/***/ (function(module, exports, __webpack_require__) { + + 'use strict'; + + var utils = __webpack_require__(2); + + /** + * Transform the data for a request or a response + * + * @param {Object|String} data The data to be transformed + * @param {Array} headers The headers for the request or response + * @param {Array|Function} fns A single function or Array of functions + * @returns {*} The resulting transformed data + */ + module.exports = function transformData(data, headers, fns) { + /*eslint no-param-reassign:0*/ + utils.forEach(fns, function transform(fn) { + data = fn(data, headers); + }); + + return data; + }; + + +/***/ }), +/* 19 */ +/***/ (function(module, exports) { + + 'use strict'; + + module.exports = function isCancel(value) { + return !!(value && value.__CANCEL__); + }; + + +/***/ }), +/* 20 */ +/***/ (function(module, exports) { + + 'use strict'; + + /** + * Determines whether the specified URL is absolute + * + * @param {string} url The URL to test + * @returns {boolean} True if the specified URL is absolute, otherwise false + */ + module.exports = function isAbsoluteURL(url) { + // A URL is considered absolute if it begins with "://" or "//" (protocol-relative URL). + // RFC 3986 defines scheme name as a sequence of characters beginning with a letter and followed + // by any combination of letters, digits, plus, period, or hyphen. + return /^([a-z][a-z\d\+\-\.]*:)?\/\//i.test(url); + }; + + +/***/ }), +/* 21 */ +/***/ (function(module, exports) { + + 'use strict'; + + /** + * Creates a new URL by combining the specified URLs + * + * @param {string} baseURL The base URL + * @param {string} relativeURL The relative URL + * @returns {string} The combined URL + */ + module.exports = function combineURLs(baseURL, relativeURL) { + return relativeURL + ? baseURL.replace(/\/+$/, '') + '/' + relativeURL.replace(/^\/+/, '') + : baseURL; + }; + + +/***/ }), +/* 22 */ +/***/ (function(module, exports) { + + '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; + + +/***/ }), +/* 23 */ +/***/ (function(module, exports, __webpack_require__) { + + 'use strict'; + + var Cancel = __webpack_require__(22); + + /** + * 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; + + +/***/ }), +/* 24 */ +/***/ (function(module, exports) { + + 'use strict'; + + /** + * Syntactic sugar for invoking a function and expanding an array for arguments. + * + * Common use case would be to use `Function.prototype.apply`. + * + * ```js + * function f(x, y, z) {} + * var args = [1, 2, 3]; + * f.apply(null, args); + * ``` + * + * With `spread` this example can be re-written. + * + * ```js + * spread(function(x, y, z) {})([1, 2, 3]); + * ``` + * + * @param {Function} callback + * @returns {Function} + */ + module.exports = function spread(callback) { + return function wrap(arr) { + return callback.apply(null, arr); + }; + }; + + +/***/ }) +/******/ ]) +}); +; +//# sourceMappingURL=axios.map \ No newline at end of file diff --git a/webpage/dist/axios.map b/webpage/dist/axios.map new file mode 100644 index 0000000..bc719b3 --- /dev/null +++ b/webpage/dist/axios.map @@ -0,0 +1 @@ +{"version":3,"sources":["webpack:///webpack/universalModuleDefinition","webpack:///webpack/bootstrap 65051a9b9bc6b3f02256","webpack:///./index.js","webpack:///./lib/axios.js","webpack:///./lib/utils.js","webpack:///./lib/helpers/bind.js","webpack:///./~/is-buffer/index.js","webpack:///./lib/core/Axios.js","webpack:///./lib/defaults.js","webpack:///./lib/helpers/normalizeHeaderName.js","webpack:///./lib/adapters/xhr.js","webpack:///./lib/core/settle.js","webpack:///./lib/core/createError.js","webpack:///./lib/core/enhanceError.js","webpack:///./lib/helpers/buildURL.js","webpack:///./lib/helpers/parseHeaders.js","webpack:///./lib/helpers/isURLSameOrigin.js","webpack:///./lib/helpers/cookies.js","webpack:///./lib/core/InterceptorManager.js","webpack:///./lib/core/dispatchRequest.js","webpack:///./lib/core/transformData.js","webpack:///./lib/cancel/isCancel.js","webpack:///./lib/helpers/isAbsoluteURL.js","webpack:///./lib/helpers/combineURLs.js","webpack:///./lib/cancel/Cancel.js","webpack:///./lib/cancel/CancelToken.js","webpack:///./lib/helpers/spread.js"],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD,O;ACVA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,uBAAe;AACf;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;;AAGA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;;;;;;ACtCA,yC;;;;;;ACAA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,YAAW,OAAO;AAClB,aAAY,MAAM;AAClB;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;;;;;;ACnDA;;AAEA;AACA;;AAEA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA,YAAW,OAAO;AAClB,cAAa,QAAQ;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,YAAW,OAAO;AAClB,cAAa,QAAQ;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,YAAW,OAAO;AAClB,cAAa,QAAQ;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,YAAW,OAAO;AAClB,cAAa,QAAQ;AACrB;AACA;AACA;AACA;AACA;AACA,IAAG;AACH;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,YAAW,OAAO;AAClB,cAAa,QAAQ;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,YAAW,OAAO;AAClB,cAAa,QAAQ;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,YAAW,OAAO;AAClB,cAAa,QAAQ;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,YAAW,OAAO;AAClB,cAAa,QAAQ;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,YAAW,OAAO;AAClB,cAAa,QAAQ;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,YAAW,OAAO;AAClB,cAAa,QAAQ;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,YAAW,OAAO;AAClB,cAAa,QAAQ;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,YAAW,OAAO;AAClB,cAAa,QAAQ;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,YAAW,OAAO;AAClB,cAAa,QAAQ;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,YAAW,OAAO;AAClB,cAAa,QAAQ;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,YAAW,OAAO;AAClB,cAAa,OAAO;AACpB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAW,aAAa;AACxB,YAAW,SAAS;AACpB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,oCAAmC,OAAO;AAC1C;AACA;AACA,IAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAuB,SAAS,GAAG,SAAS;AAC5C,4BAA2B;AAC3B;AACA;AACA,YAAW,OAAO;AAClB,cAAa,OAAO;AACpB;AACA;AACA;AACA;AACA;AACA;AACA,MAAK;AACL;AACA;AACA;;AAEA,wCAAuC,OAAO;AAC9C;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,YAAW,OAAO;AAClB,YAAW,OAAO;AAClB,YAAW,OAAO;AAClB,aAAY,OAAO;AACnB;AACA;AACA;AACA;AACA;AACA,MAAK;AACL;AACA;AACA,IAAG;AACH;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;AC9SA;;AAEA;AACA;AACA;AACA,oBAAmB,iBAAiB;AACpC;AACA;AACA;AACA;AACA;;;;;;;ACVA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;;;;;;ACVA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,YAAW,OAAO;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,YAAW,OAAO;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAK;AACL;;AAEA,mCAAkC,cAAc;AAChD;;AAEA;AACA;AACA;;AAEA;AACA;AACA,IAAG;;AAEH;AACA;AACA,IAAG;;AAEH;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA,iDAAgD;AAChD;AACA;AACA,MAAK;AACL;AACA,EAAC;;AAED;AACA;AACA;AACA,iDAAgD;AAChD;AACA;AACA;AACA,MAAK;AACL;AACA,EAAC;;AAED;;;;;;;AC9EA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,IAAG;AACH;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yEAAwE;AACxE;AACA;AACA;AACA,wDAAuD;AACvD;AACA;AACA;AACA,IAAG;;AAEH;AACA;AACA;AACA;AACA;AACA,QAAO,YAAY;AACnB;AACA;AACA,IAAG;;AAEH;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,EAAC;;AAED;AACA;AACA,EAAC;;AAED;;;;;;;AC/FA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,IAAG;AACH;;;;;;;ACXA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,6CAA4C;AAC5C;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,UAAS;AACT;AACA;AACA;AACA,QAAO;AACP;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,QAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,QAAO;AACP;;AAEA;AACA;AACA;;AAEA;AACA;AACA,IAAG;AACH;;;;;;;ACjKA;;AAEA;;AAEA;AACA;AACA;AACA,YAAW,SAAS;AACpB,YAAW,SAAS;AACpB,YAAW,OAAO;AAClB;AACA;AACA;AACA;AACA;AACA;AACA,IAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;ACzBA;;AAEA;;AAEA;AACA;AACA;AACA,YAAW,OAAO;AAClB,YAAW,OAAO;AAClB,YAAW,OAAO;AAClB,YAAW,OAAO;AAClB,YAAW,OAAO;AAClB,cAAa,MAAM;AACnB;AACA;AACA;AACA;AACA;;;;;;;ACjBA;;AAEA;AACA;AACA;AACA,YAAW,MAAM;AACjB,YAAW,OAAO;AAClB,YAAW,OAAO;AAClB,YAAW,OAAO;AAClB,YAAW,OAAO;AAClB,cAAa,MAAM;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;ACpBA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,YAAW,OAAO;AAClB,YAAW,OAAO;AAClB,cAAa,OAAO;AACpB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,IAAG;AACH;AACA,IAAG;AACH;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA,QAAO;AACP;AACA;;AAEA;AACA;AACA;AACA,UAAS;AACT;AACA;AACA;AACA,QAAO;AACP,MAAK;;AAEL;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;;;;;;ACjEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAW,OAAO;AAClB,cAAa,OAAO;AACpB;AACA;AACA;AACA;AACA;AACA;;AAEA,kBAAiB,eAAe;;AAEhC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,QAAO;AACP;AACA;AACA;AACA,IAAG;;AAEH;AACA;;;;;;;ACpDA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,eAAc,OAAO;AACrB,iBAAgB;AAChB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA,eAAc,OAAO;AACrB,iBAAgB,QAAQ;AACxB;AACA;AACA;AACA;AACA;AACA;AACA,IAAG;;AAEH;AACA;AACA;AACA;AACA;AACA,IAAG;AACH;;;;;;;ACnEA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA,yCAAwC;AACxC,QAAO;;AAEP;AACA,2DAA0D,wBAAwB;AAClF;AACA,QAAO;;AAEP;AACA;AACA;AACA;AACA,IAAG;;AAEH;AACA;AACA;AACA,iCAAgC;AAChC,8BAA6B,aAAa,EAAE;AAC5C;AACA;AACA,IAAG;AACH;;;;;;;ACpDA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,YAAW,SAAS;AACpB,YAAW,SAAS;AACpB;AACA,aAAY,OAAO;AACnB;AACA;AACA;AACA;AACA;AACA,IAAG;AACH;AACA;;AAEA;AACA;AACA;AACA,YAAW,OAAO;AAClB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,YAAW,SAAS;AACpB;AACA;AACA;AACA;AACA;AACA;AACA,IAAG;AACH;;AAEA;;;;;;;ACnDA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,YAAW,OAAO;AAClB,cAAa,QAAQ;AACrB;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,gCAA+B;AAC/B,wCAAuC;AACvC;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,IAAG;AACH;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,IAAG;AACH;;;;;;;ACrFA;;AAEA;;AAEA;AACA;AACA;AACA,YAAW,cAAc;AACzB,YAAW,MAAM;AACjB,YAAW,eAAe;AAC1B,cAAa,EAAE;AACf;AACA;AACA;AACA;AACA;AACA,IAAG;;AAEH;AACA;;;;;;;ACnBA;;AAEA;AACA;AACA;;;;;;;ACJA;;AAEA;AACA;AACA;AACA,YAAW,OAAO;AAClB,cAAa,QAAQ;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;ACbA;;AAEA;AACA;AACA;AACA,YAAW,OAAO;AAClB,YAAW,OAAO;AAClB,cAAa,OAAO;AACpB;AACA;AACA;AACA;AACA;AACA;;;;;;;ACbA;;AAEA;AACA;AACA;AACA;AACA,YAAW,QAAQ;AACnB;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;;;;;;;AClBA;;AAEA;;AAEA;AACA;AACA;AACA;AACA,YAAW,SAAS;AACpB;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,IAAG;;AAEH;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,IAAG;AACH;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAG;AACH;AACA;AACA;AACA;AACA;;AAEA;;;;;;;ACxDA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gCAA+B;AAC/B;AACA;AACA,YAAW,SAAS;AACpB,cAAa;AACb;AACA;AACA;AACA;AACA;AACA","file":"axios.js","sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"axios\"] = factory();\n\telse\n\t\troot[\"axios\"] = factory();\n})(this, function() {\nreturn \n\n\n// WEBPACK FOOTER //\n// webpack/universalModuleDefinition"," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId])\n \t\t\treturn installedModules[moduleId].exports;\n\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\texports: {},\n \t\t\tid: moduleId,\n \t\t\tloaded: false\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.loaded = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(0);\n\n\n\n// WEBPACK FOOTER //\n// webpack/bootstrap 65051a9b9bc6b3f02256","module.exports = require('./lib/axios');\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./index.js\n// module id = 0\n// module chunks = 0","'use strict';\n\nvar utils = require('./utils');\nvar bind = require('./helpers/bind');\nvar Axios = require('./core/Axios');\nvar defaults = require('./defaults');\n\n/**\n * Create an instance of Axios\n *\n * @param {Object} defaultConfig The default config for the instance\n * @return {Axios} A new instance of Axios\n */\nfunction createInstance(defaultConfig) {\n var context = new Axios(defaultConfig);\n var instance = bind(Axios.prototype.request, context);\n\n // Copy axios.prototype to instance\n utils.extend(instance, Axios.prototype, context);\n\n // Copy context to instance\n utils.extend(instance, context);\n\n return instance;\n}\n\n// Create the default instance to be exported\nvar axios = createInstance(defaults);\n\n// Expose Axios class to allow class inheritance\naxios.Axios = Axios;\n\n// Factory for creating new instances\naxios.create = function create(instanceConfig) {\n return createInstance(utils.merge(defaults, instanceConfig));\n};\n\n// Expose Cancel & CancelToken\naxios.Cancel = require('./cancel/Cancel');\naxios.CancelToken = require('./cancel/CancelToken');\naxios.isCancel = require('./cancel/isCancel');\n\n// Expose all/spread\naxios.all = function all(promises) {\n return Promise.all(promises);\n};\naxios.spread = require('./helpers/spread');\n\nmodule.exports = axios;\n\n// Allow use of default import syntax in TypeScript\nmodule.exports.default = axios;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/axios.js\n// module id = 1\n// module chunks = 0","'use strict';\n\nvar bind = require('./helpers/bind');\nvar isBuffer = require('is-buffer');\n\n/*global toString:true*/\n\n// utils is a library of generic helper functions non-specific to axios\n\nvar toString = Object.prototype.toString;\n\n/**\n * Determine if a value is an Array\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is an Array, otherwise false\n */\nfunction isArray(val) {\n return toString.call(val) === '[object Array]';\n}\n\n/**\n * Determine if a value is an ArrayBuffer\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is an ArrayBuffer, otherwise false\n */\nfunction isArrayBuffer(val) {\n return toString.call(val) === '[object ArrayBuffer]';\n}\n\n/**\n * Determine if a value is a FormData\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is an FormData, otherwise false\n */\nfunction isFormData(val) {\n return (typeof FormData !== 'undefined') && (val instanceof FormData);\n}\n\n/**\n * Determine if a value is a view on an ArrayBuffer\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a view on an ArrayBuffer, otherwise false\n */\nfunction isArrayBufferView(val) {\n var result;\n if ((typeof ArrayBuffer !== 'undefined') && (ArrayBuffer.isView)) {\n result = ArrayBuffer.isView(val);\n } else {\n result = (val) && (val.buffer) && (val.buffer instanceof ArrayBuffer);\n }\n return result;\n}\n\n/**\n * Determine if a value is a String\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a String, otherwise false\n */\nfunction isString(val) {\n return typeof val === 'string';\n}\n\n/**\n * Determine if a value is a Number\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Number, otherwise false\n */\nfunction isNumber(val) {\n return typeof val === 'number';\n}\n\n/**\n * Determine if a value is undefined\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if the value is undefined, otherwise false\n */\nfunction isUndefined(val) {\n return typeof val === 'undefined';\n}\n\n/**\n * Determine if a value is an Object\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is an Object, otherwise false\n */\nfunction isObject(val) {\n return val !== null && typeof val === 'object';\n}\n\n/**\n * Determine if a value is a Date\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Date, otherwise false\n */\nfunction isDate(val) {\n return toString.call(val) === '[object Date]';\n}\n\n/**\n * Determine if a value is a File\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a File, otherwise false\n */\nfunction isFile(val) {\n return toString.call(val) === '[object File]';\n}\n\n/**\n * Determine if a value is a Blob\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Blob, otherwise false\n */\nfunction isBlob(val) {\n return toString.call(val) === '[object Blob]';\n}\n\n/**\n * Determine if a value is a Function\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Function, otherwise false\n */\nfunction isFunction(val) {\n return toString.call(val) === '[object Function]';\n}\n\n/**\n * Determine if a value is a Stream\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Stream, otherwise false\n */\nfunction isStream(val) {\n return isObject(val) && isFunction(val.pipe);\n}\n\n/**\n * Determine if a value is a URLSearchParams object\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a URLSearchParams object, otherwise false\n */\nfunction isURLSearchParams(val) {\n return typeof URLSearchParams !== 'undefined' && val instanceof URLSearchParams;\n}\n\n/**\n * Trim excess whitespace off the beginning and end of a string\n *\n * @param {String} str The String to trim\n * @returns {String} The String freed of excess whitespace\n */\nfunction trim(str) {\n return str.replace(/^\\s*/, '').replace(/\\s*$/, '');\n}\n\n/**\n * Determine if we're running in a standard browser environment\n *\n * This allows axios to run in a web worker, and react-native.\n * Both environments support XMLHttpRequest, but not fully standard globals.\n *\n * web workers:\n * typeof window -> undefined\n * typeof document -> undefined\n *\n * react-native:\n * navigator.product -> 'ReactNative'\n */\nfunction isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && navigator.product === 'ReactNative') {\n return false;\n }\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined'\n );\n}\n\n/**\n * Iterate over an Array or an Object invoking a function for each item.\n *\n * If `obj` is an Array callback will be called passing\n * the value, index, and complete array for each item.\n *\n * If 'obj' is an Object callback will be called passing\n * the value, key, and complete object for each property.\n *\n * @param {Object|Array} obj The object to iterate\n * @param {Function} fn The callback to invoke for each item\n */\nfunction forEach(obj, fn) {\n // Don't bother if no value provided\n if (obj === null || typeof obj === 'undefined') {\n return;\n }\n\n // Force an array if not already something iterable\n if (typeof obj !== 'object') {\n /*eslint no-param-reassign:0*/\n obj = [obj];\n }\n\n if (isArray(obj)) {\n // Iterate over array values\n for (var i = 0, l = obj.length; i < l; i++) {\n fn.call(null, obj[i], i, obj);\n }\n } else {\n // Iterate over object keys\n for (var key in obj) {\n if (Object.prototype.hasOwnProperty.call(obj, key)) {\n fn.call(null, obj[key], key, obj);\n }\n }\n }\n}\n\n/**\n * Accepts varargs expecting each argument to be an object, then\n * immutably merges the properties of each object and returns result.\n *\n * When multiple objects contain the same key the later object in\n * the arguments list will take precedence.\n *\n * Example:\n *\n * ```js\n * var result = merge({foo: 123}, {foo: 456});\n * console.log(result.foo); // outputs 456\n * ```\n *\n * @param {Object} obj1 Object to merge\n * @returns {Object} Result of all merge properties\n */\nfunction merge(/* obj1, obj2, obj3, ... */) {\n var result = {};\n function assignValue(val, key) {\n if (typeof result[key] === 'object' && typeof val === 'object') {\n result[key] = merge(result[key], val);\n } else {\n result[key] = val;\n }\n }\n\n for (var i = 0, l = arguments.length; i < l; i++) {\n forEach(arguments[i], assignValue);\n }\n return result;\n}\n\n/**\n * Extends object a by mutably adding to it the properties of object b.\n *\n * @param {Object} a The object to be extended\n * @param {Object} b The object to copy properties from\n * @param {Object} thisArg The object to bind function to\n * @return {Object} The resulting value of object a\n */\nfunction extend(a, b, thisArg) {\n forEach(b, function assignValue(val, key) {\n if (thisArg && typeof val === 'function') {\n a[key] = bind(val, thisArg);\n } else {\n a[key] = val;\n }\n });\n return a;\n}\n\nmodule.exports = {\n isArray: isArray,\n isArrayBuffer: isArrayBuffer,\n isBuffer: isBuffer,\n isFormData: isFormData,\n isArrayBufferView: isArrayBufferView,\n isString: isString,\n isNumber: isNumber,\n isObject: isObject,\n isUndefined: isUndefined,\n isDate: isDate,\n isFile: isFile,\n isBlob: isBlob,\n isFunction: isFunction,\n isStream: isStream,\n isURLSearchParams: isURLSearchParams,\n isStandardBrowserEnv: isStandardBrowserEnv,\n forEach: forEach,\n merge: merge,\n extend: extend,\n trim: trim\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/utils.js\n// module id = 2\n// module chunks = 0","'use strict';\n\nmodule.exports = function bind(fn, thisArg) {\n return function wrap() {\n var args = new Array(arguments.length);\n for (var i = 0; i < args.length; i++) {\n args[i] = arguments[i];\n }\n return fn.apply(thisArg, args);\n };\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/helpers/bind.js\n// module id = 3\n// module chunks = 0","/*!\n * Determine if an object is a Buffer\n *\n * @author Feross Aboukhadijeh \n * @license MIT\n */\n\nmodule.exports = function isBuffer (obj) {\n return obj != null && obj.constructor != null &&\n typeof obj.constructor.isBuffer === 'function' && obj.constructor.isBuffer(obj)\n}\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/is-buffer/index.js\n// module id = 4\n// module chunks = 0","'use strict';\n\nvar defaults = require('./../defaults');\nvar utils = require('./../utils');\nvar InterceptorManager = require('./InterceptorManager');\nvar dispatchRequest = require('./dispatchRequest');\n\n/**\n * Create a new instance of Axios\n *\n * @param {Object} instanceConfig The default config for the instance\n */\nfunction Axios(instanceConfig) {\n this.defaults = instanceConfig;\n this.interceptors = {\n request: new InterceptorManager(),\n response: new InterceptorManager()\n };\n}\n\n/**\n * Dispatch a request\n *\n * @param {Object} config The config specific for this request (merged with this.defaults)\n */\nAxios.prototype.request = function request(config) {\n /*eslint no-param-reassign:0*/\n // Allow for axios('example/url'[, config]) a la fetch API\n if (typeof config === 'string') {\n config = utils.merge({\n url: arguments[0]\n }, arguments[1]);\n }\n\n config = utils.merge(defaults, {method: 'get'}, this.defaults, config);\n config.method = config.method.toLowerCase();\n\n // Hook up interceptors middleware\n var chain = [dispatchRequest, undefined];\n var promise = Promise.resolve(config);\n\n this.interceptors.request.forEach(function unshiftRequestInterceptors(interceptor) {\n chain.unshift(interceptor.fulfilled, interceptor.rejected);\n });\n\n this.interceptors.response.forEach(function pushResponseInterceptors(interceptor) {\n chain.push(interceptor.fulfilled, interceptor.rejected);\n });\n\n while (chain.length) {\n promise = promise.then(chain.shift(), chain.shift());\n }\n\n return promise;\n};\n\n// Provide aliases for supported request methods\nutils.forEach(['delete', 'get', 'head', 'options'], function forEachMethodNoData(method) {\n /*eslint func-names:0*/\n Axios.prototype[method] = function(url, config) {\n return this.request(utils.merge(config || {}, {\n method: method,\n url: url\n }));\n };\n});\n\nutils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {\n /*eslint func-names:0*/\n Axios.prototype[method] = function(url, data, config) {\n return this.request(utils.merge(config || {}, {\n method: method,\n url: url,\n data: data\n }));\n };\n});\n\nmodule.exports = Axios;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/core/Axios.js\n// module id = 5\n// module chunks = 0","'use strict';\n\nvar utils = require('./utils');\nvar normalizeHeaderName = require('./helpers/normalizeHeaderName');\n\nvar DEFAULT_CONTENT_TYPE = {\n 'Content-Type': 'application/x-www-form-urlencoded'\n};\n\nfunction setContentTypeIfUnset(headers, value) {\n if (!utils.isUndefined(headers) && utils.isUndefined(headers['Content-Type'])) {\n headers['Content-Type'] = value;\n }\n}\n\nfunction getDefaultAdapter() {\n var adapter;\n if (typeof XMLHttpRequest !== 'undefined') {\n // For browsers use XHR adapter\n adapter = require('./adapters/xhr');\n } else if (typeof process !== 'undefined') {\n // For node use HTTP adapter\n adapter = require('./adapters/http');\n }\n return adapter;\n}\n\nvar defaults = {\n adapter: getDefaultAdapter(),\n\n transformRequest: [function transformRequest(data, headers) {\n normalizeHeaderName(headers, 'Content-Type');\n if (utils.isFormData(data) ||\n utils.isArrayBuffer(data) ||\n utils.isBuffer(data) ||\n utils.isStream(data) ||\n utils.isFile(data) ||\n utils.isBlob(data)\n ) {\n return data;\n }\n if (utils.isArrayBufferView(data)) {\n return data.buffer;\n }\n if (utils.isURLSearchParams(data)) {\n setContentTypeIfUnset(headers, 'application/x-www-form-urlencoded;charset=utf-8');\n return data.toString();\n }\n if (utils.isObject(data)) {\n setContentTypeIfUnset(headers, 'application/json;charset=utf-8');\n return JSON.stringify(data);\n }\n return data;\n }],\n\n transformResponse: [function transformResponse(data) {\n /*eslint no-param-reassign:0*/\n if (typeof data === 'string') {\n try {\n data = JSON.parse(data);\n } catch (e) { /* Ignore */ }\n }\n return data;\n }],\n\n /**\n * A timeout in milliseconds to abort a request. If set to 0 (default) a\n * timeout is not created.\n */\n timeout: 0,\n\n xsrfCookieName: 'XSRF-TOKEN',\n xsrfHeaderName: 'X-XSRF-TOKEN',\n\n maxContentLength: -1,\n\n validateStatus: function validateStatus(status) {\n return status >= 200 && status < 300;\n }\n};\n\ndefaults.headers = {\n common: {\n 'Accept': 'application/json, text/plain, */*'\n }\n};\n\nutils.forEach(['delete', 'get', 'head'], function forEachMethodNoData(method) {\n defaults.headers[method] = {};\n});\n\nutils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {\n defaults.headers[method] = utils.merge(DEFAULT_CONTENT_TYPE);\n});\n\nmodule.exports = defaults;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/defaults.js\n// module id = 6\n// module chunks = 0","'use strict';\n\nvar utils = require('../utils');\n\nmodule.exports = function normalizeHeaderName(headers, normalizedName) {\n utils.forEach(headers, function processHeader(value, name) {\n if (name !== normalizedName && name.toUpperCase() === normalizedName.toUpperCase()) {\n headers[normalizedName] = value;\n delete headers[name];\n }\n });\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/helpers/normalizeHeaderName.js\n// module id = 7\n// module chunks = 0","'use strict';\n\nvar utils = require('./../utils');\nvar settle = require('./../core/settle');\nvar buildURL = require('./../helpers/buildURL');\nvar parseHeaders = require('./../helpers/parseHeaders');\nvar isURLSameOrigin = require('./../helpers/isURLSameOrigin');\nvar createError = require('../core/createError');\n\nmodule.exports = function xhrAdapter(config) {\n return new Promise(function dispatchXhrRequest(resolve, reject) {\n var requestData = config.data;\n var requestHeaders = config.headers;\n\n if (utils.isFormData(requestData)) {\n delete requestHeaders['Content-Type']; // Let the browser set it\n }\n\n var request = new XMLHttpRequest();\n\n // HTTP basic authentication\n if (config.auth) {\n var username = config.auth.username || '';\n var password = config.auth.password || '';\n requestHeaders.Authorization = 'Basic ' + btoa(username + ':' + password);\n }\n\n request.open(config.method.toUpperCase(), buildURL(config.url, config.params, config.paramsSerializer), true);\n\n // Set the request timeout in MS\n request.timeout = config.timeout;\n\n // Listen for ready state\n request.onreadystatechange = function handleLoad() {\n if (!request || request.readyState !== 4) {\n return;\n }\n\n // The request errored out and we didn't get a response, this will be\n // handled by onerror instead\n // With one exception: request that using file: protocol, most browsers\n // will return status as 0 even though it's a successful request\n if (request.status === 0 && !(request.responseURL && request.responseURL.indexOf('file:') === 0)) {\n return;\n }\n\n // Prepare the response\n var responseHeaders = 'getAllResponseHeaders' in request ? parseHeaders(request.getAllResponseHeaders()) : null;\n var responseData = !config.responseType || config.responseType === 'text' ? request.responseText : request.response;\n var response = {\n data: responseData,\n status: request.status,\n statusText: request.statusText,\n headers: responseHeaders,\n config: config,\n request: request\n };\n\n settle(resolve, reject, response);\n\n // Clean up request\n request = null;\n };\n\n // Handle low level network errors\n request.onerror = function handleError() {\n // Real errors are hidden from us by the browser\n // onerror should only fire if it's a network error\n reject(createError('Network Error', config, null, request));\n\n // Clean up request\n request = null;\n };\n\n // Handle timeout\n request.ontimeout = function handleTimeout() {\n reject(createError('timeout of ' + config.timeout + 'ms exceeded', config, 'ECONNABORTED',\n request));\n\n // Clean up request\n request = null;\n };\n\n // Add xsrf header\n // This is only done if running in a standard browser environment.\n // Specifically not if we're in a web worker, or react-native.\n if (utils.isStandardBrowserEnv()) {\n var cookies = require('./../helpers/cookies');\n\n // Add xsrf header\n var xsrfValue = (config.withCredentials || isURLSameOrigin(config.url)) && config.xsrfCookieName ?\n cookies.read(config.xsrfCookieName) :\n undefined;\n\n if (xsrfValue) {\n requestHeaders[config.xsrfHeaderName] = xsrfValue;\n }\n }\n\n // Add headers to the request\n if ('setRequestHeader' in request) {\n utils.forEach(requestHeaders, function setRequestHeader(val, key) {\n if (typeof requestData === 'undefined' && key.toLowerCase() === 'content-type') {\n // Remove Content-Type if data is undefined\n delete requestHeaders[key];\n } else {\n // Otherwise add header to the request\n request.setRequestHeader(key, val);\n }\n });\n }\n\n // Add withCredentials to request if needed\n if (config.withCredentials) {\n request.withCredentials = true;\n }\n\n // Add responseType to request if needed\n if (config.responseType) {\n try {\n request.responseType = config.responseType;\n } catch (e) {\n // Expected DOMException thrown by browsers not compatible XMLHttpRequest Level 2.\n // But, this can be suppressed for 'json' type as it can be parsed by default 'transformResponse' function.\n if (config.responseType !== 'json') {\n throw e;\n }\n }\n }\n\n // Handle progress if needed\n if (typeof config.onDownloadProgress === 'function') {\n request.addEventListener('progress', config.onDownloadProgress);\n }\n\n // Not all browsers support upload events\n if (typeof config.onUploadProgress === 'function' && request.upload) {\n request.upload.addEventListener('progress', config.onUploadProgress);\n }\n\n if (config.cancelToken) {\n // Handle cancellation\n config.cancelToken.promise.then(function onCanceled(cancel) {\n if (!request) {\n return;\n }\n\n request.abort();\n reject(cancel);\n // Clean up request\n request = null;\n });\n }\n\n if (requestData === undefined) {\n requestData = null;\n }\n\n // Send the request\n request.send(requestData);\n });\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/adapters/xhr.js\n// module id = 8\n// module chunks = 0","'use strict';\n\nvar createError = require('./createError');\n\n/**\n * Resolve or reject a Promise based on response status.\n *\n * @param {Function} resolve A function that resolves the promise.\n * @param {Function} reject A function that rejects the promise.\n * @param {object} response The response.\n */\nmodule.exports = function settle(resolve, reject, response) {\n var validateStatus = response.config.validateStatus;\n // Note: status is not exposed by XDomainRequest\n if (!response.status || !validateStatus || validateStatus(response.status)) {\n resolve(response);\n } else {\n reject(createError(\n 'Request failed with status code ' + response.status,\n response.config,\n null,\n response.request,\n response\n ));\n }\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/core/settle.js\n// module id = 9\n// module chunks = 0","'use strict';\n\nvar enhanceError = require('./enhanceError');\n\n/**\n * Create an Error with the specified message, config, error code, request and response.\n *\n * @param {string} message The error message.\n * @param {Object} config The config.\n * @param {string} [code] The error code (for example, 'ECONNABORTED').\n * @param {Object} [request] The request.\n * @param {Object} [response] The response.\n * @returns {Error} The created error.\n */\nmodule.exports = function createError(message, config, code, request, response) {\n var error = new Error(message);\n return enhanceError(error, config, code, request, response);\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/core/createError.js\n// module id = 10\n// module chunks = 0","'use strict';\n\n/**\n * Update an Error with the specified config, error code, and response.\n *\n * @param {Error} error The error to update.\n * @param {Object} config The config.\n * @param {string} [code] The error code (for example, 'ECONNABORTED').\n * @param {Object} [request] The request.\n * @param {Object} [response] The response.\n * @returns {Error} The error.\n */\nmodule.exports = function enhanceError(error, config, code, request, response) {\n error.config = config;\n if (code) {\n error.code = code;\n }\n error.request = request;\n error.response = response;\n return error;\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/core/enhanceError.js\n// module id = 11\n// module chunks = 0","'use strict';\n\nvar utils = require('./../utils');\n\nfunction encode(val) {\n return encodeURIComponent(val).\n replace(/%40/gi, '@').\n replace(/%3A/gi, ':').\n replace(/%24/g, '$').\n replace(/%2C/gi, ',').\n replace(/%20/g, '+').\n replace(/%5B/gi, '[').\n replace(/%5D/gi, ']');\n}\n\n/**\n * Build a URL by appending params to the end\n *\n * @param {string} url The base of the url (e.g., http://www.google.com)\n * @param {object} [params] The params to be appended\n * @returns {string} The formatted url\n */\nmodule.exports = function buildURL(url, params, paramsSerializer) {\n /*eslint no-param-reassign:0*/\n if (!params) {\n return url;\n }\n\n var serializedParams;\n if (paramsSerializer) {\n serializedParams = paramsSerializer(params);\n } else if (utils.isURLSearchParams(params)) {\n serializedParams = params.toString();\n } else {\n var parts = [];\n\n utils.forEach(params, function serialize(val, key) {\n if (val === null || typeof val === 'undefined') {\n return;\n }\n\n if (utils.isArray(val)) {\n key = key + '[]';\n } else {\n val = [val];\n }\n\n utils.forEach(val, function parseValue(v) {\n if (utils.isDate(v)) {\n v = v.toISOString();\n } else if (utils.isObject(v)) {\n v = JSON.stringify(v);\n }\n parts.push(encode(key) + '=' + encode(v));\n });\n });\n\n serializedParams = parts.join('&');\n }\n\n if (serializedParams) {\n url += (url.indexOf('?') === -1 ? '?' : '&') + serializedParams;\n }\n\n return url;\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/helpers/buildURL.js\n// module id = 12\n// module chunks = 0","'use strict';\n\nvar utils = require('./../utils');\n\n// Headers whose duplicates are ignored by node\n// c.f. https://nodejs.org/api/http.html#http_message_headers\nvar ignoreDuplicateOf = [\n 'age', 'authorization', 'content-length', 'content-type', 'etag',\n 'expires', 'from', 'host', 'if-modified-since', 'if-unmodified-since',\n 'last-modified', 'location', 'max-forwards', 'proxy-authorization',\n 'referer', 'retry-after', 'user-agent'\n];\n\n/**\n * Parse headers into an object\n *\n * ```\n * Date: Wed, 27 Aug 2014 08:58:49 GMT\n * Content-Type: application/json\n * Connection: keep-alive\n * Transfer-Encoding: chunked\n * ```\n *\n * @param {String} headers Headers needing to be parsed\n * @returns {Object} Headers parsed into an object\n */\nmodule.exports = function parseHeaders(headers) {\n var parsed = {};\n var key;\n var val;\n var i;\n\n if (!headers) { return parsed; }\n\n utils.forEach(headers.split('\\n'), function parser(line) {\n i = line.indexOf(':');\n key = utils.trim(line.substr(0, i)).toLowerCase();\n val = utils.trim(line.substr(i + 1));\n\n if (key) {\n if (parsed[key] && ignoreDuplicateOf.indexOf(key) >= 0) {\n return;\n }\n if (key === 'set-cookie') {\n parsed[key] = (parsed[key] ? parsed[key] : []).concat([val]);\n } else {\n parsed[key] = parsed[key] ? parsed[key] + ', ' + val : val;\n }\n }\n });\n\n return parsed;\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/helpers/parseHeaders.js\n// module id = 13\n// module chunks = 0","'use strict';\n\nvar utils = require('./../utils');\n\nmodule.exports = (\n utils.isStandardBrowserEnv() ?\n\n // Standard browser envs have full support of the APIs needed to test\n // whether the request URL is of the same origin as current location.\n (function standardBrowserEnv() {\n var msie = /(msie|trident)/i.test(navigator.userAgent);\n var urlParsingNode = document.createElement('a');\n var originURL;\n\n /**\n * Parse a URL to discover it's components\n *\n * @param {String} url The URL to be parsed\n * @returns {Object}\n */\n function resolveURL(url) {\n var href = url;\n\n if (msie) {\n // IE needs attribute set twice to normalize properties\n urlParsingNode.setAttribute('href', href);\n href = urlParsingNode.href;\n }\n\n urlParsingNode.setAttribute('href', href);\n\n // urlParsingNode provides the UrlUtils interface - http://url.spec.whatwg.org/#urlutils\n return {\n href: urlParsingNode.href,\n protocol: urlParsingNode.protocol ? urlParsingNode.protocol.replace(/:$/, '') : '',\n host: urlParsingNode.host,\n search: urlParsingNode.search ? urlParsingNode.search.replace(/^\\?/, '') : '',\n hash: urlParsingNode.hash ? urlParsingNode.hash.replace(/^#/, '') : '',\n hostname: urlParsingNode.hostname,\n port: urlParsingNode.port,\n pathname: (urlParsingNode.pathname.charAt(0) === '/') ?\n urlParsingNode.pathname :\n '/' + urlParsingNode.pathname\n };\n }\n\n originURL = resolveURL(window.location.href);\n\n /**\n * Determine if a URL shares the same origin as the current location\n *\n * @param {String} requestURL The URL to test\n * @returns {boolean} True if URL shares the same origin, otherwise false\n */\n return function isURLSameOrigin(requestURL) {\n var parsed = (utils.isString(requestURL)) ? resolveURL(requestURL) : requestURL;\n return (parsed.protocol === originURL.protocol &&\n parsed.host === originURL.host);\n };\n })() :\n\n // Non standard browser envs (web workers, react-native) lack needed support.\n (function nonStandardBrowserEnv() {\n return function isURLSameOrigin() {\n return true;\n };\n })()\n);\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/helpers/isURLSameOrigin.js\n// module id = 14\n// module chunks = 0","'use strict';\n\nvar utils = require('./../utils');\n\nmodule.exports = (\n utils.isStandardBrowserEnv() ?\n\n // Standard browser envs support document.cookie\n (function standardBrowserEnv() {\n return {\n write: function write(name, value, expires, path, domain, secure) {\n var cookie = [];\n cookie.push(name + '=' + encodeURIComponent(value));\n\n if (utils.isNumber(expires)) {\n cookie.push('expires=' + new Date(expires).toGMTString());\n }\n\n if (utils.isString(path)) {\n cookie.push('path=' + path);\n }\n\n if (utils.isString(domain)) {\n cookie.push('domain=' + domain);\n }\n\n if (secure === true) {\n cookie.push('secure');\n }\n\n document.cookie = cookie.join('; ');\n },\n\n read: function read(name) {\n var match = document.cookie.match(new RegExp('(^|;\\\\s*)(' + name + ')=([^;]*)'));\n return (match ? decodeURIComponent(match[3]) : null);\n },\n\n remove: function remove(name) {\n this.write(name, '', Date.now() - 86400000);\n }\n };\n })() :\n\n // Non standard browser env (web workers, react-native) lack needed support.\n (function nonStandardBrowserEnv() {\n return {\n write: function write() {},\n read: function read() { return null; },\n remove: function remove() {}\n };\n })()\n);\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/helpers/cookies.js\n// module id = 15\n// module chunks = 0","'use strict';\n\nvar utils = require('./../utils');\n\nfunction InterceptorManager() {\n this.handlers = [];\n}\n\n/**\n * Add a new interceptor to the stack\n *\n * @param {Function} fulfilled The function to handle `then` for a `Promise`\n * @param {Function} rejected The function to handle `reject` for a `Promise`\n *\n * @return {Number} An ID used to remove interceptor later\n */\nInterceptorManager.prototype.use = function use(fulfilled, rejected) {\n this.handlers.push({\n fulfilled: fulfilled,\n rejected: rejected\n });\n return this.handlers.length - 1;\n};\n\n/**\n * Remove an interceptor from the stack\n *\n * @param {Number} id The ID that was returned by `use`\n */\nInterceptorManager.prototype.eject = function eject(id) {\n if (this.handlers[id]) {\n this.handlers[id] = null;\n }\n};\n\n/**\n * Iterate over all the registered interceptors\n *\n * This method is particularly useful for skipping over any\n * interceptors that may have become `null` calling `eject`.\n *\n * @param {Function} fn The function to call for each interceptor\n */\nInterceptorManager.prototype.forEach = function forEach(fn) {\n utils.forEach(this.handlers, function forEachHandler(h) {\n if (h !== null) {\n fn(h);\n }\n });\n};\n\nmodule.exports = InterceptorManager;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/core/InterceptorManager.js\n// module id = 16\n// module chunks = 0","'use strict';\n\nvar utils = require('./../utils');\nvar transformData = require('./transformData');\nvar isCancel = require('../cancel/isCancel');\nvar defaults = require('../defaults');\nvar isAbsoluteURL = require('./../helpers/isAbsoluteURL');\nvar combineURLs = require('./../helpers/combineURLs');\n\n/**\n * Throws a `Cancel` if cancellation has been requested.\n */\nfunction throwIfCancellationRequested(config) {\n if (config.cancelToken) {\n config.cancelToken.throwIfRequested();\n }\n}\n\n/**\n * Dispatch a request to the server using the configured adapter.\n *\n * @param {object} config The config that is to be used for the request\n * @returns {Promise} The Promise to be fulfilled\n */\nmodule.exports = function dispatchRequest(config) {\n throwIfCancellationRequested(config);\n\n // Support baseURL config\n if (config.baseURL && !isAbsoluteURL(config.url)) {\n config.url = combineURLs(config.baseURL, config.url);\n }\n\n // Ensure headers exist\n config.headers = config.headers || {};\n\n // Transform request data\n config.data = transformData(\n config.data,\n config.headers,\n config.transformRequest\n );\n\n // Flatten headers\n config.headers = utils.merge(\n config.headers.common || {},\n config.headers[config.method] || {},\n config.headers || {}\n );\n\n utils.forEach(\n ['delete', 'get', 'head', 'post', 'put', 'patch', 'common'],\n function cleanHeaderConfig(method) {\n delete config.headers[method];\n }\n );\n\n var adapter = config.adapter || defaults.adapter;\n\n return adapter(config).then(function onAdapterResolution(response) {\n throwIfCancellationRequested(config);\n\n // Transform response data\n response.data = transformData(\n response.data,\n response.headers,\n config.transformResponse\n );\n\n return response;\n }, function onAdapterRejection(reason) {\n if (!isCancel(reason)) {\n throwIfCancellationRequested(config);\n\n // Transform response data\n if (reason && reason.response) {\n reason.response.data = transformData(\n reason.response.data,\n reason.response.headers,\n config.transformResponse\n );\n }\n }\n\n return Promise.reject(reason);\n });\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/core/dispatchRequest.js\n// module id = 17\n// module chunks = 0","'use strict';\n\nvar utils = require('./../utils');\n\n/**\n * Transform the data for a request or a response\n *\n * @param {Object|String} data The data to be transformed\n * @param {Array} headers The headers for the request or response\n * @param {Array|Function} fns A single function or Array of functions\n * @returns {*} The resulting transformed data\n */\nmodule.exports = function transformData(data, headers, fns) {\n /*eslint no-param-reassign:0*/\n utils.forEach(fns, function transform(fn) {\n data = fn(data, headers);\n });\n\n return data;\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/core/transformData.js\n// module id = 18\n// module chunks = 0","'use strict';\n\nmodule.exports = function isCancel(value) {\n return !!(value && value.__CANCEL__);\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/cancel/isCancel.js\n// module id = 19\n// module chunks = 0","'use strict';\n\n/**\n * Determines whether the specified URL is absolute\n *\n * @param {string} url The URL to test\n * @returns {boolean} True if the specified URL is absolute, otherwise false\n */\nmodule.exports = function isAbsoluteURL(url) {\n // A URL is considered absolute if it begins with \"://\" or \"//\" (protocol-relative URL).\n // RFC 3986 defines scheme name as a sequence of characters beginning with a letter and followed\n // by any combination of letters, digits, plus, period, or hyphen.\n return /^([a-z][a-z\\d\\+\\-\\.]*:)?\\/\\//i.test(url);\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/helpers/isAbsoluteURL.js\n// module id = 20\n// module chunks = 0","'use strict';\n\n/**\n * Creates a new URL by combining the specified URLs\n *\n * @param {string} baseURL The base URL\n * @param {string} relativeURL The relative URL\n * @returns {string} The combined URL\n */\nmodule.exports = function combineURLs(baseURL, relativeURL) {\n return relativeURL\n ? baseURL.replace(/\\/+$/, '') + '/' + relativeURL.replace(/^\\/+/, '')\n : baseURL;\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/helpers/combineURLs.js\n// module id = 21\n// module chunks = 0","'use strict';\n\n/**\n * A `Cancel` is an object that is thrown when an operation is canceled.\n *\n * @class\n * @param {string=} message The message.\n */\nfunction Cancel(message) {\n this.message = message;\n}\n\nCancel.prototype.toString = function toString() {\n return 'Cancel' + (this.message ? ': ' + this.message : '');\n};\n\nCancel.prototype.__CANCEL__ = true;\n\nmodule.exports = Cancel;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/cancel/Cancel.js\n// module id = 22\n// module chunks = 0","'use strict';\n\nvar Cancel = require('./Cancel');\n\n/**\n * A `CancelToken` is an object that can be used to request cancellation of an operation.\n *\n * @class\n * @param {Function} executor The executor function.\n */\nfunction CancelToken(executor) {\n if (typeof executor !== 'function') {\n throw new TypeError('executor must be a function.');\n }\n\n var resolvePromise;\n this.promise = new Promise(function promiseExecutor(resolve) {\n resolvePromise = resolve;\n });\n\n var token = this;\n executor(function cancel(message) {\n if (token.reason) {\n // Cancellation has already been requested\n return;\n }\n\n token.reason = new Cancel(message);\n resolvePromise(token.reason);\n });\n}\n\n/**\n * Throws a `Cancel` if cancellation has been requested.\n */\nCancelToken.prototype.throwIfRequested = function throwIfRequested() {\n if (this.reason) {\n throw this.reason;\n }\n};\n\n/**\n * Returns an object that contains a new `CancelToken` and a function that, when called,\n * cancels the `CancelToken`.\n */\nCancelToken.source = function source() {\n var cancel;\n var token = new CancelToken(function executor(c) {\n cancel = c;\n });\n return {\n token: token,\n cancel: cancel\n };\n};\n\nmodule.exports = CancelToken;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/cancel/CancelToken.js\n// module id = 23\n// module chunks = 0","'use strict';\n\n/**\n * Syntactic sugar for invoking a function and expanding an array for arguments.\n *\n * Common use case would be to use `Function.prototype.apply`.\n *\n * ```js\n * function f(x, y, z) {}\n * var args = [1, 2, 3];\n * f.apply(null, args);\n * ```\n *\n * With `spread` this example can be re-written.\n *\n * ```js\n * spread(function(x, y, z) {})([1, 2, 3]);\n * ```\n *\n * @param {Function} callback\n * @returns {Function}\n */\nmodule.exports = function spread(callback) {\n return function wrap(arr) {\n return callback.apply(null, arr);\n };\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/helpers/spread.js\n// module id = 24\n// module chunks = 0"],"sourceRoot":""} \ No newline at end of file diff --git a/webpage/dist/axios.min.js b/webpage/dist/axios.min.js new file mode 100644 index 0000000..c7b4b0d --- /dev/null +++ b/webpage/dist/axios.min.js @@ -0,0 +1,9 @@ +/* axios v0.18.1 | (c) 2019 by Matt Zabriskie */ +!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.axios=t():e.axios=t()}(this,function(){return function(e){function t(r){if(n[r])return n[r].exports;var o=n[r]={exports:{},id:r,loaded:!1};return e[r].call(o.exports,o,o.exports,t),o.loaded=!0,o.exports}var n={};return t.m=e,t.c=n,t.p="",t(0)}([function(e,t,n){e.exports=n(1)},function(e,t,n){"use strict";function r(e){var t=new i(e),n=s(i.prototype.request,t);return o.extend(n,i.prototype,t),o.extend(n,t),n}var o=n(2),s=n(3),i=n(5),u=n(6),a=r(u);a.Axios=i,a.create=function(e){return r(o.merge(u,e))},a.Cancel=n(22),a.CancelToken=n(23),a.isCancel=n(19),a.all=function(e){return Promise.all(e)},a.spread=n(24),e.exports=a,e.exports.default=a},function(e,t,n){"use strict";function r(e){return"[object Array]"===R.call(e)}function o(e){return"[object ArrayBuffer]"===R.call(e)}function s(e){return"undefined"!=typeof FormData&&e instanceof FormData}function i(e){var t;return t="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&e.buffer instanceof ArrayBuffer}function u(e){return"string"==typeof e}function a(e){return"number"==typeof e}function c(e){return"undefined"==typeof e}function f(e){return null!==e&&"object"==typeof e}function p(e){return"[object Date]"===R.call(e)}function d(e){return"[object File]"===R.call(e)}function l(e){return"[object Blob]"===R.call(e)}function h(e){return"[object Function]"===R.call(e)}function m(e){return f(e)&&h(e.pipe)}function y(e){return"undefined"!=typeof URLSearchParams&&e instanceof URLSearchParams}function g(e){return e.replace(/^\s*/,"").replace(/\s*$/,"")}function x(){return("undefined"==typeof navigator||"ReactNative"!==navigator.product)&&("undefined"!=typeof window&&"undefined"!=typeof document)}function v(e,t){if(null!==e&&"undefined"!=typeof e)if("object"!=typeof e&&(e=[e]),r(e))for(var n=0,o=e.length;n + * @license MIT + */ +e.exports=function(e){return null!=e&&null!=e.constructor&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)}},function(e,t,n){"use strict";function r(e){this.defaults=e,this.interceptors={request:new i,response:new i}}var o=n(6),s=n(2),i=n(16),u=n(17);r.prototype.request=function(e){"string"==typeof e&&(e=s.merge({url:arguments[0]},arguments[1])),e=s.merge(o,{method:"get"},this.defaults,e),e.method=e.method.toLowerCase();var t=[u,void 0],n=Promise.resolve(e);for(this.interceptors.request.forEach(function(e){t.unshift(e.fulfilled,e.rejected)}),this.interceptors.response.forEach(function(e){t.push(e.fulfilled,e.rejected)});t.length;)n=n.then(t.shift(),t.shift());return n},s.forEach(["delete","get","head","options"],function(e){r.prototype[e]=function(t,n){return this.request(s.merge(n||{},{method:e,url:t}))}}),s.forEach(["post","put","patch"],function(e){r.prototype[e]=function(t,n,r){return this.request(s.merge(r||{},{method:e,url:t,data:n}))}}),e.exports=r},function(e,t,n){"use strict";function r(e,t){!s.isUndefined(e)&&s.isUndefined(e["Content-Type"])&&(e["Content-Type"]=t)}function o(){var e;return"undefined"!=typeof XMLHttpRequest?e=n(8):"undefined"!=typeof process&&(e=n(8)),e}var s=n(2),i=n(7),u={"Content-Type":"application/x-www-form-urlencoded"},a={adapter:o(),transformRequest:[function(e,t){return i(t,"Content-Type"),s.isFormData(e)||s.isArrayBuffer(e)||s.isBuffer(e)||s.isStream(e)||s.isFile(e)||s.isBlob(e)?e:s.isArrayBufferView(e)?e.buffer:s.isURLSearchParams(e)?(r(t,"application/x-www-form-urlencoded;charset=utf-8"),e.toString()):s.isObject(e)?(r(t,"application/json;charset=utf-8"),JSON.stringify(e)):e}],transformResponse:[function(e){if("string"==typeof e)try{e=JSON.parse(e)}catch(e){}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,validateStatus:function(e){return e>=200&&e<300}};a.headers={common:{Accept:"application/json, text/plain, */*"}},s.forEach(["delete","get","head"],function(e){a.headers[e]={}}),s.forEach(["post","put","patch"],function(e){a.headers[e]=s.merge(u)}),e.exports=a},function(e,t,n){"use strict";var r=n(2);e.exports=function(e,t){r.forEach(e,function(n,r){r!==t&&r.toUpperCase()===t.toUpperCase()&&(e[t]=n,delete e[r])})}},function(e,t,n){"use strict";var r=n(2),o=n(9),s=n(12),i=n(13),u=n(14),a=n(10);e.exports=function(e){return new Promise(function(t,c){var f=e.data,p=e.headers;r.isFormData(f)&&delete p["Content-Type"];var d=new XMLHttpRequest;if(e.auth){var l=e.auth.username||"",h=e.auth.password||"";p.Authorization="Basic "+btoa(l+":"+h)}if(d.open(e.method.toUpperCase(),s(e.url,e.params,e.paramsSerializer),!0),d.timeout=e.timeout,d.onreadystatechange=function(){if(d&&4===d.readyState&&(0!==d.status||d.responseURL&&0===d.responseURL.indexOf("file:"))){var n="getAllResponseHeaders"in d?i(d.getAllResponseHeaders()):null,r=e.responseType&&"text"!==e.responseType?d.response:d.responseText,s={data:r,status:d.status,statusText:d.statusText,headers:n,config:e,request:d};o(t,c,s),d=null}},d.onerror=function(){c(a("Network Error",e,null,d)),d=null},d.ontimeout=function(){c(a("timeout of "+e.timeout+"ms exceeded",e,"ECONNABORTED",d)),d=null},r.isStandardBrowserEnv()){var m=n(15),y=(e.withCredentials||u(e.url))&&e.xsrfCookieName?m.read(e.xsrfCookieName):void 0;y&&(p[e.xsrfHeaderName]=y)}if("setRequestHeader"in d&&r.forEach(p,function(e,t){"undefined"==typeof f&&"content-type"===t.toLowerCase()?delete p[t]:d.setRequestHeader(t,e)}),e.withCredentials&&(d.withCredentials=!0),e.responseType)try{d.responseType=e.responseType}catch(t){if("json"!==e.responseType)throw t}"function"==typeof e.onDownloadProgress&&d.addEventListener("progress",e.onDownloadProgress),"function"==typeof e.onUploadProgress&&d.upload&&d.upload.addEventListener("progress",e.onUploadProgress),e.cancelToken&&e.cancelToken.promise.then(function(e){d&&(d.abort(),c(e),d=null)}),void 0===f&&(f=null),d.send(f)})}},function(e,t,n){"use strict";var r=n(10);e.exports=function(e,t,n){var o=n.config.validateStatus;n.status&&o&&!o(n.status)?t(r("Request failed with status code "+n.status,n.config,null,n.request,n)):e(n)}},function(e,t,n){"use strict";var r=n(11);e.exports=function(e,t,n,o,s){var i=new Error(e);return r(i,t,n,o,s)}},function(e,t){"use strict";e.exports=function(e,t,n,r,o){return e.config=t,n&&(e.code=n),e.request=r,e.response=o,e}},function(e,t,n){"use strict";function r(e){return encodeURIComponent(e).replace(/%40/gi,"@").replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}var o=n(2);e.exports=function(e,t,n){if(!t)return e;var s;if(n)s=n(t);else if(o.isURLSearchParams(t))s=t.toString();else{var i=[];o.forEach(t,function(e,t){null!==e&&"undefined"!=typeof e&&(o.isArray(e)?t+="[]":e=[e],o.forEach(e,function(e){o.isDate(e)?e=e.toISOString():o.isObject(e)&&(e=JSON.stringify(e)),i.push(r(t)+"="+r(e))}))}),s=i.join("&")}return s&&(e+=(e.indexOf("?")===-1?"?":"&")+s),e}},function(e,t,n){"use strict";var r=n(2),o=["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"];e.exports=function(e){var t,n,s,i={};return e?(r.forEach(e.split("\n"),function(e){if(s=e.indexOf(":"),t=r.trim(e.substr(0,s)).toLowerCase(),n=r.trim(e.substr(s+1)),t){if(i[t]&&o.indexOf(t)>=0)return;"set-cookie"===t?i[t]=(i[t]?i[t]:[]).concat([n]):i[t]=i[t]?i[t]+", "+n:n}}),i):i}},function(e,t,n){"use strict";var r=n(2);e.exports=r.isStandardBrowserEnv()?function(){function e(e){var t=e;return n&&(o.setAttribute("href",t),t=o.href),o.setAttribute("href",t),{href:o.href,protocol:o.protocol?o.protocol.replace(/:$/,""):"",host:o.host,search:o.search?o.search.replace(/^\?/,""):"",hash:o.hash?o.hash.replace(/^#/,""):"",hostname:o.hostname,port:o.port,pathname:"/"===o.pathname.charAt(0)?o.pathname:"/"+o.pathname}}var t,n=/(msie|trident)/i.test(navigator.userAgent),o=document.createElement("a");return t=e(window.location.href),function(n){var o=r.isString(n)?e(n):n;return o.protocol===t.protocol&&o.host===t.host}}():function(){return function(){return!0}}()},function(e,t,n){"use strict";var r=n(2);e.exports=r.isStandardBrowserEnv()?function(){return{write:function(e,t,n,o,s,i){var u=[];u.push(e+"="+encodeURIComponent(t)),r.isNumber(n)&&u.push("expires="+new Date(n).toGMTString()),r.isString(o)&&u.push("path="+o),r.isString(s)&&u.push("domain="+s),i===!0&&u.push("secure"),document.cookie=u.join("; ")},read:function(e){var t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove:function(e){this.write(e,"",Date.now()-864e5)}}}():function(){return{write:function(){},read:function(){return null},remove:function(){}}}()},function(e,t,n){"use strict";function r(){this.handlers=[]}var o=n(2);r.prototype.use=function(e,t){return this.handlers.push({fulfilled:e,rejected:t}),this.handlers.length-1},r.prototype.eject=function(e){this.handlers[e]&&(this.handlers[e]=null)},r.prototype.forEach=function(e){o.forEach(this.handlers,function(t){null!==t&&e(t)})},e.exports=r},function(e,t,n){"use strict";function r(e){e.cancelToken&&e.cancelToken.throwIfRequested()}var o=n(2),s=n(18),i=n(19),u=n(6),a=n(20),c=n(21);e.exports=function(e){r(e),e.baseURL&&!a(e.url)&&(e.url=c(e.baseURL,e.url)),e.headers=e.headers||{},e.data=s(e.data,e.headers,e.transformRequest),e.headers=o.merge(e.headers.common||{},e.headers[e.method]||{},e.headers||{}),o.forEach(["delete","get","head","post","put","patch","common"],function(t){delete e.headers[t]});var t=e.adapter||u.adapter;return t(e).then(function(t){return r(e),t.data=s(t.data,t.headers,e.transformResponse),t},function(t){return i(t)||(r(e),t&&t.response&&(t.response.data=s(t.response.data,t.response.headers,e.transformResponse))),Promise.reject(t)})}},function(e,t,n){"use strict";var r=n(2);e.exports=function(e,t,n){return r.forEach(n,function(n){e=n(e,t)}),e}},function(e,t){"use strict";e.exports=function(e){return!(!e||!e.__CANCEL__)}},function(e,t){"use strict";e.exports=function(e){return/^([a-z][a-z\d\+\-\.]*:)?\/\//i.test(e)}},function(e,t){"use strict";e.exports=function(e,t){return t?e.replace(/\/+$/,"")+"/"+t.replace(/^\/+/,""):e}},function(e,t){"use strict";function n(e){this.message=e}n.prototype.toString=function(){return"Cancel"+(this.message?": "+this.message:"")},n.prototype.__CANCEL__=!0,e.exports=n},function(e,t,n){"use strict";function r(e){if("function"!=typeof e)throw new TypeError("executor must be a function.");var t;this.promise=new Promise(function(e){t=e});var n=this;e(function(e){n.reason||(n.reason=new o(e),t(n.reason))})}var o=n(22);r.prototype.throwIfRequested=function(){if(this.reason)throw this.reason},r.source=function(){var e,t=new r(function(t){e=t});return{token:t,cancel:e}},e.exports=r},function(e,t){"use strict";e.exports=function(e){return function(t){return e.apply(null,t)}}}])}); +//# sourceMappingURL=axios.min.map \ No newline at end of file diff --git a/webpage/dist/axios.min.map b/webpage/dist/axios.min.map new file mode 100644 index 0000000..f1616a9 --- /dev/null +++ b/webpage/dist/axios.min.map @@ -0,0 +1 @@ +{"version":3,"sources":["webpack:///webpack/universalModuleDefinition","webpack:///axios.min.js","webpack:///webpack/bootstrap 8949187259fb54f91ce7","webpack:///./index.js","webpack:///./lib/axios.js","webpack:///./lib/utils.js","webpack:///./lib/helpers/bind.js","webpack:///./~/is-buffer/index.js","webpack:///./lib/core/Axios.js","webpack:///./lib/defaults.js","webpack:///./lib/helpers/normalizeHeaderName.js","webpack:///./lib/adapters/xhr.js","webpack:///./lib/core/settle.js","webpack:///./lib/core/createError.js","webpack:///./lib/core/enhanceError.js","webpack:///./lib/helpers/buildURL.js","webpack:///./lib/helpers/parseHeaders.js","webpack:///./lib/helpers/isURLSameOrigin.js","webpack:///./lib/helpers/cookies.js","webpack:///./lib/core/InterceptorManager.js","webpack:///./lib/core/dispatchRequest.js","webpack:///./lib/core/transformData.js","webpack:///./lib/cancel/isCancel.js","webpack:///./lib/helpers/isAbsoluteURL.js","webpack:///./lib/helpers/combineURLs.js","webpack:///./lib/cancel/Cancel.js","webpack:///./lib/cancel/CancelToken.js","webpack:///./lib/helpers/spread.js"],"names":["root","factory","exports","module","define","amd","this","modules","__webpack_require__","moduleId","installedModules","id","loaded","call","m","c","p","createInstance","defaultConfig","context","Axios","instance","bind","prototype","request","utils","extend","defaults","axios","create","instanceConfig","merge","Cancel","CancelToken","isCancel","all","promises","Promise","spread","default","isArray","val","toString","isArrayBuffer","isFormData","FormData","isArrayBufferView","result","ArrayBuffer","isView","buffer","isString","isNumber","isUndefined","isObject","isDate","isFile","isBlob","isFunction","isStream","pipe","isURLSearchParams","URLSearchParams","trim","str","replace","isStandardBrowserEnv","navigator","product","window","document","forEach","obj","fn","i","l","length","key","Object","hasOwnProperty","assignValue","arguments","a","b","thisArg","isBuffer","args","Array","apply","constructor","interceptors","InterceptorManager","response","dispatchRequest","config","url","method","toLowerCase","chain","undefined","promise","resolve","interceptor","unshift","fulfilled","rejected","push","then","shift","data","setContentTypeIfUnset","headers","value","getDefaultAdapter","adapter","XMLHttpRequest","process","normalizeHeaderName","DEFAULT_CONTENT_TYPE","Content-Type","transformRequest","JSON","stringify","transformResponse","parse","e","timeout","xsrfCookieName","xsrfHeaderName","maxContentLength","validateStatus","status","common","Accept","normalizedName","name","toUpperCase","settle","buildURL","parseHeaders","isURLSameOrigin","createError","reject","requestData","requestHeaders","auth","username","password","Authorization","btoa","open","params","paramsSerializer","onreadystatechange","readyState","responseURL","indexOf","responseHeaders","getAllResponseHeaders","responseData","responseType","responseText","statusText","onerror","ontimeout","cookies","xsrfValue","withCredentials","read","setRequestHeader","onDownloadProgress","addEventListener","onUploadProgress","upload","cancelToken","cancel","abort","send","enhanceError","message","code","error","Error","encode","encodeURIComponent","serializedParams","parts","v","toISOString","join","ignoreDuplicateOf","parsed","split","line","substr","concat","resolveURL","href","msie","urlParsingNode","setAttribute","protocol","host","search","hash","hostname","port","pathname","charAt","originURL","test","userAgent","createElement","location","requestURL","write","expires","path","domain","secure","cookie","Date","toGMTString","match","RegExp","decodeURIComponent","remove","now","handlers","use","eject","h","throwIfCancellationRequested","throwIfRequested","transformData","isAbsoluteURL","combineURLs","baseURL","reason","fns","__CANCEL__","relativeURL","executor","TypeError","resolvePromise","token","source","callback","arr"],"mappings":"CAAA,SAAAA,EAAAC,GACA,gBAAAC,UAAA,gBAAAC,QACAA,OAAAD,QAAAD,IACA,kBAAAG,gBAAAC,IACAD,UAAAH,GACA,gBAAAC,SACAA,QAAA,MAAAD,IAEAD,EAAA,MAAAC,KACCK,KAAA,WACD,MCAgB,UAAUC,GCN1B,QAAAC,GAAAC,GAGA,GAAAC,EAAAD,GACA,MAAAC,GAAAD,GAAAP,OAGA,IAAAC,GAAAO,EAAAD,IACAP,WACAS,GAAAF,EACAG,QAAA,EAUA,OANAL,GAAAE,GAAAI,KAAAV,EAAAD,QAAAC,IAAAD,QAAAM,GAGAL,EAAAS,QAAA,EAGAT,EAAAD,QAvBA,GAAAQ,KAqCA,OATAF,GAAAM,EAAAP,EAGAC,EAAAO,EAAAL,EAGAF,EAAAQ,EAAA,GAGAR,EAAA,KDgBM,SAAUL,EAAQD,EAASM,GEtDjCL,EAAAD,QAAAM,EAAA,IF4DM,SAAUL,EAAQD,EAASM,GG5DjC,YAaA,SAAAS,GAAAC,GACA,GAAAC,GAAA,GAAAC,GAAAF,GACAG,EAAAC,EAAAF,EAAAG,UAAAC,QAAAL,EAQA,OALAM,GAAAC,OAAAL,EAAAD,EAAAG,UAAAJ,GAGAM,EAAAC,OAAAL,EAAAF,GAEAE,EArBA,GAAAI,GAAAjB,EAAA,GACAc,EAAAd,EAAA,GACAY,EAAAZ,EAAA,GACAmB,EAAAnB,EAAA,GAsBAoB,EAAAX,EAAAU,EAGAC,GAAAR,QAGAQ,EAAAC,OAAA,SAAAC,GACA,MAAAb,GAAAQ,EAAAM,MAAAJ,EAAAG,KAIAF,EAAAI,OAAAxB,EAAA,IACAoB,EAAAK,YAAAzB,EAAA,IACAoB,EAAAM,SAAA1B,EAAA,IAGAoB,EAAAO,IAAA,SAAAC,GACA,MAAAC,SAAAF,IAAAC,IAEAR,EAAAU,OAAA9B,EAAA,IAEAL,EAAAD,QAAA0B,EAGAzB,EAAAD,QAAAqC,QAAAX,GHmEM,SAAUzB,EAAQD,EAASM,GItHjC,YAiBA,SAAAgC,GAAAC,GACA,yBAAAC,EAAA7B,KAAA4B,GASA,QAAAE,GAAAF,GACA,+BAAAC,EAAA7B,KAAA4B,GASA,QAAAG,GAAAH,GACA,yBAAAI,WAAAJ,YAAAI,UASA,QAAAC,GAAAL,GACA,GAAAM,EAMA,OAJAA,GADA,mBAAAC,0BAAA,OACAA,YAAAC,OAAAR,GAEA,GAAAA,EAAA,QAAAA,EAAAS,iBAAAF,aAWA,QAAAG,GAAAV,GACA,sBAAAA,GASA,QAAAW,GAAAX,GACA,sBAAAA,GASA,QAAAY,GAAAZ,GACA,yBAAAA,GASA,QAAAa,GAAAb,GACA,cAAAA,GAAA,gBAAAA,GASA,QAAAc,GAAAd,GACA,wBAAAC,EAAA7B,KAAA4B,GASA,QAAAe,GAAAf,GACA,wBAAAC,EAAA7B,KAAA4B,GASA,QAAAgB,GAAAhB,GACA,wBAAAC,EAAA7B,KAAA4B,GASA,QAAAiB,GAAAjB,GACA,4BAAAC,EAAA7B,KAAA4B,GASA,QAAAkB,GAAAlB,GACA,MAAAa,GAAAb,IAAAiB,EAAAjB,EAAAmB,MASA,QAAAC,GAAApB,GACA,yBAAAqB,kBAAArB,YAAAqB,iBASA,QAAAC,GAAAC,GACA,MAAAA,GAAAC,QAAA,WAAAA,QAAA,WAgBA,QAAAC,KACA,0BAAAC,YAAA,gBAAAA,UAAAC,WAIA,mBAAAC,SACA,mBAAAC,WAgBA,QAAAC,GAAAC,EAAAC,GAEA,UAAAD,GAAA,mBAAAA,GAUA,GALA,gBAAAA,KAEAA,OAGAhC,EAAAgC,GAEA,OAAAE,GAAA,EAAAC,EAAAH,EAAAI,OAAmCF,EAAAC,EAAOD,IAC1CD,EAAA5D,KAAA,KAAA2D,EAAAE,KAAAF,OAIA,QAAAK,KAAAL,GACAM,OAAAvD,UAAAwD,eAAAlE,KAAA2D,EAAAK,IACAJ,EAAA5D,KAAA,KAAA2D,EAAAK,KAAAL,GAuBA,QAAAzC,KAEA,QAAAiD,GAAAvC,EAAAoC,GACA,gBAAA9B,GAAA8B,IAAA,gBAAApC,GACAM,EAAA8B,GAAA9C,EAAAgB,EAAA8B,GAAApC,GAEAM,EAAA8B,GAAApC,EAIA,OATAM,MASA2B,EAAA,EAAAC,EAAAM,UAAAL,OAAuCF,EAAAC,EAAOD,IAC9CH,EAAAU,UAAAP,GAAAM,EAEA,OAAAjC,GAWA,QAAArB,GAAAwD,EAAAC,EAAAC,GAQA,MAPAb,GAAAY,EAAA,SAAA1C,EAAAoC,GACAO,GAAA,kBAAA3C,GACAyC,EAAAL,GAAAvD,EAAAmB,EAAA2C,GAEAF,EAAAL,GAAApC,IAGAyC,EApRA,GAAA5D,GAAAd,EAAA,GACA6E,EAAA7E,EAAA,GAMAkC,EAAAoC,OAAAvD,UAAAmB,QAgRAvC,GAAAD,SACAsC,UACAG,gBACA0C,WACAzC,aACAE,oBACAK,WACAC,WACAE,WACAD,cACAE,SACAC,SACAC,SACAC,aACAC,WACAE,oBACAK,uBACAK,UACAxC,QACAL,SACAqC,SJ8HM,SAAU5D,EAAQD,GK3axB,YAEAC,GAAAD,QAAA,SAAAuE,EAAAW,GACA,kBAEA,OADAE,GAAA,GAAAC,OAAAN,UAAAL,QACAF,EAAA,EAAmBA,EAAAY,EAAAV,OAAiBF,IACpCY,EAAAZ,GAAAO,UAAAP,EAEA,OAAAD,GAAAe,MAAAJ,EAAAE,MLobM,SAAUnF,EAAQD;;;;;;AMrbxBC,EAAAD,QAAA,SAAAsE,GACA,aAAAA,GAAA,MAAAA,EAAAiB,aACA,kBAAAjB,GAAAiB,YAAAJ,UAAAb,EAAAiB,YAAAJ,SAAAb,KNocM,SAAUrE,EAAQD,EAASM,GO7cjC,YAYA,SAAAY,GAAAU,GACAxB,KAAAqB,SAAAG,EACAxB,KAAAoF,cACAlE,QAAA,GAAAmE,GACAC,SAAA,GAAAD,IAdA,GAAAhE,GAAAnB,EAAA,GACAiB,EAAAjB,EAAA,GACAmF,EAAAnF,EAAA,IACAqF,EAAArF,EAAA,GAoBAY,GAAAG,UAAAC,QAAA,SAAAsE,GAGA,gBAAAA,KACAA,EAAArE,EAAAM,OACAgE,IAAAd,UAAA,IACKA,UAAA,KAGLa,EAAArE,EAAAM,MAAAJ,GAAkCqE,OAAA,OAAc1F,KAAAqB,SAAAmE,GAChDA,EAAAE,OAAAF,EAAAE,OAAAC,aAGA,IAAAC,IAAAL,EAAAM,QACAC,EAAA/D,QAAAgE,QAAAP,EAUA,KARAxF,KAAAoF,aAAAlE,QAAA+C,QAAA,SAAA+B,GACAJ,EAAAK,QAAAD,EAAAE,UAAAF,EAAAG,YAGAnG,KAAAoF,aAAAE,SAAArB,QAAA,SAAA+B,GACAJ,EAAAQ,KAAAJ,EAAAE,UAAAF,EAAAG,YAGAP,EAAAtB,QACAwB,IAAAO,KAAAT,EAAAU,QAAAV,EAAAU,QAGA,OAAAR,IAIA3E,EAAA8C,SAAA,0CAAAyB,GAEA5E,EAAAG,UAAAyE,GAAA,SAAAD,EAAAD,GACA,MAAAxF,MAAAkB,QAAAC,EAAAM,MAAA+D,OACAE,SACAD,YAKAtE,EAAA8C,SAAA,+BAAAyB,GAEA5E,EAAAG,UAAAyE,GAAA,SAAAD,EAAAc,EAAAf,GACA,MAAAxF,MAAAkB,QAAAC,EAAAM,MAAA+D,OACAE,SACAD,MACAc,aAKA1G,EAAAD,QAAAkB,GPodM,SAAUjB,EAAQD,EAASM,GQliBjC,YASA,SAAAsG,GAAAC,EAAAC,IACAvF,EAAA4B,YAAA0D,IAAAtF,EAAA4B,YAAA0D,EAAA,mBACAA,EAAA,gBAAAC,GAIA,QAAAC,KACA,GAAAC,EAQA,OAPA,mBAAAC,gBAEAD,EAAA1G,EAAA,GACG,mBAAA4G,WAEHF,EAAA1G,EAAA,IAEA0G,EAtBA,GAAAzF,GAAAjB,EAAA,GACA6G,EAAA7G,EAAA,GAEA8G,GACAC,eAAA,qCAqBA5F,GACAuF,QAAAD,IAEAO,kBAAA,SAAAX,EAAAE,GAEA,MADAM,GAAAN,EAAA,gBACAtF,EAAAmB,WAAAiE,IACApF,EAAAkB,cAAAkE,IACApF,EAAA4D,SAAAwB,IACApF,EAAAkC,SAAAkD,IACApF,EAAA+B,OAAAqD,IACApF,EAAAgC,OAAAoD,GAEAA,EAEApF,EAAAqB,kBAAA+D,GACAA,EAAA3D,OAEAzB,EAAAoC,kBAAAgD,IACAC,EAAAC,EAAA,mDACAF,EAAAnE,YAEAjB,EAAA6B,SAAAuD,IACAC,EAAAC,EAAA,kCACAU,KAAAC,UAAAb,IAEAA,IAGAc,mBAAA,SAAAd,GAEA,mBAAAA,GACA,IACAA,EAAAY,KAAAG,MAAAf,GACO,MAAAgB,IAEP,MAAAhB,KAOAiB,QAAA,EAEAC,eAAA,aACAC,eAAA,eAEAC,kBAAA,EAEAC,eAAA,SAAAC,GACA,MAAAA,IAAA,KAAAA,EAAA,KAIAxG,GAAAoF,SACAqB,QACAC,OAAA,sCAIA5G,EAAA8C,SAAA,gCAAAyB,GACArE,EAAAoF,QAAAf,QAGAvE,EAAA8C,SAAA,+BAAAyB,GACArE,EAAAoF,QAAAf,GAAAvE,EAAAM,MAAAuF,KAGAnH,EAAAD,QAAAyB,GRyiBM,SAAUxB,EAAQD,EAASM,GSxoBjC,YAEA,IAAAiB,GAAAjB,EAAA,EAEAL,GAAAD,QAAA,SAAA6G,EAAAuB,GACA7G,EAAA8C,QAAAwC,EAAA,SAAAC,EAAAuB,GACAA,IAAAD,GAAAC,EAAAC,gBAAAF,EAAAE,gBACAzB,EAAAuB,GAAAtB,QACAD,GAAAwB,QTkpBM,SAAUpI,EAAQD,EAASM,GU1pBjC,YAEA,IAAAiB,GAAAjB,EAAA,GACAiI,EAAAjI,EAAA,GACAkI,EAAAlI,EAAA,IACAmI,EAAAnI,EAAA,IACAoI,EAAApI,EAAA,IACAqI,EAAArI,EAAA,GAEAL,GAAAD,QAAA,SAAA4F,GACA,UAAAzD,SAAA,SAAAgE,EAAAyC,GACA,GAAAC,GAAAjD,EAAAe,KACAmC,EAAAlD,EAAAiB,OAEAtF,GAAAmB,WAAAmG,UACAC,GAAA,eAGA,IAAAxH,GAAA,GAAA2F,eAGA,IAAArB,EAAAmD,KAAA,CACA,GAAAC,GAAApD,EAAAmD,KAAAC,UAAA,GACAC,EAAArD,EAAAmD,KAAAE,UAAA,EACAH,GAAAI,cAAA,SAAAC,KAAAH,EAAA,IAAAC,GA8DA,GA3DA3H,EAAA8H,KAAAxD,EAAAE,OAAAwC,cAAAE,EAAA5C,EAAAC,IAAAD,EAAAyD,OAAAzD,EAAA0D,mBAAA,GAGAhI,EAAAsG,QAAAhC,EAAAgC,QAGAtG,EAAAiI,mBAAA,WACA,GAAAjI,GAAA,IAAAA,EAAAkI,aAQA,IAAAlI,EAAA2G,QAAA3G,EAAAmI,aAAA,IAAAnI,EAAAmI,YAAAC,QAAA,WAKA,GAAAC,GAAA,yBAAArI,GAAAmH,EAAAnH,EAAAsI,yBAAA,KACAC,EAAAjE,EAAAkE,cAAA,SAAAlE,EAAAkE,aAAAxI,EAAAoE,SAAApE,EAAAyI,aACArE,GACAiB,KAAAkD,EACA5B,OAAA3G,EAAA2G,OACA+B,WAAA1I,EAAA0I,WACAnD,QAAA8C,EACA/D,SACAtE,UAGAiH,GAAApC,EAAAyC,EAAAlD,GAGApE,EAAA,OAIAA,EAAA2I,QAAA,WAGArB,EAAAD,EAAA,gBAAA/C,EAAA,KAAAtE,IAGAA,EAAA,MAIAA,EAAA4I,UAAA,WACAtB,EAAAD,EAAA,cAAA/C,EAAAgC,QAAA,cAAAhC,EAAA,eACAtE,IAGAA,EAAA,MAMAC,EAAAyC,uBAAA,CACA,GAAAmG,GAAA7J,EAAA,IAGA8J,GAAAxE,EAAAyE,iBAAA3B,EAAA9C,EAAAC,OAAAD,EAAAiC,eACAsC,EAAAG,KAAA1E,EAAAiC,gBACA5B,MAEAmE,KACAtB,EAAAlD,EAAAkC,gBAAAsC,GAuBA,GAlBA,oBAAA9I,IACAC,EAAA8C,QAAAyE,EAAA,SAAAvG,EAAAoC,GACA,mBAAAkE,IAAA,iBAAAlE,EAAAoB,oBAEA+C,GAAAnE,GAGArD,EAAAiJ,iBAAA5F,EAAApC,KAMAqD,EAAAyE,kBACA/I,EAAA+I,iBAAA,GAIAzE,EAAAkE,aACA,IACAxI,EAAAwI,aAAAlE,EAAAkE,aACO,MAAAnC,GAGP,YAAA/B,EAAAkE,aACA,KAAAnC,GAMA,kBAAA/B,GAAA4E,oBACAlJ,EAAAmJ,iBAAA,WAAA7E,EAAA4E,oBAIA,kBAAA5E,GAAA8E,kBAAApJ,EAAAqJ,QACArJ,EAAAqJ,OAAAF,iBAAA,WAAA7E,EAAA8E,kBAGA9E,EAAAgF,aAEAhF,EAAAgF,YAAA1E,QAAAO,KAAA,SAAAoE,GACAvJ,IAIAA,EAAAwJ,QACAlC,EAAAiC,GAEAvJ,EAAA,QAIA2E,SAAA4C,IACAA,EAAA,MAIAvH,EAAAyJ,KAAAlC,OVmqBM,SAAU5I,EAAQD,EAASM,GWl0BjC,YAEA,IAAAqI,GAAArI,EAAA,GASAL,GAAAD,QAAA,SAAAmG,EAAAyC,EAAAlD,GACA,GAAAsC,GAAAtC,EAAAE,OAAAoC,cAEAtC,GAAAuC,QAAAD,MAAAtC,EAAAuC,QAGAW,EAAAD,EACA,mCAAAjD,EAAAuC,OACAvC,EAAAE,OACA,KACAF,EAAApE,QACAoE,IAPAS,EAAAT,KXm1BM,SAAUzF,EAAQD,EAASM,GYl2BjC,YAEA,IAAA0K,GAAA1K,EAAA,GAYAL,GAAAD,QAAA,SAAAiL,EAAArF,EAAAsF,EAAA5J,EAAAoE,GACA,GAAAyF,GAAA,GAAAC,OAAAH,EACA,OAAAD,GAAAG,EAAAvF,EAAAsF,EAAA5J,EAAAoE,KZ02BM,SAAUzF,EAAQD,Ga13BxB,YAYAC,GAAAD,QAAA,SAAAmL,EAAAvF,EAAAsF,EAAA5J,EAAAoE,GAOA,MANAyF,GAAAvF,SACAsF,IACAC,EAAAD,QAEAC,EAAA7J,UACA6J,EAAAzF,WACAyF,Ibk4BM,SAAUlL,EAAQD,EAASM,Gcr5BjC,YAIA,SAAA+K,GAAA9I,GACA,MAAA+I,oBAAA/I,GACAwB,QAAA,aACAA,QAAA,aACAA,QAAA,YACAA,QAAA,aACAA,QAAA,YACAA,QAAA,aACAA,QAAA,aAVA,GAAAxC,GAAAjB,EAAA,EAoBAL,GAAAD,QAAA,SAAA6F,EAAAwD,EAAAC,GAEA,IAAAD,EACA,MAAAxD,EAGA,IAAA0F,EACA,IAAAjC,EACAiC,EAAAjC,EAAAD,OACG,IAAA9H,EAAAoC,kBAAA0F,GACHkC,EAAAlC,EAAA7G,eACG,CACH,GAAAgJ,KAEAjK,GAAA8C,QAAAgF,EAAA,SAAA9G,EAAAoC,GACA,OAAApC,GAAA,mBAAAA,KAIAhB,EAAAe,QAAAC,GACAoC,GAAA,KAEApC,MAGAhB,EAAA8C,QAAA9B,EAAA,SAAAkJ,GACAlK,EAAA8B,OAAAoI,GACAA,IAAAC,cACSnK,EAAA6B,SAAAqI,KACTA,EAAAlE,KAAAC,UAAAiE,IAEAD,EAAAhF,KAAA6E,EAAA1G,GAAA,IAAA0G,EAAAI,SAIAF,EAAAC,EAAAG,KAAA,KAOA,MAJAJ,KACA1F,MAAA6D,QAAA,mBAAA6B,GAGA1F,Id65BM,SAAU5F,EAAQD,EAASM,Ge79BjC,YAEA,IAAAiB,GAAAjB,EAAA,GAIAsL,GACA,6DACA,kEACA,gEACA,qCAgBA3L,GAAAD,QAAA,SAAA6G,GACA,GACAlC,GACApC,EACAiC,EAHAqH,IAKA,OAAAhF,IAEAtF,EAAA8C,QAAAwC,EAAAiF,MAAA,eAAAC,GAKA,GAJAvH,EAAAuH,EAAArC,QAAA,KACA/E,EAAApD,EAAAsC,KAAAkI,EAAAC,OAAA,EAAAxH,IAAAuB,cACAxD,EAAAhB,EAAAsC,KAAAkI,EAAAC,OAAAxH,EAAA,IAEAG,EAAA,CACA,GAAAkH,EAAAlH,IAAAiH,EAAAlC,QAAA/E,IAAA,EACA,MAEA,gBAAAA,EACAkH,EAAAlH,IAAAkH,EAAAlH,GAAAkH,EAAAlH,OAAAsH,QAAA1J,IAEAsJ,EAAAlH,GAAAkH,EAAAlH,GAAAkH,EAAAlH,GAAA,KAAApC,OAKAsJ,GAnBiBA,Ifw/BX,SAAU5L,EAAQD,EAASM,GgBxhCjC,YAEA,IAAAiB,GAAAjB,EAAA,EAEAL,GAAAD,QACAuB,EAAAyC,uBAIA,WAWA,QAAAkI,GAAArG,GACA,GAAAsG,GAAAtG,CAWA,OATAuG,KAEAC,EAAAC,aAAA,OAAAH,GACAA,EAAAE,EAAAF,MAGAE,EAAAC,aAAA,OAAAH,IAIAA,KAAAE,EAAAF,KACAI,SAAAF,EAAAE,SAAAF,EAAAE,SAAAxI,QAAA,YACAyI,KAAAH,EAAAG,KACAC,OAAAJ,EAAAI,OAAAJ,EAAAI,OAAA1I,QAAA,aACA2I,KAAAL,EAAAK,KAAAL,EAAAK,KAAA3I,QAAA,YACA4I,SAAAN,EAAAM,SACAC,KAAAP,EAAAO,KACAC,SAAA,MAAAR,EAAAQ,SAAAC,OAAA,GACAT,EAAAQ,SACA,IAAAR,EAAAQ,UAhCA,GAEAE,GAFAX,EAAA,kBAAAY,KAAA/I,UAAAgJ,WACAZ,EAAAjI,SAAA8I,cAAA,IA2CA,OARAH,GAAAb,EAAA/H,OAAAgJ,SAAAhB,MAQA,SAAAiB,GACA,GAAAvB,GAAAtK,EAAA0B,SAAAmK,GAAAlB,EAAAkB,IACA,OAAAvB,GAAAU,WAAAQ,EAAAR,UACAV,EAAAW,OAAAO,EAAAP,SAKA,WACA,kBACA,chBkiCM,SAAUvM,EAAQD,EAASM,GiBlmCjC,YAEA,IAAAiB,GAAAjB,EAAA,EAEAL,GAAAD,QACAuB,EAAAyC,uBAGA,WACA,OACAqJ,MAAA,SAAAhF,EAAAvB,EAAAwG,EAAAC,EAAAC,EAAAC,GACA,GAAAC,KACAA,GAAAlH,KAAA6B,EAAA,IAAAiD,mBAAAxE,IAEAvF,EAAA2B,SAAAoK,IACAI,EAAAlH,KAAA,cAAAmH,MAAAL,GAAAM,eAGArM,EAAA0B,SAAAsK,IACAG,EAAAlH,KAAA,QAAA+G,GAGAhM,EAAA0B,SAAAuK,IACAE,EAAAlH,KAAA,UAAAgH,GAGAC,KAAA,GACAC,EAAAlH,KAAA,UAGApC,SAAAsJ,SAAA/B,KAAA,OAGArB,KAAA,SAAAjC,GACA,GAAAwF,GAAAzJ,SAAAsJ,OAAAG,MAAA,GAAAC,QAAA,aAA0DzF,EAAA,aAC1D,OAAAwF,GAAAE,mBAAAF,EAAA,UAGAG,OAAA,SAAA3F,GACAjI,KAAAiN,MAAAhF,EAAA,GAAAsF,KAAAM,MAAA,YAMA,WACA,OACAZ,MAAA,aACA/C,KAAA,WAA6B,aAC7B0D,OAAA,kBjB4mCM,SAAU/N,EAAQD,EAASM,GkB7pCjC,YAIA,SAAAmF,KACArF,KAAA8N,YAHA,GAAA3M,GAAAjB,EAAA,EAcAmF,GAAApE,UAAA8M,IAAA,SAAA7H,EAAAC,GAKA,MAJAnG,MAAA8N,SAAA1H,MACAF,YACAC,aAEAnG,KAAA8N,SAAAxJ,OAAA,GAQAe,EAAApE,UAAA+M,MAAA,SAAA3N,GACAL,KAAA8N,SAAAzN,KACAL,KAAA8N,SAAAzN,GAAA,OAYAgF,EAAApE,UAAAgD,QAAA,SAAAE,GACAhD,EAAA8C,QAAAjE,KAAA8N,SAAA,SAAAG,GACA,OAAAA,GACA9J,EAAA8J,MAKApO,EAAAD,QAAAyF,GlBoqCM,SAAUxF,EAAQD,EAASM,GmBvtCjC,YAYA,SAAAgO,GAAA1I,GACAA,EAAAgF,aACAhF,EAAAgF,YAAA2D,mBAZA,GAAAhN,GAAAjB,EAAA,GACAkO,EAAAlO,EAAA,IACA0B,EAAA1B,EAAA,IACAmB,EAAAnB,EAAA,GACAmO,EAAAnO,EAAA,IACAoO,EAAApO,EAAA,GAiBAL,GAAAD,QAAA,SAAA4F,GACA0I,EAAA1I,GAGAA,EAAA+I,UAAAF,EAAA7I,EAAAC,OACAD,EAAAC,IAAA6I,EAAA9I,EAAA+I,QAAA/I,EAAAC,MAIAD,EAAAiB,QAAAjB,EAAAiB,YAGAjB,EAAAe,KAAA6H,EACA5I,EAAAe,KACAf,EAAAiB,QACAjB,EAAA0B,kBAIA1B,EAAAiB,QAAAtF,EAAAM,MACA+D,EAAAiB,QAAAqB,WACAtC,EAAAiB,QAAAjB,EAAAE,YACAF,EAAAiB,aAGAtF,EAAA8C,SACA,qDACA,SAAAyB,SACAF,GAAAiB,QAAAf,IAIA,IAAAkB,GAAApB,EAAAoB,SAAAvF,EAAAuF,OAEA,OAAAA,GAAApB,GAAAa,KAAA,SAAAf,GAUA,MATA4I,GAAA1I,GAGAF,EAAAiB,KAAA6H,EACA9I,EAAAiB,KACAjB,EAAAmB,QACAjB,EAAA6B,mBAGA/B,GACG,SAAAkJ,GAcH,MAbA5M,GAAA4M,KACAN,EAAA1I,GAGAgJ,KAAAlJ,WACAkJ,EAAAlJ,SAAAiB,KAAA6H,EACAI,EAAAlJ,SAAAiB,KACAiI,EAAAlJ,SAAAmB,QACAjB,EAAA6B,qBAKAtF,QAAAyG,OAAAgG,OnBguCM,SAAU3O,EAAQD,EAASM,GoBnzCjC,YAEA,IAAAiB,GAAAjB,EAAA,EAUAL,GAAAD,QAAA,SAAA2G,EAAAE,EAAAgI,GAMA,MAJAtN,GAAA8C,QAAAwK,EAAA,SAAAtK,GACAoC,EAAApC,EAAAoC,EAAAE,KAGAF,IpB2zCM,SAAU1G,EAAQD,GqB70CxB,YAEAC,GAAAD,QAAA,SAAA8G,GACA,SAAAA,MAAAgI,crBq1CM,SAAU7O,EAAQD,GsBx1CxB,YAQAC,GAAAD,QAAA,SAAA6F,GAIA,sCAAAmH,KAAAnH,KtBg2CM,SAAU5F,EAAQD,GuB52CxB,YASAC,GAAAD,QAAA,SAAA2O,EAAAI,GACA,MAAAA,GACAJ,EAAA5K,QAAA,eAAAgL,EAAAhL,QAAA,WACA4K,IvBo3CM,SAAU1O,EAAQD,GwBh4CxB,YAQA,SAAA8B,GAAAmJ,GACA7K,KAAA6K,UAGAnJ,EAAAT,UAAAmB,SAAA,WACA,gBAAApC,KAAA6K,QAAA,KAAA7K,KAAA6K,QAAA,KAGAnJ,EAAAT,UAAAyN,YAAA,EAEA7O,EAAAD,QAAA8B,GxBu4CM,SAAU7B,EAAQD,EAASM,GyBz5CjC,YAUA,SAAAyB,GAAAiN,GACA,qBAAAA,GACA,SAAAC,WAAA,+BAGA,IAAAC,EACA9O,MAAA8F,QAAA,GAAA/D,SAAA,SAAAgE,GACA+I,EAAA/I,GAGA,IAAAgJ,GAAA/O,IACA4O,GAAA,SAAA/D,GACAkE,EAAAP,SAKAO,EAAAP,OAAA,GAAA9M,GAAAmJ,GACAiE,EAAAC,EAAAP,WA1BA,GAAA9M,GAAAxB,EAAA,GAiCAyB,GAAAV,UAAAkN,iBAAA,WACA,GAAAnO,KAAAwO,OACA,KAAAxO,MAAAwO,QAQA7M,EAAAqN,OAAA,WACA,GAAAvE,GACAsE,EAAA,GAAApN,GAAA,SAAAlB,GACAgK,EAAAhK,GAEA,QACAsO,QACAtE,WAIA5K,EAAAD,QAAA+B,GzBg6CM,SAAU9B,EAAQD,G0Bx9CxB,YAsBAC,GAAAD,QAAA,SAAAqP,GACA,gBAAAC,GACA,MAAAD,GAAA/J,MAAA,KAAAgK","file":"axios.min.js","sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"axios\"] = factory();\n\telse\n\t\troot[\"axios\"] = factory();\n})(this, function() {\nreturn \n\n\n// WEBPACK FOOTER //\n// webpack/universalModuleDefinition","(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"axios\"] = factory();\n\telse\n\t\troot[\"axios\"] = factory();\n})(this, function() {\nreturn /******/ (function(modules) { // webpackBootstrap\n/******/ \t// The module cache\n/******/ \tvar installedModules = {};\n/******/\n/******/ \t// The require function\n/******/ \tfunction __webpack_require__(moduleId) {\n/******/\n/******/ \t\t// Check if module is in cache\n/******/ \t\tif(installedModules[moduleId])\n/******/ \t\t\treturn installedModules[moduleId].exports;\n/******/\n/******/ \t\t// Create a new module (and put it into the cache)\n/******/ \t\tvar module = installedModules[moduleId] = {\n/******/ \t\t\texports: {},\n/******/ \t\t\tid: moduleId,\n/******/ \t\t\tloaded: false\n/******/ \t\t};\n/******/\n/******/ \t\t// Execute the module function\n/******/ \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n/******/\n/******/ \t\t// Flag the module as loaded\n/******/ \t\tmodule.loaded = true;\n/******/\n/******/ \t\t// Return the exports of the module\n/******/ \t\treturn module.exports;\n/******/ \t}\n/******/\n/******/\n/******/ \t// expose the modules object (__webpack_modules__)\n/******/ \t__webpack_require__.m = modules;\n/******/\n/******/ \t// expose the module cache\n/******/ \t__webpack_require__.c = installedModules;\n/******/\n/******/ \t// __webpack_public_path__\n/******/ \t__webpack_require__.p = \"\";\n/******/\n/******/ \t// Load entry module and return exports\n/******/ \treturn __webpack_require__(0);\n/******/ })\n/************************************************************************/\n/******/ ([\n/* 0 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\tmodule.exports = __webpack_require__(1);\n\n/***/ }),\n/* 1 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tvar utils = __webpack_require__(2);\n\tvar bind = __webpack_require__(3);\n\tvar Axios = __webpack_require__(5);\n\tvar defaults = __webpack_require__(6);\n\t\n\t/**\n\t * Create an instance of Axios\n\t *\n\t * @param {Object} defaultConfig The default config for the instance\n\t * @return {Axios} A new instance of Axios\n\t */\n\tfunction createInstance(defaultConfig) {\n\t var context = new Axios(defaultConfig);\n\t var instance = bind(Axios.prototype.request, context);\n\t\n\t // Copy axios.prototype to instance\n\t utils.extend(instance, Axios.prototype, context);\n\t\n\t // Copy context to instance\n\t utils.extend(instance, context);\n\t\n\t return instance;\n\t}\n\t\n\t// Create the default instance to be exported\n\tvar axios = createInstance(defaults);\n\t\n\t// Expose Axios class to allow class inheritance\n\taxios.Axios = Axios;\n\t\n\t// Factory for creating new instances\n\taxios.create = function create(instanceConfig) {\n\t return createInstance(utils.merge(defaults, instanceConfig));\n\t};\n\t\n\t// Expose Cancel & CancelToken\n\taxios.Cancel = __webpack_require__(22);\n\taxios.CancelToken = __webpack_require__(23);\n\taxios.isCancel = __webpack_require__(19);\n\t\n\t// Expose all/spread\n\taxios.all = function all(promises) {\n\t return Promise.all(promises);\n\t};\n\taxios.spread = __webpack_require__(24);\n\t\n\tmodule.exports = axios;\n\t\n\t// Allow use of default import syntax in TypeScript\n\tmodule.exports.default = axios;\n\n\n/***/ }),\n/* 2 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tvar bind = __webpack_require__(3);\n\tvar isBuffer = __webpack_require__(4);\n\t\n\t/*global toString:true*/\n\t\n\t// utils is a library of generic helper functions non-specific to axios\n\t\n\tvar toString = Object.prototype.toString;\n\t\n\t/**\n\t * Determine if a value is an Array\n\t *\n\t * @param {Object} val The value to test\n\t * @returns {boolean} True if value is an Array, otherwise false\n\t */\n\tfunction isArray(val) {\n\t return toString.call(val) === '[object Array]';\n\t}\n\t\n\t/**\n\t * Determine if a value is an ArrayBuffer\n\t *\n\t * @param {Object} val The value to test\n\t * @returns {boolean} True if value is an ArrayBuffer, otherwise false\n\t */\n\tfunction isArrayBuffer(val) {\n\t return toString.call(val) === '[object ArrayBuffer]';\n\t}\n\t\n\t/**\n\t * Determine if a value is a FormData\n\t *\n\t * @param {Object} val The value to test\n\t * @returns {boolean} True if value is an FormData, otherwise false\n\t */\n\tfunction isFormData(val) {\n\t return (typeof FormData !== 'undefined') && (val instanceof FormData);\n\t}\n\t\n\t/**\n\t * Determine if a value is a view on an ArrayBuffer\n\t *\n\t * @param {Object} val The value to test\n\t * @returns {boolean} True if value is a view on an ArrayBuffer, otherwise false\n\t */\n\tfunction isArrayBufferView(val) {\n\t var result;\n\t if ((typeof ArrayBuffer !== 'undefined') && (ArrayBuffer.isView)) {\n\t result = ArrayBuffer.isView(val);\n\t } else {\n\t result = (val) && (val.buffer) && (val.buffer instanceof ArrayBuffer);\n\t }\n\t return result;\n\t}\n\t\n\t/**\n\t * Determine if a value is a String\n\t *\n\t * @param {Object} val The value to test\n\t * @returns {boolean} True if value is a String, otherwise false\n\t */\n\tfunction isString(val) {\n\t return typeof val === 'string';\n\t}\n\t\n\t/**\n\t * Determine if a value is a Number\n\t *\n\t * @param {Object} val The value to test\n\t * @returns {boolean} True if value is a Number, otherwise false\n\t */\n\tfunction isNumber(val) {\n\t return typeof val === 'number';\n\t}\n\t\n\t/**\n\t * Determine if a value is undefined\n\t *\n\t * @param {Object} val The value to test\n\t * @returns {boolean} True if the value is undefined, otherwise false\n\t */\n\tfunction isUndefined(val) {\n\t return typeof val === 'undefined';\n\t}\n\t\n\t/**\n\t * Determine if a value is an Object\n\t *\n\t * @param {Object} val The value to test\n\t * @returns {boolean} True if value is an Object, otherwise false\n\t */\n\tfunction isObject(val) {\n\t return val !== null && typeof val === 'object';\n\t}\n\t\n\t/**\n\t * Determine if a value is a Date\n\t *\n\t * @param {Object} val The value to test\n\t * @returns {boolean} True if value is a Date, otherwise false\n\t */\n\tfunction isDate(val) {\n\t return toString.call(val) === '[object Date]';\n\t}\n\t\n\t/**\n\t * Determine if a value is a File\n\t *\n\t * @param {Object} val The value to test\n\t * @returns {boolean} True if value is a File, otherwise false\n\t */\n\tfunction isFile(val) {\n\t return toString.call(val) === '[object File]';\n\t}\n\t\n\t/**\n\t * Determine if a value is a Blob\n\t *\n\t * @param {Object} val The value to test\n\t * @returns {boolean} True if value is a Blob, otherwise false\n\t */\n\tfunction isBlob(val) {\n\t return toString.call(val) === '[object Blob]';\n\t}\n\t\n\t/**\n\t * Determine if a value is a Function\n\t *\n\t * @param {Object} val The value to test\n\t * @returns {boolean} True if value is a Function, otherwise false\n\t */\n\tfunction isFunction(val) {\n\t return toString.call(val) === '[object Function]';\n\t}\n\t\n\t/**\n\t * Determine if a value is a Stream\n\t *\n\t * @param {Object} val The value to test\n\t * @returns {boolean} True if value is a Stream, otherwise false\n\t */\n\tfunction isStream(val) {\n\t return isObject(val) && isFunction(val.pipe);\n\t}\n\t\n\t/**\n\t * Determine if a value is a URLSearchParams object\n\t *\n\t * @param {Object} val The value to test\n\t * @returns {boolean} True if value is a URLSearchParams object, otherwise false\n\t */\n\tfunction isURLSearchParams(val) {\n\t return typeof URLSearchParams !== 'undefined' && val instanceof URLSearchParams;\n\t}\n\t\n\t/**\n\t * Trim excess whitespace off the beginning and end of a string\n\t *\n\t * @param {String} str The String to trim\n\t * @returns {String} The String freed of excess whitespace\n\t */\n\tfunction trim(str) {\n\t return str.replace(/^\\s*/, '').replace(/\\s*$/, '');\n\t}\n\t\n\t/**\n\t * Determine if we're running in a standard browser environment\n\t *\n\t * This allows axios to run in a web worker, and react-native.\n\t * Both environments support XMLHttpRequest, but not fully standard globals.\n\t *\n\t * web workers:\n\t * typeof window -> undefined\n\t * typeof document -> undefined\n\t *\n\t * react-native:\n\t * navigator.product -> 'ReactNative'\n\t */\n\tfunction isStandardBrowserEnv() {\n\t if (typeof navigator !== 'undefined' && navigator.product === 'ReactNative') {\n\t return false;\n\t }\n\t return (\n\t typeof window !== 'undefined' &&\n\t typeof document !== 'undefined'\n\t );\n\t}\n\t\n\t/**\n\t * Iterate over an Array or an Object invoking a function for each item.\n\t *\n\t * If `obj` is an Array callback will be called passing\n\t * the value, index, and complete array for each item.\n\t *\n\t * If 'obj' is an Object callback will be called passing\n\t * the value, key, and complete object for each property.\n\t *\n\t * @param {Object|Array} obj The object to iterate\n\t * @param {Function} fn The callback to invoke for each item\n\t */\n\tfunction forEach(obj, fn) {\n\t // Don't bother if no value provided\n\t if (obj === null || typeof obj === 'undefined') {\n\t return;\n\t }\n\t\n\t // Force an array if not already something iterable\n\t if (typeof obj !== 'object') {\n\t /*eslint no-param-reassign:0*/\n\t obj = [obj];\n\t }\n\t\n\t if (isArray(obj)) {\n\t // Iterate over array values\n\t for (var i = 0, l = obj.length; i < l; i++) {\n\t fn.call(null, obj[i], i, obj);\n\t }\n\t } else {\n\t // Iterate over object keys\n\t for (var key in obj) {\n\t if (Object.prototype.hasOwnProperty.call(obj, key)) {\n\t fn.call(null, obj[key], key, obj);\n\t }\n\t }\n\t }\n\t}\n\t\n\t/**\n\t * Accepts varargs expecting each argument to be an object, then\n\t * immutably merges the properties of each object and returns result.\n\t *\n\t * When multiple objects contain the same key the later object in\n\t * the arguments list will take precedence.\n\t *\n\t * Example:\n\t *\n\t * ```js\n\t * var result = merge({foo: 123}, {foo: 456});\n\t * console.log(result.foo); // outputs 456\n\t * ```\n\t *\n\t * @param {Object} obj1 Object to merge\n\t * @returns {Object} Result of all merge properties\n\t */\n\tfunction merge(/* obj1, obj2, obj3, ... */) {\n\t var result = {};\n\t function assignValue(val, key) {\n\t if (typeof result[key] === 'object' && typeof val === 'object') {\n\t result[key] = merge(result[key], val);\n\t } else {\n\t result[key] = val;\n\t }\n\t }\n\t\n\t for (var i = 0, l = arguments.length; i < l; i++) {\n\t forEach(arguments[i], assignValue);\n\t }\n\t return result;\n\t}\n\t\n\t/**\n\t * Extends object a by mutably adding to it the properties of object b.\n\t *\n\t * @param {Object} a The object to be extended\n\t * @param {Object} b The object to copy properties from\n\t * @param {Object} thisArg The object to bind function to\n\t * @return {Object} The resulting value of object a\n\t */\n\tfunction extend(a, b, thisArg) {\n\t forEach(b, function assignValue(val, key) {\n\t if (thisArg && typeof val === 'function') {\n\t a[key] = bind(val, thisArg);\n\t } else {\n\t a[key] = val;\n\t }\n\t });\n\t return a;\n\t}\n\t\n\tmodule.exports = {\n\t isArray: isArray,\n\t isArrayBuffer: isArrayBuffer,\n\t isBuffer: isBuffer,\n\t isFormData: isFormData,\n\t isArrayBufferView: isArrayBufferView,\n\t isString: isString,\n\t isNumber: isNumber,\n\t isObject: isObject,\n\t isUndefined: isUndefined,\n\t isDate: isDate,\n\t isFile: isFile,\n\t isBlob: isBlob,\n\t isFunction: isFunction,\n\t isStream: isStream,\n\t isURLSearchParams: isURLSearchParams,\n\t isStandardBrowserEnv: isStandardBrowserEnv,\n\t forEach: forEach,\n\t merge: merge,\n\t extend: extend,\n\t trim: trim\n\t};\n\n\n/***/ }),\n/* 3 */\n/***/ (function(module, exports) {\n\n\t'use strict';\n\t\n\tmodule.exports = function bind(fn, thisArg) {\n\t return function wrap() {\n\t var args = new Array(arguments.length);\n\t for (var i = 0; i < args.length; i++) {\n\t args[i] = arguments[i];\n\t }\n\t return fn.apply(thisArg, args);\n\t };\n\t};\n\n\n/***/ }),\n/* 4 */\n/***/ (function(module, exports) {\n\n\t/*!\n\t * Determine if an object is a Buffer\n\t *\n\t * @author Feross Aboukhadijeh \n\t * @license MIT\n\t */\n\t\n\tmodule.exports = function isBuffer (obj) {\n\t return obj != null && obj.constructor != null &&\n\t typeof obj.constructor.isBuffer === 'function' && obj.constructor.isBuffer(obj)\n\t}\n\n\n/***/ }),\n/* 5 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tvar defaults = __webpack_require__(6);\n\tvar utils = __webpack_require__(2);\n\tvar InterceptorManager = __webpack_require__(16);\n\tvar dispatchRequest = __webpack_require__(17);\n\t\n\t/**\n\t * Create a new instance of Axios\n\t *\n\t * @param {Object} instanceConfig The default config for the instance\n\t */\n\tfunction Axios(instanceConfig) {\n\t this.defaults = instanceConfig;\n\t this.interceptors = {\n\t request: new InterceptorManager(),\n\t response: new InterceptorManager()\n\t };\n\t}\n\t\n\t/**\n\t * Dispatch a request\n\t *\n\t * @param {Object} config The config specific for this request (merged with this.defaults)\n\t */\n\tAxios.prototype.request = function request(config) {\n\t /*eslint no-param-reassign:0*/\n\t // Allow for axios('example/url'[, config]) a la fetch API\n\t if (typeof config === 'string') {\n\t config = utils.merge({\n\t url: arguments[0]\n\t }, arguments[1]);\n\t }\n\t\n\t config = utils.merge(defaults, {method: 'get'}, this.defaults, config);\n\t config.method = config.method.toLowerCase();\n\t\n\t // Hook up interceptors middleware\n\t var chain = [dispatchRequest, undefined];\n\t var promise = Promise.resolve(config);\n\t\n\t this.interceptors.request.forEach(function unshiftRequestInterceptors(interceptor) {\n\t chain.unshift(interceptor.fulfilled, interceptor.rejected);\n\t });\n\t\n\t this.interceptors.response.forEach(function pushResponseInterceptors(interceptor) {\n\t chain.push(interceptor.fulfilled, interceptor.rejected);\n\t });\n\t\n\t while (chain.length) {\n\t promise = promise.then(chain.shift(), chain.shift());\n\t }\n\t\n\t return promise;\n\t};\n\t\n\t// Provide aliases for supported request methods\n\tutils.forEach(['delete', 'get', 'head', 'options'], function forEachMethodNoData(method) {\n\t /*eslint func-names:0*/\n\t Axios.prototype[method] = function(url, config) {\n\t return this.request(utils.merge(config || {}, {\n\t method: method,\n\t url: url\n\t }));\n\t };\n\t});\n\t\n\tutils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {\n\t /*eslint func-names:0*/\n\t Axios.prototype[method] = function(url, data, config) {\n\t return this.request(utils.merge(config || {}, {\n\t method: method,\n\t url: url,\n\t data: data\n\t }));\n\t };\n\t});\n\t\n\tmodule.exports = Axios;\n\n\n/***/ }),\n/* 6 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tvar utils = __webpack_require__(2);\n\tvar normalizeHeaderName = __webpack_require__(7);\n\t\n\tvar DEFAULT_CONTENT_TYPE = {\n\t 'Content-Type': 'application/x-www-form-urlencoded'\n\t};\n\t\n\tfunction setContentTypeIfUnset(headers, value) {\n\t if (!utils.isUndefined(headers) && utils.isUndefined(headers['Content-Type'])) {\n\t headers['Content-Type'] = value;\n\t }\n\t}\n\t\n\tfunction getDefaultAdapter() {\n\t var adapter;\n\t if (typeof XMLHttpRequest !== 'undefined') {\n\t // For browsers use XHR adapter\n\t adapter = __webpack_require__(8);\n\t } else if (typeof process !== 'undefined') {\n\t // For node use HTTP adapter\n\t adapter = __webpack_require__(8);\n\t }\n\t return adapter;\n\t}\n\t\n\tvar defaults = {\n\t adapter: getDefaultAdapter(),\n\t\n\t transformRequest: [function transformRequest(data, headers) {\n\t normalizeHeaderName(headers, 'Content-Type');\n\t if (utils.isFormData(data) ||\n\t utils.isArrayBuffer(data) ||\n\t utils.isBuffer(data) ||\n\t utils.isStream(data) ||\n\t utils.isFile(data) ||\n\t utils.isBlob(data)\n\t ) {\n\t return data;\n\t }\n\t if (utils.isArrayBufferView(data)) {\n\t return data.buffer;\n\t }\n\t if (utils.isURLSearchParams(data)) {\n\t setContentTypeIfUnset(headers, 'application/x-www-form-urlencoded;charset=utf-8');\n\t return data.toString();\n\t }\n\t if (utils.isObject(data)) {\n\t setContentTypeIfUnset(headers, 'application/json;charset=utf-8');\n\t return JSON.stringify(data);\n\t }\n\t return data;\n\t }],\n\t\n\t transformResponse: [function transformResponse(data) {\n\t /*eslint no-param-reassign:0*/\n\t if (typeof data === 'string') {\n\t try {\n\t data = JSON.parse(data);\n\t } catch (e) { /* Ignore */ }\n\t }\n\t return data;\n\t }],\n\t\n\t /**\n\t * A timeout in milliseconds to abort a request. If set to 0 (default) a\n\t * timeout is not created.\n\t */\n\t timeout: 0,\n\t\n\t xsrfCookieName: 'XSRF-TOKEN',\n\t xsrfHeaderName: 'X-XSRF-TOKEN',\n\t\n\t maxContentLength: -1,\n\t\n\t validateStatus: function validateStatus(status) {\n\t return status >= 200 && status < 300;\n\t }\n\t};\n\t\n\tdefaults.headers = {\n\t common: {\n\t 'Accept': 'application/json, text/plain, */*'\n\t }\n\t};\n\t\n\tutils.forEach(['delete', 'get', 'head'], function forEachMethodNoData(method) {\n\t defaults.headers[method] = {};\n\t});\n\t\n\tutils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {\n\t defaults.headers[method] = utils.merge(DEFAULT_CONTENT_TYPE);\n\t});\n\t\n\tmodule.exports = defaults;\n\n\n/***/ }),\n/* 7 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tvar utils = __webpack_require__(2);\n\t\n\tmodule.exports = function normalizeHeaderName(headers, normalizedName) {\n\t utils.forEach(headers, function processHeader(value, name) {\n\t if (name !== normalizedName && name.toUpperCase() === normalizedName.toUpperCase()) {\n\t headers[normalizedName] = value;\n\t delete headers[name];\n\t }\n\t });\n\t};\n\n\n/***/ }),\n/* 8 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tvar utils = __webpack_require__(2);\n\tvar settle = __webpack_require__(9);\n\tvar buildURL = __webpack_require__(12);\n\tvar parseHeaders = __webpack_require__(13);\n\tvar isURLSameOrigin = __webpack_require__(14);\n\tvar createError = __webpack_require__(10);\n\t\n\tmodule.exports = function xhrAdapter(config) {\n\t return new Promise(function dispatchXhrRequest(resolve, reject) {\n\t var requestData = config.data;\n\t var requestHeaders = config.headers;\n\t\n\t if (utils.isFormData(requestData)) {\n\t delete requestHeaders['Content-Type']; // Let the browser set it\n\t }\n\t\n\t var request = new XMLHttpRequest();\n\t\n\t // HTTP basic authentication\n\t if (config.auth) {\n\t var username = config.auth.username || '';\n\t var password = config.auth.password || '';\n\t requestHeaders.Authorization = 'Basic ' + btoa(username + ':' + password);\n\t }\n\t\n\t request.open(config.method.toUpperCase(), buildURL(config.url, config.params, config.paramsSerializer), true);\n\t\n\t // Set the request timeout in MS\n\t request.timeout = config.timeout;\n\t\n\t // Listen for ready state\n\t request.onreadystatechange = function handleLoad() {\n\t if (!request || request.readyState !== 4) {\n\t return;\n\t }\n\t\n\t // The request errored out and we didn't get a response, this will be\n\t // handled by onerror instead\n\t // With one exception: request that using file: protocol, most browsers\n\t // will return status as 0 even though it's a successful request\n\t if (request.status === 0 && !(request.responseURL && request.responseURL.indexOf('file:') === 0)) {\n\t return;\n\t }\n\t\n\t // Prepare the response\n\t var responseHeaders = 'getAllResponseHeaders' in request ? parseHeaders(request.getAllResponseHeaders()) : null;\n\t var responseData = !config.responseType || config.responseType === 'text' ? request.responseText : request.response;\n\t var response = {\n\t data: responseData,\n\t status: request.status,\n\t statusText: request.statusText,\n\t headers: responseHeaders,\n\t config: config,\n\t request: request\n\t };\n\t\n\t settle(resolve, reject, response);\n\t\n\t // Clean up request\n\t request = null;\n\t };\n\t\n\t // Handle low level network errors\n\t request.onerror = function handleError() {\n\t // Real errors are hidden from us by the browser\n\t // onerror should only fire if it's a network error\n\t reject(createError('Network Error', config, null, request));\n\t\n\t // Clean up request\n\t request = null;\n\t };\n\t\n\t // Handle timeout\n\t request.ontimeout = function handleTimeout() {\n\t reject(createError('timeout of ' + config.timeout + 'ms exceeded', config, 'ECONNABORTED',\n\t request));\n\t\n\t // Clean up request\n\t request = null;\n\t };\n\t\n\t // Add xsrf header\n\t // This is only done if running in a standard browser environment.\n\t // Specifically not if we're in a web worker, or react-native.\n\t if (utils.isStandardBrowserEnv()) {\n\t var cookies = __webpack_require__(15);\n\t\n\t // Add xsrf header\n\t var xsrfValue = (config.withCredentials || isURLSameOrigin(config.url)) && config.xsrfCookieName ?\n\t cookies.read(config.xsrfCookieName) :\n\t undefined;\n\t\n\t if (xsrfValue) {\n\t requestHeaders[config.xsrfHeaderName] = xsrfValue;\n\t }\n\t }\n\t\n\t // Add headers to the request\n\t if ('setRequestHeader' in request) {\n\t utils.forEach(requestHeaders, function setRequestHeader(val, key) {\n\t if (typeof requestData === 'undefined' && key.toLowerCase() === 'content-type') {\n\t // Remove Content-Type if data is undefined\n\t delete requestHeaders[key];\n\t } else {\n\t // Otherwise add header to the request\n\t request.setRequestHeader(key, val);\n\t }\n\t });\n\t }\n\t\n\t // Add withCredentials to request if needed\n\t if (config.withCredentials) {\n\t request.withCredentials = true;\n\t }\n\t\n\t // Add responseType to request if needed\n\t if (config.responseType) {\n\t try {\n\t request.responseType = config.responseType;\n\t } catch (e) {\n\t // Expected DOMException thrown by browsers not compatible XMLHttpRequest Level 2.\n\t // But, this can be suppressed for 'json' type as it can be parsed by default 'transformResponse' function.\n\t if (config.responseType !== 'json') {\n\t throw e;\n\t }\n\t }\n\t }\n\t\n\t // Handle progress if needed\n\t if (typeof config.onDownloadProgress === 'function') {\n\t request.addEventListener('progress', config.onDownloadProgress);\n\t }\n\t\n\t // Not all browsers support upload events\n\t if (typeof config.onUploadProgress === 'function' && request.upload) {\n\t request.upload.addEventListener('progress', config.onUploadProgress);\n\t }\n\t\n\t if (config.cancelToken) {\n\t // Handle cancellation\n\t config.cancelToken.promise.then(function onCanceled(cancel) {\n\t if (!request) {\n\t return;\n\t }\n\t\n\t request.abort();\n\t reject(cancel);\n\t // Clean up request\n\t request = null;\n\t });\n\t }\n\t\n\t if (requestData === undefined) {\n\t requestData = null;\n\t }\n\t\n\t // Send the request\n\t request.send(requestData);\n\t });\n\t};\n\n\n/***/ }),\n/* 9 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tvar createError = __webpack_require__(10);\n\t\n\t/**\n\t * Resolve or reject a Promise based on response status.\n\t *\n\t * @param {Function} resolve A function that resolves the promise.\n\t * @param {Function} reject A function that rejects the promise.\n\t * @param {object} response The response.\n\t */\n\tmodule.exports = function settle(resolve, reject, response) {\n\t var validateStatus = response.config.validateStatus;\n\t // Note: status is not exposed by XDomainRequest\n\t if (!response.status || !validateStatus || validateStatus(response.status)) {\n\t resolve(response);\n\t } else {\n\t reject(createError(\n\t 'Request failed with status code ' + response.status,\n\t response.config,\n\t null,\n\t response.request,\n\t response\n\t ));\n\t }\n\t};\n\n\n/***/ }),\n/* 10 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tvar enhanceError = __webpack_require__(11);\n\t\n\t/**\n\t * Create an Error with the specified message, config, error code, request and response.\n\t *\n\t * @param {string} message The error message.\n\t * @param {Object} config The config.\n\t * @param {string} [code] The error code (for example, 'ECONNABORTED').\n\t * @param {Object} [request] The request.\n\t * @param {Object} [response] The response.\n\t * @returns {Error} The created error.\n\t */\n\tmodule.exports = function createError(message, config, code, request, response) {\n\t var error = new Error(message);\n\t return enhanceError(error, config, code, request, response);\n\t};\n\n\n/***/ }),\n/* 11 */\n/***/ (function(module, exports) {\n\n\t'use strict';\n\t\n\t/**\n\t * Update an Error with the specified config, error code, and response.\n\t *\n\t * @param {Error} error The error to update.\n\t * @param {Object} config The config.\n\t * @param {string} [code] The error code (for example, 'ECONNABORTED').\n\t * @param {Object} [request] The request.\n\t * @param {Object} [response] The response.\n\t * @returns {Error} The error.\n\t */\n\tmodule.exports = function enhanceError(error, config, code, request, response) {\n\t error.config = config;\n\t if (code) {\n\t error.code = code;\n\t }\n\t error.request = request;\n\t error.response = response;\n\t return error;\n\t};\n\n\n/***/ }),\n/* 12 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tvar utils = __webpack_require__(2);\n\t\n\tfunction encode(val) {\n\t return encodeURIComponent(val).\n\t replace(/%40/gi, '@').\n\t replace(/%3A/gi, ':').\n\t replace(/%24/g, '$').\n\t replace(/%2C/gi, ',').\n\t replace(/%20/g, '+').\n\t replace(/%5B/gi, '[').\n\t replace(/%5D/gi, ']');\n\t}\n\t\n\t/**\n\t * Build a URL by appending params to the end\n\t *\n\t * @param {string} url The base of the url (e.g., http://www.google.com)\n\t * @param {object} [params] The params to be appended\n\t * @returns {string} The formatted url\n\t */\n\tmodule.exports = function buildURL(url, params, paramsSerializer) {\n\t /*eslint no-param-reassign:0*/\n\t if (!params) {\n\t return url;\n\t }\n\t\n\t var serializedParams;\n\t if (paramsSerializer) {\n\t serializedParams = paramsSerializer(params);\n\t } else if (utils.isURLSearchParams(params)) {\n\t serializedParams = params.toString();\n\t } else {\n\t var parts = [];\n\t\n\t utils.forEach(params, function serialize(val, key) {\n\t if (val === null || typeof val === 'undefined') {\n\t return;\n\t }\n\t\n\t if (utils.isArray(val)) {\n\t key = key + '[]';\n\t } else {\n\t val = [val];\n\t }\n\t\n\t utils.forEach(val, function parseValue(v) {\n\t if (utils.isDate(v)) {\n\t v = v.toISOString();\n\t } else if (utils.isObject(v)) {\n\t v = JSON.stringify(v);\n\t }\n\t parts.push(encode(key) + '=' + encode(v));\n\t });\n\t });\n\t\n\t serializedParams = parts.join('&');\n\t }\n\t\n\t if (serializedParams) {\n\t url += (url.indexOf('?') === -1 ? '?' : '&') + serializedParams;\n\t }\n\t\n\t return url;\n\t};\n\n\n/***/ }),\n/* 13 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tvar utils = __webpack_require__(2);\n\t\n\t// Headers whose duplicates are ignored by node\n\t// c.f. https://nodejs.org/api/http.html#http_message_headers\n\tvar ignoreDuplicateOf = [\n\t 'age', 'authorization', 'content-length', 'content-type', 'etag',\n\t 'expires', 'from', 'host', 'if-modified-since', 'if-unmodified-since',\n\t 'last-modified', 'location', 'max-forwards', 'proxy-authorization',\n\t 'referer', 'retry-after', 'user-agent'\n\t];\n\t\n\t/**\n\t * Parse headers into an object\n\t *\n\t * ```\n\t * Date: Wed, 27 Aug 2014 08:58:49 GMT\n\t * Content-Type: application/json\n\t * Connection: keep-alive\n\t * Transfer-Encoding: chunked\n\t * ```\n\t *\n\t * @param {String} headers Headers needing to be parsed\n\t * @returns {Object} Headers parsed into an object\n\t */\n\tmodule.exports = function parseHeaders(headers) {\n\t var parsed = {};\n\t var key;\n\t var val;\n\t var i;\n\t\n\t if (!headers) { return parsed; }\n\t\n\t utils.forEach(headers.split('\\n'), function parser(line) {\n\t i = line.indexOf(':');\n\t key = utils.trim(line.substr(0, i)).toLowerCase();\n\t val = utils.trim(line.substr(i + 1));\n\t\n\t if (key) {\n\t if (parsed[key] && ignoreDuplicateOf.indexOf(key) >= 0) {\n\t return;\n\t }\n\t if (key === 'set-cookie') {\n\t parsed[key] = (parsed[key] ? parsed[key] : []).concat([val]);\n\t } else {\n\t parsed[key] = parsed[key] ? parsed[key] + ', ' + val : val;\n\t }\n\t }\n\t });\n\t\n\t return parsed;\n\t};\n\n\n/***/ }),\n/* 14 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tvar utils = __webpack_require__(2);\n\t\n\tmodule.exports = (\n\t utils.isStandardBrowserEnv() ?\n\t\n\t // Standard browser envs have full support of the APIs needed to test\n\t // whether the request URL is of the same origin as current location.\n\t (function standardBrowserEnv() {\n\t var msie = /(msie|trident)/i.test(navigator.userAgent);\n\t var urlParsingNode = document.createElement('a');\n\t var originURL;\n\t\n\t /**\n\t * Parse a URL to discover it's components\n\t *\n\t * @param {String} url The URL to be parsed\n\t * @returns {Object}\n\t */\n\t function resolveURL(url) {\n\t var href = url;\n\t\n\t if (msie) {\n\t // IE needs attribute set twice to normalize properties\n\t urlParsingNode.setAttribute('href', href);\n\t href = urlParsingNode.href;\n\t }\n\t\n\t urlParsingNode.setAttribute('href', href);\n\t\n\t // urlParsingNode provides the UrlUtils interface - http://url.spec.whatwg.org/#urlutils\n\t return {\n\t href: urlParsingNode.href,\n\t protocol: urlParsingNode.protocol ? urlParsingNode.protocol.replace(/:$/, '') : '',\n\t host: urlParsingNode.host,\n\t search: urlParsingNode.search ? urlParsingNode.search.replace(/^\\?/, '') : '',\n\t hash: urlParsingNode.hash ? urlParsingNode.hash.replace(/^#/, '') : '',\n\t hostname: urlParsingNode.hostname,\n\t port: urlParsingNode.port,\n\t pathname: (urlParsingNode.pathname.charAt(0) === '/') ?\n\t urlParsingNode.pathname :\n\t '/' + urlParsingNode.pathname\n\t };\n\t }\n\t\n\t originURL = resolveURL(window.location.href);\n\t\n\t /**\n\t * Determine if a URL shares the same origin as the current location\n\t *\n\t * @param {String} requestURL The URL to test\n\t * @returns {boolean} True if URL shares the same origin, otherwise false\n\t */\n\t return function isURLSameOrigin(requestURL) {\n\t var parsed = (utils.isString(requestURL)) ? resolveURL(requestURL) : requestURL;\n\t return (parsed.protocol === originURL.protocol &&\n\t parsed.host === originURL.host);\n\t };\n\t })() :\n\t\n\t // Non standard browser envs (web workers, react-native) lack needed support.\n\t (function nonStandardBrowserEnv() {\n\t return function isURLSameOrigin() {\n\t return true;\n\t };\n\t })()\n\t);\n\n\n/***/ }),\n/* 15 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tvar utils = __webpack_require__(2);\n\t\n\tmodule.exports = (\n\t utils.isStandardBrowserEnv() ?\n\t\n\t // Standard browser envs support document.cookie\n\t (function standardBrowserEnv() {\n\t return {\n\t write: function write(name, value, expires, path, domain, secure) {\n\t var cookie = [];\n\t cookie.push(name + '=' + encodeURIComponent(value));\n\t\n\t if (utils.isNumber(expires)) {\n\t cookie.push('expires=' + new Date(expires).toGMTString());\n\t }\n\t\n\t if (utils.isString(path)) {\n\t cookie.push('path=' + path);\n\t }\n\t\n\t if (utils.isString(domain)) {\n\t cookie.push('domain=' + domain);\n\t }\n\t\n\t if (secure === true) {\n\t cookie.push('secure');\n\t }\n\t\n\t document.cookie = cookie.join('; ');\n\t },\n\t\n\t read: function read(name) {\n\t var match = document.cookie.match(new RegExp('(^|;\\\\s*)(' + name + ')=([^;]*)'));\n\t return (match ? decodeURIComponent(match[3]) : null);\n\t },\n\t\n\t remove: function remove(name) {\n\t this.write(name, '', Date.now() - 86400000);\n\t }\n\t };\n\t })() :\n\t\n\t // Non standard browser env (web workers, react-native) lack needed support.\n\t (function nonStandardBrowserEnv() {\n\t return {\n\t write: function write() {},\n\t read: function read() { return null; },\n\t remove: function remove() {}\n\t };\n\t })()\n\t);\n\n\n/***/ }),\n/* 16 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tvar utils = __webpack_require__(2);\n\t\n\tfunction InterceptorManager() {\n\t this.handlers = [];\n\t}\n\t\n\t/**\n\t * Add a new interceptor to the stack\n\t *\n\t * @param {Function} fulfilled The function to handle `then` for a `Promise`\n\t * @param {Function} rejected The function to handle `reject` for a `Promise`\n\t *\n\t * @return {Number} An ID used to remove interceptor later\n\t */\n\tInterceptorManager.prototype.use = function use(fulfilled, rejected) {\n\t this.handlers.push({\n\t fulfilled: fulfilled,\n\t rejected: rejected\n\t });\n\t return this.handlers.length - 1;\n\t};\n\t\n\t/**\n\t * Remove an interceptor from the stack\n\t *\n\t * @param {Number} id The ID that was returned by `use`\n\t */\n\tInterceptorManager.prototype.eject = function eject(id) {\n\t if (this.handlers[id]) {\n\t this.handlers[id] = null;\n\t }\n\t};\n\t\n\t/**\n\t * Iterate over all the registered interceptors\n\t *\n\t * This method is particularly useful for skipping over any\n\t * interceptors that may have become `null` calling `eject`.\n\t *\n\t * @param {Function} fn The function to call for each interceptor\n\t */\n\tInterceptorManager.prototype.forEach = function forEach(fn) {\n\t utils.forEach(this.handlers, function forEachHandler(h) {\n\t if (h !== null) {\n\t fn(h);\n\t }\n\t });\n\t};\n\t\n\tmodule.exports = InterceptorManager;\n\n\n/***/ }),\n/* 17 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tvar utils = __webpack_require__(2);\n\tvar transformData = __webpack_require__(18);\n\tvar isCancel = __webpack_require__(19);\n\tvar defaults = __webpack_require__(6);\n\tvar isAbsoluteURL = __webpack_require__(20);\n\tvar combineURLs = __webpack_require__(21);\n\t\n\t/**\n\t * Throws a `Cancel` if cancellation has been requested.\n\t */\n\tfunction throwIfCancellationRequested(config) {\n\t if (config.cancelToken) {\n\t config.cancelToken.throwIfRequested();\n\t }\n\t}\n\t\n\t/**\n\t * Dispatch a request to the server using the configured adapter.\n\t *\n\t * @param {object} config The config that is to be used for the request\n\t * @returns {Promise} The Promise to be fulfilled\n\t */\n\tmodule.exports = function dispatchRequest(config) {\n\t throwIfCancellationRequested(config);\n\t\n\t // Support baseURL config\n\t if (config.baseURL && !isAbsoluteURL(config.url)) {\n\t config.url = combineURLs(config.baseURL, config.url);\n\t }\n\t\n\t // Ensure headers exist\n\t config.headers = config.headers || {};\n\t\n\t // Transform request data\n\t config.data = transformData(\n\t config.data,\n\t config.headers,\n\t config.transformRequest\n\t );\n\t\n\t // Flatten headers\n\t config.headers = utils.merge(\n\t config.headers.common || {},\n\t config.headers[config.method] || {},\n\t config.headers || {}\n\t );\n\t\n\t utils.forEach(\n\t ['delete', 'get', 'head', 'post', 'put', 'patch', 'common'],\n\t function cleanHeaderConfig(method) {\n\t delete config.headers[method];\n\t }\n\t );\n\t\n\t var adapter = config.adapter || defaults.adapter;\n\t\n\t return adapter(config).then(function onAdapterResolution(response) {\n\t throwIfCancellationRequested(config);\n\t\n\t // Transform response data\n\t response.data = transformData(\n\t response.data,\n\t response.headers,\n\t config.transformResponse\n\t );\n\t\n\t return response;\n\t }, function onAdapterRejection(reason) {\n\t if (!isCancel(reason)) {\n\t throwIfCancellationRequested(config);\n\t\n\t // Transform response data\n\t if (reason && reason.response) {\n\t reason.response.data = transformData(\n\t reason.response.data,\n\t reason.response.headers,\n\t config.transformResponse\n\t );\n\t }\n\t }\n\t\n\t return Promise.reject(reason);\n\t });\n\t};\n\n\n/***/ }),\n/* 18 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tvar utils = __webpack_require__(2);\n\t\n\t/**\n\t * Transform the data for a request or a response\n\t *\n\t * @param {Object|String} data The data to be transformed\n\t * @param {Array} headers The headers for the request or response\n\t * @param {Array|Function} fns A single function or Array of functions\n\t * @returns {*} The resulting transformed data\n\t */\n\tmodule.exports = function transformData(data, headers, fns) {\n\t /*eslint no-param-reassign:0*/\n\t utils.forEach(fns, function transform(fn) {\n\t data = fn(data, headers);\n\t });\n\t\n\t return data;\n\t};\n\n\n/***/ }),\n/* 19 */\n/***/ (function(module, exports) {\n\n\t'use strict';\n\t\n\tmodule.exports = function isCancel(value) {\n\t return !!(value && value.__CANCEL__);\n\t};\n\n\n/***/ }),\n/* 20 */\n/***/ (function(module, exports) {\n\n\t'use strict';\n\t\n\t/**\n\t * Determines whether the specified URL is absolute\n\t *\n\t * @param {string} url The URL to test\n\t * @returns {boolean} True if the specified URL is absolute, otherwise false\n\t */\n\tmodule.exports = function isAbsoluteURL(url) {\n\t // A URL is considered absolute if it begins with \"://\" or \"//\" (protocol-relative URL).\n\t // RFC 3986 defines scheme name as a sequence of characters beginning with a letter and followed\n\t // by any combination of letters, digits, plus, period, or hyphen.\n\t return /^([a-z][a-z\\d\\+\\-\\.]*:)?\\/\\//i.test(url);\n\t};\n\n\n/***/ }),\n/* 21 */\n/***/ (function(module, exports) {\n\n\t'use strict';\n\t\n\t/**\n\t * Creates a new URL by combining the specified URLs\n\t *\n\t * @param {string} baseURL The base URL\n\t * @param {string} relativeURL The relative URL\n\t * @returns {string} The combined URL\n\t */\n\tmodule.exports = function combineURLs(baseURL, relativeURL) {\n\t return relativeURL\n\t ? baseURL.replace(/\\/+$/, '') + '/' + relativeURL.replace(/^\\/+/, '')\n\t : baseURL;\n\t};\n\n\n/***/ }),\n/* 22 */\n/***/ (function(module, exports) {\n\n\t'use strict';\n\t\n\t/**\n\t * A `Cancel` is an object that is thrown when an operation is canceled.\n\t *\n\t * @class\n\t * @param {string=} message The message.\n\t */\n\tfunction Cancel(message) {\n\t this.message = message;\n\t}\n\t\n\tCancel.prototype.toString = function toString() {\n\t return 'Cancel' + (this.message ? ': ' + this.message : '');\n\t};\n\t\n\tCancel.prototype.__CANCEL__ = true;\n\t\n\tmodule.exports = Cancel;\n\n\n/***/ }),\n/* 23 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tvar Cancel = __webpack_require__(22);\n\t\n\t/**\n\t * A `CancelToken` is an object that can be used to request cancellation of an operation.\n\t *\n\t * @class\n\t * @param {Function} executor The executor function.\n\t */\n\tfunction CancelToken(executor) {\n\t if (typeof executor !== 'function') {\n\t throw new TypeError('executor must be a function.');\n\t }\n\t\n\t var resolvePromise;\n\t this.promise = new Promise(function promiseExecutor(resolve) {\n\t resolvePromise = resolve;\n\t });\n\t\n\t var token = this;\n\t executor(function cancel(message) {\n\t if (token.reason) {\n\t // Cancellation has already been requested\n\t return;\n\t }\n\t\n\t token.reason = new Cancel(message);\n\t resolvePromise(token.reason);\n\t });\n\t}\n\t\n\t/**\n\t * Throws a `Cancel` if cancellation has been requested.\n\t */\n\tCancelToken.prototype.throwIfRequested = function throwIfRequested() {\n\t if (this.reason) {\n\t throw this.reason;\n\t }\n\t};\n\t\n\t/**\n\t * Returns an object that contains a new `CancelToken` and a function that, when called,\n\t * cancels the `CancelToken`.\n\t */\n\tCancelToken.source = function source() {\n\t var cancel;\n\t var token = new CancelToken(function executor(c) {\n\t cancel = c;\n\t });\n\t return {\n\t token: token,\n\t cancel: cancel\n\t };\n\t};\n\t\n\tmodule.exports = CancelToken;\n\n\n/***/ }),\n/* 24 */\n/***/ (function(module, exports) {\n\n\t'use strict';\n\t\n\t/**\n\t * Syntactic sugar for invoking a function and expanding an array for arguments.\n\t *\n\t * Common use case would be to use `Function.prototype.apply`.\n\t *\n\t * ```js\n\t * function f(x, y, z) {}\n\t * var args = [1, 2, 3];\n\t * f.apply(null, args);\n\t * ```\n\t *\n\t * With `spread` this example can be re-written.\n\t *\n\t * ```js\n\t * spread(function(x, y, z) {})([1, 2, 3]);\n\t * ```\n\t *\n\t * @param {Function} callback\n\t * @returns {Function}\n\t */\n\tmodule.exports = function spread(callback) {\n\t return function wrap(arr) {\n\t return callback.apply(null, arr);\n\t };\n\t};\n\n\n/***/ })\n/******/ ])\n});\n;\n\n\n// WEBPACK FOOTER //\n// axios.min.js"," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId])\n \t\t\treturn installedModules[moduleId].exports;\n\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\texports: {},\n \t\t\tid: moduleId,\n \t\t\tloaded: false\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.loaded = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(0);\n\n\n\n// WEBPACK FOOTER //\n// webpack/bootstrap 8949187259fb54f91ce7","module.exports = require('./lib/axios');\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./index.js\n// module id = 0\n// module chunks = 0","'use strict';\n\nvar utils = require('./utils');\nvar bind = require('./helpers/bind');\nvar Axios = require('./core/Axios');\nvar defaults = require('./defaults');\n\n/**\n * Create an instance of Axios\n *\n * @param {Object} defaultConfig The default config for the instance\n * @return {Axios} A new instance of Axios\n */\nfunction createInstance(defaultConfig) {\n var context = new Axios(defaultConfig);\n var instance = bind(Axios.prototype.request, context);\n\n // Copy axios.prototype to instance\n utils.extend(instance, Axios.prototype, context);\n\n // Copy context to instance\n utils.extend(instance, context);\n\n return instance;\n}\n\n// Create the default instance to be exported\nvar axios = createInstance(defaults);\n\n// Expose Axios class to allow class inheritance\naxios.Axios = Axios;\n\n// Factory for creating new instances\naxios.create = function create(instanceConfig) {\n return createInstance(utils.merge(defaults, instanceConfig));\n};\n\n// Expose Cancel & CancelToken\naxios.Cancel = require('./cancel/Cancel');\naxios.CancelToken = require('./cancel/CancelToken');\naxios.isCancel = require('./cancel/isCancel');\n\n// Expose all/spread\naxios.all = function all(promises) {\n return Promise.all(promises);\n};\naxios.spread = require('./helpers/spread');\n\nmodule.exports = axios;\n\n// Allow use of default import syntax in TypeScript\nmodule.exports.default = axios;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/axios.js\n// module id = 1\n// module chunks = 0","'use strict';\n\nvar bind = require('./helpers/bind');\nvar isBuffer = require('is-buffer');\n\n/*global toString:true*/\n\n// utils is a library of generic helper functions non-specific to axios\n\nvar toString = Object.prototype.toString;\n\n/**\n * Determine if a value is an Array\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is an Array, otherwise false\n */\nfunction isArray(val) {\n return toString.call(val) === '[object Array]';\n}\n\n/**\n * Determine if a value is an ArrayBuffer\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is an ArrayBuffer, otherwise false\n */\nfunction isArrayBuffer(val) {\n return toString.call(val) === '[object ArrayBuffer]';\n}\n\n/**\n * Determine if a value is a FormData\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is an FormData, otherwise false\n */\nfunction isFormData(val) {\n return (typeof FormData !== 'undefined') && (val instanceof FormData);\n}\n\n/**\n * Determine if a value is a view on an ArrayBuffer\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a view on an ArrayBuffer, otherwise false\n */\nfunction isArrayBufferView(val) {\n var result;\n if ((typeof ArrayBuffer !== 'undefined') && (ArrayBuffer.isView)) {\n result = ArrayBuffer.isView(val);\n } else {\n result = (val) && (val.buffer) && (val.buffer instanceof ArrayBuffer);\n }\n return result;\n}\n\n/**\n * Determine if a value is a String\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a String, otherwise false\n */\nfunction isString(val) {\n return typeof val === 'string';\n}\n\n/**\n * Determine if a value is a Number\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Number, otherwise false\n */\nfunction isNumber(val) {\n return typeof val === 'number';\n}\n\n/**\n * Determine if a value is undefined\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if the value is undefined, otherwise false\n */\nfunction isUndefined(val) {\n return typeof val === 'undefined';\n}\n\n/**\n * Determine if a value is an Object\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is an Object, otherwise false\n */\nfunction isObject(val) {\n return val !== null && typeof val === 'object';\n}\n\n/**\n * Determine if a value is a Date\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Date, otherwise false\n */\nfunction isDate(val) {\n return toString.call(val) === '[object Date]';\n}\n\n/**\n * Determine if a value is a File\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a File, otherwise false\n */\nfunction isFile(val) {\n return toString.call(val) === '[object File]';\n}\n\n/**\n * Determine if a value is a Blob\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Blob, otherwise false\n */\nfunction isBlob(val) {\n return toString.call(val) === '[object Blob]';\n}\n\n/**\n * Determine if a value is a Function\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Function, otherwise false\n */\nfunction isFunction(val) {\n return toString.call(val) === '[object Function]';\n}\n\n/**\n * Determine if a value is a Stream\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Stream, otherwise false\n */\nfunction isStream(val) {\n return isObject(val) && isFunction(val.pipe);\n}\n\n/**\n * Determine if a value is a URLSearchParams object\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a URLSearchParams object, otherwise false\n */\nfunction isURLSearchParams(val) {\n return typeof URLSearchParams !== 'undefined' && val instanceof URLSearchParams;\n}\n\n/**\n * Trim excess whitespace off the beginning and end of a string\n *\n * @param {String} str The String to trim\n * @returns {String} The String freed of excess whitespace\n */\nfunction trim(str) {\n return str.replace(/^\\s*/, '').replace(/\\s*$/, '');\n}\n\n/**\n * Determine if we're running in a standard browser environment\n *\n * This allows axios to run in a web worker, and react-native.\n * Both environments support XMLHttpRequest, but not fully standard globals.\n *\n * web workers:\n * typeof window -> undefined\n * typeof document -> undefined\n *\n * react-native:\n * navigator.product -> 'ReactNative'\n */\nfunction isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && navigator.product === 'ReactNative') {\n return false;\n }\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined'\n );\n}\n\n/**\n * Iterate over an Array or an Object invoking a function for each item.\n *\n * If `obj` is an Array callback will be called passing\n * the value, index, and complete array for each item.\n *\n * If 'obj' is an Object callback will be called passing\n * the value, key, and complete object for each property.\n *\n * @param {Object|Array} obj The object to iterate\n * @param {Function} fn The callback to invoke for each item\n */\nfunction forEach(obj, fn) {\n // Don't bother if no value provided\n if (obj === null || typeof obj === 'undefined') {\n return;\n }\n\n // Force an array if not already something iterable\n if (typeof obj !== 'object') {\n /*eslint no-param-reassign:0*/\n obj = [obj];\n }\n\n if (isArray(obj)) {\n // Iterate over array values\n for (var i = 0, l = obj.length; i < l; i++) {\n fn.call(null, obj[i], i, obj);\n }\n } else {\n // Iterate over object keys\n for (var key in obj) {\n if (Object.prototype.hasOwnProperty.call(obj, key)) {\n fn.call(null, obj[key], key, obj);\n }\n }\n }\n}\n\n/**\n * Accepts varargs expecting each argument to be an object, then\n * immutably merges the properties of each object and returns result.\n *\n * When multiple objects contain the same key the later object in\n * the arguments list will take precedence.\n *\n * Example:\n *\n * ```js\n * var result = merge({foo: 123}, {foo: 456});\n * console.log(result.foo); // outputs 456\n * ```\n *\n * @param {Object} obj1 Object to merge\n * @returns {Object} Result of all merge properties\n */\nfunction merge(/* obj1, obj2, obj3, ... */) {\n var result = {};\n function assignValue(val, key) {\n if (typeof result[key] === 'object' && typeof val === 'object') {\n result[key] = merge(result[key], val);\n } else {\n result[key] = val;\n }\n }\n\n for (var i = 0, l = arguments.length; i < l; i++) {\n forEach(arguments[i], assignValue);\n }\n return result;\n}\n\n/**\n * Extends object a by mutably adding to it the properties of object b.\n *\n * @param {Object} a The object to be extended\n * @param {Object} b The object to copy properties from\n * @param {Object} thisArg The object to bind function to\n * @return {Object} The resulting value of object a\n */\nfunction extend(a, b, thisArg) {\n forEach(b, function assignValue(val, key) {\n if (thisArg && typeof val === 'function') {\n a[key] = bind(val, thisArg);\n } else {\n a[key] = val;\n }\n });\n return a;\n}\n\nmodule.exports = {\n isArray: isArray,\n isArrayBuffer: isArrayBuffer,\n isBuffer: isBuffer,\n isFormData: isFormData,\n isArrayBufferView: isArrayBufferView,\n isString: isString,\n isNumber: isNumber,\n isObject: isObject,\n isUndefined: isUndefined,\n isDate: isDate,\n isFile: isFile,\n isBlob: isBlob,\n isFunction: isFunction,\n isStream: isStream,\n isURLSearchParams: isURLSearchParams,\n isStandardBrowserEnv: isStandardBrowserEnv,\n forEach: forEach,\n merge: merge,\n extend: extend,\n trim: trim\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/utils.js\n// module id = 2\n// module chunks = 0","'use strict';\n\nmodule.exports = function bind(fn, thisArg) {\n return function wrap() {\n var args = new Array(arguments.length);\n for (var i = 0; i < args.length; i++) {\n args[i] = arguments[i];\n }\n return fn.apply(thisArg, args);\n };\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/helpers/bind.js\n// module id = 3\n// module chunks = 0","/*!\n * Determine if an object is a Buffer\n *\n * @author Feross Aboukhadijeh \n * @license MIT\n */\n\nmodule.exports = function isBuffer (obj) {\n return obj != null && obj.constructor != null &&\n typeof obj.constructor.isBuffer === 'function' && obj.constructor.isBuffer(obj)\n}\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/is-buffer/index.js\n// module id = 4\n// module chunks = 0","'use strict';\n\nvar defaults = require('./../defaults');\nvar utils = require('./../utils');\nvar InterceptorManager = require('./InterceptorManager');\nvar dispatchRequest = require('./dispatchRequest');\n\n/**\n * Create a new instance of Axios\n *\n * @param {Object} instanceConfig The default config for the instance\n */\nfunction Axios(instanceConfig) {\n this.defaults = instanceConfig;\n this.interceptors = {\n request: new InterceptorManager(),\n response: new InterceptorManager()\n };\n}\n\n/**\n * Dispatch a request\n *\n * @param {Object} config The config specific for this request (merged with this.defaults)\n */\nAxios.prototype.request = function request(config) {\n /*eslint no-param-reassign:0*/\n // Allow for axios('example/url'[, config]) a la fetch API\n if (typeof config === 'string') {\n config = utils.merge({\n url: arguments[0]\n }, arguments[1]);\n }\n\n config = utils.merge(defaults, {method: 'get'}, this.defaults, config);\n config.method = config.method.toLowerCase();\n\n // Hook up interceptors middleware\n var chain = [dispatchRequest, undefined];\n var promise = Promise.resolve(config);\n\n this.interceptors.request.forEach(function unshiftRequestInterceptors(interceptor) {\n chain.unshift(interceptor.fulfilled, interceptor.rejected);\n });\n\n this.interceptors.response.forEach(function pushResponseInterceptors(interceptor) {\n chain.push(interceptor.fulfilled, interceptor.rejected);\n });\n\n while (chain.length) {\n promise = promise.then(chain.shift(), chain.shift());\n }\n\n return promise;\n};\n\n// Provide aliases for supported request methods\nutils.forEach(['delete', 'get', 'head', 'options'], function forEachMethodNoData(method) {\n /*eslint func-names:0*/\n Axios.prototype[method] = function(url, config) {\n return this.request(utils.merge(config || {}, {\n method: method,\n url: url\n }));\n };\n});\n\nutils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {\n /*eslint func-names:0*/\n Axios.prototype[method] = function(url, data, config) {\n return this.request(utils.merge(config || {}, {\n method: method,\n url: url,\n data: data\n }));\n };\n});\n\nmodule.exports = Axios;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/core/Axios.js\n// module id = 5\n// module chunks = 0","'use strict';\n\nvar utils = require('./utils');\nvar normalizeHeaderName = require('./helpers/normalizeHeaderName');\n\nvar DEFAULT_CONTENT_TYPE = {\n 'Content-Type': 'application/x-www-form-urlencoded'\n};\n\nfunction setContentTypeIfUnset(headers, value) {\n if (!utils.isUndefined(headers) && utils.isUndefined(headers['Content-Type'])) {\n headers['Content-Type'] = value;\n }\n}\n\nfunction getDefaultAdapter() {\n var adapter;\n if (typeof XMLHttpRequest !== 'undefined') {\n // For browsers use XHR adapter\n adapter = require('./adapters/xhr');\n } else if (typeof process !== 'undefined') {\n // For node use HTTP adapter\n adapter = require('./adapters/http');\n }\n return adapter;\n}\n\nvar defaults = {\n adapter: getDefaultAdapter(),\n\n transformRequest: [function transformRequest(data, headers) {\n normalizeHeaderName(headers, 'Content-Type');\n if (utils.isFormData(data) ||\n utils.isArrayBuffer(data) ||\n utils.isBuffer(data) ||\n utils.isStream(data) ||\n utils.isFile(data) ||\n utils.isBlob(data)\n ) {\n return data;\n }\n if (utils.isArrayBufferView(data)) {\n return data.buffer;\n }\n if (utils.isURLSearchParams(data)) {\n setContentTypeIfUnset(headers, 'application/x-www-form-urlencoded;charset=utf-8');\n return data.toString();\n }\n if (utils.isObject(data)) {\n setContentTypeIfUnset(headers, 'application/json;charset=utf-8');\n return JSON.stringify(data);\n }\n return data;\n }],\n\n transformResponse: [function transformResponse(data) {\n /*eslint no-param-reassign:0*/\n if (typeof data === 'string') {\n try {\n data = JSON.parse(data);\n } catch (e) { /* Ignore */ }\n }\n return data;\n }],\n\n /**\n * A timeout in milliseconds to abort a request. If set to 0 (default) a\n * timeout is not created.\n */\n timeout: 0,\n\n xsrfCookieName: 'XSRF-TOKEN',\n xsrfHeaderName: 'X-XSRF-TOKEN',\n\n maxContentLength: -1,\n\n validateStatus: function validateStatus(status) {\n return status >= 200 && status < 300;\n }\n};\n\ndefaults.headers = {\n common: {\n 'Accept': 'application/json, text/plain, */*'\n }\n};\n\nutils.forEach(['delete', 'get', 'head'], function forEachMethodNoData(method) {\n defaults.headers[method] = {};\n});\n\nutils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {\n defaults.headers[method] = utils.merge(DEFAULT_CONTENT_TYPE);\n});\n\nmodule.exports = defaults;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/defaults.js\n// module id = 6\n// module chunks = 0","'use strict';\n\nvar utils = require('../utils');\n\nmodule.exports = function normalizeHeaderName(headers, normalizedName) {\n utils.forEach(headers, function processHeader(value, name) {\n if (name !== normalizedName && name.toUpperCase() === normalizedName.toUpperCase()) {\n headers[normalizedName] = value;\n delete headers[name];\n }\n });\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/helpers/normalizeHeaderName.js\n// module id = 7\n// module chunks = 0","'use strict';\n\nvar utils = require('./../utils');\nvar settle = require('./../core/settle');\nvar buildURL = require('./../helpers/buildURL');\nvar parseHeaders = require('./../helpers/parseHeaders');\nvar isURLSameOrigin = require('./../helpers/isURLSameOrigin');\nvar createError = require('../core/createError');\n\nmodule.exports = function xhrAdapter(config) {\n return new Promise(function dispatchXhrRequest(resolve, reject) {\n var requestData = config.data;\n var requestHeaders = config.headers;\n\n if (utils.isFormData(requestData)) {\n delete requestHeaders['Content-Type']; // Let the browser set it\n }\n\n var request = new XMLHttpRequest();\n\n // HTTP basic authentication\n if (config.auth) {\n var username = config.auth.username || '';\n var password = config.auth.password || '';\n requestHeaders.Authorization = 'Basic ' + btoa(username + ':' + password);\n }\n\n request.open(config.method.toUpperCase(), buildURL(config.url, config.params, config.paramsSerializer), true);\n\n // Set the request timeout in MS\n request.timeout = config.timeout;\n\n // Listen for ready state\n request.onreadystatechange = function handleLoad() {\n if (!request || request.readyState !== 4) {\n return;\n }\n\n // The request errored out and we didn't get a response, this will be\n // handled by onerror instead\n // With one exception: request that using file: protocol, most browsers\n // will return status as 0 even though it's a successful request\n if (request.status === 0 && !(request.responseURL && request.responseURL.indexOf('file:') === 0)) {\n return;\n }\n\n // Prepare the response\n var responseHeaders = 'getAllResponseHeaders' in request ? parseHeaders(request.getAllResponseHeaders()) : null;\n var responseData = !config.responseType || config.responseType === 'text' ? request.responseText : request.response;\n var response = {\n data: responseData,\n status: request.status,\n statusText: request.statusText,\n headers: responseHeaders,\n config: config,\n request: request\n };\n\n settle(resolve, reject, response);\n\n // Clean up request\n request = null;\n };\n\n // Handle low level network errors\n request.onerror = function handleError() {\n // Real errors are hidden from us by the browser\n // onerror should only fire if it's a network error\n reject(createError('Network Error', config, null, request));\n\n // Clean up request\n request = null;\n };\n\n // Handle timeout\n request.ontimeout = function handleTimeout() {\n reject(createError('timeout of ' + config.timeout + 'ms exceeded', config, 'ECONNABORTED',\n request));\n\n // Clean up request\n request = null;\n };\n\n // Add xsrf header\n // This is only done if running in a standard browser environment.\n // Specifically not if we're in a web worker, or react-native.\n if (utils.isStandardBrowserEnv()) {\n var cookies = require('./../helpers/cookies');\n\n // Add xsrf header\n var xsrfValue = (config.withCredentials || isURLSameOrigin(config.url)) && config.xsrfCookieName ?\n cookies.read(config.xsrfCookieName) :\n undefined;\n\n if (xsrfValue) {\n requestHeaders[config.xsrfHeaderName] = xsrfValue;\n }\n }\n\n // Add headers to the request\n if ('setRequestHeader' in request) {\n utils.forEach(requestHeaders, function setRequestHeader(val, key) {\n if (typeof requestData === 'undefined' && key.toLowerCase() === 'content-type') {\n // Remove Content-Type if data is undefined\n delete requestHeaders[key];\n } else {\n // Otherwise add header to the request\n request.setRequestHeader(key, val);\n }\n });\n }\n\n // Add withCredentials to request if needed\n if (config.withCredentials) {\n request.withCredentials = true;\n }\n\n // Add responseType to request if needed\n if (config.responseType) {\n try {\n request.responseType = config.responseType;\n } catch (e) {\n // Expected DOMException thrown by browsers not compatible XMLHttpRequest Level 2.\n // But, this can be suppressed for 'json' type as it can be parsed by default 'transformResponse' function.\n if (config.responseType !== 'json') {\n throw e;\n }\n }\n }\n\n // Handle progress if needed\n if (typeof config.onDownloadProgress === 'function') {\n request.addEventListener('progress', config.onDownloadProgress);\n }\n\n // Not all browsers support upload events\n if (typeof config.onUploadProgress === 'function' && request.upload) {\n request.upload.addEventListener('progress', config.onUploadProgress);\n }\n\n if (config.cancelToken) {\n // Handle cancellation\n config.cancelToken.promise.then(function onCanceled(cancel) {\n if (!request) {\n return;\n }\n\n request.abort();\n reject(cancel);\n // Clean up request\n request = null;\n });\n }\n\n if (requestData === undefined) {\n requestData = null;\n }\n\n // Send the request\n request.send(requestData);\n });\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/adapters/xhr.js\n// module id = 8\n// module chunks = 0","'use strict';\n\nvar createError = require('./createError');\n\n/**\n * Resolve or reject a Promise based on response status.\n *\n * @param {Function} resolve A function that resolves the promise.\n * @param {Function} reject A function that rejects the promise.\n * @param {object} response The response.\n */\nmodule.exports = function settle(resolve, reject, response) {\n var validateStatus = response.config.validateStatus;\n // Note: status is not exposed by XDomainRequest\n if (!response.status || !validateStatus || validateStatus(response.status)) {\n resolve(response);\n } else {\n reject(createError(\n 'Request failed with status code ' + response.status,\n response.config,\n null,\n response.request,\n response\n ));\n }\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/core/settle.js\n// module id = 9\n// module chunks = 0","'use strict';\n\nvar enhanceError = require('./enhanceError');\n\n/**\n * Create an Error with the specified message, config, error code, request and response.\n *\n * @param {string} message The error message.\n * @param {Object} config The config.\n * @param {string} [code] The error code (for example, 'ECONNABORTED').\n * @param {Object} [request] The request.\n * @param {Object} [response] The response.\n * @returns {Error} The created error.\n */\nmodule.exports = function createError(message, config, code, request, response) {\n var error = new Error(message);\n return enhanceError(error, config, code, request, response);\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/core/createError.js\n// module id = 10\n// module chunks = 0","'use strict';\n\n/**\n * Update an Error with the specified config, error code, and response.\n *\n * @param {Error} error The error to update.\n * @param {Object} config The config.\n * @param {string} [code] The error code (for example, 'ECONNABORTED').\n * @param {Object} [request] The request.\n * @param {Object} [response] The response.\n * @returns {Error} The error.\n */\nmodule.exports = function enhanceError(error, config, code, request, response) {\n error.config = config;\n if (code) {\n error.code = code;\n }\n error.request = request;\n error.response = response;\n return error;\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/core/enhanceError.js\n// module id = 11\n// module chunks = 0","'use strict';\n\nvar utils = require('./../utils');\n\nfunction encode(val) {\n return encodeURIComponent(val).\n replace(/%40/gi, '@').\n replace(/%3A/gi, ':').\n replace(/%24/g, '$').\n replace(/%2C/gi, ',').\n replace(/%20/g, '+').\n replace(/%5B/gi, '[').\n replace(/%5D/gi, ']');\n}\n\n/**\n * Build a URL by appending params to the end\n *\n * @param {string} url The base of the url (e.g., http://www.google.com)\n * @param {object} [params] The params to be appended\n * @returns {string} The formatted url\n */\nmodule.exports = function buildURL(url, params, paramsSerializer) {\n /*eslint no-param-reassign:0*/\n if (!params) {\n return url;\n }\n\n var serializedParams;\n if (paramsSerializer) {\n serializedParams = paramsSerializer(params);\n } else if (utils.isURLSearchParams(params)) {\n serializedParams = params.toString();\n } else {\n var parts = [];\n\n utils.forEach(params, function serialize(val, key) {\n if (val === null || typeof val === 'undefined') {\n return;\n }\n\n if (utils.isArray(val)) {\n key = key + '[]';\n } else {\n val = [val];\n }\n\n utils.forEach(val, function parseValue(v) {\n if (utils.isDate(v)) {\n v = v.toISOString();\n } else if (utils.isObject(v)) {\n v = JSON.stringify(v);\n }\n parts.push(encode(key) + '=' + encode(v));\n });\n });\n\n serializedParams = parts.join('&');\n }\n\n if (serializedParams) {\n url += (url.indexOf('?') === -1 ? '?' : '&') + serializedParams;\n }\n\n return url;\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/helpers/buildURL.js\n// module id = 12\n// module chunks = 0","'use strict';\n\nvar utils = require('./../utils');\n\n// Headers whose duplicates are ignored by node\n// c.f. https://nodejs.org/api/http.html#http_message_headers\nvar ignoreDuplicateOf = [\n 'age', 'authorization', 'content-length', 'content-type', 'etag',\n 'expires', 'from', 'host', 'if-modified-since', 'if-unmodified-since',\n 'last-modified', 'location', 'max-forwards', 'proxy-authorization',\n 'referer', 'retry-after', 'user-agent'\n];\n\n/**\n * Parse headers into an object\n *\n * ```\n * Date: Wed, 27 Aug 2014 08:58:49 GMT\n * Content-Type: application/json\n * Connection: keep-alive\n * Transfer-Encoding: chunked\n * ```\n *\n * @param {String} headers Headers needing to be parsed\n * @returns {Object} Headers parsed into an object\n */\nmodule.exports = function parseHeaders(headers) {\n var parsed = {};\n var key;\n var val;\n var i;\n\n if (!headers) { return parsed; }\n\n utils.forEach(headers.split('\\n'), function parser(line) {\n i = line.indexOf(':');\n key = utils.trim(line.substr(0, i)).toLowerCase();\n val = utils.trim(line.substr(i + 1));\n\n if (key) {\n if (parsed[key] && ignoreDuplicateOf.indexOf(key) >= 0) {\n return;\n }\n if (key === 'set-cookie') {\n parsed[key] = (parsed[key] ? parsed[key] : []).concat([val]);\n } else {\n parsed[key] = parsed[key] ? parsed[key] + ', ' + val : val;\n }\n }\n });\n\n return parsed;\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/helpers/parseHeaders.js\n// module id = 13\n// module chunks = 0","'use strict';\n\nvar utils = require('./../utils');\n\nmodule.exports = (\n utils.isStandardBrowserEnv() ?\n\n // Standard browser envs have full support of the APIs needed to test\n // whether the request URL is of the same origin as current location.\n (function standardBrowserEnv() {\n var msie = /(msie|trident)/i.test(navigator.userAgent);\n var urlParsingNode = document.createElement('a');\n var originURL;\n\n /**\n * Parse a URL to discover it's components\n *\n * @param {String} url The URL to be parsed\n * @returns {Object}\n */\n function resolveURL(url) {\n var href = url;\n\n if (msie) {\n // IE needs attribute set twice to normalize properties\n urlParsingNode.setAttribute('href', href);\n href = urlParsingNode.href;\n }\n\n urlParsingNode.setAttribute('href', href);\n\n // urlParsingNode provides the UrlUtils interface - http://url.spec.whatwg.org/#urlutils\n return {\n href: urlParsingNode.href,\n protocol: urlParsingNode.protocol ? urlParsingNode.protocol.replace(/:$/, '') : '',\n host: urlParsingNode.host,\n search: urlParsingNode.search ? urlParsingNode.search.replace(/^\\?/, '') : '',\n hash: urlParsingNode.hash ? urlParsingNode.hash.replace(/^#/, '') : '',\n hostname: urlParsingNode.hostname,\n port: urlParsingNode.port,\n pathname: (urlParsingNode.pathname.charAt(0) === '/') ?\n urlParsingNode.pathname :\n '/' + urlParsingNode.pathname\n };\n }\n\n originURL = resolveURL(window.location.href);\n\n /**\n * Determine if a URL shares the same origin as the current location\n *\n * @param {String} requestURL The URL to test\n * @returns {boolean} True if URL shares the same origin, otherwise false\n */\n return function isURLSameOrigin(requestURL) {\n var parsed = (utils.isString(requestURL)) ? resolveURL(requestURL) : requestURL;\n return (parsed.protocol === originURL.protocol &&\n parsed.host === originURL.host);\n };\n })() :\n\n // Non standard browser envs (web workers, react-native) lack needed support.\n (function nonStandardBrowserEnv() {\n return function isURLSameOrigin() {\n return true;\n };\n })()\n);\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/helpers/isURLSameOrigin.js\n// module id = 14\n// module chunks = 0","'use strict';\n\nvar utils = require('./../utils');\n\nmodule.exports = (\n utils.isStandardBrowserEnv() ?\n\n // Standard browser envs support document.cookie\n (function standardBrowserEnv() {\n return {\n write: function write(name, value, expires, path, domain, secure) {\n var cookie = [];\n cookie.push(name + '=' + encodeURIComponent(value));\n\n if (utils.isNumber(expires)) {\n cookie.push('expires=' + new Date(expires).toGMTString());\n }\n\n if (utils.isString(path)) {\n cookie.push('path=' + path);\n }\n\n if (utils.isString(domain)) {\n cookie.push('domain=' + domain);\n }\n\n if (secure === true) {\n cookie.push('secure');\n }\n\n document.cookie = cookie.join('; ');\n },\n\n read: function read(name) {\n var match = document.cookie.match(new RegExp('(^|;\\\\s*)(' + name + ')=([^;]*)'));\n return (match ? decodeURIComponent(match[3]) : null);\n },\n\n remove: function remove(name) {\n this.write(name, '', Date.now() - 86400000);\n }\n };\n })() :\n\n // Non standard browser env (web workers, react-native) lack needed support.\n (function nonStandardBrowserEnv() {\n return {\n write: function write() {},\n read: function read() { return null; },\n remove: function remove() {}\n };\n })()\n);\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/helpers/cookies.js\n// module id = 15\n// module chunks = 0","'use strict';\n\nvar utils = require('./../utils');\n\nfunction InterceptorManager() {\n this.handlers = [];\n}\n\n/**\n * Add a new interceptor to the stack\n *\n * @param {Function} fulfilled The function to handle `then` for a `Promise`\n * @param {Function} rejected The function to handle `reject` for a `Promise`\n *\n * @return {Number} An ID used to remove interceptor later\n */\nInterceptorManager.prototype.use = function use(fulfilled, rejected) {\n this.handlers.push({\n fulfilled: fulfilled,\n rejected: rejected\n });\n return this.handlers.length - 1;\n};\n\n/**\n * Remove an interceptor from the stack\n *\n * @param {Number} id The ID that was returned by `use`\n */\nInterceptorManager.prototype.eject = function eject(id) {\n if (this.handlers[id]) {\n this.handlers[id] = null;\n }\n};\n\n/**\n * Iterate over all the registered interceptors\n *\n * This method is particularly useful for skipping over any\n * interceptors that may have become `null` calling `eject`.\n *\n * @param {Function} fn The function to call for each interceptor\n */\nInterceptorManager.prototype.forEach = function forEach(fn) {\n utils.forEach(this.handlers, function forEachHandler(h) {\n if (h !== null) {\n fn(h);\n }\n });\n};\n\nmodule.exports = InterceptorManager;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/core/InterceptorManager.js\n// module id = 16\n// module chunks = 0","'use strict';\n\nvar utils = require('./../utils');\nvar transformData = require('./transformData');\nvar isCancel = require('../cancel/isCancel');\nvar defaults = require('../defaults');\nvar isAbsoluteURL = require('./../helpers/isAbsoluteURL');\nvar combineURLs = require('./../helpers/combineURLs');\n\n/**\n * Throws a `Cancel` if cancellation has been requested.\n */\nfunction throwIfCancellationRequested(config) {\n if (config.cancelToken) {\n config.cancelToken.throwIfRequested();\n }\n}\n\n/**\n * Dispatch a request to the server using the configured adapter.\n *\n * @param {object} config The config that is to be used for the request\n * @returns {Promise} The Promise to be fulfilled\n */\nmodule.exports = function dispatchRequest(config) {\n throwIfCancellationRequested(config);\n\n // Support baseURL config\n if (config.baseURL && !isAbsoluteURL(config.url)) {\n config.url = combineURLs(config.baseURL, config.url);\n }\n\n // Ensure headers exist\n config.headers = config.headers || {};\n\n // Transform request data\n config.data = transformData(\n config.data,\n config.headers,\n config.transformRequest\n );\n\n // Flatten headers\n config.headers = utils.merge(\n config.headers.common || {},\n config.headers[config.method] || {},\n config.headers || {}\n );\n\n utils.forEach(\n ['delete', 'get', 'head', 'post', 'put', 'patch', 'common'],\n function cleanHeaderConfig(method) {\n delete config.headers[method];\n }\n );\n\n var adapter = config.adapter || defaults.adapter;\n\n return adapter(config).then(function onAdapterResolution(response) {\n throwIfCancellationRequested(config);\n\n // Transform response data\n response.data = transformData(\n response.data,\n response.headers,\n config.transformResponse\n );\n\n return response;\n }, function onAdapterRejection(reason) {\n if (!isCancel(reason)) {\n throwIfCancellationRequested(config);\n\n // Transform response data\n if (reason && reason.response) {\n reason.response.data = transformData(\n reason.response.data,\n reason.response.headers,\n config.transformResponse\n );\n }\n }\n\n return Promise.reject(reason);\n });\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/core/dispatchRequest.js\n// module id = 17\n// module chunks = 0","'use strict';\n\nvar utils = require('./../utils');\n\n/**\n * Transform the data for a request or a response\n *\n * @param {Object|String} data The data to be transformed\n * @param {Array} headers The headers for the request or response\n * @param {Array|Function} fns A single function or Array of functions\n * @returns {*} The resulting transformed data\n */\nmodule.exports = function transformData(data, headers, fns) {\n /*eslint no-param-reassign:0*/\n utils.forEach(fns, function transform(fn) {\n data = fn(data, headers);\n });\n\n return data;\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/core/transformData.js\n// module id = 18\n// module chunks = 0","'use strict';\n\nmodule.exports = function isCancel(value) {\n return !!(value && value.__CANCEL__);\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/cancel/isCancel.js\n// module id = 19\n// module chunks = 0","'use strict';\n\n/**\n * Determines whether the specified URL is absolute\n *\n * @param {string} url The URL to test\n * @returns {boolean} True if the specified URL is absolute, otherwise false\n */\nmodule.exports = function isAbsoluteURL(url) {\n // A URL is considered absolute if it begins with \"://\" or \"//\" (protocol-relative URL).\n // RFC 3986 defines scheme name as a sequence of characters beginning with a letter and followed\n // by any combination of letters, digits, plus, period, or hyphen.\n return /^([a-z][a-z\\d\\+\\-\\.]*:)?\\/\\//i.test(url);\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/helpers/isAbsoluteURL.js\n// module id = 20\n// module chunks = 0","'use strict';\n\n/**\n * Creates a new URL by combining the specified URLs\n *\n * @param {string} baseURL The base URL\n * @param {string} relativeURL The relative URL\n * @returns {string} The combined URL\n */\nmodule.exports = function combineURLs(baseURL, relativeURL) {\n return relativeURL\n ? baseURL.replace(/\\/+$/, '') + '/' + relativeURL.replace(/^\\/+/, '')\n : baseURL;\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/helpers/combineURLs.js\n// module id = 21\n// module chunks = 0","'use strict';\n\n/**\n * A `Cancel` is an object that is thrown when an operation is canceled.\n *\n * @class\n * @param {string=} message The message.\n */\nfunction Cancel(message) {\n this.message = message;\n}\n\nCancel.prototype.toString = function toString() {\n return 'Cancel' + (this.message ? ': ' + this.message : '');\n};\n\nCancel.prototype.__CANCEL__ = true;\n\nmodule.exports = Cancel;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/cancel/Cancel.js\n// module id = 22\n// module chunks = 0","'use strict';\n\nvar Cancel = require('./Cancel');\n\n/**\n * A `CancelToken` is an object that can be used to request cancellation of an operation.\n *\n * @class\n * @param {Function} executor The executor function.\n */\nfunction CancelToken(executor) {\n if (typeof executor !== 'function') {\n throw new TypeError('executor must be a function.');\n }\n\n var resolvePromise;\n this.promise = new Promise(function promiseExecutor(resolve) {\n resolvePromise = resolve;\n });\n\n var token = this;\n executor(function cancel(message) {\n if (token.reason) {\n // Cancellation has already been requested\n return;\n }\n\n token.reason = new Cancel(message);\n resolvePromise(token.reason);\n });\n}\n\n/**\n * Throws a `Cancel` if cancellation has been requested.\n */\nCancelToken.prototype.throwIfRequested = function throwIfRequested() {\n if (this.reason) {\n throw this.reason;\n }\n};\n\n/**\n * Returns an object that contains a new `CancelToken` and a function that, when called,\n * cancels the `CancelToken`.\n */\nCancelToken.source = function source() {\n var cancel;\n var token = new CancelToken(function executor(c) {\n cancel = c;\n });\n return {\n token: token,\n cancel: cancel\n };\n};\n\nmodule.exports = CancelToken;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/cancel/CancelToken.js\n// module id = 23\n// module chunks = 0","'use strict';\n\n/**\n * Syntactic sugar for invoking a function and expanding an array for arguments.\n *\n * Common use case would be to use `Function.prototype.apply`.\n *\n * ```js\n * function f(x, y, z) {}\n * var args = [1, 2, 3];\n * f.apply(null, args);\n * ```\n *\n * With `spread` this example can be re-written.\n *\n * ```js\n * spread(function(x, y, z) {})([1, 2, 3]);\n * ```\n *\n * @param {Function} callback\n * @returns {Function}\n */\nmodule.exports = function spread(callback) {\n return function wrap(arr) {\n return callback.apply(null, arr);\n };\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/helpers/spread.js\n// module id = 24\n// module chunks = 0"],"sourceRoot":""} \ No newline at end of file diff --git a/webpage/dist/vue.js b/webpage/dist/vue.js new file mode 100644 index 0000000..e22cf13 --- /dev/null +++ b/webpage/dist/vue.js @@ -0,0 +1,11965 @@ +/*! + * Vue.js v2.6.11 + * (c) 2014-2019 Evan You + * Released under the MIT License. + */ +(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() : + typeof define === 'function' && define.amd ? define(factory) : + (global = global || self, global.Vue = factory()); +}(this, function () { 'use strict'; + + /* */ + + var emptyObject = Object.freeze({}); + + // These helpers produce better VM code in JS engines due to their + // explicitness and function inlining. + function isUndef (v) { + return v === undefined || v === null + } + + function isDef (v) { + return v !== undefined && v !== null + } + + function isTrue (v) { + return v === true + } + + function isFalse (v) { + return v === false + } + + /** + * Check if value is primitive. + */ + function isPrimitive (value) { + return ( + typeof value === 'string' || + typeof value === 'number' || + // $flow-disable-line + typeof value === 'symbol' || + typeof value === 'boolean' + ) + } + + /** + * Quick object check - this is primarily used to tell + * Objects from primitive values when we know the value + * is a JSON-compliant type. + */ + function isObject (obj) { + return obj !== null && typeof obj === 'object' + } + + /** + * Get the raw type string of a value, e.g., [object Object]. + */ + var _toString = Object.prototype.toString; + + function toRawType (value) { + return _toString.call(value).slice(8, -1) + } + + /** + * Strict object type check. Only returns true + * for plain JavaScript objects. + */ + function isPlainObject (obj) { + return _toString.call(obj) === '[object Object]' + } + + function isRegExp (v) { + return _toString.call(v) === '[object RegExp]' + } + + /** + * Check if val is a valid array index. + */ + function isValidArrayIndex (val) { + var n = parseFloat(String(val)); + return n >= 0 && Math.floor(n) === n && isFinite(val) + } + + function isPromise (val) { + return ( + isDef(val) && + typeof val.then === 'function' && + typeof val.catch === 'function' + ) + } + + /** + * Convert a value to a string that is actually rendered. + */ + function toString (val) { + return val == null + ? '' + : Array.isArray(val) || (isPlainObject(val) && val.toString === _toString) + ? JSON.stringify(val, null, 2) + : String(val) + } + + /** + * Convert an input value to a number for persistence. + * If the conversion fails, return original string. + */ + function toNumber (val) { + var n = parseFloat(val); + return isNaN(n) ? val : n + } + + /** + * Make a map and return a function for checking if a key + * is in that map. + */ + function makeMap ( + str, + expectsLowerCase + ) { + var map = Object.create(null); + var list = str.split(','); + for (var i = 0; i < list.length; i++) { + map[list[i]] = true; + } + return expectsLowerCase + ? function (val) { return map[val.toLowerCase()]; } + : function (val) { return map[val]; } + } + + /** + * Check if a tag is a built-in tag. + */ + var isBuiltInTag = makeMap('slot,component', true); + + /** + * Check if an attribute is a reserved attribute. + */ + var isReservedAttribute = makeMap('key,ref,slot,slot-scope,is'); + + /** + * Remove an item from an array. + */ + function remove (arr, item) { + if (arr.length) { + var index = arr.indexOf(item); + if (index > -1) { + return arr.splice(index, 1) + } + } + } + + /** + * Check whether an object has the property. + */ + var hasOwnProperty = Object.prototype.hasOwnProperty; + function hasOwn (obj, key) { + return hasOwnProperty.call(obj, key) + } + + /** + * Create a cached version of a pure function. + */ + function cached (fn) { + var cache = Object.create(null); + return (function cachedFn (str) { + var hit = cache[str]; + return hit || (cache[str] = fn(str)) + }) + } + + /** + * Camelize a hyphen-delimited string. + */ + var camelizeRE = /-(\w)/g; + var camelize = cached(function (str) { + return str.replace(camelizeRE, function (_, c) { return c ? c.toUpperCase() : ''; }) + }); + + /** + * Capitalize a string. + */ + var capitalize = cached(function (str) { + return str.charAt(0).toUpperCase() + str.slice(1) + }); + + /** + * Hyphenate a camelCase string. + */ + var hyphenateRE = /\B([A-Z])/g; + var hyphenate = cached(function (str) { + return str.replace(hyphenateRE, '-$1').toLowerCase() + }); + + /** + * Simple bind polyfill for environments that do not support it, + * e.g., PhantomJS 1.x. Technically, we don't need this anymore + * since native bind is now performant enough in most browsers. + * But removing it would mean breaking code that was able to run in + * PhantomJS 1.x, so this must be kept for backward compatibility. + */ + + /* istanbul ignore next */ + function polyfillBind (fn, ctx) { + function boundFn (a) { + var l = arguments.length; + return l + ? l > 1 + ? fn.apply(ctx, arguments) + : fn.call(ctx, a) + : fn.call(ctx) + } + + boundFn._length = fn.length; + return boundFn + } + + function nativeBind (fn, ctx) { + return fn.bind(ctx) + } + + var bind = Function.prototype.bind + ? nativeBind + : polyfillBind; + + /** + * Convert an Array-like object to a real Array. + */ + function toArray (list, start) { + start = start || 0; + var i = list.length - start; + var ret = new Array(i); + while (i--) { + ret[i] = list[i + start]; + } + return ret + } + + /** + * Mix properties into target object. + */ + function extend (to, _from) { + for (var key in _from) { + to[key] = _from[key]; + } + return to + } + + /** + * Merge an Array of Objects into a single Object. + */ + function toObject (arr) { + var res = {}; + for (var i = 0; i < arr.length; i++) { + if (arr[i]) { + extend(res, arr[i]); + } + } + return res + } + + /* eslint-disable no-unused-vars */ + + /** + * Perform no operation. + * Stubbing args to make Flow happy without leaving useless transpiled code + * with ...rest (https://flow.org/blog/2017/05/07/Strict-Function-Call-Arity/). + */ + function noop (a, b, c) {} + + /** + * Always return false. + */ + var no = function (a, b, c) { return false; }; + + /* eslint-enable no-unused-vars */ + + /** + * Return the same value. + */ + var identity = function (_) { return _; }; + + /** + * Generate a string containing static keys from compiler modules. + */ + function genStaticKeys (modules) { + return modules.reduce(function (keys, m) { + return keys.concat(m.staticKeys || []) + }, []).join(',') + } + + /** + * Check if two values are loosely equal - that is, + * if they are plain objects, do they have the same shape? + */ + function looseEqual (a, b) { + if (a === b) { return true } + var isObjectA = isObject(a); + var isObjectB = isObject(b); + if (isObjectA && isObjectB) { + try { + var isArrayA = Array.isArray(a); + var isArrayB = Array.isArray(b); + if (isArrayA && isArrayB) { + return a.length === b.length && a.every(function (e, i) { + return looseEqual(e, b[i]) + }) + } else if (a instanceof Date && b instanceof Date) { + return a.getTime() === b.getTime() + } else if (!isArrayA && !isArrayB) { + var keysA = Object.keys(a); + var keysB = Object.keys(b); + return keysA.length === keysB.length && keysA.every(function (key) { + return looseEqual(a[key], b[key]) + }) + } else { + /* istanbul ignore next */ + return false + } + } catch (e) { + /* istanbul ignore next */ + return false + } + } else if (!isObjectA && !isObjectB) { + return String(a) === String(b) + } else { + return false + } + } + + /** + * Return the first index at which a loosely equal value can be + * found in the array (if value is a plain object, the array must + * contain an object of the same shape), or -1 if it is not present. + */ + function looseIndexOf (arr, val) { + for (var i = 0; i < arr.length; i++) { + if (looseEqual(arr[i], val)) { return i } + } + return -1 + } + + /** + * Ensure a function is called only once. + */ + function once (fn) { + var called = false; + return function () { + if (!called) { + called = true; + fn.apply(this, arguments); + } + } + } + + var SSR_ATTR = 'data-server-rendered'; + + var ASSET_TYPES = [ + 'component', + 'directive', + 'filter' + ]; + + var LIFECYCLE_HOOKS = [ + 'beforeCreate', + 'created', + 'beforeMount', + 'mounted', + 'beforeUpdate', + 'updated', + 'beforeDestroy', + 'destroyed', + 'activated', + 'deactivated', + 'errorCaptured', + 'serverPrefetch' + ]; + + /* */ + + + + var config = ({ + /** + * Option merge strategies (used in core/util/options) + */ + // $flow-disable-line + optionMergeStrategies: Object.create(null), + + /** + * Whether to suppress warnings. + */ + silent: false, + + /** + * Show production mode tip message on boot? + */ + productionTip: "development" !== 'production', + + /** + * Whether to enable devtools + */ + devtools: "development" !== 'production', + + /** + * Whether to record perf + */ + performance: false, + + /** + * Error handler for watcher errors + */ + errorHandler: null, + + /** + * Warn handler for watcher warns + */ + warnHandler: null, + + /** + * Ignore certain custom elements + */ + ignoredElements: [], + + /** + * Custom user key aliases for v-on + */ + // $flow-disable-line + keyCodes: Object.create(null), + + /** + * Check if a tag is reserved so that it cannot be registered as a + * component. This is platform-dependent and may be overwritten. + */ + isReservedTag: no, + + /** + * Check if an attribute is reserved so that it cannot be used as a component + * prop. This is platform-dependent and may be overwritten. + */ + isReservedAttr: no, + + /** + * Check if a tag is an unknown element. + * Platform-dependent. + */ + isUnknownElement: no, + + /** + * Get the namespace of an element + */ + getTagNamespace: noop, + + /** + * Parse the real tag name for the specific platform. + */ + parsePlatformTagName: identity, + + /** + * Check if an attribute must be bound using property, e.g. value + * Platform-dependent. + */ + mustUseProp: no, + + /** + * Perform updates asynchronously. Intended to be used by Vue Test Utils + * This will significantly reduce performance if set to false. + */ + async: true, + + /** + * Exposed for legacy reasons + */ + _lifecycleHooks: LIFECYCLE_HOOKS + }); + + /* */ + + /** + * unicode letters used for parsing html tags, component names and property paths. + * using https://www.w3.org/TR/html53/semantics-scripting.html#potentialcustomelementname + * skipping \u10000-\uEFFFF due to it freezing up PhantomJS + */ + var unicodeRegExp = /a-zA-Z\u00B7\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u037D\u037F-\u1FFF\u200C-\u200D\u203F-\u2040\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD/; + + /** + * Check if a string starts with $ or _ + */ + function isReserved (str) { + var c = (str + '').charCodeAt(0); + return c === 0x24 || c === 0x5F + } + + /** + * Define a property. + */ + function def (obj, key, val, enumerable) { + Object.defineProperty(obj, key, { + value: val, + enumerable: !!enumerable, + writable: true, + configurable: true + }); + } + + /** + * Parse simple path. + */ + var bailRE = new RegExp(("[^" + (unicodeRegExp.source) + ".$_\\d]")); + function parsePath (path) { + if (bailRE.test(path)) { + return + } + var segments = path.split('.'); + return function (obj) { + for (var i = 0; i < segments.length; i++) { + if (!obj) { return } + obj = obj[segments[i]]; + } + return obj + } + } + + /* */ + + // can we use __proto__? + var hasProto = '__proto__' in {}; + + // Browser environment sniffing + var inBrowser = typeof window !== 'undefined'; + var inWeex = typeof WXEnvironment !== 'undefined' && !!WXEnvironment.platform; + var weexPlatform = inWeex && WXEnvironment.platform.toLowerCase(); + var UA = inBrowser && window.navigator.userAgent.toLowerCase(); + var isIE = UA && /msie|trident/.test(UA); + var isIE9 = UA && UA.indexOf('msie 9.0') > 0; + var isEdge = UA && UA.indexOf('edge/') > 0; + var isAndroid = (UA && UA.indexOf('android') > 0) || (weexPlatform === 'android'); + var isIOS = (UA && /iphone|ipad|ipod|ios/.test(UA)) || (weexPlatform === 'ios'); + var isChrome = UA && /chrome\/\d+/.test(UA) && !isEdge; + var isPhantomJS = UA && /phantomjs/.test(UA); + var isFF = UA && UA.match(/firefox\/(\d+)/); + + // Firefox has a "watch" function on Object.prototype... + var nativeWatch = ({}).watch; + + var supportsPassive = false; + if (inBrowser) { + try { + var opts = {}; + Object.defineProperty(opts, 'passive', ({ + get: function get () { + /* istanbul ignore next */ + supportsPassive = true; + } + })); // https://github.com/facebook/flow/issues/285 + window.addEventListener('test-passive', null, opts); + } catch (e) {} + } + + // this needs to be lazy-evaled because vue may be required before + // vue-server-renderer can set VUE_ENV + var _isServer; + var isServerRendering = function () { + if (_isServer === undefined) { + /* istanbul ignore if */ + if (!inBrowser && !inWeex && typeof global !== 'undefined') { + // detect presence of vue-server-renderer and avoid + // Webpack shimming the process + _isServer = global['process'] && global['process'].env.VUE_ENV === 'server'; + } else { + _isServer = false; + } + } + return _isServer + }; + + // detect devtools + var devtools = inBrowser && window.__VUE_DEVTOOLS_GLOBAL_HOOK__; + + /* istanbul ignore next */ + function isNative (Ctor) { + return typeof Ctor === 'function' && /native code/.test(Ctor.toString()) + } + + var hasSymbol = + typeof Symbol !== 'undefined' && isNative(Symbol) && + typeof Reflect !== 'undefined' && isNative(Reflect.ownKeys); + + var _Set; + /* istanbul ignore if */ // $flow-disable-line + if (typeof Set !== 'undefined' && isNative(Set)) { + // use native Set when available. + _Set = Set; + } else { + // a non-standard Set polyfill that only works with primitive keys. + _Set = /*@__PURE__*/(function () { + function Set () { + this.set = Object.create(null); + } + Set.prototype.has = function has (key) { + return this.set[key] === true + }; + Set.prototype.add = function add (key) { + this.set[key] = true; + }; + Set.prototype.clear = function clear () { + this.set = Object.create(null); + }; + + return Set; + }()); + } + + /* */ + + var warn = noop; + var tip = noop; + var generateComponentTrace = (noop); // work around flow check + var formatComponentName = (noop); + + { + var hasConsole = typeof console !== 'undefined'; + var classifyRE = /(?:^|[-_])(\w)/g; + var classify = function (str) { return str + .replace(classifyRE, function (c) { return c.toUpperCase(); }) + .replace(/[-_]/g, ''); }; + + warn = function (msg, vm) { + var trace = vm ? generateComponentTrace(vm) : ''; + + if (config.warnHandler) { + config.warnHandler.call(null, msg, vm, trace); + } else if (hasConsole && (!config.silent)) { + console.error(("[Vue warn]: " + msg + trace)); + } + }; + + tip = function (msg, vm) { + if (hasConsole && (!config.silent)) { + console.warn("[Vue tip]: " + msg + ( + vm ? generateComponentTrace(vm) : '' + )); + } + }; + + formatComponentName = function (vm, includeFile) { + if (vm.$root === vm) { + return '' + } + var options = typeof vm === 'function' && vm.cid != null + ? vm.options + : vm._isVue + ? vm.$options || vm.constructor.options + : vm; + var name = options.name || options._componentTag; + var file = options.__file; + if (!name && file) { + var match = file.match(/([^/\\]+)\.vue$/); + name = match && match[1]; + } + + return ( + (name ? ("<" + (classify(name)) + ">") : "") + + (file && includeFile !== false ? (" at " + file) : '') + ) + }; + + var repeat = function (str, n) { + var res = ''; + while (n) { + if (n % 2 === 1) { res += str; } + if (n > 1) { str += str; } + n >>= 1; + } + return res + }; + + generateComponentTrace = function (vm) { + if (vm._isVue && vm.$parent) { + var tree = []; + var currentRecursiveSequence = 0; + while (vm) { + if (tree.length > 0) { + var last = tree[tree.length - 1]; + if (last.constructor === vm.constructor) { + currentRecursiveSequence++; + vm = vm.$parent; + continue + } else if (currentRecursiveSequence > 0) { + tree[tree.length - 1] = [last, currentRecursiveSequence]; + currentRecursiveSequence = 0; + } + } + tree.push(vm); + vm = vm.$parent; + } + return '\n\nfound in\n\n' + tree + .map(function (vm, i) { return ("" + (i === 0 ? '---> ' : repeat(' ', 5 + i * 2)) + (Array.isArray(vm) + ? ((formatComponentName(vm[0])) + "... (" + (vm[1]) + " recursive calls)") + : formatComponentName(vm))); }) + .join('\n') + } else { + return ("\n\n(found in " + (formatComponentName(vm)) + ")") + } + }; + } + + /* */ + + var uid = 0; + + /** + * A dep is an observable that can have multiple + * directives subscribing to it. + */ + var Dep = function Dep () { + this.id = uid++; + this.subs = []; + }; + + Dep.prototype.addSub = function addSub (sub) { + this.subs.push(sub); + }; + + Dep.prototype.removeSub = function removeSub (sub) { + remove(this.subs, sub); + }; + + Dep.prototype.depend = function depend () { + if (Dep.target) { + Dep.target.addDep(this); + } + }; + + Dep.prototype.notify = function notify () { + // stabilize the subscriber list first + var subs = this.subs.slice(); + if (!config.async) { + // subs aren't sorted in scheduler if not running async + // we need to sort them now to make sure they fire in correct + // order + subs.sort(function (a, b) { return a.id - b.id; }); + } + for (var i = 0, l = subs.length; i < l; i++) { + subs[i].update(); + } + }; + + // The current target watcher being evaluated. + // This is globally unique because only one watcher + // can be evaluated at a time. + Dep.target = null; + var targetStack = []; + + function pushTarget (target) { + targetStack.push(target); + Dep.target = target; + } + + function popTarget () { + targetStack.pop(); + Dep.target = targetStack[targetStack.length - 1]; + } + + /* */ + + var VNode = function VNode ( + tag, + data, + children, + text, + elm, + context, + componentOptions, + asyncFactory + ) { + this.tag = tag; + this.data = data; + this.children = children; + this.text = text; + this.elm = elm; + this.ns = undefined; + this.context = context; + this.fnContext = undefined; + this.fnOptions = undefined; + this.fnScopeId = undefined; + this.key = data && data.key; + this.componentOptions = componentOptions; + this.componentInstance = undefined; + this.parent = undefined; + this.raw = false; + this.isStatic = false; + this.isRootInsert = true; + this.isComment = false; + this.isCloned = false; + this.isOnce = false; + this.asyncFactory = asyncFactory; + this.asyncMeta = undefined; + this.isAsyncPlaceholder = false; + }; + + var prototypeAccessors = { child: { configurable: true } }; + + // DEPRECATED: alias for componentInstance for backwards compat. + /* istanbul ignore next */ + prototypeAccessors.child.get = function () { + return this.componentInstance + }; + + Object.defineProperties( VNode.prototype, prototypeAccessors ); + + var createEmptyVNode = function (text) { + if ( text === void 0 ) text = ''; + + var node = new VNode(); + node.text = text; + node.isComment = true; + return node + }; + + function createTextVNode (val) { + return new VNode(undefined, undefined, undefined, String(val)) + } + + // optimized shallow clone + // used for static nodes and slot nodes because they may be reused across + // multiple renders, cloning them avoids errors when DOM manipulations rely + // on their elm reference. + function cloneVNode (vnode) { + var cloned = new VNode( + vnode.tag, + vnode.data, + // #7975 + // clone children array to avoid mutating original in case of cloning + // a child. + vnode.children && vnode.children.slice(), + vnode.text, + vnode.elm, + vnode.context, + vnode.componentOptions, + vnode.asyncFactory + ); + cloned.ns = vnode.ns; + cloned.isStatic = vnode.isStatic; + cloned.key = vnode.key; + cloned.isComment = vnode.isComment; + cloned.fnContext = vnode.fnContext; + cloned.fnOptions = vnode.fnOptions; + cloned.fnScopeId = vnode.fnScopeId; + cloned.asyncMeta = vnode.asyncMeta; + cloned.isCloned = true; + return cloned + } + + /* + * not type checking this file because flow doesn't play well with + * dynamically accessing methods on Array prototype + */ + + var arrayProto = Array.prototype; + var arrayMethods = Object.create(arrayProto); + + var methodsToPatch = [ + 'push', + 'pop', + 'shift', + 'unshift', + 'splice', + 'sort', + 'reverse' + ]; + + /** + * Intercept mutating methods and emit events + */ + methodsToPatch.forEach(function (method) { + // cache original method + var original = arrayProto[method]; + def(arrayMethods, method, function mutator () { + var args = [], len = arguments.length; + while ( len-- ) args[ len ] = arguments[ len ]; + + var result = original.apply(this, args); + var ob = this.__ob__; + var inserted; + switch (method) { + case 'push': + case 'unshift': + inserted = args; + break + case 'splice': + inserted = args.slice(2); + break + } + if (inserted) { ob.observeArray(inserted); } + // notify change + ob.dep.notify(); + return result + }); + }); + + /* */ + + var arrayKeys = Object.getOwnPropertyNames(arrayMethods); + + /** + * In some cases we may want to disable observation inside a component's + * update computation. + */ + var shouldObserve = true; + + function toggleObserving (value) { + shouldObserve = value; + } + + /** + * Observer class that is attached to each observed + * object. Once attached, the observer converts the target + * object's property keys into getter/setters that + * collect dependencies and dispatch updates. + */ + var Observer = function Observer (value) { + this.value = value; + this.dep = new Dep(); + this.vmCount = 0; + def(value, '__ob__', this); + if (Array.isArray(value)) { + if (hasProto) { + protoAugment(value, arrayMethods); + } else { + copyAugment(value, arrayMethods, arrayKeys); + } + this.observeArray(value); + } else { + this.walk(value); + } + }; + + /** + * Walk through all properties and convert them into + * getter/setters. This method should only be called when + * value type is Object. + */ + Observer.prototype.walk = function walk (obj) { + var keys = Object.keys(obj); + for (var i = 0; i < keys.length; i++) { + defineReactive$$1(obj, keys[i]); + } + }; + + /** + * Observe a list of Array items. + */ + Observer.prototype.observeArray = function observeArray (items) { + for (var i = 0, l = items.length; i < l; i++) { + observe(items[i]); + } + }; + + // helpers + + /** + * Augment a target Object or Array by intercepting + * the prototype chain using __proto__ + */ + function protoAugment (target, src) { + /* eslint-disable no-proto */ + target.__proto__ = src; + /* eslint-enable no-proto */ + } + + /** + * Augment a target Object or Array by defining + * hidden properties. + */ + /* istanbul ignore next */ + function copyAugment (target, src, keys) { + for (var i = 0, l = keys.length; i < l; i++) { + var key = keys[i]; + def(target, key, src[key]); + } + } + + /** + * Attempt to create an observer instance for a value, + * returns the new observer if successfully observed, + * or the existing observer if the value already has one. + */ + function observe (value, asRootData) { + if (!isObject(value) || value instanceof VNode) { + return + } + var ob; + if (hasOwn(value, '__ob__') && value.__ob__ instanceof Observer) { + ob = value.__ob__; + } else if ( + shouldObserve && + !isServerRendering() && + (Array.isArray(value) || isPlainObject(value)) && + Object.isExtensible(value) && + !value._isVue + ) { + ob = new Observer(value); + } + if (asRootData && ob) { + ob.vmCount++; + } + return ob + } + + /** + * Define a reactive property on an Object. + */ + function defineReactive$$1 ( + obj, + key, + val, + customSetter, + shallow + ) { + var dep = new Dep(); + + var property = Object.getOwnPropertyDescriptor(obj, key); + if (property && property.configurable === false) { + return + } + + // cater for pre-defined getter/setters + var getter = property && property.get; + var setter = property && property.set; + if ((!getter || setter) && arguments.length === 2) { + val = obj[key]; + } + + var childOb = !shallow && observe(val); + Object.defineProperty(obj, key, { + enumerable: true, + configurable: true, + get: function reactiveGetter () { + var value = getter ? getter.call(obj) : val; + if (Dep.target) { + dep.depend(); + if (childOb) { + childOb.dep.depend(); + if (Array.isArray(value)) { + dependArray(value); + } + } + } + return value + }, + set: function reactiveSetter (newVal) { + var value = getter ? getter.call(obj) : val; + /* eslint-disable no-self-compare */ + if (newVal === value || (newVal !== newVal && value !== value)) { + return + } + /* eslint-enable no-self-compare */ + if (customSetter) { + customSetter(); + } + // #7981: for accessor properties without setter + if (getter && !setter) { return } + if (setter) { + setter.call(obj, newVal); + } else { + val = newVal; + } + childOb = !shallow && observe(newVal); + dep.notify(); + } + }); + } + + /** + * Set a property on an object. Adds the new property and + * triggers change notification if the property doesn't + * already exist. + */ + function set (target, key, val) { + if (isUndef(target) || isPrimitive(target) + ) { + warn(("Cannot set reactive property on undefined, null, or primitive value: " + ((target)))); + } + if (Array.isArray(target) && isValidArrayIndex(key)) { + target.length = Math.max(target.length, key); + target.splice(key, 1, val); + return val + } + if (key in target && !(key in Object.prototype)) { + target[key] = val; + return val + } + var ob = (target).__ob__; + if (target._isVue || (ob && ob.vmCount)) { + warn( + 'Avoid adding reactive properties to a Vue instance or its root $data ' + + 'at runtime - declare it upfront in the data option.' + ); + return val + } + if (!ob) { + target[key] = val; + return val + } + defineReactive$$1(ob.value, key, val); + ob.dep.notify(); + return val + } + + /** + * Delete a property and trigger change if necessary. + */ + function del (target, key) { + if (isUndef(target) || isPrimitive(target) + ) { + warn(("Cannot delete reactive property on undefined, null, or primitive value: " + ((target)))); + } + if (Array.isArray(target) && isValidArrayIndex(key)) { + target.splice(key, 1); + return + } + var ob = (target).__ob__; + if (target._isVue || (ob && ob.vmCount)) { + warn( + 'Avoid deleting properties on a Vue instance or its root $data ' + + '- just set it to null.' + ); + return + } + if (!hasOwn(target, key)) { + return + } + delete target[key]; + if (!ob) { + return + } + ob.dep.notify(); + } + + /** + * Collect dependencies on array elements when the array is touched, since + * we cannot intercept array element access like property getters. + */ + function dependArray (value) { + for (var e = (void 0), i = 0, l = value.length; i < l; i++) { + e = value[i]; + e && e.__ob__ && e.__ob__.dep.depend(); + if (Array.isArray(e)) { + dependArray(e); + } + } + } + + /* */ + + /** + * Option overwriting strategies are functions that handle + * how to merge a parent option value and a child option + * value into the final value. + */ + var strats = config.optionMergeStrategies; + + /** + * Options with restrictions + */ + { + strats.el = strats.propsData = function (parent, child, vm, key) { + if (!vm) { + warn( + "option \"" + key + "\" can only be used during instance " + + 'creation with the `new` keyword.' + ); + } + return defaultStrat(parent, child) + }; + } + + /** + * Helper that recursively merges two data objects together. + */ + function mergeData (to, from) { + if (!from) { return to } + var key, toVal, fromVal; + + var keys = hasSymbol + ? Reflect.ownKeys(from) + : Object.keys(from); + + for (var i = 0; i < keys.length; i++) { + key = keys[i]; + // in case the object is already observed... + if (key === '__ob__') { continue } + toVal = to[key]; + fromVal = from[key]; + if (!hasOwn(to, key)) { + set(to, key, fromVal); + } else if ( + toVal !== fromVal && + isPlainObject(toVal) && + isPlainObject(fromVal) + ) { + mergeData(toVal, fromVal); + } + } + return to + } + + /** + * Data + */ + function mergeDataOrFn ( + parentVal, + childVal, + vm + ) { + if (!vm) { + // in a Vue.extend merge, both should be functions + if (!childVal) { + return parentVal + } + if (!parentVal) { + return childVal + } + // when parentVal & childVal are both present, + // we need to return a function that returns the + // merged result of both functions... no need to + // check if parentVal is a function here because + // it has to be a function to pass previous merges. + return function mergedDataFn () { + return mergeData( + typeof childVal === 'function' ? childVal.call(this, this) : childVal, + typeof parentVal === 'function' ? parentVal.call(this, this) : parentVal + ) + } + } else { + return function mergedInstanceDataFn () { + // instance merge + var instanceData = typeof childVal === 'function' + ? childVal.call(vm, vm) + : childVal; + var defaultData = typeof parentVal === 'function' + ? parentVal.call(vm, vm) + : parentVal; + if (instanceData) { + return mergeData(instanceData, defaultData) + } else { + return defaultData + } + } + } + } + + strats.data = function ( + parentVal, + childVal, + vm + ) { + if (!vm) { + if (childVal && typeof childVal !== 'function') { + warn( + 'The "data" option should be a function ' + + 'that returns a per-instance value in component ' + + 'definitions.', + vm + ); + + return parentVal + } + return mergeDataOrFn(parentVal, childVal) + } + + return mergeDataOrFn(parentVal, childVal, vm) + }; + + /** + * Hooks and props are merged as arrays. + */ + function mergeHook ( + parentVal, + childVal + ) { + var res = childVal + ? parentVal + ? parentVal.concat(childVal) + : Array.isArray(childVal) + ? childVal + : [childVal] + : parentVal; + return res + ? dedupeHooks(res) + : res + } + + function dedupeHooks (hooks) { + var res = []; + for (var i = 0; i < hooks.length; i++) { + if (res.indexOf(hooks[i]) === -1) { + res.push(hooks[i]); + } + } + return res + } + + LIFECYCLE_HOOKS.forEach(function (hook) { + strats[hook] = mergeHook; + }); + + /** + * Assets + * + * When a vm is present (instance creation), we need to do + * a three-way merge between constructor options, instance + * options and parent options. + */ + function mergeAssets ( + parentVal, + childVal, + vm, + key + ) { + var res = Object.create(parentVal || null); + if (childVal) { + assertObjectType(key, childVal, vm); + return extend(res, childVal) + } else { + return res + } + } + + ASSET_TYPES.forEach(function (type) { + strats[type + 's'] = mergeAssets; + }); + + /** + * Watchers. + * + * Watchers hashes should not overwrite one + * another, so we merge them as arrays. + */ + strats.watch = function ( + parentVal, + childVal, + vm, + key + ) { + // work around Firefox's Object.prototype.watch... + if (parentVal === nativeWatch) { parentVal = undefined; } + if (childVal === nativeWatch) { childVal = undefined; } + /* istanbul ignore if */ + if (!childVal) { return Object.create(parentVal || null) } + { + assertObjectType(key, childVal, vm); + } + if (!parentVal) { return childVal } + var ret = {}; + extend(ret, parentVal); + for (var key$1 in childVal) { + var parent = ret[key$1]; + var child = childVal[key$1]; + if (parent && !Array.isArray(parent)) { + parent = [parent]; + } + ret[key$1] = parent + ? parent.concat(child) + : Array.isArray(child) ? child : [child]; + } + return ret + }; + + /** + * Other object hashes. + */ + strats.props = + strats.methods = + strats.inject = + strats.computed = function ( + parentVal, + childVal, + vm, + key + ) { + if (childVal && "development" !== 'production') { + assertObjectType(key, childVal, vm); + } + if (!parentVal) { return childVal } + var ret = Object.create(null); + extend(ret, parentVal); + if (childVal) { extend(ret, childVal); } + return ret + }; + strats.provide = mergeDataOrFn; + + /** + * Default strategy. + */ + var defaultStrat = function (parentVal, childVal) { + return childVal === undefined + ? parentVal + : childVal + }; + + /** + * Validate component names + */ + function checkComponents (options) { + for (var key in options.components) { + validateComponentName(key); + } + } + + function validateComponentName (name) { + if (!new RegExp(("^[a-zA-Z][\\-\\.0-9_" + (unicodeRegExp.source) + "]*$")).test(name)) { + warn( + 'Invalid component name: "' + name + '". Component names ' + + 'should conform to valid custom element name in html5 specification.' + ); + } + if (isBuiltInTag(name) || config.isReservedTag(name)) { + warn( + 'Do not use built-in or reserved HTML elements as component ' + + 'id: ' + name + ); + } + } + + /** + * Ensure all props option syntax are normalized into the + * Object-based format. + */ + function normalizeProps (options, vm) { + var props = options.props; + if (!props) { return } + var res = {}; + var i, val, name; + if (Array.isArray(props)) { + i = props.length; + while (i--) { + val = props[i]; + if (typeof val === 'string') { + name = camelize(val); + res[name] = { type: null }; + } else { + warn('props must be strings when using array syntax.'); + } + } + } else if (isPlainObject(props)) { + for (var key in props) { + val = props[key]; + name = camelize(key); + res[name] = isPlainObject(val) + ? val + : { type: val }; + } + } else { + warn( + "Invalid value for option \"props\": expected an Array or an Object, " + + "but got " + (toRawType(props)) + ".", + vm + ); + } + options.props = res; + } + + /** + * Normalize all injections into Object-based format + */ + function normalizeInject (options, vm) { + var inject = options.inject; + if (!inject) { return } + var normalized = options.inject = {}; + if (Array.isArray(inject)) { + for (var i = 0; i < inject.length; i++) { + normalized[inject[i]] = { from: inject[i] }; + } + } else if (isPlainObject(inject)) { + for (var key in inject) { + var val = inject[key]; + normalized[key] = isPlainObject(val) + ? extend({ from: key }, val) + : { from: val }; + } + } else { + warn( + "Invalid value for option \"inject\": expected an Array or an Object, " + + "but got " + (toRawType(inject)) + ".", + vm + ); + } + } + + /** + * Normalize raw function directives into object format. + */ + function normalizeDirectives (options) { + var dirs = options.directives; + if (dirs) { + for (var key in dirs) { + var def$$1 = dirs[key]; + if (typeof def$$1 === 'function') { + dirs[key] = { bind: def$$1, update: def$$1 }; + } + } + } + } + + function assertObjectType (name, value, vm) { + if (!isPlainObject(value)) { + warn( + "Invalid value for option \"" + name + "\": expected an Object, " + + "but got " + (toRawType(value)) + ".", + vm + ); + } + } + + /** + * Merge two option objects into a new one. + * Core utility used in both instantiation and inheritance. + */ + function mergeOptions ( + parent, + child, + vm + ) { + { + checkComponents(child); + } + + if (typeof child === 'function') { + child = child.options; + } + + normalizeProps(child, vm); + normalizeInject(child, vm); + normalizeDirectives(child); + + // Apply extends and mixins on the child options, + // but only if it is a raw options object that isn't + // the result of another mergeOptions call. + // Only merged options has the _base property. + if (!child._base) { + if (child.extends) { + parent = mergeOptions(parent, child.extends, vm); + } + if (child.mixins) { + for (var i = 0, l = child.mixins.length; i < l; i++) { + parent = mergeOptions(parent, child.mixins[i], vm); + } + } + } + + var options = {}; + var key; + for (key in parent) { + mergeField(key); + } + for (key in child) { + if (!hasOwn(parent, key)) { + mergeField(key); + } + } + function mergeField (key) { + var strat = strats[key] || defaultStrat; + options[key] = strat(parent[key], child[key], vm, key); + } + return options + } + + /** + * Resolve an asset. + * This function is used because child instances need access + * to assets defined in its ancestor chain. + */ + function resolveAsset ( + options, + type, + id, + warnMissing + ) { + /* istanbul ignore if */ + if (typeof id !== 'string') { + return + } + var assets = options[type]; + // check local registration variations first + if (hasOwn(assets, id)) { return assets[id] } + var camelizedId = camelize(id); + if (hasOwn(assets, camelizedId)) { return assets[camelizedId] } + var PascalCaseId = capitalize(camelizedId); + if (hasOwn(assets, PascalCaseId)) { return assets[PascalCaseId] } + // fallback to prototype chain + var res = assets[id] || assets[camelizedId] || assets[PascalCaseId]; + if (warnMissing && !res) { + warn( + 'Failed to resolve ' + type.slice(0, -1) + ': ' + id, + options + ); + } + return res + } + + /* */ + + + + function validateProp ( + key, + propOptions, + propsData, + vm + ) { + var prop = propOptions[key]; + var absent = !hasOwn(propsData, key); + var value = propsData[key]; + // boolean casting + var booleanIndex = getTypeIndex(Boolean, prop.type); + if (booleanIndex > -1) { + if (absent && !hasOwn(prop, 'default')) { + value = false; + } else if (value === '' || value === hyphenate(key)) { + // only cast empty string / same name to boolean if + // boolean has higher priority + var stringIndex = getTypeIndex(String, prop.type); + if (stringIndex < 0 || booleanIndex < stringIndex) { + value = true; + } + } + } + // check default value + if (value === undefined) { + value = getPropDefaultValue(vm, prop, key); + // since the default value is a fresh copy, + // make sure to observe it. + var prevShouldObserve = shouldObserve; + toggleObserving(true); + observe(value); + toggleObserving(prevShouldObserve); + } + { + assertProp(prop, key, value, vm, absent); + } + return value + } + + /** + * Get the default value of a prop. + */ + function getPropDefaultValue (vm, prop, key) { + // no default, return undefined + if (!hasOwn(prop, 'default')) { + return undefined + } + var def = prop.default; + // warn against non-factory defaults for Object & Array + if (isObject(def)) { + warn( + 'Invalid default value for prop "' + key + '": ' + + 'Props with type Object/Array must use a factory function ' + + 'to return the default value.', + vm + ); + } + // the raw prop value was also undefined from previous render, + // return previous default value to avoid unnecessary watcher trigger + if (vm && vm.$options.propsData && + vm.$options.propsData[key] === undefined && + vm._props[key] !== undefined + ) { + return vm._props[key] + } + // call factory function for non-Function types + // a value is Function if its prototype is function even across different execution context + return typeof def === 'function' && getType(prop.type) !== 'Function' + ? def.call(vm) + : def + } + + /** + * Assert whether a prop is valid. + */ + function assertProp ( + prop, + name, + value, + vm, + absent + ) { + if (prop.required && absent) { + warn( + 'Missing required prop: "' + name + '"', + vm + ); + return + } + if (value == null && !prop.required) { + return + } + var type = prop.type; + var valid = !type || type === true; + var expectedTypes = []; + if (type) { + if (!Array.isArray(type)) { + type = [type]; + } + for (var i = 0; i < type.length && !valid; i++) { + var assertedType = assertType(value, type[i]); + expectedTypes.push(assertedType.expectedType || ''); + valid = assertedType.valid; + } + } + + if (!valid) { + warn( + getInvalidTypeMessage(name, value, expectedTypes), + vm + ); + return + } + var validator = prop.validator; + if (validator) { + if (!validator(value)) { + warn( + 'Invalid prop: custom validator check failed for prop "' + name + '".', + vm + ); + } + } + } + + var simpleCheckRE = /^(String|Number|Boolean|Function|Symbol)$/; + + function assertType (value, type) { + var valid; + var expectedType = getType(type); + if (simpleCheckRE.test(expectedType)) { + var t = typeof value; + valid = t === expectedType.toLowerCase(); + // for primitive wrapper objects + if (!valid && t === 'object') { + valid = value instanceof type; + } + } else if (expectedType === 'Object') { + valid = isPlainObject(value); + } else if (expectedType === 'Array') { + valid = Array.isArray(value); + } else { + valid = value instanceof type; + } + return { + valid: valid, + expectedType: expectedType + } + } + + /** + * Use function string name to check built-in types, + * because a simple equality check will fail when running + * across different vms / iframes. + */ + function getType (fn) { + var match = fn && fn.toString().match(/^\s*function (\w+)/); + return match ? match[1] : '' + } + + function isSameType (a, b) { + return getType(a) === getType(b) + } + + function getTypeIndex (type, expectedTypes) { + if (!Array.isArray(expectedTypes)) { + return isSameType(expectedTypes, type) ? 0 : -1 + } + for (var i = 0, len = expectedTypes.length; i < len; i++) { + if (isSameType(expectedTypes[i], type)) { + return i + } + } + return -1 + } + + function getInvalidTypeMessage (name, value, expectedTypes) { + var message = "Invalid prop: type check failed for prop \"" + name + "\"." + + " Expected " + (expectedTypes.map(capitalize).join(', ')); + var expectedType = expectedTypes[0]; + var receivedType = toRawType(value); + var expectedValue = styleValue(value, expectedType); + var receivedValue = styleValue(value, receivedType); + // check if we need to specify expected value + if (expectedTypes.length === 1 && + isExplicable(expectedType) && + !isBoolean(expectedType, receivedType)) { + message += " with value " + expectedValue; + } + message += ", got " + receivedType + " "; + // check if we need to specify received value + if (isExplicable(receivedType)) { + message += "with value " + receivedValue + "."; + } + return message + } + + function styleValue (value, type) { + if (type === 'String') { + return ("\"" + value + "\"") + } else if (type === 'Number') { + return ("" + (Number(value))) + } else { + return ("" + value) + } + } + + function isExplicable (value) { + var explicitTypes = ['string', 'number', 'boolean']; + return explicitTypes.some(function (elem) { return value.toLowerCase() === elem; }) + } + + function isBoolean () { + var args = [], len = arguments.length; + while ( len-- ) args[ len ] = arguments[ len ]; + + return args.some(function (elem) { return elem.toLowerCase() === 'boolean'; }) + } + + /* */ + + function handleError (err, vm, info) { + // Deactivate deps tracking while processing error handler to avoid possible infinite rendering. + // See: https://github.com/vuejs/vuex/issues/1505 + pushTarget(); + try { + if (vm) { + var cur = vm; + while ((cur = cur.$parent)) { + var hooks = cur.$options.errorCaptured; + if (hooks) { + for (var i = 0; i < hooks.length; i++) { + try { + var capture = hooks[i].call(cur, err, vm, info) === false; + if (capture) { return } + } catch (e) { + globalHandleError(e, cur, 'errorCaptured hook'); + } + } + } + } + } + globalHandleError(err, vm, info); + } finally { + popTarget(); + } + } + + function invokeWithErrorHandling ( + handler, + context, + args, + vm, + info + ) { + var res; + try { + res = args ? handler.apply(context, args) : handler.call(context); + if (res && !res._isVue && isPromise(res) && !res._handled) { + res.catch(function (e) { return handleError(e, vm, info + " (Promise/async)"); }); + // issue #9511 + // avoid catch triggering multiple times when nested calls + res._handled = true; + } + } catch (e) { + handleError(e, vm, info); + } + return res + } + + function globalHandleError (err, vm, info) { + if (config.errorHandler) { + try { + return config.errorHandler.call(null, err, vm, info) + } catch (e) { + // if the user intentionally throws the original error in the handler, + // do not log it twice + if (e !== err) { + logError(e, null, 'config.errorHandler'); + } + } + } + logError(err, vm, info); + } + + function logError (err, vm, info) { + { + warn(("Error in " + info + ": \"" + (err.toString()) + "\""), vm); + } + /* istanbul ignore else */ + if ((inBrowser || inWeex) && typeof console !== 'undefined') { + console.error(err); + } else { + throw err + } + } + + /* */ + + var isUsingMicroTask = false; + + var callbacks = []; + var pending = false; + + function flushCallbacks () { + pending = false; + var copies = callbacks.slice(0); + callbacks.length = 0; + for (var i = 0; i < copies.length; i++) { + copies[i](); + } + } + + // Here we have async deferring wrappers using microtasks. + // In 2.5 we used (macro) tasks (in combination with microtasks). + // However, it has subtle problems when state is changed right before repaint + // (e.g. #6813, out-in transitions). + // Also, using (macro) tasks in event handler would cause some weird behaviors + // that cannot be circumvented (e.g. #7109, #7153, #7546, #7834, #8109). + // So we now use microtasks everywhere, again. + // A major drawback of this tradeoff is that there are some scenarios + // where microtasks have too high a priority and fire in between supposedly + // sequential events (e.g. #4521, #6690, which have workarounds) + // or even between bubbling of the same event (#6566). + var timerFunc; + + // The nextTick behavior leverages the microtask queue, which can be accessed + // via either native Promise.then or MutationObserver. + // MutationObserver has wider support, however it is seriously bugged in + // UIWebView in iOS >= 9.3.3 when triggered in touch event handlers. It + // completely stops working after triggering a few times... so, if native + // Promise is available, we will use it: + /* istanbul ignore next, $flow-disable-line */ + if (typeof Promise !== 'undefined' && isNative(Promise)) { + var p = Promise.resolve(); + timerFunc = function () { + p.then(flushCallbacks); + // In problematic UIWebViews, Promise.then doesn't completely break, but + // it can get stuck in a weird state where callbacks are pushed into the + // microtask queue but the queue isn't being flushed, until the browser + // needs to do some other work, e.g. handle a timer. Therefore we can + // "force" the microtask queue to be flushed by adding an empty timer. + if (isIOS) { setTimeout(noop); } + }; + isUsingMicroTask = true; + } else if (!isIE && typeof MutationObserver !== 'undefined' && ( + isNative(MutationObserver) || + // PhantomJS and iOS 7.x + MutationObserver.toString() === '[object MutationObserverConstructor]' + )) { + // Use MutationObserver where native Promise is not available, + // e.g. PhantomJS, iOS7, Android 4.4 + // (#6466 MutationObserver is unreliable in IE11) + var counter = 1; + var observer = new MutationObserver(flushCallbacks); + var textNode = document.createTextNode(String(counter)); + observer.observe(textNode, { + characterData: true + }); + timerFunc = function () { + counter = (counter + 1) % 2; + textNode.data = String(counter); + }; + isUsingMicroTask = true; + } else if (typeof setImmediate !== 'undefined' && isNative(setImmediate)) { + // Fallback to setImmediate. + // Technically it leverages the (macro) task queue, + // but it is still a better choice than setTimeout. + timerFunc = function () { + setImmediate(flushCallbacks); + }; + } else { + // Fallback to setTimeout. + timerFunc = function () { + setTimeout(flushCallbacks, 0); + }; + } + + function nextTick (cb, ctx) { + var _resolve; + callbacks.push(function () { + if (cb) { + try { + cb.call(ctx); + } catch (e) { + handleError(e, ctx, 'nextTick'); + } + } else if (_resolve) { + _resolve(ctx); + } + }); + if (!pending) { + pending = true; + timerFunc(); + } + // $flow-disable-line + if (!cb && typeof Promise !== 'undefined') { + return new Promise(function (resolve) { + _resolve = resolve; + }) + } + } + + /* */ + + var mark; + var measure; + + { + var perf = inBrowser && window.performance; + /* istanbul ignore if */ + if ( + perf && + perf.mark && + perf.measure && + perf.clearMarks && + perf.clearMeasures + ) { + mark = function (tag) { return perf.mark(tag); }; + measure = function (name, startTag, endTag) { + perf.measure(name, startTag, endTag); + perf.clearMarks(startTag); + perf.clearMarks(endTag); + // perf.clearMeasures(name) + }; + } + } + + /* not type checking this file because flow doesn't play well with Proxy */ + + var initProxy; + + { + var allowedGlobals = makeMap( + 'Infinity,undefined,NaN,isFinite,isNaN,' + + 'parseFloat,parseInt,decodeURI,decodeURIComponent,encodeURI,encodeURIComponent,' + + 'Math,Number,Date,Array,Object,Boolean,String,RegExp,Map,Set,JSON,Intl,' + + 'require' // for Webpack/Browserify + ); + + var warnNonPresent = function (target, key) { + warn( + "Property or method \"" + key + "\" is not defined on the instance but " + + 'referenced during render. Make sure that this property is reactive, ' + + 'either in the data option, or for class-based components, by ' + + 'initializing the property. ' + + 'See: https://vuejs.org/v2/guide/reactivity.html#Declaring-Reactive-Properties.', + target + ); + }; + + var warnReservedPrefix = function (target, key) { + warn( + "Property \"" + key + "\" must be accessed with \"$data." + key + "\" because " + + 'properties starting with "$" or "_" are not proxied in the Vue instance to ' + + 'prevent conflicts with Vue internals. ' + + 'See: https://vuejs.org/v2/api/#data', + target + ); + }; + + var hasProxy = + typeof Proxy !== 'undefined' && isNative(Proxy); + + if (hasProxy) { + var isBuiltInModifier = makeMap('stop,prevent,self,ctrl,shift,alt,meta,exact'); + config.keyCodes = new Proxy(config.keyCodes, { + set: function set (target, key, value) { + if (isBuiltInModifier(key)) { + warn(("Avoid overwriting built-in modifier in config.keyCodes: ." + key)); + return false + } else { + target[key] = value; + return true + } + } + }); + } + + var hasHandler = { + has: function has (target, key) { + var has = key in target; + var isAllowed = allowedGlobals(key) || + (typeof key === 'string' && key.charAt(0) === '_' && !(key in target.$data)); + if (!has && !isAllowed) { + if (key in target.$data) { warnReservedPrefix(target, key); } + else { warnNonPresent(target, key); } + } + return has || !isAllowed + } + }; + + var getHandler = { + get: function get (target, key) { + if (typeof key === 'string' && !(key in target)) { + if (key in target.$data) { warnReservedPrefix(target, key); } + else { warnNonPresent(target, key); } + } + return target[key] + } + }; + + initProxy = function initProxy (vm) { + if (hasProxy) { + // determine which proxy handler to use + var options = vm.$options; + var handlers = options.render && options.render._withStripped + ? getHandler + : hasHandler; + vm._renderProxy = new Proxy(vm, handlers); + } else { + vm._renderProxy = vm; + } + }; + } + + /* */ + + var seenObjects = new _Set(); + + /** + * Recursively traverse an object to evoke all converted + * getters, so that every nested property inside the object + * is collected as a "deep" dependency. + */ + function traverse (val) { + _traverse(val, seenObjects); + seenObjects.clear(); + } + + function _traverse (val, seen) { + var i, keys; + var isA = Array.isArray(val); + if ((!isA && !isObject(val)) || Object.isFrozen(val) || val instanceof VNode) { + return + } + if (val.__ob__) { + var depId = val.__ob__.dep.id; + if (seen.has(depId)) { + return + } + seen.add(depId); + } + if (isA) { + i = val.length; + while (i--) { _traverse(val[i], seen); } + } else { + keys = Object.keys(val); + i = keys.length; + while (i--) { _traverse(val[keys[i]], seen); } + } + } + + /* */ + + var normalizeEvent = cached(function (name) { + var passive = name.charAt(0) === '&'; + name = passive ? name.slice(1) : name; + var once$$1 = name.charAt(0) === '~'; // Prefixed last, checked first + name = once$$1 ? name.slice(1) : name; + var capture = name.charAt(0) === '!'; + name = capture ? name.slice(1) : name; + return { + name: name, + once: once$$1, + capture: capture, + passive: passive + } + }); + + function createFnInvoker (fns, vm) { + function invoker () { + var arguments$1 = arguments; + + var fns = invoker.fns; + if (Array.isArray(fns)) { + var cloned = fns.slice(); + for (var i = 0; i < cloned.length; i++) { + invokeWithErrorHandling(cloned[i], null, arguments$1, vm, "v-on handler"); + } + } else { + // return handler return value for single handlers + return invokeWithErrorHandling(fns, null, arguments, vm, "v-on handler") + } + } + invoker.fns = fns; + return invoker + } + + function updateListeners ( + on, + oldOn, + add, + remove$$1, + createOnceHandler, + vm + ) { + var name, def$$1, cur, old, event; + for (name in on) { + def$$1 = cur = on[name]; + old = oldOn[name]; + event = normalizeEvent(name); + if (isUndef(cur)) { + warn( + "Invalid handler for event \"" + (event.name) + "\": got " + String(cur), + vm + ); + } else if (isUndef(old)) { + if (isUndef(cur.fns)) { + cur = on[name] = createFnInvoker(cur, vm); + } + if (isTrue(event.once)) { + cur = on[name] = createOnceHandler(event.name, cur, event.capture); + } + add(event.name, cur, event.capture, event.passive, event.params); + } else if (cur !== old) { + old.fns = cur; + on[name] = old; + } + } + for (name in oldOn) { + if (isUndef(on[name])) { + event = normalizeEvent(name); + remove$$1(event.name, oldOn[name], event.capture); + } + } + } + + /* */ + + function mergeVNodeHook (def, hookKey, hook) { + if (def instanceof VNode) { + def = def.data.hook || (def.data.hook = {}); + } + var invoker; + var oldHook = def[hookKey]; + + function wrappedHook () { + hook.apply(this, arguments); + // important: remove merged hook to ensure it's called only once + // and prevent memory leak + remove(invoker.fns, wrappedHook); + } + + if (isUndef(oldHook)) { + // no existing hook + invoker = createFnInvoker([wrappedHook]); + } else { + /* istanbul ignore if */ + if (isDef(oldHook.fns) && isTrue(oldHook.merged)) { + // already a merged invoker + invoker = oldHook; + invoker.fns.push(wrappedHook); + } else { + // existing plain hook + invoker = createFnInvoker([oldHook, wrappedHook]); + } + } + + invoker.merged = true; + def[hookKey] = invoker; + } + + /* */ + + function extractPropsFromVNodeData ( + data, + Ctor, + tag + ) { + // we are only extracting raw values here. + // validation and default values are handled in the child + // component itself. + var propOptions = Ctor.options.props; + if (isUndef(propOptions)) { + return + } + var res = {}; + var attrs = data.attrs; + var props = data.props; + if (isDef(attrs) || isDef(props)) { + for (var key in propOptions) { + var altKey = hyphenate(key); + { + var keyInLowerCase = key.toLowerCase(); + if ( + key !== keyInLowerCase && + attrs && hasOwn(attrs, keyInLowerCase) + ) { + tip( + "Prop \"" + keyInLowerCase + "\" is passed to component " + + (formatComponentName(tag || Ctor)) + ", but the declared prop name is" + + " \"" + key + "\". " + + "Note that HTML attributes are case-insensitive and camelCased " + + "props need to use their kebab-case equivalents when using in-DOM " + + "templates. You should probably use \"" + altKey + "\" instead of \"" + key + "\"." + ); + } + } + checkProp(res, props, key, altKey, true) || + checkProp(res, attrs, key, altKey, false); + } + } + return res + } + + function checkProp ( + res, + hash, + key, + altKey, + preserve + ) { + if (isDef(hash)) { + if (hasOwn(hash, key)) { + res[key] = hash[key]; + if (!preserve) { + delete hash[key]; + } + return true + } else if (hasOwn(hash, altKey)) { + res[key] = hash[altKey]; + if (!preserve) { + delete hash[altKey]; + } + return true + } + } + return false + } + + /* */ + + // The template compiler attempts to minimize the need for normalization by + // statically analyzing the template at compile time. + // + // For plain HTML markup, normalization can be completely skipped because the + // generated render function is guaranteed to return Array. There are + // two cases where extra normalization is needed: + + // 1. When the children contains components - because a functional component + // may return an Array instead of a single root. In this case, just a simple + // normalization is needed - if any child is an Array, we flatten the whole + // thing with Array.prototype.concat. It is guaranteed to be only 1-level deep + // because functional components already normalize their own children. + function simpleNormalizeChildren (children) { + for (var i = 0; i < children.length; i++) { + if (Array.isArray(children[i])) { + return Array.prototype.concat.apply([], children) + } + } + return children + } + + // 2. When the children contains constructs that always generated nested Arrays, + // e.g.