diff --git a/1.00c50a4.js b/1.00c50a4.js deleted file mode 100644 index c2fb223..0000000 --- a/1.00c50a4.js +++ /dev/null @@ -1 +0,0 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[1],{72:function(module,__webpack_exports__,__webpack_require__){"use strict";eval('__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "rgba2laba", function() { return rgba2laba; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "rgba_laba_distance", function() { return rgba_laba_distance; });\n/* harmony import */ var _rgba2laba_bg__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(73);\n/* tslint:disable */\n\nlet cachegetFloat64Memory = null;\n\nfunction getFloat64Memory() {\n if (cachegetFloat64Memory === null || cachegetFloat64Memory.buffer !== _rgba2laba_bg__WEBPACK_IMPORTED_MODULE_0__[/* memory */ "c"].buffer) {\n cachegetFloat64Memory = new Float64Array(_rgba2laba_bg__WEBPACK_IMPORTED_MODULE_0__[/* memory */ "c"].buffer);\n }\n\n return cachegetFloat64Memory;\n}\n\nfunction getArrayF64FromWasm(ptr, len) {\n return getFloat64Memory().subarray(ptr / 8, ptr / 8 + len);\n}\n\nlet cachedGlobalArgumentPtr = null;\n\nfunction globalArgumentPtr() {\n if (cachedGlobalArgumentPtr === null) {\n cachedGlobalArgumentPtr = _rgba2laba_bg__WEBPACK_IMPORTED_MODULE_0__[/* __wbindgen_global_argument_ptr */ "b"]();\n }\n\n return cachedGlobalArgumentPtr;\n}\n\nlet cachegetUint32Memory = null;\n\nfunction getUint32Memory() {\n if (cachegetUint32Memory === null || cachegetUint32Memory.buffer !== _rgba2laba_bg__WEBPACK_IMPORTED_MODULE_0__[/* memory */ "c"].buffer) {\n cachegetUint32Memory = new Uint32Array(_rgba2laba_bg__WEBPACK_IMPORTED_MODULE_0__[/* memory */ "c"].buffer);\n }\n\n return cachegetUint32Memory;\n}\n/**\n* @param {number} arg0\n* @param {number} arg1\n* @param {number} arg2\n* @param {number} arg3\n* @param {number} arg4\n* @param {number} arg5\n* @param {number} arg6\n* @returns {Float64Array}\n*/\n\n\nfunction rgba2laba(arg0, arg1, arg2, arg3, arg4, arg5, arg6) {\n const retptr = globalArgumentPtr();\n _rgba2laba_bg__WEBPACK_IMPORTED_MODULE_0__[/* rgba2laba */ "d"](retptr, arg0, arg1, arg2, arg3, arg4, arg5, arg6);\n const mem = getUint32Memory();\n const rustptr = mem[retptr / 4];\n const rustlen = mem[retptr / 4 + 1];\n const realRet = getArrayF64FromWasm(rustptr, rustlen).slice();\n\n _rgba2laba_bg__WEBPACK_IMPORTED_MODULE_0__[/* __wbindgen_free */ "a"](rustptr, rustlen * 8);\n\n return realRet;\n}\n/**\n* @param {number} arg0\n* @param {number} arg1\n* @param {number} arg2\n* @param {number} arg3\n* @param {number} arg4\n* @param {number} arg5\n* @param {number} arg6\n* @param {number} arg7\n* @param {number} arg8\n* @param {number} arg9\n* @param {number} arg10\n* @returns {number}\n*/\n\nfunction rgba_laba_distance(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10) {\n return _rgba2laba_bg__WEBPACK_IMPORTED_MODULE_0__[/* rgba_laba_distance */ "e"](arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10);\n}//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNzIuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi93YXNtL3JnYmEybGFiYS93YXNtL3JnYmEybGFiYS5qcz84NzY2Il0sInNvdXJjZXNDb250ZW50IjpbIi8qIHRzbGludDpkaXNhYmxlICovXG5pbXBvcnQgKiBhcyB3YXNtIGZyb20gJy4vcmdiYTJsYWJhX2JnJztcbmxldCBjYWNoZWdldEZsb2F0NjRNZW1vcnkgPSBudWxsO1xuXG5mdW5jdGlvbiBnZXRGbG9hdDY0TWVtb3J5KCkge1xuICBpZiAoY2FjaG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TtBQUNBO0FBQ0E7QUFDQTtBQUNBIiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///72\n')},73:function(n,r,a){"use strict";var b=a.w[n.i];n.exports=b,b.f()}}]); \ No newline at end of file diff --git a/1.00c50a4.js.gz b/1.00c50a4.js.gz deleted file mode 100644 index 5f5003f..0000000 Binary files a/1.00c50a4.js.gz and /dev/null differ diff --git a/ab0ca95e464949a16375.module.wasm b/54df3a3c1a435554347d.module.wasm similarity index 99% rename from ab0ca95e464949a16375.module.wasm rename to 54df3a3c1a435554347d.module.wasm index 27ee930..17c521b 100644 Binary files a/ab0ca95e464949a16375.module.wasm and b/54df3a3c1a435554347d.module.wasm differ diff --git a/54df3a3c1a435554347d.module.wasm.gz b/54df3a3c1a435554347d.module.wasm.gz new file mode 100644 index 0000000..53e8107 Binary files /dev/null and b/54df3a3c1a435554347d.module.wasm.gz differ diff --git a/771.19fb315.js b/771.19fb315.js new file mode 100644 index 0000000..f916f2d --- /dev/null +++ b/771.19fb315.js @@ -0,0 +1,2 @@ +"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[771],{7771:(r,e,a)=>{a.r(e),a.d(e,{rgba2laba:()=>f,rgba_laba_distance:()=>t});var n=a(5542);let l=null;let u=null,b=null;function f(r,e,a,f,t,s,_){const o=(null===u&&(u=n.__wbindgen_global_argument_ptr()),u);n.rgba2laba(o,r,e,a,f,t,s,_);const c=(null!==b&&b.buffer===n.memory.buffer||(b=new Uint32Array(n.memory.buffer)),b),i=c[o/4],m=c[o/4+1],g=(w=i,y=m,(null!==l&&l.buffer===n.memory.buffer||(l=new Float64Array(n.memory.buffer)),l).subarray(w/8,w/8+y)).slice();var w,y;return n.__wbindgen_free(i,8*m),g}function t(r,e,a,l,u,b,f,t,s,_,o){return n.rgba_laba_distance(r,e,a,l,u,b,f,t,s,_,o)}},5542:(r,e,a)=>{var n=a.w[r.id];r.exports=n,n[""]()}}]); +//# sourceMappingURL=771.19fb315.js.map \ No newline at end of file diff --git a/771.19fb315.js.gz b/771.19fb315.js.gz new file mode 100644 index 0000000..8226c30 Binary files /dev/null and b/771.19fb315.js.gz differ diff --git a/771.19fb315.js.map b/771.19fb315.js.map new file mode 100644 index 0000000..575427b --- /dev/null +++ b/771.19fb315.js.map @@ -0,0 +1 @@ +{"version":3,"file":"771.19fb315.js","mappings":"0JAGA,IAAIA,EAAwB,KAY5B,IAAIC,EAA0B,KAQ1BC,EAAuB,KAiBpB,SAASC,EAAUC,EAAMC,EAAMC,EAAMC,EAAMC,EAAMC,EAAMC,GAC1D,MAAMC,GAxB0B,OAA5BV,IACAA,EAA0BW,EAAAA,kCAEvBX,GAsBPW,EAAAA,UAAeD,EAAQP,EAAMC,EAAMC,EAAMC,EAAMC,EAAMC,EAAMC,GAC3D,MAAMG,GAlBuB,OAAzBX,GAAiCA,EAAqBY,SAAWF,EAAAA,OAAYE,SAC7EZ,EAAuB,IAAIa,YAAYH,EAAAA,OAAYE,SAEhDZ,GAgBDc,EAAUH,EAAIF,EAAS,GACvBM,EAAUJ,EAAIF,EAAS,EAAI,GAE3BO,GApCmBC,EAoCWH,EApCNI,EAoCeH,GA1Cf,OAA1BjB,GAAkCA,EAAsBc,SAAWF,EAAAA,OAAYE,SAC/Ed,EAAwB,IAAIqB,aAAaT,EAAAA,OAAYE,SAElDd,GAImBsB,SAASH,EAAM,EAAGA,EAAM,EAAIC,IAmCAG,QApC1D,IAA6BJ,EAAKC,EAsC9B,OADAR,EAAAA,gBAAqBI,EAAmB,EAAVC,GACvBC,CAEX,CAgBO,SAASM,EAAmBpB,EAAMC,EAAMC,EAAMC,EAAMC,EAAMC,EAAMC,EAAMe,EAAMC,EAAMC,EAAMC,GAC3F,OAAOhB,EAAAA,mBAAwBR,EAAMC,EAAMC,EAAMC,EAAMC,EAAMC,EAAMC,EAAMe,EAAMC,EAAMC,EAAMC,EAC/F,C","sources":["webpack:///./wasm/rgba2laba/wasm/rgba2laba.js"],"sourcesContent":["/* tslint:disable */\nimport * as wasm from './rgba2laba_bg';\n\nlet cachegetFloat64Memory = null;\nfunction getFloat64Memory() {\n if (cachegetFloat64Memory === null || cachegetFloat64Memory.buffer !== wasm.memory.buffer) {\n cachegetFloat64Memory = new Float64Array(wasm.memory.buffer);\n }\n return cachegetFloat64Memory;\n}\n\nfunction getArrayF64FromWasm(ptr, len) {\n return getFloat64Memory().subarray(ptr / 8, ptr / 8 + len);\n}\n\nlet cachedGlobalArgumentPtr = null;\nfunction globalArgumentPtr() {\n if (cachedGlobalArgumentPtr === null) {\n cachedGlobalArgumentPtr = wasm.__wbindgen_global_argument_ptr();\n }\n return cachedGlobalArgumentPtr;\n}\n\nlet cachegetUint32Memory = null;\nfunction getUint32Memory() {\n if (cachegetUint32Memory === null || cachegetUint32Memory.buffer !== wasm.memory.buffer) {\n cachegetUint32Memory = new Uint32Array(wasm.memory.buffer);\n }\n return cachegetUint32Memory;\n}\n/**\n* @param {number} arg0\n* @param {number} arg1\n* @param {number} arg2\n* @param {number} arg3\n* @param {number} arg4\n* @param {number} arg5\n* @param {number} arg6\n* @returns {Float64Array}\n*/\nexport function rgba2laba(arg0, arg1, arg2, arg3, arg4, arg5, arg6) {\n const retptr = globalArgumentPtr();\n wasm.rgba2laba(retptr, arg0, arg1, arg2, arg3, arg4, arg5, arg6);\n const mem = getUint32Memory();\n const rustptr = mem[retptr / 4];\n const rustlen = mem[retptr / 4 + 1];\n\n const realRet = getArrayF64FromWasm(rustptr, rustlen).slice();\n wasm.__wbindgen_free(rustptr, rustlen * 8);\n return realRet;\n\n}\n\n/**\n* @param {number} arg0\n* @param {number} arg1\n* @param {number} arg2\n* @param {number} arg3\n* @param {number} arg4\n* @param {number} arg5\n* @param {number} arg6\n* @param {number} arg7\n* @param {number} arg8\n* @param {number} arg9\n* @param {number} arg10\n* @returns {number}\n*/\nexport function rgba_laba_distance(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10) {\n return wasm.rgba_laba_distance(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10);\n}\n\n"],"names":["cachegetFloat64Memory","cachedGlobalArgumentPtr","cachegetUint32Memory","rgba2laba","arg0","arg1","arg2","arg3","arg4","arg5","arg6","retptr","wasm","mem","buffer","Uint32Array","rustptr","rustlen","realRet","ptr","len","Float64Array","subarray","slice","rgba_laba_distance","arg7","arg8","arg9","arg10"],"sourceRoot":""} \ No newline at end of file diff --git a/771.19fb315.js.map.gz b/771.19fb315.js.map.gz new file mode 100644 index 0000000..9891568 Binary files /dev/null and b/771.19fb315.js.map.gz differ diff --git a/ab0ca95e464949a16375.module.wasm.gz b/ab0ca95e464949a16375.module.wasm.gz deleted file mode 100644 index 16b2d54..0000000 Binary files a/ab0ca95e464949a16375.module.wasm.gz and /dev/null differ diff --git a/app.00c50a4.js b/app.00c50a4.js deleted file mode 100644 index e2d5b32..0000000 --- a/app.00c50a4.js +++ /dev/null @@ -1 +0,0 @@ -!function(n){function t(t){for(var e,I,c=t[0],l=t[1],B=0,a=[];B {\n wasmRgba2labaInner = obj.rgba2laba; // eslint-disable-line\n\n wasmRgbaLabaDistanceInner = obj.rgba_laba_distance; // eslint-disable-line\n // wasmRgbaLabaDistanceTransformRInner = obj.rgba_laba_distance_transform_right; // eslint-disable-line\n});\nconst serializeState = state => JSON.stringify(state); // https://stackoverflow.com/questions/596216/formula-to-determine-brightness-of-rgb-color\n// TODO: make formula an enum\n\nconst luminanceItuBt709 = c => 0.2126 * c[0] + 0.7152 * c[1] + 0.0722 * c[2] * (c[3] / 255); // ITU BT.601\n\nconst luminance = c => 0.299 * c[0] + 0.587 * c[1] + 0.114 * c[2] * (c[3] / 255);\nconst quantizeValue = (value, levels) => {\n const step = 255 / (levels - 1);\n const bucket = Math.round(value / step);\n return Math.round(bucket * step);\n};\nconst clamp = (min, max, value) => Math.max(min, Math.min(max, value));\nconst rgba = (r, g, b, a) => [r, g, b, a]; // mutates input\n\nconst equalize = input => {\n let min = input[0];\n let max = input[0];\n\n for (let i = 1; i < input.length; i += 1) {\n const val = input[i];\n if (i < min) min = val;\n if (i > max) max = val;\n }\n\n const range = max - min;\n const factor = 256 / range;\n\n for (let i = 0; i < input.length; i += 1) {\n input[i] = input[i] - min * factor; // eslint-disable-line\n }\n}; // http://www.easyrgb.com/en/math.php#text1\n\nconst referenceTable = {\n CIE_1931: {\n // 2° (CIE 1931)\n D65: {\n x: 95.047,\n y: 100,\n z: 108.883\n }\n },\n CIE_1964: {\n // 10° (CIE 1964)\n D65: {\n x: 94.811,\n y: 100,\n z: 107.304\n }\n }\n}; // 0-360, 0-1, 0-1, 0-1\n\nconst rgba2hsva = input => {\n const r = input[0] / 255;\n const g = input[1] / 255;\n const b = input[2] / 255;\n const a = input[3] / 255;\n let h;\n let s;\n const min = Math.min(r, g, b);\n const max = Math.max(r, g, b);\n const delta = max - min;\n const v = max;\n\n if (delta > 0) {\n s = delta / max;\n } else {\n s = 0;\n h = 0;\n return [h, s, v, a];\n }\n\n if (r === max) {\n h = (g - b) / delta;\n } else if (g === max) {\n h = 2 + (b - r) / delta;\n } else {\n h = 4 + (r - g) / delta;\n }\n\n h *= 60;\n\n if (h < 0) {\n h += 360;\n }\n\n return [h, s, v, a];\n}; // https://stackoverflow.com/questions/7880264/convert-lab-color-to-rgb\n// Convert RGB > XYZ > CIE Lab, copying alpha channel\n\nconst rgba2laba = (input, ref = referenceTable.CIE_1931.D65) => {\n let r = input[0] / 255;\n let g = input[1] / 255;\n let b = input[2] / 255;\n r = r > 0.04045 ? ((r + 0.055) / 1.055) ** 2.4 : r / 12.92;\n g = g > 0.04045 ? ((g + 0.055) / 1.055) ** 2.4 : g / 12.92;\n b = b > 0.04045 ? ((b + 0.055) / 1.055) ** 2.4 : b / 12.92;\n r *= 100;\n g *= 100;\n b *= 100; // Observer= 2° (Only use CIE 1931!)\n\n let x = r * 0.4124 + g * 0.3576 + b * 0.1805;\n let y = r * 0.2126 + g * 0.7152 + b * 0.0722;\n let z = r * 0.0193 + g * 0.1192 + b * 0.9505;\n x /= ref.x;\n y /= ref.y;\n z /= ref.z;\n x = x > 0.008856 ? x ** (1 / 3) : x * 7.787 + 16 / 116;\n y = y > 0.008856 ? y ** (1 / 3) : y * 7.787 + 16 / 116;\n z = z > 0.008856 ? z ** (1 / 3) : z * 7.787 + 16 / 116;\n const outL = 116 * y - 16;\n const outA = 500 * (x - y);\n const outB = 200 * (y - z);\n return [outL, outA, outB, input[3]];\n};\n\nlet wasmRgba2labaInner = (a, b, c, d, e, f, g) => {\n console.error("WASM module not loaded!", a, b, c, d, e, f, g); // eslint-disable-line\n\n return [0, 0, 0, 0];\n};\n\nlet wasmRgbaLabaDistanceInner = (a, b, c, d, e, f, g, h, i, j, k) => {\n console.error("WASM module not loaded!", a, b, c, d, e, f, g, h, i, j, k); // eslint-disable-line\n\n return 0;\n}; // let wasmRgbaLabaDistanceTransformRInner = (a, b, c, d, e, f, g, h, i, j, k) => {\n// console.error("WASM module not loaded!", a, b, c, d, e, f, g, h, i, j, k); // eslint-disable-line\n// return 0;\n// };\n\n\nconst wasmRgbaLabaDistance = (a, b, ref = referenceTable.CIE_1931.D65) => wasmRgbaLabaDistanceInner(a[0], a[1], a[2], a[3], b[0], b[1], b[2], b[3], ref.x, ref.y, ref.z);\nconst wasmRgba2laba = (input // $FlowFixMe\n, ref = referenceTable.CIE_1931.D65) => wasmRgba2labaInner(input[0], input[1], input[2], input[3], ref.x, ref.y, ref.z);\nconst wasmRgba2labaMemo = lodash_memoize__WEBPACK_IMPORTED_MODULE_1___default()(wasmRgba2laba); // Convert CIE Lab > XYZ > RGBA, copying alpha channel\n\nconst laba2rgba = (input, ref = referenceTable.CIE_1931.D65) => {\n let y = (input[0] + 16) / 116;\n let x = input[1] / 500 + y;\n let z = y - input[2] / 200;\n y = y ** 3 > 0.008856 ? y ** 3 : (y - 16 / 116) / 7.787;\n x = x ** 3 > 0.008856 ? x ** 3 : (x - 16 / 116) / 7.787;\n z = z ** 3 > 0.008856 ? z ** 3 : (z - 16 / 116) / 7.787; // Observer= 2° (Only use CIE 1931!)\n\n x *= ref.x;\n y *= ref.y;\n z *= ref.z; // Normalize\n\n x /= 100;\n y /= 100;\n z /= 100;\n let r = x * 3.2406 + y * -1.5372 + z * -0.4986;\n let g = x * -0.9689 + y * 1.8758 + z * 0.0415;\n let b = x * 0.0557 + y * -0.204 + z * 1.057;\n r = r > 0.0031308 ? 1.055 * r ** (1 / 2.4) - 0.055 : 12.92 * r;\n g = g > 0.0031308 ? 1.055 * g ** (1 / 2.4) - 0.055 : 12.92 * g;\n b = b > 0.0031308 ? 1.055 * b ** (1 / 2.4) - 0.055 : 12.92 * b;\n r = clamp(0, 255, Math.round(r * 255));\n g = clamp(0, 255, Math.round(g * 255));\n b = clamp(0, 255, Math.round(b * 255));\n return [r, g, b, input[3]];\n}; // a can be assumed to be palette colour\n\nconst colorDistance = (a, b, colorDistanceAlgorithm) => {\n switch (colorDistanceAlgorithm) {\n case constants_color__WEBPACK_IMPORTED_MODULE_0__[/* RGB_NEAREST */ "d"]:\n return Math.sqrt((a[0] - b[0]) ** 2 + (a[1] - b[1]) ** 2 + (a[2] - b[2]) ** 2);\n\n case constants_color__WEBPACK_IMPORTED_MODULE_0__[/* LAB_NEAREST */ "b"]:\n {\n const aLab = rgba2laba(a);\n const bLab = rgba2laba(b);\n return Math.sqrt((bLab[0] - aLab[0]) ** 2 + (bLab[1] - aLab[1]) ** 2 + (bLab[2] - aLab[2]) ** 2);\n }\n\n case constants_color__WEBPACK_IMPORTED_MODULE_0__[/* WASM_LAB_NEAREST */ "e"]:\n {\n return wasmRgbaLabaDistance(a, b);\n }\n\n case constants_color__WEBPACK_IMPORTED_MODULE_0__[/* WASM_LAB_NEAREST_MEMO_PALETTE */ "f"]:\n {\n const aLab = wasmRgba2labaMemo(a);\n const bLab = rgba2laba(b);\n return Math.sqrt((bLab[0] - aLab[0]) ** 2 + (bLab[1] - aLab[1]) ** 2 + (bLab[2] - aLab[2]) ** 2);\n }\n\n case constants_color__WEBPACK_IMPORTED_MODULE_0__[/* RGB_APPROX */ "c"]:\n {\n const r = (a[0] + b[0]) / 2;\n const dR = a[0] - b[0];\n const dG = a[1] - b[1];\n const dB = a[2] - b[2];\n const dRc = (2 + r / 256) * dR ** 2;\n const dGc = 4 * dG ** 2 + (2 + (255 - r) / 256);\n const dBc = dB ** 2;\n return Math.sqrt(dRc + dGc + dBc);\n }\n\n case constants_color__WEBPACK_IMPORTED_MODULE_0__[/* HSV_NEAREST */ "a"]:\n {\n const aHsv = rgba2hsva(a);\n const bHsv = rgba2hsva(b);\n const dH = Math.min(Math.abs(bHsv[0] - aHsv[0]), 360 - Math.abs(bHsv[0] - aHsv[0])) / 180.0;\n const dS = Math.abs(bHsv[1] - aHsv[1]);\n const dV = Math.abs(bHsv[2] - aHsv[2]) / 255.0;\n return Math.sqrt(dH ** 2 + dS ** 2 + dV ** 2);\n }\n\n default:\n return -1;\n }\n};\nconst medianCutPalette = (buf, limit, ignoreAlpha, adaptMode, colorMode = "RGB") => {\n const range = {\n r: {\n min: buf[0],\n max: buf[0]\n },\n g: {\n min: buf[0],\n max: buf[0]\n },\n b: {\n min: buf[0],\n max: buf[0]\n },\n a: {\n min: buf[0],\n max: buf[0]\n }\n };\n const pixels = [];\n\n for (let i = 0; i < buf.length; i += 4) {\n const pixelRaw = rgba(buf[i], buf[i + 1], buf[i + 2], buf[i + 3]);\n const pixel = colorMode === "RGB" ? pixelRaw : rgba2laba(pixelRaw);\n const r = pixel[0];\n const g = pixel[1];\n const b = pixel[2];\n const a = pixel[3];\n range.r.min = r < range.r.min ? r : range.r.min;\n range.r.max = r > range.r.max ? r : range.r.max;\n range.g.min = g < range.g.min ? g : range.g.min;\n range.g.max = g > range.g.max ? g : range.g.max;\n range.b.min = b < range.b.min ? b : range.b.min;\n range.b.max = b > range.b.max ? b : range.b.max;\n range.a.min = a < range.a.min ? a : range.a.min;\n range.a.max = a > range.a.max ? a : range.a.max;\n pixels.push(pixel);\n }\n\n const channelsByRange = [{\n channel: 0,\n range: range.r.max - range.r.min\n }, {\n channel: 1,\n range: range.g.max - range.g.min\n }, {\n channel: 2,\n range: range.b.max - range.b.min\n }, {\n channel: 3,\n range: range.a.max - range.a.min\n }].sort((a, b) => b.range - a.range);\n\n const medianCut = (bucket, channelSequence, remaining, iterations, ignAlpha, adptMode) => {\n const channel = channelSequence[iterations % (ignAlpha ? 3 : 4)];\n bucket.sort((a, b) => b[channel.channel] - a[channel.channel]);\n const midIdx = Math.floor(bucket.length / 2);\n\n if (remaining <= 0) {\n switch (adaptMode) {\n case "AVERAGE":\n {\n const acc = [0, 0, 0, 0];\n bucket.forEach(c => {\n acc[0] += c[0] / bucket.length;\n acc[1] += c[1] / bucket.length;\n acc[2] += c[2] / bucket.length;\n acc[3] += c[3] / bucket.length;\n }); // $FlowFixMe\n\n return [acc.map(ch => Math.floor(ch))];\n }\n\n case "FIRST":\n return [bucket[0]];\n\n default:\n case "MID":\n return [bucket[midIdx]];\n }\n } // Subsort recursively, cycling through channels\n\n\n return [bucket.slice(0, midIdx), bucket.slice(midIdx, bucket.length)].map(g => medianCut(g, channelSequence, remaining - 1, iterations + 1, ignAlpha, adptMode)).reduce((a, b) => a.concat(b), []);\n };\n\n const paletteRaw = medianCut(pixels, channelsByRange, limit, 0, ignoreAlpha, adaptMode).filter(c => c != null);\n\n if (colorMode === "RGB") {\n return paletteRaw;\n } else if (colorMode === "LAB") {\n return paletteRaw.map(c => laba2rgba(c));\n }\n\n return [];\n};\nconst uniqueColors = (buf, limit) => {\n const seen = {};\n\n for (let i = 0; i < buf.length; i += 4) {\n const r = buf[i];\n const g = buf[i + 1];\n const b = buf[i + 2];\n const a = buf[i + 3];\n const key = `${r}-${g}-${b}-${a}`;\n\n if (seen[key] && seen[key].count) {\n seen[key].count += 1;\n } else {\n seen[key] = {\n count: 1,\n color: rgba(r, g, b, a)\n };\n }\n }\n\n if (limit) {\n return Object.values(seen).sort((a, b) => {\n if (!a || !b || typeof a.count !== "number" || typeof b.count !== "number") {\n return 0;\n }\n\n if (a.count < b.count) return -1;\n if (a.count > b.count) return 1;\n return 0;\n }).slice(0, limit) // $FlowFixMe\n .map(c => c.color);\n } // $FlowFixMe\n\n\n return Object.values(seen).map(c => c.color);\n}; // Preserves nulls\n\nconst scaleMatrix = (mat, scale) => mat.map(row => row.map(col => col ? col * scale : col));\nconst add = (a, b) => [a[0] + b[0], a[1] + b[1], a[2] + b[2], a[3] + b[3]];\nconst sub = (a, b) => [a[0] - b[0], a[1] - b[1], a[2] - b[2], a[3] - b[3]];\nconst scale = (a, scalar, alpha = false) => [scalar * a[0], scalar * a[1], scalar * a[2], alpha ? scalar * a[3] : a[3]]; // contrast factor 0-1 ideally\n\nconst contrast = (color, factor) => {\n // normalise to [-1, 1]\n const nC = [color[0] / 255 - 0.5, color[1] / 255 - 0.5, color[2] / 255 - 0.5, color[3]];\n return [(nC[0] + factor * (nC[0] - 1.0) * nC[0] * (nC[0] - 0.5) + 0.5) * 255, (nC[1] + factor * (nC[1] - 1.0) * nC[1] * (nC[1] - 0.5) + 0.5) * 255, (nC[2] + factor * (nC[2] - 1.0) * nC[2] * (nC[2] - 0.5) + 0.5) * 255, color[3]];\n}; // factor 0-255, exposure ideally 0-2 (small number)\n\nconst brightness = (color, factor, exposure = 1) => [color[0] * exposure + factor, color[1] * exposure + factor, color[2] * exposure + factor, color[3]];\nconst gamma = (color, g) => [255 * (color[0] / 255) ** (1 / g), 255 * (color[1] / 255) ** (1 / g), 255 * (color[2] / 255) ** (1 / g), color[3]];\nconst getBufferIndex = (x, y, width) => (x + width * y) * 4; // FIXME: Make signature consistent with addBufferPixel\n\nconst fillBufferPixel = (buf, i, r, g, b, a) => {\n buf[i] = r; // eslint-disable-line\n\n buf[i + 1] = g; // eslint-disable-line\n\n buf[i + 2] = b; // eslint-disable-line\n\n buf[i + 3] = a; // eslint-disable-line\n};\nconst addBufferPixel = (buf, i, color) => {\n buf[i] += color[0]; // eslint-disable-line\n\n buf[i + 1] += color[1]; // eslint-disable-line\n\n buf[i + 2] += color[2]; // eslint-disable-line\n\n buf[i + 3] += color[3]; // eslint-disable-line\n};\nconst cloneCanvas = (original, copyData = true) => {\n const clone = document.createElement("canvas");\n clone.width = original.width;\n clone.height = original.height;\n const cloneCtx = clone.getContext("2d");\n\n if (cloneCtx && copyData) {\n cloneCtx.drawImage(original, 0, 0);\n }\n\n return clone;\n};//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMC5qcyIsInNvdXJjZXMiOlsid2VicGFjazovLy8uL3V0aWxzL2luZGV4LmpzPzkwNTYiXSwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IHsgUkdCX05FQVJFU1QsIFJHQl9BUFBST1gsIEhTVl9ORUFSRVNULCBMQUJfTkVBUkVTVCwgV0FTTV9MQUJfTkVBUkVTVCwgV0FTTV9MQUJfTkVBUkVTVF9NRU1PX1BBTEVUVEUgfSBmcm9tIFwiY29uc3RhbnRzL2NvbG9yXCI7XG5pbXBvcnQgbWVtb2l6ZSBmcm9tIFwibG9kYXNoLm1lbW9pemVcIjtcbmNvbnN0IHJ1c3QgPSBpbXBvcnQoXCJ3YXNtL3JnYmEybGFiYS93YXNtL3JnYmEybGFiYVwiKTtcbnJ1c3QudGhlbihvYmogPT4ge1xuICB3YXNtUmdiYTJsYWJhSW5uZXIgPSBvYmoucmdiYTJsYWJhOyAvLyBlc2xpbnQtZGlzYWJsZS1saW5lXG5cbiAgd2FzbVJnYmFMYWJhRGlzdGFuY2VJbm5lciA9IG9iai5yZ2JhX2xhYmFfZGlzdGFuY2U7IC8vIGVzbGludC1kaXNhYmxlLWxpbmVcbiAgLy8gd2FzbVJnYmFMYWJhRGlzdGFuY2VUcmFuc2Zvcm1SSW5uZXIgPSBvYmoucmdiYV9sYWJhX2Rpc3RhbmNlX3RyYW5zZm9ybV9yaWdodDsgLy8gZXNsaW50LWRpc2FibGUtbGluZVxufSk7XG5leHBvcnQgY29uc3Qgc2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tBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQSIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///0\n')},function(module,exports,__webpack_require__){"use strict";eval("\n\nif (true) {\n module.exports = __webpack_require__(47);\n} else {}\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMS5qcyIsInNvdXJjZXMiOlsid2VicGFjazovLy8uLi9ub2RlX21vZHVsZXMvcmVhY3QvaW5kZXguanM/OTk3MSJdLCJzb3VyY2VzQ29udGVudCI6WyIndXNlIHN0cmljdCc7XG5cbmlmIChwcm9jZXNzLmVudi5OT0RFX0VOViA9PT0gJ3Byb2R1Y3Rpb24nKSB7XG4gIG1vZHVsZS5leHBvcnRzID0gcmVxdWlyZSgnLi9janMvcmVhY3QucHJvZHVjdGlvbi5taW4uanMnKTtcbn0gZWxzZSB7XG4gIG1vZHVsZS5leHBvcnRzID0gcmVxdWlyZSgnLi9janMvcmVhY3QuZGV2ZWxvcG1lbnQuanMnKTtcbn1cbiJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQSxTQUVBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///1\n")},function(module,exports,__webpack_require__){eval("/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nif (false) { var throwOnDirectAccess, isValidElement, REACT_ELEMENT_TYPE; } else {\n // By explicitly using `prop-types` you are opting into new production behavior.\n // http://fb.me/prop-types-in-prod\n module.exports = __webpack_require__(56)();\n}\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMi5qcyIsInNvdXJjZXMiOlsid2VicGFjazovLy8uLi9ub2RlX21vZHVsZXMvcHJvcC10eXBlcy9pbmRleC5qcz81YjQwIl0sInNvdXJjZXNDb250ZW50IjpbIi8qKlxuICogQ29weXJpZ2h0IChjKSAyMDEzLXByZXNlbnQsIEZhY2Vib29rLCBJbmMuXG4gKlxuICogVGhpcyBzb3VyY2UgY29kZSBpcyBsaWNlbnNlZCB1bmRlciB0aGUgTUlUIGxpY2Vuc2UgZm91bmQgaW4gdGhlXG4gKiBMSUNFTlNFIGZpbGUgaW4gdGhlIHJvb3QgZGlyZWN0b3J5IG9mIHRoaXMgc291cmNlIHRyZWUuXG4gKi9cblxuaWYgKHByb2Nlc3MuZW52Lk5PREVfRU5WICE9PSAncHJvZHVjdGlvbicpIHtcbiAgdmFyIFJFQUNUX0VMRU1FTlRfVFlQRSA9ICh0eXBlb2YgU3ltYm9sID09PSAnZnVuY3Rpb24nICYmXG4gICAgU3ltYm9sLmZvciAmJlxuICAgIFN5bWJvbC5mb3IoJ3JlYWN0LmVsZW1lbnQnKSkgfHxcbiAgICAweGVhYzc7XG5cbiAgdmFyIGlzVmFsaWRFbGVtZW50ID0gZnVuY3Rpb24ob2JqZWN0KSB7XG4gICAgcmV0dXJuIHR5cGVvZiBvYmplY3QgPT09ICdvYmplY3QnICYmXG4gICAgICBvYmplY3QgIT09IG51bGwgJiZcbiAgICAgIG9iamVjdC4kJHR5cGVvZiA9PT0gUkVBQ1RfRUxFTUVOVF9UWVBFO1xuICB9O1xuXG4gIC8vIEJ5IGV4cGxpY2l0bHkgdXNpbmcgYHByb3AtdHlwZXNgIHlvdSBhcmUgb3B0aW5nIGludG8gbmV3IGRldmVsb3BtZW50IGJlaGF2aW9yLlxuICAvLyBodHRwOi8vZmIubWUvcHJvcC10eXBlcy1pbi1wcm9kXG4gIHZhciB0aHJvd09uRGlyZWN0QWNjZXNzID0gdHJ1ZTtcbiAgbW9kdWxlLmV4cG9ydHMgPSByZXF1aXJlKCcuL2ZhY3RvcnlXaXRoVHlwZUNoZWNrZXJzJykoaXNWYWxpZEVsZW1lbnQsIHRocm93T25EaXJlY3RBY2Nlc3MpO1xufSBlbHNlIHtcbiAgLy8gQnkgZXhwbGljaXRseSB1c2luZyBgcHJvcC10eXBlc2AgeW91IGFyZSBvcHRpbmcgaW50byBuZXcgcHJvZHVjdGlvbiBiZWhhdmlvci5cbiAgLy8gaHR0cDovL2ZiLm1lL3Byb3AtdHlwZXMtaW4tcHJvZFxuICBtb2R1bGUuZXhwb3J0cyA9IHJlcXVpcmUoJy4vZmFjdG9yeVdpdGhUaHJvd2luZ1NoaW1zJykoKTtcbn1cbiJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQSwyRUFnQkE7QUFDQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///2\n")},function(module,__webpack_exports__,__webpack_require__){"use strict";eval('/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return BOOL; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "d", function() { return ENUM; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "f", function() { return RANGE; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "h", function() { return STRING; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "i", function() { return TEXT; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "e", function() { return PALETTE; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return COLOR_ARRAY; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return COLOR_DISTANCE_ALGORITHM; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "g", function() { return SCALING_ALGORITHM_OPTIONS; });\n/* harmony import */ var constants_color__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(10);\n/* harmony import */ var constants_optionTypes__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(11);\n\n\nconst BOOL = "BOOL";\nconst ENUM = "ENUM";\nconst RANGE = "RANGE";\nconst STRING = "STRING";\nconst TEXT = "TEXT";\nconst PALETTE = "PALETTE";\nconst COLOR_ARRAY = "COLOR_ARRAY";\nconst COLOR_DISTANCE_ALGORITHM = {\n type: ENUM,\n options: [{\n name: "RGB",\n value: constants_color__WEBPACK_IMPORTED_MODULE_0__[/* RGB_NEAREST */ "d"]\n }, {\n name: "RGB (perceptual approx.)",\n value: constants_color__WEBPACK_IMPORTED_MODULE_0__[/* RGB_APPROX */ "c"]\n }, {\n name: "HSV",\n value: constants_color__WEBPACK_IMPORTED_MODULE_0__[/* HSV_NEAREST */ "a"]\n }, {\n name: "Lab",\n value: constants_color__WEBPACK_IMPORTED_MODULE_0__[/* LAB_NEAREST */ "b"]\n }, {\n name: "Lab (wasm)",\n value: constants_color__WEBPACK_IMPORTED_MODULE_0__[/* WASM_LAB_NEAREST */ "e"]\n }, {\n name: "Lab (wasm, memoized palette)",\n value: constants_color__WEBPACK_IMPORTED_MODULE_0__[/* WASM_LAB_NEAREST_MEMO_PALETTE */ "f"]\n }],\n default: constants_color__WEBPACK_IMPORTED_MODULE_0__[/* RGB_APPROX */ "c"]\n};\nconst SCALING_ALGORITHM_OPTIONS = {\n type: ENUM,\n options: [{\n name: "Auto",\n value: constants_optionTypes__WEBPACK_IMPORTED_MODULE_1__[/* SCALING_ALGORITHM */ "b"].AUTO\n }, {\n name: "Pixelated",\n value: constants_optionTypes__WEBPACK_IMPORTED_MODULE_1__[/* SCALING_ALGORITHM */ "b"].PIXELATED\n }],\n default: constants_optionTypes__WEBPACK_IMPORTED_MODULE_1__[/* SCALING_ALGORITHM */ "b"].AUTO\n};//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMy5qcyIsInNvdXJjZXMiOlsid2VicGFjazovLy8uL2NvbnN0YW50cy9jb250cm9sVHlwZXMuanM/NzJmMiJdLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgeyBSR0JfTkVBUkVTVCwgUkdCX0FQUFJPWCwgTEFCX05FQVJFU1QsIEhTVl9ORUFSRVNULCBXQVNNX0xBQl9ORUFSRVNULCBXQVNNX0xBQl9ORUFSRVNUX01FTU9fUEFMRVRURSB9IGZyb20gXCJjb25zdGFudHMvY29sb3JcIjtcbmltcG9ydCB7IFNDQUxJTkdfQUxHT1JJVEhNIH0gZnJvbSBcImNvbnN0YW50cy9vcHRpb25UeXBlc1wiO1xuZXhwb3J0IGNvbnN0IEJPT0wgPSBcIkJPT0xcIjtcbmV4cG9ydCBjb25zdCBFTlVNID0gXCJFTlVNXCI7XG5leHBvcnQgY29uc3QgUkFOR0UgPSBcIlJBTkdFXCI7XG5leHBvcnQgY29uc3QgU1RSSU5HID0gXCJTVFJJTkdcIjtcbmV4cG9ydCBjb25zdCBURVhUID0gXCJURVhUXCI7XG5leHBvcnQgY29uc3QgUEFMRVRURSA9IFwiUEFMRVRURVwiO1xuZXhwb3J0IGNvbnN0IENPTE9SX0FSUkFZID0gXCJDT0xPUl9BUlJBWVwiO1xuZXhwb3J0IGNvbnN0IENPTE9SX0RJU1RBTkNFX0FMR09SSVRITSA9IHtcbiAgdHlwZTogRU5VTSxcbiAgb3B0aW9ucz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tBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQSIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///3\n')},function(module,exports,__webpack_require__){eval("\nvar content = __webpack_require__(59);\n\nif(typeof content === 'string') content = [[module.i, content, '']];\n\nvar transform;\nvar insertInto;\n\n\n\nvar options = {\"hmr\":true}\n\noptions.transform = transform\noptions.insertInto = undefined;\n\nvar update = __webpack_require__(24)(content, options);\n\nif(content.locals) module.exports = content.locals;\n\nif(false) {}//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNC5qcyIsInNvdXJjZXMiOlsid2VicGFjazovLy8uL2NvbXBvbmVudHMvY29udHJvbHMvc3R5bGVzLnNjc3M/MjlhMiJdLCJzb3VyY2VzQ29udGVudCI6WyJcbnZhciBjb250ZW50ID0gcmVxdWlyZShcIiEhLi4vLi4vLi4vbm9kZV9tb2R1bGVzL2Nzcy1sb2FkZXIvaW5kZXguanM/P3JlZi0tNC0xIS4uLy4uLy4uL25vZGVfbW9kdWxlcy9wb3N0Y3NzLWxvYWRlci9saWIvaW5kZXguanM/P3JlZi0tNC0yIS4vc3R5bGVzLnNjc3NcIik7XG5cbmlmKHR5cGVvZiBjb250ZW50ID09PSAnc3RyaW5nJykgY29udGVudCA9IFtbbW9kdWxlLmlkLCBjb250ZW50LCAnJ11dO1xuXG52YXIgdHJhbnNmb3JtO1xudmFyIGluc2VydEludG87XG5cblxuXG52YXIgb3B0aW9ucyA9IHtcImhtclwiOnRydWV9XG5cbm9wdGlvbnMudHJhbnNmb3JtID0gdHJhbn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V5IGluIGIpIGlkeC0tO1xuXG5cdFx0XHRyZXR1cm4gaWR4ID09PSAwO1xuXHRcdH0oY29udGVudC5sb2NhbHMsIG5ld0NvbnRlbnQubG9jYWxzKSk7XG5cblx0XHRpZighbG9jYWxzKSB0aHJvdyBuZXcgRXJyb3IoJ0Fib3J0aW5nIENTUyBITVIgZHVlIHRvIGNoYW5nZWQgY3NzLW1vZHVsZXMgbG9jYWxzLicpO1xuXG5cdFx0dXBkYXRlKG5ld0NvbnRlbnQpO1xuXHR9KTtcblxuXHRtb2R1bGUuaG90LmRpc3Bvc2UoZnVuY3Rpb24oKSB7IHVwZGF0ZSgpOyB9KTtcbn0iXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0EiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///4\n")},function(module,exports,__webpack_require__){"use strict";eval("/**\n * Copyright 2014-2015, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n\n\n/**\n * Similar to invariant but only logs a warning if the condition is not met.\n * This can be used to log issues in development environments in critical\n * paths. Removing the logging code for production environments will keep the\n * same logic and follow the same code paths.\n */\n\nvar warning = function() {};\n\nif (false) {}\n\nmodule.exports = warning;\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNS5qcyIsInNvdXJjZXMiOlsid2VicGFjazovLy8uLi9ub2RlX21vZHVsZXMvd2FybmluZy9icm93c2VyLmpzPzNhMGQiXSwic291cmNlc0NvbnRlbnQiOlsiLyoqXG4gKiBDb3B5cmlnaHQgMjAxNC0yMDE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IGEgY29udmVuaWVuY2Ugc28gdGhhdCB5b3UgY2FuIHVzZSB0aGlzIHN0YWNrXG4gICAgICAgIC8vIHRvIGZpbmQgdGhlIGNhbGxzaXRlIHRoYXQgY2F1c2VkIHRoaXMgd2FybmluZyB0byBmaXJlLlxuICAgICAgICB0aHJvdyBuZXcgRXJyb3IobWVzc2FnZSk7XG4gICAgICB9IGNhdGNoKHgpIHt9XG4gICAgfVxuICB9O1xufVxuXG5tb2R1bGUuZXhwb3J0cyA9IHdhcm5pbmc7XG4iXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQSxhQXFDQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///5\n")},function(module,__webpack_exports__,__webpack_require__){"use strict";eval('\n// EXTERNAL MODULE: ./constants/controlTypes.js\nvar controlTypes = __webpack_require__(3);\n\n// CONCATENATED MODULE: ./palettes/nearest.js\n\nconst optionTypes = {\n levels: {\n type: controlTypes["f" /* RANGE */],\n range: [1, 256],\n default: 2\n }\n};\nconst defaults = {\n levels: optionTypes.levels.default\n}; // Gets nearest color\n\nconst getColor = (color, options = defaults) => {\n if (options.levels >= 256) {\n return color;\n }\n\n const step = 255 / (options.levels - 1); // $FlowFixMe\n\n return color.map(c => {\n const bucket = Math.round(c / step);\n return Math.round(bucket * step);\n });\n};\n\n/* harmony default export */ var nearest = ({\n name: "nearest",\n getColor,\n options: defaults,\n optionTypes,\n defaults\n});\n// EXTERNAL MODULE: ./palettes/user.js\nvar user = __webpack_require__(9);\n\n// CONCATENATED MODULE: ./palettes/index.js\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return paletteList; });\n/* concated harmony reexport nearest */__webpack_require__.d(__webpack_exports__, "a", function() { return nearest; });\n/* concated harmony reexport user */__webpack_require__.d(__webpack_exports__, "c", function() { return user["b" /* default */]; });\n\n\n\n\nconst paletteList = [{\n name: "Nearest",\n palette: nearest\n}, {\n name: "User/Adaptive",\n palette: user["b" /* default */]\n}];//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNi5qcyIsInNvdXJjZXMiOlsid2VicGFjazovLy8uL3BhbGV0dGVzL25lYXJlc3QuanM/ZWYxYiIsIndlYnBhY2s6Ly8vLi9wYWxldHRlcy9pbmRleC5qcz9kOGI5Il0sInNvdXJjZXNDb250ZW50IjpbImltcG9ydCB7IFJBTkdFIH0gZnJvbSBcImNvbnN0YW50cy9jb250cm9sVHlwZXNcIjtcbmNvbnN0IG9wdGlvblR5cGVzID0ge1xuICBsZXZlbHM6IHtcbiAgICB0eXBlOiBSQU5HRSxcbiAgICByYW5nZTogWzEsIDI1Nl0sXG4gICAgZGVmYXVsdDogMlxuICB9XG59O1xuY29uc3QgZGVmYXVsdHMgPSB7XG4gIGxldmVsczogb3B0aW9uVHlwZXMubGV2ZWxzLmRlZmF1bHRcbn07IC8vIEdldHMgbmVhcmVzdCBjb2xvclxuXG5jb25zdCBnZXRDb2xvciA9IChjb2xvciwgb3B0aW9ucyA9IGRlZmF1bHRzKSA9PiB7XG4gIGlmIChvcHRpb25zLmxldmVscyA+PSAyNTYpIHtcbiAgICByZXR1cm4gY29sb3I7XG4gIH1cblxuICBjb25zdCBzdGVwID0gMjU1IC8gKG9wdGlvbnMubGV2ZWxzIC0gMSk7IC8vICRGbG93Rml4TWVcblxuICByZXR1cm4gY29sb3IubWFwKGMgPT4ge1xuICAgIGNvbnN0IGJ1Y2tldCA9IE1hdGgucm91bmQoYyAvIHN0ZXApO1xuICAgIHJldHVybiBNYXRoLnJvdW5kKGJ1Y2tldCAqIHN0ZXApO1xuICB9KTtcbn07XG5cbmV4cG9ydCBkZWZhdWx0IHtcbiAgbmFtZTogXCJuZWFyZXN0XCIsXG4gIGdldENvbG9yLFxuICBvcHRpb25zOiBkZWZhdWx0cyxcbiAgb3B0aW9uVHlwZXMsXG4gIGRlZmF1bHRzXG59OyIsImltcG9ydCBuZWFyZXN0IGZyb20gXCIuL25lYXJlc3RcIjtcbmltcG9ydCB1c2VyIGZyb20gXCIuL3VzZXJcIjtcbmV4cG9ydCB7IGRlZmF1bHQgYXMgbmVhcmVzdCB9IGZyb20gXCIuL25lYXJlc3RcIjtcbmV4cG9ydCB7IGRlZmF1bHQgYXMgdXNlciB9IGZyb20gXCIuL3VzZXJcIjtcbmV4cG9ydCBjb25zdCBwYWxldHRlTGlzdCA9IFt7XG4gIG5hbWU6IFwiTmVhcmVzdFwiLFxuICBwYWxldHRlOiBuZWFyZXN0XG59LCB7XG4gIG5hbWU6IFwiVXNlci9BZGFwdGl2ZVwiLFxuICBwYWxldHRlOiB1c2VyXG59XTsiXSwibWFwcGluZ3MiOiI7Ozs7O0FBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTs7Ozs7QUMvQkE7QUFBQTtBQUFBO0FBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQSIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///6\n')},function(module,exports,__webpack_require__){"use strict";eval("/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n\n\n/**\n * Use invariant() to assert state which your program assumes to be true.\n *\n * Provide sprintf-style format (only %s is supported) and arguments\n * to provide information about what broke and what you were\n * expecting.\n *\n * The invariant message will be stripped in production, but the invariant\n * will remain to ensure logic does not differ in production.\n */\n\nvar invariant = function(condition, format, a, b, c, d, e, f) {\n if (false) {}\n\n if (!condition) {\n var error;\n if (format === undefined) {\n error = new Error(\n 'Minified exception occurred; use the non-minified dev environment ' +\n 'for the full error message and additional helpful warnings.'\n );\n } else {\n var args = [a, b, c, d, e, f];\n var argIndex = 0;\n error = new Error(\n format.replace(/%s/g, function() { return args[argIndex++]; })\n );\n error.name = 'Invariant Violation';\n }\n\n error.framesToPop = 1; // we don't care about invariant's own frame\n throw error;\n }\n};\n\nmodule.exports = invariant;\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNy5qcyIsInNvdXJjZXMiOlsid2VicGFjazovLy8uLi9ub2RlX21vZHVsZXMvaW52YXJpYW50L2Jyb3dzZXIuanM/ZjhiYiJdLCJzb3VyY2VzQ29udGVudCI6WyIvKipcbiAqIENvcHlyaWdodCAoYykgMjAxMy1wcmVzZW50LCBGYWNlYm9vaywgSW5jLlxuICpcbiAqIFRoaXMgc291cmNlIGNvZGUgaXMgbGljZW5zZWQgdW5kZXIgdGhlIE1JVCBsaWNlbnNlIGZvdW5kIGluIHRoZVxuICogTElDRU5TRSBmaWxlIGluIHRoZSByb290IGRpcmVjdG9yeSBvZiB0aGlzIHNvdXJjZSB0cmVlLlxuICovXG5cbid1c2Ugc3RyaWN0JztcblxuLyoqXG4gKiBVc2UgaW52YXJpYW50KCkgdG8gYXNzZXJ0IHN0YXRlIHdoaWNoIHlvdXIgcHJvZ3JhbSBhc3N1bWVzIHRvIGJlIHRydWUuXG4gKlxuICogUHJvdmlkZSBzcHJpbnRmLXN0eWxlIGZvcm1hdCAob25seSAlcyBpcyBzdXBwb3J0ZWQpIGFuZCBhcmd1bWVudHNcbiAqIHRvIHByb3ZpZGUgaW5mb3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ybWF0LnJlcGxhY2UoLyVzL2csIGZ1bmN0aW9uKCkgeyByZXR1cm4gYXJnc1thcmdJbmRleCsrXTsgfSlcbiAgICAgICk7XG4gICAgICBlcnJvci5uYW1lID0gJ0ludmFyaWFudCBWaW9sYXRpb24nO1xuICAgIH1cblxuICAgIGVycm9yLmZyYW1lc1RvUG9wID0gMTsgLy8gd2UgZG9uJ3QgY2FyZSBhYm91dCBpbnZhcmlhbnQncyBvd24gZnJhbWVcbiAgICB0aHJvdyBlcnJvcjtcbiAgfVxufTtcblxubW9kdWxlLmV4cG9ydHMgPSBpbnZhcmlhbnQ7XG4iXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBLGVBSUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///7\n")},function(module,exports,__webpack_require__){eval("\nvar content = __webpack_require__(61);\n\nif(typeof content === 'string') content = [[module.i, content, '']];\n\nvar transform;\nvar insertInto;\n\n\n\nvar options = {\"hmr\":true}\n\noptions.transform = transform\noptions.insertInto = undefined;\n\nvar update = __webpack_require__(24)(content, options);\n\nif(content.locals) module.exports = content.locals;\n\nif(false) {}//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiOC5qcyIsInNvdXJjZXMiOlsid2VicGFjazovLy8uL2NvbXBvbmVudHMvQXBwL3N0eWxlcy5z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eval('/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return THEMES; });\n/* unused harmony export createPalette */\n/* harmony import */ var constants_controlTypes__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(3);\n/* harmony import */ var utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(0);\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; var ownKeys = Object.keys(source); if (typeof Object.getOwnPropertySymbols === \'function\') { ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; })); } ownKeys.forEach(function (key) { _defineProperty(target, key, source[key]); }); } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\n\n\n// https://en.wikipedia.org/wiki/List_of_8-bit_computer_hardware_palettes\n// https://en.wikipedia.org/wiki/Color_Graphics_Adapter\nconst cga = {\n BLACK: Object(utils__WEBPACK_IMPORTED_MODULE_1__[/* rgba */ "m"])(0, 0, 0, 255),\n // 0 black\n BLUE: Object(utils__WEBPACK_IMPORTED_MODULE_1__[/* rgba */ "m"])(0, 0, 170, 255),\n // 1 blue\n GREEN: Object(utils__WEBPACK_IMPORTED_MODULE_1__[/* rgba */ "m"])(0, 170, 0, 255),\n // 2 green\n CYAN: Object(utils__WEBPACK_IMPORTED_MODULE_1__[/* rgba */ "m"])(0, 170, 170, 255),\n // 3 cyan\n RED: Object(utils__WEBPACK_IMPORTED_MODULE_1__[/* rgba */ "m"])(170, 0, 0, 255),\n // 4 red\n MAGENTA: Object(utils__WEBPACK_IMPORTED_MODULE_1__[/* rgba */ "m"])(170, 0, 170, 255),\n // 5 magenta\n YELLOW: Object(utils__WEBPACK_IMPORTED_MODULE_1__[/* rgba */ "m"])(170, 170, 0, 255),\n // 6 yellow\n WHITE: Object(utils__WEBPACK_IMPORTED_MODULE_1__[/* rgba */ "m"])(170, 170, 170, 255),\n // 7 white\n BBLACK: Object(utils__WEBPACK_IMPORTED_MODULE_1__[/* rgba */ "m"])(85, 85, 85, 255),\n // 8 bright black\n BBLUE: Object(utils__WEBPACK_IMPORTED_MODULE_1__[/* rgba */ "m"])(85, 85, 255, 255),\n // 9 bright blue\n BGREEN: Object(utils__WEBPACK_IMPORTED_MODULE_1__[/* rgba */ "m"])(85, 255, 85, 255),\n // 10 bright green\n BCYAN: Object(utils__WEBPACK_IMPORTED_MODULE_1__[/* rgba */ "m"])(85, 255, 255, 255),\n // 11 bright cyan\n BRED: Object(utils__WEBPACK_IMPORTED_MODULE_1__[/* rgba */ "m"])(255, 85, 85, 255),\n // 12 bright red\n BMAGENTA: Object(utils__WEBPACK_IMPORTED_MODULE_1__[/* rgba */ "m"])(255, 85, 255, 255),\n // 13 bright magenta\n BYELLOW: Object(utils__WEBPACK_IMPORTED_MODULE_1__[/* rgba */ "m"])(255, 255, 85, 255),\n // 14 bright yellow\n BWHITE: Object(utils__WEBPACK_IMPORTED_MODULE_1__[/* rgba */ "m"])(255, 255, 255, 255) // 15 bright white\n\n};\nconst THEMES = {\n CMYK: [Object(utils__WEBPACK_IMPORTED_MODULE_1__[/* rgba */ "m"])(0, 255, 255, 255), // cyan\n Object(utils__WEBPACK_IMPORTED_MODULE_1__[/* rgba */ "m"])(255, 0, 255, 255), // magenta\n Object(utils__WEBPACK_IMPORTED_MODULE_1__[/* rgba */ "m"])(255, 255, 0, 255), // yellow\n Object(utils__WEBPACK_IMPORTED_MODULE_1__[/* rgba */ "m"])(0, 0, 0, 255), // black\n Object(utils__WEBPACK_IMPORTED_MODULE_1__[/* rgba */ "m"])(255, 255, 255, 255)],\n EGA_MODE4_PALETTE1_LOW: [cga.BLACK, cga.WHITE, cga.MAGENTA, cga.CYAN],\n EGA_MODE4_PALETTE1_HIGH: [cga.BLACK, cga.WHITE, cga.BMAGENTA, cga.BCYAN],\n EGA_MODE4_PALETTE2_LOW: [cga.BLACK, cga.GREEN, cga.RED, cga.YELLOW],\n EGA_MODE4_PALETTE2_HIGH: [cga.BLACK, cga.BGREEN, cga.BRED, cga.BYELLOW],\n EGA_MODE5_PALETTE3_LOW: [cga.BLACK, cga.CYAN, cga.RED, cga.BBLACK],\n EGA_MODE5_PALETTE3_HIGH: [cga.BLACK, cga.BCYAN, cga.BRED, cga.BWHITE],\n CGA: [cga.BLACK, cga.BLUE, cga.GREEN, cga.CYAN, cga.RED, cga.MAGENTA, cga.YELLOW, cga.WHITE, cga.BBLACK, cga.BBLUE, cga.BGREEN, cga.BCYAN, cga.BRED, cga.BMAGENTA, cga.BYELLOW, cga.BWHITE],\n // https://upload.wikimedia.org/wikipedia/commons/1/14/CGA-NTSC-colors.png\n CGA_NTSC: [Object(utils__WEBPACK_IMPORTED_MODULE_1__[/* rgba */ "m"])(0, 0, 0, 255), // black\n Object(utils__WEBPACK_IMPORTED_MODULE_1__[/* rgba */ "m"])(0, 14, 163, 255), // blue\n Object(utils__WEBPACK_IMPORTED_MODULE_1__[/* rgba */ "m"])(0, 119, 23, 255), // green\n Object(utils__WEBPACK_IMPORTED_MODULE_1__[/* rgba */ "m"])(0, 156, 118, 255), // cyan\n Object(utils__WEBPACK_IMPORTED_MODULE_1__[/* rgba */ "m"])(111, 7, 31, 255), // red\n Object(utils__WEBPACK_IMPORTED_MODULE_1__[/* rgba */ "m"])(130, 34, 168, 255), // magenta\n Object(utils__WEBPACK_IMPORTED_MODULE_1__[/* rgba */ "m"])(117, 143, 26, 255), // yellow\n Object(utils__WEBPACK_IMPORTED_MODULE_1__[/* rgba */ "m"])(162, 162, 162, 255), // white\n Object(utils__WEBPACK_IMPORTED_MODULE_1__[/* rgba */ "m"])(73, 73, 73, 255), // bblack\n Object(utils__WEBPACK_IMPORTED_MODULE_1__[/* rgba */ "m"])(109, 92, 253, 255), // bblue\n Object(utils__WEBPACK_IMPORTED_MODULE_1__[/* rgba */ "m"])(94, 210, 75, 255), // bgreen\n Object(utils__WEBPACK_IMPORTED_MODULE_1__[/* rgba */ "m"])(105, 250, 209, 255), // bcyan\n Object(utils__WEBPACK_IMPORTED_MODULE_1__[/* rgba */ "m"])(204, 80, 116, 255), // bred\n Object(utils__WEBPACK_IMPORTED_MODULE_1__[/* rgba */ "m"])(224, 117, 254, 255), // bmagenta\n Object(utils__WEBPACK_IMPORTED_MODULE_1__[/* rgba */ "m"])(210, 237, 79, 255), // byellow\n Object(utils__WEBPACK_IMPORTED_MODULE_1__[/* rgba */ "m"])(255, 255, 255, 255) // bwhite\n ],\n // https://en.wikipedia.org/wiki/List_of_software_palettes#Microsoft_Windows_default_20-color_palette\n CGA_MICROSOFT_256: [cga.BLACK, cga.BLUE, cga.GREEN, cga.CYAN, cga.RED, cga.MAGENTA, cga.YELLOW, cga.WHITE, cga.BBLACK, cga.BBLUE, cga.BGREEN, cga.BCYAN, cga.BRED, cga.BMAGENTA, cga.BYELLOW, cga.BWHITE, Object(utils__WEBPACK_IMPORTED_MODULE_1__[/* rgba */ "m"])(188, 219, 192, 255), Object(utils__WEBPACK_IMPORTED_MODULE_1__[/* rgba */ "m"])(157, 201, 238, 255), Object(utils__WEBPACK_IMPORTED_MODULE_1__[/* rgba */ "m"])(255, 251, 240, 255), Object(utils__WEBPACK_IMPORTED_MODULE_1__[/* rgba */ "m"])(158, 159, 162, 255)],\n // https://en.wikipedia.org/wiki/File:Commodore64_palette.png\n C64: [Object(utils__WEBPACK_IMPORTED_MODULE_1__[/* rgba */ "m"])(0, 0, 0, 255), Object(utils__WEBPACK_IMPORTED_MODULE_1__[/* rgba */ "m"])(255, 255, 255, 255), Object(utils__WEBPACK_IMPORTED_MODULE_1__[/* rgba */ "m"])(166, 77, 69, 255), Object(utils__WEBPACK_IMPORTED_MODULE_1__[/* rgba */ "m"])(88, 192, 199, 255), Object(utils__WEBPACK_IMPORTED_MODULE_1__[/* rgba */ "m"])(164, 88, 161, 255), Object(utils__WEBPACK_IMPORTED_MODULE_1__[/* rgba */ "m"])(82, 171, 100, 255), Object(utils__WEBPACK_IMPORTED_MODULE_1__[/* rgba */ "m"])(77, 71, 152, 255), Object(utils__WEBPACK_IMPORTED_MODULE_1__[/* rgba */ "m"])(203, 212, 141, 255), Object(utils__WEBPACK_IMPORTED_MODULE_1__[/* rgba */ "m"])(168, 104, 64, 255), Object(utils__WEBPACK_IMPORTED_MODULE_1__[/* rgba */ "m"])(113, 84, 28, 255), Object(utils__WEBPACK_IMPORTED_MODULE_1__[/* rgba */ "m"])(210, 125, 119, 255), Object(utils__WEBPACK_IMPORTED_MODULE_1__[/* rgba */ "m"])(99, 99, 99, 255), Object(utils__WEBPACK_IMPORTED_MODULE_1__[/* rgba */ "m"])(138, 138, 138, 255), Object(utils__WEBPACK_IMPORTED_MODULE_1__[/* rgba */ "m"])(144, 226, 157, 255), Object(utils__WEBPACK_IMPORTED_MODULE_1__[/* rgba */ "m"])(134, 126, 202, 255), Object(utils__WEBPACK_IMPORTED_MODULE_1__[/* rgba */ "m"])(174, 173, 174, 255)],\n C64_NTSC: [Object(utils__WEBPACK_IMPORTED_MODULE_1__[/* rgba */ "m"])(0, 0, 0, 255), Object(utils__WEBPACK_IMPORTED_MODULE_1__[/* rgba */ "m"])(255, 255, 255, 255), Object(utils__WEBPACK_IMPORTED_MODULE_1__[/* rgba */ "m"])(255, 52, 24, 255), Object(utils__WEBPACK_IMPORTED_MODULE_1__[/* rgba */ "m"])(0, 222, 253, 255), Object(utils__WEBPACK_IMPORTED_MODULE_1__[/* rgba */ "m"])(170, 78, 199, 255), Object(utils__WEBPACK_IMPORTED_MODULE_1__[/* rgba */ "m"])(95, 185, 89, 255), Object(utils__WEBPACK_IMPORTED_MODULE_1__[/* rgba */ "m"])(0, 77, 204, 255), Object(utils__WEBPACK_IMPORTED_MODULE_1__[/* rgba */ "m"])(255, 236, 84, 255), Object(utils__WEBPACK_IMPORTED_MODULE_1__[/* rgba */ "m"])(255, 90, 30, 255), Object(utils__WEBPACK_IMPORTED_MODULE_1__[/* rgba */ "m"])(201, 65, 22, 255), Object(utils__WEBPACK_IMPORTED_MODULE_1__[/* rgba */ "m"])(255, 113, 77, 255), Object(utils__WEBPACK_IMPORTED_MODULE_1__[/* rgba */ "m"])(96, 96, 96, 255), Object(utils__WEBPACK_IMPORTED_MODULE_1__[/* rgba */ "m"])(135, 152, 109, 255), Object(utils__WEBPACK_IMPORTED_MODULE_1__[/* rgba */ "m"])(170, 255, 157, 255), Object(utils__WEBPACK_IMPORTED_MODULE_1__[/* rgba */ "m"])(35, 136, 250, 255), Object(utils__WEBPACK_IMPORTED_MODULE_1__[/* rgba */ "m"])(195, 184, 213, 255)],\n // https://en.wikipedia.org/wiki/File:BbcMicro_palette_color_test_chart.png\n TELETEXT_BBC_MICRO: [Object(utils__WEBPACK_IMPORTED_MODULE_1__[/* rgba */ "m"])(0, 0, 0, 255), Object(utils__WEBPACK_IMPORTED_MODULE_1__[/* rgba */ "m"])(255, 15, 22, 255), Object(utils__WEBPACK_IMPORTED_MODULE_1__[/* rgba */ "m"])(0, 254, 62, 255), Object(utils__WEBPACK_IMPORTED_MODULE_1__[/* rgba */ "m"])(0, 30, 250, 255), Object(utils__WEBPACK_IMPORTED_MODULE_1__[/* rgba */ "m"])(0, 255, 254, 255), Object(utils__WEBPACK_IMPORTED_MODULE_1__[/* rgba */ "m"])(255, 27, 249, 255), Object(utils__WEBPACK_IMPORTED_MODULE_1__[/* rgba */ "m"])(255, 254, 64, 255), Object(utils__WEBPACK_IMPORTED_MODULE_1__[/* rgba */ "m"])(255, 255, 255, 255)],\n MAC2: [Object(utils__WEBPACK_IMPORTED_MODULE_1__[/* rgba */ "m"])(255, 255, 255, 255), // white\n Object(utils__WEBPACK_IMPORTED_MODULE_1__[/* rgba */ "m"])(255, 255, 0, 255), // yellow\n Object(utils__WEBPACK_IMPORTED_MODULE_1__[/* rgba */ "m"])(255, 102, 0, 255), // orange\n Object(utils__WEBPACK_IMPORTED_MODULE_1__[/* rgba */ "m"])(221, 0, 0, 255), // red\n Object(utils__WEBPACK_IMPORTED_MODULE_1__[/* rgba */ "m"])(255, 0, 153, 255), // magenta\n Object(utils__WEBPACK_IMPORTED_MODULE_1__[/* rgba */ "m"])(51, 0, 153, 255), // purple\n Object(utils__WEBPACK_IMPORTED_MODULE_1__[/* rgba */ "m"])(0, 0, 204, 255), // blue\n Object(utils__WEBPACK_IMPORTED_MODULE_1__[/* rgba */ "m"])(0, 153, 255, 255), // cyan\n Object(utils__WEBPACK_IMPORTED_MODULE_1__[/* rgba */ "m"])(0, 170, 0, 255), // green\n Object(utils__WEBPACK_IMPORTED_MODULE_1__[/* rgba */ "m"])(0, 102, 0, 255), // dark green\n Object(utils__WEBPACK_IMPORTED_MODULE_1__[/* rgba */ "m"])(102, 51, 0, 255), // brown\n Object(utils__WEBPACK_IMPORTED_MODULE_1__[/* rgba */ "m"])(153, 102, 51, 255), // tan\n Object(utils__WEBPACK_IMPORTED_MODULE_1__[/* rgba */ "m"])(187, 187, 187, 255), // light grey\n Object(utils__WEBPACK_IMPORTED_MODULE_1__[/* rgba */ "m"])(136, 136, 136, 255), // medium grey\n Object(utils__WEBPACK_IMPORTED_MODULE_1__[/* rgba */ "m"])(68, 68, 68, 255), // dark grey\n Object(utils__WEBPACK_IMPORTED_MODULE_1__[/* rgba */ "m"])(0, 0, 0, 255) // black\n ],\n // https://en.wikipedia.org/wiki/File:AppleII_palette.png\n APPLE2: [Object(utils__WEBPACK_IMPORTED_MODULE_1__[/* rgba */ "m"])(0, 0, 0, 255), Object(utils__WEBPACK_IMPORTED_MODULE_1__[/* rgba */ "m"])(137, 61, 81, 255), Object(utils__WEBPACK_IMPORTED_MODULE_1__[/* rgba */ "m"])(78, 74, 134, 255), Object(utils__WEBPACK_IMPORTED_MODULE_1__[/* rgba */ "m"])(239, 96, 235, 255), Object(utils__WEBPACK_IMPORTED_MODULE_1__[/* rgba */ "m"])(0, 104, 84, 255), Object(utils__WEBPACK_IMPORTED_MODULE_1__[/* rgba */ "m"])(145, 145, 145, 255), Object(utils__WEBPACK_IMPORTED_MODULE_1__[/* rgba */ "m"])(0, 167, 237, 255), Object(utils__WEBPACK_IMPORTED_MODULE_1__[/* rgba */ "m"])(199, 194, 246, 255), Object(utils__WEBPACK_IMPORTED_MODULE_1__[/* rgba */ "m"])(82, 92, 31, 255), Object(utils__WEBPACK_IMPORTED_MODULE_1__[/* rgba */ "m"])(244, 125, 51, 255), Object(utils__WEBPACK_IMPORTED_MODULE_1__[/* rgba */ "m"])(145, 145, 145, 255), Object(utils__WEBPACK_IMPORTED_MODULE_1__[/* rgba */ "m"])(251, 184, 200, 255), Object(utils__WEBPACK_IMPORTED_MODULE_1__[/* rgba */ "m"])(0, 199, 63, 255), Object(utils__WEBPACK_IMPORTED_MODULE_1__[/* rgba */ "m"])(203, 209, 157, 255), Object(utils__WEBPACK_IMPORTED_MODULE_1__[/* rgba */ "m"])(144, 219, 202, 255), Object(utils__WEBPACK_IMPORTED_MODULE_1__[/* rgba */ "m"])(255, 255, 255, 255)],\n // https://en.wikipedia.org/wiki/File:MSX_palette.png\n MSX: [Object(utils__WEBPACK_IMPORTED_MODULE_1__[/* rgba */ "m"])(0, 0, 0, 0), Object(utils__WEBPACK_IMPORTED_MODULE_1__[/* rgba */ "m"])(0, 0, 0, 255), Object(utils__WEBPACK_IMPORTED_MODULE_1__[/* rgba */ "m"])(35, 182, 83, 255), Object(utils__WEBPACK_IMPORTED_MODULE_1__[/* rgba */ "m"])(103, 206, 129, 255), Object(utils__WEBPACK_IMPORTED_MODULE_1__[/* rgba */ "m"])(79, 88, 218, 255), Object(utils__WEBPACK_IMPORTED_MODULE_1__[/* rgba */ "m"])(121, 119, 236, 255), Object(utils__WEBPACK_IMPORTED_MODULE_1__[/* rgba */ "m"])(191, 94, 83, 255), Object(utils__WEBPACK_IMPORTED_MODULE_1__[/* rgba */ "m"])(68, 218, 237, 255), Object(utils__WEBPACK_IMPORTED_MODULE_1__[/* rgba */ "m"])(227, 100, 91, 255), Object(utils__WEBPACK_IMPORTED_MODULE_1__[/* rgba */ "m"])(255, 135, 125, 255), Object(utils__WEBPACK_IMPORTED_MODULE_1__[/* rgba */ "m"])(206, 193, 102, 255), Object(utils__WEBPACK_IMPORTED_MODULE_1__[/* rgba */ "m"])(224, 207, 138, 255), Object(utils__WEBPACK_IMPORTED_MODULE_1__[/* rgba */ "m"])(41, 160, 74, 255), Object(utils__WEBPACK_IMPORTED_MODULE_1__[/* rgba */ "m"])(186, 102, 177, 255), Object(utils__WEBPACK_IMPORTED_MODULE_1__[/* rgba */ "m"])(203, 203, 203, 255), Object(utils__WEBPACK_IMPORTED_MODULE_1__[/* rgba */ "m"])(255, 255, 255, 255)],\n MSX2_MODE6: [Object(utils__WEBPACK_IMPORTED_MODULE_1__[/* rgba */ "m"])(0, 0, 0, 255), Object(utils__WEBPACK_IMPORTED_MODULE_1__[/* rgba */ "m"])(255, 38, 23, 255), Object(utils__WEBPACK_IMPORTED_MODULE_1__[/* rgba */ "m"])(110, 108, 75, 255), Object(utils__WEBPACK_IMPORTED_MODULE_1__[/* rgba */ "m"])(255, 216, 149, 255)],\n EARTHBOUND_1: [Object(utils__WEBPACK_IMPORTED_MODULE_1__[/* rgba */ "m"])(6, 6, 6, 255), Object(utils__WEBPACK_IMPORTED_MODULE_1__[/* rgba */ "m"])(239, 239, 239, 255), Object(utils__WEBPACK_IMPORTED_MODULE_1__[/* rgba */ "m"])(207, 207, 207, 255), Object(utils__WEBPACK_IMPORTED_MODULE_1__[/* rgba */ "m"])(142, 158, 129, 255), Object(utils__WEBPACK_IMPORTED_MODULE_1__[/* rgba */ "m"])(0, 174, 129, 255), Object(utils__WEBPACK_IMPORTED_MODULE_1__[/* rgba */ "m"])(0, 142, 112, 255), Object(utils__WEBPACK_IMPORTED_MODULE_1__[/* rgba */ "m"])(93, 127, 105, 255), Object(utils__WEBPACK_IMPORTED_MODULE_1__[/* rgba */ "m"])(193, 174, 130, 255), Object(utils__WEBPACK_IMPORTED_MODULE_1__[/* rgba */ "m"])(195, 158, 108, 255), Object(utils__WEBPACK_IMPORTED_MODULE_1__[/* rgba */ "m"])(154, 119, 91, 255), Object(utils__WEBPACK_IMPORTED_MODULE_1__[/* rgba */ "m"])(252, 16, 95, 255), Object(utils__WEBPACK_IMPORTED_MODULE_1__[/* rgba */ "m"])(150, 9, 51, 255), Object(utils__WEBPACK_IMPORTED_MODULE_1__[/* rgba */ "m"])(228, 206, 62, 255), Object(utils__WEBPACK_IMPORTED_MODULE_1__[/* rgba */ "m"])(232, 150, 48, 255), Object(utils__WEBPACK_IMPORTED_MODULE_1__[/* rgba */ "m"])(71, 83, 195, 255), Object(utils__WEBPACK_IMPORTED_MODULE_1__[/* rgba */ "m"])(53, 37, 37, 255)],\n SEPIA: [Object(utils__WEBPACK_IMPORTED_MODULE_1__[/* rgba */ "m"])(8, 8, 0, 255), Object(utils__WEBPACK_IMPORTED_MODULE_1__[/* rgba */ "m"])(39, 34, 24, 255), Object(utils__WEBPACK_IMPORTED_MODULE_1__[/* rgba */ "m"])(70, 63, 48, 255), Object(utils__WEBPACK_IMPORTED_MODULE_1__[/* rgba */ "m"])(101, 93, 72, 255), Object(utils__WEBPACK_IMPORTED_MODULE_1__[/* rgba */ "m"])(132, 122, 96, 255), Object(utils__WEBPACK_IMPORTED_MODULE_1__[/* rgba */ "m"])(163, 152, 120, 255), Object(utils__WEBPACK_IMPORTED_MODULE_1__[/* rgba */ "m"])(194, 182, 145, 255), Object(utils__WEBPACK_IMPORTED_MODULE_1__[/* rgba */ "m"])(225, 211, 169, 255)],\n GAMEBOY: [Object(utils__WEBPACK_IMPORTED_MODULE_1__[/* rgba */ "m"])(155, 188, 15, 255), Object(utils__WEBPACK_IMPORTED_MODULE_1__[/* rgba */ "m"])(139, 172, 15, 255), Object(utils__WEBPACK_IMPORTED_MODULE_1__[/* rgba */ "m"])(48, 98, 48, 255), Object(utils__WEBPACK_IMPORTED_MODULE_1__[/* rgba */ "m"])(15, 56, 15, 255)],\n // https://steamcommunity.com/sharedfiles/filedetails/?id=572608400\n DOWNWELL_GAMEBOY: [Object(utils__WEBPACK_IMPORTED_MODULE_1__[/* rgba */ "m"])(50, 59, 41, 255), Object(utils__WEBPACK_IMPORTED_MODULE_1__[/* rgba */ "m"])(109, 127, 87, 255), Object(utils__WEBPACK_IMPORTED_MODULE_1__[/* rgba */ "m"])(98, 114, 79, 255), Object(utils__WEBPACK_IMPORTED_MODULE_1__[/* rgba */ "m"])(156, 173, 136, 255)],\n DOWNWELL: [Object(utils__WEBPACK_IMPORTED_MODULE_1__[/* rgba */ "m"])(249, 249, 249, 255), Object(utils__WEBPACK_IMPORTED_MODULE_1__[/* rgba */ "m"])(247, 0, 22, 255), Object(utils__WEBPACK_IMPORTED_MODULE_1__[/* rgba */ "m"])(21, 127, 246, 255), Object(utils__WEBPACK_IMPORTED_MODULE_1__[/* rgba */ "m"])(0, 0, 0, 255)],\n DOWNWELL_NIKAIDO: [Object(utils__WEBPACK_IMPORTED_MODULE_1__[/* rgba */ "m"])(254, 254, 254, 255), Object(utils__WEBPACK_IMPORTED_MODULE_1__[/* rgba */ "m"])(252, 146, 33, 255), Object(utils__WEBPACK_IMPORTED_MODULE_1__[/* rgba */ "m"])(21, 127, 252, 255), Object(utils__WEBPACK_IMPORTED_MODULE_1__[/* rgba */ "m"])(26, 26, 13, 255)],\n DOWNWELL_MAD: [Object(utils__WEBPACK_IMPORTED_MODULE_1__[/* rgba */ "m"])(34, 31, 58, 255), Object(utils__WEBPACK_IMPORTED_MODULE_1__[/* rgba */ "m"])(43, 224, 184, 255), Object(utils__WEBPACK_IMPORTED_MODULE_1__[/* rgba */ "m"])(240, 39, 232, 255), Object(utils__WEBPACK_IMPORTED_MODULE_1__[/* rgba */ "m"])(236, 153, 61, 255)],\n DOWNWELL_RGB: [Object(utils__WEBPACK_IMPORTED_MODULE_1__[/* rgba */ "m"])(91, 228, 126, 255), Object(utils__WEBPACK_IMPORTED_MODULE_1__[/* rgba */ "m"])(220, 0, 52, 255), Object(utils__WEBPACK_IMPORTED_MODULE_1__[/* rgba */ "m"])(2, 3, 109, 255), Object(utils__WEBPACK_IMPORTED_MODULE_1__[/* rgba */ "m"])(25, 45, 155, 255)],\n DOWNWELL_ZENNYAN: [Object(utils__WEBPACK_IMPORTED_MODULE_1__[/* rgba */ "m"])(254, 254, 254, 255), Object(utils__WEBPACK_IMPORTED_MODULE_1__[/* rgba */ "m"])(21, 127, 252, 255), Object(utils__WEBPACK_IMPORTED_MODULE_1__[/* rgba */ "m"])(232, 11, 195, 255), Object(utils__WEBPACK_IMPORTED_MODULE_1__[/* rgba */ "m"])(87, 182, 62, 255)],\n VA_11_HALL_A: [Object(utils__WEBPACK_IMPORTED_MODULE_1__[/* rgba */ "m"])(0, 0, 0, 255), Object(utils__WEBPACK_IMPORTED_MODULE_1__[/* rgba */ "m"])(2, 0, 24, 255), Object(utils__WEBPACK_IMPORTED_MODULE_1__[/* rgba */ "m"])(39, 8, 52, 255), Object(utils__WEBPACK_IMPORTED_MODULE_1__[/* rgba */ "m"])(63, 1, 71, 255), Object(utils__WEBPACK_IMPORTED_MODULE_1__[/* rgba */ "m"])(109, 7, 74, 255), Object(utils__WEBPACK_IMPORTED_MODULE_1__[/* rgba */ "m"])(160, 16, 73, 255), Object(utils__WEBPACK_IMPORTED_MODULE_1__[/* rgba */ "m"])(167, 96, 130, 255), Object(utils__WEBPACK_IMPORTED_MODULE_1__[/* rgba */ "m"])(187, 18, 75, 255), Object(utils__WEBPACK_IMPORTED_MODULE_1__[/* rgba */ "m"])(202, 93, 108, 255), Object(utils__WEBPACK_IMPORTED_MODULE_1__[/* rgba */ "m"])(206, 19, 76, 255), Object(utils__WEBPACK_IMPORTED_MODULE_1__[/* rgba */ "m"])(243, 169, 141, 255), Object(utils__WEBPACK_IMPORTED_MODULE_1__[/* rgba */ "m"])(250, 58, 80, 255), Object(utils__WEBPACK_IMPORTED_MODULE_1__[/* rgba */ "m"])(253, 21, 102, 255), Object(utils__WEBPACK_IMPORTED_MODULE_1__[/* rgba */ "m"])(254, 180, 182, 255), Object(utils__WEBPACK_IMPORTED_MODULE_1__[/* rgba */ "m"])(254, 238, 182, 255), Object(utils__WEBPACK_IMPORTED_MODULE_1__[/* rgba */ "m"])(255, 255, 255, 255)],\n PC98_PHOBOS: [Object(utils__WEBPACK_IMPORTED_MODULE_1__[/* rgba */ "m"])(0, 0, 0, 255), Object(utils__WEBPACK_IMPORTED_MODULE_1__[/* rgba */ "m"])(0, 102, 119, 255), Object(utils__WEBPACK_IMPORTED_MODULE_1__[/* rgba */ "m"])(68, 34, 153, 255), Object(utils__WEBPACK_IMPORTED_MODULE_1__[/* rgba */ "m"])(85, 102, 102, 255), Object(utils__WEBPACK_IMPORTED_MODULE_1__[/* rgba */ "m"])(102, 68, 187, 255), Object(utils__WEBPACK_IMPORTED_MODULE_1__[/* rgba */ "m"])(119, 136, 136, 255), Object(utils__WEBPACK_IMPORTED_MODULE_1__[/* rgba */ "m"])(153, 119, 238, 255), Object(utils__WEBPACK_IMPORTED_MODULE_1__[/* rgba */ "m"])(153, 153, 102, 255), Object(utils__WEBPACK_IMPORTED_MODULE_1__[/* rgba */ "m"])(153, 85, 102, 255), Object(utils__WEBPACK_IMPORTED_MODULE_1__[/* rgba */ "m"])(170, 187, 187, 255), Object(utils__WEBPACK_IMPORTED_MODULE_1__[/* rgba */ "m"])(187, 153, 153, 255), Object(utils__WEBPACK_IMPORTED_MODULE_1__[/* rgba */ "m"])(204, 204, 153, 255), Object(utils__WEBPACK_IMPORTED_MODULE_1__[/* rgba */ "m"])(221, 187, 187, 255), Object(utils__WEBPACK_IMPORTED_MODULE_1__[/* rgba */ "m"])(221, 34, 85, 255), Object(utils__WEBPACK_IMPORTED_MODULE_1__[/* rgba */ "m"])(255, 238, 221, 255), Object(utils__WEBPACK_IMPORTED_MODULE_1__[/* rgba */ "m"])(255, 255, 255, 255)],\n PC98_YUNO: [Object(utils__WEBPACK_IMPORTED_MODULE_1__[/* rgba */ "m"])(0, 0, 0, 255), Object(utils__WEBPACK_IMPORTED_MODULE_1__[/* rgba */ "m"])(16, 156, 140, 255), Object(utils__WEBPACK_IMPORTED_MODULE_1__[/* rgba */ "m"])(66, 33, 66, 255), Object(utils__WEBPACK_IMPORTED_MODULE_1__[/* rgba */ "m"])(82, 99, 99, 255), Object(utils__WEBPACK_IMPORTED_MODULE_1__[/* rgba */ "m"])(99, 99, 239, 255), Object(utils__WEBPACK_IMPORTED_MODULE_1__[/* rgba */ "m"])(140, 49, 49, 255), Object(utils__WEBPACK_IMPORTED_MODULE_1__[/* rgba */ "m"])(156, 173, 189, 255), Object(utils__WEBPACK_IMPORTED_MODULE_1__[/* rgba */ "m"])(189, 206, 255, 255), Object(utils__WEBPACK_IMPORTED_MODULE_1__[/* rgba */ "m"])(189, 49, 66, 255), Object(utils__WEBPACK_IMPORTED_MODULE_1__[/* rgba */ "m"])(222, 140, 115, 255), Object(utils__WEBPACK_IMPORTED_MODULE_1__[/* rgba */ "m"])(239, 49, 82, 255), Object(utils__WEBPACK_IMPORTED_MODULE_1__[/* rgba */ "m"])(255, 140, 156, 255), Object(utils__WEBPACK_IMPORTED_MODULE_1__[/* rgba */ "m"])(255, 173, 49, 255), Object(utils__WEBPACK_IMPORTED_MODULE_1__[/* rgba */ "m"])(255, 189, 173, 255), Object(utils__WEBPACK_IMPORTED_MODULE_1__[/* rgba */ "m"])(255, 222, 206, 255), Object(utils__WEBPACK_IMPORTED_MODULE_1__[/* rgba */ "m"])(255, 255, 255, 255)],\n PC98_POLICENAUTS: [Object(utils__WEBPACK_IMPORTED_MODULE_1__[/* rgba */ "m"])(1, 1, 1, 255), Object(utils__WEBPACK_IMPORTED_MODULE_1__[/* rgba */ "m"])(1, 84, 220, 255), Object(utils__WEBPACK_IMPORTED_MODULE_1__[/* rgba */ "m"])(35, 171, 35, 255), Object(utils__WEBPACK_IMPORTED_MODULE_1__[/* rgba */ "m"])(69, 69, 69, 255), Object(utils__WEBPACK_IMPORTED_MODULE_1__[/* rgba */ "m"])(84, 186, 205, 255), Object(utils__WEBPACK_IMPORTED_MODULE_1__[/* rgba */ "m"])(103, 35, 16, 255), Object(utils__WEBPACK_IMPORTED_MODULE_1__[/* rgba */ "m"])(137, 137, 137, 255), Object(utils__WEBPACK_IMPORTED_MODULE_1__[/* rgba */ "m"])(171, 69, 205, 255), Object(utils__WEBPACK_IMPORTED_MODULE_1__[/* rgba */ "m"])(171, 84, 69, 255), Object(utils__WEBPACK_IMPORTED_MODULE_1__[/* rgba */ "m"])(186, 35, 35, 255), Object(utils__WEBPACK_IMPORTED_MODULE_1__[/* rgba */ "m"])(205, 186, 50, 255), Object(utils__WEBPACK_IMPORTED_MODULE_1__[/* rgba */ "m"])(205, 205, 205, 255), Object(utils__WEBPACK_IMPORTED_MODULE_1__[/* rgba */ "m"])(205, 84, 1, 255), Object(utils__WEBPACK_IMPORTED_MODULE_1__[/* rgba */ "m"])(220, 152, 118, 255)],\n PC98_VIRGIN_ANGEL: [Object(utils__WEBPACK_IMPORTED_MODULE_1__[/* rgba */ "m"])(0, 0, 0, 255), Object(utils__WEBPACK_IMPORTED_MODULE_1__[/* rgba */ "m"])(0, 136, 51, 255), Object(utils__WEBPACK_IMPORTED_MODULE_1__[/* rgba */ "m"])(0, 68, 85, 255), Object(utils__WEBPACK_IMPORTED_MODULE_1__[/* rgba */ "m"])(85, 119, 136, 255), Object(utils__WEBPACK_IMPORTED_MODULE_1__[/* rgba */ "m"])(102, 102, 136, 255), Object(utils__WEBPACK_IMPORTED_MODULE_1__[/* rgba */ "m"])(102, 51, 51, 255), Object(utils__WEBPACK_IMPORTED_MODULE_1__[/* rgba */ "m"])(153, 102, 102, 255), Object(utils__WEBPACK_IMPORTED_MODULE_1__[/* rgba */ "m"])(153, 187, 204, 255), Object(utils__WEBPACK_IMPORTED_MODULE_1__[/* rgba */ "m"])(170, 153, 204, 255), Object(utils__WEBPACK_IMPORTED_MODULE_1__[/* rgba */ "m"])(187, 136, 136, 255), Object(utils__WEBPACK_IMPORTED_MODULE_1__[/* rgba */ "m"])(187, 68, 68, 255), Object(utils__WEBPACK_IMPORTED_MODULE_1__[/* rgba */ "m"])(221, 170, 170, 255), Object(utils__WEBPACK_IMPORTED_MODULE_1__[/* rgba */ "m"])(255, 221, 221, 255), Object(utils__WEBPACK_IMPORTED_MODULE_1__[/* rgba */ "m"])(255, 238, 221, 255), Object(utils__WEBPACK_IMPORTED_MODULE_1__[/* rgba */ "m"])(255, 255, 255, 255)],\n PC98_INNOCENT_TOUR: [Object(utils__WEBPACK_IMPORTED_MODULE_1__[/* rgba */ "m"])(0, 0, 0, 255), Object(utils__WEBPACK_IMPORTED_MODULE_1__[/* rgba */ "m"])(0, 68, 153, 255), Object(utils__WEBPACK_IMPORTED_MODULE_1__[/* rgba */ "m"])(34, 102, 0, 255), Object(utils__WEBPACK_IMPORTED_MODULE_1__[/* rgba */ "m"])(68, 34, 34, 255), Object(utils__WEBPACK_IMPORTED_MODULE_1__[/* rgba */ "m"])(68, 85, 85, 255), Object(utils__WEBPACK_IMPORTED_MODULE_1__[/* rgba */ "m"])(85, 153, 51, 255), Object(utils__WEBPACK_IMPORTED_MODULE_1__[/* rgba */ "m"])(119, 68, 51, 255), Object(utils__WEBPACK_IMPORTED_MODULE_1__[/* rgba */ "m"])(136, 153, 153, 255), Object(utils__WEBPACK_IMPORTED_MODULE_1__[/* rgba */ "m"])(153, 0, 0, 255), Object(utils__WEBPACK_IMPORTED_MODULE_1__[/* rgba */ "m"])(170, 102, 68, 255), Object(utils__WEBPACK_IMPORTED_MODULE_1__[/* rgba */ "m"])(170, 187, 238, 255), Object(utils__WEBPACK_IMPORTED_MODULE_1__[/* rgba */ "m"])(238, 153, 102, 255), Object(utils__WEBPACK_IMPORTED_MODULE_1__[/* rgba */ "m"])(238, 153, 51, 255), Object(utils__WEBPACK_IMPORTED_MODULE_1__[/* rgba */ "m"])(255, 187, 153, 255), Object(utils__WEBPACK_IMPORTED_MODULE_1__[/* rgba */ "m"])(255, 255, 255, 255)],\n PC98_POSSESSIONER: [Object(utils__WEBPACK_IMPORTED_MODULE_1__[/* rgba */ "m"])(0, 0, 0, 255), Object(utils__WEBPACK_IMPORTED_MODULE_1__[/* rgba */ "m"])(0, 51, 102, 255), Object(utils__WEBPACK_IMPORTED_MODULE_1__[/* rgba */ "m"])(34, 119, 136, 255), Object(utils__WEBPACK_IMPORTED_MODULE_1__[/* rgba */ "m"])(34, 170, 187, 255), Object(utils__WEBPACK_IMPORTED_MODULE_1__[/* rgba */ "m"])(68, 119, 68, 255), Object(utils__WEBPACK_IMPORTED_MODULE_1__[/* rgba */ "m"])(136, 0, 0, 255), Object(utils__WEBPACK_IMPORTED_MODULE_1__[/* rgba */ "m"])(136, 68, 34, 255), Object(utils__WEBPACK_IMPORTED_MODULE_1__[/* rgba */ "m"])(153, 187, 136, 255), Object(utils__WEBPACK_IMPORTED_MODULE_1__[/* rgba */ "m"])(187, 187, 187, 255), Object(utils__WEBPACK_IMPORTED_MODULE_1__[/* rgba */ "m"])(204, 102, 85, 255), Object(utils__WEBPACK_IMPORTED_MODULE_1__[/* rgba */ "m"])(238, 0, 0, 255), Object(utils__WEBPACK_IMPORTED_MODULE_1__[/* rgba */ "m"])(238, 153, 136, 255), Object(utils__WEBPACK_IMPORTED_MODULE_1__[/* rgba */ "m"])(255, 187, 170, 255), Object(utils__WEBPACK_IMPORTED_MODULE_1__[/* rgba */ "m"])(255, 204, 0, 255), Object(utils__WEBPACK_IMPORTED_MODULE_1__[/* rgba */ "m"])(255, 255, 255, 255)],\n // https://color.adobe.com/sandy-stone-beach-ocean-diver-color-theme-15325/\n SANDY_STONE_BEACH: [Object(utils__WEBPACK_IMPORTED_MODULE_1__[/* rgba */ "m"])(232, 225, 177, 255), Object(utils__WEBPACK_IMPORTED_MODULE_1__[/* rgba */ "m"])(166, 161, 127, 255), Object(utils__WEBPACK_IMPORTED_MODULE_1__[/* rgba */ "m"])(240, 235, 202, 255), Object(utils__WEBPACK_IMPORTED_MODULE_1__[/* rgba */ "m"])(0, 100, 126, 255), Object(utils__WEBPACK_IMPORTED_MODULE_1__[/* rgba */ "m"])(0, 51, 51, 255)],\n VAPORWAVE: [// modified http://www.colourlovers.com/palette/3636765/seapunk_vaporwave\n Object(utils__WEBPACK_IMPORTED_MODULE_1__[/* rgba */ "m"])(255, 106, 213, 255), Object(utils__WEBPACK_IMPORTED_MODULE_1__[/* rgba */ "m"])(199, 116, 232, 255), Object(utils__WEBPACK_IMPORTED_MODULE_1__[/* rgba */ "m"])(173, 140, 255, 255), Object(utils__WEBPACK_IMPORTED_MODULE_1__[/* rgba */ "m"])(135, 149, 232, 255), Object(utils__WEBPACK_IMPORTED_MODULE_1__[/* rgba */ "m"])(148, 208, 255, 255), Object(utils__WEBPACK_IMPORTED_MODULE_1__[/* rgba */ "m"])(0, 0, 0, 255)],\n WIREDSOUND: [// https://fauux.neocities.org\n Object(utils__WEBPACK_IMPORTED_MODULE_1__[/* rgba */ "m"])(210, 115, 138, 255), Object(utils__WEBPACK_IMPORTED_MODULE_1__[/* rgba */ "m"])(0, 0, 0, 255), Object(utils__WEBPACK_IMPORTED_MODULE_1__[/* rgba */ "m"])(193, 180, 146, 255)],\n EMPTY: []\n};\nconst optionTypes = {\n palette: {\n type: constants_controlTypes__WEBPACK_IMPORTED_MODULE_0__[/* COLOR_ARRAY */ "b"],\n default: THEMES.CGA\n },\n colorDistanceAlgorithm: constants_controlTypes__WEBPACK_IMPORTED_MODULE_0__[/* COLOR_DISTANCE_ALGORITHM */ "c"]\n};\nconst defaults = {\n colors: optionTypes.palette.default,\n colorDistanceAlgorithm: optionTypes.colorDistanceAlgorithm.default\n};\n\nconst getColor = (color, options = defaults) => {\n const {\n colors\n } = options;\n const colorDistanceAlgorithm = options.colorDistanceAlgorithm || defaults.colorDistanceAlgorithm;\n\n if (!colors) {\n return color;\n }\n\n let min = null;\n let minDistance = 0;\n colors.forEach(pc => {\n const distance = Object(utils__WEBPACK_IMPORTED_MODULE_1__[/* colorDistance */ "e"])(pc, color, colorDistanceAlgorithm);\n\n if (min === null) {\n min = pc;\n minDistance = distance;\n } else if (distance < minDistance) {\n min = pc;\n minDistance = distance;\n }\n });\n return !min ? color : min;\n};\n\nconst user = {\n name: "User/Adaptive",\n getColor,\n options: defaults,\n optionTypes,\n defaults\n};\n/* harmony default export */ __webpack_exports__["b"] = (user);\nconst createPalette = colors => _objectSpread({}, user, {\n options: _objectSpread({}, user.options, {\n colors,\n defaults: colors\n })\n});//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiOS5qcyIsInNvdXJjZXMiOlsid2VicGFjazovLy8uL3BhbGV0dGVzL3VzZXIuanM/NTE2ZiJdLCJzb3VyY2VzQ29udGVudCI6WyJmdW5jdGlvbiBfb2JqZWN0U3ByZWFkKHRhcmdldCkgeyBmb3IgKHZhciBpID0gMTsgaSA8IGFyZ3VtZW50cy5sZW5ndGg7IGkrKykgeyB2YXIgc291cmNlID0gYXJndW1lbnRzW2ldICE9IG51bGwgPyBhcmd1bWVudHNbaV0gOiB7fTsgdmFyIG93bktleXMgPSBPYmplY3Qua2V5cyhzb3VyY2UpOyBpZiAodHlwZW9mIE9iamVjdC5nZXRPd25Qcm9wZXJ0eVN5bWJvbHMgPT09ICdmdW5jdGlvbicpIHsgb3duS2V5cyA9IG93bktleXMuY29uY2F0KE9iamVjdC5nZXRPd25Qcm9wZXJ0eVN5bWJvbHMoc291cmNlKS5maWx0ZXIoZnVuY3Rpb24gKHN5bSkgeyByZXR1cm4gT2JqZWN0LmdldE93blByb3BlcnR5RGVzY3JpcHRvcihzb3VyY2UsIHN5bSkuZW51bWVyYWJsZTsgfSkpOyB9IG93bktleXMuZm9yRWFjaChmdW5jdGlvbiAoa2V5KSB7IF9kZWZpbmVQcm9wZXJ0eSh0YXJnZXQsIGtleSwgc291cmNlW2tleV0pOyB9KTsgfSByZXR1cm4gdGFyZ2V0OyB9XG5cbmZ1bmN0aW9uIF9kZWZpbmVQcm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QUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBIiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///9\n')},function(module,__webpack_exports__,__webpack_require__){"use strict";eval('/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "d", function() { return RGB_NEAREST; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return RGB_APPROX; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return HSV_NEAREST; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return LAB_NEAREST; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "e", function() { return WASM_LAB_NEAREST; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "f", function() { return WASM_LAB_NEAREST_MEMO_PALETTE; });\nconst RGB_NEAREST = "RGB_NEAREST_FAST";\nconst RGB_APPROX = "RGB_APPROX";\nconst HSV_NEAREST = "HSV_NEAREST";\nconst LAB_NEAREST = "JS_LAB_NEAREST_BEST";\nconst WASM_LAB_NEAREST = "WASM_LAB_NEAREST_BEST";\nconst WASM_LAB_NEAREST_MEMO_PALETTE = "WASM_LAB_NEAREST_MEMO_PALETTE";//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTAuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9jb25zdGFudHMvY29sb3IuanM/NWVkMCJdLCJzb3VyY2VzQ29udGVudCI6WyJleHBvcnQgY29uc3QgUkdCX05FQVJFU1QgPSBcIlJHQl9ORUFSRVNUX0ZBU1RcIjtcbmV4cG9ydCBjb25zdCBSR0JfQVBQUk9YID0gXCJSR0JfQVBQUk9YXCI7XG5leHBvcnQgY29uc3QgSFNWX05FQVJFU1QgPSBcIkhTVl9ORUFSRVNUXCI7XG5leHBvcnQgY29uc3QgTEFCX05FQVJFU1QgPSBcIkpTX0xBQl9ORUFSRVNUX0JFU1RcIjtcbmV4cG9ydCBjb25zdCBXQVNNX0xBQl9ORUFSRVNUID0gXCJXQVNNX0xBQl9ORUFSRVNUX0JFU1RcIjtcbmV4cG9ydCBjb25zdCBXQVNNX0xBQl9ORUFSRVNUX01FTU9fUEFMRVRURSA9IFwiV0FTTV9MQUJfTkVBUkVTVF9NRU1PX1BBTEVUVEVcIjsiXSwibWFwcGluZ3MiOiJBQUFBO0FBQUE7QUFBQTtBQUFBO0FBQUE7QUFBQTtBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQSIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///10\n')},function(module,__webpack_exports__,__webpack_require__){"use strict";eval('/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return PALETTE; });\n/* unused harmony export UNKNOWN */\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return SCALING_ALGORITHM; });\nconst PALETTE = "PALETTE";\nconst UNKNOWN = "UNKNOWN";\nconst SCALING_ALGORITHM = {\n AUTO: "AUTO",\n PIXELATED: "PIXELATED"\n};//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTEuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9jb25zdGFudHMvb3B0aW9uVHlwZXMuanM/OGM4MiJdLCJzb3VyY2VzQ29udGVudCI6WyJleHBvcnQgY29uc3QgUEFMRVRURSA9IFwiUEFMRVRURVwiO1xuZXhwb3J0IGNvbnN0IFVOS05PV04gPSBcIlVOS05PV05cIjtcbmV4cG9ydCBjb25zdCBTQ0FMSU5HX0FMR09SSVRITSA9IHtcbiAgQVVUTzogXCJBVVRPXCIsXG4gIFBJWEVMQVRFRDogXCJQSVhFTEFURURcIlxufTsiXSwibWFwcGluZ3MiOiJBQUFBO0FBQUE7QUFBQTtBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQSIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///11\n')},function(module,exports,__webpack_require__){"use strict";eval("\n\nexports.__esModule = true;\nvar addLeadingSlash = exports.addLeadingSlash = function addLeadingSlash(path) {\n return path.charAt(0) === '/' ? path : '/' + path;\n};\n\nvar stripLeadingSlash = exports.stripLeadingSlash = function stripLeadingSlash(path) {\n return path.charAt(0) === '/' ? path.substr(1) : path;\n};\n\nvar hasBasename = exports.hasBasename = function hasBasename(path, prefix) {\n return new RegExp('^' + prefix + '(\\\\/|\\\\?|#|$)', 'i').test(path);\n};\n\nvar stripBasename = exports.stripBasename = function stripBasename(path, prefix) {\n return hasBasename(path, prefix) ? path.substr(prefix.length) : path;\n};\n\nvar stripTrailingSlash = exports.stripTrailingSlash = function stripTrailingSlash(path) {\n return path.charAt(path.length - 1) === '/' ? path.slice(0, -1) : path;\n};\n\nvar parsePath = exports.parsePath = function parsePath(path) {\n var pathname = path || '/';\n var search = '';\n var hash = '';\n\n var hashIndex = pathname.indexOf('#');\n if (hashIndex !== -1) {\n hash = pathname.substr(hashIndex);\n pathname = pathname.substr(0, hashIndex);\n }\n\n var searchIndex = pathname.indexOf('?');\n if (searchIndex !== -1) {\n search = pathname.substr(searchIndex);\n pathname = pathname.substr(0, searchIndex);\n }\n\n return {\n pathname: pathname,\n search: search === '?' ? '' : search,\n hash: hash === '#' ? '' : hash\n };\n};\n\nvar createPath = exports.createPath = function createPath(location) {\n var pathname = location.pathname,\n search = location.search,\n hash = location.hash;\n\n\n var path = pathname || '/';\n\n if (search && search !== '?') path += search.charAt(0) === '?' ? search : '?' + search;\n\n if (hash && hash !== '#') path += hash.charAt(0) === '#' ? hash : '#' + hash;\n\n return path;\n};//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTIuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi4vbm9kZV9tb2R1bGVzL2hpc3RvcnkvUGF0aFV0aWxzLmpzP2Q1NGEiXSwic291cmNlc0NvbnRlbnQiOlsiJ3VzZSBzdHJpY3QnO1xuXG5leHBvcnRzLl9fZXNNb2R1bGUgPSB0cnVlO1xudmFyIGFkZExlYWRpbmdTbGFzaCA9IGV4cG9ydHMuYWRkTGVhZGluZ1NsYXNoID0gZnVuY3Rpb24gYWRkTGVhZGluZ1NsYXNoKHBhdGgpIHtcbiAgcmV0dXJuIHBhdGguY2hhckF0KDApID09PSAnLycgPyBwYXRoIDogJy8nICsgcGF0aDtcbn07XG5cbnZhciBzdHJpcExlYWRpbmdTbGFzaCA9IGV4cG9ydHMuc3RyaXBMZWFkaW5nU2xhc2ggPSBmdW5jdGlvbiBzdHJpcExlYWRpbmdTbGFzaChwYXRoKSB7XG4gIHJldHVybiBwYXRoLmNoYXJBdCgwKSA9PT0gJy8nID8gcGF0aC5zdWJzdHIoMSkgOiBwYXRoO1xufTt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BO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBIiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///12\n")},function(module,exports,__webpack_require__){"use strict";eval("\n\n\nvar TYPED_OK = (typeof Uint8Array !== 'undefined') &&\n (typeof Uint16Array !== 'undefined') &&\n (typeof Int32Array !== 'undefined');\n\nfunction _has(obj, key) {\n return Object.prototype.hasOwnProperty.call(obj, key);\n}\n\nexports.assign = function (obj /*from1, from2, from3, ...*/) {\n var sources = Array.prototype.slice.call(arguments, 1);\n while (sources.length) {\n var source = sources.shift();\n if (!source) { continue; }\n\n if (typeof source !== 'object') {\n throw new TypeError(source + 'must be non-object');\n }\n\n for (var p in source) {\n if (_has(source, p)) {\n obj[p] = source[p];\n }\n }\n }\n\n return obj;\n};\n\n\n// reduce buffer size, avoiding mem copy\nexports.shrinkBuf = function (buf, size) {\n if (buf.length === size) { return buf; }\n if (buf.subarray) { return buf.subarray(0, size); }\n buf.length = size;\n return buf;\n};\n\n\nvar fnTyped = {\n arraySet: function (dest, src, src_offs, len, dest_offs) {\n if (src.subarray && dest.subarray) {\n dest.set(src.subarray(src_offs, src_offs + len), dest_offs);\n return;\n }\n // Fallback to ordinary array\n for (var i = 0; i < len; i++) {\n dest[dest_offs + i] = src[src_offs + i];\n }\n },\n // Join array of chunks to single array.\n flattenChunks: function (chunks) {\n var i, l, len, pos, chunk, result;\n\n // calculate data length\n len = 0;\n for (i = 0, l = chunks.length; i < l; i++) {\n len += chunks[i].length;\n }\n\n // join chunks\n result = new Uint8Array(len);\n pos = 0;\n for (i = 0, l = chunks.length; i < l; i++) {\n chunk = chunks[i];\n result.set(chunk, pos);\n pos += chunk.length;\n }\n\n return result;\n }\n};\n\nvar fnUntyped = {\n arraySet: function (dest, src, src_offs, len, dest_offs) {\n for (var i = 0; i < len; i++) {\n dest[dest_offs + i] = src[src_offs + i];\n }\n },\n // Join array of chunks to single array.\n flattenChunks: function (chunks) {\n return [].concat.apply([], chunks);\n }\n};\n\n\n// Enable/Disable typed arrays use, for testing\n//\nexports.setTyped = function (on) {\n if (on) {\n exports.Buf8 = Uint8Array;\n exports.Buf16 = Uint16Array;\n exports.Buf32 = Int32Array;\n exports.assign(exports, fnTyped);\n } else {\n exports.Buf8 = Array;\n exports.Buf16 = Array;\n exports.Buf32 = Array;\n exports.assign(exports, fnUntyped);\n }\n};\n\nexports.setTyped(TYPED_OK);\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTMuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi4vbm9kZV9tb2R1bGVzL3Bha28vbGliL3V0aWxzL2NvbW1vbi5qcz9mYWU5Il0sInNvdXJjZXNDb250ZW50IjpbIid1c2Ugc3RyaWN0JztcblxuXG52YXIgVFlQRURfT0sgPSAgKHR5cGVvZiBVaW50OEFycmF5ICE9PSAndW5kZWZpbmVkJykgJiZcbiAgICAgICAgICAgICAgICAodHlwZW9mIFVpbnQxNkFycmF5ICE9PSAndW5kZWZpbmVkJykgJiZcbiAgICAgICAgICAgICAgICAodHlwZW9mIEludDMyQXJyYXkgIT09ICd1bmRlZmluZWQnKTtcblxuZnVuY3Rpb24gX2hhcyhvYmosIGtleSkge1xuICByZXR1cm4gT2JqZWN0LnByb3RvdHlwZS5oYXNPd25Qcm9wZXJ0eS5jYWxsKG9iaiwga2V5KTtcbn1cblxuZXhwb3J0cy5hc3NpZ24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DQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///13\n")},function(module,__webpack_exports__,__webpack_require__){"use strict";eval('/* unused harmony export ALL */\n/* unused harmony export PIXEL */\n/* unused harmony export optionTypes */\n/* unused harmony export defaults */\n/* harmony import */ var constants_controlTypes__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(3);\n/* harmony import */ var palettes__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(6);\n/* harmony import */ var utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(0);\n\n\n\nconst ALL = "ALL";\nconst PIXEL = "PIXEL";\nconst optionTypes = {\n mode: {\n type: constants_controlTypes__WEBPACK_IMPORTED_MODULE_0__[/* ENUM */ "d"],\n options: [{\n name: "Pixel",\n value: PIXEL\n }],\n default: PIXEL\n },\n program: {\n type: constants_controlTypes__WEBPACK_IMPORTED_MODULE_0__[/* TEXT */ "i"],\n default: `// Eval\'d JS\n// Errors in console\n// Variables:\n// r, g, b, a\n// w, h, x, y\n// const p ([r, g, b, a]),\n// const i (index),\n// buf (pixel array)\n// palette\n\nr = buf[i + 17];\ng = b;\nb = i % 255;\na = 255;`\n },\n palette: {\n type: constants_controlTypes__WEBPACK_IMPORTED_MODULE_0__[/* PALETTE */ "e"],\n default: palettes__WEBPACK_IMPORTED_MODULE_1__[/* nearest */ "a"]\n }\n};\nconst defaults = {\n mode: optionTypes.mode.default,\n program: optionTypes.program.default,\n palette: optionTypes.palette.default\n};\n\nconst programFilter = (input, options = defaults) => {\n const {\n program,\n palette\n } = options;\n const output = Object(utils__WEBPACK_IMPORTED_MODULE_2__[/* cloneCanvas */ "d"])(input, false);\n const inputCtx = input.getContext("2d");\n const outputCtx = output.getContext("2d");\n\n if (!inputCtx || !outputCtx) {\n return input;\n }\n\n const buf = inputCtx.getImageData(0, 0, input.width, input.height).data;\n const w = input.width;\n const h = input.height;\n\n outside: for (let x = 0; x < w; x += 1) {\n // eslint-disable-line\n for (let y = 0; y < h; y += 1) {\n // Define variables for program\n const i = Object(utils__WEBPACK_IMPORTED_MODULE_2__[/* getBufferIndex */ "i"])(x, y, w);\n const p = Object(utils__WEBPACK_IMPORTED_MODULE_2__[/* rgba */ "m"])(buf[i], buf[i + 1], buf[i + 2], buf[i + 3]);\n /* eslint-disable */\n\n let r = p[0];\n let g = p[1];\n let b = p[2];\n let a = p[3];\n\n try {\n eval(program);\n } catch (e) {\n console.error(e);\n break outside;\n }\n /* eslint-enable */\n\n\n const col = palette.getColor([r, g, b, a], palette.options);\n Object(utils__WEBPACK_IMPORTED_MODULE_2__[/* fillBufferPixel */ "g"])(buf, i, col[0], col[1], col[2], col[3]);\n }\n }\n\n outputCtx.putImageData(new ImageData(buf, output.width, output.height), 0, 0);\n return output;\n};\n\n/* harmony default export */ __webpack_exports__["a"] = ({\n name: "Program",\n func: programFilter,\n optionTypes,\n options: defaults,\n defaults\n});//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaW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DQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0EiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///14\n')},function(module,exports){eval('/*\n\tMIT License http://www.opensource.org/licenses/mit-license.php\n\tAuthor Tobias Koppers @sokra\n*/\n// css base code, injected by the css-loader\nmodule.exports = function(useSourceMap) {\n\tvar list = [];\n\n\t// return the list of modules as css string\n\tlist.toString = function toString() {\n\t\treturn this.map(function (item) {\n\t\t\tvar content = cssWithMappingToString(item, useSourceMap);\n\t\t\tif(item[2]) {\n\t\t\t\treturn "@media " + item[2] + "{" + content + "}";\n\t\t\t} else {\n\t\t\t\treturn content;\n\t\t\t}\n\t\t}).join("");\n\t};\n\n\t// import a list of modules into the list\n\tlist.i = function(modules, mediaQuery) {\n\t\tif(typeof modules === "string")\n\t\t\tmodules = [[null, modules, ""]];\n\t\tvar alreadyImportedModules = {};\n\t\tfor(var i = 0; i < this.length; i++) {\n\t\t\tvar id = this[i][0];\n\t\t\tif(typeof id === "number")\n\t\t\t\talreadyImportedModules[id] = true;\n\t\t}\n\t\tfor(i = 0; i < modules.length; i++) {\n\t\t\tvar item = modules[i];\n\t\t\t// skip already imported module\n\t\t\t// this implementation is not 100% perfect for weird media query combinations\n\t\t\t// when a module is imported multiple times with different media queries.\n\t\t\t// I hope this will never occur (Hey this way we have smaller bundles)\n\t\t\tif(typeof item[0] !== "number" || !alreadyImportedModules[item[0]]) {\n\t\t\t\tif(mediaQuery && !item[2]) {\n\t\t\t\t\titem[2] = mediaQuery;\n\t\t\t\t} else if(mediaQuery) {\n\t\t\t\t\titem[2] = "(" + item[2] + ") and (" + mediaQuery + ")";\n\t\t\t\t}\n\t\t\t\tlist.push(item);\n\t\t\t}\n\t\t}\n\t};\n\treturn list;\n};\n\nfunction cssWithMappingToString(item, useSourceMap) {\n\tvar content = item[1] || \'\';\n\tvar cssMapping = item[3];\n\tif (!cssMapping) {\n\t\treturn content;\n\t}\n\n\tif (useSourceMap && typeof btoa === \'function\') {\n\t\tvar sourceMapping = toComment(cssMapping);\n\t\tvar sourceURLs = cssMapping.sources.map(function (source) {\n\t\t\treturn \'/*# sourceURL=\' + cssMapping.sourceRoot + source + \' */\'\n\t\t});\n\n\t\treturn [content].concat(sourceURLs).concat([sourceMapping]).join(\'\\n\');\n\t}\n\n\treturn [content].join(\'\\n\');\n}\n\n// Adapted from convert-source-map (MIT)\nfunction toComment(sourceMap) {\n\t// eslint-disable-next-line no-undef\n\tvar base64 = btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap))));\n\tvar data = \'sourceMappingURL=data:application/json;charset=utf-8;base64,\' + base64;\n\n\treturn \'/*# \' + data + \' */\';\n}\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTUuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi4vbm9kZV9tb2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mNlTWFwKSkpKTtcblx0dmFyIGRhdGEgPSAnc291cmNlTWFwcGluZ1VSTD1kYXRhOmFwcGxpY2F0aW9uL2pzb247Y2hhcnNldD11dGYtODtiYXNlNjQsJyArIGJhc2U2NDtcblxuXHRyZXR1cm4gJy8qIyAnICsgZGF0YSArICcgKi8nO1xufVxuIl0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///15\n')},function(module,exports,__webpack_require__){eval("/**\n * Copyright 2015, Yahoo! Inc.\n * Copyrights licensed under the New BSD License. See the accompanying LICENSE file for terms.\n */\n(function (global, factory) {\n true ? module.exports = factory() :\n undefined;\n}(this, (function () {\n 'use strict';\n \n var REACT_STATICS = {\n childContextTypes: true,\n contextTypes: true,\n defaultProps: true,\n displayName: true,\n getDefaultProps: true,\n getDerivedStateFromProps: true,\n mixins: true,\n propTypes: true,\n type: true\n };\n \n var KNOWN_STATICS = {\n name: true,\n length: true,\n prototype: true,\n caller: true,\n callee: true,\n arguments: true,\n arity: true\n };\n \n var defineProperty = Object.defineProperty;\n var getOwnPropertyNames = Object.getOwnPropertyNames;\n var getOwnPropertySymbols = Object.getOwnPropertySymbols;\n var getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;\n var getPrototypeOf = Object.getPrototypeOf;\n var objectPrototype = getPrototypeOf && getPrototypeOf(Object);\n \n return function hoistNonReactStatics(targetComponent, sourceComponent, blacklist) {\n if (typeof sourceComponent !== 'string') { // don't hoist over string (html) components\n \n if (objectPrototype) {\n var inheritedComponent = getPrototypeOf(sourceComponent);\n if (inheritedComponent && inheritedComponent !== objectPrototype) {\n hoistNonReactStatics(targetComponent, inheritedComponent, blacklist);\n }\n }\n \n var keys = getOwnPropertyNames(sourceComponent);\n \n if (getOwnPropertySymbols) {\n keys = keys.concat(getOwnPropertySymbols(sourceComponent));\n }\n \n for (var i = 0; i < keys.length; ++i) {\n var key = keys[i];\n if (!REACT_STATICS[key] && !KNOWN_STATICS[key] && (!blacklist || !blacklist[key])) {\n var descriptor = getOwnPropertyDescriptor(sourceComponent, key);\n try { // Avoid failures from read-only properties\n defineProperty(targetComponent, key, descriptor);\n } catch (e) {}\n }\n }\n \n return targetComponent;\n }\n \n return targetComponent;\n };\n})));\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTYuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi4vbm9kZV9tb2R1bGVzL2hvaXN0LW5vbi1yZWFjdC1zdGF0aWNzL2luZGV4LmpzPzcyZjAiXSwic291cmNlc0NvbnRlbnQiOlsiLyoqXG4gKiBDb3B5cmlnaHQgMjAxNSwgWWFob28hIEluYy5cbiAqIENvcHlyaWdodHMgbGljZW5zZWQgdW5kZXIgdGhlIE5ldyBCU0QgTGljZW5zZS4gU2VlIHRoZSBhY2NvbXBhbnlpbmcgTElDRU5TRSBma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XG4gICAgXG4gICAgdmFyIGRlZmluZVByb3BlcnR5ID0gT2JqZWN0LmRlZmluZVByb3BlcnR5O1xuICAgIHZhciBnZXRPd25Qcm9wZXJ0eU5hbWVzID0gT2JqZWN0LmdldE93blByb3BlcnR5TmFtZXM7XG4gICAgdmFyIGdldE93blByb3BlcnR5U3ltYm9scyA9IE9iamVjdC5nZXRPd25Qcm9wZXJ0eVN5bWJvbHM7XG4gICAgdmFyIGdldE93blByb3BlcnR5RGVzY3JpcHRvciA9IE9iamVjdC5nZXRPd25Qcm9wZXJ0eURlc2NyaXB0b3I7XG4gICAgdmFyIGdldFByb3RvdHlwZU9mID0gT2JqZWN0LmdldFByb3RvdHlwZU9mO1xuICAgIHZhciBvYmplY3RQcm90b3R5cGUgPSBnZXRQcm90b3R5cGVPZiAmJiBnZXRQcm90b3R5cGVPZihPYmplY3QpO1xuICAgIFxuICAgIHJldHVybiBmdW5jdGlvbiBob2lzdE5vblJlYWN0U3RhdGljcyh0YXJnZXRDb21wb25lbnQsIHNvdXJjZUNvbXBvbmVudCwgYmxhY2tsaXN0KSB7XG4gICAgICAgIGlmICh0eXBlb2Ygc291cmNlQ29tcG9uZW50ICE9PSAnc3RyaW5nJykgeyAvLyBkb24ndCBob2lzdCBvdmVyIHN0cmluZyAoaHRtbCkgY29tcG9uZW50c1xuICAgICAgICAgICAgXG4gICAgICAgICAgICBpZiAob2JqZWN0UHJvdG90eXBlKSB7XG4gICAgICAgICAgICAgICAgdmFyIGluaGVyaXRlZENvbXBvbmVudCA9IGdldFByb3RvdHlwZU9mKHNvdXJjZUNvbXBvbmVudCk7XG4gICAgICAgICAgICAgICAgaWYgKGluaGVyaXRlZENvbXBvbmVudCAmJiBpbmhlcml0ZWRDb21wb25lbnQgIT09IG9iamVjdFByb3RvdHlwZSkge1xuICAgICAgICAgICAgICAgICAgICBob2lzdE5vblJlYWN0U3RhdGljcyh0YXJnZXRDb21wb25lbnQsIGluaGVyaXRlZENvbXBvbmVudCwgYmxhY2tsaXN0KTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBcbiAgICAgICAgICAgIHZhciBrZXlzID0gZ2V0T3duUHJvcGVydHlOYW1lcyhzb3VyY2VDb21wb25lbnQpO1xuICAgICAgICAgICAgXG4gICAgICAgICAgICBpZiAoZ2V0T3duUHJvcGVydHlTeW1ib2xzKSB7XG4gICAgICAgICAgICAgICAga2V5cyA9IGtleXMuY29uY2F0KGdldE93blByb3BlcnR5U3ltYm9scyhzb3VyY2VDb21wb25lbnQpKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIFxuICAgICAgICAgICAgZm9yICh2YXIgaSA9IDA7IGkgPCBrZXlzLmxlbmd0aDsgKytpKSB7XG4gICAgICAgICAgICAgICAgdmFyIGtleSA9IGtleXNbaV07XG4gICAgICAgICAgICAgICAgaWYgKCFSRUFDVF9TVEFUSUNTW2tleV0gJiYgIUtOT1dOX1NUQVRJQ1Nba2V5XSAmJiAoIWJsYWNrbGlzdCB8fCAhYmxhY2tsaXN0W2tleV0pKSB7XG4gICAgICAgICAgICAgICAgICAgIHZhciBkZXNjcmlwdG9yID0gZ2V0T3duUHJvcGVydHlEZXNjcmlwdG9yKHNvdXJjZUNvbXBvbmVudCwga2V5KTtcbiAgICAgICAgICAgICAgICAgICAgdHJ5IHsgLy8gQXZvaWQgZmFpbHVyZXMgZnJvbSByZWFkLW9ubHkgcHJvcGVydGllc1xuICAgICAgICAgICAgICAgICAgICAgICAgZGVmaW5lUHJvcGVydHkodGFyZ2V0Q29tcG9uZW50LCBrZXksIGRlc2NyaXB0b3IpO1xuICAgICAgICAgICAgICAgICAgICB9IGNhdGNoIChlKSB7fVxuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIFxuICAgICAgICAgICAgcmV0dXJuIHRhcmdldENvbXBvbmVudDtcbiAgICAgICAgfVxuICAgICAgICBcbiAgICAgICAgcmV0dXJuIHRhcmdldENvbXBvbmVudDtcbiAgICB9O1xufSkpKTtcbiJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0EsYUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///16\n")},function(module,exports,__webpack_require__){"use strict";eval("\n\nexports.__esModule = true;\n\nvar _typeof = typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; };\n\nvar _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };\n\nvar _warning = __webpack_require__(5);\n\nvar _warning2 = _interopRequireDefault(_warning);\n\nvar _invariant = __webpack_require__(7);\n\nvar _invariant2 = _interopRequireDefault(_invariant);\n\nvar _LocationUtils = __webpack_require__(22);\n\nvar _PathUtils = __webpack_require__(12);\n\nvar _createTransitionManager = __webpack_require__(23);\n\nvar _createTransitionManager2 = _interopRequireDefault(_createTransitionManager);\n\nvar _DOMUtils = __webpack_require__(34);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar PopStateEvent = 'popstate';\nvar HashChangeEvent = 'hashchange';\n\nvar getHistoryState = function getHistoryState() {\n try {\n return window.history.state || {};\n } catch (e) {\n // IE 11 sometimes throws when accessing window.history.state\n // See https://github.com/ReactTraining/history/pull/289\n return {};\n }\n};\n\n/**\n * Creates a history object that uses the HTML5 history API including\n * pushState, replaceState, and the popstate event.\n */\nvar createBrowserHistory = function createBrowserHistory() {\n var props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n\n (0, _invariant2.default)(_DOMUtils.canUseDOM, 'Browser history needs a DOM');\n\n var globalHistory = window.history;\n var canUseHistory = (0, _DOMUtils.supportsHistory)();\n var needsHashChangeListener = !(0, _DOMUtils.supportsPopStateOnHashChange)();\n\n var _props$forceRefresh = props.forceRefresh,\n forceRefresh = _props$forceRefresh === undefined ? false : _props$forceRefresh,\n _props$getUserConfirm = props.getUserConfirmation,\n getUserConfirmation = _props$getUserConfirm === undefined ? _DOMUtils.getConfirmation : _props$getUserConfirm,\n _props$keyLength = props.keyLength,\n keyLength = _props$keyLength === undefined ? 6 : _props$keyLength;\n\n var basename = props.basename ? (0, _PathUtils.stripTrailingSlash)((0, _PathUtils.addLeadingSlash)(props.basename)) : '';\n\n var getDOMLocation = function getDOMLocation(historyState) {\n var _ref = historyState || {},\n key = _ref.key,\n state = _ref.state;\n\n var _window$location = window.location,\n pathname = _window$location.pathname,\n search = _window$location.search,\n hash = _window$location.hash;\n\n\n var path = pathname + search + hash;\n\n (0, _warning2.default)(!basename || (0, _PathUtils.hasBasename)(path, basename), 'You are attempting to use a basename on a page whose URL path does not begin ' + 'with the basename. Expected path \"' + path + '\" to begin with \"' + basename + '\".');\n\n if (basename) path = (0, _PathUtils.stripBasename)(path, basename);\n\n return (0, _LocationUtils.createLocation)(path, state, key);\n };\n\n var createKey = function createKey() {\n return Math.random().toString(36).substr(2, keyLength);\n };\n\n var transitionManager = (0, _createTransitionManager2.default)();\n\n var setState = function setState(nextState) {\n _extends(history, nextState);\n\n history.length = globalHistory.length;\n\n transitionManager.notifyListeners(history.location, history.action);\n };\n\n var handlePopState = function handlePopState(event) {\n // Ignore extraneous popstate events in WebKit.\n if ((0, _DOMUtils.isExtraneousPopstateEvent)(event)) return;\n\n handlePop(getDOMLocation(event.state));\n };\n\n var handleHashChange = function handleHashChange() {\n handlePop(getDOMLocation(getHistoryState()));\n };\n\n var forceNextPop = false;\n\n var handlePop = function handlePop(location) {\n if (forceNextPop) {\n forceNextPop = false;\n setState();\n } else {\n var action = 'POP';\n\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (ok) {\n setState({ action: action, location: location });\n } else {\n revertPop(location);\n }\n });\n }\n };\n\n var revertPop = function revertPop(fromLocation) {\n var toLocation = history.location;\n\n // TODO: We could probably make this more reliable by\n // keeping a list of keys we've seen in sessionStorage.\n // Instead, we just default to 0 for keys we don't know.\n\n var toIndex = allKeys.indexOf(toLocation.key);\n\n if (toIndex === -1) toIndex = 0;\n\n var fromIndex = allKeys.indexOf(fromLocation.key);\n\n if (fromIndex === -1) fromIndex = 0;\n\n var delta = toIndex - fromIndex;\n\n if (delta) {\n forceNextPop = true;\n go(delta);\n }\n };\n\n var initialLocation = getDOMLocation(getHistoryState());\n var allKeys = [initialLocation.key];\n\n // Public interface\n\n var createHref = function createHref(location) {\n return basename + (0, _PathUtils.createPath)(location);\n };\n\n var push = function push(path, state) {\n (0, _warning2.default)(!((typeof path === 'undefined' ? 'undefined' : _typeof(path)) === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to push when the 1st ' + 'argument is a location-like object that already has state; it is ignored');\n\n var action = 'PUSH';\n var location = (0, _LocationUtils.createLocation)(path, state, createKey(), history.location);\n\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n\n var href = createHref(location);\n var key = location.key,\n state = location.state;\n\n\n if (canUseHistory) {\n globalHistory.pushState({ key: key, state: state }, null, href);\n\n if (forceRefresh) {\n window.location.href = href;\n } else {\n var prevIndex = allKeys.indexOf(history.location.key);\n var nextKeys = allKeys.slice(0, prevIndex === -1 ? 0 : prevIndex + 1);\n\n nextKeys.push(location.key);\n allKeys = nextKeys;\n\n setState({ action: action, location: location });\n }\n } else {\n (0, _warning2.default)(state === undefined, 'Browser history cannot push state in browsers that do not support HTML5 history');\n\n window.location.href = href;\n }\n });\n };\n\n var replace = function replace(path, state) {\n (0, _warning2.default)(!((typeof path === 'undefined' ? 'undefined' : _typeof(path)) === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to replace when the 1st ' + 'argument is a location-like object that already has state; it is ignored');\n\n var action = 'REPLACE';\n var location = (0, _LocationUtils.createLocation)(path, state, createKey(), history.location);\n\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n\n var href = createHref(location);\n var key = location.key,\n state = location.state;\n\n\n if (canUseHistory) {\n globalHistory.replaceState({ key: key, state: state }, null, href);\n\n if (forceRefresh) {\n window.location.replace(href);\n } else {\n var prevIndex = allKeys.indexOf(history.location.key);\n\n if (prevIndex !== -1) allKeys[prevIndex] = location.key;\n\n setState({ action: action, location: location });\n }\n } else {\n (0, _warning2.default)(state === undefined, 'Browser history cannot replace state in browsers that do not support HTML5 history');\n\n window.location.replace(href);\n }\n });\n };\n\n var go = function go(n) {\n globalHistory.go(n);\n };\n\n var goBack = function goBack() {\n return go(-1);\n };\n\n var goForward = function goForward() {\n return go(1);\n };\n\n var listenerCount = 0;\n\n var checkDOMListeners = function checkDOMListeners(delta) {\n listenerCount += delta;\n\n if (listenerCount === 1) {\n (0, _DOMUtils.addEventListener)(window, PopStateEvent, handlePopState);\n\n if (needsHashChangeListener) (0, _DOMUtils.addEventListener)(window, HashChangeEvent, handleHashChange);\n } else if (listenerCount === 0) {\n (0, _DOMUtils.removeEventListener)(window, PopStateEvent, handlePopState);\n\n if (needsHashChangeListener) (0, _DOMUtils.removeEventListener)(window, HashChangeEvent, handleHashChange);\n }\n };\n\n var isBlocked = false;\n\n var block = function block() {\n var prompt = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;\n\n var unblock = transitionManager.setPrompt(prompt);\n\n if (!isBlocked) {\n checkDOMListeners(1);\n isBlocked = true;\n }\n\n return function () {\n if (isBlocked) {\n isBlocked = false;\n checkDOMListeners(-1);\n }\n\n return unblock();\n };\n };\n\n var listen = function listen(listener) {\n var unlisten = transitionManager.appendListener(listener);\n checkDOMListeners(1);\n\n return function () {\n checkDOMListeners(-1);\n unlisten();\n };\n };\n\n var history = {\n length: globalHistory.length,\n action: 'POP',\n location: initialLocation,\n createHref: createHref,\n push: push,\n replace: replace,\n go: go,\n goBack: goBack,\n goForward: goForward,\n block: block,\n listen: listen\n };\n\n return history;\n};\n\nexports.default = createBrowserHistory;//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTcuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi4vbm9kZV9tb2R1bGVzL2hpc3RvcnkvY3JlYXRlQnJvd3Nlckhpc3RvcnkuanM/OWVlMSJdLCJzb3VyY2VzQ29udGVudCI6WyIndXNlIHN0cmljdCc7XG5cbmV4cG9ydHMuX19lc01vZHVsZSA9IHRydWU7XG5cbnZhciBfdHlwZW9mID0gdHlwZW9mIFN5bWJvbCA9PT0gXCJmdW5jdGlvblwiICYmIHR5cGVvZiBTeW1ib2wuaXRlcmF0b3IgPT09IFwic3ltYm9sXCIgPyBmdW5jdGlvbiAob2JqKSB7IHJldHVybiB0eXBlb2Ygb2JqOyB9IDogZnVuY3Rpb24gKG9iaikgeyByZXR1cm4gb2JqICYmIHR5cGVvZiBTeW1ib2wgPT09IFwiZnVuY3Rpb25cIi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QUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQSIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///17\n")},function(module,exports,__webpack_require__){eval("(function webpackUniversalModuleDefinition(root, factory) {\n\tif(true)\n\t\tmodule.exports = factory(__webpack_require__(27), __webpack_require__(1));\n\telse {}\n})(this, function(__WEBPACK_EXTERNAL_MODULE_4__, __WEBPACK_EXTERNAL_MODULE_6__) {\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/******/ \t\t}\n/******/ \t\t// Create a new module (and put it into the cache)\n/******/ \t\tvar module = installedModules[moduleId] = {\n/******/ \t\t\ti: moduleId,\n/******/ \t\t\tl: false,\n/******/ \t\t\texports: {}\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.l = 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// define getter function for harmony exports\n/******/ \t__webpack_require__.d = function(exports, name, getter) {\n/******/ \t\tif(!__webpack_require__.o(exports, name)) {\n/******/ \t\t\tObject.defineProperty(exports, name, {\n/******/ \t\t\t\tconfigurable: false,\n/******/ \t\t\t\tenumerable: true,\n/******/ \t\t\t\tget: getter\n/******/ \t\t\t});\n/******/ \t\t}\n/******/ \t};\n/******/\n/******/ \t// getDefaultExport function for compatibility with non-harmony modules\n/******/ \t__webpack_require__.n = function(module) {\n/******/ \t\tvar getter = module && module.__esModule ?\n/******/ \t\t\tfunction getDefault() { return module['default']; } :\n/******/ \t\t\tfunction getModuleExports() { return module; };\n/******/ \t\t__webpack_require__.d(getter, 'a', getter);\n/******/ \t\treturn getter;\n/******/ \t};\n/******/\n/******/ \t// Object.prototype.hasOwnProperty.call\n/******/ \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n/******/\n/******/ \t// __webpack_public_path__\n/******/ \t__webpack_require__.p = \"\";\n/******/\n/******/ \t// Load entry module and return exports\n/******/ \treturn __webpack_require__(__webpack_require__.s = 12);\n/******/ })\n/************************************************************************/\n/******/ ([\n/* 0 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.findInArray = findInArray;\nexports.isFunction = isFunction;\nexports.isNum = isNum;\nexports.int = int;\nexports.dontSetMe = dontSetMe;\n\n// @credits https://gist.github.com/rogozhnikoff/a43cfed27c41e4e68cdc\nfunction findInArray(array /*: Array | TouchList*/, callback /*: Function*/) /*: any*/ {\n for (var i = 0, length = array.length; i < length; i++) {\n if (callback.apply(callback, [array[i], i, array])) return array[i];\n }\n}\n\nfunction isFunction(func /*: any*/) /*: boolean*/ {\n return typeof func === 'function' || Object.prototype.toString.call(func) === '[object Function]';\n}\n\nfunction isNum(num /*: any*/) /*: boolean*/ {\n return typeof num === 'number' && !isNaN(num);\n}\n\nfunction int(a /*: string*/) /*: number*/ {\n return parseInt(a, 10);\n}\n\nfunction dontSetMe(props /*: Object*/, propName /*: string*/, componentName /*: string*/) {\n if (props[propName]) {\n return new Error('Invalid prop ' + propName + ' passed to ' + componentName + ' - do not set this, set it on the child.');\n }\n}\n\n/***/ }),\n/* 1 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\n/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * \n */\n\nfunction makeEmptyFunction(arg) {\n return function () {\n return arg;\n };\n}\n\n/**\n * This function accepts and discards inputs; it has no side effects. This is\n * primarily useful idiomatically for overridable function endpoints which\n * always need to be callable, since JS lacks a null-call idiom ala Cocoa.\n */\nvar emptyFunction = function emptyFunction() {};\n\nemptyFunction.thatReturns = makeEmptyFunction;\nemptyFunction.thatReturnsFalse = makeEmptyFunction(false);\nemptyFunction.thatReturnsTrue = makeEmptyFunction(true);\nemptyFunction.thatReturnsNull = makeEmptyFunction(null);\nemptyFunction.thatReturnsThis = function () {\n return this;\n};\nemptyFunction.thatReturnsArgument = function (arg) {\n return arg;\n};\n\nmodule.exports = emptyFunction;\n\n/***/ }),\n/* 2 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\n\n\n/**\n * Use invariant() to assert state which your program assumes to be true.\n *\n * Provide sprintf-style format (only %s is supported) and arguments\n * to provide information about what broke and what you were\n * expecting.\n *\n * The invariant message will be stripped in production, but the invariant\n * will remain to ensure logic does not differ in production.\n */\n\nvar validateFormat = function validateFormat(format) {};\n\nif (Object({\"DRAGGABLE_DEBUG\":undefined}).NODE_ENV !== 'production') {\n validateFormat = function validateFormat(format) {\n if (format === undefined) {\n throw new Error('invariant requires an error message argument');\n }\n };\n}\n\nfunction invariant(condition, format, a, b, c, d, e, f) {\n validateFormat(format);\n\n if (!condition) {\n var error;\n if (format === undefined) {\n error = new Error('Minified exception occurred; use the non-minified dev environment ' + 'for the full error message and additional helpful warnings.');\n } else {\n var args = [a, b, c, d, e, f];\n var argIndex = 0;\n error = new Error(format.replace(/%s/g, function () {\n return args[argIndex++];\n }));\n error.name = 'Invariant Violation';\n }\n\n error.framesToPop = 1; // we don't care about invariant's own frame\n throw error;\n }\n}\n\nmodule.exports = invariant;\n\n/***/ }),\n/* 3 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n\n\nvar ReactPropTypesSecret = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED';\n\nmodule.exports = ReactPropTypesSecret;\n\n\n/***/ }),\n/* 4 */\n/***/ (function(module, exports) {\n\nmodule.exports = __WEBPACK_EXTERNAL_MODULE_4__;\n\n/***/ }),\n/* 5 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };\n\nexports.matchesSelector = matchesSelector;\nexports.matchesSelectorAndParentsTo = matchesSelectorAndParentsTo;\nexports.addEvent = addEvent;\nexports.removeEvent = removeEvent;\nexports.outerHeight = outerHeight;\nexports.outerWidth = outerWidth;\nexports.innerHeight = innerHeight;\nexports.innerWidth = innerWidth;\nexports.offsetXYFromParent = offsetXYFromParent;\nexports.createCSSTransform = createCSSTransform;\nexports.createSVGTransform = createSVGTransform;\nexports.getTouch = getTouch;\nexports.getTouchIdentifier = getTouchIdentifier;\nexports.addUserSelectStyles = addUserSelectStyles;\nexports.removeUserSelectStyles = removeUserSelectStyles;\nexports.styleHacks = styleHacks;\nexports.addClassName = addClassName;\nexports.removeClassName = removeClassName;\n\nvar _shims = __webpack_require__(0);\n\nvar _getPrefix = __webpack_require__(19);\n\nvar _getPrefix2 = _interopRequireDefault(_getPrefix);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\n/*:: import type {ControlPosition, MouseTouchEvent} from './types';*/\n\n\nvar matchesSelectorFunc = '';\nfunction matchesSelector(el /*: Node*/, selector /*: string*/) /*: boolean*/ {\n if (!matchesSelectorFunc) {\n matchesSelectorFunc = (0, _shims.findInArray)(['matches', 'webkitMatchesSelector', 'mozMatchesSelector', 'msMatchesSelector', 'oMatchesSelector'], function (method) {\n // $FlowIgnore: Doesn't think elements are indexable\n return (0, _shims.isFunction)(el[method]);\n });\n }\n\n // Might not be found entirely (not an Element?) - in that case, bail\n // $FlowIgnore: Doesn't think elements are indexable\n if (!(0, _shims.isFunction)(el[matchesSelectorFunc])) return false;\n\n // $FlowIgnore: Doesn't think elements are indexable\n return el[matchesSelectorFunc](selector);\n}\n\n// Works up the tree to the draggable itself attempting to match selector.\nfunction matchesSelectorAndParentsTo(el /*: Node*/, selector /*: string*/, baseNode /*: Node*/) /*: boolean*/ {\n var node = el;\n do {\n if (matchesSelector(node, selector)) return true;\n if (node === baseNode) return false;\n node = node.parentNode;\n } while (node);\n\n return false;\n}\n\nfunction addEvent(el /*: ?Node*/, event /*: string*/, handler /*: Function*/) /*: void*/ {\n if (!el) {\n return;\n }\n if (el.attachEvent) {\n el.attachEvent('on' + event, handler);\n } else if (el.addEventListener) {\n el.addEventListener(event, handler, true);\n } else {\n // $FlowIgnore: Doesn't think elements are indexable\n el['on' + event] = handler;\n }\n}\n\nfunction removeEvent(el /*: ?Node*/, event /*: string*/, handler /*: Function*/) /*: void*/ {\n if (!el) {\n return;\n }\n if (el.detachEvent) {\n el.detachEvent('on' + event, handler);\n } else if (el.removeEventListener) {\n el.removeEventListener(event, handler, true);\n } else {\n // $FlowIgnore: Doesn't think elements are indexable\n el['on' + event] = null;\n }\n}\n\nfunction outerHeight(node /*: HTMLElement*/) /*: number*/ {\n // This is deliberately excluding margin for our calculations, since we are using\n // offsetTop which is including margin. See getBoundPosition\n var height = node.clientHeight;\n var computedStyle = node.ownerDocument.defaultView.getComputedStyle(node);\n height += (0, _shims.int)(computedStyle.borderTopWidth);\n height += (0, _shims.int)(computedStyle.borderBottomWidth);\n return height;\n}\n\nfunction outerWidth(node /*: HTMLElement*/) /*: number*/ {\n // This is deliberately excluding margin for our calculations, since we are using\n // offsetLeft which is including margin. See getBoundPosition\n var width = node.clientWidth;\n var computedStyle = node.ownerDocument.defaultView.getComputedStyle(node);\n width += (0, _shims.int)(computedStyle.borderLeftWidth);\n width += (0, _shims.int)(computedStyle.borderRightWidth);\n return width;\n}\nfunction innerHeight(node /*: HTMLElement*/) /*: number*/ {\n var height = node.clientHeight;\n var computedStyle = node.ownerDocument.defaultView.getComputedStyle(node);\n height -= (0, _shims.int)(computedStyle.paddingTop);\n height -= (0, _shims.int)(computedStyle.paddingBottom);\n return height;\n}\n\nfunction innerWidth(node /*: HTMLElement*/) /*: number*/ {\n var width = node.clientWidth;\n var computedStyle = node.ownerDocument.defaultView.getComputedStyle(node);\n width -= (0, _shims.int)(computedStyle.paddingLeft);\n width -= (0, _shims.int)(computedStyle.paddingRight);\n return width;\n}\n\n// Get from offsetParent\nfunction offsetXYFromParent(evt /*: {clientX: number, clientY: number}*/, offsetParent /*: HTMLElement*/) /*: ControlPosition*/ {\n var isBody = offsetParent === offsetParent.ownerDocument.body;\n var offsetParentRect = isBody ? { left: 0, top: 0 } : offsetParent.getBoundingClientRect();\n\n var x = evt.clientX + offsetParent.scrollLeft - offsetParentRect.left;\n var y = evt.clientY + offsetParent.scrollTop - offsetParentRect.top;\n\n return { x: x, y: y };\n}\n\nfunction createCSSTransform(_ref) /*: Object*/ {\n var x = _ref.x,\n y = _ref.y;\n\n // Replace unitless items with px\n return _defineProperty({}, (0, _getPrefix.browserPrefixToKey)('transform', _getPrefix2.default), 'translate(' + x + 'px,' + y + 'px)');\n}\n\nfunction createSVGTransform(_ref3) /*: string*/ {\n var x = _ref3.x,\n y = _ref3.y;\n\n return 'translate(' + x + ',' + y + ')';\n}\n\nfunction getTouch(e /*: MouseTouchEvent*/, identifier /*: number*/) /*: ?{clientX: number, clientY: number}*/ {\n return e.targetTouches && (0, _shims.findInArray)(e.targetTouches, function (t) {\n return identifier === t.identifier;\n }) || e.changedTouches && (0, _shims.findInArray)(e.changedTouches, function (t) {\n return identifier === t.identifier;\n });\n}\n\nfunction getTouchIdentifier(e /*: MouseTouchEvent*/) /*: ?number*/ {\n if (e.targetTouches && e.targetTouches[0]) return e.targetTouches[0].identifier;\n if (e.changedTouches && e.changedTouches[0]) return e.changedTouches[0].identifier;\n}\n\n// User-select Hacks:\n//\n// Useful for preventing blue highlights all over everything when dragging.\n\n// Note we're passing `document` b/c we could be iframed\nfunction addUserSelectStyles(doc /*: ?Document*/) {\n if (!doc) return;\n var styleEl = doc.getElementById('react-draggable-style-el');\n if (!styleEl) {\n styleEl = doc.createElement('style');\n styleEl.type = 'text/css';\n styleEl.id = 'react-draggable-style-el';\n styleEl.innerHTML = '.react-draggable-transparent-selection *::-moz-selection {background: transparent;}\\n';\n styleEl.innerHTML += '.react-draggable-transparent-selection *::selection {background: transparent;}\\n';\n doc.getElementsByTagName('head')[0].appendChild(styleEl);\n }\n if (doc.body) addClassName(doc.body, 'react-draggable-transparent-selection');\n}\n\nfunction removeUserSelectStyles(doc /*: ?Document*/) {\n try {\n if (doc && doc.body) removeClassName(doc.body, 'react-draggable-transparent-selection');\n window.getSelection().removeAllRanges(); // remove selection caused by scroll\n } catch (e) {\n // probably IE\n }\n}\n\nfunction styleHacks() /*: Object*/ {\n var childStyle /*: Object*/ = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n\n // Workaround IE pointer events; see #51\n // https://github.com/mzabriskie/react-draggable/issues/51#issuecomment-103488278\n return _extends({\n touchAction: 'none'\n }, childStyle);\n}\n\nfunction addClassName(el /*: HTMLElement*/, className /*: string*/) {\n if (el.classList) {\n el.classList.add(className);\n } else {\n if (!el.className.match(new RegExp('(?:^|\\\\s)' + className + '(?!\\\\S)'))) {\n el.className += ' ' + className;\n }\n }\n}\n\nfunction removeClassName(el /*: HTMLElement*/, className /*: string*/) {\n if (el.classList) {\n el.classList.remove(className);\n } else {\n el.className = el.className.replace(new RegExp('(?:^|\\\\s)' + className + '(?!\\\\S)', 'g'), '');\n }\n}\n\n/***/ }),\n/* 6 */\n/***/ (function(module, exports) {\n\nmodule.exports = __WEBPACK_EXTERNAL_MODULE_6__;\n\n/***/ }),\n/* 7 */\n/***/ (function(module, exports, __webpack_require__) {\n\n/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nif (Object({\"DRAGGABLE_DEBUG\":undefined}).NODE_ENV !== 'production') {\n var REACT_ELEMENT_TYPE = (typeof Symbol === 'function' &&\n Symbol.for &&\n Symbol.for('react.element')) ||\n 0xeac7;\n\n var isValidElement = function(object) {\n return typeof object === 'object' &&\n object !== null &&\n object.$$typeof === REACT_ELEMENT_TYPE;\n };\n\n // By explicitly using `prop-types` you are opting into new development behavior.\n // http://fb.me/prop-types-in-prod\n var throwOnDirectAccess = true;\n module.exports = __webpack_require__(14)(isValidElement, throwOnDirectAccess);\n} else {\n // By explicitly using `prop-types` you are opting into new production behavior.\n // http://fb.me/prop-types-in-prod\n module.exports = __webpack_require__(17)();\n}\n\n\n/***/ }),\n/* 8 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n/**\n * Copyright (c) 2014-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\n\n\nvar emptyFunction = __webpack_require__(1);\n\n/**\n * Similar to invariant but only logs a warning if the condition is not met.\n * This can be used to log issues in development environments in critical\n * paths. Removing the logging code for production environments will keep the\n * same logic and follow the same code paths.\n */\n\nvar warning = emptyFunction;\n\nif (Object({\"DRAGGABLE_DEBUG\":undefined}).NODE_ENV !== 'production') {\n var printWarning = function printWarning(format) {\n for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n args[_key - 1] = arguments[_key];\n }\n\n var argIndex = 0;\n var message = 'Warning: ' + format.replace(/%s/g, function () {\n return args[argIndex++];\n });\n if (typeof console !== 'undefined') {\n console.error(message);\n }\n try {\n // --- Welcome to debugging React ---\n // This error was thrown as a convenience so that you can use this stack\n // to find the callsite that caused this warning to fire.\n throw new Error(message);\n } catch (x) {}\n };\n\n warning = function warning(condition, format) {\n if (format === undefined) {\n throw new Error('`warning(condition, format, ...args)` requires a warning ' + 'message argument');\n }\n\n if (format.indexOf('Failed Composite propType: ') === 0) {\n return; // Ignore CompositeComponent proptype check.\n }\n\n if (!condition) {\n for (var _len2 = arguments.length, args = Array(_len2 > 2 ? _len2 - 2 : 0), _key2 = 2; _key2 < _len2; _key2++) {\n args[_key2 - 2] = arguments[_key2];\n }\n\n printWarning.apply(undefined, [format].concat(args));\n }\n };\n}\n\nmodule.exports = warning;\n\n/***/ }),\n/* 9 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.getBoundPosition = getBoundPosition;\nexports.snapToGrid = snapToGrid;\nexports.canDragX = canDragX;\nexports.canDragY = canDragY;\nexports.getControlPosition = getControlPosition;\nexports.createCoreData = createCoreData;\nexports.createDraggableData = createDraggableData;\n\nvar _shims = __webpack_require__(0);\n\nvar _reactDom = __webpack_require__(4);\n\nvar _reactDom2 = _interopRequireDefault(_reactDom);\n\nvar _domFns = __webpack_require__(5);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\n/*:: import type Draggable from '../Draggable';*/\n/*:: import type {Bounds, ControlPosition, DraggableData, MouseTouchEvent} from './types';*/\n/*:: import type DraggableCore from '../DraggableCore';*/\nfunction getBoundPosition(draggable /*: Draggable*/, x /*: number*/, y /*: number*/) /*: [number, number]*/ {\n // If no bounds, short-circuit and move on\n if (!draggable.props.bounds) return [x, y];\n\n // Clone new bounds\n var bounds = draggable.props.bounds;\n\n bounds = typeof bounds === 'string' ? bounds : cloneBounds(bounds);\n var node = findDOMNode(draggable);\n\n if (typeof bounds === 'string') {\n var ownerDocument = node.ownerDocument;\n\n var ownerWindow = ownerDocument.defaultView;\n var boundNode = void 0;\n if (bounds === 'parent') {\n boundNode = node.parentNode;\n } else {\n boundNode = ownerDocument.querySelector(bounds);\n }\n if (!(boundNode instanceof HTMLElement)) {\n throw new Error('Bounds selector \"' + bounds + '\" could not find an element.');\n }\n var nodeStyle = ownerWindow.getComputedStyle(node);\n var boundNodeStyle = ownerWindow.getComputedStyle(boundNode);\n // Compute bounds. This is a pain with padding and offsets but this gets it exactly right.\n bounds = {\n left: -node.offsetLeft + (0, _shims.int)(boundNodeStyle.paddingLeft) + (0, _shims.int)(nodeStyle.marginLeft),\n top: -node.offsetTop + (0, _shims.int)(boundNodeStyle.paddingTop) + (0, _shims.int)(nodeStyle.marginTop),\n right: (0, _domFns.innerWidth)(boundNode) - (0, _domFns.outerWidth)(node) - node.offsetLeft + (0, _shims.int)(boundNodeStyle.paddingRight) - (0, _shims.int)(nodeStyle.marginRight),\n bottom: (0, _domFns.innerHeight)(boundNode) - (0, _domFns.outerHeight)(node) - node.offsetTop + (0, _shims.int)(boundNodeStyle.paddingBottom) - (0, _shims.int)(nodeStyle.marginBottom)\n };\n }\n\n // Keep x and y below right and bottom limits...\n if ((0, _shims.isNum)(bounds.right)) x = Math.min(x, bounds.right);\n if ((0, _shims.isNum)(bounds.bottom)) y = Math.min(y, bounds.bottom);\n\n // But above left and top limits.\n if ((0, _shims.isNum)(bounds.left)) x = Math.max(x, bounds.left);\n if ((0, _shims.isNum)(bounds.top)) y = Math.max(y, bounds.top);\n\n return [x, y];\n}\n\nfunction snapToGrid(grid /*: [number, number]*/, pendingX /*: number*/, pendingY /*: number*/) /*: [number, number]*/ {\n var x = Math.round(pendingX / grid[0]) * grid[0];\n var y = Math.round(pendingY / grid[1]) * grid[1];\n return [x, y];\n}\n\nfunction canDragX(draggable /*: Draggable*/) /*: boolean*/ {\n return draggable.props.axis === 'both' || draggable.props.axis === 'x';\n}\n\nfunction canDragY(draggable /*: Draggable*/) /*: boolean*/ {\n return draggable.props.axis === 'both' || draggable.props.axis === 'y';\n}\n\n// Get {x, y} positions from event.\nfunction getControlPosition(e /*: MouseTouchEvent*/, touchIdentifier /*: ?number*/, draggableCore /*: DraggableCore*/) /*: ?ControlPosition*/ {\n var touchObj = typeof touchIdentifier === 'number' ? (0, _domFns.getTouch)(e, touchIdentifier) : null;\n if (typeof touchIdentifier === 'number' && !touchObj) return null; // not the right touch\n var node = findDOMNode(draggableCore);\n // User can provide an offsetParent if desired.\n var offsetParent = draggableCore.props.offsetParent || node.offsetParent || node.ownerDocument.body;\n return (0, _domFns.offsetXYFromParent)(touchObj || e, offsetParent);\n}\n\n// Create an data object exposed by 's events\nfunction createCoreData(draggable /*: DraggableCore*/, x /*: number*/, y /*: number*/) /*: DraggableData*/ {\n var state = draggable.state;\n var isStart = !(0, _shims.isNum)(state.lastX);\n var node = findDOMNode(draggable);\n\n if (isStart) {\n // If this is our first move, use the x and y as last coords.\n return {\n node: node,\n deltaX: 0, deltaY: 0,\n lastX: x, lastY: y,\n x: x, y: y\n };\n } else {\n // Otherwise calculate proper values.\n return {\n node: node,\n deltaX: x - state.lastX, deltaY: y - state.lastY,\n lastX: state.lastX, lastY: state.lastY,\n x: x, y: y\n };\n }\n}\n\n// Create an data exposed by 's events\nfunction createDraggableData(draggable /*: Draggable*/, coreData /*: DraggableData*/) /*: DraggableData*/ {\n return {\n node: coreData.node,\n x: draggable.state.x + coreData.deltaX,\n y: draggable.state.y + coreData.deltaY,\n deltaX: coreData.deltaX,\n deltaY: coreData.deltaY,\n lastX: draggable.state.x,\n lastY: draggable.state.y\n };\n}\n\n// A lot faster than stringify/parse\nfunction cloneBounds(bounds /*: Bounds*/) /*: Bounds*/ {\n return {\n left: bounds.left,\n top: bounds.top,\n right: bounds.right,\n bottom: bounds.bottom\n };\n}\n\nfunction findDOMNode(draggable /*: Draggable | DraggableCore*/) /*: HTMLElement*/ {\n var node = _reactDom2.default.findDOMNode(draggable);\n if (!node) {\n throw new Error(': Unmounted during event!');\n }\n // $FlowIgnore we can't assert on HTMLElement due to tests... FIXME\n return node;\n}\n\n/***/ }),\n/* 10 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n/* WEBPACK VAR INJECTION */(function(process) {\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i[\"return\"]) _i[\"return\"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError(\"Invalid attempt to destructure non-iterable instance\"); } }; }();\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _react = __webpack_require__(6);\n\nvar _react2 = _interopRequireDefault(_react);\n\nvar _propTypes = __webpack_require__(7);\n\nvar _propTypes2 = _interopRequireDefault(_propTypes);\n\nvar _reactDom = __webpack_require__(4);\n\nvar _reactDom2 = _interopRequireDefault(_reactDom);\n\nvar _domFns = __webpack_require__(5);\n\nvar _positionFns = __webpack_require__(9);\n\nvar _shims = __webpack_require__(0);\n\nvar _log = __webpack_require__(11);\n\nvar _log2 = _interopRequireDefault(_log);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\n/*:: import type {EventHandler, MouseTouchEvent} from './utils/types';*/\n\n\n// Simple abstraction for dragging events names.\n/*:: import type {Element as ReactElement} from 'react';*/\nvar eventsFor = {\n touch: {\n start: 'touchstart',\n move: 'touchmove',\n stop: 'touchend'\n },\n mouse: {\n start: 'mousedown',\n move: 'mousemove',\n stop: 'mouseup'\n }\n};\n\n// Default to mouse events.\nvar dragEventFor = eventsFor.mouse;\n\n/*:: type DraggableCoreState = {\n dragging: boolean,\n lastX: number,\n lastY: number,\n touchIdentifier: ?number\n};*/\n/*:: export type DraggableBounds = {\n left: number,\n right: number,\n top: number,\n bottom: number,\n};*/\n/*:: export type DraggableData = {\n node: HTMLElement,\n x: number, y: number,\n deltaX: number, deltaY: number,\n lastX: number, lastY: number,\n};*/\n/*:: export type DraggableEventHandler = (e: MouseEvent, data: DraggableData) => void;*/\n/*:: export type ControlPosition = {x: number, y: number};*/\n\n\n//\n// Define .\n//\n// is for advanced usage of . It maintains minimal internal state so it can\n// work well with libraries that require more control over the element.\n//\n\n/*:: export type DraggableCoreProps = {\n allowAnyClick: boolean,\n cancel: string,\n children: ReactElement,\n disabled: boolean,\n enableUserSelectHack: boolean,\n offsetParent: HTMLElement,\n grid: [number, number],\n handle: string,\n onStart: DraggableEventHandler,\n onDrag: DraggableEventHandler,\n onStop: DraggableEventHandler,\n onMouseDown: (e: MouseEvent) => void,\n};*/\n\nvar DraggableCore = function (_React$Component) {\n _inherits(DraggableCore, _React$Component);\n\n function DraggableCore() {\n var _ref;\n\n var _temp, _this, _ret;\n\n _classCallCheck(this, DraggableCore);\n\n for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n return _ret = (_temp = (_this = _possibleConstructorReturn(this, (_ref = DraggableCore.__proto__ || Object.getPrototypeOf(DraggableCore)).call.apply(_ref, [this].concat(args))), _this), _this.state = {\n dragging: false,\n // Used while dragging to determine deltas.\n lastX: NaN, lastY: NaN,\n touchIdentifier: null\n }, _this.handleDragStart = function (e) {\n // Make it possible to attach event handlers on top of this one.\n _this.props.onMouseDown(e);\n\n // Only accept left-clicks.\n if (!_this.props.allowAnyClick && typeof e.button === 'number' && e.button !== 0) return false;\n\n // Get nodes. Be sure to grab relative document (could be iframed)\n var thisNode = _reactDom2.default.findDOMNode(_this);\n if (!thisNode || !thisNode.ownerDocument || !thisNode.ownerDocument.body) {\n throw new Error(' not mounted on DragStart!');\n }\n var ownerDocument = thisNode.ownerDocument;\n\n // Short circuit if handle or cancel prop was provided and selector doesn't match.\n\n if (_this.props.disabled || !(e.target instanceof ownerDocument.defaultView.Node) || _this.props.handle && !(0, _domFns.matchesSelectorAndParentsTo)(e.target, _this.props.handle, thisNode) || _this.props.cancel && (0, _domFns.matchesSelectorAndParentsTo)(e.target, _this.props.cancel, thisNode)) {\n return;\n }\n\n // Set touch identifier in component state if this is a touch event. This allows us to\n // distinguish between individual touches on multitouch screens by identifying which\n // touchpoint was set to this element.\n var touchIdentifier = (0, _domFns.getTouchIdentifier)(e);\n _this.setState({ touchIdentifier: touchIdentifier });\n\n // Get the current drag point from the event. This is used as the offset.\n var position = (0, _positionFns.getControlPosition)(e, touchIdentifier, _this);\n if (position == null) return; // not possible but satisfies flow\n var x = position.x,\n y = position.y;\n\n // Create an event object with all the data parents need to make a decision here.\n\n var coreEvent = (0, _positionFns.createCoreData)(_this, x, y);\n\n (0, _log2.default)('DraggableCore: handleDragStart: %j', coreEvent);\n\n // Call event handler. If it returns explicit false, cancel.\n (0, _log2.default)('calling', _this.props.onStart);\n var shouldUpdate = _this.props.onStart(e, coreEvent);\n if (shouldUpdate === false) return;\n\n // Add a style to the body to disable user-select. This prevents text from\n // being selected all over the page.\n if (_this.props.enableUserSelectHack) (0, _domFns.addUserSelectStyles)(ownerDocument);\n\n // Initiate dragging. Set the current x and y as offsets\n // so we know how much we've moved during the drag. This allows us\n // to drag elements around even if they have been moved, without issue.\n _this.setState({\n dragging: true,\n\n lastX: x,\n lastY: y\n });\n\n // Add events to the document directly so we catch when the user's mouse/touch moves outside of\n // this element. We use different events depending on whether or not we have detected that this\n // is a touch-capable device.\n (0, _domFns.addEvent)(ownerDocument, dragEventFor.move, _this.handleDrag);\n (0, _domFns.addEvent)(ownerDocument, dragEventFor.stop, _this.handleDragStop);\n }, _this.handleDrag = function (e) {\n\n // Prevent scrolling on mobile devices, like ipad/iphone.\n if (e.type === 'touchmove') e.preventDefault();\n\n // Get the current drag point from the event. This is used as the offset.\n var position = (0, _positionFns.getControlPosition)(e, _this.state.touchIdentifier, _this);\n if (position == null) return;\n var x = position.x,\n y = position.y;\n\n // Snap to grid if prop has been provided\n\n if (Array.isArray(_this.props.grid)) {\n var _deltaX = x - _this.state.lastX,\n _deltaY = y - _this.state.lastY;\n\n var _snapToGrid = (0, _positionFns.snapToGrid)(_this.props.grid, _deltaX, _deltaY);\n\n var _snapToGrid2 = _slicedToArray(_snapToGrid, 2);\n\n _deltaX = _snapToGrid2[0];\n _deltaY = _snapToGrid2[1];\n\n if (!_deltaX && !_deltaY) return; // skip useless drag\n x = _this.state.lastX + _deltaX, y = _this.state.lastY + _deltaY;\n }\n\n var coreEvent = (0, _positionFns.createCoreData)(_this, x, y);\n\n (0, _log2.default)('DraggableCore: handleDrag: %j', coreEvent);\n\n // Call event handler. If it returns explicit false, trigger end.\n var shouldUpdate = _this.props.onDrag(e, coreEvent);\n if (shouldUpdate === false) {\n try {\n // $FlowIgnore\n _this.handleDragStop(new MouseEvent('mouseup'));\n } catch (err) {\n // Old browsers\n var event = ((document.createEvent('MouseEvents') /*: any*/) /*: MouseTouchEvent*/);\n // I see why this insanity was deprecated\n // $FlowIgnore\n event.initMouseEvent('mouseup', true, true, window, 0, 0, 0, 0, 0, false, false, false, false, 0, null);\n _this.handleDragStop(event);\n }\n return;\n }\n\n _this.setState({\n lastX: x,\n lastY: y\n });\n }, _this.handleDragStop = function (e) {\n if (!_this.state.dragging) return;\n\n var position = (0, _positionFns.getControlPosition)(e, _this.state.touchIdentifier, _this);\n if (position == null) return;\n var x = position.x,\n y = position.y;\n\n var coreEvent = (0, _positionFns.createCoreData)(_this, x, y);\n\n var thisNode = _reactDom2.default.findDOMNode(_this);\n if (thisNode) {\n // Remove user-select hack\n if (_this.props.enableUserSelectHack) (0, _domFns.removeUserSelectStyles)(thisNode.ownerDocument);\n }\n\n (0, _log2.default)('DraggableCore: handleDragStop: %j', coreEvent);\n\n // Reset the el.\n _this.setState({\n dragging: false,\n lastX: NaN,\n lastY: NaN\n });\n\n // Call event handler\n _this.props.onStop(e, coreEvent);\n\n if (thisNode) {\n // Remove event handlers\n (0, _log2.default)('DraggableCore: Removing handlers');\n (0, _domFns.removeEvent)(thisNode.ownerDocument, dragEventFor.move, _this.handleDrag);\n (0, _domFns.removeEvent)(thisNode.ownerDocument, dragEventFor.stop, _this.handleDragStop);\n }\n }, _this.onMouseDown = function (e) {\n dragEventFor = eventsFor.mouse; // on touchscreen laptops we could switch back to mouse\n\n return _this.handleDragStart(e);\n }, _this.onMouseUp = function (e) {\n dragEventFor = eventsFor.mouse;\n\n return _this.handleDragStop(e);\n }, _this.onTouchStart = function (e) {\n // We're on a touch device now, so change the event handlers\n dragEventFor = eventsFor.touch;\n\n return _this.handleDragStart(e);\n }, _this.onTouchEnd = function (e) {\n // We're on a touch device now, so change the event handlers\n dragEventFor = eventsFor.touch;\n\n return _this.handleDragStop(e);\n }, _temp), _possibleConstructorReturn(_this, _ret);\n }\n\n _createClass(DraggableCore, [{\n key: 'componentWillUnmount',\n value: function componentWillUnmount() {\n // Remove any leftover event handlers. Remove both touch and mouse handlers in case\n // some browser quirk caused a touch event to fire during a mouse move, or vice versa.\n var thisNode = _reactDom2.default.findDOMNode(this);\n if (thisNode) {\n var ownerDocument = thisNode.ownerDocument;\n\n (0, _domFns.removeEvent)(ownerDocument, eventsFor.mouse.move, this.handleDrag);\n (0, _domFns.removeEvent)(ownerDocument, eventsFor.touch.move, this.handleDrag);\n (0, _domFns.removeEvent)(ownerDocument, eventsFor.mouse.stop, this.handleDragStop);\n (0, _domFns.removeEvent)(ownerDocument, eventsFor.touch.stop, this.handleDragStop);\n if (this.props.enableUserSelectHack) (0, _domFns.removeUserSelectStyles)(ownerDocument);\n }\n }\n\n // Same as onMouseDown (start drag), but now consider this a touch device.\n\n }, {\n key: 'render',\n value: function render() {\n // Reuse the child provided\n // This makes it flexible to use whatever element is wanted (div, ul, etc)\n return _react2.default.cloneElement(_react2.default.Children.only(this.props.children), {\n style: (0, _domFns.styleHacks)(this.props.children.props.style),\n\n // Note: mouseMove handler is attached to document so it will still function\n // when the user drags quickly and leaves the bounds of the element.\n onMouseDown: this.onMouseDown,\n onTouchStart: this.onTouchStart,\n onMouseUp: this.onMouseUp,\n onTouchEnd: this.onTouchEnd\n });\n }\n }]);\n\n return DraggableCore;\n}(_react2.default.Component);\n\nDraggableCore.displayName = 'DraggableCore';\nDraggableCore.propTypes = {\n /**\n * `allowAnyClick` allows dragging using any mouse button.\n * By default, we only accept the left button.\n *\n * Defaults to `false`.\n */\n allowAnyClick: _propTypes2.default.bool,\n\n /**\n * `disabled`, if true, stops the from dragging. All handlers,\n * with the exception of `onMouseDown`, will not fire.\n */\n disabled: _propTypes2.default.bool,\n\n /**\n * By default, we add 'user-select:none' attributes to the document body\n * to prevent ugly text selection during drag. If this is causing problems\n * for your app, set this to `false`.\n */\n enableUserSelectHack: _propTypes2.default.bool,\n\n /**\n * `offsetParent`, if set, uses the passed DOM node to compute drag offsets\n * instead of using the parent node.\n */\n offsetParent: function offsetParent(props /*: DraggableCoreProps*/, propName /*: $Keys*/) {\n if (process.browser === true && props[propName] && props[propName].nodeType !== 1) {\n throw new Error('Draggable\\'s offsetParent must be a DOM Node.');\n }\n },\n\n /**\n * `grid` specifies the x and y that dragging should snap to.\n */\n grid: _propTypes2.default.arrayOf(_propTypes2.default.number),\n\n /**\n * `handle` specifies a selector to be used as the handle that initiates drag.\n *\n * Example:\n *\n * ```jsx\n * let App = React.createClass({\n * render: function () {\n * return (\n * \n *
\n *
Click me to drag
\n *
This is some other content
\n *
\n *
\n * );\n * }\n * });\n * ```\n */\n handle: _propTypes2.default.string,\n\n /**\n * `cancel` specifies a selector to be used to prevent drag initialization.\n *\n * Example:\n *\n * ```jsx\n * let App = React.createClass({\n * render: function () {\n * return(\n * \n *
\n *
You can't drag from here
\n *
Dragging here works fine
\n *
\n *
\n * );\n * }\n * });\n * ```\n */\n cancel: _propTypes2.default.string,\n\n /**\n * Called when dragging starts.\n * If this function returns the boolean false, dragging will be canceled.\n */\n onStart: _propTypes2.default.func,\n\n /**\n * Called while dragging.\n * If this function returns the boolean false, dragging will be canceled.\n */\n onDrag: _propTypes2.default.func,\n\n /**\n * Called when dragging stops.\n * If this function returns the boolean false, the drag will remain active.\n */\n onStop: _propTypes2.default.func,\n\n /**\n * A workaround option which can be passed if onMouseDown needs to be accessed,\n * since it'll always be blocked (as there is internal use of onMouseDown)\n */\n onMouseDown: _propTypes2.default.func,\n\n /**\n * These properties should be defined on the child, not here.\n */\n className: _shims.dontSetMe,\n style: _shims.dontSetMe,\n transform: _shims.dontSetMe\n};\nDraggableCore.defaultProps = {\n allowAnyClick: false, // by default only accept left click\n cancel: null,\n disabled: false,\n enableUserSelectHack: true,\n offsetParent: null,\n handle: null,\n grid: null,\n transform: null,\n onStart: function onStart() {},\n onDrag: function onDrag() {},\n onStop: function onStop() {},\n onMouseDown: function onMouseDown() {}\n};\nexports.default = DraggableCore;\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(20)))\n\n/***/ }),\n/* 11 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = log;\n\n/*eslint no-console:0*/\nfunction log() {\n var _console;\n\n if (undefined) (_console = console).log.apply(_console, arguments);\n}\n\n/***/ }),\n/* 12 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nvar Draggable = __webpack_require__(13).default;\n\n// Previous versions of this lib exported as the root export. As to not break\n// them, or TypeScript, we export *both* as the root and as 'default'.\n// See https://github.com/mzabriskie/react-draggable/pull/254\n// and https://github.com/mzabriskie/react-draggable/issues/266\nmodule.exports = Draggable;\nmodule.exports.default = Draggable;\nmodule.exports.DraggableCore = __webpack_require__(10).default;\n\n/***/ }),\n/* 13 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };\n\nvar _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i[\"return\"]) _i[\"return\"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError(\"Invalid attempt to destructure non-iterable instance\"); } }; }();\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _react = __webpack_require__(6);\n\nvar _react2 = _interopRequireDefault(_react);\n\nvar _propTypes = __webpack_require__(7);\n\nvar _propTypes2 = _interopRequireDefault(_propTypes);\n\nvar _reactDom = __webpack_require__(4);\n\nvar _reactDom2 = _interopRequireDefault(_reactDom);\n\nvar _classnames = __webpack_require__(18);\n\nvar _classnames2 = _interopRequireDefault(_classnames);\n\nvar _domFns = __webpack_require__(5);\n\nvar _positionFns = __webpack_require__(9);\n\nvar _shims = __webpack_require__(0);\n\nvar _DraggableCore = __webpack_require__(10);\n\nvar _DraggableCore2 = _interopRequireDefault(_DraggableCore);\n\nvar _log = __webpack_require__(11);\n\nvar _log2 = _interopRequireDefault(_log);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\n/*:: import type {ControlPosition, DraggableBounds, DraggableCoreProps} from './DraggableCore';*/\n/*:: import type {DraggableEventHandler} from './utils/types';*/\n/*:: import type {Element as ReactElement} from 'react';*/\n/*:: type DraggableState = {\n dragging: boolean,\n dragged: boolean,\n x: number, y: number,\n slackX: number, slackY: number,\n isElementSVG: boolean\n};*/\n\n\n//\n// Define \n//\n\n/*:: export type DraggableProps = {\n ...$Exact,\n axis: 'both' | 'x' | 'y' | 'none',\n bounds: DraggableBounds | string | false,\n defaultClassName: string,\n defaultClassNameDragging: string,\n defaultClassNameDragged: string,\n defaultPosition: ControlPosition,\n position: ControlPosition,\n};*/\n\nvar Draggable = function (_React$Component) {\n _inherits(Draggable, _React$Component);\n\n function Draggable(props /*: DraggableProps*/) {\n _classCallCheck(this, Draggable);\n\n var _this = _possibleConstructorReturn(this, (Draggable.__proto__ || Object.getPrototypeOf(Draggable)).call(this, props));\n\n _this.onDragStart = function (e, coreData) {\n (0, _log2.default)('Draggable: onDragStart: %j', coreData);\n\n // Short-circuit if user's callback killed it.\n var shouldStart = _this.props.onStart(e, (0, _positionFns.createDraggableData)(_this, coreData));\n // Kills start event on core as well, so move handlers are never bound.\n if (shouldStart === false) return false;\n\n _this.setState({ dragging: true, dragged: true });\n };\n\n _this.onDrag = function (e, coreData) {\n if (!_this.state.dragging) return false;\n (0, _log2.default)('Draggable: onDrag: %j', coreData);\n\n var uiData = (0, _positionFns.createDraggableData)(_this, coreData);\n\n var newState /*: $Shape*/ = {\n x: uiData.x,\n y: uiData.y\n };\n\n // Keep within bounds.\n if (_this.props.bounds) {\n // Save original x and y.\n var _x = newState.x,\n _y = newState.y;\n\n // Add slack to the values used to calculate bound position. This will ensure that if\n // we start removing slack, the element won't react to it right away until it's been\n // completely removed.\n\n newState.x += _this.state.slackX;\n newState.y += _this.state.slackY;\n\n // Get bound position. This will ceil/floor the x and y within the boundaries.\n\n var _getBoundPosition = (0, _positionFns.getBoundPosition)(_this, newState.x, newState.y),\n _getBoundPosition2 = _slicedToArray(_getBoundPosition, 2),\n newStateX = _getBoundPosition2[0],\n newStateY = _getBoundPosition2[1];\n\n newState.x = newStateX;\n newState.y = newStateY;\n\n // Recalculate slack by noting how much was shaved by the boundPosition handler.\n newState.slackX = _this.state.slackX + (_x - newState.x);\n newState.slackY = _this.state.slackY + (_y - newState.y);\n\n // Update the event we fire to reflect what really happened after bounds took effect.\n uiData.x = newState.x;\n uiData.y = newState.y;\n uiData.deltaX = newState.x - _this.state.x;\n uiData.deltaY = newState.y - _this.state.y;\n }\n\n // Short-circuit if user's callback killed it.\n var shouldUpdate = _this.props.onDrag(e, uiData);\n if (shouldUpdate === false) return false;\n\n _this.setState(newState);\n };\n\n _this.onDragStop = function (e, coreData) {\n if (!_this.state.dragging) return false;\n\n // Short-circuit if user's callback killed it.\n var shouldStop = _this.props.onStop(e, (0, _positionFns.createDraggableData)(_this, coreData));\n if (shouldStop === false) return false;\n\n (0, _log2.default)('Draggable: onDragStop: %j', coreData);\n\n var newState /*: $Shape*/ = {\n dragging: false,\n slackX: 0,\n slackY: 0\n };\n\n // If this is a controlled component, the result of this operation will be to\n // revert back to the old position. We expect a handler on `onDragStop`, at the least.\n var controlled = Boolean(_this.props.position);\n if (controlled) {\n var _this$props$position = _this.props.position,\n _x2 = _this$props$position.x,\n _y2 = _this$props$position.y;\n\n newState.x = _x2;\n newState.y = _y2;\n }\n\n _this.setState(newState);\n };\n\n _this.state = {\n // Whether or not we are currently dragging.\n dragging: false,\n\n // Whether or not we have been dragged before.\n dragged: false,\n\n // Current transform x and y.\n x: props.position ? props.position.x : props.defaultPosition.x,\n y: props.position ? props.position.y : props.defaultPosition.y,\n\n // Used for compensating for out-of-bounds drags\n slackX: 0, slackY: 0,\n\n // Can only determine if SVG after mounting\n isElementSVG: false\n };\n return _this;\n }\n\n _createClass(Draggable, [{\n key: 'componentWillMount',\n value: function componentWillMount() {\n if (this.props.position && !(this.props.onDrag || this.props.onStop)) {\n // eslint-disable-next-line\n console.warn('A `position` was applied to this , without drag handlers. This will make this ' + 'component effectively undraggable. Please attach `onDrag` or `onStop` handlers so you can adjust the ' + '`position` of this element.');\n }\n }\n }, {\n key: 'componentDidMount',\n value: function componentDidMount() {\n // Check to see if the element passed is an instanceof SVGElement\n if (typeof window.SVGElement !== 'undefined' && _reactDom2.default.findDOMNode(this) instanceof window.SVGElement) {\n this.setState({ isElementSVG: true });\n }\n }\n }, {\n key: 'componentWillReceiveProps',\n value: function componentWillReceiveProps(nextProps /*: Object*/) {\n // Set x/y if position has changed\n if (nextProps.position && (!this.props.position || nextProps.position.x !== this.props.position.x || nextProps.position.y !== this.props.position.y)) {\n this.setState({ x: nextProps.position.x, y: nextProps.position.y });\n }\n }\n }, {\n key: 'componentWillUnmount',\n value: function componentWillUnmount() {\n this.setState({ dragging: false }); // prevents invariant if unmounted while dragging\n }\n }, {\n key: 'render',\n value: function render() /*: ReactElement*/ {\n var _classNames;\n\n var style = {},\n svgTransform = null;\n\n // If this is controlled, we don't want to move it - unless it's dragging.\n var controlled = Boolean(this.props.position);\n var draggable = !controlled || this.state.dragging;\n\n var position = this.props.position || this.props.defaultPosition;\n var transformOpts = {\n // Set left if horizontal drag is enabled\n x: (0, _positionFns.canDragX)(this) && draggable ? this.state.x : position.x,\n\n // Set top if vertical drag is enabled\n y: (0, _positionFns.canDragY)(this) && draggable ? this.state.y : position.y\n };\n\n // If this element was SVG, we use the `transform` attribute.\n if (this.state.isElementSVG) {\n svgTransform = (0, _domFns.createSVGTransform)(transformOpts);\n } else {\n // Add a CSS transform to move the element around. This allows us to move the element around\n // without worrying about whether or not it is relatively or absolutely positioned.\n // If the item you are dragging already has a transform set, wrap it in a so \n // has a clean slate.\n style = (0, _domFns.createCSSTransform)(transformOpts);\n }\n\n var _props = this.props,\n defaultClassName = _props.defaultClassName,\n defaultClassNameDragging = _props.defaultClassNameDragging,\n defaultClassNameDragged = _props.defaultClassNameDragged;\n\n\n var children = _react2.default.Children.only(this.props.children);\n\n // Mark with class while dragging\n var className = (0, _classnames2.default)(children.props.className || '', defaultClassName, (_classNames = {}, _defineProperty(_classNames, defaultClassNameDragging, this.state.dragging), _defineProperty(_classNames, defaultClassNameDragged, this.state.dragged), _classNames));\n\n // Reuse the child provided\n // This makes it flexible to use whatever element is wanted (div, ul, etc)\n return _react2.default.createElement(\n _DraggableCore2.default,\n _extends({}, this.props, { onStart: this.onDragStart, onDrag: this.onDrag, onStop: this.onDragStop }),\n _react2.default.cloneElement(children, {\n className: className,\n style: _extends({}, children.props.style, style),\n transform: svgTransform\n })\n );\n }\n }]);\n\n return Draggable;\n}(_react2.default.Component);\n\nDraggable.displayName = 'Draggable';\nDraggable.propTypes = _extends({}, _DraggableCore2.default.propTypes, {\n\n /**\n * `axis` determines which axis the draggable can move.\n *\n * Note that all callbacks will still return data as normal. This only\n * controls flushing to the DOM.\n *\n * 'both' allows movement horizontally and vertically.\n * 'x' limits movement to horizontal axis.\n * 'y' limits movement to vertical axis.\n * 'none' limits all movement.\n *\n * Defaults to 'both'.\n */\n axis: _propTypes2.default.oneOf(['both', 'x', 'y', 'none']),\n\n /**\n * `bounds` determines the range of movement available to the element.\n * Available values are:\n *\n * 'parent' restricts movement within the Draggable's parent node.\n *\n * Alternatively, pass an object with the following properties, all of which are optional:\n *\n * {left: LEFT_BOUND, right: RIGHT_BOUND, bottom: BOTTOM_BOUND, top: TOP_BOUND}\n *\n * All values are in px.\n *\n * Example:\n *\n * ```jsx\n * let App = React.createClass({\n * render: function () {\n * return (\n * \n *
Content
\n *
\n * );\n * }\n * });\n * ```\n */\n bounds: _propTypes2.default.oneOfType([_propTypes2.default.shape({\n left: _propTypes2.default.number,\n right: _propTypes2.default.number,\n top: _propTypes2.default.number,\n bottom: _propTypes2.default.number\n }), _propTypes2.default.string, _propTypes2.default.oneOf([false])]),\n\n defaultClassName: _propTypes2.default.string,\n defaultClassNameDragging: _propTypes2.default.string,\n defaultClassNameDragged: _propTypes2.default.string,\n\n /**\n * `defaultPosition` specifies the x and y that the dragged item should start at\n *\n * Example:\n *\n * ```jsx\n * let App = React.createClass({\n * render: function () {\n * return (\n * \n *
I start with transformX: 25px and transformY: 25px;
\n *
\n * );\n * }\n * });\n * ```\n */\n defaultPosition: _propTypes2.default.shape({\n x: _propTypes2.default.number,\n y: _propTypes2.default.number\n }),\n\n /**\n * `position`, if present, defines the current position of the element.\n *\n * This is similar to how form elements in React work - if no `position` is supplied, the component\n * is uncontrolled.\n *\n * Example:\n *\n * ```jsx\n * let App = React.createClass({\n * render: function () {\n * return (\n * \n *
I start with transformX: 25px and transformY: 25px;
\n *
\n * );\n * }\n * });\n * ```\n */\n position: _propTypes2.default.shape({\n x: _propTypes2.default.number,\n y: _propTypes2.default.number\n }),\n\n /**\n * These properties should be defined on the child, not here.\n */\n className: _shims.dontSetMe,\n style: _shims.dontSetMe,\n transform: _shims.dontSetMe\n});\nDraggable.defaultProps = _extends({}, _DraggableCore2.default.defaultProps, {\n axis: 'both',\n bounds: false,\n defaultClassName: 'react-draggable',\n defaultClassNameDragging: 'react-draggable-dragging',\n defaultClassNameDragged: 'react-draggable-dragged',\n defaultPosition: { x: 0, y: 0 },\n position: null\n});\nexports.default = Draggable;\n\n/***/ }),\n/* 14 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n\n\nvar emptyFunction = __webpack_require__(1);\nvar invariant = __webpack_require__(2);\nvar warning = __webpack_require__(8);\nvar assign = __webpack_require__(15);\n\nvar ReactPropTypesSecret = __webpack_require__(3);\nvar checkPropTypes = __webpack_require__(16);\n\nmodule.exports = function(isValidElement, throwOnDirectAccess) {\n /* global Symbol */\n var ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator;\n var FAUX_ITERATOR_SYMBOL = '@@iterator'; // Before Symbol spec.\n\n /**\n * Returns the iterator method function contained on the iterable object.\n *\n * Be sure to invoke the function with the iterable as context:\n *\n * var iteratorFn = getIteratorFn(myIterable);\n * if (iteratorFn) {\n * var iterator = iteratorFn.call(myIterable);\n * ...\n * }\n *\n * @param {?object} maybeIterable\n * @return {?function}\n */\n function getIteratorFn(maybeIterable) {\n var iteratorFn = maybeIterable && (ITERATOR_SYMBOL && maybeIterable[ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL]);\n if (typeof iteratorFn === 'function') {\n return iteratorFn;\n }\n }\n\n /**\n * Collection of methods that allow declaration and validation of props that are\n * supplied to React components. Example usage:\n *\n * var Props = require('ReactPropTypes');\n * var MyArticle = React.createClass({\n * propTypes: {\n * // An optional string prop named \"description\".\n * description: Props.string,\n *\n * // A required enum prop named \"category\".\n * category: Props.oneOf(['News','Photos']).isRequired,\n *\n * // A prop named \"dialog\" that requires an instance of Dialog.\n * dialog: Props.instanceOf(Dialog).isRequired\n * },\n * render: function() { ... }\n * });\n *\n * A more formal specification of how these methods are used:\n *\n * type := array|bool|func|object|number|string|oneOf([...])|instanceOf(...)\n * decl := ReactPropTypes.{type}(.isRequired)?\n *\n * Each and every declaration produces a function with the same signature. This\n * allows the creation of custom validation functions. For example:\n *\n * var MyLink = React.createClass({\n * propTypes: {\n * // An optional string or URI prop named \"href\".\n * href: function(props, propName, componentName) {\n * var propValue = props[propName];\n * if (propValue != null && typeof propValue !== 'string' &&\n * !(propValue instanceof URI)) {\n * return new Error(\n * 'Expected a string or an URI for ' + propName + ' in ' +\n * componentName\n * );\n * }\n * }\n * },\n * render: function() {...}\n * });\n *\n * @internal\n */\n\n var ANONYMOUS = '<>';\n\n // Important!\n // Keep this list in sync with production version in `./factoryWithThrowingShims.js`.\n var ReactPropTypes = {\n array: createPrimitiveTypeChecker('array'),\n bool: createPrimitiveTypeChecker('boolean'),\n func: createPrimitiveTypeChecker('function'),\n number: createPrimitiveTypeChecker('number'),\n object: createPrimitiveTypeChecker('object'),\n string: createPrimitiveTypeChecker('string'),\n symbol: createPrimitiveTypeChecker('symbol'),\n\n any: createAnyTypeChecker(),\n arrayOf: createArrayOfTypeChecker,\n element: createElementTypeChecker(),\n instanceOf: createInstanceTypeChecker,\n node: createNodeChecker(),\n objectOf: createObjectOfTypeChecker,\n oneOf: createEnumTypeChecker,\n oneOfType: createUnionTypeChecker,\n shape: createShapeTypeChecker,\n exact: createStrictShapeTypeChecker,\n };\n\n /**\n * inlined Object.is polyfill to avoid requiring consumers ship their own\n * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is\n */\n /*eslint-disable no-self-compare*/\n function is(x, y) {\n // SameValue algorithm\n if (x === y) {\n // Steps 1-5, 7-10\n // Steps 6.b-6.e: +0 != -0\n return x !== 0 || 1 / x === 1 / y;\n } else {\n // Step 6.a: NaN == NaN\n return x !== x && y !== y;\n }\n }\n /*eslint-enable no-self-compare*/\n\n /**\n * We use an Error-like object for backward compatibility as people may call\n * PropTypes directly and inspect their output. However, we don't use real\n * Errors anymore. We don't inspect their stack anyway, and creating them\n * is prohibitively expensive if they are created too often, such as what\n * happens in oneOfType() for any type before the one that matched.\n */\n function PropTypeError(message) {\n this.message = message;\n this.stack = '';\n }\n // Make `instanceof Error` still work for returned errors.\n PropTypeError.prototype = Error.prototype;\n\n function createChainableTypeChecker(validate) {\n if (Object({\"DRAGGABLE_DEBUG\":undefined}).NODE_ENV !== 'production') {\n var manualPropTypeCallCache = {};\n var manualPropTypeWarningCount = 0;\n }\n function checkType(isRequired, props, propName, componentName, location, propFullName, secret) {\n componentName = componentName || ANONYMOUS;\n propFullName = propFullName || propName;\n\n if (secret !== ReactPropTypesSecret) {\n if (throwOnDirectAccess) {\n // New behavior only for users of `prop-types` package\n invariant(\n false,\n 'Calling PropTypes validators directly is not supported by the `prop-types` package. ' +\n 'Use `PropTypes.checkPropTypes()` to call them. ' +\n 'Read more at http://fb.me/use-check-prop-types'\n );\n } else if (Object({\"DRAGGABLE_DEBUG\":undefined}).NODE_ENV !== 'production' && typeof console !== 'undefined') {\n // Old behavior for people using React.PropTypes\n var cacheKey = componentName + ':' + propName;\n if (\n !manualPropTypeCallCache[cacheKey] &&\n // Avoid spamming the console because they are often not actionable except for lib authors\n manualPropTypeWarningCount < 3\n ) {\n warning(\n false,\n 'You are manually calling a React.PropTypes validation ' +\n 'function for the `%s` prop on `%s`. This is deprecated ' +\n 'and will throw in the standalone `prop-types` package. ' +\n 'You may be seeing this warning due to a third-party PropTypes ' +\n 'library. See https://fb.me/react-warning-dont-call-proptypes ' + 'for details.',\n propFullName,\n componentName\n );\n manualPropTypeCallCache[cacheKey] = true;\n manualPropTypeWarningCount++;\n }\n }\n }\n if (props[propName] == null) {\n if (isRequired) {\n if (props[propName] === null) {\n return new PropTypeError('The ' + location + ' `' + propFullName + '` is marked as required ' + ('in `' + componentName + '`, but its value is `null`.'));\n }\n return new PropTypeError('The ' + location + ' `' + propFullName + '` is marked as required in ' + ('`' + componentName + '`, but its value is `undefined`.'));\n }\n return null;\n } else {\n return validate(props, propName, componentName, location, propFullName);\n }\n }\n\n var chainedCheckType = checkType.bind(null, false);\n chainedCheckType.isRequired = checkType.bind(null, true);\n\n return chainedCheckType;\n }\n\n function createPrimitiveTypeChecker(expectedType) {\n function validate(props, propName, componentName, location, propFullName, secret) {\n var propValue = props[propName];\n var propType = getPropType(propValue);\n if (propType !== expectedType) {\n // `propValue` being instance of, say, date/regexp, pass the 'object'\n // check, but we can offer a more precise error message here rather than\n // 'of type `object`'.\n var preciseType = getPreciseType(propValue);\n\n return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + preciseType + '` supplied to `' + componentName + '`, expected ') + ('`' + expectedType + '`.'));\n }\n return null;\n }\n return createChainableTypeChecker(validate);\n }\n\n function createAnyTypeChecker() {\n return createChainableTypeChecker(emptyFunction.thatReturnsNull);\n }\n\n function createArrayOfTypeChecker(typeChecker) {\n function validate(props, propName, componentName, location, propFullName) {\n if (typeof typeChecker !== 'function') {\n return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside arrayOf.');\n }\n var propValue = props[propName];\n if (!Array.isArray(propValue)) {\n var propType = getPropType(propValue);\n return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an array.'));\n }\n for (var i = 0; i < propValue.length; i++) {\n var error = typeChecker(propValue, i, componentName, location, propFullName + '[' + i + ']', ReactPropTypesSecret);\n if (error instanceof Error) {\n return error;\n }\n }\n return null;\n }\n return createChainableTypeChecker(validate);\n }\n\n function createElementTypeChecker() {\n function validate(props, propName, componentName, location, propFullName) {\n var propValue = props[propName];\n if (!isValidElement(propValue)) {\n var propType = getPropType(propValue);\n return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected a single ReactElement.'));\n }\n return null;\n }\n return createChainableTypeChecker(validate);\n }\n\n function createInstanceTypeChecker(expectedClass) {\n function validate(props, propName, componentName, location, propFullName) {\n if (!(props[propName] instanceof expectedClass)) {\n var expectedClassName = expectedClass.name || ANONYMOUS;\n var actualClassName = getClassName(props[propName]);\n return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + actualClassName + '` supplied to `' + componentName + '`, expected ') + ('instance of `' + expectedClassName + '`.'));\n }\n return null;\n }\n return createChainableTypeChecker(validate);\n }\n\n function createEnumTypeChecker(expectedValues) {\n if (!Array.isArray(expectedValues)) {\n Object({\"DRAGGABLE_DEBUG\":undefined}).NODE_ENV !== 'production' ? warning(false, 'Invalid argument supplied to oneOf, expected an instance of array.') : void 0;\n return emptyFunction.thatReturnsNull;\n }\n\n function validate(props, propName, componentName, location, propFullName) {\n var propValue = props[propName];\n for (var i = 0; i < expectedValues.length; i++) {\n if (is(propValue, expectedValues[i])) {\n return null;\n }\n }\n\n var valuesString = JSON.stringify(expectedValues);\n return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of value `' + propValue + '` ' + ('supplied to `' + componentName + '`, expected one of ' + valuesString + '.'));\n }\n return createChainableTypeChecker(validate);\n }\n\n function createObjectOfTypeChecker(typeChecker) {\n function validate(props, propName, componentName, location, propFullName) {\n if (typeof typeChecker !== 'function') {\n return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside objectOf.');\n }\n var propValue = props[propName];\n var propType = getPropType(propValue);\n if (propType !== 'object') {\n return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an object.'));\n }\n for (var key in propValue) {\n if (propValue.hasOwnProperty(key)) {\n var error = typeChecker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret);\n if (error instanceof Error) {\n return error;\n }\n }\n }\n return null;\n }\n return createChainableTypeChecker(validate);\n }\n\n function createUnionTypeChecker(arrayOfTypeCheckers) {\n if (!Array.isArray(arrayOfTypeCheckers)) {\n Object({\"DRAGGABLE_DEBUG\":undefined}).NODE_ENV !== 'production' ? warning(false, 'Invalid argument supplied to oneOfType, expected an instance of array.') : void 0;\n return emptyFunction.thatReturnsNull;\n }\n\n for (var i = 0; i < arrayOfTypeCheckers.length; i++) {\n var checker = arrayOfTypeCheckers[i];\n if (typeof checker !== 'function') {\n warning(\n false,\n 'Invalid argument supplied to oneOfType. Expected an array of check functions, but ' +\n 'received %s at index %s.',\n getPostfixForTypeWarning(checker),\n i\n );\n return emptyFunction.thatReturnsNull;\n }\n }\n\n function validate(props, propName, componentName, location, propFullName) {\n for (var i = 0; i < arrayOfTypeCheckers.length; i++) {\n var checker = arrayOfTypeCheckers[i];\n if (checker(props, propName, componentName, location, propFullName, ReactPropTypesSecret) == null) {\n return null;\n }\n }\n\n return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`.'));\n }\n return createChainableTypeChecker(validate);\n }\n\n function createNodeChecker() {\n function validate(props, propName, componentName, location, propFullName) {\n if (!isNode(props[propName])) {\n return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`, expected a ReactNode.'));\n }\n return null;\n }\n return createChainableTypeChecker(validate);\n }\n\n function createShapeTypeChecker(shapeTypes) {\n function validate(props, propName, componentName, location, propFullName) {\n var propValue = props[propName];\n var propType = getPropType(propValue);\n if (propType !== 'object') {\n return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type `' + propType + '` ' + ('supplied to `' + componentName + '`, expected `object`.'));\n }\n for (var key in shapeTypes) {\n var checker = shapeTypes[key];\n if (!checker) {\n continue;\n }\n var error = checker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret);\n if (error) {\n return error;\n }\n }\n return null;\n }\n return createChainableTypeChecker(validate);\n }\n\n function createStrictShapeTypeChecker(shapeTypes) {\n function validate(props, propName, componentName, location, propFullName) {\n var propValue = props[propName];\n var propType = getPropType(propValue);\n if (propType !== 'object') {\n return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type `' + propType + '` ' + ('supplied to `' + componentName + '`, expected `object`.'));\n }\n // We need to check all keys in case some are required but missing from\n // props.\n var allKeys = assign({}, props[propName], shapeTypes);\n for (var key in allKeys) {\n var checker = shapeTypes[key];\n if (!checker) {\n return new PropTypeError(\n 'Invalid ' + location + ' `' + propFullName + '` key `' + key + '` supplied to `' + componentName + '`.' +\n '\\nBad object: ' + JSON.stringify(props[propName], null, ' ') +\n '\\nValid keys: ' + JSON.stringify(Object.keys(shapeTypes), null, ' ')\n );\n }\n var error = checker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret);\n if (error) {\n return error;\n }\n }\n return null;\n }\n\n return createChainableTypeChecker(validate);\n }\n\n function isNode(propValue) {\n switch (typeof propValue) {\n case 'number':\n case 'string':\n case 'undefined':\n return true;\n case 'boolean':\n return !propValue;\n case 'object':\n if (Array.isArray(propValue)) {\n return propValue.every(isNode);\n }\n if (propValue === null || isValidElement(propValue)) {\n return true;\n }\n\n var iteratorFn = getIteratorFn(propValue);\n if (iteratorFn) {\n var iterator = iteratorFn.call(propValue);\n var step;\n if (iteratorFn !== propValue.entries) {\n while (!(step = iterator.next()).done) {\n if (!isNode(step.value)) {\n return false;\n }\n }\n } else {\n // Iterator will provide entry [k,v] tuples rather than values.\n while (!(step = iterator.next()).done) {\n var entry = step.value;\n if (entry) {\n if (!isNode(entry[1])) {\n return false;\n }\n }\n }\n }\n } else {\n return false;\n }\n\n return true;\n default:\n return false;\n }\n }\n\n function isSymbol(propType, propValue) {\n // Native Symbol.\n if (propType === 'symbol') {\n return true;\n }\n\n // 19.4.3.5 Symbol.prototype[@@toStringTag] === 'Symbol'\n if (propValue['@@toStringTag'] === 'Symbol') {\n return true;\n }\n\n // Fallback for non-spec compliant Symbols which are polyfilled.\n if (typeof Symbol === 'function' && propValue instanceof Symbol) {\n return true;\n }\n\n return false;\n }\n\n // Equivalent of `typeof` but with special handling for array and regexp.\n function getPropType(propValue) {\n var propType = typeof propValue;\n if (Array.isArray(propValue)) {\n return 'array';\n }\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return 'object';\n }\n if (isSymbol(propType, propValue)) {\n return 'symbol';\n }\n return propType;\n }\n\n // This handles more types than `getPropType`. Only used for error messages.\n // See `createPrimitiveTypeChecker`.\n function getPreciseType(propValue) {\n if (typeof propValue === 'undefined' || propValue === null) {\n return '' + propValue;\n }\n var propType = getPropType(propValue);\n if (propType === 'object') {\n if (propValue instanceof Date) {\n return 'date';\n } else if (propValue instanceof RegExp) {\n return 'regexp';\n }\n }\n return propType;\n }\n\n // Returns a string that is postfixed to a warning about an invalid type.\n // For example, \"undefined\" or \"of type array\"\n function getPostfixForTypeWarning(value) {\n var type = getPreciseType(value);\n switch (type) {\n case 'array':\n case 'object':\n return 'an ' + type;\n case 'boolean':\n case 'date':\n case 'regexp':\n return 'a ' + type;\n default:\n return type;\n }\n }\n\n // Returns class name of the object, if any.\n function getClassName(propValue) {\n if (!propValue.constructor || !propValue.constructor.name) {\n return ANONYMOUS;\n }\n return propValue.constructor.name;\n }\n\n ReactPropTypes.checkPropTypes = checkPropTypes;\n ReactPropTypes.PropTypes = ReactPropTypes;\n\n return ReactPropTypes;\n};\n\n\n/***/ }),\n/* 15 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n/*\nobject-assign\n(c) Sindre Sorhus\n@license MIT\n*/\n\n\n/* eslint-disable no-unused-vars */\nvar getOwnPropertySymbols = Object.getOwnPropertySymbols;\nvar hasOwnProperty = Object.prototype.hasOwnProperty;\nvar propIsEnumerable = Object.prototype.propertyIsEnumerable;\n\nfunction toObject(val) {\n\tif (val === null || val === undefined) {\n\t\tthrow new TypeError('Object.assign cannot be called with null or undefined');\n\t}\n\n\treturn Object(val);\n}\n\nfunction shouldUseNative() {\n\ttry {\n\t\tif (!Object.assign) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// Detect buggy property enumeration order in older V8 versions.\n\n\t\t// https://bugs.chromium.org/p/v8/issues/detail?id=4118\n\t\tvar test1 = new String('abc'); // eslint-disable-line no-new-wrappers\n\t\ttest1[5] = 'de';\n\t\tif (Object.getOwnPropertyNames(test1)[0] === '5') {\n\t\t\treturn false;\n\t\t}\n\n\t\t// https://bugs.chromium.org/p/v8/issues/detail?id=3056\n\t\tvar test2 = {};\n\t\tfor (var i = 0; i < 10; i++) {\n\t\t\ttest2['_' + String.fromCharCode(i)] = i;\n\t\t}\n\t\tvar order2 = Object.getOwnPropertyNames(test2).map(function (n) {\n\t\t\treturn test2[n];\n\t\t});\n\t\tif (order2.join('') !== '0123456789') {\n\t\t\treturn false;\n\t\t}\n\n\t\t// https://bugs.chromium.org/p/v8/issues/detail?id=3056\n\t\tvar test3 = {};\n\t\t'abcdefghijklmnopqrst'.split('').forEach(function (letter) {\n\t\t\ttest3[letter] = letter;\n\t\t});\n\t\tif (Object.keys(Object.assign({}, test3)).join('') !==\n\t\t\t\t'abcdefghijklmnopqrst') {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn true;\n\t} catch (err) {\n\t\t// We don't expect any of the above to throw, but better to be safe.\n\t\treturn false;\n\t}\n}\n\nmodule.exports = shouldUseNative() ? Object.assign : function (target, source) {\n\tvar from;\n\tvar to = toObject(target);\n\tvar symbols;\n\n\tfor (var s = 1; s < arguments.length; s++) {\n\t\tfrom = Object(arguments[s]);\n\n\t\tfor (var key in from) {\n\t\t\tif (hasOwnProperty.call(from, key)) {\n\t\t\t\tto[key] = from[key];\n\t\t\t}\n\t\t}\n\n\t\tif (getOwnPropertySymbols) {\n\t\t\tsymbols = getOwnPropertySymbols(from);\n\t\t\tfor (var i = 0; i < symbols.length; i++) {\n\t\t\t\tif (propIsEnumerable.call(from, symbols[i])) {\n\t\t\t\t\tto[symbols[i]] = from[symbols[i]];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\treturn to;\n};\n\n\n/***/ }),\n/* 16 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n\n\nif (Object({\"DRAGGABLE_DEBUG\":undefined}).NODE_ENV !== 'production') {\n var invariant = __webpack_require__(2);\n var warning = __webpack_require__(8);\n var ReactPropTypesSecret = __webpack_require__(3);\n var loggedTypeFailures = {};\n}\n\n/**\n * Assert that the values match with the type specs.\n * Error messages are memorized and will only be shown once.\n *\n * @param {object} typeSpecs Map of name to a ReactPropType\n * @param {object} values Runtime values that need to be type-checked\n * @param {string} location e.g. \"prop\", \"context\", \"child context\"\n * @param {string} componentName Name of the component for error messages.\n * @param {?Function} getStack Returns the component stack.\n * @private\n */\nfunction checkPropTypes(typeSpecs, values, location, componentName, getStack) {\n if (Object({\"DRAGGABLE_DEBUG\":undefined}).NODE_ENV !== 'production') {\n for (var typeSpecName in typeSpecs) {\n if (typeSpecs.hasOwnProperty(typeSpecName)) {\n var error;\n // Prop type validation may throw. In case they do, we don't want to\n // fail the render phase where it didn't fail before. So we log it.\n // After these have been cleaned up, we'll let them throw.\n try {\n // This is intentionally an invariant that gets caught. It's the same\n // behavior as without this statement except with a better message.\n invariant(typeof typeSpecs[typeSpecName] === 'function', '%s: %s type `%s` is invalid; it must be a function, usually from ' + 'the `prop-types` package, but received `%s`.', componentName || 'React class', location, typeSpecName, typeof typeSpecs[typeSpecName]);\n error = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, ReactPropTypesSecret);\n } catch (ex) {\n error = ex;\n }\n warning(!error || error instanceof Error, '%s: type specification of %s `%s` is invalid; the type checker ' + 'function must return `null` or an `Error` but returned a %s. ' + 'You may have forgotten to pass an argument to the type checker ' + 'creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and ' + 'shape all require an argument).', componentName || 'React class', location, typeSpecName, typeof error);\n if (error instanceof Error && !(error.message in loggedTypeFailures)) {\n // Only monitor this failure once because there tends to be a lot of the\n // same error.\n loggedTypeFailures[error.message] = true;\n\n var stack = getStack ? getStack() : '';\n\n warning(false, 'Failed %s type: %s%s', location, error.message, stack != null ? stack : '');\n }\n }\n }\n }\n}\n\nmodule.exports = checkPropTypes;\n\n\n/***/ }),\n/* 17 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n\n\nvar emptyFunction = __webpack_require__(1);\nvar invariant = __webpack_require__(2);\nvar ReactPropTypesSecret = __webpack_require__(3);\n\nmodule.exports = function() {\n function shim(props, propName, componentName, location, propFullName, secret) {\n if (secret === ReactPropTypesSecret) {\n // It is still safe when called from React.\n return;\n }\n invariant(\n false,\n 'Calling PropTypes validators directly is not supported by the `prop-types` package. ' +\n 'Use PropTypes.checkPropTypes() to call them. ' +\n 'Read more at http://fb.me/use-check-prop-types'\n );\n };\n shim.isRequired = shim;\n function getShim() {\n return shim;\n };\n // Important!\n // Keep this list in sync with production version in `./factoryWithTypeCheckers.js`.\n var ReactPropTypes = {\n array: shim,\n bool: shim,\n func: shim,\n number: shim,\n object: shim,\n string: shim,\n symbol: shim,\n\n any: shim,\n arrayOf: getShim,\n element: shim,\n instanceOf: getShim,\n node: shim,\n objectOf: getShim,\n oneOf: getShim,\n oneOfType: getShim,\n shape: getShim,\n exact: getShim\n };\n\n ReactPropTypes.checkPropTypes = emptyFunction;\n ReactPropTypes.PropTypes = ReactPropTypes;\n\n return ReactPropTypes;\n};\n\n\n/***/ }),\n/* 18 */\n/***/ (function(module, exports, __webpack_require__) {\n\nvar __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*!\n Copyright (c) 2016 Jed Watson.\n Licensed under the MIT License (MIT), see\n http://jedwatson.github.io/classnames\n*/\n/* global define */\n\n(function () {\n\t'use strict';\n\n\tvar hasOwn = {}.hasOwnProperty;\n\n\tfunction classNames () {\n\t\tvar classes = [];\n\n\t\tfor (var i = 0; i < arguments.length; i++) {\n\t\t\tvar arg = arguments[i];\n\t\t\tif (!arg) continue;\n\n\t\t\tvar argType = typeof arg;\n\n\t\t\tif (argType === 'string' || argType === 'number') {\n\t\t\t\tclasses.push(arg);\n\t\t\t} else if (Array.isArray(arg)) {\n\t\t\t\tclasses.push(classNames.apply(null, arg));\n\t\t\t} else if (argType === 'object') {\n\t\t\t\tfor (var key in arg) {\n\t\t\t\t\tif (hasOwn.call(arg, key) && arg[key]) {\n\t\t\t\t\t\tclasses.push(key);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn classes.join(' ');\n\t}\n\n\tif (typeof module !== 'undefined' && module.exports) {\n\t\tmodule.exports = classNames;\n\t} else if (true) {\n\t\t// register as 'classnames', consistent with npm package name\n\t\t!(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_RESULT__ = function () {\n\t\t\treturn classNames;\n\t\t}.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__),\n\t\t\t\t__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));\n\t} else {}\n}());\n\n\n/***/ }),\n/* 19 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.getPrefix = getPrefix;\nexports.browserPrefixToKey = browserPrefixToKey;\nexports.browserPrefixToStyle = browserPrefixToStyle;\nvar prefixes = ['Moz', 'Webkit', 'O', 'ms'];\nfunction getPrefix() /*: string*/ {\n var prop /*: string*/ = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'transform';\n\n // Checking specifically for 'window.document' is for pseudo-browser server-side\n // environments that define 'window' as the global context.\n // E.g. React-rails (see https://github.com/reactjs/react-rails/pull/84)\n if (typeof window === 'undefined' || typeof window.document === 'undefined') return '';\n\n var style = window.document.documentElement.style;\n\n if (prop in style) return '';\n\n for (var i = 0; i < prefixes.length; i++) {\n if (browserPrefixToKey(prop, prefixes[i]) in style) return prefixes[i];\n }\n\n return '';\n}\n\nfunction browserPrefixToKey(prop /*: string*/, prefix /*: string*/) /*: string*/ {\n return prefix ? '' + prefix + kebabToTitleCase(prop) : prop;\n}\n\nfunction browserPrefixToStyle(prop /*: string*/, prefix /*: string*/) /*: string*/ {\n return prefix ? '-' + prefix.toLowerCase() + '-' + prop : prop;\n}\n\nfunction kebabToTitleCase(str /*: string*/) /*: string*/ {\n var out = '';\n var shouldCapitalize = true;\n for (var i = 0; i < str.length; i++) {\n if (shouldCapitalize) {\n out += str[i].toUpperCase();\n shouldCapitalize = false;\n } else if (str[i] === '-') {\n shouldCapitalize = true;\n } else {\n out += str[i];\n }\n }\n return out;\n}\n\n// Default export is the prefix itself, like 'Moz', 'Webkit', etc\n// Note that you may have to re-test for certain things; for instance, Chrome 50\n// can handle unprefixed `transform`, but not unprefixed `user-select`\nexports.default = getPrefix();\n\n/***/ }),\n/* 20 */\n/***/ (function(module, exports) {\n\n// shim for using process in browser\nvar process = module.exports = {};\n\n// cached from whatever global is present so that test runners that stub it\n// don't break things. But we need to wrap it in a try catch in case it is\n// wrapped in strict mode code which doesn't define any globals. It's inside a\n// function because try/catches deoptimize in certain engines.\n\nvar cachedSetTimeout;\nvar cachedClearTimeout;\n\nfunction defaultSetTimout() {\n throw new Error('setTimeout has not been defined');\n}\nfunction defaultClearTimeout () {\n throw new Error('clearTimeout has not been defined');\n}\n(function () {\n try {\n if (typeof setTimeout === 'function') {\n cachedSetTimeout = setTimeout;\n } else {\n cachedSetTimeout = defaultSetTimout;\n }\n } catch (e) {\n cachedSetTimeout = defaultSetTimout;\n }\n try {\n if (typeof clearTimeout === 'function') {\n cachedClearTimeout = clearTimeout;\n } else {\n cachedClearTimeout = defaultClearTimeout;\n }\n } catch (e) {\n cachedClearTimeout = defaultClearTimeout;\n }\n} ())\nfunction runTimeout(fun) {\n if (cachedSetTimeout === setTimeout) {\n //normal enviroments in sane situations\n return setTimeout(fun, 0);\n }\n // if setTimeout wasn't available but was latter defined\n if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) {\n cachedSetTimeout = setTimeout;\n return setTimeout(fun, 0);\n }\n try {\n // when when somebody has screwed with setTimeout but no I.E. maddness\n return cachedSetTimeout(fun, 0);\n } catch(e){\n try {\n // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally\n return cachedSetTimeout.call(null, fun, 0);\n } catch(e){\n // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error\n return cachedSetTimeout.call(this, fun, 0);\n }\n }\n\n\n}\nfunction runClearTimeout(marker) {\n if (cachedClearTimeout === clearTimeout) {\n //normal enviroments in sane situations\n return clearTimeout(marker);\n }\n // if clearTimeout wasn't available but was latter defined\n if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) {\n cachedClearTimeout = clearTimeout;\n return clearTimeout(marker);\n }\n try {\n // when when somebody has screwed with setTimeout but no I.E. maddness\n return cachedClearTimeout(marker);\n } catch (e){\n try {\n // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally\n return cachedClearTimeout.call(null, marker);\n } catch (e){\n // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error.\n // Some versions of I.E. have different rules for clearTimeout vs setTimeout\n return cachedClearTimeout.call(this, marker);\n }\n }\n\n\n\n}\nvar queue = [];\nvar draining = false;\nvar currentQueue;\nvar queueIndex = -1;\n\nfunction cleanUpNextTick() {\n if (!draining || !currentQueue) {\n return;\n }\n draining = false;\n if (currentQueue.length) {\n queue = currentQueue.concat(queue);\n } else {\n queueIndex = -1;\n }\n if (queue.length) {\n drainQueue();\n }\n}\n\nfunction drainQueue() {\n if (draining) {\n return;\n }\n var timeout = runTimeout(cleanUpNextTick);\n draining = true;\n\n var len = queue.length;\n while(len) {\n currentQueue = queue;\n queue = [];\n while (++queueIndex < len) {\n if (currentQueue) {\n currentQueue[queueIndex].run();\n }\n }\n queueIndex = -1;\n len = queue.length;\n }\n currentQueue = null;\n draining = false;\n runClearTimeout(timeout);\n}\n\nprocess.nextTick = function (fun) {\n var args = new Array(arguments.length - 1);\n if (arguments.length > 1) {\n for (var i = 1; i < arguments.length; i++) {\n args[i - 1] = arguments[i];\n }\n }\n queue.push(new Item(fun, args));\n if (queue.length === 1 && !draining) {\n runTimeout(drainQueue);\n }\n};\n\n// v8 likes predictible objects\nfunction Item(fun, array) {\n this.fun = fun;\n this.array = array;\n}\nItem.prototype.run = function () {\n this.fun.apply(null, this.array);\n};\nprocess.title = 'browser';\nprocess.browser = true;\nprocess.env = {};\nprocess.argv = [];\nprocess.version = ''; // empty string to avoid regexp issues\nprocess.versions = {};\n\nfunction noop() {}\n\nprocess.on = noop;\nprocess.addListener = noop;\nprocess.once = noop;\nprocess.off = noop;\nprocess.removeListener = noop;\nprocess.removeAllListeners = noop;\nprocess.emit = noop;\nprocess.prependListener = noop;\nprocess.prependOnceListener = noop;\n\nprocess.listeners = function (name) { return [] }\n\nprocess.binding = function (name) {\n throw new Error('process.binding is not supported');\n};\n\nprocess.cwd = function () { return '/' };\nprocess.chdir = function (dir) {\n throw new Error('process.chdir is not supported');\n};\nprocess.umask = function() { return 0; };\n\n\n/***/ })\n/******/ ]);\n});\n//# sourceMappingURL=react-draggable.js.map//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTguanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi4vbm9kZV9tb2R1bGVzL3JlYWN0LWRyYWdnYWJsZS9kaXN0L3JlYWN0LWRyYWdnYWJsZS5qcz80Mzg5Il0sInNvdXJjZXNDb250ZW50IjpbIihmdW5jdGlvbiB3ZWJwYWNrVW5pdmVyc2FsTW9kdWxlRGVmaW5pdGlvbihyb290LCBmYWN0b3J5KSB7XG5cdGlmKHR5cGVvZiBleHBvcnRzID09PSAnb2JqZWN0JyAmJiB0eXBlb2YgbW9kdWxlID09PSAnb2JqZWN0Jylcblx0XHRtb2R1bGUuZXhwb3J0cyA9IGZhY3RvcnkocmVxdWlyZShcInJlYWN0LWRvbVwiKSwgcmVxdWlyZShcInJlYWN0XCIpKTtcblx0ZWxzZSBpZih0eXBlb2YgZGVmaW5lID09PSAnZnVuY3Rpb24nICYmIGRlZmluZS5hbWQpXG5cdFx0ZGVmaW5lKFtcInJlYWN0LWRvbVwiLCBcInJlYWN0XCJdLCBmYWN0b3J5KTtcblx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W1iZXJcbiAgfSksXG5cbiAgLyoqXG4gICAqIGBwb3NpdGlvbmAsIGlmIHByZXNlbnQsIGRlZmluZXMgdGhlIGN1cnJlbnQgcG9zaXRpb24gb2YgdGhlIGVsZW1lbnQuXG4gICAqXG4gICAqICBUaGlzIGlzIHNpbWlsYXIgdG8gaG93IGZvcm0gZWxlbWVudHMgaW4gUmVhY3Qgd29yayAtIGlmIG5vIGBwb3NpdGlvbmAgaXMgc3VwcGxpZWQsIHRoZSBjb21wb25lbnRcbiAgICogIGlzIHVuY29udHJvbGxlZC5cbiAgICpcbiAgICogRXhhbXBsZTpcbiAgICpcbiAgICogYGBganN4XG4gICAqICAgICAgbGV0IEFwcCA9IFJlYWN0LmNyZWF0ZUNsYXNzKHtcbiAgICogICAgICAgICAgcmVuZGVyOiBmdW5jdGlvbiAoKSB7XG4gICAqICAgICAgICAgICAgICByZXR1cm4gKFxuICAgKiAgICAgICAgICAgICAgICAgIDxEcmFnZ2FibGUgcG9zaXRpb249e3t4OiAyNSwgeTogMjV9fT5cbiAgICogICAgICAgICAgICAgICAgICAgICAgPGRpdj5JIHN0YXJ0IHdpdGggdHJhbnNmb3JtWDogMjVweCBhbmQgdHJhbnNmb3JtWTogMjVweDs8L2Rpdj5cbiAgICogICAgICAgICAgICAgICAgICA8L0RyYWdnYWJsZT5cbiAgICogICAgICAgICAgICAgICk7XG4gICAqICAgICAgICAgIH1cbiAgICogICAgICB9KTtcbiAgICogYGBgXG4gICAqL1xuICBwb3NpdGlvbjogX3Byb3BUeXBlczIuZGVmYXVsdC5zaGFwZSh7XG4gICAgeDogX3Byb3BUeXBlczIuZGVmYXVsdC5udW1iZXIsXG4gICAgeTogX3Byb3BUeXBlczIuZGVmYXVsdC5udW1iZXJcbiAgfSksXG5cbiAgLyoqXG4gICAqIFRoZXNlIHByb3BlcnRpZXMgc2hvdWxkIGJlIGRlZmluZWQgb24gdGhlIGNoaWxkLCBub3QgaGVyZS5cbiAgICovXG4gIGNsYXNzTmFtZT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N0ZWQgYG9iamVjdGAuJykpO1xuICAgICAgfVxuICAgICAgLy8gV2UgbmVlZCB0byBjaGVjayBhbGwga2V5cyBpbiBjYXNlIHNvbWUgYXJlIHJlcXVpcmVkIGJ1dCBtaXNzaW5nIGZyb21cbiAgICAgIC8vIHByb3BzLlxuICAgICAgdmFyIGFsbEtleXMgPSBhc3NpZ24oe30sIHByb3BzW3Byb3BOYW1lXSwgc2hhcGVUeXBlcyk7XG4gICAgICBmb3IgKHZhciBrZXkgaW4gYWxsS2V5cykge1xuICAgICAgICB2YXIgY2hlY2tlciA9IHNoYXBlVHlwZXNba2V5XTtcbiAgICAgICAgaWYgKCFjaGVja2VyKSB7XG4gICAgICAgICAgcmV0dXJuIG5ldyBQcm9wVHlwZUVycm9yKFxuICAgICAgICAgICAgJ0ludmFsaWQgJyArIGxvY2F0aW9uICsgJyBgJyArIHByb3BGdWxsTmFtZSArICdgIGtleSBgJyArIGtleSArICdgIHN1cHBsaWVkIHRvIGAnICsgY29tcG9uZW50TmFtZSArICdgLicgK1xuICAgICAgICAgICAgJ1xcbkJhZCBvYmplY3Q6ICcgKyBKU09OLnN0cmluZ2lmeShwcm9wc1twcm9wTmFtZV0sIG51bGwsICcgICcpICtcbiAgICAgICAgICAgICdcXG5WYWxpZCBrZXlzOiAnICsgIEpTT04uc3RyaW5naWZ5KE9iamVjdC5rZXlzKHNoYXBlVHlwZXMpLCBudWxsLCAnICAnKVxuICAgICAgICAgICk7XG4gICAgICAgIH1cbiAgICAgICAgdmFyIGVycm9yID0gY2hlY2tlcihwcm9wVmFsdWUsIGtleSwgY29tcG9uZW50TmFtZSwgbG9jYXRpb24sIHByb3BGdWxsTmFtZSArICcuJyArIGtleSwgUmVhY3RQcm9wVHlwZXNTZWNyZXQpO1xuICAgICAgICBpZiAoZXJyb3IpIHtcbiAgICAgICAgICByZXR1cm4gZXJyb3I7XG4gICAgICAgIH1cbiAgICAgIH1cbiAgICAgIHJldHVybiBudWxsO1xuICAgIH1cblxuICAgIHJldHVybiBjcmVhdGVDaGFpbmFibGVUeXBlQ2hlY2tlcih2YWxpZGF0ZSk7XG4gIH1cblxuICBmdW5jdGlvbiBpc05vZGUocHJvcFZhbHVlKSB7XG4gICAgc3dpdGNoICh0eXBlb2YgcHJvcFZhbHVlKSB7XG4gICAgICBjYXNlICdudW1iZXInOlxuICAgICAgY2FzZSAnc3RyaW5nJzpcbiAgICAgIGNhc2UgJ3VuZGVmaW5lZCc6XG4gICAgICAgIHJldHVybiB0cnVlO1xuICAgICAgY2FzZSAnYm9vbGVhbic6XG4gICAgICAgIHJldHVybiAhcHJvcFZhbHVlO1xuICAgICAgY2FzZSAnb2JqZWN0JzpcbiAgICAgICAgaWYgKEFycmF5LmlzQXJyYXkocHJvcFZhbHVlKSkge1xuICAgICAgICAgIHJldHVybiBwcm9wVmFsdWUuZXZlcnkoaXNOb2RlKTtcbiAgICAgICAgfVxuICAgICAgICBpZiAocHJvcFZhbHVlID09PSBudWxsIHx8IGlzVmFsaWRFbGVtZW50KHByb3BWYWx1ZSkpIHtcbiAgICAgICAgICByZXR1cm4gdHJ1ZTtcbiAgICAgICAgfVxuXG4gICAgICAgIHZhciBpdGVyYXRvckZuID0gZ2V0SXRlcmF0b3JGbihwcm9wVmFsdWUpO1xuICAgICAgICBpZiAoaXRlcmF0b3JGbikge1xuICAgICAgICAgIHZhciBpdGVyYXRvciA9IGl0ZXJhdG9yRm4uY2FsbChwcm9wVmFsdWUpO1xuICAgICAgICAgIHZhciBzdGVwO1xuICAgICAgICAgIGlmIChpdGVyYXRvckZuICE9PSBwcm9wVmFsdWUuZW50cmllcykge1xuICAgICAgICAgICAgd2hpbGUgKCEoc3RlcCA9IGl0ZXJhdG9yLm5leHQoKSkuZG9uZSkge1xuICAgICAgICAgICAgICBpZiAoIWlzTm9kZShzdGVwLnZhbHVlKSkge1xuICAgICAgICAgICAgICAgIHJldHVybiBmYWxzZTtcbiAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgIC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NBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBIiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///18\n")},function(module,exports,__webpack_require__){"use strict";eval("/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\n\n\n/**\n * Use invariant() to assert state which your program assumes to be true.\n *\n * Provide sprintf-style format (only %s is supported) and arguments\n * to provide information about what broke and what you were\n * expecting.\n *\n * The invariant message will be stripped in production, but the invariant\n * will remain to ensure logic does not differ in production.\n */\n\nvar validateFormat = function validateFormat(format) {};\n\nif (false) {}\n\nfunction invariant(condition, format, a, b, c, d, e, f) {\n validateFormat(format);\n\n if (!condition) {\n var error;\n if (format === undefined) {\n error = new Error('Minified exception occurred; use the non-minified dev environment ' + 'for the full error message and additional helpful warnings.');\n } else {\n var args = [a, b, c, d, e, f];\n var argIndex = 0;\n error = new Error(format.replace(/%s/g, function () {\n return args[argIndex++];\n }));\n error.name = 'Invariant Violation';\n }\n\n error.framesToPop = 1; // we don't care about invariant's own frame\n throw error;\n }\n}\n\nmodule.exports = invariant;//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTkuanMiLCJ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UuZXhwb3J0cyA9IGludmFyaWFudDsiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQSxhQU1BO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQSIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///19\n")},function(module,exports,__webpack_require__){"use strict";eval("\n\n/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * \n */\n\nfunction makeEmptyFunction(arg) {\n return function () {\n return arg;\n };\n}\n\n/**\n * This function accepts and discards inputs; it has no side effects. This is\n * primarily useful idiomatically for overridable function endpoints which\n * always need to be callable, since JS lacks a null-call idiom ala Cocoa.\n */\nvar emptyFunction = function emptyFunction() {};\n\nemptyFunction.thatReturns = makeEmptyFunction;\nemptyFunction.thatReturnsFalse = makeEmptyFunction(false);\nemptyFunction.thatReturnsTrue = makeEmptyFunction(true);\nemptyFunction.thatReturnsNull = makeEmptyFunction(null);\nemptyFunction.thatReturnsThis = function () {\n return this;\n};\nemptyFunction.thatReturnsArgument = function (arg) {\n return arg;\n};\n\nmodule.exports = emptyFunction;//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMjAuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi4vbm9kZV9tb2R1bGVzL2ZianMvbGliL2VtcH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VuY3Rpb24odHJ1ZSk7XG5lbXB0eUZ1bmN0aW9uLnRoYXRSZXR1cm5zTnVsbCA9IG1ha2VFbXB0eUZ1bmN0aW9uKG51bGwpO1xuZW1wdHlGdW5jdGlvbi50aGF0UmV0dXJuc1RoaXMgPSBmdW5jdGlvbiAoKSB7XG4gIHJldHVybiB0aGlzO1xufTtcbmVtcHR5RnVuY3Rpb24udGhhdFJldHVybnNBcmd1bWVudCA9IGZ1bmN0aW9uIChhcmcpIHtcbiAgcmV0dXJuIGFyZztcbn07XG5cbm1vZHVsZS5leHBvcnRzID0gZW1wdHlGdW5jdGlvbjsiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQSIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///20\n")},function(module,exports){eval('var g;\n\n// This works in non-strict mode\ng = (function() {\n\treturn this;\n})();\n\ntry {\n\t// This works if eval is allowed (see CSP)\n\tg = g || Function("return this")() || (1, eval)("this");\n} catch (e) {\n\t// This works if the window reference is available\n\tif (typeof window === "object") g = window;\n}\n\n// g can still be undefined, but nothing to do about it...\n// We return undefined, instead of nothing here, so it\'s\n// easier to handle this case. if(!global) { ...}\n\nmodule.exports = g;\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMjEuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi4vbm9kZV9tb2R1bGVzL3dlYnBhY2svYnVpbGRpbi9nbG9iYWwuanM/YTQyYiJdLCJzb3VyY2VzQ29udGVudCI6WyJ2YXIgZztcblxuLy8gVGhpcyB3b3JrcyBpbiBub24tc3RyaWN0IG1vZGVcbmcgPSAoZnVuY3Rpb24oKSB7XG5cdHJldHVybiB0aGlzO1xufSkoKTtcblxudHJ5IHtcblx0Ly8gVGhpcyB3b3JrcyBpZiBldmFsIGlzIGFsbG93ZWQgKHNlZSBDU1ApXG5cdGcgPSBnIHx8IEZ1bmN0aW9uKFwicmV0dXJuIHRoaXNcIikoKSB8fCAoMSwgZXZhbCkoXCJ0aGlzXCIpO1xufSBjYXRjaCAoZSkge1xuXHQvLyBUaGlzIHdvcmtzIGlmIHRoZSB3aW5kb3cgcmVmZXJlbmNlIGlzIGF2YWlsYWJsZVxuXHRpZiAodHlwZW9mIHdpbmRvdyA9PT0gXCJvYmplY3RcIikgZyA9IHdpbmRvdztcbn1cblxuLy8gZyBjYW4gc3RpbGwgYmUgdW5kZWZpbmVkLCBidXQgbm90aGluZyB0byBkbyBhYm91dCBpdC4uLlxuLy8gV2UgcmV0dXJuIHVuZGVmaW5lZCwgaW5zdGVhZCBvZiBub3RoaW5nIGhlcmUsIHNvIGl0J3Ncbi8vIGVhc2llciB0byBoYW5kbGUgdGhpcyBjYXNlLiBpZighZ2xvYmFsKSB7IC4uLn1cblxubW9kdWxlLmV4cG9ydHMgPSBnO1xuIl0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///21\n')},function(module,exports,__webpack_require__){"use strict";eval("\n\nexports.__esModule = true;\nexports.locationsAreEqual = exports.createLocation = undefined;\n\nvar _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };\n\nvar _resolvePathname = __webpack_require__(28);\n\nvar _resolvePathname2 = _interopRequireDefault(_resolvePathname);\n\nvar _valueEqual = __webpack_require__(29);\n\nvar _valueEqual2 = _interopRequireDefault(_valueEqual);\n\nvar _PathUtils = __webpack_require__(12);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar createLocation = exports.createLocation = function createLocation(path, state, key, currentLocation) {\n var location = void 0;\n if (typeof path === 'string') {\n // Two-arg form: push(path, state)\n location = (0, _PathUtils.parsePath)(path);\n location.state = state;\n } else {\n // One-arg form: push(location)\n location = _extends({}, path);\n\n if (location.pathname === undefined) location.pathname = '';\n\n if (location.search) {\n if (location.search.charAt(0) !== '?') location.search = '?' + location.search;\n } else {\n location.search = '';\n }\n\n if (location.hash) {\n if (location.hash.charAt(0) !== '#') location.hash = '#' + location.hash;\n } else {\n location.hash = '';\n }\n\n if (state !== undefined && location.state === undefined) location.state = state;\n }\n\n try {\n location.pathname = decodeURI(location.pathname);\n } catch (e) {\n if (e instanceof URIError) {\n throw new URIError('Pathname \"' + location.pathname + '\" could not be decoded. ' + 'This is likely caused by an invalid percent-encoding.');\n } else {\n throw e;\n }\n }\n\n if (key) location.key = key;\n\n if (currentLocation) {\n // Resolve incomplete/relative pathname relative to current location.\n if (!location.pathname) {\n location.pathname = currentLocation.pathname;\n } else if (location.pathname.charAt(0) !== '/') {\n location.pathname = (0, _resolvePathname2.default)(location.pathname, currentLocation.pathname);\n }\n } else {\n // When there is no prior location and pathname is empty, set it to /\n if (!location.pathname) {\n location.pathname = '/';\n }\n }\n\n return location;\n};\n\nvar locationsAreEqual = exports.locationsAreEqual = function locationsAreEqual(a, b) {\n return a.pathname === b.pathname && a.search === b.search && a.hash === b.hash && a.key === b.key && (0, _valueEqual2.default)(a.state, b.state);\n};//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,ey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Q0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0EiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///22\n")},function(module,exports,__webpack_require__){"use strict";eval("\n\nexports.__esModule = true;\n\nvar _warning = __webpack_require__(5);\n\nvar _warning2 = _interopRequireDefault(_warning);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar createTransitionManager = function createTransitionManager() {\n var prompt = null;\n\n var setPrompt = function setPrompt(nextPrompt) {\n (0, _warning2.default)(prompt == null, 'A history supports only one prompt at a time');\n\n prompt = nextPrompt;\n\n return function () {\n if (prompt === nextPrompt) prompt = null;\n };\n };\n\n var confirmTransitionTo = function confirmTransitionTo(location, action, getUserConfirmation, callback) {\n // TODO: If another transition starts while we're still confirming\n // the previous one, we may end up in a weird state. Figure out the\n // best way to handle this.\n if (prompt != null) {\n var result = typeof prompt === 'function' ? prompt(location, action) : prompt;\n\n if (typeof result === 'string') {\n if (typeof getUserConfirmation === 'function') {\n getUserConfirmation(result, callback);\n } else {\n (0, _warning2.default)(false, 'A history needs a getUserConfirmation function in order to use a prompt message');\n\n callback(true);\n }\n } else {\n // Return false from a transition hook to cancel the transition.\n callback(result !== false);\n }\n } else {\n callback(true);\n }\n };\n\n var listeners = [];\n\n var appendListener = function appendListener(fn) {\n var isActive = true;\n\n var listener = function listener() {\n if (isActive) fn.apply(undefined, arguments);\n };\n\n listeners.push(listener);\n\n return function () {\n isActive = false;\n listeners = listeners.filter(function (item) {\n return item !== listener;\n });\n };\n };\n\n var notifyListeners = function notifyListeners() {\n for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n listeners.forEach(function (listener) {\n return listener.apply(undefined, args);\n });\n };\n\n return {\n setPrompt: setPrompt,\n confirmTransitionTo: confirmTransitionTo,\n appendListener: appendListener,\n notifyListeners: notifyListeners\n };\n};\n\nexports.default = createTransitionManager;//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMjMuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi4vbm9kZV9tb2R1bGVzL2hpc3RvcnkvY3JlYXRlVHJhbnNpdGlvbk1hbmFnZXIuanM/OTgzYSJdLCJzb3VyY2VzQ29udGVudCI6WyIndXNlIHN0cmljdCc7XG5cbmV4cG9ydHMuX19lc01vZHVsZSA9IHRydWU7XG5cbnZhciBfd2FybmluZyA9IHJlcXVpcmUoJ3dhcm5pbmcnKTtcblxudmFyIF93YXJuaW5nMiA9IF9pbnRlcm9wUmVxdWlyZURlZmF1bHQoX3dhcm5pbmcpO1xuXG5mdW5jdGlvbiBfaW50ZXJvcFJlcXVpcmVEZWZhdWx0KG9iaikgeyByZXR1cm4gb2JqICYmIG9iai5fX2VzTW9kdWxlID8gb2JqIDogeyBkZWZhdWx0OiBvYmogfTsgfVxuXG52YXIgY3JlYXRlVHJhbnNpdGlvbk1hbmFnZXIgPSBmdW5jdGlvbiBjcmVhdGVUcmFuc2l0aW9uTWFuYWdlcigpIHtcbiAgdmFyIHByb21wdCA9IG51bGw7XG5cbiAgdmFyIHNldFByb21wdCA9IGZ1bmN0aW9uIHNldFByb21wdChuZXh0UHJvbXB0KSB7XG4gICAgKDAsIF93YXJuaW5nMi5kZWZhdWx0KShwcm9tcHQgPT0gbnVsbCwgJ0EgaGlzdG9yeSBzdXBwb3J0cyBvbmx5IG9uZSBwcm9tcHQgYXQgYSB0aW1lJyk7XG5cbiAgICBwcm9tcHQgPSBuZXh0UHJvbXB0O1xuXG4gICAgcmV0dXJuIGZ1bmN0aW9uICgpIHtcbiAgICAgIGlmIChwcm9tcHQgPT09IG5leHRQcm9tcHQpIHByb21wdCA9IG51bGw7XG4gICAgfTtcbiAgfTtcblxuICB2YXIgY29uZmlybVRyYW5zaXRpb25UbyA9IGZ1bmN0aW9uIG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0LFxuICAgIGNvbmZpcm1UcmFuc2l0aW9uVG86IGNvbmZpcm1UcmFuc2l0aW9uVG8sXG4gICAgYXBwZW5kTGlzdGVuZXI6IGFwcGVuZExpc3RlbmVyLFxuICAgIG5vdGlmeUxpc3RlbmVyczogbm90aWZ5TGlzdGVuZXJzXG4gIH07XG59O1xuXG5leHBvcnRzLmRlZmF1bHQgPSBjcmVhdGVUcmFuc2l0aW9uTWFuYWdlcjsiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBIiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///23\n")},function(module,exports,__webpack_require__){eval('/*\n\tMIT License http://www.opensource.org/licenses/mit-license.php\n\tAuthor Tobias Koppers @sokra\n*/\n\nvar stylesInDom = {};\n\nvar\tmemoize = function (fn) {\n\tvar memo;\n\n\treturn function () {\n\t\tif (typeof memo === "undefined") memo = fn.apply(this, arguments);\n\t\treturn memo;\n\t};\n};\n\nvar isOldIE = memoize(function () {\n\t// Test for IE <= 9 as proposed by Browserhacks\n\t// @see http://browserhacks.com/#hack-e71d8692f65334173fee715c222cb805\n\t// Tests for existence of standard globals is to allow style-loader\n\t// to operate correctly into non-standard environments\n\t// @see https://github.com/webpack-contrib/style-loader/issues/177\n\treturn window && document && document.all && !window.atob;\n});\n\nvar getTarget = function (target) {\n return document.querySelector(target);\n};\n\nvar getElement = (function (fn) {\n\tvar memo = {};\n\n\treturn function(target) {\n // If passing function in options, then use it for resolve "head" element.\n // Useful for Shadow Root style i.e\n // {\n // insertInto: function () { return document.querySelector("#foo").shadowRoot }\n // }\n if (typeof target === \'function\') {\n return target();\n }\n if (typeof memo[target] === "undefined") {\n\t\t\tvar styleTarget = getTarget.call(this, target);\n\t\t\t// Special case to return head of iframe instead of iframe itself\n\t\t\tif (window.HTMLIFrameElement && styleTarget instanceof window.HTMLIFrameElement) {\n\t\t\t\ttry {\n\t\t\t\t\t// This will throw an exception if access to iframe is blocked\n\t\t\t\t\t// due to cross-origin restrictions\n\t\t\t\t\tstyleTarget = styleTarget.contentDocument.head;\n\t\t\t\t} catch(e) {\n\t\t\t\t\tstyleTarget = null;\n\t\t\t\t}\n\t\t\t}\n\t\t\tmemo[target] = styleTarget;\n\t\t}\n\t\treturn memo[target]\n\t};\n})();\n\nvar singleton = null;\nvar\tsingletonCounter = 0;\nvar\tstylesInsertedAtTop = [];\n\nvar\tfixUrls = __webpack_require__(60);\n\nmodule.exports = function(list, options) {\n\tif (typeof DEBUG !== "undefined" && DEBUG) {\n\t\tif (typeof document !== "object") throw new Error("The style-loader cannot be used in a non-browser environment");\n\t}\n\n\toptions = options || {};\n\n\toptions.attrs = typeof options.attrs === "object" ? options.attrs : {};\n\n\t// Force single-tag solution on IE6-9, which has a hard limit on the # of