\r\n\r\n ${useAsButton ? '' : '
'}\r\n\r\n
\r\n
\r\n `);\r\n\r\n const int = root.interaction;\r\n\r\n // Select option which is not hidden\r\n int.options.find(o => !o.hidden && !o.classList.add('active'));\r\n\r\n // Create method to find currenlty active option\r\n int.type = () => int.options.find(e => e.classList.contains('active'));\r\n return root;\r\n}\r\n"],"sourceRoot":""}
\ No newline at end of file
+{"version":3,"sources":["webpack:///webpack/universalModuleDefinition","webpack:///webpack/bootstrap","webpack:///./src/js/utils/utils.js","webpack:///./src/js/utils/color.js","webpack:///./src/js/utils/hsvacolor.js","webpack:///./src/js/libs/moveable.js","webpack:///./src/js/libs/selectable.js","webpack:///./src/js/pickr.js","webpack:///./src/js/libs/nanopop.js","webpack:///./src/js/template.js"],"names":["root","factory","exports","module","define","amd","window","installedModules","__webpack_require__","moduleId","i","l","modules","call","m","c","d","name","getter","o","Object","defineProperty","enumerable","get","r","Symbol","toStringTag","value","t","mode","__esModule","ns","create","key","bind","n","object","property","prototype","hasOwnProperty","p","s","on","eventListener","off","method","elements","events","fn","options","arguments","length","undefined","HTMLCollection","NodeList","Array","from","isArray","_iteratorNormalCompletion","_didIteratorError","_iteratorError","_step","_iterator","iterator","next","done","el","_iteratorNormalCompletion2","_didIteratorError2","_iteratorError2","_step2","_iterator2","ev","_objectSpread","capture","err","return","slice","createElementFromString","html","div","document","createElement","innerHTML","trim","firstElementChild","removeAttribute","getAttribute","createFromTemplate","str","resolve","element","base","con","subtree","_i","_Array$from","children","child","arr","push","eventPath","evt","path","composedPath","target","parentElement","adjustableInputNumbers","mapper","v","handleScroll","e","inc","Number","shiftKey","ctrlKey","deltaY","index","selectionStart","replace","focus","setSelectionRange","preventDefault","dispatchEvent","Event","passive","min","Math","max","floor","round","hsvToRgb","h","f","q","mod","rgbToHsv","g","b","minVal","maxVal","delta","dr","dg","db","cmykToHsv","y","k","_toConsumableArray","hslToHsv","hexToHsv","hex","apply","match","map","parseInt","parseToHSV","ctx","getContext","fillStyle","regex","cmyk","rgba","hsla","hsva","numarize","array","test","type","exec","_numarize2","_slicedToArray","values","concat","_numarize4","_numarize4$","a","splitAt","substring","alpha","_splitAt$map2","_splitAt2","_numarize6","_numarize6$","_numarize8","_numarize8$","HSVaColor","ceil","that","toHSVA","rhsva","toString","toFixed","toHSLA","hsvToHsl","rhsla","toRGBA","rrgba","toCMYK","rgb","hsvToCmyk","rcmyk","toHEXA","padStart","hsvToHex","toUpperCase","join","clone","clamp","Moveable","opt","assign","lock","onchange","_tapstart","_","_tapstop","_tapmove","cache","wrapper","getBoundingClientRect","x","touch","touches","clientX","clientY","left","width","top","height","style","offsetWidth","offsetHeight","cx","cy","trigger","update","_that$options$wrapper","destroy","Selectable","className","onTap","forEach","classList","selectable_toConsumableArray","Pickr","_this","this","_classCallCheck","pickr_defineProperty","swatchselect","change","save","init","appClass","useAsButton","disabled","comparison","closeOnScroll","components","interaction","strings","swatches","inline","sliders","default","defaultRepresentation","position","adjustableNumbers","showAlways","closeWithKey","_opt","_ref","reference","_ref$padding","padding","vBehaviour","hBehaviour","getInfo","preview","opacity","hue","palette","_preBuild","_buildComponents","_bindEvents","_finalBuild","color","addSwatch","_nanopop","_root","button","app","start","middle","end","right","bottom","pos","cached","_pos$split2","nanopop_slicedToArray","split","_pos$split2$","variant","isVertical","_getInfo","rb","eb","so","total","scrollTop","getScrollOffset","positions","variants","bevs","vars","styleprop","vertical","adder","win","v1Ok","v2Ok","margin","requestAnimationFrame","cb","offsetParent","body","setColor","_rePositioningPicker","_representation","setColorRepresentation","show","_initializingActive","_emit","hidden","int","reduce","pv","cv","ci","querySelector","shadowRoot","keys","input","clear","find","add","contains","appendChild","removeChild","lastChild","insertBefore","nextSibling","parentNode","replaceChild","disable","transition","lastColor","hide","inst","comp","sh","_sliders","pickr_slicedToArray","opposite","_ref2","picker","_color","cssRGBaString","background","currentColor","_recalc","_updateOutput","remove","slider","backgroundColor","selectable","_this2","eventBindings","_clearColor","setHSVA","pickr_toConsumableArray","_lastColor","applyColor","result","stopImmediatePropagation","ck","isOpen","code","some","ranges","step","range","getColorRepresentation","toLowerCase","nv","toPrecision","timeout","setTimeout","rs","clearTimeout","_eventBindings","event","_this3","_len","args","_key","_eventListener","callBacks","indexOf","splice","_this4","Color","_swatchColors","hsvaColorObject","swatchColor","silent","_this$_root","_this5","pickr","recalc","_this$components","string","_Color$parseToHSV2","utype","startsWith","click","utils","version"],"mappings":";CAAA,SAAAA,EAAAC,GACA,iBAAAC,SAAA,iBAAAC,OACAA,OAAAD,QAAAD,IACA,mBAAAG,eAAAC,IACAD,OAAA,GAAAH,GACA,iBAAAC,QACAA,QAAA,MAAAD,IAEAD,EAAA,MAAAC,IARA,CASCK,OAAA,WACD,mBCTA,IAAAC,EAAA,GAGA,SAAAC,EAAAC,GAGA,GAAAF,EAAAE,GACA,OAAAF,EAAAE,GAAAP,QAGA,IAAAC,EAAAI,EAAAE,GAAA,CACAC,EAAAD,EACAE,GAAA,EACAT,QAAA,IAUA,OANAU,EAAAH,GAAAI,KAAAV,EAAAD,QAAAC,IAAAD,QAAAM,GAGAL,EAAAQ,GAAA,EAGAR,EAAAD,QA0DA,OArDAM,EAAAM,EAAAF,EAGAJ,EAAAO,EAAAR,EAGAC,EAAAQ,EAAA,SAAAd,EAAAe,EAAAC,GACAV,EAAAW,EAAAjB,EAAAe,IACAG,OAAAC,eAAAnB,EAAAe,EAAA,CAA0CK,YAAA,EAAAC,IAAAL,KAK1CV,EAAAgB,EAAA,SAAAtB,GACA,oBAAAuB,eAAAC,aACAN,OAAAC,eAAAnB,EAAAuB,OAAAC,YAAA,CAAwDC,MAAA,WAExDP,OAAAC,eAAAnB,EAAA,cAAiDyB,OAAA,KAQjDnB,EAAAoB,EAAA,SAAAD,EAAAE,GAEA,GADA,EAAAA,IAAAF,EAAAnB,EAAAmB,IACA,EAAAE,EAAA,OAAAF,EACA,KAAAE,GAAA,iBAAAF,QAAAG,WAAA,OAAAH,EACA,IAAAI,EAAAX,OAAAY,OAAA,MAGA,GAFAxB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K,SAAA7O,GAAC,OAAIA,EAAEtB,aAAa,aAAamV,WAAWlQ,KAAU3D,EAAE8T,2DAQrG,OAAOpL,KAAKmF,mDAOZ,OAAOnF,KAAKyH,yCAOZ,OAAOzH,KAAK2C,wCAUZ,OAHA3C,KAAKgH,OACLhH,KAAKtM,QAAQ+M,UAAW,EACxBT,KAAK2C,MAAMC,OAAOhD,UAAUwG,IAAI,YACzBpG,sCASP,OAFAA,KAAKtM,QAAQ+M,UAAW,EACxBT,KAAK2C,MAAMC,OAAOhD,UAAUmI,OAAO,YAC5B/H,0CAKfF,EAAMuL,MAAQrN,EAGd8B,EAAMrN,OAAS,SAAAiB,GAAO,OAAI,IAAIoM,EAAMpM,IAGpCoM,EAAMwL,QAAU,QACDxL","file":"pickr.es5.min.js","sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"Pickr\"] = factory();\n\telse\n\t\troot[\"Pickr\"] = factory();\n})(window, function() {\nreturn "," \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, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\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\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 0);\n","/**\r\n * Add event(s) to element(s).\r\n * @param elements DOM-Elements\r\n * @param events Event names\r\n * @param fn Callback\r\n * @param options Optional options\r\n * @return Array passed arguments\r\n */\r\nexport const on = eventListener.bind(null, 'addEventListener');\r\n\r\n/**\r\n * Remove event(s) from element(s).\r\n * @param elements DOM-Elements\r\n * @param events Event names\r\n * @param fn Callback\r\n * @param options Optional options\r\n * @return Array passed arguments\r\n */\r\nexport const off = eventListener.bind(null, 'removeEventListener');\r\n\r\nfunction eventListener(method, elements, events, fn, options = {}) {\r\n\r\n // Normalize array\r\n if (elements instanceof HTMLCollection || elements instanceof NodeList) {\r\n elements = Array.from(elements);\r\n } else if (!Array.isArray(elements)) {\r\n elements = [elements];\r\n }\r\n\r\n if (!Array.isArray(events)) {\r\n events = [events];\r\n }\r\n\r\n for (const el of elements) {\r\n for (const ev of events) {\r\n el[method](ev, fn, {capture: false, ...options});\r\n }\r\n }\r\n\r\n return Array.prototype.slice.call(arguments, 1);\r\n}\r\n\r\n/**\r\n * Creates an DOM-Element out of a string (Single element).\r\n * @param html HTML representing a single element\r\n * @returns {Element | null} The element.\r\n */\r\nexport function createElementFromString(html) {\r\n const div = document.createElement('div');\r\n div.innerHTML = html.trim();\r\n return div.firstElementChild;\r\n}\r\n\r\n/**\r\n * Removes an attribute from a HTMLElement and returns the value.\r\n * @param el\r\n * @param name\r\n * @return {string}\r\n */\r\nexport function removeAttribute(el, name) {\r\n const value = el.getAttribute(name);\r\n el.removeAttribute(name);\r\n return value;\r\n}\r\n\r\n/**\r\n * Creates a new html element, every element which has\r\n * a 'data-key' attribute will be saved in a object (which will be returned)\r\n * where the value of 'data-key' ist the object-key and the value the HTMLElement.\r\n *\r\n * It's possible to create a hierarchy if you add a 'data-con' attribute. Every\r\n * sibling will be added to the object which will get the name from the 'data-con' attribute.\r\n *\r\n * If you want to create an Array out of multiple elements, you can use the 'data-arr' attribute,\r\n * the value defines the key and all elements, which has the same parent and the same 'data-arr' attribute,\r\n * would be added to it.\r\n *\r\n * @param str - The HTML String.\r\n */\r\nexport function createFromTemplate(str) {\r\n\r\n // Recursive function to resolve template\r\n function resolve(element, base = {}) {\r\n\r\n // Check key and container attribute\r\n const con = removeAttribute(element, 'data-con');\r\n const key = removeAttribute(element, 'data-key');\r\n\r\n // Check and save element\r\n if (key) {\r\n base[key] = element;\r\n }\r\n\r\n // Check all children\r\n const subtree = con ? (base[con] = {}) : base;\r\n for (let child of Array.from(element.children)) {\r\n\r\n // Check if element should be saved as array\r\n const arr = removeAttribute(child, 'data-arr');\r\n if (arr) {\r\n\r\n // Check if there is already an array and add element\r\n (subtree[arr] || (subtree[arr] = [])).push(child);\r\n } else {\r\n resolve(child, subtree);\r\n }\r\n }\r\n\r\n return base;\r\n }\r\n\r\n return resolve(createElementFromString(str));\r\n}\r\n\r\n/**\r\n * Polyfill for safari & firefox for the eventPath event property.\r\n * @param evt The event object.\r\n * @return [String] event path.\r\n */\r\nexport function eventPath(evt) {\r\n let path = evt.path || (evt.composedPath && evt.composedPath());\r\n if (path) return path;\r\n\r\n let el = evt.target.parentElement;\r\n path = [evt.target, el];\r\n while (el = el.parentElement) path.push(el);\r\n\r\n path.push(document, window);\r\n return path;\r\n}\r\n\r\n/**\r\n * Creates the ability to change numbers in an input field with the scroll-wheel.\r\n * @param el\r\n * @param mapper\r\n */\r\nexport function adjustableInputNumbers(el, mapper = v => v) {\r\n\r\n function handleScroll(e) {\r\n const inc = ([0.001, 0.01, 0.1])[Number(e.shiftKey || e.ctrlKey * 2)] * (e.deltaY < 0 ? 1 : -1);\r\n\r\n let index = 0;\r\n let off = el.selectionStart;\r\n el.value = el.value.replace(/[\\d.]+/g, (v, i) => {\r\n\r\n // Check if number is in cursor range and increase it\r\n if (i <= off && i + v.length >= off) {\r\n off = i;\r\n return mapper(Number(v), inc, index);\r\n }\r\n\r\n index++;\r\n return v;\r\n });\r\n\r\n el.focus();\r\n el.setSelectionRange(off, off);\r\n\r\n // Prevent default and trigger input event\r\n e.preventDefault();\r\n el.dispatchEvent(new Event('input'));\r\n }\r\n\r\n // Bind events\r\n on(el, 'focus', () => on(window, 'wheel', handleScroll, {passive: false}));\r\n on(el, 'blur', () => off(window, 'wheel', handleScroll));\r\n}\r\n","// Shorthands\r\nconst {min, max, floor, round} = Math;\r\n\r\n/**\r\n * Tries to convert a color name to rgb/a hex representation\r\n * @param name\r\n * @returns {string | CanvasGradient | CanvasPattern}\r\n */\r\nfunction standardizeColor(name) {\r\n const ctx = document.createElement('canvas').getContext('2d');\r\n ctx.fillStyle = name;\r\n return ctx.fillStyle;\r\n}\r\n\r\n/**\r\n * Convert HSV spectrum to RGB.\r\n * @param h Hue\r\n * @param s Saturation\r\n * @param v Value\r\n * @returns {number[]} Array with rgb values.\r\n */\r\nexport function hsvToRgb(h, s, v) {\r\n h = (h / 360) * 6;\r\n s /= 100;\r\n v /= 100;\r\n\r\n let i = floor(h);\r\n\r\n let f = h - i;\r\n let p = v * (1 - s);\r\n let q = v * (1 - f * s);\r\n let t = v * (1 - (1 - f) * s);\r\n\r\n let mod = i % 6;\r\n let r = [v, q, p, p, t, v][mod];\r\n let g = [t, v, v, q, p, p][mod];\r\n let b = [p, p, t, v, v, q][mod];\r\n\r\n return [\r\n r * 255,\r\n g * 255,\r\n b * 255\r\n ];\r\n}\r\n\r\n/**\r\n * Convert HSV spectrum to Hex.\r\n * @param h Hue\r\n * @param s Saturation\r\n * @param v Value\r\n * @returns {string[]} Hex values\r\n */\r\nexport function hsvToHex(h, s, v) {\r\n return hsvToRgb(h, s, v).map(v =>\r\n round(v).toString(16).padStart(2, '0')\r\n );\r\n}\r\n\r\n/**\r\n * Convert HSV spectrum to CMYK.\r\n * @param h Hue\r\n * @param s Saturation\r\n * @param v Value\r\n * @returns {number[]} CMYK values\r\n */\r\nexport function hsvToCmyk(h, s, v) {\r\n const rgb = hsvToRgb(h, s, v);\r\n const r = rgb[0] / 255;\r\n const g = rgb[1] / 255;\r\n const b = rgb[2] / 255;\r\n\r\n let k, c, m, y;\r\n\r\n k = min(1 - r, 1 - g, 1 - b);\r\n\r\n c = k === 1 ? 0 : (1 - r - k) / (1 - k);\r\n m = k === 1 ? 0 : (1 - g - k) / (1 - k);\r\n y = k === 1 ? 0 : (1 - b - k) / (1 - k);\r\n\r\n return [\r\n c * 100,\r\n m * 100,\r\n y * 100,\r\n k * 100\r\n ];\r\n}\r\n\r\n/**\r\n * Convert HSV spectrum to HSL.\r\n * @param h Hue\r\n * @param s Saturation\r\n * @param v Value\r\n * @returns {number[]} HSL values\r\n */\r\nexport function hsvToHsl(h, s, v) {\r\n s /= 100, v /= 100;\r\n\r\n let l = (2 - s) * v / 2;\r\n\r\n if (l !== 0) {\r\n if (l === 1) {\r\n s = 0;\r\n } else if (l < 0.5) {\r\n s = s * v / (l * 2);\r\n } else {\r\n s = s * v / (2 - l * 2);\r\n }\r\n }\r\n\r\n return [\r\n h,\r\n s * 100,\r\n l * 100\r\n ];\r\n}\r\n\r\n/**\r\n * Convert RGB to HSV.\r\n * @param r Red\r\n * @param g Green\r\n * @param b Blue\r\n * @return {number[]} HSV values.\r\n */\r\nfunction rgbToHsv(r, g, b) {\r\n r /= 255, g /= 255, b /= 255;\r\n\r\n let h, s, v;\r\n const minVal = min(r, g, b);\r\n const maxVal = max(r, g, b);\r\n const delta = maxVal - minVal;\r\n\r\n v = maxVal;\r\n if (delta === 0) {\r\n h = s = 0;\r\n } else {\r\n s = delta / maxVal;\r\n let dr = (((maxVal - r) / 6) + (delta / 2)) / delta;\r\n let dg = (((maxVal - g) / 6) + (delta / 2)) / delta;\r\n let db = (((maxVal - b) / 6) + (delta / 2)) / delta;\r\n\r\n if (r === maxVal) {\r\n h = db - dg;\r\n } else if (g === maxVal) {\r\n h = (1 / 3) + dr - db;\r\n } else if (b === maxVal) {\r\n h = (2 / 3) + dg - dr;\r\n }\r\n\r\n if (h < 0) {\r\n h += 1;\r\n } else if (h > 1) {\r\n h -= 1;\r\n }\r\n }\r\n\r\n return [\r\n h * 360,\r\n s * 100,\r\n v * 100\r\n ];\r\n}\r\n\r\n/**\r\n * Convert CMYK to HSV.\r\n * @param c Cyan\r\n * @param m Magenta\r\n * @param y Yellow\r\n * @param k Key (Black)\r\n * @return {number[]} HSV values.\r\n */\r\nfunction cmykToHsv(c, m, y, k) {\r\n c /= 100, m /= 100, y /= 100, k /= 100;\r\n\r\n const r = (1 - min(1, c * (1 - k) + k)) * 255;\r\n const g = (1 - min(1, m * (1 - k) + k)) * 255;\r\n const b = (1 - min(1, y * (1 - k) + k)) * 255;\r\n\r\n return [...rgbToHsv(r, g, b)];\r\n}\r\n\r\n/**\r\n * Convert HSL to HSV.\r\n * @param h Hue\r\n * @param s Saturation\r\n * @param l Lightness\r\n * @return {number[]} HSV values.\r\n */\r\nfunction hslToHsv(h, s, l) {\r\n s /= 100, l /= 100;\r\n s *= l < 0.5 ? l : 1 - l;\r\n\r\n let ns = (2 * s / (l + s)) * 100;\r\n let v = (l + s) * 100;\r\n return [h, ns, v];\r\n}\r\n\r\n/**\r\n * Convert HEX to HSV.\r\n * @param hex Hexadecimal string of rgb colors, can have length 3 or 6.\r\n * @return {number[]} HSV values.\r\n */\r\nfunction hexToHsv(hex) {\r\n return rgbToHsv(...hex.match(/.{2}/g).map(v => parseInt(v, 16)));\r\n}\r\n\r\n/**\r\n * Try's to parse a string which represents a color to a HSV array.\r\n * Current supported types are cmyk, rgba, hsla and hexadecimal.\r\n * @param str\r\n * @return {*}\r\n */\r\nexport function parseToHSV(str) {\r\n\r\n // Check if string is a color-name\r\n str = str.match(/^[a-zA-Z]+$/) ? standardizeColor(str) : str;\r\n\r\n // Regular expressions to match different types of color represention\r\n const regex = {\r\n cmyk: /^cmyk[\\D]+(\\d+)[\\D]+(\\d+)[\\D]+(\\d+)[\\D]+(\\d+)/i,\r\n rgba: /^(rgb|rgba)[\\D]+(\\d+)[\\D]+(\\d+)[\\D]+(\\d+)[\\D]*?([\\d.]+|$)/i,\r\n hsla: /^(hsl|hsla)[\\D]+(\\d+)[\\D]+(\\d+)[\\D]+(\\d+)[\\D]*?([\\d.]+|$)/i,\r\n hsva: /^(hsv|hsva)[\\D]+(\\d+)[\\D]+(\\d+)[\\D]+(\\d+)[\\D]*?([\\d.]+|$)/i,\r\n hex: /^#?(([\\dA-Fa-f]{3,4})|([\\dA-Fa-f]{6})|([\\dA-Fa-f]{8}))$/i\r\n };\r\n\r\n /**\r\n * Takes an Array of any type, convert strings which represents\r\n * a number to a number an anything else to undefined.\r\n * @param array\r\n * @return {*}\r\n */\r\n const numarize = array => array.map(v => /^(|\\d+)\\.\\d+|\\d+$/.test(v) ? Number(v) : undefined);\r\n\r\n let match;\r\n for (const type in regex) {\r\n\r\n // Check if current scheme passed\r\n if (!(match = regex[type].exec(str)))\r\n continue;\r\n\r\n // Try to convert\r\n switch (type) {\r\n case 'cmyk': {\r\n let [, c, m, y, k] = numarize(match);\r\n\r\n if (c > 100 || m > 100 || y > 100 || k > 100)\r\n break;\r\n\r\n return {values: [...cmykToHsv(c, m, y, k), 1], type};\r\n }\r\n case 'rgba': {\r\n let [, , r, g, b, a = 1] = numarize(match);\r\n\r\n if (r > 255 || g > 255 || b > 255 || a < 0 || a > 1)\r\n break;\r\n\r\n return {values: [...rgbToHsv(r, g, b), a], type};\r\n }\r\n case 'hex': {\r\n const splitAt = (s, i) => [s.substring(0, i), s.substring(i, s.length)];\r\n let [, hex] = match;\r\n\r\n // Fill up opacity if not declared\r\n if (hex.length === 3) {\r\n hex += 'F';\r\n } else if (hex.length === 6) {\r\n hex += 'FF';\r\n }\r\n\r\n let alpha;\r\n if (hex.length === 4) {\r\n [hex, alpha] = splitAt(hex, 3).map(v => v + v);\r\n } else if (hex.length === 8) {\r\n [hex, alpha] = splitAt(hex, 6);\r\n }\r\n\r\n // Convert 0 - 255 to 0 - 1 for opacity\r\n alpha = parseInt(alpha, 16) / 255;\r\n return {values: [...hexToHsv(hex), alpha], type};\r\n }\r\n case 'hsla': {\r\n let [, , h, s, l, a = 1] = numarize(match);\r\n\r\n if (h > 360 || s > 100 || l > 100 || a < 0 || a > 1)\r\n break;\r\n\r\n return {values: [...hslToHsv(h, s, l), a], type};\r\n }\r\n case 'hsva': {\r\n let [, , h, s, v, a = 1] = numarize(match);\r\n\r\n if (h > 360 || s > 100 || v > 100 || a < 0 || a > 1)\r\n break;\r\n\r\n return {values: [h, s, v, a], type};\r\n }\r\n }\r\n }\r\n\r\n return {values: null, type: null};\r\n}\r\n","import {hsvToHsl, hsvToRgb, hsvToCmyk, hsvToHex} from './color';\r\n\r\n/**\r\n * Simple class which holds the properties\r\n * of the color represention model hsla (hue saturation lightness alpha)\r\n */\r\nexport function HSVaColor(h = 0, s = 0, v = 0, a = 1) {\r\n const {ceil} = Math;\r\n\r\n const that = {\r\n h, s, v, a,\r\n\r\n toHSVA() {\r\n const hsva = [that.h, that.s, that.v];\r\n const rhsva = hsva.map(ceil);\r\n\r\n hsva.push(that.a);\r\n hsva.toString = () => `hsva(${rhsva[0]}, ${rhsva[1]}%, ${rhsva[2]}%, ${that.a.toFixed(1)})`;\r\n return hsva;\r\n },\r\n\r\n toHSLA() {\r\n const hsla = hsvToHsl(that.h, that.s, that.v);\r\n const rhsla = hsla.map(ceil);\r\n\r\n hsla.push(that.a);\r\n hsla.toString = () => `hsla(${rhsla[0]}, ${rhsla[1]}%, ${rhsla[2]}%, ${that.a.toFixed(1)})`;\r\n return hsla;\r\n },\r\n\r\n toRGBA() {\r\n const rgba = hsvToRgb(that.h, that.s, that.v);\r\n const rrgba = rgba.map(ceil);\r\n\r\n rgba.push(that.a);\r\n rgba.toString = () => `rgba(${rrgba[0]}, ${rrgba[1]}, ${rrgba[2]}, ${that.a.toFixed(1)})`;\r\n return rgba;\r\n },\r\n\r\n toCMYK() {\r\n const cmyk = hsvToCmyk(that.h, that.s, that.v);\r\n const rcmyk = cmyk.map(ceil);\r\n\r\n cmyk.toString = () => `cmyk(${rcmyk[0]}%, ${rcmyk[1]}%, ${rcmyk[2]}%, ${rcmyk[3]}%)`;\r\n return cmyk;\r\n },\r\n\r\n toHEXA() {\r\n const hex = hsvToHex(that.h, that.s, that.v);\r\n\r\n hex.toString = () => {\r\n\r\n // Check if alpha channel make sense, convert it to 255 number space, convert\r\n // to hex and pad it with zeros if needet.\r\n const alpha = that.a >= 1 ? '' : Number((that.a * 255).toFixed(0))\r\n .toString(16)\r\n .toUpperCase().padStart(2, '0');\r\n\r\n return `#${hex.join('').toUpperCase() + alpha}`;\r\n };\r\n\r\n return hex;\r\n },\r\n\r\n clone() {\r\n return HSVaColor(that.h, that.s, that.v, that.a);\r\n }\r\n };\r\n\r\n return that;\r\n}\r\n","import * as _ from '../utils/utils';\r\n\r\nconst clamp = v => Math.max(Math.min(v, 1), 0);\r\nexport default function Moveable(opt) {\r\n\r\n const that = {\r\n\r\n // Assign default values\r\n options: Object.assign({\r\n lock: null,\r\n onchange: () => 0\r\n }, opt),\r\n\r\n _tapstart(evt) {\r\n _.on(document, ['mouseup', 'touchend', 'touchcancel'], that._tapstop);\r\n _.on(document, ['mousemove', 'touchmove'], that._tapmove);\r\n\r\n // Prevent default touch event\r\n evt.preventDefault();\r\n\r\n // Trigger\r\n that._tapmove(evt);\r\n },\r\n\r\n _tapmove(evt) {\r\n const {options: {lock}, cache} = that;\r\n const {element, wrapper} = options;\r\n const b = wrapper.getBoundingClientRect();\r\n\r\n let x = 0, y = 0;\r\n if (evt) {\r\n const touch = evt && evt.touches && evt.touches[0];\r\n x = evt ? (touch || evt).clientX : 0;\r\n y = evt ? (touch || evt).clientY : 0;\r\n\r\n // Reset to bounds\r\n if (x < b.left) x = b.left;\r\n else if (x > b.left + b.width) x = b.left + b.width;\r\n if (y < b.top) y = b.top;\r\n else if (y > b.top + b.height) y = b.top + b.height;\r\n\r\n // Normalize\r\n x -= b.left;\r\n y -= b.top;\r\n } else if (cache) {\r\n x = cache.x * b.width;\r\n y = cache.y * b.height;\r\n }\r\n\r\n if (lock !== 'h') {\r\n element.style.left = `calc(${x / b.width * 100}% - ${element.offsetWidth / 2}px)`;\r\n }\r\n\r\n if (lock !== 'v') {\r\n element.style.top = `calc(${y / b.height * 100}% - ${element.offsetHeight / 2}px)`;\r\n }\r\n\r\n that.cache = {x: x / b.width, y: y / b.height};\r\n const cx = clamp(x / wrapper.offsetWidth);\r\n const cy = clamp(y / wrapper.offsetHeight);\r\n\r\n switch (lock) {\r\n case 'v':\r\n return options.onchange(cx);\r\n case 'h':\r\n return options.onchange(cy);\r\n default:\r\n return options.onchange(cx, cy);\r\n }\r\n },\r\n\r\n _tapstop() {\r\n _.off(document, ['mouseup', 'touchend', 'touchcancel'], that._tapstop);\r\n _.off(document, ['mousemove', 'touchmove'], that._tapmove);\r\n },\r\n\r\n trigger() {\r\n that._tapmove();\r\n },\r\n\r\n update(x = 0, y = 0) {\r\n const {left, top, width, height} = that.options.wrapper.getBoundingClientRect();\r\n that._tapmove({\r\n clientX: left + width * x,\r\n clientY: top + height * y\r\n });\r\n },\r\n\r\n destroy() {\r\n const {options, _tapstart} = that;\r\n _.off([options.wrapper, options.element], 'mousedown', _tapstart);\r\n _.off([options.wrapper, options.element], 'touchstart', _tapstart, {\r\n passive: false\r\n });\r\n }\r\n };\r\n\r\n // Initilize\r\n const {options, _tapstart} = that;\r\n _.on([options.wrapper, options.element], 'mousedown', _tapstart);\r\n _.on([options.wrapper, options.element], 'touchstart', _tapstart, {\r\n passive: false\r\n });\r\n\r\n return that;\r\n}\r\n","import * as _ from '../utils/utils';\r\n\r\nexport default function Selectable(opt = {}) {\r\n opt = Object.assign({\r\n onchange: () => 0,\r\n className: '',\r\n elements: []\r\n }, opt);\r\n\r\n const onTap = _.on(opt.elements, 'click', evt => {\r\n opt.elements.forEach(e =>\r\n e.classList[evt.target === e ? 'add' : 'remove'](opt.className)\r\n );\r\n\r\n opt.onchange(evt);\r\n });\r\n\r\n return {\r\n destroy: () => _.off(...onTap)\r\n };\r\n}\r\n","// Import utils\nimport * as _ from './utils/utils';\nimport * as Color from './utils/color';\n\n// Import classes\nimport {HSVaColor} from './utils/hsvacolor';\nimport Moveable from './libs/moveable';\nimport Selectable from './libs/selectable';\nimport Nanopop from './libs/nanopop';\nimport buildPickr from './template';\n\nclass Pickr {\n\n // Will be used to prevent specific actions during initilization\n _initializingActive = true;\n\n // Replace element with color picker\n _recalc = true;\n\n // Current and last color for comparison\n _color = HSVaColor();\n _lastColor = HSVaColor();\n _swatchColors = [];\n\n // Evenlistener name: [callbacks]\n _eventListener = {\n 'swatchselect': [],\n 'change': [],\n 'save': [],\n 'init': []\n };\n\n constructor(opt) {\n\n // Assign default values\n this.options = opt = Object.assign({\n appClass: null,\n useAsButton: false,\n disabled: false,\n comparison: true,\n closeOnScroll: false,\n\n components: {\n interaction: {}\n },\n\n strings: {},\n swatches: null,\n inline: false,\n sliders: 'v',\n\n default: '#42445A',\n defaultRepresentation: null,\n position: 'bottom-middle',\n adjustableNumbers: true,\n showAlways: false,\n\n closeWithKey: 'Escape'\n }, opt);\n\n const {swatches, inline, components} = opt;\n\n // Check interaction section\n if (!components.interaction) {\n components.interaction = {};\n }\n\n // Overwrite palette if preview, opacity or hue are true\n const {preview, opacity, hue, palette} = components;\n components.palette = palette || preview || opacity || hue;\n\n // Per default enabled if inline\n if (inline) {\n opt.showAlways = true;\n }\n\n // Initialize picker\n this._preBuild();\n this._buildComponents();\n this._bindEvents();\n\n // Finalize build\n this._finalBuild();\n\n // Append pre-defined swatch colors\n if (swatches && swatches.length) {\n swatches.forEach(color => this.addSwatch(color));\n }\n\n // Initialize positioning engine\n this._nanopop = Nanopop({\n reference: this._root.button,\n el: this._root.app\n });\n\n // Initilization is finish, pickr is visible and ready for usage\n const {button} = this._root;\n const that = this;\n requestAnimationFrame((function cb() {\n\n // offsetParent of body is always 0. So check if it is the body\n if (button.offsetParent === null && button !== document.body) {\n return requestAnimationFrame(cb);\n }\n\n // Apply default color\n that.setColor(opt.default);\n that._rePositioningPicker();\n\n // Initialize color representation\n if (opt.defaultRepresentation) {\n that._representation = opt.defaultRepresentation;\n that.setColorRepresentation(that._representation);\n }\n\n // Show pickr if locked\n if (opt.showAlways) {\n that.show();\n }\n\n // Initialization is done - pickr is usable, fire init event\n that._initializingActive = false;\n that._emit('init');\n }));\n }\n\n // Does only the absolutly basic thing to initialize the components\n _preBuild() {\n const opt = this.options;\n\n // Check if element is selector\n if (typeof opt.el === 'string') {\n\n // Resolve possible shadow dom access\n opt.el = opt.el.split(/>>/g).reduce((pv, cv, ci, a) => {\n pv = pv.querySelector(cv);\n return ci < a.length - 1 ? pv.shadowRoot : pv;\n }, document);\n }\n\n // Create element and append it to body to\n // prevent initialization errors\n this._root = buildPickr(opt);\n\n // Check if a custom button is used\n if (opt.useAsButton) {\n this._root.button = opt.el; // Replace button with customized button\n }\n\n document.body.appendChild(this._root.root);\n }\n\n _finalBuild() {\n const opt = this.options;\n const root = this._root;\n\n // Remove from body\n document.body.removeChild(root.root);\n\n if (opt.inline) {\n const {parentElement} = opt.el;\n\n if (parentElement.lastChild === opt.el) {\n parentElement.appendChild(root.app);\n } else {\n parentElement.insertBefore(root.app, opt.el.nextSibling);\n }\n } else {\n document.body.appendChild(root.app);\n }\n\n // Don't replace the the element if a custom button is used\n if (!opt.useAsButton) {\n\n // Replace element with actual color-picker\n opt.el.parentNode.replaceChild(root.root, opt.el);\n }\n\n // Call disable to also add the disabled class\n if (opt.disabled) {\n this.disable();\n }\n\n // Check if color comparison is disabled, if yes - remove transitions so everything keeps smoothly\n if (!opt.comparison) {\n root.button.style.transition = 'none';\n if (!opt.useAsButton) {\n root.preview.lastColor.style.transition = 'none';\n }\n }\n\n this.hide();\n }\n\n _buildComponents() {\n\n // Instance reference\n const inst = this;\n const comp = this.options.components;\n const [so, sh] = (() => {\n const {sliders} = inst.options;\n let so = 'v', sh = 'v';\n\n if (sliders.match(/^[vh]+$/g)) {\n if (sliders.length > 1) {\n [so, sh] = sliders;\n } else {\n so = sh = sliders;\n }\n }\n\n const opposite = {v: 'h', h: 'v'};\n return [opposite[so], opposite[sh]];\n })();\n\n const components = {\n\n palette: Moveable({\n element: inst._root.palette.picker,\n wrapper: inst._root.palette.palette,\n\n onchange(x, y) {\n if (!comp.palette) return;\n const {_color, _root, options} = inst;\n\n // Calculate saturation based on the position\n _color.s = x * 100;\n\n // Calculate the value\n _color.v = 100 - y * 100;\n\n // Prevent falling under zero\n _color.v < 0 ? _color.v = 0 : 0;\n\n // Set picker and gradient color\n const cssRGBaString = _color.toRGBA().toString();\n this.element.style.background = cssRGBaString;\n this.wrapper.style.background = `\n linear-gradient(to top, rgba(0, 0, 0, ${_color.a}), transparent),\n linear-gradient(to left, hsla(${_color.h}, 100%, 50%, ${_color.a}), rgba(255, 255, 255, ${_color.a}))\n `;\n\n // Check if color is locked\n if (!options.comparison) {\n _root.button.style.color = cssRGBaString;\n\n if (!options.useAsButton) {\n _root.preview.lastColor.style.color = cssRGBaString;\n }\n }\n\n // Change current color\n _root.preview.currentColor.style.color = cssRGBaString;\n\n // Update the input field only if the user is currently not typing\n if (inst._recalc) {\n inst._updateOutput();\n }\n\n if (!inst.options.comparison) {\n\n // If the user changes the color, remove the cleared icon\n _root.button.classList.remove('clear');\n }\n }\n }),\n\n hue: Moveable({\n lock: sh,\n element: inst._root.hue.picker,\n wrapper: inst._root.hue.slider,\n\n onchange(v) {\n if (!comp.hue || !comp.palette) return;\n\n // Calculate hue\n inst._color.h = v * 360;\n\n // Update color\n this.element.style.backgroundColor = `hsl(${inst._color.h}, 100%, 50%)`;\n components.palette.trigger();\n }\n }),\n\n opacity: Moveable({\n lock: so,\n element: inst._root.opacity.picker,\n wrapper: inst._root.opacity.slider,\n\n onchange(v) {\n if (!comp.opacity || !comp.palette) return;\n\n // Calculate opacity\n inst._color.a = Math.round(v * 1e2) / 100;\n\n // Update color\n this.element.style.background = `rgba(0, 0, 0, ${inst._color.a})`;\n inst.components.palette.trigger();\n }\n }),\n\n selectable: Selectable({\n elements: inst._root.interaction.options,\n className: 'active',\n onchange(e) {\n inst._representation = e.target.getAttribute('data-type').toUpperCase();\n inst._updateOutput();\n }\n })\n };\n\n this.components = components;\n }\n\n _bindEvents() {\n const {_root, options} = this;\n\n const eventBindings = [\n\n // Clear color\n _.on(_root.interaction.clear, 'click', () => this._clearColor()),\n\n // Select last color on click\n _.on(_root.preview.lastColor, 'click', () => this.setHSVA(...this._lastColor.toHSVA())),\n\n // Save color\n _.on(_root.interaction.save, 'click', () => {\n !this.applyColor() && !options.showAlways && this.hide();\n }),\n\n // Detect user input and disable auto-recalculation\n _.on(_root.interaction.result, ['keyup', 'input'], e => {\n this._recalc = false;\n\n // Fire listener if initialization is finish and changed color was valid\n if (this.setColor(e.target.value, true) && !this._initializingActive) {\n this._emit('change', this._color);\n }\n\n e.stopImmediatePropagation();\n }),\n\n // Cancel input detection on color change\n _.on([\n _root.palette.palette,\n _root.palette.picker,\n _root.hue.slider,\n _root.hue.picker,\n _root.opacity.slider,\n _root.opacity.picker\n ], ['mousedown', 'touchstart'], () => this._recalc = true)\n ];\n\n // Provide hiding / showing abilities only if showAlways is false\n if (!options.showAlways) {\n const ck = options.closeWithKey;\n\n eventBindings.push(\n // Save and hide / show picker\n _.on(_root.button, 'click', () => this.isOpen() ? this.hide() : this.show()),\n\n // Close with escape key\n _.on(document, 'keyup', e => this.isOpen() && (e.key === ck || e.code === ck) && this.hide()),\n\n // Cancel selecting if the user taps behind the color picker\n _.on(document, ['touchstart', 'mousedown'], e => {\n if (this.isOpen() && !_.eventPath(e).some(el => el === _root.app || el === _root.button)) {\n this.hide();\n }\n }, {capture: true})\n );\n }\n\n // Make input adjustable if enabled\n if (options.adjustableNumbers) {\n const ranges = {\n rgba: [255, 255, 255, 1],\n hsva: [360, 100, 100, 1],\n hsla: [360, 100, 100, 1],\n cmyk: [100, 100, 100, 100]\n };\n\n _.adjustableInputNumbers(_root.interaction.result, (o, step, index) => {\n const range = ranges[this.getColorRepresentation().toLowerCase()];\n\n if (range) {\n const max = range[index];\n\n // Calculate next reasonable number\n const nv = o + (max >= 100 ? step * 1000 : step);\n\n // Apply range of zero up to max, fix floating-point issues\n return nv <= 0 ? 0 : Number((nv < max ? nv : max).toPrecision(3));\n } else {\n return o;\n }\n });\n }\n\n if (!options.inline) {\n let timeout = null;\n const that = this;\n\n // Re-calc position on window resize, scroll and wheel\n eventBindings.push(\n _.on(window, ['scroll', 'resize'], () => {\n if (that.isOpen()) {\n\n if (options.closeOnScroll) {\n that.hide();\n }\n\n if (timeout === null) {\n timeout = setTimeout(() => timeout = null, 100);\n\n // Update position on every frame\n requestAnimationFrame(function rs() {\n that._rePositioningPicker();\n (timeout !== null) && requestAnimationFrame(rs);\n });\n } else {\n clearTimeout(timeout);\n timeout = setTimeout(() => timeout = null, 100);\n }\n }\n }, {capture: true})\n );\n }\n\n // Save bindings\n this._eventBindings = eventBindings;\n }\n\n _rePositioningPicker() {\n const {options} = this;\n\n // No repositioning needed if inline\n if (!options.inline) {\n this._nanopop.update(options.position);\n }\n }\n\n _updateOutput() {\n\n // Check if component is present\n if (this._root.interaction.type()) {\n\n // Construct function name and call if present\n const method = `to${this._root.interaction.type().getAttribute('data-type')}`;\n this._root.interaction.result.value = typeof this._color[method] === 'function' ? this._color[method]().toString() : '';\n }\n\n // Fire listener if initialization is finish\n if (!this._initializingActive) {\n this._emit('change', this._color);\n }\n }\n\n _clearColor() {\n const {_root, options} = this;\n\n // Change only the button color if it isn't customized\n if (!options.useAsButton) {\n _root.button.style.color = 'rgba(0, 0, 0, 0.15)';\n }\n\n _root.button.classList.add('clear');\n\n if (!options.showAlways) {\n this.hide();\n }\n\n if (!this._initializingActive) {\n\n // Fire listener\n this._emit('save', null);\n }\n }\n\n _emit(event, ...args) {\n this._eventListener[event].forEach(cb => cb(...args, this));\n }\n\n on(event, cb) {\n\n // Validate\n if (typeof cb === 'function' && typeof event === 'string' && event in this._eventListener) {\n this._eventListener[event].push(cb);\n }\n\n return this;\n }\n\n off(event, cb) {\n const callBacks = this._eventListener[event];\n\n if (callBacks) {\n const index = callBacks.indexOf(cb);\n\n if (~index) {\n callBacks.splice(index, 1);\n }\n }\n\n return this;\n }\n\n /**\n * Appends a color to the swatch palette\n * @param color\n * @returns {boolean}\n */\n addSwatch(color) {\n const {values} = Color.parseToHSV(color);\n\n if (values) {\n const {_swatchColors, _root} = this;\n const hsvaColorObject = HSVaColor(...values);\n\n // Create new swatch HTMLElement\n const element = _.createElementFromString(\n `