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I,EAAErH,EAAE,CAACY,QAAQjD,EAAEkD,UAAUxE,IAAIgL,EAAEhC,gBAAgB,IAAI,IAAInE,EAAEmG,EAAE/B,cAAcc,EAAE,EAAEpG,EAAEkB,GAAG9E,EAAE,GAAGkL,EAAE,EAAEC,EAAErG,EAAExC,OAAO4I,EAAEC,GAAGnL,EAAEoL,KAAK,CAACtG,EAAEoG,KAAKpG,EAAEoG,KAAKpG,EAAEoG,KAAK,MAAM,MAAM,CAACG,SAASrL,EAAEsL,MAAMzE,EAAEtF,EAAEyI,ICI57EuB,CAASR,EAAI5I,KAAMqF,GAClC,OAAO9F,M","sources":["webpack://sakurairo-scripts/./node_modules/@kotorik/palette/node_modules/color-space/lab.js","webpack://sakurairo-scripts/./node_modules/@kotorik/palette/node_modules/color-space/rgb.js","webpack://sakurairo-scripts/./node_modules/@kotorik/palette/node_modules/color-space/xyz.js","webpack://sakurairo-scripts/./node_modules/promise-worker/register.js","webpack://sakurairo-scripts/webpack/bootstrap","webpack://sakurairo-scripts/webpack/runtime/compat get default export","webpack://sakurairo-scripts/webpack/runtime/define property getters","webpack://sakurairo-scripts/webpack/runtime/hasOwnProperty shorthand","webpack://sakurairo-scripts/./node_modules/neuquant-js/src/neuquant.js","webpack://sakurairo-scripts/./node_modules/neuquant-js/src/helpers.js","webpack://sakurairo-scripts/./node_modules/@kotorik/palette/dist/index.mjs","webpack://sakurairo-scripts/./src/app/theme-color/worker.ts"],"sourcesContent":["/**\n * CIE LAB space model\n *\n * @module color-space/lab\n */\n'use strict'\n\nvar xyz = require('./xyz');\n\nmodule.exports = {\n\tname: 'lab',\n\tmin: [0,-100,-100],\n\tmax: [100,100,100],\n\tchannel: ['lightness', 'a', 'b'],\n\talias: ['LAB', 'cielab'],\n\n\txyz: function(lab) {\n\t\tvar l = lab[0],\n\t\t\t\ta = lab[1],\n\t\t\t\tb = lab[2],\n\t\t\t\tx, y, z, y2;\n\n\t\tif (l <= 8) {\n\t\t\ty = (l * 100) / 903.3;\n\t\t\ty2 = (7.787 * (y / 100)) + (16 / 116);\n\t\t} else {\n\t\t\ty = 100 * Math.pow((l + 16) / 116, 3);\n\t\t\ty2 = Math.pow(y / 100, 1/3);\n\t\t}\n\n\t\tx = x / 95.047 <= 0.008856 ? x = (95.047 * ((a / 500) + y2 - (16 / 116))) / 7.787 : 95.047 * Math.pow((a / 500) + y2, 3);\n\n\t\tz = z / 108.883 <= 0.008859 ? z = (108.883 * (y2 - (b / 200) - (16 / 116))) / 7.787 : 108.883 * Math.pow(y2 - (b / 200), 3);\n\n\t\treturn [x, y, z];\n\t}\n};\n\n\n//extend xyz\nxyz.lab = function(xyz){\n\tvar x = xyz[0],\n\t\t\ty = xyz[1],\n\t\t\tz = xyz[2],\n\t\t\tl, a, b;\n\n\tx /= 95.047;\n\ty /= 100;\n\tz /= 108.883;\n\n\tx = x > 0.008856 ? Math.pow(x, 1/3) : (7.787 * x) + (16 / 116);\n\ty = y > 0.008856 ? Math.pow(y, 1/3) : (7.787 * y) + (16 / 116);\n\tz = z > 0.008856 ? Math.pow(z, 1/3) : (7.787 * z) + (16 / 116);\n\n\tl = (116 * y) - 16;\n\ta = 500 * (x - y);\n\tb = 200 * (y - z);\n\n\treturn [l, a, b];\n};\n","/**\n * RGB space.\n *\n * @module color-space/rgb\n */\n'use strict'\n\nmodule.exports = {\n\tname: 'rgb',\n\tmin: [0,0,0],\n\tmax: [255,255,255],\n\tchannel: ['red', 'green', 'blue'],\n\talias: ['RGB']\n};\n","/**\n * CIE XYZ\n *\n * @module color-space/xyz\n */\n'use strict'\n\nvar rgb = require('./rgb');\n\nvar xyz = {\n\tname: 'xyz',\n\tmin: [0,0,0],\n\tchannel: ['X','Y','Z'],\n\talias: ['XYZ', 'ciexyz', 'cie1931']\n};\n\n\n/**\n * Whitepoint reference values with observer/illuminant\n *\n * http://en.wikipedia.org/wiki/Standard_illuminant\n */\nxyz.whitepoint = {\n\t//1931 2°\n\t2: {\n\t\t//incadescent\n\t\tA:[109.85, 100, 35.585],\n\t\t// B:[],\n\t\tC: [98.074, 100, 118.232],\n\t\tD50: [96.422, 100, 82.521],\n\t\tD55: [95.682, 100, 92.149],\n\t\t//daylight\n\t\tD65: [95.045592705167, 100, 108.9057750759878],\n\t\tD75: [94.972, 100, 122.638],\n\t\t//flourescent\n\t\t// F1: [],\n\t\tF2: [99.187, 100, 67.395],\n\t\t// F3: [],\n\t\t// F4: [],\n\t\t// F5: [],\n\t\t// F6:[],\n\t\tF7: [95.044, 100, 108.755],\n\t\t// F8: [],\n\t\t// F9: [],\n\t\t// F10: [],\n\t\tF11: [100.966, 100, 64.370],\n\t\t// F12: [],\n\t\tE: [100,100,100]\n\t},\n\n\t//1964 10°\n\t10: {\n\t\t//incadescent\n\t\tA:[111.144, 100, 35.200],\n\t\tC: [97.285, 100, 116.145],\n\t\tD50: [96.720, 100, 81.427],\n\t\tD55: [95.799, 100, 90.926],\n\t\t//daylight\n\t\tD65: [94.811, 100, 107.304],\n\t\tD75: [94.416, 100, 120.641],\n\t\t//flourescent\n\t\tF2: [103.280, 100, 69.026],\n\t\tF7: [95.792, 100, 107.687],\n\t\tF11: [103.866, 100, 65.627],\n\t\tE: [100,100,100]\n\t}\n};\n\n\n/**\n * Top values are the whitepoint’s top values, default are D65\n */\nxyz.max = xyz.whitepoint[2].D65;\n\n\n/**\n * Transform xyz to rgb\n *\n * @param {Array} xyz Array of xyz values\n *\n * @return {Array} RGB values\n */\nxyz.rgb = function (_xyz, white) {\n\t//FIXME: make sure we have to divide like this. Probably we have to replace matrix as well then\n\twhite = white || xyz.whitepoint[2].E;\n\n\tvar x = _xyz[0] / white[0],\n\t\ty = _xyz[1] / white[1],\n\t\tz = _xyz[2] / white[2],\n\t\tr, g, b;\n\n\t// assume sRGB\n\t// http://www.brucelindbloom.com/index.html?Eqn_RGB_XYZ_Matrix.html\n\tr = (x * 3.240969941904521) + (y * -1.537383177570093) + (z * -0.498610760293);\n\tg = (x * -0.96924363628087) + (y * 1.87596750150772) + (z * 0.041555057407175);\n\tb = (x * 0.055630079696993) + (y * -0.20397695888897) + (z * 1.056971514242878);\n\n\tr = r > 0.0031308 ? ((1.055 * Math.pow(r, 1.0 / 2.4)) - 0.055)\n\t\t: r = (r * 12.92);\n\n\tg = g > 0.0031308 ? ((1.055 * Math.pow(g, 1.0 / 2.4)) - 0.055)\n\t\t: g = (g * 12.92);\n\n\tb = b > 0.0031308 ? ((1.055 * Math.pow(b, 1.0 / 2.4)) - 0.055)\n\t\t: b = (b * 12.92);\n\n\tr = Math.min(Math.max(0, r), 1);\n\tg = Math.min(Math.max(0, g), 1);\n\tb = Math.min(Math.max(0, b), 1);\n\n\treturn [r * 255, g * 255, b * 255];\n}\n\n\n\n/**\n * RGB to XYZ\n *\n * @param {Array} rgb RGB channels\n *\n * @return {Array} XYZ channels\n */\nrgb.xyz = function(rgb, white) {\n\tvar r = rgb[0] / 255,\n\t\t\tg = rgb[1] / 255,\n\t\t\tb = rgb[2] / 255;\n\n\t// assume sRGB\n\tr = r > 0.04045 ? Math.pow(((r + 0.055) / 1.055), 2.4) : (r / 12.92);\n\tg = g > 0.04045 ? Math.pow(((g + 0.055) / 1.055), 2.4) : (g / 12.92);\n\tb = b > 0.04045 ? Math.pow(((b + 0.055) / 1.055), 2.4) : (b / 12.92);\n\n\tvar x = (r * 0.41239079926595) + (g * 0.35758433938387) + (b * 0.18048078840183);\n\tvar y = (r * 0.21263900587151) + (g * 0.71516867876775) + (b * 0.072192315360733);\n\tvar z = (r * 0.019330818715591) + (g * 0.11919477979462) + (b * 0.95053215224966);\n\n\twhite = white || xyz.whitepoint[2].E;\n\n\treturn [x * white[0], y * white[1], z * white[2]];\n};\n\n\n\nmodule.exports = xyz;\n","'use strict'\n\nfunction isPromise (obj) {\n // via https://unpkg.com/is-promise@2.1.0/index.js\n return !!obj && (typeof obj === 'object' || typeof obj === 'function') && typeof obj.then === 'function'\n}\n\nfunction registerPromiseWorker (callback) {\n function postOutgoingMessage (e, messageId, error, result) {\n function postMessage (msg) {\n /* istanbul ignore if */\n if (typeof self.postMessage !== 'function') { // service worker\n e.ports[0].postMessage(msg)\n } else { // web worker\n self.postMessage(msg)\n }\n }\n if (error) {\n /* istanbul ignore else */\n if (typeof console !== 'undefined' && 'error' in console) {\n // This is to make errors easier to debug. I think it's important\n // enough to just leave here without giving the user an option\n // to silence it.\n console.error('Worker caught an error:', error)\n }\n postMessage([messageId, {\n message: error.message\n }])\n } else {\n postMessage([messageId, null, result])\n }\n }\n\n function tryCatchFunc (callback, message) {\n try {\n return { res: callback(message) }\n } catch (e) {\n return { err: e }\n }\n }\n\n function handleIncomingMessage (e, callback, messageId, message) {\n var result = tryCatchFunc(callback, message)\n\n if (result.err) {\n postOutgoingMessage(e, messageId, result.err)\n } else if (!isPromise(result.res)) {\n postOutgoingMessage(e, messageId, null, result.res)\n } else {\n result.res.then(function (finalResult) {\n postOutgoingMessage(e, messageId, null, finalResult)\n }, function (finalError) {\n postOutgoingMessage(e, messageId, finalError)\n })\n }\n }\n\n function onIncomingMessage (e) {\n var payload = e.data\n if (!Array.isArray(payload) || payload.length !== 2) {\n // message doens't match communication format; ignore\n return\n }\n var messageId = payload[0]\n var message = payload[1]\n\n if (typeof callback !== 'function') {\n postOutgoingMessage(e, messageId, new Error(\n 'Please pass a function into register().'))\n } else {\n handleIncomingMessage(e, callback, messageId, message)\n }\n }\n\n self.addEventListener('message', onIncomingMessage)\n}\n\nmodule.exports = registerPromiseWorker\n","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","/**\n * NeuQuant Neural-Network Quantization Algorithm\n *\n * Copyright (c) 1994 Anthony Dekker\n *\n * See \"Kohonen neural networks for optimal colour quantization\" in \"Network:\n * Computation in Neural Systems\" Vol. 5 (1994) pp 351-367. for a discussion of\n * the algorithm.\n *\n * See also http://members.ozemail.com.au/~dekker/NEUQUANT.HTML\n *\n * Any party obtaining a copy of these files from the author, directly or\n * indirectly, is granted, free of charge, a full and unrestricted irrevocable,\n * world-wide, paid up, royalty-free, nonexclusive right and license to deal in\n * this software and documentation files (the \"Software\"), including without\n * limitation the rights to use, copy, modify, merge, publish, distribute,\n * sublicense, and/or sell copies of the Software, and to permit persons who\n * receive copies from any such party to do so, with the only requirement being\n * that this copyright notice remain intact.\n *\n * Copyright (c) 2012 Johan Nordberg (JavaScript port)\n * Copyright (c) 2014 Devon Govett (JavaScript port)\n */\n\nconst prime1 = 499\nconst prime2 = 491\nconst prime3 = 487\nconst prime4 = 503\n\nconst maxprime = Math.max(prime1, prime2, prime3, prime4)\nconst minpicturebytes = (3 * maxprime)\n\nconst defaults = {\n ncycles: 100,\n netsize: 256,\n samplefac: 10\n}\n\nconst assign = function (target) {\n for (let i = 1, l = arguments.length; i < l; i++) {\n const nextSource = arguments[i]\n if (nextSource != null) {\n for (const nextKey in nextSource) {\n if (Object.prototype.hasOwnProperty.call(nextSource, nextKey)) {\n target[nextKey] = nextSource[nextKey]\n }\n }\n }\n }\n return target\n}\n\nexport default class NeuQuant {\n constructor (pixels, options) {\n assign(this, defaults, {pixels}, options)\n\n if (this.netsize < 4 || this.netsize > 256) {\n throw new Error('Color count must be between 4 and 256')\n }\n\n if (this.samplefac < 1 || this.samplefac > 30) {\n throw new Error('Sampling factor must be between 1 and 30')\n }\n\n this.maxnetpos = this.netsize - 1\n\n this.netbiasshift = 4\n this.intbiasshift = 16\n this.intbias = (1 << this.intbiasshift)\n this.gammashift = 10\n this.gamma = (1 << this.gammashift)\n this.betashift = 10\n this.beta = (this.intbias >> this.betashift)\n this.betagamma = (this.beta * this.gamma)\n\n this.initrad = (this.netsize >> 3)\n this.radiusbiasshift = 6\n this.radiusbias = (1 << this.radiusbiasshift)\n this.initradius = (this.initrad * this.radiusbias)\n this.radiusdec = 30\n\n this.alphabiasshift = 10\n this.initalpha = (1 << this.alphabiasshift)\n\n this.radbiasshift = 8\n this.radbias = (1 << this.radbiasshift)\n this.alpharadbshift = (this.alphabiasshift + this.radbiasshift)\n this.alpharadbias = (1 << this.alpharadbshift)\n\n this.network = []\n this.netindex = new Uint32Array(256)\n this.bias = new Uint32Array(this.netsize)\n this.freq = new Uint32Array(this.netsize)\n this.radpower = new Uint32Array(this.netsize >> 3)\n\n for (let i = 0, l = this.netsize; i < l; i++) {\n let v = (i << (this.netbiasshift + 8)) / this.netsize\n this.network[i] = new Float64Array([v, v, v, 0])\n this.freq[i] = this.intbias / this.netsize\n this.bias[i] = 0\n }\n }\n\n unbiasnet () {\n for (let i = 0, l = this.netsize; i < l; i++) {\n this.network[i][0] >>= this.netbiasshift\n this.network[i][1] >>= this.netbiasshift\n this.network[i][2] >>= this.netbiasshift\n this.network[i][3] = i\n }\n }\n\n altersingle (alpha, i, b, g, r) {\n this.network[i][0] -= (alpha * (this.network[i][0] - b)) / this.initalpha\n this.network[i][1] -= (alpha * (this.network[i][1] - g)) / this.initalpha\n this.network[i][2] -= (alpha * (this.network[i][2] - r)) / this.initalpha\n }\n\n alterneigh (radius, i, b, g, r) {\n const lo = Math.abs(i - radius)\n const hi = Math.min(i + radius, this.netsize)\n\n let j = i + 1\n let k = i - 1\n let m = 1\n\n while ((j < hi) || (k > lo)) {\n const a = this.radpower[m++]\n\n if (j < hi) {\n const p = this.network[j++]\n p[0] -= (a * (p[0] - b)) / this.alpharadbias\n p[1] -= (a * (p[1] - g)) / this.alpharadbias\n p[2] -= (a * (p[2] - r)) / this.alpharadbias\n }\n\n if (k > lo) {\n const p = this.network[k--]\n p[0] -= (a * (p[0] - b)) / this.alpharadbias\n p[1] -= (a * (p[1] - g)) / this.alpharadbias\n p[2] -= (a * (p[2] - r)) / this.alpharadbias\n }\n }\n }\n\n contest (b, g, r) {\n let bestd = ~(1 << 31)\n let bestbiasd = bestd\n let bestpos = -1\n let bestbiaspos = bestpos\n\n for (let i = 0, l = this.netsize; i < l; i++) {\n let n = this.network[i]\n\n let dist = Math.abs(n[0] - b) + Math.abs(n[1] - g) + Math.abs(n[2] - r)\n if (dist < bestd) {\n bestd = dist\n bestpos = i\n }\n\n let biasdist = dist - ((this.bias[i]) >> (this.intbiasshift - this.netbiasshift))\n if (biasdist < bestbiasd) {\n bestbiasd = biasdist\n bestbiaspos = i\n }\n\n let betafreq = (this.freq[i] >> this.betashift)\n this.freq[i] -= betafreq\n this.bias[i] += (betafreq << this.gammashift)\n }\n\n this.freq[bestpos] += this.beta\n this.bias[bestpos] -= this.betagamma\n\n return bestbiaspos\n }\n\n inxbuild () {\n let previouscol = 0\n let startpos = 0\n\n for (let i = 0, l = this.netsize; i < l; i++) {\n let p = this.network[i]\n let q = null\n let smallpos = i\n let smallval = p[1]\n\n for (let j = i + 1; j < l; j++) {\n q = this.network[j]\n if (q[1] < smallval) {\n smallpos = j\n smallval = q[1]\n }\n }\n q = this.network[smallpos]\n\n if (i !== smallpos) {\n [p[0], q[0]] = [q[0], p[0]];\n [p[1], q[1]] = [q[1], p[1]];\n [p[2], q[2]] = [q[2], p[2]];\n [p[3], q[3]] = [q[3], p[3]]\n }\n\n if (smallval !== previouscol) {\n this.netindex[previouscol] = (startpos + i) >> 1\n for (let j = previouscol + 1; j < smallval; j++) {\n this.netindex[j] = i\n }\n previouscol = smallval\n startpos = i\n }\n }\n\n this.netindex[previouscol] = (startpos + this.maxnetpos) >> 1\n for (let i = previouscol + 1; i < 256; i++) {\n this.netindex[i] = this.maxnetpos\n }\n }\n\n learn () {\n const lengthcount = this.pixels.length\n const alphadec = 30 + ((this.samplefac - 1) / 3)\n const samplepixels = lengthcount / (3 * this.samplefac)\n\n let delta = samplepixels / this.ncycles | 0\n let alpha = this.initalpha\n let radius = this.initradius\n\n let rad = radius >> this.radiusbiasshift\n\n if (rad <= 1) {\n rad = 0\n }\n\n for (let i = 0; i < rad; i++) {\n this.radpower[i] = alpha * (((rad * rad - i * i) * this.radbias) / (rad * rad))\n }\n\n let step\n if (lengthcount < minpicturebytes) {\n this.samplefac = 1\n step = 3\n } else if ((lengthcount % prime1) !== 0) {\n step = 3 * prime1\n } else if ((lengthcount % prime2) !== 0) {\n step = 3 * prime2\n } else if ((lengthcount % prime3) !== 0) {\n step = 3 * prime3\n } else {\n step = 3 * prime4\n }\n\n let pix = 0\n\n for (let i = 0; i < samplepixels;) {\n let b = (this.pixels[pix] & 0xff) << this.netbiasshift\n let g = (this.pixels[pix + 1] & 0xff) << this.netbiasshift\n let r = (this.pixels[pix + 2] & 0xff) << this.netbiasshift\n\n let j = this.contest(b, g, r)\n this.altersingle(alpha, j, b, g, r)\n if (rad !== 0) {\n this.alterneigh(rad, j, b, g, r)\n }\n\n pix += step\n if (pix >= lengthcount) {\n pix -= lengthcount\n }\n\n if (delta === 0) {\n delta = 1\n }\n\n if (++i % delta === 0) {\n alpha -= alpha / alphadec\n radius -= radius / this.radiusdec\n rad = radius >> this.radiusbiasshift\n\n if (rad <= 1) {\n rad = 0\n }\n\n for (let k = 0; k < rad; k++) {\n this.radpower[k] = alpha * (((rad * rad - k * k) * this.radbias) / (rad * rad))\n }\n }\n }\n }\n\n buildColorMap () {\n this.learn()\n this.unbiasnet()\n this.inxbuild()\n }\n\n getColorMap () {\n const map = new Buffer(this.netsize * 3)\n const index = new Buffer(this.netsize)\n\n for (let i = 0, l = this.netsize; i < l; i++) {\n index[this.network[i][3]] = i\n }\n\n for (let i = 0, j = 0, k = 0, l = this.netsize; i < l; i++) {\n k = index[i]\n map[j++] = this.network[k][0] & 0xff\n map[j++] = this.network[k][1] & 0xff\n map[j++] = this.network[k][2] & 0xff\n }\n\n return map\n }\n}\n","import NeuQuant from './neuquant'\n\nfunction findClosest (palette, r, g, b) {\n let minpos = 0\n let mind = 256 * 256 * 256\n\n for (let i = 0, l = palette.length; i < l;) {\n const dr = r - palette[i++]\n const dg = g - palette[i++]\n const db = b - palette[i]\n const d = dr * dr + dg * dg + db * db\n const pos = i / 3 | 0\n\n if (d < mind) {\n mind = d\n minpos = pos\n }\n\n i++\n }\n\n return minpos\n}\n\nexport function palette (pixels, options) {\n const nq = new NeuQuant(pixels, options)\n nq.buildColorMap()\n return nq.getColorMap()\n}\n\nexport function indexed (pixels, palette) {\n const indexed = new Buffer(pixels.length / 3)\n const memo = {}\n\n for (let i = 0, j = 0, l = pixels.length; i < l;) {\n const r = pixels[i++]\n const g = pixels[i++]\n const b = pixels[i++]\n const k = r << 16 | g << 8 | b\n\n if (k in memo) {\n indexed[j++] = memo[k]\n } else {\n indexed[j++] = memo[k] = findClosest(palette, r, g, b)\n }\n }\n\n return indexed\n}\n\nexport function quantize (pixels, options) {\n const p = palette(pixels, options)\n const i = indexed(pixels, p)\n\n return {\n palette: p,\n indexed: i\n }\n}\n","import r from\"neuquant-js/src/neuquant.js\";import{indexed as t}from\"neuquant-js\";import n from\"color-space/rgb.js\";import e from\"color-space/xyz.js\";import a from\"color-space/lab.js\";function o(r,t,n){var e=r[t++]-n[0],a=r[t++]-n[1],o=r[t++]-n[2],u=r[t++]-n[3];return Math.pow(e,2)+Math.pow(a,2)+Math.pow(o,2)+Math.pow(u,2)}function u(r,t,n,e){void 0===e&&(e=1);for(var a,u,f,l,c,v=[],s=[],h=[],p=0,m=0;m<t;m++){var d=Math.floor(Math.random()*r.length);s.push(Array.from(r.slice(d,d+4))),h.push(i(0,4)),v.push(i(0,5))}for(;p<n;){for(var g=0;g<r.length;){for(var y=0,b=o(r,g,s[0]),w=1;w<t;w++){var M=o(r,g,s[w]);M<b&&(b=M,y=w)}var j=v[y];j[0]+=r[g++],j[1]+=r[g++],j[2]+=r[g++],j[3]+=r[g++],j[4]++}for(var A=0,I=0;I<t;I++){var x=v[I],C=x[4];if(0==C){var q=Math.floor(Math.random()*r.length);h[I]=Array.from(r.slice(q,q+4)),A+=e}else{for(var z=h[I],S=0;S<4;S++)z[S]=x[S]/C;A+=Math.sqrt((f=(a=s[I])[1]-(u=h[I])[1],l=a[2]-u[2],c=a[3]-u[3],Math.pow(a[0]-u[0],2)+Math.pow(f,2)+Math.pow(l,2)+Math.pow(c,2)))}}if(A<=e)return{centroid:h,iteration:p,fit:!0,label:v.map(function(r){return r[4]}),size:r.length};var E=s;s=h,h=E,p++;for(var D=0;D<t;D++){var O=v[D];O[0]=0,O[1]=0,O[2]=0,O[3]=0,O[4]=0}}return{centroid:s,iteration:p,fit:!1,label:v.map(function(r){return r[4]}),size:r.length}}function i(r,t){for(var n=[],e=0;e<t;e++)n.push(r);return n}function f(r,t){(null==t||t>r.length)&&(t=r.length);for(var n=0,e=new Array(t);n<t;n++)e[n]=r[n];return e}function l(r,t){var n=\"undefined\"!=typeof Symbol&&r[Symbol.iterator]||r[\"@@iterator\"];if(n)return(n=n.call(r)).next.bind(n);if(Array.isArray(r)||(n=function(r,t){if(r){if(\"string\"==typeof r)return f(r,t);var n=Object.prototype.toString.call(r).slice(8,-1);return\"Object\"===n&&r.constructor&&(n=r.constructor.name),\"Map\"===n||\"Set\"===n?Array.from(r):\"Arguments\"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?f(r,t):void 0}}(r))||t&&r&&\"number\"==typeof r.length){n&&(r=n);var e=0;return function(){return e>=r.length?{done:!0}:{done:!1,value:r[e++]}}}throw new TypeError(\"Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\")}function c(n,e,a){void 0===a&&(a=1);var o=function(r){for(var t=new Uint8ClampedArray(r.length/4*3),n=0,e=0,a=r.length;e<a;){for(var o=0;o<3;o++)t[n++]=r[e++];e++}return t}(n),u=new r(o,{netsize:e,samplefac:a});u.buildColorMap();for(var i=u.getColorMap(),f=t(o,i),l=[],c=0,s=i.length;c<s;)l.push([i[c++],i[c++],i[c++],255]);return{centroid:l,label:v(e,f)}}function v(r,t){for(var n,e=new Array(r).fill(0),a=l(t);!(n=a()).done;)e[n.value]++;return e}function s(r,t){var n=document.createElement(\"canvas\"),e=n.getContext(\"2d\");return n.height=t,n.width=r,e}function h(r,t){return new OffscreenCanvas(r,t).getContext(\"2d\")}function p(r){return new Promise(function(t,n){r.complete?t():(r.addEventListener(\"load\",function(r){t(r)}),r.addEventListener(\"error\",function(r){n(r)}))})}function m(r){return g(s,r)}function d(r){return g(h,r)}function g(r,t){var n=t.naturalWidth,e=t.naturalHeight,a=r(n,e);return null==a||a.drawImage(t,0,0,n,e),null==a?void 0:a.getImageData(0,0,n,e)}function y(r,t){return w(s,r,t)}function b(r,t){return w(h,r,t)}function w(r,t,n){var e=t.naturalWidth,a=t.naturalHeight,o=e*a/n;if(o>1){var u=e/Math.sqrt(o),i=a/Math.sqrt(o),f=r(u,i);return null==f||f.drawImage(t,0,0,u,i),null==f?void 0:f.getImageData(0,0,u,i)}var l=r(e,a);return null==l||l.drawImage(t,0,0),null==l?void 0:l.getImageData(0,0,e,a)}function M(r){return r.map(function(r){return r/255})}function j(r){var t,n,e,a,o,u,i=(u=(e=r)[2],(a=e[0])>(o=e[1])?o>u?[a,u]:a>u?[a,o]:[u,o]:o>u?u>a?[o,a]:[o,u]:[u,a]),f=i[0],l=i[1],c=f-l,v=f+l;if(0==c)t=0,n=0;else{if(f==r[0]){var s=60*(r[1]-r[2])/c;t=s<0?s+360:s}else t=f==r[1]?60*(r[2]-r[0])/c+120:60*(r[0]-r[1])/c+240;n=0==v?0:v<=1?c/v:c/(2-v)}return[t,n,v/2,r[3]]}var A=function(r){return void 0===r&&(r=[0,1,2,3]),function(t,n){for(var e,a,o=l(r);!(a=o()).done;){var u=a.value;if(0!=(e=t[u]-n[u]))return e}return e}},I=function(r){return\"hsla(\"+r[0]+\"deg,\"+100*r[1]+\"%,\"+100*r[2]+\"%,\"+r[3]+\")\"},x=function(r){return\"rgba(\"+r.map(function(r){return Math.floor(r)}).join(\",\")+\")\"};function C(r){for(var t=[],a=0;a<r.length;a+=4){var o=r.slice(a,a+4),u=o[3],i=o.slice(0,3),f=n.xyz(i),l=e.lab(f);t.push.apply(t,l.concat([u]))}return t}function q(r){var t=r.slice(0,3),n=r[3],o=a.xyz(t),u=e.rgb(o);return[].concat(u,[n])}export{p as awaitImage,C as convertToLab,A as getHSLAComparer,I as hslaCSSText,u as kmeans,q as labaToRGBA,c as neuquant,M as normalizeRGBA,m as readImage,y as readImageDownsampling,b as readImageDownsamplingOffscreen,d as readImageOffscreen,x as rgbaCSSText,j as rgbaToHSLA};\n//# sourceMappingURL=index.mjs.map\n","import { neuquant } from \"@kotorik/palette\";\nimport registerPromiseWorker from 'promise-worker/register';\nregisterPromiseWorker((data) => {\n const { img, k } = data;\n const result = neuquant(img.data, k);\n return result;\n});\n"],"names":["xyz","module","exports","name","min","max","channel","alias","lab","x","y","z","y2","l","a","b","Math","pow","rgb","A","C","D50","D55","D65","D75","F2","F7","F11","E","whitepoint","_xyz","white","r","g","callback","postOutgoingMessage","e","messageId","error","result","postMessage","msg","self","ports","console","message","addEventListener","payload","data","Array","isArray","length","Error","obj","res","err","tryCatchFunc","then","finalResult","finalError","handleIncomingMessage","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","undefined","__webpack_modules__","n","getter","__esModule","d","definition","key","o","Object","defineProperty","enumerable","get","prop","prototype","hasOwnProperty","call","minpicturebytes","defaults","ncycles","netsize","samplefac","constructor","pixels","options","target","i","arguments","nextSource","nextKey","this","maxnetpos","netbiasshift","intbiasshift","intbias","gammashift","gamma","betashift","beta","betagamma","initrad","radiusbiasshift","radiusbias","initradius","radiusdec","alphabiasshift","initalpha","radbiasshift","radbias","alpharadbshift","alpharadbias","network","netindex","Uint32Array","bias","freq","radpower","v","Float64Array","unbiasnet","altersingle","alpha","alterneigh","radius","lo","abs","hi","j","k","m","p","contest","bestd","bestbiasd","bestpos","bestbiaspos","dist","biasdist","betafreq","inxbuild","previouscol","startpos","q","smallpos","smallval","learn","lengthcount","alphadec","samplepixels","step","delta","rad","pix","buildColorMap","getColorMap","map","Buffer","index","findClosest","palette","minpos","mind","dr","dg","db","pos","indexed","memo","f","t","Symbol","iterator","next","bind","toString","slice","from","test","done","value","TypeError","fill","registerPromiseWorker","img","Uint8ClampedArray","u","c","s","push","centroid","label","neuquant"],"sourceRoot":""}