From 6e1d52d97322049db5cc5cd9816b6f7681170049 Mon Sep 17 00:00:00 2001 From: skjnldsv Date: Thu, 21 Nov 2024 10:11:29 +0100 Subject: [PATCH 1/3] fix: source/dav handling and delete event payload Signed-off-by: skjnldsv --- package-lock.json | 8 ++++---- package.json | 2 +- src/views/Viewer.vue | 28 +++++++++++++++++++--------- 3 files changed, 24 insertions(+), 14 deletions(-) diff --git a/package-lock.json b/package-lock.json index 8e31c42eb..33b6efbdb 100644 --- a/package-lock.json +++ b/package-lock.json @@ -15,7 +15,7 @@ "@nextcloud/axios": "^2.5.1", "@nextcloud/dialogs": "^5.3.7", "@nextcloud/event-bus": "^3.3.1", - "@nextcloud/files": "^3.9.0", + "@nextcloud/files": "^3.10.0", "@nextcloud/initial-state": "^2.2.0", "@nextcloud/l10n": "^3.1.0", "@nextcloud/logger": "^3.0.2", @@ -1812,9 +1812,9 @@ } }, "node_modules/@nextcloud/files": { - "version": "3.9.1", - "resolved": "https://registry.npmjs.org/@nextcloud/files/-/files-3.9.1.tgz", - "integrity": "sha512-eureE0Hi13QhC7detUUlp5B7NjLLu1JnVLDF0yuNv/My5ETbe3SuWjulAXQ2KH3lvqVjhjgbNoEjH5wHemIG+g==", + "version": "3.10.0", + "resolved": "https://registry.npmjs.org/@nextcloud/files/-/files-3.10.0.tgz", + "integrity": "sha512-VvucXNM+Ci/Ej1nK1UAboliiPpAY8az6cDDMoBWxgtfKRL7Q9I0aN2/nl4V9j2JaCm6E4TVWnKXlYDySMPNQKQ==", "license": "AGPL-3.0-or-later", "dependencies": { "@nextcloud/auth": "^2.4.0", diff --git a/package.json b/package.json index 188f96073..d7dc06973 100644 --- a/package.json +++ b/package.json @@ -46,7 +46,7 @@ "@nextcloud/axios": "^2.5.1", "@nextcloud/dialogs": "^5.3.7", "@nextcloud/event-bus": "^3.3.1", - "@nextcloud/files": "^3.9.0", + "@nextcloud/files": "^3.10.0", "@nextcloud/initial-state": "^2.2.0", "@nextcloud/l10n": "^3.1.0", "@nextcloud/logger": "^3.0.2", diff --git a/src/views/Viewer.vue b/src/views/Viewer.vue index ada71c361..c0cd65b05 100644 --- a/src/views/Viewer.vue +++ b/src/views/Viewer.vue @@ -175,11 +175,11 @@ \"},this.getStyleTags=function(){return e.sealed?D(2):e._emitSheetCSS()},this.getStyleElement=function(){var t;if(e.sealed)return D(2);var n=((t={})[N]=\"\",t[\"data-styled-version\"]=\"5.3.11\",t.dangerouslySetInnerHTML={__html:e.instance.toString()},t),o=Y();return o&&(n.nonce=o),[r.createElement(\"style\",y({},n,{key:\"sc-0-0\"}))]},this.seal=function(){e.sealed=!0},this.instance=new X({isServer:!0}),this.sealed=!1}var t=e.prototype;return t.collectStyles=function(e){return this.sealed?D(2):r.createElement(me,{sheet:this.instance},e)},t.interleaveWithNodeStream=function(e){return D(3)},e}(),Je=function(e){var t=r.forwardRef((function(t,n){var o=s(Me),i=e.defaultProps,a=Oe(t,o,i);return\"production\"!==process.env.NODE_ENV&&void 0===a&&console.warn('[withTheme] You are not using a ThemeProvider nor passing a theme prop or a theme in defaultProps in component class \"'+b(e)+'\"'),r.createElement(e,y({},t,{theme:a,ref:n}))}));return m(t,e),t.displayName=\"WithTheme(\"+b(e)+\")\",t},Xe=function(){return s(Me)},Ze={StyleSheet:X,masterSheet:de};\"production\"!==process.env.NODE_ENV&&\"undefined\"!=typeof navigator&&\"ReactNative\"===navigator.product&&console.warn(\"It looks like you've imported 'styled-components' on React Native.\\nPerhaps you're looking to import 'styled-components/native'?\\nRead more about this at https://www.styled-components.com/docs/basics#react-native\"),\"production\"!==process.env.NODE_ENV&&\"test\"!==process.env.NODE_ENV&&\"undefined\"!=typeof window&&(window[\"__styled-components-init__\"]=window[\"__styled-components-init__\"]||0,1===window[\"__styled-components-init__\"]&&console.warn(\"It looks like there are several instances of 'styled-components' initialized in this application. This may cause dynamic styles to not render properly, errors during the rehydration process, a missing theme prop, and makes your application bigger without good reason.\\n\\nSee https://s-c.sh/2BAXzed for more info.\"),window[\"__styled-components-init__\"]+=1);export default qe;export{Ue as ServerStyleSheet,ue as StyleSheetConsumer,ce as StyleSheetContext,me as StyleSheetManager,Ge as ThemeConsumer,Me as ThemeContext,Le as ThemeProvider,Ze as __PRIVATE__,$e as createGlobalStyle,Ae as css,_ as isStyledComponent,We as keyframes,Xe as useTheme,A as version,Je as withTheme};\n//# sourceMappingURL=styled-components.browser.esm.js.map\n","/**\n * Lodash (Custom Build) \n * Build: `lodash modularize exports=\"npm\" -o ./`\n * Copyright OpenJS Foundation and other contributors \n * Released under MIT license \n * Based on Underscore.js 1.8.3 \n * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors\n */\n\n/** Used as the size to enable large array optimizations. */\nvar LARGE_ARRAY_SIZE = 200;\n\n/** Used to stand-in for `undefined` hash values. */\nvar HASH_UNDEFINED = '__lodash_hash_undefined__';\n\n/** Used to detect hot functions by number of calls within a span of milliseconds. */\nvar HOT_COUNT = 800,\n HOT_SPAN = 16;\n\n/** Used as references for various `Number` constants. */\nvar MAX_SAFE_INTEGER = 9007199254740991;\n\n/** `Object#toString` result references. */\nvar argsTag = '[object Arguments]',\n arrayTag = '[object Array]',\n asyncTag = '[object AsyncFunction]',\n boolTag = '[object Boolean]',\n dateTag = '[object Date]',\n errorTag = '[object Error]',\n funcTag = '[object Function]',\n genTag = '[object GeneratorFunction]',\n mapTag = '[object Map]',\n numberTag = '[object Number]',\n nullTag = '[object Null]',\n objectTag = '[object Object]',\n proxyTag = '[object Proxy]',\n regexpTag = '[object RegExp]',\n setTag = '[object Set]',\n stringTag = '[object String]',\n undefinedTag = '[object Undefined]',\n weakMapTag = '[object WeakMap]';\n\nvar arrayBufferTag = '[object ArrayBuffer]',\n dataViewTag = '[object DataView]',\n float32Tag = '[object Float32Array]',\n float64Tag = '[object Float64Array]',\n int8Tag = '[object Int8Array]',\n int16Tag = '[object Int16Array]',\n int32Tag = '[object Int32Array]',\n uint8Tag = '[object Uint8Array]',\n uint8ClampedTag = '[object Uint8ClampedArray]',\n uint16Tag = '[object Uint16Array]',\n uint32Tag = '[object Uint32Array]';\n\n/**\n * Used to match `RegExp`\n * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).\n */\nvar reRegExpChar = /[\\\\^$.*+?()[\\]{}|]/g;\n\n/** Used to detect host constructors (Safari). */\nvar reIsHostCtor = /^\\[object .+?Constructor\\]$/;\n\n/** Used to detect unsigned integer values. */\nvar reIsUint = /^(?:0|[1-9]\\d*)$/;\n\n/** Used to identify `toStringTag` values of typed arrays. */\nvar typedArrayTags = {};\ntypedArrayTags[float32Tag] = typedArrayTags[float64Tag] =\ntypedArrayTags[int8Tag] = typedArrayTags[int16Tag] =\ntypedArrayTags[int32Tag] = typedArrayTags[uint8Tag] =\ntypedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] =\ntypedArrayTags[uint32Tag] = true;\ntypedArrayTags[argsTag] = typedArrayTags[arrayTag] =\ntypedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] =\ntypedArrayTags[dataViewTag] = typedArrayTags[dateTag] =\ntypedArrayTags[errorTag] = typedArrayTags[funcTag] =\ntypedArrayTags[mapTag] = typedArrayTags[numberTag] =\ntypedArrayTags[objectTag] = typedArrayTags[regexpTag] =\ntypedArrayTags[setTag] = typedArrayTags[stringTag] =\ntypedArrayTags[weakMapTag] = false;\n\n/** Detect free variable `global` from Node.js. */\nvar freeGlobal = typeof global == 'object' && global && global.Object === Object && global;\n\n/** Detect free variable `self`. */\nvar freeSelf = typeof self == 'object' && self && self.Object === Object && self;\n\n/** Used as a reference to the global object. */\nvar root = freeGlobal || freeSelf || Function('return this')();\n\n/** Detect free variable `exports`. */\nvar freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports;\n\n/** Detect free variable `module`. */\nvar freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;\n\n/** Detect the popular CommonJS extension `module.exports`. */\nvar moduleExports = freeModule && freeModule.exports === freeExports;\n\n/** Detect free variable `process` from Node.js. */\nvar freeProcess = moduleExports && freeGlobal.process;\n\n/** Used to access faster Node.js helpers. */\nvar nodeUtil = (function() {\n try {\n // Use `util.types` for Node.js 10+.\n var types = freeModule && freeModule.require && freeModule.require('util').types;\n\n if (types) {\n return types;\n }\n\n // Legacy `process.binding('util')` for Node.js < 10.\n return freeProcess && freeProcess.binding && freeProcess.binding('util');\n } catch (e) {}\n}());\n\n/* Node.js helper references. */\nvar nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray;\n\n/**\n * A faster alternative to `Function#apply`, this function invokes `func`\n * with the `this` binding of `thisArg` and the arguments of `args`.\n *\n * @private\n * @param {Function} func The function to invoke.\n * @param {*} thisArg The `this` binding of `func`.\n * @param {Array} args The arguments to invoke `func` with.\n * @returns {*} Returns the result of `func`.\n */\nfunction apply(func, thisArg, args) {\n switch (args.length) {\n case 0: return func.call(thisArg);\n case 1: return func.call(thisArg, args[0]);\n case 2: return func.call(thisArg, args[0], args[1]);\n case 3: return func.call(thisArg, args[0], args[1], args[2]);\n }\n return func.apply(thisArg, args);\n}\n\n/**\n * The base implementation of `_.times` without support for iteratee shorthands\n * or max array length checks.\n *\n * @private\n * @param {number} n The number of times to invoke `iteratee`.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns the array of results.\n */\nfunction baseTimes(n, iteratee) {\n var index = -1,\n result = Array(n);\n\n while (++index < n) {\n result[index] = iteratee(index);\n }\n return result;\n}\n\n/**\n * The base implementation of `_.unary` without support for storing metadata.\n *\n * @private\n * @param {Function} func The function to cap arguments for.\n * @returns {Function} Returns the new capped function.\n */\nfunction baseUnary(func) {\n return function(value) {\n return func(value);\n };\n}\n\n/**\n * Gets the value at `key` of `object`.\n *\n * @private\n * @param {Object} [object] The object to query.\n * @param {string} key The key of the property to get.\n * @returns {*} Returns the property value.\n */\nfunction getValue(object, key) {\n return object == null ? undefined : object[key];\n}\n\n/**\n * Creates a unary function that invokes `func` with its argument transformed.\n *\n * @private\n * @param {Function} func The function to wrap.\n * @param {Function} transform The argument transform.\n * @returns {Function} Returns the new function.\n */\nfunction overArg(func, transform) {\n return function(arg) {\n return func(transform(arg));\n };\n}\n\n/** Used for built-in method references. */\nvar arrayProto = Array.prototype,\n funcProto = Function.prototype,\n objectProto = Object.prototype;\n\n/** Used to detect overreaching core-js shims. */\nvar coreJsData = root['__core-js_shared__'];\n\n/** Used to resolve the decompiled source of functions. */\nvar funcToString = funcProto.toString;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/** Used to detect methods masquerading as native. */\nvar maskSrcKey = (function() {\n var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');\n return uid ? ('Symbol(src)_1.' + uid) : '';\n}());\n\n/**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar nativeObjectToString = objectProto.toString;\n\n/** Used to infer the `Object` constructor. */\nvar objectCtorString = funcToString.call(Object);\n\n/** Used to detect if a method is native. */\nvar reIsNative = RegExp('^' +\n funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\\\$&')\n .replace(/hasOwnProperty|(function).*?(?=\\\\\\()| for .+?(?=\\\\\\])/g, '$1.*?') + '$'\n);\n\n/** Built-in value references. */\nvar Buffer = moduleExports ? root.Buffer : undefined,\n Symbol = root.Symbol,\n Uint8Array = root.Uint8Array,\n allocUnsafe = Buffer ? Buffer.allocUnsafe : undefined,\n getPrototype = overArg(Object.getPrototypeOf, Object),\n objectCreate = Object.create,\n propertyIsEnumerable = objectProto.propertyIsEnumerable,\n splice = arrayProto.splice,\n symToStringTag = Symbol ? Symbol.toStringTag : undefined;\n\nvar defineProperty = (function() {\n try {\n var func = getNative(Object, 'defineProperty');\n func({}, '', {});\n return func;\n } catch (e) {}\n}());\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined,\n nativeMax = Math.max,\n nativeNow = Date.now;\n\n/* Built-in method references that are verified to be native. */\nvar Map = getNative(root, 'Map'),\n nativeCreate = getNative(Object, 'create');\n\n/**\n * The base implementation of `_.create` without support for assigning\n * properties to the created object.\n *\n * @private\n * @param {Object} proto The object to inherit from.\n * @returns {Object} Returns the new object.\n */\nvar baseCreate = (function() {\n function object() {}\n return function(proto) {\n if (!isObject(proto)) {\n return {};\n }\n if (objectCreate) {\n return objectCreate(proto);\n }\n object.prototype = proto;\n var result = new object;\n object.prototype = undefined;\n return result;\n };\n}());\n\n/**\n * Creates a hash object.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction Hash(entries) {\n var index = -1,\n length = entries == null ? 0 : entries.length;\n\n this.clear();\n while (++index < length) {\n var entry = entries[index];\n this.set(entry[0], entry[1]);\n }\n}\n\n/**\n * Removes all key-value entries from the hash.\n *\n * @private\n * @name clear\n * @memberOf Hash\n */\nfunction hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n}\n\n/**\n * Removes `key` and its value from the hash.\n *\n * @private\n * @name delete\n * @memberOf Hash\n * @param {Object} hash The hash to modify.\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction hashDelete(key) {\n var result = this.has(key) && delete this.__data__[key];\n this.size -= result ? 1 : 0;\n return result;\n}\n\n/**\n * Gets the hash value for `key`.\n *\n * @private\n * @name get\n * @memberOf Hash\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction hashGet(key) {\n var data = this.__data__;\n if (nativeCreate) {\n var result = data[key];\n return result === HASH_UNDEFINED ? undefined : result;\n }\n return hasOwnProperty.call(data, key) ? data[key] : undefined;\n}\n\n/**\n * Checks if a hash value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf Hash\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction hashHas(key) {\n var data = this.__data__;\n return nativeCreate ? (data[key] !== undefined) : hasOwnProperty.call(data, key);\n}\n\n/**\n * Sets the hash `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf Hash\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the hash instance.\n */\nfunction hashSet(key, value) {\n var data = this.__data__;\n this.size += this.has(key) ? 0 : 1;\n data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;\n return this;\n}\n\n// Add methods to `Hash`.\nHash.prototype.clear = hashClear;\nHash.prototype['delete'] = hashDelete;\nHash.prototype.get = hashGet;\nHash.prototype.has = hashHas;\nHash.prototype.set = hashSet;\n\n/**\n * Creates an list cache object.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction ListCache(entries) {\n var index = -1,\n length = entries == null ? 0 : entries.length;\n\n this.clear();\n while (++index < length) {\n var entry = entries[index];\n this.set(entry[0], entry[1]);\n }\n}\n\n/**\n * Removes all key-value entries from the list cache.\n *\n * @private\n * @name clear\n * @memberOf ListCache\n */\nfunction listCacheClear() {\n this.__data__ = [];\n this.size = 0;\n}\n\n/**\n * Removes `key` and its value from the list cache.\n *\n * @private\n * @name delete\n * @memberOf ListCache\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction listCacheDelete(key) {\n var data = this.__data__,\n index = assocIndexOf(data, key);\n\n if (index < 0) {\n return false;\n }\n var lastIndex = data.length - 1;\n if (index == lastIndex) {\n data.pop();\n } else {\n splice.call(data, index, 1);\n }\n --this.size;\n return true;\n}\n\n/**\n * Gets the list cache value for `key`.\n *\n * @private\n * @name get\n * @memberOf ListCache\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction listCacheGet(key) {\n var data = this.__data__,\n index = assocIndexOf(data, key);\n\n return index < 0 ? undefined : data[index][1];\n}\n\n/**\n * Checks if a list cache value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf ListCache\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction listCacheHas(key) {\n return assocIndexOf(this.__data__, key) > -1;\n}\n\n/**\n * Sets the list cache `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf ListCache\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the list cache instance.\n */\nfunction listCacheSet(key, value) {\n var data = this.__data__,\n index = assocIndexOf(data, key);\n\n if (index < 0) {\n ++this.size;\n data.push([key, value]);\n } else {\n data[index][1] = value;\n }\n return this;\n}\n\n// Add methods to `ListCache`.\nListCache.prototype.clear = listCacheClear;\nListCache.prototype['delete'] = listCacheDelete;\nListCache.prototype.get = listCacheGet;\nListCache.prototype.has = listCacheHas;\nListCache.prototype.set = listCacheSet;\n\n/**\n * Creates a map cache object to store key-value pairs.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction MapCache(entries) {\n var index = -1,\n length = entries == null ? 0 : entries.length;\n\n this.clear();\n while (++index < length) {\n var entry = entries[index];\n this.set(entry[0], entry[1]);\n }\n}\n\n/**\n * Removes all key-value entries from the map.\n *\n * @private\n * @name clear\n * @memberOf MapCache\n */\nfunction mapCacheClear() {\n this.size = 0;\n this.__data__ = {\n 'hash': new Hash,\n 'map': new (Map || ListCache),\n 'string': new Hash\n };\n}\n\n/**\n * Removes `key` and its value from the map.\n *\n * @private\n * @name delete\n * @memberOf MapCache\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction mapCacheDelete(key) {\n var result = getMapData(this, key)['delete'](key);\n this.size -= result ? 1 : 0;\n return result;\n}\n\n/**\n * Gets the map value for `key`.\n *\n * @private\n * @name get\n * @memberOf MapCache\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction mapCacheGet(key) {\n return getMapData(this, key).get(key);\n}\n\n/**\n * Checks if a map value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf MapCache\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction mapCacheHas(key) {\n return getMapData(this, key).has(key);\n}\n\n/**\n * Sets the map `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf MapCache\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the map cache instance.\n */\nfunction mapCacheSet(key, value) {\n var data = getMapData(this, key),\n size = data.size;\n\n data.set(key, value);\n this.size += data.size == size ? 0 : 1;\n return this;\n}\n\n// Add methods to `MapCache`.\nMapCache.prototype.clear = mapCacheClear;\nMapCache.prototype['delete'] = mapCacheDelete;\nMapCache.prototype.get = mapCacheGet;\nMapCache.prototype.has = mapCacheHas;\nMapCache.prototype.set = mapCacheSet;\n\n/**\n * Creates a stack cache object to store key-value pairs.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction Stack(entries) {\n var data = this.__data__ = new ListCache(entries);\n this.size = data.size;\n}\n\n/**\n * Removes all key-value entries from the stack.\n *\n * @private\n * @name clear\n * @memberOf Stack\n */\nfunction stackClear() {\n this.__data__ = new ListCache;\n this.size = 0;\n}\n\n/**\n * Removes `key` and its value from the stack.\n *\n * @private\n * @name delete\n * @memberOf Stack\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction stackDelete(key) {\n var data = this.__data__,\n result = data['delete'](key);\n\n this.size = data.size;\n return result;\n}\n\n/**\n * Gets the stack value for `key`.\n *\n * @private\n * @name get\n * @memberOf Stack\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction stackGet(key) {\n return this.__data__.get(key);\n}\n\n/**\n * Checks if a stack value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf Stack\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction stackHas(key) {\n return this.__data__.has(key);\n}\n\n/**\n * Sets the stack `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf Stack\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the stack cache instance.\n */\nfunction stackSet(key, value) {\n var data = this.__data__;\n if (data instanceof ListCache) {\n var pairs = data.__data__;\n if (!Map || (pairs.length < LARGE_ARRAY_SIZE - 1)) {\n pairs.push([key, value]);\n this.size = ++data.size;\n return this;\n }\n data = this.__data__ = new MapCache(pairs);\n }\n data.set(key, value);\n this.size = data.size;\n return this;\n}\n\n// Add methods to `Stack`.\nStack.prototype.clear = stackClear;\nStack.prototype['delete'] = stackDelete;\nStack.prototype.get = stackGet;\nStack.prototype.has = stackHas;\nStack.prototype.set = stackSet;\n\n/**\n * Creates an array of the enumerable property names of the array-like `value`.\n *\n * @private\n * @param {*} value The value to query.\n * @param {boolean} inherited Specify returning inherited property names.\n * @returns {Array} Returns the array of property names.\n */\nfunction arrayLikeKeys(value, inherited) {\n var isArr = isArray(value),\n isArg = !isArr && isArguments(value),\n isBuff = !isArr && !isArg && isBuffer(value),\n isType = !isArr && !isArg && !isBuff && isTypedArray(value),\n skipIndexes = isArr || isArg || isBuff || isType,\n result = skipIndexes ? baseTimes(value.length, String) : [],\n length = result.length;\n\n for (var key in value) {\n if ((inherited || hasOwnProperty.call(value, key)) &&\n !(skipIndexes && (\n // Safari 9 has enumerable `arguments.length` in strict mode.\n key == 'length' ||\n // Node.js 0.10 has enumerable non-index properties on buffers.\n (isBuff && (key == 'offset' || key == 'parent')) ||\n // PhantomJS 2 has enumerable non-index properties on typed arrays.\n (isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset')) ||\n // Skip index properties.\n isIndex(key, length)\n ))) {\n result.push(key);\n }\n }\n return result;\n}\n\n/**\n * This function is like `assignValue` except that it doesn't assign\n * `undefined` values.\n *\n * @private\n * @param {Object} object The object to modify.\n * @param {string} key The key of the property to assign.\n * @param {*} value The value to assign.\n */\nfunction assignMergeValue(object, key, value) {\n if ((value !== undefined && !eq(object[key], value)) ||\n (value === undefined && !(key in object))) {\n baseAssignValue(object, key, value);\n }\n}\n\n/**\n * Assigns `value` to `key` of `object` if the existing value is not equivalent\n * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * for equality comparisons.\n *\n * @private\n * @param {Object} object The object to modify.\n * @param {string} key The key of the property to assign.\n * @param {*} value The value to assign.\n */\nfunction assignValue(object, key, value) {\n var objValue = object[key];\n if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) ||\n (value === undefined && !(key in object))) {\n baseAssignValue(object, key, value);\n }\n}\n\n/**\n * Gets the index at which the `key` is found in `array` of key-value pairs.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {*} key The key to search for.\n * @returns {number} Returns the index of the matched value, else `-1`.\n */\nfunction assocIndexOf(array, key) {\n var length = array.length;\n while (length--) {\n if (eq(array[length][0], key)) {\n return length;\n }\n }\n return -1;\n}\n\n/**\n * The base implementation of `assignValue` and `assignMergeValue` without\n * value checks.\n *\n * @private\n * @param {Object} object The object to modify.\n * @param {string} key The key of the property to assign.\n * @param {*} value The value to assign.\n */\nfunction baseAssignValue(object, key, value) {\n if (key == '__proto__' && defineProperty) {\n defineProperty(object, key, {\n 'configurable': true,\n 'enumerable': true,\n 'value': value,\n 'writable': true\n });\n } else {\n object[key] = value;\n }\n}\n\n/**\n * The base implementation of `baseForOwn` which iterates over `object`\n * properties returned by `keysFunc` and invokes `iteratee` for each property.\n * Iteratee functions may exit iteration early by explicitly returning `false`.\n *\n * @private\n * @param {Object} object The object to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @param {Function} keysFunc The function to get the keys of `object`.\n * @returns {Object} Returns `object`.\n */\nvar baseFor = createBaseFor();\n\n/**\n * The base implementation of `getTag` without fallbacks for buggy environments.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the `toStringTag`.\n */\nfunction baseGetTag(value) {\n if (value == null) {\n return value === undefined ? undefinedTag : nullTag;\n }\n return (symToStringTag && symToStringTag in Object(value))\n ? getRawTag(value)\n : objectToString(value);\n}\n\n/**\n * The base implementation of `_.isArguments`.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an `arguments` object,\n */\nfunction baseIsArguments(value) {\n return isObjectLike(value) && baseGetTag(value) == argsTag;\n}\n\n/**\n * The base implementation of `_.isNative` without bad shim checks.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a native function,\n * else `false`.\n */\nfunction baseIsNative(value) {\n if (!isObject(value) || isMasked(value)) {\n return false;\n }\n var pattern = isFunction(value) ? reIsNative : reIsHostCtor;\n return pattern.test(toSource(value));\n}\n\n/**\n * The base implementation of `_.isTypedArray` without Node.js optimizations.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.\n */\nfunction baseIsTypedArray(value) {\n return isObjectLike(value) &&\n isLength(value.length) && !!typedArrayTags[baseGetTag(value)];\n}\n\n/**\n * The base implementation of `_.keysIn` which doesn't treat sparse arrays as dense.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n */\nfunction baseKeysIn(object) {\n if (!isObject(object)) {\n return nativeKeysIn(object);\n }\n var isProto = isPrototype(object),\n result = [];\n\n for (var key in object) {\n if (!(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) {\n result.push(key);\n }\n }\n return result;\n}\n\n/**\n * The base implementation of `_.merge` without support for multiple sources.\n *\n * @private\n * @param {Object} object The destination object.\n * @param {Object} source The source object.\n * @param {number} srcIndex The index of `source`.\n * @param {Function} [customizer] The function to customize merged values.\n * @param {Object} [stack] Tracks traversed source values and their merged\n * counterparts.\n */\nfunction baseMerge(object, source, srcIndex, customizer, stack) {\n if (object === source) {\n return;\n }\n baseFor(source, function(srcValue, key) {\n stack || (stack = new Stack);\n if (isObject(srcValue)) {\n baseMergeDeep(object, source, key, srcIndex, baseMerge, customizer, stack);\n }\n else {\n var newValue = customizer\n ? customizer(safeGet(object, key), srcValue, (key + ''), object, source, stack)\n : undefined;\n\n if (newValue === undefined) {\n newValue = srcValue;\n }\n assignMergeValue(object, key, newValue);\n }\n }, keysIn);\n}\n\n/**\n * A specialized version of `baseMerge` for arrays and objects which performs\n * deep merges and tracks traversed objects enabling objects with circular\n * references to be merged.\n *\n * @private\n * @param {Object} object The destination object.\n * @param {Object} source The source object.\n * @param {string} key The key of the value to merge.\n * @param {number} srcIndex The index of `source`.\n * @param {Function} mergeFunc The function to merge values.\n * @param {Function} [customizer] The function to customize assigned values.\n * @param {Object} [stack] Tracks traversed source values and their merged\n * counterparts.\n */\nfunction baseMergeDeep(object, source, key, srcIndex, mergeFunc, customizer, stack) {\n var objValue = safeGet(object, key),\n srcValue = safeGet(source, key),\n stacked = stack.get(srcValue);\n\n if (stacked) {\n assignMergeValue(object, key, stacked);\n return;\n }\n var newValue = customizer\n ? customizer(objValue, srcValue, (key + ''), object, source, stack)\n : undefined;\n\n var isCommon = newValue === undefined;\n\n if (isCommon) {\n var isArr = isArray(srcValue),\n isBuff = !isArr && isBuffer(srcValue),\n isTyped = !isArr && !isBuff && isTypedArray(srcValue);\n\n newValue = srcValue;\n if (isArr || isBuff || isTyped) {\n if (isArray(objValue)) {\n newValue = objValue;\n }\n else if (isArrayLikeObject(objValue)) {\n newValue = copyArray(objValue);\n }\n else if (isBuff) {\n isCommon = false;\n newValue = cloneBuffer(srcValue, true);\n }\n else if (isTyped) {\n isCommon = false;\n newValue = cloneTypedArray(srcValue, true);\n }\n else {\n newValue = [];\n }\n }\n else if (isPlainObject(srcValue) || isArguments(srcValue)) {\n newValue = objValue;\n if (isArguments(objValue)) {\n newValue = toPlainObject(objValue);\n }\n else if (!isObject(objValue) || isFunction(objValue)) {\n newValue = initCloneObject(srcValue);\n }\n }\n else {\n isCommon = false;\n }\n }\n if (isCommon) {\n // Recursively merge objects and arrays (susceptible to call stack limits).\n stack.set(srcValue, newValue);\n mergeFunc(newValue, srcValue, srcIndex, customizer, stack);\n stack['delete'](srcValue);\n }\n assignMergeValue(object, key, newValue);\n}\n\n/**\n * The base implementation of `_.rest` which doesn't validate or coerce arguments.\n *\n * @private\n * @param {Function} func The function to apply a rest parameter to.\n * @param {number} [start=func.length-1] The start position of the rest parameter.\n * @returns {Function} Returns the new function.\n */\nfunction baseRest(func, start) {\n return setToString(overRest(func, start, identity), func + '');\n}\n\n/**\n * The base implementation of `setToString` without support for hot loop shorting.\n *\n * @private\n * @param {Function} func The function to modify.\n * @param {Function} string The `toString` result.\n * @returns {Function} Returns `func`.\n */\nvar baseSetToString = !defineProperty ? identity : function(func, string) {\n return defineProperty(func, 'toString', {\n 'configurable': true,\n 'enumerable': false,\n 'value': constant(string),\n 'writable': true\n });\n};\n\n/**\n * Creates a clone of `buffer`.\n *\n * @private\n * @param {Buffer} buffer The buffer to clone.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Buffer} Returns the cloned buffer.\n */\nfunction cloneBuffer(buffer, isDeep) {\n if (isDeep) {\n return buffer.slice();\n }\n var length = buffer.length,\n result = allocUnsafe ? allocUnsafe(length) : new buffer.constructor(length);\n\n buffer.copy(result);\n return result;\n}\n\n/**\n * Creates a clone of `arrayBuffer`.\n *\n * @private\n * @param {ArrayBuffer} arrayBuffer The array buffer to clone.\n * @returns {ArrayBuffer} Returns the cloned array buffer.\n */\nfunction cloneArrayBuffer(arrayBuffer) {\n var result = new arrayBuffer.constructor(arrayBuffer.byteLength);\n new Uint8Array(result).set(new Uint8Array(arrayBuffer));\n return result;\n}\n\n/**\n * Creates a clone of `typedArray`.\n *\n * @private\n * @param {Object} typedArray The typed array to clone.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Object} Returns the cloned typed array.\n */\nfunction cloneTypedArray(typedArray, isDeep) {\n var buffer = isDeep ? cloneArrayBuffer(typedArray.buffer) : typedArray.buffer;\n return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length);\n}\n\n/**\n * Copies the values of `source` to `array`.\n *\n * @private\n * @param {Array} source The array to copy values from.\n * @param {Array} [array=[]] The array to copy values to.\n * @returns {Array} Returns `array`.\n */\nfunction copyArray(source, array) {\n var index = -1,\n length = source.length;\n\n array || (array = Array(length));\n while (++index < length) {\n array[index] = source[index];\n }\n return array;\n}\n\n/**\n * Copies properties of `source` to `object`.\n *\n * @private\n * @param {Object} source The object to copy properties from.\n * @param {Array} props The property identifiers to copy.\n * @param {Object} [object={}] The object to copy properties to.\n * @param {Function} [customizer] The function to customize copied values.\n * @returns {Object} Returns `object`.\n */\nfunction copyObject(source, props, object, customizer) {\n var isNew = !object;\n object || (object = {});\n\n var index = -1,\n length = props.length;\n\n while (++index < length) {\n var key = props[index];\n\n var newValue = customizer\n ? customizer(object[key], source[key], key, object, source)\n : undefined;\n\n if (newValue === undefined) {\n newValue = source[key];\n }\n if (isNew) {\n baseAssignValue(object, key, newValue);\n } else {\n assignValue(object, key, newValue);\n }\n }\n return object;\n}\n\n/**\n * Creates a function like `_.assign`.\n *\n * @private\n * @param {Function} assigner The function to assign values.\n * @returns {Function} Returns the new assigner function.\n */\nfunction createAssigner(assigner) {\n return baseRest(function(object, sources) {\n var index = -1,\n length = sources.length,\n customizer = length > 1 ? sources[length - 1] : undefined,\n guard = length > 2 ? sources[2] : undefined;\n\n customizer = (assigner.length > 3 && typeof customizer == 'function')\n ? (length--, customizer)\n : undefined;\n\n if (guard && isIterateeCall(sources[0], sources[1], guard)) {\n customizer = length < 3 ? undefined : customizer;\n length = 1;\n }\n object = Object(object);\n while (++index < length) {\n var source = sources[index];\n if (source) {\n assigner(object, source, index, customizer);\n }\n }\n return object;\n });\n}\n\n/**\n * Creates a base function for methods like `_.forIn` and `_.forOwn`.\n *\n * @private\n * @param {boolean} [fromRight] Specify iterating from right to left.\n * @returns {Function} Returns the new base function.\n */\nfunction createBaseFor(fromRight) {\n return function(object, iteratee, keysFunc) {\n var index = -1,\n iterable = Object(object),\n props = keysFunc(object),\n length = props.length;\n\n while (length--) {\n var key = props[fromRight ? length : ++index];\n if (iteratee(iterable[key], key, iterable) === false) {\n break;\n }\n }\n return object;\n };\n}\n\n/**\n * Gets the data for `map`.\n *\n * @private\n * @param {Object} map The map to query.\n * @param {string} key The reference key.\n * @returns {*} Returns the map data.\n */\nfunction getMapData(map, key) {\n var data = map.__data__;\n return isKeyable(key)\n ? data[typeof key == 'string' ? 'string' : 'hash']\n : data.map;\n}\n\n/**\n * Gets the native function at `key` of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {string} key The key of the method to get.\n * @returns {*} Returns the function if it's native, else `undefined`.\n */\nfunction getNative(object, key) {\n var value = getValue(object, key);\n return baseIsNative(value) ? value : undefined;\n}\n\n/**\n * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the raw `toStringTag`.\n */\nfunction getRawTag(value) {\n var isOwn = hasOwnProperty.call(value, symToStringTag),\n tag = value[symToStringTag];\n\n try {\n value[symToStringTag] = undefined;\n var unmasked = true;\n } catch (e) {}\n\n var result = nativeObjectToString.call(value);\n if (unmasked) {\n if (isOwn) {\n value[symToStringTag] = tag;\n } else {\n delete value[symToStringTag];\n }\n }\n return result;\n}\n\n/**\n * Initializes an object clone.\n *\n * @private\n * @param {Object} object The object to clone.\n * @returns {Object} Returns the initialized clone.\n */\nfunction initCloneObject(object) {\n return (typeof object.constructor == 'function' && !isPrototype(object))\n ? baseCreate(getPrototype(object))\n : {};\n}\n\n/**\n * Checks if `value` is a valid array-like index.\n *\n * @private\n * @param {*} value The value to check.\n * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.\n * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.\n */\nfunction isIndex(value, length) {\n var type = typeof value;\n length = length == null ? MAX_SAFE_INTEGER : length;\n\n return !!length &&\n (type == 'number' ||\n (type != 'symbol' && reIsUint.test(value))) &&\n (value > -1 && value % 1 == 0 && value < length);\n}\n\n/**\n * Checks if the given arguments are from an iteratee call.\n *\n * @private\n * @param {*} value The potential iteratee value argument.\n * @param {*} index The potential iteratee index or key argument.\n * @param {*} object The potential iteratee object argument.\n * @returns {boolean} Returns `true` if the arguments are from an iteratee call,\n * else `false`.\n */\nfunction isIterateeCall(value, index, object) {\n if (!isObject(object)) {\n return false;\n }\n var type = typeof index;\n if (type == 'number'\n ? (isArrayLike(object) && isIndex(index, object.length))\n : (type == 'string' && index in object)\n ) {\n return eq(object[index], value);\n }\n return false;\n}\n\n/**\n * Checks if `value` is suitable for use as unique object key.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is suitable, else `false`.\n */\nfunction isKeyable(value) {\n var type = typeof value;\n return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')\n ? (value !== '__proto__')\n : (value === null);\n}\n\n/**\n * Checks if `func` has its source masked.\n *\n * @private\n * @param {Function} func The function to check.\n * @returns {boolean} Returns `true` if `func` is masked, else `false`.\n */\nfunction isMasked(func) {\n return !!maskSrcKey && (maskSrcKey in func);\n}\n\n/**\n * Checks if `value` is likely a prototype object.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a prototype, else `false`.\n */\nfunction isPrototype(value) {\n var Ctor = value && value.constructor,\n proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto;\n\n return value === proto;\n}\n\n/**\n * This function is like\n * [`Object.keys`](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)\n * except that it includes inherited enumerable properties.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n */\nfunction nativeKeysIn(object) {\n var result = [];\n if (object != null) {\n for (var key in Object(object)) {\n result.push(key);\n }\n }\n return result;\n}\n\n/**\n * Converts `value` to a string using `Object.prototype.toString`.\n *\n * @private\n * @param {*} value The value to convert.\n * @returns {string} Returns the converted string.\n */\nfunction objectToString(value) {\n return nativeObjectToString.call(value);\n}\n\n/**\n * A specialized version of `baseRest` which transforms the rest array.\n *\n * @private\n * @param {Function} func The function to apply a rest parameter to.\n * @param {number} [start=func.length-1] The start position of the rest parameter.\n * @param {Function} transform The rest array transform.\n * @returns {Function} Returns the new function.\n */\nfunction overRest(func, start, transform) {\n start = nativeMax(start === undefined ? (func.length - 1) : start, 0);\n return function() {\n var args = arguments,\n index = -1,\n length = nativeMax(args.length - start, 0),\n array = Array(length);\n\n while (++index < length) {\n array[index] = args[start + index];\n }\n index = -1;\n var otherArgs = Array(start + 1);\n while (++index < start) {\n otherArgs[index] = args[index];\n }\n otherArgs[start] = transform(array);\n return apply(func, this, otherArgs);\n };\n}\n\n/**\n * Gets the value at `key`, unless `key` is \"__proto__\" or \"constructor\".\n *\n * @private\n * @param {Object} object The object to query.\n * @param {string} key The key of the property to get.\n * @returns {*} Returns the property value.\n */\nfunction safeGet(object, key) {\n if (key === 'constructor' && typeof object[key] === 'function') {\n return;\n }\n\n if (key == '__proto__') {\n return;\n }\n\n return object[key];\n}\n\n/**\n * Sets the `toString` method of `func` to return `string`.\n *\n * @private\n * @param {Function} func The function to modify.\n * @param {Function} string The `toString` result.\n * @returns {Function} Returns `func`.\n */\nvar setToString = shortOut(baseSetToString);\n\n/**\n * Creates a function that'll short out and invoke `identity` instead\n * of `func` when it's called `HOT_COUNT` or more times in `HOT_SPAN`\n * milliseconds.\n *\n * @private\n * @param {Function} func The function to restrict.\n * @returns {Function} Returns the new shortable function.\n */\nfunction shortOut(func) {\n var count = 0,\n lastCalled = 0;\n\n return function() {\n var stamp = nativeNow(),\n remaining = HOT_SPAN - (stamp - lastCalled);\n\n lastCalled = stamp;\n if (remaining > 0) {\n if (++count >= HOT_COUNT) {\n return arguments[0];\n }\n } else {\n count = 0;\n }\n return func.apply(undefined, arguments);\n };\n}\n\n/**\n * Converts `func` to its source code.\n *\n * @private\n * @param {Function} func The function to convert.\n * @returns {string} Returns the source code.\n */\nfunction toSource(func) {\n if (func != null) {\n try {\n return funcToString.call(func);\n } catch (e) {}\n try {\n return (func + '');\n } catch (e) {}\n }\n return '';\n}\n\n/**\n * Performs a\n * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * comparison between two values to determine if they are equivalent.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n * @example\n *\n * var object = { 'a': 1 };\n * var other = { 'a': 1 };\n *\n * _.eq(object, object);\n * // => true\n *\n * _.eq(object, other);\n * // => false\n *\n * _.eq('a', 'a');\n * // => true\n *\n * _.eq('a', Object('a'));\n * // => false\n *\n * _.eq(NaN, NaN);\n * // => true\n */\nfunction eq(value, other) {\n return value === other || (value !== value && other !== other);\n}\n\n/**\n * Checks if `value` is likely an `arguments` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an `arguments` object,\n * else `false`.\n * @example\n *\n * _.isArguments(function() { return arguments; }());\n * // => true\n *\n * _.isArguments([1, 2, 3]);\n * // => false\n */\nvar isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) {\n return isObjectLike(value) && hasOwnProperty.call(value, 'callee') &&\n !propertyIsEnumerable.call(value, 'callee');\n};\n\n/**\n * Checks if `value` is classified as an `Array` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an array, else `false`.\n * @example\n *\n * _.isArray([1, 2, 3]);\n * // => true\n *\n * _.isArray(document.body.children);\n * // => false\n *\n * _.isArray('abc');\n * // => false\n *\n * _.isArray(_.noop);\n * // => false\n */\nvar isArray = Array.isArray;\n\n/**\n * Checks if `value` is array-like. A value is considered array-like if it's\n * not a function and has a `value.length` that's an integer greater than or\n * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is array-like, else `false`.\n * @example\n *\n * _.isArrayLike([1, 2, 3]);\n * // => true\n *\n * _.isArrayLike(document.body.children);\n * // => true\n *\n * _.isArrayLike('abc');\n * // => true\n *\n * _.isArrayLike(_.noop);\n * // => false\n */\nfunction isArrayLike(value) {\n return value != null && isLength(value.length) && !isFunction(value);\n}\n\n/**\n * This method is like `_.isArrayLike` except that it also checks if `value`\n * is an object.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an array-like object,\n * else `false`.\n * @example\n *\n * _.isArrayLikeObject([1, 2, 3]);\n * // => true\n *\n * _.isArrayLikeObject(document.body.children);\n * // => true\n *\n * _.isArrayLikeObject('abc');\n * // => false\n *\n * _.isArrayLikeObject(_.noop);\n * // => false\n */\nfunction isArrayLikeObject(value) {\n return isObjectLike(value) && isArrayLike(value);\n}\n\n/**\n * Checks if `value` is a buffer.\n *\n * @static\n * @memberOf _\n * @since 4.3.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a buffer, else `false`.\n * @example\n *\n * _.isBuffer(new Buffer(2));\n * // => true\n *\n * _.isBuffer(new Uint8Array(2));\n * // => false\n */\nvar isBuffer = nativeIsBuffer || stubFalse;\n\n/**\n * Checks if `value` is classified as a `Function` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a function, else `false`.\n * @example\n *\n * _.isFunction(_);\n * // => true\n *\n * _.isFunction(/abc/);\n * // => false\n */\nfunction isFunction(value) {\n if (!isObject(value)) {\n return false;\n }\n // The use of `Object#toString` avoids issues with the `typeof` operator\n // in Safari 9 which returns 'object' for typed arrays and other constructors.\n var tag = baseGetTag(value);\n return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag;\n}\n\n/**\n * Checks if `value` is a valid array-like length.\n *\n * **Note:** This method is loosely based on\n * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.\n * @example\n *\n * _.isLength(3);\n * // => true\n *\n * _.isLength(Number.MIN_VALUE);\n * // => false\n *\n * _.isLength(Infinity);\n * // => false\n *\n * _.isLength('3');\n * // => false\n */\nfunction isLength(value) {\n return typeof value == 'number' &&\n value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;\n}\n\n/**\n * Checks if `value` is the\n * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)\n * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an object, else `false`.\n * @example\n *\n * _.isObject({});\n * // => true\n *\n * _.isObject([1, 2, 3]);\n * // => true\n *\n * _.isObject(_.noop);\n * // => true\n *\n * _.isObject(null);\n * // => false\n */\nfunction isObject(value) {\n var type = typeof value;\n return value != null && (type == 'object' || type == 'function');\n}\n\n/**\n * Checks if `value` is object-like. A value is object-like if it's not `null`\n * and has a `typeof` result of \"object\".\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is object-like, else `false`.\n * @example\n *\n * _.isObjectLike({});\n * // => true\n *\n * _.isObjectLike([1, 2, 3]);\n * // => true\n *\n * _.isObjectLike(_.noop);\n * // => false\n *\n * _.isObjectLike(null);\n * // => false\n */\nfunction isObjectLike(value) {\n return value != null && typeof value == 'object';\n}\n\n/**\n * Checks if `value` is a plain object, that is, an object created by the\n * `Object` constructor or one with a `[[Prototype]]` of `null`.\n *\n * @static\n * @memberOf _\n * @since 0.8.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a plain object, else `false`.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * }\n *\n * _.isPlainObject(new Foo);\n * // => false\n *\n * _.isPlainObject([1, 2, 3]);\n * // => false\n *\n * _.isPlainObject({ 'x': 0, 'y': 0 });\n * // => true\n *\n * _.isPlainObject(Object.create(null));\n * // => true\n */\nfunction isPlainObject(value) {\n if (!isObjectLike(value) || baseGetTag(value) != objectTag) {\n return false;\n }\n var proto = getPrototype(value);\n if (proto === null) {\n return true;\n }\n var Ctor = hasOwnProperty.call(proto, 'constructor') && proto.constructor;\n return typeof Ctor == 'function' && Ctor instanceof Ctor &&\n funcToString.call(Ctor) == objectCtorString;\n}\n\n/**\n * Checks if `value` is classified as a typed array.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.\n * @example\n *\n * _.isTypedArray(new Uint8Array);\n * // => true\n *\n * _.isTypedArray([]);\n * // => false\n */\nvar isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;\n\n/**\n * Converts `value` to a plain object flattening inherited enumerable string\n * keyed properties of `value` to own properties of the plain object.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Lang\n * @param {*} value The value to convert.\n * @returns {Object} Returns the converted plain object.\n * @example\n *\n * function Foo() {\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.assign({ 'a': 1 }, new Foo);\n * // => { 'a': 1, 'b': 2 }\n *\n * _.assign({ 'a': 1 }, _.toPlainObject(new Foo));\n * // => { 'a': 1, 'b': 2, 'c': 3 }\n */\nfunction toPlainObject(value) {\n return copyObject(value, keysIn(value));\n}\n\n/**\n * Creates an array of the own and inherited enumerable property names of `object`.\n *\n * **Note:** Non-object values are coerced to objects.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Object\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.keysIn(new Foo);\n * // => ['a', 'b', 'c'] (iteration order is not guaranteed)\n */\nfunction keysIn(object) {\n return isArrayLike(object) ? arrayLikeKeys(object, true) : baseKeysIn(object);\n}\n\n/**\n * This method is like `_.assign` except that it recursively merges own and\n * inherited enumerable string keyed properties of source objects into the\n * destination object. Source properties that resolve to `undefined` are\n * skipped if a destination value exists. Array and plain object properties\n * are merged recursively. Other objects and value types are overridden by\n * assignment. Source objects are applied from left to right. Subsequent\n * sources overwrite property assignments of previous sources.\n *\n * **Note:** This method mutates `object`.\n *\n * @static\n * @memberOf _\n * @since 0.5.0\n * @category Object\n * @param {Object} object The destination object.\n * @param {...Object} [sources] The source objects.\n * @returns {Object} Returns `object`.\n * @example\n *\n * var object = {\n * 'a': [{ 'b': 2 }, { 'd': 4 }]\n * };\n *\n * var other = {\n * 'a': [{ 'c': 3 }, { 'e': 5 }]\n * };\n *\n * _.merge(object, other);\n * // => { 'a': [{ 'b': 2, 'c': 3 }, { 'd': 4, 'e': 5 }] }\n */\nvar merge = createAssigner(function(object, source, srcIndex) {\n baseMerge(object, source, srcIndex);\n});\n\n/**\n * Creates a function that returns `value`.\n *\n * @static\n * @memberOf _\n * @since 2.4.0\n * @category Util\n * @param {*} value The value to return from the new function.\n * @returns {Function} Returns the new constant function.\n * @example\n *\n * var objects = _.times(2, _.constant({ 'a': 1 }));\n *\n * console.log(objects);\n * // => [{ 'a': 1 }, { 'a': 1 }]\n *\n * console.log(objects[0] === objects[1]);\n * // => true\n */\nfunction constant(value) {\n return function() {\n return value;\n };\n}\n\n/**\n * This method returns the first argument it receives.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Util\n * @param {*} value Any value.\n * @returns {*} Returns `value`.\n * @example\n *\n * var object = { 'a': 1 };\n *\n * console.log(_.identity(object) === object);\n * // => true\n */\nfunction identity(value) {\n return value;\n}\n\n/**\n * This method returns `false`.\n *\n * @static\n * @memberOf _\n * @since 4.13.0\n * @category Util\n * @returns {boolean} Returns `false`.\n * @example\n *\n * _.times(2, _.stubFalse);\n * // => [false, false]\n */\nfunction stubFalse() {\n return false;\n}\n\nmodule.exports = merge;\n","import _defineProperty from \"@babel/runtime/helpers/defineProperty\";\nexport var record = function record(keys, valueType) {\n return keys.reduce(function (toObject, key) {\n return Object.assign(toObject, _defineProperty({}, key, valueType));\n }, {});\n};","function _arrayLikeToArray(r, a) {\n (null == a || a > r.length) && (a = r.length);\n for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e];\n return n;\n}\nexport { _arrayLikeToArray as default };","import arrayLikeToArray from \"./arrayLikeToArray.js\";\nfunction _arrayWithoutHoles(r) {\n if (Array.isArray(r)) return arrayLikeToArray(r);\n}\nexport { _arrayWithoutHoles as default };","function _iterableToArray(r) {\n if (\"undefined\" != typeof Symbol && null != r[Symbol.iterator] || null != r[\"@@iterator\"]) return Array.from(r);\n}\nexport { _iterableToArray as default };","import arrayLikeToArray from \"./arrayLikeToArray.js\";\nfunction _unsupportedIterableToArray(r, a) {\n if (r) {\n if (\"string\" == typeof r) return arrayLikeToArray(r, a);\n var t = {}.toString.call(r).slice(8, -1);\n return \"Object\" === t && r.constructor && (t = r.constructor.name), \"Map\" === t || \"Set\" === t ? Array.from(r) : \"Arguments\" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? arrayLikeToArray(r, a) : void 0;\n }\n}\nexport { _unsupportedIterableToArray as default };","function _nonIterableSpread() {\n throw new TypeError(\"Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\");\n}\nexport { _nonIterableSpread as default };","import arrayWithoutHoles from \"./arrayWithoutHoles.js\";\nimport iterableToArray from \"./iterableToArray.js\";\nimport unsupportedIterableToArray from \"./unsupportedIterableToArray.js\";\nimport nonIterableSpread from \"./nonIterableSpread.js\";\nfunction _toConsumableArray(r) {\n return arrayWithoutHoles(r) || iterableToArray(r) || unsupportedIterableToArray(r) || nonIterableSpread();\n}\nexport { _toConsumableArray as default };","import _toConsumableArray from \"@babel/runtime/helpers/toConsumableArray\";\nexport function generateClassNames(componentName, subClassNames) {\n var generateClassName = function generateClassName(subClassName) {\n return \"Sfx\".concat(componentName).concat(subClassName ? \"-\".concat(subClassName) : '');\n };\n var classNameArray = [];\n if (subClassNames) {\n if (Array.isArray(subClassNames)) {\n classNameArray.push.apply(classNameArray, _toConsumableArray(subClassNames.filter(function (subClassName) {\n return typeof subClassName === 'string';\n }).map(function (subClassName) {\n return generateClassName(subClassName);\n })));\n } else if (typeof subClassNames === 'string') {\n classNameArray.push(generateClassName(subClassNames));\n }\n }\n if (classNameArray.length === 0) {\n classNameArray.push(generateClassName());\n }\n return classNameArray.join(' ');\n}","import { forwardRef } from 'react';\n/**\r\n * Wrapper around React's `forwardRef` function, which adds a `displayName` to each component\r\n * created using it\r\n */\nexport function intrinsicComponent(render, displayName) {\n var component = /*#__PURE__*/forwardRef(render);\n // eslint-disable-next-line immutable/no-mutation\n component.displayName = displayName || render.name;\n return component;\n}","/**\r\n * Type-safe Object.keys\r\n */\nexport function objectKeys(object) {\n return Object.keys(object);\n}","/**\r\n * Type-safe Object.values\r\n */\nexport function objectValues(object) {\n return Object.values(object);\n}","/**\r\n * If your prop can be either a function or a plain value, this function handles\r\n * its usage for you – just provide the reference for a 'maybe function' and the arguments\r\n * to call it with\r\n */\nexport function applyPolymorphicFunctionProp(prop) {\n for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n args[_key - 1] = arguments[_key];\n }\n return typeof prop === 'function' ? prop.apply(void 0, args) : prop;\n}","import _defineProperty from \"@babel/runtime/helpers/defineProperty\";\n/**\r\n * If you are using a namespace for your styled components, this can come in handy giving each\r\n * styled component in this namespace a displayName which gives better debugging experience\r\n */\nexport function applyDisplayNames(styledObject) {\n return Object.keys(styledObject).reduce(function (newStyledObject, styledComponentName) {\n var styledComponent = styledObject[styledComponentName];\n styledComponent.displayName = \"\".concat(styledComponentName);\n return Object.assign(newStyledObject, _defineProperty({}, styledComponentName, styledComponent));\n }, {});\n}","/**\r\n * passes {value} to {ref}\r\n * Useful if you want to expose the ref of an inner component to the public API\r\n * while still using it inside the component.\r\n * @param ref A ref callback or ref object. If anything falsy, this is a no-op.\r\n */\nexport default function setRef(ref, value) {\n if (typeof ref === 'function') {\n ref(value);\n } else if (ref) {\n ref.current = value;\n }\n}","import * as React from 'react';\nimport setRef from './set-ref';\nexport function useForkRef(refA, refB) {\n /**\r\n * This will create a new function if the ref props change and are defined.\r\n * This means react will call the old forkRef with `null` and the new forkRef\r\n * with the ref. Cleanup naturally emerges from this behavior.\r\n */\n return React.useMemo(function () {\n if (refA == null && refB == null) {\n return null;\n }\n return function (refValue) {\n setRef(refA, refValue);\n setRef(refB, refValue);\n };\n }, [refA, refB]);\n}","export function restrictNumber(number) {\n var min = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;\n var max = arguments.length > 2 ? arguments[2] : undefined;\n // we are not assigning default value for it as if max was null it will override the default value.\n var currentMax = max || 1000000;\n var convertedNumber = +number;\n return Math.min(Math.max(min, convertedNumber), currentMax);\n}","export function mapNumber(number, oldMin, oldMax, newMin, newMax) {\n return (number - oldMin) * (newMax - newMin) / (oldMax - oldMin) + newMin;\n}","import _toConsumableArray from \"@babel/runtime/helpers/toConsumableArray\";\nexport var rgbStringToArray = function rgbStringToArray(rgbColorString) {\n return rgbColorString.replaceAll(/[^\\d,]/gi, '').split(',').map(function (n) {\n return +n;\n });\n};\nexport var hexToRgb = function hexToRgb(hexColor) {\n // if (!hexColor) return { r: 0, g: 0, b: 0 };\n if (!hexColor) return [0, 0, 0];\n return [Number.parseInt(hexColor.slice(1, 3), 16), Number.parseInt(hexColor.slice(3, 5), 16), Number.parseInt(hexColor.slice(5, 7), 16)];\n};\nvar rgbChannelToHex = function rgbChannelToHex(channel) {\n return channel.toString(16).padStart(2, '0');\n};\nexport var rgbToHex = function rgbToHex() {\n for (var _len = arguments.length, rgbColor = new Array(_len), _key = 0; _key < _len; _key++) {\n rgbColor[_key] = arguments[_key];\n }\n return \"#\".concat(rgbColor.map(rgbChannelToHex).join(''));\n};\nexport var hslToHex = function hslToHex(h, s, l) {\n var dividedL = l / 100;\n var a = s * Math.min(dividedL, 1 - dividedL) / 100;\n var f = function f(n) {\n var k = (n + h / 30) % 12;\n var color = dividedL - a * Math.max(Math.min(k - 3, 9 - k, 1), -1);\n return rgbChannelToHex(Math.round(255 * color));\n };\n return \"#\".concat(f(0)).concat(f(8)).concat(f(4));\n};\nexport var rgbToHsl = function rgbToHsl() {\n for (var _len2 = arguments.length, rgbColor = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {\n rgbColor[_key2] = arguments[_key2];\n }\n var r = rgbColor[0],\n g = rgbColor[1],\n b = rgbColor[2];\n r /= 255;\n g /= 255;\n b /= 255;\n var min = Math.min(r, g, b);\n var max = Math.max(r, g, b);\n var h;\n var s;\n var l = (max + min) / 2;\n if (max === min) {\n h = 0;\n s = 0;\n } else {\n var diff = max - min;\n s = l > 0.5 ? diff / (2 - max - min) : diff / (max + min);\n switch (max) {\n case r:\n h = (g - b) / diff + (g < b ? 6 : 0);\n break;\n case g:\n h = (b - r) / diff + 2;\n break;\n case b:\n h = (r - g) / diff + 4;\n break;\n default:\n h = 0;\n }\n h /= 6;\n }\n\n // * 360 for having the hue in degrees\n return [Math.round(h * 360), Math.round(s * 100), Math.round(l * 100)];\n};\nexport var colorToHsl = function colorToHsl(color) {\n if (color.startsWith('#')) {\n var hex = color;\n if (color.length === 4) {\n hex = \"#\".concat(color[1]).concat(color[1]).concat(color[2]).concat(color[2]).concat(color[3]).concat(color[3]);\n }\n return rgbToHsl.apply(void 0, _toConsumableArray(hexToRgb(hex)));\n }\n if (color.startsWith('rgb')) {\n var colorInRgb = rgbStringToArray(color);\n return rgbToHsl.apply(void 0, _toConsumableArray(colorInRgb));\n }\n\n // if the color is in text and no one from previous then return the default color which is black\n if (typeof color === 'string') {\n return [0, 0, 0];\n }\n return color;\n};\nexport var colorToRgb = function colorToRgb(color) {\n // we are not handling (hsl/color name) here cause we are accepting only HEX and RGB colors as default colors from user.\n if (color.startsWith('#')) {\n return hexToRgb(color);\n }\n if (color.startsWith('rgb')) {\n return rgbStringToArray(color);\n }\n if (typeof color === 'string') {\n return [0, 0, 0];\n }\n return color;\n};\nexport var colorToHex = function colorToHex(color) {\n if (color.startsWith('#')) {\n if (color.length === 7) {\n return color;\n }\n return \"#\".concat(color[0]).concat(color[0]).concat(color[1]).concat(color[1]).concat(color[2]).concat(color[2]);\n }\n if (color.startsWith('rgb')) {\n return rgbToHex.apply(void 0, _toConsumableArray(rgbStringToArray(color)));\n }\n if (typeof color === 'string') {\n return '#000000';\n }\n return color;\n};\nvar checkIsBlack = function checkIsBlack(s, l) {\n return l === 0 && (s === 0 || s === 1);\n};\nvar checkIsWhite = function checkIsWhite(s, l) {\n return s === 0 && l === 1;\n};\n\n// both hsv and hsl values are in [0, 1] except h is in [0, 360]\nexport var hsvToHsl = function hsvToHsl(h, s, v) {\n var newS = s;\n var l = (2 - s) * v / 2;\n if (l !== 0) {\n if (l === 1) {\n newS = 0;\n } else if (l < 0.5) {\n newS = newS * v / (l * 2);\n } else {\n newS = newS * v / (2 - l * 2);\n }\n }\n var isBlack = checkIsBlack(newS, l);\n return [isBlack || checkIsWhite(newS, l) ? 0 : h, isBlack ? 0 : Math.round(newS * 100), Math.round(l * 100)];\n};\n\n// both hsv and hsl values are in [0, 1] except h is in [0, 360]\nexport var hslToHsv = function hslToHsv(h, s, l) {\n var newS = s;\n var newL = l * 2;\n newS *= newL <= 1 ? newL : 2 - newL;\n var v = (newL + newS) / 2;\n newS = 2 * newS / (newL + newS);\n\n // return [h, newS, v];\n var isBlack = checkIsBlack(newS, l);\n return [isBlack || checkIsWhite(newS, l) ? 0 : h, isBlack ? 0 : Math.round(newS * 100), Math.round(v * 100)];\n};\n\n// TODO: validating 3 color code for Hex\n// /^#([\\da-f]{3}){1,2}$/i.test(color)colorToHex\nexport var validateHex = function validateHex(color) {\n return /^#[\\da-f]{6}$/i.test(color);\n};","export function getElemDocumentCoords(elem) {\n if (!elem) {\n return null;\n }\n var box = elem.getBoundingClientRect();\n var _document = document,\n body = _document.body;\n var docEl = document.documentElement;\n var scrollTop = window.pageYOffset || docEl.scrollTop || body.scrollTop;\n var scrollLeft = window.pageXOffset || docEl.scrollLeft || body.scrollLeft;\n var clientTop = docEl.clientTop || body.clientTop || 0;\n var clientLeft = docEl.clientLeft || body.clientLeft || 0;\n var top = box.top + scrollTop - clientTop;\n var left = box.left + scrollLeft - clientLeft;\n return {\n top: Math.round(top),\n left: Math.round(left),\n width: box.width,\n height: box.height\n };\n}","export function asc(a, b) {\n return a - b;\n}\nexport function valueToPercent(value, min, max) {\n return (value - min) * 100 / (max - min);\n}\nexport function percentToValue(percent, min, max) {\n return (max - min) * percent + min;\n}\nfunction getDecimalPrecision(num) {\n // This handles the case when num is very small (0.00000001), js will turn this into 1e-8.\n // When num is bigger than 1 or less than -1 it won't get converted to this notation so it's fine.\n if (Math.abs(num) < 1) {\n var parts = num.toExponential().split('e-');\n var matissaDecimalPart = parts[0].split('.')[1];\n return (matissaDecimalPart ? matissaDecimalPart.length : 0) + Number.parseInt(parts[1], 10);\n }\n var decimalPart = num.toString().split('.')[1];\n return decimalPart ? decimalPart.length : 0;\n}\nexport function roundValueToStep(value, step, min) {\n var nearest = Math.round((value - min) / step) * step + min;\n return Number(nearest.toFixed(getDecimalPrecision(step)));\n}\nexport function setValueIndex(_ref) {\n var values = _ref.values,\n newValue = _ref.newValue,\n index = _ref.index;\n var output = values.slice();\n output[index] = newValue;\n return output.sort(asc);\n}\nexport function findClosest(values, currentValue) {\n var _values$reduce = values.reduce(function (acc, value, index) {\n var distance = Math.abs(currentValue - value);\n if (acc === null || distance < acc.distance || distance === acc.distance) {\n return {\n distance: distance,\n index: index\n };\n }\n return acc;\n }, null),\n closestIndex = _values$reduce.index;\n return closestIndex;\n}\nexport function ownerDocument(node) {\n return node && node.ownerDocument || document;\n}\nexport function clamp(value, min, max) {\n if (value == null) {\n return min;\n }\n return Math.min(Math.max(min, value), max);\n}\nexport function trackFinger(event, touchId) {\n if (touchId.current !== undefined && event.changedTouches) {\n for (var i = 0; i < event.changedTouches.length; i += 1) {\n var touch = event.changedTouches[i];\n if (touch.identifier === touchId.current) {\n return {\n x: touch.clientX,\n y: touch.clientY\n };\n }\n }\n return false;\n }\n return {\n x: event.clientX,\n y: event.clientY\n };\n}\nexport var axisProps = {\n horizontal: {\n offset: function offset(percent) {\n return {\n left: \"\".concat(percent, \"%\")\n };\n },\n leap: function leap(percent) {\n return {\n width: \"\".concat(percent, \"%\")\n };\n }\n },\n 'horizontal-reverse': {\n offset: function offset(percent) {\n return {\n right: \"\".concat(percent, \"%\")\n };\n },\n leap: function leap(percent) {\n return {\n width: \"\".concat(percent, \"%\")\n };\n }\n },\n vertical: {\n offset: function offset(percent) {\n return {\n bottom: \"\".concat(percent, \"%\")\n };\n },\n leap: function leap(percent) {\n return {\n height: \"\".concat(percent, \"%\")\n };\n }\n }\n};\nexport function focusThumb(_ref2) {\n var sliderRef = _ref2.sliderRef,\n activeIndex = _ref2.activeIndex,\n setActive = _ref2.setActive;\n var doc = ownerDocument(sliderRef.current);\n if (!sliderRef.current.contains(doc.activeElement) || Number(doc.activeElement.getAttribute('data-index')) !== activeIndex) {\n var _sliderRef$current$qu;\n (_sliderRef$current$qu = sliderRef.current.querySelector(\"[type=\\\"range\\\"][data-index=\\\"\".concat(activeIndex, \"\\\"]\"))) === null || _sliderRef$current$qu === void 0 || _sliderRef$current$qu.focus();\n }\n if (setActive) {\n setActive(activeIndex);\n }\n}","export var Color = {\n TextPrimary: 'txt-primary',\n TextSecondary: 'txt-secondary',\n TextSecondaryInvert: 'txt-secondary-invert',\n TextPlaceholder: 'txt-placeholder',\n TextWarning: 'txt-warning',\n TextError: 'txt-error',\n TextInfo: 'txt-info',\n AccentPrimary: 'accent-primary',\n AccentPrimaryHover: 'accent-primary-hover',\n AccentPrimaryActive: 'accent-primary-active',\n AccentPrimaryDisabled: 'accent-primary-disabled',\n AccentSecondaryDisabled: 'accent-secondary-disabled',\n AccentStateless: 'accent-stateless',\n AccentStateless_0_4_Opacity: 'accent-stateless_0_4_opacity',\n Accent_0_5_Opacity: 'accent_0_5_opacity',\n Accent_1_2_Opacity: 'accent_1_2_opacity',\n Accent_1_8_Opacity: 'accent_1_8_opacity',\n Accent_2_8_Opacity: 'accent_2_8_opacity',\n Accent_4_0_Opacity: 'accent_4_0_opacity',\n BackgroundGrey: 'bg-grey',\n BackgroundStateless: 'bg-stateless',\n BackgroundActive: 'bg-active',\n BackgroundBaseLight: 'bg-base-light',\n BackgroundBaseMedium: 'bg-base-medium',\n BackgroundPrimary: 'bg-primary',\n BackgroundPrimaryLight: 'bg-primary-light',\n BackgroundPrimaryHover: 'bg-primary-hover',\n BackgroundPrimaryActive: 'bg-primary-active',\n BackgroundPrimaryStateless: 'bg-primary-stateless',\n BackgroundPrimary_0_5_Opacity: 'bg-primary-0-5-opacity',\n BackgroundSecondary: 'bg-secondary',\n BackgroundHover: 'bg-hover',\n BackgroundGreen: 'bg-green',\n BackgroundGreenMedium: 'bg-green-medium',\n BackgroundBlue: 'bg-blue',\n BackgroundRed: 'bg-red',\n BackgroundRedLight: 'bg-red-light',\n BackgroundRedMedium: 'background-red-medium',\n BackgroundOrange: 'bg-orange',\n BackgroundTooltip: 'bg-tooltip',\n IconsPrimary: 'icon-primary',\n IconsPrimaryOpacity_0_6: 'icons-primary-opacity-0-6',\n IconsSecondary: 'icons-secondary',\n IconsPlaceholder: 'icons-placeholder',\n IconsInvert: 'icons-invert',\n IconsMuted: 'icons-muted',\n IconsPrimaryHover: 'icons-primary-hover',\n IconsSecondaryHover: 'icons-secondary-hover',\n ButtonPrimaryText: 'btn-primary-text',\n ButtonPrimaryText_0_6: 'btn-primary-text-0-6',\n ButtonPrimaryText_0_4: 'btn-primary-text-0-4',\n ButtonDisabledText: 'btn-disabled-text',\n ButtonSecondaryText: 'btn-secondary-text',\n LinkPrimary: 'link-primary',\n LinkStateless: 'link-stateless',\n LinkHover: 'link-hover',\n LinkActive: 'link-active',\n LinkMuted: 'link-muted',\n LinkPressed: 'link-pressed',\n BordersPrimary: 'borders-primary',\n BordersPrimaryHover: 'borders-primary-hover',\n BordersSecondary: 'borders-secondary',\n BordersStrong: 'borders-strong',\n BordersInvert: 'borders-invert',\n BorderHoverBottom: 'border-hover-bottom',\n BorderActiveBottom: 'border-active-bottom',\n BorderPrimaryStateless: 'border-primary-stateless',\n BordersDisabled: 'borders-disabled',\n BordersButton: 'borders-button',\n BordersItem: 'borders-item',\n BordersBaseLight: 'borders-base-light',\n BordersBaseMedium: 'borders-base-medium',\n BordersGreen: 'borders-green',\n BordersGreenMedium: 'borders-green-medium',\n BordersRed: 'borders-red',\n ActiveSecondary: 'active-secondary',\n ActiveSecondaryHover: 'active-secondary-hover',\n Tag: 'tag',\n StatesErrorDisabledText: 'states-error-disabled-text',\n Error: 'error',\n Error_0_28_Opacity: 'error-0-28-opacity',\n Error_0_12_Opacity: 'error-0-12-opacity',\n ErrorHover: 'error-hover',\n ErrorActive: 'error-active',\n Success: 'success',\n SuccessHover: 'success-hover',\n SuccessActive: 'success-Active',\n Warning: 'warning',\n WarningHover: 'warning-hover',\n WarningActive: 'warning-active',\n Info: 'info',\n Modified: 'modified',\n Red: 'red',\n Orange: 'orange',\n Salad: 'salad',\n Green: 'green',\n Blue: 'blue',\n Indigo: 'indigo',\n Violet: 'violet',\n Pink: 'pink',\n GradientRight: 'gradient-right',\n Extra_0_3_Overlay: 'extra-0-3-overlay',\n GradientRightActive: 'gradient-right-active',\n GradientRightHover: 'gradient-right-hover',\n Extra_0_5_Overlay: 'extra-0-5-overlay',\n Extra_0_7_Overlay: 'extra-0-7-overlay',\n Extra_0_9_Overlay: 'extra-0-9-overlay',\n Red_0_1_Overlay: 'red-0-1-overlay',\n Orange_0_1_Overlay: 'orange-0-1-overlay',\n Accent_0_8_Overlay: 'accent-0-8-overlay',\n Link: 'link',\n Camera: 'camera',\n GoogleDrive: 'google-drive',\n Dropbox: 'dropbox',\n OneDrive: 'one-drive',\n Device: 'device',\n Instagram: 'instagram',\n FreeImages: 'free-images',\n FreeIcons: 'free-icons',\n Canvas: 'canvas',\n Box: 'box',\n ScreenCast: 'screen-cast',\n Unsplash: 'unsplash',\n LightShadow: 'light-shadow',\n MediumShadow: 'medium-shadow',\n LargeShadow: 'large-shadow',\n XLargeShadow: 'x-large-shadow'\n};","import { css } from 'styled-components';\nimport { Color as PaletteColor } from '../types/palette';\nexport var scrollBar = function scrollBar(_ref) {\n var palette = _ref.theme.palette;\n return css([\"scrollbar-color:\", \" \", \";scrollbar-width:thin;::-webkit-scrollbar{width:12px;}::-webkit-scrollbar-track{margin-block:6px;}::-webkit-scrollbar-thumb{background:\", \";border:4px solid \", \";border-radius:99px;padding:4px 6px;background-clip:padding-box;}\"], palette[PaletteColor.IconsMuted], palette[PaletteColor.ActiveSecondary], palette[PaletteColor.Extra_0_3_Overlay], palette[PaletteColor.ActiveSecondary]);\n};","export var Breakpoint = {\n Xs: 'xs',\n Sm: 'sm',\n Md: 'md',\n Lg: 'lg',\n Xl: 'xl',\n Xxl: 'xxl',\n Xxxl: 'xxxl'\n};\nexport var BreakpointClass = {\n Xs: '.sfx-breakpoint-xs',\n Sm: '.sfx-breakpoint-sm',\n Md: '.sfx-breakpoint-md',\n Lg: '.sfx-breakpoint-lg',\n Xl: '.sfx-breakpoint-xl',\n Xxl: '.sfx-breakpoint-xxl',\n Xxxl: '.sfx-breakpoint-xxxl'\n};","export var Shadows = {\n ShadowSm: 'shadow-sm',\n ShadowMd: 'shadow-md',\n ShadowLg: 'shadow-lg',\n ShadowXl: 'shadow-xl',\n Label: 'label',\n Header: 'header',\n HeaderPopup: 'header-popup',\n FooterPopup: 'footer-popup',\n LeftPanelMd: 'left-panel-md',\n RightPanelMd: 'right-panel-md',\n LeftPanelSm: 'left-panel-sm',\n RightPanelSm: 'right-panel-sm'\n};","export var FontWeight = {\n Thin: 100,\n ExtraLight: 200,\n Light: 300,\n Regular: 400,\n Medium: 500,\n SemiBold: 600,\n Bold: 700,\n ExtraBold: 800,\n Black: 900\n};","export var FontVariant = {\n TextExtraSmall: 'text-extra-small',\n TextSmall: 'text-small',\n TextSmallUp: 'text-small-up',\n TextMedium: 'text-medium',\n TextLarge: 'text-large',\n TextExtraLarge: 'text-extra-large',\n TextXExtraLarge: 'text-x-extra-large',\n TitleH6: 'title-h6',\n TitleH5: 'title-h5',\n TitleH4: 'title-h4',\n TitleH3: 'title-h3',\n TitleH2: 'title-h2',\n TitleH1: 'title-h1',\n LabelExtraSmall: 'label-extra-small',\n LabelExtraSmallEmphasis: 'label-extra-small-emphasis',\n LabelExtraSmallUp: 'label-extra-small-up',\n LabelSmall: 'label-small',\n LabelSmallEmphasis: 'label-small-emphasis',\n LabelSmallUp: 'label-small-up',\n LabelSmallUpEmphasis: 'label-small-up-emphasis',\n LabelMedium: 'label-medium',\n LabelMediumEmphasis: 'label-medium-emphasis',\n LabelLarge: 'label-large',\n LabelLargeEmphasis: 'label-large-emphasis',\n LabelLargeUp: 'label-large-up',\n LabelExtraLargeEmphasis: 'label-extra-large-emphasis',\n LabelExtraLarge: 'label-extra-large',\n LabelXExtraLargeEmphasis: 'label-x-extra-large-emphasis',\n LabelXExtraLarge: 'label-x-extra-large',\n LabelXXExtraLargeEmphasis: 'label-x-x-extra-large-emphasis',\n LabelXXExtraLarge: 'label-x-x-extra-large',\n LabelXXXExtraLarge: 'label-x-x-x-extra-large',\n ButtonSmEmphasis: 'btn-sm-emphasis',\n ButtonSm: 'btn-sm',\n ButtonSmUpEmphasis: 'btn-sm-up-emphasis',\n ButtonSmUp: 'btn-sm-up',\n ButtonMdEmphasis: 'btn-md-emphasis',\n ButtonMd: 'btn-md',\n ButtonLgEmphasis: 'btn-lg-emphasis',\n ButtonLg: 'btn-lg',\n ButtonLgUpEmphasis: 'btn-lg-up-emphasis',\n ButtonLgUp: 'btn-lg-up',\n LinkSmall: 'link-small',\n LinkSmallEmphasis: 'link-small-emphasis',\n LinkSmallUp: 'link-small-up',\n LinkSmallUpEmphasis: 'link-small-up-emphasis',\n LinkMedium: 'link-medium',\n LinkMediumEmphasis: 'link-medium-emphasis',\n LinkLarge: 'link-large',\n LinkLargeEmphasis: 'link-large-emphasis',\n LinkLargeUp: 'link-large-up',\n LinkLargeUpEmphasis: 'link-large-up-emphasis',\n InputSm: 'input-sm',\n InputSmUp: 'input-sm-up',\n InputMd: 'input-md',\n InputLg: 'input-lg'\n};","export var BorderRadiusSize = {\n Sm: 'sm',\n Md: 'md',\n Lg: 'lg'\n};","import { createGlobalStyle, css } from 'styled-components';\nvar Typography = /*#__PURE__*/createGlobalStyle([\"\", \";\"], function (_ref) {\n var theme = _ref.theme;\n var baseLineHeight = theme.typography.baseLineHeight;\n return css([\"h1,h2,h3,h4,h5,h6,p,small{line-height:\", \";}\"], baseLineHeight);\n});\nexport default Typography;","import _defineProperty from \"@babel/runtime/helpers/defineProperty\";\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\n/* eslint-disable sonarjs/no-duplicate-string */\nimport { FontVariant, FontWeight } from '../../../../utils/types/typography';\nvar defaultFontValue = {\n fontFamily: '\"Roboto\"',\n fontStyle: 'normal',\n fontWeight: FontWeight.Regular\n};\nvar getLabelFontVariants = function getLabelFontVariants() {\n var _ref;\n var fontOverride = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n return _ref = {}, _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_ref, FontVariant.LabelExtraSmall, _objectSpread(_objectSpread({}, defaultFontValue), {}, {\n fontSize: '10px',\n lineHeight: '12px'\n }, fontOverride)), FontVariant.LabelExtraSmallEmphasis, _objectSpread(_objectSpread({}, defaultFontValue), {}, {\n fontWeight: 'Bold',\n fontSize: '10px',\n lineHeight: '12px'\n }, fontOverride)), FontVariant.LabelExtraSmallUp, _objectSpread(_objectSpread({}, defaultFontValue), {}, {\n fontSize: '11px',\n lineHeight: '12px'\n }, fontOverride)), FontVariant.LabelSmall, _objectSpread(_objectSpread({}, defaultFontValue), {}, {\n fontSize: '12px',\n lineHeight: '14px'\n }, fontOverride)), FontVariant.LabelSmallEmphasis, _objectSpread(_objectSpread({}, defaultFontValue), {}, {\n fontWeight: FontWeight.Medium,\n fontSize: '12px',\n lineHeight: '14px'\n }, fontOverride)), FontVariant.LabelSmallUp, _objectSpread(_objectSpread({\n fontSize: '13px',\n lineHeight: '16px'\n }, defaultFontValue), fontOverride)), FontVariant.LabelSmallUpEmphasis, _objectSpread(_objectSpread({}, defaultFontValue), {}, {\n fontWeight: FontWeight.Medium,\n fontSize: '13px',\n lineHeight: '16px'\n }, fontOverride)), FontVariant.LabelMedium, _objectSpread(_objectSpread({\n fontSize: '14px',\n lineHeight: '16px'\n }, defaultFontValue), fontOverride)), FontVariant.LabelMediumEmphasis, _objectSpread(_objectSpread({}, defaultFontValue), {}, {\n fontWeight: FontWeight.Medium,\n fontSize: '14px',\n lineHeight: '16px'\n }, fontOverride)), FontVariant.LabelLarge, _objectSpread(_objectSpread({}, defaultFontValue), {}, {\n fontSize: '16px',\n lineHeight: '18px'\n }, fontOverride)), _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_ref, FontVariant.LabelLargeEmphasis, _objectSpread(_objectSpread({}, defaultFontValue), {}, {\n fontWeight: FontWeight.Medium,\n fontSize: '16px',\n lineHeight: '18px'\n }, fontOverride)), FontVariant.LabelLargeUp, _objectSpread(_objectSpread({}, defaultFontValue), {}, {\n fontWeight: FontWeight.Regular,\n fontSize: '18px',\n lineHeight: '20px'\n }, fontOverride)), FontVariant.LabelExtraLargeEmphasis, _objectSpread(_objectSpread({}, defaultFontValue), {}, {\n fontWeight: FontWeight.Medium,\n fontSize: '24px',\n lineHeight: '28px'\n }, fontOverride)), FontVariant.LabelExtraLarge, _objectSpread(_objectSpread({}, defaultFontValue), {}, {\n fontWeight: FontWeight.Regular,\n fontSize: '24px',\n lineHeight: '28px'\n }, fontOverride)), FontVariant.LabelXExtraLargeEmphasis, _objectSpread(_objectSpread({}, defaultFontValue), {}, {\n fontWeight: FontWeight.Medium,\n fontSize: '32px',\n lineHeight: '36px'\n }, fontOverride)), FontVariant.LabelXExtraLarge, _objectSpread(_objectSpread({}, defaultFontValue), {}, {\n fontSize: '32px',\n lineHeight: '36px'\n }, fontOverride)), FontVariant.LabelXXExtraLargeEmphasis, _objectSpread(_objectSpread({}, defaultFontValue), {}, {\n fontWeight: FontWeight.Medium,\n fontSize: '48px',\n lineHeight: '54px'\n }, fontOverride)), FontVariant.LabelXXExtraLarge, _objectSpread(_objectSpread({}, defaultFontValue), {}, {\n fontSize: '48px',\n lineHeight: '54px'\n }, fontOverride)), FontVariant.LabelXXXExtraLarge, _objectSpread(_objectSpread({}, defaultFontValue), {}, {\n fontSize: '60px',\n lineHeight: '68px'\n }, fontOverride));\n};\nvar getTextFontVariants = function getTextFontVariants() {\n var fontOverride = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n return _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({}, FontVariant.TextExtraSmall, _objectSpread(_objectSpread({}, getLabelFontVariants()[FontVariant.LabelExtraSmallUp]), {}, {\n lineHeight: '14px'\n }, fontOverride)), FontVariant.TextSmall, _objectSpread(_objectSpread({}, defaultFontValue), {}, {\n fontSize: '12px',\n lineHeight: '18px'\n }, fontOverride)), FontVariant.TextSmallUp, _objectSpread(_objectSpread({}, defaultFontValue), {}, {\n fontSize: '13px',\n lineHeight: '18px'\n }, fontOverride)), FontVariant.TextMedium, _objectSpread(_objectSpread({}, defaultFontValue), {}, {\n fontSize: '14px',\n lineHeight: '20px'\n }, fontOverride)), FontVariant.TextLarge, _objectSpread(_objectSpread({}, defaultFontValue), {}, {\n fontSize: '16px',\n lineHeight: '22px'\n }, fontOverride)), FontVariant.TextExtraLarge, _objectSpread(_objectSpread({}, defaultFontValue), {}, {\n fontSize: '18px',\n lineHeight: '26px'\n }, fontOverride)), FontVariant.TextXExtraLarge, _objectSpread(_objectSpread({}, defaultFontValue), {}, {\n fontSize: '28px',\n lineHeight: '40px'\n }, fontOverride));\n};\nvar getButtonFontVariants = function getButtonFontVariants() {\n var fontOverride = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n return _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({}, FontVariant.ButtonSmEmphasis, _objectSpread(_objectSpread({}, defaultFontValue), {}, {\n fontWeight: FontWeight.Medium,\n fontSize: '12px',\n lineHeight: '14px'\n }, fontOverride)), FontVariant.ButtonSm, _objectSpread(_objectSpread({}, defaultFontValue), {}, {\n fontSize: '12px',\n lineHeight: '14px'\n }, fontOverride)), FontVariant.ButtonSmUpEmphasis, _objectSpread(_objectSpread({}, defaultFontValue), {}, {\n fontWeight: FontWeight.Medium,\n fontSize: '13px',\n lineHeight: '16px'\n }, fontOverride)), FontVariant.ButtonSmUp, _objectSpread(_objectSpread({}, defaultFontValue), {}, {\n fontSize: '13px',\n lineHeight: '16px'\n }, fontOverride)), FontVariant.ButtonMdEmphasis, _objectSpread(_objectSpread({}, defaultFontValue), {}, {\n fontWeight: FontWeight.Medium,\n fontSize: '14px',\n lineHeight: '16px'\n }, fontOverride)), FontVariant.ButtonMd, _objectSpread(_objectSpread({}, defaultFontValue), {}, {\n fontSize: '14px',\n lineHeight: '16px'\n }, fontOverride)), FontVariant.ButtonLgEmphasis, _objectSpread(_objectSpread({}, defaultFontValue), {}, {\n fontWeight: FontWeight.Medium,\n fontSize: '16px',\n lineHeight: '18px'\n }, fontOverride)), FontVariant.ButtonLg, _objectSpread(_objectSpread({}, defaultFontValue), {}, {\n fontSize: '16px',\n lineHeight: '18px'\n }, fontOverride)), FontVariant.ButtonLgUpEmphasis, _objectSpread(_objectSpread({}, defaultFontValue), {}, {\n fontWeight: FontWeight.Medium,\n fontSize: '18px',\n lineHeight: '20px'\n }, fontOverride)), FontVariant.ButtonLgUp, _objectSpread(_objectSpread({}, defaultFontValue), {}, {\n fontSize: '18px',\n lineHeight: '20px'\n }, fontOverride));\n};\nvar getLinkFontVariants = function getLinkFontVariants() {\n var fontOverride = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n return _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({}, FontVariant.LinkSmall, _objectSpread(_objectSpread({}, defaultFontValue), {}, {\n fontSize: '12px',\n lineHeight: '14px'\n }, fontOverride)), FontVariant.LinkSmallEmphasis, _objectSpread(_objectSpread({}, defaultFontValue), {}, {\n fontWeight: FontWeight.Medium,\n fontSize: '12px',\n lineHeight: '14px'\n }, fontOverride)), FontVariant.LinkSmallUp, _objectSpread(_objectSpread({}, defaultFontValue), {}, {\n fontSize: '13px',\n lineHeight: '16px'\n }, fontOverride)), FontVariant.LinkSmallUpEmphasis, _objectSpread(_objectSpread({}, defaultFontValue), {}, {\n fontWeight: FontWeight.Medium,\n fontSize: '13px',\n lineHeight: '16px'\n }, fontOverride)), FontVariant.LinkMedium, _objectSpread(_objectSpread({}, defaultFontValue), {}, {\n fontSize: '14px',\n lineHeight: '16px'\n }, fontOverride)), FontVariant.LinkMediumEmphasis, _objectSpread(_objectSpread({}, defaultFontValue), {}, {\n fontWeight: FontWeight.Medium,\n fontSize: '14px',\n lineHeight: '16px'\n }, fontOverride)), FontVariant.LinkLarge, _objectSpread(_objectSpread({}, defaultFontValue), {}, {\n fontSize: '16px',\n lineHeight: '18px'\n }, fontOverride)), FontVariant.LinkLargeEmphasis, _objectSpread(_objectSpread({}, defaultFontValue), {}, {\n fontWeight: FontWeight.Medium,\n fontSize: '16px',\n lineHeight: '18px'\n }, fontOverride)), FontVariant.LinkLargeUp, _objectSpread(_objectSpread({}, defaultFontValue), {}, {\n fontSize: '18px',\n lineHeight: '20px'\n }, fontOverride)), FontVariant.LinkLargeUpEmphasis, _objectSpread(_objectSpread({}, defaultFontValue), {}, {\n fontWeight: FontWeight.Medium,\n fontSize: '18px',\n lineHeight: '20px'\n }, fontOverride));\n};\nvar getInputFontVariants = function getInputFontVariants() {\n var fontOverride = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n return _defineProperty(_defineProperty(_defineProperty(_defineProperty({}, FontVariant.InputSm, _objectSpread(_objectSpread({}, defaultFontValue), {}, {\n fontSize: '12px',\n lineHeight: '14px'\n }, fontOverride)), FontVariant.InputSmUp, _objectSpread(_objectSpread({}, defaultFontValue), {}, {\n fontSize: '13px',\n lineHeight: '16px'\n }, fontOverride)), FontVariant.InputMd, _objectSpread(_objectSpread({}, defaultFontValue), {}, {\n fontSize: '14px',\n lineHeight: '16px'\n }, fontOverride)), FontVariant.InputLg, _objectSpread(_objectSpread({}, defaultFontValue), {}, {\n fontSize: '16px',\n lineHeight: '18px'\n }, fontOverride));\n};\nvar getTitleFontVariants = function getTitleFontVariants() {\n var fontOverride = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n return _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({}, FontVariant.TitleH6, _objectSpread(_objectSpread({}, defaultFontValue), {}, {\n fontWeight: FontWeight.Medium,\n fontSize: '12px',\n lineHeight: '18px'\n }, fontOverride)), FontVariant.TitleH5, _objectSpread(_objectSpread({}, defaultFontValue), {}, {\n fontWeight: FontWeight.Medium,\n fontSize: '14px',\n lineHeight: '21px'\n }, fontOverride)), FontVariant.TitleH4, _objectSpread(_objectSpread({}, defaultFontValue), {}, {\n fontWeight: FontWeight.Medium,\n fontSize: '16px',\n lineHeight: '24px'\n }, fontOverride)), FontVariant.TitleH3, _objectSpread(_objectSpread({}, defaultFontValue), {}, {\n fontWeight: FontWeight.Medium,\n fontSize: '18px',\n lineHeight: '27px'\n }, fontOverride)), FontVariant.TitleH2, _objectSpread(_objectSpread({}, defaultFontValue), {}, {\n fontWeight: FontWeight.Medium,\n fontSize: '20px',\n lineHeight: '30px'\n }, fontOverride)), FontVariant.TitleH1, _objectSpread(_objectSpread({}, defaultFontValue), {}, {\n fontWeight: FontWeight.Medium,\n fontSize: '28px',\n lineHeight: '42px'\n }, fontOverride));\n};\n\n// eslint-disable-next-line @typescript-eslint/explicit-function-return-type\nexport var getDefaultTypography = function getDefaultTypography() {\n var typographyOverride = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n return _objectSpread(_objectSpread({\n fontFamily: defaultFontValue.fontFamily,\n baseLineHeight: 1.375\n }, typographyOverride), {}, {\n font: _objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread({}, getLabelFontVariants(typographyOverride)), getTextFontVariants(typographyOverride)), getButtonFontVariants(typographyOverride)), getLinkFontVariants(typographyOverride)), getInputFontVariants(typographyOverride)), getTitleFontVariants(typographyOverride))\n });\n};","import { createGlobalStyle /* , css */ } from 'styled-components';\n\n// Example with theme: ${({ theme }) => css``;\n\nvar CommonStyles = /*#__PURE__*/createGlobalStyle([\"@keyframes spinner{0%{transform:rotate(0deg);}100%{transform:rotate(360deg);}}.Menu-open{overflow:hidden;}.Modal-open{overflow:hidden;}\"]);\nexport default CommonStyles;","import _defineProperty from \"@babel/runtime/helpers/defineProperty\";\nvar _lightPalette;\n/* eslint-disable sonarjs/no-duplicate-string */\nimport { Color } from '../../../../utils/types/palette';\nexport var lightPalette = (_lightPalette = {}, _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_lightPalette, Color.TextPrimary, 'rgba(55, 65, 75, 1)'), Color.TextSecondary, 'rgba(118, 138, 159, 1)'), Color.TextSecondaryInvert, 'rgba(213, 216, 220, 1)'), Color.TextPlaceholder, 'rgba(169, 182, 194, 1)'), Color.TextWarning, 'rgba(196, 110, 0, 1)'), Color.TextError, 'rgba(185, 33, 46, 1)'), Color.TextInfo, 'rgba(35, 117, 171, 1)'), Color.AccentPrimary, 'rgba(104, 121, 235, 1)'), Color.AccentPrimaryHover, 'rgba(96, 111, 209, 1)'), Color.AccentPrimaryActive, 'rgba(73, 88, 188, 1)'), _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_lightPalette, Color.AccentPrimaryDisabled, 'rgba(233, 238, 242, 1)'), Color.AccentSecondaryDisabled, '#F9FBFC'), Color.AccentStateless, 'rgba(104, 121, 235, 1)'), Color.AccentStateless_0_4_Opacity, 'rgba(104, 121, 235, 0.4)'), Color.Accent_0_5_Opacity, 'rgba(104, 121, 235, 0.05)'), Color.Accent_1_2_Opacity, 'rgba(104, 121, 235, 0.12)'), Color.Accent_1_8_Opacity, 'rgba(104, 121, 235, 0.18)'), Color.Accent_2_8_Opacity, 'rgba(104, 121, 235, 0.28)'), Color.Accent_4_0_Opacity, 'rgba(104, 121, 235, 0.4)'), Color.BackgroundGrey, 'rgba(216, 224, 232, 1)'), _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_lightPalette, Color.BackgroundStateless, 'rgba(255, 255, 255, 1)'), Color.BackgroundActive, 'rgba(243, 247, 250, 1)'), Color.BackgroundBaseLight, 'rgba(235, 239, 252, 1)'), Color.BackgroundBaseMedium, 'rgba(227, 231, 251, 1)'), Color.BackgroundPrimary, 'rgba(248, 250, 251, 1)'), Color.BackgroundPrimaryLight, 'rgba(243, 245, 247, 1)'), Color.BackgroundPrimaryHover, 'rgba(239, 243, 246, 1)'), Color.BackgroundPrimaryActive, 'rgba(93, 109, 126, 1)'), Color.BackgroundPrimary_0_5_Opacity, 'rgba(255, 255, 255, 0.500)'), Color.BackgroundPrimaryStateless, '#CCD6DE'), _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_lightPalette, Color.BackgroundSecondary, 'rgba(255, 255, 255, 1)'), Color.BackgroundHover, 'rgba(249, 251, 252, 1)'), Color.BackgroundGreen, 'rgba(237, 250, 244, 1)'), Color.BackgroundGreenMedium, 'rgba(227, 250, 239, 1)'), Color.BackgroundBlue, 'rgba(244, 249, 255, 1)'), Color.BackgroundRed, 'rgba(253, 244, 242, 1)'), Color.BackgroundRedLight, 'rgba(255, 245, 245, 1)'), Color.BackgroundRedMedium, 'rgba(247, 228, 230, 1)'), Color.BackgroundOrange, 'rgba(255, 249, 242, 1)'), Color.BackgroundTooltip, 'rgba(79, 98, 118, 1)'), _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_lightPalette, Color.IconsPrimary, 'rgba(118, 138, 159, 1)'), Color.IconsPrimaryOpacity_0_6, 'rgba(93, 109, 126, 0.600)'), Color.IconsSecondary, 'rgba(151, 166, 182, 1)'), Color.IconsPlaceholder, 'rgba(223, 231, 237, 1)'), Color.IconsInvert, 'rgba(255, 255, 255, 1)'), Color.IconsMuted, 'rgba(169, 182, 194, 1)'), Color.IconsPrimaryHover, 'rgba(79, 98, 118, 1)'), Color.IconsSecondaryHover, 'rgba(118, 138, 159, 1)'), Color.ButtonPrimaryText, 'rgba(255, 255, 255, 1)'), Color.ButtonPrimaryText_0_6, 'rgba(255, 255, 255, 0.6)'), _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_lightPalette, Color.ButtonPrimaryText_0_4, 'rgba(255, 255, 255, 0.4)'), Color.ButtonDisabledText, 'rgba(169, 182, 194, 1)'), Color.ButtonSecondaryText, 'rgba(0, 0, 0, 1)'), Color.LinkPrimary, 'rgba(118, 138, 159, 1)'), Color.LinkStateless, 'rgba(118, 138, 159, 1)'), Color.LinkHover, 'rgba(79, 98, 118, 1)'), Color.LinkActive, 'rgba(55, 65, 75, 1)'), Color.LinkPressed, 'rgba(104, 121, 235, 1)'), Color.LinkMuted, 'rgba(169, 182, 194, 1)'), Color.BordersPrimary, 'rgba(204, 214, 222, 1)'), _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_lightPalette, Color.BordersPrimaryHover, 'rgba(104, 118, 134, 1)'), Color.BordersSecondary, 'rgba(236, 240, 243, 1)'), Color.BordersStrong, 'rgba(204, 214, 222, 1)'), Color.BordersInvert, 'rgba(85, 99, 115, 1)'), Color.BorderHoverBottom, 'rgba(104, 121, 235, 0.18)'), Color.BorderActiveBottom, '#4958BC'), Color.BorderPrimaryStateless, 'rgba(204, 214, 222, 1)'), Color.BordersDisabled, 'rgba(73, 88, 188, 0.4)'), Color.BordersButton, 'rgba(151, 166, 182, 1)'), Color.BordersItem, 'rgba(226, 232, 236, 1)'), _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_lightPalette, Color.BordersBaseLight, 'rgba(211, 219, 250, 1)'), Color.BordersBaseMedium, 'rgba(164, 175, 227, 1)'), Color.BordersGreen, 'rgba(27, 161, 99, 0.22)'), Color.BordersGreenMedium, 'rgba(27, 161, 99, 0.4)'), Color.BordersRed, 'rgba(185, 33, 46, 0.4)'), Color.ActiveSecondary, '#FFFFFF'), Color.ActiveSecondaryHover, 'rgba(104, 121, 235, 0.05)'), Color.Error, 'rgba(246, 61, 61, 1)'), Color.Error_0_28_Opacity, 'rgba(185, 33, 46, 0.28)'), Color.Error_0_12_Opacity, 'rgba(255, 86, 78, 0.1)'), _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_lightPalette, Color.ErrorHover, 'rgba(216, 46, 46, 1)'), Color.ErrorActive, 'rgba(185, 33, 46, 1)'), Color.Success, 'rgba(38, 193, 122, 1)'), Color.SuccessHover, 'rgba(30, 154, 98, 1)'), Color.SuccessActive, 'rgba(23, 116, 73, 1)'), Color.Warning, 'rgba(255, 172, 74, 1)'), Color.WarningHover, 'rgba(237, 145, 7, 1)'), Color.WarningActive, 'rgba(224, 135, 0, 1)'), Color.Info, 'rgba(41, 127, 184, 1)'), Color.Modified, 'rgba(165, 166, 246, 1)'), _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_lightPalette, Color.Red, 'rgba(219, 46, 50, 1)'), Color.Orange, 'rgba(255, 168, 0, 1)'), Color.Salad, 'rgba(143, 176, 33, 1)'), Color.Green, 'rgba(22, 160, 134, 1)'), Color.Blue, 'rgba(41, 127, 184, 1)'), Color.Indigo, 'rgba(91, 72, 162, 1)'), Color.Violet, 'rgba(141, 68, 173, 1)'), Color.Pink, 'rgba(211, 92, 158, 1)'), Color.GradientRight, 'linear-gradient(270deg, #FFFFFF 1.56%, rgba(255, 255, 255, 0.89) 52.4%, rgba(255, 255, 255, 0.532165) 76.04%, rgba(255, 255, 255, 0) 100%)'), Color.Extra_0_3_Overlay, 'rgba(79, 98, 118, 0.3)'), _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_lightPalette, Color.GradientRightActive, 'linear-gradient(270deg, #F3F7FA 1.56%, #F3F7FA 52.4%, rgba(243, 247, 250, 0.53) 76.04%, rgba(243, 247, 250, 0) 100%)'), Color.GradientRightHover, 'linear-gradient(270deg, #F9FBFC 1.56%, #F9FBFC 52.4%, rgba(249, 251, 252, 0.53) 76.04%, rgba(249, 251, 252, 0) 100%)'), Color.Extra_0_5_Overlay, 'rgba(79, 98, 118, 0.5)'), Color.Extra_0_7_Overlay, 'rgba(79, 98, 118, 0.7)'), Color.Extra_0_9_Overlay, 'rgba(79, 98, 118, 0.9)'), Color.Red_0_1_Overlay, 'rgba(232, 91, 70, 0.1)'), Color.Orange_0_1_Overlay, 'rgba(250, 157, 47, 0.1)'), Color.Accent_0_8_Overlay, 'rgba(104, 121, 235, 0.08)'), Color.Link, 'rgba(250, 166, 68, 1)'), Color.Camera, 'rgba(73, 186, 224, 1)'), _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_lightPalette, Color.GoogleDrive, 'rgba(81, 136, 238, 1)'), Color.Dropbox, 'rgba(17, 40, 124, 1)'), Color.OneDrive, 'rgba(40, 100, 186, 1)'), Color.Device, 'rgba(102, 73, 209, 1)'), Color.Instagram, 'rgba(244, 70, 154, 1)'), Color.Unsplash, 'rgba(173, 38, 220, 1)'), Color.FreeImages, 'rgba(16, 163, 135, 1)'), Color.FreeIcons, 'rgba(62, 207, 139, 1)'), Color.Canvas, 'rgba(36, 190, 202, 1)'), Color.Box, 'rgba(0, 97, 213, 1)'), _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_lightPalette, Color.ScreenCast, 'rgba(48, 61, 78, 1)'), Color.Tag, '#889AAC'), Color.StatesErrorDisabledText, 'rgba(185, 33, 46, 0.3)'), Color.LightShadow, 'rgba(146, 166, 188, 0.2)'), Color.MediumShadow, 'rgba(146, 166, 188, 0.24)'), Color.LargeShadow, 'rgba(146, 166, 188, 0.32)'), Color.XLargeShadow, 'rgba(146, 166, 188, 0.5)'));\nexport var defaultPalette = lightPalette;","import _defineProperty from \"@babel/runtime/helpers/defineProperty\";\nvar _shadows;\nimport { Shadows } from '../../../../utils/types/shadows';\nexport var shadows = (_shadows = {}, _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_shadows, Shadows.ShadowSm, '0px 1px 2px 0px rgba(146, 166, 188, 0.2)'), Shadows.ShadowMd, ' 0px 1px 4px 0px rgba(146, 166, 188, 0.24)'), Shadows.ShadowLg, ' 0px 2px 6px 0px rgba(146, 166, 188, 0.32)'), Shadows.ShadowXl, ' 0px 2px 6px 0px rgba(146, 166, 188, 0.5)'), Shadows.Label, ' 0px 1px 3px 0px rgba(77, 78, 78, 0.15)'), Shadows.Header, ' 0px 6px 10px 0px rgba(146, 166, 188, 0.2)'), Shadows.HeaderPopup, ' 0px 3px 7px 0px rgba(146, 166, 188, 0.16)'), Shadows.FooterPopup, ' 0px -4px 8px 0px rgba(208, 215, 220, 0.22)'), Shadows.LeftPanelMd, ' 6px 8px 12px 0px rgba(146, 166, 188, 0.14)'), Shadows.RightPanelMd, '-6px 8px 12px 0px rgba(146, 166, 188, 0.14)'), _defineProperty(_defineProperty(_shadows, Shadows.LeftPanelSm, '6px -4px 12px 0px rgba(146, 166, 188, 0.14)'), Shadows.RightPanelSm, '-6px -4px 12px 0px rgba(146, 166, 188, 0.14)'));\nexport var defaultShadows = shadows;","import _defineProperty from \"@babel/runtime/helpers/defineProperty\";\nimport { Breakpoint } from '../../../../utils/types/css';\nexport var defaultBreakpoints = {\n keys: [Breakpoint.Xs, Breakpoint.Sm, Breakpoint.Md, Breakpoint.Lg, Breakpoint.Xl],\n values: _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({}, Breakpoint.Xs, 0), Breakpoint.Sm, 576), Breakpoint.Md, 768), Breakpoint.Lg, 1084), Breakpoint.Xl, 1342), Breakpoint.Xxl, 1600), Breakpoint.Xxxl, 1920),\n classes: _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({}, Breakpoint.Xs, '.sfx-breakpoint-xs'), Breakpoint.Sm, '.sfx-breakpoint-sm'), Breakpoint.Md, '.sfx-breakpoint-md'), Breakpoint.Lg, '.sfx-breakpoint-lg'), Breakpoint.Xl, '.sfx-breakpoint-xl'), Breakpoint.Xxl, '.sfx-breakpoint-xxl'), Breakpoint.Xxxl, '.sfx-breakpoint-xxxl'),\n getBreakpointClass: function getBreakpointClass() {\n return '';\n },\n up: function up() {\n return '';\n },\n down: function down() {\n return '';\n },\n between: function between() {\n return '';\n },\n only: function only() {\n return '';\n }\n};","import { defaultBreakpoints } from './default-breakpoints';\nvar createBreakpoints = function createBreakpoints(breakpoints) {\n var _breakpoints$values = breakpoints.values,\n values = _breakpoints$values === void 0 ? defaultBreakpoints.values : _breakpoints$values,\n _breakpoints$classes = breakpoints.classes,\n classes = _breakpoints$classes === void 0 ? defaultBreakpoints.classes : _breakpoints$classes;\n var unit = 'px';\n var keys = Object.keys(values);\n var up = function up(key) {\n var value = typeof values[key] === 'number' ? values[key] : key;\n return \"@media (min-width:\".concat(value).concat(unit, \")\");\n };\n var down = function down(key) {\n var value = values[key];\n return \"@media (max-width:\".concat(value).concat(unit, \")\");\n };\n var between = function between(start, end) {\n var endIndex = keys.indexOf(end);\n return \"@media (min-width:\".concat(values[start]).concat(unit, \") and (max-width:\").concat(values[keys[endIndex]]).concat(unit, \")\");\n };\n var only = function only(key) {\n if (keys.indexOf(key) + 1 < keys.length) {\n return between(key, keys[keys.indexOf(key) + 1]);\n }\n return up(key);\n };\n var getBreakpointClass = function getBreakpointClass(width, hideSelector) {\n var removeSelector = function removeSelector(str) {\n return str.slice(1);\n };\n if (width >= values.xs && width < values.sm) {\n return hideSelector ? removeSelector(classes.xs) : classes.xs;\n }\n if (width >= values.sm && width < values.md) {\n return hideSelector ? removeSelector(classes.sm) : classes.sm;\n }\n if (width >= values.md && width < values.lg) {\n return hideSelector ? removeSelector(classes.md) : classes.md;\n }\n if (width >= values.lg && width < values.xl) {\n return hideSelector ? removeSelector(classes.lg) : classes.lg;\n }\n if (width >= values.xl && width < values.xxl) {\n return hideSelector ? removeSelector(classes.xl) : classes.xl;\n }\n if (width >= values.xxl && width < values.xxxl) {\n return hideSelector ? removeSelector(classes.xxl) : classes.xxl;\n }\n if (width >= values.xxxl) {\n return hideSelector ? removeSelector(classes.xxxl) : classes.xxxl;\n }\n return hideSelector ? removeSelector(classes.md) : classes.md;\n };\n return {\n keys: keys,\n values: values,\n classes: classes,\n getBreakpointClass: getBreakpointClass,\n up: up,\n down: down,\n between: between,\n only: only\n };\n};\nexport default createBreakpoints;","import _objectWithoutProperties from \"@babel/runtime/helpers/objectWithoutProperties\";\nimport _defineProperty from \"@babel/runtime/helpers/defineProperty\";\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nimport React, { useMemo } from 'react';\nimport PT from 'prop-types';\nimport { ThemeProvider as SCThemeProvider } from 'styled-components';\nimport merge from 'lodash.merge';\nimport { record } from '../../utils/types/prop-types';\nimport { applyPolymorphicFunctionProp, objectKeys, objectValues } from '../../utils/functions';\nimport { Breakpoint } from '../../utils/types/css';\nimport { Color } from '../../utils/types/palette';\nimport { Shadows } from '../../utils/types/shadows';\nimport { FontVariant } from '../../utils/types/typography';\nimport { BorderRadiusSize } from '../../utils/types/shape';\nimport { Typography, CommonStyles } from '../roots';\nimport { defaultPalette } from '../roots/palette';\nimport { defaultShadows } from '../roots/shadows';\nimport { getDefaultTypography } from '../roots/typography';\nimport createBreakpoints from '../roots/breakpoints/entity/create-breakpoints';\nvar defaultShape = {\n borderRadius: _defineProperty(_defineProperty(_defineProperty({}, BorderRadiusSize.Sm, '2px'), BorderRadiusSize.Md, '4px'), BorderRadiusSize.Lg, '8px')\n};\nvar ThemeProvider = function ThemeProvider(_ref) {\n var children = _ref.children,\n _ref$theme = _ref.theme,\n theme = _ref$theme === void 0 ? {} : _ref$theme;\n var _theme$palette = theme.palette,\n paletteOverride = _theme$palette === void 0 ? {} : _theme$palette,\n _theme$breakpoints = theme.breakpoints,\n breakpointsOverride = _theme$breakpoints === void 0 ? {} : _theme$breakpoints,\n _theme$typography = theme.typography,\n typographyOverride = _theme$typography === void 0 ? {} : _theme$typography,\n _theme$shape = theme.shape,\n shapeOverride = _theme$shape === void 0 ? {} : _theme$shape,\n _theme$shadows = theme.shadows,\n shadowsOverride = _theme$shadows === void 0 ? {} : _theme$shadows;\n var finalTheme = useMemo(function () {\n var palette = _objectSpread(_objectSpread({}, defaultPalette), paletteOverride);\n var breakpoints = createBreakpoints(breakpointsOverride);\n var shadows = _objectSpread(_objectSpread({}, defaultShadows), shadowsOverride);\n return {\n palette: palette,\n breakpoints: breakpoints,\n typography: getDefaultTypography(typographyOverride),\n shape: _objectSpread({}, merge(_objectSpread({}, defaultShape), _objectSpread({}, shapeOverride))),\n shadows: shadows\n };\n return {};\n }, [JSON.stringify(theme)]);\n return /*#__PURE__*/React.createElement(SCThemeProvider, {\n theme: finalTheme\n }, /*#__PURE__*/React.createElement(React.Fragment, null, applyPolymorphicFunctionProp(children, finalTheme), /*#__PURE__*/React.createElement(CommonStyles, null), /*#__PURE__*/React.createElement(Typography, null)));\n};\nvar _getDefaultTypography = getDefaultTypography(),\n baseLineHeight = _getDefaultTypography.baseLineHeight,\n font = _getDefaultTypography.font,\n typography = _objectWithoutProperties(_getDefaultTypography, [\"baseLineHeight\", \"font\"]);\nThemeProvider.propTypes = {\n children: PT.oneOfType([PT.node, PT.func, PT.arrayOf(PT.node)]).isRequired,\n theme: PT.exact({\n breakpoints: PT.exact({\n keys: PT.arrayOf(PT.string),\n values: PT.exact(record(objectValues(Breakpoint), PT.number)),\n classes: PT.exact(record(objectValues(Breakpoint), PT.string)),\n getBreakpointClass: PT.func,\n up: PT.func,\n down: PT.func,\n between: PT.func,\n only: PT.func\n }),\n palette: PT.exact(record(objectValues(Color), PT.string)),\n shadows: PT.exact(record(objectValues(Shadows), PT.string)),\n shape: PT.exact({\n borderRadius: PT.exact(record(objectValues(BorderRadiusSize), PT.string))\n }),\n typography: PT.exact(_objectSpread({\n baseLineHeight: PT.oneOfType([PT.string, PT.number]),\n font: PT.exact(record(objectValues(FontVariant), PT.object))\n }, record(objectKeys(typography), PT.string)))\n })\n};\nexport default ThemeProvider;","function _arrayWithHoles(r) {\n if (Array.isArray(r)) return r;\n}\nexport { _arrayWithHoles as default };","function _iterableToArrayLimit(r, l) {\n var t = null == r ? null : \"undefined\" != typeof Symbol && r[Symbol.iterator] || r[\"@@iterator\"];\n if (null != t) {\n var e,\n n,\n i,\n u,\n a = [],\n f = !0,\n o = !1;\n try {\n if (i = (t = t.call(r)).next, 0 === l) {\n if (Object(t) !== t) return;\n f = !1;\n } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0);\n } catch (r) {\n o = !0, n = r;\n } finally {\n try {\n if (!f && null != t[\"return\"] && (u = t[\"return\"](), Object(u) !== u)) return;\n } finally {\n if (o) throw n;\n }\n }\n return a;\n }\n}\nexport { _iterableToArrayLimit as default };","function _nonIterableRest() {\n throw new TypeError(\"Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\");\n}\nexport { _nonIterableRest as default };","import arrayWithHoles from \"./arrayWithHoles.js\";\nimport iterableToArrayLimit from \"./iterableToArrayLimit.js\";\nimport unsupportedIterableToArray from \"./unsupportedIterableToArray.js\";\nimport nonIterableRest from \"./nonIterableRest.js\";\nfunction _slicedToArray(r, e) {\n return arrayWithHoles(r) || iterableToArrayLimit(r, e) || unsupportedIterableToArray(r, e) || nonIterableRest();\n}\nexport { _slicedToArray as default };","function _extends() {\n return _extends = Object.assign ? Object.assign.bind() : function (n) {\n for (var e = 1; e < arguments.length; e++) {\n var t = arguments[e];\n for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]);\n }\n return n;\n }, _extends.apply(null, arguments);\n}\nexport { _extends as default };","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports._registerNode = exports.Konva = exports.glob = void 0;\nconst PI_OVER_180 = Math.PI / 180;\nfunction detectBrowser() {\n return (typeof window !== 'undefined' &&\n ({}.toString.call(window) === '[object Window]' ||\n {}.toString.call(window) === '[object global]'));\n}\nexports.glob = typeof global !== 'undefined'\n ? global\n : typeof window !== 'undefined'\n ? window\n : typeof WorkerGlobalScope !== 'undefined'\n ? self\n : {};\nexports.Konva = {\n _global: exports.glob,\n version: '9.3.15',\n isBrowser: detectBrowser(),\n isUnminified: /param/.test(function (param) { }.toString()),\n dblClickWindow: 400,\n getAngle(angle) {\n return exports.Konva.angleDeg ? angle * PI_OVER_180 : angle;\n },\n enableTrace: false,\n pointerEventsEnabled: true,\n autoDrawEnabled: true,\n hitOnDragEnabled: false,\n capturePointerEventsEnabled: false,\n _mouseListenClick: false,\n _touchListenClick: false,\n _pointerListenClick: false,\n _mouseInDblClickWindow: false,\n _touchInDblClickWindow: false,\n _pointerInDblClickWindow: false,\n _mouseDblClickPointerId: null,\n _touchDblClickPointerId: null,\n _pointerDblClickPointerId: null,\n _fixTextRendering: false,\n pixelRatio: (typeof window !== 'undefined' && window.devicePixelRatio) || 1,\n dragDistance: 3,\n angleDeg: true,\n showWarnings: true,\n dragButtons: [0, 1],\n isDragging() {\n return exports.Konva['DD'].isDragging;\n },\n isTransforming() {\n var _a;\n return (_a = exports.Konva['Transformer']) === null || _a === void 0 ? void 0 : _a.isTransforming();\n },\n isDragReady() {\n return !!exports.Konva['DD'].node;\n },\n releaseCanvasOnDestroy: true,\n document: exports.glob.document,\n _injectGlobal(Konva) {\n exports.glob.Konva = Konva;\n },\n};\nconst _registerNode = (NodeClass) => {\n exports.Konva[NodeClass.prototype.getClassName()] = NodeClass;\n};\nexports._registerNode = _registerNode;\nexports.Konva._injectGlobal(exports.Konva);\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Util = exports.Transform = void 0;\nconst Global_1 = require(\"./Global\");\nclass Transform {\n constructor(m = [1, 0, 0, 1, 0, 0]) {\n this.dirty = false;\n this.m = (m && m.slice()) || [1, 0, 0, 1, 0, 0];\n }\n reset() {\n this.m[0] = 1;\n this.m[1] = 0;\n this.m[2] = 0;\n this.m[3] = 1;\n this.m[4] = 0;\n this.m[5] = 0;\n }\n copy() {\n return new Transform(this.m);\n }\n copyInto(tr) {\n tr.m[0] = this.m[0];\n tr.m[1] = this.m[1];\n tr.m[2] = this.m[2];\n tr.m[3] = this.m[3];\n tr.m[4] = this.m[4];\n tr.m[5] = this.m[5];\n }\n point(point) {\n var m = this.m;\n return {\n x: m[0] * point.x + m[2] * point.y + m[4],\n y: m[1] * point.x + m[3] * point.y + m[5],\n };\n }\n translate(x, y) {\n this.m[4] += this.m[0] * x + this.m[2] * y;\n this.m[5] += this.m[1] * x + this.m[3] * y;\n return this;\n }\n scale(sx, sy) {\n this.m[0] *= sx;\n this.m[1] *= sx;\n this.m[2] *= sy;\n this.m[3] *= sy;\n return this;\n }\n rotate(rad) {\n var c = Math.cos(rad);\n var s = Math.sin(rad);\n var m11 = this.m[0] * c + this.m[2] * s;\n var m12 = this.m[1] * c + this.m[3] * s;\n var m21 = this.m[0] * -s + this.m[2] * c;\n var m22 = this.m[1] * -s + this.m[3] * c;\n this.m[0] = m11;\n this.m[1] = m12;\n this.m[2] = m21;\n this.m[3] = m22;\n return this;\n }\n getTranslation() {\n return {\n x: this.m[4],\n y: this.m[5],\n };\n }\n skew(sx, sy) {\n var m11 = this.m[0] + this.m[2] * sy;\n var m12 = this.m[1] + this.m[3] * sy;\n var m21 = this.m[2] + this.m[0] * sx;\n var m22 = this.m[3] + this.m[1] * sx;\n this.m[0] = m11;\n this.m[1] = m12;\n this.m[2] = m21;\n this.m[3] = m22;\n return this;\n }\n multiply(matrix) {\n var m11 = this.m[0] * matrix.m[0] + this.m[2] * matrix.m[1];\n var m12 = this.m[1] * matrix.m[0] + this.m[3] * matrix.m[1];\n var m21 = this.m[0] * matrix.m[2] + this.m[2] * matrix.m[3];\n var m22 = this.m[1] * matrix.m[2] + this.m[3] * matrix.m[3];\n var dx = this.m[0] * matrix.m[4] + this.m[2] * matrix.m[5] + this.m[4];\n var dy = this.m[1] * matrix.m[4] + this.m[3] * matrix.m[5] + this.m[5];\n this.m[0] = m11;\n this.m[1] = m12;\n this.m[2] = m21;\n this.m[3] = m22;\n this.m[4] = dx;\n this.m[5] = dy;\n return this;\n }\n invert() {\n var d = 1 / (this.m[0] * this.m[3] - this.m[1] * this.m[2]);\n var m0 = this.m[3] * d;\n var m1 = -this.m[1] * d;\n var m2 = -this.m[2] * d;\n var m3 = this.m[0] * d;\n var m4 = d * (this.m[2] * this.m[5] - this.m[3] * this.m[4]);\n var m5 = d * (this.m[1] * this.m[4] - this.m[0] * this.m[5]);\n this.m[0] = m0;\n this.m[1] = m1;\n this.m[2] = m2;\n this.m[3] = m3;\n this.m[4] = m4;\n this.m[5] = m5;\n return this;\n }\n getMatrix() {\n return this.m;\n }\n decompose() {\n var a = this.m[0];\n var b = this.m[1];\n var c = this.m[2];\n var d = this.m[3];\n var e = this.m[4];\n var f = this.m[5];\n var delta = a * d - b * c;\n let result = {\n x: e,\n y: f,\n rotation: 0,\n scaleX: 0,\n scaleY: 0,\n skewX: 0,\n skewY: 0,\n };\n if (a != 0 || b != 0) {\n var r = Math.sqrt(a * a + b * b);\n result.rotation = b > 0 ? Math.acos(a / r) : -Math.acos(a / r);\n result.scaleX = r;\n result.scaleY = delta / r;\n result.skewX = (a * c + b * d) / delta;\n result.skewY = 0;\n }\n else if (c != 0 || d != 0) {\n var s = Math.sqrt(c * c + d * d);\n result.rotation =\n Math.PI / 2 - (d > 0 ? Math.acos(-c / s) : -Math.acos(c / s));\n result.scaleX = delta / s;\n result.scaleY = s;\n result.skewX = 0;\n result.skewY = (a * c + b * d) / delta;\n }\n else {\n }\n result.rotation = exports.Util._getRotation(result.rotation);\n return result;\n }\n}\nexports.Transform = Transform;\nvar OBJECT_ARRAY = '[object Array]', OBJECT_NUMBER = '[object Number]', OBJECT_STRING = '[object String]', OBJECT_BOOLEAN = '[object Boolean]', PI_OVER_DEG180 = Math.PI / 180, DEG180_OVER_PI = 180 / Math.PI, HASH = '#', EMPTY_STRING = '', ZERO = '0', KONVA_WARNING = 'Konva warning: ', KONVA_ERROR = 'Konva error: ', RGB_PAREN = 'rgb(', COLORS = {\n aliceblue: [240, 248, 255],\n antiquewhite: [250, 235, 215],\n aqua: [0, 255, 255],\n aquamarine: [127, 255, 212],\n azure: [240, 255, 255],\n beige: [245, 245, 220],\n bisque: [255, 228, 196],\n black: [0, 0, 0],\n blanchedalmond: [255, 235, 205],\n blue: [0, 0, 255],\n blueviolet: [138, 43, 226],\n brown: [165, 42, 42],\n burlywood: [222, 184, 135],\n cadetblue: [95, 158, 160],\n chartreuse: [127, 255, 0],\n chocolate: [210, 105, 30],\n coral: [255, 127, 80],\n cornflowerblue: [100, 149, 237],\n cornsilk: [255, 248, 220],\n crimson: [220, 20, 60],\n cyan: [0, 255, 255],\n darkblue: [0, 0, 139],\n darkcyan: [0, 139, 139],\n darkgoldenrod: [184, 132, 11],\n darkgray: [169, 169, 169],\n darkgreen: [0, 100, 0],\n darkgrey: [169, 169, 169],\n darkkhaki: [189, 183, 107],\n darkmagenta: [139, 0, 139],\n darkolivegreen: [85, 107, 47],\n darkorange: [255, 140, 0],\n darkorchid: [153, 50, 204],\n darkred: [139, 0, 0],\n darksalmon: [233, 150, 122],\n darkseagreen: [143, 188, 143],\n darkslateblue: [72, 61, 139],\n darkslategray: [47, 79, 79],\n darkslategrey: [47, 79, 79],\n darkturquoise: [0, 206, 209],\n darkviolet: [148, 0, 211],\n deeppink: [255, 20, 147],\n deepskyblue: [0, 191, 255],\n dimgray: [105, 105, 105],\n dimgrey: [105, 105, 105],\n dodgerblue: [30, 144, 255],\n firebrick: [178, 34, 34],\n floralwhite: [255, 255, 240],\n forestgreen: [34, 139, 34],\n fuchsia: [255, 0, 255],\n gainsboro: [220, 220, 220],\n ghostwhite: [248, 248, 255],\n gold: [255, 215, 0],\n goldenrod: [218, 165, 32],\n gray: [128, 128, 128],\n green: [0, 128, 0],\n greenyellow: [173, 255, 47],\n grey: [128, 128, 128],\n honeydew: [240, 255, 240],\n hotpink: [255, 105, 180],\n indianred: [205, 92, 92],\n indigo: [75, 0, 130],\n ivory: [255, 255, 240],\n khaki: [240, 230, 140],\n lavender: [230, 230, 250],\n lavenderblush: [255, 240, 245],\n lawngreen: [124, 252, 0],\n lemonchiffon: [255, 250, 205],\n lightblue: [173, 216, 230],\n lightcoral: [240, 128, 128],\n lightcyan: [224, 255, 255],\n lightgoldenrodyellow: [250, 250, 210],\n lightgray: [211, 211, 211],\n lightgreen: [144, 238, 144],\n lightgrey: [211, 211, 211],\n lightpink: [255, 182, 193],\n lightsalmon: [255, 160, 122],\n lightseagreen: [32, 178, 170],\n lightskyblue: [135, 206, 250],\n lightslategray: [119, 136, 153],\n lightslategrey: [119, 136, 153],\n lightsteelblue: [176, 196, 222],\n lightyellow: [255, 255, 224],\n lime: [0, 255, 0],\n limegreen: [50, 205, 50],\n linen: [250, 240, 230],\n magenta: [255, 0, 255],\n maroon: [128, 0, 0],\n mediumaquamarine: [102, 205, 170],\n mediumblue: [0, 0, 205],\n mediumorchid: [186, 85, 211],\n mediumpurple: [147, 112, 219],\n mediumseagreen: [60, 179, 113],\n mediumslateblue: [123, 104, 238],\n mediumspringgreen: [0, 250, 154],\n mediumturquoise: [72, 209, 204],\n mediumvioletred: [199, 21, 133],\n midnightblue: [25, 25, 112],\n mintcream: [245, 255, 250],\n mistyrose: [255, 228, 225],\n moccasin: [255, 228, 181],\n navajowhite: [255, 222, 173],\n navy: [0, 0, 128],\n oldlace: [253, 245, 230],\n olive: [128, 128, 0],\n olivedrab: [107, 142, 35],\n orange: [255, 165, 0],\n orangered: [255, 69, 0],\n orchid: [218, 112, 214],\n palegoldenrod: [238, 232, 170],\n palegreen: [152, 251, 152],\n paleturquoise: [175, 238, 238],\n palevioletred: [219, 112, 147],\n papayawhip: [255, 239, 213],\n peachpuff: [255, 218, 185],\n peru: [205, 133, 63],\n pink: [255, 192, 203],\n plum: [221, 160, 203],\n powderblue: [176, 224, 230],\n purple: [128, 0, 128],\n rebeccapurple: [102, 51, 153],\n red: [255, 0, 0],\n rosybrown: [188, 143, 143],\n royalblue: [65, 105, 225],\n saddlebrown: [139, 69, 19],\n salmon: [250, 128, 114],\n sandybrown: [244, 164, 96],\n seagreen: [46, 139, 87],\n seashell: [255, 245, 238],\n sienna: [160, 82, 45],\n silver: [192, 192, 192],\n skyblue: [135, 206, 235],\n slateblue: [106, 90, 205],\n slategray: [119, 128, 144],\n slategrey: [119, 128, 144],\n snow: [255, 255, 250],\n springgreen: [0, 255, 127],\n steelblue: [70, 130, 180],\n tan: [210, 180, 140],\n teal: [0, 128, 128],\n thistle: [216, 191, 216],\n transparent: [255, 255, 255, 0],\n tomato: [255, 99, 71],\n turquoise: [64, 224, 208],\n violet: [238, 130, 238],\n wheat: [245, 222, 179],\n white: [255, 255, 255],\n whitesmoke: [245, 245, 245],\n yellow: [255, 255, 0],\n yellowgreen: [154, 205, 5],\n}, RGB_REGEX = /rgb\\((\\d{1,3}),(\\d{1,3}),(\\d{1,3})\\)/, animQueue = [];\nconst req = (typeof requestAnimationFrame !== 'undefined' && requestAnimationFrame) ||\n function (f) {\n setTimeout(f, 60);\n };\nexports.Util = {\n _isElement(obj) {\n return !!(obj && obj.nodeType == 1);\n },\n _isFunction(obj) {\n return !!(obj && obj.constructor && obj.call && obj.apply);\n },\n _isPlainObject(obj) {\n return !!obj && obj.constructor === Object;\n },\n _isArray(obj) {\n return Object.prototype.toString.call(obj) === OBJECT_ARRAY;\n },\n _isNumber(obj) {\n return (Object.prototype.toString.call(obj) === OBJECT_NUMBER &&\n !isNaN(obj) &&\n isFinite(obj));\n },\n _isString(obj) {\n return Object.prototype.toString.call(obj) === OBJECT_STRING;\n },\n _isBoolean(obj) {\n return Object.prototype.toString.call(obj) === OBJECT_BOOLEAN;\n },\n isObject(val) {\n return val instanceof Object;\n },\n isValidSelector(selector) {\n if (typeof selector !== 'string') {\n return false;\n }\n var firstChar = selector[0];\n return (firstChar === '#' ||\n firstChar === '.' ||\n firstChar === firstChar.toUpperCase());\n },\n _sign(number) {\n if (number === 0) {\n return 1;\n }\n if (number > 0) {\n return 1;\n }\n else {\n return -1;\n }\n },\n requestAnimFrame(callback) {\n animQueue.push(callback);\n if (animQueue.length === 1) {\n req(function () {\n const queue = animQueue;\n animQueue = [];\n queue.forEach(function (cb) {\n cb();\n });\n });\n }\n },\n createCanvasElement() {\n var canvas = document.createElement('canvas');\n try {\n canvas.style = canvas.style || {};\n }\n catch (e) { }\n return canvas;\n },\n createImageElement() {\n return document.createElement('img');\n },\n _isInDocument(el) {\n while ((el = el.parentNode)) {\n if (el == document) {\n return true;\n }\n }\n return false;\n },\n _urlToImage(url, callback) {\n var imageObj = exports.Util.createImageElement();\n imageObj.onload = function () {\n callback(imageObj);\n };\n imageObj.src = url;\n },\n _rgbToHex(r, g, b) {\n return ((1 << 24) + (r << 16) + (g << 8) + b).toString(16).slice(1);\n },\n _hexToRgb(hex) {\n hex = hex.replace(HASH, EMPTY_STRING);\n var bigint = parseInt(hex, 16);\n return {\n r: (bigint >> 16) & 255,\n g: (bigint >> 8) & 255,\n b: bigint & 255,\n };\n },\n getRandomColor() {\n var randColor = ((Math.random() * 0xffffff) << 0).toString(16);\n while (randColor.length < 6) {\n randColor = ZERO + randColor;\n }\n return HASH + randColor;\n },\n getRGB(color) {\n var rgb;\n if (color in COLORS) {\n rgb = COLORS[color];\n return {\n r: rgb[0],\n g: rgb[1],\n b: rgb[2],\n };\n }\n else if (color[0] === HASH) {\n return this._hexToRgb(color.substring(1));\n }\n else if (color.substr(0, 4) === RGB_PAREN) {\n rgb = RGB_REGEX.exec(color.replace(/ /g, ''));\n return {\n r: parseInt(rgb[1], 10),\n g: parseInt(rgb[2], 10),\n b: parseInt(rgb[3], 10),\n };\n }\n else {\n return {\n r: 0,\n g: 0,\n b: 0,\n };\n }\n },\n colorToRGBA(str) {\n str = str || 'black';\n return (exports.Util._namedColorToRBA(str) ||\n exports.Util._hex3ColorToRGBA(str) ||\n exports.Util._hex4ColorToRGBA(str) ||\n exports.Util._hex6ColorToRGBA(str) ||\n exports.Util._hex8ColorToRGBA(str) ||\n exports.Util._rgbColorToRGBA(str) ||\n exports.Util._rgbaColorToRGBA(str) ||\n exports.Util._hslColorToRGBA(str));\n },\n _namedColorToRBA(str) {\n var c = COLORS[str.toLowerCase()];\n if (!c) {\n return null;\n }\n return {\n r: c[0],\n g: c[1],\n b: c[2],\n a: 1,\n };\n },\n _rgbColorToRGBA(str) {\n if (str.indexOf('rgb(') === 0) {\n str = str.match(/rgb\\(([^)]+)\\)/)[1];\n var parts = str.split(/ *, */).map(Number);\n return {\n r: parts[0],\n g: parts[1],\n b: parts[2],\n a: 1,\n };\n }\n },\n _rgbaColorToRGBA(str) {\n if (str.indexOf('rgba(') === 0) {\n str = str.match(/rgba\\(([^)]+)\\)/)[1];\n var parts = str.split(/ *, */).map((n, index) => {\n if (n.slice(-1) === '%') {\n return index === 3 ? parseInt(n) / 100 : (parseInt(n) / 100) * 255;\n }\n return Number(n);\n });\n return {\n r: parts[0],\n g: parts[1],\n b: parts[2],\n a: parts[3],\n };\n }\n },\n _hex8ColorToRGBA(str) {\n if (str[0] === '#' && str.length === 9) {\n return {\n r: parseInt(str.slice(1, 3), 16),\n g: parseInt(str.slice(3, 5), 16),\n b: parseInt(str.slice(5, 7), 16),\n a: parseInt(str.slice(7, 9), 16) / 0xff,\n };\n }\n },\n _hex6ColorToRGBA(str) {\n if (str[0] === '#' && str.length === 7) {\n return {\n r: parseInt(str.slice(1, 3), 16),\n g: parseInt(str.slice(3, 5), 16),\n b: parseInt(str.slice(5, 7), 16),\n a: 1,\n };\n }\n },\n _hex4ColorToRGBA(str) {\n if (str[0] === '#' && str.length === 5) {\n return {\n r: parseInt(str[1] + str[1], 16),\n g: parseInt(str[2] + str[2], 16),\n b: parseInt(str[3] + str[3], 16),\n a: parseInt(str[4] + str[4], 16) / 0xff,\n };\n }\n },\n _hex3ColorToRGBA(str) {\n if (str[0] === '#' && str.length === 4) {\n return {\n r: parseInt(str[1] + str[1], 16),\n g: parseInt(str[2] + str[2], 16),\n b: parseInt(str[3] + str[3], 16),\n a: 1,\n };\n }\n },\n _hslColorToRGBA(str) {\n if (/hsl\\((\\d+),\\s*([\\d.]+)%,\\s*([\\d.]+)%\\)/g.test(str)) {\n const [_, ...hsl] = /hsl\\((\\d+),\\s*([\\d.]+)%,\\s*([\\d.]+)%\\)/g.exec(str);\n const h = Number(hsl[0]) / 360;\n const s = Number(hsl[1]) / 100;\n const l = Number(hsl[2]) / 100;\n let t2;\n let t3;\n let val;\n if (s === 0) {\n val = l * 255;\n return {\n r: Math.round(val),\n g: Math.round(val),\n b: Math.round(val),\n a: 1,\n };\n }\n if (l < 0.5) {\n t2 = l * (1 + s);\n }\n else {\n t2 = l + s - l * s;\n }\n const t1 = 2 * l - t2;\n const rgb = [0, 0, 0];\n for (let i = 0; i < 3; i++) {\n t3 = h + (1 / 3) * -(i - 1);\n if (t3 < 0) {\n t3++;\n }\n if (t3 > 1) {\n t3--;\n }\n if (6 * t3 < 1) {\n val = t1 + (t2 - t1) * 6 * t3;\n }\n else if (2 * t3 < 1) {\n val = t2;\n }\n else if (3 * t3 < 2) {\n val = t1 + (t2 - t1) * (2 / 3 - t3) * 6;\n }\n else {\n val = t1;\n }\n rgb[i] = val * 255;\n }\n return {\n r: Math.round(rgb[0]),\n g: Math.round(rgb[1]),\n b: Math.round(rgb[2]),\n a: 1,\n };\n }\n },\n haveIntersection(r1, r2) {\n return !(r2.x > r1.x + r1.width ||\n r2.x + r2.width < r1.x ||\n r2.y > r1.y + r1.height ||\n r2.y + r2.height < r1.y);\n },\n cloneObject(obj) {\n var retObj = {};\n for (var key in obj) {\n if (this._isPlainObject(obj[key])) {\n retObj[key] = this.cloneObject(obj[key]);\n }\n else if (this._isArray(obj[key])) {\n retObj[key] = this.cloneArray(obj[key]);\n }\n else {\n retObj[key] = obj[key];\n }\n }\n return retObj;\n },\n cloneArray(arr) {\n return arr.slice(0);\n },\n degToRad(deg) {\n return deg * PI_OVER_DEG180;\n },\n radToDeg(rad) {\n return rad * DEG180_OVER_PI;\n },\n _degToRad(deg) {\n exports.Util.warn('Util._degToRad is removed. Please use public Util.degToRad instead.');\n return exports.Util.degToRad(deg);\n },\n _radToDeg(rad) {\n exports.Util.warn('Util._radToDeg is removed. Please use public Util.radToDeg instead.');\n return exports.Util.radToDeg(rad);\n },\n _getRotation(radians) {\n return Global_1.Konva.angleDeg ? exports.Util.radToDeg(radians) : radians;\n },\n _capitalize(str) {\n return str.charAt(0).toUpperCase() + str.slice(1);\n },\n throw(str) {\n throw new Error(KONVA_ERROR + str);\n },\n error(str) {\n console.error(KONVA_ERROR + str);\n },\n warn(str) {\n if (!Global_1.Konva.showWarnings) {\n return;\n }\n console.warn(KONVA_WARNING + str);\n },\n each(obj, func) {\n for (var key in obj) {\n func(key, obj[key]);\n }\n },\n _inRange(val, left, right) {\n return left <= val && val < right;\n },\n _getProjectionToSegment(x1, y1, x2, y2, x3, y3) {\n var x, y, dist;\n var pd2 = (x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2);\n if (pd2 == 0) {\n x = x1;\n y = y1;\n dist = (x3 - x2) * (x3 - x2) + (y3 - y2) * (y3 - y2);\n }\n else {\n var u = ((x3 - x1) * (x2 - x1) + (y3 - y1) * (y2 - y1)) / pd2;\n if (u < 0) {\n x = x1;\n y = y1;\n dist = (x1 - x3) * (x1 - x3) + (y1 - y3) * (y1 - y3);\n }\n else if (u > 1.0) {\n x = x2;\n y = y2;\n dist = (x2 - x3) * (x2 - x3) + (y2 - y3) * (y2 - y3);\n }\n else {\n x = x1 + u * (x2 - x1);\n y = y1 + u * (y2 - y1);\n dist = (x - x3) * (x - x3) + (y - y3) * (y - y3);\n }\n }\n return [x, y, dist];\n },\n _getProjectionToLine(pt, line, isClosed) {\n var pc = exports.Util.cloneObject(pt);\n var dist = Number.MAX_VALUE;\n line.forEach(function (p1, i) {\n if (!isClosed && i === line.length - 1) {\n return;\n }\n var p2 = line[(i + 1) % line.length];\n var proj = exports.Util._getProjectionToSegment(p1.x, p1.y, p2.x, p2.y, pt.x, pt.y);\n var px = proj[0], py = proj[1], pdist = proj[2];\n if (pdist < dist) {\n pc.x = px;\n pc.y = py;\n dist = pdist;\n }\n });\n return pc;\n },\n _prepareArrayForTween(startArray, endArray, isClosed) {\n var n, start = [], end = [];\n if (startArray.length > endArray.length) {\n var temp = endArray;\n endArray = startArray;\n startArray = temp;\n }\n for (n = 0; n < startArray.length; n += 2) {\n start.push({\n x: startArray[n],\n y: startArray[n + 1],\n });\n }\n for (n = 0; n < endArray.length; n += 2) {\n end.push({\n x: endArray[n],\n y: endArray[n + 1],\n });\n }\n var newStart = [];\n end.forEach(function (point) {\n var pr = exports.Util._getProjectionToLine(point, start, isClosed);\n newStart.push(pr.x);\n newStart.push(pr.y);\n });\n return newStart;\n },\n _prepareToStringify(obj) {\n var desc;\n obj.visitedByCircularReferenceRemoval = true;\n for (var key in obj) {\n if (!(obj.hasOwnProperty(key) && obj[key] && typeof obj[key] == 'object')) {\n continue;\n }\n desc = Object.getOwnPropertyDescriptor(obj, key);\n if (obj[key].visitedByCircularReferenceRemoval ||\n exports.Util._isElement(obj[key])) {\n if (desc.configurable) {\n delete obj[key];\n }\n else {\n return null;\n }\n }\n else if (exports.Util._prepareToStringify(obj[key]) === null) {\n if (desc.configurable) {\n delete obj[key];\n }\n else {\n return null;\n }\n }\n }\n delete obj.visitedByCircularReferenceRemoval;\n return obj;\n },\n _assign(target, source) {\n for (var key in source) {\n target[key] = source[key];\n }\n return target;\n },\n _getFirstPointerId(evt) {\n if (!evt.touches) {\n return evt.pointerId || 999;\n }\n else {\n return evt.changedTouches[0].identifier;\n }\n },\n releaseCanvas(...canvases) {\n if (!Global_1.Konva.releaseCanvasOnDestroy)\n return;\n canvases.forEach((c) => {\n c.width = 0;\n c.height = 0;\n });\n },\n drawRoundedRectPath(context, width, height, cornerRadius) {\n let topLeft = 0;\n let topRight = 0;\n let bottomLeft = 0;\n let bottomRight = 0;\n if (typeof cornerRadius === 'number') {\n topLeft =\n topRight =\n bottomLeft =\n bottomRight =\n Math.min(cornerRadius, width / 2, height / 2);\n }\n else {\n topLeft = Math.min(cornerRadius[0] || 0, width / 2, height / 2);\n topRight = Math.min(cornerRadius[1] || 0, width / 2, height / 2);\n bottomRight = Math.min(cornerRadius[2] || 0, width / 2, height / 2);\n bottomLeft = Math.min(cornerRadius[3] || 0, width / 2, height / 2);\n }\n context.moveTo(topLeft, 0);\n context.lineTo(width - topRight, 0);\n context.arc(width - topRight, topRight, topRight, (Math.PI * 3) / 2, 0, false);\n context.lineTo(width, height - bottomRight);\n context.arc(width - bottomRight, height - bottomRight, bottomRight, 0, Math.PI / 2, false);\n context.lineTo(bottomLeft, height);\n context.arc(bottomLeft, height - bottomLeft, bottomLeft, Math.PI / 2, Math.PI, false);\n context.lineTo(0, topLeft);\n context.arc(topLeft, topLeft, topLeft, Math.PI, (Math.PI * 3) / 2, false);\n },\n};\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.getComponentValidator = exports.getBooleanValidator = exports.getNumberArrayValidator = exports.getFunctionValidator = exports.getStringOrGradientValidator = exports.getStringValidator = exports.getNumberOrAutoValidator = exports.getNumberOrArrayOfNumbersValidator = exports.getNumberValidator = exports.alphaComponent = exports.RGBComponent = void 0;\nconst Global_1 = require(\"./Global\");\nconst Util_1 = require(\"./Util\");\nfunction _formatValue(val) {\n if (Util_1.Util._isString(val)) {\n return '\"' + val + '\"';\n }\n if (Object.prototype.toString.call(val) === '[object Number]') {\n return val;\n }\n if (Util_1.Util._isBoolean(val)) {\n return val;\n }\n return Object.prototype.toString.call(val);\n}\nfunction RGBComponent(val) {\n if (val > 255) {\n return 255;\n }\n else if (val < 0) {\n return 0;\n }\n return Math.round(val);\n}\nexports.RGBComponent = RGBComponent;\nfunction alphaComponent(val) {\n if (val > 1) {\n return 1;\n }\n else if (val < 0.0001) {\n return 0.0001;\n }\n return val;\n}\nexports.alphaComponent = alphaComponent;\nfunction getNumberValidator() {\n if (Global_1.Konva.isUnminified) {\n return function (val, attr) {\n if (!Util_1.Util._isNumber(val)) {\n Util_1.Util.warn(_formatValue(val) +\n ' is a not valid value for \"' +\n attr +\n '\" attribute. The value should be a number.');\n }\n return val;\n };\n }\n}\nexports.getNumberValidator = getNumberValidator;\nfunction getNumberOrArrayOfNumbersValidator(noOfElements) {\n if (Global_1.Konva.isUnminified) {\n return function (val, attr) {\n let isNumber = Util_1.Util._isNumber(val);\n let isValidArray = Util_1.Util._isArray(val) && val.length == noOfElements;\n if (!isNumber && !isValidArray) {\n Util_1.Util.warn(_formatValue(val) +\n ' is a not valid value for \"' +\n attr +\n '\" attribute. The value should be a number or Array(' +\n noOfElements +\n ')');\n }\n return val;\n };\n }\n}\nexports.getNumberOrArrayOfNumbersValidator = getNumberOrArrayOfNumbersValidator;\nfunction getNumberOrAutoValidator() {\n if (Global_1.Konva.isUnminified) {\n return function (val, attr) {\n var isNumber = Util_1.Util._isNumber(val);\n var isAuto = val === 'auto';\n if (!(isNumber || isAuto)) {\n Util_1.Util.warn(_formatValue(val) +\n ' is a not valid value for \"' +\n attr +\n '\" attribute. The value should be a number or \"auto\".');\n }\n return val;\n };\n }\n}\nexports.getNumberOrAutoValidator = getNumberOrAutoValidator;\nfunction getStringValidator() {\n if (Global_1.Konva.isUnminified) {\n return function (val, attr) {\n if (!Util_1.Util._isString(val)) {\n Util_1.Util.warn(_formatValue(val) +\n ' is a not valid value for \"' +\n attr +\n '\" attribute. The value should be a string.');\n }\n return val;\n };\n }\n}\nexports.getStringValidator = getStringValidator;\nfunction getStringOrGradientValidator() {\n if (Global_1.Konva.isUnminified) {\n return function (val, attr) {\n const isString = Util_1.Util._isString(val);\n const isGradient = Object.prototype.toString.call(val) === '[object CanvasGradient]' ||\n (val && val.addColorStop);\n if (!(isString || isGradient)) {\n Util_1.Util.warn(_formatValue(val) +\n ' is a not valid value for \"' +\n attr +\n '\" attribute. The value should be a string or a native gradient.');\n }\n return val;\n };\n }\n}\nexports.getStringOrGradientValidator = getStringOrGradientValidator;\nfunction getFunctionValidator() {\n if (Global_1.Konva.isUnminified) {\n return function (val, attr) {\n if (!Util_1.Util._isFunction(val)) {\n Util_1.Util.warn(_formatValue(val) +\n ' is a not valid value for \"' +\n attr +\n '\" attribute. The value should be a function.');\n }\n return val;\n };\n }\n}\nexports.getFunctionValidator = getFunctionValidator;\nfunction getNumberArrayValidator() {\n if (Global_1.Konva.isUnminified) {\n return function (val, attr) {\n const TypedArray = Int8Array ? Object.getPrototypeOf(Int8Array) : null;\n if (TypedArray && val instanceof TypedArray) {\n return val;\n }\n if (!Util_1.Util._isArray(val)) {\n Util_1.Util.warn(_formatValue(val) +\n ' is a not valid value for \"' +\n attr +\n '\" attribute. The value should be a array of numbers.');\n }\n else {\n val.forEach(function (item) {\n if (!Util_1.Util._isNumber(item)) {\n Util_1.Util.warn('\"' +\n attr +\n '\" attribute has non numeric element ' +\n item +\n '. Make sure that all elements are numbers.');\n }\n });\n }\n return val;\n };\n }\n}\nexports.getNumberArrayValidator = getNumberArrayValidator;\nfunction getBooleanValidator() {\n if (Global_1.Konva.isUnminified) {\n return function (val, attr) {\n var isBool = val === true || val === false;\n if (!isBool) {\n Util_1.Util.warn(_formatValue(val) +\n ' is a not valid value for \"' +\n attr +\n '\" attribute. The value should be a boolean.');\n }\n return val;\n };\n }\n}\nexports.getBooleanValidator = getBooleanValidator;\nfunction getComponentValidator(components) {\n if (Global_1.Konva.isUnminified) {\n return function (val, attr) {\n if (val === undefined || val === null) {\n return val;\n }\n if (!Util_1.Util.isObject(val)) {\n Util_1.Util.warn(_formatValue(val) +\n ' is a not valid value for \"' +\n attr +\n '\" attribute. The value should be an object with properties ' +\n components);\n }\n return val;\n };\n }\n}\nexports.getComponentValidator = getComponentValidator;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Factory = void 0;\nconst Util_1 = require(\"./Util\");\nconst Validators_1 = require(\"./Validators\");\nvar GET = 'get', SET = 'set';\nexports.Factory = {\n addGetterSetter(constructor, attr, def, validator, after) {\n exports.Factory.addGetter(constructor, attr, def);\n exports.Factory.addSetter(constructor, attr, validator, after);\n exports.Factory.addOverloadedGetterSetter(constructor, attr);\n },\n addGetter(constructor, attr, def) {\n var method = GET + Util_1.Util._capitalize(attr);\n constructor.prototype[method] =\n constructor.prototype[method] ||\n function () {\n var val = this.attrs[attr];\n return val === undefined ? def : val;\n };\n },\n addSetter(constructor, attr, validator, after) {\n var method = SET + Util_1.Util._capitalize(attr);\n if (!constructor.prototype[method]) {\n exports.Factory.overWriteSetter(constructor, attr, validator, after);\n }\n },\n overWriteSetter(constructor, attr, validator, after) {\n var method = SET + Util_1.Util._capitalize(attr);\n constructor.prototype[method] = function (val) {\n if (validator && val !== undefined && val !== null) {\n val = validator.call(this, val, attr);\n }\n this._setAttr(attr, val);\n if (after) {\n after.call(this);\n }\n return this;\n };\n },\n addComponentsGetterSetter(constructor, attr, components, validator, after) {\n var len = components.length, capitalize = Util_1.Util._capitalize, getter = GET + capitalize(attr), setter = SET + capitalize(attr), n, component;\n constructor.prototype[getter] = function () {\n var ret = {};\n for (n = 0; n < len; n++) {\n component = components[n];\n ret[component] = this.getAttr(attr + capitalize(component));\n }\n return ret;\n };\n var basicValidator = (0, Validators_1.getComponentValidator)(components);\n constructor.prototype[setter] = function (val) {\n var oldVal = this.attrs[attr], key;\n if (validator) {\n val = validator.call(this, val);\n }\n if (basicValidator) {\n basicValidator.call(this, val, attr);\n }\n for (key in val) {\n if (!val.hasOwnProperty(key)) {\n continue;\n }\n this._setAttr(attr + capitalize(key), val[key]);\n }\n if (!val) {\n components.forEach((component) => {\n this._setAttr(attr + capitalize(component), undefined);\n });\n }\n this._fireChangeEvent(attr, oldVal, val);\n if (after) {\n after.call(this);\n }\n return this;\n };\n exports.Factory.addOverloadedGetterSetter(constructor, attr);\n },\n addOverloadedGetterSetter(constructor, attr) {\n var capitalizedAttr = Util_1.Util._capitalize(attr), setter = SET + capitalizedAttr, getter = GET + capitalizedAttr;\n constructor.prototype[attr] = function () {\n if (arguments.length) {\n this[setter](arguments[0]);\n return this;\n }\n return this[getter]();\n };\n },\n addDeprecatedGetterSetter(constructor, attr, def, validator) {\n Util_1.Util.error('Adding deprecated ' + attr);\n var method = GET + Util_1.Util._capitalize(attr);\n var message = attr +\n ' property is deprecated and will be removed soon. Look at Konva change log for more information.';\n constructor.prototype[method] = function () {\n Util_1.Util.error(message);\n var val = this.attrs[attr];\n return val === undefined ? def : val;\n };\n exports.Factory.addSetter(constructor, attr, validator, function () {\n Util_1.Util.error(message);\n });\n exports.Factory.addOverloadedGetterSetter(constructor, attr);\n },\n backCompat(constructor, methods) {\n Util_1.Util.each(methods, function (oldMethodName, newMethodName) {\n var method = constructor.prototype[newMethodName];\n var oldGetter = GET + Util_1.Util._capitalize(oldMethodName);\n var oldSetter = SET + Util_1.Util._capitalize(oldMethodName);\n function deprecated() {\n method.apply(this, arguments);\n Util_1.Util.error('\"' +\n oldMethodName +\n '\" method is deprecated and will be removed soon. Use \"\"' +\n newMethodName +\n '\" instead.');\n }\n constructor.prototype[oldMethodName] = deprecated;\n constructor.prototype[oldGetter] = deprecated;\n constructor.prototype[oldSetter] = deprecated;\n });\n },\n afterSetFilter() {\n this._filterUpToDate = false;\n },\n};\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.HitContext = exports.SceneContext = exports.Context = void 0;\nconst Util_1 = require(\"./Util\");\nconst Global_1 = require(\"./Global\");\nfunction simplifyArray(arr) {\n var retArr = [], len = arr.length, util = Util_1.Util, n, val;\n for (n = 0; n < len; n++) {\n val = arr[n];\n if (util._isNumber(val)) {\n val = Math.round(val * 1000) / 1000;\n }\n else if (!util._isString(val)) {\n val = val + '';\n }\n retArr.push(val);\n }\n return retArr;\n}\nvar COMMA = ',', OPEN_PAREN = '(', CLOSE_PAREN = ')', OPEN_PAREN_BRACKET = '([', CLOSE_BRACKET_PAREN = '])', SEMICOLON = ';', DOUBLE_PAREN = '()', EQUALS = '=', CONTEXT_METHODS = [\n 'arc',\n 'arcTo',\n 'beginPath',\n 'bezierCurveTo',\n 'clearRect',\n 'clip',\n 'closePath',\n 'createLinearGradient',\n 'createPattern',\n 'createRadialGradient',\n 'drawImage',\n 'ellipse',\n 'fill',\n 'fillText',\n 'getImageData',\n 'createImageData',\n 'lineTo',\n 'moveTo',\n 'putImageData',\n 'quadraticCurveTo',\n 'rect',\n 'roundRect',\n 'restore',\n 'rotate',\n 'save',\n 'scale',\n 'setLineDash',\n 'setTransform',\n 'stroke',\n 'strokeText',\n 'transform',\n 'translate',\n];\nvar CONTEXT_PROPERTIES = [\n 'fillStyle',\n 'strokeStyle',\n 'shadowColor',\n 'shadowBlur',\n 'shadowOffsetX',\n 'shadowOffsetY',\n 'letterSpacing',\n 'lineCap',\n 'lineDashOffset',\n 'lineJoin',\n 'lineWidth',\n 'miterLimit',\n 'direction',\n 'font',\n 'textAlign',\n 'textBaseline',\n 'globalAlpha',\n 'globalCompositeOperation',\n 'imageSmoothingEnabled',\n];\nconst traceArrMax = 100;\nclass Context {\n constructor(canvas) {\n this.canvas = canvas;\n if (Global_1.Konva.enableTrace) {\n this.traceArr = [];\n this._enableTrace();\n }\n }\n fillShape(shape) {\n if (shape.fillEnabled()) {\n this._fill(shape);\n }\n }\n _fill(shape) {\n }\n strokeShape(shape) {\n if (shape.hasStroke()) {\n this._stroke(shape);\n }\n }\n _stroke(shape) {\n }\n fillStrokeShape(shape) {\n if (shape.attrs.fillAfterStrokeEnabled) {\n this.strokeShape(shape);\n this.fillShape(shape);\n }\n else {\n this.fillShape(shape);\n this.strokeShape(shape);\n }\n }\n getTrace(relaxed, rounded) {\n var traceArr = this.traceArr, len = traceArr.length, str = '', n, trace, method, args;\n for (n = 0; n < len; n++) {\n trace = traceArr[n];\n method = trace.method;\n if (method) {\n args = trace.args;\n str += method;\n if (relaxed) {\n str += DOUBLE_PAREN;\n }\n else {\n if (Util_1.Util._isArray(args[0])) {\n str += OPEN_PAREN_BRACKET + args.join(COMMA) + CLOSE_BRACKET_PAREN;\n }\n else {\n if (rounded) {\n args = args.map((a) => typeof a === 'number' ? Math.floor(a) : a);\n }\n str += OPEN_PAREN + args.join(COMMA) + CLOSE_PAREN;\n }\n }\n }\n else {\n str += trace.property;\n if (!relaxed) {\n str += EQUALS + trace.val;\n }\n }\n str += SEMICOLON;\n }\n return str;\n }\n clearTrace() {\n this.traceArr = [];\n }\n _trace(str) {\n var traceArr = this.traceArr, len;\n traceArr.push(str);\n len = traceArr.length;\n if (len >= traceArrMax) {\n traceArr.shift();\n }\n }\n reset() {\n var pixelRatio = this.getCanvas().getPixelRatio();\n this.setTransform(1 * pixelRatio, 0, 0, 1 * pixelRatio, 0, 0);\n }\n getCanvas() {\n return this.canvas;\n }\n clear(bounds) {\n var canvas = this.getCanvas();\n if (bounds) {\n this.clearRect(bounds.x || 0, bounds.y || 0, bounds.width || 0, bounds.height || 0);\n }\n else {\n this.clearRect(0, 0, canvas.getWidth() / canvas.pixelRatio, canvas.getHeight() / canvas.pixelRatio);\n }\n }\n _applyLineCap(shape) {\n const lineCap = shape.attrs.lineCap;\n if (lineCap) {\n this.setAttr('lineCap', lineCap);\n }\n }\n _applyOpacity(shape) {\n var absOpacity = shape.getAbsoluteOpacity();\n if (absOpacity !== 1) {\n this.setAttr('globalAlpha', absOpacity);\n }\n }\n _applyLineJoin(shape) {\n const lineJoin = shape.attrs.lineJoin;\n if (lineJoin) {\n this.setAttr('lineJoin', lineJoin);\n }\n }\n setAttr(attr, val) {\n this._context[attr] = val;\n }\n arc(x, y, radius, startAngle, endAngle, counterClockwise) {\n this._context.arc(x, y, radius, startAngle, endAngle, counterClockwise);\n }\n arcTo(x1, y1, x2, y2, radius) {\n this._context.arcTo(x1, y1, x2, y2, radius);\n }\n beginPath() {\n this._context.beginPath();\n }\n bezierCurveTo(cp1x, cp1y, cp2x, cp2y, x, y) {\n this._context.bezierCurveTo(cp1x, cp1y, cp2x, cp2y, x, y);\n }\n clearRect(x, y, width, height) {\n this._context.clearRect(x, y, width, height);\n }\n clip(...args) {\n this._context.clip.apply(this._context, args);\n }\n closePath() {\n this._context.closePath();\n }\n createImageData(width, height) {\n var a = arguments;\n if (a.length === 2) {\n return this._context.createImageData(width, height);\n }\n else if (a.length === 1) {\n return this._context.createImageData(width);\n }\n }\n createLinearGradient(x0, y0, x1, y1) {\n return this._context.createLinearGradient(x0, y0, x1, y1);\n }\n createPattern(image, repetition) {\n return this._context.createPattern(image, repetition);\n }\n createRadialGradient(x0, y0, r0, x1, y1, r1) {\n return this._context.createRadialGradient(x0, y0, r0, x1, y1, r1);\n }\n drawImage(image, sx, sy, sWidth, sHeight, dx, dy, dWidth, dHeight) {\n var a = arguments, _context = this._context;\n if (a.length === 3) {\n _context.drawImage(image, sx, sy);\n }\n else if (a.length === 5) {\n _context.drawImage(image, sx, sy, sWidth, sHeight);\n }\n else if (a.length === 9) {\n _context.drawImage(image, sx, sy, sWidth, sHeight, dx, dy, dWidth, dHeight);\n }\n }\n ellipse(x, y, radiusX, radiusY, rotation, startAngle, endAngle, counterclockwise) {\n this._context.ellipse(x, y, radiusX, radiusY, rotation, startAngle, endAngle, counterclockwise);\n }\n isPointInPath(x, y, path, fillRule) {\n if (path) {\n return this._context.isPointInPath(path, x, y, fillRule);\n }\n return this._context.isPointInPath(x, y, fillRule);\n }\n fill(...args) {\n this._context.fill.apply(this._context, args);\n }\n fillRect(x, y, width, height) {\n this._context.fillRect(x, y, width, height);\n }\n strokeRect(x, y, width, height) {\n this._context.strokeRect(x, y, width, height);\n }\n fillText(text, x, y, maxWidth) {\n if (maxWidth) {\n this._context.fillText(text, x, y, maxWidth);\n }\n else {\n this._context.fillText(text, x, y);\n }\n }\n measureText(text) {\n return this._context.measureText(text);\n }\n getImageData(sx, sy, sw, sh) {\n return this._context.getImageData(sx, sy, sw, sh);\n }\n lineTo(x, y) {\n this._context.lineTo(x, y);\n }\n moveTo(x, y) {\n this._context.moveTo(x, y);\n }\n rect(x, y, width, height) {\n this._context.rect(x, y, width, height);\n }\n roundRect(x, y, width, height, radii) {\n this._context.roundRect(x, y, width, height, radii);\n }\n putImageData(imageData, dx, dy) {\n this._context.putImageData(imageData, dx, dy);\n }\n quadraticCurveTo(cpx, cpy, x, y) {\n this._context.quadraticCurveTo(cpx, cpy, x, y);\n }\n restore() {\n this._context.restore();\n }\n rotate(angle) {\n this._context.rotate(angle);\n }\n save() {\n this._context.save();\n }\n scale(x, y) {\n this._context.scale(x, y);\n }\n setLineDash(segments) {\n if (this._context.setLineDash) {\n this._context.setLineDash(segments);\n }\n else if ('mozDash' in this._context) {\n this._context['mozDash'] = segments;\n }\n else if ('webkitLineDash' in this._context) {\n this._context['webkitLineDash'] = segments;\n }\n }\n getLineDash() {\n return this._context.getLineDash();\n }\n setTransform(a, b, c, d, e, f) {\n this._context.setTransform(a, b, c, d, e, f);\n }\n stroke(path2d) {\n if (path2d) {\n this._context.stroke(path2d);\n }\n else {\n this._context.stroke();\n }\n }\n strokeText(text, x, y, maxWidth) {\n this._context.strokeText(text, x, y, maxWidth);\n }\n transform(a, b, c, d, e, f) {\n this._context.transform(a, b, c, d, e, f);\n }\n translate(x, y) {\n this._context.translate(x, y);\n }\n _enableTrace() {\n var that = this, len = CONTEXT_METHODS.length, origSetter = this.setAttr, n, args;\n var func = function (methodName) {\n var origMethod = that[methodName], ret;\n that[methodName] = function () {\n args = simplifyArray(Array.prototype.slice.call(arguments, 0));\n ret = origMethod.apply(that, arguments);\n that._trace({\n method: methodName,\n args: args,\n });\n return ret;\n };\n };\n for (n = 0; n < len; n++) {\n func(CONTEXT_METHODS[n]);\n }\n that.setAttr = function () {\n origSetter.apply(that, arguments);\n var prop = arguments[0];\n var val = arguments[1];\n if (prop === 'shadowOffsetX' ||\n prop === 'shadowOffsetY' ||\n prop === 'shadowBlur') {\n val = val / this.canvas.getPixelRatio();\n }\n that._trace({\n property: prop,\n val: val,\n });\n };\n }\n _applyGlobalCompositeOperation(node) {\n const op = node.attrs.globalCompositeOperation;\n var def = !op || op === 'source-over';\n if (!def) {\n this.setAttr('globalCompositeOperation', op);\n }\n }\n}\nexports.Context = Context;\nCONTEXT_PROPERTIES.forEach(function (prop) {\n Object.defineProperty(Context.prototype, prop, {\n get() {\n return this._context[prop];\n },\n set(val) {\n this._context[prop] = val;\n },\n });\n});\nclass SceneContext extends Context {\n constructor(canvas, { willReadFrequently = false } = {}) {\n super(canvas);\n this._context = canvas._canvas.getContext('2d', {\n willReadFrequently,\n });\n }\n _fillColor(shape) {\n var fill = shape.fill();\n this.setAttr('fillStyle', fill);\n shape._fillFunc(this);\n }\n _fillPattern(shape) {\n this.setAttr('fillStyle', shape._getFillPattern());\n shape._fillFunc(this);\n }\n _fillLinearGradient(shape) {\n var grd = shape._getLinearGradient();\n if (grd) {\n this.setAttr('fillStyle', grd);\n shape._fillFunc(this);\n }\n }\n _fillRadialGradient(shape) {\n const grd = shape._getRadialGradient();\n if (grd) {\n this.setAttr('fillStyle', grd);\n shape._fillFunc(this);\n }\n }\n _fill(shape) {\n const hasColor = shape.fill(), fillPriority = shape.getFillPriority();\n if (hasColor && fillPriority === 'color') {\n this._fillColor(shape);\n return;\n }\n const hasPattern = shape.getFillPatternImage();\n if (hasPattern && fillPriority === 'pattern') {\n this._fillPattern(shape);\n return;\n }\n const hasLinearGradient = shape.getFillLinearGradientColorStops();\n if (hasLinearGradient && fillPriority === 'linear-gradient') {\n this._fillLinearGradient(shape);\n return;\n }\n const hasRadialGradient = shape.getFillRadialGradientColorStops();\n if (hasRadialGradient && fillPriority === 'radial-gradient') {\n this._fillRadialGradient(shape);\n return;\n }\n if (hasColor) {\n this._fillColor(shape);\n }\n else if (hasPattern) {\n this._fillPattern(shape);\n }\n else if (hasLinearGradient) {\n this._fillLinearGradient(shape);\n }\n else if (hasRadialGradient) {\n this._fillRadialGradient(shape);\n }\n }\n _strokeLinearGradient(shape) {\n const start = shape.getStrokeLinearGradientStartPoint(), end = shape.getStrokeLinearGradientEndPoint(), colorStops = shape.getStrokeLinearGradientColorStops(), grd = this.createLinearGradient(start.x, start.y, end.x, end.y);\n if (colorStops) {\n for (var n = 0; n < colorStops.length; n += 2) {\n grd.addColorStop(colorStops[n], colorStops[n + 1]);\n }\n this.setAttr('strokeStyle', grd);\n }\n }\n _stroke(shape) {\n var dash = shape.dash(), strokeScaleEnabled = shape.getStrokeScaleEnabled();\n if (shape.hasStroke()) {\n if (!strokeScaleEnabled) {\n this.save();\n var pixelRatio = this.getCanvas().getPixelRatio();\n this.setTransform(pixelRatio, 0, 0, pixelRatio, 0, 0);\n }\n this._applyLineCap(shape);\n if (dash && shape.dashEnabled()) {\n this.setLineDash(dash);\n this.setAttr('lineDashOffset', shape.dashOffset());\n }\n this.setAttr('lineWidth', shape.strokeWidth());\n if (!shape.getShadowForStrokeEnabled()) {\n this.setAttr('shadowColor', 'rgba(0,0,0,0)');\n }\n var hasLinearGradient = shape.getStrokeLinearGradientColorStops();\n if (hasLinearGradient) {\n this._strokeLinearGradient(shape);\n }\n else {\n this.setAttr('strokeStyle', shape.stroke());\n }\n shape._strokeFunc(this);\n if (!strokeScaleEnabled) {\n this.restore();\n }\n }\n }\n _applyShadow(shape) {\n var _a, _b, _c;\n var color = (_a = shape.getShadowRGBA()) !== null && _a !== void 0 ? _a : 'black', blur = (_b = shape.getShadowBlur()) !== null && _b !== void 0 ? _b : 5, offset = (_c = shape.getShadowOffset()) !== null && _c !== void 0 ? _c : {\n x: 0,\n y: 0,\n }, scale = shape.getAbsoluteScale(), ratio = this.canvas.getPixelRatio(), scaleX = scale.x * ratio, scaleY = scale.y * ratio;\n this.setAttr('shadowColor', color);\n this.setAttr('shadowBlur', blur * Math.min(Math.abs(scaleX), Math.abs(scaleY)));\n this.setAttr('shadowOffsetX', offset.x * scaleX);\n this.setAttr('shadowOffsetY', offset.y * scaleY);\n }\n}\nexports.SceneContext = SceneContext;\nclass HitContext extends Context {\n constructor(canvas) {\n super(canvas);\n this._context = canvas._canvas.getContext('2d', {\n willReadFrequently: true,\n });\n }\n _fill(shape) {\n this.save();\n this.setAttr('fillStyle', shape.colorKey);\n shape._fillFuncHit(this);\n this.restore();\n }\n strokeShape(shape) {\n if (shape.hasHitStroke()) {\n this._stroke(shape);\n }\n }\n _stroke(shape) {\n if (shape.hasHitStroke()) {\n const strokeScaleEnabled = shape.getStrokeScaleEnabled();\n if (!strokeScaleEnabled) {\n this.save();\n var pixelRatio = this.getCanvas().getPixelRatio();\n this.setTransform(pixelRatio, 0, 0, pixelRatio, 0, 0);\n }\n this._applyLineCap(shape);\n var hitStrokeWidth = shape.hitStrokeWidth();\n var strokeWidth = hitStrokeWidth === 'auto' ? shape.strokeWidth() : hitStrokeWidth;\n this.setAttr('lineWidth', strokeWidth);\n this.setAttr('strokeStyle', shape.colorKey);\n shape._strokeFuncHit(this);\n if (!strokeScaleEnabled) {\n this.restore();\n }\n }\n }\n}\nexports.HitContext = HitContext;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.HitCanvas = exports.SceneCanvas = exports.Canvas = void 0;\nconst Util_1 = require(\"./Util\");\nconst Context_1 = require(\"./Context\");\nconst Global_1 = require(\"./Global\");\nconst Factory_1 = require(\"./Factory\");\nconst Validators_1 = require(\"./Validators\");\nvar _pixelRatio;\nfunction getDevicePixelRatio() {\n if (_pixelRatio) {\n return _pixelRatio;\n }\n var canvas = Util_1.Util.createCanvasElement();\n var context = canvas.getContext('2d');\n _pixelRatio = (function () {\n var devicePixelRatio = Global_1.Konva._global.devicePixelRatio || 1, backingStoreRatio = context.webkitBackingStorePixelRatio ||\n context.mozBackingStorePixelRatio ||\n context.msBackingStorePixelRatio ||\n context.oBackingStorePixelRatio ||\n context.backingStorePixelRatio ||\n 1;\n return devicePixelRatio / backingStoreRatio;\n })();\n Util_1.Util.releaseCanvas(canvas);\n return _pixelRatio;\n}\nclass Canvas {\n constructor(config) {\n this.pixelRatio = 1;\n this.width = 0;\n this.height = 0;\n this.isCache = false;\n var conf = config || {};\n var pixelRatio = conf.pixelRatio || Global_1.Konva.pixelRatio || getDevicePixelRatio();\n this.pixelRatio = pixelRatio;\n this._canvas = Util_1.Util.createCanvasElement();\n this._canvas.style.padding = '0';\n this._canvas.style.margin = '0';\n this._canvas.style.border = '0';\n this._canvas.style.background = 'transparent';\n this._canvas.style.position = 'absolute';\n this._canvas.style.top = '0';\n this._canvas.style.left = '0';\n }\n getContext() {\n return this.context;\n }\n getPixelRatio() {\n return this.pixelRatio;\n }\n setPixelRatio(pixelRatio) {\n var previousRatio = this.pixelRatio;\n this.pixelRatio = pixelRatio;\n this.setSize(this.getWidth() / previousRatio, this.getHeight() / previousRatio);\n }\n setWidth(width) {\n this.width = this._canvas.width = width * this.pixelRatio;\n this._canvas.style.width = width + 'px';\n var pixelRatio = this.pixelRatio, _context = this.getContext()._context;\n _context.scale(pixelRatio, pixelRatio);\n }\n setHeight(height) {\n this.height = this._canvas.height = height * this.pixelRatio;\n this._canvas.style.height = height + 'px';\n var pixelRatio = this.pixelRatio, _context = this.getContext()._context;\n _context.scale(pixelRatio, pixelRatio);\n }\n getWidth() {\n return this.width;\n }\n getHeight() {\n return this.height;\n }\n setSize(width, height) {\n this.setWidth(width || 0);\n this.setHeight(height || 0);\n }\n toDataURL(mimeType, quality) {\n try {\n return this._canvas.toDataURL(mimeType, quality);\n }\n catch (e) {\n try {\n return this._canvas.toDataURL();\n }\n catch (err) {\n Util_1.Util.error('Unable to get data URL. ' +\n err.message +\n ' For more info read https://konvajs.org/docs/posts/Tainted_Canvas.html.');\n return '';\n }\n }\n }\n}\nexports.Canvas = Canvas;\nFactory_1.Factory.addGetterSetter(Canvas, 'pixelRatio', undefined, (0, Validators_1.getNumberValidator)());\nclass SceneCanvas extends Canvas {\n constructor(config = { width: 0, height: 0, willReadFrequently: false }) {\n super(config);\n this.context = new Context_1.SceneContext(this, {\n willReadFrequently: config.willReadFrequently,\n });\n this.setSize(config.width, config.height);\n }\n}\nexports.SceneCanvas = SceneCanvas;\nclass HitCanvas extends Canvas {\n constructor(config = { width: 0, height: 0 }) {\n super(config);\n this.hitCanvas = true;\n this.context = new Context_1.HitContext(this);\n this.setSize(config.width, config.height);\n }\n}\nexports.HitCanvas = HitCanvas;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.DD = void 0;\nconst Global_1 = require(\"./Global\");\nconst Util_1 = require(\"./Util\");\nexports.DD = {\n get isDragging() {\n var flag = false;\n exports.DD._dragElements.forEach((elem) => {\n if (elem.dragStatus === 'dragging') {\n flag = true;\n }\n });\n return flag;\n },\n justDragged: false,\n get node() {\n var node;\n exports.DD._dragElements.forEach((elem) => {\n node = elem.node;\n });\n return node;\n },\n _dragElements: new Map(),\n _drag(evt) {\n const nodesToFireEvents = [];\n exports.DD._dragElements.forEach((elem, key) => {\n const { node } = elem;\n const stage = node.getStage();\n stage.setPointersPositions(evt);\n if (elem.pointerId === undefined) {\n elem.pointerId = Util_1.Util._getFirstPointerId(evt);\n }\n const pos = stage._changedPointerPositions.find((pos) => pos.id === elem.pointerId);\n if (!pos) {\n return;\n }\n if (elem.dragStatus !== 'dragging') {\n var dragDistance = node.dragDistance();\n var distance = Math.max(Math.abs(pos.x - elem.startPointerPos.x), Math.abs(pos.y - elem.startPointerPos.y));\n if (distance < dragDistance) {\n return;\n }\n node.startDrag({ evt });\n if (!node.isDragging()) {\n return;\n }\n }\n node._setDragPosition(evt, elem);\n nodesToFireEvents.push(node);\n });\n nodesToFireEvents.forEach((node) => {\n node.fire('dragmove', {\n type: 'dragmove',\n target: node,\n evt: evt,\n }, true);\n });\n },\n _endDragBefore(evt) {\n const drawNodes = [];\n exports.DD._dragElements.forEach((elem) => {\n const { node } = elem;\n const stage = node.getStage();\n if (evt) {\n stage.setPointersPositions(evt);\n }\n const pos = stage._changedPointerPositions.find((pos) => pos.id === elem.pointerId);\n if (!pos) {\n return;\n }\n if (elem.dragStatus === 'dragging' || elem.dragStatus === 'stopped') {\n exports.DD.justDragged = true;\n Global_1.Konva._mouseListenClick = false;\n Global_1.Konva._touchListenClick = false;\n Global_1.Konva._pointerListenClick = false;\n elem.dragStatus = 'stopped';\n }\n const drawNode = elem.node.getLayer() ||\n (elem.node instanceof Global_1.Konva['Stage'] && elem.node);\n if (drawNode && drawNodes.indexOf(drawNode) === -1) {\n drawNodes.push(drawNode);\n }\n });\n drawNodes.forEach((drawNode) => {\n drawNode.draw();\n });\n },\n _endDragAfter(evt) {\n exports.DD._dragElements.forEach((elem, key) => {\n if (elem.dragStatus === 'stopped') {\n elem.node.fire('dragend', {\n type: 'dragend',\n target: elem.node,\n evt: evt,\n }, true);\n }\n if (elem.dragStatus !== 'dragging') {\n exports.DD._dragElements.delete(key);\n }\n });\n },\n};\nif (Global_1.Konva.isBrowser) {\n window.addEventListener('mouseup', exports.DD._endDragBefore, true);\n window.addEventListener('touchend', exports.DD._endDragBefore, true);\n window.addEventListener('mousemove', exports.DD._drag);\n window.addEventListener('touchmove', exports.DD._drag);\n window.addEventListener('mouseup', exports.DD._endDragAfter, false);\n window.addEventListener('touchend', exports.DD._endDragAfter, false);\n}\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Node = void 0;\nconst Util_1 = require(\"./Util\");\nconst Factory_1 = require(\"./Factory\");\nconst Canvas_1 = require(\"./Canvas\");\nconst Global_1 = require(\"./Global\");\nconst DragAndDrop_1 = require(\"./DragAndDrop\");\nconst Validators_1 = require(\"./Validators\");\nvar ABSOLUTE_OPACITY = 'absoluteOpacity', ALL_LISTENERS = 'allEventListeners', ABSOLUTE_TRANSFORM = 'absoluteTransform', ABSOLUTE_SCALE = 'absoluteScale', CANVAS = 'canvas', CHANGE = 'Change', CHILDREN = 'children', KONVA = 'konva', LISTENING = 'listening', MOUSEENTER = 'mouseenter', MOUSELEAVE = 'mouseleave', NAME = 'name', SET = 'set', SHAPE = 'Shape', SPACE = ' ', STAGE = 'stage', TRANSFORM = 'transform', UPPER_STAGE = 'Stage', VISIBLE = 'visible', TRANSFORM_CHANGE_STR = [\n 'xChange.konva',\n 'yChange.konva',\n 'scaleXChange.konva',\n 'scaleYChange.konva',\n 'skewXChange.konva',\n 'skewYChange.konva',\n 'rotationChange.konva',\n 'offsetXChange.konva',\n 'offsetYChange.konva',\n 'transformsEnabledChange.konva',\n].join(SPACE);\nlet idCounter = 1;\nclass Node {\n constructor(config) {\n this._id = idCounter++;\n this.eventListeners = {};\n this.attrs = {};\n this.index = 0;\n this._allEventListeners = null;\n this.parent = null;\n this._cache = new Map();\n this._attachedDepsListeners = new Map();\n this._lastPos = null;\n this._batchingTransformChange = false;\n this._needClearTransformCache = false;\n this._filterUpToDate = false;\n this._isUnderCache = false;\n this._dragEventId = null;\n this._shouldFireChangeEvents = false;\n this.setAttrs(config);\n this._shouldFireChangeEvents = true;\n }\n hasChildren() {\n return false;\n }\n _clearCache(attr) {\n if ((attr === TRANSFORM || attr === ABSOLUTE_TRANSFORM) &&\n this._cache.get(attr)) {\n this._cache.get(attr).dirty = true;\n }\n else if (attr) {\n this._cache.delete(attr);\n }\n else {\n this._cache.clear();\n }\n }\n _getCache(attr, privateGetter) {\n var cache = this._cache.get(attr);\n var isTransform = attr === TRANSFORM || attr === ABSOLUTE_TRANSFORM;\n var invalid = cache === undefined || (isTransform && cache.dirty === true);\n if (invalid) {\n cache = privateGetter.call(this);\n this._cache.set(attr, cache);\n }\n return cache;\n }\n _calculate(name, deps, getter) {\n if (!this._attachedDepsListeners.get(name)) {\n const depsString = deps.map((dep) => dep + 'Change.konva').join(SPACE);\n this.on(depsString, () => {\n this._clearCache(name);\n });\n this._attachedDepsListeners.set(name, true);\n }\n return this._getCache(name, getter);\n }\n _getCanvasCache() {\n return this._cache.get(CANVAS);\n }\n _clearSelfAndDescendantCache(attr) {\n this._clearCache(attr);\n if (attr === ABSOLUTE_TRANSFORM) {\n this.fire('absoluteTransformChange');\n }\n }\n clearCache() {\n if (this._cache.has(CANVAS)) {\n const { scene, filter, hit } = this._cache.get(CANVAS);\n Util_1.Util.releaseCanvas(scene, filter, hit);\n this._cache.delete(CANVAS);\n }\n this._clearSelfAndDescendantCache();\n this._requestDraw();\n return this;\n }\n cache(config) {\n var conf = config || {};\n var rect = {};\n if (conf.x === undefined ||\n conf.y === undefined ||\n conf.width === undefined ||\n conf.height === undefined) {\n rect = this.getClientRect({\n skipTransform: true,\n relativeTo: this.getParent() || undefined,\n });\n }\n var width = Math.ceil(conf.width || rect.width), height = Math.ceil(conf.height || rect.height), pixelRatio = conf.pixelRatio, x = conf.x === undefined ? Math.floor(rect.x) : conf.x, y = conf.y === undefined ? Math.floor(rect.y) : conf.y, offset = conf.offset || 0, drawBorder = conf.drawBorder || false, hitCanvasPixelRatio = conf.hitCanvasPixelRatio || 1;\n if (!width || !height) {\n Util_1.Util.error('Can not cache the node. Width or height of the node equals 0. Caching is skipped.');\n return;\n }\n const extraPaddingX = Math.abs(Math.round(rect.x) - x) > 0.5 ? 1 : 0;\n const extraPaddingY = Math.abs(Math.round(rect.y) - y) > 0.5 ? 1 : 0;\n width += offset * 2 + extraPaddingX;\n height += offset * 2 + extraPaddingY;\n x -= offset;\n y -= offset;\n var cachedSceneCanvas = new Canvas_1.SceneCanvas({\n pixelRatio: pixelRatio,\n width: width,\n height: height,\n }), cachedFilterCanvas = new Canvas_1.SceneCanvas({\n pixelRatio: pixelRatio,\n width: 0,\n height: 0,\n willReadFrequently: true,\n }), cachedHitCanvas = new Canvas_1.HitCanvas({\n pixelRatio: hitCanvasPixelRatio,\n width: width,\n height: height,\n }), sceneContext = cachedSceneCanvas.getContext(), hitContext = cachedHitCanvas.getContext();\n cachedHitCanvas.isCache = true;\n cachedSceneCanvas.isCache = true;\n this._cache.delete(CANVAS);\n this._filterUpToDate = false;\n if (conf.imageSmoothingEnabled === false) {\n cachedSceneCanvas.getContext()._context.imageSmoothingEnabled = false;\n cachedFilterCanvas.getContext()._context.imageSmoothingEnabled = false;\n }\n sceneContext.save();\n hitContext.save();\n sceneContext.translate(-x, -y);\n hitContext.translate(-x, -y);\n this._isUnderCache = true;\n this._clearSelfAndDescendantCache(ABSOLUTE_OPACITY);\n this._clearSelfAndDescendantCache(ABSOLUTE_SCALE);\n this.drawScene(cachedSceneCanvas, this);\n this.drawHit(cachedHitCanvas, this);\n this._isUnderCache = false;\n sceneContext.restore();\n hitContext.restore();\n if (drawBorder) {\n sceneContext.save();\n sceneContext.beginPath();\n sceneContext.rect(0, 0, width, height);\n sceneContext.closePath();\n sceneContext.setAttr('strokeStyle', 'red');\n sceneContext.setAttr('lineWidth', 5);\n sceneContext.stroke();\n sceneContext.restore();\n }\n this._cache.set(CANVAS, {\n scene: cachedSceneCanvas,\n filter: cachedFilterCanvas,\n hit: cachedHitCanvas,\n x: x,\n y: y,\n });\n this._requestDraw();\n return this;\n }\n isCached() {\n return this._cache.has(CANVAS);\n }\n getClientRect(config) {\n throw new Error('abstract \"getClientRect\" method call');\n }\n _transformedRect(rect, top) {\n var points = [\n { x: rect.x, y: rect.y },\n { x: rect.x + rect.width, y: rect.y },\n { x: rect.x + rect.width, y: rect.y + rect.height },\n { x: rect.x, y: rect.y + rect.height },\n ];\n var minX = Infinity, minY = Infinity, maxX = -Infinity, maxY = -Infinity;\n var trans = this.getAbsoluteTransform(top);\n points.forEach(function (point) {\n var transformed = trans.point(point);\n if (minX === undefined) {\n minX = maxX = transformed.x;\n minY = maxY = transformed.y;\n }\n minX = Math.min(minX, transformed.x);\n minY = Math.min(minY, transformed.y);\n maxX = Math.max(maxX, transformed.x);\n maxY = Math.max(maxY, transformed.y);\n });\n return {\n x: minX,\n y: minY,\n width: maxX - minX,\n height: maxY - minY,\n };\n }\n _drawCachedSceneCanvas(context) {\n context.save();\n context._applyOpacity(this);\n context._applyGlobalCompositeOperation(this);\n const canvasCache = this._getCanvasCache();\n context.translate(canvasCache.x, canvasCache.y);\n var cacheCanvas = this._getCachedSceneCanvas();\n var ratio = cacheCanvas.pixelRatio;\n context.drawImage(cacheCanvas._canvas, 0, 0, cacheCanvas.width / ratio, cacheCanvas.height / ratio);\n context.restore();\n }\n _drawCachedHitCanvas(context) {\n var canvasCache = this._getCanvasCache(), hitCanvas = canvasCache.hit;\n context.save();\n context.translate(canvasCache.x, canvasCache.y);\n context.drawImage(hitCanvas._canvas, 0, 0, hitCanvas.width / hitCanvas.pixelRatio, hitCanvas.height / hitCanvas.pixelRatio);\n context.restore();\n }\n _getCachedSceneCanvas() {\n var filters = this.filters(), cachedCanvas = this._getCanvasCache(), sceneCanvas = cachedCanvas.scene, filterCanvas = cachedCanvas.filter, filterContext = filterCanvas.getContext(), len, imageData, n, filter;\n if (filters) {\n if (!this._filterUpToDate) {\n var ratio = sceneCanvas.pixelRatio;\n filterCanvas.setSize(sceneCanvas.width / sceneCanvas.pixelRatio, sceneCanvas.height / sceneCanvas.pixelRatio);\n try {\n len = filters.length;\n filterContext.clear();\n filterContext.drawImage(sceneCanvas._canvas, 0, 0, sceneCanvas.getWidth() / ratio, sceneCanvas.getHeight() / ratio);\n imageData = filterContext.getImageData(0, 0, filterCanvas.getWidth(), filterCanvas.getHeight());\n for (n = 0; n < len; n++) {\n filter = filters[n];\n if (typeof filter !== 'function') {\n Util_1.Util.error('Filter should be type of function, but got ' +\n typeof filter +\n ' instead. Please check correct filters');\n continue;\n }\n filter.call(this, imageData);\n filterContext.putImageData(imageData, 0, 0);\n }\n }\n catch (e) {\n Util_1.Util.error('Unable to apply filter. ' +\n e.message +\n ' This post my help you https://konvajs.org/docs/posts/Tainted_Canvas.html.');\n }\n this._filterUpToDate = true;\n }\n return filterCanvas;\n }\n return sceneCanvas;\n }\n on(evtStr, handler) {\n this._cache && this._cache.delete(ALL_LISTENERS);\n if (arguments.length === 3) {\n return this._delegate.apply(this, arguments);\n }\n var events = evtStr.split(SPACE), len = events.length, n, event, parts, baseEvent, name;\n for (n = 0; n < len; n++) {\n event = events[n];\n parts = event.split('.');\n baseEvent = parts[0];\n name = parts[1] || '';\n if (!this.eventListeners[baseEvent]) {\n this.eventListeners[baseEvent] = [];\n }\n this.eventListeners[baseEvent].push({\n name: name,\n handler: handler,\n });\n }\n return this;\n }\n off(evtStr, callback) {\n var events = (evtStr || '').split(SPACE), len = events.length, n, t, event, parts, baseEvent, name;\n this._cache && this._cache.delete(ALL_LISTENERS);\n if (!evtStr) {\n for (t in this.eventListeners) {\n this._off(t);\n }\n }\n for (n = 0; n < len; n++) {\n event = events[n];\n parts = event.split('.');\n baseEvent = parts[0];\n name = parts[1];\n if (baseEvent) {\n if (this.eventListeners[baseEvent]) {\n this._off(baseEvent, name, callback);\n }\n }\n else {\n for (t in this.eventListeners) {\n this._off(t, name, callback);\n }\n }\n }\n return this;\n }\n dispatchEvent(evt) {\n var e = {\n target: this,\n type: evt.type,\n evt: evt,\n };\n this.fire(evt.type, e);\n return this;\n }\n addEventListener(type, handler) {\n this.on(type, function (evt) {\n handler.call(this, evt.evt);\n });\n return this;\n }\n removeEventListener(type) {\n this.off(type);\n return this;\n }\n _delegate(event, selector, handler) {\n var stopNode = this;\n this.on(event, function (evt) {\n var targets = evt.target.findAncestors(selector, true, stopNode);\n for (var i = 0; i < targets.length; i++) {\n evt = Util_1.Util.cloneObject(evt);\n evt.currentTarget = targets[i];\n handler.call(targets[i], evt);\n }\n });\n }\n remove() {\n if (this.isDragging()) {\n this.stopDrag();\n }\n DragAndDrop_1.DD._dragElements.delete(this._id);\n this._remove();\n return this;\n }\n _clearCaches() {\n this._clearSelfAndDescendantCache(ABSOLUTE_TRANSFORM);\n this._clearSelfAndDescendantCache(ABSOLUTE_OPACITY);\n this._clearSelfAndDescendantCache(ABSOLUTE_SCALE);\n this._clearSelfAndDescendantCache(STAGE);\n this._clearSelfAndDescendantCache(VISIBLE);\n this._clearSelfAndDescendantCache(LISTENING);\n }\n _remove() {\n this._clearCaches();\n var parent = this.getParent();\n if (parent && parent.children) {\n parent.children.splice(this.index, 1);\n parent._setChildrenIndices();\n this.parent = null;\n }\n }\n destroy() {\n this.remove();\n this.clearCache();\n return this;\n }\n getAttr(attr) {\n var method = 'get' + Util_1.Util._capitalize(attr);\n if (Util_1.Util._isFunction(this[method])) {\n return this[method]();\n }\n return this.attrs[attr];\n }\n getAncestors() {\n var parent = this.getParent(), ancestors = [];\n while (parent) {\n ancestors.push(parent);\n parent = parent.getParent();\n }\n return ancestors;\n }\n getAttrs() {\n return (this.attrs || {});\n }\n setAttrs(config) {\n this._batchTransformChanges(() => {\n var key, method;\n if (!config) {\n return this;\n }\n for (key in config) {\n if (key === CHILDREN) {\n continue;\n }\n method = SET + Util_1.Util._capitalize(key);\n if (Util_1.Util._isFunction(this[method])) {\n this[method](config[key]);\n }\n else {\n this._setAttr(key, config[key]);\n }\n }\n });\n return this;\n }\n isListening() {\n return this._getCache(LISTENING, this._isListening);\n }\n _isListening(relativeTo) {\n const listening = this.listening();\n if (!listening) {\n return false;\n }\n const parent = this.getParent();\n if (parent && parent !== relativeTo && this !== relativeTo) {\n return parent._isListening(relativeTo);\n }\n else {\n return true;\n }\n }\n isVisible() {\n return this._getCache(VISIBLE, this._isVisible);\n }\n _isVisible(relativeTo) {\n const visible = this.visible();\n if (!visible) {\n return false;\n }\n const parent = this.getParent();\n if (parent && parent !== relativeTo && this !== relativeTo) {\n return parent._isVisible(relativeTo);\n }\n else {\n return true;\n }\n }\n shouldDrawHit(top, skipDragCheck = false) {\n if (top) {\n return this._isVisible(top) && this._isListening(top);\n }\n var layer = this.getLayer();\n var layerUnderDrag = false;\n DragAndDrop_1.DD._dragElements.forEach((elem) => {\n if (elem.dragStatus !== 'dragging') {\n return;\n }\n else if (elem.node.nodeType === 'Stage') {\n layerUnderDrag = true;\n }\n else if (elem.node.getLayer() === layer) {\n layerUnderDrag = true;\n }\n });\n var dragSkip = !skipDragCheck &&\n !Global_1.Konva.hitOnDragEnabled &&\n (layerUnderDrag || Global_1.Konva.isTransforming());\n return this.isListening() && this.isVisible() && !dragSkip;\n }\n show() {\n this.visible(true);\n return this;\n }\n hide() {\n this.visible(false);\n return this;\n }\n getZIndex() {\n return this.index || 0;\n }\n getAbsoluteZIndex() {\n var depth = this.getDepth(), that = this, index = 0, nodes, len, n, child;\n function addChildren(children) {\n nodes = [];\n len = children.length;\n for (n = 0; n < len; n++) {\n child = children[n];\n index++;\n if (child.nodeType !== SHAPE) {\n nodes = nodes.concat(child.getChildren().slice());\n }\n if (child._id === that._id) {\n n = len;\n }\n }\n if (nodes.length > 0 && nodes[0].getDepth() <= depth) {\n addChildren(nodes);\n }\n }\n const stage = this.getStage();\n if (that.nodeType !== UPPER_STAGE && stage) {\n addChildren(stage.getChildren());\n }\n return index;\n }\n getDepth() {\n var depth = 0, parent = this.parent;\n while (parent) {\n depth++;\n parent = parent.parent;\n }\n return depth;\n }\n _batchTransformChanges(func) {\n this._batchingTransformChange = true;\n func();\n this._batchingTransformChange = false;\n if (this._needClearTransformCache) {\n this._clearCache(TRANSFORM);\n this._clearSelfAndDescendantCache(ABSOLUTE_TRANSFORM);\n }\n this._needClearTransformCache = false;\n }\n setPosition(pos) {\n this._batchTransformChanges(() => {\n this.x(pos.x);\n this.y(pos.y);\n });\n return this;\n }\n getPosition() {\n return {\n x: this.x(),\n y: this.y(),\n };\n }\n getRelativePointerPosition() {\n const stage = this.getStage();\n if (!stage) {\n return null;\n }\n var pos = stage.getPointerPosition();\n if (!pos) {\n return null;\n }\n var transform = this.getAbsoluteTransform().copy();\n transform.invert();\n return transform.point(pos);\n }\n getAbsolutePosition(top) {\n let haveCachedParent = false;\n let parent = this.parent;\n while (parent) {\n if (parent.isCached()) {\n haveCachedParent = true;\n break;\n }\n parent = parent.parent;\n }\n if (haveCachedParent && !top) {\n top = true;\n }\n var absoluteMatrix = this.getAbsoluteTransform(top).getMatrix(), absoluteTransform = new Util_1.Transform(), offset = this.offset();\n absoluteTransform.m = absoluteMatrix.slice();\n absoluteTransform.translate(offset.x, offset.y);\n return absoluteTransform.getTranslation();\n }\n setAbsolutePosition(pos) {\n const { x, y, ...origTrans } = this._clearTransform();\n this.attrs.x = x;\n this.attrs.y = y;\n this._clearCache(TRANSFORM);\n var it = this._getAbsoluteTransform().copy();\n it.invert();\n it.translate(pos.x, pos.y);\n pos = {\n x: this.attrs.x + it.getTranslation().x,\n y: this.attrs.y + it.getTranslation().y,\n };\n this._setTransform(origTrans);\n this.setPosition({ x: pos.x, y: pos.y });\n this._clearCache(TRANSFORM);\n this._clearSelfAndDescendantCache(ABSOLUTE_TRANSFORM);\n return this;\n }\n _setTransform(trans) {\n var key;\n for (key in trans) {\n this.attrs[key] = trans[key];\n }\n }\n _clearTransform() {\n var trans = {\n x: this.x(),\n y: this.y(),\n rotation: this.rotation(),\n scaleX: this.scaleX(),\n scaleY: this.scaleY(),\n offsetX: this.offsetX(),\n offsetY: this.offsetY(),\n skewX: this.skewX(),\n skewY: this.skewY(),\n };\n this.attrs.x = 0;\n this.attrs.y = 0;\n this.attrs.rotation = 0;\n this.attrs.scaleX = 1;\n this.attrs.scaleY = 1;\n this.attrs.offsetX = 0;\n this.attrs.offsetY = 0;\n this.attrs.skewX = 0;\n this.attrs.skewY = 0;\n return trans;\n }\n move(change) {\n var changeX = change.x, changeY = change.y, x = this.x(), y = this.y();\n if (changeX !== undefined) {\n x += changeX;\n }\n if (changeY !== undefined) {\n y += changeY;\n }\n this.setPosition({ x: x, y: y });\n return this;\n }\n _eachAncestorReverse(func, top) {\n var family = [], parent = this.getParent(), len, n;\n if (top && top._id === this._id) {\n return;\n }\n family.unshift(this);\n while (parent && (!top || parent._id !== top._id)) {\n family.unshift(parent);\n parent = parent.parent;\n }\n len = family.length;\n for (n = 0; n < len; n++) {\n func(family[n]);\n }\n }\n rotate(theta) {\n this.rotation(this.rotation() + theta);\n return this;\n }\n moveToTop() {\n if (!this.parent) {\n Util_1.Util.warn('Node has no parent. moveToTop function is ignored.');\n return false;\n }\n var index = this.index, len = this.parent.getChildren().length;\n if (index < len - 1) {\n this.parent.children.splice(index, 1);\n this.parent.children.push(this);\n this.parent._setChildrenIndices();\n return true;\n }\n return false;\n }\n moveUp() {\n if (!this.parent) {\n Util_1.Util.warn('Node has no parent. moveUp function is ignored.');\n return false;\n }\n var index = this.index, len = this.parent.getChildren().length;\n if (index < len - 1) {\n this.parent.children.splice(index, 1);\n this.parent.children.splice(index + 1, 0, this);\n this.parent._setChildrenIndices();\n return true;\n }\n return false;\n }\n moveDown() {\n if (!this.parent) {\n Util_1.Util.warn('Node has no parent. moveDown function is ignored.');\n return false;\n }\n var index = this.index;\n if (index > 0) {\n this.parent.children.splice(index, 1);\n this.parent.children.splice(index - 1, 0, this);\n this.parent._setChildrenIndices();\n return true;\n }\n return false;\n }\n moveToBottom() {\n if (!this.parent) {\n Util_1.Util.warn('Node has no parent. moveToBottom function is ignored.');\n return false;\n }\n var index = this.index;\n if (index > 0) {\n this.parent.children.splice(index, 1);\n this.parent.children.unshift(this);\n this.parent._setChildrenIndices();\n return true;\n }\n return false;\n }\n setZIndex(zIndex) {\n if (!this.parent) {\n Util_1.Util.warn('Node has no parent. zIndex parameter is ignored.');\n return this;\n }\n if (zIndex < 0 || zIndex >= this.parent.children.length) {\n Util_1.Util.warn('Unexpected value ' +\n zIndex +\n ' for zIndex property. zIndex is just index of a node in children of its parent. Expected value is from 0 to ' +\n (this.parent.children.length - 1) +\n '.');\n }\n var index = this.index;\n this.parent.children.splice(index, 1);\n this.parent.children.splice(zIndex, 0, this);\n this.parent._setChildrenIndices();\n return this;\n }\n getAbsoluteOpacity() {\n return this._getCache(ABSOLUTE_OPACITY, this._getAbsoluteOpacity);\n }\n _getAbsoluteOpacity() {\n var absOpacity = this.opacity();\n var parent = this.getParent();\n if (parent && !parent._isUnderCache) {\n absOpacity *= parent.getAbsoluteOpacity();\n }\n return absOpacity;\n }\n moveTo(newContainer) {\n if (this.getParent() !== newContainer) {\n this._remove();\n newContainer.add(this);\n }\n return this;\n }\n toObject() {\n var attrs = this.getAttrs(), key, val, getter, defaultValue, nonPlainObject;\n const obj = {\n attrs: {},\n className: this.getClassName(),\n };\n for (key in attrs) {\n val = attrs[key];\n nonPlainObject =\n Util_1.Util.isObject(val) && !Util_1.Util._isPlainObject(val) && !Util_1.Util._isArray(val);\n if (nonPlainObject) {\n continue;\n }\n getter = typeof this[key] === 'function' && this[key];\n delete attrs[key];\n defaultValue = getter ? getter.call(this) : null;\n attrs[key] = val;\n if (defaultValue !== val) {\n obj.attrs[key] = val;\n }\n }\n return Util_1.Util._prepareToStringify(obj);\n }\n toJSON() {\n return JSON.stringify(this.toObject());\n }\n getParent() {\n return this.parent;\n }\n findAncestors(selector, includeSelf, stopNode) {\n var res = [];\n if (includeSelf && this._isMatch(selector)) {\n res.push(this);\n }\n var ancestor = this.parent;\n while (ancestor) {\n if (ancestor === stopNode) {\n return res;\n }\n if (ancestor._isMatch(selector)) {\n res.push(ancestor);\n }\n ancestor = ancestor.parent;\n }\n return res;\n }\n isAncestorOf(node) {\n return false;\n }\n findAncestor(selector, includeSelf, stopNode) {\n return this.findAncestors(selector, includeSelf, stopNode)[0];\n }\n _isMatch(selector) {\n if (!selector) {\n return false;\n }\n if (typeof selector === 'function') {\n return selector(this);\n }\n var selectorArr = selector.replace(/ /g, '').split(','), len = selectorArr.length, n, sel;\n for (n = 0; n < len; n++) {\n sel = selectorArr[n];\n if (!Util_1.Util.isValidSelector(sel)) {\n Util_1.Util.warn('Selector \"' +\n sel +\n '\" is invalid. Allowed selectors examples are \"#foo\", \".bar\" or \"Group\".');\n Util_1.Util.warn('If you have a custom shape with such className, please change it to start with upper letter like \"Triangle\".');\n Util_1.Util.warn('Konva is awesome, right?');\n }\n if (sel.charAt(0) === '#') {\n if (this.id() === sel.slice(1)) {\n return true;\n }\n }\n else if (sel.charAt(0) === '.') {\n if (this.hasName(sel.slice(1))) {\n return true;\n }\n }\n else if (this.className === sel || this.nodeType === sel) {\n return true;\n }\n }\n return false;\n }\n getLayer() {\n var parent = this.getParent();\n return parent ? parent.getLayer() : null;\n }\n getStage() {\n return this._getCache(STAGE, this._getStage);\n }\n _getStage() {\n var parent = this.getParent();\n if (parent) {\n return parent.getStage();\n }\n else {\n return null;\n }\n }\n fire(eventType, evt = {}, bubble) {\n evt.target = evt.target || this;\n if (bubble) {\n this._fireAndBubble(eventType, evt);\n }\n else {\n this._fire(eventType, evt);\n }\n return this;\n }\n getAbsoluteTransform(top) {\n if (top) {\n return this._getAbsoluteTransform(top);\n }\n else {\n return this._getCache(ABSOLUTE_TRANSFORM, this._getAbsoluteTransform);\n }\n }\n _getAbsoluteTransform(top) {\n var at;\n if (top) {\n at = new Util_1.Transform();\n this._eachAncestorReverse(function (node) {\n var transformsEnabled = node.transformsEnabled();\n if (transformsEnabled === 'all') {\n at.multiply(node.getTransform());\n }\n else if (transformsEnabled === 'position') {\n at.translate(node.x() - node.offsetX(), node.y() - node.offsetY());\n }\n }, top);\n return at;\n }\n else {\n at = this._cache.get(ABSOLUTE_TRANSFORM) || new Util_1.Transform();\n if (this.parent) {\n this.parent.getAbsoluteTransform().copyInto(at);\n }\n else {\n at.reset();\n }\n var transformsEnabled = this.transformsEnabled();\n if (transformsEnabled === 'all') {\n at.multiply(this.getTransform());\n }\n else if (transformsEnabled === 'position') {\n const x = this.attrs.x || 0;\n const y = this.attrs.y || 0;\n const offsetX = this.attrs.offsetX || 0;\n const offsetY = this.attrs.offsetY || 0;\n at.translate(x - offsetX, y - offsetY);\n }\n at.dirty = false;\n return at;\n }\n }\n getAbsoluteScale(top) {\n var parent = this;\n while (parent) {\n if (parent._isUnderCache) {\n top = parent;\n }\n parent = parent.getParent();\n }\n const transform = this.getAbsoluteTransform(top);\n const attrs = transform.decompose();\n return {\n x: attrs.scaleX,\n y: attrs.scaleY,\n };\n }\n getAbsoluteRotation() {\n return this.getAbsoluteTransform().decompose().rotation;\n }\n getTransform() {\n return this._getCache(TRANSFORM, this._getTransform);\n }\n _getTransform() {\n var _a, _b;\n var m = this._cache.get(TRANSFORM) || new Util_1.Transform();\n m.reset();\n var x = this.x(), y = this.y(), rotation = Global_1.Konva.getAngle(this.rotation()), scaleX = (_a = this.attrs.scaleX) !== null && _a !== void 0 ? _a : 1, scaleY = (_b = this.attrs.scaleY) !== null && _b !== void 0 ? _b : 1, skewX = this.attrs.skewX || 0, skewY = this.attrs.skewY || 0, offsetX = this.attrs.offsetX || 0, offsetY = this.attrs.offsetY || 0;\n if (x !== 0 || y !== 0) {\n m.translate(x, y);\n }\n if (rotation !== 0) {\n m.rotate(rotation);\n }\n if (skewX !== 0 || skewY !== 0) {\n m.skew(skewX, skewY);\n }\n if (scaleX !== 1 || scaleY !== 1) {\n m.scale(scaleX, scaleY);\n }\n if (offsetX !== 0 || offsetY !== 0) {\n m.translate(-1 * offsetX, -1 * offsetY);\n }\n m.dirty = false;\n return m;\n }\n clone(obj) {\n var attrs = Util_1.Util.cloneObject(this.attrs), key, allListeners, len, n, listener;\n for (key in obj) {\n attrs[key] = obj[key];\n }\n var node = new this.constructor(attrs);\n for (key in this.eventListeners) {\n allListeners = this.eventListeners[key];\n len = allListeners.length;\n for (n = 0; n < len; n++) {\n listener = allListeners[n];\n if (listener.name.indexOf(KONVA) < 0) {\n if (!node.eventListeners[key]) {\n node.eventListeners[key] = [];\n }\n node.eventListeners[key].push(listener);\n }\n }\n }\n return node;\n }\n _toKonvaCanvas(config) {\n config = config || {};\n var box = this.getClientRect();\n var stage = this.getStage(), x = config.x !== undefined ? config.x : Math.floor(box.x), y = config.y !== undefined ? config.y : Math.floor(box.y), pixelRatio = config.pixelRatio || 1, canvas = new Canvas_1.SceneCanvas({\n width: config.width || Math.ceil(box.width) || (stage ? stage.width() : 0),\n height: config.height ||\n Math.ceil(box.height) ||\n (stage ? stage.height() : 0),\n pixelRatio: pixelRatio,\n }), context = canvas.getContext();\n const bufferCanvas = new Canvas_1.SceneCanvas({\n width: canvas.width / canvas.pixelRatio + Math.abs(x),\n height: canvas.height / canvas.pixelRatio + Math.abs(y),\n pixelRatio: canvas.pixelRatio,\n });\n if (config.imageSmoothingEnabled === false) {\n context._context.imageSmoothingEnabled = false;\n }\n context.save();\n if (x || y) {\n context.translate(-1 * x, -1 * y);\n }\n this.drawScene(canvas, undefined, bufferCanvas);\n context.restore();\n return canvas;\n }\n toCanvas(config) {\n return this._toKonvaCanvas(config)._canvas;\n }\n toDataURL(config) {\n config = config || {};\n var mimeType = config.mimeType || null, quality = config.quality || null;\n var url = this._toKonvaCanvas(config).toDataURL(mimeType, quality);\n if (config.callback) {\n config.callback(url);\n }\n return url;\n }\n toImage(config) {\n return new Promise((resolve, reject) => {\n try {\n const callback = config === null || config === void 0 ? void 0 : config.callback;\n if (callback)\n delete config.callback;\n Util_1.Util._urlToImage(this.toDataURL(config), function (img) {\n resolve(img);\n callback === null || callback === void 0 ? void 0 : callback(img);\n });\n }\n catch (err) {\n reject(err);\n }\n });\n }\n toBlob(config) {\n return new Promise((resolve, reject) => {\n try {\n const callback = config === null || config === void 0 ? void 0 : config.callback;\n if (callback)\n delete config.callback;\n this.toCanvas(config).toBlob((blob) => {\n resolve(blob);\n callback === null || callback === void 0 ? void 0 : callback(blob);\n }, config === null || config === void 0 ? void 0 : config.mimeType, config === null || config === void 0 ? void 0 : config.quality);\n }\n catch (err) {\n reject(err);\n }\n });\n }\n setSize(size) {\n this.width(size.width);\n this.height(size.height);\n return this;\n }\n getSize() {\n return {\n width: this.width(),\n height: this.height(),\n };\n }\n getClassName() {\n return this.className || this.nodeType;\n }\n getType() {\n return this.nodeType;\n }\n getDragDistance() {\n if (this.attrs.dragDistance !== undefined) {\n return this.attrs.dragDistance;\n }\n else if (this.parent) {\n return this.parent.getDragDistance();\n }\n else {\n return Global_1.Konva.dragDistance;\n }\n }\n _off(type, name, callback) {\n var evtListeners = this.eventListeners[type], i, evtName, handler;\n for (i = 0; i < evtListeners.length; i++) {\n evtName = evtListeners[i].name;\n handler = evtListeners[i].handler;\n if ((evtName !== 'konva' || name === 'konva') &&\n (!name || evtName === name) &&\n (!callback || callback === handler)) {\n evtListeners.splice(i, 1);\n if (evtListeners.length === 0) {\n delete this.eventListeners[type];\n break;\n }\n i--;\n }\n }\n }\n _fireChangeEvent(attr, oldVal, newVal) {\n this._fire(attr + CHANGE, {\n oldVal: oldVal,\n newVal: newVal,\n });\n }\n addName(name) {\n if (!this.hasName(name)) {\n var oldName = this.name();\n var newName = oldName ? oldName + ' ' + name : name;\n this.name(newName);\n }\n return this;\n }\n hasName(name) {\n if (!name) {\n return false;\n }\n const fullName = this.name();\n if (!fullName) {\n return false;\n }\n var names = (fullName || '').split(/\\s/g);\n return names.indexOf(name) !== -1;\n }\n removeName(name) {\n var names = (this.name() || '').split(/\\s/g);\n var index = names.indexOf(name);\n if (index !== -1) {\n names.splice(index, 1);\n this.name(names.join(' '));\n }\n return this;\n }\n setAttr(attr, val) {\n var func = this[SET + Util_1.Util._capitalize(attr)];\n if (Util_1.Util._isFunction(func)) {\n func.call(this, val);\n }\n else {\n this._setAttr(attr, val);\n }\n return this;\n }\n _requestDraw() {\n if (Global_1.Konva.autoDrawEnabled) {\n const drawNode = this.getLayer() || this.getStage();\n drawNode === null || drawNode === void 0 ? void 0 : drawNode.batchDraw();\n }\n }\n _setAttr(key, val) {\n var oldVal = this.attrs[key];\n if (oldVal === val && !Util_1.Util.isObject(val)) {\n return;\n }\n if (val === undefined || val === null) {\n delete this.attrs[key];\n }\n else {\n this.attrs[key] = val;\n }\n if (this._shouldFireChangeEvents) {\n this._fireChangeEvent(key, oldVal, val);\n }\n this._requestDraw();\n }\n _setComponentAttr(key, component, val) {\n var oldVal;\n if (val !== undefined) {\n oldVal = this.attrs[key];\n if (!oldVal) {\n this.attrs[key] = this.getAttr(key);\n }\n this.attrs[key][component] = val;\n this._fireChangeEvent(key, oldVal, val);\n }\n }\n _fireAndBubble(eventType, evt, compareShape) {\n if (evt && this.nodeType === SHAPE) {\n evt.target = this;\n }\n var shouldStop = (eventType === MOUSEENTER || eventType === MOUSELEAVE) &&\n ((compareShape &&\n (this === compareShape ||\n (this.isAncestorOf && this.isAncestorOf(compareShape)))) ||\n (this.nodeType === 'Stage' && !compareShape));\n if (!shouldStop) {\n this._fire(eventType, evt);\n var stopBubble = (eventType === MOUSEENTER || eventType === MOUSELEAVE) &&\n compareShape &&\n compareShape.isAncestorOf &&\n compareShape.isAncestorOf(this) &&\n !compareShape.isAncestorOf(this.parent);\n if (((evt && !evt.cancelBubble) || !evt) &&\n this.parent &&\n this.parent.isListening() &&\n !stopBubble) {\n if (compareShape && compareShape.parent) {\n this._fireAndBubble.call(this.parent, eventType, evt, compareShape);\n }\n else {\n this._fireAndBubble.call(this.parent, eventType, evt);\n }\n }\n }\n }\n _getProtoListeners(eventType) {\n var _a, _b, _c;\n const allListeners = (_a = this._cache.get(ALL_LISTENERS)) !== null && _a !== void 0 ? _a : {};\n let events = allListeners === null || allListeners === void 0 ? void 0 : allListeners[eventType];\n if (events === undefined) {\n events = [];\n let obj = Object.getPrototypeOf(this);\n while (obj) {\n const hierarchyEvents = (_c = (_b = obj.eventListeners) === null || _b === void 0 ? void 0 : _b[eventType]) !== null && _c !== void 0 ? _c : [];\n events.push(...hierarchyEvents);\n obj = Object.getPrototypeOf(obj);\n }\n allListeners[eventType] = events;\n this._cache.set(ALL_LISTENERS, allListeners);\n }\n return events;\n }\n _fire(eventType, evt) {\n evt = evt || {};\n evt.currentTarget = this;\n evt.type = eventType;\n const topListeners = this._getProtoListeners(eventType);\n if (topListeners) {\n for (var i = 0; i < topListeners.length; i++) {\n topListeners[i].handler.call(this, evt);\n }\n }\n const selfListeners = this.eventListeners[eventType];\n if (selfListeners) {\n for (var i = 0; i < selfListeners.length; i++) {\n selfListeners[i].handler.call(this, evt);\n }\n }\n }\n draw() {\n this.drawScene();\n this.drawHit();\n return this;\n }\n _createDragElement(evt) {\n var pointerId = evt ? evt.pointerId : undefined;\n var stage = this.getStage();\n var ap = this.getAbsolutePosition();\n if (!stage) {\n return;\n }\n var pos = stage._getPointerById(pointerId) ||\n stage._changedPointerPositions[0] ||\n ap;\n DragAndDrop_1.DD._dragElements.set(this._id, {\n node: this,\n startPointerPos: pos,\n offset: {\n x: pos.x - ap.x,\n y: pos.y - ap.y,\n },\n dragStatus: 'ready',\n pointerId,\n });\n }\n startDrag(evt, bubbleEvent = true) {\n if (!DragAndDrop_1.DD._dragElements.has(this._id)) {\n this._createDragElement(evt);\n }\n const elem = DragAndDrop_1.DD._dragElements.get(this._id);\n elem.dragStatus = 'dragging';\n this.fire('dragstart', {\n type: 'dragstart',\n target: this,\n evt: evt && evt.evt,\n }, bubbleEvent);\n }\n _setDragPosition(evt, elem) {\n const pos = this.getStage()._getPointerById(elem.pointerId);\n if (!pos) {\n return;\n }\n var newNodePos = {\n x: pos.x - elem.offset.x,\n y: pos.y - elem.offset.y,\n };\n var dbf = this.dragBoundFunc();\n if (dbf !== undefined) {\n const bounded = dbf.call(this, newNodePos, evt);\n if (!bounded) {\n Util_1.Util.warn('dragBoundFunc did not return any value. That is unexpected behavior. You must return new absolute position from dragBoundFunc.');\n }\n else {\n newNodePos = bounded;\n }\n }\n if (!this._lastPos ||\n this._lastPos.x !== newNodePos.x ||\n this._lastPos.y !== newNodePos.y) {\n this.setAbsolutePosition(newNodePos);\n this._requestDraw();\n }\n this._lastPos = newNodePos;\n }\n stopDrag(evt) {\n const elem = DragAndDrop_1.DD._dragElements.get(this._id);\n if (elem) {\n elem.dragStatus = 'stopped';\n }\n DragAndDrop_1.DD._endDragBefore(evt);\n DragAndDrop_1.DD._endDragAfter(evt);\n }\n setDraggable(draggable) {\n this._setAttr('draggable', draggable);\n this._dragChange();\n }\n isDragging() {\n const elem = DragAndDrop_1.DD._dragElements.get(this._id);\n return elem ? elem.dragStatus === 'dragging' : false;\n }\n _listenDrag() {\n this._dragCleanup();\n this.on('mousedown.konva touchstart.konva', function (evt) {\n var shouldCheckButton = evt.evt['button'] !== undefined;\n var canDrag = !shouldCheckButton || Global_1.Konva.dragButtons.indexOf(evt.evt['button']) >= 0;\n if (!canDrag) {\n return;\n }\n if (this.isDragging()) {\n return;\n }\n var hasDraggingChild = false;\n DragAndDrop_1.DD._dragElements.forEach((elem) => {\n if (this.isAncestorOf(elem.node)) {\n hasDraggingChild = true;\n }\n });\n if (!hasDraggingChild) {\n this._createDragElement(evt);\n }\n });\n }\n _dragChange() {\n if (this.attrs.draggable) {\n this._listenDrag();\n }\n else {\n this._dragCleanup();\n var stage = this.getStage();\n if (!stage) {\n return;\n }\n const dragElement = DragAndDrop_1.DD._dragElements.get(this._id);\n const isDragging = dragElement && dragElement.dragStatus === 'dragging';\n const isReady = dragElement && dragElement.dragStatus === 'ready';\n if (isDragging) {\n this.stopDrag();\n }\n else if (isReady) {\n DragAndDrop_1.DD._dragElements.delete(this._id);\n }\n }\n }\n _dragCleanup() {\n this.off('mousedown.konva');\n this.off('touchstart.konva');\n }\n isClientRectOnScreen(margin = { x: 0, y: 0 }) {\n const stage = this.getStage();\n if (!stage) {\n return false;\n }\n const screenRect = {\n x: -margin.x,\n y: -margin.y,\n width: stage.width() + 2 * margin.x,\n height: stage.height() + 2 * margin.y,\n };\n return Util_1.Util.haveIntersection(screenRect, this.getClientRect());\n }\n static create(data, container) {\n if (Util_1.Util._isString(data)) {\n data = JSON.parse(data);\n }\n return this._createNode(data, container);\n }\n static _createNode(obj, container) {\n var className = Node.prototype.getClassName.call(obj), children = obj.children, no, len, n;\n if (container) {\n obj.attrs.container = container;\n }\n if (!Global_1.Konva[className]) {\n Util_1.Util.warn('Can not find a node with class name \"' +\n className +\n '\". Fallback to \"Shape\".');\n className = 'Shape';\n }\n const Class = Global_1.Konva[className];\n no = new Class(obj.attrs);\n if (children) {\n len = children.length;\n for (n = 0; n < len; n++) {\n no.add(Node._createNode(children[n]));\n }\n }\n return no;\n }\n}\nexports.Node = Node;\nNode.prototype.nodeType = 'Node';\nNode.prototype._attrsAffectingSize = [];\nNode.prototype.eventListeners = {};\nNode.prototype.on.call(Node.prototype, TRANSFORM_CHANGE_STR, function () {\n if (this._batchingTransformChange) {\n this._needClearTransformCache = true;\n return;\n }\n this._clearCache(TRANSFORM);\n this._clearSelfAndDescendantCache(ABSOLUTE_TRANSFORM);\n});\nNode.prototype.on.call(Node.prototype, 'visibleChange.konva', function () {\n this._clearSelfAndDescendantCache(VISIBLE);\n});\nNode.prototype.on.call(Node.prototype, 'listeningChange.konva', function () {\n this._clearSelfAndDescendantCache(LISTENING);\n});\nNode.prototype.on.call(Node.prototype, 'opacityChange.konva', function () {\n this._clearSelfAndDescendantCache(ABSOLUTE_OPACITY);\n});\nconst addGetterSetter = Factory_1.Factory.addGetterSetter;\naddGetterSetter(Node, 'zIndex');\naddGetterSetter(Node, 'absolutePosition');\naddGetterSetter(Node, 'position');\naddGetterSetter(Node, 'x', 0, (0, Validators_1.getNumberValidator)());\naddGetterSetter(Node, 'y', 0, (0, Validators_1.getNumberValidator)());\naddGetterSetter(Node, 'globalCompositeOperation', 'source-over', (0, Validators_1.getStringValidator)());\naddGetterSetter(Node, 'opacity', 1, (0, Validators_1.getNumberValidator)());\naddGetterSetter(Node, 'name', '', (0, Validators_1.getStringValidator)());\naddGetterSetter(Node, 'id', '', (0, Validators_1.getStringValidator)());\naddGetterSetter(Node, 'rotation', 0, (0, Validators_1.getNumberValidator)());\nFactory_1.Factory.addComponentsGetterSetter(Node, 'scale', ['x', 'y']);\naddGetterSetter(Node, 'scaleX', 1, (0, Validators_1.getNumberValidator)());\naddGetterSetter(Node, 'scaleY', 1, (0, Validators_1.getNumberValidator)());\nFactory_1.Factory.addComponentsGetterSetter(Node, 'skew', ['x', 'y']);\naddGetterSetter(Node, 'skewX', 0, (0, Validators_1.getNumberValidator)());\naddGetterSetter(Node, 'skewY', 0, (0, Validators_1.getNumberValidator)());\nFactory_1.Factory.addComponentsGetterSetter(Node, 'offset', ['x', 'y']);\naddGetterSetter(Node, 'offsetX', 0, (0, Validators_1.getNumberValidator)());\naddGetterSetter(Node, 'offsetY', 0, (0, Validators_1.getNumberValidator)());\naddGetterSetter(Node, 'dragDistance', null, (0, Validators_1.getNumberValidator)());\naddGetterSetter(Node, 'width', 0, (0, Validators_1.getNumberValidator)());\naddGetterSetter(Node, 'height', 0, (0, Validators_1.getNumberValidator)());\naddGetterSetter(Node, 'listening', true, (0, Validators_1.getBooleanValidator)());\naddGetterSetter(Node, 'preventDefault', true, (0, Validators_1.getBooleanValidator)());\naddGetterSetter(Node, 'filters', null, function (val) {\n this._filterUpToDate = false;\n return val;\n});\naddGetterSetter(Node, 'visible', true, (0, Validators_1.getBooleanValidator)());\naddGetterSetter(Node, 'transformsEnabled', 'all', (0, Validators_1.getStringValidator)());\naddGetterSetter(Node, 'size');\naddGetterSetter(Node, 'dragBoundFunc');\naddGetterSetter(Node, 'draggable', false, (0, Validators_1.getBooleanValidator)());\nFactory_1.Factory.backCompat(Node, {\n rotateDeg: 'rotate',\n setRotationDeg: 'setRotation',\n getRotationDeg: 'getRotation',\n});\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Container = void 0;\nconst Factory_1 = require(\"./Factory\");\nconst Node_1 = require(\"./Node\");\nconst Validators_1 = require(\"./Validators\");\nclass Container extends Node_1.Node {\n constructor() {\n super(...arguments);\n this.children = [];\n }\n getChildren(filterFunc) {\n if (!filterFunc) {\n return this.children || [];\n }\n const children = this.children || [];\n var results = [];\n children.forEach(function (child) {\n if (filterFunc(child)) {\n results.push(child);\n }\n });\n return results;\n }\n hasChildren() {\n return this.getChildren().length > 0;\n }\n removeChildren() {\n this.getChildren().forEach((child) => {\n child.parent = null;\n child.index = 0;\n child.remove();\n });\n this.children = [];\n this._requestDraw();\n return this;\n }\n destroyChildren() {\n this.getChildren().forEach((child) => {\n child.parent = null;\n child.index = 0;\n child.destroy();\n });\n this.children = [];\n this._requestDraw();\n return this;\n }\n add(...children) {\n if (children.length === 0) {\n return this;\n }\n if (children.length > 1) {\n for (var i = 0; i < children.length; i++) {\n this.add(children[i]);\n }\n return this;\n }\n const child = children[0];\n if (child.getParent()) {\n child.moveTo(this);\n return this;\n }\n this._validateAdd(child);\n child.index = this.getChildren().length;\n child.parent = this;\n child._clearCaches();\n this.getChildren().push(child);\n this._fire('add', {\n child: child,\n });\n this._requestDraw();\n return this;\n }\n destroy() {\n if (this.hasChildren()) {\n this.destroyChildren();\n }\n super.destroy();\n return this;\n }\n find(selector) {\n return this._generalFind(selector, false);\n }\n findOne(selector) {\n var result = this._generalFind(selector, true);\n return result.length > 0 ? result[0] : undefined;\n }\n _generalFind(selector, findOne) {\n var retArr = [];\n this._descendants((node) => {\n const valid = node._isMatch(selector);\n if (valid) {\n retArr.push(node);\n }\n if (valid && findOne) {\n return true;\n }\n return false;\n });\n return retArr;\n }\n _descendants(fn) {\n let shouldStop = false;\n const children = this.getChildren();\n for (const child of children) {\n shouldStop = fn(child);\n if (shouldStop) {\n return true;\n }\n if (!child.hasChildren()) {\n continue;\n }\n shouldStop = child._descendants(fn);\n if (shouldStop) {\n return true;\n }\n }\n return false;\n }\n toObject() {\n var obj = Node_1.Node.prototype.toObject.call(this);\n obj.children = [];\n this.getChildren().forEach((child) => {\n obj.children.push(child.toObject());\n });\n return obj;\n }\n isAncestorOf(node) {\n var parent = node.getParent();\n while (parent) {\n if (parent._id === this._id) {\n return true;\n }\n parent = parent.getParent();\n }\n return false;\n }\n clone(obj) {\n var node = Node_1.Node.prototype.clone.call(this, obj);\n this.getChildren().forEach(function (no) {\n node.add(no.clone());\n });\n return node;\n }\n getAllIntersections(pos) {\n var arr = [];\n this.find('Shape').forEach((shape) => {\n if (shape.isVisible() && shape.intersects(pos)) {\n arr.push(shape);\n }\n });\n return arr;\n }\n _clearSelfAndDescendantCache(attr) {\n var _a;\n super._clearSelfAndDescendantCache(attr);\n if (this.isCached()) {\n return;\n }\n (_a = this.children) === null || _a === void 0 ? void 0 : _a.forEach(function (node) {\n node._clearSelfAndDescendantCache(attr);\n });\n }\n _setChildrenIndices() {\n var _a;\n (_a = this.children) === null || _a === void 0 ? void 0 : _a.forEach(function (child, n) {\n child.index = n;\n });\n this._requestDraw();\n }\n drawScene(can, top, bufferCanvas) {\n var layer = this.getLayer(), canvas = can || (layer && layer.getCanvas()), context = canvas && canvas.getContext(), cachedCanvas = this._getCanvasCache(), cachedSceneCanvas = cachedCanvas && cachedCanvas.scene;\n var caching = canvas && canvas.isCache;\n if (!this.isVisible() && !caching) {\n return this;\n }\n if (cachedSceneCanvas) {\n context.save();\n var m = this.getAbsoluteTransform(top).getMatrix();\n context.transform(m[0], m[1], m[2], m[3], m[4], m[5]);\n this._drawCachedSceneCanvas(context);\n context.restore();\n }\n else {\n this._drawChildren('drawScene', canvas, top, bufferCanvas);\n }\n return this;\n }\n drawHit(can, top) {\n if (!this.shouldDrawHit(top)) {\n return this;\n }\n var layer = this.getLayer(), canvas = can || (layer && layer.hitCanvas), context = canvas && canvas.getContext(), cachedCanvas = this._getCanvasCache(), cachedHitCanvas = cachedCanvas && cachedCanvas.hit;\n if (cachedHitCanvas) {\n context.save();\n var m = this.getAbsoluteTransform(top).getMatrix();\n context.transform(m[0], m[1], m[2], m[3], m[4], m[5]);\n this._drawCachedHitCanvas(context);\n context.restore();\n }\n else {\n this._drawChildren('drawHit', canvas, top);\n }\n return this;\n }\n _drawChildren(drawMethod, canvas, top, bufferCanvas) {\n var _a;\n var context = canvas && canvas.getContext(), clipWidth = this.clipWidth(), clipHeight = this.clipHeight(), clipFunc = this.clipFunc(), hasClip = (typeof clipWidth === 'number' && typeof clipHeight === 'number') ||\n clipFunc;\n const selfCache = top === this;\n if (hasClip) {\n context.save();\n var transform = this.getAbsoluteTransform(top);\n var m = transform.getMatrix();\n context.transform(m[0], m[1], m[2], m[3], m[4], m[5]);\n context.beginPath();\n let clipArgs;\n if (clipFunc) {\n clipArgs = clipFunc.call(this, context, this);\n }\n else {\n var clipX = this.clipX();\n var clipY = this.clipY();\n context.rect(clipX || 0, clipY || 0, clipWidth, clipHeight);\n }\n context.clip.apply(context, clipArgs);\n m = transform.copy().invert().getMatrix();\n context.transform(m[0], m[1], m[2], m[3], m[4], m[5]);\n }\n var hasComposition = !selfCache &&\n this.globalCompositeOperation() !== 'source-over' &&\n drawMethod === 'drawScene';\n if (hasComposition) {\n context.save();\n context._applyGlobalCompositeOperation(this);\n }\n (_a = this.children) === null || _a === void 0 ? void 0 : _a.forEach(function (child) {\n child[drawMethod](canvas, top, bufferCanvas);\n });\n if (hasComposition) {\n context.restore();\n }\n if (hasClip) {\n context.restore();\n }\n }\n getClientRect(config = {}) {\n var _a;\n var skipTransform = config.skipTransform;\n var relativeTo = config.relativeTo;\n var minX, minY, maxX, maxY;\n var selfRect = {\n x: Infinity,\n y: Infinity,\n width: 0,\n height: 0,\n };\n var that = this;\n (_a = this.children) === null || _a === void 0 ? void 0 : _a.forEach(function (child) {\n if (!child.visible()) {\n return;\n }\n var rect = child.getClientRect({\n relativeTo: that,\n skipShadow: config.skipShadow,\n skipStroke: config.skipStroke,\n });\n if (rect.width === 0 && rect.height === 0) {\n return;\n }\n if (minX === undefined) {\n minX = rect.x;\n minY = rect.y;\n maxX = rect.x + rect.width;\n maxY = rect.y + rect.height;\n }\n else {\n minX = Math.min(minX, rect.x);\n minY = Math.min(minY, rect.y);\n maxX = Math.max(maxX, rect.x + rect.width);\n maxY = Math.max(maxY, rect.y + rect.height);\n }\n });\n var shapes = this.find('Shape');\n var hasVisible = false;\n for (var i = 0; i < shapes.length; i++) {\n var shape = shapes[i];\n if (shape._isVisible(this)) {\n hasVisible = true;\n break;\n }\n }\n if (hasVisible && minX !== undefined) {\n selfRect = {\n x: minX,\n y: minY,\n width: maxX - minX,\n height: maxY - minY,\n };\n }\n else {\n selfRect = {\n x: 0,\n y: 0,\n width: 0,\n height: 0,\n };\n }\n if (!skipTransform) {\n return this._transformedRect(selfRect, relativeTo);\n }\n return selfRect;\n }\n}\nexports.Container = Container;\nFactory_1.Factory.addComponentsGetterSetter(Container, 'clip', [\n 'x',\n 'y',\n 'width',\n 'height',\n]);\nFactory_1.Factory.addGetterSetter(Container, 'clipX', undefined, (0, Validators_1.getNumberValidator)());\nFactory_1.Factory.addGetterSetter(Container, 'clipY', undefined, (0, Validators_1.getNumberValidator)());\nFactory_1.Factory.addGetterSetter(Container, 'clipWidth', undefined, (0, Validators_1.getNumberValidator)());\nFactory_1.Factory.addGetterSetter(Container, 'clipHeight', undefined, (0, Validators_1.getNumberValidator)());\nFactory_1.Factory.addGetterSetter(Container, 'clipFunc');\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.releaseCapture = exports.setPointerCapture = exports.hasPointerCapture = exports.createEvent = exports.getCapturedShape = void 0;\nconst Global_1 = require(\"./Global\");\nconst Captures = new Map();\nconst SUPPORT_POINTER_EVENTS = Global_1.Konva._global['PointerEvent'] !== undefined;\nfunction getCapturedShape(pointerId) {\n return Captures.get(pointerId);\n}\nexports.getCapturedShape = getCapturedShape;\nfunction createEvent(evt) {\n return {\n evt,\n pointerId: evt.pointerId,\n };\n}\nexports.createEvent = createEvent;\nfunction hasPointerCapture(pointerId, shape) {\n return Captures.get(pointerId) === shape;\n}\nexports.hasPointerCapture = hasPointerCapture;\nfunction setPointerCapture(pointerId, shape) {\n releaseCapture(pointerId);\n const stage = shape.getStage();\n if (!stage)\n return;\n Captures.set(pointerId, shape);\n if (SUPPORT_POINTER_EVENTS) {\n shape._fire('gotpointercapture', createEvent(new PointerEvent('gotpointercapture')));\n }\n}\nexports.setPointerCapture = setPointerCapture;\nfunction releaseCapture(pointerId, target) {\n const shape = Captures.get(pointerId);\n if (!shape)\n return;\n const stage = shape.getStage();\n if (stage && stage.content) {\n }\n Captures.delete(pointerId);\n if (SUPPORT_POINTER_EVENTS) {\n shape._fire('lostpointercapture', createEvent(new PointerEvent('lostpointercapture')));\n }\n}\nexports.releaseCapture = releaseCapture;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Stage = exports.stages = void 0;\nconst Util_1 = require(\"./Util\");\nconst Factory_1 = require(\"./Factory\");\nconst Container_1 = require(\"./Container\");\nconst Global_1 = require(\"./Global\");\nconst Canvas_1 = require(\"./Canvas\");\nconst DragAndDrop_1 = require(\"./DragAndDrop\");\nconst Global_2 = require(\"./Global\");\nconst PointerEvents = require(\"./PointerEvents\");\nvar STAGE = 'Stage', STRING = 'string', PX = 'px', MOUSEOUT = 'mouseout', MOUSELEAVE = 'mouseleave', MOUSEOVER = 'mouseover', MOUSEENTER = 'mouseenter', MOUSEMOVE = 'mousemove', MOUSEDOWN = 'mousedown', MOUSEUP = 'mouseup', POINTERMOVE = 'pointermove', POINTERDOWN = 'pointerdown', POINTERUP = 'pointerup', POINTERCANCEL = 'pointercancel', LOSTPOINTERCAPTURE = 'lostpointercapture', POINTEROUT = 'pointerout', POINTERLEAVE = 'pointerleave', POINTEROVER = 'pointerover', POINTERENTER = 'pointerenter', CONTEXTMENU = 'contextmenu', TOUCHSTART = 'touchstart', TOUCHEND = 'touchend', TOUCHMOVE = 'touchmove', TOUCHCANCEL = 'touchcancel', WHEEL = 'wheel', MAX_LAYERS_NUMBER = 5, EVENTS = [\n [MOUSEENTER, '_pointerenter'],\n [MOUSEDOWN, '_pointerdown'],\n [MOUSEMOVE, '_pointermove'],\n [MOUSEUP, '_pointerup'],\n [MOUSELEAVE, '_pointerleave'],\n [TOUCHSTART, '_pointerdown'],\n [TOUCHMOVE, '_pointermove'],\n [TOUCHEND, '_pointerup'],\n [TOUCHCANCEL, '_pointercancel'],\n [MOUSEOVER, '_pointerover'],\n [WHEEL, '_wheel'],\n [CONTEXTMENU, '_contextmenu'],\n [POINTERDOWN, '_pointerdown'],\n [POINTERMOVE, '_pointermove'],\n [POINTERUP, '_pointerup'],\n [POINTERCANCEL, '_pointercancel'],\n [LOSTPOINTERCAPTURE, '_lostpointercapture'],\n];\nconst EVENTS_MAP = {\n mouse: {\n [POINTEROUT]: MOUSEOUT,\n [POINTERLEAVE]: MOUSELEAVE,\n [POINTEROVER]: MOUSEOVER,\n [POINTERENTER]: MOUSEENTER,\n [POINTERMOVE]: MOUSEMOVE,\n [POINTERDOWN]: MOUSEDOWN,\n [POINTERUP]: MOUSEUP,\n [POINTERCANCEL]: 'mousecancel',\n pointerclick: 'click',\n pointerdblclick: 'dblclick',\n },\n touch: {\n [POINTEROUT]: 'touchout',\n [POINTERLEAVE]: 'touchleave',\n [POINTEROVER]: 'touchover',\n [POINTERENTER]: 'touchenter',\n [POINTERMOVE]: TOUCHMOVE,\n [POINTERDOWN]: TOUCHSTART,\n [POINTERUP]: TOUCHEND,\n [POINTERCANCEL]: TOUCHCANCEL,\n pointerclick: 'tap',\n pointerdblclick: 'dbltap',\n },\n pointer: {\n [POINTEROUT]: POINTEROUT,\n [POINTERLEAVE]: POINTERLEAVE,\n [POINTEROVER]: POINTEROVER,\n [POINTERENTER]: POINTERENTER,\n [POINTERMOVE]: POINTERMOVE,\n [POINTERDOWN]: POINTERDOWN,\n [POINTERUP]: POINTERUP,\n [POINTERCANCEL]: POINTERCANCEL,\n pointerclick: 'pointerclick',\n pointerdblclick: 'pointerdblclick',\n },\n};\nconst getEventType = (type) => {\n if (type.indexOf('pointer') >= 0) {\n return 'pointer';\n }\n if (type.indexOf('touch') >= 0) {\n return 'touch';\n }\n return 'mouse';\n};\nconst getEventsMap = (eventType) => {\n const type = getEventType(eventType);\n if (type === 'pointer') {\n return Global_1.Konva.pointerEventsEnabled && EVENTS_MAP.pointer;\n }\n if (type === 'touch') {\n return EVENTS_MAP.touch;\n }\n if (type === 'mouse') {\n return EVENTS_MAP.mouse;\n }\n};\nfunction checkNoClip(attrs = {}) {\n if (attrs.clipFunc || attrs.clipWidth || attrs.clipHeight) {\n Util_1.Util.warn('Stage does not support clipping. Please use clip for Layers or Groups.');\n }\n return attrs;\n}\nconst NO_POINTERS_MESSAGE = `Pointer position is missing and not registered by the stage. Looks like it is outside of the stage container. You can set it manually from event: stage.setPointersPositions(event);`;\nexports.stages = [];\nclass Stage extends Container_1.Container {\n constructor(config) {\n super(checkNoClip(config));\n this._pointerPositions = [];\n this._changedPointerPositions = [];\n this._buildDOM();\n this._bindContentEvents();\n exports.stages.push(this);\n this.on('widthChange.konva heightChange.konva', this._resizeDOM);\n this.on('visibleChange.konva', this._checkVisibility);\n this.on('clipWidthChange.konva clipHeightChange.konva clipFuncChange.konva', () => {\n checkNoClip(this.attrs);\n });\n this._checkVisibility();\n }\n _validateAdd(child) {\n const isLayer = child.getType() === 'Layer';\n const isFastLayer = child.getType() === 'FastLayer';\n const valid = isLayer || isFastLayer;\n if (!valid) {\n Util_1.Util.throw('You may only add layers to the stage.');\n }\n }\n _checkVisibility() {\n if (!this.content) {\n return;\n }\n const style = this.visible() ? '' : 'none';\n this.content.style.display = style;\n }\n setContainer(container) {\n if (typeof container === STRING) {\n if (container.charAt(0) === '.') {\n var className = container.slice(1);\n container = document.getElementsByClassName(className)[0];\n }\n else {\n var id;\n if (container.charAt(0) !== '#') {\n id = container;\n }\n else {\n id = container.slice(1);\n }\n container = document.getElementById(id);\n }\n if (!container) {\n throw 'Can not find container in document with id ' + id;\n }\n }\n this._setAttr('container', container);\n if (this.content) {\n if (this.content.parentElement) {\n this.content.parentElement.removeChild(this.content);\n }\n container.appendChild(this.content);\n }\n return this;\n }\n shouldDrawHit() {\n return true;\n }\n clear() {\n var layers = this.children, len = layers.length, n;\n for (n = 0; n < len; n++) {\n layers[n].clear();\n }\n return this;\n }\n clone(obj) {\n if (!obj) {\n obj = {};\n }\n obj.container =\n typeof document !== 'undefined' && document.createElement('div');\n return Container_1.Container.prototype.clone.call(this, obj);\n }\n destroy() {\n super.destroy();\n var content = this.content;\n if (content && Util_1.Util._isInDocument(content)) {\n this.container().removeChild(content);\n }\n var index = exports.stages.indexOf(this);\n if (index > -1) {\n exports.stages.splice(index, 1);\n }\n Util_1.Util.releaseCanvas(this.bufferCanvas._canvas, this.bufferHitCanvas._canvas);\n return this;\n }\n getPointerPosition() {\n const pos = this._pointerPositions[0] || this._changedPointerPositions[0];\n if (!pos) {\n Util_1.Util.warn(NO_POINTERS_MESSAGE);\n return null;\n }\n return {\n x: pos.x,\n y: pos.y,\n };\n }\n _getPointerById(id) {\n return this._pointerPositions.find((p) => p.id === id);\n }\n getPointersPositions() {\n return this._pointerPositions;\n }\n getStage() {\n return this;\n }\n getContent() {\n return this.content;\n }\n _toKonvaCanvas(config) {\n config = config || {};\n config.x = config.x || 0;\n config.y = config.y || 0;\n config.width = config.width || this.width();\n config.height = config.height || this.height();\n var canvas = new Canvas_1.SceneCanvas({\n width: config.width,\n height: config.height,\n pixelRatio: config.pixelRatio || 1,\n });\n var _context = canvas.getContext()._context;\n var layers = this.children;\n if (config.x || config.y) {\n _context.translate(-1 * config.x, -1 * config.y);\n }\n layers.forEach(function (layer) {\n if (!layer.isVisible()) {\n return;\n }\n var layerCanvas = layer._toKonvaCanvas(config);\n _context.drawImage(layerCanvas._canvas, config.x, config.y, layerCanvas.getWidth() / layerCanvas.getPixelRatio(), layerCanvas.getHeight() / layerCanvas.getPixelRatio());\n });\n return canvas;\n }\n getIntersection(pos) {\n if (!pos) {\n return null;\n }\n var layers = this.children, len = layers.length, end = len - 1, n;\n for (n = end; n >= 0; n--) {\n const shape = layers[n].getIntersection(pos);\n if (shape) {\n return shape;\n }\n }\n return null;\n }\n _resizeDOM() {\n var width = this.width();\n var height = this.height();\n if (this.content) {\n this.content.style.width = width + PX;\n this.content.style.height = height + PX;\n }\n this.bufferCanvas.setSize(width, height);\n this.bufferHitCanvas.setSize(width, height);\n this.children.forEach((layer) => {\n layer.setSize({ width, height });\n layer.draw();\n });\n }\n add(layer, ...rest) {\n if (arguments.length > 1) {\n for (var i = 0; i < arguments.length; i++) {\n this.add(arguments[i]);\n }\n return this;\n }\n super.add(layer);\n var length = this.children.length;\n if (length > MAX_LAYERS_NUMBER) {\n Util_1.Util.warn('The stage has ' +\n length +\n ' layers. Recommended maximum number of layers is 3-5. Adding more layers into the stage may drop the performance. Rethink your tree structure, you can use Konva.Group.');\n }\n layer.setSize({ width: this.width(), height: this.height() });\n layer.draw();\n if (Global_1.Konva.isBrowser) {\n this.content.appendChild(layer.canvas._canvas);\n }\n return this;\n }\n getParent() {\n return null;\n }\n getLayer() {\n return null;\n }\n hasPointerCapture(pointerId) {\n return PointerEvents.hasPointerCapture(pointerId, this);\n }\n setPointerCapture(pointerId) {\n PointerEvents.setPointerCapture(pointerId, this);\n }\n releaseCapture(pointerId) {\n PointerEvents.releaseCapture(pointerId, this);\n }\n getLayers() {\n return this.children;\n }\n _bindContentEvents() {\n if (!Global_1.Konva.isBrowser) {\n return;\n }\n EVENTS.forEach(([event, methodName]) => {\n this.content.addEventListener(event, (evt) => {\n this[methodName](evt);\n }, { passive: false });\n });\n }\n _pointerenter(evt) {\n this.setPointersPositions(evt);\n const events = getEventsMap(evt.type);\n if (events) {\n this._fire(events.pointerenter, {\n evt: evt,\n target: this,\n currentTarget: this,\n });\n }\n }\n _pointerover(evt) {\n this.setPointersPositions(evt);\n const events = getEventsMap(evt.type);\n if (events) {\n this._fire(events.pointerover, {\n evt: evt,\n target: this,\n currentTarget: this,\n });\n }\n }\n _getTargetShape(evenType) {\n let shape = this[evenType + 'targetShape'];\n if (shape && !shape.getStage()) {\n shape = null;\n }\n return shape;\n }\n _pointerleave(evt) {\n const events = getEventsMap(evt.type);\n const eventType = getEventType(evt.type);\n if (!events) {\n return;\n }\n this.setPointersPositions(evt);\n var targetShape = this._getTargetShape(eventType);\n var eventsEnabled = !(Global_1.Konva.isDragging() || Global_1.Konva.isTransforming()) || Global_1.Konva.hitOnDragEnabled;\n if (targetShape && eventsEnabled) {\n targetShape._fireAndBubble(events.pointerout, { evt: evt });\n targetShape._fireAndBubble(events.pointerleave, { evt: evt });\n this._fire(events.pointerleave, {\n evt: evt,\n target: this,\n currentTarget: this,\n });\n this[eventType + 'targetShape'] = null;\n }\n else if (eventsEnabled) {\n this._fire(events.pointerleave, {\n evt: evt,\n target: this,\n currentTarget: this,\n });\n this._fire(events.pointerout, {\n evt: evt,\n target: this,\n currentTarget: this,\n });\n }\n this.pointerPos = null;\n this._pointerPositions = [];\n }\n _pointerdown(evt) {\n const events = getEventsMap(evt.type);\n const eventType = getEventType(evt.type);\n if (!events) {\n return;\n }\n this.setPointersPositions(evt);\n var triggeredOnShape = false;\n this._changedPointerPositions.forEach((pos) => {\n var shape = this.getIntersection(pos);\n DragAndDrop_1.DD.justDragged = false;\n Global_1.Konva['_' + eventType + 'ListenClick'] = true;\n if (!shape || !shape.isListening()) {\n this[eventType + 'ClickStartShape'] = undefined;\n return;\n }\n if (Global_1.Konva.capturePointerEventsEnabled) {\n shape.setPointerCapture(pos.id);\n }\n this[eventType + 'ClickStartShape'] = shape;\n shape._fireAndBubble(events.pointerdown, {\n evt: evt,\n pointerId: pos.id,\n });\n triggeredOnShape = true;\n const isTouch = evt.type.indexOf('touch') >= 0;\n if (shape.preventDefault() && evt.cancelable && isTouch) {\n evt.preventDefault();\n }\n });\n if (!triggeredOnShape) {\n this._fire(events.pointerdown, {\n evt: evt,\n target: this,\n currentTarget: this,\n pointerId: this._pointerPositions[0].id,\n });\n }\n }\n _pointermove(evt) {\n const events = getEventsMap(evt.type);\n const eventType = getEventType(evt.type);\n if (!events) {\n return;\n }\n if (Global_1.Konva.isDragging() && DragAndDrop_1.DD.node.preventDefault() && evt.cancelable) {\n evt.preventDefault();\n }\n this.setPointersPositions(evt);\n var eventsEnabled = !(Global_1.Konva.isDragging() || Global_1.Konva.isTransforming()) || Global_1.Konva.hitOnDragEnabled;\n if (!eventsEnabled) {\n return;\n }\n var processedShapesIds = {};\n let triggeredOnShape = false;\n var targetShape = this._getTargetShape(eventType);\n this._changedPointerPositions.forEach((pos) => {\n const shape = (PointerEvents.getCapturedShape(pos.id) ||\n this.getIntersection(pos));\n const pointerId = pos.id;\n const event = { evt: evt, pointerId };\n var differentTarget = targetShape !== shape;\n if (differentTarget && targetShape) {\n targetShape._fireAndBubble(events.pointerout, { ...event }, shape);\n targetShape._fireAndBubble(events.pointerleave, { ...event }, shape);\n }\n if (shape) {\n if (processedShapesIds[shape._id]) {\n return;\n }\n processedShapesIds[shape._id] = true;\n }\n if (shape && shape.isListening()) {\n triggeredOnShape = true;\n if (differentTarget) {\n shape._fireAndBubble(events.pointerover, { ...event }, targetShape);\n shape._fireAndBubble(events.pointerenter, { ...event }, targetShape);\n this[eventType + 'targetShape'] = shape;\n }\n shape._fireAndBubble(events.pointermove, { ...event });\n }\n else {\n if (targetShape) {\n this._fire(events.pointerover, {\n evt: evt,\n target: this,\n currentTarget: this,\n pointerId,\n });\n this[eventType + 'targetShape'] = null;\n }\n }\n });\n if (!triggeredOnShape) {\n this._fire(events.pointermove, {\n evt: evt,\n target: this,\n currentTarget: this,\n pointerId: this._changedPointerPositions[0].id,\n });\n }\n }\n _pointerup(evt) {\n const events = getEventsMap(evt.type);\n const eventType = getEventType(evt.type);\n if (!events) {\n return;\n }\n this.setPointersPositions(evt);\n const clickStartShape = this[eventType + 'ClickStartShape'];\n const clickEndShape = this[eventType + 'ClickEndShape'];\n var processedShapesIds = {};\n let triggeredOnShape = false;\n this._changedPointerPositions.forEach((pos) => {\n const shape = (PointerEvents.getCapturedShape(pos.id) ||\n this.getIntersection(pos));\n if (shape) {\n shape.releaseCapture(pos.id);\n if (processedShapesIds[shape._id]) {\n return;\n }\n processedShapesIds[shape._id] = true;\n }\n const pointerId = pos.id;\n const event = { evt: evt, pointerId };\n let fireDblClick = false;\n if (Global_1.Konva['_' + eventType + 'InDblClickWindow']) {\n fireDblClick = true;\n clearTimeout(this[eventType + 'DblTimeout']);\n }\n else if (!DragAndDrop_1.DD.justDragged) {\n Global_1.Konva['_' + eventType + 'InDblClickWindow'] = true;\n clearTimeout(this[eventType + 'DblTimeout']);\n }\n this[eventType + 'DblTimeout'] = setTimeout(function () {\n Global_1.Konva['_' + eventType + 'InDblClickWindow'] = false;\n }, Global_1.Konva.dblClickWindow);\n if (shape && shape.isListening()) {\n triggeredOnShape = true;\n this[eventType + 'ClickEndShape'] = shape;\n shape._fireAndBubble(events.pointerup, { ...event });\n if (Global_1.Konva['_' + eventType + 'ListenClick'] &&\n clickStartShape &&\n clickStartShape === shape) {\n shape._fireAndBubble(events.pointerclick, { ...event });\n if (fireDblClick && clickEndShape && clickEndShape === shape) {\n shape._fireAndBubble(events.pointerdblclick, { ...event });\n }\n }\n }\n else {\n this[eventType + 'ClickEndShape'] = null;\n if (Global_1.Konva['_' + eventType + 'ListenClick']) {\n this._fire(events.pointerclick, {\n evt: evt,\n target: this,\n currentTarget: this,\n pointerId,\n });\n }\n if (fireDblClick) {\n this._fire(events.pointerdblclick, {\n evt: evt,\n target: this,\n currentTarget: this,\n pointerId,\n });\n }\n }\n });\n if (!triggeredOnShape) {\n this._fire(events.pointerup, {\n evt: evt,\n target: this,\n currentTarget: this,\n pointerId: this._changedPointerPositions[0].id,\n });\n }\n Global_1.Konva['_' + eventType + 'ListenClick'] = false;\n if (evt.cancelable && eventType !== 'touch') {\n evt.preventDefault();\n }\n }\n _contextmenu(evt) {\n this.setPointersPositions(evt);\n var shape = this.getIntersection(this.getPointerPosition());\n if (shape && shape.isListening()) {\n shape._fireAndBubble(CONTEXTMENU, { evt: evt });\n }\n else {\n this._fire(CONTEXTMENU, {\n evt: evt,\n target: this,\n currentTarget: this,\n });\n }\n }\n _wheel(evt) {\n this.setPointersPositions(evt);\n var shape = this.getIntersection(this.getPointerPosition());\n if (shape && shape.isListening()) {\n shape._fireAndBubble(WHEEL, { evt: evt });\n }\n else {\n this._fire(WHEEL, {\n evt: evt,\n target: this,\n currentTarget: this,\n });\n }\n }\n _pointercancel(evt) {\n this.setPointersPositions(evt);\n const shape = PointerEvents.getCapturedShape(evt.pointerId) ||\n this.getIntersection(this.getPointerPosition());\n if (shape) {\n shape._fireAndBubble(POINTERUP, PointerEvents.createEvent(evt));\n }\n PointerEvents.releaseCapture(evt.pointerId);\n }\n _lostpointercapture(evt) {\n PointerEvents.releaseCapture(evt.pointerId);\n }\n setPointersPositions(evt) {\n var contentPosition = this._getContentPosition(), x = null, y = null;\n evt = evt ? evt : window.event;\n if (evt.touches !== undefined) {\n this._pointerPositions = [];\n this._changedPointerPositions = [];\n Array.prototype.forEach.call(evt.touches, (touch) => {\n this._pointerPositions.push({\n id: touch.identifier,\n x: (touch.clientX - contentPosition.left) / contentPosition.scaleX,\n y: (touch.clientY - contentPosition.top) / contentPosition.scaleY,\n });\n });\n Array.prototype.forEach.call(evt.changedTouches || evt.touches, (touch) => {\n this._changedPointerPositions.push({\n id: touch.identifier,\n x: (touch.clientX - contentPosition.left) / contentPosition.scaleX,\n y: (touch.clientY - contentPosition.top) / contentPosition.scaleY,\n });\n });\n }\n else {\n x = (evt.clientX - contentPosition.left) / contentPosition.scaleX;\n y = (evt.clientY - contentPosition.top) / contentPosition.scaleY;\n this.pointerPos = {\n x: x,\n y: y,\n };\n this._pointerPositions = [{ x, y, id: Util_1.Util._getFirstPointerId(evt) }];\n this._changedPointerPositions = [\n { x, y, id: Util_1.Util._getFirstPointerId(evt) },\n ];\n }\n }\n _setPointerPosition(evt) {\n Util_1.Util.warn('Method _setPointerPosition is deprecated. Use \"stage.setPointersPositions(event)\" instead.');\n this.setPointersPositions(evt);\n }\n _getContentPosition() {\n if (!this.content || !this.content.getBoundingClientRect) {\n return {\n top: 0,\n left: 0,\n scaleX: 1,\n scaleY: 1,\n };\n }\n var rect = this.content.getBoundingClientRect();\n return {\n top: rect.top,\n left: rect.left,\n scaleX: rect.width / this.content.clientWidth || 1,\n scaleY: rect.height / this.content.clientHeight || 1,\n };\n }\n _buildDOM() {\n this.bufferCanvas = new Canvas_1.SceneCanvas({\n width: this.width(),\n height: this.height(),\n });\n this.bufferHitCanvas = new Canvas_1.HitCanvas({\n pixelRatio: 1,\n width: this.width(),\n height: this.height(),\n });\n if (!Global_1.Konva.isBrowser) {\n return;\n }\n var container = this.container();\n if (!container) {\n throw 'Stage has no container. A container is required.';\n }\n container.innerHTML = '';\n this.content = document.createElement('div');\n this.content.style.position = 'relative';\n this.content.style.userSelect = 'none';\n this.content.className = 'konvajs-content';\n this.content.setAttribute('role', 'presentation');\n container.appendChild(this.content);\n this._resizeDOM();\n }\n cache() {\n Util_1.Util.warn('Cache function is not allowed for stage. You may use cache only for layers, groups and shapes.');\n return this;\n }\n clearCache() {\n return this;\n }\n batchDraw() {\n this.getChildren().forEach(function (layer) {\n layer.batchDraw();\n });\n return this;\n }\n}\nexports.Stage = Stage;\nStage.prototype.nodeType = STAGE;\n(0, Global_2._registerNode)(Stage);\nFactory_1.Factory.addGetterSetter(Stage, 'container');\nif (Global_1.Konva.isBrowser) {\n document.addEventListener('visibilitychange', () => {\n exports.stages.forEach((stage) => {\n stage.batchDraw();\n });\n });\n}\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Shape = exports.shapes = void 0;\nconst Global_1 = require(\"./Global\");\nconst Util_1 = require(\"./Util\");\nconst Factory_1 = require(\"./Factory\");\nconst Node_1 = require(\"./Node\");\nconst Validators_1 = require(\"./Validators\");\nconst Global_2 = require(\"./Global\");\nconst PointerEvents = require(\"./PointerEvents\");\nvar HAS_SHADOW = 'hasShadow';\nvar SHADOW_RGBA = 'shadowRGBA';\nvar patternImage = 'patternImage';\nvar linearGradient = 'linearGradient';\nvar radialGradient = 'radialGradient';\nlet dummyContext;\nfunction getDummyContext() {\n if (dummyContext) {\n return dummyContext;\n }\n dummyContext = Util_1.Util.createCanvasElement().getContext('2d');\n return dummyContext;\n}\nexports.shapes = {};\nfunction _fillFunc(context) {\n const fillRule = this.attrs.fillRule;\n if (fillRule) {\n context.fill(fillRule);\n }\n else {\n context.fill();\n }\n}\nfunction _strokeFunc(context) {\n context.stroke();\n}\nfunction _fillFuncHit(context) {\n const fillRule = this.attrs.fillRule;\n if (fillRule) {\n context.fill(fillRule);\n }\n else {\n context.fill();\n }\n}\nfunction _strokeFuncHit(context) {\n context.stroke();\n}\nfunction _clearHasShadowCache() {\n this._clearCache(HAS_SHADOW);\n}\nfunction _clearGetShadowRGBACache() {\n this._clearCache(SHADOW_RGBA);\n}\nfunction _clearFillPatternCache() {\n this._clearCache(patternImage);\n}\nfunction _clearLinearGradientCache() {\n this._clearCache(linearGradient);\n}\nfunction _clearRadialGradientCache() {\n this._clearCache(radialGradient);\n}\nclass Shape extends Node_1.Node {\n constructor(config) {\n super(config);\n let key;\n while (true) {\n key = Util_1.Util.getRandomColor();\n if (key && !(key in exports.shapes)) {\n break;\n }\n }\n this.colorKey = key;\n exports.shapes[key] = this;\n }\n getContext() {\n Util_1.Util.warn('shape.getContext() method is deprecated. Please do not use it.');\n return this.getLayer().getContext();\n }\n getCanvas() {\n Util_1.Util.warn('shape.getCanvas() method is deprecated. Please do not use it.');\n return this.getLayer().getCanvas();\n }\n getSceneFunc() {\n return this.attrs.sceneFunc || this['_sceneFunc'];\n }\n getHitFunc() {\n return this.attrs.hitFunc || this['_hitFunc'];\n }\n hasShadow() {\n return this._getCache(HAS_SHADOW, this._hasShadow);\n }\n _hasShadow() {\n return (this.shadowEnabled() &&\n this.shadowOpacity() !== 0 &&\n !!(this.shadowColor() ||\n this.shadowBlur() ||\n this.shadowOffsetX() ||\n this.shadowOffsetY()));\n }\n _getFillPattern() {\n return this._getCache(patternImage, this.__getFillPattern);\n }\n __getFillPattern() {\n if (this.fillPatternImage()) {\n var ctx = getDummyContext();\n const pattern = ctx.createPattern(this.fillPatternImage(), this.fillPatternRepeat() || 'repeat');\n if (pattern && pattern.setTransform) {\n const tr = new Util_1.Transform();\n tr.translate(this.fillPatternX(), this.fillPatternY());\n tr.rotate(Global_1.Konva.getAngle(this.fillPatternRotation()));\n tr.scale(this.fillPatternScaleX(), this.fillPatternScaleY());\n tr.translate(-1 * this.fillPatternOffsetX(), -1 * this.fillPatternOffsetY());\n const m = tr.getMatrix();\n const matrix = typeof DOMMatrix === 'undefined'\n ? {\n a: m[0],\n b: m[1],\n c: m[2],\n d: m[3],\n e: m[4],\n f: m[5],\n }\n : new DOMMatrix(m);\n pattern.setTransform(matrix);\n }\n return pattern;\n }\n }\n _getLinearGradient() {\n return this._getCache(linearGradient, this.__getLinearGradient);\n }\n __getLinearGradient() {\n var colorStops = this.fillLinearGradientColorStops();\n if (colorStops) {\n var ctx = getDummyContext();\n var start = this.fillLinearGradientStartPoint();\n var end = this.fillLinearGradientEndPoint();\n var grd = ctx.createLinearGradient(start.x, start.y, end.x, end.y);\n for (var n = 0; n < colorStops.length; n += 2) {\n grd.addColorStop(colorStops[n], colorStops[n + 1]);\n }\n return grd;\n }\n }\n _getRadialGradient() {\n return this._getCache(radialGradient, this.__getRadialGradient);\n }\n __getRadialGradient() {\n var colorStops = this.fillRadialGradientColorStops();\n if (colorStops) {\n var ctx = getDummyContext();\n var start = this.fillRadialGradientStartPoint();\n var end = this.fillRadialGradientEndPoint();\n var grd = ctx.createRadialGradient(start.x, start.y, this.fillRadialGradientStartRadius(), end.x, end.y, this.fillRadialGradientEndRadius());\n for (var n = 0; n < colorStops.length; n += 2) {\n grd.addColorStop(colorStops[n], colorStops[n + 1]);\n }\n return grd;\n }\n }\n getShadowRGBA() {\n return this._getCache(SHADOW_RGBA, this._getShadowRGBA);\n }\n _getShadowRGBA() {\n if (!this.hasShadow()) {\n return;\n }\n var rgba = Util_1.Util.colorToRGBA(this.shadowColor());\n if (rgba) {\n return ('rgba(' +\n rgba.r +\n ',' +\n rgba.g +\n ',' +\n rgba.b +\n ',' +\n rgba.a * (this.shadowOpacity() || 1) +\n ')');\n }\n }\n hasFill() {\n return this._calculate('hasFill', [\n 'fillEnabled',\n 'fill',\n 'fillPatternImage',\n 'fillLinearGradientColorStops',\n 'fillRadialGradientColorStops',\n ], () => {\n return (this.fillEnabled() &&\n !!(this.fill() ||\n this.fillPatternImage() ||\n this.fillLinearGradientColorStops() ||\n this.fillRadialGradientColorStops()));\n });\n }\n hasStroke() {\n return this._calculate('hasStroke', [\n 'strokeEnabled',\n 'strokeWidth',\n 'stroke',\n 'strokeLinearGradientColorStops',\n ], () => {\n return (this.strokeEnabled() &&\n this.strokeWidth() &&\n !!(this.stroke() || this.strokeLinearGradientColorStops()));\n });\n }\n hasHitStroke() {\n const width = this.hitStrokeWidth();\n if (width === 'auto') {\n return this.hasStroke();\n }\n return this.strokeEnabled() && !!width;\n }\n intersects(point) {\n var stage = this.getStage();\n if (!stage) {\n return false;\n }\n const bufferHitCanvas = stage.bufferHitCanvas;\n bufferHitCanvas.getContext().clear();\n this.drawHit(bufferHitCanvas, undefined, true);\n const p = bufferHitCanvas.context.getImageData(Math.round(point.x), Math.round(point.y), 1, 1).data;\n return p[3] > 0;\n }\n destroy() {\n Node_1.Node.prototype.destroy.call(this);\n delete exports.shapes[this.colorKey];\n delete this.colorKey;\n return this;\n }\n _useBufferCanvas(forceFill) {\n var _a;\n const perfectDrawEnabled = (_a = this.attrs.perfectDrawEnabled) !== null && _a !== void 0 ? _a : true;\n if (!perfectDrawEnabled) {\n return false;\n }\n const hasFill = forceFill || this.hasFill();\n const hasStroke = this.hasStroke();\n const isTransparent = this.getAbsoluteOpacity() !== 1;\n if (hasFill && hasStroke && isTransparent) {\n return true;\n }\n const hasShadow = this.hasShadow();\n const strokeForShadow = this.shadowForStrokeEnabled();\n if (hasFill && hasStroke && hasShadow && strokeForShadow) {\n return true;\n }\n return false;\n }\n setStrokeHitEnabled(val) {\n Util_1.Util.warn('strokeHitEnabled property is deprecated. Please use hitStrokeWidth instead.');\n if (val) {\n this.hitStrokeWidth('auto');\n }\n else {\n this.hitStrokeWidth(0);\n }\n }\n getStrokeHitEnabled() {\n if (this.hitStrokeWidth() === 0) {\n return false;\n }\n else {\n return true;\n }\n }\n getSelfRect() {\n var size = this.size();\n return {\n x: this._centroid ? -size.width / 2 : 0,\n y: this._centroid ? -size.height / 2 : 0,\n width: size.width,\n height: size.height,\n };\n }\n getClientRect(config = {}) {\n let hasCachedParent = false;\n let parent = this.getParent();\n while (parent) {\n if (parent.isCached()) {\n hasCachedParent = true;\n break;\n }\n parent = parent.getParent();\n }\n const skipTransform = config.skipTransform;\n const relativeTo = config.relativeTo || (hasCachedParent && this.getStage()) || undefined;\n const fillRect = this.getSelfRect();\n const applyStroke = !config.skipStroke && this.hasStroke();\n const strokeWidth = (applyStroke && this.strokeWidth()) || 0;\n const fillAndStrokeWidth = fillRect.width + strokeWidth;\n const fillAndStrokeHeight = fillRect.height + strokeWidth;\n const applyShadow = !config.skipShadow && this.hasShadow();\n const shadowOffsetX = applyShadow ? this.shadowOffsetX() : 0;\n const shadowOffsetY = applyShadow ? this.shadowOffsetY() : 0;\n const preWidth = fillAndStrokeWidth + Math.abs(shadowOffsetX);\n const preHeight = fillAndStrokeHeight + Math.abs(shadowOffsetY);\n const blurRadius = (applyShadow && this.shadowBlur()) || 0;\n const width = preWidth + blurRadius * 2;\n const height = preHeight + blurRadius * 2;\n const rect = {\n width: width,\n height: height,\n x: -(strokeWidth / 2 + blurRadius) +\n Math.min(shadowOffsetX, 0) +\n fillRect.x,\n y: -(strokeWidth / 2 + blurRadius) +\n Math.min(shadowOffsetY, 0) +\n fillRect.y,\n };\n if (!skipTransform) {\n return this._transformedRect(rect, relativeTo);\n }\n return rect;\n }\n drawScene(can, top, bufferCanvas) {\n var layer = this.getLayer();\n var canvas = can || layer.getCanvas(), context = canvas.getContext(), cachedCanvas = this._getCanvasCache(), drawFunc = this.getSceneFunc(), hasShadow = this.hasShadow(), stage, bufferContext;\n var skipBuffer = canvas.isCache;\n var cachingSelf = top === this;\n if (!this.isVisible() && !cachingSelf) {\n return this;\n }\n if (cachedCanvas) {\n context.save();\n var m = this.getAbsoluteTransform(top).getMatrix();\n context.transform(m[0], m[1], m[2], m[3], m[4], m[5]);\n this._drawCachedSceneCanvas(context);\n context.restore();\n return this;\n }\n if (!drawFunc) {\n return this;\n }\n context.save();\n if (this._useBufferCanvas() && !skipBuffer) {\n stage = this.getStage();\n const bc = bufferCanvas || stage.bufferCanvas;\n bufferContext = bc.getContext();\n bufferContext.clear();\n bufferContext.save();\n bufferContext._applyLineJoin(this);\n var o = this.getAbsoluteTransform(top).getMatrix();\n bufferContext.transform(o[0], o[1], o[2], o[3], o[4], o[5]);\n drawFunc.call(this, bufferContext, this);\n bufferContext.restore();\n var ratio = bc.pixelRatio;\n if (hasShadow) {\n context._applyShadow(this);\n }\n context._applyOpacity(this);\n context._applyGlobalCompositeOperation(this);\n context.drawImage(bc._canvas, 0, 0, bc.width / ratio, bc.height / ratio);\n }\n else {\n context._applyLineJoin(this);\n if (!cachingSelf) {\n var o = this.getAbsoluteTransform(top).getMatrix();\n context.transform(o[0], o[1], o[2], o[3], o[4], o[5]);\n context._applyOpacity(this);\n context._applyGlobalCompositeOperation(this);\n }\n if (hasShadow) {\n context._applyShadow(this);\n }\n drawFunc.call(this, context, this);\n }\n context.restore();\n return this;\n }\n drawHit(can, top, skipDragCheck = false) {\n if (!this.shouldDrawHit(top, skipDragCheck)) {\n return this;\n }\n var layer = this.getLayer(), canvas = can || layer.hitCanvas, context = canvas && canvas.getContext(), drawFunc = this.hitFunc() || this.sceneFunc(), cachedCanvas = this._getCanvasCache(), cachedHitCanvas = cachedCanvas && cachedCanvas.hit;\n if (!this.colorKey) {\n Util_1.Util.warn('Looks like your canvas has a destroyed shape in it. Do not reuse shape after you destroyed it. If you want to reuse shape you should call remove() instead of destroy()');\n }\n if (cachedHitCanvas) {\n context.save();\n var m = this.getAbsoluteTransform(top).getMatrix();\n context.transform(m[0], m[1], m[2], m[3], m[4], m[5]);\n this._drawCachedHitCanvas(context);\n context.restore();\n return this;\n }\n if (!drawFunc) {\n return this;\n }\n context.save();\n context._applyLineJoin(this);\n const selfCache = this === top;\n if (!selfCache) {\n var o = this.getAbsoluteTransform(top).getMatrix();\n context.transform(o[0], o[1], o[2], o[3], o[4], o[5]);\n }\n drawFunc.call(this, context, this);\n context.restore();\n return this;\n }\n drawHitFromCache(alphaThreshold = 0) {\n var cachedCanvas = this._getCanvasCache(), sceneCanvas = this._getCachedSceneCanvas(), hitCanvas = cachedCanvas.hit, hitContext = hitCanvas.getContext(), hitWidth = hitCanvas.getWidth(), hitHeight = hitCanvas.getHeight(), hitImageData, hitData, len, rgbColorKey, i, alpha;\n hitContext.clear();\n hitContext.drawImage(sceneCanvas._canvas, 0, 0, hitWidth, hitHeight);\n try {\n hitImageData = hitContext.getImageData(0, 0, hitWidth, hitHeight);\n hitData = hitImageData.data;\n len = hitData.length;\n rgbColorKey = Util_1.Util._hexToRgb(this.colorKey);\n for (i = 0; i < len; i += 4) {\n alpha = hitData[i + 3];\n if (alpha > alphaThreshold) {\n hitData[i] = rgbColorKey.r;\n hitData[i + 1] = rgbColorKey.g;\n hitData[i + 2] = rgbColorKey.b;\n hitData[i + 3] = 255;\n }\n else {\n hitData[i + 3] = 0;\n }\n }\n hitContext.putImageData(hitImageData, 0, 0);\n }\n catch (e) {\n Util_1.Util.error('Unable to draw hit graph from cached scene canvas. ' + e.message);\n }\n return this;\n }\n hasPointerCapture(pointerId) {\n return PointerEvents.hasPointerCapture(pointerId, this);\n }\n setPointerCapture(pointerId) {\n PointerEvents.setPointerCapture(pointerId, this);\n }\n releaseCapture(pointerId) {\n PointerEvents.releaseCapture(pointerId, this);\n }\n}\nexports.Shape = Shape;\nShape.prototype._fillFunc = _fillFunc;\nShape.prototype._strokeFunc = _strokeFunc;\nShape.prototype._fillFuncHit = _fillFuncHit;\nShape.prototype._strokeFuncHit = _strokeFuncHit;\nShape.prototype._centroid = false;\nShape.prototype.nodeType = 'Shape';\n(0, Global_2._registerNode)(Shape);\nShape.prototype.eventListeners = {};\nShape.prototype.on.call(Shape.prototype, 'shadowColorChange.konva shadowBlurChange.konva shadowOffsetChange.konva shadowOpacityChange.konva shadowEnabledChange.konva', _clearHasShadowCache);\nShape.prototype.on.call(Shape.prototype, 'shadowColorChange.konva shadowOpacityChange.konva shadowEnabledChange.konva', _clearGetShadowRGBACache);\nShape.prototype.on.call(Shape.prototype, 'fillPriorityChange.konva fillPatternImageChange.konva fillPatternRepeatChange.konva fillPatternScaleXChange.konva fillPatternScaleYChange.konva fillPatternOffsetXChange.konva fillPatternOffsetYChange.konva fillPatternXChange.konva fillPatternYChange.konva fillPatternRotationChange.konva', _clearFillPatternCache);\nShape.prototype.on.call(Shape.prototype, 'fillPriorityChange.konva fillLinearGradientColorStopsChange.konva fillLinearGradientStartPointXChange.konva fillLinearGradientStartPointYChange.konva fillLinearGradientEndPointXChange.konva fillLinearGradientEndPointYChange.konva', _clearLinearGradientCache);\nShape.prototype.on.call(Shape.prototype, 'fillPriorityChange.konva fillRadialGradientColorStopsChange.konva fillRadialGradientStartPointXChange.konva fillRadialGradientStartPointYChange.konva fillRadialGradientEndPointXChange.konva fillRadialGradientEndPointYChange.konva fillRadialGradientStartRadiusChange.konva fillRadialGradientEndRadiusChange.konva', _clearRadialGradientCache);\nFactory_1.Factory.addGetterSetter(Shape, 'stroke', undefined, (0, Validators_1.getStringOrGradientValidator)());\nFactory_1.Factory.addGetterSetter(Shape, 'strokeWidth', 2, (0, Validators_1.getNumberValidator)());\nFactory_1.Factory.addGetterSetter(Shape, 'fillAfterStrokeEnabled', false);\nFactory_1.Factory.addGetterSetter(Shape, 'hitStrokeWidth', 'auto', (0, Validators_1.getNumberOrAutoValidator)());\nFactory_1.Factory.addGetterSetter(Shape, 'strokeHitEnabled', true, (0, Validators_1.getBooleanValidator)());\nFactory_1.Factory.addGetterSetter(Shape, 'perfectDrawEnabled', true, (0, Validators_1.getBooleanValidator)());\nFactory_1.Factory.addGetterSetter(Shape, 'shadowForStrokeEnabled', true, (0, Validators_1.getBooleanValidator)());\nFactory_1.Factory.addGetterSetter(Shape, 'lineJoin');\nFactory_1.Factory.addGetterSetter(Shape, 'lineCap');\nFactory_1.Factory.addGetterSetter(Shape, 'sceneFunc');\nFactory_1.Factory.addGetterSetter(Shape, 'hitFunc');\nFactory_1.Factory.addGetterSetter(Shape, 'dash');\nFactory_1.Factory.addGetterSetter(Shape, 'dashOffset', 0, (0, Validators_1.getNumberValidator)());\nFactory_1.Factory.addGetterSetter(Shape, 'shadowColor', undefined, (0, Validators_1.getStringValidator)());\nFactory_1.Factory.addGetterSetter(Shape, 'shadowBlur', 0, (0, Validators_1.getNumberValidator)());\nFactory_1.Factory.addGetterSetter(Shape, 'shadowOpacity', 1, (0, Validators_1.getNumberValidator)());\nFactory_1.Factory.addComponentsGetterSetter(Shape, 'shadowOffset', ['x', 'y']);\nFactory_1.Factory.addGetterSetter(Shape, 'shadowOffsetX', 0, (0, Validators_1.getNumberValidator)());\nFactory_1.Factory.addGetterSetter(Shape, 'shadowOffsetY', 0, (0, Validators_1.getNumberValidator)());\nFactory_1.Factory.addGetterSetter(Shape, 'fillPatternImage');\nFactory_1.Factory.addGetterSetter(Shape, 'fill', undefined, (0, Validators_1.getStringOrGradientValidator)());\nFactory_1.Factory.addGetterSetter(Shape, 'fillPatternX', 0, (0, Validators_1.getNumberValidator)());\nFactory_1.Factory.addGetterSetter(Shape, 'fillPatternY', 0, (0, Validators_1.getNumberValidator)());\nFactory_1.Factory.addGetterSetter(Shape, 'fillLinearGradientColorStops');\nFactory_1.Factory.addGetterSetter(Shape, 'strokeLinearGradientColorStops');\nFactory_1.Factory.addGetterSetter(Shape, 'fillRadialGradientStartRadius', 0);\nFactory_1.Factory.addGetterSetter(Shape, 'fillRadialGradientEndRadius', 0);\nFactory_1.Factory.addGetterSetter(Shape, 'fillRadialGradientColorStops');\nFactory_1.Factory.addGetterSetter(Shape, 'fillPatternRepeat', 'repeat');\nFactory_1.Factory.addGetterSetter(Shape, 'fillEnabled', true);\nFactory_1.Factory.addGetterSetter(Shape, 'strokeEnabled', true);\nFactory_1.Factory.addGetterSetter(Shape, 'shadowEnabled', true);\nFactory_1.Factory.addGetterSetter(Shape, 'dashEnabled', true);\nFactory_1.Factory.addGetterSetter(Shape, 'strokeScaleEnabled', true);\nFactory_1.Factory.addGetterSetter(Shape, 'fillPriority', 'color');\nFactory_1.Factory.addComponentsGetterSetter(Shape, 'fillPatternOffset', ['x', 'y']);\nFactory_1.Factory.addGetterSetter(Shape, 'fillPatternOffsetX', 0, (0, Validators_1.getNumberValidator)());\nFactory_1.Factory.addGetterSetter(Shape, 'fillPatternOffsetY', 0, (0, Validators_1.getNumberValidator)());\nFactory_1.Factory.addComponentsGetterSetter(Shape, 'fillPatternScale', ['x', 'y']);\nFactory_1.Factory.addGetterSetter(Shape, 'fillPatternScaleX', 1, (0, Validators_1.getNumberValidator)());\nFactory_1.Factory.addGetterSetter(Shape, 'fillPatternScaleY', 1, (0, Validators_1.getNumberValidator)());\nFactory_1.Factory.addComponentsGetterSetter(Shape, 'fillLinearGradientStartPoint', [\n 'x',\n 'y',\n]);\nFactory_1.Factory.addComponentsGetterSetter(Shape, 'strokeLinearGradientStartPoint', [\n 'x',\n 'y',\n]);\nFactory_1.Factory.addGetterSetter(Shape, 'fillLinearGradientStartPointX', 0);\nFactory_1.Factory.addGetterSetter(Shape, 'strokeLinearGradientStartPointX', 0);\nFactory_1.Factory.addGetterSetter(Shape, 'fillLinearGradientStartPointY', 0);\nFactory_1.Factory.addGetterSetter(Shape, 'strokeLinearGradientStartPointY', 0);\nFactory_1.Factory.addComponentsGetterSetter(Shape, 'fillLinearGradientEndPoint', [\n 'x',\n 'y',\n]);\nFactory_1.Factory.addComponentsGetterSetter(Shape, 'strokeLinearGradientEndPoint', [\n 'x',\n 'y',\n]);\nFactory_1.Factory.addGetterSetter(Shape, 'fillLinearGradientEndPointX', 0);\nFactory_1.Factory.addGetterSetter(Shape, 'strokeLinearGradientEndPointX', 0);\nFactory_1.Factory.addGetterSetter(Shape, 'fillLinearGradientEndPointY', 0);\nFactory_1.Factory.addGetterSetter(Shape, 'strokeLinearGradientEndPointY', 0);\nFactory_1.Factory.addComponentsGetterSetter(Shape, 'fillRadialGradientStartPoint', [\n 'x',\n 'y',\n]);\nFactory_1.Factory.addGetterSetter(Shape, 'fillRadialGradientStartPointX', 0);\nFactory_1.Factory.addGetterSetter(Shape, 'fillRadialGradientStartPointY', 0);\nFactory_1.Factory.addComponentsGetterSetter(Shape, 'fillRadialGradientEndPoint', [\n 'x',\n 'y',\n]);\nFactory_1.Factory.addGetterSetter(Shape, 'fillRadialGradientEndPointX', 0);\nFactory_1.Factory.addGetterSetter(Shape, 'fillRadialGradientEndPointY', 0);\nFactory_1.Factory.addGetterSetter(Shape, 'fillPatternRotation', 0);\nFactory_1.Factory.addGetterSetter(Shape, 'fillRule', undefined, (0, Validators_1.getStringValidator)());\nFactory_1.Factory.backCompat(Shape, {\n dashArray: 'dash',\n getDashArray: 'getDash',\n setDashArray: 'getDash',\n drawFunc: 'sceneFunc',\n getDrawFunc: 'getSceneFunc',\n setDrawFunc: 'setSceneFunc',\n drawHitFunc: 'hitFunc',\n getDrawHitFunc: 'getHitFunc',\n setDrawHitFunc: 'setHitFunc',\n});\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Layer = void 0;\nconst Util_1 = require(\"./Util\");\nconst Container_1 = require(\"./Container\");\nconst Node_1 = require(\"./Node\");\nconst Factory_1 = require(\"./Factory\");\nconst Canvas_1 = require(\"./Canvas\");\nconst Validators_1 = require(\"./Validators\");\nconst Shape_1 = require(\"./Shape\");\nconst Global_1 = require(\"./Global\");\nvar HASH = '#', BEFORE_DRAW = 'beforeDraw', DRAW = 'draw', INTERSECTION_OFFSETS = [\n { x: 0, y: 0 },\n { x: -1, y: -1 },\n { x: 1, y: -1 },\n { x: 1, y: 1 },\n { x: -1, y: 1 },\n], INTERSECTION_OFFSETS_LEN = INTERSECTION_OFFSETS.length;\nclass Layer extends Container_1.Container {\n constructor(config) {\n super(config);\n this.canvas = new Canvas_1.SceneCanvas();\n this.hitCanvas = new Canvas_1.HitCanvas({\n pixelRatio: 1,\n });\n this._waitingForDraw = false;\n this.on('visibleChange.konva', this._checkVisibility);\n this._checkVisibility();\n this.on('imageSmoothingEnabledChange.konva', this._setSmoothEnabled);\n this._setSmoothEnabled();\n }\n createPNGStream() {\n const c = this.canvas._canvas;\n return c.createPNGStream();\n }\n getCanvas() {\n return this.canvas;\n }\n getNativeCanvasElement() {\n return this.canvas._canvas;\n }\n getHitCanvas() {\n return this.hitCanvas;\n }\n getContext() {\n return this.getCanvas().getContext();\n }\n clear(bounds) {\n this.getContext().clear(bounds);\n this.getHitCanvas().getContext().clear(bounds);\n return this;\n }\n setZIndex(index) {\n super.setZIndex(index);\n var stage = this.getStage();\n if (stage && stage.content) {\n stage.content.removeChild(this.getNativeCanvasElement());\n if (index < stage.children.length - 1) {\n stage.content.insertBefore(this.getNativeCanvasElement(), stage.children[index + 1].getCanvas()._canvas);\n }\n else {\n stage.content.appendChild(this.getNativeCanvasElement());\n }\n }\n return this;\n }\n moveToTop() {\n Node_1.Node.prototype.moveToTop.call(this);\n var stage = this.getStage();\n if (stage && stage.content) {\n stage.content.removeChild(this.getNativeCanvasElement());\n stage.content.appendChild(this.getNativeCanvasElement());\n }\n return true;\n }\n moveUp() {\n var moved = Node_1.Node.prototype.moveUp.call(this);\n if (!moved) {\n return false;\n }\n var stage = this.getStage();\n if (!stage || !stage.content) {\n return false;\n }\n stage.content.removeChild(this.getNativeCanvasElement());\n if (this.index < stage.children.length - 1) {\n stage.content.insertBefore(this.getNativeCanvasElement(), stage.children[this.index + 1].getCanvas()._canvas);\n }\n else {\n stage.content.appendChild(this.getNativeCanvasElement());\n }\n return true;\n }\n moveDown() {\n if (Node_1.Node.prototype.moveDown.call(this)) {\n var stage = this.getStage();\n if (stage) {\n var children = stage.children;\n if (stage.content) {\n stage.content.removeChild(this.getNativeCanvasElement());\n stage.content.insertBefore(this.getNativeCanvasElement(), children[this.index + 1].getCanvas()._canvas);\n }\n }\n return true;\n }\n return false;\n }\n moveToBottom() {\n if (Node_1.Node.prototype.moveToBottom.call(this)) {\n var stage = this.getStage();\n if (stage) {\n var children = stage.children;\n if (stage.content) {\n stage.content.removeChild(this.getNativeCanvasElement());\n stage.content.insertBefore(this.getNativeCanvasElement(), children[1].getCanvas()._canvas);\n }\n }\n return true;\n }\n return false;\n }\n getLayer() {\n return this;\n }\n remove() {\n var _canvas = this.getNativeCanvasElement();\n Node_1.Node.prototype.remove.call(this);\n if (_canvas && _canvas.parentNode && Util_1.Util._isInDocument(_canvas)) {\n _canvas.parentNode.removeChild(_canvas);\n }\n return this;\n }\n getStage() {\n return this.parent;\n }\n setSize({ width, height }) {\n this.canvas.setSize(width, height);\n this.hitCanvas.setSize(width, height);\n this._setSmoothEnabled();\n return this;\n }\n _validateAdd(child) {\n var type = child.getType();\n if (type !== 'Group' && type !== 'Shape') {\n Util_1.Util.throw('You may only add groups and shapes to a layer.');\n }\n }\n _toKonvaCanvas(config) {\n config = config || {};\n config.width = config.width || this.getWidth();\n config.height = config.height || this.getHeight();\n config.x = config.x !== undefined ? config.x : this.x();\n config.y = config.y !== undefined ? config.y : this.y();\n return Node_1.Node.prototype._toKonvaCanvas.call(this, config);\n }\n _checkVisibility() {\n const visible = this.visible();\n if (visible) {\n this.canvas._canvas.style.display = 'block';\n }\n else {\n this.canvas._canvas.style.display = 'none';\n }\n }\n _setSmoothEnabled() {\n this.getContext()._context.imageSmoothingEnabled =\n this.imageSmoothingEnabled();\n }\n getWidth() {\n if (this.parent) {\n return this.parent.width();\n }\n }\n setWidth() {\n Util_1.Util.warn('Can not change width of layer. Use \"stage.width(value)\" function instead.');\n }\n getHeight() {\n if (this.parent) {\n return this.parent.height();\n }\n }\n setHeight() {\n Util_1.Util.warn('Can not change height of layer. Use \"stage.height(value)\" function instead.');\n }\n batchDraw() {\n if (!this._waitingForDraw) {\n this._waitingForDraw = true;\n Util_1.Util.requestAnimFrame(() => {\n this.draw();\n this._waitingForDraw = false;\n });\n }\n return this;\n }\n getIntersection(pos) {\n if (!this.isListening() || !this.isVisible()) {\n return null;\n }\n var spiralSearchDistance = 1;\n var continueSearch = false;\n while (true) {\n for (let i = 0; i < INTERSECTION_OFFSETS_LEN; i++) {\n const intersectionOffset = INTERSECTION_OFFSETS[i];\n const obj = this._getIntersection({\n x: pos.x + intersectionOffset.x * spiralSearchDistance,\n y: pos.y + intersectionOffset.y * spiralSearchDistance,\n });\n const shape = obj.shape;\n if (shape) {\n return shape;\n }\n continueSearch = !!obj.antialiased;\n if (!obj.antialiased) {\n break;\n }\n }\n if (continueSearch) {\n spiralSearchDistance += 1;\n }\n else {\n return null;\n }\n }\n }\n _getIntersection(pos) {\n const ratio = this.hitCanvas.pixelRatio;\n const p = this.hitCanvas.context.getImageData(Math.round(pos.x * ratio), Math.round(pos.y * ratio), 1, 1).data;\n const p3 = p[3];\n if (p3 === 255) {\n const colorKey = Util_1.Util._rgbToHex(p[0], p[1], p[2]);\n const shape = Shape_1.shapes[HASH + colorKey];\n if (shape) {\n return {\n shape: shape,\n };\n }\n return {\n antialiased: true,\n };\n }\n else if (p3 > 0) {\n return {\n antialiased: true,\n };\n }\n return {};\n }\n drawScene(can, top) {\n var layer = this.getLayer(), canvas = can || (layer && layer.getCanvas());\n this._fire(BEFORE_DRAW, {\n node: this,\n });\n if (this.clearBeforeDraw()) {\n canvas.getContext().clear();\n }\n Container_1.Container.prototype.drawScene.call(this, canvas, top);\n this._fire(DRAW, {\n node: this,\n });\n return this;\n }\n drawHit(can, top) {\n var layer = this.getLayer(), canvas = can || (layer && layer.hitCanvas);\n if (layer && layer.clearBeforeDraw()) {\n layer.getHitCanvas().getContext().clear();\n }\n Container_1.Container.prototype.drawHit.call(this, canvas, top);\n return this;\n }\n enableHitGraph() {\n this.hitGraphEnabled(true);\n return this;\n }\n disableHitGraph() {\n this.hitGraphEnabled(false);\n return this;\n }\n setHitGraphEnabled(val) {\n Util_1.Util.warn('hitGraphEnabled method is deprecated. Please use layer.listening() instead.');\n this.listening(val);\n }\n getHitGraphEnabled(val) {\n Util_1.Util.warn('hitGraphEnabled method is deprecated. Please use layer.listening() instead.');\n return this.listening();\n }\n toggleHitCanvas() {\n if (!this.parent || !this.parent['content']) {\n return;\n }\n var parent = this.parent;\n var added = !!this.hitCanvas._canvas.parentNode;\n if (added) {\n parent.content.removeChild(this.hitCanvas._canvas);\n }\n else {\n parent.content.appendChild(this.hitCanvas._canvas);\n }\n }\n destroy() {\n Util_1.Util.releaseCanvas(this.getNativeCanvasElement(), this.getHitCanvas()._canvas);\n return super.destroy();\n }\n}\nexports.Layer = Layer;\nLayer.prototype.nodeType = 'Layer';\n(0, Global_1._registerNode)(Layer);\nFactory_1.Factory.addGetterSetter(Layer, 'imageSmoothingEnabled', true);\nFactory_1.Factory.addGetterSetter(Layer, 'clearBeforeDraw', true);\nFactory_1.Factory.addGetterSetter(Layer, 'hitGraphEnabled', true, (0, Validators_1.getBooleanValidator)());\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.FastLayer = void 0;\nconst Util_1 = require(\"./Util\");\nconst Layer_1 = require(\"./Layer\");\nconst Global_1 = require(\"./Global\");\nclass FastLayer extends Layer_1.Layer {\n constructor(attrs) {\n super(attrs);\n this.listening(false);\n Util_1.Util.warn('Konva.Fast layer is deprecated. Please use \"new Konva.Layer({ listening: false })\" instead.');\n }\n}\nexports.FastLayer = FastLayer;\nFastLayer.prototype.nodeType = 'FastLayer';\n(0, Global_1._registerNode)(FastLayer);\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Group = void 0;\nconst Util_1 = require(\"./Util\");\nconst Container_1 = require(\"./Container\");\nconst Global_1 = require(\"./Global\");\nclass Group extends Container_1.Container {\n _validateAdd(child) {\n var type = child.getType();\n if (type !== 'Group' && type !== 'Shape') {\n Util_1.Util.throw('You may only add groups and shapes to groups.');\n }\n }\n}\nexports.Group = Group;\nGroup.prototype.nodeType = 'Group';\n(0, Global_1._registerNode)(Group);\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Animation = void 0;\nconst Global_1 = require(\"./Global\");\nconst Util_1 = require(\"./Util\");\nconst now = (function () {\n if (Global_1.glob.performance && Global_1.glob.performance.now) {\n return function () {\n return Global_1.glob.performance.now();\n };\n }\n return function () {\n return new Date().getTime();\n };\n})();\nclass Animation {\n constructor(func, layers) {\n this.id = Animation.animIdCounter++;\n this.frame = {\n time: 0,\n timeDiff: 0,\n lastTime: now(),\n frameRate: 0,\n };\n this.func = func;\n this.setLayers(layers);\n }\n setLayers(layers) {\n let lays = [];\n if (layers) {\n lays = Array.isArray(layers) ? layers : [layers];\n }\n this.layers = lays;\n return this;\n }\n getLayers() {\n return this.layers;\n }\n addLayer(layer) {\n const layers = this.layers;\n const len = layers.length;\n for (let n = 0; n < len; n++) {\n if (layers[n]._id === layer._id) {\n return false;\n }\n }\n this.layers.push(layer);\n return true;\n }\n isRunning() {\n const a = Animation;\n const animations = a.animations;\n const len = animations.length;\n for (let n = 0; n < len; n++) {\n if (animations[n].id === this.id) {\n return true;\n }\n }\n return false;\n }\n start() {\n this.stop();\n this.frame.timeDiff = 0;\n this.frame.lastTime = now();\n Animation._addAnimation(this);\n return this;\n }\n stop() {\n Animation._removeAnimation(this);\n return this;\n }\n _updateFrameObject(time) {\n this.frame.timeDiff = time - this.frame.lastTime;\n this.frame.lastTime = time;\n this.frame.time += this.frame.timeDiff;\n this.frame.frameRate = 1000 / this.frame.timeDiff;\n }\n static _addAnimation(anim) {\n this.animations.push(anim);\n this._handleAnimation();\n }\n static _removeAnimation(anim) {\n const id = anim.id;\n const animations = this.animations;\n const len = animations.length;\n for (let n = 0; n < len; n++) {\n if (animations[n].id === id) {\n this.animations.splice(n, 1);\n break;\n }\n }\n }\n static _runFrames() {\n const layerHash = {};\n const animations = this.animations;\n for (let n = 0; n < animations.length; n++) {\n const anim = animations[n];\n const layers = anim.layers;\n const func = anim.func;\n anim._updateFrameObject(now());\n const layersLen = layers.length;\n let needRedraw;\n if (func) {\n needRedraw = func.call(anim, anim.frame) !== false;\n }\n else {\n needRedraw = true;\n }\n if (!needRedraw) {\n continue;\n }\n for (let i = 0; i < layersLen; i++) {\n const layer = layers[i];\n if (layer._id !== undefined) {\n layerHash[layer._id] = layer;\n }\n }\n }\n for (let key in layerHash) {\n if (!layerHash.hasOwnProperty(key)) {\n continue;\n }\n layerHash[key].batchDraw();\n }\n }\n static _animationLoop() {\n const Anim = Animation;\n if (Anim.animations.length) {\n Anim._runFrames();\n Util_1.Util.requestAnimFrame(Anim._animationLoop);\n }\n else {\n Anim.animRunning = false;\n }\n }\n static _handleAnimation() {\n if (!this.animRunning) {\n this.animRunning = true;\n Util_1.Util.requestAnimFrame(this._animationLoop);\n }\n }\n}\nexports.Animation = Animation;\nAnimation.animations = [];\nAnimation.animIdCounter = 0;\nAnimation.animRunning = false;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Easings = exports.Tween = void 0;\nconst Util_1 = require(\"./Util\");\nconst Animation_1 = require(\"./Animation\");\nconst Node_1 = require(\"./Node\");\nconst Global_1 = require(\"./Global\");\nvar blacklist = {\n node: 1,\n duration: 1,\n easing: 1,\n onFinish: 1,\n yoyo: 1,\n}, PAUSED = 1, PLAYING = 2, REVERSING = 3, idCounter = 0, colorAttrs = ['fill', 'stroke', 'shadowColor'];\nclass TweenEngine {\n constructor(prop, propFunc, func, begin, finish, duration, yoyo) {\n this.prop = prop;\n this.propFunc = propFunc;\n this.begin = begin;\n this._pos = begin;\n this.duration = duration;\n this._change = 0;\n this.prevPos = 0;\n this.yoyo = yoyo;\n this._time = 0;\n this._position = 0;\n this._startTime = 0;\n this._finish = 0;\n this.func = func;\n this._change = finish - this.begin;\n this.pause();\n }\n fire(str) {\n var handler = this[str];\n if (handler) {\n handler();\n }\n }\n setTime(t) {\n if (t > this.duration) {\n if (this.yoyo) {\n this._time = this.duration;\n this.reverse();\n }\n else {\n this.finish();\n }\n }\n else if (t < 0) {\n if (this.yoyo) {\n this._time = 0;\n this.play();\n }\n else {\n this.reset();\n }\n }\n else {\n this._time = t;\n this.update();\n }\n }\n getTime() {\n return this._time;\n }\n setPosition(p) {\n this.prevPos = this._pos;\n this.propFunc(p);\n this._pos = p;\n }\n getPosition(t) {\n if (t === undefined) {\n t = this._time;\n }\n return this.func(t, this.begin, this._change, this.duration);\n }\n play() {\n this.state = PLAYING;\n this._startTime = this.getTimer() - this._time;\n this.onEnterFrame();\n this.fire('onPlay');\n }\n reverse() {\n this.state = REVERSING;\n this._time = this.duration - this._time;\n this._startTime = this.getTimer() - this._time;\n this.onEnterFrame();\n this.fire('onReverse');\n }\n seek(t) {\n this.pause();\n this._time = t;\n this.update();\n this.fire('onSeek');\n }\n reset() {\n this.pause();\n this._time = 0;\n this.update();\n this.fire('onReset');\n }\n finish() {\n this.pause();\n this._time = this.duration;\n this.update();\n this.fire('onFinish');\n }\n update() {\n this.setPosition(this.getPosition(this._time));\n this.fire('onUpdate');\n }\n onEnterFrame() {\n var t = this.getTimer() - this._startTime;\n if (this.state === PLAYING) {\n this.setTime(t);\n }\n else if (this.state === REVERSING) {\n this.setTime(this.duration - t);\n }\n }\n pause() {\n this.state = PAUSED;\n this.fire('onPause');\n }\n getTimer() {\n return new Date().getTime();\n }\n}\nclass Tween {\n constructor(config) {\n var that = this, node = config.node, nodeId = node._id, duration, easing = config.easing || exports.Easings.Linear, yoyo = !!config.yoyo, key;\n if (typeof config.duration === 'undefined') {\n duration = 0.3;\n }\n else if (config.duration === 0) {\n duration = 0.001;\n }\n else {\n duration = config.duration;\n }\n this.node = node;\n this._id = idCounter++;\n var layers = node.getLayer() ||\n (node instanceof Global_1.Konva['Stage'] ? node.getLayers() : null);\n if (!layers) {\n Util_1.Util.error('Tween constructor have `node` that is not in a layer. Please add node into layer first.');\n }\n this.anim = new Animation_1.Animation(function () {\n that.tween.onEnterFrame();\n }, layers);\n this.tween = new TweenEngine(key, function (i) {\n that._tweenFunc(i);\n }, easing, 0, 1, duration * 1000, yoyo);\n this._addListeners();\n if (!Tween.attrs[nodeId]) {\n Tween.attrs[nodeId] = {};\n }\n if (!Tween.attrs[nodeId][this._id]) {\n Tween.attrs[nodeId][this._id] = {};\n }\n if (!Tween.tweens[nodeId]) {\n Tween.tweens[nodeId] = {};\n }\n for (key in config) {\n if (blacklist[key] === undefined) {\n this._addAttr(key, config[key]);\n }\n }\n this.reset();\n this.onFinish = config.onFinish;\n this.onReset = config.onReset;\n this.onUpdate = config.onUpdate;\n }\n _addAttr(key, end) {\n var node = this.node, nodeId = node._id, start, diff, tweenId, n, len, trueEnd, trueStart, endRGBA;\n tweenId = Tween.tweens[nodeId][key];\n if (tweenId) {\n delete Tween.attrs[nodeId][tweenId][key];\n }\n start = node.getAttr(key);\n if (Util_1.Util._isArray(end)) {\n diff = [];\n len = Math.max(end.length, start.length);\n if (key === 'points' && end.length !== start.length) {\n if (end.length > start.length) {\n trueStart = start;\n start = Util_1.Util._prepareArrayForTween(start, end, node.closed());\n }\n else {\n trueEnd = end;\n end = Util_1.Util._prepareArrayForTween(end, start, node.closed());\n }\n }\n if (key.indexOf('fill') === 0) {\n for (n = 0; n < len; n++) {\n if (n % 2 === 0) {\n diff.push(end[n] - start[n]);\n }\n else {\n var startRGBA = Util_1.Util.colorToRGBA(start[n]);\n endRGBA = Util_1.Util.colorToRGBA(end[n]);\n start[n] = startRGBA;\n diff.push({\n r: endRGBA.r - startRGBA.r,\n g: endRGBA.g - startRGBA.g,\n b: endRGBA.b - startRGBA.b,\n a: endRGBA.a - startRGBA.a,\n });\n }\n }\n }\n else {\n for (n = 0; n < len; n++) {\n diff.push(end[n] - start[n]);\n }\n }\n }\n else if (colorAttrs.indexOf(key) !== -1) {\n start = Util_1.Util.colorToRGBA(start);\n endRGBA = Util_1.Util.colorToRGBA(end);\n diff = {\n r: endRGBA.r - start.r,\n g: endRGBA.g - start.g,\n b: endRGBA.b - start.b,\n a: endRGBA.a - start.a,\n };\n }\n else {\n diff = end - start;\n }\n Tween.attrs[nodeId][this._id][key] = {\n start: start,\n diff: diff,\n end: end,\n trueEnd: trueEnd,\n trueStart: trueStart,\n };\n Tween.tweens[nodeId][key] = this._id;\n }\n _tweenFunc(i) {\n var node = this.node, attrs = Tween.attrs[node._id][this._id], key, attr, start, diff, newVal, n, len, end;\n for (key in attrs) {\n attr = attrs[key];\n start = attr.start;\n diff = attr.diff;\n end = attr.end;\n if (Util_1.Util._isArray(start)) {\n newVal = [];\n len = Math.max(start.length, end.length);\n if (key.indexOf('fill') === 0) {\n for (n = 0; n < len; n++) {\n if (n % 2 === 0) {\n newVal.push((start[n] || 0) + diff[n] * i);\n }\n else {\n newVal.push('rgba(' +\n Math.round(start[n].r + diff[n].r * i) +\n ',' +\n Math.round(start[n].g + diff[n].g * i) +\n ',' +\n Math.round(start[n].b + diff[n].b * i) +\n ',' +\n (start[n].a + diff[n].a * i) +\n ')');\n }\n }\n }\n else {\n for (n = 0; n < len; n++) {\n newVal.push((start[n] || 0) + diff[n] * i);\n }\n }\n }\n else if (colorAttrs.indexOf(key) !== -1) {\n newVal =\n 'rgba(' +\n Math.round(start.r + diff.r * i) +\n ',' +\n Math.round(start.g + diff.g * i) +\n ',' +\n Math.round(start.b + diff.b * i) +\n ',' +\n (start.a + diff.a * i) +\n ')';\n }\n else {\n newVal = start + diff * i;\n }\n node.setAttr(key, newVal);\n }\n }\n _addListeners() {\n this.tween.onPlay = () => {\n this.anim.start();\n };\n this.tween.onReverse = () => {\n this.anim.start();\n };\n this.tween.onPause = () => {\n this.anim.stop();\n };\n this.tween.onFinish = () => {\n var node = this.node;\n var attrs = Tween.attrs[node._id][this._id];\n if (attrs.points && attrs.points.trueEnd) {\n node.setAttr('points', attrs.points.trueEnd);\n }\n if (this.onFinish) {\n this.onFinish.call(this);\n }\n };\n this.tween.onReset = () => {\n var node = this.node;\n var attrs = Tween.attrs[node._id][this._id];\n if (attrs.points && attrs.points.trueStart) {\n node.points(attrs.points.trueStart);\n }\n if (this.onReset) {\n this.onReset();\n }\n };\n this.tween.onUpdate = () => {\n if (this.onUpdate) {\n this.onUpdate.call(this);\n }\n };\n }\n play() {\n this.tween.play();\n return this;\n }\n reverse() {\n this.tween.reverse();\n return this;\n }\n reset() {\n this.tween.reset();\n return this;\n }\n seek(t) {\n this.tween.seek(t * 1000);\n return this;\n }\n pause() {\n this.tween.pause();\n return this;\n }\n finish() {\n this.tween.finish();\n return this;\n }\n destroy() {\n var nodeId = this.node._id, thisId = this._id, attrs = Tween.tweens[nodeId], key;\n this.pause();\n for (key in attrs) {\n delete Tween.tweens[nodeId][key];\n }\n delete Tween.attrs[nodeId][thisId];\n }\n}\nexports.Tween = Tween;\nTween.attrs = {};\nTween.tweens = {};\nNode_1.Node.prototype.to = function (params) {\n var onFinish = params.onFinish;\n params.node = this;\n params.onFinish = function () {\n this.destroy();\n if (onFinish) {\n onFinish();\n }\n };\n var tween = new Tween(params);\n tween.play();\n};\nexports.Easings = {\n BackEaseIn(t, b, c, d) {\n var s = 1.70158;\n return c * (t /= d) * t * ((s + 1) * t - s) + b;\n },\n BackEaseOut(t, b, c, d) {\n var s = 1.70158;\n return c * ((t = t / d - 1) * t * ((s + 1) * t + s) + 1) + b;\n },\n BackEaseInOut(t, b, c, d) {\n var s = 1.70158;\n if ((t /= d / 2) < 1) {\n return (c / 2) * (t * t * (((s *= 1.525) + 1) * t - s)) + b;\n }\n return (c / 2) * ((t -= 2) * t * (((s *= 1.525) + 1) * t + s) + 2) + b;\n },\n ElasticEaseIn(t, b, c, d, a, p) {\n var s = 0;\n if (t === 0) {\n return b;\n }\n if ((t /= d) === 1) {\n return b + c;\n }\n if (!p) {\n p = d * 0.3;\n }\n if (!a || a < Math.abs(c)) {\n a = c;\n s = p / 4;\n }\n else {\n s = (p / (2 * Math.PI)) * Math.asin(c / a);\n }\n return (-(a *\n Math.pow(2, 10 * (t -= 1)) *\n Math.sin(((t * d - s) * (2 * Math.PI)) / p)) + b);\n },\n ElasticEaseOut(t, b, c, d, a, p) {\n var s = 0;\n if (t === 0) {\n return b;\n }\n if ((t /= d) === 1) {\n return b + c;\n }\n if (!p) {\n p = d * 0.3;\n }\n if (!a || a < Math.abs(c)) {\n a = c;\n s = p / 4;\n }\n else {\n s = (p / (2 * Math.PI)) * Math.asin(c / a);\n }\n return (a * Math.pow(2, -10 * t) * Math.sin(((t * d - s) * (2 * Math.PI)) / p) +\n c +\n b);\n },\n ElasticEaseInOut(t, b, c, d, a, p) {\n var s = 0;\n if (t === 0) {\n return b;\n }\n if ((t /= d / 2) === 2) {\n return b + c;\n }\n if (!p) {\n p = d * (0.3 * 1.5);\n }\n if (!a || a < Math.abs(c)) {\n a = c;\n s = p / 4;\n }\n else {\n s = (p / (2 * Math.PI)) * Math.asin(c / a);\n }\n if (t < 1) {\n return (-0.5 *\n (a *\n Math.pow(2, 10 * (t -= 1)) *\n Math.sin(((t * d - s) * (2 * Math.PI)) / p)) +\n b);\n }\n return (a *\n Math.pow(2, -10 * (t -= 1)) *\n Math.sin(((t * d - s) * (2 * Math.PI)) / p) *\n 0.5 +\n c +\n b);\n },\n BounceEaseOut(t, b, c, d) {\n if ((t /= d) < 1 / 2.75) {\n return c * (7.5625 * t * t) + b;\n }\n else if (t < 2 / 2.75) {\n return c * (7.5625 * (t -= 1.5 / 2.75) * t + 0.75) + b;\n }\n else if (t < 2.5 / 2.75) {\n return c * (7.5625 * (t -= 2.25 / 2.75) * t + 0.9375) + b;\n }\n else {\n return c * (7.5625 * (t -= 2.625 / 2.75) * t + 0.984375) + b;\n }\n },\n BounceEaseIn(t, b, c, d) {\n return c - exports.Easings.BounceEaseOut(d - t, 0, c, d) + b;\n },\n BounceEaseInOut(t, b, c, d) {\n if (t < d / 2) {\n return exports.Easings.BounceEaseIn(t * 2, 0, c, d) * 0.5 + b;\n }\n else {\n return exports.Easings.BounceEaseOut(t * 2 - d, 0, c, d) * 0.5 + c * 0.5 + b;\n }\n },\n EaseIn(t, b, c, d) {\n return c * (t /= d) * t + b;\n },\n EaseOut(t, b, c, d) {\n return -c * (t /= d) * (t - 2) + b;\n },\n EaseInOut(t, b, c, d) {\n if ((t /= d / 2) < 1) {\n return (c / 2) * t * t + b;\n }\n return (-c / 2) * (--t * (t - 2) - 1) + b;\n },\n StrongEaseIn(t, b, c, d) {\n return c * (t /= d) * t * t * t * t + b;\n },\n StrongEaseOut(t, b, c, d) {\n return c * ((t = t / d - 1) * t * t * t * t + 1) + b;\n },\n StrongEaseInOut(t, b, c, d) {\n if ((t /= d / 2) < 1) {\n return (c / 2) * t * t * t * t * t + b;\n }\n return (c / 2) * ((t -= 2) * t * t * t * t + 2) + b;\n },\n Linear(t, b, c, d) {\n return (c * t) / d + b;\n },\n};\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Konva = void 0;\nconst Global_1 = require(\"./Global\");\nconst Util_1 = require(\"./Util\");\nconst Node_1 = require(\"./Node\");\nconst Container_1 = require(\"./Container\");\nconst Stage_1 = require(\"./Stage\");\nconst Layer_1 = require(\"./Layer\");\nconst FastLayer_1 = require(\"./FastLayer\");\nconst Group_1 = require(\"./Group\");\nconst DragAndDrop_1 = require(\"./DragAndDrop\");\nconst Shape_1 = require(\"./Shape\");\nconst Animation_1 = require(\"./Animation\");\nconst Tween_1 = require(\"./Tween\");\nconst Context_1 = require(\"./Context\");\nconst Canvas_1 = require(\"./Canvas\");\nexports.Konva = Util_1.Util._assign(Global_1.Konva, {\n Util: Util_1.Util,\n Transform: Util_1.Transform,\n Node: Node_1.Node,\n Container: Container_1.Container,\n Stage: Stage_1.Stage,\n stages: Stage_1.stages,\n Layer: Layer_1.Layer,\n FastLayer: FastLayer_1.FastLayer,\n Group: Group_1.Group,\n DD: DragAndDrop_1.DD,\n Shape: Shape_1.Shape,\n shapes: Shape_1.shapes,\n Animation: Animation_1.Animation,\n Tween: Tween_1.Tween,\n Easings: Tween_1.Easings,\n Context: Context_1.Context,\n Canvas: Canvas_1.Canvas,\n});\nexports.default = exports.Konva;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Arc = void 0;\nconst Factory_1 = require(\"../Factory\");\nconst Shape_1 = require(\"../Shape\");\nconst Global_1 = require(\"../Global\");\nconst Validators_1 = require(\"../Validators\");\nconst Global_2 = require(\"../Global\");\nclass Arc extends Shape_1.Shape {\n _sceneFunc(context) {\n var angle = Global_1.Konva.getAngle(this.angle()), clockwise = this.clockwise();\n context.beginPath();\n context.arc(0, 0, this.outerRadius(), 0, angle, clockwise);\n context.arc(0, 0, this.innerRadius(), angle, 0, !clockwise);\n context.closePath();\n context.fillStrokeShape(this);\n }\n getWidth() {\n return this.outerRadius() * 2;\n }\n getHeight() {\n return this.outerRadius() * 2;\n }\n setWidth(width) {\n this.outerRadius(width / 2);\n }\n setHeight(height) {\n this.outerRadius(height / 2);\n }\n getSelfRect() {\n const innerRadius = this.innerRadius();\n const outerRadius = this.outerRadius();\n const clockwise = this.clockwise();\n const angle = Global_1.Konva.getAngle(clockwise ? 360 - this.angle() : this.angle());\n const boundLeftRatio = Math.cos(Math.min(angle, Math.PI));\n const boundRightRatio = 1;\n const boundTopRatio = Math.sin(Math.min(Math.max(Math.PI, angle), (3 * Math.PI) / 2));\n const boundBottomRatio = Math.sin(Math.min(angle, Math.PI / 2));\n const boundLeft = boundLeftRatio * (boundLeftRatio > 0 ? innerRadius : outerRadius);\n const boundRight = boundRightRatio * (boundRightRatio > 0 ? outerRadius : innerRadius);\n const boundTop = boundTopRatio * (boundTopRatio > 0 ? innerRadius : outerRadius);\n const boundBottom = boundBottomRatio * (boundBottomRatio > 0 ? outerRadius : innerRadius);\n return {\n x: boundLeft,\n y: clockwise ? -1 * boundBottom : boundTop,\n width: boundRight - boundLeft,\n height: boundBottom - boundTop,\n };\n }\n}\nexports.Arc = Arc;\nArc.prototype._centroid = true;\nArc.prototype.className = 'Arc';\nArc.prototype._attrsAffectingSize = ['innerRadius', 'outerRadius'];\n(0, Global_2._registerNode)(Arc);\nFactory_1.Factory.addGetterSetter(Arc, 'innerRadius', 0, (0, Validators_1.getNumberValidator)());\nFactory_1.Factory.addGetterSetter(Arc, 'outerRadius', 0, (0, Validators_1.getNumberValidator)());\nFactory_1.Factory.addGetterSetter(Arc, 'angle', 0, (0, Validators_1.getNumberValidator)());\nFactory_1.Factory.addGetterSetter(Arc, 'clockwise', false, (0, Validators_1.getBooleanValidator)());\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Line = void 0;\nconst Factory_1 = require(\"../Factory\");\nconst Shape_1 = require(\"../Shape\");\nconst Validators_1 = require(\"../Validators\");\nconst Global_1 = require(\"../Global\");\nfunction getControlPoints(x0, y0, x1, y1, x2, y2, t) {\n var d01 = Math.sqrt(Math.pow(x1 - x0, 2) + Math.pow(y1 - y0, 2)), d12 = Math.sqrt(Math.pow(x2 - x1, 2) + Math.pow(y2 - y1, 2)), fa = (t * d01) / (d01 + d12), fb = (t * d12) / (d01 + d12), p1x = x1 - fa * (x2 - x0), p1y = y1 - fa * (y2 - y0), p2x = x1 + fb * (x2 - x0), p2y = y1 + fb * (y2 - y0);\n return [p1x, p1y, p2x, p2y];\n}\nfunction expandPoints(p, tension) {\n var len = p.length, allPoints = [], n, cp;\n for (n = 2; n < len - 2; n += 2) {\n cp = getControlPoints(p[n - 2], p[n - 1], p[n], p[n + 1], p[n + 2], p[n + 3], tension);\n if (isNaN(cp[0])) {\n continue;\n }\n allPoints.push(cp[0]);\n allPoints.push(cp[1]);\n allPoints.push(p[n]);\n allPoints.push(p[n + 1]);\n allPoints.push(cp[2]);\n allPoints.push(cp[3]);\n }\n return allPoints;\n}\nclass Line extends Shape_1.Shape {\n constructor(config) {\n super(config);\n this.on('pointsChange.konva tensionChange.konva closedChange.konva bezierChange.konva', function () {\n this._clearCache('tensionPoints');\n });\n }\n _sceneFunc(context) {\n var points = this.points(), length = points.length, tension = this.tension(), closed = this.closed(), bezier = this.bezier(), tp, len, n;\n if (!length) {\n return;\n }\n context.beginPath();\n context.moveTo(points[0], points[1]);\n if (tension !== 0 && length > 4) {\n tp = this.getTensionPoints();\n len = tp.length;\n n = closed ? 0 : 4;\n if (!closed) {\n context.quadraticCurveTo(tp[0], tp[1], tp[2], tp[3]);\n }\n while (n < len - 2) {\n context.bezierCurveTo(tp[n++], tp[n++], tp[n++], tp[n++], tp[n++], tp[n++]);\n }\n if (!closed) {\n context.quadraticCurveTo(tp[len - 2], tp[len - 1], points[length - 2], points[length - 1]);\n }\n }\n else if (bezier) {\n n = 2;\n while (n < length) {\n context.bezierCurveTo(points[n++], points[n++], points[n++], points[n++], points[n++], points[n++]);\n }\n }\n else {\n for (n = 2; n < length; n += 2) {\n context.lineTo(points[n], points[n + 1]);\n }\n }\n if (closed) {\n context.closePath();\n context.fillStrokeShape(this);\n }\n else {\n context.strokeShape(this);\n }\n }\n getTensionPoints() {\n return this._getCache('tensionPoints', this._getTensionPoints);\n }\n _getTensionPoints() {\n if (this.closed()) {\n return this._getTensionPointsClosed();\n }\n else {\n return expandPoints(this.points(), this.tension());\n }\n }\n _getTensionPointsClosed() {\n var p = this.points(), len = p.length, tension = this.tension(), firstControlPoints = getControlPoints(p[len - 2], p[len - 1], p[0], p[1], p[2], p[3], tension), lastControlPoints = getControlPoints(p[len - 4], p[len - 3], p[len - 2], p[len - 1], p[0], p[1], tension), middle = expandPoints(p, tension), tp = [firstControlPoints[2], firstControlPoints[3]]\n .concat(middle)\n .concat([\n lastControlPoints[0],\n lastControlPoints[1],\n p[len - 2],\n p[len - 1],\n lastControlPoints[2],\n lastControlPoints[3],\n firstControlPoints[0],\n firstControlPoints[1],\n p[0],\n p[1],\n ]);\n return tp;\n }\n getWidth() {\n return this.getSelfRect().width;\n }\n getHeight() {\n return this.getSelfRect().height;\n }\n getSelfRect() {\n var points = this.points();\n if (points.length < 4) {\n return {\n x: points[0] || 0,\n y: points[1] || 0,\n width: 0,\n height: 0,\n };\n }\n if (this.tension() !== 0) {\n points = [\n points[0],\n points[1],\n ...this._getTensionPoints(),\n points[points.length - 2],\n points[points.length - 1],\n ];\n }\n else {\n points = this.points();\n }\n var minX = points[0];\n var maxX = points[0];\n var minY = points[1];\n var maxY = points[1];\n var x, y;\n for (var i = 0; i < points.length / 2; i++) {\n x = points[i * 2];\n y = points[i * 2 + 1];\n minX = Math.min(minX, x);\n maxX = Math.max(maxX, x);\n minY = Math.min(minY, y);\n maxY = Math.max(maxY, y);\n }\n return {\n x: minX,\n y: minY,\n width: maxX - minX,\n height: maxY - minY,\n };\n }\n}\nexports.Line = Line;\nLine.prototype.className = 'Line';\nLine.prototype._attrsAffectingSize = ['points', 'bezier', 'tension'];\n(0, Global_1._registerNode)(Line);\nFactory_1.Factory.addGetterSetter(Line, 'closed', false);\nFactory_1.Factory.addGetterSetter(Line, 'bezier', false);\nFactory_1.Factory.addGetterSetter(Line, 'tension', 0, (0, Validators_1.getNumberValidator)());\nFactory_1.Factory.addGetterSetter(Line, 'points', [], (0, Validators_1.getNumberArrayValidator)());\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.t2length = exports.getQuadraticArcLength = exports.getCubicArcLength = exports.binomialCoefficients = exports.cValues = exports.tValues = void 0;\nexports.tValues = [\n [],\n [],\n [\n -0.5773502691896257645091487805019574556476,\n 0.5773502691896257645091487805019574556476,\n ],\n [\n 0, -0.7745966692414833770358530799564799221665,\n 0.7745966692414833770358530799564799221665,\n ],\n [\n -0.3399810435848562648026657591032446872005,\n 0.3399810435848562648026657591032446872005,\n -0.8611363115940525752239464888928095050957,\n 0.8611363115940525752239464888928095050957,\n ],\n [\n 0, -0.5384693101056830910363144207002088049672,\n 0.5384693101056830910363144207002088049672,\n -0.9061798459386639927976268782993929651256,\n 0.9061798459386639927976268782993929651256,\n ],\n [\n 0.6612093864662645136613995950199053470064,\n -0.6612093864662645136613995950199053470064,\n -0.2386191860831969086305017216807119354186,\n 0.2386191860831969086305017216807119354186,\n -0.9324695142031520278123015544939946091347,\n 0.9324695142031520278123015544939946091347,\n ],\n [\n 0, 0.4058451513773971669066064120769614633473,\n -0.4058451513773971669066064120769614633473,\n -0.7415311855993944398638647732807884070741,\n 0.7415311855993944398638647732807884070741,\n -0.9491079123427585245261896840478512624007,\n 0.9491079123427585245261896840478512624007,\n ],\n [\n -0.1834346424956498049394761423601839806667,\n 0.1834346424956498049394761423601839806667,\n -0.5255324099163289858177390491892463490419,\n 0.5255324099163289858177390491892463490419,\n -0.7966664774136267395915539364758304368371,\n 0.7966664774136267395915539364758304368371,\n -0.9602898564975362316835608685694729904282,\n 0.9602898564975362316835608685694729904282,\n ],\n [\n 0, -0.8360311073266357942994297880697348765441,\n 0.8360311073266357942994297880697348765441,\n -0.9681602395076260898355762029036728700494,\n 0.9681602395076260898355762029036728700494,\n -0.3242534234038089290385380146433366085719,\n 0.3242534234038089290385380146433366085719,\n -0.6133714327005903973087020393414741847857,\n 0.6133714327005903973087020393414741847857,\n ],\n [\n -0.1488743389816312108848260011297199846175,\n 0.1488743389816312108848260011297199846175,\n -0.4333953941292471907992659431657841622,\n 0.4333953941292471907992659431657841622,\n -0.6794095682990244062343273651148735757692,\n 0.6794095682990244062343273651148735757692,\n -0.8650633666889845107320966884234930485275,\n 0.8650633666889845107320966884234930485275,\n -0.9739065285171717200779640120844520534282,\n 0.9739065285171717200779640120844520534282,\n ],\n [\n 0, -0.2695431559523449723315319854008615246796,\n 0.2695431559523449723315319854008615246796,\n -0.5190961292068118159257256694586095544802,\n 0.5190961292068118159257256694586095544802,\n -0.7301520055740493240934162520311534580496,\n 0.7301520055740493240934162520311534580496,\n -0.8870625997680952990751577693039272666316,\n 0.8870625997680952990751577693039272666316,\n -0.9782286581460569928039380011228573907714,\n 0.9782286581460569928039380011228573907714,\n ],\n [\n -0.1252334085114689154724413694638531299833,\n 0.1252334085114689154724413694638531299833,\n -0.3678314989981801937526915366437175612563,\n 0.3678314989981801937526915366437175612563,\n -0.587317954286617447296702418940534280369,\n 0.587317954286617447296702418940534280369,\n -0.7699026741943046870368938332128180759849,\n 0.7699026741943046870368938332128180759849,\n -0.9041172563704748566784658661190961925375,\n 0.9041172563704748566784658661190961925375,\n -0.9815606342467192506905490901492808229601,\n 0.9815606342467192506905490901492808229601,\n ],\n [\n 0, -0.2304583159551347940655281210979888352115,\n 0.2304583159551347940655281210979888352115,\n -0.4484927510364468528779128521276398678019,\n 0.4484927510364468528779128521276398678019,\n -0.6423493394403402206439846069955156500716,\n 0.6423493394403402206439846069955156500716,\n -0.8015780907333099127942064895828598903056,\n 0.8015780907333099127942064895828598903056,\n -0.9175983992229779652065478365007195123904,\n 0.9175983992229779652065478365007195123904,\n -0.9841830547185881494728294488071096110649,\n 0.9841830547185881494728294488071096110649,\n ],\n [\n -0.1080549487073436620662446502198347476119,\n 0.1080549487073436620662446502198347476119,\n -0.3191123689278897604356718241684754668342,\n 0.3191123689278897604356718241684754668342,\n -0.5152486363581540919652907185511886623088,\n 0.5152486363581540919652907185511886623088,\n -0.6872929048116854701480198030193341375384,\n 0.6872929048116854701480198030193341375384,\n -0.8272013150697649931897947426503949610397,\n 0.8272013150697649931897947426503949610397,\n -0.928434883663573517336391139377874264477,\n 0.928434883663573517336391139377874264477,\n -0.986283808696812338841597266704052801676,\n 0.986283808696812338841597266704052801676,\n ],\n [\n 0, -0.2011940939974345223006283033945962078128,\n 0.2011940939974345223006283033945962078128,\n -0.3941513470775633698972073709810454683627,\n 0.3941513470775633698972073709810454683627,\n -0.5709721726085388475372267372539106412383,\n 0.5709721726085388475372267372539106412383,\n -0.7244177313601700474161860546139380096308,\n 0.7244177313601700474161860546139380096308,\n -0.8482065834104272162006483207742168513662,\n 0.8482065834104272162006483207742168513662,\n -0.9372733924007059043077589477102094712439,\n 0.9372733924007059043077589477102094712439,\n -0.9879925180204854284895657185866125811469,\n 0.9879925180204854284895657185866125811469,\n ],\n [\n -0.0950125098376374401853193354249580631303,\n 0.0950125098376374401853193354249580631303,\n -0.281603550779258913230460501460496106486,\n 0.281603550779258913230460501460496106486,\n -0.45801677765722738634241944298357757354,\n 0.45801677765722738634241944298357757354,\n -0.6178762444026437484466717640487910189918,\n 0.6178762444026437484466717640487910189918,\n -0.7554044083550030338951011948474422683538,\n 0.7554044083550030338951011948474422683538,\n -0.8656312023878317438804678977123931323873,\n 0.8656312023878317438804678977123931323873,\n -0.9445750230732325760779884155346083450911,\n 0.9445750230732325760779884155346083450911,\n -0.9894009349916499325961541734503326274262,\n 0.9894009349916499325961541734503326274262,\n ],\n [\n 0, -0.1784841814958478558506774936540655574754,\n 0.1784841814958478558506774936540655574754,\n -0.3512317634538763152971855170953460050405,\n 0.3512317634538763152971855170953460050405,\n -0.5126905370864769678862465686295518745829,\n 0.5126905370864769678862465686295518745829,\n -0.6576711592166907658503022166430023351478,\n 0.6576711592166907658503022166430023351478,\n -0.7815140038968014069252300555204760502239,\n 0.7815140038968014069252300555204760502239,\n -0.8802391537269859021229556944881556926234,\n 0.8802391537269859021229556944881556926234,\n -0.9506755217687677612227169578958030214433,\n 0.9506755217687677612227169578958030214433,\n -0.9905754753144173356754340199406652765077,\n 0.9905754753144173356754340199406652765077,\n ],\n [\n -0.0847750130417353012422618529357838117333,\n 0.0847750130417353012422618529357838117333,\n -0.2518862256915055095889728548779112301628,\n 0.2518862256915055095889728548779112301628,\n -0.4117511614628426460359317938330516370789,\n 0.4117511614628426460359317938330516370789,\n -0.5597708310739475346078715485253291369276,\n 0.5597708310739475346078715485253291369276,\n -0.6916870430603532078748910812888483894522,\n 0.6916870430603532078748910812888483894522,\n -0.8037049589725231156824174550145907971032,\n 0.8037049589725231156824174550145907971032,\n -0.8926024664975557392060605911271455154078,\n 0.8926024664975557392060605911271455154078,\n -0.9558239495713977551811958929297763099728,\n 0.9558239495713977551811958929297763099728,\n -0.9915651684209309467300160047061507702525,\n 0.9915651684209309467300160047061507702525,\n ],\n [\n 0, -0.1603586456402253758680961157407435495048,\n 0.1603586456402253758680961157407435495048,\n -0.3165640999636298319901173288498449178922,\n 0.3165640999636298319901173288498449178922,\n -0.4645707413759609457172671481041023679762,\n 0.4645707413759609457172671481041023679762,\n -0.6005453046616810234696381649462392798683,\n 0.6005453046616810234696381649462392798683,\n -0.7209661773352293786170958608237816296571,\n 0.7209661773352293786170958608237816296571,\n -0.8227146565371428249789224867127139017745,\n 0.8227146565371428249789224867127139017745,\n -0.9031559036148179016426609285323124878093,\n 0.9031559036148179016426609285323124878093,\n -0.960208152134830030852778840687651526615,\n 0.960208152134830030852778840687651526615,\n -0.9924068438435844031890176702532604935893,\n 0.9924068438435844031890176702532604935893,\n ],\n [\n -0.0765265211334973337546404093988382110047,\n 0.0765265211334973337546404093988382110047,\n -0.227785851141645078080496195368574624743,\n 0.227785851141645078080496195368574624743,\n -0.3737060887154195606725481770249272373957,\n 0.3737060887154195606725481770249272373957,\n -0.5108670019508270980043640509552509984254,\n 0.5108670019508270980043640509552509984254,\n -0.6360536807265150254528366962262859367433,\n 0.6360536807265150254528366962262859367433,\n -0.7463319064601507926143050703556415903107,\n 0.7463319064601507926143050703556415903107,\n -0.8391169718222188233945290617015206853296,\n 0.8391169718222188233945290617015206853296,\n -0.9122344282513259058677524412032981130491,\n 0.9122344282513259058677524412032981130491,\n -0.963971927277913791267666131197277221912,\n 0.963971927277913791267666131197277221912,\n -0.9931285991850949247861223884713202782226,\n 0.9931285991850949247861223884713202782226,\n ],\n [\n 0, -0.1455618541608950909370309823386863301163,\n 0.1455618541608950909370309823386863301163,\n -0.288021316802401096600792516064600319909,\n 0.288021316802401096600792516064600319909,\n -0.4243421202074387835736688885437880520964,\n 0.4243421202074387835736688885437880520964,\n -0.551618835887219807059018796724313286622,\n 0.551618835887219807059018796724313286622,\n -0.667138804197412319305966669990339162597,\n 0.667138804197412319305966669990339162597,\n -0.7684399634756779086158778513062280348209,\n 0.7684399634756779086158778513062280348209,\n -0.8533633645833172836472506385875676702761,\n 0.8533633645833172836472506385875676702761,\n -0.9200993341504008287901871337149688941591,\n 0.9200993341504008287901871337149688941591,\n -0.9672268385663062943166222149076951614246,\n 0.9672268385663062943166222149076951614246,\n -0.9937521706203895002602420359379409291933,\n 0.9937521706203895002602420359379409291933,\n ],\n [\n -0.0697392733197222212138417961186280818222,\n 0.0697392733197222212138417961186280818222,\n -0.2078604266882212854788465339195457342156,\n 0.2078604266882212854788465339195457342156,\n -0.3419358208920842251581474204273796195591,\n 0.3419358208920842251581474204273796195591,\n -0.4693558379867570264063307109664063460953,\n 0.4693558379867570264063307109664063460953,\n -0.5876404035069115929588769276386473488776,\n 0.5876404035069115929588769276386473488776,\n -0.6944872631866827800506898357622567712673,\n 0.6944872631866827800506898357622567712673,\n -0.7878168059792081620042779554083515213881,\n 0.7878168059792081620042779554083515213881,\n -0.8658125777203001365364256370193787290847,\n 0.8658125777203001365364256370193787290847,\n -0.9269567721871740005206929392590531966353,\n 0.9269567721871740005206929392590531966353,\n -0.9700604978354287271239509867652687108059,\n 0.9700604978354287271239509867652687108059,\n -0.994294585482399292073031421161298980393,\n 0.994294585482399292073031421161298980393,\n ],\n [\n 0, -0.1332568242984661109317426822417661370104,\n 0.1332568242984661109317426822417661370104,\n -0.264135680970344930533869538283309602979,\n 0.264135680970344930533869538283309602979,\n -0.390301038030290831421488872880605458578,\n 0.390301038030290831421488872880605458578,\n -0.5095014778460075496897930478668464305448,\n 0.5095014778460075496897930478668464305448,\n -0.6196098757636461563850973116495956533871,\n 0.6196098757636461563850973116495956533871,\n -0.7186613631319501944616244837486188483299,\n 0.7186613631319501944616244837486188483299,\n -0.8048884016188398921511184069967785579414,\n 0.8048884016188398921511184069967785579414,\n -0.8767523582704416673781568859341456716389,\n 0.8767523582704416673781568859341456716389,\n -0.9329710868260161023491969890384229782357,\n 0.9329710868260161023491969890384229782357,\n -0.9725424712181152319560240768207773751816,\n 0.9725424712181152319560240768207773751816,\n -0.9947693349975521235239257154455743605736,\n 0.9947693349975521235239257154455743605736,\n ],\n [\n -0.0640568928626056260850430826247450385909,\n 0.0640568928626056260850430826247450385909,\n -0.1911188674736163091586398207570696318404,\n 0.1911188674736163091586398207570696318404,\n -0.3150426796961633743867932913198102407864,\n 0.3150426796961633743867932913198102407864,\n -0.4337935076260451384870842319133497124524,\n 0.4337935076260451384870842319133497124524,\n -0.5454214713888395356583756172183723700107,\n 0.5454214713888395356583756172183723700107,\n -0.6480936519369755692524957869107476266696,\n 0.6480936519369755692524957869107476266696,\n -0.7401241915785543642438281030999784255232,\n 0.7401241915785543642438281030999784255232,\n -0.8200019859739029219539498726697452080761,\n 0.8200019859739029219539498726697452080761,\n -0.8864155270044010342131543419821967550873,\n 0.8864155270044010342131543419821967550873,\n -0.9382745520027327585236490017087214496548,\n 0.9382745520027327585236490017087214496548,\n -0.9747285559713094981983919930081690617411,\n 0.9747285559713094981983919930081690617411,\n -0.9951872199970213601799974097007368118745,\n 0.9951872199970213601799974097007368118745,\n ],\n];\nexports.cValues = [\n [],\n [],\n [1.0, 1.0],\n [\n 0.8888888888888888888888888888888888888888,\n 0.5555555555555555555555555555555555555555,\n 0.5555555555555555555555555555555555555555,\n ],\n [\n 0.6521451548625461426269360507780005927646,\n 0.6521451548625461426269360507780005927646,\n 0.3478548451374538573730639492219994072353,\n 0.3478548451374538573730639492219994072353,\n ],\n [\n 0.5688888888888888888888888888888888888888,\n 0.4786286704993664680412915148356381929122,\n 0.4786286704993664680412915148356381929122,\n 0.2369268850561890875142640407199173626432,\n 0.2369268850561890875142640407199173626432,\n ],\n [\n 0.3607615730481386075698335138377161116615,\n 0.3607615730481386075698335138377161116615,\n 0.4679139345726910473898703439895509948116,\n 0.4679139345726910473898703439895509948116,\n 0.1713244923791703450402961421727328935268,\n 0.1713244923791703450402961421727328935268,\n ],\n [\n 0.4179591836734693877551020408163265306122,\n 0.3818300505051189449503697754889751338783,\n 0.3818300505051189449503697754889751338783,\n 0.2797053914892766679014677714237795824869,\n 0.2797053914892766679014677714237795824869,\n 0.1294849661688696932706114326790820183285,\n 0.1294849661688696932706114326790820183285,\n ],\n [\n 0.3626837833783619829651504492771956121941,\n 0.3626837833783619829651504492771956121941,\n 0.3137066458778872873379622019866013132603,\n 0.3137066458778872873379622019866013132603,\n 0.2223810344533744705443559944262408844301,\n 0.2223810344533744705443559944262408844301,\n 0.1012285362903762591525313543099621901153,\n 0.1012285362903762591525313543099621901153,\n ],\n [\n 0.3302393550012597631645250692869740488788,\n 0.1806481606948574040584720312429128095143,\n 0.1806481606948574040584720312429128095143,\n 0.0812743883615744119718921581105236506756,\n 0.0812743883615744119718921581105236506756,\n 0.3123470770400028400686304065844436655987,\n 0.3123470770400028400686304065844436655987,\n 0.2606106964029354623187428694186328497718,\n 0.2606106964029354623187428694186328497718,\n ],\n [\n 0.295524224714752870173892994651338329421,\n 0.295524224714752870173892994651338329421,\n 0.2692667193099963550912269215694693528597,\n 0.2692667193099963550912269215694693528597,\n 0.2190863625159820439955349342281631924587,\n 0.2190863625159820439955349342281631924587,\n 0.1494513491505805931457763396576973324025,\n 0.1494513491505805931457763396576973324025,\n 0.0666713443086881375935688098933317928578,\n 0.0666713443086881375935688098933317928578,\n ],\n [\n 0.272925086777900630714483528336342189156,\n 0.2628045445102466621806888698905091953727,\n 0.2628045445102466621806888698905091953727,\n 0.2331937645919904799185237048431751394317,\n 0.2331937645919904799185237048431751394317,\n 0.1862902109277342514260976414316558916912,\n 0.1862902109277342514260976414316558916912,\n 0.1255803694649046246346942992239401001976,\n 0.1255803694649046246346942992239401001976,\n 0.0556685671161736664827537204425485787285,\n 0.0556685671161736664827537204425485787285,\n ],\n [\n 0.2491470458134027850005624360429512108304,\n 0.2491470458134027850005624360429512108304,\n 0.2334925365383548087608498989248780562594,\n 0.2334925365383548087608498989248780562594,\n 0.2031674267230659217490644558097983765065,\n 0.2031674267230659217490644558097983765065,\n 0.160078328543346226334652529543359071872,\n 0.160078328543346226334652529543359071872,\n 0.1069393259953184309602547181939962242145,\n 0.1069393259953184309602547181939962242145,\n 0.047175336386511827194615961485017060317,\n 0.047175336386511827194615961485017060317,\n ],\n [\n 0.2325515532308739101945895152688359481566,\n 0.2262831802628972384120901860397766184347,\n 0.2262831802628972384120901860397766184347,\n 0.2078160475368885023125232193060527633865,\n 0.2078160475368885023125232193060527633865,\n 0.1781459807619457382800466919960979955128,\n 0.1781459807619457382800466919960979955128,\n 0.1388735102197872384636017768688714676218,\n 0.1388735102197872384636017768688714676218,\n 0.0921214998377284479144217759537971209236,\n 0.0921214998377284479144217759537971209236,\n 0.0404840047653158795200215922009860600419,\n 0.0404840047653158795200215922009860600419,\n ],\n [\n 0.2152638534631577901958764433162600352749,\n 0.2152638534631577901958764433162600352749,\n 0.2051984637212956039659240656612180557103,\n 0.2051984637212956039659240656612180557103,\n 0.1855383974779378137417165901251570362489,\n 0.1855383974779378137417165901251570362489,\n 0.1572031671581935345696019386238421566056,\n 0.1572031671581935345696019386238421566056,\n 0.1215185706879031846894148090724766259566,\n 0.1215185706879031846894148090724766259566,\n 0.0801580871597602098056332770628543095836,\n 0.0801580871597602098056332770628543095836,\n 0.0351194603317518630318328761381917806197,\n 0.0351194603317518630318328761381917806197,\n ],\n [\n 0.2025782419255612728806201999675193148386,\n 0.1984314853271115764561183264438393248186,\n 0.1984314853271115764561183264438393248186,\n 0.1861610000155622110268005618664228245062,\n 0.1861610000155622110268005618664228245062,\n 0.1662692058169939335532008604812088111309,\n 0.1662692058169939335532008604812088111309,\n 0.1395706779261543144478047945110283225208,\n 0.1395706779261543144478047945110283225208,\n 0.1071592204671719350118695466858693034155,\n 0.1071592204671719350118695466858693034155,\n 0.0703660474881081247092674164506673384667,\n 0.0703660474881081247092674164506673384667,\n 0.0307532419961172683546283935772044177217,\n 0.0307532419961172683546283935772044177217,\n ],\n [\n 0.1894506104550684962853967232082831051469,\n 0.1894506104550684962853967232082831051469,\n 0.1826034150449235888667636679692199393835,\n 0.1826034150449235888667636679692199393835,\n 0.1691565193950025381893120790303599622116,\n 0.1691565193950025381893120790303599622116,\n 0.1495959888165767320815017305474785489704,\n 0.1495959888165767320815017305474785489704,\n 0.1246289712555338720524762821920164201448,\n 0.1246289712555338720524762821920164201448,\n 0.0951585116824927848099251076022462263552,\n 0.0951585116824927848099251076022462263552,\n 0.0622535239386478928628438369943776942749,\n 0.0622535239386478928628438369943776942749,\n 0.0271524594117540948517805724560181035122,\n 0.0271524594117540948517805724560181035122,\n ],\n [\n 0.1794464703562065254582656442618856214487,\n 0.1765627053669926463252709901131972391509,\n 0.1765627053669926463252709901131972391509,\n 0.1680041021564500445099706637883231550211,\n 0.1680041021564500445099706637883231550211,\n 0.1540457610768102880814315948019586119404,\n 0.1540457610768102880814315948019586119404,\n 0.1351363684685254732863199817023501973721,\n 0.1351363684685254732863199817023501973721,\n 0.1118838471934039710947883856263559267358,\n 0.1118838471934039710947883856263559267358,\n 0.0850361483171791808835353701910620738504,\n 0.0850361483171791808835353701910620738504,\n 0.0554595293739872011294401653582446605128,\n 0.0554595293739872011294401653582446605128,\n 0.0241483028685479319601100262875653246916,\n 0.0241483028685479319601100262875653246916,\n ],\n [\n 0.1691423829631435918406564701349866103341,\n 0.1691423829631435918406564701349866103341,\n 0.1642764837458327229860537764659275904123,\n 0.1642764837458327229860537764659275904123,\n 0.1546846751262652449254180038363747721932,\n 0.1546846751262652449254180038363747721932,\n 0.1406429146706506512047313037519472280955,\n 0.1406429146706506512047313037519472280955,\n 0.1225552067114784601845191268002015552281,\n 0.1225552067114784601845191268002015552281,\n 0.1009420441062871655628139849248346070628,\n 0.1009420441062871655628139849248346070628,\n 0.0764257302548890565291296776166365256053,\n 0.0764257302548890565291296776166365256053,\n 0.0497145488949697964533349462026386416808,\n 0.0497145488949697964533349462026386416808,\n 0.0216160135264833103133427102664524693876,\n 0.0216160135264833103133427102664524693876,\n ],\n [\n 0.1610544498487836959791636253209167350399,\n 0.1589688433939543476499564394650472016787,\n 0.1589688433939543476499564394650472016787,\n 0.152766042065859666778855400897662998461,\n 0.152766042065859666778855400897662998461,\n 0.1426067021736066117757461094419029724756,\n 0.1426067021736066117757461094419029724756,\n 0.1287539625393362276755157848568771170558,\n 0.1287539625393362276755157848568771170558,\n 0.1115666455473339947160239016817659974813,\n 0.1115666455473339947160239016817659974813,\n 0.0914900216224499994644620941238396526609,\n 0.0914900216224499994644620941238396526609,\n 0.0690445427376412265807082580060130449618,\n 0.0690445427376412265807082580060130449618,\n 0.0448142267656996003328381574019942119517,\n 0.0448142267656996003328381574019942119517,\n 0.0194617882297264770363120414644384357529,\n 0.0194617882297264770363120414644384357529,\n ],\n [\n 0.1527533871307258506980843319550975934919,\n 0.1527533871307258506980843319550975934919,\n 0.1491729864726037467878287370019694366926,\n 0.1491729864726037467878287370019694366926,\n 0.1420961093183820513292983250671649330345,\n 0.1420961093183820513292983250671649330345,\n 0.1316886384491766268984944997481631349161,\n 0.1316886384491766268984944997481631349161,\n 0.118194531961518417312377377711382287005,\n 0.118194531961518417312377377711382287005,\n 0.1019301198172404350367501354803498761666,\n 0.1019301198172404350367501354803498761666,\n 0.0832767415767047487247581432220462061001,\n 0.0832767415767047487247581432220462061001,\n 0.0626720483341090635695065351870416063516,\n 0.0626720483341090635695065351870416063516,\n 0.040601429800386941331039952274932109879,\n 0.040601429800386941331039952274932109879,\n 0.0176140071391521183118619623518528163621,\n 0.0176140071391521183118619623518528163621,\n ],\n [\n 0.1460811336496904271919851476833711882448,\n 0.1445244039899700590638271665537525436099,\n 0.1445244039899700590638271665537525436099,\n 0.1398873947910731547221334238675831108927,\n 0.1398873947910731547221334238675831108927,\n 0.132268938633337461781052574496775604329,\n 0.132268938633337461781052574496775604329,\n 0.1218314160537285341953671771257335983563,\n 0.1218314160537285341953671771257335983563,\n 0.1087972991671483776634745780701056420336,\n 0.1087972991671483776634745780701056420336,\n 0.0934444234560338615532897411139320884835,\n 0.0934444234560338615532897411139320884835,\n 0.0761001136283793020170516533001831792261,\n 0.0761001136283793020170516533001831792261,\n 0.0571344254268572082836358264724479574912,\n 0.0571344254268572082836358264724479574912,\n 0.0369537897708524937999506682993296661889,\n 0.0369537897708524937999506682993296661889,\n 0.0160172282577743333242246168584710152658,\n 0.0160172282577743333242246168584710152658,\n ],\n [\n 0.1392518728556319933754102483418099578739,\n 0.1392518728556319933754102483418099578739,\n 0.1365414983460151713525738312315173965863,\n 0.1365414983460151713525738312315173965863,\n 0.1311735047870623707329649925303074458757,\n 0.1311735047870623707329649925303074458757,\n 0.1232523768105124242855609861548144719594,\n 0.1232523768105124242855609861548144719594,\n 0.1129322960805392183934006074217843191142,\n 0.1129322960805392183934006074217843191142,\n 0.1004141444428809649320788378305362823508,\n 0.1004141444428809649320788378305362823508,\n 0.0859416062170677274144436813727028661891,\n 0.0859416062170677274144436813727028661891,\n 0.0697964684245204880949614189302176573987,\n 0.0697964684245204880949614189302176573987,\n 0.0522933351526832859403120512732112561121,\n 0.0522933351526832859403120512732112561121,\n 0.0337749015848141547933022468659129013491,\n 0.0337749015848141547933022468659129013491,\n 0.0146279952982722006849910980471854451902,\n 0.0146279952982722006849910980471854451902,\n ],\n [\n 0.1336545721861061753514571105458443385831,\n 0.132462039404696617371642464703316925805,\n 0.132462039404696617371642464703316925805,\n 0.1289057221880821499785953393997936532597,\n 0.1289057221880821499785953393997936532597,\n 0.1230490843067295304675784006720096548158,\n 0.1230490843067295304675784006720096548158,\n 0.1149966402224113649416435129339613014914,\n 0.1149966402224113649416435129339613014914,\n 0.1048920914645414100740861850147438548584,\n 0.1048920914645414100740861850147438548584,\n 0.0929157660600351474770186173697646486034,\n 0.0929157660600351474770186173697646486034,\n 0.0792814117767189549228925247420432269137,\n 0.0792814117767189549228925247420432269137,\n 0.0642324214085258521271696151589109980391,\n 0.0642324214085258521271696151589109980391,\n 0.0480376717310846685716410716320339965612,\n 0.0480376717310846685716410716320339965612,\n 0.0309880058569794443106942196418845053837,\n 0.0309880058569794443106942196418845053837,\n 0.0134118594871417720813094934586150649766,\n 0.0134118594871417720813094934586150649766,\n ],\n [\n 0.1279381953467521569740561652246953718517,\n 0.1279381953467521569740561652246953718517,\n 0.1258374563468282961213753825111836887264,\n 0.1258374563468282961213753825111836887264,\n 0.121670472927803391204463153476262425607,\n 0.121670472927803391204463153476262425607,\n 0.1155056680537256013533444839067835598622,\n 0.1155056680537256013533444839067835598622,\n 0.1074442701159656347825773424466062227946,\n 0.1074442701159656347825773424466062227946,\n 0.0976186521041138882698806644642471544279,\n 0.0976186521041138882698806644642471544279,\n 0.086190161531953275917185202983742667185,\n 0.086190161531953275917185202983742667185,\n 0.0733464814110803057340336152531165181193,\n 0.0733464814110803057340336152531165181193,\n 0.0592985849154367807463677585001085845412,\n 0.0592985849154367807463677585001085845412,\n 0.0442774388174198061686027482113382288593,\n 0.0442774388174198061686027482113382288593,\n 0.0285313886289336631813078159518782864491,\n 0.0285313886289336631813078159518782864491,\n 0.0123412297999871995468056670700372915759,\n 0.0123412297999871995468056670700372915759,\n ],\n];\nexports.binomialCoefficients = [[1], [1, 1], [1, 2, 1], [1, 3, 3, 1]];\nconst getCubicArcLength = (xs, ys, t) => {\n let z;\n let sum;\n let correctedT;\n const n = 20;\n z = t / 2;\n sum = 0;\n for (let i = 0; i < n; i++) {\n correctedT = z * exports.tValues[n][i] + z;\n sum += exports.cValues[n][i] * BFunc(xs, ys, correctedT);\n }\n return z * sum;\n};\nexports.getCubicArcLength = getCubicArcLength;\nconst getQuadraticArcLength = (xs, ys, t) => {\n if (t === undefined) {\n t = 1;\n }\n const ax = xs[0] - 2 * xs[1] + xs[2];\n const ay = ys[0] - 2 * ys[1] + ys[2];\n const bx = 2 * xs[1] - 2 * xs[0];\n const by = 2 * ys[1] - 2 * ys[0];\n const A = 4 * (ax * ax + ay * ay);\n const B = 4 * (ax * bx + ay * by);\n const C = bx * bx + by * by;\n if (A === 0) {\n return (t * Math.sqrt(Math.pow(xs[2] - xs[0], 2) + Math.pow(ys[2] - ys[0], 2)));\n }\n const b = B / (2 * A);\n const c = C / A;\n const u = t + b;\n const k = c - b * b;\n const uuk = u * u + k > 0 ? Math.sqrt(u * u + k) : 0;\n const bbk = b * b + k > 0 ? Math.sqrt(b * b + k) : 0;\n const term = b + Math.sqrt(b * b + k) !== 0\n ? k * Math.log(Math.abs((u + uuk) / (b + bbk)))\n : 0;\n return (Math.sqrt(A) / 2) * (u * uuk - b * bbk + term);\n};\nexports.getQuadraticArcLength = getQuadraticArcLength;\nfunction BFunc(xs, ys, t) {\n const xbase = getDerivative(1, t, xs);\n const ybase = getDerivative(1, t, ys);\n const combined = xbase * xbase + ybase * ybase;\n return Math.sqrt(combined);\n}\nconst getDerivative = (derivative, t, vs) => {\n const n = vs.length - 1;\n let _vs;\n let value;\n if (n === 0) {\n return 0;\n }\n if (derivative === 0) {\n value = 0;\n for (let k = 0; k <= n; k++) {\n value +=\n exports.binomialCoefficients[n][k] *\n Math.pow(1 - t, n - k) *\n Math.pow(t, k) *\n vs[k];\n }\n return value;\n }\n else {\n _vs = new Array(n);\n for (let k = 0; k < n; k++) {\n _vs[k] = n * (vs[k + 1] - vs[k]);\n }\n return getDerivative(derivative - 1, t, _vs);\n }\n};\nconst t2length = (length, totalLength, func) => {\n let error = 1;\n let t = length / totalLength;\n let step = (length - func(t)) / totalLength;\n let numIterations = 0;\n while (error > 0.001) {\n const increasedTLength = func(t + step);\n const increasedTError = Math.abs(length - increasedTLength) / totalLength;\n if (increasedTError < error) {\n error = increasedTError;\n t += step;\n }\n else {\n const decreasedTLength = func(t - step);\n const decreasedTError = Math.abs(length - decreasedTLength) / totalLength;\n if (decreasedTError < error) {\n error = decreasedTError;\n t -= step;\n }\n else {\n step /= 2;\n }\n }\n numIterations++;\n if (numIterations > 500) {\n break;\n }\n }\n return t;\n};\nexports.t2length = t2length;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Path = void 0;\nconst Factory_1 = require(\"../Factory\");\nconst Shape_1 = require(\"../Shape\");\nconst Global_1 = require(\"../Global\");\nconst BezierFunctions_1 = require(\"../BezierFunctions\");\nclass Path extends Shape_1.Shape {\n constructor(config) {\n super(config);\n this.dataArray = [];\n this.pathLength = 0;\n this._readDataAttribute();\n this.on('dataChange.konva', function () {\n this._readDataAttribute();\n });\n }\n _readDataAttribute() {\n this.dataArray = Path.parsePathData(this.data());\n this.pathLength = Path.getPathLength(this.dataArray);\n }\n _sceneFunc(context) {\n var ca = this.dataArray;\n context.beginPath();\n var isClosed = false;\n for (var n = 0; n < ca.length; n++) {\n var c = ca[n].command;\n var p = ca[n].points;\n switch (c) {\n case 'L':\n context.lineTo(p[0], p[1]);\n break;\n case 'M':\n context.moveTo(p[0], p[1]);\n break;\n case 'C':\n context.bezierCurveTo(p[0], p[1], p[2], p[3], p[4], p[5]);\n break;\n case 'Q':\n context.quadraticCurveTo(p[0], p[1], p[2], p[3]);\n break;\n case 'A':\n var cx = p[0], cy = p[1], rx = p[2], ry = p[3], theta = p[4], dTheta = p[5], psi = p[6], fs = p[7];\n var r = rx > ry ? rx : ry;\n var scaleX = rx > ry ? 1 : rx / ry;\n var scaleY = rx > ry ? ry / rx : 1;\n context.translate(cx, cy);\n context.rotate(psi);\n context.scale(scaleX, scaleY);\n context.arc(0, 0, r, theta, theta + dTheta, 1 - fs);\n context.scale(1 / scaleX, 1 / scaleY);\n context.rotate(-psi);\n context.translate(-cx, -cy);\n break;\n case 'z':\n isClosed = true;\n context.closePath();\n break;\n }\n }\n if (!isClosed && !this.hasFill()) {\n context.strokeShape(this);\n }\n else {\n context.fillStrokeShape(this);\n }\n }\n getSelfRect() {\n var points = [];\n this.dataArray.forEach(function (data) {\n if (data.command === 'A') {\n var start = data.points[4];\n var dTheta = data.points[5];\n var end = data.points[4] + dTheta;\n var inc = Math.PI / 180.0;\n if (Math.abs(start - end) < inc) {\n inc = Math.abs(start - end);\n }\n if (dTheta < 0) {\n for (let t = start - inc; t > end; t -= inc) {\n const point = Path.getPointOnEllipticalArc(data.points[0], data.points[1], data.points[2], data.points[3], t, 0);\n points.push(point.x, point.y);\n }\n }\n else {\n for (let t = start + inc; t < end; t += inc) {\n const point = Path.getPointOnEllipticalArc(data.points[0], data.points[1], data.points[2], data.points[3], t, 0);\n points.push(point.x, point.y);\n }\n }\n }\n else if (data.command === 'C') {\n for (let t = 0.0; t <= 1; t += 0.01) {\n const point = Path.getPointOnCubicBezier(t, data.start.x, data.start.y, data.points[0], data.points[1], data.points[2], data.points[3], data.points[4], data.points[5]);\n points.push(point.x, point.y);\n }\n }\n else {\n points = points.concat(data.points);\n }\n });\n var minX = points[0];\n var maxX = points[0];\n var minY = points[1];\n var maxY = points[1];\n var x, y;\n for (var i = 0; i < points.length / 2; i++) {\n x = points[i * 2];\n y = points[i * 2 + 1];\n if (!isNaN(x)) {\n minX = Math.min(minX, x);\n maxX = Math.max(maxX, x);\n }\n if (!isNaN(y)) {\n minY = Math.min(minY, y);\n maxY = Math.max(maxY, y);\n }\n }\n return {\n x: minX,\n y: minY,\n width: maxX - minX,\n height: maxY - minY,\n };\n }\n getLength() {\n return this.pathLength;\n }\n getPointAtLength(length) {\n return Path.getPointAtLengthOfDataArray(length, this.dataArray);\n }\n static getLineLength(x1, y1, x2, y2) {\n return Math.sqrt((x2 - x1) * (x2 - x1) + (y2 - y1) * (y2 - y1));\n }\n static getPathLength(dataArray) {\n let pathLength = 0;\n for (var i = 0; i < dataArray.length; ++i) {\n pathLength += dataArray[i].pathLength;\n }\n return pathLength;\n }\n static getPointAtLengthOfDataArray(length, dataArray) {\n var points, i = 0, ii = dataArray.length;\n if (!ii) {\n return null;\n }\n while (i < ii && length > dataArray[i].pathLength) {\n length -= dataArray[i].pathLength;\n ++i;\n }\n if (i === ii) {\n points = dataArray[i - 1].points.slice(-2);\n return {\n x: points[0],\n y: points[1],\n };\n }\n if (length < 0.01) {\n points = dataArray[i].points.slice(0, 2);\n return {\n x: points[0],\n y: points[1],\n };\n }\n var cp = dataArray[i];\n var p = cp.points;\n switch (cp.command) {\n case 'L':\n return Path.getPointOnLine(length, cp.start.x, cp.start.y, p[0], p[1]);\n case 'C':\n return Path.getPointOnCubicBezier((0, BezierFunctions_1.t2length)(length, Path.getPathLength(dataArray), (i) => {\n return (0, BezierFunctions_1.getCubicArcLength)([cp.start.x, p[0], p[2], p[4]], [cp.start.y, p[1], p[3], p[5]], i);\n }), cp.start.x, cp.start.y, p[0], p[1], p[2], p[3], p[4], p[5]);\n case 'Q':\n return Path.getPointOnQuadraticBezier((0, BezierFunctions_1.t2length)(length, Path.getPathLength(dataArray), (i) => {\n return (0, BezierFunctions_1.getQuadraticArcLength)([cp.start.x, p[0], p[2]], [cp.start.y, p[1], p[3]], i);\n }), cp.start.x, cp.start.y, p[0], p[1], p[2], p[3]);\n case 'A':\n var cx = p[0], cy = p[1], rx = p[2], ry = p[3], theta = p[4], dTheta = p[5], psi = p[6];\n theta += (dTheta * length) / cp.pathLength;\n return Path.getPointOnEllipticalArc(cx, cy, rx, ry, theta, psi);\n }\n return null;\n }\n static getPointOnLine(dist, P1x, P1y, P2x, P2y, fromX, fromY) {\n fromX = fromX !== null && fromX !== void 0 ? fromX : P1x;\n fromY = fromY !== null && fromY !== void 0 ? fromY : P1y;\n const len = this.getLineLength(P1x, P1y, P2x, P2y);\n if (len < 1e-10) {\n return { x: P1x, y: P1y };\n }\n if (P2x === P1x) {\n return { x: fromX, y: fromY + (P2y > P1y ? dist : -dist) };\n }\n const m = (P2y - P1y) / (P2x - P1x);\n const run = Math.sqrt((dist * dist) / (1 + m * m)) * (P2x < P1x ? -1 : 1);\n const rise = m * run;\n if (Math.abs(fromY - P1y - m * (fromX - P1x)) < 1e-10) {\n return { x: fromX + run, y: fromY + rise };\n }\n const u = ((fromX - P1x) * (P2x - P1x) + (fromY - P1y) * (P2y - P1y)) / (len * len);\n const ix = P1x + u * (P2x - P1x);\n const iy = P1y + u * (P2y - P1y);\n const pRise = this.getLineLength(fromX, fromY, ix, iy);\n const pRun = Math.sqrt(dist * dist - pRise * pRise);\n const adjustedRun = Math.sqrt((pRun * pRun) / (1 + m * m)) * (P2x < P1x ? -1 : 1);\n const adjustedRise = m * adjustedRun;\n return { x: ix + adjustedRun, y: iy + adjustedRise };\n }\n static getPointOnCubicBezier(pct, P1x, P1y, P2x, P2y, P3x, P3y, P4x, P4y) {\n function CB1(t) {\n return t * t * t;\n }\n function CB2(t) {\n return 3 * t * t * (1 - t);\n }\n function CB3(t) {\n return 3 * t * (1 - t) * (1 - t);\n }\n function CB4(t) {\n return (1 - t) * (1 - t) * (1 - t);\n }\n var x = P4x * CB1(pct) + P3x * CB2(pct) + P2x * CB3(pct) + P1x * CB4(pct);\n var y = P4y * CB1(pct) + P3y * CB2(pct) + P2y * CB3(pct) + P1y * CB4(pct);\n return {\n x: x,\n y: y,\n };\n }\n static getPointOnQuadraticBezier(pct, P1x, P1y, P2x, P2y, P3x, P3y) {\n function QB1(t) {\n return t * t;\n }\n function QB2(t) {\n return 2 * t * (1 - t);\n }\n function QB3(t) {\n return (1 - t) * (1 - t);\n }\n var x = P3x * QB1(pct) + P2x * QB2(pct) + P1x * QB3(pct);\n var y = P3y * QB1(pct) + P2y * QB2(pct) + P1y * QB3(pct);\n return {\n x: x,\n y: y,\n };\n }\n static getPointOnEllipticalArc(cx, cy, rx, ry, theta, psi) {\n var cosPsi = Math.cos(psi), sinPsi = Math.sin(psi);\n var pt = {\n x: rx * Math.cos(theta),\n y: ry * Math.sin(theta),\n };\n return {\n x: cx + (pt.x * cosPsi - pt.y * sinPsi),\n y: cy + (pt.x * sinPsi + pt.y * cosPsi),\n };\n }\n static parsePathData(data) {\n if (!data) {\n return [];\n }\n var cs = data;\n var cc = [\n 'm',\n 'M',\n 'l',\n 'L',\n 'v',\n 'V',\n 'h',\n 'H',\n 'z',\n 'Z',\n 'c',\n 'C',\n 'q',\n 'Q',\n 't',\n 'T',\n 's',\n 'S',\n 'a',\n 'A',\n ];\n cs = cs.replace(new RegExp(' ', 'g'), ',');\n for (var n = 0; n < cc.length; n++) {\n cs = cs.replace(new RegExp(cc[n], 'g'), '|' + cc[n]);\n }\n var arr = cs.split('|');\n var ca = [];\n var coords = [];\n var cpx = 0;\n var cpy = 0;\n var re = /([-+]?((\\d+\\.\\d+)|((\\d+)|(\\.\\d+)))(?:e[-+]?\\d+)?)/gi;\n var match;\n for (n = 1; n < arr.length; n++) {\n var str = arr[n];\n var c = str.charAt(0);\n str = str.slice(1);\n coords.length = 0;\n while ((match = re.exec(str))) {\n coords.push(match[0]);\n }\n var p = [];\n for (var j = 0, jlen = coords.length; j < jlen; j++) {\n if (coords[j] === '00') {\n p.push(0, 0);\n continue;\n }\n var parsed = parseFloat(coords[j]);\n if (!isNaN(parsed)) {\n p.push(parsed);\n }\n else {\n p.push(0);\n }\n }\n while (p.length > 0) {\n if (isNaN(p[0])) {\n break;\n }\n var cmd = '';\n var points = [];\n var startX = cpx, startY = cpy;\n var prevCmd, ctlPtx, ctlPty;\n var rx, ry, psi, fa, fs, x1, y1;\n switch (c) {\n case 'l':\n cpx += p.shift();\n cpy += p.shift();\n cmd = 'L';\n points.push(cpx, cpy);\n break;\n case 'L':\n cpx = p.shift();\n cpy = p.shift();\n points.push(cpx, cpy);\n break;\n case 'm':\n var dx = p.shift();\n var dy = p.shift();\n cpx += dx;\n cpy += dy;\n cmd = 'M';\n if (ca.length > 2 && ca[ca.length - 1].command === 'z') {\n for (var idx = ca.length - 2; idx >= 0; idx--) {\n if (ca[idx].command === 'M') {\n cpx = ca[idx].points[0] + dx;\n cpy = ca[idx].points[1] + dy;\n break;\n }\n }\n }\n points.push(cpx, cpy);\n c = 'l';\n break;\n case 'M':\n cpx = p.shift();\n cpy = p.shift();\n cmd = 'M';\n points.push(cpx, cpy);\n c = 'L';\n break;\n case 'h':\n cpx += p.shift();\n cmd = 'L';\n points.push(cpx, cpy);\n break;\n case 'H':\n cpx = p.shift();\n cmd = 'L';\n points.push(cpx, cpy);\n break;\n case 'v':\n cpy += p.shift();\n cmd = 'L';\n points.push(cpx, cpy);\n break;\n case 'V':\n cpy = p.shift();\n cmd = 'L';\n points.push(cpx, cpy);\n break;\n case 'C':\n points.push(p.shift(), p.shift(), p.shift(), p.shift());\n cpx = p.shift();\n cpy = p.shift();\n points.push(cpx, cpy);\n break;\n case 'c':\n points.push(cpx + p.shift(), cpy + p.shift(), cpx + p.shift(), cpy + p.shift());\n cpx += p.shift();\n cpy += p.shift();\n cmd = 'C';\n points.push(cpx, cpy);\n break;\n case 'S':\n ctlPtx = cpx;\n ctlPty = cpy;\n prevCmd = ca[ca.length - 1];\n if (prevCmd.command === 'C') {\n ctlPtx = cpx + (cpx - prevCmd.points[2]);\n ctlPty = cpy + (cpy - prevCmd.points[3]);\n }\n points.push(ctlPtx, ctlPty, p.shift(), p.shift());\n cpx = p.shift();\n cpy = p.shift();\n cmd = 'C';\n points.push(cpx, cpy);\n break;\n case 's':\n ctlPtx = cpx;\n ctlPty = cpy;\n prevCmd = ca[ca.length - 1];\n if (prevCmd.command === 'C') {\n ctlPtx = cpx + (cpx - prevCmd.points[2]);\n ctlPty = cpy + (cpy - prevCmd.points[3]);\n }\n points.push(ctlPtx, ctlPty, cpx + p.shift(), cpy + p.shift());\n cpx += p.shift();\n cpy += p.shift();\n cmd = 'C';\n points.push(cpx, cpy);\n break;\n case 'Q':\n points.push(p.shift(), p.shift());\n cpx = p.shift();\n cpy = p.shift();\n points.push(cpx, cpy);\n break;\n case 'q':\n points.push(cpx + p.shift(), cpy + p.shift());\n cpx += p.shift();\n cpy += p.shift();\n cmd = 'Q';\n points.push(cpx, cpy);\n break;\n case 'T':\n ctlPtx = cpx;\n ctlPty = cpy;\n prevCmd = ca[ca.length - 1];\n if (prevCmd.command === 'Q') {\n ctlPtx = cpx + (cpx - prevCmd.points[0]);\n ctlPty = cpy + (cpy - prevCmd.points[1]);\n }\n cpx = p.shift();\n cpy = p.shift();\n cmd = 'Q';\n points.push(ctlPtx, ctlPty, cpx, cpy);\n break;\n case 't':\n ctlPtx = cpx;\n ctlPty = cpy;\n prevCmd = ca[ca.length - 1];\n if (prevCmd.command === 'Q') {\n ctlPtx = cpx + (cpx - prevCmd.points[0]);\n ctlPty = cpy + (cpy - prevCmd.points[1]);\n }\n cpx += p.shift();\n cpy += p.shift();\n cmd = 'Q';\n points.push(ctlPtx, ctlPty, cpx, cpy);\n break;\n case 'A':\n rx = p.shift();\n ry = p.shift();\n psi = p.shift();\n fa = p.shift();\n fs = p.shift();\n x1 = cpx;\n y1 = cpy;\n cpx = p.shift();\n cpy = p.shift();\n cmd = 'A';\n points = this.convertEndpointToCenterParameterization(x1, y1, cpx, cpy, fa, fs, rx, ry, psi);\n break;\n case 'a':\n rx = p.shift();\n ry = p.shift();\n psi = p.shift();\n fa = p.shift();\n fs = p.shift();\n x1 = cpx;\n y1 = cpy;\n cpx += p.shift();\n cpy += p.shift();\n cmd = 'A';\n points = this.convertEndpointToCenterParameterization(x1, y1, cpx, cpy, fa, fs, rx, ry, psi);\n break;\n }\n ca.push({\n command: cmd || c,\n points: points,\n start: {\n x: startX,\n y: startY,\n },\n pathLength: this.calcLength(startX, startY, cmd || c, points),\n });\n }\n if (c === 'z' || c === 'Z') {\n ca.push({\n command: 'z',\n points: [],\n start: undefined,\n pathLength: 0,\n });\n }\n }\n return ca;\n }\n static calcLength(x, y, cmd, points) {\n var len, p1, p2, t;\n var path = Path;\n switch (cmd) {\n case 'L':\n return path.getLineLength(x, y, points[0], points[1]);\n case 'C':\n return (0, BezierFunctions_1.getCubicArcLength)([x, points[0], points[2], points[4]], [y, points[1], points[3], points[5]], 1);\n case 'Q':\n return (0, BezierFunctions_1.getQuadraticArcLength)([x, points[0], points[2]], [y, points[1], points[3]], 1);\n case 'A':\n len = 0.0;\n var start = points[4];\n var dTheta = points[5];\n var end = points[4] + dTheta;\n var inc = Math.PI / 180.0;\n if (Math.abs(start - end) < inc) {\n inc = Math.abs(start - end);\n }\n p1 = path.getPointOnEllipticalArc(points[0], points[1], points[2], points[3], start, 0);\n if (dTheta < 0) {\n for (t = start - inc; t > end; t -= inc) {\n p2 = path.getPointOnEllipticalArc(points[0], points[1], points[2], points[3], t, 0);\n len += path.getLineLength(p1.x, p1.y, p2.x, p2.y);\n p1 = p2;\n }\n }\n else {\n for (t = start + inc; t < end; t += inc) {\n p2 = path.getPointOnEllipticalArc(points[0], points[1], points[2], points[3], t, 0);\n len += path.getLineLength(p1.x, p1.y, p2.x, p2.y);\n p1 = p2;\n }\n }\n p2 = path.getPointOnEllipticalArc(points[0], points[1], points[2], points[3], end, 0);\n len += path.getLineLength(p1.x, p1.y, p2.x, p2.y);\n return len;\n }\n return 0;\n }\n static convertEndpointToCenterParameterization(x1, y1, x2, y2, fa, fs, rx, ry, psiDeg) {\n var psi = psiDeg * (Math.PI / 180.0);\n var xp = (Math.cos(psi) * (x1 - x2)) / 2.0 + (Math.sin(psi) * (y1 - y2)) / 2.0;\n var yp = (-1 * Math.sin(psi) * (x1 - x2)) / 2.0 +\n (Math.cos(psi) * (y1 - y2)) / 2.0;\n var lambda = (xp * xp) / (rx * rx) + (yp * yp) / (ry * ry);\n if (lambda > 1) {\n rx *= Math.sqrt(lambda);\n ry *= Math.sqrt(lambda);\n }\n var f = Math.sqrt((rx * rx * (ry * ry) - rx * rx * (yp * yp) - ry * ry * (xp * xp)) /\n (rx * rx * (yp * yp) + ry * ry * (xp * xp)));\n if (fa === fs) {\n f *= -1;\n }\n if (isNaN(f)) {\n f = 0;\n }\n var cxp = (f * rx * yp) / ry;\n var cyp = (f * -ry * xp) / rx;\n var cx = (x1 + x2) / 2.0 + Math.cos(psi) * cxp - Math.sin(psi) * cyp;\n var cy = (y1 + y2) / 2.0 + Math.sin(psi) * cxp + Math.cos(psi) * cyp;\n var vMag = function (v) {\n return Math.sqrt(v[0] * v[0] + v[1] * v[1]);\n };\n var vRatio = function (u, v) {\n return (u[0] * v[0] + u[1] * v[1]) / (vMag(u) * vMag(v));\n };\n var vAngle = function (u, v) {\n return (u[0] * v[1] < u[1] * v[0] ? -1 : 1) * Math.acos(vRatio(u, v));\n };\n var theta = vAngle([1, 0], [(xp - cxp) / rx, (yp - cyp) / ry]);\n var u = [(xp - cxp) / rx, (yp - cyp) / ry];\n var v = [(-1 * xp - cxp) / rx, (-1 * yp - cyp) / ry];\n var dTheta = vAngle(u, v);\n if (vRatio(u, v) <= -1) {\n dTheta = Math.PI;\n }\n if (vRatio(u, v) >= 1) {\n dTheta = 0;\n }\n if (fs === 0 && dTheta > 0) {\n dTheta = dTheta - 2 * Math.PI;\n }\n if (fs === 1 && dTheta < 0) {\n dTheta = dTheta + 2 * Math.PI;\n }\n return [cx, cy, rx, ry, theta, dTheta, psi, fs];\n }\n}\nexports.Path = Path;\nPath.prototype.className = 'Path';\nPath.prototype._attrsAffectingSize = ['data'];\n(0, Global_1._registerNode)(Path);\nFactory_1.Factory.addGetterSetter(Path, 'data');\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Arrow = void 0;\nconst Factory_1 = require(\"../Factory\");\nconst Line_1 = require(\"./Line\");\nconst Validators_1 = require(\"../Validators\");\nconst Global_1 = require(\"../Global\");\nconst Path_1 = require(\"./Path\");\nclass Arrow extends Line_1.Line {\n _sceneFunc(ctx) {\n super._sceneFunc(ctx);\n var PI2 = Math.PI * 2;\n var points = this.points();\n var tp = points;\n var fromTension = this.tension() !== 0 && points.length > 4;\n if (fromTension) {\n tp = this.getTensionPoints();\n }\n var length = this.pointerLength();\n var n = points.length;\n var dx, dy;\n if (fromTension) {\n const lp = [\n tp[tp.length - 4],\n tp[tp.length - 3],\n tp[tp.length - 2],\n tp[tp.length - 1],\n points[n - 2],\n points[n - 1],\n ];\n const lastLength = Path_1.Path.calcLength(tp[tp.length - 4], tp[tp.length - 3], 'C', lp);\n const previous = Path_1.Path.getPointOnQuadraticBezier(Math.min(1, 1 - length / lastLength), lp[0], lp[1], lp[2], lp[3], lp[4], lp[5]);\n dx = points[n - 2] - previous.x;\n dy = points[n - 1] - previous.y;\n }\n else {\n dx = points[n - 2] - points[n - 4];\n dy = points[n - 1] - points[n - 3];\n }\n var radians = (Math.atan2(dy, dx) + PI2) % PI2;\n var width = this.pointerWidth();\n if (this.pointerAtEnding()) {\n ctx.save();\n ctx.beginPath();\n ctx.translate(points[n - 2], points[n - 1]);\n ctx.rotate(radians);\n ctx.moveTo(0, 0);\n ctx.lineTo(-length, width / 2);\n ctx.lineTo(-length, -width / 2);\n ctx.closePath();\n ctx.restore();\n this.__fillStroke(ctx);\n }\n if (this.pointerAtBeginning()) {\n ctx.save();\n ctx.beginPath();\n ctx.translate(points[0], points[1]);\n if (fromTension) {\n dx = (tp[0] + tp[2]) / 2 - points[0];\n dy = (tp[1] + tp[3]) / 2 - points[1];\n }\n else {\n dx = points[2] - points[0];\n dy = points[3] - points[1];\n }\n ctx.rotate((Math.atan2(-dy, -dx) + PI2) % PI2);\n ctx.moveTo(0, 0);\n ctx.lineTo(-length, width / 2);\n ctx.lineTo(-length, -width / 2);\n ctx.closePath();\n ctx.restore();\n this.__fillStroke(ctx);\n }\n }\n __fillStroke(ctx) {\n var isDashEnabled = this.dashEnabled();\n if (isDashEnabled) {\n this.attrs.dashEnabled = false;\n ctx.setLineDash([]);\n }\n ctx.fillStrokeShape(this);\n if (isDashEnabled) {\n this.attrs.dashEnabled = true;\n }\n }\n getSelfRect() {\n const lineRect = super.getSelfRect();\n const offset = this.pointerWidth() / 2;\n return {\n x: lineRect.x - offset,\n y: lineRect.y - offset,\n width: lineRect.width + offset * 2,\n height: lineRect.height + offset * 2,\n };\n }\n}\nexports.Arrow = Arrow;\nArrow.prototype.className = 'Arrow';\n(0, Global_1._registerNode)(Arrow);\nFactory_1.Factory.addGetterSetter(Arrow, 'pointerLength', 10, (0, Validators_1.getNumberValidator)());\nFactory_1.Factory.addGetterSetter(Arrow, 'pointerWidth', 10, (0, Validators_1.getNumberValidator)());\nFactory_1.Factory.addGetterSetter(Arrow, 'pointerAtBeginning', false);\nFactory_1.Factory.addGetterSetter(Arrow, 'pointerAtEnding', true);\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Circle = void 0;\nconst Factory_1 = require(\"../Factory\");\nconst Shape_1 = require(\"../Shape\");\nconst Validators_1 = require(\"../Validators\");\nconst Global_1 = require(\"../Global\");\nclass Circle extends Shape_1.Shape {\n _sceneFunc(context) {\n context.beginPath();\n context.arc(0, 0, this.attrs.radius || 0, 0, Math.PI * 2, false);\n context.closePath();\n context.fillStrokeShape(this);\n }\n getWidth() {\n return this.radius() * 2;\n }\n getHeight() {\n return this.radius() * 2;\n }\n setWidth(width) {\n if (this.radius() !== width / 2) {\n this.radius(width / 2);\n }\n }\n setHeight(height) {\n if (this.radius() !== height / 2) {\n this.radius(height / 2);\n }\n }\n}\nexports.Circle = Circle;\nCircle.prototype._centroid = true;\nCircle.prototype.className = 'Circle';\nCircle.prototype._attrsAffectingSize = ['radius'];\n(0, Global_1._registerNode)(Circle);\nFactory_1.Factory.addGetterSetter(Circle, 'radius', 0, (0, Validators_1.getNumberValidator)());\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Ellipse = void 0;\nconst Factory_1 = require(\"../Factory\");\nconst Shape_1 = require(\"../Shape\");\nconst Validators_1 = require(\"../Validators\");\nconst Global_1 = require(\"../Global\");\nclass Ellipse extends Shape_1.Shape {\n _sceneFunc(context) {\n var rx = this.radiusX(), ry = this.radiusY();\n context.beginPath();\n context.save();\n if (rx !== ry) {\n context.scale(1, ry / rx);\n }\n context.arc(0, 0, rx, 0, Math.PI * 2, false);\n context.restore();\n context.closePath();\n context.fillStrokeShape(this);\n }\n getWidth() {\n return this.radiusX() * 2;\n }\n getHeight() {\n return this.radiusY() * 2;\n }\n setWidth(width) {\n this.radiusX(width / 2);\n }\n setHeight(height) {\n this.radiusY(height / 2);\n }\n}\nexports.Ellipse = Ellipse;\nEllipse.prototype.className = 'Ellipse';\nEllipse.prototype._centroid = true;\nEllipse.prototype._attrsAffectingSize = ['radiusX', 'radiusY'];\n(0, Global_1._registerNode)(Ellipse);\nFactory_1.Factory.addComponentsGetterSetter(Ellipse, 'radius', ['x', 'y']);\nFactory_1.Factory.addGetterSetter(Ellipse, 'radiusX', 0, (0, Validators_1.getNumberValidator)());\nFactory_1.Factory.addGetterSetter(Ellipse, 'radiusY', 0, (0, Validators_1.getNumberValidator)());\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Image = void 0;\nconst Util_1 = require(\"../Util\");\nconst Factory_1 = require(\"../Factory\");\nconst Shape_1 = require(\"../Shape\");\nconst Global_1 = require(\"../Global\");\nconst Validators_1 = require(\"../Validators\");\nclass Image extends Shape_1.Shape {\n constructor(attrs) {\n super(attrs);\n this.on('imageChange.konva', () => {\n this._setImageLoad();\n });\n this._setImageLoad();\n }\n _setImageLoad() {\n const image = this.image();\n if (image && image.complete) {\n return;\n }\n if (image && image.readyState === 4) {\n return;\n }\n if (image && image['addEventListener']) {\n image['addEventListener']('load', () => {\n this._requestDraw();\n });\n }\n }\n _useBufferCanvas() {\n const hasCornerRadius = !!this.cornerRadius();\n const hasShadow = this.hasShadow();\n if (hasCornerRadius && hasShadow) {\n return true;\n }\n return super._useBufferCanvas(true);\n }\n _sceneFunc(context) {\n const width = this.getWidth();\n const height = this.getHeight();\n const cornerRadius = this.cornerRadius();\n const image = this.attrs.image;\n let params;\n if (image) {\n const cropWidth = this.attrs.cropWidth;\n const cropHeight = this.attrs.cropHeight;\n if (cropWidth && cropHeight) {\n params = [\n image,\n this.cropX(),\n this.cropY(),\n cropWidth,\n cropHeight,\n 0,\n 0,\n width,\n height,\n ];\n }\n else {\n params = [image, 0, 0, width, height];\n }\n }\n if (this.hasFill() || this.hasStroke() || cornerRadius) {\n context.beginPath();\n cornerRadius\n ? Util_1.Util.drawRoundedRectPath(context, width, height, cornerRadius)\n : context.rect(0, 0, width, height);\n context.closePath();\n context.fillStrokeShape(this);\n }\n if (image) {\n if (cornerRadius) {\n context.clip();\n }\n context.drawImage.apply(context, params);\n }\n }\n _hitFunc(context) {\n var width = this.width(), height = this.height(), cornerRadius = this.cornerRadius();\n context.beginPath();\n if (!cornerRadius) {\n context.rect(0, 0, width, height);\n }\n else {\n Util_1.Util.drawRoundedRectPath(context, width, height, cornerRadius);\n }\n context.closePath();\n context.fillStrokeShape(this);\n }\n getWidth() {\n var _a, _b;\n return (_a = this.attrs.width) !== null && _a !== void 0 ? _a : (_b = this.image()) === null || _b === void 0 ? void 0 : _b.width;\n }\n getHeight() {\n var _a, _b;\n return (_a = this.attrs.height) !== null && _a !== void 0 ? _a : (_b = this.image()) === null || _b === void 0 ? void 0 : _b.height;\n }\n static fromURL(url, callback, onError = null) {\n var img = Util_1.Util.createImageElement();\n img.onload = function () {\n var image = new Image({\n image: img,\n });\n callback(image);\n };\n img.onerror = onError;\n img.crossOrigin = 'Anonymous';\n img.src = url;\n }\n}\nexports.Image = Image;\nImage.prototype.className = 'Image';\n(0, Global_1._registerNode)(Image);\nFactory_1.Factory.addGetterSetter(Image, 'cornerRadius', 0, (0, Validators_1.getNumberOrArrayOfNumbersValidator)(4));\nFactory_1.Factory.addGetterSetter(Image, 'image');\nFactory_1.Factory.addComponentsGetterSetter(Image, 'crop', ['x', 'y', 'width', 'height']);\nFactory_1.Factory.addGetterSetter(Image, 'cropX', 0, (0, Validators_1.getNumberValidator)());\nFactory_1.Factory.addGetterSetter(Image, 'cropY', 0, (0, Validators_1.getNumberValidator)());\nFactory_1.Factory.addGetterSetter(Image, 'cropWidth', 0, (0, Validators_1.getNumberValidator)());\nFactory_1.Factory.addGetterSetter(Image, 'cropHeight', 0, (0, Validators_1.getNumberValidator)());\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Tag = exports.Label = void 0;\nconst Factory_1 = require(\"../Factory\");\nconst Shape_1 = require(\"../Shape\");\nconst Group_1 = require(\"../Group\");\nconst Validators_1 = require(\"../Validators\");\nconst Global_1 = require(\"../Global\");\nvar ATTR_CHANGE_LIST = [\n 'fontFamily',\n 'fontSize',\n 'fontStyle',\n 'padding',\n 'lineHeight',\n 'text',\n 'width',\n 'height',\n 'pointerDirection',\n 'pointerWidth',\n 'pointerHeight',\n], CHANGE_KONVA = 'Change.konva', NONE = 'none', UP = 'up', RIGHT = 'right', DOWN = 'down', LEFT = 'left', attrChangeListLen = ATTR_CHANGE_LIST.length;\nclass Label extends Group_1.Group {\n constructor(config) {\n super(config);\n this.on('add.konva', function (evt) {\n this._addListeners(evt.child);\n this._sync();\n });\n }\n getText() {\n return this.find('Text')[0];\n }\n getTag() {\n return this.find('Tag')[0];\n }\n _addListeners(text) {\n var that = this, n;\n var func = function () {\n that._sync();\n };\n for (n = 0; n < attrChangeListLen; n++) {\n text.on(ATTR_CHANGE_LIST[n] + CHANGE_KONVA, func);\n }\n }\n getWidth() {\n return this.getText().width();\n }\n getHeight() {\n return this.getText().height();\n }\n _sync() {\n var text = this.getText(), tag = this.getTag(), width, height, pointerDirection, pointerWidth, x, y, pointerHeight;\n if (text && tag) {\n width = text.width();\n height = text.height();\n pointerDirection = tag.pointerDirection();\n pointerWidth = tag.pointerWidth();\n pointerHeight = tag.pointerHeight();\n x = 0;\n y = 0;\n switch (pointerDirection) {\n case UP:\n x = width / 2;\n y = -1 * pointerHeight;\n break;\n case RIGHT:\n x = width + pointerWidth;\n y = height / 2;\n break;\n case DOWN:\n x = width / 2;\n y = height + pointerHeight;\n break;\n case LEFT:\n x = -1 * pointerWidth;\n y = height / 2;\n break;\n }\n tag.setAttrs({\n x: -1 * x,\n y: -1 * y,\n width: width,\n height: height,\n });\n text.setAttrs({\n x: -1 * x,\n y: -1 * y,\n });\n }\n }\n}\nexports.Label = Label;\nLabel.prototype.className = 'Label';\n(0, Global_1._registerNode)(Label);\nclass Tag extends Shape_1.Shape {\n _sceneFunc(context) {\n var width = this.width(), height = this.height(), pointerDirection = this.pointerDirection(), pointerWidth = this.pointerWidth(), pointerHeight = this.pointerHeight(), cornerRadius = this.cornerRadius();\n let topLeft = 0;\n let topRight = 0;\n let bottomLeft = 0;\n let bottomRight = 0;\n if (typeof cornerRadius === 'number') {\n topLeft =\n topRight =\n bottomLeft =\n bottomRight =\n Math.min(cornerRadius, width / 2, height / 2);\n }\n else {\n topLeft = Math.min(cornerRadius[0] || 0, width / 2, height / 2);\n topRight = Math.min(cornerRadius[1] || 0, width / 2, height / 2);\n bottomRight = Math.min(cornerRadius[2] || 0, width / 2, height / 2);\n bottomLeft = Math.min(cornerRadius[3] || 0, width / 2, height / 2);\n }\n context.beginPath();\n context.moveTo(topLeft, 0);\n if (pointerDirection === UP) {\n context.lineTo((width - pointerWidth) / 2, 0);\n context.lineTo(width / 2, -1 * pointerHeight);\n context.lineTo((width + pointerWidth) / 2, 0);\n }\n context.lineTo(width - topRight, 0);\n context.arc(width - topRight, topRight, topRight, (Math.PI * 3) / 2, 0, false);\n if (pointerDirection === RIGHT) {\n context.lineTo(width, (height - pointerHeight) / 2);\n context.lineTo(width + pointerWidth, height / 2);\n context.lineTo(width, (height + pointerHeight) / 2);\n }\n context.lineTo(width, height - bottomRight);\n context.arc(width - bottomRight, height - bottomRight, bottomRight, 0, Math.PI / 2, false);\n if (pointerDirection === DOWN) {\n context.lineTo((width + pointerWidth) / 2, height);\n context.lineTo(width / 2, height + pointerHeight);\n context.lineTo((width - pointerWidth) / 2, height);\n }\n context.lineTo(bottomLeft, height);\n context.arc(bottomLeft, height - bottomLeft, bottomLeft, Math.PI / 2, Math.PI, false);\n if (pointerDirection === LEFT) {\n context.lineTo(0, (height + pointerHeight) / 2);\n context.lineTo(-1 * pointerWidth, height / 2);\n context.lineTo(0, (height - pointerHeight) / 2);\n }\n context.lineTo(0, topLeft);\n context.arc(topLeft, topLeft, topLeft, Math.PI, (Math.PI * 3) / 2, false);\n context.closePath();\n context.fillStrokeShape(this);\n }\n getSelfRect() {\n var x = 0, y = 0, pointerWidth = this.pointerWidth(), pointerHeight = this.pointerHeight(), direction = this.pointerDirection(), width = this.width(), height = this.height();\n if (direction === UP) {\n y -= pointerHeight;\n height += pointerHeight;\n }\n else if (direction === DOWN) {\n height += pointerHeight;\n }\n else if (direction === LEFT) {\n x -= pointerWidth * 1.5;\n width += pointerWidth;\n }\n else if (direction === RIGHT) {\n width += pointerWidth * 1.5;\n }\n return {\n x: x,\n y: y,\n width: width,\n height: height,\n };\n }\n}\nexports.Tag = Tag;\nTag.prototype.className = 'Tag';\n(0, Global_1._registerNode)(Tag);\nFactory_1.Factory.addGetterSetter(Tag, 'pointerDirection', NONE);\nFactory_1.Factory.addGetterSetter(Tag, 'pointerWidth', 0, (0, Validators_1.getNumberValidator)());\nFactory_1.Factory.addGetterSetter(Tag, 'pointerHeight', 0, (0, Validators_1.getNumberValidator)());\nFactory_1.Factory.addGetterSetter(Tag, 'cornerRadius', 0, (0, Validators_1.getNumberOrArrayOfNumbersValidator)(4));\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Rect = void 0;\nconst Factory_1 = require(\"../Factory\");\nconst Shape_1 = require(\"../Shape\");\nconst Global_1 = require(\"../Global\");\nconst Util_1 = require(\"../Util\");\nconst Validators_1 = require(\"../Validators\");\nclass Rect extends Shape_1.Shape {\n _sceneFunc(context) {\n var cornerRadius = this.cornerRadius(), width = this.width(), height = this.height();\n context.beginPath();\n if (!cornerRadius) {\n context.rect(0, 0, width, height);\n }\n else {\n Util_1.Util.drawRoundedRectPath(context, width, height, cornerRadius);\n }\n context.closePath();\n context.fillStrokeShape(this);\n }\n}\nexports.Rect = Rect;\nRect.prototype.className = 'Rect';\n(0, Global_1._registerNode)(Rect);\nFactory_1.Factory.addGetterSetter(Rect, 'cornerRadius', 0, (0, Validators_1.getNumberOrArrayOfNumbersValidator)(4));\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.RegularPolygon = void 0;\nconst Factory_1 = require(\"../Factory\");\nconst Shape_1 = require(\"../Shape\");\nconst Validators_1 = require(\"../Validators\");\nconst Global_1 = require(\"../Global\");\nclass RegularPolygon extends Shape_1.Shape {\n _sceneFunc(context) {\n const points = this._getPoints();\n context.beginPath();\n context.moveTo(points[0].x, points[0].y);\n for (var n = 1; n < points.length; n++) {\n context.lineTo(points[n].x, points[n].y);\n }\n context.closePath();\n context.fillStrokeShape(this);\n }\n _getPoints() {\n const sides = this.attrs.sides;\n const radius = this.attrs.radius || 0;\n const points = [];\n for (var n = 0; n < sides; n++) {\n points.push({\n x: radius * Math.sin((n * 2 * Math.PI) / sides),\n y: -1 * radius * Math.cos((n * 2 * Math.PI) / sides),\n });\n }\n return points;\n }\n getSelfRect() {\n const points = this._getPoints();\n var minX = points[0].x;\n var maxX = points[0].y;\n var minY = points[0].x;\n var maxY = points[0].y;\n points.forEach((point) => {\n minX = Math.min(minX, point.x);\n maxX = Math.max(maxX, point.x);\n minY = Math.min(minY, point.y);\n maxY = Math.max(maxY, point.y);\n });\n return {\n x: minX,\n y: minY,\n width: maxX - minX,\n height: maxY - minY,\n };\n }\n getWidth() {\n return this.radius() * 2;\n }\n getHeight() {\n return this.radius() * 2;\n }\n setWidth(width) {\n this.radius(width / 2);\n }\n setHeight(height) {\n this.radius(height / 2);\n }\n}\nexports.RegularPolygon = RegularPolygon;\nRegularPolygon.prototype.className = 'RegularPolygon';\nRegularPolygon.prototype._centroid = true;\nRegularPolygon.prototype._attrsAffectingSize = ['radius'];\n(0, Global_1._registerNode)(RegularPolygon);\nFactory_1.Factory.addGetterSetter(RegularPolygon, 'radius', 0, (0, Validators_1.getNumberValidator)());\nFactory_1.Factory.addGetterSetter(RegularPolygon, 'sides', 0, (0, Validators_1.getNumberValidator)());\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Ring = void 0;\nconst Factory_1 = require(\"../Factory\");\nconst Shape_1 = require(\"../Shape\");\nconst Validators_1 = require(\"../Validators\");\nconst Global_1 = require(\"../Global\");\nvar PIx2 = Math.PI * 2;\nclass Ring extends Shape_1.Shape {\n _sceneFunc(context) {\n context.beginPath();\n context.arc(0, 0, this.innerRadius(), 0, PIx2, false);\n context.moveTo(this.outerRadius(), 0);\n context.arc(0, 0, this.outerRadius(), PIx2, 0, true);\n context.closePath();\n context.fillStrokeShape(this);\n }\n getWidth() {\n return this.outerRadius() * 2;\n }\n getHeight() {\n return this.outerRadius() * 2;\n }\n setWidth(width) {\n this.outerRadius(width / 2);\n }\n setHeight(height) {\n this.outerRadius(height / 2);\n }\n}\nexports.Ring = Ring;\nRing.prototype.className = 'Ring';\nRing.prototype._centroid = true;\nRing.prototype._attrsAffectingSize = ['innerRadius', 'outerRadius'];\n(0, Global_1._registerNode)(Ring);\nFactory_1.Factory.addGetterSetter(Ring, 'innerRadius', 0, (0, Validators_1.getNumberValidator)());\nFactory_1.Factory.addGetterSetter(Ring, 'outerRadius', 0, (0, Validators_1.getNumberValidator)());\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Sprite = void 0;\nconst Factory_1 = require(\"../Factory\");\nconst Shape_1 = require(\"../Shape\");\nconst Animation_1 = require(\"../Animation\");\nconst Validators_1 = require(\"../Validators\");\nconst Global_1 = require(\"../Global\");\nclass Sprite extends Shape_1.Shape {\n constructor(config) {\n super(config);\n this._updated = true;\n this.anim = new Animation_1.Animation(() => {\n var updated = this._updated;\n this._updated = false;\n return updated;\n });\n this.on('animationChange.konva', function () {\n this.frameIndex(0);\n });\n this.on('frameIndexChange.konva', function () {\n this._updated = true;\n });\n this.on('frameRateChange.konva', function () {\n if (!this.anim.isRunning()) {\n return;\n }\n clearInterval(this.interval);\n this._setInterval();\n });\n }\n _sceneFunc(context) {\n var anim = this.animation(), index = this.frameIndex(), ix4 = index * 4, set = this.animations()[anim], offsets = this.frameOffsets(), x = set[ix4 + 0], y = set[ix4 + 1], width = set[ix4 + 2], height = set[ix4 + 3], image = this.image();\n if (this.hasFill() || this.hasStroke()) {\n context.beginPath();\n context.rect(0, 0, width, height);\n context.closePath();\n context.fillStrokeShape(this);\n }\n if (image) {\n if (offsets) {\n var offset = offsets[anim], ix2 = index * 2;\n context.drawImage(image, x, y, width, height, offset[ix2 + 0], offset[ix2 + 1], width, height);\n }\n else {\n context.drawImage(image, x, y, width, height, 0, 0, width, height);\n }\n }\n }\n _hitFunc(context) {\n var anim = this.animation(), index = this.frameIndex(), ix4 = index * 4, set = this.animations()[anim], offsets = this.frameOffsets(), width = set[ix4 + 2], height = set[ix4 + 3];\n context.beginPath();\n if (offsets) {\n var offset = offsets[anim];\n var ix2 = index * 2;\n context.rect(offset[ix2 + 0], offset[ix2 + 1], width, height);\n }\n else {\n context.rect(0, 0, width, height);\n }\n context.closePath();\n context.fillShape(this);\n }\n _useBufferCanvas() {\n return super._useBufferCanvas(true);\n }\n _setInterval() {\n var that = this;\n this.interval = setInterval(function () {\n that._updateIndex();\n }, 1000 / this.frameRate());\n }\n start() {\n if (this.isRunning()) {\n return;\n }\n var layer = this.getLayer();\n this.anim.setLayers(layer);\n this._setInterval();\n this.anim.start();\n }\n stop() {\n this.anim.stop();\n clearInterval(this.interval);\n }\n isRunning() {\n return this.anim.isRunning();\n }\n _updateIndex() {\n var index = this.frameIndex(), animation = this.animation(), animations = this.animations(), anim = animations[animation], len = anim.length / 4;\n if (index < len - 1) {\n this.frameIndex(index + 1);\n }\n else {\n this.frameIndex(0);\n }\n }\n}\nexports.Sprite = Sprite;\nSprite.prototype.className = 'Sprite';\n(0, Global_1._registerNode)(Sprite);\nFactory_1.Factory.addGetterSetter(Sprite, 'animation');\nFactory_1.Factory.addGetterSetter(Sprite, 'animations');\nFactory_1.Factory.addGetterSetter(Sprite, 'frameOffsets');\nFactory_1.Factory.addGetterSetter(Sprite, 'image');\nFactory_1.Factory.addGetterSetter(Sprite, 'frameIndex', 0, (0, Validators_1.getNumberValidator)());\nFactory_1.Factory.addGetterSetter(Sprite, 'frameRate', 17, (0, Validators_1.getNumberValidator)());\nFactory_1.Factory.backCompat(Sprite, {\n index: 'frameIndex',\n getIndex: 'getFrameIndex',\n setIndex: 'setFrameIndex',\n});\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Star = void 0;\nconst Factory_1 = require(\"../Factory\");\nconst Shape_1 = require(\"../Shape\");\nconst Validators_1 = require(\"../Validators\");\nconst Global_1 = require(\"../Global\");\nclass Star extends Shape_1.Shape {\n _sceneFunc(context) {\n var innerRadius = this.innerRadius(), outerRadius = this.outerRadius(), numPoints = this.numPoints();\n context.beginPath();\n context.moveTo(0, 0 - outerRadius);\n for (var n = 1; n < numPoints * 2; n++) {\n var radius = n % 2 === 0 ? outerRadius : innerRadius;\n var x = radius * Math.sin((n * Math.PI) / numPoints);\n var y = -1 * radius * Math.cos((n * Math.PI) / numPoints);\n context.lineTo(x, y);\n }\n context.closePath();\n context.fillStrokeShape(this);\n }\n getWidth() {\n return this.outerRadius() * 2;\n }\n getHeight() {\n return this.outerRadius() * 2;\n }\n setWidth(width) {\n this.outerRadius(width / 2);\n }\n setHeight(height) {\n this.outerRadius(height / 2);\n }\n}\nexports.Star = Star;\nStar.prototype.className = 'Star';\nStar.prototype._centroid = true;\nStar.prototype._attrsAffectingSize = ['innerRadius', 'outerRadius'];\n(0, Global_1._registerNode)(Star);\nFactory_1.Factory.addGetterSetter(Star, 'numPoints', 5, (0, Validators_1.getNumberValidator)());\nFactory_1.Factory.addGetterSetter(Star, 'innerRadius', 0, (0, Validators_1.getNumberValidator)());\nFactory_1.Factory.addGetterSetter(Star, 'outerRadius', 0, (0, Validators_1.getNumberValidator)());\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Text = exports.stringToArray = void 0;\nconst Util_1 = require(\"../Util\");\nconst Factory_1 = require(\"../Factory\");\nconst Shape_1 = require(\"../Shape\");\nconst Global_1 = require(\"../Global\");\nconst Validators_1 = require(\"../Validators\");\nconst Global_2 = require(\"../Global\");\nfunction stringToArray(string) {\n return [...string].reduce((acc, char, index, array) => {\n if (/\\p{Emoji_Modifier_Base}\\p{Emoji_Modifier}?(?:\\u200D\\p{Emoji_Presentation})+/u.test(char)) {\n acc.push(char);\n }\n else if (/\\p{Regional_Indicator}{2}/u.test(char + (array[index + 1] || ''))) {\n acc.push(char + array[index + 1]);\n }\n else if (index > 0 && /\\p{Mn}|\\p{Me}|\\p{Mc}/u.test(char)) {\n acc[acc.length - 1] += char;\n }\n else {\n acc.push(char);\n }\n return acc;\n }, []);\n}\nexports.stringToArray = stringToArray;\nvar AUTO = 'auto', CENTER = 'center', INHERIT = 'inherit', JUSTIFY = 'justify', CHANGE_KONVA = 'Change.konva', CONTEXT_2D = '2d', DASH = '-', LEFT = 'left', LTR = 'ltr', TEXT = 'text', TEXT_UPPER = 'Text', TOP = 'top', BOTTOM = 'bottom', MIDDLE = 'middle', NORMAL = 'normal', PX_SPACE = 'px ', SPACE = ' ', RIGHT = 'right', RTL = 'rtl', WORD = 'word', CHAR = 'char', NONE = 'none', ELLIPSIS = '…', ATTR_CHANGE_LIST = [\n 'direction',\n 'fontFamily',\n 'fontSize',\n 'fontStyle',\n 'fontVariant',\n 'padding',\n 'align',\n 'verticalAlign',\n 'lineHeight',\n 'text',\n 'width',\n 'height',\n 'wrap',\n 'ellipsis',\n 'letterSpacing',\n], attrChangeListLen = ATTR_CHANGE_LIST.length;\nfunction normalizeFontFamily(fontFamily) {\n return fontFamily\n .split(',')\n .map((family) => {\n family = family.trim();\n const hasSpace = family.indexOf(' ') >= 0;\n const hasQuotes = family.indexOf('\"') >= 0 || family.indexOf(\"'\") >= 0;\n if (hasSpace && !hasQuotes) {\n family = `\"${family}\"`;\n }\n return family;\n })\n .join(', ');\n}\nvar dummyContext;\nfunction getDummyContext() {\n if (dummyContext) {\n return dummyContext;\n }\n dummyContext = Util_1.Util.createCanvasElement().getContext(CONTEXT_2D);\n return dummyContext;\n}\nfunction _fillFunc(context) {\n context.fillText(this._partialText, this._partialTextX, this._partialTextY);\n}\nfunction _strokeFunc(context) {\n context.setAttr('miterLimit', 2);\n context.strokeText(this._partialText, this._partialTextX, this._partialTextY);\n}\nfunction checkDefaultFill(config) {\n config = config || {};\n if (!config.fillLinearGradientColorStops &&\n !config.fillRadialGradientColorStops &&\n !config.fillPatternImage) {\n config.fill = config.fill || 'black';\n }\n return config;\n}\nclass Text extends Shape_1.Shape {\n constructor(config) {\n super(checkDefaultFill(config));\n this._partialTextX = 0;\n this._partialTextY = 0;\n for (var n = 0; n < attrChangeListLen; n++) {\n this.on(ATTR_CHANGE_LIST[n] + CHANGE_KONVA, this._setTextData);\n }\n this._setTextData();\n }\n _sceneFunc(context) {\n var textArr = this.textArr, textArrLen = textArr.length;\n if (!this.text()) {\n return;\n }\n var padding = this.padding(), fontSize = this.fontSize(), lineHeightPx = this.lineHeight() * fontSize, verticalAlign = this.verticalAlign(), direction = this.direction(), alignY = 0, align = this.align(), totalWidth = this.getWidth(), letterSpacing = this.letterSpacing(), fill = this.fill(), textDecoration = this.textDecoration(), shouldUnderline = textDecoration.indexOf('underline') !== -1, shouldLineThrough = textDecoration.indexOf('line-through') !== -1, n;\n direction = direction === INHERIT ? context.direction : direction;\n var translateY = lineHeightPx / 2;\n var baseline = MIDDLE;\n if (Global_1.Konva._fixTextRendering) {\n var metrics = this.measureSize('M');\n baseline = 'alphabetic';\n translateY =\n (metrics.fontBoundingBoxAscent - metrics.fontBoundingBoxDescent) / 2 +\n lineHeightPx / 2;\n }\n var lineTranslateX = 0;\n var lineTranslateY = 0;\n if (direction === RTL) {\n context.setAttr('direction', direction);\n }\n context.setAttr('font', this._getContextFont());\n context.setAttr('textBaseline', baseline);\n context.setAttr('textAlign', LEFT);\n if (verticalAlign === MIDDLE) {\n alignY = (this.getHeight() - textArrLen * lineHeightPx - padding * 2) / 2;\n }\n else if (verticalAlign === BOTTOM) {\n alignY = this.getHeight() - textArrLen * lineHeightPx - padding * 2;\n }\n context.translate(padding, alignY + padding);\n for (n = 0; n < textArrLen; n++) {\n var lineTranslateX = 0;\n var lineTranslateY = 0;\n var obj = textArr[n], text = obj.text, width = obj.width, lastLine = obj.lastInParagraph, spacesNumber, oneWord, lineWidth;\n context.save();\n if (align === RIGHT) {\n lineTranslateX += totalWidth - width - padding * 2;\n }\n else if (align === CENTER) {\n lineTranslateX += (totalWidth - width - padding * 2) / 2;\n }\n if (shouldUnderline) {\n context.save();\n context.beginPath();\n let yOffset = Global_1.Konva._fixTextRendering\n ? Math.round(fontSize / 4)\n : Math.round(fontSize / 2);\n const x = lineTranslateX;\n const y = translateY + lineTranslateY + yOffset;\n context.moveTo(x, y);\n spacesNumber = text.split(' ').length - 1;\n oneWord = spacesNumber === 0;\n lineWidth =\n align === JUSTIFY && !lastLine ? totalWidth - padding * 2 : width;\n context.lineTo(x + Math.round(lineWidth), y);\n context.lineWidth = fontSize / 15;\n const gradient = this._getLinearGradient();\n context.strokeStyle = gradient || fill;\n context.stroke();\n context.restore();\n }\n if (shouldLineThrough) {\n context.save();\n context.beginPath();\n let yOffset = Global_1.Konva._fixTextRendering ? -Math.round(fontSize / 4) : 0;\n context.moveTo(lineTranslateX, translateY + lineTranslateY + yOffset);\n spacesNumber = text.split(' ').length - 1;\n oneWord = spacesNumber === 0;\n lineWidth =\n align === JUSTIFY && lastLine && !oneWord\n ? totalWidth - padding * 2\n : width;\n context.lineTo(lineTranslateX + Math.round(lineWidth), translateY + lineTranslateY + yOffset);\n context.lineWidth = fontSize / 15;\n const gradient = this._getLinearGradient();\n context.strokeStyle = gradient || fill;\n context.stroke();\n context.restore();\n }\n if (direction !== RTL && (letterSpacing !== 0 || align === JUSTIFY)) {\n spacesNumber = text.split(' ').length - 1;\n var array = stringToArray(text);\n for (var li = 0; li < array.length; li++) {\n var letter = array[li];\n if (letter === ' ' && !lastLine && align === JUSTIFY) {\n lineTranslateX += (totalWidth - padding * 2 - width) / spacesNumber;\n }\n this._partialTextX = lineTranslateX;\n this._partialTextY = translateY + lineTranslateY;\n this._partialText = letter;\n context.fillStrokeShape(this);\n lineTranslateX += this.measureSize(letter).width + letterSpacing;\n }\n }\n else {\n if (letterSpacing !== 0) {\n context.setAttr('letterSpacing', `${letterSpacing}px`);\n }\n this._partialTextX = lineTranslateX;\n this._partialTextY = translateY + lineTranslateY;\n this._partialText = text;\n context.fillStrokeShape(this);\n }\n context.restore();\n if (textArrLen > 1) {\n translateY += lineHeightPx;\n }\n }\n }\n _hitFunc(context) {\n var width = this.getWidth(), height = this.getHeight();\n context.beginPath();\n context.rect(0, 0, width, height);\n context.closePath();\n context.fillStrokeShape(this);\n }\n setText(text) {\n var str = Util_1.Util._isString(text)\n ? text\n : text === null || text === undefined\n ? ''\n : text + '';\n this._setAttr(TEXT, str);\n return this;\n }\n getWidth() {\n var isAuto = this.attrs.width === AUTO || this.attrs.width === undefined;\n return isAuto ? this.getTextWidth() + this.padding() * 2 : this.attrs.width;\n }\n getHeight() {\n var isAuto = this.attrs.height === AUTO || this.attrs.height === undefined;\n return isAuto\n ? this.fontSize() * this.textArr.length * this.lineHeight() +\n this.padding() * 2\n : this.attrs.height;\n }\n getTextWidth() {\n return this.textWidth;\n }\n getTextHeight() {\n Util_1.Util.warn('text.getTextHeight() method is deprecated. Use text.height() - for full height and text.fontSize() - for one line height.');\n return this.textHeight;\n }\n measureSize(text) {\n var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;\n var _context = getDummyContext(), fontSize = this.fontSize(), metrics;\n _context.save();\n _context.font = this._getContextFont();\n metrics = _context.measureText(text);\n _context.restore();\n const scaleFactor = fontSize / 100;\n return {\n actualBoundingBoxAscent: (_a = metrics.actualBoundingBoxAscent) !== null && _a !== void 0 ? _a : 71.58203125 * scaleFactor,\n actualBoundingBoxDescent: (_b = metrics.actualBoundingBoxDescent) !== null && _b !== void 0 ? _b : 0,\n actualBoundingBoxLeft: (_c = metrics.actualBoundingBoxLeft) !== null && _c !== void 0 ? _c : -7.421875 * scaleFactor,\n actualBoundingBoxRight: (_d = metrics.actualBoundingBoxRight) !== null && _d !== void 0 ? _d : 75.732421875 * scaleFactor,\n alphabeticBaseline: (_e = metrics.alphabeticBaseline) !== null && _e !== void 0 ? _e : 0,\n emHeightAscent: (_f = metrics.emHeightAscent) !== null && _f !== void 0 ? _f : 100 * scaleFactor,\n emHeightDescent: (_g = metrics.emHeightDescent) !== null && _g !== void 0 ? _g : -20 * scaleFactor,\n fontBoundingBoxAscent: (_h = metrics.fontBoundingBoxAscent) !== null && _h !== void 0 ? _h : 91 * scaleFactor,\n fontBoundingBoxDescent: (_j = metrics.fontBoundingBoxDescent) !== null && _j !== void 0 ? _j : 21 * scaleFactor,\n hangingBaseline: (_k = metrics.hangingBaseline) !== null && _k !== void 0 ? _k : 72.80000305175781 * scaleFactor,\n ideographicBaseline: (_l = metrics.ideographicBaseline) !== null && _l !== void 0 ? _l : -21 * scaleFactor,\n width: metrics.width,\n height: fontSize,\n };\n }\n _getContextFont() {\n return (this.fontStyle() +\n SPACE +\n this.fontVariant() +\n SPACE +\n (this.fontSize() + PX_SPACE) +\n normalizeFontFamily(this.fontFamily()));\n }\n _addTextLine(line) {\n const align = this.align();\n if (align === JUSTIFY) {\n line = line.trim();\n }\n var width = this._getTextWidth(line);\n return this.textArr.push({\n text: line,\n width: width,\n lastInParagraph: false,\n });\n }\n _getTextWidth(text) {\n var letterSpacing = this.letterSpacing();\n var length = text.length;\n return (getDummyContext().measureText(text).width +\n (length ? letterSpacing * (length - 1) : 0));\n }\n _setTextData() {\n var lines = this.text().split('\\n'), fontSize = +this.fontSize(), textWidth = 0, lineHeightPx = this.lineHeight() * fontSize, width = this.attrs.width, height = this.attrs.height, fixedWidth = width !== AUTO && width !== undefined, fixedHeight = height !== AUTO && height !== undefined, padding = this.padding(), maxWidth = width - padding * 2, maxHeightPx = height - padding * 2, currentHeightPx = 0, wrap = this.wrap(), shouldWrap = wrap !== NONE, wrapAtWord = wrap !== CHAR && shouldWrap, shouldAddEllipsis = this.ellipsis();\n this.textArr = [];\n getDummyContext().font = this._getContextFont();\n var additionalWidth = shouldAddEllipsis ? this._getTextWidth(ELLIPSIS) : 0;\n for (var i = 0, max = lines.length; i < max; ++i) {\n var line = lines[i];\n var lineWidth = this._getTextWidth(line);\n if (fixedWidth && lineWidth > maxWidth) {\n while (line.length > 0) {\n var low = 0, high = line.length, match = '', matchWidth = 0;\n while (low < high) {\n var mid = (low + high) >>> 1, substr = line.slice(0, mid + 1), substrWidth = this._getTextWidth(substr) + additionalWidth;\n if (substrWidth <= maxWidth) {\n low = mid + 1;\n match = substr;\n matchWidth = substrWidth;\n }\n else {\n high = mid;\n }\n }\n if (match) {\n if (wrapAtWord) {\n var wrapIndex;\n var nextChar = line[match.length];\n var nextIsSpaceOrDash = nextChar === SPACE || nextChar === DASH;\n if (nextIsSpaceOrDash && matchWidth <= maxWidth) {\n wrapIndex = match.length;\n }\n else {\n wrapIndex =\n Math.max(match.lastIndexOf(SPACE), match.lastIndexOf(DASH)) +\n 1;\n }\n if (wrapIndex > 0) {\n low = wrapIndex;\n match = match.slice(0, low);\n matchWidth = this._getTextWidth(match);\n }\n }\n match = match.trimRight();\n this._addTextLine(match);\n textWidth = Math.max(textWidth, matchWidth);\n currentHeightPx += lineHeightPx;\n var shouldHandleEllipsis = this._shouldHandleEllipsis(currentHeightPx);\n if (shouldHandleEllipsis) {\n this._tryToAddEllipsisToLastLine();\n break;\n }\n line = line.slice(low);\n line = line.trimLeft();\n if (line.length > 0) {\n lineWidth = this._getTextWidth(line);\n if (lineWidth <= maxWidth) {\n this._addTextLine(line);\n currentHeightPx += lineHeightPx;\n textWidth = Math.max(textWidth, lineWidth);\n break;\n }\n }\n }\n else {\n break;\n }\n }\n }\n else {\n this._addTextLine(line);\n currentHeightPx += lineHeightPx;\n textWidth = Math.max(textWidth, lineWidth);\n if (this._shouldHandleEllipsis(currentHeightPx) && i < max - 1) {\n this._tryToAddEllipsisToLastLine();\n }\n }\n if (this.textArr[this.textArr.length - 1]) {\n this.textArr[this.textArr.length - 1].lastInParagraph = true;\n }\n if (fixedHeight && currentHeightPx + lineHeightPx > maxHeightPx) {\n break;\n }\n }\n this.textHeight = fontSize;\n this.textWidth = textWidth;\n }\n _shouldHandleEllipsis(currentHeightPx) {\n var fontSize = +this.fontSize(), lineHeightPx = this.lineHeight() * fontSize, height = this.attrs.height, fixedHeight = height !== AUTO && height !== undefined, padding = this.padding(), maxHeightPx = height - padding * 2, wrap = this.wrap(), shouldWrap = wrap !== NONE;\n return (!shouldWrap ||\n (fixedHeight && currentHeightPx + lineHeightPx > maxHeightPx));\n }\n _tryToAddEllipsisToLastLine() {\n var width = this.attrs.width, fixedWidth = width !== AUTO && width !== undefined, padding = this.padding(), maxWidth = width - padding * 2, shouldAddEllipsis = this.ellipsis();\n var lastLine = this.textArr[this.textArr.length - 1];\n if (!lastLine || !shouldAddEllipsis) {\n return;\n }\n if (fixedWidth) {\n var haveSpace = this._getTextWidth(lastLine.text + ELLIPSIS) < maxWidth;\n if (!haveSpace) {\n lastLine.text = lastLine.text.slice(0, lastLine.text.length - 3);\n }\n }\n this.textArr.splice(this.textArr.length - 1, 1);\n this._addTextLine(lastLine.text + ELLIPSIS);\n }\n getStrokeScaleEnabled() {\n return true;\n }\n _useBufferCanvas() {\n const hasLine = this.textDecoration().indexOf('underline') !== -1 ||\n this.textDecoration().indexOf('line-through') !== -1;\n const hasShadow = this.hasShadow();\n if (hasLine && hasShadow) {\n return true;\n }\n return super._useBufferCanvas();\n }\n}\nexports.Text = Text;\nText.prototype._fillFunc = _fillFunc;\nText.prototype._strokeFunc = _strokeFunc;\nText.prototype.className = TEXT_UPPER;\nText.prototype._attrsAffectingSize = [\n 'text',\n 'fontSize',\n 'padding',\n 'wrap',\n 'lineHeight',\n 'letterSpacing',\n];\n(0, Global_2._registerNode)(Text);\nFactory_1.Factory.overWriteSetter(Text, 'width', (0, Validators_1.getNumberOrAutoValidator)());\nFactory_1.Factory.overWriteSetter(Text, 'height', (0, Validators_1.getNumberOrAutoValidator)());\nFactory_1.Factory.addGetterSetter(Text, 'direction', INHERIT);\nFactory_1.Factory.addGetterSetter(Text, 'fontFamily', 'Arial');\nFactory_1.Factory.addGetterSetter(Text, 'fontSize', 12, (0, Validators_1.getNumberValidator)());\nFactory_1.Factory.addGetterSetter(Text, 'fontStyle', NORMAL);\nFactory_1.Factory.addGetterSetter(Text, 'fontVariant', NORMAL);\nFactory_1.Factory.addGetterSetter(Text, 'padding', 0, (0, Validators_1.getNumberValidator)());\nFactory_1.Factory.addGetterSetter(Text, 'align', LEFT);\nFactory_1.Factory.addGetterSetter(Text, 'verticalAlign', TOP);\nFactory_1.Factory.addGetterSetter(Text, 'lineHeight', 1, (0, Validators_1.getNumberValidator)());\nFactory_1.Factory.addGetterSetter(Text, 'wrap', WORD);\nFactory_1.Factory.addGetterSetter(Text, 'ellipsis', false, (0, Validators_1.getBooleanValidator)());\nFactory_1.Factory.addGetterSetter(Text, 'letterSpacing', 0, (0, Validators_1.getNumberValidator)());\nFactory_1.Factory.addGetterSetter(Text, 'text', '', (0, Validators_1.getStringValidator)());\nFactory_1.Factory.addGetterSetter(Text, 'textDecoration', '');\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.TextPath = void 0;\nconst Util_1 = require(\"../Util\");\nconst Factory_1 = require(\"../Factory\");\nconst Shape_1 = require(\"../Shape\");\nconst Path_1 = require(\"./Path\");\nconst Text_1 = require(\"./Text\");\nconst Validators_1 = require(\"../Validators\");\nconst Global_1 = require(\"../Global\");\nvar EMPTY_STRING = '', NORMAL = 'normal';\nfunction _fillFunc(context) {\n context.fillText(this.partialText, 0, 0);\n}\nfunction _strokeFunc(context) {\n context.strokeText(this.partialText, 0, 0);\n}\nclass TextPath extends Shape_1.Shape {\n constructor(config) {\n super(config);\n this.dummyCanvas = Util_1.Util.createCanvasElement();\n this.dataArray = [];\n this._readDataAttribute();\n this.on('dataChange.konva', function () {\n this._readDataAttribute();\n this._setTextData();\n });\n this.on('textChange.konva alignChange.konva letterSpacingChange.konva kerningFuncChange.konva fontSizeChange.konva fontFamilyChange.konva', this._setTextData);\n this._setTextData();\n }\n _getTextPathLength() {\n return Path_1.Path.getPathLength(this.dataArray);\n }\n _getPointAtLength(length) {\n if (!this.attrs.data) {\n return null;\n }\n const totalLength = this.pathLength;\n if (length - 1 > totalLength) {\n return null;\n }\n return Path_1.Path.getPointAtLengthOfDataArray(length, this.dataArray);\n }\n _readDataAttribute() {\n this.dataArray = Path_1.Path.parsePathData(this.attrs.data);\n this.pathLength = this._getTextPathLength();\n }\n _sceneFunc(context) {\n context.setAttr('font', this._getContextFont());\n context.setAttr('textBaseline', this.textBaseline());\n context.setAttr('textAlign', 'left');\n context.save();\n var textDecoration = this.textDecoration();\n var fill = this.fill();\n var fontSize = this.fontSize();\n var glyphInfo = this.glyphInfo;\n if (textDecoration === 'underline') {\n context.beginPath();\n }\n for (var i = 0; i < glyphInfo.length; i++) {\n context.save();\n var p0 = glyphInfo[i].p0;\n context.translate(p0.x, p0.y);\n context.rotate(glyphInfo[i].rotation);\n this.partialText = glyphInfo[i].text;\n context.fillStrokeShape(this);\n if (textDecoration === 'underline') {\n if (i === 0) {\n context.moveTo(0, fontSize / 2 + 1);\n }\n context.lineTo(fontSize, fontSize / 2 + 1);\n }\n context.restore();\n }\n if (textDecoration === 'underline') {\n context.strokeStyle = fill;\n context.lineWidth = fontSize / 20;\n context.stroke();\n }\n context.restore();\n }\n _hitFunc(context) {\n context.beginPath();\n var glyphInfo = this.glyphInfo;\n if (glyphInfo.length >= 1) {\n var p0 = glyphInfo[0].p0;\n context.moveTo(p0.x, p0.y);\n }\n for (var i = 0; i < glyphInfo.length; i++) {\n var p1 = glyphInfo[i].p1;\n context.lineTo(p1.x, p1.y);\n }\n context.setAttr('lineWidth', this.fontSize());\n context.setAttr('strokeStyle', this.colorKey);\n context.stroke();\n }\n getTextWidth() {\n return this.textWidth;\n }\n getTextHeight() {\n Util_1.Util.warn('text.getTextHeight() method is deprecated. Use text.height() - for full height and text.fontSize() - for one line height.');\n return this.textHeight;\n }\n setText(text) {\n return Text_1.Text.prototype.setText.call(this, text);\n }\n _getContextFont() {\n return Text_1.Text.prototype._getContextFont.call(this);\n }\n _getTextSize(text) {\n var dummyCanvas = this.dummyCanvas;\n var _context = dummyCanvas.getContext('2d');\n _context.save();\n _context.font = this._getContextFont();\n var metrics = _context.measureText(text);\n _context.restore();\n return {\n width: metrics.width,\n height: parseInt(`${this.fontSize()}`, 10),\n };\n }\n _setTextData() {\n const { width, height } = this._getTextSize(this.attrs.text);\n this.textWidth = width;\n this.textHeight = height;\n this.glyphInfo = [];\n if (!this.attrs.data) {\n return null;\n }\n const letterSpacing = this.letterSpacing();\n const align = this.align();\n const kerningFunc = this.kerningFunc();\n const textWidth = Math.max(this.textWidth + ((this.attrs.text || '').length - 1) * letterSpacing, 0);\n let offset = 0;\n if (align === 'center') {\n offset = Math.max(0, this.pathLength / 2 - textWidth / 2);\n }\n if (align === 'right') {\n offset = Math.max(0, this.pathLength - textWidth);\n }\n const charArr = (0, Text_1.stringToArray)(this.text());\n let offsetToGlyph = offset;\n for (var i = 0; i < charArr.length; i++) {\n const charStartPoint = this._getPointAtLength(offsetToGlyph);\n if (!charStartPoint)\n return;\n let glyphWidth = this._getTextSize(charArr[i]).width + letterSpacing;\n if (charArr[i] === ' ' && align === 'justify') {\n const numberOfSpaces = this.text().split(' ').length - 1;\n glyphWidth += (this.pathLength - textWidth) / numberOfSpaces;\n }\n const charEndPoint = this._getPointAtLength(offsetToGlyph + glyphWidth);\n if (!charEndPoint)\n return;\n const width = Path_1.Path.getLineLength(charStartPoint.x, charStartPoint.y, charEndPoint.x, charEndPoint.y);\n let kern = 0;\n if (kerningFunc) {\n try {\n kern = kerningFunc(charArr[i - 1], charArr[i]) * this.fontSize();\n }\n catch (e) {\n kern = 0;\n }\n }\n charStartPoint.x += kern;\n charEndPoint.x += kern;\n this.textWidth += kern;\n const midpoint = Path_1.Path.getPointOnLine(kern + width / 2.0, charStartPoint.x, charStartPoint.y, charEndPoint.x, charEndPoint.y);\n const rotation = Math.atan2(charEndPoint.y - charStartPoint.y, charEndPoint.x - charStartPoint.x);\n this.glyphInfo.push({\n transposeX: midpoint.x,\n transposeY: midpoint.y,\n text: charArr[i],\n rotation: rotation,\n p0: charStartPoint,\n p1: charEndPoint,\n });\n offsetToGlyph += glyphWidth;\n }\n }\n getSelfRect() {\n if (!this.glyphInfo.length) {\n return {\n x: 0,\n y: 0,\n width: 0,\n height: 0,\n };\n }\n var points = [];\n this.glyphInfo.forEach(function (info) {\n points.push(info.p0.x);\n points.push(info.p0.y);\n points.push(info.p1.x);\n points.push(info.p1.y);\n });\n var minX = points[0] || 0;\n var maxX = points[0] || 0;\n var minY = points[1] || 0;\n var maxY = points[1] || 0;\n var x, y;\n for (var i = 0; i < points.length / 2; i++) {\n x = points[i * 2];\n y = points[i * 2 + 1];\n minX = Math.min(minX, x);\n maxX = Math.max(maxX, x);\n minY = Math.min(minY, y);\n maxY = Math.max(maxY, y);\n }\n var fontSize = this.fontSize();\n return {\n x: minX - fontSize / 2,\n y: minY - fontSize / 2,\n width: maxX - minX + fontSize,\n height: maxY - minY + fontSize,\n };\n }\n destroy() {\n Util_1.Util.releaseCanvas(this.dummyCanvas);\n return super.destroy();\n }\n}\nexports.TextPath = TextPath;\nTextPath.prototype._fillFunc = _fillFunc;\nTextPath.prototype._strokeFunc = _strokeFunc;\nTextPath.prototype._fillFuncHit = _fillFunc;\nTextPath.prototype._strokeFuncHit = _strokeFunc;\nTextPath.prototype.className = 'TextPath';\nTextPath.prototype._attrsAffectingSize = ['text', 'fontSize', 'data'];\n(0, Global_1._registerNode)(TextPath);\nFactory_1.Factory.addGetterSetter(TextPath, 'data');\nFactory_1.Factory.addGetterSetter(TextPath, 'fontFamily', 'Arial');\nFactory_1.Factory.addGetterSetter(TextPath, 'fontSize', 12, (0, Validators_1.getNumberValidator)());\nFactory_1.Factory.addGetterSetter(TextPath, 'fontStyle', NORMAL);\nFactory_1.Factory.addGetterSetter(TextPath, 'align', 'left');\nFactory_1.Factory.addGetterSetter(TextPath, 'letterSpacing', 0, (0, Validators_1.getNumberValidator)());\nFactory_1.Factory.addGetterSetter(TextPath, 'textBaseline', 'middle');\nFactory_1.Factory.addGetterSetter(TextPath, 'fontVariant', NORMAL);\nFactory_1.Factory.addGetterSetter(TextPath, 'text', EMPTY_STRING);\nFactory_1.Factory.addGetterSetter(TextPath, 'textDecoration', null);\nFactory_1.Factory.addGetterSetter(TextPath, 'kerningFunc', null);\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Transformer = void 0;\nconst Util_1 = require(\"../Util\");\nconst Factory_1 = require(\"../Factory\");\nconst Node_1 = require(\"../Node\");\nconst Shape_1 = require(\"../Shape\");\nconst Rect_1 = require(\"./Rect\");\nconst Group_1 = require(\"../Group\");\nconst Global_1 = require(\"../Global\");\nconst Validators_1 = require(\"../Validators\");\nconst Global_2 = require(\"../Global\");\nvar EVENTS_NAME = 'tr-konva';\nvar ATTR_CHANGE_LIST = [\n 'resizeEnabledChange',\n 'rotateAnchorOffsetChange',\n 'rotateEnabledChange',\n 'enabledAnchorsChange',\n 'anchorSizeChange',\n 'borderEnabledChange',\n 'borderStrokeChange',\n 'borderStrokeWidthChange',\n 'borderDashChange',\n 'anchorStrokeChange',\n 'anchorStrokeWidthChange',\n 'anchorFillChange',\n 'anchorCornerRadiusChange',\n 'ignoreStrokeChange',\n 'anchorStyleFuncChange',\n]\n .map((e) => e + `.${EVENTS_NAME}`)\n .join(' ');\nvar NODES_RECT = 'nodesRect';\nvar TRANSFORM_CHANGE_STR = [\n 'widthChange',\n 'heightChange',\n 'scaleXChange',\n 'scaleYChange',\n 'skewXChange',\n 'skewYChange',\n 'rotationChange',\n 'offsetXChange',\n 'offsetYChange',\n 'transformsEnabledChange',\n 'strokeWidthChange',\n];\nvar ANGLES = {\n 'top-left': -45,\n 'top-center': 0,\n 'top-right': 45,\n 'middle-right': -90,\n 'middle-left': 90,\n 'bottom-left': -135,\n 'bottom-center': 180,\n 'bottom-right': 135,\n};\nconst TOUCH_DEVICE = 'ontouchstart' in Global_1.Konva._global;\nfunction getCursor(anchorName, rad, rotateCursor) {\n if (anchorName === 'rotater') {\n return rotateCursor;\n }\n rad += Util_1.Util.degToRad(ANGLES[anchorName] || 0);\n var angle = ((Util_1.Util.radToDeg(rad) % 360) + 360) % 360;\n if (Util_1.Util._inRange(angle, 315 + 22.5, 360) || Util_1.Util._inRange(angle, 0, 22.5)) {\n return 'ns-resize';\n }\n else if (Util_1.Util._inRange(angle, 45 - 22.5, 45 + 22.5)) {\n return 'nesw-resize';\n }\n else if (Util_1.Util._inRange(angle, 90 - 22.5, 90 + 22.5)) {\n return 'ew-resize';\n }\n else if (Util_1.Util._inRange(angle, 135 - 22.5, 135 + 22.5)) {\n return 'nwse-resize';\n }\n else if (Util_1.Util._inRange(angle, 180 - 22.5, 180 + 22.5)) {\n return 'ns-resize';\n }\n else if (Util_1.Util._inRange(angle, 225 - 22.5, 225 + 22.5)) {\n return 'nesw-resize';\n }\n else if (Util_1.Util._inRange(angle, 270 - 22.5, 270 + 22.5)) {\n return 'ew-resize';\n }\n else if (Util_1.Util._inRange(angle, 315 - 22.5, 315 + 22.5)) {\n return 'nwse-resize';\n }\n else {\n Util_1.Util.error('Transformer has unknown angle for cursor detection: ' + angle);\n return 'pointer';\n }\n}\nvar ANCHORS_NAMES = [\n 'top-left',\n 'top-center',\n 'top-right',\n 'middle-right',\n 'middle-left',\n 'bottom-left',\n 'bottom-center',\n 'bottom-right',\n];\nvar MAX_SAFE_INTEGER = 100000000;\nfunction getCenter(shape) {\n return {\n x: shape.x +\n (shape.width / 2) * Math.cos(shape.rotation) +\n (shape.height / 2) * Math.sin(-shape.rotation),\n y: shape.y +\n (shape.height / 2) * Math.cos(shape.rotation) +\n (shape.width / 2) * Math.sin(shape.rotation),\n };\n}\nfunction rotateAroundPoint(shape, angleRad, point) {\n const x = point.x +\n (shape.x - point.x) * Math.cos(angleRad) -\n (shape.y - point.y) * Math.sin(angleRad);\n const y = point.y +\n (shape.x - point.x) * Math.sin(angleRad) +\n (shape.y - point.y) * Math.cos(angleRad);\n return {\n ...shape,\n rotation: shape.rotation + angleRad,\n x,\n y,\n };\n}\nfunction rotateAroundCenter(shape, deltaRad) {\n const center = getCenter(shape);\n return rotateAroundPoint(shape, deltaRad, center);\n}\nfunction getSnap(snaps, newRotationRad, tol) {\n let snapped = newRotationRad;\n for (let i = 0; i < snaps.length; i++) {\n const angle = Global_1.Konva.getAngle(snaps[i]);\n const absDiff = Math.abs(angle - newRotationRad) % (Math.PI * 2);\n const dif = Math.min(absDiff, Math.PI * 2 - absDiff);\n if (dif < tol) {\n snapped = angle;\n }\n }\n return snapped;\n}\nlet activeTransformersCount = 0;\nclass Transformer extends Group_1.Group {\n constructor(config) {\n super(config);\n this._movingAnchorName = null;\n this._transforming = false;\n this._createElements();\n this._handleMouseMove = this._handleMouseMove.bind(this);\n this._handleMouseUp = this._handleMouseUp.bind(this);\n this.update = this.update.bind(this);\n this.on(ATTR_CHANGE_LIST, this.update);\n if (this.getNode()) {\n this.update();\n }\n }\n attachTo(node) {\n this.setNode(node);\n return this;\n }\n setNode(node) {\n Util_1.Util.warn('tr.setNode(shape), tr.node(shape) and tr.attachTo(shape) methods are deprecated. Please use tr.nodes(nodesArray) instead.');\n return this.setNodes([node]);\n }\n getNode() {\n return this._nodes && this._nodes[0];\n }\n _getEventNamespace() {\n return EVENTS_NAME + this._id;\n }\n setNodes(nodes = []) {\n if (this._nodes && this._nodes.length) {\n this.detach();\n }\n const filteredNodes = nodes.filter((node) => {\n if (node.isAncestorOf(this)) {\n Util_1.Util.error('Konva.Transformer cannot be an a child of the node you are trying to attach');\n return false;\n }\n return true;\n });\n this._nodes = nodes = filteredNodes;\n if (nodes.length === 1 && this.useSingleNodeRotation()) {\n this.rotation(nodes[0].getAbsoluteRotation());\n }\n else {\n this.rotation(0);\n }\n this._nodes.forEach((node) => {\n const onChange = () => {\n if (this.nodes().length === 1 && this.useSingleNodeRotation()) {\n this.rotation(this.nodes()[0].getAbsoluteRotation());\n }\n this._resetTransformCache();\n if (!this._transforming && !this.isDragging()) {\n this.update();\n }\n };\n const additionalEvents = node._attrsAffectingSize\n .map((prop) => prop + 'Change.' + this._getEventNamespace())\n .join(' ');\n node.on(additionalEvents, onChange);\n node.on(TRANSFORM_CHANGE_STR.map((e) => e + `.${this._getEventNamespace()}`).join(' '), onChange);\n node.on(`absoluteTransformChange.${this._getEventNamespace()}`, onChange);\n this._proxyDrag(node);\n });\n this._resetTransformCache();\n var elementsCreated = !!this.findOne('.top-left');\n if (elementsCreated) {\n this.update();\n }\n return this;\n }\n _proxyDrag(node) {\n let lastPos;\n node.on(`dragstart.${this._getEventNamespace()}`, (e) => {\n lastPos = node.getAbsolutePosition();\n if (!this.isDragging() && node !== this.findOne('.back')) {\n this.startDrag(e, false);\n }\n });\n node.on(`dragmove.${this._getEventNamespace()}`, (e) => {\n if (!lastPos) {\n return;\n }\n const abs = node.getAbsolutePosition();\n const dx = abs.x - lastPos.x;\n const dy = abs.y - lastPos.y;\n this.nodes().forEach((otherNode) => {\n if (otherNode === node) {\n return;\n }\n if (otherNode.isDragging()) {\n return;\n }\n const otherAbs = otherNode.getAbsolutePosition();\n otherNode.setAbsolutePosition({\n x: otherAbs.x + dx,\n y: otherAbs.y + dy,\n });\n otherNode.startDrag(e);\n });\n lastPos = null;\n });\n }\n getNodes() {\n return this._nodes || [];\n }\n getActiveAnchor() {\n return this._movingAnchorName;\n }\n detach() {\n if (this._nodes) {\n this._nodes.forEach((node) => {\n node.off('.' + this._getEventNamespace());\n });\n }\n this._nodes = [];\n this._resetTransformCache();\n }\n _resetTransformCache() {\n this._clearCache(NODES_RECT);\n this._clearCache('transform');\n this._clearSelfAndDescendantCache('absoluteTransform');\n }\n _getNodeRect() {\n return this._getCache(NODES_RECT, this.__getNodeRect);\n }\n __getNodeShape(node, rot = this.rotation(), relative) {\n var rect = node.getClientRect({\n skipTransform: true,\n skipShadow: true,\n skipStroke: this.ignoreStroke(),\n });\n var absScale = node.getAbsoluteScale(relative);\n var absPos = node.getAbsolutePosition(relative);\n var dx = rect.x * absScale.x - node.offsetX() * absScale.x;\n var dy = rect.y * absScale.y - node.offsetY() * absScale.y;\n const rotation = (Global_1.Konva.getAngle(node.getAbsoluteRotation()) + Math.PI * 2) %\n (Math.PI * 2);\n const box = {\n x: absPos.x + dx * Math.cos(rotation) + dy * Math.sin(-rotation),\n y: absPos.y + dy * Math.cos(rotation) + dx * Math.sin(rotation),\n width: rect.width * absScale.x,\n height: rect.height * absScale.y,\n rotation: rotation,\n };\n return rotateAroundPoint(box, -Global_1.Konva.getAngle(rot), {\n x: 0,\n y: 0,\n });\n }\n __getNodeRect() {\n var node = this.getNode();\n if (!node) {\n return {\n x: -MAX_SAFE_INTEGER,\n y: -MAX_SAFE_INTEGER,\n width: 0,\n height: 0,\n rotation: 0,\n };\n }\n const totalPoints = [];\n this.nodes().map((node) => {\n const box = node.getClientRect({\n skipTransform: true,\n skipShadow: true,\n skipStroke: this.ignoreStroke(),\n });\n var points = [\n { x: box.x, y: box.y },\n { x: box.x + box.width, y: box.y },\n { x: box.x + box.width, y: box.y + box.height },\n { x: box.x, y: box.y + box.height },\n ];\n var trans = node.getAbsoluteTransform();\n points.forEach(function (point) {\n var transformed = trans.point(point);\n totalPoints.push(transformed);\n });\n });\n const tr = new Util_1.Transform();\n tr.rotate(-Global_1.Konva.getAngle(this.rotation()));\n var minX = Infinity, minY = Infinity, maxX = -Infinity, maxY = -Infinity;\n totalPoints.forEach(function (point) {\n var transformed = tr.point(point);\n if (minX === undefined) {\n minX = maxX = transformed.x;\n minY = maxY = transformed.y;\n }\n minX = Math.min(minX, transformed.x);\n minY = Math.min(minY, transformed.y);\n maxX = Math.max(maxX, transformed.x);\n maxY = Math.max(maxY, transformed.y);\n });\n tr.invert();\n const p = tr.point({ x: minX, y: minY });\n return {\n x: p.x,\n y: p.y,\n width: maxX - minX,\n height: maxY - minY,\n rotation: Global_1.Konva.getAngle(this.rotation()),\n };\n }\n getX() {\n return this._getNodeRect().x;\n }\n getY() {\n return this._getNodeRect().y;\n }\n getWidth() {\n return this._getNodeRect().width;\n }\n getHeight() {\n return this._getNodeRect().height;\n }\n _createElements() {\n this._createBack();\n ANCHORS_NAMES.forEach((name) => {\n this._createAnchor(name);\n });\n this._createAnchor('rotater');\n }\n _createAnchor(name) {\n var anchor = new Rect_1.Rect({\n stroke: 'rgb(0, 161, 255)',\n fill: 'white',\n strokeWidth: 1,\n name: name + ' _anchor',\n dragDistance: 0,\n draggable: true,\n hitStrokeWidth: TOUCH_DEVICE ? 10 : 'auto',\n });\n var self = this;\n anchor.on('mousedown touchstart', function (e) {\n self._handleMouseDown(e);\n });\n anchor.on('dragstart', (e) => {\n anchor.stopDrag();\n e.cancelBubble = true;\n });\n anchor.on('dragend', (e) => {\n e.cancelBubble = true;\n });\n anchor.on('mouseenter', () => {\n var rad = Global_1.Konva.getAngle(this.rotation());\n var rotateCursor = this.rotateAnchorCursor();\n var cursor = getCursor(name, rad, rotateCursor);\n anchor.getStage().content &&\n (anchor.getStage().content.style.cursor = cursor);\n this._cursorChange = true;\n });\n anchor.on('mouseout', () => {\n anchor.getStage().content &&\n (anchor.getStage().content.style.cursor = '');\n this._cursorChange = false;\n });\n this.add(anchor);\n }\n _createBack() {\n var back = new Shape_1.Shape({\n name: 'back',\n width: 0,\n height: 0,\n draggable: true,\n sceneFunc(ctx, shape) {\n var tr = shape.getParent();\n var padding = tr.padding();\n ctx.beginPath();\n ctx.rect(-padding, -padding, shape.width() + padding * 2, shape.height() + padding * 2);\n ctx.moveTo(shape.width() / 2, -padding);\n if (tr.rotateEnabled() && tr.rotateLineVisible()) {\n ctx.lineTo(shape.width() / 2, -tr.rotateAnchorOffset() * Util_1.Util._sign(shape.height()) - padding);\n }\n ctx.fillStrokeShape(shape);\n },\n hitFunc: (ctx, shape) => {\n if (!this.shouldOverdrawWholeArea()) {\n return;\n }\n var padding = this.padding();\n ctx.beginPath();\n ctx.rect(-padding, -padding, shape.width() + padding * 2, shape.height() + padding * 2);\n ctx.fillStrokeShape(shape);\n },\n });\n this.add(back);\n this._proxyDrag(back);\n back.on('dragstart', (e) => {\n e.cancelBubble = true;\n });\n back.on('dragmove', (e) => {\n e.cancelBubble = true;\n });\n back.on('dragend', (e) => {\n e.cancelBubble = true;\n });\n this.on('dragmove', (e) => {\n this.update();\n });\n }\n _handleMouseDown(e) {\n if (this._transforming) {\n return;\n }\n this._movingAnchorName = e.target.name().split(' ')[0];\n var attrs = this._getNodeRect();\n var width = attrs.width;\n var height = attrs.height;\n var hypotenuse = Math.sqrt(Math.pow(width, 2) + Math.pow(height, 2));\n this.sin = Math.abs(height / hypotenuse);\n this.cos = Math.abs(width / hypotenuse);\n if (typeof window !== 'undefined') {\n window.addEventListener('mousemove', this._handleMouseMove);\n window.addEventListener('touchmove', this._handleMouseMove);\n window.addEventListener('mouseup', this._handleMouseUp, true);\n window.addEventListener('touchend', this._handleMouseUp, true);\n }\n this._transforming = true;\n var ap = e.target.getAbsolutePosition();\n var pos = e.target.getStage().getPointerPosition();\n this._anchorDragOffset = {\n x: pos.x - ap.x,\n y: pos.y - ap.y,\n };\n activeTransformersCount++;\n this._fire('transformstart', { evt: e.evt, target: this.getNode() });\n this._nodes.forEach((target) => {\n target._fire('transformstart', { evt: e.evt, target });\n });\n }\n _handleMouseMove(e) {\n var x, y, newHypotenuse;\n var anchorNode = this.findOne('.' + this._movingAnchorName);\n var stage = anchorNode.getStage();\n stage.setPointersPositions(e);\n const pp = stage.getPointerPosition();\n let newNodePos = {\n x: pp.x - this._anchorDragOffset.x,\n y: pp.y - this._anchorDragOffset.y,\n };\n const oldAbs = anchorNode.getAbsolutePosition();\n if (this.anchorDragBoundFunc()) {\n newNodePos = this.anchorDragBoundFunc()(oldAbs, newNodePos, e);\n }\n anchorNode.setAbsolutePosition(newNodePos);\n const newAbs = anchorNode.getAbsolutePosition();\n if (oldAbs.x === newAbs.x && oldAbs.y === newAbs.y) {\n return;\n }\n if (this._movingAnchorName === 'rotater') {\n var attrs = this._getNodeRect();\n x = anchorNode.x() - attrs.width / 2;\n y = -anchorNode.y() + attrs.height / 2;\n let delta = Math.atan2(-y, x) + Math.PI / 2;\n if (attrs.height < 0) {\n delta -= Math.PI;\n }\n var oldRotation = Global_1.Konva.getAngle(this.rotation());\n const newRotation = oldRotation + delta;\n const tol = Global_1.Konva.getAngle(this.rotationSnapTolerance());\n const snappedRot = getSnap(this.rotationSnaps(), newRotation, tol);\n const diff = snappedRot - attrs.rotation;\n const shape = rotateAroundCenter(attrs, diff);\n this._fitNodesInto(shape, e);\n return;\n }\n var shiftBehavior = this.shiftBehavior();\n var keepProportion;\n if (shiftBehavior === 'inverted') {\n keepProportion = this.keepRatio() && !e.shiftKey;\n }\n else if (shiftBehavior === 'none') {\n keepProportion = this.keepRatio();\n }\n else {\n keepProportion = this.keepRatio() || e.shiftKey;\n }\n var centeredScaling = this.centeredScaling() || e.altKey;\n if (this._movingAnchorName === 'top-left') {\n if (keepProportion) {\n var comparePoint = centeredScaling\n ? {\n x: this.width() / 2,\n y: this.height() / 2,\n }\n : {\n x: this.findOne('.bottom-right').x(),\n y: this.findOne('.bottom-right').y(),\n };\n newHypotenuse = Math.sqrt(Math.pow(comparePoint.x - anchorNode.x(), 2) +\n Math.pow(comparePoint.y - anchorNode.y(), 2));\n var reverseX = this.findOne('.top-left').x() > comparePoint.x ? -1 : 1;\n var reverseY = this.findOne('.top-left').y() > comparePoint.y ? -1 : 1;\n x = newHypotenuse * this.cos * reverseX;\n y = newHypotenuse * this.sin * reverseY;\n this.findOne('.top-left').x(comparePoint.x - x);\n this.findOne('.top-left').y(comparePoint.y - y);\n }\n }\n else if (this._movingAnchorName === 'top-center') {\n this.findOne('.top-left').y(anchorNode.y());\n }\n else if (this._movingAnchorName === 'top-right') {\n if (keepProportion) {\n var comparePoint = centeredScaling\n ? {\n x: this.width() / 2,\n y: this.height() / 2,\n }\n : {\n x: this.findOne('.bottom-left').x(),\n y: this.findOne('.bottom-left').y(),\n };\n newHypotenuse = Math.sqrt(Math.pow(anchorNode.x() - comparePoint.x, 2) +\n Math.pow(comparePoint.y - anchorNode.y(), 2));\n var reverseX = this.findOne('.top-right').x() < comparePoint.x ? -1 : 1;\n var reverseY = this.findOne('.top-right').y() > comparePoint.y ? -1 : 1;\n x = newHypotenuse * this.cos * reverseX;\n y = newHypotenuse * this.sin * reverseY;\n this.findOne('.top-right').x(comparePoint.x + x);\n this.findOne('.top-right').y(comparePoint.y - y);\n }\n var pos = anchorNode.position();\n this.findOne('.top-left').y(pos.y);\n this.findOne('.bottom-right').x(pos.x);\n }\n else if (this._movingAnchorName === 'middle-left') {\n this.findOne('.top-left').x(anchorNode.x());\n }\n else if (this._movingAnchorName === 'middle-right') {\n this.findOne('.bottom-right').x(anchorNode.x());\n }\n else if (this._movingAnchorName === 'bottom-left') {\n if (keepProportion) {\n var comparePoint = centeredScaling\n ? {\n x: this.width() / 2,\n y: this.height() / 2,\n }\n : {\n x: this.findOne('.top-right').x(),\n y: this.findOne('.top-right').y(),\n };\n newHypotenuse = Math.sqrt(Math.pow(comparePoint.x - anchorNode.x(), 2) +\n Math.pow(anchorNode.y() - comparePoint.y, 2));\n var reverseX = comparePoint.x < anchorNode.x() ? -1 : 1;\n var reverseY = anchorNode.y() < comparePoint.y ? -1 : 1;\n x = newHypotenuse * this.cos * reverseX;\n y = newHypotenuse * this.sin * reverseY;\n anchorNode.x(comparePoint.x - x);\n anchorNode.y(comparePoint.y + y);\n }\n pos = anchorNode.position();\n this.findOne('.top-left').x(pos.x);\n this.findOne('.bottom-right').y(pos.y);\n }\n else if (this._movingAnchorName === 'bottom-center') {\n this.findOne('.bottom-right').y(anchorNode.y());\n }\n else if (this._movingAnchorName === 'bottom-right') {\n if (keepProportion) {\n var comparePoint = centeredScaling\n ? {\n x: this.width() / 2,\n y: this.height() / 2,\n }\n : {\n x: this.findOne('.top-left').x(),\n y: this.findOne('.top-left').y(),\n };\n newHypotenuse = Math.sqrt(Math.pow(anchorNode.x() - comparePoint.x, 2) +\n Math.pow(anchorNode.y() - comparePoint.y, 2));\n var reverseX = this.findOne('.bottom-right').x() < comparePoint.x ? -1 : 1;\n var reverseY = this.findOne('.bottom-right').y() < comparePoint.y ? -1 : 1;\n x = newHypotenuse * this.cos * reverseX;\n y = newHypotenuse * this.sin * reverseY;\n this.findOne('.bottom-right').x(comparePoint.x + x);\n this.findOne('.bottom-right').y(comparePoint.y + y);\n }\n }\n else {\n console.error(new Error('Wrong position argument of selection resizer: ' +\n this._movingAnchorName));\n }\n var centeredScaling = this.centeredScaling() || e.altKey;\n if (centeredScaling) {\n var topLeft = this.findOne('.top-left');\n var bottomRight = this.findOne('.bottom-right');\n var topOffsetX = topLeft.x();\n var topOffsetY = topLeft.y();\n var bottomOffsetX = this.getWidth() - bottomRight.x();\n var bottomOffsetY = this.getHeight() - bottomRight.y();\n bottomRight.move({\n x: -topOffsetX,\n y: -topOffsetY,\n });\n topLeft.move({\n x: bottomOffsetX,\n y: bottomOffsetY,\n });\n }\n var absPos = this.findOne('.top-left').getAbsolutePosition();\n x = absPos.x;\n y = absPos.y;\n var width = this.findOne('.bottom-right').x() - this.findOne('.top-left').x();\n var height = this.findOne('.bottom-right').y() - this.findOne('.top-left').y();\n this._fitNodesInto({\n x: x,\n y: y,\n width: width,\n height: height,\n rotation: Global_1.Konva.getAngle(this.rotation()),\n }, e);\n }\n _handleMouseUp(e) {\n this._removeEvents(e);\n }\n getAbsoluteTransform() {\n return this.getTransform();\n }\n _removeEvents(e) {\n var _a;\n if (this._transforming) {\n this._transforming = false;\n if (typeof window !== 'undefined') {\n window.removeEventListener('mousemove', this._handleMouseMove);\n window.removeEventListener('touchmove', this._handleMouseMove);\n window.removeEventListener('mouseup', this._handleMouseUp, true);\n window.removeEventListener('touchend', this._handleMouseUp, true);\n }\n var node = this.getNode();\n activeTransformersCount--;\n this._fire('transformend', { evt: e, target: node });\n (_a = this.getLayer()) === null || _a === void 0 ? void 0 : _a.batchDraw();\n if (node) {\n this._nodes.forEach((target) => {\n var _a;\n target._fire('transformend', { evt: e, target });\n (_a = target.getLayer()) === null || _a === void 0 ? void 0 : _a.batchDraw();\n });\n }\n this._movingAnchorName = null;\n }\n }\n _fitNodesInto(newAttrs, evt) {\n var oldAttrs = this._getNodeRect();\n const minSize = 1;\n if (Util_1.Util._inRange(newAttrs.width, -this.padding() * 2 - minSize, minSize)) {\n this.update();\n return;\n }\n if (Util_1.Util._inRange(newAttrs.height, -this.padding() * 2 - minSize, minSize)) {\n this.update();\n return;\n }\n var t = new Util_1.Transform();\n t.rotate(Global_1.Konva.getAngle(this.rotation()));\n if (this._movingAnchorName &&\n newAttrs.width < 0 &&\n this._movingAnchorName.indexOf('left') >= 0) {\n const offset = t.point({\n x: -this.padding() * 2,\n y: 0,\n });\n newAttrs.x += offset.x;\n newAttrs.y += offset.y;\n newAttrs.width += this.padding() * 2;\n this._movingAnchorName = this._movingAnchorName.replace('left', 'right');\n this._anchorDragOffset.x -= offset.x;\n this._anchorDragOffset.y -= offset.y;\n }\n else if (this._movingAnchorName &&\n newAttrs.width < 0 &&\n this._movingAnchorName.indexOf('right') >= 0) {\n const offset = t.point({\n x: this.padding() * 2,\n y: 0,\n });\n this._movingAnchorName = this._movingAnchorName.replace('right', 'left');\n this._anchorDragOffset.x -= offset.x;\n this._anchorDragOffset.y -= offset.y;\n newAttrs.width += this.padding() * 2;\n }\n if (this._movingAnchorName &&\n newAttrs.height < 0 &&\n this._movingAnchorName.indexOf('top') >= 0) {\n const offset = t.point({\n x: 0,\n y: -this.padding() * 2,\n });\n newAttrs.x += offset.x;\n newAttrs.y += offset.y;\n this._movingAnchorName = this._movingAnchorName.replace('top', 'bottom');\n this._anchorDragOffset.x -= offset.x;\n this._anchorDragOffset.y -= offset.y;\n newAttrs.height += this.padding() * 2;\n }\n else if (this._movingAnchorName &&\n newAttrs.height < 0 &&\n this._movingAnchorName.indexOf('bottom') >= 0) {\n const offset = t.point({\n x: 0,\n y: this.padding() * 2,\n });\n this._movingAnchorName = this._movingAnchorName.replace('bottom', 'top');\n this._anchorDragOffset.x -= offset.x;\n this._anchorDragOffset.y -= offset.y;\n newAttrs.height += this.padding() * 2;\n }\n if (this.boundBoxFunc()) {\n const bounded = this.boundBoxFunc()(oldAttrs, newAttrs);\n if (bounded) {\n newAttrs = bounded;\n }\n else {\n Util_1.Util.warn('boundBoxFunc returned falsy. You should return new bound rect from it!');\n }\n }\n const baseSize = 10000000;\n const oldTr = new Util_1.Transform();\n oldTr.translate(oldAttrs.x, oldAttrs.y);\n oldTr.rotate(oldAttrs.rotation);\n oldTr.scale(oldAttrs.width / baseSize, oldAttrs.height / baseSize);\n const newTr = new Util_1.Transform();\n const newScaleX = newAttrs.width / baseSize;\n const newScaleY = newAttrs.height / baseSize;\n if (this.flipEnabled() === false) {\n newTr.translate(newAttrs.x, newAttrs.y);\n newTr.rotate(newAttrs.rotation);\n newTr.translate(newAttrs.width < 0 ? newAttrs.width : 0, newAttrs.height < 0 ? newAttrs.height : 0);\n newTr.scale(Math.abs(newScaleX), Math.abs(newScaleY));\n }\n else {\n newTr.translate(newAttrs.x, newAttrs.y);\n newTr.rotate(newAttrs.rotation);\n newTr.scale(newScaleX, newScaleY);\n }\n const delta = newTr.multiply(oldTr.invert());\n this._nodes.forEach((node) => {\n var _a;\n const parentTransform = node.getParent().getAbsoluteTransform();\n const localTransform = node.getTransform().copy();\n localTransform.translate(node.offsetX(), node.offsetY());\n const newLocalTransform = new Util_1.Transform();\n newLocalTransform\n .multiply(parentTransform.copy().invert())\n .multiply(delta)\n .multiply(parentTransform)\n .multiply(localTransform);\n const attrs = newLocalTransform.decompose();\n node.setAttrs(attrs);\n (_a = node.getLayer()) === null || _a === void 0 ? void 0 : _a.batchDraw();\n });\n this.rotation(Util_1.Util._getRotation(newAttrs.rotation));\n this._nodes.forEach((node) => {\n this._fire('transform', { evt: evt, target: node });\n node._fire('transform', { evt: evt, target: node });\n });\n this._resetTransformCache();\n this.update();\n this.getLayer().batchDraw();\n }\n forceUpdate() {\n this._resetTransformCache();\n this.update();\n }\n _batchChangeChild(selector, attrs) {\n const anchor = this.findOne(selector);\n anchor.setAttrs(attrs);\n }\n update() {\n var _a;\n var attrs = this._getNodeRect();\n this.rotation(Util_1.Util._getRotation(attrs.rotation));\n var width = attrs.width;\n var height = attrs.height;\n var enabledAnchors = this.enabledAnchors();\n var resizeEnabled = this.resizeEnabled();\n var padding = this.padding();\n var anchorSize = this.anchorSize();\n const anchors = this.find('._anchor');\n anchors.forEach((node) => {\n node.setAttrs({\n width: anchorSize,\n height: anchorSize,\n offsetX: anchorSize / 2,\n offsetY: anchorSize / 2,\n stroke: this.anchorStroke(),\n strokeWidth: this.anchorStrokeWidth(),\n fill: this.anchorFill(),\n cornerRadius: this.anchorCornerRadius(),\n });\n });\n this._batchChangeChild('.top-left', {\n x: 0,\n y: 0,\n offsetX: anchorSize / 2 + padding,\n offsetY: anchorSize / 2 + padding,\n visible: resizeEnabled && enabledAnchors.indexOf('top-left') >= 0,\n });\n this._batchChangeChild('.top-center', {\n x: width / 2,\n y: 0,\n offsetY: anchorSize / 2 + padding,\n visible: resizeEnabled && enabledAnchors.indexOf('top-center') >= 0,\n });\n this._batchChangeChild('.top-right', {\n x: width,\n y: 0,\n offsetX: anchorSize / 2 - padding,\n offsetY: anchorSize / 2 + padding,\n visible: resizeEnabled && enabledAnchors.indexOf('top-right') >= 0,\n });\n this._batchChangeChild('.middle-left', {\n x: 0,\n y: height / 2,\n offsetX: anchorSize / 2 + padding,\n visible: resizeEnabled && enabledAnchors.indexOf('middle-left') >= 0,\n });\n this._batchChangeChild('.middle-right', {\n x: width,\n y: height / 2,\n offsetX: anchorSize / 2 - padding,\n visible: resizeEnabled && enabledAnchors.indexOf('middle-right') >= 0,\n });\n this._batchChangeChild('.bottom-left', {\n x: 0,\n y: height,\n offsetX: anchorSize / 2 + padding,\n offsetY: anchorSize / 2 - padding,\n visible: resizeEnabled && enabledAnchors.indexOf('bottom-left') >= 0,\n });\n this._batchChangeChild('.bottom-center', {\n x: width / 2,\n y: height,\n offsetY: anchorSize / 2 - padding,\n visible: resizeEnabled && enabledAnchors.indexOf('bottom-center') >= 0,\n });\n this._batchChangeChild('.bottom-right', {\n x: width,\n y: height,\n offsetX: anchorSize / 2 - padding,\n offsetY: anchorSize / 2 - padding,\n visible: resizeEnabled && enabledAnchors.indexOf('bottom-right') >= 0,\n });\n this._batchChangeChild('.rotater', {\n x: width / 2,\n y: -this.rotateAnchorOffset() * Util_1.Util._sign(height) - padding,\n visible: this.rotateEnabled(),\n });\n this._batchChangeChild('.back', {\n width: width,\n height: height,\n visible: this.borderEnabled(),\n stroke: this.borderStroke(),\n strokeWidth: this.borderStrokeWidth(),\n dash: this.borderDash(),\n x: 0,\n y: 0,\n });\n const styleFunc = this.anchorStyleFunc();\n if (styleFunc) {\n anchors.forEach((node) => {\n styleFunc(node);\n });\n }\n (_a = this.getLayer()) === null || _a === void 0 ? void 0 : _a.batchDraw();\n }\n isTransforming() {\n return this._transforming;\n }\n stopTransform() {\n if (this._transforming) {\n this._removeEvents();\n var anchorNode = this.findOne('.' + this._movingAnchorName);\n if (anchorNode) {\n anchorNode.stopDrag();\n }\n }\n }\n destroy() {\n if (this.getStage() && this._cursorChange) {\n this.getStage().content && (this.getStage().content.style.cursor = '');\n }\n Group_1.Group.prototype.destroy.call(this);\n this.detach();\n this._removeEvents();\n return this;\n }\n toObject() {\n return Node_1.Node.prototype.toObject.call(this);\n }\n clone(obj) {\n var node = Node_1.Node.prototype.clone.call(this, obj);\n return node;\n }\n getClientRect() {\n if (this.nodes().length > 0) {\n return super.getClientRect();\n }\n else {\n return { x: 0, y: 0, width: 0, height: 0 };\n }\n }\n}\nexports.Transformer = Transformer;\nTransformer.isTransforming = () => {\n return activeTransformersCount > 0;\n};\nfunction validateAnchors(val) {\n if (!(val instanceof Array)) {\n Util_1.Util.warn('enabledAnchors value should be an array');\n }\n if (val instanceof Array) {\n val.forEach(function (name) {\n if (ANCHORS_NAMES.indexOf(name) === -1) {\n Util_1.Util.warn('Unknown anchor name: ' +\n name +\n '. Available names are: ' +\n ANCHORS_NAMES.join(', '));\n }\n });\n }\n return val || [];\n}\nTransformer.prototype.className = 'Transformer';\n(0, Global_2._registerNode)(Transformer);\nFactory_1.Factory.addGetterSetter(Transformer, 'enabledAnchors', ANCHORS_NAMES, validateAnchors);\nFactory_1.Factory.addGetterSetter(Transformer, 'flipEnabled', true, (0, Validators_1.getBooleanValidator)());\nFactory_1.Factory.addGetterSetter(Transformer, 'resizeEnabled', true);\nFactory_1.Factory.addGetterSetter(Transformer, 'anchorSize', 10, (0, Validators_1.getNumberValidator)());\nFactory_1.Factory.addGetterSetter(Transformer, 'rotateEnabled', true);\nFactory_1.Factory.addGetterSetter(Transformer, 'rotateLineVisible', true);\nFactory_1.Factory.addGetterSetter(Transformer, 'rotationSnaps', []);\nFactory_1.Factory.addGetterSetter(Transformer, 'rotateAnchorOffset', 50, (0, Validators_1.getNumberValidator)());\nFactory_1.Factory.addGetterSetter(Transformer, 'rotateAnchorCursor', 'crosshair');\nFactory_1.Factory.addGetterSetter(Transformer, 'rotationSnapTolerance', 5, (0, Validators_1.getNumberValidator)());\nFactory_1.Factory.addGetterSetter(Transformer, 'borderEnabled', true);\nFactory_1.Factory.addGetterSetter(Transformer, 'anchorStroke', 'rgb(0, 161, 255)');\nFactory_1.Factory.addGetterSetter(Transformer, 'anchorStrokeWidth', 1, (0, Validators_1.getNumberValidator)());\nFactory_1.Factory.addGetterSetter(Transformer, 'anchorFill', 'white');\nFactory_1.Factory.addGetterSetter(Transformer, 'anchorCornerRadius', 0, (0, Validators_1.getNumberValidator)());\nFactory_1.Factory.addGetterSetter(Transformer, 'borderStroke', 'rgb(0, 161, 255)');\nFactory_1.Factory.addGetterSetter(Transformer, 'borderStrokeWidth', 1, (0, Validators_1.getNumberValidator)());\nFactory_1.Factory.addGetterSetter(Transformer, 'borderDash');\nFactory_1.Factory.addGetterSetter(Transformer, 'keepRatio', true);\nFactory_1.Factory.addGetterSetter(Transformer, 'shiftBehavior', 'default');\nFactory_1.Factory.addGetterSetter(Transformer, 'centeredScaling', false);\nFactory_1.Factory.addGetterSetter(Transformer, 'ignoreStroke', false);\nFactory_1.Factory.addGetterSetter(Transformer, 'padding', 0, (0, Validators_1.getNumberValidator)());\nFactory_1.Factory.addGetterSetter(Transformer, 'node');\nFactory_1.Factory.addGetterSetter(Transformer, 'nodes');\nFactory_1.Factory.addGetterSetter(Transformer, 'boundBoxFunc');\nFactory_1.Factory.addGetterSetter(Transformer, 'anchorDragBoundFunc');\nFactory_1.Factory.addGetterSetter(Transformer, 'anchorStyleFunc');\nFactory_1.Factory.addGetterSetter(Transformer, 'shouldOverdrawWholeArea', false);\nFactory_1.Factory.addGetterSetter(Transformer, 'useSingleNodeRotation', true);\nFactory_1.Factory.backCompat(Transformer, {\n lineEnabled: 'borderEnabled',\n rotateHandlerOffset: 'rotateAnchorOffset',\n enabledHandlers: 'enabledAnchors',\n});\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Wedge = void 0;\nconst Factory_1 = require(\"../Factory\");\nconst Shape_1 = require(\"../Shape\");\nconst Global_1 = require(\"../Global\");\nconst Validators_1 = require(\"../Validators\");\nconst Global_2 = require(\"../Global\");\nclass Wedge extends Shape_1.Shape {\n _sceneFunc(context) {\n context.beginPath();\n context.arc(0, 0, this.radius(), 0, Global_1.Konva.getAngle(this.angle()), this.clockwise());\n context.lineTo(0, 0);\n context.closePath();\n context.fillStrokeShape(this);\n }\n getWidth() {\n return this.radius() * 2;\n }\n getHeight() {\n return this.radius() * 2;\n }\n setWidth(width) {\n this.radius(width / 2);\n }\n setHeight(height) {\n this.radius(height / 2);\n }\n}\nexports.Wedge = Wedge;\nWedge.prototype.className = 'Wedge';\nWedge.prototype._centroid = true;\nWedge.prototype._attrsAffectingSize = ['radius'];\n(0, Global_2._registerNode)(Wedge);\nFactory_1.Factory.addGetterSetter(Wedge, 'radius', 0, (0, Validators_1.getNumberValidator)());\nFactory_1.Factory.addGetterSetter(Wedge, 'angle', 0, (0, Validators_1.getNumberValidator)());\nFactory_1.Factory.addGetterSetter(Wedge, 'clockwise', false);\nFactory_1.Factory.backCompat(Wedge, {\n angleDeg: 'angle',\n getAngleDeg: 'getAngle',\n setAngleDeg: 'setAngle',\n});\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Blur = void 0;\nconst Factory_1 = require(\"../Factory\");\nconst Node_1 = require(\"../Node\");\nconst Validators_1 = require(\"../Validators\");\nfunction BlurStack() {\n this.r = 0;\n this.g = 0;\n this.b = 0;\n this.a = 0;\n this.next = null;\n}\nvar mul_table = [\n 512, 512, 456, 512, 328, 456, 335, 512, 405, 328, 271, 456, 388, 335, 292,\n 512, 454, 405, 364, 328, 298, 271, 496, 456, 420, 388, 360, 335, 312, 292,\n 273, 512, 482, 454, 428, 405, 383, 364, 345, 328, 312, 298, 284, 271, 259,\n 496, 475, 456, 437, 420, 404, 388, 374, 360, 347, 335, 323, 312, 302, 292,\n 282, 273, 265, 512, 497, 482, 468, 454, 441, 428, 417, 405, 394, 383, 373,\n 364, 354, 345, 337, 328, 320, 312, 305, 298, 291, 284, 278, 271, 265, 259,\n 507, 496, 485, 475, 465, 456, 446, 437, 428, 420, 412, 404, 396, 388, 381,\n 374, 367, 360, 354, 347, 341, 335, 329, 323, 318, 312, 307, 302, 297, 292,\n 287, 282, 278, 273, 269, 265, 261, 512, 505, 497, 489, 482, 475, 468, 461,\n 454, 447, 441, 435, 428, 422, 417, 411, 405, 399, 394, 389, 383, 378, 373,\n 368, 364, 359, 354, 350, 345, 341, 337, 332, 328, 324, 320, 316, 312, 309,\n 305, 301, 298, 294, 291, 287, 284, 281, 278, 274, 271, 268, 265, 262, 259,\n 257, 507, 501, 496, 491, 485, 480, 475, 470, 465, 460, 456, 451, 446, 442,\n 437, 433, 428, 424, 420, 416, 412, 408, 404, 400, 396, 392, 388, 385, 381,\n 377, 374, 370, 367, 363, 360, 357, 354, 350, 347, 344, 341, 338, 335, 332,\n 329, 326, 323, 320, 318, 315, 312, 310, 307, 304, 302, 299, 297, 294, 292,\n 289, 287, 285, 282, 280, 278, 275, 273, 271, 269, 267, 265, 263, 261, 259,\n];\nvar shg_table = [\n 9, 11, 12, 13, 13, 14, 14, 15, 15, 15, 15, 16, 16, 16, 16, 17, 17, 17, 17, 17,\n 17, 17, 18, 18, 18, 18, 18, 18, 18, 18, 18, 19, 19, 19, 19, 19, 19, 19, 19,\n 19, 19, 19, 19, 19, 19, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,\n 20, 20, 20, 20, 20, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21,\n 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 22, 22, 22, 22, 22, 22,\n 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22,\n 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 23, 23, 23, 23, 23, 23, 23,\n 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23,\n 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23,\n 23, 23, 23, 23, 23, 23, 23, 23, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24,\n 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24,\n 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24,\n 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24,\n 24, 24, 24, 24, 24, 24, 24,\n];\nfunction filterGaussBlurRGBA(imageData, radius) {\n var pixels = imageData.data, width = imageData.width, height = imageData.height;\n var x, y, i, p, yp, yi, yw, r_sum, g_sum, b_sum, a_sum, r_out_sum, g_out_sum, b_out_sum, a_out_sum, r_in_sum, g_in_sum, b_in_sum, a_in_sum, pr, pg, pb, pa, rbs;\n var div = radius + radius + 1, widthMinus1 = width - 1, heightMinus1 = height - 1, radiusPlus1 = radius + 1, sumFactor = (radiusPlus1 * (radiusPlus1 + 1)) / 2, stackStart = new BlurStack(), stackEnd = null, stack = stackStart, stackIn = null, stackOut = null, mul_sum = mul_table[radius], shg_sum = shg_table[radius];\n for (i = 1; i < div; i++) {\n stack = stack.next = new BlurStack();\n if (i === radiusPlus1) {\n stackEnd = stack;\n }\n }\n stack.next = stackStart;\n yw = yi = 0;\n for (y = 0; y < height; y++) {\n r_in_sum =\n g_in_sum =\n b_in_sum =\n a_in_sum =\n r_sum =\n g_sum =\n b_sum =\n a_sum =\n 0;\n r_out_sum = radiusPlus1 * (pr = pixels[yi]);\n g_out_sum = radiusPlus1 * (pg = pixels[yi + 1]);\n b_out_sum = radiusPlus1 * (pb = pixels[yi + 2]);\n a_out_sum = radiusPlus1 * (pa = pixels[yi + 3]);\n r_sum += sumFactor * pr;\n g_sum += sumFactor * pg;\n b_sum += sumFactor * pb;\n a_sum += sumFactor * pa;\n stack = stackStart;\n for (i = 0; i < radiusPlus1; i++) {\n stack.r = pr;\n stack.g = pg;\n stack.b = pb;\n stack.a = pa;\n stack = stack.next;\n }\n for (i = 1; i < radiusPlus1; i++) {\n p = yi + ((widthMinus1 < i ? widthMinus1 : i) << 2);\n r_sum += (stack.r = pr = pixels[p]) * (rbs = radiusPlus1 - i);\n g_sum += (stack.g = pg = pixels[p + 1]) * rbs;\n b_sum += (stack.b = pb = pixels[p + 2]) * rbs;\n a_sum += (stack.a = pa = pixels[p + 3]) * rbs;\n r_in_sum += pr;\n g_in_sum += pg;\n b_in_sum += pb;\n a_in_sum += pa;\n stack = stack.next;\n }\n stackIn = stackStart;\n stackOut = stackEnd;\n for (x = 0; x < width; x++) {\n pixels[yi + 3] = pa = (a_sum * mul_sum) >> shg_sum;\n if (pa !== 0) {\n pa = 255 / pa;\n pixels[yi] = ((r_sum * mul_sum) >> shg_sum) * pa;\n pixels[yi + 1] = ((g_sum * mul_sum) >> shg_sum) * pa;\n pixels[yi + 2] = ((b_sum * mul_sum) >> shg_sum) * pa;\n }\n else {\n pixels[yi] = pixels[yi + 1] = pixels[yi + 2] = 0;\n }\n r_sum -= r_out_sum;\n g_sum -= g_out_sum;\n b_sum -= b_out_sum;\n a_sum -= a_out_sum;\n r_out_sum -= stackIn.r;\n g_out_sum -= stackIn.g;\n b_out_sum -= stackIn.b;\n a_out_sum -= stackIn.a;\n p = (yw + ((p = x + radius + 1) < widthMinus1 ? p : widthMinus1)) << 2;\n r_in_sum += stackIn.r = pixels[p];\n g_in_sum += stackIn.g = pixels[p + 1];\n b_in_sum += stackIn.b = pixels[p + 2];\n a_in_sum += stackIn.a = pixels[p + 3];\n r_sum += r_in_sum;\n g_sum += g_in_sum;\n b_sum += b_in_sum;\n a_sum += a_in_sum;\n stackIn = stackIn.next;\n r_out_sum += pr = stackOut.r;\n g_out_sum += pg = stackOut.g;\n b_out_sum += pb = stackOut.b;\n a_out_sum += pa = stackOut.a;\n r_in_sum -= pr;\n g_in_sum -= pg;\n b_in_sum -= pb;\n a_in_sum -= pa;\n stackOut = stackOut.next;\n yi += 4;\n }\n yw += width;\n }\n for (x = 0; x < width; x++) {\n g_in_sum =\n b_in_sum =\n a_in_sum =\n r_in_sum =\n g_sum =\n b_sum =\n a_sum =\n r_sum =\n 0;\n yi = x << 2;\n r_out_sum = radiusPlus1 * (pr = pixels[yi]);\n g_out_sum = radiusPlus1 * (pg = pixels[yi + 1]);\n b_out_sum = radiusPlus1 * (pb = pixels[yi + 2]);\n a_out_sum = radiusPlus1 * (pa = pixels[yi + 3]);\n r_sum += sumFactor * pr;\n g_sum += sumFactor * pg;\n b_sum += sumFactor * pb;\n a_sum += sumFactor * pa;\n stack = stackStart;\n for (i = 0; i < radiusPlus1; i++) {\n stack.r = pr;\n stack.g = pg;\n stack.b = pb;\n stack.a = pa;\n stack = stack.next;\n }\n yp = width;\n for (i = 1; i <= radius; i++) {\n yi = (yp + x) << 2;\n r_sum += (stack.r = pr = pixels[yi]) * (rbs = radiusPlus1 - i);\n g_sum += (stack.g = pg = pixels[yi + 1]) * rbs;\n b_sum += (stack.b = pb = pixels[yi + 2]) * rbs;\n a_sum += (stack.a = pa = pixels[yi + 3]) * rbs;\n r_in_sum += pr;\n g_in_sum += pg;\n b_in_sum += pb;\n a_in_sum += pa;\n stack = stack.next;\n if (i < heightMinus1) {\n yp += width;\n }\n }\n yi = x;\n stackIn = stackStart;\n stackOut = stackEnd;\n for (y = 0; y < height; y++) {\n p = yi << 2;\n pixels[p + 3] = pa = (a_sum * mul_sum) >> shg_sum;\n if (pa > 0) {\n pa = 255 / pa;\n pixels[p] = ((r_sum * mul_sum) >> shg_sum) * pa;\n pixels[p + 1] = ((g_sum * mul_sum) >> shg_sum) * pa;\n pixels[p + 2] = ((b_sum * mul_sum) >> shg_sum) * pa;\n }\n else {\n pixels[p] = pixels[p + 1] = pixels[p + 2] = 0;\n }\n r_sum -= r_out_sum;\n g_sum -= g_out_sum;\n b_sum -= b_out_sum;\n a_sum -= a_out_sum;\n r_out_sum -= stackIn.r;\n g_out_sum -= stackIn.g;\n b_out_sum -= stackIn.b;\n a_out_sum -= stackIn.a;\n p =\n (x +\n ((p = y + radiusPlus1) < heightMinus1 ? p : heightMinus1) * width) <<\n 2;\n r_sum += r_in_sum += stackIn.r = pixels[p];\n g_sum += g_in_sum += stackIn.g = pixels[p + 1];\n b_sum += b_in_sum += stackIn.b = pixels[p + 2];\n a_sum += a_in_sum += stackIn.a = pixels[p + 3];\n stackIn = stackIn.next;\n r_out_sum += pr = stackOut.r;\n g_out_sum += pg = stackOut.g;\n b_out_sum += pb = stackOut.b;\n a_out_sum += pa = stackOut.a;\n r_in_sum -= pr;\n g_in_sum -= pg;\n b_in_sum -= pb;\n a_in_sum -= pa;\n stackOut = stackOut.next;\n yi += width;\n }\n }\n}\nconst Blur = function Blur(imageData) {\n var radius = Math.round(this.blurRadius());\n if (radius > 0) {\n filterGaussBlurRGBA(imageData, radius);\n }\n};\nexports.Blur = Blur;\nFactory_1.Factory.addGetterSetter(Node_1.Node, 'blurRadius', 0, (0, Validators_1.getNumberValidator)(), Factory_1.Factory.afterSetFilter);\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Brighten = void 0;\nconst Factory_1 = require(\"../Factory\");\nconst Node_1 = require(\"../Node\");\nconst Validators_1 = require(\"../Validators\");\nconst Brighten = function (imageData) {\n var brightness = this.brightness() * 255, data = imageData.data, len = data.length, i;\n for (i = 0; i < len; i += 4) {\n data[i] += brightness;\n data[i + 1] += brightness;\n data[i + 2] += brightness;\n }\n};\nexports.Brighten = Brighten;\nFactory_1.Factory.addGetterSetter(Node_1.Node, 'brightness', 0, (0, Validators_1.getNumberValidator)(), Factory_1.Factory.afterSetFilter);\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Contrast = void 0;\nconst Factory_1 = require(\"../Factory\");\nconst Node_1 = require(\"../Node\");\nconst Validators_1 = require(\"../Validators\");\nconst Contrast = function (imageData) {\n var adjust = Math.pow((this.contrast() + 100) / 100, 2);\n var data = imageData.data, nPixels = data.length, red = 150, green = 150, blue = 150, i;\n for (i = 0; i < nPixels; i += 4) {\n red = data[i];\n green = data[i + 1];\n blue = data[i + 2];\n red /= 255;\n red -= 0.5;\n red *= adjust;\n red += 0.5;\n red *= 255;\n green /= 255;\n green -= 0.5;\n green *= adjust;\n green += 0.5;\n green *= 255;\n blue /= 255;\n blue -= 0.5;\n blue *= adjust;\n blue += 0.5;\n blue *= 255;\n red = red < 0 ? 0 : red > 255 ? 255 : red;\n green = green < 0 ? 0 : green > 255 ? 255 : green;\n blue = blue < 0 ? 0 : blue > 255 ? 255 : blue;\n data[i] = red;\n data[i + 1] = green;\n data[i + 2] = blue;\n }\n};\nexports.Contrast = Contrast;\nFactory_1.Factory.addGetterSetter(Node_1.Node, 'contrast', 0, (0, Validators_1.getNumberValidator)(), Factory_1.Factory.afterSetFilter);\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Emboss = void 0;\nconst Factory_1 = require(\"../Factory\");\nconst Node_1 = require(\"../Node\");\nconst Util_1 = require(\"../Util\");\nconst Validators_1 = require(\"../Validators\");\nconst Emboss = function (imageData) {\n var strength = this.embossStrength() * 10, greyLevel = this.embossWhiteLevel() * 255, direction = this.embossDirection(), blend = this.embossBlend(), dirY = 0, dirX = 0, data = imageData.data, w = imageData.width, h = imageData.height, w4 = w * 4, y = h;\n switch (direction) {\n case 'top-left':\n dirY = -1;\n dirX = -1;\n break;\n case 'top':\n dirY = -1;\n dirX = 0;\n break;\n case 'top-right':\n dirY = -1;\n dirX = 1;\n break;\n case 'right':\n dirY = 0;\n dirX = 1;\n break;\n case 'bottom-right':\n dirY = 1;\n dirX = 1;\n break;\n case 'bottom':\n dirY = 1;\n dirX = 0;\n break;\n case 'bottom-left':\n dirY = 1;\n dirX = -1;\n break;\n case 'left':\n dirY = 0;\n dirX = -1;\n break;\n default:\n Util_1.Util.error('Unknown emboss direction: ' + direction);\n }\n do {\n var offsetY = (y - 1) * w4;\n var otherY = dirY;\n if (y + otherY < 1) {\n otherY = 0;\n }\n if (y + otherY > h) {\n otherY = 0;\n }\n var offsetYOther = (y - 1 + otherY) * w * 4;\n var x = w;\n do {\n var offset = offsetY + (x - 1) * 4;\n var otherX = dirX;\n if (x + otherX < 1) {\n otherX = 0;\n }\n if (x + otherX > w) {\n otherX = 0;\n }\n var offsetOther = offsetYOther + (x - 1 + otherX) * 4;\n var dR = data[offset] - data[offsetOther];\n var dG = data[offset + 1] - data[offsetOther + 1];\n var dB = data[offset + 2] - data[offsetOther + 2];\n var dif = dR;\n var absDif = dif > 0 ? dif : -dif;\n var absG = dG > 0 ? dG : -dG;\n var absB = dB > 0 ? dB : -dB;\n if (absG > absDif) {\n dif = dG;\n }\n if (absB > absDif) {\n dif = dB;\n }\n dif *= strength;\n if (blend) {\n var r = data[offset] + dif;\n var g = data[offset + 1] + dif;\n var b = data[offset + 2] + dif;\n data[offset] = r > 255 ? 255 : r < 0 ? 0 : r;\n data[offset + 1] = g > 255 ? 255 : g < 0 ? 0 : g;\n data[offset + 2] = b > 255 ? 255 : b < 0 ? 0 : b;\n }\n else {\n var grey = greyLevel - dif;\n if (grey < 0) {\n grey = 0;\n }\n else if (grey > 255) {\n grey = 255;\n }\n data[offset] = data[offset + 1] = data[offset + 2] = grey;\n }\n } while (--x);\n } while (--y);\n};\nexports.Emboss = Emboss;\nFactory_1.Factory.addGetterSetter(Node_1.Node, 'embossStrength', 0.5, (0, Validators_1.getNumberValidator)(), Factory_1.Factory.afterSetFilter);\nFactory_1.Factory.addGetterSetter(Node_1.Node, 'embossWhiteLevel', 0.5, (0, Validators_1.getNumberValidator)(), Factory_1.Factory.afterSetFilter);\nFactory_1.Factory.addGetterSetter(Node_1.Node, 'embossDirection', 'top-left', null, Factory_1.Factory.afterSetFilter);\nFactory_1.Factory.addGetterSetter(Node_1.Node, 'embossBlend', false, null, Factory_1.Factory.afterSetFilter);\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Enhance = void 0;\nconst Factory_1 = require(\"../Factory\");\nconst Node_1 = require(\"../Node\");\nconst Validators_1 = require(\"../Validators\");\nfunction remap(fromValue, fromMin, fromMax, toMin, toMax) {\n var fromRange = fromMax - fromMin, toRange = toMax - toMin, toValue;\n if (fromRange === 0) {\n return toMin + toRange / 2;\n }\n if (toRange === 0) {\n return toMin;\n }\n toValue = (fromValue - fromMin) / fromRange;\n toValue = toRange * toValue + toMin;\n return toValue;\n}\nconst Enhance = function (imageData) {\n var data = imageData.data, nSubPixels = data.length, rMin = data[0], rMax = rMin, r, gMin = data[1], gMax = gMin, g, bMin = data[2], bMax = bMin, b, i;\n var enhanceAmount = this.enhance();\n if (enhanceAmount === 0) {\n return;\n }\n for (i = 0; i < nSubPixels; i += 4) {\n r = data[i + 0];\n if (r < rMin) {\n rMin = r;\n }\n else if (r > rMax) {\n rMax = r;\n }\n g = data[i + 1];\n if (g < gMin) {\n gMin = g;\n }\n else if (g > gMax) {\n gMax = g;\n }\n b = data[i + 2];\n if (b < bMin) {\n bMin = b;\n }\n else if (b > bMax) {\n bMax = b;\n }\n }\n if (rMax === rMin) {\n rMax = 255;\n rMin = 0;\n }\n if (gMax === gMin) {\n gMax = 255;\n gMin = 0;\n }\n if (bMax === bMin) {\n bMax = 255;\n bMin = 0;\n }\n var rMid, rGoalMax, rGoalMin, gMid, gGoalMax, gGoalMin, bMid, bGoalMax, bGoalMin;\n if (enhanceAmount > 0) {\n rGoalMax = rMax + enhanceAmount * (255 - rMax);\n rGoalMin = rMin - enhanceAmount * (rMin - 0);\n gGoalMax = gMax + enhanceAmount * (255 - gMax);\n gGoalMin = gMin - enhanceAmount * (gMin - 0);\n bGoalMax = bMax + enhanceAmount * (255 - bMax);\n bGoalMin = bMin - enhanceAmount * (bMin - 0);\n }\n else {\n rMid = (rMax + rMin) * 0.5;\n rGoalMax = rMax + enhanceAmount * (rMax - rMid);\n rGoalMin = rMin + enhanceAmount * (rMin - rMid);\n gMid = (gMax + gMin) * 0.5;\n gGoalMax = gMax + enhanceAmount * (gMax - gMid);\n gGoalMin = gMin + enhanceAmount * (gMin - gMid);\n bMid = (bMax + bMin) * 0.5;\n bGoalMax = bMax + enhanceAmount * (bMax - bMid);\n bGoalMin = bMin + enhanceAmount * (bMin - bMid);\n }\n for (i = 0; i < nSubPixels; i += 4) {\n data[i + 0] = remap(data[i + 0], rMin, rMax, rGoalMin, rGoalMax);\n data[i + 1] = remap(data[i + 1], gMin, gMax, gGoalMin, gGoalMax);\n data[i + 2] = remap(data[i + 2], bMin, bMax, bGoalMin, bGoalMax);\n }\n};\nexports.Enhance = Enhance;\nFactory_1.Factory.addGetterSetter(Node_1.Node, 'enhance', 0, (0, Validators_1.getNumberValidator)(), Factory_1.Factory.afterSetFilter);\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Grayscale = void 0;\nconst Grayscale = function (imageData) {\n var data = imageData.data, len = data.length, i, brightness;\n for (i = 0; i < len; i += 4) {\n brightness = 0.34 * data[i] + 0.5 * data[i + 1] + 0.16 * data[i + 2];\n data[i] = brightness;\n data[i + 1] = brightness;\n data[i + 2] = brightness;\n }\n};\nexports.Grayscale = Grayscale;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.HSL = void 0;\nconst Factory_1 = require(\"../Factory\");\nconst Node_1 = require(\"../Node\");\nconst Validators_1 = require(\"../Validators\");\nFactory_1.Factory.addGetterSetter(Node_1.Node, 'hue', 0, (0, Validators_1.getNumberValidator)(), Factory_1.Factory.afterSetFilter);\nFactory_1.Factory.addGetterSetter(Node_1.Node, 'saturation', 0, (0, Validators_1.getNumberValidator)(), Factory_1.Factory.afterSetFilter);\nFactory_1.Factory.addGetterSetter(Node_1.Node, 'luminance', 0, (0, Validators_1.getNumberValidator)(), Factory_1.Factory.afterSetFilter);\nconst HSL = function (imageData) {\n var data = imageData.data, nPixels = data.length, v = 1, s = Math.pow(2, this.saturation()), h = Math.abs(this.hue() + 360) % 360, l = this.luminance() * 127, i;\n var vsu = v * s * Math.cos((h * Math.PI) / 180), vsw = v * s * Math.sin((h * Math.PI) / 180);\n var rr = 0.299 * v + 0.701 * vsu + 0.167 * vsw, rg = 0.587 * v - 0.587 * vsu + 0.33 * vsw, rb = 0.114 * v - 0.114 * vsu - 0.497 * vsw;\n var gr = 0.299 * v - 0.299 * vsu - 0.328 * vsw, gg = 0.587 * v + 0.413 * vsu + 0.035 * vsw, gb = 0.114 * v - 0.114 * vsu + 0.293 * vsw;\n var br = 0.299 * v - 0.3 * vsu + 1.25 * vsw, bg = 0.587 * v - 0.586 * vsu - 1.05 * vsw, bb = 0.114 * v + 0.886 * vsu - 0.2 * vsw;\n var r, g, b, a;\n for (i = 0; i < nPixels; i += 4) {\n r = data[i + 0];\n g = data[i + 1];\n b = data[i + 2];\n a = data[i + 3];\n data[i + 0] = rr * r + rg * g + rb * b + l;\n data[i + 1] = gr * r + gg * g + gb * b + l;\n data[i + 2] = br * r + bg * g + bb * b + l;\n data[i + 3] = a;\n }\n};\nexports.HSL = HSL;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.HSV = void 0;\nconst Factory_1 = require(\"../Factory\");\nconst Node_1 = require(\"../Node\");\nconst Validators_1 = require(\"../Validators\");\nconst HSV = function (imageData) {\n var data = imageData.data, nPixels = data.length, v = Math.pow(2, this.value()), s = Math.pow(2, this.saturation()), h = Math.abs(this.hue() + 360) % 360, i;\n var vsu = v * s * Math.cos((h * Math.PI) / 180), vsw = v * s * Math.sin((h * Math.PI) / 180);\n var rr = 0.299 * v + 0.701 * vsu + 0.167 * vsw, rg = 0.587 * v - 0.587 * vsu + 0.33 * vsw, rb = 0.114 * v - 0.114 * vsu - 0.497 * vsw;\n var gr = 0.299 * v - 0.299 * vsu - 0.328 * vsw, gg = 0.587 * v + 0.413 * vsu + 0.035 * vsw, gb = 0.114 * v - 0.114 * vsu + 0.293 * vsw;\n var br = 0.299 * v - 0.3 * vsu + 1.25 * vsw, bg = 0.587 * v - 0.586 * vsu - 1.05 * vsw, bb = 0.114 * v + 0.886 * vsu - 0.2 * vsw;\n var r, g, b, a;\n for (i = 0; i < nPixels; i += 4) {\n r = data[i + 0];\n g = data[i + 1];\n b = data[i + 2];\n a = data[i + 3];\n data[i + 0] = rr * r + rg * g + rb * b;\n data[i + 1] = gr * r + gg * g + gb * b;\n data[i + 2] = br * r + bg * g + bb * b;\n data[i + 3] = a;\n }\n};\nexports.HSV = HSV;\nFactory_1.Factory.addGetterSetter(Node_1.Node, 'hue', 0, (0, Validators_1.getNumberValidator)(), Factory_1.Factory.afterSetFilter);\nFactory_1.Factory.addGetterSetter(Node_1.Node, 'saturation', 0, (0, Validators_1.getNumberValidator)(), Factory_1.Factory.afterSetFilter);\nFactory_1.Factory.addGetterSetter(Node_1.Node, 'value', 0, (0, Validators_1.getNumberValidator)(), Factory_1.Factory.afterSetFilter);\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Invert = void 0;\nconst Invert = function (imageData) {\n var data = imageData.data, len = data.length, i;\n for (i = 0; i < len; i += 4) {\n data[i] = 255 - data[i];\n data[i + 1] = 255 - data[i + 1];\n data[i + 2] = 255 - data[i + 2];\n }\n};\nexports.Invert = Invert;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Kaleidoscope = void 0;\nconst Factory_1 = require(\"../Factory\");\nconst Node_1 = require(\"../Node\");\nconst Util_1 = require(\"../Util\");\nconst Validators_1 = require(\"../Validators\");\nvar ToPolar = function (src, dst, opt) {\n var srcPixels = src.data, dstPixels = dst.data, xSize = src.width, ySize = src.height, xMid = opt.polarCenterX || xSize / 2, yMid = opt.polarCenterY || ySize / 2, i, x, y, r = 0, g = 0, b = 0, a = 0;\n var rad, rMax = Math.sqrt(xMid * xMid + yMid * yMid);\n x = xSize - xMid;\n y = ySize - yMid;\n rad = Math.sqrt(x * x + y * y);\n rMax = rad > rMax ? rad : rMax;\n var rSize = ySize, tSize = xSize, radius, theta;\n var conversion = ((360 / tSize) * Math.PI) / 180, sin, cos;\n for (theta = 0; theta < tSize; theta += 1) {\n sin = Math.sin(theta * conversion);\n cos = Math.cos(theta * conversion);\n for (radius = 0; radius < rSize; radius += 1) {\n x = Math.floor(xMid + ((rMax * radius) / rSize) * cos);\n y = Math.floor(yMid + ((rMax * radius) / rSize) * sin);\n i = (y * xSize + x) * 4;\n r = srcPixels[i + 0];\n g = srcPixels[i + 1];\n b = srcPixels[i + 2];\n a = srcPixels[i + 3];\n i = (theta + radius * xSize) * 4;\n dstPixels[i + 0] = r;\n dstPixels[i + 1] = g;\n dstPixels[i + 2] = b;\n dstPixels[i + 3] = a;\n }\n }\n};\nvar FromPolar = function (src, dst, opt) {\n var srcPixels = src.data, dstPixels = dst.data, xSize = src.width, ySize = src.height, xMid = opt.polarCenterX || xSize / 2, yMid = opt.polarCenterY || ySize / 2, i, x, y, dx, dy, r = 0, g = 0, b = 0, a = 0;\n var rad, rMax = Math.sqrt(xMid * xMid + yMid * yMid);\n x = xSize - xMid;\n y = ySize - yMid;\n rad = Math.sqrt(x * x + y * y);\n rMax = rad > rMax ? rad : rMax;\n var rSize = ySize, tSize = xSize, radius, theta, phaseShift = opt.polarRotation || 0;\n var x1, y1;\n for (x = 0; x < xSize; x += 1) {\n for (y = 0; y < ySize; y += 1) {\n dx = x - xMid;\n dy = y - yMid;\n radius = (Math.sqrt(dx * dx + dy * dy) * rSize) / rMax;\n theta = ((Math.atan2(dy, dx) * 180) / Math.PI + 360 + phaseShift) % 360;\n theta = (theta * tSize) / 360;\n x1 = Math.floor(theta);\n y1 = Math.floor(radius);\n i = (y1 * xSize + x1) * 4;\n r = srcPixels[i + 0];\n g = srcPixels[i + 1];\n b = srcPixels[i + 2];\n a = srcPixels[i + 3];\n i = (y * xSize + x) * 4;\n dstPixels[i + 0] = r;\n dstPixels[i + 1] = g;\n dstPixels[i + 2] = b;\n dstPixels[i + 3] = a;\n }\n }\n};\nconst Kaleidoscope = function (imageData) {\n var xSize = imageData.width, ySize = imageData.height;\n var x, y, xoff, i, r, g, b, a, srcPos, dstPos;\n var power = Math.round(this.kaleidoscopePower());\n var angle = Math.round(this.kaleidoscopeAngle());\n var offset = Math.floor((xSize * (angle % 360)) / 360);\n if (power < 1) {\n return;\n }\n var tempCanvas = Util_1.Util.createCanvasElement();\n tempCanvas.width = xSize;\n tempCanvas.height = ySize;\n var scratchData = tempCanvas\n .getContext('2d')\n .getImageData(0, 0, xSize, ySize);\n Util_1.Util.releaseCanvas(tempCanvas);\n ToPolar(imageData, scratchData, {\n polarCenterX: xSize / 2,\n polarCenterY: ySize / 2,\n });\n var minSectionSize = xSize / Math.pow(2, power);\n while (minSectionSize <= 8) {\n minSectionSize = minSectionSize * 2;\n power -= 1;\n }\n minSectionSize = Math.ceil(minSectionSize);\n var sectionSize = minSectionSize;\n var xStart = 0, xEnd = sectionSize, xDelta = 1;\n if (offset + minSectionSize > xSize) {\n xStart = sectionSize;\n xEnd = 0;\n xDelta = -1;\n }\n for (y = 0; y < ySize; y += 1) {\n for (x = xStart; x !== xEnd; x += xDelta) {\n xoff = Math.round(x + offset) % xSize;\n srcPos = (xSize * y + xoff) * 4;\n r = scratchData.data[srcPos + 0];\n g = scratchData.data[srcPos + 1];\n b = scratchData.data[srcPos + 2];\n a = scratchData.data[srcPos + 3];\n dstPos = (xSize * y + x) * 4;\n scratchData.data[dstPos + 0] = r;\n scratchData.data[dstPos + 1] = g;\n scratchData.data[dstPos + 2] = b;\n scratchData.data[dstPos + 3] = a;\n }\n }\n for (y = 0; y < ySize; y += 1) {\n sectionSize = Math.floor(minSectionSize);\n for (i = 0; i < power; i += 1) {\n for (x = 0; x < sectionSize + 1; x += 1) {\n srcPos = (xSize * y + x) * 4;\n r = scratchData.data[srcPos + 0];\n g = scratchData.data[srcPos + 1];\n b = scratchData.data[srcPos + 2];\n a = scratchData.data[srcPos + 3];\n dstPos = (xSize * y + sectionSize * 2 - x - 1) * 4;\n scratchData.data[dstPos + 0] = r;\n scratchData.data[dstPos + 1] = g;\n scratchData.data[dstPos + 2] = b;\n scratchData.data[dstPos + 3] = a;\n }\n sectionSize *= 2;\n }\n }\n FromPolar(scratchData, imageData, { polarRotation: 0 });\n};\nexports.Kaleidoscope = Kaleidoscope;\nFactory_1.Factory.addGetterSetter(Node_1.Node, 'kaleidoscopePower', 2, (0, Validators_1.getNumberValidator)(), Factory_1.Factory.afterSetFilter);\nFactory_1.Factory.addGetterSetter(Node_1.Node, 'kaleidoscopeAngle', 0, (0, Validators_1.getNumberValidator)(), Factory_1.Factory.afterSetFilter);\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Mask = void 0;\nconst Factory_1 = require(\"../Factory\");\nconst Node_1 = require(\"../Node\");\nconst Validators_1 = require(\"../Validators\");\nfunction pixelAt(idata, x, y) {\n var idx = (y * idata.width + x) * 4;\n var d = [];\n d.push(idata.data[idx++], idata.data[idx++], idata.data[idx++], idata.data[idx++]);\n return d;\n}\nfunction rgbDistance(p1, p2) {\n return Math.sqrt(Math.pow(p1[0] - p2[0], 2) +\n Math.pow(p1[1] - p2[1], 2) +\n Math.pow(p1[2] - p2[2], 2));\n}\nfunction rgbMean(pTab) {\n var m = [0, 0, 0];\n for (var i = 0; i < pTab.length; i++) {\n m[0] += pTab[i][0];\n m[1] += pTab[i][1];\n m[2] += pTab[i][2];\n }\n m[0] /= pTab.length;\n m[1] /= pTab.length;\n m[2] /= pTab.length;\n return m;\n}\nfunction backgroundMask(idata, threshold) {\n var rgbv_no = pixelAt(idata, 0, 0);\n var rgbv_ne = pixelAt(idata, idata.width - 1, 0);\n var rgbv_so = pixelAt(idata, 0, idata.height - 1);\n var rgbv_se = pixelAt(idata, idata.width - 1, idata.height - 1);\n var thres = threshold || 10;\n if (rgbDistance(rgbv_no, rgbv_ne) < thres &&\n rgbDistance(rgbv_ne, rgbv_se) < thres &&\n rgbDistance(rgbv_se, rgbv_so) < thres &&\n rgbDistance(rgbv_so, rgbv_no) < thres) {\n var mean = rgbMean([rgbv_ne, rgbv_no, rgbv_se, rgbv_so]);\n var mask = [];\n for (var i = 0; i < idata.width * idata.height; i++) {\n var d = rgbDistance(mean, [\n idata.data[i * 4],\n idata.data[i * 4 + 1],\n idata.data[i * 4 + 2],\n ]);\n mask[i] = d < thres ? 0 : 255;\n }\n return mask;\n }\n}\nfunction applyMask(idata, mask) {\n for (var i = 0; i < idata.width * idata.height; i++) {\n idata.data[4 * i + 3] = mask[i];\n }\n}\nfunction erodeMask(mask, sw, sh) {\n var weights = [1, 1, 1, 1, 0, 1, 1, 1, 1];\n var side = Math.round(Math.sqrt(weights.length));\n var halfSide = Math.floor(side / 2);\n var maskResult = [];\n for (var y = 0; y < sh; y++) {\n for (var x = 0; x < sw; x++) {\n var so = y * sw + x;\n var a = 0;\n for (var cy = 0; cy < side; cy++) {\n for (var cx = 0; cx < side; cx++) {\n var scy = y + cy - halfSide;\n var scx = x + cx - halfSide;\n if (scy >= 0 && scy < sh && scx >= 0 && scx < sw) {\n var srcOff = scy * sw + scx;\n var wt = weights[cy * side + cx];\n a += mask[srcOff] * wt;\n }\n }\n }\n maskResult[so] = a === 255 * 8 ? 255 : 0;\n }\n }\n return maskResult;\n}\nfunction dilateMask(mask, sw, sh) {\n var weights = [1, 1, 1, 1, 1, 1, 1, 1, 1];\n var side = Math.round(Math.sqrt(weights.length));\n var halfSide = Math.floor(side / 2);\n var maskResult = [];\n for (var y = 0; y < sh; y++) {\n for (var x = 0; x < sw; x++) {\n var so = y * sw + x;\n var a = 0;\n for (var cy = 0; cy < side; cy++) {\n for (var cx = 0; cx < side; cx++) {\n var scy = y + cy - halfSide;\n var scx = x + cx - halfSide;\n if (scy >= 0 && scy < sh && scx >= 0 && scx < sw) {\n var srcOff = scy * sw + scx;\n var wt = weights[cy * side + cx];\n a += mask[srcOff] * wt;\n }\n }\n }\n maskResult[so] = a >= 255 * 4 ? 255 : 0;\n }\n }\n return maskResult;\n}\nfunction smoothEdgeMask(mask, sw, sh) {\n var weights = [1 / 9, 1 / 9, 1 / 9, 1 / 9, 1 / 9, 1 / 9, 1 / 9, 1 / 9, 1 / 9];\n var side = Math.round(Math.sqrt(weights.length));\n var halfSide = Math.floor(side / 2);\n var maskResult = [];\n for (var y = 0; y < sh; y++) {\n for (var x = 0; x < sw; x++) {\n var so = y * sw + x;\n var a = 0;\n for (var cy = 0; cy < side; cy++) {\n for (var cx = 0; cx < side; cx++) {\n var scy = y + cy - halfSide;\n var scx = x + cx - halfSide;\n if (scy >= 0 && scy < sh && scx >= 0 && scx < sw) {\n var srcOff = scy * sw + scx;\n var wt = weights[cy * side + cx];\n a += mask[srcOff] * wt;\n }\n }\n }\n maskResult[so] = a;\n }\n }\n return maskResult;\n}\nconst Mask = function (imageData) {\n var threshold = this.threshold(), mask = backgroundMask(imageData, threshold);\n if (mask) {\n mask = erodeMask(mask, imageData.width, imageData.height);\n mask = dilateMask(mask, imageData.width, imageData.height);\n mask = smoothEdgeMask(mask, imageData.width, imageData.height);\n applyMask(imageData, mask);\n }\n return imageData;\n};\nexports.Mask = Mask;\nFactory_1.Factory.addGetterSetter(Node_1.Node, 'threshold', 0, (0, Validators_1.getNumberValidator)(), Factory_1.Factory.afterSetFilter);\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Noise = void 0;\nconst Factory_1 = require(\"../Factory\");\nconst Node_1 = require(\"../Node\");\nconst Validators_1 = require(\"../Validators\");\nconst Noise = function (imageData) {\n var amount = this.noise() * 255, data = imageData.data, nPixels = data.length, half = amount / 2, i;\n for (i = 0; i < nPixels; i += 4) {\n data[i + 0] += half - 2 * half * Math.random();\n data[i + 1] += half - 2 * half * Math.random();\n data[i + 2] += half - 2 * half * Math.random();\n }\n};\nexports.Noise = Noise;\nFactory_1.Factory.addGetterSetter(Node_1.Node, 'noise', 0.2, (0, Validators_1.getNumberValidator)(), Factory_1.Factory.afterSetFilter);\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Pixelate = void 0;\nconst Factory_1 = require(\"../Factory\");\nconst Util_1 = require(\"../Util\");\nconst Node_1 = require(\"../Node\");\nconst Validators_1 = require(\"../Validators\");\nconst Pixelate = function (imageData) {\n var pixelSize = Math.ceil(this.pixelSize()), width = imageData.width, height = imageData.height, x, y, i, red, green, blue, alpha, nBinsX = Math.ceil(width / pixelSize), nBinsY = Math.ceil(height / pixelSize), xBinStart, xBinEnd, yBinStart, yBinEnd, xBin, yBin, pixelsInBin, data = imageData.data;\n if (pixelSize <= 0) {\n Util_1.Util.error('pixelSize value can not be <= 0');\n return;\n }\n for (xBin = 0; xBin < nBinsX; xBin += 1) {\n for (yBin = 0; yBin < nBinsY; yBin += 1) {\n red = 0;\n green = 0;\n blue = 0;\n alpha = 0;\n xBinStart = xBin * pixelSize;\n xBinEnd = xBinStart + pixelSize;\n yBinStart = yBin * pixelSize;\n yBinEnd = yBinStart + pixelSize;\n pixelsInBin = 0;\n for (x = xBinStart; x < xBinEnd; x += 1) {\n if (x >= width) {\n continue;\n }\n for (y = yBinStart; y < yBinEnd; y += 1) {\n if (y >= height) {\n continue;\n }\n i = (width * y + x) * 4;\n red += data[i + 0];\n green += data[i + 1];\n blue += data[i + 2];\n alpha += data[i + 3];\n pixelsInBin += 1;\n }\n }\n red = red / pixelsInBin;\n green = green / pixelsInBin;\n blue = blue / pixelsInBin;\n alpha = alpha / pixelsInBin;\n for (x = xBinStart; x < xBinEnd; x += 1) {\n if (x >= width) {\n continue;\n }\n for (y = yBinStart; y < yBinEnd; y += 1) {\n if (y >= height) {\n continue;\n }\n i = (width * y + x) * 4;\n data[i + 0] = red;\n data[i + 1] = green;\n data[i + 2] = blue;\n data[i + 3] = alpha;\n }\n }\n }\n }\n};\nexports.Pixelate = Pixelate;\nFactory_1.Factory.addGetterSetter(Node_1.Node, 'pixelSize', 8, (0, Validators_1.getNumberValidator)(), Factory_1.Factory.afterSetFilter);\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Posterize = void 0;\nconst Factory_1 = require(\"../Factory\");\nconst Node_1 = require(\"../Node\");\nconst Validators_1 = require(\"../Validators\");\nconst Posterize = function (imageData) {\n var levels = Math.round(this.levels() * 254) + 1, data = imageData.data, len = data.length, scale = 255 / levels, i;\n for (i = 0; i < len; i += 1) {\n data[i] = Math.floor(data[i] / scale) * scale;\n }\n};\nexports.Posterize = Posterize;\nFactory_1.Factory.addGetterSetter(Node_1.Node, 'levels', 0.5, (0, Validators_1.getNumberValidator)(), Factory_1.Factory.afterSetFilter);\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.RGB = void 0;\nconst Factory_1 = require(\"../Factory\");\nconst Node_1 = require(\"../Node\");\nconst Validators_1 = require(\"../Validators\");\nconst RGB = function (imageData) {\n var data = imageData.data, nPixels = data.length, red = this.red(), green = this.green(), blue = this.blue(), i, brightness;\n for (i = 0; i < nPixels; i += 4) {\n brightness =\n (0.34 * data[i] + 0.5 * data[i + 1] + 0.16 * data[i + 2]) / 255;\n data[i] = brightness * red;\n data[i + 1] = brightness * green;\n data[i + 2] = brightness * blue;\n data[i + 3] = data[i + 3];\n }\n};\nexports.RGB = RGB;\nFactory_1.Factory.addGetterSetter(Node_1.Node, 'red', 0, function (val) {\n this._filterUpToDate = false;\n if (val > 255) {\n return 255;\n }\n else if (val < 0) {\n return 0;\n }\n else {\n return Math.round(val);\n }\n});\nFactory_1.Factory.addGetterSetter(Node_1.Node, 'green', 0, function (val) {\n this._filterUpToDate = false;\n if (val > 255) {\n return 255;\n }\n else if (val < 0) {\n return 0;\n }\n else {\n return Math.round(val);\n }\n});\nFactory_1.Factory.addGetterSetter(Node_1.Node, 'blue', 0, Validators_1.RGBComponent, Factory_1.Factory.afterSetFilter);\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.RGBA = void 0;\nconst Factory_1 = require(\"../Factory\");\nconst Node_1 = require(\"../Node\");\nconst Validators_1 = require(\"../Validators\");\nconst RGBA = function (imageData) {\n var data = imageData.data, nPixels = data.length, red = this.red(), green = this.green(), blue = this.blue(), alpha = this.alpha(), i, ia;\n for (i = 0; i < nPixels; i += 4) {\n ia = 1 - alpha;\n data[i] = red * alpha + data[i] * ia;\n data[i + 1] = green * alpha + data[i + 1] * ia;\n data[i + 2] = blue * alpha + data[i + 2] * ia;\n }\n};\nexports.RGBA = RGBA;\nFactory_1.Factory.addGetterSetter(Node_1.Node, 'red', 0, function (val) {\n this._filterUpToDate = false;\n if (val > 255) {\n return 255;\n }\n else if (val < 0) {\n return 0;\n }\n else {\n return Math.round(val);\n }\n});\nFactory_1.Factory.addGetterSetter(Node_1.Node, 'green', 0, function (val) {\n this._filterUpToDate = false;\n if (val > 255) {\n return 255;\n }\n else if (val < 0) {\n return 0;\n }\n else {\n return Math.round(val);\n }\n});\nFactory_1.Factory.addGetterSetter(Node_1.Node, 'blue', 0, Validators_1.RGBComponent, Factory_1.Factory.afterSetFilter);\nFactory_1.Factory.addGetterSetter(Node_1.Node, 'alpha', 1, function (val) {\n this._filterUpToDate = false;\n if (val > 1) {\n return 1;\n }\n else if (val < 0) {\n return 0;\n }\n else {\n return val;\n }\n});\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Sepia = void 0;\nconst Sepia = function (imageData) {\n var data = imageData.data, nPixels = data.length, i, r, g, b;\n for (i = 0; i < nPixels; i += 4) {\n r = data[i + 0];\n g = data[i + 1];\n b = data[i + 2];\n data[i + 0] = Math.min(255, r * 0.393 + g * 0.769 + b * 0.189);\n data[i + 1] = Math.min(255, r * 0.349 + g * 0.686 + b * 0.168);\n data[i + 2] = Math.min(255, r * 0.272 + g * 0.534 + b * 0.131);\n }\n};\nexports.Sepia = Sepia;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Solarize = void 0;\nconst Solarize = function (imageData) {\n var data = imageData.data, w = imageData.width, h = imageData.height, w4 = w * 4, y = h;\n do {\n var offsetY = (y - 1) * w4;\n var x = w;\n do {\n var offset = offsetY + (x - 1) * 4;\n var r = data[offset];\n var g = data[offset + 1];\n var b = data[offset + 2];\n if (r > 127) {\n r = 255 - r;\n }\n if (g > 127) {\n g = 255 - g;\n }\n if (b > 127) {\n b = 255 - b;\n }\n data[offset] = r;\n data[offset + 1] = g;\n data[offset + 2] = b;\n } while (--x);\n } while (--y);\n};\nexports.Solarize = Solarize;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Threshold = void 0;\nconst Factory_1 = require(\"../Factory\");\nconst Node_1 = require(\"../Node\");\nconst Validators_1 = require(\"../Validators\");\nconst Threshold = function (imageData) {\n var level = this.threshold() * 255, data = imageData.data, len = data.length, i;\n for (i = 0; i < len; i += 1) {\n data[i] = data[i] < level ? 0 : 255;\n }\n};\nexports.Threshold = Threshold;\nFactory_1.Factory.addGetterSetter(Node_1.Node, 'threshold', 0.5, (0, Validators_1.getNumberValidator)(), Factory_1.Factory.afterSetFilter);\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Konva = void 0;\nconst _CoreInternals_1 = require(\"./_CoreInternals\");\nconst Arc_1 = require(\"./shapes/Arc\");\nconst Arrow_1 = require(\"./shapes/Arrow\");\nconst Circle_1 = require(\"./shapes/Circle\");\nconst Ellipse_1 = require(\"./shapes/Ellipse\");\nconst Image_1 = require(\"./shapes/Image\");\nconst Label_1 = require(\"./shapes/Label\");\nconst Line_1 = require(\"./shapes/Line\");\nconst Path_1 = require(\"./shapes/Path\");\nconst Rect_1 = require(\"./shapes/Rect\");\nconst RegularPolygon_1 = require(\"./shapes/RegularPolygon\");\nconst Ring_1 = require(\"./shapes/Ring\");\nconst Sprite_1 = require(\"./shapes/Sprite\");\nconst Star_1 = require(\"./shapes/Star\");\nconst Text_1 = require(\"./shapes/Text\");\nconst TextPath_1 = require(\"./shapes/TextPath\");\nconst Transformer_1 = require(\"./shapes/Transformer\");\nconst Wedge_1 = require(\"./shapes/Wedge\");\nconst Blur_1 = require(\"./filters/Blur\");\nconst Brighten_1 = require(\"./filters/Brighten\");\nconst Contrast_1 = require(\"./filters/Contrast\");\nconst Emboss_1 = require(\"./filters/Emboss\");\nconst Enhance_1 = require(\"./filters/Enhance\");\nconst Grayscale_1 = require(\"./filters/Grayscale\");\nconst HSL_1 = require(\"./filters/HSL\");\nconst HSV_1 = require(\"./filters/HSV\");\nconst Invert_1 = require(\"./filters/Invert\");\nconst Kaleidoscope_1 = require(\"./filters/Kaleidoscope\");\nconst Mask_1 = require(\"./filters/Mask\");\nconst Noise_1 = require(\"./filters/Noise\");\nconst Pixelate_1 = require(\"./filters/Pixelate\");\nconst Posterize_1 = require(\"./filters/Posterize\");\nconst RGB_1 = require(\"./filters/RGB\");\nconst RGBA_1 = require(\"./filters/RGBA\");\nconst Sepia_1 = require(\"./filters/Sepia\");\nconst Solarize_1 = require(\"./filters/Solarize\");\nconst Threshold_1 = require(\"./filters/Threshold\");\nexports.Konva = _CoreInternals_1.Konva.Util._assign(_CoreInternals_1.Konva, {\n Arc: Arc_1.Arc,\n Arrow: Arrow_1.Arrow,\n Circle: Circle_1.Circle,\n Ellipse: Ellipse_1.Ellipse,\n Image: Image_1.Image,\n Label: Label_1.Label,\n Tag: Label_1.Tag,\n Line: Line_1.Line,\n Path: Path_1.Path,\n Rect: Rect_1.Rect,\n RegularPolygon: RegularPolygon_1.RegularPolygon,\n Ring: Ring_1.Ring,\n Sprite: Sprite_1.Sprite,\n Star: Star_1.Star,\n Text: Text_1.Text,\n TextPath: TextPath_1.TextPath,\n Transformer: Transformer_1.Transformer,\n Wedge: Wedge_1.Wedge,\n Filters: {\n Blur: Blur_1.Blur,\n Brighten: Brighten_1.Brighten,\n Contrast: Contrast_1.Contrast,\n Emboss: Emboss_1.Emboss,\n Enhance: Enhance_1.Enhance,\n Grayscale: Grayscale_1.Grayscale,\n HSL: HSL_1.HSL,\n HSV: HSV_1.HSV,\n Invert: Invert_1.Invert,\n Kaleidoscope: Kaleidoscope_1.Kaleidoscope,\n Mask: Mask_1.Mask,\n Noise: Noise_1.Noise,\n Pixelate: Pixelate_1.Pixelate,\n Posterize: Posterize_1.Posterize,\n RGB: RGB_1.RGB,\n RGBA: RGBA_1.RGBA,\n Sepia: Sepia_1.Sepia,\n Solarize: Solarize_1.Solarize,\n Threshold: Threshold_1.Threshold,\n },\n});\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst _FullInternals_1 = require(\"./_FullInternals\");\nmodule.exports = _FullInternals_1.Konva;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Konva = void 0;\nvar _CoreInternals_1 = require(\"./_CoreInternals\");\nObject.defineProperty(exports, \"Konva\", { enumerable: true, get: function () { return _CoreInternals_1.Konva; } });\nconst _CoreInternals_2 = require(\"./_CoreInternals\");\nmodule.exports = _CoreInternals_2.Konva;\n","/**\n * @license React\n * react-reconciler.production.min.js\n *\n * Copyright (c) Facebook, Inc. and its affiliates.\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 */\nmodule.exports = function $$$reconciler($$$hostConfig) {\n var exports = {};\n'use strict';var aa=require(\"react\"),ba=require(\"scheduler\"),ca=Object.assign;function n(a){for(var b=\"https://reactjs.org/docs/error-decoder.html?invariant=\"+a,c=1;ch||e[g]!==f[h]){var k=\"\\n\"+e[g].replace(\" at new \",\" at \");a.displayName&&k.includes(\"\")&&(k=k.replace(\"\",a.displayName));return k}while(1<=g&&0<=h)}break}}}finally{dc=!1,Error.prepareStackTrace=c}return(a=a?a.displayName||a.name:\"\")?cc(a):\"\"}var fc=Object.prototype.hasOwnProperty,gc=[],hc=-1;function ic(a){return{current:a}}\nfunction q(a){0>hc||(a.current=gc[hc],gc[hc]=null,hc--)}function v(a,b){hc++;gc[hc]=a.current;a.current=b}var jc={},x=ic(jc),z=ic(!1),kc=jc;function mc(a,b){var c=a.type.contextTypes;if(!c)return jc;var d=a.stateNode;if(d&&d.__reactInternalMemoizedUnmaskedChildContext===b)return d.__reactInternalMemoizedMaskedChildContext;var e={},f;for(f in c)e[f]=b[f];d&&(a=a.stateNode,a.__reactInternalMemoizedUnmaskedChildContext=b,a.__reactInternalMemoizedMaskedChildContext=e);return e}\nfunction A(a){a=a.childContextTypes;return null!==a&&void 0!==a}function nc(){q(z);q(x)}function oc(a,b,c){if(x.current!==jc)throw Error(n(168));v(x,b);v(z,c)}function pc(a,b,c){var d=a.stateNode;b=b.childContextTypes;if(\"function\"!==typeof d.getChildContext)return c;d=d.getChildContext();for(var e in d)if(!(e in b))throw Error(n(108,va(a)||\"Unknown\",e));return ca({},c,d)}\nfunction qc(a){a=(a=a.stateNode)&&a.__reactInternalMemoizedMergedChildContext||jc;kc=x.current;v(x,a);v(z,z.current);return!0}function rc(a,b,c){var d=a.stateNode;if(!d)throw Error(n(169));c?(a=pc(a,b,kc),d.__reactInternalMemoizedMergedChildContext=a,q(z),q(x),v(x,a)):q(z);v(z,c)}var tc=Math.clz32?Math.clz32:sc,uc=Math.log,vc=Math.LN2;function sc(a){a>>>=0;return 0===a?32:31-(uc(a)/vc|0)|0}var wc=64,xc=4194304;\nfunction yc(a){switch(a&-a){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return a&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return a&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;\ndefault:return a}}function zc(a,b){var c=a.pendingLanes;if(0===c)return 0;var d=0,e=a.suspendedLanes,f=a.pingedLanes,g=c&268435455;if(0!==g){var h=g&~e;0!==h?d=yc(h):(f&=g,0!==f&&(d=yc(f)))}else g=c&~e,0!==g?d=yc(g):0!==f&&(d=yc(f));if(0===d)return 0;if(0!==b&&b!==d&&0===(b&e)&&(e=d&-d,f=b&-b,e>=f||16===e&&0!==(f&4194240)))return b;0!==(d&4)&&(d|=c&16);b=a.entangledLanes;if(0!==b)for(a=a.entanglements,b&=d;0c;c++)b.push(a);return b}\nfunction Fc(a,b,c){a.pendingLanes|=b;536870912!==b&&(a.suspendedLanes=0,a.pingedLanes=0);a=a.eventTimes;b=31-tc(b);a[b]=c}function Gc(a,b){var c=a.pendingLanes&~b;a.pendingLanes=b;a.suspendedLanes=0;a.pingedLanes=0;a.expiredLanes&=b;a.mutableReadLanes&=b;a.entangledLanes&=b;b=a.entanglements;var d=a.eventTimes;for(a=a.expirationTimes;0>=g;e-=g;id=1<<32-tc(b)+e|c<t?(E=u,u=null):E=u.sibling;var y=p(e,u,h[t],k);if(null===y){null===u&&(u=E);break}a&&u&&null===y.alternate&&b(e,u);g=f(y,g,t);null===m?l=y:m.sibling=y;m=y;u=E}if(t===h.length)return c(e,u),F&&kd(e,t),l;if(null===u){for(;tt?(E=m,m=null):E=m.sibling;var w=p(e,m,y.value,k);if(null===w){null===m&&(m=E);break}a&&m&&null===w.alternate&&b(e,m);g=f(w,g,t);null===u?l=w:u.sibling=w;u=w;m=E}if(y.done)return c(e,\nm),F&&kd(e,t),l;if(null===m){for(;!y.done;t++,y=h.next())y=r(e,y.value,k),null!==y&&(g=f(y,g,t),null===u?l=y:u.sibling=y,u=y);F&&kd(e,t);return l}for(m=d(e,m);!y.done;t++,y=h.next())y=B(m,e,t,y.value,k),null!==y&&(a&&null!==y.alternate&&m.delete(null===y.key?t:y.key),g=f(y,g,t),null===u?l=y:u.sibling=y,u=y);a&&m.forEach(function(a){return b(e,a)});F&&kd(e,t);return l}function ya(a,d,f,h){\"object\"===typeof f&&null!==f&&f.type===ha&&null===f.key&&(f=f.props.children);if(\"object\"===typeof f&&null!==\nf){switch(f.$$typeof){case ea:a:{for(var k=f.key,l=d;null!==l;){if(l.key===k){k=f.type;if(k===ha){if(7===l.tag){c(a,l.sibling);d=e(l,f.props.children);d.return=a;a=d;break a}}else if(l.elementType===k||\"object\"===typeof k&&null!==k&&k.$$typeof===qa&&Hd(k)===l.type){c(a,l.sibling);d=e(l,f.props);d.ref=Fd(a,l,f);d.return=a;a=d;break a}c(a,l);break}else b(a,l);l=l.sibling}f.type===ha?(d=Nd(f.props.children,a.mode,h,f.key),d.return=a,a=d):(h=Ld(f.type,f.key,f.props,null,a.mode,h),h.ref=Fd(a,d,f),h.return=\na,a=h)}return g(a);case fa:a:{for(l=f.key;null!==d;){if(d.key===l)if(4===d.tag&&d.stateNode.containerInfo===f.containerInfo&&d.stateNode.implementation===f.implementation){c(a,d.sibling);d=e(d,f.children||[]);d.return=a;a=d;break a}else{c(a,d);break}else b(a,d);d=d.sibling}d=Md(f,a.mode,h);d.return=a;a=d}return g(a);case qa:return l=f._init,ya(a,d,l(f._payload),h)}if(Da(f))return w(a,d,f,h);if(ta(f))return Y(a,d,f,h);Gd(a,f)}return\"string\"===typeof f&&\"\"!==f||\"number\"===typeof f?(f=\"\"+f,null!==d&&\n6===d.tag?(c(a,d.sibling),d=e(d,f),d.return=a,a=d):(c(a,d),d=Kd(f,a.mode,h),d.return=a,a=d),g(a)):c(a,d)}return ya}var Od=Id(!0),Pd=Id(!1),Qd=ic(null),Rd=null,Sd=null,Td=null;function Ud(){Td=Sd=Rd=null}function Vd(a,b,c){Sa?(v(Qd,b._currentValue),b._currentValue=c):(v(Qd,b._currentValue2),b._currentValue2=c)}function Wd(a){var b=Qd.current;q(Qd);Sa?a._currentValue=b:a._currentValue2=b}\nfunction Xd(a,b,c){for(;null!==a;){var d=a.alternate;(a.childLanes&b)!==b?(a.childLanes|=b,null!==d&&(d.childLanes|=b)):null!==d&&(d.childLanes&b)!==b&&(d.childLanes|=b);if(a===c)break;a=a.return}}function Yd(a,b){Rd=a;Td=Sd=null;a=a.dependencies;null!==a&&null!==a.firstContext&&(0!==(a.lanes&b)&&(G=!0),a.firstContext=null)}\nfunction Zd(a){var b=Sa?a._currentValue:a._currentValue2;if(Td!==a)if(a={context:a,memoizedValue:b,next:null},null===Sd){if(null===Rd)throw Error(n(308));Sd=a;Rd.dependencies={lanes:0,firstContext:a}}else Sd=Sd.next=a;return b}var $d=null;function ae(a){null===$d?$d=[a]:$d.push(a)}function be(a,b,c,d){var e=b.interleaved;null===e?(c.next=c,ae(b)):(c.next=e.next,e.next=c);b.interleaved=c;return ce(a,d)}\nfunction ce(a,b){a.lanes|=b;var c=a.alternate;null!==c&&(c.lanes|=b);c=a;for(a=a.return;null!==a;)a.childLanes|=b,c=a.alternate,null!==c&&(c.childLanes|=b),c=a,a=a.return;return 3===c.tag?c.stateNode:null}var de=!1;function ee(a){a.updateQueue={baseState:a.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}\nfunction fe(a,b){a=a.updateQueue;b.updateQueue===a&&(b.updateQueue={baseState:a.baseState,firstBaseUpdate:a.firstBaseUpdate,lastBaseUpdate:a.lastBaseUpdate,shared:a.shared,effects:a.effects})}function ge(a,b){return{eventTime:a,lane:b,tag:0,payload:null,callback:null,next:null}}\nfunction he(a,b,c){var d=a.updateQueue;if(null===d)return null;d=d.shared;if(0!==(H&2)){var e=d.pending;null===e?b.next=b:(b.next=e.next,e.next=b);d.pending=b;return ce(a,c)}e=d.interleaved;null===e?(b.next=b,ae(d)):(b.next=e.next,e.next=b);d.interleaved=b;return ce(a,c)}function ie(a,b,c){b=b.updateQueue;if(null!==b&&(b=b.shared,0!==(c&4194240))){var d=b.lanes;d&=a.pendingLanes;c|=d;b.lanes=c;Hc(a,c)}}\nfunction je(a,b){var c=a.updateQueue,d=a.alternate;if(null!==d&&(d=d.updateQueue,c===d)){var e=null,f=null;c=c.firstBaseUpdate;if(null!==c){do{var g={eventTime:c.eventTime,lane:c.lane,tag:c.tag,payload:c.payload,callback:c.callback,next:null};null===f?e=f=g:f=f.next=g;c=c.next}while(null!==c);null===f?e=f=b:f=f.next=b}else e=f=b;c={baseState:d.baseState,firstBaseUpdate:e,lastBaseUpdate:f,shared:d.shared,effects:d.effects};a.updateQueue=c;return}a=c.lastBaseUpdate;null===a?c.firstBaseUpdate=b:a.next=\nb;c.lastBaseUpdate=b}\nfunction ke(a,b,c,d){var e=a.updateQueue;de=!1;var f=e.firstBaseUpdate,g=e.lastBaseUpdate,h=e.shared.pending;if(null!==h){e.shared.pending=null;var k=h,l=k.next;k.next=null;null===g?f=l:g.next=l;g=k;var m=a.alternate;null!==m&&(m=m.updateQueue,h=m.lastBaseUpdate,h!==g&&(null===h?m.firstBaseUpdate=l:h.next=l,m.lastBaseUpdate=k))}if(null!==f){var r=e.baseState;g=0;m=l=k=null;h=f;do{var p=h.lane,B=h.eventTime;if((d&p)===p){null!==m&&(m=m.next={eventTime:B,lane:0,tag:h.tag,payload:h.payload,callback:h.callback,\nnext:null});a:{var w=a,Y=h;p=b;B=c;switch(Y.tag){case 1:w=Y.payload;if(\"function\"===typeof w){r=w.call(B,r,p);break a}r=w;break a;case 3:w.flags=w.flags&-65537|128;case 0:w=Y.payload;p=\"function\"===typeof w?w.call(B,r,p):w;if(null===p||void 0===p)break a;r=ca({},r,p);break a;case 2:de=!0}}null!==h.callback&&0!==h.lane&&(a.flags|=64,p=e.effects,null===p?e.effects=[h]:p.push(h))}else B={eventTime:B,lane:p,tag:h.tag,payload:h.payload,callback:h.callback,next:null},null===m?(l=m=B,k=r):m=m.next=B,g|=\np;h=h.next;if(null===h)if(h=e.shared.pending,null===h)break;else p=h,h=p.next,p.next=null,e.lastBaseUpdate=p,e.shared.pending=null}while(1);null===m&&(k=r);e.baseState=k;e.firstBaseUpdate=l;e.lastBaseUpdate=m;b=e.shared.interleaved;if(null!==b){e=b;do g|=e.lane,e=e.next;while(e!==b)}else null===f&&(e.shared.lanes=0);le|=g;a.lanes=g;a.memoizedState=r}}\nfunction me(a,b,c){a=b.effects;b.effects=null;if(null!==a)for(b=0;bc?c:4;a(!0);var d=Ae.transition;Ae.transition={};try{a(!1),b()}finally{C=c,Ae.transition=d}}function rf(){return Oe().memoizedState}\nfunction sf(a,b,c){var d=tf(a);c={lane:d,action:c,hasEagerState:!1,eagerState:null,next:null};if(uf(a))vf(b,c);else if(c=be(a,b,c,d),null!==c){var e=O();af(c,a,d,e);wf(c,b,d)}}\nfunction cf(a,b,c){var d=tf(a),e={lane:d,action:c,hasEagerState:!1,eagerState:null,next:null};if(uf(a))vf(b,e);else{var f=a.alternate;if(0===a.lanes&&(null===f||0===f.lanes)&&(f=b.lastRenderedReducer,null!==f))try{var g=b.lastRenderedState,h=f(g,c);e.hasEagerState=!0;e.eagerState=h;if(Vc(h,g)){var k=b.interleaved;null===k?(e.next=e,ae(b)):(e.next=k.next,k.next=e);b.interleaved=e;return}}catch(l){}finally{}c=be(a,b,e,d);null!==c&&(e=O(),af(c,a,d,e),wf(c,b,d))}}\nfunction uf(a){var b=a.alternate;return a===J||null!==b&&b===J}function vf(a,b){De=Ce=!0;var c=a.pending;null===c?b.next=b:(b.next=c.next,c.next=b);a.pending=b}function wf(a,b,c){if(0!==(c&4194240)){var d=b.lanes;d&=a.pendingLanes;c|=d;b.lanes=c;Hc(a,c)}}\nvar Le={readContext:Zd,useCallback:M,useContext:M,useEffect:M,useImperativeHandle:M,useInsertionEffect:M,useLayoutEffect:M,useMemo:M,useReducer:M,useRef:M,useState:M,useDebugValue:M,useDeferredValue:M,useTransition:M,useMutableSource:M,useSyncExternalStore:M,useId:M,unstable_isNewReconciler:!1},Ie={readContext:Zd,useCallback:function(a,b){Ne().memoizedState=[a,void 0===b?null:b];return a},useContext:Zd,useEffect:gf,useImperativeHandle:function(a,b,c){c=null!==c&&void 0!==c?c.concat([a]):null;return ef(4194308,\n4,kf.bind(null,b,a),c)},useLayoutEffect:function(a,b){return ef(4194308,4,a,b)},useInsertionEffect:function(a,b){return ef(4,2,a,b)},useMemo:function(a,b){var c=Ne();b=void 0===b?null:b;a=a();c.memoizedState=[a,b];return a},useReducer:function(a,b,c){var d=Ne();b=void 0!==c?c(b):b;d.memoizedState=d.baseState=b;a={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:a,lastRenderedState:b};d.queue=a;a=a.dispatch=sf.bind(null,J,a);return[d.memoizedState,a]},useRef:function(a){var b=\nNe();a={current:a};return b.memoizedState=a},useState:bf,useDebugValue:mf,useDeferredValue:function(a){return Ne().memoizedState=a},useTransition:function(){var a=bf(!1),b=a[0];a=qf.bind(null,a[1]);Ne().memoizedState=a;return[b,a]},useMutableSource:function(){},useSyncExternalStore:function(a,b,c){var d=J,e=Ne();if(F){if(void 0===c)throw Error(n(407));c=c()}else{c=b();if(null===N)throw Error(n(349));0!==(Be&30)||Ye(d,b,c)}e.memoizedState=c;var f={value:c,getSnapshot:b};e.queue=f;gf(Ve.bind(null,d,\nf,a),[a]);d.flags|=2048;We(9,Xe.bind(null,d,f,c,b),void 0,null);return c},useId:function(){var a=Ne(),b=N.identifierPrefix;if(F){var c=jd;var d=id;c=(d&~(1<<32-tc(d)-1)).toString(32)+c;b=\":\"+b+\"R\"+c;c=Ee++;0Dg&&(b.flags|=128,d=!0,Ag(e,!1),b.lanes=4194304)}else{if(!d)if(a=we(f),null!==a){if(b.flags|=128,d=!0,a=a.updateQueue,null!==a&&(b.updateQueue=a,b.flags|=4),Ag(e,!0),null===e.tail&&\"hidden\"===e.tailMode&&!f.alternate&&!F)return Q(b),null}else 2*D()-e.renderingStartTime>Dg&&1073741824!==c&&(b.flags|=128,d=!0,Ag(e,!1),b.lanes=\n4194304);e.isBackwards?(f.sibling=b.child,b.child=f):(a=e.last,null!==a?a.sibling=f:b.child=f,e.last=f)}if(null!==e.tail)return b=e.tail,e.rendering=b,e.tail=b.sibling,e.renderingStartTime=D(),b.sibling=null,a=I.current,v(I,d?a&1|2:a&1),b;Q(b);return null;case 22:case 23:return Eg(),c=null!==b.memoizedState,null!==a&&null!==a.memoizedState!==c&&(b.flags|=8192),c&&0!==(b.mode&1)?0!==($f&1073741824)&&(Q(b),Ta&&b.subtreeFlags&6&&(b.flags|=8192)):Q(b),null;case 24:return null;case 25:return null}throw Error(n(156,\nb.tag));}\nfunction Fg(a,b){nd(b);switch(b.tag){case 1:return A(b.type)&&nc(),a=b.flags,a&65536?(b.flags=a&-65537|128,b):null;case 3:return te(),q(z),q(x),ye(),a=b.flags,0!==(a&65536)&&0===(a&128)?(b.flags=a&-65537|128,b):null;case 5:return ve(b),null;case 13:q(I);a=b.memoizedState;if(null!==a&&null!==a.dehydrated){if(null===b.alternate)throw Error(n(340));Ad()}a=b.flags;return a&65536?(b.flags=a&-65537|128,b):null;case 19:return q(I),null;case 4:return te(),null;case 10:return Wd(b.type._context),null;case 22:case 23:return Eg(),\nnull;case 24:return null;default:return null}}var Gg=!1,S=!1,Hg=\"function\"===typeof WeakSet?WeakSet:Set,T=null;function Ig(a,b){var c=a.ref;if(null!==c)if(\"function\"===typeof c)try{c(null)}catch(d){U(a,b,d)}else c.current=null}function Jg(a,b,c){try{c()}catch(d){U(a,b,d)}}var Kg=!1;\nfunction Lg(a,b){Ha(a.containerInfo);for(T=b;null!==T;)if(a=T,b=a.child,0!==(a.subtreeFlags&1028)&&null!==b)b.return=a,T=b;else for(;null!==T;){a=T;try{var c=a.alternate;if(0!==(a.flags&1024))switch(a.tag){case 0:case 11:case 15:break;case 1:if(null!==c){var d=c.memoizedProps,e=c.memoizedState,f=a.stateNode,g=f.getSnapshotBeforeUpdate(a.elementType===a.type?d:xf(a.type,d),e);f.__reactInternalSnapshotBeforeUpdate=g}break;case 3:Ta&&xb(a.stateNode.containerInfo);break;case 5:case 6:case 4:case 17:break;\ndefault:throw Error(n(163));}}catch(h){U(a,a.return,h)}b=a.sibling;if(null!==b){b.return=a.return;T=b;break}T=a.return}c=Kg;Kg=!1;return c}function Mg(a,b,c){var d=b.updateQueue;d=null!==d?d.lastEffect:null;if(null!==d){var e=d=d.next;do{if((e.tag&a)===a){var f=e.destroy;e.destroy=void 0;void 0!==f&&Jg(b,c,f)}e=e.next}while(e!==d)}}function Ng(a,b){b=b.updateQueue;b=null!==b?b.lastEffect:null;if(null!==b){var c=b=b.next;do{if((c.tag&a)===a){var d=c.create;c.destroy=d()}c=c.next}while(c!==b)}}\nfunction Og(a){var b=a.ref;if(null!==b){var c=a.stateNode;switch(a.tag){case 5:a=Ea(c);break;default:a=c}\"function\"===typeof b?b(a):b.current=a}}function Pg(a){var b=a.alternate;null!==b&&(a.alternate=null,Pg(b));a.child=null;a.deletions=null;a.sibling=null;5===a.tag&&(b=a.stateNode,null!==b&&Za(b));a.stateNode=null;a.return=null;a.dependencies=null;a.memoizedProps=null;a.memoizedState=null;a.pendingProps=null;a.stateNode=null;a.updateQueue=null}\nfunction Qg(a){return 5===a.tag||3===a.tag||4===a.tag}function Rg(a){a:for(;;){for(;null===a.sibling;){if(null===a.return||Qg(a.return))return null;a=a.return}a.sibling.return=a.return;for(a=a.sibling;5!==a.tag&&6!==a.tag&&18!==a.tag;){if(a.flags&2)continue a;if(null===a.child||4===a.tag)continue a;else a.child.return=a,a=a.child}if(!(a.flags&2))return a.stateNode}}\nfunction Sg(a,b,c){var d=a.tag;if(5===d||6===d)a=a.stateNode,b?pb(c,a,b):kb(c,a);else if(4!==d&&(a=a.child,null!==a))for(Sg(a,b,c),a=a.sibling;null!==a;)Sg(a,b,c),a=a.sibling}function Tg(a,b,c){var d=a.tag;if(5===d||6===d)a=a.stateNode,b?ob(c,a,b):jb(c,a);else if(4!==d&&(a=a.child,null!==a))for(Tg(a,b,c),a=a.sibling;null!==a;)Tg(a,b,c),a=a.sibling}var V=null,Ug=!1;function Vg(a,b,c){for(c=c.child;null!==c;)Wg(a,b,c),c=c.sibling}\nfunction Wg(a,b,c){if(Sc&&\"function\"===typeof Sc.onCommitFiberUnmount)try{Sc.onCommitFiberUnmount(Rc,c)}catch(h){}switch(c.tag){case 5:S||Ig(c,b);case 6:if(Ta){var d=V,e=Ug;V=null;Vg(a,b,c);V=d;Ug=e;null!==V&&(Ug?rb(V,c.stateNode):qb(V,c.stateNode))}else Vg(a,b,c);break;case 18:Ta&&null!==V&&(Ug?Yb(V,c.stateNode):Xb(V,c.stateNode));break;case 4:Ta?(d=V,e=Ug,V=c.stateNode.containerInfo,Ug=!0,Vg(a,b,c),V=d,Ug=e):(Ua&&(d=c.stateNode.containerInfo,e=zb(d),Cb(d,e)),Vg(a,b,c));break;case 0:case 11:case 14:case 15:if(!S&&\n(d=c.updateQueue,null!==d&&(d=d.lastEffect,null!==d))){e=d=d.next;do{var f=e,g=f.destroy;f=f.tag;void 0!==g&&(0!==(f&2)?Jg(c,b,g):0!==(f&4)&&Jg(c,b,g));e=e.next}while(e!==d)}Vg(a,b,c);break;case 1:if(!S&&(Ig(c,b),d=c.stateNode,\"function\"===typeof d.componentWillUnmount))try{d.props=c.memoizedProps,d.state=c.memoizedState,d.componentWillUnmount()}catch(h){U(c,b,h)}Vg(a,b,c);break;case 21:Vg(a,b,c);break;case 22:c.mode&1?(S=(d=S)||null!==c.memoizedState,Vg(a,b,c),S=d):Vg(a,b,c);break;default:Vg(a,b,\nc)}}function Xg(a){var b=a.updateQueue;if(null!==b){a.updateQueue=null;var c=a.stateNode;null===c&&(c=a.stateNode=new Hg);b.forEach(function(b){var d=Yg.bind(null,a,b);c.has(b)||(c.add(b),b.then(d,d))})}}\nfunction Zg(a,b){var c=b.deletions;if(null!==c)for(var d=0;d\";case ih:return\":has(\"+(ph(a)||\"\")+\")\";case jh:return'[role=\"'+a.value+'\"]';case lh:return'\"'+a.value+'\"';case kh:return'[data-testname=\"'+a.value+'\"]';default:throw Error(n(365));}}\nfunction qh(a,b){var c=[];a=[a,0];for(var d=0;de&&(e=g);d&=~f}d=e;d=D()-d;d=(120>d?120:480>d?480:1080>d?1080:1920>d?1920:3E3>d?3E3:4320>d?4320:1960*sh(d/1960))-d;if(10a?16:a;if(null===Dh)var d=!1;else{a=Dh;Dh=null;Eh=0;if(0!==(H&6))throw Error(n(331));var e=H;H|=4;for(T=a.current;null!==T;){var f=T,g=f.child;if(0!==(T.flags&16)){var h=f.deletions;if(null!==h){for(var k=0;kD()-bh?Rh(a,0):xh|=c);Kh(a,b)}function di(a,b){0===b&&(0===(a.mode&1)?b=1:(b=xc,xc<<=1,0===(xc&130023424)&&(xc=4194304)));var c=O();a=ce(a,b);null!==a&&(Fc(a,b,c),Kh(a,c))}function og(a){var b=a.memoizedState,c=0;null!==b&&(c=b.retryLane);di(a,c)}\nfunction Yg(a,b){var c=0;switch(a.tag){case 13:var d=a.stateNode;var e=a.memoizedState;null!==e&&(c=e.retryLane);break;case 19:d=a.stateNode;break;default:throw Error(n(314));}null!==d&&d.delete(b);di(a,c)}var ai;\nai=function(a,b,c){if(null!==a)if(a.memoizedProps!==b.pendingProps||z.current)G=!0;else{if(0===(a.lanes&c)&&0===(b.flags&128))return G=!1,sg(a,b,c);G=0!==(a.flags&131072)?!0:!1}else G=!1,F&&0!==(b.flags&1048576)&&ld(b,ed,b.index);b.lanes=0;switch(b.tag){case 2:var d=b.type;cg(a,b);a=b.pendingProps;var e=mc(b,x.current);Yd(b,c);e=He(null,b,d,a,e,c);var f=Me();b.flags|=1;\"object\"===typeof e&&null!==e&&\"function\"===typeof e.render&&void 0===e.$$typeof?(b.tag=1,b.memoizedState=null,b.updateQueue=null,\nA(d)?(f=!0,qc(b)):f=!1,b.memoizedState=null!==e.state&&void 0!==e.state?e.state:null,ee(b),e.updater=zf,b.stateNode=e,e._reactInternals=b,Df(b,d,a,c),b=dg(null,b,d,!0,f,c)):(b.tag=0,F&&f&&md(b),P(null,b,e,c),b=b.child);return b;case 16:d=b.elementType;a:{cg(a,b);a=b.pendingProps;e=d._init;d=e(d._payload);b.type=d;e=b.tag=ei(d);a=xf(d,a);switch(e){case 0:b=Xf(null,b,d,a,c);break a;case 1:b=bg(null,b,d,a,c);break a;case 11:b=Sf(null,b,d,a,c);break a;case 14:b=Uf(null,b,d,xf(d.type,a),c);break a}throw Error(n(306,\nd,\"\"));}return b;case 0:return d=b.type,e=b.pendingProps,e=b.elementType===d?e:xf(d,e),Xf(a,b,d,e,c);case 1:return d=b.type,e=b.pendingProps,e=b.elementType===d?e:xf(d,e),bg(a,b,d,e,c);case 3:a:{eg(b);if(null===a)throw Error(n(387));d=b.pendingProps;f=b.memoizedState;e=f.element;fe(a,b);ke(b,d,null,c);var g=b.memoizedState;d=g.element;if(Va&&f.isDehydrated)if(f={element:d,isDehydrated:!1,cache:g.cache,pendingSuspenseBoundaries:g.pendingSuspenseBoundaries,transitions:g.transitions},b.updateQueue.baseState=\nf,b.memoizedState=f,b.flags&256){e=Ef(Error(n(423)),b);b=fg(a,b,d,c,e);break a}else if(d!==e){e=Ef(Error(n(424)),b);b=fg(a,b,d,c,e);break a}else for(Va&&(pd=Pb(b.stateNode.containerInfo),od=b,F=!0,rd=null,qd=!1),c=Pd(b,null,d,c),b.child=c;c;)c.flags=c.flags&-3|4096,c=c.sibling;else{Ad();if(d===e){b=Tf(a,b,c);break a}P(a,b,d,c)}b=b.child}return b;case 5:return ue(b),null===a&&wd(b),d=b.type,e=b.pendingProps,f=null!==a?a.memoizedProps:null,g=e.children,Na(d,e)?g=null:null!==f&&Na(d,f)&&(b.flags|=32),\nag(a,b),P(a,b,g,c),b.child;case 6:return null===a&&wd(b),null;case 13:return ig(a,b,c);case 4:return se(b,b.stateNode.containerInfo),d=b.pendingProps,null===a?b.child=Od(b,null,d,c):P(a,b,d,c),b.child;case 11:return d=b.type,e=b.pendingProps,e=b.elementType===d?e:xf(d,e),Sf(a,b,d,e,c);case 7:return P(a,b,b.pendingProps,c),b.child;case 8:return P(a,b,b.pendingProps.children,c),b.child;case 12:return P(a,b,b.pendingProps.children,c),b.child;case 10:a:{d=b.type._context;e=b.pendingProps;f=b.memoizedProps;\ng=e.value;Vd(b,d,g);if(null!==f)if(Vc(f.value,g)){if(f.children===e.children&&!z.current){b=Tf(a,b,c);break a}}else for(f=b.child,null!==f&&(f.return=b);null!==f;){var h=f.dependencies;if(null!==h){g=f.child;for(var k=h.firstContext;null!==k;){if(k.context===d){if(1===f.tag){k=ge(-1,c&-c);k.tag=2;var l=f.updateQueue;if(null!==l){l=l.shared;var m=l.pending;null===m?k.next=k:(k.next=m.next,m.next=k);l.pending=k}}f.lanes|=c;k=f.alternate;null!==k&&(k.lanes|=c);Xd(f.return,c,b);h.lanes|=c;break}k=k.next}}else if(10===\nf.tag)g=f.type===b.type?null:f.child;else if(18===f.tag){g=f.return;if(null===g)throw Error(n(341));g.lanes|=c;h=g.alternate;null!==h&&(h.lanes|=c);Xd(g,c,b);g=f.sibling}else g=f.child;if(null!==g)g.return=f;else for(g=f;null!==g;){if(g===b){g=null;break}f=g.sibling;if(null!==f){f.return=g.return;g=f;break}g=g.return}f=g}P(a,b,e.children,c);b=b.child}return b;case 9:return e=b.type,d=b.pendingProps.children,Yd(b,c),e=Zd(e),d=d(e),b.flags|=1,P(a,b,d,c),b.child;case 14:return d=b.type,e=xf(d,b.pendingProps),\ne=xf(d.type,e),Uf(a,b,d,e,c);case 15:return Wf(a,b,b.type,b.pendingProps,c);case 17:return d=b.type,e=b.pendingProps,e=b.elementType===d?e:xf(d,e),cg(a,b),b.tag=1,A(d)?(a=!0,qc(b)):a=!1,Yd(b,c),Bf(b,d,e),Df(b,d,e,c),dg(null,b,d,!0,a,c);case 19:return rg(a,b,c);case 22:return Yf(a,b,c)}throw Error(n(156,b.tag));};function Mh(a,b){return Jc(a,b)}\nfunction fi(a,b,c,d){this.tag=a;this.key=c;this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null;this.index=0;this.ref=null;this.pendingProps=b;this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null;this.mode=d;this.subtreeFlags=this.flags=0;this.deletions=null;this.childLanes=this.lanes=0;this.alternate=null}function td(a,b,c,d){return new fi(a,b,c,d)}function Vf(a){a=a.prototype;return!(!a||!a.isReactComponent)}\nfunction ei(a){if(\"function\"===typeof a)return Vf(a)?1:0;if(void 0!==a&&null!==a){a=a.$$typeof;if(a===ma)return 11;if(a===pa)return 14}return 2}\nfunction Jd(a,b){var c=a.alternate;null===c?(c=td(a.tag,b,a.key,a.mode),c.elementType=a.elementType,c.type=a.type,c.stateNode=a.stateNode,c.alternate=a,a.alternate=c):(c.pendingProps=b,c.type=a.type,c.flags=0,c.subtreeFlags=0,c.deletions=null);c.flags=a.flags&14680064;c.childLanes=a.childLanes;c.lanes=a.lanes;c.child=a.child;c.memoizedProps=a.memoizedProps;c.memoizedState=a.memoizedState;c.updateQueue=a.updateQueue;b=a.dependencies;c.dependencies=null===b?null:{lanes:b.lanes,firstContext:b.firstContext};\nc.sibling=a.sibling;c.index=a.index;c.ref=a.ref;return c}\nfunction Ld(a,b,c,d,e,f){var g=2;d=a;if(\"function\"===typeof a)Vf(a)&&(g=1);else if(\"string\"===typeof a)g=5;else a:switch(a){case ha:return Nd(c.children,e,f,b);case ia:g=8;e|=8;break;case ja:return a=td(12,c,b,e|2),a.elementType=ja,a.lanes=f,a;case na:return a=td(13,c,b,e),a.elementType=na,a.lanes=f,a;case oa:return a=td(19,c,b,e),a.elementType=oa,a.lanes=f,a;case ra:return jg(c,e,f,b);default:if(\"object\"===typeof a&&null!==a)switch(a.$$typeof){case ka:g=10;break a;case la:g=9;break a;case ma:g=11;\nbreak a;case pa:g=14;break a;case qa:g=16;d=null;break a}throw Error(n(130,null==a?a:typeof a,\"\"));}b=td(g,c,b,e);b.elementType=a;b.type=d;b.lanes=f;return b}function Nd(a,b,c,d){a=td(7,a,d,b);a.lanes=c;return a}function jg(a,b,c,d){a=td(22,a,d,b);a.elementType=ra;a.lanes=c;a.stateNode={isHidden:!1};return a}function Kd(a,b,c){a=td(6,a,null,b);a.lanes=c;return a}\nfunction Md(a,b,c){b=td(4,null!==a.children?a.children:[],a.key,b);b.lanes=c;b.stateNode={containerInfo:a.containerInfo,pendingChildren:null,implementation:a.implementation};return b}\nfunction gi(a,b,c,d,e){this.tag=b;this.containerInfo=a;this.finishedWork=this.pingCache=this.current=this.pendingChildren=null;this.timeoutHandle=Ra;this.callbackNode=this.pendingContext=this.context=null;this.callbackPriority=0;this.eventTimes=Ec(0);this.expirationTimes=Ec(-1);this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0;this.entanglements=Ec(0);this.identifierPrefix=d;this.onRecoverableError=e;Va&&(this.mutableSourceEagerHydrationData=\nnull)}function hi(a,b,c,d,e,f,g,h,k){a=new gi(a,b,c,h,k);1===b?(b=1,!0===f&&(b|=8)):b=0;f=td(3,null,null,b);a.current=f;f.stateNode=a;f.memoizedState={element:d,isDehydrated:c,cache:null,transitions:null,pendingSuspenseBoundaries:null};ee(f);return a}\nfunction ii(a){if(!a)return jc;a=a._reactInternals;a:{if(wa(a)!==a||1!==a.tag)throw Error(n(170));var b=a;do{switch(b.tag){case 3:b=b.stateNode.context;break a;case 1:if(A(b.type)){b=b.stateNode.__reactInternalMemoizedMergedChildContext;break a}}b=b.return}while(null!==b);throw Error(n(171));}if(1===a.tag){var c=a.type;if(A(c))return pc(a,c,b)}return b}\nfunction ji(a){var b=a._reactInternals;if(void 0===b){if(\"function\"===typeof a.render)throw Error(n(188));a=Object.keys(a).join(\",\");throw Error(n(268,a));}a=Aa(b);return null===a?null:a.stateNode}function ki(a,b){a=a.memoizedState;if(null!==a&&null!==a.dehydrated){var c=a.retryLane;a.retryLane=0!==c&&c=l&&f>=r&&e<=m&&g<=p){a.splice(b,1);break}else if(!(d!==l||c.width!==k.width||pg)){r>f&&(k.height+=r-f,k.y=f);pe)){l>d&&(k.width+=\nl-d,k.x=d);mc&&(c=g)),g \")+\"\\n\\nNo matching component was found for:\\n \")+a.join(\" > \")}return null};\nexports.getPublicRootInstance=function(a){a=a.current;if(!a.child)return null;switch(a.child.tag){case 5:return Ea(a.child.stateNode);default:return a.child.stateNode}};\nexports.injectIntoDevTools=function(a){a={bundleType:a.bundleType,version:a.version,rendererPackageName:a.rendererPackageName,rendererConfig:a.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:da.ReactCurrentDispatcher,findHostInstanceByFiber:mi,findFiberByHostInstance:a.findFiberByHostInstance||\nni,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:\"18.3.1\"};if(\"undefined\"===typeof __REACT_DEVTOOLS_GLOBAL_HOOK__)a=!1;else{var b=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(b.isDisabled||!b.supportsFiber)a=!0;else{try{Rc=b.inject(a),Sc=b}catch(c){}a=b.checkDCE?!0:!1}}return a};exports.isAlreadyRendering=function(){return!1};\nexports.observeVisibleRects=function(a,b,c,d){if(!bb)throw Error(n(363));a=rh(a,b);var e=ib(a,c,d).disconnect;return{disconnect:function(){e()}}};exports.registerMutableSourceForHydration=function(a,b){var c=b._getVersion;c=c(b._source);null==a.mutableSourceEagerHydrationData?a.mutableSourceEagerHydrationData=[b,c]:a.mutableSourceEagerHydrationData.push(b,c)};exports.runWithPriority=function(a,b){var c=C;try{return C=a,b()}finally{C=c}};exports.shouldError=function(){return null};\nexports.shouldSuspend=function(){return!1};exports.updateContainer=function(a,b,c,d){var e=b.current,f=O(),g=tf(e);c=ii(c);null===b.context?b.context=c:b.pendingContext=c;b=ge(f,g);b.payload={element:a};d=void 0===d?null:d;null!==d&&(b.callback=d);a=he(e,b,g);null!==a&&(af(a,e,g,f),ie(a,e,g));return g};\n\n return exports;\n};\n","'use strict';\n\nif (process.env.NODE_ENV === 'production') {\n module.exports = require('./cjs/react-reconciler.production.min.js');\n} else {\n module.exports = require('./cjs/react-reconciler.development.js');\n}\n","/**\n * @license React\n * react-reconciler-constants.production.min.js\n *\n * Copyright (c) Facebook, Inc. and its affiliates.\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'use strict';exports.ConcurrentRoot=1;exports.ContinuousEventPriority=4;exports.DefaultEventPriority=16;exports.DiscreteEventPriority=1;exports.IdleEventPriority=536870912;exports.LegacyRoot=0;\n","'use strict';\n\nif (process.env.NODE_ENV === 'production') {\n module.exports = require('./cjs/react-reconciler-constants.production.min.js');\n} else {\n module.exports = require('./cjs/react-reconciler-constants.development.js');\n}\n","import { Konva } from 'konva/lib/Global.js';\nconst propsToSkip = {\n children: true,\n ref: true,\n key: true,\n style: true,\n forwardedRef: true,\n unstable_applyCache: true,\n unstable_applyDrawHitFromCache: true,\n};\nlet zIndexWarningShowed = false;\nlet dragWarningShowed = false;\nexport const EVENTS_NAMESPACE = '.react-konva-event';\nlet useStrictMode = false;\nexport function toggleStrictMode(value) {\n useStrictMode = value;\n}\nconst DRAGGABLE_WARNING = `ReactKonva: You have a Konva node with draggable = true and position defined but no onDragMove or onDragEnd events are handled.\nPosition of a node will be changed during drag&drop, so you should update state of the react app as well.\nConsider to add onDragMove or onDragEnd events.\nFor more info see: https://github.com/konvajs/react-konva/issues/256\n`;\nconst Z_INDEX_WARNING = `ReactKonva: You are using \"zIndex\" attribute for a Konva node.\nreact-konva may get confused with ordering. Just define correct order of elements in your render function of a component.\nFor more info see: https://github.com/konvajs/react-konva/issues/194\n`;\nconst EMPTY_PROPS = {};\nexport function applyNodeProps(instance, props, oldProps = EMPTY_PROPS) {\n // don't use zIndex in react-konva\n if (!zIndexWarningShowed && 'zIndex' in props) {\n console.warn(Z_INDEX_WARNING);\n zIndexWarningShowed = true;\n }\n // check correct draggable usage\n if (!dragWarningShowed && props.draggable) {\n var hasPosition = props.x !== undefined || props.y !== undefined;\n var hasEvents = props.onDragEnd || props.onDragMove;\n if (hasPosition && !hasEvents) {\n console.warn(DRAGGABLE_WARNING);\n dragWarningShowed = true;\n }\n }\n // check old props\n // we need to unset properties that are not in new props\n // and remove all events\n for (var key in oldProps) {\n if (propsToSkip[key]) {\n continue;\n }\n var isEvent = key.slice(0, 2) === 'on';\n var propChanged = oldProps[key] !== props[key];\n // if that is a changed event, we need to remove it\n if (isEvent && propChanged) {\n var eventName = key.substr(2).toLowerCase();\n if (eventName.substr(0, 7) === 'content') {\n eventName =\n 'content' +\n eventName.substr(7, 1).toUpperCase() +\n eventName.substr(8);\n }\n instance.off(eventName, oldProps[key]);\n }\n var toRemove = !props.hasOwnProperty(key);\n if (toRemove) {\n instance.setAttr(key, undefined);\n }\n }\n var strictUpdate = useStrictMode || props._useStrictMode;\n var updatedProps = {};\n var hasUpdates = false;\n const newEvents = {};\n for (var key in props) {\n if (propsToSkip[key]) {\n continue;\n }\n var isEvent = key.slice(0, 2) === 'on';\n var toAdd = oldProps[key] !== props[key];\n if (isEvent && toAdd) {\n var eventName = key.substr(2).toLowerCase();\n if (eventName.substr(0, 7) === 'content') {\n eventName =\n 'content' +\n eventName.substr(7, 1).toUpperCase() +\n eventName.substr(8);\n }\n // check that event is not undefined\n if (props[key]) {\n newEvents[eventName] = props[key];\n }\n }\n if (!isEvent &&\n (props[key] !== oldProps[key] ||\n (strictUpdate && props[key] !== instance.getAttr(key)))) {\n hasUpdates = true;\n updatedProps[key] = props[key];\n }\n }\n if (hasUpdates) {\n instance.setAttrs(updatedProps);\n updatePicture(instance);\n }\n // subscribe to events AFTER we set attrs\n // we need it to fix https://github.com/konvajs/react-konva/issues/471\n // settings attrs may add events. Like \"draggable: true\" will add \"mousedown\" listener\n for (var eventName in newEvents) {\n instance.on(eventName + EVENTS_NAMESPACE, newEvents[eventName]);\n }\n}\nexport function updatePicture(node) {\n if (!Konva.autoDrawEnabled) {\n var drawingNode = node.getLayer() || node.getStage();\n drawingNode && drawingNode.batchDraw();\n }\n}\n","import Konva from 'konva/lib/Core.js';\nimport { applyNodeProps, updatePicture, EVENTS_NAMESPACE } from './makeUpdates.js';\nexport { unstable_now as now, unstable_IdlePriority as idlePriority, unstable_runWithPriority as run, } from 'scheduler';\nimport { DefaultEventPriority } from 'react-reconciler/constants.js';\nconst NO_CONTEXT = {};\nconst UPDATE_SIGNAL = {};\n// for react-spring capability\nKonva.Node.prototype._applyProps = applyNodeProps;\nexport function appendInitialChild(parentInstance, child) {\n if (typeof child === 'string') {\n // Noop for string children of Text (eg foo)\n console.error(`Do not use plain text as child of Konva.Node. You are using text: ${child}`);\n return;\n }\n parentInstance.add(child);\n updatePicture(parentInstance);\n}\nexport function createInstance(type, props, internalInstanceHandle) {\n let NodeClass = Konva[type];\n if (!NodeClass) {\n console.error(`Konva has no node with the type ${type}. Group will be used instead. If you use minimal version of react-konva, just import required nodes into Konva: \"import \"konva/lib/shapes/${type}\" If you want to render DOM elements as part of canvas tree take a look into this demo: https://konvajs.github.io/docs/react/DOM_Portal.html`);\n NodeClass = Konva.Group;\n }\n // we need to split props into events and non events\n // we we can pass non events into constructor directly\n // that way the performance should be better\n // we we apply change \"applyNodeProps\"\n // then it will trigger change events on first run\n // but we don't need them!\n const propsWithoutEvents = {};\n const propsWithOnlyEvents = {};\n for (var key in props) {\n var isEvent = key.slice(0, 2) === 'on';\n if (isEvent) {\n propsWithOnlyEvents[key] = props[key];\n }\n else {\n propsWithoutEvents[key] = props[key];\n }\n }\n const instance = new NodeClass(propsWithoutEvents);\n applyNodeProps(instance, propsWithOnlyEvents);\n return instance;\n}\nexport function createTextInstance(text, rootContainerInstance, internalInstanceHandle) {\n console.error(`Text components are not supported for now in ReactKonva. Your text is: \"${text}\"`);\n}\nexport function finalizeInitialChildren(domElement, type, props) {\n return false;\n}\nexport function getPublicInstance(instance) {\n return instance;\n}\nexport function prepareForCommit() {\n return null;\n}\nexport function preparePortalMount() {\n return null;\n}\nexport function prepareUpdate(domElement, type, oldProps, newProps) {\n return UPDATE_SIGNAL;\n}\nexport function resetAfterCommit() {\n // Noop\n}\nexport function resetTextContent(domElement) {\n // Noop\n}\nexport function shouldDeprioritizeSubtree(type, props) {\n return false;\n}\nexport function getRootHostContext() {\n return NO_CONTEXT;\n}\nexport function getChildHostContext() {\n return NO_CONTEXT;\n}\nexport const scheduleTimeout = setTimeout;\nexport const cancelTimeout = clearTimeout;\nexport const noTimeout = -1;\n// export const schedulePassiveEffects = scheduleDeferredCallback;\n// export const cancelPassiveEffects = cancelDeferredCallback;\nexport function shouldSetTextContent(type, props) {\n return false;\n}\n// The Konva renderer is secondary to the React DOM renderer.\nexport const isPrimaryRenderer = false;\nexport const warnsIfNotActing = true;\nexport const supportsMutation = true;\nexport function appendChild(parentInstance, child) {\n if (child.parent === parentInstance) {\n child.moveToTop();\n }\n else {\n parentInstance.add(child);\n }\n updatePicture(parentInstance);\n}\nexport function appendChildToContainer(parentInstance, child) {\n if (child.parent === parentInstance) {\n child.moveToTop();\n }\n else {\n parentInstance.add(child);\n }\n updatePicture(parentInstance);\n}\nexport function insertBefore(parentInstance, child, beforeChild) {\n // child._remove() will not stop dragging\n // but child.remove() will stop it, but we don't need it\n // removing will reset zIndexes\n child._remove();\n parentInstance.add(child);\n child.setZIndex(beforeChild.getZIndex());\n updatePicture(parentInstance);\n}\nexport function insertInContainerBefore(parentInstance, child, beforeChild) {\n insertBefore(parentInstance, child, beforeChild);\n}\nexport function removeChild(parentInstance, child) {\n child.destroy();\n child.off(EVENTS_NAMESPACE);\n updatePicture(parentInstance);\n}\nexport function removeChildFromContainer(parentInstance, child) {\n child.destroy();\n child.off(EVENTS_NAMESPACE);\n updatePicture(parentInstance);\n}\nexport function commitTextUpdate(textInstance, oldText, newText) {\n console.error(`Text components are not yet supported in ReactKonva. You text is: \"${newText}\"`);\n}\nexport function commitMount(instance, type, newProps) {\n // Noop\n}\nexport function commitUpdate(instance, updatePayload, type, oldProps, newProps) {\n applyNodeProps(instance, newProps, oldProps);\n}\nexport function hideInstance(instance) {\n instance.hide();\n updatePicture(instance);\n}\nexport function hideTextInstance(textInstance) {\n // Noop\n}\nexport function unhideInstance(instance, props) {\n if (props.visible == null || props.visible) {\n instance.show();\n }\n}\nexport function unhideTextInstance(textInstance, text) {\n // Noop\n}\nexport function clearContainer(container) {\n // Noop\n}\nexport function detachDeletedInstance() { }\nexport const getCurrentEventPriority = () => DefaultEventPriority;\n","import * as React from \"react\";\nvar __defProp = Object.defineProperty;\nvar __defProps = Object.defineProperties;\nvar __getOwnPropDescs = Object.getOwnPropertyDescriptors;\nvar __getOwnPropSymbols = Object.getOwnPropertySymbols;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __propIsEnum = Object.prototype.propertyIsEnumerable;\nvar __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;\nvar __spreadValues = (a, b) => {\n for (var prop in b || (b = {}))\n if (__hasOwnProp.call(b, prop))\n __defNormalProp(a, prop, b[prop]);\n if (__getOwnPropSymbols)\n for (var prop of __getOwnPropSymbols(b)) {\n if (__propIsEnum.call(b, prop))\n __defNormalProp(a, prop, b[prop]);\n }\n return a;\n};\nvar __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));\nvar _a, _b;\nconst useIsomorphicLayoutEffect = typeof window !== \"undefined\" && (((_a = window.document) == null ? void 0 : _a.createElement) || ((_b = window.navigator) == null ? void 0 : _b.product) === \"ReactNative\") ? React.useLayoutEffect : React.useEffect;\nfunction traverseFiber(fiber, ascending, selector) {\n if (!fiber)\n return;\n if (selector(fiber) === true)\n return fiber;\n let child = ascending ? fiber.return : fiber.child;\n while (child) {\n const match = traverseFiber(child, ascending, selector);\n if (match)\n return match;\n child = ascending ? null : child.sibling;\n }\n}\nfunction wrapContext(context) {\n try {\n return Object.defineProperties(context, {\n _currentRenderer: {\n get() {\n return null;\n },\n set() {\n }\n },\n _currentRenderer2: {\n get() {\n return null;\n },\n set() {\n }\n }\n });\n } catch (_) {\n return context;\n }\n}\nconst error = console.error;\nconsole.error = function() {\n const message = [...arguments].join(\"\");\n if ((message == null ? void 0 : message.startsWith(\"Warning:\")) && message.includes(\"useContext\")) {\n console.error = error;\n return;\n }\n return error.apply(this, arguments);\n};\nconst FiberContext = wrapContext(React.createContext(null));\nclass FiberProvider extends React.Component {\n render() {\n return /* @__PURE__ */ React.createElement(FiberContext.Provider, {\n value: this._reactInternals\n }, this.props.children);\n }\n}\nfunction useFiber() {\n const root = React.useContext(FiberContext);\n if (root === null)\n throw new Error(\"its-fine: useFiber must be called within a !\");\n const id = React.useId();\n const fiber = React.useMemo(() => {\n for (const maybeFiber of [root, root == null ? void 0 : root.alternate]) {\n if (!maybeFiber)\n continue;\n const fiber2 = traverseFiber(maybeFiber, false, (node) => {\n let state = node.memoizedState;\n while (state) {\n if (state.memoizedState === id)\n return true;\n state = state.next;\n }\n });\n if (fiber2)\n return fiber2;\n }\n }, [root, id]);\n return fiber;\n}\nfunction useContainer() {\n const fiber = useFiber();\n const root = React.useMemo(\n () => traverseFiber(fiber, true, (node) => {\n var _a2;\n return ((_a2 = node.stateNode) == null ? void 0 : _a2.containerInfo) != null;\n }),\n [fiber]\n );\n return root == null ? void 0 : root.stateNode.containerInfo;\n}\nfunction useNearestChild(type) {\n const fiber = useFiber();\n const childRef = React.useRef();\n useIsomorphicLayoutEffect(() => {\n var _a2;\n childRef.current = (_a2 = traverseFiber(\n fiber,\n false,\n (node) => typeof node.type === \"string\" && (type === void 0 || node.type === type)\n )) == null ? void 0 : _a2.stateNode;\n }, [fiber]);\n return childRef;\n}\nfunction useNearestParent(type) {\n const fiber = useFiber();\n const parentRef = React.useRef();\n useIsomorphicLayoutEffect(() => {\n var _a2;\n parentRef.current = (_a2 = traverseFiber(\n fiber,\n true,\n (node) => typeof node.type === \"string\" && (type === void 0 || node.type === type)\n )) == null ? void 0 : _a2.stateNode;\n }, [fiber]);\n return parentRef;\n}\nfunction useContextMap() {\n const fiber = useFiber();\n const [contextMap] = React.useState(() => /* @__PURE__ */ new Map());\n contextMap.clear();\n let node = fiber;\n while (node) {\n if (node.type && typeof node.type === \"object\") {\n const enableRenderableContext = node.type._context === void 0 && node.type.Provider === node.type;\n const context = enableRenderableContext ? node.type : node.type._context;\n if (context && context !== FiberContext && !contextMap.has(context)) {\n contextMap.set(context, React.useContext(wrapContext(context)));\n }\n }\n node = node.return;\n }\n return contextMap;\n}\nfunction useContextBridge() {\n const contextMap = useContextMap();\n return React.useMemo(\n () => Array.from(contextMap.keys()).reduce(\n (Prev, context) => (props) => /* @__PURE__ */ React.createElement(Prev, null, /* @__PURE__ */ React.createElement(context.Provider, __spreadProps(__spreadValues({}, props), {\n value: contextMap.get(context)\n }))),\n (props) => /* @__PURE__ */ React.createElement(FiberProvider, __spreadValues({}, props))\n ),\n [contextMap]\n );\n}\nexport {\n FiberProvider,\n traverseFiber,\n useContainer,\n useContextBridge,\n useContextMap,\n useFiber,\n useNearestChild,\n useNearestParent\n};\n//# sourceMappingURL=index.js.map\n","/**\n * Based on ReactArt.js\n * Copyright (c) 2017-present Lavrenov Anton.\n * All rights reserved.\n *\n * MIT\n */\n'use strict';\nimport React from 'react';\nimport Konva from 'konva/lib/Core.js';\nimport ReactFiberReconciler from 'react-reconciler';\nimport { LegacyRoot } from 'react-reconciler/constants.js';\nimport * as HostConfig from './ReactKonvaHostConfig.js';\nimport { applyNodeProps, toggleStrictMode } from './makeUpdates.js';\nimport { useContextBridge, FiberProvider } from 'its-fine';\nfunction usePrevious(value) {\n const ref = React.useRef({});\n React.useLayoutEffect(() => {\n ref.current = value;\n });\n React.useLayoutEffect(() => {\n return () => {\n // when using suspense it is possible that stage is unmounted\n // but React still keep component ref\n // in that case we need to manually flush props\n // we have a special test for that\n ref.current = {};\n };\n }, []);\n return ref.current;\n}\nconst StageWrap = (props) => {\n const container = React.useRef();\n const stage = React.useRef();\n const fiberRef = React.useRef();\n const oldProps = usePrevious(props);\n const Bridge = useContextBridge();\n const _setRef = (stage) => {\n const { forwardedRef } = props;\n if (!forwardedRef) {\n return;\n }\n if (typeof forwardedRef === 'function') {\n forwardedRef(stage);\n }\n else {\n forwardedRef.current = stage;\n }\n };\n React.useLayoutEffect(() => {\n stage.current = new Konva.Stage({\n width: props.width,\n height: props.height,\n container: container.current,\n });\n _setRef(stage.current);\n // @ts-ignore\n fiberRef.current = KonvaRenderer.createContainer(stage.current, LegacyRoot, false, null);\n KonvaRenderer.updateContainer(React.createElement(Bridge, {}, props.children), fiberRef.current);\n return () => {\n if (!Konva.isBrowser) {\n return;\n }\n _setRef(null);\n KonvaRenderer.updateContainer(null, fiberRef.current, null);\n stage.current.destroy();\n };\n }, []);\n React.useLayoutEffect(() => {\n _setRef(stage.current);\n applyNodeProps(stage.current, props, oldProps);\n KonvaRenderer.updateContainer(React.createElement(Bridge, {}, props.children), fiberRef.current, null);\n });\n return React.createElement('div', {\n ref: container,\n id: props.id,\n accessKey: props.accessKey,\n className: props.className,\n role: props.role,\n style: props.style,\n tabIndex: props.tabIndex,\n title: props.title,\n });\n};\nexport const Layer = 'Layer';\nexport const FastLayer = 'FastLayer';\nexport const Group = 'Group';\nexport const Label = 'Label';\nexport const Rect = 'Rect';\nexport const Circle = 'Circle';\nexport const Ellipse = 'Ellipse';\nexport const Wedge = 'Wedge';\nexport const Line = 'Line';\nexport const Sprite = 'Sprite';\nexport const Image = 'Image';\nexport const Text = 'Text';\nexport const TextPath = 'TextPath';\nexport const Star = 'Star';\nexport const Ring = 'Ring';\nexport const Arc = 'Arc';\nexport const Tag = 'Tag';\nexport const Path = 'Path';\nexport const RegularPolygon = 'RegularPolygon';\nexport const Arrow = 'Arrow';\nexport const Shape = 'Shape';\nexport const Transformer = 'Transformer';\n// @ts-ignore\nexport const KonvaRenderer = ReactFiberReconciler(HostConfig);\nKonvaRenderer.injectIntoDevTools({\n // @ts-ignore\n findHostInstanceByFiber: () => null,\n bundleType: process.env.NODE_ENV !== 'production' ? 1 : 0,\n version: React.version,\n rendererPackageName: 'react-konva',\n});\nexport const Stage = React.forwardRef((props, ref) => {\n return React.createElement(FiberProvider, {}, React.createElement(StageWrap, { ...props, forwardedRef: ref }));\n});\nexport const useStrictMode = toggleStrictMode;\n","var getDimensionsMinimalRatio=function(a,b,c,d){return Math.min(a/c,b/d)||1};export default getDimensionsMinimalRatio;","export var ROOT_CONTAINER_CLASS_NAME=\"FIE_root\";export var DESIGN_LAYER_ID=\"FIE_design-layer\";export var TRANSFORMERS_LAYER_ID=\"FIE_transformers-layer\";export var IMAGE_NODE_ID=\"FIE_original-image\";export var NODES_TRANSFORMER_ID=\"FIE_nodes-transformer\";export var WATERMARK_ANNOTATION_ID=\"watermark\";export var TRANSLATIONS_GRID_UUID=\"353297d2-40b4-4684-a875-45a2178a8157\";export var DEFAULT_SAVE_QUALITY=.92;export var TABS_IDS={FINETUNE:\"Finetune\",FILTERS:\"Filters\",ADJUST:\"Adjust\",WATERMARK:\"Watermark\",ANNOTATE:\"Annotate\",RESIZE:\"Resize\"};export var TOOLS_IDS={CROP:\"Crop\",ROTATE:\"Rotate\",FLIP_X:\"Flip_X\",FLIP_Y:\"Flip_Y\",BRIGHTNESS:\"Brightness\",CONTRAST:\"Contrast\",HSV:\"HueSaturationValue\",WARMTH:\"Warmth\",BLUR:\"Blur\",THRESHOLD:\"Threshold\",POSTERIZE:\"Posterize\",PIXELATE:\"Pixelate\",NOISE:\"Noise\",FILTERS:\"Filters\",RECT:\"Rect\",ELLIPSE:\"Ellipse\",POLYGON:\"Polygon\",TEXT:\"Text\",LINE:\"Line\",IMAGE:\"Image\",ARROW:\"Arrow\",WATERMARK:\"Watermark\",PEN:\"Pen\",RESIZE:\"Resize\"};export var FLIP_DIRECTIONS={X:\"X\",Y:\"Y\"};export var DEFAULT_ZOOM_FACTOR=1;export var SUPPORTED_IMAGE_TYPES=[\"png\",\"jpeg\",\"jpg\",\"webp\"];export var POSSIBLE_IMAGE_TYPES=[].concat(SUPPORTED_IMAGE_TYPES,[\"svg\",\"gif\",\"avif\",\"apng\"]);export var DEFAULT_IMAGE_TYPE=SUPPORTED_IMAGE_TYPES[0];export var POINTER_ICONS={DEFAULT:\"default\",DRAW:\"crosshair\",SELECT:\"pointer\",MOVE:\"move\",DRAG:\"GRAB\"};export var DEFAULT_ENABLED_ANCHORS=[\"top-left\",\"top-center\",\"top-right\",\"middle-right\",\"middle-left\",\"bottom-left\",\"bottom-center\",\"bottom-right\"];export var ORIGINAL_CROP=\"Crop\";export var CUSTOM_CROP=\"custom\";export var ELLIPSE_CROP=\"ellipse\";export var POSITIONS={TOP_LEFT:\"top-left\",TOP_CENTER:\"top-center\",TOP_RIGHT:\"top-right\",MIDDLE_LEFT:\"middle-left\",MIDDLE_CENTER:\"middle-center\",MIDDLE_RIGHT:\"middle-right\",BOTTOM_LEFT:\"bottom-left\",BOTTOM_CENTER:\"bottom-center\",BOTTOM_RIGHT:\"bottom-right\"};export var MIN_CROP={WIDTH:14,HEIGHT:14};export var CLOSING_REASONS={AFTER_SAVE:\"after-saving\",CLOSE_BUTTON:\"close-button-clicked\",BACK_BUTTON:\"back-button-clicked\"};export var FEEDBACK_STATUSES={WARNING:\"warning\",ERROR:\"error\"};export var EDITOR_TO_CLOUDIMG_POSITIONS={top:\"north\",bottom:\"south\",left:\"west\",center:\"center\",right:\"east\"};export var CLOUDIMG_TO_EDITOR_POSITIONS={northwest:\"top-left\",northcenter:\"top-center\",northeast:\"top-right\",centerwest:\"center-left\",centercenter:\"center-center\",centereast:\"center-right\",southwest:\"bottom-left\",southcenter:\"bottom-center\",southeast:\"bottom-right\"};","import{ELLIPSE_CROP}from\"./constants\";var cropImage=function(a,b){var c=!!(2 {\n exports.Konva[NodeClass.prototype.getClassName()] = NodeClass;\n};\nexports._registerNode = _registerNode;\nexports.Konva._injectGlobal(exports.Konva);\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Util = exports.Transform = void 0;\nconst Global_1 = require(\"./Global\");\nclass Transform {\n constructor(m = [1, 0, 0, 1, 0, 0]) {\n this.dirty = false;\n this.m = (m && m.slice()) || [1, 0, 0, 1, 0, 0];\n }\n reset() {\n this.m[0] = 1;\n this.m[1] = 0;\n this.m[2] = 0;\n this.m[3] = 1;\n this.m[4] = 0;\n this.m[5] = 0;\n }\n copy() {\n return new Transform(this.m);\n }\n copyInto(tr) {\n tr.m[0] = this.m[0];\n tr.m[1] = this.m[1];\n tr.m[2] = this.m[2];\n tr.m[3] = this.m[3];\n tr.m[4] = this.m[4];\n tr.m[5] = this.m[5];\n }\n point(point) {\n var m = this.m;\n return {\n x: m[0] * point.x + m[2] * point.y + m[4],\n y: m[1] * point.x + m[3] * point.y + m[5],\n };\n }\n translate(x, y) {\n this.m[4] += this.m[0] * x + this.m[2] * y;\n this.m[5] += this.m[1] * x + this.m[3] * y;\n return this;\n }\n scale(sx, sy) {\n this.m[0] *= sx;\n this.m[1] *= sx;\n this.m[2] *= sy;\n this.m[3] *= sy;\n return this;\n }\n rotate(rad) {\n var c = Math.cos(rad);\n var s = Math.sin(rad);\n var m11 = this.m[0] * c + this.m[2] * s;\n var m12 = this.m[1] * c + this.m[3] * s;\n var m21 = this.m[0] * -s + this.m[2] * c;\n var m22 = this.m[1] * -s + this.m[3] * c;\n this.m[0] = m11;\n this.m[1] = m12;\n this.m[2] = m21;\n this.m[3] = m22;\n return this;\n }\n getTranslation() {\n return {\n x: this.m[4],\n y: this.m[5],\n };\n }\n skew(sx, sy) {\n var m11 = this.m[0] + this.m[2] * sy;\n var m12 = this.m[1] + this.m[3] * sy;\n var m21 = this.m[2] + this.m[0] * sx;\n var m22 = this.m[3] + this.m[1] * sx;\n this.m[0] = m11;\n this.m[1] = m12;\n this.m[2] = m21;\n this.m[3] = m22;\n return this;\n }\n multiply(matrix) {\n var m11 = this.m[0] * matrix.m[0] + this.m[2] * matrix.m[1];\n var m12 = this.m[1] * matrix.m[0] + this.m[3] * matrix.m[1];\n var m21 = this.m[0] * matrix.m[2] + this.m[2] * matrix.m[3];\n var m22 = this.m[1] * matrix.m[2] + this.m[3] * matrix.m[3];\n var dx = this.m[0] * matrix.m[4] + this.m[2] * matrix.m[5] + this.m[4];\n var dy = this.m[1] * matrix.m[4] + this.m[3] * matrix.m[5] + this.m[5];\n this.m[0] = m11;\n this.m[1] = m12;\n this.m[2] = m21;\n this.m[3] = m22;\n this.m[4] = dx;\n this.m[5] = dy;\n return this;\n }\n invert() {\n var d = 1 / (this.m[0] * this.m[3] - this.m[1] * this.m[2]);\n var m0 = this.m[3] * d;\n var m1 = -this.m[1] * d;\n var m2 = -this.m[2] * d;\n var m3 = this.m[0] * d;\n var m4 = d * (this.m[2] * this.m[5] - this.m[3] * this.m[4]);\n var m5 = d * (this.m[1] * this.m[4] - this.m[0] * this.m[5]);\n this.m[0] = m0;\n this.m[1] = m1;\n this.m[2] = m2;\n this.m[3] = m3;\n this.m[4] = m4;\n this.m[5] = m5;\n return this;\n }\n getMatrix() {\n return this.m;\n }\n decompose() {\n var a = this.m[0];\n var b = this.m[1];\n var c = this.m[2];\n var d = this.m[3];\n var e = this.m[4];\n var f = this.m[5];\n var delta = a * d - b * c;\n let result = {\n x: e,\n y: f,\n rotation: 0,\n scaleX: 0,\n scaleY: 0,\n skewX: 0,\n skewY: 0,\n };\n if (a != 0 || b != 0) {\n var r = Math.sqrt(a * a + b * b);\n result.rotation = b > 0 ? Math.acos(a / r) : -Math.acos(a / r);\n result.scaleX = r;\n result.scaleY = delta / r;\n result.skewX = (a * c + b * d) / delta;\n result.skewY = 0;\n }\n else if (c != 0 || d != 0) {\n var s = Math.sqrt(c * c + d * d);\n result.rotation =\n Math.PI / 2 - (d > 0 ? Math.acos(-c / s) : -Math.acos(c / s));\n result.scaleX = delta / s;\n result.scaleY = s;\n result.skewX = 0;\n result.skewY = (a * c + b * d) / delta;\n }\n else {\n }\n result.rotation = exports.Util._getRotation(result.rotation);\n return result;\n }\n}\nexports.Transform = Transform;\nvar OBJECT_ARRAY = '[object Array]', OBJECT_NUMBER = '[object Number]', OBJECT_STRING = '[object String]', OBJECT_BOOLEAN = '[object Boolean]', PI_OVER_DEG180 = Math.PI / 180, DEG180_OVER_PI = 180 / Math.PI, HASH = '#', EMPTY_STRING = '', ZERO = '0', KONVA_WARNING = 'Konva warning: ', KONVA_ERROR = 'Konva error: ', RGB_PAREN = 'rgb(', COLORS = {\n aliceblue: [240, 248, 255],\n antiquewhite: [250, 235, 215],\n aqua: [0, 255, 255],\n aquamarine: [127, 255, 212],\n azure: [240, 255, 255],\n beige: [245, 245, 220],\n bisque: [255, 228, 196],\n black: [0, 0, 0],\n blanchedalmond: [255, 235, 205],\n blue: [0, 0, 255],\n blueviolet: [138, 43, 226],\n brown: [165, 42, 42],\n burlywood: [222, 184, 135],\n cadetblue: [95, 158, 160],\n chartreuse: [127, 255, 0],\n chocolate: [210, 105, 30],\n coral: [255, 127, 80],\n cornflowerblue: [100, 149, 237],\n cornsilk: [255, 248, 220],\n crimson: [220, 20, 60],\n cyan: [0, 255, 255],\n darkblue: [0, 0, 139],\n darkcyan: [0, 139, 139],\n darkgoldenrod: [184, 132, 11],\n darkgray: [169, 169, 169],\n darkgreen: [0, 100, 0],\n darkgrey: [169, 169, 169],\n darkkhaki: [189, 183, 107],\n darkmagenta: [139, 0, 139],\n darkolivegreen: [85, 107, 47],\n darkorange: [255, 140, 0],\n darkorchid: [153, 50, 204],\n darkred: [139, 0, 0],\n darksalmon: [233, 150, 122],\n darkseagreen: [143, 188, 143],\n darkslateblue: [72, 61, 139],\n darkslategray: [47, 79, 79],\n darkslategrey: [47, 79, 79],\n darkturquoise: [0, 206, 209],\n darkviolet: [148, 0, 211],\n deeppink: [255, 20, 147],\n deepskyblue: [0, 191, 255],\n dimgray: [105, 105, 105],\n dimgrey: [105, 105, 105],\n dodgerblue: [30, 144, 255],\n firebrick: [178, 34, 34],\n floralwhite: [255, 255, 240],\n forestgreen: [34, 139, 34],\n fuchsia: [255, 0, 255],\n gainsboro: [220, 220, 220],\n ghostwhite: [248, 248, 255],\n gold: [255, 215, 0],\n goldenrod: [218, 165, 32],\n gray: [128, 128, 128],\n green: [0, 128, 0],\n greenyellow: [173, 255, 47],\n grey: [128, 128, 128],\n honeydew: [240, 255, 240],\n hotpink: [255, 105, 180],\n indianred: [205, 92, 92],\n indigo: [75, 0, 130],\n ivory: [255, 255, 240],\n khaki: [240, 230, 140],\n lavender: [230, 230, 250],\n lavenderblush: [255, 240, 245],\n lawngreen: [124, 252, 0],\n lemonchiffon: [255, 250, 205],\n lightblue: [173, 216, 230],\n lightcoral: [240, 128, 128],\n lightcyan: [224, 255, 255],\n lightgoldenrodyellow: [250, 250, 210],\n lightgray: [211, 211, 211],\n lightgreen: [144, 238, 144],\n lightgrey: [211, 211, 211],\n lightpink: [255, 182, 193],\n lightsalmon: [255, 160, 122],\n lightseagreen: [32, 178, 170],\n lightskyblue: [135, 206, 250],\n lightslategray: [119, 136, 153],\n lightslategrey: [119, 136, 153],\n lightsteelblue: [176, 196, 222],\n lightyellow: [255, 255, 224],\n lime: [0, 255, 0],\n limegreen: [50, 205, 50],\n linen: [250, 240, 230],\n magenta: [255, 0, 255],\n maroon: [128, 0, 0],\n mediumaquamarine: [102, 205, 170],\n mediumblue: [0, 0, 205],\n mediumorchid: [186, 85, 211],\n mediumpurple: [147, 112, 219],\n mediumseagreen: [60, 179, 113],\n mediumslateblue: [123, 104, 238],\n mediumspringgreen: [0, 250, 154],\n mediumturquoise: [72, 209, 204],\n mediumvioletred: [199, 21, 133],\n midnightblue: [25, 25, 112],\n mintcream: [245, 255, 250],\n mistyrose: [255, 228, 225],\n moccasin: [255, 228, 181],\n navajowhite: [255, 222, 173],\n navy: [0, 0, 128],\n oldlace: [253, 245, 230],\n olive: [128, 128, 0],\n olivedrab: [107, 142, 35],\n orange: [255, 165, 0],\n orangered: [255, 69, 0],\n orchid: [218, 112, 214],\n palegoldenrod: [238, 232, 170],\n palegreen: [152, 251, 152],\n paleturquoise: [175, 238, 238],\n palevioletred: [219, 112, 147],\n papayawhip: [255, 239, 213],\n peachpuff: [255, 218, 185],\n peru: [205, 133, 63],\n pink: [255, 192, 203],\n plum: [221, 160, 203],\n powderblue: [176, 224, 230],\n purple: [128, 0, 128],\n rebeccapurple: [102, 51, 153],\n red: [255, 0, 0],\n rosybrown: [188, 143, 143],\n royalblue: [65, 105, 225],\n saddlebrown: [139, 69, 19],\n salmon: [250, 128, 114],\n sandybrown: [244, 164, 96],\n seagreen: [46, 139, 87],\n seashell: [255, 245, 238],\n sienna: [160, 82, 45],\n silver: [192, 192, 192],\n skyblue: [135, 206, 235],\n slateblue: [106, 90, 205],\n slategray: [119, 128, 144],\n slategrey: [119, 128, 144],\n snow: [255, 255, 250],\n springgreen: [0, 255, 127],\n steelblue: [70, 130, 180],\n tan: [210, 180, 140],\n teal: [0, 128, 128],\n thistle: [216, 191, 216],\n transparent: [255, 255, 255, 0],\n tomato: [255, 99, 71],\n turquoise: [64, 224, 208],\n violet: [238, 130, 238],\n wheat: [245, 222, 179],\n white: [255, 255, 255],\n whitesmoke: [245, 245, 245],\n yellow: [255, 255, 0],\n yellowgreen: [154, 205, 5],\n}, RGB_REGEX = /rgb\\((\\d{1,3}),(\\d{1,3}),(\\d{1,3})\\)/, animQueue = [];\nconst req = (typeof requestAnimationFrame !== 'undefined' && requestAnimationFrame) ||\n function (f) {\n setTimeout(f, 60);\n };\nexports.Util = {\n _isElement(obj) {\n return !!(obj && obj.nodeType == 1);\n },\n _isFunction(obj) {\n return !!(obj && obj.constructor && obj.call && obj.apply);\n },\n _isPlainObject(obj) {\n return !!obj && obj.constructor === Object;\n },\n _isArray(obj) {\n return Object.prototype.toString.call(obj) === OBJECT_ARRAY;\n },\n _isNumber(obj) {\n return (Object.prototype.toString.call(obj) === OBJECT_NUMBER &&\n !isNaN(obj) &&\n isFinite(obj));\n },\n _isString(obj) {\n return Object.prototype.toString.call(obj) === OBJECT_STRING;\n },\n _isBoolean(obj) {\n return Object.prototype.toString.call(obj) === OBJECT_BOOLEAN;\n },\n isObject(val) {\n return val instanceof Object;\n },\n isValidSelector(selector) {\n if (typeof selector !== 'string') {\n return false;\n }\n var firstChar = selector[0];\n return (firstChar === '#' ||\n firstChar === '.' ||\n firstChar === firstChar.toUpperCase());\n },\n _sign(number) {\n if (number === 0) {\n return 1;\n }\n if (number > 0) {\n return 1;\n }\n else {\n return -1;\n }\n },\n requestAnimFrame(callback) {\n animQueue.push(callback);\n if (animQueue.length === 1) {\n req(function () {\n const queue = animQueue;\n animQueue = [];\n queue.forEach(function (cb) {\n cb();\n });\n });\n }\n },\n createCanvasElement() {\n var canvas = document.createElement('canvas');\n try {\n canvas.style = canvas.style || {};\n }\n catch (e) { }\n return canvas;\n },\n createImageElement() {\n return document.createElement('img');\n },\n _isInDocument(el) {\n while ((el = el.parentNode)) {\n if (el == document) {\n return true;\n }\n }\n return false;\n },\n _urlToImage(url, callback) {\n var imageObj = exports.Util.createImageElement();\n imageObj.onload = function () {\n callback(imageObj);\n };\n imageObj.src = url;\n },\n _rgbToHex(r, g, b) {\n return ((1 << 24) + (r << 16) + (g << 8) + b).toString(16).slice(1);\n },\n _hexToRgb(hex) {\n hex = hex.replace(HASH, EMPTY_STRING);\n var bigint = parseInt(hex, 16);\n return {\n r: (bigint >> 16) & 255,\n g: (bigint >> 8) & 255,\n b: bigint & 255,\n };\n },\n getRandomColor() {\n var randColor = ((Math.random() * 0xffffff) << 0).toString(16);\n while (randColor.length < 6) {\n randColor = ZERO + randColor;\n }\n return HASH + randColor;\n },\n getRGB(color) {\n var rgb;\n if (color in COLORS) {\n rgb = COLORS[color];\n return {\n r: rgb[0],\n g: rgb[1],\n b: rgb[2],\n };\n }\n else if (color[0] === HASH) {\n return this._hexToRgb(color.substring(1));\n }\n else if (color.substr(0, 4) === RGB_PAREN) {\n rgb = RGB_REGEX.exec(color.replace(/ /g, ''));\n return {\n r: parseInt(rgb[1], 10),\n g: parseInt(rgb[2], 10),\n b: parseInt(rgb[3], 10),\n };\n }\n else {\n return {\n r: 0,\n g: 0,\n b: 0,\n };\n }\n },\n colorToRGBA(str) {\n str = str || 'black';\n return (exports.Util._namedColorToRBA(str) ||\n exports.Util._hex3ColorToRGBA(str) ||\n exports.Util._hex4ColorToRGBA(str) ||\n exports.Util._hex6ColorToRGBA(str) ||\n exports.Util._hex8ColorToRGBA(str) ||\n exports.Util._rgbColorToRGBA(str) ||\n exports.Util._rgbaColorToRGBA(str) ||\n exports.Util._hslColorToRGBA(str));\n },\n _namedColorToRBA(str) {\n var c = COLORS[str.toLowerCase()];\n if (!c) {\n return null;\n }\n return {\n r: c[0],\n g: c[1],\n b: c[2],\n a: 1,\n };\n },\n _rgbColorToRGBA(str) {\n if (str.indexOf('rgb(') === 0) {\n str = str.match(/rgb\\(([^)]+)\\)/)[1];\n var parts = str.split(/ *, */).map(Number);\n return {\n r: parts[0],\n g: parts[1],\n b: parts[2],\n a: 1,\n };\n }\n },\n _rgbaColorToRGBA(str) {\n if (str.indexOf('rgba(') === 0) {\n str = str.match(/rgba\\(([^)]+)\\)/)[1];\n var parts = str.split(/ *, */).map((n, index) => {\n if (n.slice(-1) === '%') {\n return index === 3 ? parseInt(n) / 100 : (parseInt(n) / 100) * 255;\n }\n return Number(n);\n });\n return {\n r: parts[0],\n g: parts[1],\n b: parts[2],\n a: parts[3],\n };\n }\n },\n _hex8ColorToRGBA(str) {\n if (str[0] === '#' && str.length === 9) {\n return {\n r: parseInt(str.slice(1, 3), 16),\n g: parseInt(str.slice(3, 5), 16),\n b: parseInt(str.slice(5, 7), 16),\n a: parseInt(str.slice(7, 9), 16) / 0xff,\n };\n }\n },\n _hex6ColorToRGBA(str) {\n if (str[0] === '#' && str.length === 7) {\n return {\n r: parseInt(str.slice(1, 3), 16),\n g: parseInt(str.slice(3, 5), 16),\n b: parseInt(str.slice(5, 7), 16),\n a: 1,\n };\n }\n },\n _hex4ColorToRGBA(str) {\n if (str[0] === '#' && str.length === 5) {\n return {\n r: parseInt(str[1] + str[1], 16),\n g: parseInt(str[2] + str[2], 16),\n b: parseInt(str[3] + str[3], 16),\n a: parseInt(str[4] + str[4], 16) / 0xff,\n };\n }\n },\n _hex3ColorToRGBA(str) {\n if (str[0] === '#' && str.length === 4) {\n return {\n r: parseInt(str[1] + str[1], 16),\n g: parseInt(str[2] + str[2], 16),\n b: parseInt(str[3] + str[3], 16),\n a: 1,\n };\n }\n },\n _hslColorToRGBA(str) {\n if (/hsl\\((\\d+),\\s*([\\d.]+)%,\\s*([\\d.]+)%\\)/g.test(str)) {\n const [_, ...hsl] = /hsl\\((\\d+),\\s*([\\d.]+)%,\\s*([\\d.]+)%\\)/g.exec(str);\n const h = Number(hsl[0]) / 360;\n const s = Number(hsl[1]) / 100;\n const l = Number(hsl[2]) / 100;\n let t2;\n let t3;\n let val;\n if (s === 0) {\n val = l * 255;\n return {\n r: Math.round(val),\n g: Math.round(val),\n b: Math.round(val),\n a: 1,\n };\n }\n if (l < 0.5) {\n t2 = l * (1 + s);\n }\n else {\n t2 = l + s - l * s;\n }\n const t1 = 2 * l - t2;\n const rgb = [0, 0, 0];\n for (let i = 0; i < 3; i++) {\n t3 = h + (1 / 3) * -(i - 1);\n if (t3 < 0) {\n t3++;\n }\n if (t3 > 1) {\n t3--;\n }\n if (6 * t3 < 1) {\n val = t1 + (t2 - t1) * 6 * t3;\n }\n else if (2 * t3 < 1) {\n val = t2;\n }\n else if (3 * t3 < 2) {\n val = t1 + (t2 - t1) * (2 / 3 - t3) * 6;\n }\n else {\n val = t1;\n }\n rgb[i] = val * 255;\n }\n return {\n r: Math.round(rgb[0]),\n g: Math.round(rgb[1]),\n b: Math.round(rgb[2]),\n a: 1,\n };\n }\n },\n haveIntersection(r1, r2) {\n return !(r2.x > r1.x + r1.width ||\n r2.x + r2.width < r1.x ||\n r2.y > r1.y + r1.height ||\n r2.y + r2.height < r1.y);\n },\n cloneObject(obj) {\n var retObj = {};\n for (var key in obj) {\n if (this._isPlainObject(obj[key])) {\n retObj[key] = this.cloneObject(obj[key]);\n }\n else if (this._isArray(obj[key])) {\n retObj[key] = this.cloneArray(obj[key]);\n }\n else {\n retObj[key] = obj[key];\n }\n }\n return retObj;\n },\n cloneArray(arr) {\n return arr.slice(0);\n },\n degToRad(deg) {\n return deg * PI_OVER_DEG180;\n },\n radToDeg(rad) {\n return rad * DEG180_OVER_PI;\n },\n _degToRad(deg) {\n exports.Util.warn('Util._degToRad is removed. Please use public Util.degToRad instead.');\n return exports.Util.degToRad(deg);\n },\n _radToDeg(rad) {\n exports.Util.warn('Util._radToDeg is removed. Please use public Util.radToDeg instead.');\n return exports.Util.radToDeg(rad);\n },\n _getRotation(radians) {\n return Global_1.Konva.angleDeg ? exports.Util.radToDeg(radians) : radians;\n },\n _capitalize(str) {\n return str.charAt(0).toUpperCase() + str.slice(1);\n },\n throw(str) {\n throw new Error(KONVA_ERROR + str);\n },\n error(str) {\n console.error(KONVA_ERROR + str);\n },\n warn(str) {\n if (!Global_1.Konva.showWarnings) {\n return;\n }\n console.warn(KONVA_WARNING + str);\n },\n each(obj, func) {\n for (var key in obj) {\n func(key, obj[key]);\n }\n },\n _inRange(val, left, right) {\n return left <= val && val < right;\n },\n _getProjectionToSegment(x1, y1, x2, y2, x3, y3) {\n var x, y, dist;\n var pd2 = (x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2);\n if (pd2 == 0) {\n x = x1;\n y = y1;\n dist = (x3 - x2) * (x3 - x2) + (y3 - y2) * (y3 - y2);\n }\n else {\n var u = ((x3 - x1) * (x2 - x1) + (y3 - y1) * (y2 - y1)) / pd2;\n if (u < 0) {\n x = x1;\n y = y1;\n dist = (x1 - x3) * (x1 - x3) + (y1 - y3) * (y1 - y3);\n }\n else if (u > 1.0) {\n x = x2;\n y = y2;\n dist = (x2 - x3) * (x2 - x3) + (y2 - y3) * (y2 - y3);\n }\n else {\n x = x1 + u * (x2 - x1);\n y = y1 + u * (y2 - y1);\n dist = (x - x3) * (x - x3) + (y - y3) * (y - y3);\n }\n }\n return [x, y, dist];\n },\n _getProjectionToLine(pt, line, isClosed) {\n var pc = exports.Util.cloneObject(pt);\n var dist = Number.MAX_VALUE;\n line.forEach(function (p1, i) {\n if (!isClosed && i === line.length - 1) {\n return;\n }\n var p2 = line[(i + 1) % line.length];\n var proj = exports.Util._getProjectionToSegment(p1.x, p1.y, p2.x, p2.y, pt.x, pt.y);\n var px = proj[0], py = proj[1], pdist = proj[2];\n if (pdist < dist) {\n pc.x = px;\n pc.y = py;\n dist = pdist;\n }\n });\n return pc;\n },\n _prepareArrayForTween(startArray, endArray, isClosed) {\n var n, start = [], end = [];\n if (startArray.length > endArray.length) {\n var temp = endArray;\n endArray = startArray;\n startArray = temp;\n }\n for (n = 0; n < startArray.length; n += 2) {\n start.push({\n x: startArray[n],\n y: startArray[n + 1],\n });\n }\n for (n = 0; n < endArray.length; n += 2) {\n end.push({\n x: endArray[n],\n y: endArray[n + 1],\n });\n }\n var newStart = [];\n end.forEach(function (point) {\n var pr = exports.Util._getProjectionToLine(point, start, isClosed);\n newStart.push(pr.x);\n newStart.push(pr.y);\n });\n return newStart;\n },\n _prepareToStringify(obj) {\n var desc;\n obj.visitedByCircularReferenceRemoval = true;\n for (var key in obj) {\n if (!(obj.hasOwnProperty(key) && obj[key] && typeof obj[key] == 'object')) {\n continue;\n }\n desc = Object.getOwnPropertyDescriptor(obj, key);\n if (obj[key].visitedByCircularReferenceRemoval ||\n exports.Util._isElement(obj[key])) {\n if (desc.configurable) {\n delete obj[key];\n }\n else {\n return null;\n }\n }\n else if (exports.Util._prepareToStringify(obj[key]) === null) {\n if (desc.configurable) {\n delete obj[key];\n }\n else {\n return null;\n }\n }\n }\n delete obj.visitedByCircularReferenceRemoval;\n return obj;\n },\n _assign(target, source) {\n for (var key in source) {\n target[key] = source[key];\n }\n return target;\n },\n _getFirstPointerId(evt) {\n if (!evt.touches) {\n return evt.pointerId || 999;\n }\n else {\n return evt.changedTouches[0].identifier;\n }\n },\n releaseCanvas(...canvases) {\n if (!Global_1.Konva.releaseCanvasOnDestroy)\n return;\n canvases.forEach((c) => {\n c.width = 0;\n c.height = 0;\n });\n },\n drawRoundedRectPath(context, width, height, cornerRadius) {\n let topLeft = 0;\n let topRight = 0;\n let bottomLeft = 0;\n let bottomRight = 0;\n if (typeof cornerRadius === 'number') {\n topLeft =\n topRight =\n bottomLeft =\n bottomRight =\n Math.min(cornerRadius, width / 2, height / 2);\n }\n else {\n topLeft = Math.min(cornerRadius[0] || 0, width / 2, height / 2);\n topRight = Math.min(cornerRadius[1] || 0, width / 2, height / 2);\n bottomRight = Math.min(cornerRadius[2] || 0, width / 2, height / 2);\n bottomLeft = Math.min(cornerRadius[3] || 0, width / 2, height / 2);\n }\n context.moveTo(topLeft, 0);\n context.lineTo(width - topRight, 0);\n context.arc(width - topRight, topRight, topRight, (Math.PI * 3) / 2, 0, false);\n context.lineTo(width, height - bottomRight);\n context.arc(width - bottomRight, height - bottomRight, bottomRight, 0, Math.PI / 2, false);\n context.lineTo(bottomLeft, height);\n context.arc(bottomLeft, height - bottomLeft, bottomLeft, Math.PI / 2, Math.PI, false);\n context.lineTo(0, topLeft);\n context.arc(topLeft, topLeft, topLeft, Math.PI, (Math.PI * 3) / 2, false);\n },\n};\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.getComponentValidator = exports.getBooleanValidator = exports.getNumberArrayValidator = exports.getFunctionValidator = exports.getStringOrGradientValidator = exports.getStringValidator = exports.getNumberOrAutoValidator = exports.getNumberOrArrayOfNumbersValidator = exports.getNumberValidator = exports.alphaComponent = exports.RGBComponent = void 0;\nconst Global_1 = require(\"./Global\");\nconst Util_1 = require(\"./Util\");\nfunction _formatValue(val) {\n if (Util_1.Util._isString(val)) {\n return '\"' + val + '\"';\n }\n if (Object.prototype.toString.call(val) === '[object Number]') {\n return val;\n }\n if (Util_1.Util._isBoolean(val)) {\n return val;\n }\n return Object.prototype.toString.call(val);\n}\nfunction RGBComponent(val) {\n if (val > 255) {\n return 255;\n }\n else if (val < 0) {\n return 0;\n }\n return Math.round(val);\n}\nexports.RGBComponent = RGBComponent;\nfunction alphaComponent(val) {\n if (val > 1) {\n return 1;\n }\n else if (val < 0.0001) {\n return 0.0001;\n }\n return val;\n}\nexports.alphaComponent = alphaComponent;\nfunction getNumberValidator() {\n if (Global_1.Konva.isUnminified) {\n return function (val, attr) {\n if (!Util_1.Util._isNumber(val)) {\n Util_1.Util.warn(_formatValue(val) +\n ' is a not valid value for \"' +\n attr +\n '\" attribute. The value should be a number.');\n }\n return val;\n };\n }\n}\nexports.getNumberValidator = getNumberValidator;\nfunction getNumberOrArrayOfNumbersValidator(noOfElements) {\n if (Global_1.Konva.isUnminified) {\n return function (val, attr) {\n let isNumber = Util_1.Util._isNumber(val);\n let isValidArray = Util_1.Util._isArray(val) && val.length == noOfElements;\n if (!isNumber && !isValidArray) {\n Util_1.Util.warn(_formatValue(val) +\n ' is a not valid value for \"' +\n attr +\n '\" attribute. The value should be a number or Array(' +\n noOfElements +\n ')');\n }\n return val;\n };\n }\n}\nexports.getNumberOrArrayOfNumbersValidator = getNumberOrArrayOfNumbersValidator;\nfunction getNumberOrAutoValidator() {\n if (Global_1.Konva.isUnminified) {\n return function (val, attr) {\n var isNumber = Util_1.Util._isNumber(val);\n var isAuto = val === 'auto';\n if (!(isNumber || isAuto)) {\n Util_1.Util.warn(_formatValue(val) +\n ' is a not valid value for \"' +\n attr +\n '\" attribute. The value should be a number or \"auto\".');\n }\n return val;\n };\n }\n}\nexports.getNumberOrAutoValidator = getNumberOrAutoValidator;\nfunction getStringValidator() {\n if (Global_1.Konva.isUnminified) {\n return function (val, attr) {\n if (!Util_1.Util._isString(val)) {\n Util_1.Util.warn(_formatValue(val) +\n ' is a not valid value for \"' +\n attr +\n '\" attribute. The value should be a string.');\n }\n return val;\n };\n }\n}\nexports.getStringValidator = getStringValidator;\nfunction getStringOrGradientValidator() {\n if (Global_1.Konva.isUnminified) {\n return function (val, attr) {\n const isString = Util_1.Util._isString(val);\n const isGradient = Object.prototype.toString.call(val) === '[object CanvasGradient]' ||\n (val && val.addColorStop);\n if (!(isString || isGradient)) {\n Util_1.Util.warn(_formatValue(val) +\n ' is a not valid value for \"' +\n attr +\n '\" attribute. The value should be a string or a native gradient.');\n }\n return val;\n };\n }\n}\nexports.getStringOrGradientValidator = getStringOrGradientValidator;\nfunction getFunctionValidator() {\n if (Global_1.Konva.isUnminified) {\n return function (val, attr) {\n if (!Util_1.Util._isFunction(val)) {\n Util_1.Util.warn(_formatValue(val) +\n ' is a not valid value for \"' +\n attr +\n '\" attribute. The value should be a function.');\n }\n return val;\n };\n }\n}\nexports.getFunctionValidator = getFunctionValidator;\nfunction getNumberArrayValidator() {\n if (Global_1.Konva.isUnminified) {\n return function (val, attr) {\n const TypedArray = Int8Array ? Object.getPrototypeOf(Int8Array) : null;\n if (TypedArray && val instanceof TypedArray) {\n return val;\n }\n if (!Util_1.Util._isArray(val)) {\n Util_1.Util.warn(_formatValue(val) +\n ' is a not valid value for \"' +\n attr +\n '\" attribute. The value should be a array of numbers.');\n }\n else {\n val.forEach(function (item) {\n if (!Util_1.Util._isNumber(item)) {\n Util_1.Util.warn('\"' +\n attr +\n '\" attribute has non numeric element ' +\n item +\n '. Make sure that all elements are numbers.');\n }\n });\n }\n return val;\n };\n }\n}\nexports.getNumberArrayValidator = getNumberArrayValidator;\nfunction getBooleanValidator() {\n if (Global_1.Konva.isUnminified) {\n return function (val, attr) {\n var isBool = val === true || val === false;\n if (!isBool) {\n Util_1.Util.warn(_formatValue(val) +\n ' is a not valid value for \"' +\n attr +\n '\" attribute. The value should be a boolean.');\n }\n return val;\n };\n }\n}\nexports.getBooleanValidator = getBooleanValidator;\nfunction getComponentValidator(components) {\n if (Global_1.Konva.isUnminified) {\n return function (val, attr) {\n if (val === undefined || val === null) {\n return val;\n }\n if (!Util_1.Util.isObject(val)) {\n Util_1.Util.warn(_formatValue(val) +\n ' is a not valid value for \"' +\n attr +\n '\" attribute. The value should be an object with properties ' +\n components);\n }\n return val;\n };\n }\n}\nexports.getComponentValidator = getComponentValidator;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Factory = void 0;\nconst Util_1 = require(\"./Util\");\nconst Validators_1 = require(\"./Validators\");\nvar GET = 'get', SET = 'set';\nexports.Factory = {\n addGetterSetter(constructor, attr, def, validator, after) {\n exports.Factory.addGetter(constructor, attr, def);\n exports.Factory.addSetter(constructor, attr, validator, after);\n exports.Factory.addOverloadedGetterSetter(constructor, attr);\n },\n addGetter(constructor, attr, def) {\n var method = GET + Util_1.Util._capitalize(attr);\n constructor.prototype[method] =\n constructor.prototype[method] ||\n function () {\n var val = this.attrs[attr];\n return val === undefined ? def : val;\n };\n },\n addSetter(constructor, attr, validator, after) {\n var method = SET + Util_1.Util._capitalize(attr);\n if (!constructor.prototype[method]) {\n exports.Factory.overWriteSetter(constructor, attr, validator, after);\n }\n },\n overWriteSetter(constructor, attr, validator, after) {\n var method = SET + Util_1.Util._capitalize(attr);\n constructor.prototype[method] = function (val) {\n if (validator && val !== undefined && val !== null) {\n val = validator.call(this, val, attr);\n }\n this._setAttr(attr, val);\n if (after) {\n after.call(this);\n }\n return this;\n };\n },\n addComponentsGetterSetter(constructor, attr, components, validator, after) {\n var len = components.length, capitalize = Util_1.Util._capitalize, getter = GET + capitalize(attr), setter = SET + capitalize(attr), n, component;\n constructor.prototype[getter] = function () {\n var ret = {};\n for (n = 0; n < len; n++) {\n component = components[n];\n ret[component] = this.getAttr(attr + capitalize(component));\n }\n return ret;\n };\n var basicValidator = (0, Validators_1.getComponentValidator)(components);\n constructor.prototype[setter] = function (val) {\n var oldVal = this.attrs[attr], key;\n if (validator) {\n val = validator.call(this, val);\n }\n if (basicValidator) {\n basicValidator.call(this, val, attr);\n }\n for (key in val) {\n if (!val.hasOwnProperty(key)) {\n continue;\n }\n this._setAttr(attr + capitalize(key), val[key]);\n }\n if (!val) {\n components.forEach((component) => {\n this._setAttr(attr + capitalize(component), undefined);\n });\n }\n this._fireChangeEvent(attr, oldVal, val);\n if (after) {\n after.call(this);\n }\n return this;\n };\n exports.Factory.addOverloadedGetterSetter(constructor, attr);\n },\n addOverloadedGetterSetter(constructor, attr) {\n var capitalizedAttr = Util_1.Util._capitalize(attr), setter = SET + capitalizedAttr, getter = GET + capitalizedAttr;\n constructor.prototype[attr] = function () {\n if (arguments.length) {\n this[setter](arguments[0]);\n return this;\n }\n return this[getter]();\n };\n },\n addDeprecatedGetterSetter(constructor, attr, def, validator) {\n Util_1.Util.error('Adding deprecated ' + attr);\n var method = GET + Util_1.Util._capitalize(attr);\n var message = attr +\n ' property is deprecated and will be removed soon. Look at Konva change log for more information.';\n constructor.prototype[method] = function () {\n Util_1.Util.error(message);\n var val = this.attrs[attr];\n return val === undefined ? def : val;\n };\n exports.Factory.addSetter(constructor, attr, validator, function () {\n Util_1.Util.error(message);\n });\n exports.Factory.addOverloadedGetterSetter(constructor, attr);\n },\n backCompat(constructor, methods) {\n Util_1.Util.each(methods, function (oldMethodName, newMethodName) {\n var method = constructor.prototype[newMethodName];\n var oldGetter = GET + Util_1.Util._capitalize(oldMethodName);\n var oldSetter = SET + Util_1.Util._capitalize(oldMethodName);\n function deprecated() {\n method.apply(this, arguments);\n Util_1.Util.error('\"' +\n oldMethodName +\n '\" method is deprecated and will be removed soon. Use \"\"' +\n newMethodName +\n '\" instead.');\n }\n constructor.prototype[oldMethodName] = deprecated;\n constructor.prototype[oldGetter] = deprecated;\n constructor.prototype[oldSetter] = deprecated;\n });\n },\n afterSetFilter() {\n this._filterUpToDate = false;\n },\n};\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.HitContext = exports.SceneContext = exports.Context = void 0;\nconst Util_1 = require(\"./Util\");\nconst Global_1 = require(\"./Global\");\nfunction simplifyArray(arr) {\n var retArr = [], len = arr.length, util = Util_1.Util, n, val;\n for (n = 0; n < len; n++) {\n val = arr[n];\n if (util._isNumber(val)) {\n val = Math.round(val * 1000) / 1000;\n }\n else if (!util._isString(val)) {\n val = val + '';\n }\n retArr.push(val);\n }\n return retArr;\n}\nvar COMMA = ',', OPEN_PAREN = '(', CLOSE_PAREN = ')', OPEN_PAREN_BRACKET = '([', CLOSE_BRACKET_PAREN = '])', SEMICOLON = ';', DOUBLE_PAREN = '()', EQUALS = '=', CONTEXT_METHODS = [\n 'arc',\n 'arcTo',\n 'beginPath',\n 'bezierCurveTo',\n 'clearRect',\n 'clip',\n 'closePath',\n 'createLinearGradient',\n 'createPattern',\n 'createRadialGradient',\n 'drawImage',\n 'ellipse',\n 'fill',\n 'fillText',\n 'getImageData',\n 'createImageData',\n 'lineTo',\n 'moveTo',\n 'putImageData',\n 'quadraticCurveTo',\n 'rect',\n 'roundRect',\n 'restore',\n 'rotate',\n 'save',\n 'scale',\n 'setLineDash',\n 'setTransform',\n 'stroke',\n 'strokeText',\n 'transform',\n 'translate',\n];\nvar CONTEXT_PROPERTIES = [\n 'fillStyle',\n 'strokeStyle',\n 'shadowColor',\n 'shadowBlur',\n 'shadowOffsetX',\n 'shadowOffsetY',\n 'letterSpacing',\n 'lineCap',\n 'lineDashOffset',\n 'lineJoin',\n 'lineWidth',\n 'miterLimit',\n 'direction',\n 'font',\n 'textAlign',\n 'textBaseline',\n 'globalAlpha',\n 'globalCompositeOperation',\n 'imageSmoothingEnabled',\n];\nconst traceArrMax = 100;\nclass Context {\n constructor(canvas) {\n this.canvas = canvas;\n if (Global_1.Konva.enableTrace) {\n this.traceArr = [];\n this._enableTrace();\n }\n }\n fillShape(shape) {\n if (shape.fillEnabled()) {\n this._fill(shape);\n }\n }\n _fill(shape) {\n }\n strokeShape(shape) {\n if (shape.hasStroke()) {\n this._stroke(shape);\n }\n }\n _stroke(shape) {\n }\n fillStrokeShape(shape) {\n if (shape.attrs.fillAfterStrokeEnabled) {\n this.strokeShape(shape);\n this.fillShape(shape);\n }\n else {\n this.fillShape(shape);\n this.strokeShape(shape);\n }\n }\n getTrace(relaxed, rounded) {\n var traceArr = this.traceArr, len = traceArr.length, str = '', n, trace, method, args;\n for (n = 0; n < len; n++) {\n trace = traceArr[n];\n method = trace.method;\n if (method) {\n args = trace.args;\n str += method;\n if (relaxed) {\n str += DOUBLE_PAREN;\n }\n else {\n if (Util_1.Util._isArray(args[0])) {\n str += OPEN_PAREN_BRACKET + args.join(COMMA) + CLOSE_BRACKET_PAREN;\n }\n else {\n if (rounded) {\n args = args.map((a) => typeof a === 'number' ? Math.floor(a) : a);\n }\n str += OPEN_PAREN + args.join(COMMA) + CLOSE_PAREN;\n }\n }\n }\n else {\n str += trace.property;\n if (!relaxed) {\n str += EQUALS + trace.val;\n }\n }\n str += SEMICOLON;\n }\n return str;\n }\n clearTrace() {\n this.traceArr = [];\n }\n _trace(str) {\n var traceArr = this.traceArr, len;\n traceArr.push(str);\n len = traceArr.length;\n if (len >= traceArrMax) {\n traceArr.shift();\n }\n }\n reset() {\n var pixelRatio = this.getCanvas().getPixelRatio();\n this.setTransform(1 * pixelRatio, 0, 0, 1 * pixelRatio, 0, 0);\n }\n getCanvas() {\n return this.canvas;\n }\n clear(bounds) {\n var canvas = this.getCanvas();\n if (bounds) {\n this.clearRect(bounds.x || 0, bounds.y || 0, bounds.width || 0, bounds.height || 0);\n }\n else {\n this.clearRect(0, 0, canvas.getWidth() / canvas.pixelRatio, canvas.getHeight() / canvas.pixelRatio);\n }\n }\n _applyLineCap(shape) {\n const lineCap = shape.attrs.lineCap;\n if (lineCap) {\n this.setAttr('lineCap', lineCap);\n }\n }\n _applyOpacity(shape) {\n var absOpacity = shape.getAbsoluteOpacity();\n if (absOpacity !== 1) {\n this.setAttr('globalAlpha', absOpacity);\n }\n }\n _applyLineJoin(shape) {\n const lineJoin = shape.attrs.lineJoin;\n if (lineJoin) {\n this.setAttr('lineJoin', lineJoin);\n }\n }\n setAttr(attr, val) {\n this._context[attr] = val;\n }\n arc(x, y, radius, startAngle, endAngle, counterClockwise) {\n this._context.arc(x, y, radius, startAngle, endAngle, counterClockwise);\n }\n arcTo(x1, y1, x2, y2, radius) {\n this._context.arcTo(x1, y1, x2, y2, radius);\n }\n beginPath() {\n this._context.beginPath();\n }\n bezierCurveTo(cp1x, cp1y, cp2x, cp2y, x, y) {\n this._context.bezierCurveTo(cp1x, cp1y, cp2x, cp2y, x, y);\n }\n clearRect(x, y, width, height) {\n this._context.clearRect(x, y, width, height);\n }\n clip(...args) {\n this._context.clip.apply(this._context, args);\n }\n closePath() {\n this._context.closePath();\n }\n createImageData(width, height) {\n var a = arguments;\n if (a.length === 2) {\n return this._context.createImageData(width, height);\n }\n else if (a.length === 1) {\n return this._context.createImageData(width);\n }\n }\n createLinearGradient(x0, y0, x1, y1) {\n return this._context.createLinearGradient(x0, y0, x1, y1);\n }\n createPattern(image, repetition) {\n return this._context.createPattern(image, repetition);\n }\n createRadialGradient(x0, y0, r0, x1, y1, r1) {\n return this._context.createRadialGradient(x0, y0, r0, x1, y1, r1);\n }\n drawImage(image, sx, sy, sWidth, sHeight, dx, dy, dWidth, dHeight) {\n var a = arguments, _context = this._context;\n if (a.length === 3) {\n _context.drawImage(image, sx, sy);\n }\n else if (a.length === 5) {\n _context.drawImage(image, sx, sy, sWidth, sHeight);\n }\n else if (a.length === 9) {\n _context.drawImage(image, sx, sy, sWidth, sHeight, dx, dy, dWidth, dHeight);\n }\n }\n ellipse(x, y, radiusX, radiusY, rotation, startAngle, endAngle, counterclockwise) {\n this._context.ellipse(x, y, radiusX, radiusY, rotation, startAngle, endAngle, counterclockwise);\n }\n isPointInPath(x, y, path, fillRule) {\n if (path) {\n return this._context.isPointInPath(path, x, y, fillRule);\n }\n return this._context.isPointInPath(x, y, fillRule);\n }\n fill(...args) {\n this._context.fill.apply(this._context, args);\n }\n fillRect(x, y, width, height) {\n this._context.fillRect(x, y, width, height);\n }\n strokeRect(x, y, width, height) {\n this._context.strokeRect(x, y, width, height);\n }\n fillText(text, x, y, maxWidth) {\n if (maxWidth) {\n this._context.fillText(text, x, y, maxWidth);\n }\n else {\n this._context.fillText(text, x, y);\n }\n }\n measureText(text) {\n return this._context.measureText(text);\n }\n getImageData(sx, sy, sw, sh) {\n return this._context.getImageData(sx, sy, sw, sh);\n }\n lineTo(x, y) {\n this._context.lineTo(x, y);\n }\n moveTo(x, y) {\n this._context.moveTo(x, y);\n }\n rect(x, y, width, height) {\n this._context.rect(x, y, width, height);\n }\n roundRect(x, y, width, height, radii) {\n this._context.roundRect(x, y, width, height, radii);\n }\n putImageData(imageData, dx, dy) {\n this._context.putImageData(imageData, dx, dy);\n }\n quadraticCurveTo(cpx, cpy, x, y) {\n this._context.quadraticCurveTo(cpx, cpy, x, y);\n }\n restore() {\n this._context.restore();\n }\n rotate(angle) {\n this._context.rotate(angle);\n }\n save() {\n this._context.save();\n }\n scale(x, y) {\n this._context.scale(x, y);\n }\n setLineDash(segments) {\n if (this._context.setLineDash) {\n this._context.setLineDash(segments);\n }\n else if ('mozDash' in this._context) {\n this._context['mozDash'] = segments;\n }\n else if ('webkitLineDash' in this._context) {\n this._context['webkitLineDash'] = segments;\n }\n }\n getLineDash() {\n return this._context.getLineDash();\n }\n setTransform(a, b, c, d, e, f) {\n this._context.setTransform(a, b, c, d, e, f);\n }\n stroke(path2d) {\n if (path2d) {\n this._context.stroke(path2d);\n }\n else {\n this._context.stroke();\n }\n }\n strokeText(text, x, y, maxWidth) {\n this._context.strokeText(text, x, y, maxWidth);\n }\n transform(a, b, c, d, e, f) {\n this._context.transform(a, b, c, d, e, f);\n }\n translate(x, y) {\n this._context.translate(x, y);\n }\n _enableTrace() {\n var that = this, len = CONTEXT_METHODS.length, origSetter = this.setAttr, n, args;\n var func = function (methodName) {\n var origMethod = that[methodName], ret;\n that[methodName] = function () {\n args = simplifyArray(Array.prototype.slice.call(arguments, 0));\n ret = origMethod.apply(that, arguments);\n that._trace({\n method: methodName,\n args: args,\n });\n return ret;\n };\n };\n for (n = 0; n < len; n++) {\n func(CONTEXT_METHODS[n]);\n }\n that.setAttr = function () {\n origSetter.apply(that, arguments);\n var prop = arguments[0];\n var val = arguments[1];\n if (prop === 'shadowOffsetX' ||\n prop === 'shadowOffsetY' ||\n prop === 'shadowBlur') {\n val = val / this.canvas.getPixelRatio();\n }\n that._trace({\n property: prop,\n val: val,\n });\n };\n }\n _applyGlobalCompositeOperation(node) {\n const op = node.attrs.globalCompositeOperation;\n var def = !op || op === 'source-over';\n if (!def) {\n this.setAttr('globalCompositeOperation', op);\n }\n }\n}\nexports.Context = Context;\nCONTEXT_PROPERTIES.forEach(function (prop) {\n Object.defineProperty(Context.prototype, prop, {\n get() {\n return this._context[prop];\n },\n set(val) {\n this._context[prop] = val;\n },\n });\n});\nclass SceneContext extends Context {\n constructor(canvas, { willReadFrequently = false } = {}) {\n super(canvas);\n this._context = canvas._canvas.getContext('2d', {\n willReadFrequently,\n });\n }\n _fillColor(shape) {\n var fill = shape.fill();\n this.setAttr('fillStyle', fill);\n shape._fillFunc(this);\n }\n _fillPattern(shape) {\n this.setAttr('fillStyle', shape._getFillPattern());\n shape._fillFunc(this);\n }\n _fillLinearGradient(shape) {\n var grd = shape._getLinearGradient();\n if (grd) {\n this.setAttr('fillStyle', grd);\n shape._fillFunc(this);\n }\n }\n _fillRadialGradient(shape) {\n const grd = shape._getRadialGradient();\n if (grd) {\n this.setAttr('fillStyle', grd);\n shape._fillFunc(this);\n }\n }\n _fill(shape) {\n const hasColor = shape.fill(), fillPriority = shape.getFillPriority();\n if (hasColor && fillPriority === 'color') {\n this._fillColor(shape);\n return;\n }\n const hasPattern = shape.getFillPatternImage();\n if (hasPattern && fillPriority === 'pattern') {\n this._fillPattern(shape);\n return;\n }\n const hasLinearGradient = shape.getFillLinearGradientColorStops();\n if (hasLinearGradient && fillPriority === 'linear-gradient') {\n this._fillLinearGradient(shape);\n return;\n }\n const hasRadialGradient = shape.getFillRadialGradientColorStops();\n if (hasRadialGradient && fillPriority === 'radial-gradient') {\n this._fillRadialGradient(shape);\n return;\n }\n if (hasColor) {\n this._fillColor(shape);\n }\n else if (hasPattern) {\n this._fillPattern(shape);\n }\n else if (hasLinearGradient) {\n this._fillLinearGradient(shape);\n }\n else if (hasRadialGradient) {\n this._fillRadialGradient(shape);\n }\n }\n _strokeLinearGradient(shape) {\n const start = shape.getStrokeLinearGradientStartPoint(), end = shape.getStrokeLinearGradientEndPoint(), colorStops = shape.getStrokeLinearGradientColorStops(), grd = this.createLinearGradient(start.x, start.y, end.x, end.y);\n if (colorStops) {\n for (var n = 0; n < colorStops.length; n += 2) {\n grd.addColorStop(colorStops[n], colorStops[n + 1]);\n }\n this.setAttr('strokeStyle', grd);\n }\n }\n _stroke(shape) {\n var dash = shape.dash(), strokeScaleEnabled = shape.getStrokeScaleEnabled();\n if (shape.hasStroke()) {\n if (!strokeScaleEnabled) {\n this.save();\n var pixelRatio = this.getCanvas().getPixelRatio();\n this.setTransform(pixelRatio, 0, 0, pixelRatio, 0, 0);\n }\n this._applyLineCap(shape);\n if (dash && shape.dashEnabled()) {\n this.setLineDash(dash);\n this.setAttr('lineDashOffset', shape.dashOffset());\n }\n this.setAttr('lineWidth', shape.strokeWidth());\n if (!shape.getShadowForStrokeEnabled()) {\n this.setAttr('shadowColor', 'rgba(0,0,0,0)');\n }\n var hasLinearGradient = shape.getStrokeLinearGradientColorStops();\n if (hasLinearGradient) {\n this._strokeLinearGradient(shape);\n }\n else {\n this.setAttr('strokeStyle', shape.stroke());\n }\n shape._strokeFunc(this);\n if (!strokeScaleEnabled) {\n this.restore();\n }\n }\n }\n _applyShadow(shape) {\n var _a, _b, _c;\n var color = (_a = shape.getShadowRGBA()) !== null && _a !== void 0 ? _a : 'black', blur = (_b = shape.getShadowBlur()) !== null && _b !== void 0 ? _b : 5, offset = (_c = shape.getShadowOffset()) !== null && _c !== void 0 ? _c : {\n x: 0,\n y: 0,\n }, scale = shape.getAbsoluteScale(), ratio = this.canvas.getPixelRatio(), scaleX = scale.x * ratio, scaleY = scale.y * ratio;\n this.setAttr('shadowColor', color);\n this.setAttr('shadowBlur', blur * Math.min(Math.abs(scaleX), Math.abs(scaleY)));\n this.setAttr('shadowOffsetX', offset.x * scaleX);\n this.setAttr('shadowOffsetY', offset.y * scaleY);\n }\n}\nexports.SceneContext = SceneContext;\nclass HitContext extends Context {\n constructor(canvas) {\n super(canvas);\n this._context = canvas._canvas.getContext('2d', {\n willReadFrequently: true,\n });\n }\n _fill(shape) {\n this.save();\n this.setAttr('fillStyle', shape.colorKey);\n shape._fillFuncHit(this);\n this.restore();\n }\n strokeShape(shape) {\n if (shape.hasHitStroke()) {\n this._stroke(shape);\n }\n }\n _stroke(shape) {\n if (shape.hasHitStroke()) {\n const strokeScaleEnabled = shape.getStrokeScaleEnabled();\n if (!strokeScaleEnabled) {\n this.save();\n var pixelRatio = this.getCanvas().getPixelRatio();\n this.setTransform(pixelRatio, 0, 0, pixelRatio, 0, 0);\n }\n this._applyLineCap(shape);\n var hitStrokeWidth = shape.hitStrokeWidth();\n var strokeWidth = hitStrokeWidth === 'auto' ? shape.strokeWidth() : hitStrokeWidth;\n this.setAttr('lineWidth', strokeWidth);\n this.setAttr('strokeStyle', shape.colorKey);\n shape._strokeFuncHit(this);\n if (!strokeScaleEnabled) {\n this.restore();\n }\n }\n }\n}\nexports.HitContext = HitContext;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.HitCanvas = exports.SceneCanvas = exports.Canvas = void 0;\nconst Util_1 = require(\"./Util\");\nconst Context_1 = require(\"./Context\");\nconst Global_1 = require(\"./Global\");\nconst Factory_1 = require(\"./Factory\");\nconst Validators_1 = require(\"./Validators\");\nvar _pixelRatio;\nfunction getDevicePixelRatio() {\n if (_pixelRatio) {\n return _pixelRatio;\n }\n var canvas = Util_1.Util.createCanvasElement();\n var context = canvas.getContext('2d');\n _pixelRatio = (function () {\n var devicePixelRatio = Global_1.Konva._global.devicePixelRatio || 1, backingStoreRatio = context.webkitBackingStorePixelRatio ||\n context.mozBackingStorePixelRatio ||\n context.msBackingStorePixelRatio ||\n context.oBackingStorePixelRatio ||\n context.backingStorePixelRatio ||\n 1;\n return devicePixelRatio / backingStoreRatio;\n })();\n Util_1.Util.releaseCanvas(canvas);\n return _pixelRatio;\n}\nclass Canvas {\n constructor(config) {\n this.pixelRatio = 1;\n this.width = 0;\n this.height = 0;\n this.isCache = false;\n var conf = config || {};\n var pixelRatio = conf.pixelRatio || Global_1.Konva.pixelRatio || getDevicePixelRatio();\n this.pixelRatio = pixelRatio;\n this._canvas = Util_1.Util.createCanvasElement();\n this._canvas.style.padding = '0';\n this._canvas.style.margin = '0';\n this._canvas.style.border = '0';\n this._canvas.style.background = 'transparent';\n this._canvas.style.position = 'absolute';\n this._canvas.style.top = '0';\n this._canvas.style.left = '0';\n }\n getContext() {\n return this.context;\n }\n getPixelRatio() {\n return this.pixelRatio;\n }\n setPixelRatio(pixelRatio) {\n var previousRatio = this.pixelRatio;\n this.pixelRatio = pixelRatio;\n this.setSize(this.getWidth() / previousRatio, this.getHeight() / previousRatio);\n }\n setWidth(width) {\n this.width = this._canvas.width = width * this.pixelRatio;\n this._canvas.style.width = width + 'px';\n var pixelRatio = this.pixelRatio, _context = this.getContext()._context;\n _context.scale(pixelRatio, pixelRatio);\n }\n setHeight(height) {\n this.height = this._canvas.height = height * this.pixelRatio;\n this._canvas.style.height = height + 'px';\n var pixelRatio = this.pixelRatio, _context = this.getContext()._context;\n _context.scale(pixelRatio, pixelRatio);\n }\n getWidth() {\n return this.width;\n }\n getHeight() {\n return this.height;\n }\n setSize(width, height) {\n this.setWidth(width || 0);\n this.setHeight(height || 0);\n }\n toDataURL(mimeType, quality) {\n try {\n return this._canvas.toDataURL(mimeType, quality);\n }\n catch (e) {\n try {\n return this._canvas.toDataURL();\n }\n catch (err) {\n Util_1.Util.error('Unable to get data URL. ' +\n err.message +\n ' For more info read https://konvajs.org/docs/posts/Tainted_Canvas.html.');\n return '';\n }\n }\n }\n}\nexports.Canvas = Canvas;\nFactory_1.Factory.addGetterSetter(Canvas, 'pixelRatio', undefined, (0, Validators_1.getNumberValidator)());\nclass SceneCanvas extends Canvas {\n constructor(config = { width: 0, height: 0, willReadFrequently: false }) {\n super(config);\n this.context = new Context_1.SceneContext(this, {\n willReadFrequently: config.willReadFrequently,\n });\n this.setSize(config.width, config.height);\n }\n}\nexports.SceneCanvas = SceneCanvas;\nclass HitCanvas extends Canvas {\n constructor(config = { width: 0, height: 0 }) {\n super(config);\n this.hitCanvas = true;\n this.context = new Context_1.HitContext(this);\n this.setSize(config.width, config.height);\n }\n}\nexports.HitCanvas = HitCanvas;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.DD = void 0;\nconst Global_1 = require(\"./Global\");\nconst Util_1 = require(\"./Util\");\nexports.DD = {\n get isDragging() {\n var flag = false;\n exports.DD._dragElements.forEach((elem) => {\n if (elem.dragStatus === 'dragging') {\n flag = true;\n }\n });\n return flag;\n },\n justDragged: false,\n get node() {\n var node;\n exports.DD._dragElements.forEach((elem) => {\n node = elem.node;\n });\n return node;\n },\n _dragElements: new Map(),\n _drag(evt) {\n const nodesToFireEvents = [];\n exports.DD._dragElements.forEach((elem, key) => {\n const { node } = elem;\n const stage = node.getStage();\n stage.setPointersPositions(evt);\n if (elem.pointerId === undefined) {\n elem.pointerId = Util_1.Util._getFirstPointerId(evt);\n }\n const pos = stage._changedPointerPositions.find((pos) => pos.id === elem.pointerId);\n if (!pos) {\n return;\n }\n if (elem.dragStatus !== 'dragging') {\n var dragDistance = node.dragDistance();\n var distance = Math.max(Math.abs(pos.x - elem.startPointerPos.x), Math.abs(pos.y - elem.startPointerPos.y));\n if (distance < dragDistance) {\n return;\n }\n node.startDrag({ evt });\n if (!node.isDragging()) {\n return;\n }\n }\n node._setDragPosition(evt, elem);\n nodesToFireEvents.push(node);\n });\n nodesToFireEvents.forEach((node) => {\n node.fire('dragmove', {\n type: 'dragmove',\n target: node,\n evt: evt,\n }, true);\n });\n },\n _endDragBefore(evt) {\n const drawNodes = [];\n exports.DD._dragElements.forEach((elem) => {\n const { node } = elem;\n const stage = node.getStage();\n if (evt) {\n stage.setPointersPositions(evt);\n }\n const pos = stage._changedPointerPositions.find((pos) => pos.id === elem.pointerId);\n if (!pos) {\n return;\n }\n if (elem.dragStatus === 'dragging' || elem.dragStatus === 'stopped') {\n exports.DD.justDragged = true;\n Global_1.Konva._mouseListenClick = false;\n Global_1.Konva._touchListenClick = false;\n Global_1.Konva._pointerListenClick = false;\n elem.dragStatus = 'stopped';\n }\n const drawNode = elem.node.getLayer() ||\n (elem.node instanceof Global_1.Konva['Stage'] && elem.node);\n if (drawNode && drawNodes.indexOf(drawNode) === -1) {\n drawNodes.push(drawNode);\n }\n });\n drawNodes.forEach((drawNode) => {\n drawNode.draw();\n });\n },\n _endDragAfter(evt) {\n exports.DD._dragElements.forEach((elem, key) => {\n if (elem.dragStatus === 'stopped') {\n elem.node.fire('dragend', {\n type: 'dragend',\n target: elem.node,\n evt: evt,\n }, true);\n }\n if (elem.dragStatus !== 'dragging') {\n exports.DD._dragElements.delete(key);\n }\n });\n },\n};\nif (Global_1.Konva.isBrowser) {\n window.addEventListener('mouseup', exports.DD._endDragBefore, true);\n window.addEventListener('touchend', exports.DD._endDragBefore, true);\n window.addEventListener('mousemove', exports.DD._drag);\n window.addEventListener('touchmove', exports.DD._drag);\n window.addEventListener('mouseup', exports.DD._endDragAfter, false);\n window.addEventListener('touchend', exports.DD._endDragAfter, false);\n}\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Node = void 0;\nconst Util_1 = require(\"./Util\");\nconst Factory_1 = require(\"./Factory\");\nconst Canvas_1 = require(\"./Canvas\");\nconst Global_1 = require(\"./Global\");\nconst DragAndDrop_1 = require(\"./DragAndDrop\");\nconst Validators_1 = require(\"./Validators\");\nvar ABSOLUTE_OPACITY = 'absoluteOpacity', ALL_LISTENERS = 'allEventListeners', ABSOLUTE_TRANSFORM = 'absoluteTransform', ABSOLUTE_SCALE = 'absoluteScale', CANVAS = 'canvas', CHANGE = 'Change', CHILDREN = 'children', KONVA = 'konva', LISTENING = 'listening', MOUSEENTER = 'mouseenter', MOUSELEAVE = 'mouseleave', NAME = 'name', SET = 'set', SHAPE = 'Shape', SPACE = ' ', STAGE = 'stage', TRANSFORM = 'transform', UPPER_STAGE = 'Stage', VISIBLE = 'visible', TRANSFORM_CHANGE_STR = [\n 'xChange.konva',\n 'yChange.konva',\n 'scaleXChange.konva',\n 'scaleYChange.konva',\n 'skewXChange.konva',\n 'skewYChange.konva',\n 'rotationChange.konva',\n 'offsetXChange.konva',\n 'offsetYChange.konva',\n 'transformsEnabledChange.konva',\n].join(SPACE);\nlet idCounter = 1;\nclass Node {\n constructor(config) {\n this._id = idCounter++;\n this.eventListeners = {};\n this.attrs = {};\n this.index = 0;\n this._allEventListeners = null;\n this.parent = null;\n this._cache = new Map();\n this._attachedDepsListeners = new Map();\n this._lastPos = null;\n this._batchingTransformChange = false;\n this._needClearTransformCache = false;\n this._filterUpToDate = false;\n this._isUnderCache = false;\n this._dragEventId = null;\n this._shouldFireChangeEvents = false;\n this.setAttrs(config);\n this._shouldFireChangeEvents = true;\n }\n hasChildren() {\n return false;\n }\n _clearCache(attr) {\n if ((attr === TRANSFORM || attr === ABSOLUTE_TRANSFORM) &&\n this._cache.get(attr)) {\n this._cache.get(attr).dirty = true;\n }\n else if (attr) {\n this._cache.delete(attr);\n }\n else {\n this._cache.clear();\n }\n }\n _getCache(attr, privateGetter) {\n var cache = this._cache.get(attr);\n var isTransform = attr === TRANSFORM || attr === ABSOLUTE_TRANSFORM;\n var invalid = cache === undefined || (isTransform && cache.dirty === true);\n if (invalid) {\n cache = privateGetter.call(this);\n this._cache.set(attr, cache);\n }\n return cache;\n }\n _calculate(name, deps, getter) {\n if (!this._attachedDepsListeners.get(name)) {\n const depsString = deps.map((dep) => dep + 'Change.konva').join(SPACE);\n this.on(depsString, () => {\n this._clearCache(name);\n });\n this._attachedDepsListeners.set(name, true);\n }\n return this._getCache(name, getter);\n }\n _getCanvasCache() {\n return this._cache.get(CANVAS);\n }\n _clearSelfAndDescendantCache(attr) {\n this._clearCache(attr);\n if (attr === ABSOLUTE_TRANSFORM) {\n this.fire('absoluteTransformChange');\n }\n }\n clearCache() {\n if (this._cache.has(CANVAS)) {\n const { scene, filter, hit } = this._cache.get(CANVAS);\n Util_1.Util.releaseCanvas(scene, filter, hit);\n this._cache.delete(CANVAS);\n }\n this._clearSelfAndDescendantCache();\n this._requestDraw();\n return this;\n }\n cache(config) {\n var conf = config || {};\n var rect = {};\n if (conf.x === undefined ||\n conf.y === undefined ||\n conf.width === undefined ||\n conf.height === undefined) {\n rect = this.getClientRect({\n skipTransform: true,\n relativeTo: this.getParent() || undefined,\n });\n }\n var width = Math.ceil(conf.width || rect.width), height = Math.ceil(conf.height || rect.height), pixelRatio = conf.pixelRatio, x = conf.x === undefined ? Math.floor(rect.x) : conf.x, y = conf.y === undefined ? Math.floor(rect.y) : conf.y, offset = conf.offset || 0, drawBorder = conf.drawBorder || false, hitCanvasPixelRatio = conf.hitCanvasPixelRatio || 1;\n if (!width || !height) {\n Util_1.Util.error('Can not cache the node. Width or height of the node equals 0. Caching is skipped.');\n return;\n }\n const extraPaddingX = Math.abs(Math.round(rect.x) - x) > 0.5 ? 1 : 0;\n const extraPaddingY = Math.abs(Math.round(rect.y) - y) > 0.5 ? 1 : 0;\n width += offset * 2 + extraPaddingX;\n height += offset * 2 + extraPaddingY;\n x -= offset;\n y -= offset;\n var cachedSceneCanvas = new Canvas_1.SceneCanvas({\n pixelRatio: pixelRatio,\n width: width,\n height: height,\n }), cachedFilterCanvas = new Canvas_1.SceneCanvas({\n pixelRatio: pixelRatio,\n width: 0,\n height: 0,\n willReadFrequently: true,\n }), cachedHitCanvas = new Canvas_1.HitCanvas({\n pixelRatio: hitCanvasPixelRatio,\n width: width,\n height: height,\n }), sceneContext = cachedSceneCanvas.getContext(), hitContext = cachedHitCanvas.getContext();\n cachedHitCanvas.isCache = true;\n cachedSceneCanvas.isCache = true;\n this._cache.delete(CANVAS);\n this._filterUpToDate = false;\n if (conf.imageSmoothingEnabled === false) {\n cachedSceneCanvas.getContext()._context.imageSmoothingEnabled = false;\n cachedFilterCanvas.getContext()._context.imageSmoothingEnabled = false;\n }\n sceneContext.save();\n hitContext.save();\n sceneContext.translate(-x, -y);\n hitContext.translate(-x, -y);\n this._isUnderCache = true;\n this._clearSelfAndDescendantCache(ABSOLUTE_OPACITY);\n this._clearSelfAndDescendantCache(ABSOLUTE_SCALE);\n this.drawScene(cachedSceneCanvas, this);\n this.drawHit(cachedHitCanvas, this);\n this._isUnderCache = false;\n sceneContext.restore();\n hitContext.restore();\n if (drawBorder) {\n sceneContext.save();\n sceneContext.beginPath();\n sceneContext.rect(0, 0, width, height);\n sceneContext.closePath();\n sceneContext.setAttr('strokeStyle', 'red');\n sceneContext.setAttr('lineWidth', 5);\n sceneContext.stroke();\n sceneContext.restore();\n }\n this._cache.set(CANVAS, {\n scene: cachedSceneCanvas,\n filter: cachedFilterCanvas,\n hit: cachedHitCanvas,\n x: x,\n y: y,\n });\n this._requestDraw();\n return this;\n }\n isCached() {\n return this._cache.has(CANVAS);\n }\n getClientRect(config) {\n throw new Error('abstract \"getClientRect\" method call');\n }\n _transformedRect(rect, top) {\n var points = [\n { x: rect.x, y: rect.y },\n { x: rect.x + rect.width, y: rect.y },\n { x: rect.x + rect.width, y: rect.y + rect.height },\n { x: rect.x, y: rect.y + rect.height },\n ];\n var minX = Infinity, minY = Infinity, maxX = -Infinity, maxY = -Infinity;\n var trans = this.getAbsoluteTransform(top);\n points.forEach(function (point) {\n var transformed = trans.point(point);\n if (minX === undefined) {\n minX = maxX = transformed.x;\n minY = maxY = transformed.y;\n }\n minX = Math.min(minX, transformed.x);\n minY = Math.min(minY, transformed.y);\n maxX = Math.max(maxX, transformed.x);\n maxY = Math.max(maxY, transformed.y);\n });\n return {\n x: minX,\n y: minY,\n width: maxX - minX,\n height: maxY - minY,\n };\n }\n _drawCachedSceneCanvas(context) {\n context.save();\n context._applyOpacity(this);\n context._applyGlobalCompositeOperation(this);\n const canvasCache = this._getCanvasCache();\n context.translate(canvasCache.x, canvasCache.y);\n var cacheCanvas = this._getCachedSceneCanvas();\n var ratio = cacheCanvas.pixelRatio;\n context.drawImage(cacheCanvas._canvas, 0, 0, cacheCanvas.width / ratio, cacheCanvas.height / ratio);\n context.restore();\n }\n _drawCachedHitCanvas(context) {\n var canvasCache = this._getCanvasCache(), hitCanvas = canvasCache.hit;\n context.save();\n context.translate(canvasCache.x, canvasCache.y);\n context.drawImage(hitCanvas._canvas, 0, 0, hitCanvas.width / hitCanvas.pixelRatio, hitCanvas.height / hitCanvas.pixelRatio);\n context.restore();\n }\n _getCachedSceneCanvas() {\n var filters = this.filters(), cachedCanvas = this._getCanvasCache(), sceneCanvas = cachedCanvas.scene, filterCanvas = cachedCanvas.filter, filterContext = filterCanvas.getContext(), len, imageData, n, filter;\n if (filters) {\n if (!this._filterUpToDate) {\n var ratio = sceneCanvas.pixelRatio;\n filterCanvas.setSize(sceneCanvas.width / sceneCanvas.pixelRatio, sceneCanvas.height / sceneCanvas.pixelRatio);\n try {\n len = filters.length;\n filterContext.clear();\n filterContext.drawImage(sceneCanvas._canvas, 0, 0, sceneCanvas.getWidth() / ratio, sceneCanvas.getHeight() / ratio);\n imageData = filterContext.getImageData(0, 0, filterCanvas.getWidth(), filterCanvas.getHeight());\n for (n = 0; n < len; n++) {\n filter = filters[n];\n if (typeof filter !== 'function') {\n Util_1.Util.error('Filter should be type of function, but got ' +\n typeof filter +\n ' instead. Please check correct filters');\n continue;\n }\n filter.call(this, imageData);\n filterContext.putImageData(imageData, 0, 0);\n }\n }\n catch (e) {\n Util_1.Util.error('Unable to apply filter. ' +\n e.message +\n ' This post my help you https://konvajs.org/docs/posts/Tainted_Canvas.html.');\n }\n this._filterUpToDate = true;\n }\n return filterCanvas;\n }\n return sceneCanvas;\n }\n on(evtStr, handler) {\n this._cache && this._cache.delete(ALL_LISTENERS);\n if (arguments.length === 3) {\n return this._delegate.apply(this, arguments);\n }\n var events = evtStr.split(SPACE), len = events.length, n, event, parts, baseEvent, name;\n for (n = 0; n < len; n++) {\n event = events[n];\n parts = event.split('.');\n baseEvent = parts[0];\n name = parts[1] || '';\n if (!this.eventListeners[baseEvent]) {\n this.eventListeners[baseEvent] = [];\n }\n this.eventListeners[baseEvent].push({\n name: name,\n handler: handler,\n });\n }\n return this;\n }\n off(evtStr, callback) {\n var events = (evtStr || '').split(SPACE), len = events.length, n, t, event, parts, baseEvent, name;\n this._cache && this._cache.delete(ALL_LISTENERS);\n if (!evtStr) {\n for (t in this.eventListeners) {\n this._off(t);\n }\n }\n for (n = 0; n < len; n++) {\n event = events[n];\n parts = event.split('.');\n baseEvent = parts[0];\n name = parts[1];\n if (baseEvent) {\n if (this.eventListeners[baseEvent]) {\n this._off(baseEvent, name, callback);\n }\n }\n else {\n for (t in this.eventListeners) {\n this._off(t, name, callback);\n }\n }\n }\n return this;\n }\n dispatchEvent(evt) {\n var e = {\n target: this,\n type: evt.type,\n evt: evt,\n };\n this.fire(evt.type, e);\n return this;\n }\n addEventListener(type, handler) {\n this.on(type, function (evt) {\n handler.call(this, evt.evt);\n });\n return this;\n }\n removeEventListener(type) {\n this.off(type);\n return this;\n }\n _delegate(event, selector, handler) {\n var stopNode = this;\n this.on(event, function (evt) {\n var targets = evt.target.findAncestors(selector, true, stopNode);\n for (var i = 0; i < targets.length; i++) {\n evt = Util_1.Util.cloneObject(evt);\n evt.currentTarget = targets[i];\n handler.call(targets[i], evt);\n }\n });\n }\n remove() {\n if (this.isDragging()) {\n this.stopDrag();\n }\n DragAndDrop_1.DD._dragElements.delete(this._id);\n this._remove();\n return this;\n }\n _clearCaches() {\n this._clearSelfAndDescendantCache(ABSOLUTE_TRANSFORM);\n this._clearSelfAndDescendantCache(ABSOLUTE_OPACITY);\n this._clearSelfAndDescendantCache(ABSOLUTE_SCALE);\n this._clearSelfAndDescendantCache(STAGE);\n this._clearSelfAndDescendantCache(VISIBLE);\n this._clearSelfAndDescendantCache(LISTENING);\n }\n _remove() {\n this._clearCaches();\n var parent = this.getParent();\n if (parent && parent.children) {\n parent.children.splice(this.index, 1);\n parent._setChildrenIndices();\n this.parent = null;\n }\n }\n destroy() {\n this.remove();\n this.clearCache();\n return this;\n }\n getAttr(attr) {\n var method = 'get' + Util_1.Util._capitalize(attr);\n if (Util_1.Util._isFunction(this[method])) {\n return this[method]();\n }\n return this.attrs[attr];\n }\n getAncestors() {\n var parent = this.getParent(), ancestors = [];\n while (parent) {\n ancestors.push(parent);\n parent = parent.getParent();\n }\n return ancestors;\n }\n getAttrs() {\n return (this.attrs || {});\n }\n setAttrs(config) {\n this._batchTransformChanges(() => {\n var key, method;\n if (!config) {\n return this;\n }\n for (key in config) {\n if (key === CHILDREN) {\n continue;\n }\n method = SET + Util_1.Util._capitalize(key);\n if (Util_1.Util._isFunction(this[method])) {\n this[method](config[key]);\n }\n else {\n this._setAttr(key, config[key]);\n }\n }\n });\n return this;\n }\n isListening() {\n return this._getCache(LISTENING, this._isListening);\n }\n _isListening(relativeTo) {\n const listening = this.listening();\n if (!listening) {\n return false;\n }\n const parent = this.getParent();\n if (parent && parent !== relativeTo && this !== relativeTo) {\n return parent._isListening(relativeTo);\n }\n else {\n return true;\n }\n }\n isVisible() {\n return this._getCache(VISIBLE, this._isVisible);\n }\n _isVisible(relativeTo) {\n const visible = this.visible();\n if (!visible) {\n return false;\n }\n const parent = this.getParent();\n if (parent && parent !== relativeTo && this !== relativeTo) {\n return parent._isVisible(relativeTo);\n }\n else {\n return true;\n }\n }\n shouldDrawHit(top, skipDragCheck = false) {\n if (top) {\n return this._isVisible(top) && this._isListening(top);\n }\n var layer = this.getLayer();\n var layerUnderDrag = false;\n DragAndDrop_1.DD._dragElements.forEach((elem) => {\n if (elem.dragStatus !== 'dragging') {\n return;\n }\n else if (elem.node.nodeType === 'Stage') {\n layerUnderDrag = true;\n }\n else if (elem.node.getLayer() === layer) {\n layerUnderDrag = true;\n }\n });\n var dragSkip = !skipDragCheck &&\n !Global_1.Konva.hitOnDragEnabled &&\n (layerUnderDrag || Global_1.Konva.isTransforming());\n return this.isListening() && this.isVisible() && !dragSkip;\n }\n show() {\n this.visible(true);\n return this;\n }\n hide() {\n this.visible(false);\n return this;\n }\n getZIndex() {\n return this.index || 0;\n }\n getAbsoluteZIndex() {\n var depth = this.getDepth(), that = this, index = 0, nodes, len, n, child;\n function addChildren(children) {\n nodes = [];\n len = children.length;\n for (n = 0; n < len; n++) {\n child = children[n];\n index++;\n if (child.nodeType !== SHAPE) {\n nodes = nodes.concat(child.getChildren().slice());\n }\n if (child._id === that._id) {\n n = len;\n }\n }\n if (nodes.length > 0 && nodes[0].getDepth() <= depth) {\n addChildren(nodes);\n }\n }\n const stage = this.getStage();\n if (that.nodeType !== UPPER_STAGE && stage) {\n addChildren(stage.getChildren());\n }\n return index;\n }\n getDepth() {\n var depth = 0, parent = this.parent;\n while (parent) {\n depth++;\n parent = parent.parent;\n }\n return depth;\n }\n _batchTransformChanges(func) {\n this._batchingTransformChange = true;\n func();\n this._batchingTransformChange = false;\n if (this._needClearTransformCache) {\n this._clearCache(TRANSFORM);\n this._clearSelfAndDescendantCache(ABSOLUTE_TRANSFORM);\n }\n this._needClearTransformCache = false;\n }\n setPosition(pos) {\n this._batchTransformChanges(() => {\n this.x(pos.x);\n this.y(pos.y);\n });\n return this;\n }\n getPosition() {\n return {\n x: this.x(),\n y: this.y(),\n };\n }\n getRelativePointerPosition() {\n const stage = this.getStage();\n if (!stage) {\n return null;\n }\n var pos = stage.getPointerPosition();\n if (!pos) {\n return null;\n }\n var transform = this.getAbsoluteTransform().copy();\n transform.invert();\n return transform.point(pos);\n }\n getAbsolutePosition(top) {\n let haveCachedParent = false;\n let parent = this.parent;\n while (parent) {\n if (parent.isCached()) {\n haveCachedParent = true;\n break;\n }\n parent = parent.parent;\n }\n if (haveCachedParent && !top) {\n top = true;\n }\n var absoluteMatrix = this.getAbsoluteTransform(top).getMatrix(), absoluteTransform = new Util_1.Transform(), offset = this.offset();\n absoluteTransform.m = absoluteMatrix.slice();\n absoluteTransform.translate(offset.x, offset.y);\n return absoluteTransform.getTranslation();\n }\n setAbsolutePosition(pos) {\n const { x, y, ...origTrans } = this._clearTransform();\n this.attrs.x = x;\n this.attrs.y = y;\n this._clearCache(TRANSFORM);\n var it = this._getAbsoluteTransform().copy();\n it.invert();\n it.translate(pos.x, pos.y);\n pos = {\n x: this.attrs.x + it.getTranslation().x,\n y: this.attrs.y + it.getTranslation().y,\n };\n this._setTransform(origTrans);\n this.setPosition({ x: pos.x, y: pos.y });\n this._clearCache(TRANSFORM);\n this._clearSelfAndDescendantCache(ABSOLUTE_TRANSFORM);\n return this;\n }\n _setTransform(trans) {\n var key;\n for (key in trans) {\n this.attrs[key] = trans[key];\n }\n }\n _clearTransform() {\n var trans = {\n x: this.x(),\n y: this.y(),\n rotation: this.rotation(),\n scaleX: this.scaleX(),\n scaleY: this.scaleY(),\n offsetX: this.offsetX(),\n offsetY: this.offsetY(),\n skewX: this.skewX(),\n skewY: this.skewY(),\n };\n this.attrs.x = 0;\n this.attrs.y = 0;\n this.attrs.rotation = 0;\n this.attrs.scaleX = 1;\n this.attrs.scaleY = 1;\n this.attrs.offsetX = 0;\n this.attrs.offsetY = 0;\n this.attrs.skewX = 0;\n this.attrs.skewY = 0;\n return trans;\n }\n move(change) {\n var changeX = change.x, changeY = change.y, x = this.x(), y = this.y();\n if (changeX !== undefined) {\n x += changeX;\n }\n if (changeY !== undefined) {\n y += changeY;\n }\n this.setPosition({ x: x, y: y });\n return this;\n }\n _eachAncestorReverse(func, top) {\n var family = [], parent = this.getParent(), len, n;\n if (top && top._id === this._id) {\n return;\n }\n family.unshift(this);\n while (parent && (!top || parent._id !== top._id)) {\n family.unshift(parent);\n parent = parent.parent;\n }\n len = family.length;\n for (n = 0; n < len; n++) {\n func(family[n]);\n }\n }\n rotate(theta) {\n this.rotation(this.rotation() + theta);\n return this;\n }\n moveToTop() {\n if (!this.parent) {\n Util_1.Util.warn('Node has no parent. moveToTop function is ignored.');\n return false;\n }\n var index = this.index, len = this.parent.getChildren().length;\n if (index < len - 1) {\n this.parent.children.splice(index, 1);\n this.parent.children.push(this);\n this.parent._setChildrenIndices();\n return true;\n }\n return false;\n }\n moveUp() {\n if (!this.parent) {\n Util_1.Util.warn('Node has no parent. moveUp function is ignored.');\n return false;\n }\n var index = this.index, len = this.parent.getChildren().length;\n if (index < len - 1) {\n this.parent.children.splice(index, 1);\n this.parent.children.splice(index + 1, 0, this);\n this.parent._setChildrenIndices();\n return true;\n }\n return false;\n }\n moveDown() {\n if (!this.parent) {\n Util_1.Util.warn('Node has no parent. moveDown function is ignored.');\n return false;\n }\n var index = this.index;\n if (index > 0) {\n this.parent.children.splice(index, 1);\n this.parent.children.splice(index - 1, 0, this);\n this.parent._setChildrenIndices();\n return true;\n }\n return false;\n }\n moveToBottom() {\n if (!this.parent) {\n Util_1.Util.warn('Node has no parent. moveToBottom function is ignored.');\n return false;\n }\n var index = this.index;\n if (index > 0) {\n this.parent.children.splice(index, 1);\n this.parent.children.unshift(this);\n this.parent._setChildrenIndices();\n return true;\n }\n return false;\n }\n setZIndex(zIndex) {\n if (!this.parent) {\n Util_1.Util.warn('Node has no parent. zIndex parameter is ignored.');\n return this;\n }\n if (zIndex < 0 || zIndex >= this.parent.children.length) {\n Util_1.Util.warn('Unexpected value ' +\n zIndex +\n ' for zIndex property. zIndex is just index of a node in children of its parent. Expected value is from 0 to ' +\n (this.parent.children.length - 1) +\n '.');\n }\n var index = this.index;\n this.parent.children.splice(index, 1);\n this.parent.children.splice(zIndex, 0, this);\n this.parent._setChildrenIndices();\n return this;\n }\n getAbsoluteOpacity() {\n return this._getCache(ABSOLUTE_OPACITY, this._getAbsoluteOpacity);\n }\n _getAbsoluteOpacity() {\n var absOpacity = this.opacity();\n var parent = this.getParent();\n if (parent && !parent._isUnderCache) {\n absOpacity *= parent.getAbsoluteOpacity();\n }\n return absOpacity;\n }\n moveTo(newContainer) {\n if (this.getParent() !== newContainer) {\n this._remove();\n newContainer.add(this);\n }\n return this;\n }\n toObject() {\n var attrs = this.getAttrs(), key, val, getter, defaultValue, nonPlainObject;\n const obj = {\n attrs: {},\n className: this.getClassName(),\n };\n for (key in attrs) {\n val = attrs[key];\n nonPlainObject =\n Util_1.Util.isObject(val) && !Util_1.Util._isPlainObject(val) && !Util_1.Util._isArray(val);\n if (nonPlainObject) {\n continue;\n }\n getter = typeof this[key] === 'function' && this[key];\n delete attrs[key];\n defaultValue = getter ? getter.call(this) : null;\n attrs[key] = val;\n if (defaultValue !== val) {\n obj.attrs[key] = val;\n }\n }\n return Util_1.Util._prepareToStringify(obj);\n }\n toJSON() {\n return JSON.stringify(this.toObject());\n }\n getParent() {\n return this.parent;\n }\n findAncestors(selector, includeSelf, stopNode) {\n var res = [];\n if (includeSelf && this._isMatch(selector)) {\n res.push(this);\n }\n var ancestor = this.parent;\n while (ancestor) {\n if (ancestor === stopNode) {\n return res;\n }\n if (ancestor._isMatch(selector)) {\n res.push(ancestor);\n }\n ancestor = ancestor.parent;\n }\n return res;\n }\n isAncestorOf(node) {\n return false;\n }\n findAncestor(selector, includeSelf, stopNode) {\n return this.findAncestors(selector, includeSelf, stopNode)[0];\n }\n _isMatch(selector) {\n if (!selector) {\n return false;\n }\n if (typeof selector === 'function') {\n return selector(this);\n }\n var selectorArr = selector.replace(/ /g, '').split(','), len = selectorArr.length, n, sel;\n for (n = 0; n < len; n++) {\n sel = selectorArr[n];\n if (!Util_1.Util.isValidSelector(sel)) {\n Util_1.Util.warn('Selector \"' +\n sel +\n '\" is invalid. Allowed selectors examples are \"#foo\", \".bar\" or \"Group\".');\n Util_1.Util.warn('If you have a custom shape with such className, please change it to start with upper letter like \"Triangle\".');\n Util_1.Util.warn('Konva is awesome, right?');\n }\n if (sel.charAt(0) === '#') {\n if (this.id() === sel.slice(1)) {\n return true;\n }\n }\n else if (sel.charAt(0) === '.') {\n if (this.hasName(sel.slice(1))) {\n return true;\n }\n }\n else if (this.className === sel || this.nodeType === sel) {\n return true;\n }\n }\n return false;\n }\n getLayer() {\n var parent = this.getParent();\n return parent ? parent.getLayer() : null;\n }\n getStage() {\n return this._getCache(STAGE, this._getStage);\n }\n _getStage() {\n var parent = this.getParent();\n if (parent) {\n return parent.getStage();\n }\n else {\n return null;\n }\n }\n fire(eventType, evt = {}, bubble) {\n evt.target = evt.target || this;\n if (bubble) {\n this._fireAndBubble(eventType, evt);\n }\n else {\n this._fire(eventType, evt);\n }\n return this;\n }\n getAbsoluteTransform(top) {\n if (top) {\n return this._getAbsoluteTransform(top);\n }\n else {\n return this._getCache(ABSOLUTE_TRANSFORM, this._getAbsoluteTransform);\n }\n }\n _getAbsoluteTransform(top) {\n var at;\n if (top) {\n at = new Util_1.Transform();\n this._eachAncestorReverse(function (node) {\n var transformsEnabled = node.transformsEnabled();\n if (transformsEnabled === 'all') {\n at.multiply(node.getTransform());\n }\n else if (transformsEnabled === 'position') {\n at.translate(node.x() - node.offsetX(), node.y() - node.offsetY());\n }\n }, top);\n return at;\n }\n else {\n at = this._cache.get(ABSOLUTE_TRANSFORM) || new Util_1.Transform();\n if (this.parent) {\n this.parent.getAbsoluteTransform().copyInto(at);\n }\n else {\n at.reset();\n }\n var transformsEnabled = this.transformsEnabled();\n if (transformsEnabled === 'all') {\n at.multiply(this.getTransform());\n }\n else if (transformsEnabled === 'position') {\n const x = this.attrs.x || 0;\n const y = this.attrs.y || 0;\n const offsetX = this.attrs.offsetX || 0;\n const offsetY = this.attrs.offsetY || 0;\n at.translate(x - offsetX, y - offsetY);\n }\n at.dirty = false;\n return at;\n }\n }\n getAbsoluteScale(top) {\n var parent = this;\n while (parent) {\n if (parent._isUnderCache) {\n top = parent;\n }\n parent = parent.getParent();\n }\n const transform = this.getAbsoluteTransform(top);\n const attrs = transform.decompose();\n return {\n x: attrs.scaleX,\n y: attrs.scaleY,\n };\n }\n getAbsoluteRotation() {\n return this.getAbsoluteTransform().decompose().rotation;\n }\n getTransform() {\n return this._getCache(TRANSFORM, this._getTransform);\n }\n _getTransform() {\n var _a, _b;\n var m = this._cache.get(TRANSFORM) || new Util_1.Transform();\n m.reset();\n var x = this.x(), y = this.y(), rotation = Global_1.Konva.getAngle(this.rotation()), scaleX = (_a = this.attrs.scaleX) !== null && _a !== void 0 ? _a : 1, scaleY = (_b = this.attrs.scaleY) !== null && _b !== void 0 ? _b : 1, skewX = this.attrs.skewX || 0, skewY = this.attrs.skewY || 0, offsetX = this.attrs.offsetX || 0, offsetY = this.attrs.offsetY || 0;\n if (x !== 0 || y !== 0) {\n m.translate(x, y);\n }\n if (rotation !== 0) {\n m.rotate(rotation);\n }\n if (skewX !== 0 || skewY !== 0) {\n m.skew(skewX, skewY);\n }\n if (scaleX !== 1 || scaleY !== 1) {\n m.scale(scaleX, scaleY);\n }\n if (offsetX !== 0 || offsetY !== 0) {\n m.translate(-1 * offsetX, -1 * offsetY);\n }\n m.dirty = false;\n return m;\n }\n clone(obj) {\n var attrs = Util_1.Util.cloneObject(this.attrs), key, allListeners, len, n, listener;\n for (key in obj) {\n attrs[key] = obj[key];\n }\n var node = new this.constructor(attrs);\n for (key in this.eventListeners) {\n allListeners = this.eventListeners[key];\n len = allListeners.length;\n for (n = 0; n < len; n++) {\n listener = allListeners[n];\n if (listener.name.indexOf(KONVA) < 0) {\n if (!node.eventListeners[key]) {\n node.eventListeners[key] = [];\n }\n node.eventListeners[key].push(listener);\n }\n }\n }\n return node;\n }\n _toKonvaCanvas(config) {\n config = config || {};\n var box = this.getClientRect();\n var stage = this.getStage(), x = config.x !== undefined ? config.x : Math.floor(box.x), y = config.y !== undefined ? config.y : Math.floor(box.y), pixelRatio = config.pixelRatio || 1, canvas = new Canvas_1.SceneCanvas({\n width: config.width || Math.ceil(box.width) || (stage ? stage.width() : 0),\n height: config.height ||\n Math.ceil(box.height) ||\n (stage ? stage.height() : 0),\n pixelRatio: pixelRatio,\n }), context = canvas.getContext();\n const bufferCanvas = new Canvas_1.SceneCanvas({\n width: canvas.width / canvas.pixelRatio + Math.abs(x),\n height: canvas.height / canvas.pixelRatio + Math.abs(y),\n pixelRatio: canvas.pixelRatio,\n });\n if (config.imageSmoothingEnabled === false) {\n context._context.imageSmoothingEnabled = false;\n }\n context.save();\n if (x || y) {\n context.translate(-1 * x, -1 * y);\n }\n this.drawScene(canvas, undefined, bufferCanvas);\n context.restore();\n return canvas;\n }\n toCanvas(config) {\n return this._toKonvaCanvas(config)._canvas;\n }\n toDataURL(config) {\n config = config || {};\n var mimeType = config.mimeType || null, quality = config.quality || null;\n var url = this._toKonvaCanvas(config).toDataURL(mimeType, quality);\n if (config.callback) {\n config.callback(url);\n }\n return url;\n }\n toImage(config) {\n return new Promise((resolve, reject) => {\n try {\n const callback = config === null || config === void 0 ? void 0 : config.callback;\n if (callback)\n delete config.callback;\n Util_1.Util._urlToImage(this.toDataURL(config), function (img) {\n resolve(img);\n callback === null || callback === void 0 ? void 0 : callback(img);\n });\n }\n catch (err) {\n reject(err);\n }\n });\n }\n toBlob(config) {\n return new Promise((resolve, reject) => {\n try {\n const callback = config === null || config === void 0 ? void 0 : config.callback;\n if (callback)\n delete config.callback;\n this.toCanvas(config).toBlob((blob) => {\n resolve(blob);\n callback === null || callback === void 0 ? void 0 : callback(blob);\n }, config === null || config === void 0 ? void 0 : config.mimeType, config === null || config === void 0 ? void 0 : config.quality);\n }\n catch (err) {\n reject(err);\n }\n });\n }\n setSize(size) {\n this.width(size.width);\n this.height(size.height);\n return this;\n }\n getSize() {\n return {\n width: this.width(),\n height: this.height(),\n };\n }\n getClassName() {\n return this.className || this.nodeType;\n }\n getType() {\n return this.nodeType;\n }\n getDragDistance() {\n if (this.attrs.dragDistance !== undefined) {\n return this.attrs.dragDistance;\n }\n else if (this.parent) {\n return this.parent.getDragDistance();\n }\n else {\n return Global_1.Konva.dragDistance;\n }\n }\n _off(type, name, callback) {\n var evtListeners = this.eventListeners[type], i, evtName, handler;\n for (i = 0; i < evtListeners.length; i++) {\n evtName = evtListeners[i].name;\n handler = evtListeners[i].handler;\n if ((evtName !== 'konva' || name === 'konva') &&\n (!name || evtName === name) &&\n (!callback || callback === handler)) {\n evtListeners.splice(i, 1);\n if (evtListeners.length === 0) {\n delete this.eventListeners[type];\n break;\n }\n i--;\n }\n }\n }\n _fireChangeEvent(attr, oldVal, newVal) {\n this._fire(attr + CHANGE, {\n oldVal: oldVal,\n newVal: newVal,\n });\n }\n addName(name) {\n if (!this.hasName(name)) {\n var oldName = this.name();\n var newName = oldName ? oldName + ' ' + name : name;\n this.name(newName);\n }\n return this;\n }\n hasName(name) {\n if (!name) {\n return false;\n }\n const fullName = this.name();\n if (!fullName) {\n return false;\n }\n var names = (fullName || '').split(/\\s/g);\n return names.indexOf(name) !== -1;\n }\n removeName(name) {\n var names = (this.name() || '').split(/\\s/g);\n var index = names.indexOf(name);\n if (index !== -1) {\n names.splice(index, 1);\n this.name(names.join(' '));\n }\n return this;\n }\n setAttr(attr, val) {\n var func = this[SET + Util_1.Util._capitalize(attr)];\n if (Util_1.Util._isFunction(func)) {\n func.call(this, val);\n }\n else {\n this._setAttr(attr, val);\n }\n return this;\n }\n _requestDraw() {\n if (Global_1.Konva.autoDrawEnabled) {\n const drawNode = this.getLayer() || this.getStage();\n drawNode === null || drawNode === void 0 ? void 0 : drawNode.batchDraw();\n }\n }\n _setAttr(key, val) {\n var oldVal = this.attrs[key];\n if (oldVal === val && !Util_1.Util.isObject(val)) {\n return;\n }\n if (val === undefined || val === null) {\n delete this.attrs[key];\n }\n else {\n this.attrs[key] = val;\n }\n if (this._shouldFireChangeEvents) {\n this._fireChangeEvent(key, oldVal, val);\n }\n this._requestDraw();\n }\n _setComponentAttr(key, component, val) {\n var oldVal;\n if (val !== undefined) {\n oldVal = this.attrs[key];\n if (!oldVal) {\n this.attrs[key] = this.getAttr(key);\n }\n this.attrs[key][component] = val;\n this._fireChangeEvent(key, oldVal, val);\n }\n }\n _fireAndBubble(eventType, evt, compareShape) {\n if (evt && this.nodeType === SHAPE) {\n evt.target = this;\n }\n var shouldStop = (eventType === MOUSEENTER || eventType === MOUSELEAVE) &&\n ((compareShape &&\n (this === compareShape ||\n (this.isAncestorOf && this.isAncestorOf(compareShape)))) ||\n (this.nodeType === 'Stage' && !compareShape));\n if (!shouldStop) {\n this._fire(eventType, evt);\n var stopBubble = (eventType === MOUSEENTER || eventType === MOUSELEAVE) &&\n compareShape &&\n compareShape.isAncestorOf &&\n compareShape.isAncestorOf(this) &&\n !compareShape.isAncestorOf(this.parent);\n if (((evt && !evt.cancelBubble) || !evt) &&\n this.parent &&\n this.parent.isListening() &&\n !stopBubble) {\n if (compareShape && compareShape.parent) {\n this._fireAndBubble.call(this.parent, eventType, evt, compareShape);\n }\n else {\n this._fireAndBubble.call(this.parent, eventType, evt);\n }\n }\n }\n }\n _getProtoListeners(eventType) {\n var _a, _b, _c;\n const allListeners = (_a = this._cache.get(ALL_LISTENERS)) !== null && _a !== void 0 ? _a : {};\n let events = allListeners === null || allListeners === void 0 ? void 0 : allListeners[eventType];\n if (events === undefined) {\n events = [];\n let obj = Object.getPrototypeOf(this);\n while (obj) {\n const hierarchyEvents = (_c = (_b = obj.eventListeners) === null || _b === void 0 ? void 0 : _b[eventType]) !== null && _c !== void 0 ? _c : [];\n events.push(...hierarchyEvents);\n obj = Object.getPrototypeOf(obj);\n }\n allListeners[eventType] = events;\n this._cache.set(ALL_LISTENERS, allListeners);\n }\n return events;\n }\n _fire(eventType, evt) {\n evt = evt || {};\n evt.currentTarget = this;\n evt.type = eventType;\n const topListeners = this._getProtoListeners(eventType);\n if (topListeners) {\n for (var i = 0; i < topListeners.length; i++) {\n topListeners[i].handler.call(this, evt);\n }\n }\n const selfListeners = this.eventListeners[eventType];\n if (selfListeners) {\n for (var i = 0; i < selfListeners.length; i++) {\n selfListeners[i].handler.call(this, evt);\n }\n }\n }\n draw() {\n this.drawScene();\n this.drawHit();\n return this;\n }\n _createDragElement(evt) {\n var pointerId = evt ? evt.pointerId : undefined;\n var stage = this.getStage();\n var ap = this.getAbsolutePosition();\n if (!stage) {\n return;\n }\n var pos = stage._getPointerById(pointerId) ||\n stage._changedPointerPositions[0] ||\n ap;\n DragAndDrop_1.DD._dragElements.set(this._id, {\n node: this,\n startPointerPos: pos,\n offset: {\n x: pos.x - ap.x,\n y: pos.y - ap.y,\n },\n dragStatus: 'ready',\n pointerId,\n });\n }\n startDrag(evt, bubbleEvent = true) {\n if (!DragAndDrop_1.DD._dragElements.has(this._id)) {\n this._createDragElement(evt);\n }\n const elem = DragAndDrop_1.DD._dragElements.get(this._id);\n elem.dragStatus = 'dragging';\n this.fire('dragstart', {\n type: 'dragstart',\n target: this,\n evt: evt && evt.evt,\n }, bubbleEvent);\n }\n _setDragPosition(evt, elem) {\n const pos = this.getStage()._getPointerById(elem.pointerId);\n if (!pos) {\n return;\n }\n var newNodePos = {\n x: pos.x - elem.offset.x,\n y: pos.y - elem.offset.y,\n };\n var dbf = this.dragBoundFunc();\n if (dbf !== undefined) {\n const bounded = dbf.call(this, newNodePos, evt);\n if (!bounded) {\n Util_1.Util.warn('dragBoundFunc did not return any value. That is unexpected behavior. You must return new absolute position from dragBoundFunc.');\n }\n else {\n newNodePos = bounded;\n }\n }\n if (!this._lastPos ||\n this._lastPos.x !== newNodePos.x ||\n this._lastPos.y !== newNodePos.y) {\n this.setAbsolutePosition(newNodePos);\n this._requestDraw();\n }\n this._lastPos = newNodePos;\n }\n stopDrag(evt) {\n const elem = DragAndDrop_1.DD._dragElements.get(this._id);\n if (elem) {\n elem.dragStatus = 'stopped';\n }\n DragAndDrop_1.DD._endDragBefore(evt);\n DragAndDrop_1.DD._endDragAfter(evt);\n }\n setDraggable(draggable) {\n this._setAttr('draggable', draggable);\n this._dragChange();\n }\n isDragging() {\n const elem = DragAndDrop_1.DD._dragElements.get(this._id);\n return elem ? elem.dragStatus === 'dragging' : false;\n }\n _listenDrag() {\n this._dragCleanup();\n this.on('mousedown.konva touchstart.konva', function (evt) {\n var shouldCheckButton = evt.evt['button'] !== undefined;\n var canDrag = !shouldCheckButton || Global_1.Konva.dragButtons.indexOf(evt.evt['button']) >= 0;\n if (!canDrag) {\n return;\n }\n if (this.isDragging()) {\n return;\n }\n var hasDraggingChild = false;\n DragAndDrop_1.DD._dragElements.forEach((elem) => {\n if (this.isAncestorOf(elem.node)) {\n hasDraggingChild = true;\n }\n });\n if (!hasDraggingChild) {\n this._createDragElement(evt);\n }\n });\n }\n _dragChange() {\n if (this.attrs.draggable) {\n this._listenDrag();\n }\n else {\n this._dragCleanup();\n var stage = this.getStage();\n if (!stage) {\n return;\n }\n const dragElement = DragAndDrop_1.DD._dragElements.get(this._id);\n const isDragging = dragElement && dragElement.dragStatus === 'dragging';\n const isReady = dragElement && dragElement.dragStatus === 'ready';\n if (isDragging) {\n this.stopDrag();\n }\n else if (isReady) {\n DragAndDrop_1.DD._dragElements.delete(this._id);\n }\n }\n }\n _dragCleanup() {\n this.off('mousedown.konva');\n this.off('touchstart.konva');\n }\n isClientRectOnScreen(margin = { x: 0, y: 0 }) {\n const stage = this.getStage();\n if (!stage) {\n return false;\n }\n const screenRect = {\n x: -margin.x,\n y: -margin.y,\n width: stage.width() + 2 * margin.x,\n height: stage.height() + 2 * margin.y,\n };\n return Util_1.Util.haveIntersection(screenRect, this.getClientRect());\n }\n static create(data, container) {\n if (Util_1.Util._isString(data)) {\n data = JSON.parse(data);\n }\n return this._createNode(data, container);\n }\n static _createNode(obj, container) {\n var className = Node.prototype.getClassName.call(obj), children = obj.children, no, len, n;\n if (container) {\n obj.attrs.container = container;\n }\n if (!Global_1.Konva[className]) {\n Util_1.Util.warn('Can not find a node with class name \"' +\n className +\n '\". Fallback to \"Shape\".');\n className = 'Shape';\n }\n const Class = Global_1.Konva[className];\n no = new Class(obj.attrs);\n if (children) {\n len = children.length;\n for (n = 0; n < len; n++) {\n no.add(Node._createNode(children[n]));\n }\n }\n return no;\n }\n}\nexports.Node = Node;\nNode.prototype.nodeType = 'Node';\nNode.prototype._attrsAffectingSize = [];\nNode.prototype.eventListeners = {};\nNode.prototype.on.call(Node.prototype, TRANSFORM_CHANGE_STR, function () {\n if (this._batchingTransformChange) {\n this._needClearTransformCache = true;\n return;\n }\n this._clearCache(TRANSFORM);\n this._clearSelfAndDescendantCache(ABSOLUTE_TRANSFORM);\n});\nNode.prototype.on.call(Node.prototype, 'visibleChange.konva', function () {\n this._clearSelfAndDescendantCache(VISIBLE);\n});\nNode.prototype.on.call(Node.prototype, 'listeningChange.konva', function () {\n this._clearSelfAndDescendantCache(LISTENING);\n});\nNode.prototype.on.call(Node.prototype, 'opacityChange.konva', function () {\n this._clearSelfAndDescendantCache(ABSOLUTE_OPACITY);\n});\nconst addGetterSetter = Factory_1.Factory.addGetterSetter;\naddGetterSetter(Node, 'zIndex');\naddGetterSetter(Node, 'absolutePosition');\naddGetterSetter(Node, 'position');\naddGetterSetter(Node, 'x', 0, (0, Validators_1.getNumberValidator)());\naddGetterSetter(Node, 'y', 0, (0, Validators_1.getNumberValidator)());\naddGetterSetter(Node, 'globalCompositeOperation', 'source-over', (0, Validators_1.getStringValidator)());\naddGetterSetter(Node, 'opacity', 1, (0, Validators_1.getNumberValidator)());\naddGetterSetter(Node, 'name', '', (0, Validators_1.getStringValidator)());\naddGetterSetter(Node, 'id', '', (0, Validators_1.getStringValidator)());\naddGetterSetter(Node, 'rotation', 0, (0, Validators_1.getNumberValidator)());\nFactory_1.Factory.addComponentsGetterSetter(Node, 'scale', ['x', 'y']);\naddGetterSetter(Node, 'scaleX', 1, (0, Validators_1.getNumberValidator)());\naddGetterSetter(Node, 'scaleY', 1, (0, Validators_1.getNumberValidator)());\nFactory_1.Factory.addComponentsGetterSetter(Node, 'skew', ['x', 'y']);\naddGetterSetter(Node, 'skewX', 0, (0, Validators_1.getNumberValidator)());\naddGetterSetter(Node, 'skewY', 0, (0, Validators_1.getNumberValidator)());\nFactory_1.Factory.addComponentsGetterSetter(Node, 'offset', ['x', 'y']);\naddGetterSetter(Node, 'offsetX', 0, (0, Validators_1.getNumberValidator)());\naddGetterSetter(Node, 'offsetY', 0, (0, Validators_1.getNumberValidator)());\naddGetterSetter(Node, 'dragDistance', null, (0, Validators_1.getNumberValidator)());\naddGetterSetter(Node, 'width', 0, (0, Validators_1.getNumberValidator)());\naddGetterSetter(Node, 'height', 0, (0, Validators_1.getNumberValidator)());\naddGetterSetter(Node, 'listening', true, (0, Validators_1.getBooleanValidator)());\naddGetterSetter(Node, 'preventDefault', true, (0, Validators_1.getBooleanValidator)());\naddGetterSetter(Node, 'filters', null, function (val) {\n this._filterUpToDate = false;\n return val;\n});\naddGetterSetter(Node, 'visible', true, (0, Validators_1.getBooleanValidator)());\naddGetterSetter(Node, 'transformsEnabled', 'all', (0, Validators_1.getStringValidator)());\naddGetterSetter(Node, 'size');\naddGetterSetter(Node, 'dragBoundFunc');\naddGetterSetter(Node, 'draggable', false, (0, Validators_1.getBooleanValidator)());\nFactory_1.Factory.backCompat(Node, {\n rotateDeg: 'rotate',\n setRotationDeg: 'setRotation',\n getRotationDeg: 'getRotation',\n});\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Container = void 0;\nconst Factory_1 = require(\"./Factory\");\nconst Node_1 = require(\"./Node\");\nconst Validators_1 = require(\"./Validators\");\nclass Container extends Node_1.Node {\n constructor() {\n super(...arguments);\n this.children = [];\n }\n getChildren(filterFunc) {\n if (!filterFunc) {\n return this.children || [];\n }\n const children = this.children || [];\n var results = [];\n children.forEach(function (child) {\n if (filterFunc(child)) {\n results.push(child);\n }\n });\n return results;\n }\n hasChildren() {\n return this.getChildren().length > 0;\n }\n removeChildren() {\n this.getChildren().forEach((child) => {\n child.parent = null;\n child.index = 0;\n child.remove();\n });\n this.children = [];\n this._requestDraw();\n return this;\n }\n destroyChildren() {\n this.getChildren().forEach((child) => {\n child.parent = null;\n child.index = 0;\n child.destroy();\n });\n this.children = [];\n this._requestDraw();\n return this;\n }\n add(...children) {\n if (children.length === 0) {\n return this;\n }\n if (children.length > 1) {\n for (var i = 0; i < children.length; i++) {\n this.add(children[i]);\n }\n return this;\n }\n const child = children[0];\n if (child.getParent()) {\n child.moveTo(this);\n return this;\n }\n this._validateAdd(child);\n child.index = this.getChildren().length;\n child.parent = this;\n child._clearCaches();\n this.getChildren().push(child);\n this._fire('add', {\n child: child,\n });\n this._requestDraw();\n return this;\n }\n destroy() {\n if (this.hasChildren()) {\n this.destroyChildren();\n }\n super.destroy();\n return this;\n }\n find(selector) {\n return this._generalFind(selector, false);\n }\n findOne(selector) {\n var result = this._generalFind(selector, true);\n return result.length > 0 ? result[0] : undefined;\n }\n _generalFind(selector, findOne) {\n var retArr = [];\n this._descendants((node) => {\n const valid = node._isMatch(selector);\n if (valid) {\n retArr.push(node);\n }\n if (valid && findOne) {\n return true;\n }\n return false;\n });\n return retArr;\n }\n _descendants(fn) {\n let shouldStop = false;\n const children = this.getChildren();\n for (const child of children) {\n shouldStop = fn(child);\n if (shouldStop) {\n return true;\n }\n if (!child.hasChildren()) {\n continue;\n }\n shouldStop = child._descendants(fn);\n if (shouldStop) {\n return true;\n }\n }\n return false;\n }\n toObject() {\n var obj = Node_1.Node.prototype.toObject.call(this);\n obj.children = [];\n this.getChildren().forEach((child) => {\n obj.children.push(child.toObject());\n });\n return obj;\n }\n isAncestorOf(node) {\n var parent = node.getParent();\n while (parent) {\n if (parent._id === this._id) {\n return true;\n }\n parent = parent.getParent();\n }\n return false;\n }\n clone(obj) {\n var node = Node_1.Node.prototype.clone.call(this, obj);\n this.getChildren().forEach(function (no) {\n node.add(no.clone());\n });\n return node;\n }\n getAllIntersections(pos) {\n var arr = [];\n this.find('Shape').forEach((shape) => {\n if (shape.isVisible() && shape.intersects(pos)) {\n arr.push(shape);\n }\n });\n return arr;\n }\n _clearSelfAndDescendantCache(attr) {\n var _a;\n super._clearSelfAndDescendantCache(attr);\n if (this.isCached()) {\n return;\n }\n (_a = this.children) === null || _a === void 0 ? void 0 : _a.forEach(function (node) {\n node._clearSelfAndDescendantCache(attr);\n });\n }\n _setChildrenIndices() {\n var _a;\n (_a = this.children) === null || _a === void 0 ? void 0 : _a.forEach(function (child, n) {\n child.index = n;\n });\n this._requestDraw();\n }\n drawScene(can, top, bufferCanvas) {\n var layer = this.getLayer(), canvas = can || (layer && layer.getCanvas()), context = canvas && canvas.getContext(), cachedCanvas = this._getCanvasCache(), cachedSceneCanvas = cachedCanvas && cachedCanvas.scene;\n var caching = canvas && canvas.isCache;\n if (!this.isVisible() && !caching) {\n return this;\n }\n if (cachedSceneCanvas) {\n context.save();\n var m = this.getAbsoluteTransform(top).getMatrix();\n context.transform(m[0], m[1], m[2], m[3], m[4], m[5]);\n this._drawCachedSceneCanvas(context);\n context.restore();\n }\n else {\n this._drawChildren('drawScene', canvas, top, bufferCanvas);\n }\n return this;\n }\n drawHit(can, top) {\n if (!this.shouldDrawHit(top)) {\n return this;\n }\n var layer = this.getLayer(), canvas = can || (layer && layer.hitCanvas), context = canvas && canvas.getContext(), cachedCanvas = this._getCanvasCache(), cachedHitCanvas = cachedCanvas && cachedCanvas.hit;\n if (cachedHitCanvas) {\n context.save();\n var m = this.getAbsoluteTransform(top).getMatrix();\n context.transform(m[0], m[1], m[2], m[3], m[4], m[5]);\n this._drawCachedHitCanvas(context);\n context.restore();\n }\n else {\n this._drawChildren('drawHit', canvas, top);\n }\n return this;\n }\n _drawChildren(drawMethod, canvas, top, bufferCanvas) {\n var _a;\n var context = canvas && canvas.getContext(), clipWidth = this.clipWidth(), clipHeight = this.clipHeight(), clipFunc = this.clipFunc(), hasClip = (typeof clipWidth === 'number' && typeof clipHeight === 'number') ||\n clipFunc;\n const selfCache = top === this;\n if (hasClip) {\n context.save();\n var transform = this.getAbsoluteTransform(top);\n var m = transform.getMatrix();\n context.transform(m[0], m[1], m[2], m[3], m[4], m[5]);\n context.beginPath();\n let clipArgs;\n if (clipFunc) {\n clipArgs = clipFunc.call(this, context, this);\n }\n else {\n var clipX = this.clipX();\n var clipY = this.clipY();\n context.rect(clipX || 0, clipY || 0, clipWidth, clipHeight);\n }\n context.clip.apply(context, clipArgs);\n m = transform.copy().invert().getMatrix();\n context.transform(m[0], m[1], m[2], m[3], m[4], m[5]);\n }\n var hasComposition = !selfCache &&\n this.globalCompositeOperation() !== 'source-over' &&\n drawMethod === 'drawScene';\n if (hasComposition) {\n context.save();\n context._applyGlobalCompositeOperation(this);\n }\n (_a = this.children) === null || _a === void 0 ? void 0 : _a.forEach(function (child) {\n child[drawMethod](canvas, top, bufferCanvas);\n });\n if (hasComposition) {\n context.restore();\n }\n if (hasClip) {\n context.restore();\n }\n }\n getClientRect(config = {}) {\n var _a;\n var skipTransform = config.skipTransform;\n var relativeTo = config.relativeTo;\n var minX, minY, maxX, maxY;\n var selfRect = {\n x: Infinity,\n y: Infinity,\n width: 0,\n height: 0,\n };\n var that = this;\n (_a = this.children) === null || _a === void 0 ? void 0 : _a.forEach(function (child) {\n if (!child.visible()) {\n return;\n }\n var rect = child.getClientRect({\n relativeTo: that,\n skipShadow: config.skipShadow,\n skipStroke: config.skipStroke,\n });\n if (rect.width === 0 && rect.height === 0) {\n return;\n }\n if (minX === undefined) {\n minX = rect.x;\n minY = rect.y;\n maxX = rect.x + rect.width;\n maxY = rect.y + rect.height;\n }\n else {\n minX = Math.min(minX, rect.x);\n minY = Math.min(minY, rect.y);\n maxX = Math.max(maxX, rect.x + rect.width);\n maxY = Math.max(maxY, rect.y + rect.height);\n }\n });\n var shapes = this.find('Shape');\n var hasVisible = false;\n for (var i = 0; i < shapes.length; i++) {\n var shape = shapes[i];\n if (shape._isVisible(this)) {\n hasVisible = true;\n break;\n }\n }\n if (hasVisible && minX !== undefined) {\n selfRect = {\n x: minX,\n y: minY,\n width: maxX - minX,\n height: maxY - minY,\n };\n }\n else {\n selfRect = {\n x: 0,\n y: 0,\n width: 0,\n height: 0,\n };\n }\n if (!skipTransform) {\n return this._transformedRect(selfRect, relativeTo);\n }\n return selfRect;\n }\n}\nexports.Container = Container;\nFactory_1.Factory.addComponentsGetterSetter(Container, 'clip', [\n 'x',\n 'y',\n 'width',\n 'height',\n]);\nFactory_1.Factory.addGetterSetter(Container, 'clipX', undefined, (0, Validators_1.getNumberValidator)());\nFactory_1.Factory.addGetterSetter(Container, 'clipY', undefined, (0, Validators_1.getNumberValidator)());\nFactory_1.Factory.addGetterSetter(Container, 'clipWidth', undefined, (0, Validators_1.getNumberValidator)());\nFactory_1.Factory.addGetterSetter(Container, 'clipHeight', undefined, (0, Validators_1.getNumberValidator)());\nFactory_1.Factory.addGetterSetter(Container, 'clipFunc');\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.releaseCapture = exports.setPointerCapture = exports.hasPointerCapture = exports.createEvent = exports.getCapturedShape = void 0;\nconst Global_1 = require(\"./Global\");\nconst Captures = new Map();\nconst SUPPORT_POINTER_EVENTS = Global_1.Konva._global['PointerEvent'] !== undefined;\nfunction getCapturedShape(pointerId) {\n return Captures.get(pointerId);\n}\nexports.getCapturedShape = getCapturedShape;\nfunction createEvent(evt) {\n return {\n evt,\n pointerId: evt.pointerId,\n };\n}\nexports.createEvent = createEvent;\nfunction hasPointerCapture(pointerId, shape) {\n return Captures.get(pointerId) === shape;\n}\nexports.hasPointerCapture = hasPointerCapture;\nfunction setPointerCapture(pointerId, shape) {\n releaseCapture(pointerId);\n const stage = shape.getStage();\n if (!stage)\n return;\n Captures.set(pointerId, shape);\n if (SUPPORT_POINTER_EVENTS) {\n shape._fire('gotpointercapture', createEvent(new PointerEvent('gotpointercapture')));\n }\n}\nexports.setPointerCapture = setPointerCapture;\nfunction releaseCapture(pointerId, target) {\n const shape = Captures.get(pointerId);\n if (!shape)\n return;\n const stage = shape.getStage();\n if (stage && stage.content) {\n }\n Captures.delete(pointerId);\n if (SUPPORT_POINTER_EVENTS) {\n shape._fire('lostpointercapture', createEvent(new PointerEvent('lostpointercapture')));\n }\n}\nexports.releaseCapture = releaseCapture;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Stage = exports.stages = void 0;\nconst Util_1 = require(\"./Util\");\nconst Factory_1 = require(\"./Factory\");\nconst Container_1 = require(\"./Container\");\nconst Global_1 = require(\"./Global\");\nconst Canvas_1 = require(\"./Canvas\");\nconst DragAndDrop_1 = require(\"./DragAndDrop\");\nconst Global_2 = require(\"./Global\");\nconst PointerEvents = require(\"./PointerEvents\");\nvar STAGE = 'Stage', STRING = 'string', PX = 'px', MOUSEOUT = 'mouseout', MOUSELEAVE = 'mouseleave', MOUSEOVER = 'mouseover', MOUSEENTER = 'mouseenter', MOUSEMOVE = 'mousemove', MOUSEDOWN = 'mousedown', MOUSEUP = 'mouseup', POINTERMOVE = 'pointermove', POINTERDOWN = 'pointerdown', POINTERUP = 'pointerup', POINTERCANCEL = 'pointercancel', LOSTPOINTERCAPTURE = 'lostpointercapture', POINTEROUT = 'pointerout', POINTERLEAVE = 'pointerleave', POINTEROVER = 'pointerover', POINTERENTER = 'pointerenter', CONTEXTMENU = 'contextmenu', TOUCHSTART = 'touchstart', TOUCHEND = 'touchend', TOUCHMOVE = 'touchmove', TOUCHCANCEL = 'touchcancel', WHEEL = 'wheel', MAX_LAYERS_NUMBER = 5, EVENTS = [\n [MOUSEENTER, '_pointerenter'],\n [MOUSEDOWN, '_pointerdown'],\n [MOUSEMOVE, '_pointermove'],\n [MOUSEUP, '_pointerup'],\n [MOUSELEAVE, '_pointerleave'],\n [TOUCHSTART, '_pointerdown'],\n [TOUCHMOVE, '_pointermove'],\n [TOUCHEND, '_pointerup'],\n [TOUCHCANCEL, '_pointercancel'],\n [MOUSEOVER, '_pointerover'],\n [WHEEL, '_wheel'],\n [CONTEXTMENU, '_contextmenu'],\n [POINTERDOWN, '_pointerdown'],\n [POINTERMOVE, '_pointermove'],\n [POINTERUP, '_pointerup'],\n [POINTERCANCEL, '_pointercancel'],\n [LOSTPOINTERCAPTURE, '_lostpointercapture'],\n];\nconst EVENTS_MAP = {\n mouse: {\n [POINTEROUT]: MOUSEOUT,\n [POINTERLEAVE]: MOUSELEAVE,\n [POINTEROVER]: MOUSEOVER,\n [POINTERENTER]: MOUSEENTER,\n [POINTERMOVE]: MOUSEMOVE,\n [POINTERDOWN]: MOUSEDOWN,\n [POINTERUP]: MOUSEUP,\n [POINTERCANCEL]: 'mousecancel',\n pointerclick: 'click',\n pointerdblclick: 'dblclick',\n },\n touch: {\n [POINTEROUT]: 'touchout',\n [POINTERLEAVE]: 'touchleave',\n [POINTEROVER]: 'touchover',\n [POINTERENTER]: 'touchenter',\n [POINTERMOVE]: TOUCHMOVE,\n [POINTERDOWN]: TOUCHSTART,\n [POINTERUP]: TOUCHEND,\n [POINTERCANCEL]: TOUCHCANCEL,\n pointerclick: 'tap',\n pointerdblclick: 'dbltap',\n },\n pointer: {\n [POINTEROUT]: POINTEROUT,\n [POINTERLEAVE]: POINTERLEAVE,\n [POINTEROVER]: POINTEROVER,\n [POINTERENTER]: POINTERENTER,\n [POINTERMOVE]: POINTERMOVE,\n [POINTERDOWN]: POINTERDOWN,\n [POINTERUP]: POINTERUP,\n [POINTERCANCEL]: POINTERCANCEL,\n pointerclick: 'pointerclick',\n pointerdblclick: 'pointerdblclick',\n },\n};\nconst getEventType = (type) => {\n if (type.indexOf('pointer') >= 0) {\n return 'pointer';\n }\n if (type.indexOf('touch') >= 0) {\n return 'touch';\n }\n return 'mouse';\n};\nconst getEventsMap = (eventType) => {\n const type = getEventType(eventType);\n if (type === 'pointer') {\n return Global_1.Konva.pointerEventsEnabled && EVENTS_MAP.pointer;\n }\n if (type === 'touch') {\n return EVENTS_MAP.touch;\n }\n if (type === 'mouse') {\n return EVENTS_MAP.mouse;\n }\n};\nfunction checkNoClip(attrs = {}) {\n if (attrs.clipFunc || attrs.clipWidth || attrs.clipHeight) {\n Util_1.Util.warn('Stage does not support clipping. Please use clip for Layers or Groups.');\n }\n return attrs;\n}\nconst NO_POINTERS_MESSAGE = `Pointer position is missing and not registered by the stage. Looks like it is outside of the stage container. You can set it manually from event: stage.setPointersPositions(event);`;\nexports.stages = [];\nclass Stage extends Container_1.Container {\n constructor(config) {\n super(checkNoClip(config));\n this._pointerPositions = [];\n this._changedPointerPositions = [];\n this._buildDOM();\n this._bindContentEvents();\n exports.stages.push(this);\n this.on('widthChange.konva heightChange.konva', this._resizeDOM);\n this.on('visibleChange.konva', this._checkVisibility);\n this.on('clipWidthChange.konva clipHeightChange.konva clipFuncChange.konva', () => {\n checkNoClip(this.attrs);\n });\n this._checkVisibility();\n }\n _validateAdd(child) {\n const isLayer = child.getType() === 'Layer';\n const isFastLayer = child.getType() === 'FastLayer';\n const valid = isLayer || isFastLayer;\n if (!valid) {\n Util_1.Util.throw('You may only add layers to the stage.');\n }\n }\n _checkVisibility() {\n if (!this.content) {\n return;\n }\n const style = this.visible() ? '' : 'none';\n this.content.style.display = style;\n }\n setContainer(container) {\n if (typeof container === STRING) {\n if (container.charAt(0) === '.') {\n var className = container.slice(1);\n container = document.getElementsByClassName(className)[0];\n }\n else {\n var id;\n if (container.charAt(0) !== '#') {\n id = container;\n }\n else {\n id = container.slice(1);\n }\n container = document.getElementById(id);\n }\n if (!container) {\n throw 'Can not find container in document with id ' + id;\n }\n }\n this._setAttr('container', container);\n if (this.content) {\n if (this.content.parentElement) {\n this.content.parentElement.removeChild(this.content);\n }\n container.appendChild(this.content);\n }\n return this;\n }\n shouldDrawHit() {\n return true;\n }\n clear() {\n var layers = this.children, len = layers.length, n;\n for (n = 0; n < len; n++) {\n layers[n].clear();\n }\n return this;\n }\n clone(obj) {\n if (!obj) {\n obj = {};\n }\n obj.container =\n typeof document !== 'undefined' && document.createElement('div');\n return Container_1.Container.prototype.clone.call(this, obj);\n }\n destroy() {\n super.destroy();\n var content = this.content;\n if (content && Util_1.Util._isInDocument(content)) {\n this.container().removeChild(content);\n }\n var index = exports.stages.indexOf(this);\n if (index > -1) {\n exports.stages.splice(index, 1);\n }\n Util_1.Util.releaseCanvas(this.bufferCanvas._canvas, this.bufferHitCanvas._canvas);\n return this;\n }\n getPointerPosition() {\n const pos = this._pointerPositions[0] || this._changedPointerPositions[0];\n if (!pos) {\n Util_1.Util.warn(NO_POINTERS_MESSAGE);\n return null;\n }\n return {\n x: pos.x,\n y: pos.y,\n };\n }\n _getPointerById(id) {\n return this._pointerPositions.find((p) => p.id === id);\n }\n getPointersPositions() {\n return this._pointerPositions;\n }\n getStage() {\n return this;\n }\n getContent() {\n return this.content;\n }\n _toKonvaCanvas(config) {\n config = config || {};\n config.x = config.x || 0;\n config.y = config.y || 0;\n config.width = config.width || this.width();\n config.height = config.height || this.height();\n var canvas = new Canvas_1.SceneCanvas({\n width: config.width,\n height: config.height,\n pixelRatio: config.pixelRatio || 1,\n });\n var _context = canvas.getContext()._context;\n var layers = this.children;\n if (config.x || config.y) {\n _context.translate(-1 * config.x, -1 * config.y);\n }\n layers.forEach(function (layer) {\n if (!layer.isVisible()) {\n return;\n }\n var layerCanvas = layer._toKonvaCanvas(config);\n _context.drawImage(layerCanvas._canvas, config.x, config.y, layerCanvas.getWidth() / layerCanvas.getPixelRatio(), layerCanvas.getHeight() / layerCanvas.getPixelRatio());\n });\n return canvas;\n }\n getIntersection(pos) {\n if (!pos) {\n return null;\n }\n var layers = this.children, len = layers.length, end = len - 1, n;\n for (n = end; n >= 0; n--) {\n const shape = layers[n].getIntersection(pos);\n if (shape) {\n return shape;\n }\n }\n return null;\n }\n _resizeDOM() {\n var width = this.width();\n var height = this.height();\n if (this.content) {\n this.content.style.width = width + PX;\n this.content.style.height = height + PX;\n }\n this.bufferCanvas.setSize(width, height);\n this.bufferHitCanvas.setSize(width, height);\n this.children.forEach((layer) => {\n layer.setSize({ width, height });\n layer.draw();\n });\n }\n add(layer, ...rest) {\n if (arguments.length > 1) {\n for (var i = 0; i < arguments.length; i++) {\n this.add(arguments[i]);\n }\n return this;\n }\n super.add(layer);\n var length = this.children.length;\n if (length > MAX_LAYERS_NUMBER) {\n Util_1.Util.warn('The stage has ' +\n length +\n ' layers. Recommended maximum number of layers is 3-5. Adding more layers into the stage may drop the performance. Rethink your tree structure, you can use Konva.Group.');\n }\n layer.setSize({ width: this.width(), height: this.height() });\n layer.draw();\n if (Global_1.Konva.isBrowser) {\n this.content.appendChild(layer.canvas._canvas);\n }\n return this;\n }\n getParent() {\n return null;\n }\n getLayer() {\n return null;\n }\n hasPointerCapture(pointerId) {\n return PointerEvents.hasPointerCapture(pointerId, this);\n }\n setPointerCapture(pointerId) {\n PointerEvents.setPointerCapture(pointerId, this);\n }\n releaseCapture(pointerId) {\n PointerEvents.releaseCapture(pointerId, this);\n }\n getLayers() {\n return this.children;\n }\n _bindContentEvents() {\n if (!Global_1.Konva.isBrowser) {\n return;\n }\n EVENTS.forEach(([event, methodName]) => {\n this.content.addEventListener(event, (evt) => {\n this[methodName](evt);\n }, { passive: false });\n });\n }\n _pointerenter(evt) {\n this.setPointersPositions(evt);\n const events = getEventsMap(evt.type);\n if (events) {\n this._fire(events.pointerenter, {\n evt: evt,\n target: this,\n currentTarget: this,\n });\n }\n }\n _pointerover(evt) {\n this.setPointersPositions(evt);\n const events = getEventsMap(evt.type);\n if (events) {\n this._fire(events.pointerover, {\n evt: evt,\n target: this,\n currentTarget: this,\n });\n }\n }\n _getTargetShape(evenType) {\n let shape = this[evenType + 'targetShape'];\n if (shape && !shape.getStage()) {\n shape = null;\n }\n return shape;\n }\n _pointerleave(evt) {\n const events = getEventsMap(evt.type);\n const eventType = getEventType(evt.type);\n if (!events) {\n return;\n }\n this.setPointersPositions(evt);\n var targetShape = this._getTargetShape(eventType);\n var eventsEnabled = !(Global_1.Konva.isDragging() || Global_1.Konva.isTransforming()) || Global_1.Konva.hitOnDragEnabled;\n if (targetShape && eventsEnabled) {\n targetShape._fireAndBubble(events.pointerout, { evt: evt });\n targetShape._fireAndBubble(events.pointerleave, { evt: evt });\n this._fire(events.pointerleave, {\n evt: evt,\n target: this,\n currentTarget: this,\n });\n this[eventType + 'targetShape'] = null;\n }\n else if (eventsEnabled) {\n this._fire(events.pointerleave, {\n evt: evt,\n target: this,\n currentTarget: this,\n });\n this._fire(events.pointerout, {\n evt: evt,\n target: this,\n currentTarget: this,\n });\n }\n this.pointerPos = null;\n this._pointerPositions = [];\n }\n _pointerdown(evt) {\n const events = getEventsMap(evt.type);\n const eventType = getEventType(evt.type);\n if (!events) {\n return;\n }\n this.setPointersPositions(evt);\n var triggeredOnShape = false;\n this._changedPointerPositions.forEach((pos) => {\n var shape = this.getIntersection(pos);\n DragAndDrop_1.DD.justDragged = false;\n Global_1.Konva['_' + eventType + 'ListenClick'] = true;\n if (!shape || !shape.isListening()) {\n return;\n }\n if (Global_1.Konva.capturePointerEventsEnabled) {\n shape.setPointerCapture(pos.id);\n }\n this[eventType + 'ClickStartShape'] = shape;\n shape._fireAndBubble(events.pointerdown, {\n evt: evt,\n pointerId: pos.id,\n });\n triggeredOnShape = true;\n const isTouch = evt.type.indexOf('touch') >= 0;\n if (shape.preventDefault() && evt.cancelable && isTouch) {\n evt.preventDefault();\n }\n });\n if (!triggeredOnShape) {\n this._fire(events.pointerdown, {\n evt: evt,\n target: this,\n currentTarget: this,\n pointerId: this._pointerPositions[0].id,\n });\n }\n }\n _pointermove(evt) {\n const events = getEventsMap(evt.type);\n const eventType = getEventType(evt.type);\n if (!events) {\n return;\n }\n if (Global_1.Konva.isDragging() && DragAndDrop_1.DD.node.preventDefault() && evt.cancelable) {\n evt.preventDefault();\n }\n this.setPointersPositions(evt);\n var eventsEnabled = !(Global_1.Konva.isDragging() || Global_1.Konva.isTransforming()) || Global_1.Konva.hitOnDragEnabled;\n if (!eventsEnabled) {\n return;\n }\n var processedShapesIds = {};\n let triggeredOnShape = false;\n var targetShape = this._getTargetShape(eventType);\n this._changedPointerPositions.forEach((pos) => {\n const shape = (PointerEvents.getCapturedShape(pos.id) ||\n this.getIntersection(pos));\n const pointerId = pos.id;\n const event = { evt: evt, pointerId };\n var differentTarget = targetShape !== shape;\n if (differentTarget && targetShape) {\n targetShape._fireAndBubble(events.pointerout, { ...event }, shape);\n targetShape._fireAndBubble(events.pointerleave, { ...event }, shape);\n }\n if (shape) {\n if (processedShapesIds[shape._id]) {\n return;\n }\n processedShapesIds[shape._id] = true;\n }\n if (shape && shape.isListening()) {\n triggeredOnShape = true;\n if (differentTarget) {\n shape._fireAndBubble(events.pointerover, { ...event }, targetShape);\n shape._fireAndBubble(events.pointerenter, { ...event }, targetShape);\n this[eventType + 'targetShape'] = shape;\n }\n shape._fireAndBubble(events.pointermove, { ...event });\n }\n else {\n if (targetShape) {\n this._fire(events.pointerover, {\n evt: evt,\n target: this,\n currentTarget: this,\n pointerId,\n });\n this[eventType + 'targetShape'] = null;\n }\n }\n });\n if (!triggeredOnShape) {\n this._fire(events.pointermove, {\n evt: evt,\n target: this,\n currentTarget: this,\n pointerId: this._changedPointerPositions[0].id,\n });\n }\n }\n _pointerup(evt) {\n const events = getEventsMap(evt.type);\n const eventType = getEventType(evt.type);\n if (!events) {\n return;\n }\n this.setPointersPositions(evt);\n const clickStartShape = this[eventType + 'ClickStartShape'];\n const clickEndShape = this[eventType + 'ClickEndShape'];\n var processedShapesIds = {};\n let triggeredOnShape = false;\n this._changedPointerPositions.forEach((pos) => {\n const shape = (PointerEvents.getCapturedShape(pos.id) ||\n this.getIntersection(pos));\n if (shape) {\n shape.releaseCapture(pos.id);\n if (processedShapesIds[shape._id]) {\n return;\n }\n processedShapesIds[shape._id] = true;\n }\n const pointerId = pos.id;\n const event = { evt: evt, pointerId };\n let fireDblClick = false;\n if (Global_1.Konva['_' + eventType + 'InDblClickWindow']) {\n fireDblClick = true;\n clearTimeout(this[eventType + 'DblTimeout']);\n }\n else if (!DragAndDrop_1.DD.justDragged) {\n Global_1.Konva['_' + eventType + 'InDblClickWindow'] = true;\n clearTimeout(this[eventType + 'DblTimeout']);\n }\n this[eventType + 'DblTimeout'] = setTimeout(function () {\n Global_1.Konva['_' + eventType + 'InDblClickWindow'] = false;\n }, Global_1.Konva.dblClickWindow);\n if (shape && shape.isListening()) {\n triggeredOnShape = true;\n this[eventType + 'ClickEndShape'] = shape;\n shape._fireAndBubble(events.pointerup, { ...event });\n if (Global_1.Konva['_' + eventType + 'ListenClick'] &&\n clickStartShape &&\n clickStartShape === shape) {\n shape._fireAndBubble(events.pointerclick, { ...event });\n if (fireDblClick && clickEndShape && clickEndShape === shape) {\n shape._fireAndBubble(events.pointerdblclick, { ...event });\n }\n }\n }\n else {\n this[eventType + 'ClickEndShape'] = null;\n if (Global_1.Konva['_' + eventType + 'ListenClick']) {\n this._fire(events.pointerclick, {\n evt: evt,\n target: this,\n currentTarget: this,\n pointerId,\n });\n }\n if (fireDblClick) {\n this._fire(events.pointerdblclick, {\n evt: evt,\n target: this,\n currentTarget: this,\n pointerId,\n });\n }\n }\n });\n if (!triggeredOnShape) {\n this._fire(events.pointerup, {\n evt: evt,\n target: this,\n currentTarget: this,\n pointerId: this._changedPointerPositions[0].id,\n });\n }\n Global_1.Konva['_' + eventType + 'ListenClick'] = false;\n if (evt.cancelable && eventType !== 'touch') {\n evt.preventDefault();\n }\n }\n _contextmenu(evt) {\n this.setPointersPositions(evt);\n var shape = this.getIntersection(this.getPointerPosition());\n if (shape && shape.isListening()) {\n shape._fireAndBubble(CONTEXTMENU, { evt: evt });\n }\n else {\n this._fire(CONTEXTMENU, {\n evt: evt,\n target: this,\n currentTarget: this,\n });\n }\n }\n _wheel(evt) {\n this.setPointersPositions(evt);\n var shape = this.getIntersection(this.getPointerPosition());\n if (shape && shape.isListening()) {\n shape._fireAndBubble(WHEEL, { evt: evt });\n }\n else {\n this._fire(WHEEL, {\n evt: evt,\n target: this,\n currentTarget: this,\n });\n }\n }\n _pointercancel(evt) {\n this.setPointersPositions(evt);\n const shape = PointerEvents.getCapturedShape(evt.pointerId) ||\n this.getIntersection(this.getPointerPosition());\n if (shape) {\n shape._fireAndBubble(POINTERUP, PointerEvents.createEvent(evt));\n }\n PointerEvents.releaseCapture(evt.pointerId);\n }\n _lostpointercapture(evt) {\n PointerEvents.releaseCapture(evt.pointerId);\n }\n setPointersPositions(evt) {\n var contentPosition = this._getContentPosition(), x = null, y = null;\n evt = evt ? evt : window.event;\n if (evt.touches !== undefined) {\n this._pointerPositions = [];\n this._changedPointerPositions = [];\n Array.prototype.forEach.call(evt.touches, (touch) => {\n this._pointerPositions.push({\n id: touch.identifier,\n x: (touch.clientX - contentPosition.left) / contentPosition.scaleX,\n y: (touch.clientY - contentPosition.top) / contentPosition.scaleY,\n });\n });\n Array.prototype.forEach.call(evt.changedTouches || evt.touches, (touch) => {\n this._changedPointerPositions.push({\n id: touch.identifier,\n x: (touch.clientX - contentPosition.left) / contentPosition.scaleX,\n y: (touch.clientY - contentPosition.top) / contentPosition.scaleY,\n });\n });\n }\n else {\n x = (evt.clientX - contentPosition.left) / contentPosition.scaleX;\n y = (evt.clientY - contentPosition.top) / contentPosition.scaleY;\n this.pointerPos = {\n x: x,\n y: y,\n };\n this._pointerPositions = [{ x, y, id: Util_1.Util._getFirstPointerId(evt) }];\n this._changedPointerPositions = [\n { x, y, id: Util_1.Util._getFirstPointerId(evt) },\n ];\n }\n }\n _setPointerPosition(evt) {\n Util_1.Util.warn('Method _setPointerPosition is deprecated. Use \"stage.setPointersPositions(event)\" instead.');\n this.setPointersPositions(evt);\n }\n _getContentPosition() {\n if (!this.content || !this.content.getBoundingClientRect) {\n return {\n top: 0,\n left: 0,\n scaleX: 1,\n scaleY: 1,\n };\n }\n var rect = this.content.getBoundingClientRect();\n return {\n top: rect.top,\n left: rect.left,\n scaleX: rect.width / this.content.clientWidth || 1,\n scaleY: rect.height / this.content.clientHeight || 1,\n };\n }\n _buildDOM() {\n this.bufferCanvas = new Canvas_1.SceneCanvas({\n width: this.width(),\n height: this.height(),\n });\n this.bufferHitCanvas = new Canvas_1.HitCanvas({\n pixelRatio: 1,\n width: this.width(),\n height: this.height(),\n });\n if (!Global_1.Konva.isBrowser) {\n return;\n }\n var container = this.container();\n if (!container) {\n throw 'Stage has no container. A container is required.';\n }\n container.innerHTML = '';\n this.content = document.createElement('div');\n this.content.style.position = 'relative';\n this.content.style.userSelect = 'none';\n this.content.className = 'konvajs-content';\n this.content.setAttribute('role', 'presentation');\n container.appendChild(this.content);\n this._resizeDOM();\n }\n cache() {\n Util_1.Util.warn('Cache function is not allowed for stage. You may use cache only for layers, groups and shapes.');\n return this;\n }\n clearCache() {\n return this;\n }\n batchDraw() {\n this.getChildren().forEach(function (layer) {\n layer.batchDraw();\n });\n return this;\n }\n}\nexports.Stage = Stage;\nStage.prototype.nodeType = STAGE;\n(0, Global_2._registerNode)(Stage);\nFactory_1.Factory.addGetterSetter(Stage, 'container');\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Shape = exports.shapes = void 0;\nconst Global_1 = require(\"./Global\");\nconst Util_1 = require(\"./Util\");\nconst Factory_1 = require(\"./Factory\");\nconst Node_1 = require(\"./Node\");\nconst Validators_1 = require(\"./Validators\");\nconst Global_2 = require(\"./Global\");\nconst PointerEvents = require(\"./PointerEvents\");\nvar HAS_SHADOW = 'hasShadow';\nvar SHADOW_RGBA = 'shadowRGBA';\nvar patternImage = 'patternImage';\nvar linearGradient = 'linearGradient';\nvar radialGradient = 'radialGradient';\nlet dummyContext;\nfunction getDummyContext() {\n if (dummyContext) {\n return dummyContext;\n }\n dummyContext = Util_1.Util.createCanvasElement().getContext('2d');\n return dummyContext;\n}\nexports.shapes = {};\nfunction _fillFunc(context) {\n const fillRule = this.attrs.fillRule;\n if (fillRule) {\n context.fill(fillRule);\n }\n else {\n context.fill();\n }\n}\nfunction _strokeFunc(context) {\n context.stroke();\n}\nfunction _fillFuncHit(context) {\n context.fill();\n}\nfunction _strokeFuncHit(context) {\n context.stroke();\n}\nfunction _clearHasShadowCache() {\n this._clearCache(HAS_SHADOW);\n}\nfunction _clearGetShadowRGBACache() {\n this._clearCache(SHADOW_RGBA);\n}\nfunction _clearFillPatternCache() {\n this._clearCache(patternImage);\n}\nfunction _clearLinearGradientCache() {\n this._clearCache(linearGradient);\n}\nfunction _clearRadialGradientCache() {\n this._clearCache(radialGradient);\n}\nclass Shape extends Node_1.Node {\n constructor(config) {\n super(config);\n let key;\n while (true) {\n key = Util_1.Util.getRandomColor();\n if (key && !(key in exports.shapes)) {\n break;\n }\n }\n this.colorKey = key;\n exports.shapes[key] = this;\n }\n getContext() {\n Util_1.Util.warn('shape.getContext() method is deprecated. Please do not use it.');\n return this.getLayer().getContext();\n }\n getCanvas() {\n Util_1.Util.warn('shape.getCanvas() method is deprecated. Please do not use it.');\n return this.getLayer().getCanvas();\n }\n getSceneFunc() {\n return this.attrs.sceneFunc || this['_sceneFunc'];\n }\n getHitFunc() {\n return this.attrs.hitFunc || this['_hitFunc'];\n }\n hasShadow() {\n return this._getCache(HAS_SHADOW, this._hasShadow);\n }\n _hasShadow() {\n return (this.shadowEnabled() &&\n this.shadowOpacity() !== 0 &&\n !!(this.shadowColor() ||\n this.shadowBlur() ||\n this.shadowOffsetX() ||\n this.shadowOffsetY()));\n }\n _getFillPattern() {\n return this._getCache(patternImage, this.__getFillPattern);\n }\n __getFillPattern() {\n if (this.fillPatternImage()) {\n var ctx = getDummyContext();\n const pattern = ctx.createPattern(this.fillPatternImage(), this.fillPatternRepeat() || 'repeat');\n if (pattern && pattern.setTransform) {\n const tr = new Util_1.Transform();\n tr.translate(this.fillPatternX(), this.fillPatternY());\n tr.rotate(Global_1.Konva.getAngle(this.fillPatternRotation()));\n tr.scale(this.fillPatternScaleX(), this.fillPatternScaleY());\n tr.translate(-1 * this.fillPatternOffsetX(), -1 * this.fillPatternOffsetY());\n const m = tr.getMatrix();\n const matrix = typeof DOMMatrix === 'undefined'\n ? {\n a: m[0],\n b: m[1],\n c: m[2],\n d: m[3],\n e: m[4],\n f: m[5],\n }\n : new DOMMatrix(m);\n pattern.setTransform(matrix);\n }\n return pattern;\n }\n }\n _getLinearGradient() {\n return this._getCache(linearGradient, this.__getLinearGradient);\n }\n __getLinearGradient() {\n var colorStops = this.fillLinearGradientColorStops();\n if (colorStops) {\n var ctx = getDummyContext();\n var start = this.fillLinearGradientStartPoint();\n var end = this.fillLinearGradientEndPoint();\n var grd = ctx.createLinearGradient(start.x, start.y, end.x, end.y);\n for (var n = 0; n < colorStops.length; n += 2) {\n grd.addColorStop(colorStops[n], colorStops[n + 1]);\n }\n return grd;\n }\n }\n _getRadialGradient() {\n return this._getCache(radialGradient, this.__getRadialGradient);\n }\n __getRadialGradient() {\n var colorStops = this.fillRadialGradientColorStops();\n if (colorStops) {\n var ctx = getDummyContext();\n var start = this.fillRadialGradientStartPoint();\n var end = this.fillRadialGradientEndPoint();\n var grd = ctx.createRadialGradient(start.x, start.y, this.fillRadialGradientStartRadius(), end.x, end.y, this.fillRadialGradientEndRadius());\n for (var n = 0; n < colorStops.length; n += 2) {\n grd.addColorStop(colorStops[n], colorStops[n + 1]);\n }\n return grd;\n }\n }\n getShadowRGBA() {\n return this._getCache(SHADOW_RGBA, this._getShadowRGBA);\n }\n _getShadowRGBA() {\n if (!this.hasShadow()) {\n return;\n }\n var rgba = Util_1.Util.colorToRGBA(this.shadowColor());\n if (rgba) {\n return ('rgba(' +\n rgba.r +\n ',' +\n rgba.g +\n ',' +\n rgba.b +\n ',' +\n rgba.a * (this.shadowOpacity() || 1) +\n ')');\n }\n }\n hasFill() {\n return this._calculate('hasFill', [\n 'fillEnabled',\n 'fill',\n 'fillPatternImage',\n 'fillLinearGradientColorStops',\n 'fillRadialGradientColorStops',\n ], () => {\n return (this.fillEnabled() &&\n !!(this.fill() ||\n this.fillPatternImage() ||\n this.fillLinearGradientColorStops() ||\n this.fillRadialGradientColorStops()));\n });\n }\n hasStroke() {\n return this._calculate('hasStroke', [\n 'strokeEnabled',\n 'strokeWidth',\n 'stroke',\n 'strokeLinearGradientColorStops',\n ], () => {\n return (this.strokeEnabled() &&\n this.strokeWidth() &&\n !!(this.stroke() || this.strokeLinearGradientColorStops()));\n });\n }\n hasHitStroke() {\n const width = this.hitStrokeWidth();\n if (width === 'auto') {\n return this.hasStroke();\n }\n return this.strokeEnabled() && !!width;\n }\n intersects(point) {\n var stage = this.getStage();\n if (!stage) {\n return false;\n }\n const bufferHitCanvas = stage.bufferHitCanvas;\n bufferHitCanvas.getContext().clear();\n this.drawHit(bufferHitCanvas, undefined, true);\n const p = bufferHitCanvas.context.getImageData(Math.round(point.x), Math.round(point.y), 1, 1).data;\n return p[3] > 0;\n }\n destroy() {\n Node_1.Node.prototype.destroy.call(this);\n delete exports.shapes[this.colorKey];\n delete this.colorKey;\n return this;\n }\n _useBufferCanvas(forceFill) {\n var _a;\n const perfectDrawEnabled = (_a = this.attrs.perfectDrawEnabled) !== null && _a !== void 0 ? _a : true;\n if (!perfectDrawEnabled) {\n return false;\n }\n const hasFill = forceFill || this.hasFill();\n const hasStroke = this.hasStroke();\n const isTransparent = this.getAbsoluteOpacity() !== 1;\n if (hasFill && hasStroke && isTransparent) {\n return true;\n }\n const hasShadow = this.hasShadow();\n const strokeForShadow = this.shadowForStrokeEnabled();\n if (hasFill && hasStroke && hasShadow && strokeForShadow) {\n return true;\n }\n return false;\n }\n setStrokeHitEnabled(val) {\n Util_1.Util.warn('strokeHitEnabled property is deprecated. Please use hitStrokeWidth instead.');\n if (val) {\n this.hitStrokeWidth('auto');\n }\n else {\n this.hitStrokeWidth(0);\n }\n }\n getStrokeHitEnabled() {\n if (this.hitStrokeWidth() === 0) {\n return false;\n }\n else {\n return true;\n }\n }\n getSelfRect() {\n var size = this.size();\n return {\n x: this._centroid ? -size.width / 2 : 0,\n y: this._centroid ? -size.height / 2 : 0,\n width: size.width,\n height: size.height,\n };\n }\n getClientRect(config = {}) {\n const skipTransform = config.skipTransform;\n const relativeTo = config.relativeTo;\n const fillRect = this.getSelfRect();\n const applyStroke = !config.skipStroke && this.hasStroke();\n const strokeWidth = (applyStroke && this.strokeWidth()) || 0;\n const fillAndStrokeWidth = fillRect.width + strokeWidth;\n const fillAndStrokeHeight = fillRect.height + strokeWidth;\n const applyShadow = !config.skipShadow && this.hasShadow();\n const shadowOffsetX = applyShadow ? this.shadowOffsetX() : 0;\n const shadowOffsetY = applyShadow ? this.shadowOffsetY() : 0;\n const preWidth = fillAndStrokeWidth + Math.abs(shadowOffsetX);\n const preHeight = fillAndStrokeHeight + Math.abs(shadowOffsetY);\n const blurRadius = (applyShadow && this.shadowBlur()) || 0;\n const width = preWidth + blurRadius * 2;\n const height = preHeight + blurRadius * 2;\n const rect = {\n width: width,\n height: height,\n x: -(strokeWidth / 2 + blurRadius) +\n Math.min(shadowOffsetX, 0) +\n fillRect.x,\n y: -(strokeWidth / 2 + blurRadius) +\n Math.min(shadowOffsetY, 0) +\n fillRect.y,\n };\n if (!skipTransform) {\n return this._transformedRect(rect, relativeTo);\n }\n return rect;\n }\n drawScene(can, top, bufferCanvas) {\n var layer = this.getLayer();\n var canvas = can || layer.getCanvas(), context = canvas.getContext(), cachedCanvas = this._getCanvasCache(), drawFunc = this.getSceneFunc(), hasShadow = this.hasShadow(), stage, bufferContext;\n var skipBuffer = canvas.isCache;\n var cachingSelf = top === this;\n if (!this.isVisible() && !cachingSelf) {\n return this;\n }\n if (cachedCanvas) {\n context.save();\n var m = this.getAbsoluteTransform(top).getMatrix();\n context.transform(m[0], m[1], m[2], m[3], m[4], m[5]);\n this._drawCachedSceneCanvas(context);\n context.restore();\n return this;\n }\n if (!drawFunc) {\n return this;\n }\n context.save();\n if (this._useBufferCanvas() && !skipBuffer) {\n stage = this.getStage();\n const bc = bufferCanvas || stage.bufferCanvas;\n bufferContext = bc.getContext();\n bufferContext.clear();\n bufferContext.save();\n bufferContext._applyLineJoin(this);\n var o = this.getAbsoluteTransform(top).getMatrix();\n bufferContext.transform(o[0], o[1], o[2], o[3], o[4], o[5]);\n drawFunc.call(this, bufferContext, this);\n bufferContext.restore();\n var ratio = bc.pixelRatio;\n if (hasShadow) {\n context._applyShadow(this);\n }\n context._applyOpacity(this);\n context._applyGlobalCompositeOperation(this);\n context.drawImage(bc._canvas, 0, 0, bc.width / ratio, bc.height / ratio);\n }\n else {\n context._applyLineJoin(this);\n if (!cachingSelf) {\n var o = this.getAbsoluteTransform(top).getMatrix();\n context.transform(o[0], o[1], o[2], o[3], o[4], o[5]);\n context._applyOpacity(this);\n context._applyGlobalCompositeOperation(this);\n }\n if (hasShadow) {\n context._applyShadow(this);\n }\n drawFunc.call(this, context, this);\n }\n context.restore();\n return this;\n }\n drawHit(can, top, skipDragCheck = false) {\n if (!this.shouldDrawHit(top, skipDragCheck)) {\n return this;\n }\n var layer = this.getLayer(), canvas = can || layer.hitCanvas, context = canvas && canvas.getContext(), drawFunc = this.hitFunc() || this.sceneFunc(), cachedCanvas = this._getCanvasCache(), cachedHitCanvas = cachedCanvas && cachedCanvas.hit;\n if (!this.colorKey) {\n Util_1.Util.warn('Looks like your canvas has a destroyed shape in it. Do not reuse shape after you destroyed it. If you want to reuse shape you should call remove() instead of destroy()');\n }\n if (cachedHitCanvas) {\n context.save();\n var m = this.getAbsoluteTransform(top).getMatrix();\n context.transform(m[0], m[1], m[2], m[3], m[4], m[5]);\n this._drawCachedHitCanvas(context);\n context.restore();\n return this;\n }\n if (!drawFunc) {\n return this;\n }\n context.save();\n context._applyLineJoin(this);\n const selfCache = this === top;\n if (!selfCache) {\n var o = this.getAbsoluteTransform(top).getMatrix();\n context.transform(o[0], o[1], o[2], o[3], o[4], o[5]);\n }\n drawFunc.call(this, context, this);\n context.restore();\n return this;\n }\n drawHitFromCache(alphaThreshold = 0) {\n var cachedCanvas = this._getCanvasCache(), sceneCanvas = this._getCachedSceneCanvas(), hitCanvas = cachedCanvas.hit, hitContext = hitCanvas.getContext(), hitWidth = hitCanvas.getWidth(), hitHeight = hitCanvas.getHeight(), hitImageData, hitData, len, rgbColorKey, i, alpha;\n hitContext.clear();\n hitContext.drawImage(sceneCanvas._canvas, 0, 0, hitWidth, hitHeight);\n try {\n hitImageData = hitContext.getImageData(0, 0, hitWidth, hitHeight);\n hitData = hitImageData.data;\n len = hitData.length;\n rgbColorKey = Util_1.Util._hexToRgb(this.colorKey);\n for (i = 0; i < len; i += 4) {\n alpha = hitData[i + 3];\n if (alpha > alphaThreshold) {\n hitData[i] = rgbColorKey.r;\n hitData[i + 1] = rgbColorKey.g;\n hitData[i + 2] = rgbColorKey.b;\n hitData[i + 3] = 255;\n }\n else {\n hitData[i + 3] = 0;\n }\n }\n hitContext.putImageData(hitImageData, 0, 0);\n }\n catch (e) {\n Util_1.Util.error('Unable to draw hit graph from cached scene canvas. ' + e.message);\n }\n return this;\n }\n hasPointerCapture(pointerId) {\n return PointerEvents.hasPointerCapture(pointerId, this);\n }\n setPointerCapture(pointerId) {\n PointerEvents.setPointerCapture(pointerId, this);\n }\n releaseCapture(pointerId) {\n PointerEvents.releaseCapture(pointerId, this);\n }\n}\nexports.Shape = Shape;\nShape.prototype._fillFunc = _fillFunc;\nShape.prototype._strokeFunc = _strokeFunc;\nShape.prototype._fillFuncHit = _fillFuncHit;\nShape.prototype._strokeFuncHit = _strokeFuncHit;\nShape.prototype._centroid = false;\nShape.prototype.nodeType = 'Shape';\n(0, Global_2._registerNode)(Shape);\nShape.prototype.eventListeners = {};\nShape.prototype.on.call(Shape.prototype, 'shadowColorChange.konva shadowBlurChange.konva shadowOffsetChange.konva shadowOpacityChange.konva shadowEnabledChange.konva', _clearHasShadowCache);\nShape.prototype.on.call(Shape.prototype, 'shadowColorChange.konva shadowOpacityChange.konva shadowEnabledChange.konva', _clearGetShadowRGBACache);\nShape.prototype.on.call(Shape.prototype, 'fillPriorityChange.konva fillPatternImageChange.konva fillPatternRepeatChange.konva fillPatternScaleXChange.konva fillPatternScaleYChange.konva fillPatternOffsetXChange.konva fillPatternOffsetYChange.konva fillPatternXChange.konva fillPatternYChange.konva fillPatternRotationChange.konva', _clearFillPatternCache);\nShape.prototype.on.call(Shape.prototype, 'fillPriorityChange.konva fillLinearGradientColorStopsChange.konva fillLinearGradientStartPointXChange.konva fillLinearGradientStartPointYChange.konva fillLinearGradientEndPointXChange.konva fillLinearGradientEndPointYChange.konva', _clearLinearGradientCache);\nShape.prototype.on.call(Shape.prototype, 'fillPriorityChange.konva fillRadialGradientColorStopsChange.konva fillRadialGradientStartPointXChange.konva fillRadialGradientStartPointYChange.konva fillRadialGradientEndPointXChange.konva fillRadialGradientEndPointYChange.konva fillRadialGradientStartRadiusChange.konva fillRadialGradientEndRadiusChange.konva', _clearRadialGradientCache);\nFactory_1.Factory.addGetterSetter(Shape, 'stroke', undefined, (0, Validators_1.getStringOrGradientValidator)());\nFactory_1.Factory.addGetterSetter(Shape, 'strokeWidth', 2, (0, Validators_1.getNumberValidator)());\nFactory_1.Factory.addGetterSetter(Shape, 'fillAfterStrokeEnabled', false);\nFactory_1.Factory.addGetterSetter(Shape, 'hitStrokeWidth', 'auto', (0, Validators_1.getNumberOrAutoValidator)());\nFactory_1.Factory.addGetterSetter(Shape, 'strokeHitEnabled', true, (0, Validators_1.getBooleanValidator)());\nFactory_1.Factory.addGetterSetter(Shape, 'perfectDrawEnabled', true, (0, Validators_1.getBooleanValidator)());\nFactory_1.Factory.addGetterSetter(Shape, 'shadowForStrokeEnabled', true, (0, Validators_1.getBooleanValidator)());\nFactory_1.Factory.addGetterSetter(Shape, 'lineJoin');\nFactory_1.Factory.addGetterSetter(Shape, 'lineCap');\nFactory_1.Factory.addGetterSetter(Shape, 'sceneFunc');\nFactory_1.Factory.addGetterSetter(Shape, 'hitFunc');\nFactory_1.Factory.addGetterSetter(Shape, 'dash');\nFactory_1.Factory.addGetterSetter(Shape, 'dashOffset', 0, (0, Validators_1.getNumberValidator)());\nFactory_1.Factory.addGetterSetter(Shape, 'shadowColor', undefined, (0, Validators_1.getStringValidator)());\nFactory_1.Factory.addGetterSetter(Shape, 'shadowBlur', 0, (0, Validators_1.getNumberValidator)());\nFactory_1.Factory.addGetterSetter(Shape, 'shadowOpacity', 1, (0, Validators_1.getNumberValidator)());\nFactory_1.Factory.addComponentsGetterSetter(Shape, 'shadowOffset', ['x', 'y']);\nFactory_1.Factory.addGetterSetter(Shape, 'shadowOffsetX', 0, (0, Validators_1.getNumberValidator)());\nFactory_1.Factory.addGetterSetter(Shape, 'shadowOffsetY', 0, (0, Validators_1.getNumberValidator)());\nFactory_1.Factory.addGetterSetter(Shape, 'fillPatternImage');\nFactory_1.Factory.addGetterSetter(Shape, 'fill', undefined, (0, Validators_1.getStringOrGradientValidator)());\nFactory_1.Factory.addGetterSetter(Shape, 'fillPatternX', 0, (0, Validators_1.getNumberValidator)());\nFactory_1.Factory.addGetterSetter(Shape, 'fillPatternY', 0, (0, Validators_1.getNumberValidator)());\nFactory_1.Factory.addGetterSetter(Shape, 'fillLinearGradientColorStops');\nFactory_1.Factory.addGetterSetter(Shape, 'strokeLinearGradientColorStops');\nFactory_1.Factory.addGetterSetter(Shape, 'fillRadialGradientStartRadius', 0);\nFactory_1.Factory.addGetterSetter(Shape, 'fillRadialGradientEndRadius', 0);\nFactory_1.Factory.addGetterSetter(Shape, 'fillRadialGradientColorStops');\nFactory_1.Factory.addGetterSetter(Shape, 'fillPatternRepeat', 'repeat');\nFactory_1.Factory.addGetterSetter(Shape, 'fillEnabled', true);\nFactory_1.Factory.addGetterSetter(Shape, 'strokeEnabled', true);\nFactory_1.Factory.addGetterSetter(Shape, 'shadowEnabled', true);\nFactory_1.Factory.addGetterSetter(Shape, 'dashEnabled', true);\nFactory_1.Factory.addGetterSetter(Shape, 'strokeScaleEnabled', true);\nFactory_1.Factory.addGetterSetter(Shape, 'fillPriority', 'color');\nFactory_1.Factory.addComponentsGetterSetter(Shape, 'fillPatternOffset', ['x', 'y']);\nFactory_1.Factory.addGetterSetter(Shape, 'fillPatternOffsetX', 0, (0, Validators_1.getNumberValidator)());\nFactory_1.Factory.addGetterSetter(Shape, 'fillPatternOffsetY', 0, (0, Validators_1.getNumberValidator)());\nFactory_1.Factory.addComponentsGetterSetter(Shape, 'fillPatternScale', ['x', 'y']);\nFactory_1.Factory.addGetterSetter(Shape, 'fillPatternScaleX', 1, (0, Validators_1.getNumberValidator)());\nFactory_1.Factory.addGetterSetter(Shape, 'fillPatternScaleY', 1, (0, Validators_1.getNumberValidator)());\nFactory_1.Factory.addComponentsGetterSetter(Shape, 'fillLinearGradientStartPoint', [\n 'x',\n 'y',\n]);\nFactory_1.Factory.addComponentsGetterSetter(Shape, 'strokeLinearGradientStartPoint', [\n 'x',\n 'y',\n]);\nFactory_1.Factory.addGetterSetter(Shape, 'fillLinearGradientStartPointX', 0);\nFactory_1.Factory.addGetterSetter(Shape, 'strokeLinearGradientStartPointX', 0);\nFactory_1.Factory.addGetterSetter(Shape, 'fillLinearGradientStartPointY', 0);\nFactory_1.Factory.addGetterSetter(Shape, 'strokeLinearGradientStartPointY', 0);\nFactory_1.Factory.addComponentsGetterSetter(Shape, 'fillLinearGradientEndPoint', [\n 'x',\n 'y',\n]);\nFactory_1.Factory.addComponentsGetterSetter(Shape, 'strokeLinearGradientEndPoint', [\n 'x',\n 'y',\n]);\nFactory_1.Factory.addGetterSetter(Shape, 'fillLinearGradientEndPointX', 0);\nFactory_1.Factory.addGetterSetter(Shape, 'strokeLinearGradientEndPointX', 0);\nFactory_1.Factory.addGetterSetter(Shape, 'fillLinearGradientEndPointY', 0);\nFactory_1.Factory.addGetterSetter(Shape, 'strokeLinearGradientEndPointY', 0);\nFactory_1.Factory.addComponentsGetterSetter(Shape, 'fillRadialGradientStartPoint', [\n 'x',\n 'y',\n]);\nFactory_1.Factory.addGetterSetter(Shape, 'fillRadialGradientStartPointX', 0);\nFactory_1.Factory.addGetterSetter(Shape, 'fillRadialGradientStartPointY', 0);\nFactory_1.Factory.addComponentsGetterSetter(Shape, 'fillRadialGradientEndPoint', [\n 'x',\n 'y',\n]);\nFactory_1.Factory.addGetterSetter(Shape, 'fillRadialGradientEndPointX', 0);\nFactory_1.Factory.addGetterSetter(Shape, 'fillRadialGradientEndPointY', 0);\nFactory_1.Factory.addGetterSetter(Shape, 'fillPatternRotation', 0);\nFactory_1.Factory.addGetterSetter(Shape, 'fillRule', undefined, (0, Validators_1.getStringValidator)());\nFactory_1.Factory.backCompat(Shape, {\n dashArray: 'dash',\n getDashArray: 'getDash',\n setDashArray: 'getDash',\n drawFunc: 'sceneFunc',\n getDrawFunc: 'getSceneFunc',\n setDrawFunc: 'setSceneFunc',\n drawHitFunc: 'hitFunc',\n getDrawHitFunc: 'getHitFunc',\n setDrawHitFunc: 'setHitFunc',\n});\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Layer = void 0;\nconst Util_1 = require(\"./Util\");\nconst Container_1 = require(\"./Container\");\nconst Node_1 = require(\"./Node\");\nconst Factory_1 = require(\"./Factory\");\nconst Canvas_1 = require(\"./Canvas\");\nconst Validators_1 = require(\"./Validators\");\nconst Shape_1 = require(\"./Shape\");\nconst Global_1 = require(\"./Global\");\nvar HASH = '#', BEFORE_DRAW = 'beforeDraw', DRAW = 'draw', INTERSECTION_OFFSETS = [\n { x: 0, y: 0 },\n { x: -1, y: -1 },\n { x: 1, y: -1 },\n { x: 1, y: 1 },\n { x: -1, y: 1 },\n], INTERSECTION_OFFSETS_LEN = INTERSECTION_OFFSETS.length;\nclass Layer extends Container_1.Container {\n constructor(config) {\n super(config);\n this.canvas = new Canvas_1.SceneCanvas();\n this.hitCanvas = new Canvas_1.HitCanvas({\n pixelRatio: 1,\n });\n this._waitingForDraw = false;\n this.on('visibleChange.konva', this._checkVisibility);\n this._checkVisibility();\n this.on('imageSmoothingEnabledChange.konva', this._setSmoothEnabled);\n this._setSmoothEnabled();\n }\n createPNGStream() {\n const c = this.canvas._canvas;\n return c.createPNGStream();\n }\n getCanvas() {\n return this.canvas;\n }\n getNativeCanvasElement() {\n return this.canvas._canvas;\n }\n getHitCanvas() {\n return this.hitCanvas;\n }\n getContext() {\n return this.getCanvas().getContext();\n }\n clear(bounds) {\n this.getContext().clear(bounds);\n this.getHitCanvas().getContext().clear(bounds);\n return this;\n }\n setZIndex(index) {\n super.setZIndex(index);\n var stage = this.getStage();\n if (stage && stage.content) {\n stage.content.removeChild(this.getNativeCanvasElement());\n if (index < stage.children.length - 1) {\n stage.content.insertBefore(this.getNativeCanvasElement(), stage.children[index + 1].getCanvas()._canvas);\n }\n else {\n stage.content.appendChild(this.getNativeCanvasElement());\n }\n }\n return this;\n }\n moveToTop() {\n Node_1.Node.prototype.moveToTop.call(this);\n var stage = this.getStage();\n if (stage && stage.content) {\n stage.content.removeChild(this.getNativeCanvasElement());\n stage.content.appendChild(this.getNativeCanvasElement());\n }\n return true;\n }\n moveUp() {\n var moved = Node_1.Node.prototype.moveUp.call(this);\n if (!moved) {\n return false;\n }\n var stage = this.getStage();\n if (!stage || !stage.content) {\n return false;\n }\n stage.content.removeChild(this.getNativeCanvasElement());\n if (this.index < stage.children.length - 1) {\n stage.content.insertBefore(this.getNativeCanvasElement(), stage.children[this.index + 1].getCanvas()._canvas);\n }\n else {\n stage.content.appendChild(this.getNativeCanvasElement());\n }\n return true;\n }\n moveDown() {\n if (Node_1.Node.prototype.moveDown.call(this)) {\n var stage = this.getStage();\n if (stage) {\n var children = stage.children;\n if (stage.content) {\n stage.content.removeChild(this.getNativeCanvasElement());\n stage.content.insertBefore(this.getNativeCanvasElement(), children[this.index + 1].getCanvas()._canvas);\n }\n }\n return true;\n }\n return false;\n }\n moveToBottom() {\n if (Node_1.Node.prototype.moveToBottom.call(this)) {\n var stage = this.getStage();\n if (stage) {\n var children = stage.children;\n if (stage.content) {\n stage.content.removeChild(this.getNativeCanvasElement());\n stage.content.insertBefore(this.getNativeCanvasElement(), children[1].getCanvas()._canvas);\n }\n }\n return true;\n }\n return false;\n }\n getLayer() {\n return this;\n }\n remove() {\n var _canvas = this.getNativeCanvasElement();\n Node_1.Node.prototype.remove.call(this);\n if (_canvas && _canvas.parentNode && Util_1.Util._isInDocument(_canvas)) {\n _canvas.parentNode.removeChild(_canvas);\n }\n return this;\n }\n getStage() {\n return this.parent;\n }\n setSize({ width, height }) {\n this.canvas.setSize(width, height);\n this.hitCanvas.setSize(width, height);\n this._setSmoothEnabled();\n return this;\n }\n _validateAdd(child) {\n var type = child.getType();\n if (type !== 'Group' && type !== 'Shape') {\n Util_1.Util.throw('You may only add groups and shapes to a layer.');\n }\n }\n _toKonvaCanvas(config) {\n config = config || {};\n config.width = config.width || this.getWidth();\n config.height = config.height || this.getHeight();\n config.x = config.x !== undefined ? config.x : this.x();\n config.y = config.y !== undefined ? config.y : this.y();\n return Node_1.Node.prototype._toKonvaCanvas.call(this, config);\n }\n _checkVisibility() {\n const visible = this.visible();\n if (visible) {\n this.canvas._canvas.style.display = 'block';\n }\n else {\n this.canvas._canvas.style.display = 'none';\n }\n }\n _setSmoothEnabled() {\n this.getContext()._context.imageSmoothingEnabled =\n this.imageSmoothingEnabled();\n }\n getWidth() {\n if (this.parent) {\n return this.parent.width();\n }\n }\n setWidth() {\n Util_1.Util.warn('Can not change width of layer. Use \"stage.width(value)\" function instead.');\n }\n getHeight() {\n if (this.parent) {\n return this.parent.height();\n }\n }\n setHeight() {\n Util_1.Util.warn('Can not change height of layer. Use \"stage.height(value)\" function instead.');\n }\n batchDraw() {\n if (!this._waitingForDraw) {\n this._waitingForDraw = true;\n Util_1.Util.requestAnimFrame(() => {\n this.draw();\n this._waitingForDraw = false;\n });\n }\n return this;\n }\n getIntersection(pos) {\n if (!this.isListening() || !this.isVisible()) {\n return null;\n }\n var spiralSearchDistance = 1;\n var continueSearch = false;\n while (true) {\n for (let i = 0; i < INTERSECTION_OFFSETS_LEN; i++) {\n const intersectionOffset = INTERSECTION_OFFSETS[i];\n const obj = this._getIntersection({\n x: pos.x + intersectionOffset.x * spiralSearchDistance,\n y: pos.y + intersectionOffset.y * spiralSearchDistance,\n });\n const shape = obj.shape;\n if (shape) {\n return shape;\n }\n continueSearch = !!obj.antialiased;\n if (!obj.antialiased) {\n break;\n }\n }\n if (continueSearch) {\n spiralSearchDistance += 1;\n }\n else {\n return null;\n }\n }\n }\n _getIntersection(pos) {\n const ratio = this.hitCanvas.pixelRatio;\n const p = this.hitCanvas.context.getImageData(Math.round(pos.x * ratio), Math.round(pos.y * ratio), 1, 1).data;\n const p3 = p[3];\n if (p3 === 255) {\n const colorKey = Util_1.Util._rgbToHex(p[0], p[1], p[2]);\n const shape = Shape_1.shapes[HASH + colorKey];\n if (shape) {\n return {\n shape: shape,\n };\n }\n return {\n antialiased: true,\n };\n }\n else if (p3 > 0) {\n return {\n antialiased: true,\n };\n }\n return {};\n }\n drawScene(can, top) {\n var layer = this.getLayer(), canvas = can || (layer && layer.getCanvas());\n this._fire(BEFORE_DRAW, {\n node: this,\n });\n if (this.clearBeforeDraw()) {\n canvas.getContext().clear();\n }\n Container_1.Container.prototype.drawScene.call(this, canvas, top);\n this._fire(DRAW, {\n node: this,\n });\n return this;\n }\n drawHit(can, top) {\n var layer = this.getLayer(), canvas = can || (layer && layer.hitCanvas);\n if (layer && layer.clearBeforeDraw()) {\n layer.getHitCanvas().getContext().clear();\n }\n Container_1.Container.prototype.drawHit.call(this, canvas, top);\n return this;\n }\n enableHitGraph() {\n this.hitGraphEnabled(true);\n return this;\n }\n disableHitGraph() {\n this.hitGraphEnabled(false);\n return this;\n }\n setHitGraphEnabled(val) {\n Util_1.Util.warn('hitGraphEnabled method is deprecated. Please use layer.listening() instead.');\n this.listening(val);\n }\n getHitGraphEnabled(val) {\n Util_1.Util.warn('hitGraphEnabled method is deprecated. Please use layer.listening() instead.');\n return this.listening();\n }\n toggleHitCanvas() {\n if (!this.parent || !this.parent['content']) {\n return;\n }\n var parent = this.parent;\n var added = !!this.hitCanvas._canvas.parentNode;\n if (added) {\n parent.content.removeChild(this.hitCanvas._canvas);\n }\n else {\n parent.content.appendChild(this.hitCanvas._canvas);\n }\n }\n destroy() {\n Util_1.Util.releaseCanvas(this.getNativeCanvasElement(), this.getHitCanvas()._canvas);\n return super.destroy();\n }\n}\nexports.Layer = Layer;\nLayer.prototype.nodeType = 'Layer';\n(0, Global_1._registerNode)(Layer);\nFactory_1.Factory.addGetterSetter(Layer, 'imageSmoothingEnabled', true);\nFactory_1.Factory.addGetterSetter(Layer, 'clearBeforeDraw', true);\nFactory_1.Factory.addGetterSetter(Layer, 'hitGraphEnabled', true, (0, Validators_1.getBooleanValidator)());\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.FastLayer = void 0;\nconst Util_1 = require(\"./Util\");\nconst Layer_1 = require(\"./Layer\");\nconst Global_1 = require(\"./Global\");\nclass FastLayer extends Layer_1.Layer {\n constructor(attrs) {\n super(attrs);\n this.listening(false);\n Util_1.Util.warn('Konva.Fast layer is deprecated. Please use \"new Konva.Layer({ listening: false })\" instead.');\n }\n}\nexports.FastLayer = FastLayer;\nFastLayer.prototype.nodeType = 'FastLayer';\n(0, Global_1._registerNode)(FastLayer);\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Group = void 0;\nconst Util_1 = require(\"./Util\");\nconst Container_1 = require(\"./Container\");\nconst Global_1 = require(\"./Global\");\nclass Group extends Container_1.Container {\n _validateAdd(child) {\n var type = child.getType();\n if (type !== 'Group' && type !== 'Shape') {\n Util_1.Util.throw('You may only add groups and shapes to groups.');\n }\n }\n}\nexports.Group = Group;\nGroup.prototype.nodeType = 'Group';\n(0, Global_1._registerNode)(Group);\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Animation = void 0;\nconst Global_1 = require(\"./Global\");\nconst Util_1 = require(\"./Util\");\nconst now = (function () {\n if (Global_1.glob.performance && Global_1.glob.performance.now) {\n return function () {\n return Global_1.glob.performance.now();\n };\n }\n return function () {\n return new Date().getTime();\n };\n})();\nclass Animation {\n constructor(func, layers) {\n this.id = Animation.animIdCounter++;\n this.frame = {\n time: 0,\n timeDiff: 0,\n lastTime: now(),\n frameRate: 0,\n };\n this.func = func;\n this.setLayers(layers);\n }\n setLayers(layers) {\n let lays = [];\n if (layers) {\n lays = Array.isArray(layers) ? layers : [layers];\n }\n this.layers = lays;\n return this;\n }\n getLayers() {\n return this.layers;\n }\n addLayer(layer) {\n const layers = this.layers;\n const len = layers.length;\n for (let n = 0; n < len; n++) {\n if (layers[n]._id === layer._id) {\n return false;\n }\n }\n this.layers.push(layer);\n return true;\n }\n isRunning() {\n const a = Animation;\n const animations = a.animations;\n const len = animations.length;\n for (let n = 0; n < len; n++) {\n if (animations[n].id === this.id) {\n return true;\n }\n }\n return false;\n }\n start() {\n this.stop();\n this.frame.timeDiff = 0;\n this.frame.lastTime = now();\n Animation._addAnimation(this);\n return this;\n }\n stop() {\n Animation._removeAnimation(this);\n return this;\n }\n _updateFrameObject(time) {\n this.frame.timeDiff = time - this.frame.lastTime;\n this.frame.lastTime = time;\n this.frame.time += this.frame.timeDiff;\n this.frame.frameRate = 1000 / this.frame.timeDiff;\n }\n static _addAnimation(anim) {\n this.animations.push(anim);\n this._handleAnimation();\n }\n static _removeAnimation(anim) {\n const id = anim.id;\n const animations = this.animations;\n const len = animations.length;\n for (let n = 0; n < len; n++) {\n if (animations[n].id === id) {\n this.animations.splice(n, 1);\n break;\n }\n }\n }\n static _runFrames() {\n const layerHash = {};\n const animations = this.animations;\n for (let n = 0; n < animations.length; n++) {\n const anim = animations[n];\n const layers = anim.layers;\n const func = anim.func;\n anim._updateFrameObject(now());\n const layersLen = layers.length;\n let needRedraw;\n if (func) {\n needRedraw = func.call(anim, anim.frame) !== false;\n }\n else {\n needRedraw = true;\n }\n if (!needRedraw) {\n continue;\n }\n for (let i = 0; i < layersLen; i++) {\n const layer = layers[i];\n if (layer._id !== undefined) {\n layerHash[layer._id] = layer;\n }\n }\n }\n for (let key in layerHash) {\n if (!layerHash.hasOwnProperty(key)) {\n continue;\n }\n layerHash[key].batchDraw();\n }\n }\n static _animationLoop() {\n const Anim = Animation;\n if (Anim.animations.length) {\n Anim._runFrames();\n Util_1.Util.requestAnimFrame(Anim._animationLoop);\n }\n else {\n Anim.animRunning = false;\n }\n }\n static _handleAnimation() {\n if (!this.animRunning) {\n this.animRunning = true;\n Util_1.Util.requestAnimFrame(this._animationLoop);\n }\n }\n}\nexports.Animation = Animation;\nAnimation.animations = [];\nAnimation.animIdCounter = 0;\nAnimation.animRunning = false;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Easings = exports.Tween = void 0;\nconst Util_1 = require(\"./Util\");\nconst Animation_1 = require(\"./Animation\");\nconst Node_1 = require(\"./Node\");\nconst Global_1 = require(\"./Global\");\nvar blacklist = {\n node: 1,\n duration: 1,\n easing: 1,\n onFinish: 1,\n yoyo: 1,\n}, PAUSED = 1, PLAYING = 2, REVERSING = 3, idCounter = 0, colorAttrs = ['fill', 'stroke', 'shadowColor'];\nclass TweenEngine {\n constructor(prop, propFunc, func, begin, finish, duration, yoyo) {\n this.prop = prop;\n this.propFunc = propFunc;\n this.begin = begin;\n this._pos = begin;\n this.duration = duration;\n this._change = 0;\n this.prevPos = 0;\n this.yoyo = yoyo;\n this._time = 0;\n this._position = 0;\n this._startTime = 0;\n this._finish = 0;\n this.func = func;\n this._change = finish - this.begin;\n this.pause();\n }\n fire(str) {\n var handler = this[str];\n if (handler) {\n handler();\n }\n }\n setTime(t) {\n if (t > this.duration) {\n if (this.yoyo) {\n this._time = this.duration;\n this.reverse();\n }\n else {\n this.finish();\n }\n }\n else if (t < 0) {\n if (this.yoyo) {\n this._time = 0;\n this.play();\n }\n else {\n this.reset();\n }\n }\n else {\n this._time = t;\n this.update();\n }\n }\n getTime() {\n return this._time;\n }\n setPosition(p) {\n this.prevPos = this._pos;\n this.propFunc(p);\n this._pos = p;\n }\n getPosition(t) {\n if (t === undefined) {\n t = this._time;\n }\n return this.func(t, this.begin, this._change, this.duration);\n }\n play() {\n this.state = PLAYING;\n this._startTime = this.getTimer() - this._time;\n this.onEnterFrame();\n this.fire('onPlay');\n }\n reverse() {\n this.state = REVERSING;\n this._time = this.duration - this._time;\n this._startTime = this.getTimer() - this._time;\n this.onEnterFrame();\n this.fire('onReverse');\n }\n seek(t) {\n this.pause();\n this._time = t;\n this.update();\n this.fire('onSeek');\n }\n reset() {\n this.pause();\n this._time = 0;\n this.update();\n this.fire('onReset');\n }\n finish() {\n this.pause();\n this._time = this.duration;\n this.update();\n this.fire('onFinish');\n }\n update() {\n this.setPosition(this.getPosition(this._time));\n this.fire('onUpdate');\n }\n onEnterFrame() {\n var t = this.getTimer() - this._startTime;\n if (this.state === PLAYING) {\n this.setTime(t);\n }\n else if (this.state === REVERSING) {\n this.setTime(this.duration - t);\n }\n }\n pause() {\n this.state = PAUSED;\n this.fire('onPause');\n }\n getTimer() {\n return new Date().getTime();\n }\n}\nclass Tween {\n constructor(config) {\n var that = this, node = config.node, nodeId = node._id, duration, easing = config.easing || exports.Easings.Linear, yoyo = !!config.yoyo, key;\n if (typeof config.duration === 'undefined') {\n duration = 0.3;\n }\n else if (config.duration === 0) {\n duration = 0.001;\n }\n else {\n duration = config.duration;\n }\n this.node = node;\n this._id = idCounter++;\n var layers = node.getLayer() ||\n (node instanceof Global_1.Konva['Stage'] ? node.getLayers() : null);\n if (!layers) {\n Util_1.Util.error('Tween constructor have `node` that is not in a layer. Please add node into layer first.');\n }\n this.anim = new Animation_1.Animation(function () {\n that.tween.onEnterFrame();\n }, layers);\n this.tween = new TweenEngine(key, function (i) {\n that._tweenFunc(i);\n }, easing, 0, 1, duration * 1000, yoyo);\n this._addListeners();\n if (!Tween.attrs[nodeId]) {\n Tween.attrs[nodeId] = {};\n }\n if (!Tween.attrs[nodeId][this._id]) {\n Tween.attrs[nodeId][this._id] = {};\n }\n if (!Tween.tweens[nodeId]) {\n Tween.tweens[nodeId] = {};\n }\n for (key in config) {\n if (blacklist[key] === undefined) {\n this._addAttr(key, config[key]);\n }\n }\n this.reset();\n this.onFinish = config.onFinish;\n this.onReset = config.onReset;\n this.onUpdate = config.onUpdate;\n }\n _addAttr(key, end) {\n var node = this.node, nodeId = node._id, start, diff, tweenId, n, len, trueEnd, trueStart, endRGBA;\n tweenId = Tween.tweens[nodeId][key];\n if (tweenId) {\n delete Tween.attrs[nodeId][tweenId][key];\n }\n start = node.getAttr(key);\n if (Util_1.Util._isArray(end)) {\n diff = [];\n len = Math.max(end.length, start.length);\n if (key === 'points' && end.length !== start.length) {\n if (end.length > start.length) {\n trueStart = start;\n start = Util_1.Util._prepareArrayForTween(start, end, node.closed());\n }\n else {\n trueEnd = end;\n end = Util_1.Util._prepareArrayForTween(end, start, node.closed());\n }\n }\n if (key.indexOf('fill') === 0) {\n for (n = 0; n < len; n++) {\n if (n % 2 === 0) {\n diff.push(end[n] - start[n]);\n }\n else {\n var startRGBA = Util_1.Util.colorToRGBA(start[n]);\n endRGBA = Util_1.Util.colorToRGBA(end[n]);\n start[n] = startRGBA;\n diff.push({\n r: endRGBA.r - startRGBA.r,\n g: endRGBA.g - startRGBA.g,\n b: endRGBA.b - startRGBA.b,\n a: endRGBA.a - startRGBA.a,\n });\n }\n }\n }\n else {\n for (n = 0; n < len; n++) {\n diff.push(end[n] - start[n]);\n }\n }\n }\n else if (colorAttrs.indexOf(key) !== -1) {\n start = Util_1.Util.colorToRGBA(start);\n endRGBA = Util_1.Util.colorToRGBA(end);\n diff = {\n r: endRGBA.r - start.r,\n g: endRGBA.g - start.g,\n b: endRGBA.b - start.b,\n a: endRGBA.a - start.a,\n };\n }\n else {\n diff = end - start;\n }\n Tween.attrs[nodeId][this._id][key] = {\n start: start,\n diff: diff,\n end: end,\n trueEnd: trueEnd,\n trueStart: trueStart,\n };\n Tween.tweens[nodeId][key] = this._id;\n }\n _tweenFunc(i) {\n var node = this.node, attrs = Tween.attrs[node._id][this._id], key, attr, start, diff, newVal, n, len, end;\n for (key in attrs) {\n attr = attrs[key];\n start = attr.start;\n diff = attr.diff;\n end = attr.end;\n if (Util_1.Util._isArray(start)) {\n newVal = [];\n len = Math.max(start.length, end.length);\n if (key.indexOf('fill') === 0) {\n for (n = 0; n < len; n++) {\n if (n % 2 === 0) {\n newVal.push((start[n] || 0) + diff[n] * i);\n }\n else {\n newVal.push('rgba(' +\n Math.round(start[n].r + diff[n].r * i) +\n ',' +\n Math.round(start[n].g + diff[n].g * i) +\n ',' +\n Math.round(start[n].b + diff[n].b * i) +\n ',' +\n (start[n].a + diff[n].a * i) +\n ')');\n }\n }\n }\n else {\n for (n = 0; n < len; n++) {\n newVal.push((start[n] || 0) + diff[n] * i);\n }\n }\n }\n else if (colorAttrs.indexOf(key) !== -1) {\n newVal =\n 'rgba(' +\n Math.round(start.r + diff.r * i) +\n ',' +\n Math.round(start.g + diff.g * i) +\n ',' +\n Math.round(start.b + diff.b * i) +\n ',' +\n (start.a + diff.a * i) +\n ')';\n }\n else {\n newVal = start + diff * i;\n }\n node.setAttr(key, newVal);\n }\n }\n _addListeners() {\n this.tween.onPlay = () => {\n this.anim.start();\n };\n this.tween.onReverse = () => {\n this.anim.start();\n };\n this.tween.onPause = () => {\n this.anim.stop();\n };\n this.tween.onFinish = () => {\n var node = this.node;\n var attrs = Tween.attrs[node._id][this._id];\n if (attrs.points && attrs.points.trueEnd) {\n node.setAttr('points', attrs.points.trueEnd);\n }\n if (this.onFinish) {\n this.onFinish.call(this);\n }\n };\n this.tween.onReset = () => {\n var node = this.node;\n var attrs = Tween.attrs[node._id][this._id];\n if (attrs.points && attrs.points.trueStart) {\n node.points(attrs.points.trueStart);\n }\n if (this.onReset) {\n this.onReset();\n }\n };\n this.tween.onUpdate = () => {\n if (this.onUpdate) {\n this.onUpdate.call(this);\n }\n };\n }\n play() {\n this.tween.play();\n return this;\n }\n reverse() {\n this.tween.reverse();\n return this;\n }\n reset() {\n this.tween.reset();\n return this;\n }\n seek(t) {\n this.tween.seek(t * 1000);\n return this;\n }\n pause() {\n this.tween.pause();\n return this;\n }\n finish() {\n this.tween.finish();\n return this;\n }\n destroy() {\n var nodeId = this.node._id, thisId = this._id, attrs = Tween.tweens[nodeId], key;\n this.pause();\n for (key in attrs) {\n delete Tween.tweens[nodeId][key];\n }\n delete Tween.attrs[nodeId][thisId];\n }\n}\nexports.Tween = Tween;\nTween.attrs = {};\nTween.tweens = {};\nNode_1.Node.prototype.to = function (params) {\n var onFinish = params.onFinish;\n params.node = this;\n params.onFinish = function () {\n this.destroy();\n if (onFinish) {\n onFinish();\n }\n };\n var tween = new Tween(params);\n tween.play();\n};\nexports.Easings = {\n BackEaseIn(t, b, c, d) {\n var s = 1.70158;\n return c * (t /= d) * t * ((s + 1) * t - s) + b;\n },\n BackEaseOut(t, b, c, d) {\n var s = 1.70158;\n return c * ((t = t / d - 1) * t * ((s + 1) * t + s) + 1) + b;\n },\n BackEaseInOut(t, b, c, d) {\n var s = 1.70158;\n if ((t /= d / 2) < 1) {\n return (c / 2) * (t * t * (((s *= 1.525) + 1) * t - s)) + b;\n }\n return (c / 2) * ((t -= 2) * t * (((s *= 1.525) + 1) * t + s) + 2) + b;\n },\n ElasticEaseIn(t, b, c, d, a, p) {\n var s = 0;\n if (t === 0) {\n return b;\n }\n if ((t /= d) === 1) {\n return b + c;\n }\n if (!p) {\n p = d * 0.3;\n }\n if (!a || a < Math.abs(c)) {\n a = c;\n s = p / 4;\n }\n else {\n s = (p / (2 * Math.PI)) * Math.asin(c / a);\n }\n return (-(a *\n Math.pow(2, 10 * (t -= 1)) *\n Math.sin(((t * d - s) * (2 * Math.PI)) / p)) + b);\n },\n ElasticEaseOut(t, b, c, d, a, p) {\n var s = 0;\n if (t === 0) {\n return b;\n }\n if ((t /= d) === 1) {\n return b + c;\n }\n if (!p) {\n p = d * 0.3;\n }\n if (!a || a < Math.abs(c)) {\n a = c;\n s = p / 4;\n }\n else {\n s = (p / (2 * Math.PI)) * Math.asin(c / a);\n }\n return (a * Math.pow(2, -10 * t) * Math.sin(((t * d - s) * (2 * Math.PI)) / p) +\n c +\n b);\n },\n ElasticEaseInOut(t, b, c, d, a, p) {\n var s = 0;\n if (t === 0) {\n return b;\n }\n if ((t /= d / 2) === 2) {\n return b + c;\n }\n if (!p) {\n p = d * (0.3 * 1.5);\n }\n if (!a || a < Math.abs(c)) {\n a = c;\n s = p / 4;\n }\n else {\n s = (p / (2 * Math.PI)) * Math.asin(c / a);\n }\n if (t < 1) {\n return (-0.5 *\n (a *\n Math.pow(2, 10 * (t -= 1)) *\n Math.sin(((t * d - s) * (2 * Math.PI)) / p)) +\n b);\n }\n return (a *\n Math.pow(2, -10 * (t -= 1)) *\n Math.sin(((t * d - s) * (2 * Math.PI)) / p) *\n 0.5 +\n c +\n b);\n },\n BounceEaseOut(t, b, c, d) {\n if ((t /= d) < 1 / 2.75) {\n return c * (7.5625 * t * t) + b;\n }\n else if (t < 2 / 2.75) {\n return c * (7.5625 * (t -= 1.5 / 2.75) * t + 0.75) + b;\n }\n else if (t < 2.5 / 2.75) {\n return c * (7.5625 * (t -= 2.25 / 2.75) * t + 0.9375) + b;\n }\n else {\n return c * (7.5625 * (t -= 2.625 / 2.75) * t + 0.984375) + b;\n }\n },\n BounceEaseIn(t, b, c, d) {\n return c - exports.Easings.BounceEaseOut(d - t, 0, c, d) + b;\n },\n BounceEaseInOut(t, b, c, d) {\n if (t < d / 2) {\n return exports.Easings.BounceEaseIn(t * 2, 0, c, d) * 0.5 + b;\n }\n else {\n return exports.Easings.BounceEaseOut(t * 2 - d, 0, c, d) * 0.5 + c * 0.5 + b;\n }\n },\n EaseIn(t, b, c, d) {\n return c * (t /= d) * t + b;\n },\n EaseOut(t, b, c, d) {\n return -c * (t /= d) * (t - 2) + b;\n },\n EaseInOut(t, b, c, d) {\n if ((t /= d / 2) < 1) {\n return (c / 2) * t * t + b;\n }\n return (-c / 2) * (--t * (t - 2) - 1) + b;\n },\n StrongEaseIn(t, b, c, d) {\n return c * (t /= d) * t * t * t * t + b;\n },\n StrongEaseOut(t, b, c, d) {\n return c * ((t = t / d - 1) * t * t * t * t + 1) + b;\n },\n StrongEaseInOut(t, b, c, d) {\n if ((t /= d / 2) < 1) {\n return (c / 2) * t * t * t * t * t + b;\n }\n return (c / 2) * ((t -= 2) * t * t * t * t + 2) + b;\n },\n Linear(t, b, c, d) {\n return (c * t) / d + b;\n },\n};\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Konva = void 0;\nconst Global_1 = require(\"./Global\");\nconst Util_1 = require(\"./Util\");\nconst Node_1 = require(\"./Node\");\nconst Container_1 = require(\"./Container\");\nconst Stage_1 = require(\"./Stage\");\nconst Layer_1 = require(\"./Layer\");\nconst FastLayer_1 = require(\"./FastLayer\");\nconst Group_1 = require(\"./Group\");\nconst DragAndDrop_1 = require(\"./DragAndDrop\");\nconst Shape_1 = require(\"./Shape\");\nconst Animation_1 = require(\"./Animation\");\nconst Tween_1 = require(\"./Tween\");\nconst Context_1 = require(\"./Context\");\nconst Canvas_1 = require(\"./Canvas\");\nexports.Konva = Util_1.Util._assign(Global_1.Konva, {\n Util: Util_1.Util,\n Transform: Util_1.Transform,\n Node: Node_1.Node,\n Container: Container_1.Container,\n Stage: Stage_1.Stage,\n stages: Stage_1.stages,\n Layer: Layer_1.Layer,\n FastLayer: FastLayer_1.FastLayer,\n Group: Group_1.Group,\n DD: DragAndDrop_1.DD,\n Shape: Shape_1.Shape,\n shapes: Shape_1.shapes,\n Animation: Animation_1.Animation,\n Tween: Tween_1.Tween,\n Easings: Tween_1.Easings,\n Context: Context_1.Context,\n Canvas: Canvas_1.Canvas,\n});\nexports.default = exports.Konva;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Arc = void 0;\nconst Factory_1 = require(\"../Factory\");\nconst Shape_1 = require(\"../Shape\");\nconst Global_1 = require(\"../Global\");\nconst Validators_1 = require(\"../Validators\");\nconst Global_2 = require(\"../Global\");\nclass Arc extends Shape_1.Shape {\n _sceneFunc(context) {\n var angle = Global_1.Konva.getAngle(this.angle()), clockwise = this.clockwise();\n context.beginPath();\n context.arc(0, 0, this.outerRadius(), 0, angle, clockwise);\n context.arc(0, 0, this.innerRadius(), angle, 0, !clockwise);\n context.closePath();\n context.fillStrokeShape(this);\n }\n getWidth() {\n return this.outerRadius() * 2;\n }\n getHeight() {\n return this.outerRadius() * 2;\n }\n setWidth(width) {\n this.outerRadius(width / 2);\n }\n setHeight(height) {\n this.outerRadius(height / 2);\n }\n getSelfRect() {\n const innerRadius = this.innerRadius();\n const outerRadius = this.outerRadius();\n const clockwise = this.clockwise();\n const angle = Global_1.Konva.getAngle(clockwise ? 360 - this.angle() : this.angle());\n const boundLeftRatio = Math.cos(Math.min(angle, Math.PI));\n const boundRightRatio = 1;\n const boundTopRatio = Math.sin(Math.min(Math.max(Math.PI, angle), (3 * Math.PI) / 2));\n const boundBottomRatio = Math.sin(Math.min(angle, Math.PI / 2));\n const boundLeft = boundLeftRatio * (boundLeftRatio > 0 ? innerRadius : outerRadius);\n const boundRight = boundRightRatio * (boundRightRatio > 0 ? outerRadius : innerRadius);\n const boundTop = boundTopRatio * (boundTopRatio > 0 ? innerRadius : outerRadius);\n const boundBottom = boundBottomRatio * (boundBottomRatio > 0 ? outerRadius : innerRadius);\n return {\n x: boundLeft,\n y: clockwise ? -1 * boundBottom : boundTop,\n width: boundRight - boundLeft,\n height: boundBottom - boundTop,\n };\n }\n}\nexports.Arc = Arc;\nArc.prototype._centroid = true;\nArc.prototype.className = 'Arc';\nArc.prototype._attrsAffectingSize = ['innerRadius', 'outerRadius'];\n(0, Global_2._registerNode)(Arc);\nFactory_1.Factory.addGetterSetter(Arc, 'innerRadius', 0, (0, Validators_1.getNumberValidator)());\nFactory_1.Factory.addGetterSetter(Arc, 'outerRadius', 0, (0, Validators_1.getNumberValidator)());\nFactory_1.Factory.addGetterSetter(Arc, 'angle', 0, (0, Validators_1.getNumberValidator)());\nFactory_1.Factory.addGetterSetter(Arc, 'clockwise', false, (0, Validators_1.getBooleanValidator)());\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Line = void 0;\nconst Factory_1 = require(\"../Factory\");\nconst Shape_1 = require(\"../Shape\");\nconst Validators_1 = require(\"../Validators\");\nconst Global_1 = require(\"../Global\");\nfunction getControlPoints(x0, y0, x1, y1, x2, y2, t) {\n var d01 = Math.sqrt(Math.pow(x1 - x0, 2) + Math.pow(y1 - y0, 2)), d12 = Math.sqrt(Math.pow(x2 - x1, 2) + Math.pow(y2 - y1, 2)), fa = (t * d01) / (d01 + d12), fb = (t * d12) / (d01 + d12), p1x = x1 - fa * (x2 - x0), p1y = y1 - fa * (y2 - y0), p2x = x1 + fb * (x2 - x0), p2y = y1 + fb * (y2 - y0);\n return [p1x, p1y, p2x, p2y];\n}\nfunction expandPoints(p, tension) {\n var len = p.length, allPoints = [], n, cp;\n for (n = 2; n < len - 2; n += 2) {\n cp = getControlPoints(p[n - 2], p[n - 1], p[n], p[n + 1], p[n + 2], p[n + 3], tension);\n if (isNaN(cp[0])) {\n continue;\n }\n allPoints.push(cp[0]);\n allPoints.push(cp[1]);\n allPoints.push(p[n]);\n allPoints.push(p[n + 1]);\n allPoints.push(cp[2]);\n allPoints.push(cp[3]);\n }\n return allPoints;\n}\nclass Line extends Shape_1.Shape {\n constructor(config) {\n super(config);\n this.on('pointsChange.konva tensionChange.konva closedChange.konva bezierChange.konva', function () {\n this._clearCache('tensionPoints');\n });\n }\n _sceneFunc(context) {\n var points = this.points(), length = points.length, tension = this.tension(), closed = this.closed(), bezier = this.bezier(), tp, len, n;\n if (!length) {\n return;\n }\n context.beginPath();\n context.moveTo(points[0], points[1]);\n if (tension !== 0 && length > 4) {\n tp = this.getTensionPoints();\n len = tp.length;\n n = closed ? 0 : 4;\n if (!closed) {\n context.quadraticCurveTo(tp[0], tp[1], tp[2], tp[3]);\n }\n while (n < len - 2) {\n context.bezierCurveTo(tp[n++], tp[n++], tp[n++], tp[n++], tp[n++], tp[n++]);\n }\n if (!closed) {\n context.quadraticCurveTo(tp[len - 2], tp[len - 1], points[length - 2], points[length - 1]);\n }\n }\n else if (bezier) {\n n = 2;\n while (n < length) {\n context.bezierCurveTo(points[n++], points[n++], points[n++], points[n++], points[n++], points[n++]);\n }\n }\n else {\n for (n = 2; n < length; n += 2) {\n context.lineTo(points[n], points[n + 1]);\n }\n }\n if (closed) {\n context.closePath();\n context.fillStrokeShape(this);\n }\n else {\n context.strokeShape(this);\n }\n }\n getTensionPoints() {\n return this._getCache('tensionPoints', this._getTensionPoints);\n }\n _getTensionPoints() {\n if (this.closed()) {\n return this._getTensionPointsClosed();\n }\n else {\n return expandPoints(this.points(), this.tension());\n }\n }\n _getTensionPointsClosed() {\n var p = this.points(), len = p.length, tension = this.tension(), firstControlPoints = getControlPoints(p[len - 2], p[len - 1], p[0], p[1], p[2], p[3], tension), lastControlPoints = getControlPoints(p[len - 4], p[len - 3], p[len - 2], p[len - 1], p[0], p[1], tension), middle = expandPoints(p, tension), tp = [firstControlPoints[2], firstControlPoints[3]]\n .concat(middle)\n .concat([\n lastControlPoints[0],\n lastControlPoints[1],\n p[len - 2],\n p[len - 1],\n lastControlPoints[2],\n lastControlPoints[3],\n firstControlPoints[0],\n firstControlPoints[1],\n p[0],\n p[1],\n ]);\n return tp;\n }\n getWidth() {\n return this.getSelfRect().width;\n }\n getHeight() {\n return this.getSelfRect().height;\n }\n getSelfRect() {\n var points = this.points();\n if (points.length < 4) {\n return {\n x: points[0] || 0,\n y: points[1] || 0,\n width: 0,\n height: 0,\n };\n }\n if (this.tension() !== 0) {\n points = [\n points[0],\n points[1],\n ...this._getTensionPoints(),\n points[points.length - 2],\n points[points.length - 1],\n ];\n }\n else {\n points = this.points();\n }\n var minX = points[0];\n var maxX = points[0];\n var minY = points[1];\n var maxY = points[1];\n var x, y;\n for (var i = 0; i < points.length / 2; i++) {\n x = points[i * 2];\n y = points[i * 2 + 1];\n minX = Math.min(minX, x);\n maxX = Math.max(maxX, x);\n minY = Math.min(minY, y);\n maxY = Math.max(maxY, y);\n }\n return {\n x: minX,\n y: minY,\n width: maxX - minX,\n height: maxY - minY,\n };\n }\n}\nexports.Line = Line;\nLine.prototype.className = 'Line';\nLine.prototype._attrsAffectingSize = ['points', 'bezier', 'tension'];\n(0, Global_1._registerNode)(Line);\nFactory_1.Factory.addGetterSetter(Line, 'closed', false);\nFactory_1.Factory.addGetterSetter(Line, 'bezier', false);\nFactory_1.Factory.addGetterSetter(Line, 'tension', 0, (0, Validators_1.getNumberValidator)());\nFactory_1.Factory.addGetterSetter(Line, 'points', [], (0, Validators_1.getNumberArrayValidator)());\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.t2length = exports.getQuadraticArcLength = exports.getCubicArcLength = exports.binomialCoefficients = exports.cValues = exports.tValues = void 0;\nexports.tValues = [\n [],\n [],\n [\n -0.5773502691896257645091487805019574556476,\n 0.5773502691896257645091487805019574556476,\n ],\n [\n 0, -0.7745966692414833770358530799564799221665,\n 0.7745966692414833770358530799564799221665,\n ],\n [\n -0.3399810435848562648026657591032446872005,\n 0.3399810435848562648026657591032446872005,\n -0.8611363115940525752239464888928095050957,\n 0.8611363115940525752239464888928095050957,\n ],\n [\n 0, -0.5384693101056830910363144207002088049672,\n 0.5384693101056830910363144207002088049672,\n -0.9061798459386639927976268782993929651256,\n 0.9061798459386639927976268782993929651256,\n ],\n [\n 0.6612093864662645136613995950199053470064,\n -0.6612093864662645136613995950199053470064,\n -0.2386191860831969086305017216807119354186,\n 0.2386191860831969086305017216807119354186,\n -0.9324695142031520278123015544939946091347,\n 0.9324695142031520278123015544939946091347,\n ],\n [\n 0, 0.4058451513773971669066064120769614633473,\n -0.4058451513773971669066064120769614633473,\n -0.7415311855993944398638647732807884070741,\n 0.7415311855993944398638647732807884070741,\n -0.9491079123427585245261896840478512624007,\n 0.9491079123427585245261896840478512624007,\n ],\n [\n -0.1834346424956498049394761423601839806667,\n 0.1834346424956498049394761423601839806667,\n -0.5255324099163289858177390491892463490419,\n 0.5255324099163289858177390491892463490419,\n -0.7966664774136267395915539364758304368371,\n 0.7966664774136267395915539364758304368371,\n -0.9602898564975362316835608685694729904282,\n 0.9602898564975362316835608685694729904282,\n ],\n [\n 0, -0.8360311073266357942994297880697348765441,\n 0.8360311073266357942994297880697348765441,\n -0.9681602395076260898355762029036728700494,\n 0.9681602395076260898355762029036728700494,\n -0.3242534234038089290385380146433366085719,\n 0.3242534234038089290385380146433366085719,\n -0.6133714327005903973087020393414741847857,\n 0.6133714327005903973087020393414741847857,\n ],\n [\n -0.1488743389816312108848260011297199846175,\n 0.1488743389816312108848260011297199846175,\n -0.4333953941292471907992659431657841622,\n 0.4333953941292471907992659431657841622,\n -0.6794095682990244062343273651148735757692,\n 0.6794095682990244062343273651148735757692,\n -0.8650633666889845107320966884234930485275,\n 0.8650633666889845107320966884234930485275,\n -0.9739065285171717200779640120844520534282,\n 0.9739065285171717200779640120844520534282,\n ],\n [\n 0, -0.2695431559523449723315319854008615246796,\n 0.2695431559523449723315319854008615246796,\n -0.5190961292068118159257256694586095544802,\n 0.5190961292068118159257256694586095544802,\n -0.7301520055740493240934162520311534580496,\n 0.7301520055740493240934162520311534580496,\n -0.8870625997680952990751577693039272666316,\n 0.8870625997680952990751577693039272666316,\n -0.9782286581460569928039380011228573907714,\n 0.9782286581460569928039380011228573907714,\n ],\n [\n -0.1252334085114689154724413694638531299833,\n 0.1252334085114689154724413694638531299833,\n -0.3678314989981801937526915366437175612563,\n 0.3678314989981801937526915366437175612563,\n -0.587317954286617447296702418940534280369,\n 0.587317954286617447296702418940534280369,\n -0.7699026741943046870368938332128180759849,\n 0.7699026741943046870368938332128180759849,\n -0.9041172563704748566784658661190961925375,\n 0.9041172563704748566784658661190961925375,\n -0.9815606342467192506905490901492808229601,\n 0.9815606342467192506905490901492808229601,\n ],\n [\n 0, -0.2304583159551347940655281210979888352115,\n 0.2304583159551347940655281210979888352115,\n -0.4484927510364468528779128521276398678019,\n 0.4484927510364468528779128521276398678019,\n -0.6423493394403402206439846069955156500716,\n 0.6423493394403402206439846069955156500716,\n -0.8015780907333099127942064895828598903056,\n 0.8015780907333099127942064895828598903056,\n -0.9175983992229779652065478365007195123904,\n 0.9175983992229779652065478365007195123904,\n -0.9841830547185881494728294488071096110649,\n 0.9841830547185881494728294488071096110649,\n ],\n [\n -0.1080549487073436620662446502198347476119,\n 0.1080549487073436620662446502198347476119,\n -0.3191123689278897604356718241684754668342,\n 0.3191123689278897604356718241684754668342,\n -0.5152486363581540919652907185511886623088,\n 0.5152486363581540919652907185511886623088,\n -0.6872929048116854701480198030193341375384,\n 0.6872929048116854701480198030193341375384,\n -0.8272013150697649931897947426503949610397,\n 0.8272013150697649931897947426503949610397,\n -0.928434883663573517336391139377874264477,\n 0.928434883663573517336391139377874264477,\n -0.986283808696812338841597266704052801676,\n 0.986283808696812338841597266704052801676,\n ],\n [\n 0, -0.2011940939974345223006283033945962078128,\n 0.2011940939974345223006283033945962078128,\n -0.3941513470775633698972073709810454683627,\n 0.3941513470775633698972073709810454683627,\n -0.5709721726085388475372267372539106412383,\n 0.5709721726085388475372267372539106412383,\n -0.7244177313601700474161860546139380096308,\n 0.7244177313601700474161860546139380096308,\n -0.8482065834104272162006483207742168513662,\n 0.8482065834104272162006483207742168513662,\n -0.9372733924007059043077589477102094712439,\n 0.9372733924007059043077589477102094712439,\n -0.9879925180204854284895657185866125811469,\n 0.9879925180204854284895657185866125811469,\n ],\n [\n -0.0950125098376374401853193354249580631303,\n 0.0950125098376374401853193354249580631303,\n -0.281603550779258913230460501460496106486,\n 0.281603550779258913230460501460496106486,\n -0.45801677765722738634241944298357757354,\n 0.45801677765722738634241944298357757354,\n -0.6178762444026437484466717640487910189918,\n 0.6178762444026437484466717640487910189918,\n -0.7554044083550030338951011948474422683538,\n 0.7554044083550030338951011948474422683538,\n -0.8656312023878317438804678977123931323873,\n 0.8656312023878317438804678977123931323873,\n -0.9445750230732325760779884155346083450911,\n 0.9445750230732325760779884155346083450911,\n -0.9894009349916499325961541734503326274262,\n 0.9894009349916499325961541734503326274262,\n ],\n [\n 0, -0.1784841814958478558506774936540655574754,\n 0.1784841814958478558506774936540655574754,\n -0.3512317634538763152971855170953460050405,\n 0.3512317634538763152971855170953460050405,\n -0.5126905370864769678862465686295518745829,\n 0.5126905370864769678862465686295518745829,\n -0.6576711592166907658503022166430023351478,\n 0.6576711592166907658503022166430023351478,\n -0.7815140038968014069252300555204760502239,\n 0.7815140038968014069252300555204760502239,\n -0.8802391537269859021229556944881556926234,\n 0.8802391537269859021229556944881556926234,\n -0.9506755217687677612227169578958030214433,\n 0.9506755217687677612227169578958030214433,\n -0.9905754753144173356754340199406652765077,\n 0.9905754753144173356754340199406652765077,\n ],\n [\n -0.0847750130417353012422618529357838117333,\n 0.0847750130417353012422618529357838117333,\n -0.2518862256915055095889728548779112301628,\n 0.2518862256915055095889728548779112301628,\n -0.4117511614628426460359317938330516370789,\n 0.4117511614628426460359317938330516370789,\n -0.5597708310739475346078715485253291369276,\n 0.5597708310739475346078715485253291369276,\n -0.6916870430603532078748910812888483894522,\n 0.6916870430603532078748910812888483894522,\n -0.8037049589725231156824174550145907971032,\n 0.8037049589725231156824174550145907971032,\n -0.8926024664975557392060605911271455154078,\n 0.8926024664975557392060605911271455154078,\n -0.9558239495713977551811958929297763099728,\n 0.9558239495713977551811958929297763099728,\n -0.9915651684209309467300160047061507702525,\n 0.9915651684209309467300160047061507702525,\n ],\n [\n 0, -0.1603586456402253758680961157407435495048,\n 0.1603586456402253758680961157407435495048,\n -0.3165640999636298319901173288498449178922,\n 0.3165640999636298319901173288498449178922,\n -0.4645707413759609457172671481041023679762,\n 0.4645707413759609457172671481041023679762,\n -0.6005453046616810234696381649462392798683,\n 0.6005453046616810234696381649462392798683,\n -0.7209661773352293786170958608237816296571,\n 0.7209661773352293786170958608237816296571,\n -0.8227146565371428249789224867127139017745,\n 0.8227146565371428249789224867127139017745,\n -0.9031559036148179016426609285323124878093,\n 0.9031559036148179016426609285323124878093,\n -0.960208152134830030852778840687651526615,\n 0.960208152134830030852778840687651526615,\n -0.9924068438435844031890176702532604935893,\n 0.9924068438435844031890176702532604935893,\n ],\n [\n -0.0765265211334973337546404093988382110047,\n 0.0765265211334973337546404093988382110047,\n -0.227785851141645078080496195368574624743,\n 0.227785851141645078080496195368574624743,\n -0.3737060887154195606725481770249272373957,\n 0.3737060887154195606725481770249272373957,\n -0.5108670019508270980043640509552509984254,\n 0.5108670019508270980043640509552509984254,\n -0.6360536807265150254528366962262859367433,\n 0.6360536807265150254528366962262859367433,\n -0.7463319064601507926143050703556415903107,\n 0.7463319064601507926143050703556415903107,\n -0.8391169718222188233945290617015206853296,\n 0.8391169718222188233945290617015206853296,\n -0.9122344282513259058677524412032981130491,\n 0.9122344282513259058677524412032981130491,\n -0.963971927277913791267666131197277221912,\n 0.963971927277913791267666131197277221912,\n -0.9931285991850949247861223884713202782226,\n 0.9931285991850949247861223884713202782226,\n ],\n [\n 0, -0.1455618541608950909370309823386863301163,\n 0.1455618541608950909370309823386863301163,\n -0.288021316802401096600792516064600319909,\n 0.288021316802401096600792516064600319909,\n -0.4243421202074387835736688885437880520964,\n 0.4243421202074387835736688885437880520964,\n -0.551618835887219807059018796724313286622,\n 0.551618835887219807059018796724313286622,\n -0.667138804197412319305966669990339162597,\n 0.667138804197412319305966669990339162597,\n -0.7684399634756779086158778513062280348209,\n 0.7684399634756779086158778513062280348209,\n -0.8533633645833172836472506385875676702761,\n 0.8533633645833172836472506385875676702761,\n -0.9200993341504008287901871337149688941591,\n 0.9200993341504008287901871337149688941591,\n -0.9672268385663062943166222149076951614246,\n 0.9672268385663062943166222149076951614246,\n -0.9937521706203895002602420359379409291933,\n 0.9937521706203895002602420359379409291933,\n ],\n [\n -0.0697392733197222212138417961186280818222,\n 0.0697392733197222212138417961186280818222,\n -0.2078604266882212854788465339195457342156,\n 0.2078604266882212854788465339195457342156,\n -0.3419358208920842251581474204273796195591,\n 0.3419358208920842251581474204273796195591,\n -0.4693558379867570264063307109664063460953,\n 0.4693558379867570264063307109664063460953,\n -0.5876404035069115929588769276386473488776,\n 0.5876404035069115929588769276386473488776,\n -0.6944872631866827800506898357622567712673,\n 0.6944872631866827800506898357622567712673,\n -0.7878168059792081620042779554083515213881,\n 0.7878168059792081620042779554083515213881,\n -0.8658125777203001365364256370193787290847,\n 0.8658125777203001365364256370193787290847,\n -0.9269567721871740005206929392590531966353,\n 0.9269567721871740005206929392590531966353,\n -0.9700604978354287271239509867652687108059,\n 0.9700604978354287271239509867652687108059,\n -0.994294585482399292073031421161298980393,\n 0.994294585482399292073031421161298980393,\n ],\n [\n 0, -0.1332568242984661109317426822417661370104,\n 0.1332568242984661109317426822417661370104,\n -0.264135680970344930533869538283309602979,\n 0.264135680970344930533869538283309602979,\n -0.390301038030290831421488872880605458578,\n 0.390301038030290831421488872880605458578,\n -0.5095014778460075496897930478668464305448,\n 0.5095014778460075496897930478668464305448,\n -0.6196098757636461563850973116495956533871,\n 0.6196098757636461563850973116495956533871,\n -0.7186613631319501944616244837486188483299,\n 0.7186613631319501944616244837486188483299,\n -0.8048884016188398921511184069967785579414,\n 0.8048884016188398921511184069967785579414,\n -0.8767523582704416673781568859341456716389,\n 0.8767523582704416673781568859341456716389,\n -0.9329710868260161023491969890384229782357,\n 0.9329710868260161023491969890384229782357,\n -0.9725424712181152319560240768207773751816,\n 0.9725424712181152319560240768207773751816,\n -0.9947693349975521235239257154455743605736,\n 0.9947693349975521235239257154455743605736,\n ],\n [\n -0.0640568928626056260850430826247450385909,\n 0.0640568928626056260850430826247450385909,\n -0.1911188674736163091586398207570696318404,\n 0.1911188674736163091586398207570696318404,\n -0.3150426796961633743867932913198102407864,\n 0.3150426796961633743867932913198102407864,\n -0.4337935076260451384870842319133497124524,\n 0.4337935076260451384870842319133497124524,\n -0.5454214713888395356583756172183723700107,\n 0.5454214713888395356583756172183723700107,\n -0.6480936519369755692524957869107476266696,\n 0.6480936519369755692524957869107476266696,\n -0.7401241915785543642438281030999784255232,\n 0.7401241915785543642438281030999784255232,\n -0.8200019859739029219539498726697452080761,\n 0.8200019859739029219539498726697452080761,\n -0.8864155270044010342131543419821967550873,\n 0.8864155270044010342131543419821967550873,\n -0.9382745520027327585236490017087214496548,\n 0.9382745520027327585236490017087214496548,\n -0.9747285559713094981983919930081690617411,\n 0.9747285559713094981983919930081690617411,\n -0.9951872199970213601799974097007368118745,\n 0.9951872199970213601799974097007368118745,\n ],\n];\nexports.cValues = [\n [],\n [],\n [1.0, 1.0],\n [\n 0.8888888888888888888888888888888888888888,\n 0.5555555555555555555555555555555555555555,\n 0.5555555555555555555555555555555555555555,\n ],\n [\n 0.6521451548625461426269360507780005927646,\n 0.6521451548625461426269360507780005927646,\n 0.3478548451374538573730639492219994072353,\n 0.3478548451374538573730639492219994072353,\n ],\n [\n 0.5688888888888888888888888888888888888888,\n 0.4786286704993664680412915148356381929122,\n 0.4786286704993664680412915148356381929122,\n 0.2369268850561890875142640407199173626432,\n 0.2369268850561890875142640407199173626432,\n ],\n [\n 0.3607615730481386075698335138377161116615,\n 0.3607615730481386075698335138377161116615,\n 0.4679139345726910473898703439895509948116,\n 0.4679139345726910473898703439895509948116,\n 0.1713244923791703450402961421727328935268,\n 0.1713244923791703450402961421727328935268,\n ],\n [\n 0.4179591836734693877551020408163265306122,\n 0.3818300505051189449503697754889751338783,\n 0.3818300505051189449503697754889751338783,\n 0.2797053914892766679014677714237795824869,\n 0.2797053914892766679014677714237795824869,\n 0.1294849661688696932706114326790820183285,\n 0.1294849661688696932706114326790820183285,\n ],\n [\n 0.3626837833783619829651504492771956121941,\n 0.3626837833783619829651504492771956121941,\n 0.3137066458778872873379622019866013132603,\n 0.3137066458778872873379622019866013132603,\n 0.2223810344533744705443559944262408844301,\n 0.2223810344533744705443559944262408844301,\n 0.1012285362903762591525313543099621901153,\n 0.1012285362903762591525313543099621901153,\n ],\n [\n 0.3302393550012597631645250692869740488788,\n 0.1806481606948574040584720312429128095143,\n 0.1806481606948574040584720312429128095143,\n 0.0812743883615744119718921581105236506756,\n 0.0812743883615744119718921581105236506756,\n 0.3123470770400028400686304065844436655987,\n 0.3123470770400028400686304065844436655987,\n 0.2606106964029354623187428694186328497718,\n 0.2606106964029354623187428694186328497718,\n ],\n [\n 0.295524224714752870173892994651338329421,\n 0.295524224714752870173892994651338329421,\n 0.2692667193099963550912269215694693528597,\n 0.2692667193099963550912269215694693528597,\n 0.2190863625159820439955349342281631924587,\n 0.2190863625159820439955349342281631924587,\n 0.1494513491505805931457763396576973324025,\n 0.1494513491505805931457763396576973324025,\n 0.0666713443086881375935688098933317928578,\n 0.0666713443086881375935688098933317928578,\n ],\n [\n 0.272925086777900630714483528336342189156,\n 0.2628045445102466621806888698905091953727,\n 0.2628045445102466621806888698905091953727,\n 0.2331937645919904799185237048431751394317,\n 0.2331937645919904799185237048431751394317,\n 0.1862902109277342514260976414316558916912,\n 0.1862902109277342514260976414316558916912,\n 0.1255803694649046246346942992239401001976,\n 0.1255803694649046246346942992239401001976,\n 0.0556685671161736664827537204425485787285,\n 0.0556685671161736664827537204425485787285,\n ],\n [\n 0.2491470458134027850005624360429512108304,\n 0.2491470458134027850005624360429512108304,\n 0.2334925365383548087608498989248780562594,\n 0.2334925365383548087608498989248780562594,\n 0.2031674267230659217490644558097983765065,\n 0.2031674267230659217490644558097983765065,\n 0.160078328543346226334652529543359071872,\n 0.160078328543346226334652529543359071872,\n 0.1069393259953184309602547181939962242145,\n 0.1069393259953184309602547181939962242145,\n 0.047175336386511827194615961485017060317,\n 0.047175336386511827194615961485017060317,\n ],\n [\n 0.2325515532308739101945895152688359481566,\n 0.2262831802628972384120901860397766184347,\n 0.2262831802628972384120901860397766184347,\n 0.2078160475368885023125232193060527633865,\n 0.2078160475368885023125232193060527633865,\n 0.1781459807619457382800466919960979955128,\n 0.1781459807619457382800466919960979955128,\n 0.1388735102197872384636017768688714676218,\n 0.1388735102197872384636017768688714676218,\n 0.0921214998377284479144217759537971209236,\n 0.0921214998377284479144217759537971209236,\n 0.0404840047653158795200215922009860600419,\n 0.0404840047653158795200215922009860600419,\n ],\n [\n 0.2152638534631577901958764433162600352749,\n 0.2152638534631577901958764433162600352749,\n 0.2051984637212956039659240656612180557103,\n 0.2051984637212956039659240656612180557103,\n 0.1855383974779378137417165901251570362489,\n 0.1855383974779378137417165901251570362489,\n 0.1572031671581935345696019386238421566056,\n 0.1572031671581935345696019386238421566056,\n 0.1215185706879031846894148090724766259566,\n 0.1215185706879031846894148090724766259566,\n 0.0801580871597602098056332770628543095836,\n 0.0801580871597602098056332770628543095836,\n 0.0351194603317518630318328761381917806197,\n 0.0351194603317518630318328761381917806197,\n ],\n [\n 0.2025782419255612728806201999675193148386,\n 0.1984314853271115764561183264438393248186,\n 0.1984314853271115764561183264438393248186,\n 0.1861610000155622110268005618664228245062,\n 0.1861610000155622110268005618664228245062,\n 0.1662692058169939335532008604812088111309,\n 0.1662692058169939335532008604812088111309,\n 0.1395706779261543144478047945110283225208,\n 0.1395706779261543144478047945110283225208,\n 0.1071592204671719350118695466858693034155,\n 0.1071592204671719350118695466858693034155,\n 0.0703660474881081247092674164506673384667,\n 0.0703660474881081247092674164506673384667,\n 0.0307532419961172683546283935772044177217,\n 0.0307532419961172683546283935772044177217,\n ],\n [\n 0.1894506104550684962853967232082831051469,\n 0.1894506104550684962853967232082831051469,\n 0.1826034150449235888667636679692199393835,\n 0.1826034150449235888667636679692199393835,\n 0.1691565193950025381893120790303599622116,\n 0.1691565193950025381893120790303599622116,\n 0.1495959888165767320815017305474785489704,\n 0.1495959888165767320815017305474785489704,\n 0.1246289712555338720524762821920164201448,\n 0.1246289712555338720524762821920164201448,\n 0.0951585116824927848099251076022462263552,\n 0.0951585116824927848099251076022462263552,\n 0.0622535239386478928628438369943776942749,\n 0.0622535239386478928628438369943776942749,\n 0.0271524594117540948517805724560181035122,\n 0.0271524594117540948517805724560181035122,\n ],\n [\n 0.1794464703562065254582656442618856214487,\n 0.1765627053669926463252709901131972391509,\n 0.1765627053669926463252709901131972391509,\n 0.1680041021564500445099706637883231550211,\n 0.1680041021564500445099706637883231550211,\n 0.1540457610768102880814315948019586119404,\n 0.1540457610768102880814315948019586119404,\n 0.1351363684685254732863199817023501973721,\n 0.1351363684685254732863199817023501973721,\n 0.1118838471934039710947883856263559267358,\n 0.1118838471934039710947883856263559267358,\n 0.0850361483171791808835353701910620738504,\n 0.0850361483171791808835353701910620738504,\n 0.0554595293739872011294401653582446605128,\n 0.0554595293739872011294401653582446605128,\n 0.0241483028685479319601100262875653246916,\n 0.0241483028685479319601100262875653246916,\n ],\n [\n 0.1691423829631435918406564701349866103341,\n 0.1691423829631435918406564701349866103341,\n 0.1642764837458327229860537764659275904123,\n 0.1642764837458327229860537764659275904123,\n 0.1546846751262652449254180038363747721932,\n 0.1546846751262652449254180038363747721932,\n 0.1406429146706506512047313037519472280955,\n 0.1406429146706506512047313037519472280955,\n 0.1225552067114784601845191268002015552281,\n 0.1225552067114784601845191268002015552281,\n 0.1009420441062871655628139849248346070628,\n 0.1009420441062871655628139849248346070628,\n 0.0764257302548890565291296776166365256053,\n 0.0764257302548890565291296776166365256053,\n 0.0497145488949697964533349462026386416808,\n 0.0497145488949697964533349462026386416808,\n 0.0216160135264833103133427102664524693876,\n 0.0216160135264833103133427102664524693876,\n ],\n [\n 0.1610544498487836959791636253209167350399,\n 0.1589688433939543476499564394650472016787,\n 0.1589688433939543476499564394650472016787,\n 0.152766042065859666778855400897662998461,\n 0.152766042065859666778855400897662998461,\n 0.1426067021736066117757461094419029724756,\n 0.1426067021736066117757461094419029724756,\n 0.1287539625393362276755157848568771170558,\n 0.1287539625393362276755157848568771170558,\n 0.1115666455473339947160239016817659974813,\n 0.1115666455473339947160239016817659974813,\n 0.0914900216224499994644620941238396526609,\n 0.0914900216224499994644620941238396526609,\n 0.0690445427376412265807082580060130449618,\n 0.0690445427376412265807082580060130449618,\n 0.0448142267656996003328381574019942119517,\n 0.0448142267656996003328381574019942119517,\n 0.0194617882297264770363120414644384357529,\n 0.0194617882297264770363120414644384357529,\n ],\n [\n 0.1527533871307258506980843319550975934919,\n 0.1527533871307258506980843319550975934919,\n 0.1491729864726037467878287370019694366926,\n 0.1491729864726037467878287370019694366926,\n 0.1420961093183820513292983250671649330345,\n 0.1420961093183820513292983250671649330345,\n 0.1316886384491766268984944997481631349161,\n 0.1316886384491766268984944997481631349161,\n 0.118194531961518417312377377711382287005,\n 0.118194531961518417312377377711382287005,\n 0.1019301198172404350367501354803498761666,\n 0.1019301198172404350367501354803498761666,\n 0.0832767415767047487247581432220462061001,\n 0.0832767415767047487247581432220462061001,\n 0.0626720483341090635695065351870416063516,\n 0.0626720483341090635695065351870416063516,\n 0.040601429800386941331039952274932109879,\n 0.040601429800386941331039952274932109879,\n 0.0176140071391521183118619623518528163621,\n 0.0176140071391521183118619623518528163621,\n ],\n [\n 0.1460811336496904271919851476833711882448,\n 0.1445244039899700590638271665537525436099,\n 0.1445244039899700590638271665537525436099,\n 0.1398873947910731547221334238675831108927,\n 0.1398873947910731547221334238675831108927,\n 0.132268938633337461781052574496775604329,\n 0.132268938633337461781052574496775604329,\n 0.1218314160537285341953671771257335983563,\n 0.1218314160537285341953671771257335983563,\n 0.1087972991671483776634745780701056420336,\n 0.1087972991671483776634745780701056420336,\n 0.0934444234560338615532897411139320884835,\n 0.0934444234560338615532897411139320884835,\n 0.0761001136283793020170516533001831792261,\n 0.0761001136283793020170516533001831792261,\n 0.0571344254268572082836358264724479574912,\n 0.0571344254268572082836358264724479574912,\n 0.0369537897708524937999506682993296661889,\n 0.0369537897708524937999506682993296661889,\n 0.0160172282577743333242246168584710152658,\n 0.0160172282577743333242246168584710152658,\n ],\n [\n 0.1392518728556319933754102483418099578739,\n 0.1392518728556319933754102483418099578739,\n 0.1365414983460151713525738312315173965863,\n 0.1365414983460151713525738312315173965863,\n 0.1311735047870623707329649925303074458757,\n 0.1311735047870623707329649925303074458757,\n 0.1232523768105124242855609861548144719594,\n 0.1232523768105124242855609861548144719594,\n 0.1129322960805392183934006074217843191142,\n 0.1129322960805392183934006074217843191142,\n 0.1004141444428809649320788378305362823508,\n 0.1004141444428809649320788378305362823508,\n 0.0859416062170677274144436813727028661891,\n 0.0859416062170677274144436813727028661891,\n 0.0697964684245204880949614189302176573987,\n 0.0697964684245204880949614189302176573987,\n 0.0522933351526832859403120512732112561121,\n 0.0522933351526832859403120512732112561121,\n 0.0337749015848141547933022468659129013491,\n 0.0337749015848141547933022468659129013491,\n 0.0146279952982722006849910980471854451902,\n 0.0146279952982722006849910980471854451902,\n ],\n [\n 0.1336545721861061753514571105458443385831,\n 0.132462039404696617371642464703316925805,\n 0.132462039404696617371642464703316925805,\n 0.1289057221880821499785953393997936532597,\n 0.1289057221880821499785953393997936532597,\n 0.1230490843067295304675784006720096548158,\n 0.1230490843067295304675784006720096548158,\n 0.1149966402224113649416435129339613014914,\n 0.1149966402224113649416435129339613014914,\n 0.1048920914645414100740861850147438548584,\n 0.1048920914645414100740861850147438548584,\n 0.0929157660600351474770186173697646486034,\n 0.0929157660600351474770186173697646486034,\n 0.0792814117767189549228925247420432269137,\n 0.0792814117767189549228925247420432269137,\n 0.0642324214085258521271696151589109980391,\n 0.0642324214085258521271696151589109980391,\n 0.0480376717310846685716410716320339965612,\n 0.0480376717310846685716410716320339965612,\n 0.0309880058569794443106942196418845053837,\n 0.0309880058569794443106942196418845053837,\n 0.0134118594871417720813094934586150649766,\n 0.0134118594871417720813094934586150649766,\n ],\n [\n 0.1279381953467521569740561652246953718517,\n 0.1279381953467521569740561652246953718517,\n 0.1258374563468282961213753825111836887264,\n 0.1258374563468282961213753825111836887264,\n 0.121670472927803391204463153476262425607,\n 0.121670472927803391204463153476262425607,\n 0.1155056680537256013533444839067835598622,\n 0.1155056680537256013533444839067835598622,\n 0.1074442701159656347825773424466062227946,\n 0.1074442701159656347825773424466062227946,\n 0.0976186521041138882698806644642471544279,\n 0.0976186521041138882698806644642471544279,\n 0.086190161531953275917185202983742667185,\n 0.086190161531953275917185202983742667185,\n 0.0733464814110803057340336152531165181193,\n 0.0733464814110803057340336152531165181193,\n 0.0592985849154367807463677585001085845412,\n 0.0592985849154367807463677585001085845412,\n 0.0442774388174198061686027482113382288593,\n 0.0442774388174198061686027482113382288593,\n 0.0285313886289336631813078159518782864491,\n 0.0285313886289336631813078159518782864491,\n 0.0123412297999871995468056670700372915759,\n 0.0123412297999871995468056670700372915759,\n ],\n];\nexports.binomialCoefficients = [[1], [1, 1], [1, 2, 1], [1, 3, 3, 1]];\nconst getCubicArcLength = (xs, ys, t) => {\n let z;\n let sum;\n let correctedT;\n const n = 20;\n z = t / 2;\n sum = 0;\n for (let i = 0; i < n; i++) {\n correctedT = z * exports.tValues[n][i] + z;\n sum += exports.cValues[n][i] * BFunc(xs, ys, correctedT);\n }\n return z * sum;\n};\nexports.getCubicArcLength = getCubicArcLength;\nconst getQuadraticArcLength = (xs, ys, t) => {\n if (t === undefined) {\n t = 1;\n }\n const ax = xs[0] - 2 * xs[1] + xs[2];\n const ay = ys[0] - 2 * ys[1] + ys[2];\n const bx = 2 * xs[1] - 2 * xs[0];\n const by = 2 * ys[1] - 2 * ys[0];\n const A = 4 * (ax * ax + ay * ay);\n const B = 4 * (ax * bx + ay * by);\n const C = bx * bx + by * by;\n if (A === 0) {\n return (t * Math.sqrt(Math.pow(xs[2] - xs[0], 2) + Math.pow(ys[2] - ys[0], 2)));\n }\n const b = B / (2 * A);\n const c = C / A;\n const u = t + b;\n const k = c - b * b;\n const uuk = u * u + k > 0 ? Math.sqrt(u * u + k) : 0;\n const bbk = b * b + k > 0 ? Math.sqrt(b * b + k) : 0;\n const term = b + Math.sqrt(b * b + k) !== 0\n ? k * Math.log(Math.abs((u + uuk) / (b + bbk)))\n : 0;\n return (Math.sqrt(A) / 2) * (u * uuk - b * bbk + term);\n};\nexports.getQuadraticArcLength = getQuadraticArcLength;\nfunction BFunc(xs, ys, t) {\n const xbase = getDerivative(1, t, xs);\n const ybase = getDerivative(1, t, ys);\n const combined = xbase * xbase + ybase * ybase;\n return Math.sqrt(combined);\n}\nconst getDerivative = (derivative, t, vs) => {\n const n = vs.length - 1;\n let _vs;\n let value;\n if (n === 0) {\n return 0;\n }\n if (derivative === 0) {\n value = 0;\n for (let k = 0; k <= n; k++) {\n value +=\n exports.binomialCoefficients[n][k] *\n Math.pow(1 - t, n - k) *\n Math.pow(t, k) *\n vs[k];\n }\n return value;\n }\n else {\n _vs = new Array(n);\n for (let k = 0; k < n; k++) {\n _vs[k] = n * (vs[k + 1] - vs[k]);\n }\n return getDerivative(derivative - 1, t, _vs);\n }\n};\nconst t2length = (length, totalLength, func) => {\n let error = 1;\n let t = length / totalLength;\n let step = (length - func(t)) / totalLength;\n let numIterations = 0;\n while (error > 0.001) {\n const increasedTLength = func(t + step);\n const increasedTError = Math.abs(length - increasedTLength) / totalLength;\n if (increasedTError < error) {\n error = increasedTError;\n t += step;\n }\n else {\n const decreasedTLength = func(t - step);\n const decreasedTError = Math.abs(length - decreasedTLength) / totalLength;\n if (decreasedTError < error) {\n error = decreasedTError;\n t -= step;\n }\n else {\n step /= 2;\n }\n }\n numIterations++;\n if (numIterations > 500) {\n break;\n }\n }\n return t;\n};\nexports.t2length = t2length;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Path = void 0;\nconst Factory_1 = require(\"../Factory\");\nconst Shape_1 = require(\"../Shape\");\nconst Global_1 = require(\"../Global\");\nconst BezierFunctions_1 = require(\"../BezierFunctions\");\nclass Path extends Shape_1.Shape {\n constructor(config) {\n super(config);\n this.dataArray = [];\n this.pathLength = 0;\n this._readDataAttribute();\n this.on('dataChange.konva', function () {\n this._readDataAttribute();\n });\n }\n _readDataAttribute() {\n this.dataArray = Path.parsePathData(this.data());\n this.pathLength = Path.getPathLength(this.dataArray);\n }\n _sceneFunc(context) {\n var ca = this.dataArray;\n context.beginPath();\n var isClosed = false;\n for (var n = 0; n < ca.length; n++) {\n var c = ca[n].command;\n var p = ca[n].points;\n switch (c) {\n case 'L':\n context.lineTo(p[0], p[1]);\n break;\n case 'M':\n context.moveTo(p[0], p[1]);\n break;\n case 'C':\n context.bezierCurveTo(p[0], p[1], p[2], p[3], p[4], p[5]);\n break;\n case 'Q':\n context.quadraticCurveTo(p[0], p[1], p[2], p[3]);\n break;\n case 'A':\n var cx = p[0], cy = p[1], rx = p[2], ry = p[3], theta = p[4], dTheta = p[5], psi = p[6], fs = p[7];\n var r = rx > ry ? rx : ry;\n var scaleX = rx > ry ? 1 : rx / ry;\n var scaleY = rx > ry ? ry / rx : 1;\n context.translate(cx, cy);\n context.rotate(psi);\n context.scale(scaleX, scaleY);\n context.arc(0, 0, r, theta, theta + dTheta, 1 - fs);\n context.scale(1 / scaleX, 1 / scaleY);\n context.rotate(-psi);\n context.translate(-cx, -cy);\n break;\n case 'z':\n isClosed = true;\n context.closePath();\n break;\n }\n }\n if (!isClosed && !this.hasFill()) {\n context.strokeShape(this);\n }\n else {\n context.fillStrokeShape(this);\n }\n }\n getSelfRect() {\n var points = [];\n this.dataArray.forEach(function (data) {\n if (data.command === 'A') {\n var start = data.points[4];\n var dTheta = data.points[5];\n var end = data.points[4] + dTheta;\n var inc = Math.PI / 180.0;\n if (Math.abs(start - end) < inc) {\n inc = Math.abs(start - end);\n }\n if (dTheta < 0) {\n for (let t = start - inc; t > end; t -= inc) {\n const point = Path.getPointOnEllipticalArc(data.points[0], data.points[1], data.points[2], data.points[3], t, 0);\n points.push(point.x, point.y);\n }\n }\n else {\n for (let t = start + inc; t < end; t += inc) {\n const point = Path.getPointOnEllipticalArc(data.points[0], data.points[1], data.points[2], data.points[3], t, 0);\n points.push(point.x, point.y);\n }\n }\n }\n else if (data.command === 'C') {\n for (let t = 0.0; t <= 1; t += 0.01) {\n const point = Path.getPointOnCubicBezier(t, data.start.x, data.start.y, data.points[0], data.points[1], data.points[2], data.points[3], data.points[4], data.points[5]);\n points.push(point.x, point.y);\n }\n }\n else {\n points = points.concat(data.points);\n }\n });\n var minX = points[0];\n var maxX = points[0];\n var minY = points[1];\n var maxY = points[1];\n var x, y;\n for (var i = 0; i < points.length / 2; i++) {\n x = points[i * 2];\n y = points[i * 2 + 1];\n if (!isNaN(x)) {\n minX = Math.min(minX, x);\n maxX = Math.max(maxX, x);\n }\n if (!isNaN(y)) {\n minY = Math.min(minY, y);\n maxY = Math.max(maxY, y);\n }\n }\n return {\n x: minX,\n y: minY,\n width: maxX - minX,\n height: maxY - minY,\n };\n }\n getLength() {\n return this.pathLength;\n }\n getPointAtLength(length) {\n return Path.getPointAtLengthOfDataArray(length, this.dataArray);\n }\n static getLineLength(x1, y1, x2, y2) {\n return Math.sqrt((x2 - x1) * (x2 - x1) + (y2 - y1) * (y2 - y1));\n }\n static getPathLength(dataArray) {\n let pathLength = 0;\n for (var i = 0; i < dataArray.length; ++i) {\n pathLength += dataArray[i].pathLength;\n }\n return pathLength;\n }\n static getPointAtLengthOfDataArray(length, dataArray) {\n var point, i = 0, ii = dataArray.length;\n if (!ii) {\n return null;\n }\n while (i < ii && length > dataArray[i].pathLength) {\n length -= dataArray[i].pathLength;\n ++i;\n }\n if (i === ii) {\n point = dataArray[i - 1].points.slice(-2);\n return {\n x: point[0],\n y: point[1],\n };\n }\n if (length < 0.01) {\n point = dataArray[i].points.slice(0, 2);\n return {\n x: point[0],\n y: point[1],\n };\n }\n var cp = dataArray[i];\n var p = cp.points;\n switch (cp.command) {\n case 'L':\n return Path.getPointOnLine(length, cp.start.x, cp.start.y, p[0], p[1]);\n case 'C':\n return Path.getPointOnCubicBezier((0, BezierFunctions_1.t2length)(length, Path.getPathLength(dataArray), (i) => {\n return (0, BezierFunctions_1.getCubicArcLength)([cp.start.x, p[0], p[2], p[4]], [cp.start.y, p[1], p[3], p[5]], i);\n }), cp.start.x, cp.start.y, p[0], p[1], p[2], p[3], p[4], p[5]);\n case 'Q':\n return Path.getPointOnQuadraticBezier((0, BezierFunctions_1.t2length)(length, Path.getPathLength(dataArray), (i) => {\n return (0, BezierFunctions_1.getQuadraticArcLength)([cp.start.x, p[0], p[2]], [cp.start.y, p[1], p[3]], i);\n }), cp.start.x, cp.start.y, p[0], p[1], p[2], p[3]);\n case 'A':\n var cx = p[0], cy = p[1], rx = p[2], ry = p[3], theta = p[4], dTheta = p[5], psi = p[6];\n theta += (dTheta * length) / cp.pathLength;\n return Path.getPointOnEllipticalArc(cx, cy, rx, ry, theta, psi);\n }\n return null;\n }\n static getPointOnLine(dist, P1x, P1y, P2x, P2y, fromX, fromY) {\n if (fromX === undefined) {\n fromX = P1x;\n }\n if (fromY === undefined) {\n fromY = P1y;\n }\n var m = (P2y - P1y) / (P2x - P1x + 0.00000001);\n var run = Math.sqrt((dist * dist) / (1 + m * m));\n if (P2x < P1x) {\n run *= -1;\n }\n var rise = m * run;\n var pt;\n if (P2x === P1x) {\n pt = {\n x: fromX,\n y: fromY + rise,\n };\n }\n else if ((fromY - P1y) / (fromX - P1x + 0.00000001) === m) {\n pt = {\n x: fromX + run,\n y: fromY + rise,\n };\n }\n else {\n var ix, iy;\n var len = this.getLineLength(P1x, P1y, P2x, P2y);\n var u = (fromX - P1x) * (P2x - P1x) + (fromY - P1y) * (P2y - P1y);\n u = u / (len * len);\n ix = P1x + u * (P2x - P1x);\n iy = P1y + u * (P2y - P1y);\n var pRise = this.getLineLength(fromX, fromY, ix, iy);\n var pRun = Math.sqrt(dist * dist - pRise * pRise);\n run = Math.sqrt((pRun * pRun) / (1 + m * m));\n if (P2x < P1x) {\n run *= -1;\n }\n rise = m * run;\n pt = {\n x: ix + run,\n y: iy + rise,\n };\n }\n return pt;\n }\n static getPointOnCubicBezier(pct, P1x, P1y, P2x, P2y, P3x, P3y, P4x, P4y) {\n function CB1(t) {\n return t * t * t;\n }\n function CB2(t) {\n return 3 * t * t * (1 - t);\n }\n function CB3(t) {\n return 3 * t * (1 - t) * (1 - t);\n }\n function CB4(t) {\n return (1 - t) * (1 - t) * (1 - t);\n }\n var x = P4x * CB1(pct) + P3x * CB2(pct) + P2x * CB3(pct) + P1x * CB4(pct);\n var y = P4y * CB1(pct) + P3y * CB2(pct) + P2y * CB3(pct) + P1y * CB4(pct);\n return {\n x: x,\n y: y,\n };\n }\n static getPointOnQuadraticBezier(pct, P1x, P1y, P2x, P2y, P3x, P3y) {\n function QB1(t) {\n return t * t;\n }\n function QB2(t) {\n return 2 * t * (1 - t);\n }\n function QB3(t) {\n return (1 - t) * (1 - t);\n }\n var x = P3x * QB1(pct) + P2x * QB2(pct) + P1x * QB3(pct);\n var y = P3y * QB1(pct) + P2y * QB2(pct) + P1y * QB3(pct);\n return {\n x: x,\n y: y,\n };\n }\n static getPointOnEllipticalArc(cx, cy, rx, ry, theta, psi) {\n var cosPsi = Math.cos(psi), sinPsi = Math.sin(psi);\n var pt = {\n x: rx * Math.cos(theta),\n y: ry * Math.sin(theta),\n };\n return {\n x: cx + (pt.x * cosPsi - pt.y * sinPsi),\n y: cy + (pt.x * sinPsi + pt.y * cosPsi),\n };\n }\n static parsePathData(data) {\n if (!data) {\n return [];\n }\n var cs = data;\n var cc = [\n 'm',\n 'M',\n 'l',\n 'L',\n 'v',\n 'V',\n 'h',\n 'H',\n 'z',\n 'Z',\n 'c',\n 'C',\n 'q',\n 'Q',\n 't',\n 'T',\n 's',\n 'S',\n 'a',\n 'A',\n ];\n cs = cs.replace(new RegExp(' ', 'g'), ',');\n for (var n = 0; n < cc.length; n++) {\n cs = cs.replace(new RegExp(cc[n], 'g'), '|' + cc[n]);\n }\n var arr = cs.split('|');\n var ca = [];\n var coords = [];\n var cpx = 0;\n var cpy = 0;\n var re = /([-+]?((\\d+\\.\\d+)|((\\d+)|(\\.\\d+)))(?:e[-+]?\\d+)?)/gi;\n var match;\n for (n = 1; n < arr.length; n++) {\n var str = arr[n];\n var c = str.charAt(0);\n str = str.slice(1);\n coords.length = 0;\n while ((match = re.exec(str))) {\n coords.push(match[0]);\n }\n var p = [];\n for (var j = 0, jlen = coords.length; j < jlen; j++) {\n if (coords[j] === '00') {\n p.push(0, 0);\n continue;\n }\n var parsed = parseFloat(coords[j]);\n if (!isNaN(parsed)) {\n p.push(parsed);\n }\n else {\n p.push(0);\n }\n }\n while (p.length > 0) {\n if (isNaN(p[0])) {\n break;\n }\n var cmd = '';\n var points = [];\n var startX = cpx, startY = cpy;\n var prevCmd, ctlPtx, ctlPty;\n var rx, ry, psi, fa, fs, x1, y1;\n switch (c) {\n case 'l':\n cpx += p.shift();\n cpy += p.shift();\n cmd = 'L';\n points.push(cpx, cpy);\n break;\n case 'L':\n cpx = p.shift();\n cpy = p.shift();\n points.push(cpx, cpy);\n break;\n case 'm':\n var dx = p.shift();\n var dy = p.shift();\n cpx += dx;\n cpy += dy;\n cmd = 'M';\n if (ca.length > 2 && ca[ca.length - 1].command === 'z') {\n for (var idx = ca.length - 2; idx >= 0; idx--) {\n if (ca[idx].command === 'M') {\n cpx = ca[idx].points[0] + dx;\n cpy = ca[idx].points[1] + dy;\n break;\n }\n }\n }\n points.push(cpx, cpy);\n c = 'l';\n break;\n case 'M':\n cpx = p.shift();\n cpy = p.shift();\n cmd = 'M';\n points.push(cpx, cpy);\n c = 'L';\n break;\n case 'h':\n cpx += p.shift();\n cmd = 'L';\n points.push(cpx, cpy);\n break;\n case 'H':\n cpx = p.shift();\n cmd = 'L';\n points.push(cpx, cpy);\n break;\n case 'v':\n cpy += p.shift();\n cmd = 'L';\n points.push(cpx, cpy);\n break;\n case 'V':\n cpy = p.shift();\n cmd = 'L';\n points.push(cpx, cpy);\n break;\n case 'C':\n points.push(p.shift(), p.shift(), p.shift(), p.shift());\n cpx = p.shift();\n cpy = p.shift();\n points.push(cpx, cpy);\n break;\n case 'c':\n points.push(cpx + p.shift(), cpy + p.shift(), cpx + p.shift(), cpy + p.shift());\n cpx += p.shift();\n cpy += p.shift();\n cmd = 'C';\n points.push(cpx, cpy);\n break;\n case 'S':\n ctlPtx = cpx;\n ctlPty = cpy;\n prevCmd = ca[ca.length - 1];\n if (prevCmd.command === 'C') {\n ctlPtx = cpx + (cpx - prevCmd.points[2]);\n ctlPty = cpy + (cpy - prevCmd.points[3]);\n }\n points.push(ctlPtx, ctlPty, p.shift(), p.shift());\n cpx = p.shift();\n cpy = p.shift();\n cmd = 'C';\n points.push(cpx, cpy);\n break;\n case 's':\n ctlPtx = cpx;\n ctlPty = cpy;\n prevCmd = ca[ca.length - 1];\n if (prevCmd.command === 'C') {\n ctlPtx = cpx + (cpx - prevCmd.points[2]);\n ctlPty = cpy + (cpy - prevCmd.points[3]);\n }\n points.push(ctlPtx, ctlPty, cpx + p.shift(), cpy + p.shift());\n cpx += p.shift();\n cpy += p.shift();\n cmd = 'C';\n points.push(cpx, cpy);\n break;\n case 'Q':\n points.push(p.shift(), p.shift());\n cpx = p.shift();\n cpy = p.shift();\n points.push(cpx, cpy);\n break;\n case 'q':\n points.push(cpx + p.shift(), cpy + p.shift());\n cpx += p.shift();\n cpy += p.shift();\n cmd = 'Q';\n points.push(cpx, cpy);\n break;\n case 'T':\n ctlPtx = cpx;\n ctlPty = cpy;\n prevCmd = ca[ca.length - 1];\n if (prevCmd.command === 'Q') {\n ctlPtx = cpx + (cpx - prevCmd.points[0]);\n ctlPty = cpy + (cpy - prevCmd.points[1]);\n }\n cpx = p.shift();\n cpy = p.shift();\n cmd = 'Q';\n points.push(ctlPtx, ctlPty, cpx, cpy);\n break;\n case 't':\n ctlPtx = cpx;\n ctlPty = cpy;\n prevCmd = ca[ca.length - 1];\n if (prevCmd.command === 'Q') {\n ctlPtx = cpx + (cpx - prevCmd.points[0]);\n ctlPty = cpy + (cpy - prevCmd.points[1]);\n }\n cpx += p.shift();\n cpy += p.shift();\n cmd = 'Q';\n points.push(ctlPtx, ctlPty, cpx, cpy);\n break;\n case 'A':\n rx = p.shift();\n ry = p.shift();\n psi = p.shift();\n fa = p.shift();\n fs = p.shift();\n x1 = cpx;\n y1 = cpy;\n cpx = p.shift();\n cpy = p.shift();\n cmd = 'A';\n points = this.convertEndpointToCenterParameterization(x1, y1, cpx, cpy, fa, fs, rx, ry, psi);\n break;\n case 'a':\n rx = p.shift();\n ry = p.shift();\n psi = p.shift();\n fa = p.shift();\n fs = p.shift();\n x1 = cpx;\n y1 = cpy;\n cpx += p.shift();\n cpy += p.shift();\n cmd = 'A';\n points = this.convertEndpointToCenterParameterization(x1, y1, cpx, cpy, fa, fs, rx, ry, psi);\n break;\n }\n ca.push({\n command: cmd || c,\n points: points,\n start: {\n x: startX,\n y: startY,\n },\n pathLength: this.calcLength(startX, startY, cmd || c, points),\n });\n }\n if (c === 'z' || c === 'Z') {\n ca.push({\n command: 'z',\n points: [],\n start: undefined,\n pathLength: 0,\n });\n }\n }\n return ca;\n }\n static calcLength(x, y, cmd, points) {\n var len, p1, p2, t;\n var path = Path;\n switch (cmd) {\n case 'L':\n return path.getLineLength(x, y, points[0], points[1]);\n case 'C':\n return (0, BezierFunctions_1.getCubicArcLength)([x, points[0], points[2], points[4]], [y, points[1], points[3], points[5]], 1);\n case 'Q':\n return (0, BezierFunctions_1.getQuadraticArcLength)([x, points[0], points[2]], [y, points[1], points[3]], 1);\n case 'A':\n len = 0.0;\n var start = points[4];\n var dTheta = points[5];\n var end = points[4] + dTheta;\n var inc = Math.PI / 180.0;\n if (Math.abs(start - end) < inc) {\n inc = Math.abs(start - end);\n }\n p1 = path.getPointOnEllipticalArc(points[0], points[1], points[2], points[3], start, 0);\n if (dTheta < 0) {\n for (t = start - inc; t > end; t -= inc) {\n p2 = path.getPointOnEllipticalArc(points[0], points[1], points[2], points[3], t, 0);\n len += path.getLineLength(p1.x, p1.y, p2.x, p2.y);\n p1 = p2;\n }\n }\n else {\n for (t = start + inc; t < end; t += inc) {\n p2 = path.getPointOnEllipticalArc(points[0], points[1], points[2], points[3], t, 0);\n len += path.getLineLength(p1.x, p1.y, p2.x, p2.y);\n p1 = p2;\n }\n }\n p2 = path.getPointOnEllipticalArc(points[0], points[1], points[2], points[3], end, 0);\n len += path.getLineLength(p1.x, p1.y, p2.x, p2.y);\n return len;\n }\n return 0;\n }\n static convertEndpointToCenterParameterization(x1, y1, x2, y2, fa, fs, rx, ry, psiDeg) {\n var psi = psiDeg * (Math.PI / 180.0);\n var xp = (Math.cos(psi) * (x1 - x2)) / 2.0 + (Math.sin(psi) * (y1 - y2)) / 2.0;\n var yp = (-1 * Math.sin(psi) * (x1 - x2)) / 2.0 +\n (Math.cos(psi) * (y1 - y2)) / 2.0;\n var lambda = (xp * xp) / (rx * rx) + (yp * yp) / (ry * ry);\n if (lambda > 1) {\n rx *= Math.sqrt(lambda);\n ry *= Math.sqrt(lambda);\n }\n var f = Math.sqrt((rx * rx * (ry * ry) - rx * rx * (yp * yp) - ry * ry * (xp * xp)) /\n (rx * rx * (yp * yp) + ry * ry * (xp * xp)));\n if (fa === fs) {\n f *= -1;\n }\n if (isNaN(f)) {\n f = 0;\n }\n var cxp = (f * rx * yp) / ry;\n var cyp = (f * -ry * xp) / rx;\n var cx = (x1 + x2) / 2.0 + Math.cos(psi) * cxp - Math.sin(psi) * cyp;\n var cy = (y1 + y2) / 2.0 + Math.sin(psi) * cxp + Math.cos(psi) * cyp;\n var vMag = function (v) {\n return Math.sqrt(v[0] * v[0] + v[1] * v[1]);\n };\n var vRatio = function (u, v) {\n return (u[0] * v[0] + u[1] * v[1]) / (vMag(u) * vMag(v));\n };\n var vAngle = function (u, v) {\n return (u[0] * v[1] < u[1] * v[0] ? -1 : 1) * Math.acos(vRatio(u, v));\n };\n var theta = vAngle([1, 0], [(xp - cxp) / rx, (yp - cyp) / ry]);\n var u = [(xp - cxp) / rx, (yp - cyp) / ry];\n var v = [(-1 * xp - cxp) / rx, (-1 * yp - cyp) / ry];\n var dTheta = vAngle(u, v);\n if (vRatio(u, v) <= -1) {\n dTheta = Math.PI;\n }\n if (vRatio(u, v) >= 1) {\n dTheta = 0;\n }\n if (fs === 0 && dTheta > 0) {\n dTheta = dTheta - 2 * Math.PI;\n }\n if (fs === 1 && dTheta < 0) {\n dTheta = dTheta + 2 * Math.PI;\n }\n return [cx, cy, rx, ry, theta, dTheta, psi, fs];\n }\n}\nexports.Path = Path;\nPath.prototype.className = 'Path';\nPath.prototype._attrsAffectingSize = ['data'];\n(0, Global_1._registerNode)(Path);\nFactory_1.Factory.addGetterSetter(Path, 'data');\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Arrow = void 0;\nconst Factory_1 = require(\"../Factory\");\nconst Line_1 = require(\"./Line\");\nconst Validators_1 = require(\"../Validators\");\nconst Global_1 = require(\"../Global\");\nconst Path_1 = require(\"./Path\");\nclass Arrow extends Line_1.Line {\n _sceneFunc(ctx) {\n super._sceneFunc(ctx);\n var PI2 = Math.PI * 2;\n var points = this.points();\n var tp = points;\n var fromTension = this.tension() !== 0 && points.length > 4;\n if (fromTension) {\n tp = this.getTensionPoints();\n }\n var length = this.pointerLength();\n var n = points.length;\n var dx, dy;\n if (fromTension) {\n const lp = [\n tp[tp.length - 4],\n tp[tp.length - 3],\n tp[tp.length - 2],\n tp[tp.length - 1],\n points[n - 2],\n points[n - 1],\n ];\n const lastLength = Path_1.Path.calcLength(tp[tp.length - 4], tp[tp.length - 3], 'C', lp);\n const previous = Path_1.Path.getPointOnQuadraticBezier(Math.min(1, 1 - length / lastLength), lp[0], lp[1], lp[2], lp[3], lp[4], lp[5]);\n dx = points[n - 2] - previous.x;\n dy = points[n - 1] - previous.y;\n }\n else {\n dx = points[n - 2] - points[n - 4];\n dy = points[n - 1] - points[n - 3];\n }\n var radians = (Math.atan2(dy, dx) + PI2) % PI2;\n var width = this.pointerWidth();\n if (this.pointerAtEnding()) {\n ctx.save();\n ctx.beginPath();\n ctx.translate(points[n - 2], points[n - 1]);\n ctx.rotate(radians);\n ctx.moveTo(0, 0);\n ctx.lineTo(-length, width / 2);\n ctx.lineTo(-length, -width / 2);\n ctx.closePath();\n ctx.restore();\n this.__fillStroke(ctx);\n }\n if (this.pointerAtBeginning()) {\n ctx.save();\n ctx.beginPath();\n ctx.translate(points[0], points[1]);\n if (fromTension) {\n dx = (tp[0] + tp[2]) / 2 - points[0];\n dy = (tp[1] + tp[3]) / 2 - points[1];\n }\n else {\n dx = points[2] - points[0];\n dy = points[3] - points[1];\n }\n ctx.rotate((Math.atan2(-dy, -dx) + PI2) % PI2);\n ctx.moveTo(0, 0);\n ctx.lineTo(-length, width / 2);\n ctx.lineTo(-length, -width / 2);\n ctx.closePath();\n ctx.restore();\n this.__fillStroke(ctx);\n }\n }\n __fillStroke(ctx) {\n var isDashEnabled = this.dashEnabled();\n if (isDashEnabled) {\n this.attrs.dashEnabled = false;\n ctx.setLineDash([]);\n }\n ctx.fillStrokeShape(this);\n if (isDashEnabled) {\n this.attrs.dashEnabled = true;\n }\n }\n getSelfRect() {\n const lineRect = super.getSelfRect();\n const offset = this.pointerWidth() / 2;\n return {\n x: lineRect.x - offset,\n y: lineRect.y - offset,\n width: lineRect.width + offset * 2,\n height: lineRect.height + offset * 2,\n };\n }\n}\nexports.Arrow = Arrow;\nArrow.prototype.className = 'Arrow';\n(0, Global_1._registerNode)(Arrow);\nFactory_1.Factory.addGetterSetter(Arrow, 'pointerLength', 10, (0, Validators_1.getNumberValidator)());\nFactory_1.Factory.addGetterSetter(Arrow, 'pointerWidth', 10, (0, Validators_1.getNumberValidator)());\nFactory_1.Factory.addGetterSetter(Arrow, 'pointerAtBeginning', false);\nFactory_1.Factory.addGetterSetter(Arrow, 'pointerAtEnding', true);\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Circle = void 0;\nconst Factory_1 = require(\"../Factory\");\nconst Shape_1 = require(\"../Shape\");\nconst Validators_1 = require(\"../Validators\");\nconst Global_1 = require(\"../Global\");\nclass Circle extends Shape_1.Shape {\n _sceneFunc(context) {\n context.beginPath();\n context.arc(0, 0, this.attrs.radius || 0, 0, Math.PI * 2, false);\n context.closePath();\n context.fillStrokeShape(this);\n }\n getWidth() {\n return this.radius() * 2;\n }\n getHeight() {\n return this.radius() * 2;\n }\n setWidth(width) {\n if (this.radius() !== width / 2) {\n this.radius(width / 2);\n }\n }\n setHeight(height) {\n if (this.radius() !== height / 2) {\n this.radius(height / 2);\n }\n }\n}\nexports.Circle = Circle;\nCircle.prototype._centroid = true;\nCircle.prototype.className = 'Circle';\nCircle.prototype._attrsAffectingSize = ['radius'];\n(0, Global_1._registerNode)(Circle);\nFactory_1.Factory.addGetterSetter(Circle, 'radius', 0, (0, Validators_1.getNumberValidator)());\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Ellipse = void 0;\nconst Factory_1 = require(\"../Factory\");\nconst Shape_1 = require(\"../Shape\");\nconst Validators_1 = require(\"../Validators\");\nconst Global_1 = require(\"../Global\");\nclass Ellipse extends Shape_1.Shape {\n _sceneFunc(context) {\n var rx = this.radiusX(), ry = this.radiusY();\n context.beginPath();\n context.save();\n if (rx !== ry) {\n context.scale(1, ry / rx);\n }\n context.arc(0, 0, rx, 0, Math.PI * 2, false);\n context.restore();\n context.closePath();\n context.fillStrokeShape(this);\n }\n getWidth() {\n return this.radiusX() * 2;\n }\n getHeight() {\n return this.radiusY() * 2;\n }\n setWidth(width) {\n this.radiusX(width / 2);\n }\n setHeight(height) {\n this.radiusY(height / 2);\n }\n}\nexports.Ellipse = Ellipse;\nEllipse.prototype.className = 'Ellipse';\nEllipse.prototype._centroid = true;\nEllipse.prototype._attrsAffectingSize = ['radiusX', 'radiusY'];\n(0, Global_1._registerNode)(Ellipse);\nFactory_1.Factory.addComponentsGetterSetter(Ellipse, 'radius', ['x', 'y']);\nFactory_1.Factory.addGetterSetter(Ellipse, 'radiusX', 0, (0, Validators_1.getNumberValidator)());\nFactory_1.Factory.addGetterSetter(Ellipse, 'radiusY', 0, (0, Validators_1.getNumberValidator)());\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Image = void 0;\nconst Util_1 = require(\"../Util\");\nconst Factory_1 = require(\"../Factory\");\nconst Shape_1 = require(\"../Shape\");\nconst Global_1 = require(\"../Global\");\nconst Validators_1 = require(\"../Validators\");\nclass Image extends Shape_1.Shape {\n constructor(attrs) {\n super(attrs);\n this.on('imageChange.konva', () => {\n this._setImageLoad();\n });\n this._setImageLoad();\n }\n _setImageLoad() {\n const image = this.image();\n if (image && image.complete) {\n return;\n }\n if (image && image.readyState === 4) {\n return;\n }\n if (image && image['addEventListener']) {\n image['addEventListener']('load', () => {\n this._requestDraw();\n });\n }\n }\n _useBufferCanvas() {\n return super._useBufferCanvas(true);\n }\n _sceneFunc(context) {\n const width = this.getWidth();\n const height = this.getHeight();\n const cornerRadius = this.cornerRadius();\n const image = this.attrs.image;\n let params;\n if (image) {\n const cropWidth = this.attrs.cropWidth;\n const cropHeight = this.attrs.cropHeight;\n if (cropWidth && cropHeight) {\n params = [\n image,\n this.cropX(),\n this.cropY(),\n cropWidth,\n cropHeight,\n 0,\n 0,\n width,\n height,\n ];\n }\n else {\n params = [image, 0, 0, width, height];\n }\n }\n if (this.hasFill() || this.hasStroke() || cornerRadius) {\n context.beginPath();\n cornerRadius\n ? Util_1.Util.drawRoundedRectPath(context, width, height, cornerRadius)\n : context.rect(0, 0, width, height);\n context.closePath();\n context.fillStrokeShape(this);\n }\n if (image) {\n if (cornerRadius) {\n context.clip();\n }\n context.drawImage.apply(context, params);\n }\n }\n _hitFunc(context) {\n var width = this.width(), height = this.height(), cornerRadius = this.cornerRadius();\n context.beginPath();\n if (!cornerRadius) {\n context.rect(0, 0, width, height);\n }\n else {\n Util_1.Util.drawRoundedRectPath(context, width, height, cornerRadius);\n }\n context.closePath();\n context.fillStrokeShape(this);\n }\n getWidth() {\n var _a, _b;\n return (_a = this.attrs.width) !== null && _a !== void 0 ? _a : (_b = this.image()) === null || _b === void 0 ? void 0 : _b.width;\n }\n getHeight() {\n var _a, _b;\n return (_a = this.attrs.height) !== null && _a !== void 0 ? _a : (_b = this.image()) === null || _b === void 0 ? void 0 : _b.height;\n }\n static fromURL(url, callback, onError = null) {\n var img = Util_1.Util.createImageElement();\n img.onload = function () {\n var image = new Image({\n image: img,\n });\n callback(image);\n };\n img.onerror = onError;\n img.crossOrigin = 'Anonymous';\n img.src = url;\n }\n}\nexports.Image = Image;\nImage.prototype.className = 'Image';\n(0, Global_1._registerNode)(Image);\nFactory_1.Factory.addGetterSetter(Image, 'cornerRadius', 0, (0, Validators_1.getNumberOrArrayOfNumbersValidator)(4));\nFactory_1.Factory.addGetterSetter(Image, 'image');\nFactory_1.Factory.addComponentsGetterSetter(Image, 'crop', ['x', 'y', 'width', 'height']);\nFactory_1.Factory.addGetterSetter(Image, 'cropX', 0, (0, Validators_1.getNumberValidator)());\nFactory_1.Factory.addGetterSetter(Image, 'cropY', 0, (0, Validators_1.getNumberValidator)());\nFactory_1.Factory.addGetterSetter(Image, 'cropWidth', 0, (0, Validators_1.getNumberValidator)());\nFactory_1.Factory.addGetterSetter(Image, 'cropHeight', 0, (0, Validators_1.getNumberValidator)());\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Tag = exports.Label = void 0;\nconst Factory_1 = require(\"../Factory\");\nconst Shape_1 = require(\"../Shape\");\nconst Group_1 = require(\"../Group\");\nconst Validators_1 = require(\"../Validators\");\nconst Global_1 = require(\"../Global\");\nvar ATTR_CHANGE_LIST = [\n 'fontFamily',\n 'fontSize',\n 'fontStyle',\n 'padding',\n 'lineHeight',\n 'text',\n 'width',\n 'height',\n 'pointerDirection',\n 'pointerWidth',\n 'pointerHeight',\n], CHANGE_KONVA = 'Change.konva', NONE = 'none', UP = 'up', RIGHT = 'right', DOWN = 'down', LEFT = 'left', attrChangeListLen = ATTR_CHANGE_LIST.length;\nclass Label extends Group_1.Group {\n constructor(config) {\n super(config);\n this.on('add.konva', function (evt) {\n this._addListeners(evt.child);\n this._sync();\n });\n }\n getText() {\n return this.find('Text')[0];\n }\n getTag() {\n return this.find('Tag')[0];\n }\n _addListeners(text) {\n var that = this, n;\n var func = function () {\n that._sync();\n };\n for (n = 0; n < attrChangeListLen; n++) {\n text.on(ATTR_CHANGE_LIST[n] + CHANGE_KONVA, func);\n }\n }\n getWidth() {\n return this.getText().width();\n }\n getHeight() {\n return this.getText().height();\n }\n _sync() {\n var text = this.getText(), tag = this.getTag(), width, height, pointerDirection, pointerWidth, x, y, pointerHeight;\n if (text && tag) {\n width = text.width();\n height = text.height();\n pointerDirection = tag.pointerDirection();\n pointerWidth = tag.pointerWidth();\n pointerHeight = tag.pointerHeight();\n x = 0;\n y = 0;\n switch (pointerDirection) {\n case UP:\n x = width / 2;\n y = -1 * pointerHeight;\n break;\n case RIGHT:\n x = width + pointerWidth;\n y = height / 2;\n break;\n case DOWN:\n x = width / 2;\n y = height + pointerHeight;\n break;\n case LEFT:\n x = -1 * pointerWidth;\n y = height / 2;\n break;\n }\n tag.setAttrs({\n x: -1 * x,\n y: -1 * y,\n width: width,\n height: height,\n });\n text.setAttrs({\n x: -1 * x,\n y: -1 * y,\n });\n }\n }\n}\nexports.Label = Label;\nLabel.prototype.className = 'Label';\n(0, Global_1._registerNode)(Label);\nclass Tag extends Shape_1.Shape {\n _sceneFunc(context) {\n var width = this.width(), height = this.height(), pointerDirection = this.pointerDirection(), pointerWidth = this.pointerWidth(), pointerHeight = this.pointerHeight(), cornerRadius = this.cornerRadius();\n let topLeft = 0;\n let topRight = 0;\n let bottomLeft = 0;\n let bottomRight = 0;\n if (typeof cornerRadius === 'number') {\n topLeft =\n topRight =\n bottomLeft =\n bottomRight =\n Math.min(cornerRadius, width / 2, height / 2);\n }\n else {\n topLeft = Math.min(cornerRadius[0] || 0, width / 2, height / 2);\n topRight = Math.min(cornerRadius[1] || 0, width / 2, height / 2);\n bottomRight = Math.min(cornerRadius[2] || 0, width / 2, height / 2);\n bottomLeft = Math.min(cornerRadius[3] || 0, width / 2, height / 2);\n }\n context.beginPath();\n context.moveTo(topLeft, 0);\n if (pointerDirection === UP) {\n context.lineTo((width - pointerWidth) / 2, 0);\n context.lineTo(width / 2, -1 * pointerHeight);\n context.lineTo((width + pointerWidth) / 2, 0);\n }\n context.lineTo(width - topRight, 0);\n context.arc(width - topRight, topRight, topRight, (Math.PI * 3) / 2, 0, false);\n if (pointerDirection === RIGHT) {\n context.lineTo(width, (height - pointerHeight) / 2);\n context.lineTo(width + pointerWidth, height / 2);\n context.lineTo(width, (height + pointerHeight) / 2);\n }\n context.lineTo(width, height - bottomRight);\n context.arc(width - bottomRight, height - bottomRight, bottomRight, 0, Math.PI / 2, false);\n if (pointerDirection === DOWN) {\n context.lineTo((width + pointerWidth) / 2, height);\n context.lineTo(width / 2, height + pointerHeight);\n context.lineTo((width - pointerWidth) / 2, height);\n }\n context.lineTo(bottomLeft, height);\n context.arc(bottomLeft, height - bottomLeft, bottomLeft, Math.PI / 2, Math.PI, false);\n if (pointerDirection === LEFT) {\n context.lineTo(0, (height + pointerHeight) / 2);\n context.lineTo(-1 * pointerWidth, height / 2);\n context.lineTo(0, (height - pointerHeight) / 2);\n }\n context.lineTo(0, topLeft);\n context.arc(topLeft, topLeft, topLeft, Math.PI, (Math.PI * 3) / 2, false);\n context.closePath();\n context.fillStrokeShape(this);\n }\n getSelfRect() {\n var x = 0, y = 0, pointerWidth = this.pointerWidth(), pointerHeight = this.pointerHeight(), direction = this.pointerDirection(), width = this.width(), height = this.height();\n if (direction === UP) {\n y -= pointerHeight;\n height += pointerHeight;\n }\n else if (direction === DOWN) {\n height += pointerHeight;\n }\n else if (direction === LEFT) {\n x -= pointerWidth * 1.5;\n width += pointerWidth;\n }\n else if (direction === RIGHT) {\n width += pointerWidth * 1.5;\n }\n return {\n x: x,\n y: y,\n width: width,\n height: height,\n };\n }\n}\nexports.Tag = Tag;\nTag.prototype.className = 'Tag';\n(0, Global_1._registerNode)(Tag);\nFactory_1.Factory.addGetterSetter(Tag, 'pointerDirection', NONE);\nFactory_1.Factory.addGetterSetter(Tag, 'pointerWidth', 0, (0, Validators_1.getNumberValidator)());\nFactory_1.Factory.addGetterSetter(Tag, 'pointerHeight', 0, (0, Validators_1.getNumberValidator)());\nFactory_1.Factory.addGetterSetter(Tag, 'cornerRadius', 0, (0, Validators_1.getNumberOrArrayOfNumbersValidator)(4));\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Rect = void 0;\nconst Factory_1 = require(\"../Factory\");\nconst Shape_1 = require(\"../Shape\");\nconst Global_1 = require(\"../Global\");\nconst Util_1 = require(\"../Util\");\nconst Validators_1 = require(\"../Validators\");\nclass Rect extends Shape_1.Shape {\n _sceneFunc(context) {\n var cornerRadius = this.cornerRadius(), width = this.width(), height = this.height();\n context.beginPath();\n if (!cornerRadius) {\n context.rect(0, 0, width, height);\n }\n else {\n Util_1.Util.drawRoundedRectPath(context, width, height, cornerRadius);\n }\n context.closePath();\n context.fillStrokeShape(this);\n }\n}\nexports.Rect = Rect;\nRect.prototype.className = 'Rect';\n(0, Global_1._registerNode)(Rect);\nFactory_1.Factory.addGetterSetter(Rect, 'cornerRadius', 0, (0, Validators_1.getNumberOrArrayOfNumbersValidator)(4));\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.RegularPolygon = void 0;\nconst Factory_1 = require(\"../Factory\");\nconst Shape_1 = require(\"../Shape\");\nconst Validators_1 = require(\"../Validators\");\nconst Global_1 = require(\"../Global\");\nclass RegularPolygon extends Shape_1.Shape {\n _sceneFunc(context) {\n const points = this._getPoints();\n context.beginPath();\n context.moveTo(points[0].x, points[0].y);\n for (var n = 1; n < points.length; n++) {\n context.lineTo(points[n].x, points[n].y);\n }\n context.closePath();\n context.fillStrokeShape(this);\n }\n _getPoints() {\n const sides = this.attrs.sides;\n const radius = this.attrs.radius || 0;\n const points = [];\n for (var n = 0; n < sides; n++) {\n points.push({\n x: radius * Math.sin((n * 2 * Math.PI) / sides),\n y: -1 * radius * Math.cos((n * 2 * Math.PI) / sides),\n });\n }\n return points;\n }\n getSelfRect() {\n const points = this._getPoints();\n var minX = points[0].x;\n var maxX = points[0].y;\n var minY = points[0].x;\n var maxY = points[0].y;\n points.forEach((point) => {\n minX = Math.min(minX, point.x);\n maxX = Math.max(maxX, point.x);\n minY = Math.min(minY, point.y);\n maxY = Math.max(maxY, point.y);\n });\n return {\n x: minX,\n y: minY,\n width: maxX - minX,\n height: maxY - minY,\n };\n }\n getWidth() {\n return this.radius() * 2;\n }\n getHeight() {\n return this.radius() * 2;\n }\n setWidth(width) {\n this.radius(width / 2);\n }\n setHeight(height) {\n this.radius(height / 2);\n }\n}\nexports.RegularPolygon = RegularPolygon;\nRegularPolygon.prototype.className = 'RegularPolygon';\nRegularPolygon.prototype._centroid = true;\nRegularPolygon.prototype._attrsAffectingSize = ['radius'];\n(0, Global_1._registerNode)(RegularPolygon);\nFactory_1.Factory.addGetterSetter(RegularPolygon, 'radius', 0, (0, Validators_1.getNumberValidator)());\nFactory_1.Factory.addGetterSetter(RegularPolygon, 'sides', 0, (0, Validators_1.getNumberValidator)());\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Ring = void 0;\nconst Factory_1 = require(\"../Factory\");\nconst Shape_1 = require(\"../Shape\");\nconst Validators_1 = require(\"../Validators\");\nconst Global_1 = require(\"../Global\");\nvar PIx2 = Math.PI * 2;\nclass Ring extends Shape_1.Shape {\n _sceneFunc(context) {\n context.beginPath();\n context.arc(0, 0, this.innerRadius(), 0, PIx2, false);\n context.moveTo(this.outerRadius(), 0);\n context.arc(0, 0, this.outerRadius(), PIx2, 0, true);\n context.closePath();\n context.fillStrokeShape(this);\n }\n getWidth() {\n return this.outerRadius() * 2;\n }\n getHeight() {\n return this.outerRadius() * 2;\n }\n setWidth(width) {\n this.outerRadius(width / 2);\n }\n setHeight(height) {\n this.outerRadius(height / 2);\n }\n}\nexports.Ring = Ring;\nRing.prototype.className = 'Ring';\nRing.prototype._centroid = true;\nRing.prototype._attrsAffectingSize = ['innerRadius', 'outerRadius'];\n(0, Global_1._registerNode)(Ring);\nFactory_1.Factory.addGetterSetter(Ring, 'innerRadius', 0, (0, Validators_1.getNumberValidator)());\nFactory_1.Factory.addGetterSetter(Ring, 'outerRadius', 0, (0, Validators_1.getNumberValidator)());\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Sprite = void 0;\nconst Factory_1 = require(\"../Factory\");\nconst Shape_1 = require(\"../Shape\");\nconst Animation_1 = require(\"../Animation\");\nconst Validators_1 = require(\"../Validators\");\nconst Global_1 = require(\"../Global\");\nclass Sprite extends Shape_1.Shape {\n constructor(config) {\n super(config);\n this._updated = true;\n this.anim = new Animation_1.Animation(() => {\n var updated = this._updated;\n this._updated = false;\n return updated;\n });\n this.on('animationChange.konva', function () {\n this.frameIndex(0);\n });\n this.on('frameIndexChange.konva', function () {\n this._updated = true;\n });\n this.on('frameRateChange.konva', function () {\n if (!this.anim.isRunning()) {\n return;\n }\n clearInterval(this.interval);\n this._setInterval();\n });\n }\n _sceneFunc(context) {\n var anim = this.animation(), index = this.frameIndex(), ix4 = index * 4, set = this.animations()[anim], offsets = this.frameOffsets(), x = set[ix4 + 0], y = set[ix4 + 1], width = set[ix4 + 2], height = set[ix4 + 3], image = this.image();\n if (this.hasFill() || this.hasStroke()) {\n context.beginPath();\n context.rect(0, 0, width, height);\n context.closePath();\n context.fillStrokeShape(this);\n }\n if (image) {\n if (offsets) {\n var offset = offsets[anim], ix2 = index * 2;\n context.drawImage(image, x, y, width, height, offset[ix2 + 0], offset[ix2 + 1], width, height);\n }\n else {\n context.drawImage(image, x, y, width, height, 0, 0, width, height);\n }\n }\n }\n _hitFunc(context) {\n var anim = this.animation(), index = this.frameIndex(), ix4 = index * 4, set = this.animations()[anim], offsets = this.frameOffsets(), width = set[ix4 + 2], height = set[ix4 + 3];\n context.beginPath();\n if (offsets) {\n var offset = offsets[anim];\n var ix2 = index * 2;\n context.rect(offset[ix2 + 0], offset[ix2 + 1], width, height);\n }\n else {\n context.rect(0, 0, width, height);\n }\n context.closePath();\n context.fillShape(this);\n }\n _useBufferCanvas() {\n return super._useBufferCanvas(true);\n }\n _setInterval() {\n var that = this;\n this.interval = setInterval(function () {\n that._updateIndex();\n }, 1000 / this.frameRate());\n }\n start() {\n if (this.isRunning()) {\n return;\n }\n var layer = this.getLayer();\n this.anim.setLayers(layer);\n this._setInterval();\n this.anim.start();\n }\n stop() {\n this.anim.stop();\n clearInterval(this.interval);\n }\n isRunning() {\n return this.anim.isRunning();\n }\n _updateIndex() {\n var index = this.frameIndex(), animation = this.animation(), animations = this.animations(), anim = animations[animation], len = anim.length / 4;\n if (index < len - 1) {\n this.frameIndex(index + 1);\n }\n else {\n this.frameIndex(0);\n }\n }\n}\nexports.Sprite = Sprite;\nSprite.prototype.className = 'Sprite';\n(0, Global_1._registerNode)(Sprite);\nFactory_1.Factory.addGetterSetter(Sprite, 'animation');\nFactory_1.Factory.addGetterSetter(Sprite, 'animations');\nFactory_1.Factory.addGetterSetter(Sprite, 'frameOffsets');\nFactory_1.Factory.addGetterSetter(Sprite, 'image');\nFactory_1.Factory.addGetterSetter(Sprite, 'frameIndex', 0, (0, Validators_1.getNumberValidator)());\nFactory_1.Factory.addGetterSetter(Sprite, 'frameRate', 17, (0, Validators_1.getNumberValidator)());\nFactory_1.Factory.backCompat(Sprite, {\n index: 'frameIndex',\n getIndex: 'getFrameIndex',\n setIndex: 'setFrameIndex',\n});\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Star = void 0;\nconst Factory_1 = require(\"../Factory\");\nconst Shape_1 = require(\"../Shape\");\nconst Validators_1 = require(\"../Validators\");\nconst Global_1 = require(\"../Global\");\nclass Star extends Shape_1.Shape {\n _sceneFunc(context) {\n var innerRadius = this.innerRadius(), outerRadius = this.outerRadius(), numPoints = this.numPoints();\n context.beginPath();\n context.moveTo(0, 0 - outerRadius);\n for (var n = 1; n < numPoints * 2; n++) {\n var radius = n % 2 === 0 ? outerRadius : innerRadius;\n var x = radius * Math.sin((n * Math.PI) / numPoints);\n var y = -1 * radius * Math.cos((n * Math.PI) / numPoints);\n context.lineTo(x, y);\n }\n context.closePath();\n context.fillStrokeShape(this);\n }\n getWidth() {\n return this.outerRadius() * 2;\n }\n getHeight() {\n return this.outerRadius() * 2;\n }\n setWidth(width) {\n this.outerRadius(width / 2);\n }\n setHeight(height) {\n this.outerRadius(height / 2);\n }\n}\nexports.Star = Star;\nStar.prototype.className = 'Star';\nStar.prototype._centroid = true;\nStar.prototype._attrsAffectingSize = ['innerRadius', 'outerRadius'];\n(0, Global_1._registerNode)(Star);\nFactory_1.Factory.addGetterSetter(Star, 'numPoints', 5, (0, Validators_1.getNumberValidator)());\nFactory_1.Factory.addGetterSetter(Star, 'innerRadius', 0, (0, Validators_1.getNumberValidator)());\nFactory_1.Factory.addGetterSetter(Star, 'outerRadius', 0, (0, Validators_1.getNumberValidator)());\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Text = exports.stringToArray = void 0;\nconst Util_1 = require(\"../Util\");\nconst Factory_1 = require(\"../Factory\");\nconst Shape_1 = require(\"../Shape\");\nconst Validators_1 = require(\"../Validators\");\nconst Global_1 = require(\"../Global\");\nfunction stringToArray(string) {\n return Array.from(string);\n}\nexports.stringToArray = stringToArray;\nvar AUTO = 'auto', CENTER = 'center', INHERIT = 'inherit', JUSTIFY = 'justify', CHANGE_KONVA = 'Change.konva', CONTEXT_2D = '2d', DASH = '-', LEFT = 'left', LTR = 'ltr', TEXT = 'text', TEXT_UPPER = 'Text', TOP = 'top', BOTTOM = 'bottom', MIDDLE = 'middle', NORMAL = 'normal', PX_SPACE = 'px ', SPACE = ' ', RIGHT = 'right', RTL = 'rtl', WORD = 'word', CHAR = 'char', NONE = 'none', ELLIPSIS = '…', ATTR_CHANGE_LIST = [\n 'direction',\n 'fontFamily',\n 'fontSize',\n 'fontStyle',\n 'fontVariant',\n 'padding',\n 'align',\n 'verticalAlign',\n 'lineHeight',\n 'text',\n 'width',\n 'height',\n 'wrap',\n 'ellipsis',\n 'letterSpacing',\n], attrChangeListLen = ATTR_CHANGE_LIST.length;\nfunction normalizeFontFamily(fontFamily) {\n return fontFamily\n .split(',')\n .map((family) => {\n family = family.trim();\n const hasSpace = family.indexOf(' ') >= 0;\n const hasQuotes = family.indexOf('\"') >= 0 || family.indexOf(\"'\") >= 0;\n if (hasSpace && !hasQuotes) {\n family = `\"${family}\"`;\n }\n return family;\n })\n .join(', ');\n}\nvar dummyContext;\nfunction getDummyContext() {\n if (dummyContext) {\n return dummyContext;\n }\n dummyContext = Util_1.Util.createCanvasElement().getContext(CONTEXT_2D);\n return dummyContext;\n}\nfunction _fillFunc(context) {\n context.fillText(this._partialText, this._partialTextX, this._partialTextY);\n}\nfunction _strokeFunc(context) {\n context.setAttr('miterLimit', 2);\n context.strokeText(this._partialText, this._partialTextX, this._partialTextY);\n}\nfunction checkDefaultFill(config) {\n config = config || {};\n if (!config.fillLinearGradientColorStops &&\n !config.fillRadialGradientColorStops &&\n !config.fillPatternImage) {\n config.fill = config.fill || 'black';\n }\n return config;\n}\nclass Text extends Shape_1.Shape {\n constructor(config) {\n super(checkDefaultFill(config));\n this._partialTextX = 0;\n this._partialTextY = 0;\n for (var n = 0; n < attrChangeListLen; n++) {\n this.on(ATTR_CHANGE_LIST[n] + CHANGE_KONVA, this._setTextData);\n }\n this._setTextData();\n }\n _sceneFunc(context) {\n var textArr = this.textArr, textArrLen = textArr.length;\n if (!this.text()) {\n return;\n }\n var padding = this.padding(), fontSize = this.fontSize(), lineHeightPx = this.lineHeight() * fontSize, verticalAlign = this.verticalAlign(), direction = this.direction(), alignY = 0, align = this.align(), totalWidth = this.getWidth(), letterSpacing = this.letterSpacing(), fill = this.fill(), textDecoration = this.textDecoration(), shouldUnderline = textDecoration.indexOf('underline') !== -1, shouldLineThrough = textDecoration.indexOf('line-through') !== -1, n;\n direction = direction === INHERIT ? context.direction : direction;\n var translateY = 0;\n var translateY = lineHeightPx / 2;\n var lineTranslateX = 0;\n var lineTranslateY = 0;\n if (direction === RTL) {\n context.setAttr('direction', direction);\n }\n context.setAttr('font', this._getContextFont());\n context.setAttr('textBaseline', MIDDLE);\n context.setAttr('textAlign', LEFT);\n if (verticalAlign === MIDDLE) {\n alignY = (this.getHeight() - textArrLen * lineHeightPx - padding * 2) / 2;\n }\n else if (verticalAlign === BOTTOM) {\n alignY = this.getHeight() - textArrLen * lineHeightPx - padding * 2;\n }\n context.translate(padding, alignY + padding);\n for (n = 0; n < textArrLen; n++) {\n var lineTranslateX = 0;\n var lineTranslateY = 0;\n var obj = textArr[n], text = obj.text, width = obj.width, lastLine = obj.lastInParagraph, spacesNumber, oneWord, lineWidth;\n context.save();\n if (align === RIGHT) {\n lineTranslateX += totalWidth - width - padding * 2;\n }\n else if (align === CENTER) {\n lineTranslateX += (totalWidth - width - padding * 2) / 2;\n }\n if (shouldUnderline) {\n context.save();\n context.beginPath();\n context.moveTo(lineTranslateX, translateY + lineTranslateY + Math.round(fontSize / 2));\n spacesNumber = text.split(' ').length - 1;\n oneWord = spacesNumber === 0;\n lineWidth =\n align === JUSTIFY && !lastLine ? totalWidth - padding * 2 : width;\n context.lineTo(lineTranslateX + Math.round(lineWidth), translateY + lineTranslateY + Math.round(fontSize / 2));\n context.lineWidth = fontSize / 15;\n const gradient = this._getLinearGradient();\n context.strokeStyle = gradient || fill;\n context.stroke();\n context.restore();\n }\n if (shouldLineThrough) {\n context.save();\n context.beginPath();\n context.moveTo(lineTranslateX, translateY + lineTranslateY);\n spacesNumber = text.split(' ').length - 1;\n oneWord = spacesNumber === 0;\n lineWidth =\n align === JUSTIFY && lastLine && !oneWord\n ? totalWidth - padding * 2\n : width;\n context.lineTo(lineTranslateX + Math.round(lineWidth), translateY + lineTranslateY);\n context.lineWidth = fontSize / 15;\n const gradient = this._getLinearGradient();\n context.strokeStyle = gradient || fill;\n context.stroke();\n context.restore();\n }\n if (direction !== RTL && (letterSpacing !== 0 || align === JUSTIFY)) {\n spacesNumber = text.split(' ').length - 1;\n var array = stringToArray(text);\n for (var li = 0; li < array.length; li++) {\n var letter = array[li];\n if (letter === ' ' && !lastLine && align === JUSTIFY) {\n lineTranslateX += (totalWidth - padding * 2 - width) / spacesNumber;\n }\n this._partialTextX = lineTranslateX;\n this._partialTextY = translateY + lineTranslateY;\n this._partialText = letter;\n context.fillStrokeShape(this);\n lineTranslateX += this.measureSize(letter).width + letterSpacing;\n }\n }\n else {\n if (letterSpacing !== 0) {\n context.setAttr('letterSpacing', `${letterSpacing}px`);\n }\n this._partialTextX = lineTranslateX;\n this._partialTextY = translateY + lineTranslateY;\n this._partialText = text;\n context.fillStrokeShape(this);\n }\n context.restore();\n if (textArrLen > 1) {\n translateY += lineHeightPx;\n }\n }\n }\n _hitFunc(context) {\n var width = this.getWidth(), height = this.getHeight();\n context.beginPath();\n context.rect(0, 0, width, height);\n context.closePath();\n context.fillStrokeShape(this);\n }\n setText(text) {\n var str = Util_1.Util._isString(text)\n ? text\n : text === null || text === undefined\n ? ''\n : text + '';\n this._setAttr(TEXT, str);\n return this;\n }\n getWidth() {\n var isAuto = this.attrs.width === AUTO || this.attrs.width === undefined;\n return isAuto ? this.getTextWidth() + this.padding() * 2 : this.attrs.width;\n }\n getHeight() {\n var isAuto = this.attrs.height === AUTO || this.attrs.height === undefined;\n return isAuto\n ? this.fontSize() * this.textArr.length * this.lineHeight() +\n this.padding() * 2\n : this.attrs.height;\n }\n getTextWidth() {\n return this.textWidth;\n }\n getTextHeight() {\n Util_1.Util.warn('text.getTextHeight() method is deprecated. Use text.height() - for full height and text.fontSize() - for one line height.');\n return this.textHeight;\n }\n measureSize(text) {\n var _context = getDummyContext(), fontSize = this.fontSize(), metrics;\n _context.save();\n _context.font = this._getContextFont();\n metrics = _context.measureText(text);\n _context.restore();\n return {\n width: metrics.width,\n height: fontSize,\n };\n }\n _getContextFont() {\n return (this.fontStyle() +\n SPACE +\n this.fontVariant() +\n SPACE +\n (this.fontSize() + PX_SPACE) +\n normalizeFontFamily(this.fontFamily()));\n }\n _addTextLine(line) {\n const align = this.align();\n if (align === JUSTIFY) {\n line = line.trim();\n }\n var width = this._getTextWidth(line);\n return this.textArr.push({\n text: line,\n width: width,\n lastInParagraph: false,\n });\n }\n _getTextWidth(text) {\n var letterSpacing = this.letterSpacing();\n var length = text.length;\n return (getDummyContext().measureText(text).width +\n (length ? letterSpacing * (length - 1) : 0));\n }\n _setTextData() {\n var lines = this.text().split('\\n'), fontSize = +this.fontSize(), textWidth = 0, lineHeightPx = this.lineHeight() * fontSize, width = this.attrs.width, height = this.attrs.height, fixedWidth = width !== AUTO && width !== undefined, fixedHeight = height !== AUTO && height !== undefined, padding = this.padding(), maxWidth = width - padding * 2, maxHeightPx = height - padding * 2, currentHeightPx = 0, wrap = this.wrap(), shouldWrap = wrap !== NONE, wrapAtWord = wrap !== CHAR && shouldWrap, shouldAddEllipsis = this.ellipsis();\n this.textArr = [];\n getDummyContext().font = this._getContextFont();\n var additionalWidth = shouldAddEllipsis ? this._getTextWidth(ELLIPSIS) : 0;\n for (var i = 0, max = lines.length; i < max; ++i) {\n var line = lines[i];\n var lineWidth = this._getTextWidth(line);\n if (fixedWidth && lineWidth > maxWidth) {\n while (line.length > 0) {\n var low = 0, high = line.length, match = '', matchWidth = 0;\n while (low < high) {\n var mid = (low + high) >>> 1, substr = line.slice(0, mid + 1), substrWidth = this._getTextWidth(substr) + additionalWidth;\n if (substrWidth <= maxWidth) {\n low = mid + 1;\n match = substr;\n matchWidth = substrWidth;\n }\n else {\n high = mid;\n }\n }\n if (match) {\n if (wrapAtWord) {\n var wrapIndex;\n var nextChar = line[match.length];\n var nextIsSpaceOrDash = nextChar === SPACE || nextChar === DASH;\n if (nextIsSpaceOrDash && matchWidth <= maxWidth) {\n wrapIndex = match.length;\n }\n else {\n wrapIndex =\n Math.max(match.lastIndexOf(SPACE), match.lastIndexOf(DASH)) +\n 1;\n }\n if (wrapIndex > 0) {\n low = wrapIndex;\n match = match.slice(0, low);\n matchWidth = this._getTextWidth(match);\n }\n }\n match = match.trimRight();\n this._addTextLine(match);\n textWidth = Math.max(textWidth, matchWidth);\n currentHeightPx += lineHeightPx;\n var shouldHandleEllipsis = this._shouldHandleEllipsis(currentHeightPx);\n if (shouldHandleEllipsis) {\n this._tryToAddEllipsisToLastLine();\n break;\n }\n line = line.slice(low);\n line = line.trimLeft();\n if (line.length > 0) {\n lineWidth = this._getTextWidth(line);\n if (lineWidth <= maxWidth) {\n this._addTextLine(line);\n currentHeightPx += lineHeightPx;\n textWidth = Math.max(textWidth, lineWidth);\n break;\n }\n }\n }\n else {\n break;\n }\n }\n }\n else {\n this._addTextLine(line);\n currentHeightPx += lineHeightPx;\n textWidth = Math.max(textWidth, lineWidth);\n if (this._shouldHandleEllipsis(currentHeightPx) && i < max - 1) {\n this._tryToAddEllipsisToLastLine();\n }\n }\n if (this.textArr[this.textArr.length - 1]) {\n this.textArr[this.textArr.length - 1].lastInParagraph = true;\n }\n if (fixedHeight && currentHeightPx + lineHeightPx > maxHeightPx) {\n break;\n }\n }\n this.textHeight = fontSize;\n this.textWidth = textWidth;\n }\n _shouldHandleEllipsis(currentHeightPx) {\n var fontSize = +this.fontSize(), lineHeightPx = this.lineHeight() * fontSize, height = this.attrs.height, fixedHeight = height !== AUTO && height !== undefined, padding = this.padding(), maxHeightPx = height - padding * 2, wrap = this.wrap(), shouldWrap = wrap !== NONE;\n return (!shouldWrap ||\n (fixedHeight && currentHeightPx + lineHeightPx > maxHeightPx));\n }\n _tryToAddEllipsisToLastLine() {\n var width = this.attrs.width, fixedWidth = width !== AUTO && width !== undefined, padding = this.padding(), maxWidth = width - padding * 2, shouldAddEllipsis = this.ellipsis();\n var lastLine = this.textArr[this.textArr.length - 1];\n if (!lastLine || !shouldAddEllipsis) {\n return;\n }\n if (fixedWidth) {\n var haveSpace = this._getTextWidth(lastLine.text + ELLIPSIS) < maxWidth;\n if (!haveSpace) {\n lastLine.text = lastLine.text.slice(0, lastLine.text.length - 3);\n }\n }\n this.textArr.splice(this.textArr.length - 1, 1);\n this._addTextLine(lastLine.text + ELLIPSIS);\n }\n getStrokeScaleEnabled() {\n return true;\n }\n _useBufferCanvas() {\n const hasLine = this.textDecoration().indexOf('underline') !== -1 ||\n this.textDecoration().indexOf('line-through') !== -1;\n const hasShadow = this.hasShadow();\n if (hasLine && hasShadow) {\n return true;\n }\n return super._useBufferCanvas();\n }\n}\nexports.Text = Text;\nText.prototype._fillFunc = _fillFunc;\nText.prototype._strokeFunc = _strokeFunc;\nText.prototype.className = TEXT_UPPER;\nText.prototype._attrsAffectingSize = [\n 'text',\n 'fontSize',\n 'padding',\n 'wrap',\n 'lineHeight',\n 'letterSpacing',\n];\n(0, Global_1._registerNode)(Text);\nFactory_1.Factory.overWriteSetter(Text, 'width', (0, Validators_1.getNumberOrAutoValidator)());\nFactory_1.Factory.overWriteSetter(Text, 'height', (0, Validators_1.getNumberOrAutoValidator)());\nFactory_1.Factory.addGetterSetter(Text, 'direction', INHERIT);\nFactory_1.Factory.addGetterSetter(Text, 'fontFamily', 'Arial');\nFactory_1.Factory.addGetterSetter(Text, 'fontSize', 12, (0, Validators_1.getNumberValidator)());\nFactory_1.Factory.addGetterSetter(Text, 'fontStyle', NORMAL);\nFactory_1.Factory.addGetterSetter(Text, 'fontVariant', NORMAL);\nFactory_1.Factory.addGetterSetter(Text, 'padding', 0, (0, Validators_1.getNumberValidator)());\nFactory_1.Factory.addGetterSetter(Text, 'align', LEFT);\nFactory_1.Factory.addGetterSetter(Text, 'verticalAlign', TOP);\nFactory_1.Factory.addGetterSetter(Text, 'lineHeight', 1, (0, Validators_1.getNumberValidator)());\nFactory_1.Factory.addGetterSetter(Text, 'wrap', WORD);\nFactory_1.Factory.addGetterSetter(Text, 'ellipsis', false, (0, Validators_1.getBooleanValidator)());\nFactory_1.Factory.addGetterSetter(Text, 'letterSpacing', 0, (0, Validators_1.getNumberValidator)());\nFactory_1.Factory.addGetterSetter(Text, 'text', '', (0, Validators_1.getStringValidator)());\nFactory_1.Factory.addGetterSetter(Text, 'textDecoration', '');\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.TextPath = void 0;\nconst Util_1 = require(\"../Util\");\nconst Factory_1 = require(\"../Factory\");\nconst Shape_1 = require(\"../Shape\");\nconst Path_1 = require(\"./Path\");\nconst Text_1 = require(\"./Text\");\nconst Validators_1 = require(\"../Validators\");\nconst Global_1 = require(\"../Global\");\nvar EMPTY_STRING = '', NORMAL = 'normal';\nfunction _fillFunc(context) {\n context.fillText(this.partialText, 0, 0);\n}\nfunction _strokeFunc(context) {\n context.strokeText(this.partialText, 0, 0);\n}\nclass TextPath extends Shape_1.Shape {\n constructor(config) {\n super(config);\n this.dummyCanvas = Util_1.Util.createCanvasElement();\n this.dataArray = [];\n this._readDataAttribute();\n this.on('dataChange.konva', function () {\n this._readDataAttribute();\n this._setTextData();\n });\n this.on('textChange.konva alignChange.konva letterSpacingChange.konva kerningFuncChange.konva fontSizeChange.konva fontFamilyChange.konva', this._setTextData);\n this._setTextData();\n }\n _getTextPathLength() {\n return Path_1.Path.getPathLength(this.dataArray);\n }\n _getPointAtLength(length) {\n if (!this.attrs.data) {\n return null;\n }\n const totalLength = this.pathLength;\n if (length - 1 > totalLength) {\n return null;\n }\n return Path_1.Path.getPointAtLengthOfDataArray(length, this.dataArray);\n }\n _readDataAttribute() {\n this.dataArray = Path_1.Path.parsePathData(this.attrs.data);\n this.pathLength = this._getTextPathLength();\n }\n _sceneFunc(context) {\n context.setAttr('font', this._getContextFont());\n context.setAttr('textBaseline', this.textBaseline());\n context.setAttr('textAlign', 'left');\n context.save();\n var textDecoration = this.textDecoration();\n var fill = this.fill();\n var fontSize = this.fontSize();\n var glyphInfo = this.glyphInfo;\n if (textDecoration === 'underline') {\n context.beginPath();\n }\n for (var i = 0; i < glyphInfo.length; i++) {\n context.save();\n var p0 = glyphInfo[i].p0;\n context.translate(p0.x, p0.y);\n context.rotate(glyphInfo[i].rotation);\n this.partialText = glyphInfo[i].text;\n context.fillStrokeShape(this);\n if (textDecoration === 'underline') {\n if (i === 0) {\n context.moveTo(0, fontSize / 2 + 1);\n }\n context.lineTo(fontSize, fontSize / 2 + 1);\n }\n context.restore();\n }\n if (textDecoration === 'underline') {\n context.strokeStyle = fill;\n context.lineWidth = fontSize / 20;\n context.stroke();\n }\n context.restore();\n }\n _hitFunc(context) {\n context.beginPath();\n var glyphInfo = this.glyphInfo;\n if (glyphInfo.length >= 1) {\n var p0 = glyphInfo[0].p0;\n context.moveTo(p0.x, p0.y);\n }\n for (var i = 0; i < glyphInfo.length; i++) {\n var p1 = glyphInfo[i].p1;\n context.lineTo(p1.x, p1.y);\n }\n context.setAttr('lineWidth', this.fontSize());\n context.setAttr('strokeStyle', this.colorKey);\n context.stroke();\n }\n getTextWidth() {\n return this.textWidth;\n }\n getTextHeight() {\n Util_1.Util.warn('text.getTextHeight() method is deprecated. Use text.height() - for full height and text.fontSize() - for one line height.');\n return this.textHeight;\n }\n setText(text) {\n return Text_1.Text.prototype.setText.call(this, text);\n }\n _getContextFont() {\n return Text_1.Text.prototype._getContextFont.call(this);\n }\n _getTextSize(text) {\n var dummyCanvas = this.dummyCanvas;\n var _context = dummyCanvas.getContext('2d');\n _context.save();\n _context.font = this._getContextFont();\n var metrics = _context.measureText(text);\n _context.restore();\n return {\n width: metrics.width,\n height: parseInt(`${this.fontSize()}`, 10),\n };\n }\n _setTextData() {\n const { width, height } = this._getTextSize(this.attrs.text);\n this.textWidth = width;\n this.textHeight = height;\n this.glyphInfo = [];\n if (!this.attrs.data) {\n return null;\n }\n const letterSpacing = this.letterSpacing();\n const align = this.align();\n const kerningFunc = this.kerningFunc();\n const textWidth = Math.max(this.textWidth + ((this.attrs.text || '').length - 1) * letterSpacing, 0);\n let offset = 0;\n if (align === 'center') {\n offset = Math.max(0, this.pathLength / 2 - textWidth / 2);\n }\n if (align === 'right') {\n offset = Math.max(0, this.pathLength - textWidth);\n }\n const charArr = (0, Text_1.stringToArray)(this.text());\n let offsetToGlyph = offset;\n for (var i = 0; i < charArr.length; i++) {\n const charStartPoint = this._getPointAtLength(offsetToGlyph);\n if (!charStartPoint)\n return;\n let glyphWidth = this._getTextSize(charArr[i]).width + letterSpacing;\n if (charArr[i] === ' ' && align === 'justify') {\n const numberOfSpaces = this.text().split(' ').length - 1;\n glyphWidth += (this.pathLength - textWidth) / numberOfSpaces;\n }\n const charEndPoint = this._getPointAtLength(offsetToGlyph + glyphWidth);\n if (!charEndPoint)\n return;\n const width = Path_1.Path.getLineLength(charStartPoint.x, charStartPoint.y, charEndPoint.x, charEndPoint.y);\n let kern = 0;\n if (kerningFunc) {\n try {\n kern = kerningFunc(charArr[i - 1], charArr[i]) * this.fontSize();\n }\n catch (e) {\n kern = 0;\n }\n }\n charStartPoint.x += kern;\n charEndPoint.x += kern;\n this.textWidth += kern;\n const midpoint = Path_1.Path.getPointOnLine(kern + width / 2.0, charStartPoint.x, charStartPoint.y, charEndPoint.x, charEndPoint.y);\n const rotation = Math.atan2(charEndPoint.y - charStartPoint.y, charEndPoint.x - charStartPoint.x);\n this.glyphInfo.push({\n transposeX: midpoint.x,\n transposeY: midpoint.y,\n text: charArr[i],\n rotation: rotation,\n p0: charStartPoint,\n p1: charEndPoint,\n });\n offsetToGlyph += glyphWidth;\n }\n }\n getSelfRect() {\n if (!this.glyphInfo.length) {\n return {\n x: 0,\n y: 0,\n width: 0,\n height: 0,\n };\n }\n var points = [];\n this.glyphInfo.forEach(function (info) {\n points.push(info.p0.x);\n points.push(info.p0.y);\n points.push(info.p1.x);\n points.push(info.p1.y);\n });\n var minX = points[0] || 0;\n var maxX = points[0] || 0;\n var minY = points[1] || 0;\n var maxY = points[1] || 0;\n var x, y;\n for (var i = 0; i < points.length / 2; i++) {\n x = points[i * 2];\n y = points[i * 2 + 1];\n minX = Math.min(minX, x);\n maxX = Math.max(maxX, x);\n minY = Math.min(minY, y);\n maxY = Math.max(maxY, y);\n }\n var fontSize = this.fontSize();\n return {\n x: minX - fontSize / 2,\n y: minY - fontSize / 2,\n width: maxX - minX + fontSize,\n height: maxY - minY + fontSize,\n };\n }\n destroy() {\n Util_1.Util.releaseCanvas(this.dummyCanvas);\n return super.destroy();\n }\n}\nexports.TextPath = TextPath;\nTextPath.prototype._fillFunc = _fillFunc;\nTextPath.prototype._strokeFunc = _strokeFunc;\nTextPath.prototype._fillFuncHit = _fillFunc;\nTextPath.prototype._strokeFuncHit = _strokeFunc;\nTextPath.prototype.className = 'TextPath';\nTextPath.prototype._attrsAffectingSize = ['text', 'fontSize', 'data'];\n(0, Global_1._registerNode)(TextPath);\nFactory_1.Factory.addGetterSetter(TextPath, 'data');\nFactory_1.Factory.addGetterSetter(TextPath, 'fontFamily', 'Arial');\nFactory_1.Factory.addGetterSetter(TextPath, 'fontSize', 12, (0, Validators_1.getNumberValidator)());\nFactory_1.Factory.addGetterSetter(TextPath, 'fontStyle', NORMAL);\nFactory_1.Factory.addGetterSetter(TextPath, 'align', 'left');\nFactory_1.Factory.addGetterSetter(TextPath, 'letterSpacing', 0, (0, Validators_1.getNumberValidator)());\nFactory_1.Factory.addGetterSetter(TextPath, 'textBaseline', 'middle');\nFactory_1.Factory.addGetterSetter(TextPath, 'fontVariant', NORMAL);\nFactory_1.Factory.addGetterSetter(TextPath, 'text', EMPTY_STRING);\nFactory_1.Factory.addGetterSetter(TextPath, 'textDecoration', null);\nFactory_1.Factory.addGetterSetter(TextPath, 'kerningFunc', null);\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Transformer = void 0;\nconst Util_1 = require(\"../Util\");\nconst Factory_1 = require(\"../Factory\");\nconst Node_1 = require(\"../Node\");\nconst Shape_1 = require(\"../Shape\");\nconst Rect_1 = require(\"./Rect\");\nconst Group_1 = require(\"../Group\");\nconst Global_1 = require(\"../Global\");\nconst Validators_1 = require(\"../Validators\");\nconst Global_2 = require(\"../Global\");\nvar EVENTS_NAME = 'tr-konva';\nvar ATTR_CHANGE_LIST = [\n 'resizeEnabledChange',\n 'rotateAnchorOffsetChange',\n 'rotateEnabledChange',\n 'enabledAnchorsChange',\n 'anchorSizeChange',\n 'borderEnabledChange',\n 'borderStrokeChange',\n 'borderStrokeWidthChange',\n 'borderDashChange',\n 'anchorStrokeChange',\n 'anchorStrokeWidthChange',\n 'anchorFillChange',\n 'anchorCornerRadiusChange',\n 'ignoreStrokeChange',\n 'anchorStyleFuncChange',\n]\n .map((e) => e + `.${EVENTS_NAME}`)\n .join(' ');\nvar NODES_RECT = 'nodesRect';\nvar TRANSFORM_CHANGE_STR = [\n 'widthChange',\n 'heightChange',\n 'scaleXChange',\n 'scaleYChange',\n 'skewXChange',\n 'skewYChange',\n 'rotationChange',\n 'offsetXChange',\n 'offsetYChange',\n 'transformsEnabledChange',\n 'strokeWidthChange',\n];\nvar ANGLES = {\n 'top-left': -45,\n 'top-center': 0,\n 'top-right': 45,\n 'middle-right': -90,\n 'middle-left': 90,\n 'bottom-left': -135,\n 'bottom-center': 180,\n 'bottom-right': 135,\n};\nconst TOUCH_DEVICE = 'ontouchstart' in Global_1.Konva._global;\nfunction getCursor(anchorName, rad, rotateCursor) {\n if (anchorName === 'rotater') {\n return rotateCursor;\n }\n rad += Util_1.Util.degToRad(ANGLES[anchorName] || 0);\n var angle = ((Util_1.Util.radToDeg(rad) % 360) + 360) % 360;\n if (Util_1.Util._inRange(angle, 315 + 22.5, 360) || Util_1.Util._inRange(angle, 0, 22.5)) {\n return 'ns-resize';\n }\n else if (Util_1.Util._inRange(angle, 45 - 22.5, 45 + 22.5)) {\n return 'nesw-resize';\n }\n else if (Util_1.Util._inRange(angle, 90 - 22.5, 90 + 22.5)) {\n return 'ew-resize';\n }\n else if (Util_1.Util._inRange(angle, 135 - 22.5, 135 + 22.5)) {\n return 'nwse-resize';\n }\n else if (Util_1.Util._inRange(angle, 180 - 22.5, 180 + 22.5)) {\n return 'ns-resize';\n }\n else if (Util_1.Util._inRange(angle, 225 - 22.5, 225 + 22.5)) {\n return 'nesw-resize';\n }\n else if (Util_1.Util._inRange(angle, 270 - 22.5, 270 + 22.5)) {\n return 'ew-resize';\n }\n else if (Util_1.Util._inRange(angle, 315 - 22.5, 315 + 22.5)) {\n return 'nwse-resize';\n }\n else {\n Util_1.Util.error('Transformer has unknown angle for cursor detection: ' + angle);\n return 'pointer';\n }\n}\nvar ANCHORS_NAMES = [\n 'top-left',\n 'top-center',\n 'top-right',\n 'middle-right',\n 'middle-left',\n 'bottom-left',\n 'bottom-center',\n 'bottom-right',\n];\nvar MAX_SAFE_INTEGER = 100000000;\nfunction getCenter(shape) {\n return {\n x: shape.x +\n (shape.width / 2) * Math.cos(shape.rotation) +\n (shape.height / 2) * Math.sin(-shape.rotation),\n y: shape.y +\n (shape.height / 2) * Math.cos(shape.rotation) +\n (shape.width / 2) * Math.sin(shape.rotation),\n };\n}\nfunction rotateAroundPoint(shape, angleRad, point) {\n const x = point.x +\n (shape.x - point.x) * Math.cos(angleRad) -\n (shape.y - point.y) * Math.sin(angleRad);\n const y = point.y +\n (shape.x - point.x) * Math.sin(angleRad) +\n (shape.y - point.y) * Math.cos(angleRad);\n return {\n ...shape,\n rotation: shape.rotation + angleRad,\n x,\n y,\n };\n}\nfunction rotateAroundCenter(shape, deltaRad) {\n const center = getCenter(shape);\n return rotateAroundPoint(shape, deltaRad, center);\n}\nfunction getSnap(snaps, newRotationRad, tol) {\n let snapped = newRotationRad;\n for (let i = 0; i < snaps.length; i++) {\n const angle = Global_1.Konva.getAngle(snaps[i]);\n const absDiff = Math.abs(angle - newRotationRad) % (Math.PI * 2);\n const dif = Math.min(absDiff, Math.PI * 2 - absDiff);\n if (dif < tol) {\n snapped = angle;\n }\n }\n return snapped;\n}\nlet activeTransformersCount = 0;\nclass Transformer extends Group_1.Group {\n constructor(config) {\n super(config);\n this._movingAnchorName = null;\n this._transforming = false;\n this._createElements();\n this._handleMouseMove = this._handleMouseMove.bind(this);\n this._handleMouseUp = this._handleMouseUp.bind(this);\n this.update = this.update.bind(this);\n this.on(ATTR_CHANGE_LIST, this.update);\n if (this.getNode()) {\n this.update();\n }\n }\n attachTo(node) {\n this.setNode(node);\n return this;\n }\n setNode(node) {\n Util_1.Util.warn('tr.setNode(shape), tr.node(shape) and tr.attachTo(shape) methods are deprecated. Please use tr.nodes(nodesArray) instead.');\n return this.setNodes([node]);\n }\n getNode() {\n return this._nodes && this._nodes[0];\n }\n _getEventNamespace() {\n return EVENTS_NAME + this._id;\n }\n setNodes(nodes = []) {\n if (this._nodes && this._nodes.length) {\n this.detach();\n }\n const filteredNodes = nodes.filter((node) => {\n if (node.isAncestorOf(this)) {\n Util_1.Util.error('Konva.Transformer cannot be an a child of the node you are trying to attach');\n return false;\n }\n return true;\n });\n this._nodes = nodes = filteredNodes;\n if (nodes.length === 1 && this.useSingleNodeRotation()) {\n this.rotation(nodes[0].getAbsoluteRotation());\n }\n else {\n this.rotation(0);\n }\n this._nodes.forEach((node) => {\n const onChange = () => {\n if (this.nodes().length === 1 && this.useSingleNodeRotation()) {\n this.rotation(this.nodes()[0].getAbsoluteRotation());\n }\n this._resetTransformCache();\n if (!this._transforming && !this.isDragging()) {\n this.update();\n }\n };\n const additionalEvents = node._attrsAffectingSize\n .map((prop) => prop + 'Change.' + this._getEventNamespace())\n .join(' ');\n node.on(additionalEvents, onChange);\n node.on(TRANSFORM_CHANGE_STR.map((e) => e + `.${this._getEventNamespace()}`).join(' '), onChange);\n node.on(`absoluteTransformChange.${this._getEventNamespace()}`, onChange);\n this._proxyDrag(node);\n });\n this._resetTransformCache();\n var elementsCreated = !!this.findOne('.top-left');\n if (elementsCreated) {\n this.update();\n }\n return this;\n }\n _proxyDrag(node) {\n let lastPos;\n node.on(`dragstart.${this._getEventNamespace()}`, (e) => {\n lastPos = node.getAbsolutePosition();\n if (!this.isDragging() && node !== this.findOne('.back')) {\n this.startDrag(e, false);\n }\n });\n node.on(`dragmove.${this._getEventNamespace()}`, (e) => {\n if (!lastPos) {\n return;\n }\n const abs = node.getAbsolutePosition();\n const dx = abs.x - lastPos.x;\n const dy = abs.y - lastPos.y;\n this.nodes().forEach((otherNode) => {\n if (otherNode === node) {\n return;\n }\n if (otherNode.isDragging()) {\n return;\n }\n const otherAbs = otherNode.getAbsolutePosition();\n otherNode.setAbsolutePosition({\n x: otherAbs.x + dx,\n y: otherAbs.y + dy,\n });\n otherNode.startDrag(e);\n });\n lastPos = null;\n });\n }\n getNodes() {\n return this._nodes || [];\n }\n getActiveAnchor() {\n return this._movingAnchorName;\n }\n detach() {\n if (this._nodes) {\n this._nodes.forEach((node) => {\n node.off('.' + this._getEventNamespace());\n });\n }\n this._nodes = [];\n this._resetTransformCache();\n }\n _resetTransformCache() {\n this._clearCache(NODES_RECT);\n this._clearCache('transform');\n this._clearSelfAndDescendantCache('absoluteTransform');\n }\n _getNodeRect() {\n return this._getCache(NODES_RECT, this.__getNodeRect);\n }\n __getNodeShape(node, rot = this.rotation(), relative) {\n var rect = node.getClientRect({\n skipTransform: true,\n skipShadow: true,\n skipStroke: this.ignoreStroke(),\n });\n var absScale = node.getAbsoluteScale(relative);\n var absPos = node.getAbsolutePosition(relative);\n var dx = rect.x * absScale.x - node.offsetX() * absScale.x;\n var dy = rect.y * absScale.y - node.offsetY() * absScale.y;\n const rotation = (Global_1.Konva.getAngle(node.getAbsoluteRotation()) + Math.PI * 2) %\n (Math.PI * 2);\n const box = {\n x: absPos.x + dx * Math.cos(rotation) + dy * Math.sin(-rotation),\n y: absPos.y + dy * Math.cos(rotation) + dx * Math.sin(rotation),\n width: rect.width * absScale.x,\n height: rect.height * absScale.y,\n rotation: rotation,\n };\n return rotateAroundPoint(box, -Global_1.Konva.getAngle(rot), {\n x: 0,\n y: 0,\n });\n }\n __getNodeRect() {\n var node = this.getNode();\n if (!node) {\n return {\n x: -MAX_SAFE_INTEGER,\n y: -MAX_SAFE_INTEGER,\n width: 0,\n height: 0,\n rotation: 0,\n };\n }\n const totalPoints = [];\n this.nodes().map((node) => {\n const box = node.getClientRect({\n skipTransform: true,\n skipShadow: true,\n skipStroke: this.ignoreStroke(),\n });\n var points = [\n { x: box.x, y: box.y },\n { x: box.x + box.width, y: box.y },\n { x: box.x + box.width, y: box.y + box.height },\n { x: box.x, y: box.y + box.height },\n ];\n var trans = node.getAbsoluteTransform();\n points.forEach(function (point) {\n var transformed = trans.point(point);\n totalPoints.push(transformed);\n });\n });\n const tr = new Util_1.Transform();\n tr.rotate(-Global_1.Konva.getAngle(this.rotation()));\n var minX = Infinity, minY = Infinity, maxX = -Infinity, maxY = -Infinity;\n totalPoints.forEach(function (point) {\n var transformed = tr.point(point);\n if (minX === undefined) {\n minX = maxX = transformed.x;\n minY = maxY = transformed.y;\n }\n minX = Math.min(minX, transformed.x);\n minY = Math.min(minY, transformed.y);\n maxX = Math.max(maxX, transformed.x);\n maxY = Math.max(maxY, transformed.y);\n });\n tr.invert();\n const p = tr.point({ x: minX, y: minY });\n return {\n x: p.x,\n y: p.y,\n width: maxX - minX,\n height: maxY - minY,\n rotation: Global_1.Konva.getAngle(this.rotation()),\n };\n }\n getX() {\n return this._getNodeRect().x;\n }\n getY() {\n return this._getNodeRect().y;\n }\n getWidth() {\n return this._getNodeRect().width;\n }\n getHeight() {\n return this._getNodeRect().height;\n }\n _createElements() {\n this._createBack();\n ANCHORS_NAMES.forEach((name) => {\n this._createAnchor(name);\n });\n this._createAnchor('rotater');\n }\n _createAnchor(name) {\n var anchor = new Rect_1.Rect({\n stroke: 'rgb(0, 161, 255)',\n fill: 'white',\n strokeWidth: 1,\n name: name + ' _anchor',\n dragDistance: 0,\n draggable: true,\n hitStrokeWidth: TOUCH_DEVICE ? 10 : 'auto',\n });\n var self = this;\n anchor.on('mousedown touchstart', function (e) {\n self._handleMouseDown(e);\n });\n anchor.on('dragstart', (e) => {\n anchor.stopDrag();\n e.cancelBubble = true;\n });\n anchor.on('dragend', (e) => {\n e.cancelBubble = true;\n });\n anchor.on('mouseenter', () => {\n var rad = Global_1.Konva.getAngle(this.rotation());\n var rotateCursor = this.rotateAnchorCursor();\n var cursor = getCursor(name, rad, rotateCursor);\n anchor.getStage().content &&\n (anchor.getStage().content.style.cursor = cursor);\n this._cursorChange = true;\n });\n anchor.on('mouseout', () => {\n anchor.getStage().content &&\n (anchor.getStage().content.style.cursor = '');\n this._cursorChange = false;\n });\n this.add(anchor);\n }\n _createBack() {\n var back = new Shape_1.Shape({\n name: 'back',\n width: 0,\n height: 0,\n draggable: true,\n sceneFunc(ctx, shape) {\n var tr = shape.getParent();\n var padding = tr.padding();\n ctx.beginPath();\n ctx.rect(-padding, -padding, shape.width() + padding * 2, shape.height() + padding * 2);\n ctx.moveTo(shape.width() / 2, -padding);\n if (tr.rotateEnabled() && tr.rotateLineVisible()) {\n ctx.lineTo(shape.width() / 2, -tr.rotateAnchorOffset() * Util_1.Util._sign(shape.height()) - padding);\n }\n ctx.fillStrokeShape(shape);\n },\n hitFunc: (ctx, shape) => {\n if (!this.shouldOverdrawWholeArea()) {\n return;\n }\n var padding = this.padding();\n ctx.beginPath();\n ctx.rect(-padding, -padding, shape.width() + padding * 2, shape.height() + padding * 2);\n ctx.fillStrokeShape(shape);\n },\n });\n this.add(back);\n this._proxyDrag(back);\n back.on('dragstart', (e) => {\n e.cancelBubble = true;\n });\n back.on('dragmove', (e) => {\n e.cancelBubble = true;\n });\n back.on('dragend', (e) => {\n e.cancelBubble = true;\n });\n this.on('dragmove', (e) => {\n this.update();\n });\n }\n _handleMouseDown(e) {\n this._movingAnchorName = e.target.name().split(' ')[0];\n var attrs = this._getNodeRect();\n var width = attrs.width;\n var height = attrs.height;\n var hypotenuse = Math.sqrt(Math.pow(width, 2) + Math.pow(height, 2));\n this.sin = Math.abs(height / hypotenuse);\n this.cos = Math.abs(width / hypotenuse);\n if (typeof window !== 'undefined') {\n window.addEventListener('mousemove', this._handleMouseMove);\n window.addEventListener('touchmove', this._handleMouseMove);\n window.addEventListener('mouseup', this._handleMouseUp, true);\n window.addEventListener('touchend', this._handleMouseUp, true);\n }\n this._transforming = true;\n var ap = e.target.getAbsolutePosition();\n var pos = e.target.getStage().getPointerPosition();\n this._anchorDragOffset = {\n x: pos.x - ap.x,\n y: pos.y - ap.y,\n };\n activeTransformersCount++;\n this._fire('transformstart', { evt: e.evt, target: this.getNode() });\n this._nodes.forEach((target) => {\n target._fire('transformstart', { evt: e.evt, target });\n });\n }\n _handleMouseMove(e) {\n var x, y, newHypotenuse;\n var anchorNode = this.findOne('.' + this._movingAnchorName);\n var stage = anchorNode.getStage();\n stage.setPointersPositions(e);\n const pp = stage.getPointerPosition();\n let newNodePos = {\n x: pp.x - this._anchorDragOffset.x,\n y: pp.y - this._anchorDragOffset.y,\n };\n const oldAbs = anchorNode.getAbsolutePosition();\n if (this.anchorDragBoundFunc()) {\n newNodePos = this.anchorDragBoundFunc()(oldAbs, newNodePos, e);\n }\n anchorNode.setAbsolutePosition(newNodePos);\n const newAbs = anchorNode.getAbsolutePosition();\n if (oldAbs.x === newAbs.x && oldAbs.y === newAbs.y) {\n return;\n }\n if (this._movingAnchorName === 'rotater') {\n var attrs = this._getNodeRect();\n x = anchorNode.x() - attrs.width / 2;\n y = -anchorNode.y() + attrs.height / 2;\n let delta = Math.atan2(-y, x) + Math.PI / 2;\n if (attrs.height < 0) {\n delta -= Math.PI;\n }\n var oldRotation = Global_1.Konva.getAngle(this.rotation());\n const newRotation = oldRotation + delta;\n const tol = Global_1.Konva.getAngle(this.rotationSnapTolerance());\n const snappedRot = getSnap(this.rotationSnaps(), newRotation, tol);\n const diff = snappedRot - attrs.rotation;\n const shape = rotateAroundCenter(attrs, diff);\n this._fitNodesInto(shape, e);\n return;\n }\n var shiftBehavior = this.shiftBehavior();\n var keepProportion;\n if (shiftBehavior === 'inverted') {\n keepProportion = this.keepRatio() && !e.shiftKey;\n }\n else if (shiftBehavior === 'none') {\n keepProportion = this.keepRatio();\n }\n else {\n keepProportion = this.keepRatio() || e.shiftKey;\n }\n var centeredScaling = this.centeredScaling() || e.altKey;\n if (this._movingAnchorName === 'top-left') {\n if (keepProportion) {\n var comparePoint = centeredScaling\n ? {\n x: this.width() / 2,\n y: this.height() / 2,\n }\n : {\n x: this.findOne('.bottom-right').x(),\n y: this.findOne('.bottom-right').y(),\n };\n newHypotenuse = Math.sqrt(Math.pow(comparePoint.x - anchorNode.x(), 2) +\n Math.pow(comparePoint.y - anchorNode.y(), 2));\n var reverseX = this.findOne('.top-left').x() > comparePoint.x ? -1 : 1;\n var reverseY = this.findOne('.top-left').y() > comparePoint.y ? -1 : 1;\n x = newHypotenuse * this.cos * reverseX;\n y = newHypotenuse * this.sin * reverseY;\n this.findOne('.top-left').x(comparePoint.x - x);\n this.findOne('.top-left').y(comparePoint.y - y);\n }\n }\n else if (this._movingAnchorName === 'top-center') {\n this.findOne('.top-left').y(anchorNode.y());\n }\n else if (this._movingAnchorName === 'top-right') {\n if (keepProportion) {\n var comparePoint = centeredScaling\n ? {\n x: this.width() / 2,\n y: this.height() / 2,\n }\n : {\n x: this.findOne('.bottom-left').x(),\n y: this.findOne('.bottom-left').y(),\n };\n newHypotenuse = Math.sqrt(Math.pow(anchorNode.x() - comparePoint.x, 2) +\n Math.pow(comparePoint.y - anchorNode.y(), 2));\n var reverseX = this.findOne('.top-right').x() < comparePoint.x ? -1 : 1;\n var reverseY = this.findOne('.top-right').y() > comparePoint.y ? -1 : 1;\n x = newHypotenuse * this.cos * reverseX;\n y = newHypotenuse * this.sin * reverseY;\n this.findOne('.top-right').x(comparePoint.x + x);\n this.findOne('.top-right').y(comparePoint.y - y);\n }\n var pos = anchorNode.position();\n this.findOne('.top-left').y(pos.y);\n this.findOne('.bottom-right').x(pos.x);\n }\n else if (this._movingAnchorName === 'middle-left') {\n this.findOne('.top-left').x(anchorNode.x());\n }\n else if (this._movingAnchorName === 'middle-right') {\n this.findOne('.bottom-right').x(anchorNode.x());\n }\n else if (this._movingAnchorName === 'bottom-left') {\n if (keepProportion) {\n var comparePoint = centeredScaling\n ? {\n x: this.width() / 2,\n y: this.height() / 2,\n }\n : {\n x: this.findOne('.top-right').x(),\n y: this.findOne('.top-right').y(),\n };\n newHypotenuse = Math.sqrt(Math.pow(comparePoint.x - anchorNode.x(), 2) +\n Math.pow(anchorNode.y() - comparePoint.y, 2));\n var reverseX = comparePoint.x < anchorNode.x() ? -1 : 1;\n var reverseY = anchorNode.y() < comparePoint.y ? -1 : 1;\n x = newHypotenuse * this.cos * reverseX;\n y = newHypotenuse * this.sin * reverseY;\n anchorNode.x(comparePoint.x - x);\n anchorNode.y(comparePoint.y + y);\n }\n pos = anchorNode.position();\n this.findOne('.top-left').x(pos.x);\n this.findOne('.bottom-right').y(pos.y);\n }\n else if (this._movingAnchorName === 'bottom-center') {\n this.findOne('.bottom-right').y(anchorNode.y());\n }\n else if (this._movingAnchorName === 'bottom-right') {\n if (keepProportion) {\n var comparePoint = centeredScaling\n ? {\n x: this.width() / 2,\n y: this.height() / 2,\n }\n : {\n x: this.findOne('.top-left').x(),\n y: this.findOne('.top-left').y(),\n };\n newHypotenuse = Math.sqrt(Math.pow(anchorNode.x() - comparePoint.x, 2) +\n Math.pow(anchorNode.y() - comparePoint.y, 2));\n var reverseX = this.findOne('.bottom-right').x() < comparePoint.x ? -1 : 1;\n var reverseY = this.findOne('.bottom-right').y() < comparePoint.y ? -1 : 1;\n x = newHypotenuse * this.cos * reverseX;\n y = newHypotenuse * this.sin * reverseY;\n this.findOne('.bottom-right').x(comparePoint.x + x);\n this.findOne('.bottom-right').y(comparePoint.y + y);\n }\n }\n else {\n console.error(new Error('Wrong position argument of selection resizer: ' +\n this._movingAnchorName));\n }\n var centeredScaling = this.centeredScaling() || e.altKey;\n if (centeredScaling) {\n var topLeft = this.findOne('.top-left');\n var bottomRight = this.findOne('.bottom-right');\n var topOffsetX = topLeft.x();\n var topOffsetY = topLeft.y();\n var bottomOffsetX = this.getWidth() - bottomRight.x();\n var bottomOffsetY = this.getHeight() - bottomRight.y();\n bottomRight.move({\n x: -topOffsetX,\n y: -topOffsetY,\n });\n topLeft.move({\n x: bottomOffsetX,\n y: bottomOffsetY,\n });\n }\n var absPos = this.findOne('.top-left').getAbsolutePosition();\n x = absPos.x;\n y = absPos.y;\n var width = this.findOne('.bottom-right').x() - this.findOne('.top-left').x();\n var height = this.findOne('.bottom-right').y() - this.findOne('.top-left').y();\n this._fitNodesInto({\n x: x,\n y: y,\n width: width,\n height: height,\n rotation: Global_1.Konva.getAngle(this.rotation()),\n }, e);\n }\n _handleMouseUp(e) {\n this._removeEvents(e);\n }\n getAbsoluteTransform() {\n return this.getTransform();\n }\n _removeEvents(e) {\n var _a;\n if (this._transforming) {\n this._transforming = false;\n if (typeof window !== 'undefined') {\n window.removeEventListener('mousemove', this._handleMouseMove);\n window.removeEventListener('touchmove', this._handleMouseMove);\n window.removeEventListener('mouseup', this._handleMouseUp, true);\n window.removeEventListener('touchend', this._handleMouseUp, true);\n }\n var node = this.getNode();\n activeTransformersCount--;\n this._fire('transformend', { evt: e, target: node });\n (_a = this.getLayer()) === null || _a === void 0 ? void 0 : _a.batchDraw();\n if (node) {\n this._nodes.forEach((target) => {\n var _a;\n target._fire('transformend', { evt: e, target });\n (_a = target.getLayer()) === null || _a === void 0 ? void 0 : _a.batchDraw();\n });\n }\n this._movingAnchorName = null;\n }\n }\n _fitNodesInto(newAttrs, evt) {\n var oldAttrs = this._getNodeRect();\n const minSize = 1;\n if (Util_1.Util._inRange(newAttrs.width, -this.padding() * 2 - minSize, minSize)) {\n this.update();\n return;\n }\n if (Util_1.Util._inRange(newAttrs.height, -this.padding() * 2 - minSize, minSize)) {\n this.update();\n return;\n }\n var t = new Util_1.Transform();\n t.rotate(Global_1.Konva.getAngle(this.rotation()));\n if (this._movingAnchorName &&\n newAttrs.width < 0 &&\n this._movingAnchorName.indexOf('left') >= 0) {\n const offset = t.point({\n x: -this.padding() * 2,\n y: 0,\n });\n newAttrs.x += offset.x;\n newAttrs.y += offset.y;\n newAttrs.width += this.padding() * 2;\n this._movingAnchorName = this._movingAnchorName.replace('left', 'right');\n this._anchorDragOffset.x -= offset.x;\n this._anchorDragOffset.y -= offset.y;\n }\n else if (this._movingAnchorName &&\n newAttrs.width < 0 &&\n this._movingAnchorName.indexOf('right') >= 0) {\n const offset = t.point({\n x: this.padding() * 2,\n y: 0,\n });\n this._movingAnchorName = this._movingAnchorName.replace('right', 'left');\n this._anchorDragOffset.x -= offset.x;\n this._anchorDragOffset.y -= offset.y;\n newAttrs.width += this.padding() * 2;\n }\n if (this._movingAnchorName &&\n newAttrs.height < 0 &&\n this._movingAnchorName.indexOf('top') >= 0) {\n const offset = t.point({\n x: 0,\n y: -this.padding() * 2,\n });\n newAttrs.x += offset.x;\n newAttrs.y += offset.y;\n this._movingAnchorName = this._movingAnchorName.replace('top', 'bottom');\n this._anchorDragOffset.x -= offset.x;\n this._anchorDragOffset.y -= offset.y;\n newAttrs.height += this.padding() * 2;\n }\n else if (this._movingAnchorName &&\n newAttrs.height < 0 &&\n this._movingAnchorName.indexOf('bottom') >= 0) {\n const offset = t.point({\n x: 0,\n y: this.padding() * 2,\n });\n this._movingAnchorName = this._movingAnchorName.replace('bottom', 'top');\n this._anchorDragOffset.x -= offset.x;\n this._anchorDragOffset.y -= offset.y;\n newAttrs.height += this.padding() * 2;\n }\n if (this.boundBoxFunc()) {\n const bounded = this.boundBoxFunc()(oldAttrs, newAttrs);\n if (bounded) {\n newAttrs = bounded;\n }\n else {\n Util_1.Util.warn('boundBoxFunc returned falsy. You should return new bound rect from it!');\n }\n }\n const baseSize = 10000000;\n const oldTr = new Util_1.Transform();\n oldTr.translate(oldAttrs.x, oldAttrs.y);\n oldTr.rotate(oldAttrs.rotation);\n oldTr.scale(oldAttrs.width / baseSize, oldAttrs.height / baseSize);\n const newTr = new Util_1.Transform();\n const newScaleX = newAttrs.width / baseSize;\n const newScaleY = newAttrs.height / baseSize;\n if (this.flipEnabled() === false) {\n newTr.translate(newAttrs.x, newAttrs.y);\n newTr.rotate(newAttrs.rotation);\n newTr.translate(newAttrs.width < 0 ? newAttrs.width : 0, newAttrs.height < 0 ? newAttrs.height : 0);\n newTr.scale(Math.abs(newScaleX), Math.abs(newScaleY));\n }\n else {\n newTr.translate(newAttrs.x, newAttrs.y);\n newTr.rotate(newAttrs.rotation);\n newTr.scale(newScaleX, newScaleY);\n }\n const delta = newTr.multiply(oldTr.invert());\n this._nodes.forEach((node) => {\n var _a;\n const parentTransform = node.getParent().getAbsoluteTransform();\n const localTransform = node.getTransform().copy();\n localTransform.translate(node.offsetX(), node.offsetY());\n const newLocalTransform = new Util_1.Transform();\n newLocalTransform\n .multiply(parentTransform.copy().invert())\n .multiply(delta)\n .multiply(parentTransform)\n .multiply(localTransform);\n const attrs = newLocalTransform.decompose();\n node.setAttrs(attrs);\n (_a = node.getLayer()) === null || _a === void 0 ? void 0 : _a.batchDraw();\n });\n this.rotation(Util_1.Util._getRotation(newAttrs.rotation));\n this._nodes.forEach((node) => {\n this._fire('transform', { evt: evt, target: node });\n node._fire('transform', { evt: evt, target: node });\n });\n this._resetTransformCache();\n this.update();\n this.getLayer().batchDraw();\n }\n forceUpdate() {\n this._resetTransformCache();\n this.update();\n }\n _batchChangeChild(selector, attrs) {\n const anchor = this.findOne(selector);\n anchor.setAttrs(attrs);\n }\n update() {\n var _a;\n var attrs = this._getNodeRect();\n this.rotation(Util_1.Util._getRotation(attrs.rotation));\n var width = attrs.width;\n var height = attrs.height;\n var enabledAnchors = this.enabledAnchors();\n var resizeEnabled = this.resizeEnabled();\n var padding = this.padding();\n var anchorSize = this.anchorSize();\n const anchors = this.find('._anchor');\n anchors.forEach((node) => {\n node.setAttrs({\n width: anchorSize,\n height: anchorSize,\n offsetX: anchorSize / 2,\n offsetY: anchorSize / 2,\n stroke: this.anchorStroke(),\n strokeWidth: this.anchorStrokeWidth(),\n fill: this.anchorFill(),\n cornerRadius: this.anchorCornerRadius(),\n });\n });\n this._batchChangeChild('.top-left', {\n x: 0,\n y: 0,\n offsetX: anchorSize / 2 + padding,\n offsetY: anchorSize / 2 + padding,\n visible: resizeEnabled && enabledAnchors.indexOf('top-left') >= 0,\n });\n this._batchChangeChild('.top-center', {\n x: width / 2,\n y: 0,\n offsetY: anchorSize / 2 + padding,\n visible: resizeEnabled && enabledAnchors.indexOf('top-center') >= 0,\n });\n this._batchChangeChild('.top-right', {\n x: width,\n y: 0,\n offsetX: anchorSize / 2 - padding,\n offsetY: anchorSize / 2 + padding,\n visible: resizeEnabled && enabledAnchors.indexOf('top-right') >= 0,\n });\n this._batchChangeChild('.middle-left', {\n x: 0,\n y: height / 2,\n offsetX: anchorSize / 2 + padding,\n visible: resizeEnabled && enabledAnchors.indexOf('middle-left') >= 0,\n });\n this._batchChangeChild('.middle-right', {\n x: width,\n y: height / 2,\n offsetX: anchorSize / 2 - padding,\n visible: resizeEnabled && enabledAnchors.indexOf('middle-right') >= 0,\n });\n this._batchChangeChild('.bottom-left', {\n x: 0,\n y: height,\n offsetX: anchorSize / 2 + padding,\n offsetY: anchorSize / 2 - padding,\n visible: resizeEnabled && enabledAnchors.indexOf('bottom-left') >= 0,\n });\n this._batchChangeChild('.bottom-center', {\n x: width / 2,\n y: height,\n offsetY: anchorSize / 2 - padding,\n visible: resizeEnabled && enabledAnchors.indexOf('bottom-center') >= 0,\n });\n this._batchChangeChild('.bottom-right', {\n x: width,\n y: height,\n offsetX: anchorSize / 2 - padding,\n offsetY: anchorSize / 2 - padding,\n visible: resizeEnabled && enabledAnchors.indexOf('bottom-right') >= 0,\n });\n this._batchChangeChild('.rotater', {\n x: width / 2,\n y: -this.rotateAnchorOffset() * Util_1.Util._sign(height) - padding,\n visible: this.rotateEnabled(),\n });\n this._batchChangeChild('.back', {\n width: width,\n height: height,\n visible: this.borderEnabled(),\n stroke: this.borderStroke(),\n strokeWidth: this.borderStrokeWidth(),\n dash: this.borderDash(),\n x: 0,\n y: 0,\n });\n const styleFunc = this.anchorStyleFunc();\n if (styleFunc) {\n anchors.forEach((node) => {\n styleFunc(node);\n });\n }\n (_a = this.getLayer()) === null || _a === void 0 ? void 0 : _a.batchDraw();\n }\n isTransforming() {\n return this._transforming;\n }\n stopTransform() {\n if (this._transforming) {\n this._removeEvents();\n var anchorNode = this.findOne('.' + this._movingAnchorName);\n if (anchorNode) {\n anchorNode.stopDrag();\n }\n }\n }\n destroy() {\n if (this.getStage() && this._cursorChange) {\n this.getStage().content && (this.getStage().content.style.cursor = '');\n }\n Group_1.Group.prototype.destroy.call(this);\n this.detach();\n this._removeEvents();\n return this;\n }\n toObject() {\n return Node_1.Node.prototype.toObject.call(this);\n }\n clone(obj) {\n var node = Node_1.Node.prototype.clone.call(this, obj);\n return node;\n }\n getClientRect() {\n if (this.nodes().length > 0) {\n return super.getClientRect();\n }\n else {\n return { x: 0, y: 0, width: 0, height: 0 };\n }\n }\n}\nexports.Transformer = Transformer;\nTransformer.isTransforming = () => {\n return activeTransformersCount > 0;\n};\nfunction validateAnchors(val) {\n if (!(val instanceof Array)) {\n Util_1.Util.warn('enabledAnchors value should be an array');\n }\n if (val instanceof Array) {\n val.forEach(function (name) {\n if (ANCHORS_NAMES.indexOf(name) === -1) {\n Util_1.Util.warn('Unknown anchor name: ' +\n name +\n '. Available names are: ' +\n ANCHORS_NAMES.join(', '));\n }\n });\n }\n return val || [];\n}\nTransformer.prototype.className = 'Transformer';\n(0, Global_2._registerNode)(Transformer);\nFactory_1.Factory.addGetterSetter(Transformer, 'enabledAnchors', ANCHORS_NAMES, validateAnchors);\nFactory_1.Factory.addGetterSetter(Transformer, 'flipEnabled', true, (0, Validators_1.getBooleanValidator)());\nFactory_1.Factory.addGetterSetter(Transformer, 'resizeEnabled', true);\nFactory_1.Factory.addGetterSetter(Transformer, 'anchorSize', 10, (0, Validators_1.getNumberValidator)());\nFactory_1.Factory.addGetterSetter(Transformer, 'rotateEnabled', true);\nFactory_1.Factory.addGetterSetter(Transformer, 'rotateLineVisible', true);\nFactory_1.Factory.addGetterSetter(Transformer, 'rotationSnaps', []);\nFactory_1.Factory.addGetterSetter(Transformer, 'rotateAnchorOffset', 50, (0, Validators_1.getNumberValidator)());\nFactory_1.Factory.addGetterSetter(Transformer, 'rotateAnchorCursor', 'crosshair');\nFactory_1.Factory.addGetterSetter(Transformer, 'rotationSnapTolerance', 5, (0, Validators_1.getNumberValidator)());\nFactory_1.Factory.addGetterSetter(Transformer, 'borderEnabled', true);\nFactory_1.Factory.addGetterSetter(Transformer, 'anchorStroke', 'rgb(0, 161, 255)');\nFactory_1.Factory.addGetterSetter(Transformer, 'anchorStrokeWidth', 1, (0, Validators_1.getNumberValidator)());\nFactory_1.Factory.addGetterSetter(Transformer, 'anchorFill', 'white');\nFactory_1.Factory.addGetterSetter(Transformer, 'anchorCornerRadius', 0, (0, Validators_1.getNumberValidator)());\nFactory_1.Factory.addGetterSetter(Transformer, 'borderStroke', 'rgb(0, 161, 255)');\nFactory_1.Factory.addGetterSetter(Transformer, 'borderStrokeWidth', 1, (0, Validators_1.getNumberValidator)());\nFactory_1.Factory.addGetterSetter(Transformer, 'borderDash');\nFactory_1.Factory.addGetterSetter(Transformer, 'keepRatio', true);\nFactory_1.Factory.addGetterSetter(Transformer, 'shiftBehavior', 'default');\nFactory_1.Factory.addGetterSetter(Transformer, 'centeredScaling', false);\nFactory_1.Factory.addGetterSetter(Transformer, 'ignoreStroke', false);\nFactory_1.Factory.addGetterSetter(Transformer, 'padding', 0, (0, Validators_1.getNumberValidator)());\nFactory_1.Factory.addGetterSetter(Transformer, 'node');\nFactory_1.Factory.addGetterSetter(Transformer, 'nodes');\nFactory_1.Factory.addGetterSetter(Transformer, 'boundBoxFunc');\nFactory_1.Factory.addGetterSetter(Transformer, 'anchorDragBoundFunc');\nFactory_1.Factory.addGetterSetter(Transformer, 'anchorStyleFunc');\nFactory_1.Factory.addGetterSetter(Transformer, 'shouldOverdrawWholeArea', false);\nFactory_1.Factory.addGetterSetter(Transformer, 'useSingleNodeRotation', true);\nFactory_1.Factory.backCompat(Transformer, {\n lineEnabled: 'borderEnabled',\n rotateHandlerOffset: 'rotateAnchorOffset',\n enabledHandlers: 'enabledAnchors',\n});\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Wedge = void 0;\nconst Factory_1 = require(\"../Factory\");\nconst Shape_1 = require(\"../Shape\");\nconst Global_1 = require(\"../Global\");\nconst Validators_1 = require(\"../Validators\");\nconst Global_2 = require(\"../Global\");\nclass Wedge extends Shape_1.Shape {\n _sceneFunc(context) {\n context.beginPath();\n context.arc(0, 0, this.radius(), 0, Global_1.Konva.getAngle(this.angle()), this.clockwise());\n context.lineTo(0, 0);\n context.closePath();\n context.fillStrokeShape(this);\n }\n getWidth() {\n return this.radius() * 2;\n }\n getHeight() {\n return this.radius() * 2;\n }\n setWidth(width) {\n this.radius(width / 2);\n }\n setHeight(height) {\n this.radius(height / 2);\n }\n}\nexports.Wedge = Wedge;\nWedge.prototype.className = 'Wedge';\nWedge.prototype._centroid = true;\nWedge.prototype._attrsAffectingSize = ['radius'];\n(0, Global_2._registerNode)(Wedge);\nFactory_1.Factory.addGetterSetter(Wedge, 'radius', 0, (0, Validators_1.getNumberValidator)());\nFactory_1.Factory.addGetterSetter(Wedge, 'angle', 0, (0, Validators_1.getNumberValidator)());\nFactory_1.Factory.addGetterSetter(Wedge, 'clockwise', false);\nFactory_1.Factory.backCompat(Wedge, {\n angleDeg: 'angle',\n getAngleDeg: 'getAngle',\n setAngleDeg: 'setAngle',\n});\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Blur = void 0;\nconst Factory_1 = require(\"../Factory\");\nconst Node_1 = require(\"../Node\");\nconst Validators_1 = require(\"../Validators\");\nfunction BlurStack() {\n this.r = 0;\n this.g = 0;\n this.b = 0;\n this.a = 0;\n this.next = null;\n}\nvar mul_table = [\n 512, 512, 456, 512, 328, 456, 335, 512, 405, 328, 271, 456, 388, 335, 292,\n 512, 454, 405, 364, 328, 298, 271, 496, 456, 420, 388, 360, 335, 312, 292,\n 273, 512, 482, 454, 428, 405, 383, 364, 345, 328, 312, 298, 284, 271, 259,\n 496, 475, 456, 437, 420, 404, 388, 374, 360, 347, 335, 323, 312, 302, 292,\n 282, 273, 265, 512, 497, 482, 468, 454, 441, 428, 417, 405, 394, 383, 373,\n 364, 354, 345, 337, 328, 320, 312, 305, 298, 291, 284, 278, 271, 265, 259,\n 507, 496, 485, 475, 465, 456, 446, 437, 428, 420, 412, 404, 396, 388, 381,\n 374, 367, 360, 354, 347, 341, 335, 329, 323, 318, 312, 307, 302, 297, 292,\n 287, 282, 278, 273, 269, 265, 261, 512, 505, 497, 489, 482, 475, 468, 461,\n 454, 447, 441, 435, 428, 422, 417, 411, 405, 399, 394, 389, 383, 378, 373,\n 368, 364, 359, 354, 350, 345, 341, 337, 332, 328, 324, 320, 316, 312, 309,\n 305, 301, 298, 294, 291, 287, 284, 281, 278, 274, 271, 268, 265, 262, 259,\n 257, 507, 501, 496, 491, 485, 480, 475, 470, 465, 460, 456, 451, 446, 442,\n 437, 433, 428, 424, 420, 416, 412, 408, 404, 400, 396, 392, 388, 385, 381,\n 377, 374, 370, 367, 363, 360, 357, 354, 350, 347, 344, 341, 338, 335, 332,\n 329, 326, 323, 320, 318, 315, 312, 310, 307, 304, 302, 299, 297, 294, 292,\n 289, 287, 285, 282, 280, 278, 275, 273, 271, 269, 267, 265, 263, 261, 259,\n];\nvar shg_table = [\n 9, 11, 12, 13, 13, 14, 14, 15, 15, 15, 15, 16, 16, 16, 16, 17, 17, 17, 17, 17,\n 17, 17, 18, 18, 18, 18, 18, 18, 18, 18, 18, 19, 19, 19, 19, 19, 19, 19, 19,\n 19, 19, 19, 19, 19, 19, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,\n 20, 20, 20, 20, 20, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21,\n 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 22, 22, 22, 22, 22, 22,\n 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22,\n 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 23, 23, 23, 23, 23, 23, 23,\n 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23,\n 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23,\n 23, 23, 23, 23, 23, 23, 23, 23, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24,\n 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24,\n 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24,\n 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24,\n 24, 24, 24, 24, 24, 24, 24,\n];\nfunction filterGaussBlurRGBA(imageData, radius) {\n var pixels = imageData.data, width = imageData.width, height = imageData.height;\n var x, y, i, p, yp, yi, yw, r_sum, g_sum, b_sum, a_sum, r_out_sum, g_out_sum, b_out_sum, a_out_sum, r_in_sum, g_in_sum, b_in_sum, a_in_sum, pr, pg, pb, pa, rbs;\n var div = radius + radius + 1, widthMinus1 = width - 1, heightMinus1 = height - 1, radiusPlus1 = radius + 1, sumFactor = (radiusPlus1 * (radiusPlus1 + 1)) / 2, stackStart = new BlurStack(), stackEnd = null, stack = stackStart, stackIn = null, stackOut = null, mul_sum = mul_table[radius], shg_sum = shg_table[radius];\n for (i = 1; i < div; i++) {\n stack = stack.next = new BlurStack();\n if (i === radiusPlus1) {\n stackEnd = stack;\n }\n }\n stack.next = stackStart;\n yw = yi = 0;\n for (y = 0; y < height; y++) {\n r_in_sum =\n g_in_sum =\n b_in_sum =\n a_in_sum =\n r_sum =\n g_sum =\n b_sum =\n a_sum =\n 0;\n r_out_sum = radiusPlus1 * (pr = pixels[yi]);\n g_out_sum = radiusPlus1 * (pg = pixels[yi + 1]);\n b_out_sum = radiusPlus1 * (pb = pixels[yi + 2]);\n a_out_sum = radiusPlus1 * (pa = pixels[yi + 3]);\n r_sum += sumFactor * pr;\n g_sum += sumFactor * pg;\n b_sum += sumFactor * pb;\n a_sum += sumFactor * pa;\n stack = stackStart;\n for (i = 0; i < radiusPlus1; i++) {\n stack.r = pr;\n stack.g = pg;\n stack.b = pb;\n stack.a = pa;\n stack = stack.next;\n }\n for (i = 1; i < radiusPlus1; i++) {\n p = yi + ((widthMinus1 < i ? widthMinus1 : i) << 2);\n r_sum += (stack.r = pr = pixels[p]) * (rbs = radiusPlus1 - i);\n g_sum += (stack.g = pg = pixels[p + 1]) * rbs;\n b_sum += (stack.b = pb = pixels[p + 2]) * rbs;\n a_sum += (stack.a = pa = pixels[p + 3]) * rbs;\n r_in_sum += pr;\n g_in_sum += pg;\n b_in_sum += pb;\n a_in_sum += pa;\n stack = stack.next;\n }\n stackIn = stackStart;\n stackOut = stackEnd;\n for (x = 0; x < width; x++) {\n pixels[yi + 3] = pa = (a_sum * mul_sum) >> shg_sum;\n if (pa !== 0) {\n pa = 255 / pa;\n pixels[yi] = ((r_sum * mul_sum) >> shg_sum) * pa;\n pixels[yi + 1] = ((g_sum * mul_sum) >> shg_sum) * pa;\n pixels[yi + 2] = ((b_sum * mul_sum) >> shg_sum) * pa;\n }\n else {\n pixels[yi] = pixels[yi + 1] = pixels[yi + 2] = 0;\n }\n r_sum -= r_out_sum;\n g_sum -= g_out_sum;\n b_sum -= b_out_sum;\n a_sum -= a_out_sum;\n r_out_sum -= stackIn.r;\n g_out_sum -= stackIn.g;\n b_out_sum -= stackIn.b;\n a_out_sum -= stackIn.a;\n p = (yw + ((p = x + radius + 1) < widthMinus1 ? p : widthMinus1)) << 2;\n r_in_sum += stackIn.r = pixels[p];\n g_in_sum += stackIn.g = pixels[p + 1];\n b_in_sum += stackIn.b = pixels[p + 2];\n a_in_sum += stackIn.a = pixels[p + 3];\n r_sum += r_in_sum;\n g_sum += g_in_sum;\n b_sum += b_in_sum;\n a_sum += a_in_sum;\n stackIn = stackIn.next;\n r_out_sum += pr = stackOut.r;\n g_out_sum += pg = stackOut.g;\n b_out_sum += pb = stackOut.b;\n a_out_sum += pa = stackOut.a;\n r_in_sum -= pr;\n g_in_sum -= pg;\n b_in_sum -= pb;\n a_in_sum -= pa;\n stackOut = stackOut.next;\n yi += 4;\n }\n yw += width;\n }\n for (x = 0; x < width; x++) {\n g_in_sum =\n b_in_sum =\n a_in_sum =\n r_in_sum =\n g_sum =\n b_sum =\n a_sum =\n r_sum =\n 0;\n yi = x << 2;\n r_out_sum = radiusPlus1 * (pr = pixels[yi]);\n g_out_sum = radiusPlus1 * (pg = pixels[yi + 1]);\n b_out_sum = radiusPlus1 * (pb = pixels[yi + 2]);\n a_out_sum = radiusPlus1 * (pa = pixels[yi + 3]);\n r_sum += sumFactor * pr;\n g_sum += sumFactor * pg;\n b_sum += sumFactor * pb;\n a_sum += sumFactor * pa;\n stack = stackStart;\n for (i = 0; i < radiusPlus1; i++) {\n stack.r = pr;\n stack.g = pg;\n stack.b = pb;\n stack.a = pa;\n stack = stack.next;\n }\n yp = width;\n for (i = 1; i <= radius; i++) {\n yi = (yp + x) << 2;\n r_sum += (stack.r = pr = pixels[yi]) * (rbs = radiusPlus1 - i);\n g_sum += (stack.g = pg = pixels[yi + 1]) * rbs;\n b_sum += (stack.b = pb = pixels[yi + 2]) * rbs;\n a_sum += (stack.a = pa = pixels[yi + 3]) * rbs;\n r_in_sum += pr;\n g_in_sum += pg;\n b_in_sum += pb;\n a_in_sum += pa;\n stack = stack.next;\n if (i < heightMinus1) {\n yp += width;\n }\n }\n yi = x;\n stackIn = stackStart;\n stackOut = stackEnd;\n for (y = 0; y < height; y++) {\n p = yi << 2;\n pixels[p + 3] = pa = (a_sum * mul_sum) >> shg_sum;\n if (pa > 0) {\n pa = 255 / pa;\n pixels[p] = ((r_sum * mul_sum) >> shg_sum) * pa;\n pixels[p + 1] = ((g_sum * mul_sum) >> shg_sum) * pa;\n pixels[p + 2] = ((b_sum * mul_sum) >> shg_sum) * pa;\n }\n else {\n pixels[p] = pixels[p + 1] = pixels[p + 2] = 0;\n }\n r_sum -= r_out_sum;\n g_sum -= g_out_sum;\n b_sum -= b_out_sum;\n a_sum -= a_out_sum;\n r_out_sum -= stackIn.r;\n g_out_sum -= stackIn.g;\n b_out_sum -= stackIn.b;\n a_out_sum -= stackIn.a;\n p =\n (x +\n ((p = y + radiusPlus1) < heightMinus1 ? p : heightMinus1) * width) <<\n 2;\n r_sum += r_in_sum += stackIn.r = pixels[p];\n g_sum += g_in_sum += stackIn.g = pixels[p + 1];\n b_sum += b_in_sum += stackIn.b = pixels[p + 2];\n a_sum += a_in_sum += stackIn.a = pixels[p + 3];\n stackIn = stackIn.next;\n r_out_sum += pr = stackOut.r;\n g_out_sum += pg = stackOut.g;\n b_out_sum += pb = stackOut.b;\n a_out_sum += pa = stackOut.a;\n r_in_sum -= pr;\n g_in_sum -= pg;\n b_in_sum -= pb;\n a_in_sum -= pa;\n stackOut = stackOut.next;\n yi += width;\n }\n }\n}\nconst Blur = function Blur(imageData) {\n var radius = Math.round(this.blurRadius());\n if (radius > 0) {\n filterGaussBlurRGBA(imageData, radius);\n }\n};\nexports.Blur = Blur;\nFactory_1.Factory.addGetterSetter(Node_1.Node, 'blurRadius', 0, (0, Validators_1.getNumberValidator)(), Factory_1.Factory.afterSetFilter);\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Brighten = void 0;\nconst Factory_1 = require(\"../Factory\");\nconst Node_1 = require(\"../Node\");\nconst Validators_1 = require(\"../Validators\");\nconst Brighten = function (imageData) {\n var brightness = this.brightness() * 255, data = imageData.data, len = data.length, i;\n for (i = 0; i < len; i += 4) {\n data[i] += brightness;\n data[i + 1] += brightness;\n data[i + 2] += brightness;\n }\n};\nexports.Brighten = Brighten;\nFactory_1.Factory.addGetterSetter(Node_1.Node, 'brightness', 0, (0, Validators_1.getNumberValidator)(), Factory_1.Factory.afterSetFilter);\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Contrast = void 0;\nconst Factory_1 = require(\"../Factory\");\nconst Node_1 = require(\"../Node\");\nconst Validators_1 = require(\"../Validators\");\nconst Contrast = function (imageData) {\n var adjust = Math.pow((this.contrast() + 100) / 100, 2);\n var data = imageData.data, nPixels = data.length, red = 150, green = 150, blue = 150, i;\n for (i = 0; i < nPixels; i += 4) {\n red = data[i];\n green = data[i + 1];\n blue = data[i + 2];\n red /= 255;\n red -= 0.5;\n red *= adjust;\n red += 0.5;\n red *= 255;\n green /= 255;\n green -= 0.5;\n green *= adjust;\n green += 0.5;\n green *= 255;\n blue /= 255;\n blue -= 0.5;\n blue *= adjust;\n blue += 0.5;\n blue *= 255;\n red = red < 0 ? 0 : red > 255 ? 255 : red;\n green = green < 0 ? 0 : green > 255 ? 255 : green;\n blue = blue < 0 ? 0 : blue > 255 ? 255 : blue;\n data[i] = red;\n data[i + 1] = green;\n data[i + 2] = blue;\n }\n};\nexports.Contrast = Contrast;\nFactory_1.Factory.addGetterSetter(Node_1.Node, 'contrast', 0, (0, Validators_1.getNumberValidator)(), Factory_1.Factory.afterSetFilter);\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Emboss = void 0;\nconst Factory_1 = require(\"../Factory\");\nconst Node_1 = require(\"../Node\");\nconst Util_1 = require(\"../Util\");\nconst Validators_1 = require(\"../Validators\");\nconst Emboss = function (imageData) {\n var strength = this.embossStrength() * 10, greyLevel = this.embossWhiteLevel() * 255, direction = this.embossDirection(), blend = this.embossBlend(), dirY = 0, dirX = 0, data = imageData.data, w = imageData.width, h = imageData.height, w4 = w * 4, y = h;\n switch (direction) {\n case 'top-left':\n dirY = -1;\n dirX = -1;\n break;\n case 'top':\n dirY = -1;\n dirX = 0;\n break;\n case 'top-right':\n dirY = -1;\n dirX = 1;\n break;\n case 'right':\n dirY = 0;\n dirX = 1;\n break;\n case 'bottom-right':\n dirY = 1;\n dirX = 1;\n break;\n case 'bottom':\n dirY = 1;\n dirX = 0;\n break;\n case 'bottom-left':\n dirY = 1;\n dirX = -1;\n break;\n case 'left':\n dirY = 0;\n dirX = -1;\n break;\n default:\n Util_1.Util.error('Unknown emboss direction: ' + direction);\n }\n do {\n var offsetY = (y - 1) * w4;\n var otherY = dirY;\n if (y + otherY < 1) {\n otherY = 0;\n }\n if (y + otherY > h) {\n otherY = 0;\n }\n var offsetYOther = (y - 1 + otherY) * w * 4;\n var x = w;\n do {\n var offset = offsetY + (x - 1) * 4;\n var otherX = dirX;\n if (x + otherX < 1) {\n otherX = 0;\n }\n if (x + otherX > w) {\n otherX = 0;\n }\n var offsetOther = offsetYOther + (x - 1 + otherX) * 4;\n var dR = data[offset] - data[offsetOther];\n var dG = data[offset + 1] - data[offsetOther + 1];\n var dB = data[offset + 2] - data[offsetOther + 2];\n var dif = dR;\n var absDif = dif > 0 ? dif : -dif;\n var absG = dG > 0 ? dG : -dG;\n var absB = dB > 0 ? dB : -dB;\n if (absG > absDif) {\n dif = dG;\n }\n if (absB > absDif) {\n dif = dB;\n }\n dif *= strength;\n if (blend) {\n var r = data[offset] + dif;\n var g = data[offset + 1] + dif;\n var b = data[offset + 2] + dif;\n data[offset] = r > 255 ? 255 : r < 0 ? 0 : r;\n data[offset + 1] = g > 255 ? 255 : g < 0 ? 0 : g;\n data[offset + 2] = b > 255 ? 255 : b < 0 ? 0 : b;\n }\n else {\n var grey = greyLevel - dif;\n if (grey < 0) {\n grey = 0;\n }\n else if (grey > 255) {\n grey = 255;\n }\n data[offset] = data[offset + 1] = data[offset + 2] = grey;\n }\n } while (--x);\n } while (--y);\n};\nexports.Emboss = Emboss;\nFactory_1.Factory.addGetterSetter(Node_1.Node, 'embossStrength', 0.5, (0, Validators_1.getNumberValidator)(), Factory_1.Factory.afterSetFilter);\nFactory_1.Factory.addGetterSetter(Node_1.Node, 'embossWhiteLevel', 0.5, (0, Validators_1.getNumberValidator)(), Factory_1.Factory.afterSetFilter);\nFactory_1.Factory.addGetterSetter(Node_1.Node, 'embossDirection', 'top-left', null, Factory_1.Factory.afterSetFilter);\nFactory_1.Factory.addGetterSetter(Node_1.Node, 'embossBlend', false, null, Factory_1.Factory.afterSetFilter);\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Enhance = void 0;\nconst Factory_1 = require(\"../Factory\");\nconst Node_1 = require(\"../Node\");\nconst Validators_1 = require(\"../Validators\");\nfunction remap(fromValue, fromMin, fromMax, toMin, toMax) {\n var fromRange = fromMax - fromMin, toRange = toMax - toMin, toValue;\n if (fromRange === 0) {\n return toMin + toRange / 2;\n }\n if (toRange === 0) {\n return toMin;\n }\n toValue = (fromValue - fromMin) / fromRange;\n toValue = toRange * toValue + toMin;\n return toValue;\n}\nconst Enhance = function (imageData) {\n var data = imageData.data, nSubPixels = data.length, rMin = data[0], rMax = rMin, r, gMin = data[1], gMax = gMin, g, bMin = data[2], bMax = bMin, b, i;\n var enhanceAmount = this.enhance();\n if (enhanceAmount === 0) {\n return;\n }\n for (i = 0; i < nSubPixels; i += 4) {\n r = data[i + 0];\n if (r < rMin) {\n rMin = r;\n }\n else if (r > rMax) {\n rMax = r;\n }\n g = data[i + 1];\n if (g < gMin) {\n gMin = g;\n }\n else if (g > gMax) {\n gMax = g;\n }\n b = data[i + 2];\n if (b < bMin) {\n bMin = b;\n }\n else if (b > bMax) {\n bMax = b;\n }\n }\n if (rMax === rMin) {\n rMax = 255;\n rMin = 0;\n }\n if (gMax === gMin) {\n gMax = 255;\n gMin = 0;\n }\n if (bMax === bMin) {\n bMax = 255;\n bMin = 0;\n }\n var rMid, rGoalMax, rGoalMin, gMid, gGoalMax, gGoalMin, bMid, bGoalMax, bGoalMin;\n if (enhanceAmount > 0) {\n rGoalMax = rMax + enhanceAmount * (255 - rMax);\n rGoalMin = rMin - enhanceAmount * (rMin - 0);\n gGoalMax = gMax + enhanceAmount * (255 - gMax);\n gGoalMin = gMin - enhanceAmount * (gMin - 0);\n bGoalMax = bMax + enhanceAmount * (255 - bMax);\n bGoalMin = bMin - enhanceAmount * (bMin - 0);\n }\n else {\n rMid = (rMax + rMin) * 0.5;\n rGoalMax = rMax + enhanceAmount * (rMax - rMid);\n rGoalMin = rMin + enhanceAmount * (rMin - rMid);\n gMid = (gMax + gMin) * 0.5;\n gGoalMax = gMax + enhanceAmount * (gMax - gMid);\n gGoalMin = gMin + enhanceAmount * (gMin - gMid);\n bMid = (bMax + bMin) * 0.5;\n bGoalMax = bMax + enhanceAmount * (bMax - bMid);\n bGoalMin = bMin + enhanceAmount * (bMin - bMid);\n }\n for (i = 0; i < nSubPixels; i += 4) {\n data[i + 0] = remap(data[i + 0], rMin, rMax, rGoalMin, rGoalMax);\n data[i + 1] = remap(data[i + 1], gMin, gMax, gGoalMin, gGoalMax);\n data[i + 2] = remap(data[i + 2], bMin, bMax, bGoalMin, bGoalMax);\n }\n};\nexports.Enhance = Enhance;\nFactory_1.Factory.addGetterSetter(Node_1.Node, 'enhance', 0, (0, Validators_1.getNumberValidator)(), Factory_1.Factory.afterSetFilter);\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Grayscale = void 0;\nconst Grayscale = function (imageData) {\n var data = imageData.data, len = data.length, i, brightness;\n for (i = 0; i < len; i += 4) {\n brightness = 0.34 * data[i] + 0.5 * data[i + 1] + 0.16 * data[i + 2];\n data[i] = brightness;\n data[i + 1] = brightness;\n data[i + 2] = brightness;\n }\n};\nexports.Grayscale = Grayscale;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.HSL = void 0;\nconst Factory_1 = require(\"../Factory\");\nconst Node_1 = require(\"../Node\");\nconst Validators_1 = require(\"../Validators\");\nFactory_1.Factory.addGetterSetter(Node_1.Node, 'hue', 0, (0, Validators_1.getNumberValidator)(), Factory_1.Factory.afterSetFilter);\nFactory_1.Factory.addGetterSetter(Node_1.Node, 'saturation', 0, (0, Validators_1.getNumberValidator)(), Factory_1.Factory.afterSetFilter);\nFactory_1.Factory.addGetterSetter(Node_1.Node, 'luminance', 0, (0, Validators_1.getNumberValidator)(), Factory_1.Factory.afterSetFilter);\nconst HSL = function (imageData) {\n var data = imageData.data, nPixels = data.length, v = 1, s = Math.pow(2, this.saturation()), h = Math.abs(this.hue() + 360) % 360, l = this.luminance() * 127, i;\n var vsu = v * s * Math.cos((h * Math.PI) / 180), vsw = v * s * Math.sin((h * Math.PI) / 180);\n var rr = 0.299 * v + 0.701 * vsu + 0.167 * vsw, rg = 0.587 * v - 0.587 * vsu + 0.33 * vsw, rb = 0.114 * v - 0.114 * vsu - 0.497 * vsw;\n var gr = 0.299 * v - 0.299 * vsu - 0.328 * vsw, gg = 0.587 * v + 0.413 * vsu + 0.035 * vsw, gb = 0.114 * v - 0.114 * vsu + 0.293 * vsw;\n var br = 0.299 * v - 0.3 * vsu + 1.25 * vsw, bg = 0.587 * v - 0.586 * vsu - 1.05 * vsw, bb = 0.114 * v + 0.886 * vsu - 0.2 * vsw;\n var r, g, b, a;\n for (i = 0; i < nPixels; i += 4) {\n r = data[i + 0];\n g = data[i + 1];\n b = data[i + 2];\n a = data[i + 3];\n data[i + 0] = rr * r + rg * g + rb * b + l;\n data[i + 1] = gr * r + gg * g + gb * b + l;\n data[i + 2] = br * r + bg * g + bb * b + l;\n data[i + 3] = a;\n }\n};\nexports.HSL = HSL;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.HSV = void 0;\nconst Factory_1 = require(\"../Factory\");\nconst Node_1 = require(\"../Node\");\nconst Validators_1 = require(\"../Validators\");\nconst HSV = function (imageData) {\n var data = imageData.data, nPixels = data.length, v = Math.pow(2, this.value()), s = Math.pow(2, this.saturation()), h = Math.abs(this.hue() + 360) % 360, i;\n var vsu = v * s * Math.cos((h * Math.PI) / 180), vsw = v * s * Math.sin((h * Math.PI) / 180);\n var rr = 0.299 * v + 0.701 * vsu + 0.167 * vsw, rg = 0.587 * v - 0.587 * vsu + 0.33 * vsw, rb = 0.114 * v - 0.114 * vsu - 0.497 * vsw;\n var gr = 0.299 * v - 0.299 * vsu - 0.328 * vsw, gg = 0.587 * v + 0.413 * vsu + 0.035 * vsw, gb = 0.114 * v - 0.114 * vsu + 0.293 * vsw;\n var br = 0.299 * v - 0.3 * vsu + 1.25 * vsw, bg = 0.587 * v - 0.586 * vsu - 1.05 * vsw, bb = 0.114 * v + 0.886 * vsu - 0.2 * vsw;\n var r, g, b, a;\n for (i = 0; i < nPixels; i += 4) {\n r = data[i + 0];\n g = data[i + 1];\n b = data[i + 2];\n a = data[i + 3];\n data[i + 0] = rr * r + rg * g + rb * b;\n data[i + 1] = gr * r + gg * g + gb * b;\n data[i + 2] = br * r + bg * g + bb * b;\n data[i + 3] = a;\n }\n};\nexports.HSV = HSV;\nFactory_1.Factory.addGetterSetter(Node_1.Node, 'hue', 0, (0, Validators_1.getNumberValidator)(), Factory_1.Factory.afterSetFilter);\nFactory_1.Factory.addGetterSetter(Node_1.Node, 'saturation', 0, (0, Validators_1.getNumberValidator)(), Factory_1.Factory.afterSetFilter);\nFactory_1.Factory.addGetterSetter(Node_1.Node, 'value', 0, (0, Validators_1.getNumberValidator)(), Factory_1.Factory.afterSetFilter);\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Invert = void 0;\nconst Invert = function (imageData) {\n var data = imageData.data, len = data.length, i;\n for (i = 0; i < len; i += 4) {\n data[i] = 255 - data[i];\n data[i + 1] = 255 - data[i + 1];\n data[i + 2] = 255 - data[i + 2];\n }\n};\nexports.Invert = Invert;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Kaleidoscope = void 0;\nconst Factory_1 = require(\"../Factory\");\nconst Node_1 = require(\"../Node\");\nconst Util_1 = require(\"../Util\");\nconst Validators_1 = require(\"../Validators\");\nvar ToPolar = function (src, dst, opt) {\n var srcPixels = src.data, dstPixels = dst.data, xSize = src.width, ySize = src.height, xMid = opt.polarCenterX || xSize / 2, yMid = opt.polarCenterY || ySize / 2, i, x, y, r = 0, g = 0, b = 0, a = 0;\n var rad, rMax = Math.sqrt(xMid * xMid + yMid * yMid);\n x = xSize - xMid;\n y = ySize - yMid;\n rad = Math.sqrt(x * x + y * y);\n rMax = rad > rMax ? rad : rMax;\n var rSize = ySize, tSize = xSize, radius, theta;\n var conversion = ((360 / tSize) * Math.PI) / 180, sin, cos;\n for (theta = 0; theta < tSize; theta += 1) {\n sin = Math.sin(theta * conversion);\n cos = Math.cos(theta * conversion);\n for (radius = 0; radius < rSize; radius += 1) {\n x = Math.floor(xMid + ((rMax * radius) / rSize) * cos);\n y = Math.floor(yMid + ((rMax * radius) / rSize) * sin);\n i = (y * xSize + x) * 4;\n r = srcPixels[i + 0];\n g = srcPixels[i + 1];\n b = srcPixels[i + 2];\n a = srcPixels[i + 3];\n i = (theta + radius * xSize) * 4;\n dstPixels[i + 0] = r;\n dstPixels[i + 1] = g;\n dstPixels[i + 2] = b;\n dstPixels[i + 3] = a;\n }\n }\n};\nvar FromPolar = function (src, dst, opt) {\n var srcPixels = src.data, dstPixels = dst.data, xSize = src.width, ySize = src.height, xMid = opt.polarCenterX || xSize / 2, yMid = opt.polarCenterY || ySize / 2, i, x, y, dx, dy, r = 0, g = 0, b = 0, a = 0;\n var rad, rMax = Math.sqrt(xMid * xMid + yMid * yMid);\n x = xSize - xMid;\n y = ySize - yMid;\n rad = Math.sqrt(x * x + y * y);\n rMax = rad > rMax ? rad : rMax;\n var rSize = ySize, tSize = xSize, radius, theta, phaseShift = opt.polarRotation || 0;\n var x1, y1;\n for (x = 0; x < xSize; x += 1) {\n for (y = 0; y < ySize; y += 1) {\n dx = x - xMid;\n dy = y - yMid;\n radius = (Math.sqrt(dx * dx + dy * dy) * rSize) / rMax;\n theta = ((Math.atan2(dy, dx) * 180) / Math.PI + 360 + phaseShift) % 360;\n theta = (theta * tSize) / 360;\n x1 = Math.floor(theta);\n y1 = Math.floor(radius);\n i = (y1 * xSize + x1) * 4;\n r = srcPixels[i + 0];\n g = srcPixels[i + 1];\n b = srcPixels[i + 2];\n a = srcPixels[i + 3];\n i = (y * xSize + x) * 4;\n dstPixels[i + 0] = r;\n dstPixels[i + 1] = g;\n dstPixels[i + 2] = b;\n dstPixels[i + 3] = a;\n }\n }\n};\nconst Kaleidoscope = function (imageData) {\n var xSize = imageData.width, ySize = imageData.height;\n var x, y, xoff, i, r, g, b, a, srcPos, dstPos;\n var power = Math.round(this.kaleidoscopePower());\n var angle = Math.round(this.kaleidoscopeAngle());\n var offset = Math.floor((xSize * (angle % 360)) / 360);\n if (power < 1) {\n return;\n }\n var tempCanvas = Util_1.Util.createCanvasElement();\n tempCanvas.width = xSize;\n tempCanvas.height = ySize;\n var scratchData = tempCanvas\n .getContext('2d')\n .getImageData(0, 0, xSize, ySize);\n Util_1.Util.releaseCanvas(tempCanvas);\n ToPolar(imageData, scratchData, {\n polarCenterX: xSize / 2,\n polarCenterY: ySize / 2,\n });\n var minSectionSize = xSize / Math.pow(2, power);\n while (minSectionSize <= 8) {\n minSectionSize = minSectionSize * 2;\n power -= 1;\n }\n minSectionSize = Math.ceil(minSectionSize);\n var sectionSize = minSectionSize;\n var xStart = 0, xEnd = sectionSize, xDelta = 1;\n if (offset + minSectionSize > xSize) {\n xStart = sectionSize;\n xEnd = 0;\n xDelta = -1;\n }\n for (y = 0; y < ySize; y += 1) {\n for (x = xStart; x !== xEnd; x += xDelta) {\n xoff = Math.round(x + offset) % xSize;\n srcPos = (xSize * y + xoff) * 4;\n r = scratchData.data[srcPos + 0];\n g = scratchData.data[srcPos + 1];\n b = scratchData.data[srcPos + 2];\n a = scratchData.data[srcPos + 3];\n dstPos = (xSize * y + x) * 4;\n scratchData.data[dstPos + 0] = r;\n scratchData.data[dstPos + 1] = g;\n scratchData.data[dstPos + 2] = b;\n scratchData.data[dstPos + 3] = a;\n }\n }\n for (y = 0; y < ySize; y += 1) {\n sectionSize = Math.floor(minSectionSize);\n for (i = 0; i < power; i += 1) {\n for (x = 0; x < sectionSize + 1; x += 1) {\n srcPos = (xSize * y + x) * 4;\n r = scratchData.data[srcPos + 0];\n g = scratchData.data[srcPos + 1];\n b = scratchData.data[srcPos + 2];\n a = scratchData.data[srcPos + 3];\n dstPos = (xSize * y + sectionSize * 2 - x - 1) * 4;\n scratchData.data[dstPos + 0] = r;\n scratchData.data[dstPos + 1] = g;\n scratchData.data[dstPos + 2] = b;\n scratchData.data[dstPos + 3] = a;\n }\n sectionSize *= 2;\n }\n }\n FromPolar(scratchData, imageData, { polarRotation: 0 });\n};\nexports.Kaleidoscope = Kaleidoscope;\nFactory_1.Factory.addGetterSetter(Node_1.Node, 'kaleidoscopePower', 2, (0, Validators_1.getNumberValidator)(), Factory_1.Factory.afterSetFilter);\nFactory_1.Factory.addGetterSetter(Node_1.Node, 'kaleidoscopeAngle', 0, (0, Validators_1.getNumberValidator)(), Factory_1.Factory.afterSetFilter);\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Mask = void 0;\nconst Factory_1 = require(\"../Factory\");\nconst Node_1 = require(\"../Node\");\nconst Validators_1 = require(\"../Validators\");\nfunction pixelAt(idata, x, y) {\n var idx = (y * idata.width + x) * 4;\n var d = [];\n d.push(idata.data[idx++], idata.data[idx++], idata.data[idx++], idata.data[idx++]);\n return d;\n}\nfunction rgbDistance(p1, p2) {\n return Math.sqrt(Math.pow(p1[0] - p2[0], 2) +\n Math.pow(p1[1] - p2[1], 2) +\n Math.pow(p1[2] - p2[2], 2));\n}\nfunction rgbMean(pTab) {\n var m = [0, 0, 0];\n for (var i = 0; i < pTab.length; i++) {\n m[0] += pTab[i][0];\n m[1] += pTab[i][1];\n m[2] += pTab[i][2];\n }\n m[0] /= pTab.length;\n m[1] /= pTab.length;\n m[2] /= pTab.length;\n return m;\n}\nfunction backgroundMask(idata, threshold) {\n var rgbv_no = pixelAt(idata, 0, 0);\n var rgbv_ne = pixelAt(idata, idata.width - 1, 0);\n var rgbv_so = pixelAt(idata, 0, idata.height - 1);\n var rgbv_se = pixelAt(idata, idata.width - 1, idata.height - 1);\n var thres = threshold || 10;\n if (rgbDistance(rgbv_no, rgbv_ne) < thres &&\n rgbDistance(rgbv_ne, rgbv_se) < thres &&\n rgbDistance(rgbv_se, rgbv_so) < thres &&\n rgbDistance(rgbv_so, rgbv_no) < thres) {\n var mean = rgbMean([rgbv_ne, rgbv_no, rgbv_se, rgbv_so]);\n var mask = [];\n for (var i = 0; i < idata.width * idata.height; i++) {\n var d = rgbDistance(mean, [\n idata.data[i * 4],\n idata.data[i * 4 + 1],\n idata.data[i * 4 + 2],\n ]);\n mask[i] = d < thres ? 0 : 255;\n }\n return mask;\n }\n}\nfunction applyMask(idata, mask) {\n for (var i = 0; i < idata.width * idata.height; i++) {\n idata.data[4 * i + 3] = mask[i];\n }\n}\nfunction erodeMask(mask, sw, sh) {\n var weights = [1, 1, 1, 1, 0, 1, 1, 1, 1];\n var side = Math.round(Math.sqrt(weights.length));\n var halfSide = Math.floor(side / 2);\n var maskResult = [];\n for (var y = 0; y < sh; y++) {\n for (var x = 0; x < sw; x++) {\n var so = y * sw + x;\n var a = 0;\n for (var cy = 0; cy < side; cy++) {\n for (var cx = 0; cx < side; cx++) {\n var scy = y + cy - halfSide;\n var scx = x + cx - halfSide;\n if (scy >= 0 && scy < sh && scx >= 0 && scx < sw) {\n var srcOff = scy * sw + scx;\n var wt = weights[cy * side + cx];\n a += mask[srcOff] * wt;\n }\n }\n }\n maskResult[so] = a === 255 * 8 ? 255 : 0;\n }\n }\n return maskResult;\n}\nfunction dilateMask(mask, sw, sh) {\n var weights = [1, 1, 1, 1, 1, 1, 1, 1, 1];\n var side = Math.round(Math.sqrt(weights.length));\n var halfSide = Math.floor(side / 2);\n var maskResult = [];\n for (var y = 0; y < sh; y++) {\n for (var x = 0; x < sw; x++) {\n var so = y * sw + x;\n var a = 0;\n for (var cy = 0; cy < side; cy++) {\n for (var cx = 0; cx < side; cx++) {\n var scy = y + cy - halfSide;\n var scx = x + cx - halfSide;\n if (scy >= 0 && scy < sh && scx >= 0 && scx < sw) {\n var srcOff = scy * sw + scx;\n var wt = weights[cy * side + cx];\n a += mask[srcOff] * wt;\n }\n }\n }\n maskResult[so] = a >= 255 * 4 ? 255 : 0;\n }\n }\n return maskResult;\n}\nfunction smoothEdgeMask(mask, sw, sh) {\n var weights = [1 / 9, 1 / 9, 1 / 9, 1 / 9, 1 / 9, 1 / 9, 1 / 9, 1 / 9, 1 / 9];\n var side = Math.round(Math.sqrt(weights.length));\n var halfSide = Math.floor(side / 2);\n var maskResult = [];\n for (var y = 0; y < sh; y++) {\n for (var x = 0; x < sw; x++) {\n var so = y * sw + x;\n var a = 0;\n for (var cy = 0; cy < side; cy++) {\n for (var cx = 0; cx < side; cx++) {\n var scy = y + cy - halfSide;\n var scx = x + cx - halfSide;\n if (scy >= 0 && scy < sh && scx >= 0 && scx < sw) {\n var srcOff = scy * sw + scx;\n var wt = weights[cy * side + cx];\n a += mask[srcOff] * wt;\n }\n }\n }\n maskResult[so] = a;\n }\n }\n return maskResult;\n}\nconst Mask = function (imageData) {\n var threshold = this.threshold(), mask = backgroundMask(imageData, threshold);\n if (mask) {\n mask = erodeMask(mask, imageData.width, imageData.height);\n mask = dilateMask(mask, imageData.width, imageData.height);\n mask = smoothEdgeMask(mask, imageData.width, imageData.height);\n applyMask(imageData, mask);\n }\n return imageData;\n};\nexports.Mask = Mask;\nFactory_1.Factory.addGetterSetter(Node_1.Node, 'threshold', 0, (0, Validators_1.getNumberValidator)(), Factory_1.Factory.afterSetFilter);\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Noise = void 0;\nconst Factory_1 = require(\"../Factory\");\nconst Node_1 = require(\"../Node\");\nconst Validators_1 = require(\"../Validators\");\nconst Noise = function (imageData) {\n var amount = this.noise() * 255, data = imageData.data, nPixels = data.length, half = amount / 2, i;\n for (i = 0; i < nPixels; i += 4) {\n data[i + 0] += half - 2 * half * Math.random();\n data[i + 1] += half - 2 * half * Math.random();\n data[i + 2] += half - 2 * half * Math.random();\n }\n};\nexports.Noise = Noise;\nFactory_1.Factory.addGetterSetter(Node_1.Node, 'noise', 0.2, (0, Validators_1.getNumberValidator)(), Factory_1.Factory.afterSetFilter);\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Pixelate = void 0;\nconst Factory_1 = require(\"../Factory\");\nconst Util_1 = require(\"../Util\");\nconst Node_1 = require(\"../Node\");\nconst Validators_1 = require(\"../Validators\");\nconst Pixelate = function (imageData) {\n var pixelSize = Math.ceil(this.pixelSize()), width = imageData.width, height = imageData.height, x, y, i, red, green, blue, alpha, nBinsX = Math.ceil(width / pixelSize), nBinsY = Math.ceil(height / pixelSize), xBinStart, xBinEnd, yBinStart, yBinEnd, xBin, yBin, pixelsInBin, data = imageData.data;\n if (pixelSize <= 0) {\n Util_1.Util.error('pixelSize value can not be <= 0');\n return;\n }\n for (xBin = 0; xBin < nBinsX; xBin += 1) {\n for (yBin = 0; yBin < nBinsY; yBin += 1) {\n red = 0;\n green = 0;\n blue = 0;\n alpha = 0;\n xBinStart = xBin * pixelSize;\n xBinEnd = xBinStart + pixelSize;\n yBinStart = yBin * pixelSize;\n yBinEnd = yBinStart + pixelSize;\n pixelsInBin = 0;\n for (x = xBinStart; x < xBinEnd; x += 1) {\n if (x >= width) {\n continue;\n }\n for (y = yBinStart; y < yBinEnd; y += 1) {\n if (y >= height) {\n continue;\n }\n i = (width * y + x) * 4;\n red += data[i + 0];\n green += data[i + 1];\n blue += data[i + 2];\n alpha += data[i + 3];\n pixelsInBin += 1;\n }\n }\n red = red / pixelsInBin;\n green = green / pixelsInBin;\n blue = blue / pixelsInBin;\n alpha = alpha / pixelsInBin;\n for (x = xBinStart; x < xBinEnd; x += 1) {\n if (x >= width) {\n continue;\n }\n for (y = yBinStart; y < yBinEnd; y += 1) {\n if (y >= height) {\n continue;\n }\n i = (width * y + x) * 4;\n data[i + 0] = red;\n data[i + 1] = green;\n data[i + 2] = blue;\n data[i + 3] = alpha;\n }\n }\n }\n }\n};\nexports.Pixelate = Pixelate;\nFactory_1.Factory.addGetterSetter(Node_1.Node, 'pixelSize', 8, (0, Validators_1.getNumberValidator)(), Factory_1.Factory.afterSetFilter);\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Posterize = void 0;\nconst Factory_1 = require(\"../Factory\");\nconst Node_1 = require(\"../Node\");\nconst Validators_1 = require(\"../Validators\");\nconst Posterize = function (imageData) {\n var levels = Math.round(this.levels() * 254) + 1, data = imageData.data, len = data.length, scale = 255 / levels, i;\n for (i = 0; i < len; i += 1) {\n data[i] = Math.floor(data[i] / scale) * scale;\n }\n};\nexports.Posterize = Posterize;\nFactory_1.Factory.addGetterSetter(Node_1.Node, 'levels', 0.5, (0, Validators_1.getNumberValidator)(), Factory_1.Factory.afterSetFilter);\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.RGB = void 0;\nconst Factory_1 = require(\"../Factory\");\nconst Node_1 = require(\"../Node\");\nconst Validators_1 = require(\"../Validators\");\nconst RGB = function (imageData) {\n var data = imageData.data, nPixels = data.length, red = this.red(), green = this.green(), blue = this.blue(), i, brightness;\n for (i = 0; i < nPixels; i += 4) {\n brightness =\n (0.34 * data[i] + 0.5 * data[i + 1] + 0.16 * data[i + 2]) / 255;\n data[i] = brightness * red;\n data[i + 1] = brightness * green;\n data[i + 2] = brightness * blue;\n data[i + 3] = data[i + 3];\n }\n};\nexports.RGB = RGB;\nFactory_1.Factory.addGetterSetter(Node_1.Node, 'red', 0, function (val) {\n this._filterUpToDate = false;\n if (val > 255) {\n return 255;\n }\n else if (val < 0) {\n return 0;\n }\n else {\n return Math.round(val);\n }\n});\nFactory_1.Factory.addGetterSetter(Node_1.Node, 'green', 0, function (val) {\n this._filterUpToDate = false;\n if (val > 255) {\n return 255;\n }\n else if (val < 0) {\n return 0;\n }\n else {\n return Math.round(val);\n }\n});\nFactory_1.Factory.addGetterSetter(Node_1.Node, 'blue', 0, Validators_1.RGBComponent, Factory_1.Factory.afterSetFilter);\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.RGBA = void 0;\nconst Factory_1 = require(\"../Factory\");\nconst Node_1 = require(\"../Node\");\nconst Validators_1 = require(\"../Validators\");\nconst RGBA = function (imageData) {\n var data = imageData.data, nPixels = data.length, red = this.red(), green = this.green(), blue = this.blue(), alpha = this.alpha(), i, ia;\n for (i = 0; i < nPixels; i += 4) {\n ia = 1 - alpha;\n data[i] = red * alpha + data[i] * ia;\n data[i + 1] = green * alpha + data[i + 1] * ia;\n data[i + 2] = blue * alpha + data[i + 2] * ia;\n }\n};\nexports.RGBA = RGBA;\nFactory_1.Factory.addGetterSetter(Node_1.Node, 'red', 0, function (val) {\n this._filterUpToDate = false;\n if (val > 255) {\n return 255;\n }\n else if (val < 0) {\n return 0;\n }\n else {\n return Math.round(val);\n }\n});\nFactory_1.Factory.addGetterSetter(Node_1.Node, 'green', 0, function (val) {\n this._filterUpToDate = false;\n if (val > 255) {\n return 255;\n }\n else if (val < 0) {\n return 0;\n }\n else {\n return Math.round(val);\n }\n});\nFactory_1.Factory.addGetterSetter(Node_1.Node, 'blue', 0, Validators_1.RGBComponent, Factory_1.Factory.afterSetFilter);\nFactory_1.Factory.addGetterSetter(Node_1.Node, 'alpha', 1, function (val) {\n this._filterUpToDate = false;\n if (val > 1) {\n return 1;\n }\n else if (val < 0) {\n return 0;\n }\n else {\n return val;\n }\n});\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Sepia = void 0;\nconst Sepia = function (imageData) {\n var data = imageData.data, nPixels = data.length, i, r, g, b;\n for (i = 0; i < nPixels; i += 4) {\n r = data[i + 0];\n g = data[i + 1];\n b = data[i + 2];\n data[i + 0] = Math.min(255, r * 0.393 + g * 0.769 + b * 0.189);\n data[i + 1] = Math.min(255, r * 0.349 + g * 0.686 + b * 0.168);\n data[i + 2] = Math.min(255, r * 0.272 + g * 0.534 + b * 0.131);\n }\n};\nexports.Sepia = Sepia;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Solarize = void 0;\nconst Solarize = function (imageData) {\n var data = imageData.data, w = imageData.width, h = imageData.height, w4 = w * 4, y = h;\n do {\n var offsetY = (y - 1) * w4;\n var x = w;\n do {\n var offset = offsetY + (x - 1) * 4;\n var r = data[offset];\n var g = data[offset + 1];\n var b = data[offset + 2];\n if (r > 127) {\n r = 255 - r;\n }\n if (g > 127) {\n g = 255 - g;\n }\n if (b > 127) {\n b = 255 - b;\n }\n data[offset] = r;\n data[offset + 1] = g;\n data[offset + 2] = b;\n } while (--x);\n } while (--y);\n};\nexports.Solarize = Solarize;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Threshold = void 0;\nconst Factory_1 = require(\"../Factory\");\nconst Node_1 = require(\"../Node\");\nconst Validators_1 = require(\"../Validators\");\nconst Threshold = function (imageData) {\n var level = this.threshold() * 255, data = imageData.data, len = data.length, i;\n for (i = 0; i < len; i += 1) {\n data[i] = data[i] < level ? 0 : 255;\n }\n};\nexports.Threshold = Threshold;\nFactory_1.Factory.addGetterSetter(Node_1.Node, 'threshold', 0.5, (0, Validators_1.getNumberValidator)(), Factory_1.Factory.afterSetFilter);\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Konva = void 0;\nconst _CoreInternals_1 = require(\"./_CoreInternals\");\nconst Arc_1 = require(\"./shapes/Arc\");\nconst Arrow_1 = require(\"./shapes/Arrow\");\nconst Circle_1 = require(\"./shapes/Circle\");\nconst Ellipse_1 = require(\"./shapes/Ellipse\");\nconst Image_1 = require(\"./shapes/Image\");\nconst Label_1 = require(\"./shapes/Label\");\nconst Line_1 = require(\"./shapes/Line\");\nconst Path_1 = require(\"./shapes/Path\");\nconst Rect_1 = require(\"./shapes/Rect\");\nconst RegularPolygon_1 = require(\"./shapes/RegularPolygon\");\nconst Ring_1 = require(\"./shapes/Ring\");\nconst Sprite_1 = require(\"./shapes/Sprite\");\nconst Star_1 = require(\"./shapes/Star\");\nconst Text_1 = require(\"./shapes/Text\");\nconst TextPath_1 = require(\"./shapes/TextPath\");\nconst Transformer_1 = require(\"./shapes/Transformer\");\nconst Wedge_1 = require(\"./shapes/Wedge\");\nconst Blur_1 = require(\"./filters/Blur\");\nconst Brighten_1 = require(\"./filters/Brighten\");\nconst Contrast_1 = require(\"./filters/Contrast\");\nconst Emboss_1 = require(\"./filters/Emboss\");\nconst Enhance_1 = require(\"./filters/Enhance\");\nconst Grayscale_1 = require(\"./filters/Grayscale\");\nconst HSL_1 = require(\"./filters/HSL\");\nconst HSV_1 = require(\"./filters/HSV\");\nconst Invert_1 = require(\"./filters/Invert\");\nconst Kaleidoscope_1 = require(\"./filters/Kaleidoscope\");\nconst Mask_1 = require(\"./filters/Mask\");\nconst Noise_1 = require(\"./filters/Noise\");\nconst Pixelate_1 = require(\"./filters/Pixelate\");\nconst Posterize_1 = require(\"./filters/Posterize\");\nconst RGB_1 = require(\"./filters/RGB\");\nconst RGBA_1 = require(\"./filters/RGBA\");\nconst Sepia_1 = require(\"./filters/Sepia\");\nconst Solarize_1 = require(\"./filters/Solarize\");\nconst Threshold_1 = require(\"./filters/Threshold\");\nexports.Konva = _CoreInternals_1.Konva.Util._assign(_CoreInternals_1.Konva, {\n Arc: Arc_1.Arc,\n Arrow: Arrow_1.Arrow,\n Circle: Circle_1.Circle,\n Ellipse: Ellipse_1.Ellipse,\n Image: Image_1.Image,\n Label: Label_1.Label,\n Tag: Label_1.Tag,\n Line: Line_1.Line,\n Path: Path_1.Path,\n Rect: Rect_1.Rect,\n RegularPolygon: RegularPolygon_1.RegularPolygon,\n Ring: Ring_1.Ring,\n Sprite: Sprite_1.Sprite,\n Star: Star_1.Star,\n Text: Text_1.Text,\n TextPath: TextPath_1.TextPath,\n Transformer: Transformer_1.Transformer,\n Wedge: Wedge_1.Wedge,\n Filters: {\n Blur: Blur_1.Blur,\n Brighten: Brighten_1.Brighten,\n Contrast: Contrast_1.Contrast,\n Emboss: Emboss_1.Emboss,\n Enhance: Enhance_1.Enhance,\n Grayscale: Grayscale_1.Grayscale,\n HSL: HSL_1.HSL,\n HSV: HSV_1.HSV,\n Invert: Invert_1.Invert,\n Kaleidoscope: Kaleidoscope_1.Kaleidoscope,\n Mask: Mask_1.Mask,\n Noise: Noise_1.Noise,\n Pixelate: Pixelate_1.Pixelate,\n Posterize: Posterize_1.Posterize,\n RGB: RGB_1.RGB,\n RGBA: RGBA_1.RGBA,\n Sepia: Sepia_1.Sepia,\n Solarize: Solarize_1.Solarize,\n Threshold: Threshold_1.Threshold,\n },\n});\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst _FullInternals_1 = require(\"./_FullInternals\");\nmodule.exports = _FullInternals_1.Konva;\n","import _slicedToArray from\"@babel/runtime/helpers/slicedToArray\";function _createForOfIteratorHelper(a,b){var c=\"undefined\"!=typeof Symbol&&a[Symbol.iterator]||a[\"@@iterator\"];if(!c){if(Array.isArray(a)||(c=_unsupportedIterableToArray(a))||b&&a&&\"number\"==typeof a.length){c&&(a=c);var d=0,e=function(){};return{s:e,n:function n(){return d>=a.length?{done:!0}:{done:!1,value:a[d++]}},e:function e(a){throw a},f: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.\")}var f,g=!0,h=!1;return{s:function s(){c=c.call(a)},n:function n(){var a=c.next();return g=a.done,a},e:function e(a){h=!0,f=a},f:function f(){try{g||null==c[\"return\"]||c[\"return\"]()}finally{if(h)throw f}}}}function _unsupportedIterableToArray(a,b){if(a){if(\"string\"==typeof a)return _arrayLikeToArray(a,b);var c=Object.prototype.toString.call(a).slice(8,-1);return\"Object\"===c&&a.constructor&&(c=a.constructor.name),\"Map\"===c||\"Set\"===c?Array.from(a):\"Arguments\"===c||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(c)?_arrayLikeToArray(a,b):void 0}}function _arrayLikeToArray(a,b){(null==b||b>a.length)&&(b=a.length);for(var c=0,d=Array(b);cc?-1:c,c=~~(255*c),[b[0]+c,b[1]+c,b[2]+c]}},contrast:function contrast(a){return function(b){var c=a;c*=255;var d=259*(c+255)/(255*(259-c));return[d*(b[0]-128)+128,d*(b[1]-128)+128,d*(b[2]-128)+128]}},saturation:function saturation(a){return function(c){var d=a;d=-1>d?-1:d;var e=c[0],f=c[1],g=c[2],b=.2989*e+.587*f+.114*g;return[-b*d+e*(1+d),-b*d+f*(1+d),-b*d+g*(1+d)]}},grayscale:function grayscale(){return function(a){var c=a[0],d=a[1],e=a[2];return[,,,].fill(.2126*c+.7152*d+.0722*e)}},sepia:function sepia(a){return function(c){var d=c[0],e=c[1],f=c[2];return[d*(1-.607*a)+.769*e*a+.189*f*a,.349*d*a+e*(1-.314*a)+.168*f*a,.272*d*a+.534*e*a+f*(1-.869*a)]}},adjustRGB:function adjustRGB(a){return function(b){return[b[0]*a[0],b[1]*a[1],b[2]*a[2]]}},colorFilter:function colorFilter(a){return function(c){var d=c[0],e=c[1],f=c[2],b=a[3];return[d-(d-a[0])*b,e-(e-a[1])*b,f-(f-a[2])*b]}}};export default BaseFilters;","import BaseFilters from\"./BaseFilters\";function BlackAndWhite(a){BaseFilters.apply(a,function(a){var b=(a[0]+a[1]+a[2])/3>100,c=b?255:0;return[c,c,c]})}BlackAndWhite.filterName=\"BlackAndWhite\";export default BlackAndWhite;","import BaseFilters from\"./BaseFilters\";var BRIGHTNESS_CONST=.1,CONTRAST_CONST=.1,SATURATION_CONST=.15;function Clarendon(a){BaseFilters.apply(a,BaseFilters.brightness(BRIGHTNESS_CONST),BaseFilters.contrast(CONTRAST_CONST),BaseFilters.saturation(SATURATION_CONST))}Clarendon.filterName=\"Clarendon\";export default Clarendon;","import BaseFilters from\"./BaseFilters\";var SEPIA_CONST=.04,CONTRAST_CONST=-.15;function Gingham(a){BaseFilters.apply(a,BaseFilters.sepia(SEPIA_CONST),BaseFilters.contrast(CONTRAST_CONST))}Gingham.filterName=\"Gingham\";export default Gingham;","import BaseFilters from\"./BaseFilters\";var BRIGHTNESS_CONST=.1;function Moon(a){BaseFilters.apply(a,BaseFilters.grayscale(),BaseFilters.brightness(BRIGHTNESS_CONST));var b=a.data,c=b.length}Moon.filterName=\"Moon\";export default Moon;","import BaseFilters from\"./BaseFilters\";var BRIGHTNESS_CONST=.08,ADJUST_RGB_CONST=[1,1.03,1.05],SATURATION_CONST=.12;function Lark(a){BaseFilters.apply(a,BaseFilters.brightness(BRIGHTNESS_CONST),BaseFilters.adjustRGB(ADJUST_RGB_CONST),BaseFilters.saturation(SATURATION_CONST))}Lark.filterName=\"Lark\";export default Lark;","import BaseFilters from\"./BaseFilters\";var SEPIA_CONST=.4,BRIGHTNESS_CONST=.13,CONTRAST_CONST=-.05;function Reyes(a){BaseFilters.apply(a,BaseFilters.sepia(SEPIA_CONST),BaseFilters.brightness(BRIGHTNESS_CONST),BaseFilters.contrast(CONTRAST_CONST))}Reyes.filterName=\"Reyes\";export default Reyes;","import BaseFilters from\"./BaseFilters\";var ADJUST_RGB_CONST=[1.01,1.04,1],SATURATION_CONST=.3;function Juno(a){BaseFilters.apply(a,BaseFilters.adjustRGB(ADJUST_RGB_CONST),BaseFilters.saturation(SATURATION_CONST))}Juno.filterName=\"Juno\";export default Juno;","import BaseFilters from\"./BaseFilters\";var BRIGHTNESS_CONST=.1,SATURATION_CONST=-.5;function Slumber(a){BaseFilters.apply(a,BaseFilters.brightness(BRIGHTNESS_CONST),BaseFilters.saturation(SATURATION_CONST))}Slumber.filterName=\"Slumber\";export default Slumber;","import BaseFilters from\"./BaseFilters\";var ADJUST_RGB_CONST=[1.04,1,1.02],SATURATION_CONST=-.05;function Crema(a){BaseFilters.apply(a,BaseFilters.adjustRGB(ADJUST_RGB_CONST),BaseFilters.saturation(SATURATION_CONST))}Crema.filterName=\"Crema\";export default Crema;","import BaseFilters from\"./BaseFilters\";var BRIGHTNESS_CONST=.05,SATURATION_CONST=-.03;function Ludwig(a){BaseFilters.apply(a,BaseFilters.brightness(BRIGHTNESS_CONST),BaseFilters.saturation(SATURATION_CONST))}Ludwig.filterName=\"Ludwig\";export default Ludwig;","import BaseFilters from\"./BaseFilters\";var COLOR_FILTER_CONST=[228,130,225,.13],SATURATION_CONST=-.2;function Aden(a){BaseFilters.apply(a,BaseFilters.colorFilter(COLOR_FILTER_CONST),BaseFilters.saturation(SATURATION_CONST))}Aden.filterName=\"Aden\";export default Aden;","import BaseFilters from\"./BaseFilters\";var ADJUST_RGB_CONST=[1.05,1.1,1];function Perpetua(a){BaseFilters.apply(a,BaseFilters.adjustRGB(ADJUST_RGB_CONST))}Perpetua.filterName=\"Perpetua\";export default Perpetua;","import BaseFilters from\"./BaseFilters\";var SATURATION_CONST=.3,BRIGHTNESS_CONST=.15;function Amaro(a){BaseFilters.apply(a,BaseFilters.saturation(SATURATION_CONST),BaseFilters.brightness(BRIGHTNESS_CONST))}Amaro.filterName=\"Amaro\";export default Amaro;","import BaseFilters from\"./BaseFilters\";var COLOR_FILTER_CONST=[230,115,108,.05],SATURATION_CONST=.15;function Mayfair(a){BaseFilters.apply(a,BaseFilters.colorFilter(COLOR_FILTER_CONST),BaseFilters.saturation(SATURATION_CONST))}Mayfair.filterName=\"Mayfair\";export default Mayfair;","import BaseFilters from\"./BaseFilters\";var COLOR_FILTER_CONST=[255,170,0,.1],BRIGHTNESS_CONST=.09,SATURATION_CONST=.1;function Rise(a){BaseFilters.apply(a,BaseFilters.colorFilter(COLOR_FILTER_CONST),BaseFilters.brightness(BRIGHTNESS_CONST),BaseFilters.saturation(SATURATION_CONST))}Rise.filterName=\"Rise\";export default Rise;","import BaseFilters from\"./BaseFilters\";var ADJUST_RGB_CONST=[1,1,1.25],CONTRAST_CONST=.1,BRIGHTNESS_CONST=.15;function Hudson(a){BaseFilters.apply(a,BaseFilters.adjustRGB(ADJUST_RGB_CONST),BaseFilters.contrast(CONTRAST_CONST),BaseFilters.brightness(BRIGHTNESS_CONST))}Hudson.filterName=\"Hudson\";export default Hudson;","import BaseFilters from\"./BaseFilters\";var COLOR_FILTER_CONST=[255,225,80,.08],SATURATION_CONST=.1,CONTRAST_CONST=.05;function Valencia(a){BaseFilters.apply(a,BaseFilters.colorFilter(COLOR_FILTER_CONST),BaseFilters.saturation(SATURATION_CONST),BaseFilters.contrast(CONTRAST_CONST))}Valencia.filterName=\"Valencia\";export default Valencia;","import BaseFilters from\"./BaseFilters\";var COLOR_FILTER_CONST=[255,255,0,.07],SATURATION_CONST=.2,CONTRAST_CONST=.15;function XPro2(a){BaseFilters.apply(a,BaseFilters.colorFilter(COLOR_FILTER_CONST),BaseFilters.saturation(SATURATION_CONST),BaseFilters.contrast(CONTRAST_CONST))}XPro2.filterName=\"XPro2\";export default XPro2;","import BaseFilters from\"./BaseFilters\";var CONTRAST_CONST=-.15,SATURATION_CONST=.1;function Sierra(a){BaseFilters.apply(a,BaseFilters.contrast(CONTRAST_CONST),BaseFilters.saturation(SATURATION_CONST))}Sierra.filterName=\"Sierra\";export default Sierra;","import BaseFilters from\"./BaseFilters\";var COLOR_FILTER_CONST=[100,28,210,.03],BRIGHTNESS_CONST=.1;function Willow(a){BaseFilters.apply(a,BaseFilters.grayscale(),BaseFilters.colorFilter(COLOR_FILTER_CONST),BaseFilters.brightness(BRIGHTNESS_CONST))}Willow.filterName=\"Willow\";export default Willow;","import BaseFilters from\"./BaseFilters\";var CONTRAST_CONST=.15,SATURATION_CONST=.2;function LoFi(a){BaseFilters.apply(a,BaseFilters.contrast(CONTRAST_CONST),BaseFilters.saturation(SATURATION_CONST))}LoFi.filterName=\"LoFi\";export default LoFi;","import BaseFilters from\"./BaseFilters\";var CONTRAST_CONST=.1,SATURATION_CONST=.15;function Hefe(a){BaseFilters.apply(a,BaseFilters.contrast(CONTRAST_CONST),BaseFilters.saturation(SATURATION_CONST))}Hefe.filterName=\"Hefe\";export default Hefe;","import BaseFilters from\"./BaseFilters\";var COLOR_FILTER_CONST=[220,115,188,.12],CONTRAST_CONST=-.05;function Nashville(a){BaseFilters.apply(a,BaseFilters.colorFilter(COLOR_FILTER_CONST),BaseFilters.contrast(CONTRAST_CONST))}Nashville.filterName=\"Nashville\";export default Nashville;","import BaseFilters from\"./BaseFilters\";var BRIGHTNESS_CONST=.1,SEPIA_CONST=.3;function Stinson(a){BaseFilters.apply(a,BaseFilters.brightness(BRIGHTNESS_CONST),BaseFilters.sepia(SEPIA_CONST))}Stinson.filterName=\"Stinson\";export default Stinson;","import BaseFilters from\"./BaseFilters\";var COLOR_FILTER_CONST=[255,225,0,.05],BRIGHTNESS_CONST=.06,CONTRAST_CONST=.06;function Vesper(a){BaseFilters.apply(a,BaseFilters.colorFilter(COLOR_FILTER_CONST),BaseFilters.brightness(BRIGHTNESS_CONST),BaseFilters.contrast(CONTRAST_CONST))}Vesper.filterName=\"Vesper\";export default Vesper;","import BaseFilters from\"./BaseFilters\";var COLOR_FILTER_CONST=[255,165,40,.2];function Earlybird(a){BaseFilters.apply(a,BaseFilters.colorFilter(COLOR_FILTER_CONST))}Earlybird.filterName=\"Earlybird\";export default Earlybird;","import BaseFilters from\"./BaseFilters\";var CONTRAST_CONST=.2,COLOR_FILTER_CONST=[140,10,185,.1];function Brannan(a){BaseFilters.apply(a,BaseFilters.contrast(CONTRAST_CONST),BaseFilters.colorFilter(COLOR_FILTER_CONST))}Brannan.filterName=\"Brannan\";export default Brannan;","import BaseFilters from\"./BaseFilters\";var BRIGHTNESS_CONST=-.1,SATURATION_CONST=-.1;function Sutro(a){BaseFilters.apply(a,BaseFilters.brightness(BRIGHTNESS_CONST),BaseFilters.saturation(SATURATION_CONST))}Sutro.filterName=\"Sutro\";export default Sutro;","import BaseFilters from\"./BaseFilters\";var SEPIA_CONST=.1,COLOR_FILTER_CONST=[255,145,0,.2];function Toaster(a){BaseFilters.apply(a,BaseFilters.sepia(SEPIA_CONST),BaseFilters.colorFilter(COLOR_FILTER_CONST))}Toaster.filterName=\"Toaster\";export default Toaster;","import BaseFilters from\"./BaseFilters\";var BRIGHTNESS_CONST=.1,COLOR_FILTER_CONST=[255,255,0,.2];function Walden(a){BaseFilters.apply(a,BaseFilters.brightness(BRIGHTNESS_CONST),BaseFilters.colorFilter(COLOR_FILTER_CONST))}Walden.filterName=\"Walden\";export default Walden;","import BaseFilters from\"./BaseFilters\";var COLOR_FILTER_CONST=[255,25,0,.15],BRIGHTNESS_CONST=.1;function NinteenSeventySeven(a){BaseFilters.apply(a,BaseFilters.colorFilter(COLOR_FILTER_CONST),BaseFilters.brightness(BRIGHTNESS_CONST))}NinteenSeventySeven.filterName=\"NinteenSeventySeven\";export default NinteenSeventySeven;","import BaseFilters from\"./BaseFilters\";var COLOR_FILTER_CONST=[255,140,0,.1],ADJUST_RGB_CONST=[1.15,1.05,1],SATURATION_CONST=.35;function Kelvin(a){BaseFilters.apply(a,BaseFilters.colorFilter(COLOR_FILTER_CONST),BaseFilters.adjustRGB(ADJUST_RGB_CONST),BaseFilters.saturation(SATURATION_CONST))}Kelvin.filterName=\"Kelvin\";export default Kelvin;","import BaseFilters from\"./BaseFilters\";var COLOR_FILTER_CONST=[225,240,0,.1],SATURATION_CONST=.25,CONTRAST_CONST=.05;function Maven(a){BaseFilters.apply(a,BaseFilters.colorFilter(COLOR_FILTER_CONST),BaseFilters.saturation(SATURATION_CONST),BaseFilters.contrast(CONTRAST_CONST))}Maven.filterName=\"Maven\";export default Maven;","import BaseFilters from\"./BaseFilters\";var SEPIA_CONST=.06,BRIGHTNESS_CONST=.1;function Ginza(a){BaseFilters.apply(a,BaseFilters.sepia(SEPIA_CONST),BaseFilters.brightness(BRIGHTNESS_CONST))}Ginza.filterName=\"Ginza\";export default Ginza;","import BaseFilters from\"./BaseFilters\";var SATURATION_CONST=.35,BRIGHTNESS_CONST=.1;function Skyline(a){BaseFilters.apply(a,BaseFilters.saturation(SATURATION_CONST),BaseFilters.brightness(BRIGHTNESS_CONST))}Skyline.filterName=\"Skyline\";export default Skyline;","import BaseFilters from\"./BaseFilters\";var CONTRAST_CONST=.15,BRIGHTNESS_CONST=.1;function Dogpatch(a){BaseFilters.apply(a,BaseFilters.contrast(CONTRAST_CONST),BaseFilters.brightness(BRIGHTNESS_CONST))}Dogpatch.filterName=\"Dogpatch\";export default Dogpatch;","import BaseFilters from\"./BaseFilters\";var COLOR_FILTER_CONST=[25,240,252,.05],SEPIA_CONST=.3;function Brooklyn(a){BaseFilters.apply(a,BaseFilters.colorFilter(COLOR_FILTER_CONST),BaseFilters.sepia(SEPIA_CONST))}Brooklyn.filterName=\"Brooklyn\";export default Brooklyn;","import BaseFilters from\"./BaseFilters\";var COLOR_FILTER_CONST=[208,208,86,.2],CONTRAST_CONST=.15;function Helena(a){BaseFilters.apply(a,BaseFilters.colorFilter(COLOR_FILTER_CONST),BaseFilters.contrast(CONTRAST_CONST))}Helena.filterName=\"Helena\";export default Helena;","import BaseFilters from\"./BaseFilters\";var COLOR_FILTER_CONST=[255,160,25,.1],BRIGHTNESS_CONST=.1;function Ashby(a){BaseFilters.apply(a,BaseFilters.colorFilter(COLOR_FILTER_CONST),BaseFilters.brightness(BRIGHTNESS_CONST))}Ashby.filterName=\"Ashby\";export default Ashby;","import BaseFilters from\"./BaseFilters\";var COLOR_FILTER_CONST=[255,50,80,.12],CONTRAST_CONST=.05;function Charmes(a){BaseFilters.apply(a,BaseFilters.colorFilter(COLOR_FILTER_CONST),BaseFilters.contrast(CONTRAST_CONST))}Charmes.filterName=\"Charmes\";export default Charmes;","import Konva from\"konva\";import*as CustomFilters from\"../custom/filters\";var filterStrToClass=function(a){return a?CustomFilters[a]||Konva.Filters[a]:null};export default filterStrToClass;","import Konva from\"konva\";import{Factory as KonvaFactory}from\"konva/lib/Factory\";import{getNumberValidator as konvaGetNumberValidator}from\"konva/lib/Validators\";function Warmth(a){for(var b=this.warmth(),c=a.data,d=c.length,e=0;e=b?255:0,c[e+1]=c[e+1]>=b?255:0,c[e+2]=c[e+2]>=b?255:0)}CustomThreshold.finetuneName=\"CustomThreshold\";export default CustomThreshold;KonvaFactory.addGetterSetter(Konva.Image,\"threshold\",0,konvaGetNumberValidator,KonvaFactory.afterSetFilter);","import Konva from\"konva\";import*as CustomFinetunes from\"../custom/finetunes\";var finetunesStrsToClasses=function(a){return Array.isArray(a)&&0d.status)b(d.response);else{var a;console.warn(\"Error in sending translation key to backend \".concat(null===(a=d.response)||void 0===a?void 0:a.hint,\", \").concat(d.status)),c()}},d.onerror=function(){var a;console.warn(\"Error in sending translation key to backend \".concat(null===(a=d.response)||void 0===a?void 0:a.hint,\", \").concat(d.status)),c()};d.open(\"POST\",\"https://neo.wordplex.io/api/import/request-translations?grid_uuid=\".concat(TRANSLATIONS_GRID_UUID)),d.send(JSON.stringify({grid_uuid:TRANSLATIONS_GRID_UUID,translations_requests:a}))})};export var getBackendTranslations=function(){var a=0f.status){(f.response||[]).forEach(function(a){backendTranslations[e]=_objectSpread(_objectSpread({},backendTranslations[e]),{},_defineProperty({},a.translation_key,a.translations[e]))});var a=[];Object.keys(defaultTranslations).forEach(function(b){var c;b&&!(null!==(c=backendTranslations[e])&&void 0!==c&&c[b])&&a.push({key:b,lang:e,default:defaultTranslations[b]})}),0d,l=0>e;switch(b){case TOOLS_IDS.RECT:c?(h.width=Math.sqrt(i*i+j*j),h.height=h.width,h.x-=k?h.width-i:0,h.y-=l?h.height-j:0):(h.width=i,h.height=j);break;case TOOLS_IDS.ELLIPSE:c?(h.radiusX=Math.sqrt(i*i+j*j)/2,h.radiusY=h.radiusX,h.x-=k?2*h.radiusX-i:0,h.y-=l?2*h.radiusY-j:0):(h.radiusX=i/2,h.radiusY=j/2),h.offsetX=-h.radiusX,h.offsetY=-h.radiusY;break;case TOOLS_IDS.POLYGON:h.radius=(i+j)/2,h.x-=k?2*h.radius-i:0,h.y-=l?2*h.radius-j:0,h.offsetX=-h.radius,h.offsetY=-h.radius;break;case TOOLS_IDS.LINE:case TOOLS_IDS.ARROW:h.x=f,h.y=g,h.points=[0,0],c?h.points.push(i>=j?d:0,j>i?e:0):h.points=[0,0,d,e];break;default:h.width=i,h.height=j}return h};export default getNewAnnotationPreview;","import _objectWithoutProperties from\"@babel/runtime/helpers/objectWithoutProperties\";import _defineProperty from\"@babel/runtime/helpers/defineProperty\";var _excluded=[\"id\",\"x\",\"y\",\"points\"],_excluded2=[\"startedX\",\"startedY\",\"offsetX\",\"offsetY\",\"width\",\"height\"];function ownKeys(a,b){var c=Object.keys(a);if(Object.getOwnPropertySymbols){var d=Object.getOwnPropertySymbols(a);b&&(d=d.filter(function(b){return Object.getOwnPropertyDescriptor(a,b).enumerable})),c.push.apply(c,d)}return c}function _objectSpread(a){for(var b,c=1;c=MIN_PIXELS&&latestAnnotationProps.height>=MIN_PIXELS||latestAnnotationProps.radiusX>=MIN_PIXELS&&latestAnnotationProps.radiusY>=MIN_PIXELS||null!==(c=latestAnnotationProps.points)&&void 0!==c&&c[2]||null!==(e=latestAnnotationProps.points)&&void 0!==e&&e[3]||latestAnnotationProps.radius>=MIN_PIXELS)){var f=latestAnnotationProps,g=f.startedX,h=f.startedY,i=f.offsetX,o=f.offsetY,p=f.width,q=f.height,r=_objectWithoutProperties(f,_excluded2);NO_WIDTH_HEIGHT_ANNOTATIONS.includes(b.name)||(r.width=p,r.height=q),d(r,!0)}shownAnnotationPreview=null,textAnnotationWrappedRect=null,latestAnnotationProps=null,a.setAttrs({isDrawing:!1}),a.off(\"mousemove touchmove\",l),a.off(\"mouseleave touchcancel\",m),document.removeEventListener(\"mouseup\",n,eventsOptions),document.removeEventListener(\"touchend\",n,eventsOptions),document.removeEventListener(\"mouseleave\",n,eventsOptions),document.removeEventListener(\"touchcancel\",n,eventsOptions),document.removeEventListener(\"mousemove\",j,eventsOptions),document.removeEventListener(\"touchmove\",j,eventsOptions),pointerDown.isOutOfCanvas=!1},o=function handlePointerDown(b){var d;if(b.evt.preventDefault(),!(b.target.attrs.draggable||1<(null===(d=b.evt.touches)||void 0===d?void 0:d.length))){k();var e=getPointerOffsetPositionBoundedToObject(c,f());pointerDown.startedX=e.offsetX,pointerDown.startedY=e.offsetY,pointerDown.isOutOfCanvas=!1,a.on(\"mousemove touchmove\",l),a.on(\"mouseleave touchcancel\",m),document.addEventListener(\"mouseup\",n,eventsOptions),document.addEventListener(\"touchend\",n,eventsOptions),document.addEventListener(\"mouseleave\",n,eventsOptions),document.addEventListener(\"touchcancel\",n,eventsOptions)}};return a.on(\"mousedown touchstart\",o),function(){k(),a.off(\"mousedown touchstart\",o)}};export default previewThenCallAnnotationAdding;","import{useCallback}from\"react\";import debounce from\"../utils/debounce\";var useDebouncedCallback=function(a,b){var c=2=e?0:function getTopOffset(){return 0>e&&-90=e&&-90<=e?0:function getLeftOffset(){return 90>>32-b},cvtHex=function(a){var b,c,d=\"\";for(b=7;0<=b;b--)c=15&a>>>4*b,d+=c.toString(16);return d},Utf8Encode=function(a){for(var b,d=a.replace(/\\r\\n/g,\"\\n\"),e=\"\",f=0;fb?e+=String.fromCharCode(b):127b?(e+=String.fromCharCode(192|b>>6),e+=String.fromCharCode(128|63&b)):(e+=String.fromCharCode(224|b>>12),e+=String.fromCharCode(128|63&b>>6),e+=String.fromCharCode(128|63&b));return e},sha1=function(a){var b,c,d,e,f,g,h,k,l,m=a,n=Array(80),o=1732584193,p=4023233417,q=2562383102,r=271733878,s=3285377520;m=Utf8Encode(m);var t=m.length,u=[];for(c=0;c>>29),u.push(4294967295&t<<3),b=0;bc;c++)n[c]=u[b+c];for(c=16;79>=c;c++)n[c]=rotateLeft(n[c-3]^n[c-8]^n[c-14]^n[c-16],1);for(e=o,f=p,g=q,h=r,k=s,c=0;19>=c;c++)l=4294967295&rotateLeft(e,5)+(f&g|~f&h)+k+n[c]+1518500249,k=h,h=g,g=rotateLeft(f,30),f=e,e=l;for(c=20;39>=c;c++)l=4294967295&rotateLeft(e,5)+(f^g^h)+k+n[c]+1859775393,k=h,h=g,g=rotateLeft(f,30),f=e,e=l;for(c=40;59>=c;c++)l=4294967295&rotateLeft(e,5)+(f&g|f&h|g&h)+k+n[c]+2400959708,k=h,h=g,g=rotateLeft(f,30),f=e,e=l;for(c=60;79>=c;c++)l=4294967295&rotateLeft(e,5)+(f^g^h)+k+n[c]+3395469782,k=h,h=g,g=rotateLeft(f,30),f=e,e=l;o=4294967295&o+e,p=4294967295&p+f,q=4294967295&q+g,r=4294967295&r+h,s=4294967295&s+k}return l=cvtHex(o)+cvtHex(p)+cvtHex(q)+cvtHex(r)+cvtHex(s),l.toLowerCase()};export default sha1;","import _slicedToArray from\"@babel/runtime/helpers/slicedToArray\";import sha1 from\"./sha1\";var encodeBase64=function(a){return btoa(a).replace(/=*$/g,\"\")},getSha1=function(a,b){return sha1(a).slice(0,b)},getSealingParams=function(a,b,c,d){var e=encodeBase64(a),f=getSha1(b+e+c,d);return[f?\"ci_seal=\".concat(f):\"\",e?\"ci_eqs=\".concat(e):\"\"].filter(function(a){return a}).join(\"&\")},getImageSealingParams=function(a,b,c){var d=b||{},e=d.salt,f=d.charCount,g=d.includeParams,h=void 0===g?[]:g,i=!h||0===(null===h||void 0===h?void 0:h.length),j=\"\",k=\"\",l=[],m=[];return a.split(\"&\").forEach(function(a){var b=a.split(\"=\"),c=_slicedToArray(b,1),d=c[0];-1<(null===h||void 0===h?void 0:h.indexOf(d))||i?l.push(a):m.push(a)}),0o?e*k/p:f*m/q),2);return\"\".concat(t,\"&wat_opacity=\").concat(i,\"&wat_scale=\").concat(A,\"p\").concat(z?\"&wat_url=\".concat(encodeURIComponent(z)):\"\")};export var finetuneNameToParamInfo={Brighten:{cloudimage:{name:\"bright\",min:-100,max:100},internal:{propName:\"brightness\",min:-1,max:1}},Contrast:{cloudimage:{name:\"contrast\",min:-100,max:100},internal:{propName:\"contrast\",min:-100,max:100}},Blur:{cloudimage:{name:\"blur\",min:0,max:100},internal:{propName:\"blurRadius\",min:0,max:100}}};var generateFinetuneQuery=function(a){var b=1 input{border:0px;clip:rect(0px,0px,0px,0px);height:100%;margin:-1px;overflow:hidden;padding:0px;position:absolute;white-space:nowrap;width:100%;direction:ltr;}&::before{position:absolute;content:'';border-radius:inherit;width:100%;height:100%;box-shadow:0px 3px 1px -2px rgb(0 0 0 / 20%),0px 2px 2px 0px rgb(0 0 0 / 14%),0px 1px 5px 0px rgb(0 0 0 / 12%);}&::after{position:absolute;content:'';border-radius:50%;width:42px;height:42px;top:50%;left:50%;transform:translate(-50%,-50%);}\"]);\nvar LabelTooltip = /*#__PURE__*/styled.span.attrs({\n className: generateClassNames(baseClassName, 'label')\n}).withConfig({\n componentId: \"sc-jjink6-4\"\n})(function (_ref2) {\n var theme = _ref2.theme,\n _ref2$open = _ref2.open,\n open = _ref2$open === void 0 ? false : _ref2$open,\n _ref2$disabled = _ref2.disabled,\n disabled = _ref2$disabled === void 0 ? false : _ref2$disabled;\n return css([\"display:flex;align-items:center;justify-content:center;padding:6px 6px;border-radius:2px;position:absolute;top:-10px;font-size:10px;z-index:1;white-space:nowrap;transition:transform 150ms cubic-bezier(0.4,0,0.2,1) 0ms;transform-origin:bottom center;transform:\", \";background-color:\", \";color:#fff;cursor:pointer;transition:all 100ms ease-out;&::before{position:absolute;content:'';background-color:inherit;width:8px;height:8px;bottom:0px;left:50%;transform:translate(-50%,50%) rotate(45deg);}\"], open ? 'translateY(-100%) scale(1)' : 'translateY(-100%) scale(0)', disabled ? theme.palette[PC.AccentPrimaryDisabled] : theme.palette[PC.LinkStateless]);\n});\nvar SliderAnnotation = /*#__PURE__*/styled.div.attrs({\n className: generateClassNames(baseClassName, 'annotation')\n}).withConfig({\n componentId: \"sc-jjink6-5\"\n})(function (_ref3) {\n var theme = _ref3.theme;\n return css([\"display:flex;justify-content:space-between;margin-top:12px;color:\", \";\"], theme.palette[PC.TextSecondary]);\n});\nvar Styled = applyDisplayNames({\n Slider: Slider,\n Rail: Rail,\n Track: Track,\n Thumb: Thumb,\n SliderAnnotation: SliderAnnotation,\n LabelTooltip: LabelTooltip\n});\nexport default Styled;","import _extends from \"@babel/runtime/helpers/extends\";\nimport _defineProperty from \"@babel/runtime/helpers/defineProperty\";\nimport _slicedToArray from \"@babel/runtime/helpers/slicedToArray\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/objectWithoutProperties\";\nvar _excluded = [\"defaultValue\", \"disabled\", \"disableSwap\", \"hideTrack\", \"hideAnnotation\", \"value\", \"min\", \"max\", \"onChange\", \"onMouseDown\", \"onMouseUp\", \"step\", \"labelTooltip\", \"annotation\", \"components\", \"componentsProps\"];\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\n/* eslint-disable no-use-before-define */\n\nimport React, { useEffect, useRef, useState, useCallback } from 'react';\nimport PT from 'prop-types';\nimport { intrinsicComponent, objectValues, asc, valueToPercent, percentToValue, roundValueToStep, setValueIndex, findClosest, ownerDocument, clamp, trackFinger, focusThumb, axisProps, useForkRef } from '../../utils/functions';\nimport useControlled from '../../hooks/use-controlled';\nimport useEventCallback from '../../hooks/use-event-callback';\nimport { LabelTooltip } from './types';\nimport Styled from './slider.styles';\nvar INTENTIONAL_DRAG_COUNT_THRESHOLD = 2;\nvar dataIndex = 'data-index';\nvar Slider = intrinsicComponent(function (_ref,\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nref) {\n var defaultValue = _ref.defaultValue,\n _ref$disabled = _ref.disabled,\n disabled = _ref$disabled === void 0 ? false : _ref$disabled,\n _ref$disableSwap = _ref.disableSwap,\n disableSwap = _ref$disableSwap === void 0 ? false : _ref$disableSwap,\n _ref$hideTrack = _ref.hideTrack,\n hideTrack = _ref$hideTrack === void 0 ? false : _ref$hideTrack,\n _ref$hideAnnotation = _ref.hideAnnotation,\n hideAnnotation = _ref$hideAnnotation === void 0 ? false : _ref$hideAnnotation,\n valueProp = _ref.value,\n _ref$min = _ref.min,\n min = _ref$min === void 0 ? 0 : _ref$min,\n _ref$max = _ref.max,\n max = _ref$max === void 0 ? 100 : _ref$max,\n onChange = _ref.onChange,\n onMouseDown = _ref.onMouseDown,\n onMouseUp = _ref.onMouseUp,\n _ref$step = _ref.step,\n step = _ref$step === void 0 ? 1 : _ref$step,\n _ref$labelTooltip = _ref.labelTooltip,\n labelTooltip = _ref$labelTooltip === void 0 ? LabelTooltip.Off : _ref$labelTooltip,\n _ref$annotation = _ref.annotation,\n annotation = _ref$annotation === void 0 ? '' : _ref$annotation,\n _ref$components = _ref.components,\n components = _ref$components === void 0 ? {} : _ref$components,\n _ref$componentsProps = _ref.componentsProps,\n componentsProps = _ref$componentsProps === void 0 ? {} : _ref$componentsProps,\n rest = _objectWithoutProperties(_ref, _excluded);\n var _useState = useState(-1),\n _useState2 = _slicedToArray(_useState, 2),\n active = _useState2[0],\n setActive = _useState2[1];\n var _useState3 = useState(-1),\n _useState4 = _slicedToArray(_useState3, 2),\n open = _useState4[0],\n setOpen = _useState4[1];\n var _useState5 = useState(false),\n _useState6 = _slicedToArray(_useState5, 2),\n dragging = _useState6[0],\n setDragging = _useState6[1];\n var moveCount = useRef(0);\n var previousIndex = useRef(0);\n var touchId = useRef();\n var sliderRef = useRef(null);\n var handleRef = useForkRef(ref, sliderRef);\n var _useControlled = useControlled({\n controlled: valueProp,\n \"default\": defaultValue !== null && defaultValue !== void 0 ? defaultValue : min\n }),\n _useControlled2 = _slicedToArray(_useControlled, 2),\n valueDerived = _useControlled2[0],\n setValueState = _useControlled2[1];\n var axis = 'horizontal';\n var range = Array.isArray(valueDerived);\n var values = range ? valueDerived.slice().sort(asc) : [valueDerived];\n var getFingerNewValue = function getFingerNewValue(_ref2) {\n var finger = _ref2.finger,\n _ref2$move = _ref2.move,\n move = _ref2$move === void 0 ? false : _ref2$move,\n values2 = _ref2.values;\n var slider = sliderRef.current;\n if (slider) {\n var _slider$getBoundingCl = slider.getBoundingClientRect(),\n width = _slider$getBoundingCl.width,\n height = _slider$getBoundingCl.height,\n bottom = _slider$getBoundingCl.bottom,\n left = _slider$getBoundingCl.left;\n var percent;\n if (axis.indexOf('vertical') === 0) {\n percent = (bottom - finger.y) / height;\n } else {\n percent = (finger.x - left) / width;\n }\n if (axis.includes('-reverse')) {\n percent = 1 - percent;\n }\n var newValue;\n newValue = percentToValue(percent, min, max);\n if (step) {\n newValue = roundValueToStep(newValue, step, min);\n }\n newValue = clamp(newValue, min, max);\n var activeIndex = 0;\n if (range) {\n if (!move) {\n activeIndex = findClosest(values2, newValue);\n } else {\n activeIndex = previousIndex.current;\n }\n if (disableSwap) {\n newValue = clamp(newValue, values2[activeIndex - 1] || -Infinity, values2[activeIndex + 1] || Infinity);\n }\n var previousValue = newValue;\n newValue = setValueIndex({\n values: values2,\n newValue: newValue,\n index: activeIndex\n });\n if (!(disableSwap && move) && Array.isArray(newValue)) {\n activeIndex = newValue.indexOf(previousValue);\n previousIndex.current = activeIndex;\n }\n }\n return {\n newValue: newValue,\n activeIndex: activeIndex\n };\n }\n return null;\n };\n var handleChange = function handleChange(event, value, thumbIndex) {\n if (onChange) {\n onChange(event, value, thumbIndex);\n }\n };\n var handleHiddenInputChange = function handleHiddenInputChange(event) {\n var index = Number(event.currentTarget.getAttribute(dataIndex));\n var newValue = event.target.valueAsNumber;\n if (range) {\n if (disableSwap) {\n newValue = clamp(newValue, values[index - 1] || -Infinity, values[index + 1] || Infinity);\n }\n var previousValue = newValue;\n newValue = setValueIndex({\n values: values,\n newValue: newValue,\n index: index\n });\n var activeIndex = index;\n if (!disableSwap) {\n activeIndex = newValue.indexOf(previousValue);\n }\n focusThumb({\n sliderRef: sliderRef,\n activeIndex: activeIndex\n });\n }\n setValueState(newValue);\n handleChange(event, newValue, index);\n if (onMouseUp) {\n onMouseUp(event);\n }\n };\n var handleTouchMove = useEventCallback(function (nativeEvent) {\n var finger = trackFinger(nativeEvent, touchId);\n if (!finger) {\n return;\n }\n moveCount.current += 1;\n if (nativeEvent.type === 'mousemove' && nativeEvent.buttons === 0) {\n handleTouchEnd(nativeEvent);\n return;\n }\n var _ref3 = getFingerNewValue({\n finger: finger,\n move: true,\n values: values\n }),\n newValue = _ref3.newValue,\n activeIndex = _ref3.activeIndex;\n focusThumb({\n sliderRef: sliderRef,\n activeIndex: activeIndex,\n setActive: setActive\n });\n setValueState(newValue);\n if (!dragging && moveCount.current > INTENTIONAL_DRAG_COUNT_THRESHOLD) {\n setDragging(true);\n }\n handleChange(nativeEvent, newValue, activeIndex);\n });\n var handleTouchEnd = useEventCallback(function (nativeEvent) {\n var finger = trackFinger(nativeEvent, touchId);\n setDragging(false);\n if (!finger) {\n return;\n }\n setActive(-1);\n if (nativeEvent.type === 'touchend') {\n setOpen(-1);\n }\n if (onMouseUp) {\n onMouseUp(nativeEvent);\n }\n touchId.current = undefined;\n stopListening();\n });\n var handleTouchStart = useEventCallback(function (nativeEvent) {\n var touch = nativeEvent.changedTouches[0];\n if (touch != null) {\n touchId.current = touch.identifier;\n }\n var finger = trackFinger(nativeEvent, touchId);\n var _ref4 = getFingerNewValue({\n finger: finger,\n values: values\n }),\n newValue = _ref4.newValue,\n activeIndex = _ref4.activeIndex;\n focusThumb({\n sliderRef: sliderRef,\n activeIndex: activeIndex,\n setActive: setActive\n });\n setValueState(newValue);\n handleChange(nativeEvent, newValue, activeIndex);\n moveCount.current = 0;\n var doc = ownerDocument(sliderRef.current);\n doc.addEventListener('touchmove', handleTouchMove);\n doc.addEventListener('touchend', handleTouchEnd);\n });\n var handleMouseOver = useEventCallback(function (event) {\n var index = Number(event.currentTarget.getAttribute(dataIndex));\n setOpen(index);\n });\n var handleMouseLeave = useEventCallback(function () {\n setOpen(-1);\n });\n var handleMouseDown = useEventCallback(function (event) {\n if (!disabled) {\n if (onMouseDown) {\n onMouseDown(event);\n }\n if (event.button !== 0) {\n return;\n }\n\n // Avoid text selection\n event.preventDefault();\n var finger = trackFinger(event, touchId);\n var _ref5 = getFingerNewValue({\n finger: finger,\n values: values\n }),\n newValue = _ref5.newValue,\n activeIndex = _ref5.activeIndex;\n focusThumb({\n sliderRef: sliderRef,\n activeIndex: activeIndex,\n setActive: setActive\n });\n setValueState(newValue);\n handleChange(event, newValue, activeIndex);\n moveCount.current = 0;\n var doc = ownerDocument(sliderRef.current);\n doc.addEventListener('mousemove', handleTouchMove);\n doc.addEventListener('mouseup', handleTouchEnd);\n } else {\n // Avoid text selection\n event.preventDefault();\n }\n });\n var stopListening = useCallback(function () {\n var doc = ownerDocument(sliderRef.current);\n doc.removeEventListener('mousemove', handleTouchMove);\n doc.removeEventListener('mouseup', handleTouchEnd);\n doc.removeEventListener('touchmove', handleTouchMove);\n doc.removeEventListener('touchend', handleTouchEnd);\n }, [handleTouchEnd, handleTouchMove]);\n useEffect(function () {\n var slider = sliderRef.current;\n if (slider) {\n return function () {\n stopListening();\n };\n }\n }, [stopListening, handleTouchStart]);\n useEffect(function () {\n if (disabled) {\n stopListening();\n }\n }, [disabled, stopListening]);\n if (disabled && active !== -1) {\n setActive(-1);\n }\n var trackOffset = valueToPercent(range ? values[0] : min, min, max);\n var trackLeap = valueToPercent(values[values.length - 1], min, max) - trackOffset;\n var trackStyle = _objectSpread(_objectSpread({}, axisProps[axis].offset(trackOffset)), axisProps[axis].leap(trackLeap));\n var railProps = componentsProps.rail;\n var Rail = typeof components.Rail === 'function' ? /*#__PURE__*/React.createElement(components.Rail, _extends({}, railProps, {\n style: _objectSpread({}, railProps === null || railProps === void 0 ? void 0 : railProps.style)\n })) : /*#__PURE__*/React.createElement(Styled.Rail, _extends({}, railProps, {\n style: _objectSpread({}, railProps === null || railProps === void 0 ? void 0 : railProps.style)\n }));\n var trackProps = componentsProps.track;\n var Track = !hideTrack && (typeof components.Track === 'function' ? /*#__PURE__*/React.createElement(components.Track, _extends({}, trackProps, {\n style: _objectSpread(_objectSpread({}, trackStyle), trackProps === null || trackProps === void 0 ? void 0 : trackProps.style)\n })) : /*#__PURE__*/React.createElement(Styled.Track, _extends({}, trackProps, {\n style: _objectSpread(_objectSpread({}, trackStyle), trackProps === null || trackProps === void 0 ? void 0 : trackProps.style)\n })));\n var thumbProps = componentsProps.thumb;\n var Thumb = components.Thumb || Styled.Thumb;\n var LabelTooltipComponent = components.LabelTooltip || Styled.LabelTooltip;\n var labelTooltipProps = componentsProps.labelTooltip;\n var annotationText = annotation ? \" \".concat(annotation) : '';\n return /*#__PURE__*/React.createElement(Styled.Slider, _extends({\n ref: handleRef,\n disabled: disabled,\n onTouchStart: handleTouchStart,\n onMouseDown: handleMouseDown\n }, rest), Rail, Track, values.map(function (value, index) {\n var percent = valueToPercent(value, min, max);\n var style = axisProps[axis].offset(percent);\n return /*#__PURE__*/React.createElement(React.Fragment, {\n key: index\n }, /*#__PURE__*/React.createElement(Thumb, _extends({\n \"data-index\": index,\n onMouseOver: handleMouseOver,\n onMouseLeave: handleMouseLeave\n }, thumbProps, {\n style: _objectSpread(_objectSpread({}, style), {}, {\n pointerEvents: disableSwap && active !== index ? 'none' : undefined\n }, thumbProps === null || thumbProps === void 0 ? void 0 : thumbProps.style)\n }), /*#__PURE__*/React.createElement(\"input\", {\n \"data-index\": index,\n type: \"range\",\n min: min,\n max: max,\n value: values[index],\n step: step,\n disabled: disabled,\n onChange: handleHiddenInputChange\n }), /*#__PURE__*/React.createElement(LabelTooltipComponent, {\n open: (open === index || active === index || labelTooltip === 'on') && labelTooltip !== 'off',\n disabled: disabled,\n style: _objectSpread({}, labelTooltipProps === null || labelTooltipProps === void 0 ? void 0 : labelTooltipProps.style)\n }, values[index], annotationText)));\n }), !hideAnnotation && /*#__PURE__*/React.createElement(Styled.SliderAnnotation, null, /*#__PURE__*/React.createElement(\"span\", null, min, annotationText), /*#__PURE__*/React.createElement(\"span\", null, max, annotationText)));\n});\nSlider.defaultProps = {\n annotation: 'MB',\n min: 0,\n max: 100,\n step: 1,\n labelTooltip: LabelTooltip.Off\n};\nSlider.propTypes = {\n defaultValue: PT.oneOfType([PT.array, PT.number]),\n value: PT.oneOfType([PT.array, PT.number]),\n min: PT.number,\n max: PT.number,\n onChange: PT.func,\n onMouseDown: PT.func,\n onMouseUp: PT.func,\n step: PT.number,\n annotation: PT.string,\n disabled: PT.bool,\n disableSwap: PT.bool,\n hideTrack: PT.bool,\n hideAnnotation: PT.bool,\n labelTooltip: PT.oneOf(objectValues(LabelTooltip)),\n components: PT.shape({\n Rail: PT.elementType,\n Track: PT.elementType,\n Thumb: PT.elementType,\n LabelTooltip: PT.elementType\n }),\n componentsProps: PT.object\n};\nexport default Slider;","import styled from\"styled-components\";import Slider from\"@scaleflex/ui/core/slider\";import{Color as PC}from\"@scaleflex/ui/utils/types/palette\";var StyledSlider=styled(Slider).withConfig({componentId:\"sc-1wort0h-0\"})([\"width:\",\";max-width:\",\";user-select:none;padding:0;margin-bottom:\",\";.SfxSlider-thumb{background-color:\",\";}.SfxSlider-Track{height:2px;color:\",\";}.SfxSlider-rail{height:2px;background-color:\",\";}\"],function(a){var b=a.width;return b||\"104px\"},function(a){var b=a.width;return b||\"104px\"},function(a){var b=a.noMargin;return b?\"\":\"16px\"},function(a){var b=a.theme.palette;return b[PC.AccentStateless]},function(a){var b=a.theme.palette;return b[PC.AccentStateless]},function(a){var b=a.theme.palette;return b[PC.BordersItem]});export{StyledSlider};","import _extends from\"@babel/runtime/helpers/extends\";import _objectWithoutProperties from\"@babel/runtime/helpers/objectWithoutProperties\";var _excluded=[\"onChange\"];import React from\"react\";import{StyledSlider}from\"./Slider.styled\";var Slider=function(a){var b=a.onChange,c=_objectWithoutProperties(a,_excluded);return React.createElement(StyledSlider,_extends({annotation:\"\",onChange:function onChange(a,c){return b?b(c):void 0},hideAnnotation:!0,labelTooltip:\"auto\"},c))};export default Slider;","import PT from 'prop-types';\nexport var iconPropTypes = {\n size: PT.number,\n width: PT.oneOfType([PT.string, PT.number]),\n height: PT.oneOfType([PT.string, PT.number]),\n color: PT.string,\n color2: PT.string,\n stroke: PT.string,\n stroke2: PT.string,\n viewBox: PT.string\n};","import _extends from \"@babel/runtime/helpers/extends\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/objectWithoutProperties\";\nvar _excluded = [\"color\", \"size\"];\nimport React from 'react';\nimport { intrinsicComponent } from './utils/functions';\nexport var ArrowBottom = intrinsicComponent(function (_ref, ref) {\n var _ref$color = _ref.color,\n color = _ref$color === void 0 ? 'currentColor' : _ref$color,\n _ref$size = _ref.size,\n size = _ref$size === void 0 ? 14 : _ref$size,\n rest = _objectWithoutProperties(_ref, _excluded);\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n ref: ref,\n width: size,\n height: size,\n viewBox: \"0 0 11 12\",\n fill: \"none\",\n xmlns: \"http://www.w3.org/2000/svg\"\n }, rest), /*#__PURE__*/React.createElement(\"path\", {\n fillRule: \"evenodd\",\n clipRule: \"evenodd\",\n d: \"M10.8468 3.13984C11.0457 3.33138 11.0517 3.64791 10.8602 3.84682L6.04534 8.84682C5.95332 8.94238 5.82709 8.99746 5.69445 8.99991C5.5618 9.00237 5.43362 8.95201 5.33812 8.85992L0.152931 3.85992C-0.0458479 3.66824 -0.0516033 3.35171 0.140078 3.15293C0.331758 2.95415 0.648288 2.9484 0.847067 3.14008L5.67208 7.79277L10.1398 3.15318C10.3314 2.95427 10.6479 2.9483 10.8468 3.13984Z\",\n fill: color\n }));\n});\nexport default ArrowBottom;","import _defineProperty from \"@babel/runtime/helpers/defineProperty\";\nimport { css } from 'styled-components';\n// import type { WithTheme } from '../../theme/entity';\n// import { Color as PaletteColor } from '../../utils/types/palette';\nimport { Position } from '../../utils/types';\nexport var typeArrowTickMixin = _defineProperty(_defineProperty(_defineProperty(_defineProperty({}, Position.Right, css([\"svg{transform:rotate(-90deg);transition:transform 150ms ease-out;}\"])), Position.Left, css([\"svg{transform:rotate(90deg);transition:transform 150ms ease-out;}\"])), Position.Top, css([\"svg{transform:rotate(180deg);transition:transform 150ms ease-out;}\"])), Position.Bottom, css([\"svg{transform:rotate(0);transition:transform 150ms ease-out;}\"]));","import styled, { css } from 'styled-components';\nimport { generateClassNames, applyDisplayNames } from '../../utils/functions';\nimport { typeArrowTickMixin } from './arrow-tick.mixin';\nimport { Position } from '../../utils/types';\nvar baseClassName = 'ArrowTick';\nvar ArrowTick = /*#__PURE__*/styled.span.attrs({\n className: generateClassNames(baseClassName, 'root')\n}).withConfig({\n componentId: \"sc-tlypde-0\"\n})(function (_ref) {\n var _ref$type = _ref.type,\n type = _ref$type === void 0 ? Position.Right : _ref$type;\n return css([\"display:inline-flex;\", \"\"], typeArrowTickMixin[type]);\n});\nvar Styled = applyDisplayNames({\n ArrowTick: ArrowTick\n});\nexport default Styled;","import _extends from \"@babel/runtime/helpers/extends\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/objectWithoutProperties\";\nvar _excluded = [\"IconProps\"];\nimport React from 'react';\nimport PT from 'prop-types';\nimport ArrowBottom from '@scaleflex/icons/arrow-bottom';\nimport { iconPropTypes } from '@scaleflex/icons/icon.prop-types';\nimport { intrinsicComponent, objectValues } from '../../utils/functions';\nimport { Position } from '../../utils/types';\nimport Styled from './arrow-tick.styles';\nvar ArrowTick = intrinsicComponent(function (_ref, ref) {\n var IconPropsData = _ref.IconProps,\n rest = _objectWithoutProperties(_ref, _excluded);\n return /*#__PURE__*/React.createElement(Styled.ArrowTick, _extends({}, rest, {\n ref: ref\n }), /*#__PURE__*/React.createElement(ArrowBottom, IconPropsData));\n});\nArrowTick.defaultProps = {\n type: Position.Right\n};\nArrowTick.propTypes = {\n type: PT.oneOf(objectValues(Position)),\n IconProps: PT.exact(iconPropTypes)\n};\nexport default ArrowTick;","import styled, { css } from 'styled-components';\nimport { generateClassNames, applyDisplayNames } from '../../utils/functions';\nimport { Color as PColor } from '../../utils/types/palette';\nimport { FontVariant } from '../../utils/types/typography';\nvar baseClassName = 'AccordionHeader';\nvar Icon = /*#__PURE__*/styled.span.attrs({\n className: generateClassNames(baseClassName, 'icon')\n}).withConfig({\n componentId: \"sc-1dtjsgt-0\"\n})(function () {\n return css([\"display:inline-flex;padding-left:8px;\"]);\n});\nvar Label = /*#__PURE__*/styled.span.attrs({\n className: generateClassNames(baseClassName, 'label')\n}).withConfig({\n componentId: \"sc-1dtjsgt-1\"\n})(function (_ref) {\n var theme = _ref.theme;\n return css([\"\", \"\"], theme.typography.font[FontVariant.ButtonSm]);\n});\nvar Header = /*#__PURE__*/styled.div.attrs({\n className: generateClassNames(baseClassName, 'root')\n}).withConfig({\n componentId: \"sc-1dtjsgt-2\"\n})(function (_ref2) {\n var theme = _ref2.theme,\n fullWidth = _ref2.fullWidth;\n return css([\"display:inline-flex;align-items:center;justify-content:space-between;box-sizing:border-box;cursor:pointer;width:\", \";color:\", \";user-select:none;\"], fullWidth ? '100%' : 'auto', theme.palette[PColor.LinkPrimary]);\n});\nvar Wrapper = /*#__PURE__*/styled.div.attrs({\n className: generateClassNames(baseClassName, 'wrapper')\n}).withConfig({\n componentId: \"sc-1dtjsgt-3\"\n})(function (_ref3) {\n var theme = _ref3.theme;\n return css([\"color:\", \";\"], theme.palette[PColor.LinkPrimary]);\n});\nvar Styled = applyDisplayNames({\n Header: Header,\n Wrapper: Wrapper,\n Icon: Icon,\n Label: Label\n});\nexport default Styled;","import _extends from \"@babel/runtime/helpers/extends\";\nimport _defineProperty from \"@babel/runtime/helpers/defineProperty\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/objectWithoutProperties\";\nvar _excluded = [\"expanded\", \"label\", \"onChange\", \"onClick\", \"onContextMenu\", \"hideIcon\", \"fullWidth\", \"iconProps\"];\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nimport React from 'react';\nimport PT from 'prop-types';\nimport { iconPropTypes } from '@scaleflex/icons/icon.prop-types';\nimport { intrinsicComponent } from '../../utils/functions';\nimport ArrowTick from '../arrow-tick';\nimport { Position as ArrowTickType } from '../../utils/types';\nimport Styled from './accordion-header.styles';\nvar AccordionHeader = intrinsicComponent(function (_ref, ref) {\n var expanded = _ref.expanded,\n label = _ref.label,\n onChange = _ref.onChange,\n _onClick = _ref.onClick,\n onContextMenu = _ref.onContextMenu,\n hideIcon = _ref.hideIcon,\n fullWidth = _ref.fullWidth,\n iconPropsData = _ref.iconProps,\n rest = _objectWithoutProperties(_ref, _excluded);\n return /*#__PURE__*/React.createElement(Styled.Header, _extends({\n ref: ref,\n onClick: function onClick(event) {\n if (typeof onChange === 'function') {\n onChange(!expanded);\n }\n if (typeof _onClick === 'function') {\n _onClick(event);\n }\n },\n fullWidth: fullWidth\n }, rest), /*#__PURE__*/React.createElement(Styled.Label, {\n onContextMenu: onContextMenu\n }, label), !hideIcon && /*#__PURE__*/React.createElement(Styled.Icon, {\n onContextMenu: onContextMenu\n }, /*#__PURE__*/React.createElement(ArrowTick, {\n type: expanded ? ArrowTickType.Top : ArrowTickType.Bottom,\n IconProps: _objectSpread({\n size: 11\n }, iconPropsData)\n })));\n});\nAccordionHeader.defaultProps = {\n expanded: false,\n hideIcon: false,\n fullWidth: false\n};\nAccordionHeader.propTypes = {\n label: PT.node.isRequired,\n expanded: PT.bool,\n hideIcon: PT.bool,\n fullWidth: PT.bool,\n onChange: PT.func,\n iconProps: PT.exact(iconPropTypes)\n};\nexport default AccordionHeader;","import styled from 'styled-components';\nimport { generateClassNames, applyDisplayNames } from '../../utils/functions';\nvar baseClassName = 'AccordionDetails';\nvar AccordionDetails = /*#__PURE__*/styled.div.attrs({\n className: generateClassNames(baseClassName, 'root')\n}).withConfig({\n componentId: \"sc-1wr6wpr-0\"\n})([\"margin:16px 0;\"]);\nvar Styled = applyDisplayNames({\n AccordionDetails: AccordionDetails\n});\nexport default Styled;","import _extends from \"@babel/runtime/helpers/extends\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/objectWithoutProperties\";\nvar _excluded = [\"expanded\", \"children\"];\nimport React from 'react';\nimport PT from 'prop-types';\nimport { intrinsicComponent } from '../../utils/functions';\nimport Styled from './accordion-details.styles';\nvar AccordionDetails = intrinsicComponent(function (_ref, ref) {\n var expanded = _ref.expanded,\n children = _ref.children,\n rest = _objectWithoutProperties(_ref, _excluded);\n return /*#__PURE__*/React.createElement(React.Fragment, null, expanded && /*#__PURE__*/React.createElement(Styled.AccordionDetails, _extends({\n ref: ref\n }, rest), children));\n});\nAccordionDetails.defaultProps = {\n expanded: false\n};\nAccordionDetails.propTypes = {\n expanded: PT.bool\n};\nexport default AccordionDetails;","import styled from 'styled-components';\nimport { generateClassNames, applyDisplayNames } from '../../utils/functions';\nvar baseClassName = 'Accordion';\nvar Accordion = /*#__PURE__*/styled.div.attrs({\n className: generateClassNames(baseClassName, 'root')\n}).withConfig({\n componentId: \"sc-1g4tz7s-0\"\n})([\"\"]);\nvar Styled = applyDisplayNames({\n Accordion: Accordion\n});\nexport default Styled;","import _extends from \"@babel/runtime/helpers/extends\";\nimport _defineProperty from \"@babel/runtime/helpers/defineProperty\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/objectWithoutProperties\";\nvar _excluded = [\"label\", \"expanded\", \"children\", \"detailStyle\", \"headerStyle\", \"fullWidth\", \"iconProps\", \"onClick\", \"onChange\", \"onContextMenu\", \"hideIcon\"];\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nimport React from 'react';\nimport PT from 'prop-types';\nimport { iconPropTypes } from '@scaleflex/icons/icon.prop-types';\nimport { intrinsicComponent } from '../../utils/functions';\nimport AccordionHeader from '../accordion-header';\nimport AccordionDetails from '../accordion-details';\nimport Styled from './accordion.styles';\nvar Accordion = intrinsicComponent(function (_ref, ref) {\n var label = _ref.label,\n expanded = _ref.expanded,\n children = _ref.children,\n detailStyle = _ref.detailStyle,\n headerStyle = _ref.headerStyle,\n fullWidth = _ref.fullWidth,\n iconPropsData = _ref.iconProps,\n _onClick = _ref.onClick,\n onChange = _ref.onChange,\n onContextMenu = _ref.onContextMenu,\n hideIcon = _ref.hideIcon,\n rest = _objectWithoutProperties(_ref, _excluded);\n return /*#__PURE__*/React.createElement(Styled.Accordion, _extends({\n ref: ref\n }, rest), /*#__PURE__*/React.createElement(AccordionHeader, {\n label: label,\n expanded: expanded,\n style: _objectSpread({}, headerStyle),\n hideIcon: hideIcon,\n onClick: function onClick(event) {\n if (typeof onChange === 'function') {\n onChange(!expanded, event);\n }\n if (typeof _onClick === 'function') {\n _onClick(event);\n }\n },\n onContextMenu: onContextMenu,\n iconProps: iconPropsData,\n fullWidth: fullWidth\n }), /*#__PURE__*/React.createElement(AccordionDetails, {\n expanded: expanded,\n style: _objectSpread({}, detailStyle)\n }, children));\n});\nAccordion.defaultProps = {\n expanded: false,\n hideIcon: false\n};\nAccordion.propTypes = {\n label: PT.node.isRequired,\n expanded: PT.bool,\n detailStyle: PT.object,\n headerStyle: PT.object,\n onChange: PT.func,\n onContextMenu: PT.func,\n hideIcon: PT.bool,\n fullWidth: PT.bool,\n iconProps: PT.exact(iconPropTypes)\n};\nexport default Accordion;","import _extends from \"@babel/runtime/helpers/extends\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/objectWithoutProperties\";\nvar _excluded = [\"stroke\", \"size\"];\nimport React from 'react';\nimport { intrinsicComponent } from './utils/functions';\nexport var Arrow = intrinsicComponent(function (_ref, ref) {\n var _ref$stroke = _ref.stroke,\n stroke = _ref$stroke === void 0 ? 'currentColor' : _ref$stroke,\n _ref$size = _ref.size,\n size = _ref$size === void 0 ? 10 : _ref$size,\n rest = _objectWithoutProperties(_ref, _excluded);\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n ref: ref,\n width: size * (51 / 56),\n height: size,\n viewBox: \"0 0 51 56\",\n fill: \"none\",\n xmlns: \"http://www.w3.org/2000/svg\"\n }, rest), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M12.2754 3L37.2754 27.0741L12.2754 53\",\n stroke: stroke,\n strokeWidth: \"5\",\n strokeLinecap: \"round\",\n strokeLinejoin: \"round\"\n }));\n});\nexport default Arrow;","import _extends from \"@babel/runtime/helpers/extends\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/objectWithoutProperties\";\nvar _excluded = [\"color\", \"size\"];\nimport React from 'react';\nimport { intrinsicComponent } from './utils/functions';\nexport var Tick = intrinsicComponent(function (_ref, ref) {\n var _ref$color = _ref.color,\n color = _ref$color === void 0 ? 'currentColor' : _ref$color,\n _ref$size = _ref.size,\n size = _ref$size === void 0 ? 14 : _ref$size,\n rest = _objectWithoutProperties(_ref, _excluded);\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n ref: ref,\n width: size,\n height: size,\n viewBox: \"0 0 14 14\",\n fill: \"none\",\n xmlns: \"http://www.w3.org/2000/svg\"\n }, rest), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M12.9783 2.30184C12.7972 2.12074 12.586 2 12.3143 2C12.0728 2 11.8314 2.09055 11.6503 2.30184L4.73816 9.84779L2.29327 7.34254C2.11217 7.16143 1.8707 7.07088 1.62923 7.07088C1.38776 7.07088 1.14629 7.19162 0.995367 7.37272C0.663345 7.76511 0.663345 8.36879 1.02555 8.73099L4.13448 11.9003C4.31559 12.0814 4.52687 12.1719 4.76835 12.1719C5.00982 12.1719 5.25129 12.0814 5.43239 11.8701L12.9783 3.62993C13.3406 3.2979 13.3406 2.66404 12.9783 2.30184Z\",\n fill: color\n }));\n});\nexport default Tick;","import _extends from \"@babel/runtime/helpers/extends\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/objectWithoutProperties\";\nvar _excluded = [\"color\", \"size\"];\nimport React from 'react';\nimport { intrinsicComponent } from './utils/functions';\nexport var CopyOutline = intrinsicComponent(function (_ref, ref) {\n var _ref$color = _ref.color,\n color = _ref$color === void 0 ? 'currentColor' : _ref$color,\n _ref$size = _ref.size,\n size = _ref$size === void 0 ? 14 : _ref$size,\n rest = _objectWithoutProperties(_ref, _excluded);\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n ref: ref,\n width: size,\n height: size,\n viewBox: \"0 0 16 16\",\n fill: \"none\",\n xmlns: \"http://www.w3.org/2000/svg\"\n }, rest), /*#__PURE__*/React.createElement(\"path\", {\n fillRule: \"evenodd\",\n clipRule: \"evenodd\",\n d: \"M2.33984 12.111V2.04761C2.33984 1.49532 2.78756 1.04761 3.33984 1.04761H10.8182C11.3705 1.04761 11.8182 1.49532 11.8182 2.04761V12.111C11.8182 12.6633 11.3705 13.111 10.8182 13.111H3.33984C2.78756 13.111 2.33984 12.6633 2.33984 12.111ZM3.33984 12.111V2.04761L10.8182 2.04761L10.8182 12.111L3.33984 12.111Z\",\n fill: color\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M13.66 4.97388C13.66 4.69774 13.4361 4.47388 13.16 4.47388C12.8838 4.47388 12.66 4.69774 12.66 4.97388V13.9523H5.40491C5.12876 13.9523 4.90491 14.1761 4.90491 14.4523C4.90491 14.7284 5.12876 14.9523 5.40491 14.9523H13.16C13.4361 14.9523 13.66 14.7284 13.66 14.4523V4.97388Z\",\n fill: color\n }));\n});\nexport default CopyOutline;","import _extends from \"@babel/runtime/helpers/extends\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/objectWithoutProperties\";\nvar _excluded = [\"color\", \"size\"];\nimport React from 'react';\nimport { intrinsicComponent } from './utils/functions';\nexport var EyeOpen = intrinsicComponent(function (_ref, ref) {\n var _ref$color = _ref.color,\n color = _ref$color === void 0 ? 'currentColor' : _ref$color,\n _ref$size = _ref.size,\n size = _ref$size === void 0 ? 14 : _ref$size,\n rest = _objectWithoutProperties(_ref, _excluded);\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n ref: ref,\n width: size,\n height: size,\n viewBox: \"0 0 50 32\",\n fill: \"none\",\n xmlns: \"http://www.w3.org/2000/svg\"\n }, rest), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M25 31.625C8.64336 31.625 0.533984 17.3656 0.196875 16.759C-0.065625 16.2867 -0.065625 15.7129 0.196875 15.2406C0.533984 14.6344 8.64336 0.375 25 0.375C41.3566 0.375 49.466 14.6344 49.8031 15.241C50.0656 15.7133 50.0656 16.2871 49.8031 16.7594C49.466 17.3656 41.3566 31.625 25 31.625ZM3.40117 15.9977C5.25977 18.8145 12.557 28.5 25 28.5C37.4824 28.5 44.7473 18.8223 46.5988 16.0023C44.7402 13.1855 37.443 3.5 25 3.5C12.5176 3.5 5.25273 13.1777 3.40117 15.9977ZM25 25.375C19.8305 25.375 15.625 21.1695 15.625 16C15.625 10.8305 19.8305 6.625 25 6.625C30.1695 6.625 34.375 10.8305 34.375 16C34.375 21.1695 30.1695 25.375 25 25.375ZM25 9.75C21.5539 9.75 18.75 12.5539 18.75 16C18.75 19.4461 21.5539 22.25 25 22.25C28.4461 22.25 31.25 19.4461 31.25 16C31.25 12.5539 28.4461 9.75 25 9.75Z\",\n fill: color\n }));\n});\nexport default EyeOpen;","import _extends from \"@babel/runtime/helpers/extends\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/objectWithoutProperties\";\nvar _excluded = [\"color\", \"size\"];\nimport React from 'react';\nimport { intrinsicComponent } from './utils/functions';\nexport var EyeClosed = intrinsicComponent(function (_ref, ref) {\n var _ref$color = _ref.color,\n color = _ref$color === void 0 ? 'currentColor' : _ref$color,\n _ref$size = _ref.size,\n size = _ref$size === void 0 ? 14 : _ref$size,\n rest = _objectWithoutProperties(_ref, _excluded);\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n ref: ref,\n width: size,\n height: size,\n viewBox: \"0 0 44 44\",\n fill: \"none\",\n xmlns: \"http://www.w3.org/2000/svg\"\n }, rest), /*#__PURE__*/React.createElement(\"path\", {\n fillRule: \"evenodd\",\n clipRule: \"evenodd\",\n d: \"M36.2553 6.05501C36.5966 5.71376 37.1514 5.71376 37.4926 6.05501C37.8339 6.39626 37.8339 6.95103 37.4926 7.29228L32.3765 12.4084C38.3601 15.8067 42.6046 20.7607 42.7917 20.9825C43.0682 21.3097 43.0699 21.7874 42.7936 22.113C42.3893 22.5908 32.7818 33.7978 22.0001 33.7978C18.9909 33.7978 15.9678 33.1203 13.0065 31.7785L7.74272 37.0423C7.57292 37.2121 7.34897 37.2978 7.12495 37.2978C6.90092 37.2978 6.67698 37.212 6.50545 37.0423C6.1642 36.701 6.1642 36.1462 6.50545 35.805L17.0426 25.2678C17.0453 25.265 17.0481 25.2622 17.0509 25.2595C17.0531 25.2573 17.0553 25.2551 17.0575 25.2529L25.7063 16.6041C25.7081 16.6023 25.7098 16.6005 25.7116 16.5987C25.7134 16.5969 25.7152 16.5952 25.717 16.5934L30.2895 12.0208C30.3028 12.0067 30.3164 11.9931 30.3304 11.9799L36.2553 6.05501ZM31.0895 13.6954L27.5301 17.2548C28.4835 18.476 28.9998 19.9721 28.9998 21.5478C28.9998 25.4083 25.8603 28.5478 21.9999 28.5478C20.4242 28.5478 18.9281 28.0314 17.7069 27.078L14.3353 30.4497C16.8728 31.5113 19.445 32.0478 22 32.0478C30.6537 32.0478 38.863 23.8071 40.9489 21.5478C39.6267 20.1195 35.855 16.3016 31.0895 13.6954ZM18.9574 25.8276C19.8392 26.458 20.8929 26.7977 21.9999 26.7977C24.8943 26.7977 27.2499 24.4422 27.2499 21.5477C27.2499 20.4409 26.9092 19.3873 26.2793 18.5056L18.9574 25.8276Z\",\n fill: color\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M27.7418 10.3057C25.7504 9.63545 23.8184 9.29773 22.0001 9.29773C11.2183 9.29773 1.61084 20.5047 1.20659 20.9825C0.951064 21.2835 0.930064 21.721 1.15762 22.0482C1.27837 22.2215 4.17111 26.3287 9.18485 29.659C9.33358 29.7587 9.49985 29.806 9.66785 29.806C9.94963 29.806 10.2279 29.6695 10.3959 29.4122C10.6636 29.0115 10.5534 28.4672 10.1509 28.2012C6.46889 25.753 3.94889 22.7973 3.00561 21.595C5.01989 19.4075 13.2834 11.0478 22.0001 11.0478C23.6293 11.0478 25.3741 11.3558 27.1835 11.963C27.642 12.1275 28.139 11.8738 28.2913 11.4135C28.4453 10.955 28.2003 10.4598 27.7418 10.3057Z\",\n fill: color\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M23.2197 14.6685C22.8224 14.5985 22.4164 14.5477 22 14.5477C18.1395 14.5477 15 17.6872 15 21.5477C15 21.9642 15.0508 22.3702 15.1225 22.7674C15.1977 23.1909 15.567 23.4902 15.9817 23.4902C16.0325 23.4902 16.0832 23.4867 16.1357 23.4762C16.6099 23.3922 16.9285 22.9371 16.8445 22.4629C16.7902 22.1654 16.75 21.8627 16.75 21.5477C16.75 18.6532 19.1055 16.2977 22 16.2977C22.315 16.2977 22.6177 16.338 22.9152 16.3905C23.3807 16.485 23.8444 16.1559 23.9284 15.6817C24.0124 15.2075 23.694 14.7525 23.2197 14.6685Z\",\n fill: color\n }));\n});\nexport default EyeClosed;","import { lightPalette } from '../../theme/roots/palette';\nimport { Color } from '../../utils/types/palette';\nexport var getInputBackgroundColor = function getInputBackgroundColor(readOnly, disabled) {\n if (readOnly || disabled) {\n return lightPalette[Color.BackgroundHover];\n }\n return lightPalette[Color.BackgroundStateless];\n};\nexport var getInputTextColor = function getInputTextColor(readOnly, disabled) {\n if (readOnly) {\n return lightPalette[Color.AccentPrimaryHover];\n }\n if (disabled) {\n return lightPalette[Color.TextPlaceholder];\n }\n return lightPalette[Color.TextPrimary];\n};\nexport var getInputBorderColor = function getInputBorderColor(readOnly, disabled) {\n if (readOnly) {\n return lightPalette[Color.BordersItem];\n }\n if (disabled) {\n return lightPalette[Color.BordersSecondary];\n }\n return lightPalette[Color.BorderPrimaryStateless];\n};\nexport var handleCopyIcon = function handleCopyIcon(value, setShowCopyMessage) {\n navigator.clipboard.writeText(value);\n setShowCopyMessage(true);\n};","export var Type = {\n Text: 'text',\n Password: 'password'\n};","import styled, { css } from 'styled-components';\nimport { generateClassNames, applyDisplayNames } from '../../utils/functions';\nimport { FontVariant as FV } from '../../utils/types/typography';\nimport { Color as PColor } from '../../utils/types/palette';\nimport { BorderRadiusSize as BRSize } from '../../utils/types/shape';\nimport { sizeInputMixin, fontSizeInputMixin, errorMixin } from './input.mixin';\nimport { InputSize } from '../../utils/types';\nimport { getInputBackgroundColor, getInputTextColor, getInputBorderColor } from './input.utils';\nvar baseClassName = 'Input';\nvar Icon = /*#__PURE__*/styled.span.attrs({\n className: generateClassNames(baseClassName, 'Icon')\n}).withConfig({\n componentId: \"sc-150k0cz-0\"\n})(function (_ref) {\n var iconClickStart = _ref.iconClickStart,\n iconClickEnd = _ref.iconClickEnd,\n disabled = _ref.disabled,\n readOnly = _ref.readOnly,\n iconType = _ref.iconType,\n palette = _ref.theme.palette;\n return css([\"display:flex;color:\", \";cursor:\", \";flex-shrink:0;\", \"\"], palette[PColor.IconsPrimary], (iconClickStart || iconClickEnd) && !disabled && !readOnly ? 'pointer' : 'default', iconType === 'end' && css([\"color:\", \";\"], palette[PColor.IconsSecondary]));\n});\nvar CopyIcon = /*#__PURE__*/styled.span.attrs({\n className: generateClassNames(baseClassName, 'CopyIcon')\n}).withConfig({\n componentId: \"sc-150k0cz-1\"\n})(function (_ref2) {\n var palette = _ref2.theme.palette;\n return css([\"display:flex;color:\", \";cursor:pointer;\"], palette[PColor.IconsSecondary]);\n});\nvar PasswordIcon = /*#__PURE__*/styled(CopyIcon).attrs({\n className: generateClassNames(baseClassName, 'PasswordIcon')\n}).withConfig({\n componentId: \"sc-150k0cz-2\"\n})([\"\"]);\nvar Container = /*#__PURE__*/styled.div.attrs({\n className: generateClassNames(baseClassName, 'Container')\n}).withConfig({\n componentId: \"sc-150k0cz-3\"\n})(function () {\n return css([\"display:block;color:inherit;font-size:inherit;width:100%;min-width:0;margin:0;padding:0;border:0;background-color:transparent;outline:none;\"]);\n});\nvar Base = /*#__PURE__*/styled.input.attrs({\n className: generateClassNames(baseClassName, 'Base')\n}).withConfig({\n componentId: \"sc-150k0cz-4\"\n})(function (_ref3) {\n var palette = _ref3.theme.palette,\n _ref3$isEllipsis = _ref3.isEllipsis,\n isEllipsis = _ref3$isEllipsis === void 0 ? false : _ref3$isEllipsis;\n return css([\"display:block;color:inherit;width:100%;min-width:fit-content;margin:0;padding:0;border:0;background-color:transparent;outline:none;\", \" &::placeholder{color:\", \";}\"], isEllipsis && css([\"text-overflow:ellipsis;\"]), palette[PColor.TextPlaceholder]);\n});\nvar Input = /*#__PURE__*/styled.div.attrs({\n className: generateClassNames(baseClassName, 'root')\n}).withConfig({\n componentId: \"sc-150k0cz-5\"\n})(function (_ref4) {\n var _ref4$size = _ref4.size,\n size = _ref4$size === void 0 ? InputSize.Md : _ref4$size,\n _ref4$error = _ref4.error,\n error = _ref4$error === void 0 ? false : _ref4$error,\n _ref4$fullWidth = _ref4.fullWidth,\n fullWidth = _ref4$fullWidth === void 0 ? false : _ref4$fullWidth,\n _ref4$readOnly = _ref4.readOnly,\n readOnly = _ref4$readOnly === void 0 ? false : _ref4$readOnly,\n _ref4$disabled = _ref4.disabled,\n disabled = _ref4$disabled === void 0 ? false : _ref4$disabled,\n _ref4$isHovering = _ref4.isHovering,\n isHovering = _ref4$isHovering === void 0 ? false : _ref4$isHovering,\n _ref4$isSelectedItems = _ref4.isSelectedItems,\n isSelectedItems = _ref4$isSelectedItems === void 0 ? false : _ref4$isSelectedItems,\n theme = _ref4.theme;\n return css([\"position:relative;display:inline-flex;align-items:center;box-sizing:border-box;column-gap:8px;cursor:text;transition:all 100ms ease-out;width:\", \";pointer-events:\", \";background-color:\", \";border-radius:\", \";border:1px solid \", \";color:\", \";\", \" \", \";\", \"{\", \"}\", \" \", \" &:hover{color:\", \";}\", \"\"], fullWidth ? '100%' : '300px', disabled ? 'none' : 'auto', getInputBackgroundColor(readOnly, disabled), theme.shape.borderRadius[BRSize.Md], getInputBorderColor(readOnly, disabled), disabled ? theme.palette[PColor.TextPlaceholder] : theme.palette[PColor.TextPrimary], sizeInputMixin[size], isSelectedItems && \"\\n height: fit-content;\\n\\n \".concat(Base, \" {\\n max-width: fit-content;\\n min-width: 20px;\\n flex-grow: 1;\\n width: 40px;\\n }\\n \"), Base, fontSizeInputMixin[size], !readOnly && !disabled && css([\"&:focus-within{background-color:\", \"!important;border:1px solid \", \";&:hover{border:1px solid \", \";\", \"{color:\", \";}}}\", \" &:hover{background-color:\", \";border:1px solid \", \";\", \"{color:\", \";}}\"], theme.palette[PColor.BackgroundSecondary], theme.palette[PColor.AccentStateless], theme.palette[PColor.AccentStateless], Icon, theme.palette[PColor.IconsPrimary], isHovering && css([\"\", \"{color:\", \";}\"], Icon, theme.palette[PColor.IconsPrimaryHover]), theme.palette[PColor.BackgroundStateless], theme.palette[PColor.BordersPrimaryHover], Icon, theme.palette[PColor.IconsPrimaryHover]), disabled && css([\"\", \"{color:\", \";}\"], Icon, theme.palette[PColor.IconsMuted]), getInputTextColor(readOnly, disabled), error && errorMixin);\n});\nvar ClearIcon = /*#__PURE__*/styled.span.attrs({\n className: generateClassNames(baseClassName, 'ClearIcon')\n}).withConfig({\n componentId: \"sc-150k0cz-6\"\n})(function (_ref5) {\n var palette = _ref5.theme.palette;\n return css([\"display:flex;cursor:pointer;color:\", \";\"], palette[PColor.IconsPrimary]);\n});\nvar NotificationBox = /*#__PURE__*/styled.div.attrs({\n className: generateClassNames(baseClassName, 'NotificationBox')\n}).withConfig({\n componentId: \"sc-150k0cz-7\"\n})(function (_ref6) {\n var _ref6$size = _ref6.size,\n size = _ref6$size === void 0 ? InputSize.Md : _ref6$size,\n _ref6$isTextarea = _ref6.isTextarea,\n isTextarea = _ref6$isTextarea === void 0 ? false : _ref6$isTextarea,\n palette = _ref6.theme.palette;\n return css([\"display:flex;position:absolute;align-items:center;max-height:34px;right:0px;padding:8px 12px;gap:6px;bottom:\", \";box-shadow:0px 2px 6px \", \";background-color:\", \";border-radius:4px;align-items:center;\", \"\"], size === InputSize.Md ? '45px' : '35px', palette[PColor.LargeShadow], palette[PColor.BackgroundStateless], isTextarea && \"\\n bottom: \".concat(size === InputSize.Md ? 27 : 22, \"px;\\n right: \").concat(size === InputSize.Md ? 16 : 12, \"px;\\n \"));\n});\nvar NotificationIcon = /*#__PURE__*/styled.span.attrs({\n className: generateClassNames(baseClassName, 'NotificationIcon')\n}).withConfig({\n componentId: \"sc-150k0cz-8\"\n})(function (_ref7) {\n var palette = _ref7.theme.palette;\n return css([\"display:flex;color:\", \";\"], palette[PColor.IconsPrimary]);\n});\nvar NotificationText = /*#__PURE__*/styled.span.attrs({\n className: generateClassNames(baseClassName, 'NotificationText')\n}).withConfig({\n componentId: \"sc-150k0cz-9\"\n})(function (_ref8) {\n var _ref8$theme = _ref8.theme,\n palette = _ref8$theme.palette,\n font = _ref8$theme.typography.font;\n return css([\"display:flex;white-space:nowrap;\", \";color:\", \";\"], font[FV.TextSmall], palette[PColor.TextPrimary]);\n});\nvar FieldWrapper = /*#__PURE__*/styled.div.attrs({\n className: generateClassNames(baseClassName, 'fieldWrapper')\n}).withConfig({\n componentId: \"sc-150k0cz-10\"\n})(function (_ref9) {\n var isSelectedItems = _ref9.isSelectedItems;\n return css([\"width:100%;height:100%;display:inline-flex;flex-wrap:wrap;gap:8px;max-height:120px;\", \";::-webkit-scrollbar{display:none;}\"], isSelectedItems && \"\\n overflow-y: auto;\\n \");\n});\nvar Styled = applyDisplayNames({\n Input: Input,\n Container: Container,\n Base: Base,\n Icon: Icon,\n CopyIcon: CopyIcon,\n PasswordIcon: PasswordIcon,\n ClearIcon: ClearIcon,\n NotificationBox: NotificationBox,\n NotificationIcon: NotificationIcon,\n NotificationText: NotificationText,\n FieldWrapper: FieldWrapper\n});\nexport default Styled;","import _extends from \"@babel/runtime/helpers/extends\";\nimport _slicedToArray from \"@babel/runtime/helpers/slicedToArray\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/objectWithoutProperties\";\nvar _excluded = [\"inputType\", \"children\", \"iconStart\", \"iconEnd\", \"iconChange\", \"clearIcon\", \"iconClickStart\", \"iconClickEnd\", \"clearIconClick\", \"size\", \"className\", \"style\", \"fullWidth\", \"readOnly\", \"disabled\", \"hideCopyIcon\", \"focusOnMount\", \"focusOnClick\", \"isEllipsis\", \"copyTextMessage\", \"copySuccessIcon\", \"error\", \"renderTags\", \"showPlaceholder\"];\nimport React, { useState, useRef, useEffect } from 'react';\nimport PT from 'prop-types';\nimport CopyOutline from '@scaleflex/icons/copy-outline';\nimport EyeOpen from '@scaleflex/icons/eye-open';\nimport EyeClosed from '@scaleflex/icons/eye-closed';\nimport { intrinsicComponent, objectValues } from '../../utils/functions';\nimport { InputSize } from '../../utils/types';\nimport { handleCopyIcon } from './input.utils';\nimport { Type } from './types';\nimport Styled from './input.styles';\nvar getIconSize = function getIconSize(sizeName, iconType) {\n switch (sizeName) {\n case InputSize.Md:\n return iconType === 'start' ? 15 : 14;\n case InputSize.Sm:\n default:\n return iconType === 'start' ? 13 : 10;\n }\n};\nvar getPasswordIconSize = function getPasswordIconSize(sizeName) {\n switch (sizeName) {\n case InputSize.Md:\n return 16;\n case InputSize.Sm:\n default:\n return 14;\n }\n};\nvar Input = intrinsicComponent(function (_ref, ref) {\n var _rest$selectedItems;\n var inputType = _ref.inputType,\n children = _ref.children,\n iconStart = _ref.iconStart,\n iconEnd = _ref.iconEnd,\n iconChange = _ref.iconChange,\n clearIcon = _ref.clearIcon,\n iconClickStart = _ref.iconClickStart,\n iconClickEnd = _ref.iconClickEnd,\n clearIconClick = _ref.clearIconClick,\n _ref$size = _ref.size,\n size = _ref$size === void 0 ? InputSize.Md : _ref$size,\n className = _ref.className,\n style = _ref.style,\n fullWidth = _ref.fullWidth,\n readOnly = _ref.readOnly,\n disabled = _ref.disabled,\n _ref$hideCopyIcon = _ref.hideCopyIcon,\n hideCopyIcon = _ref$hideCopyIcon === void 0 ? false : _ref$hideCopyIcon,\n _ref$focusOnMount = _ref.focusOnMount,\n focusOnMount = _ref$focusOnMount === void 0 ? false : _ref$focusOnMount,\n _ref$focusOnClick = _ref.focusOnClick,\n focusOnClick = _ref$focusOnClick === void 0 ? true : _ref$focusOnClick,\n _ref$isEllipsis = _ref.isEllipsis,\n isEllipsis = _ref$isEllipsis === void 0 ? false : _ref$isEllipsis,\n copyTextMessage = _ref.copyTextMessage,\n copySuccessIcon = _ref.copySuccessIcon,\n error = _ref.error,\n renderTags = _ref.renderTags,\n showPlaceholder = _ref.showPlaceholder,\n rest = _objectWithoutProperties(_ref, _excluded);\n var _useState = useState(false),\n _useState2 = _slicedToArray(_useState, 2),\n isHovering = _useState2[0],\n setIsHovering = _useState2[1];\n var _useState3 = useState(false),\n _useState4 = _slicedToArray(_useState3, 2),\n showCopyMessage = _useState4[0],\n setShowCopyMessage = _useState4[1];\n var _useState5 = useState(false),\n _useState6 = _slicedToArray(_useState5, 2),\n isVisible = _useState6[0],\n setIsVisible = _useState6[1];\n var inputRef = useRef(null);\n var isSelectedItems = (_rest$selectedItems = rest.selectedItems) === null || _rest$selectedItems === void 0 ? void 0 : _rest$selectedItems.length;\n var placeholder = rest.value || isSelectedItems ? '' : rest.placeholder;\n var showCopyIcon = isHovering && readOnly && rest.value.length > 0 && !hideCopyIcon;\n var handleFocus = function handleFocus() {\n var _inputRef$current;\n if (disabled || readOnly) return;\n showPlaceholder === null || showPlaceholder === void 0 || showPlaceholder(false);\n (_inputRef$current = inputRef.current) === null || _inputRef$current === void 0 || _inputRef$current.focus();\n };\n useEffect(function () {\n if (focusOnMount) {\n handleFocus();\n }\n }, []);\n useEffect(function () {\n setTimeout(function () {\n return setShowCopyMessage(false);\n }, 2000);\n }, [showCopyMessage]);\n var handleEntering = function handleEntering() {\n setTimeout(function () {\n setIsHovering(true);\n }, 150);\n };\n var handleLeaving = function handleLeaving() {\n setTimeout(function () {\n setIsHovering(false);\n }, 200);\n };\n var handleIconClick = function handleIconClick(event, type) {\n if (disabled || readOnly) return;\n if (focusOnClick) {\n handleFocus();\n }\n if (type === 'start') {\n if (iconClickStart) {\n iconClickStart(event);\n }\n } else if (type === 'end') {\n if (iconClickEnd) {\n iconClickEnd(event);\n }\n } else if (clearIconClick) {\n clearIconClick(event);\n }\n };\n var renderIcon = function renderIcon(_icon, type) {\n return _icon ? /*#__PURE__*/React.createElement(Styled.Icon, {\n onClick: function onClick(event) {\n return handleIconClick(event, type);\n },\n iconClickStart: iconClickStart,\n iconClickEnd: iconClickEnd,\n iconType: type,\n disabled: disabled,\n readOnly: readOnly\n }, typeof _icon === 'function' ? _icon({\n size: getIconSize(size, type)\n }) : _icon) : undefined;\n };\n var renderClearIcon = function renderClearIcon() {\n return disabled || readOnly || !clearIcon ? undefined : /*#__PURE__*/React.createElement(Styled.ClearIcon, {\n onClick: function onClick(event) {\n return handleIconClick(event, 'clear');\n }\n }, typeof clearIcon === 'function' ? clearIcon({\n size: getIconSize(size, 'clear')\n }) : clearIcon);\n };\n var renderCopyIcon = function renderCopyIcon(icon) {\n return showCopyIcon ? /*#__PURE__*/React.createElement(Styled.CopyIcon, {\n onClick: function onClick() {\n return handleCopyIcon(rest.value, setShowCopyMessage);\n }\n }, typeof icon === 'function' ? icon() : icon) : undefined;\n };\n var toggleVisibility = function toggleVisibility(event) {\n event.stopPropagation();\n setIsVisible(!isVisible);\n };\n var renderPasswordIcon = function renderPasswordIcon() {\n return /*#__PURE__*/React.createElement(Styled.PasswordIcon, {\n onClick: function onClick(event) {\n return toggleVisibility(event);\n }\n }, isVisible ? /*#__PURE__*/React.createElement(EyeClosed, {\n size: getPasswordIconSize(size)\n }) : /*#__PURE__*/React.createElement(EyeOpen, {\n size: getPasswordIconSize(size)\n }));\n };\n var getInputType = function getInputType() {\n if (!inputType && rest !== null && rest !== void 0 && rest.type) {\n return rest === null || rest === void 0 ? void 0 : rest.type;\n }\n if (inputType === Type.Password && !isVisible) {\n return Type.Password;\n }\n return Type.Text;\n };\n var renderField = function renderField() {\n return /*#__PURE__*/React.createElement(Styled.FieldWrapper, {\n isSelectedItems: Boolean(isSelectedItems)\n }, renderTags && renderTags(), /*#__PURE__*/React.createElement(Styled.Base, _extends({}, rest, {\n placeholder: placeholder,\n ref: inputRef,\n readOnly: Boolean(readOnly),\n type: getInputType(),\n isEllipsis: isEllipsis\n })));\n };\n var renderCopyText = function renderCopyText() {\n return /*#__PURE__*/React.createElement(Styled.NotificationBox, {\n size: size\n }, /*#__PURE__*/React.createElement(Styled.NotificationIcon, null, copySuccessIcon), /*#__PURE__*/React.createElement(Styled.NotificationText, null, copyTextMessage));\n };\n return /*#__PURE__*/React.createElement(Styled.Input, {\n onClick: focusOnClick ? handleFocus : undefined,\n ref: ref,\n size: size,\n onMouseEnter: handleEntering,\n onMouseLeave: handleLeaving,\n className: className,\n style: style,\n readOnly: readOnly,\n disabled: disabled,\n fullWidth: Boolean(fullWidth),\n error: error,\n clearIcon: clearIcon,\n isHovering: rest.isHovering,\n isSelectedItems: Boolean(isSelectedItems)\n }, renderIcon(iconStart, 'start'), renderField(), renderCopyIcon( /*#__PURE__*/React.createElement(CopyOutline, {\n size: getIconSize(size, 'copy')\n })), showCopyMessage && renderCopyText(), renderClearIcon(), inputType === Type.Password && renderPasswordIcon(), renderIcon(iconEnd, 'end'), renderIcon(iconChange, ''), children && /*#__PURE__*/React.createElement(React.Fragment, null, children));\n});\nexport var defaultProps = {\n size: InputSize.Md,\n error: false,\n fullWidth: false,\n readOnly: false,\n disabled: false,\n copyTextMessage: 'Copied!'\n};\nInput.defaultProps = defaultProps;\nexport var propTypes = {\n size: PT.oneOf(objectValues(InputSize)),\n iconStart: PT.oneOfType([PT.node, PT.func]),\n iconEnd: PT.oneOfType([PT.node, PT.func]),\n iconChange: PT.oneOfType([PT.node, PT.func]),\n copySuccessIcon: PT.oneOfType([PT.node, PT.func]),\n clearIcon: PT.oneOfType([PT.node, PT.func]),\n error: PT.bool,\n fullWidth: PT.bool,\n value: PT.any,\n readOnly: PT.bool,\n disabled: PT.bool,\n iconClickStart: PT.func,\n showPlaceholder: PT.func,\n iconClickEnd: PT.func,\n clearIconClick: PT.func,\n focusOnMount: PT.bool,\n focusOnClick: PT.bool,\n copyTextMessage: PT.string,\n inputType: PT.string,\n renderTags: PT.func\n};\nInput.propTypes = propTypes;\nexport default Input;","export var top = 'top';\nexport var bottom = 'bottom';\nexport var right = 'right';\nexport var left = 'left';\nexport var auto = 'auto';\nexport var basePlacements = [top, bottom, right, left];\nexport var start = 'start';\nexport var end = 'end';\nexport var clippingParents = 'clippingParents';\nexport var viewport = 'viewport';\nexport var popper = 'popper';\nexport var reference = 'reference';\nexport var variationPlacements = /*#__PURE__*/basePlacements.reduce(function (acc, placement) {\n return acc.concat([placement + \"-\" + start, placement + \"-\" + end]);\n}, []);\nexport var placements = /*#__PURE__*/[].concat(basePlacements, [auto]).reduce(function (acc, placement) {\n return acc.concat([placement, placement + \"-\" + start, placement + \"-\" + end]);\n}, []); // modifiers that need to read the DOM\n\nexport var beforeRead = 'beforeRead';\nexport var read = 'read';\nexport var afterRead = 'afterRead'; // pure-logic modifiers\n\nexport var beforeMain = 'beforeMain';\nexport var main = 'main';\nexport var afterMain = 'afterMain'; // modifier with the purpose to write to the DOM (or write into a framework state)\n\nexport var beforeWrite = 'beforeWrite';\nexport var write = 'write';\nexport var afterWrite = 'afterWrite';\nexport var modifierPhases = [beforeRead, read, afterRead, beforeMain, main, afterMain, beforeWrite, write, afterWrite];","export default function getNodeName(element) {\n return element ? (element.nodeName || '').toLowerCase() : null;\n}","export default function getWindow(node) {\n if (node == null) {\n return window;\n }\n\n if (node.toString() !== '[object Window]') {\n var ownerDocument = node.ownerDocument;\n return ownerDocument ? ownerDocument.defaultView || window : window;\n }\n\n return node;\n}","import getWindow from \"./getWindow.js\";\n\nfunction isElement(node) {\n var OwnElement = getWindow(node).Element;\n return node instanceof OwnElement || node instanceof Element;\n}\n\nfunction isHTMLElement(node) {\n var OwnElement = getWindow(node).HTMLElement;\n return node instanceof OwnElement || node instanceof HTMLElement;\n}\n\nfunction isShadowRoot(node) {\n // IE 11 has no ShadowRoot\n if (typeof ShadowRoot === 'undefined') {\n return false;\n }\n\n var OwnElement = getWindow(node).ShadowRoot;\n return node instanceof OwnElement || node instanceof ShadowRoot;\n}\n\nexport { isElement, isHTMLElement, isShadowRoot };","import getNodeName from \"../dom-utils/getNodeName.js\";\nimport { isHTMLElement } from \"../dom-utils/instanceOf.js\"; // This modifier takes the styles prepared by the `computeStyles` modifier\n// and applies them to the HTMLElements such as popper and arrow\n\nfunction applyStyles(_ref) {\n var state = _ref.state;\n Object.keys(state.elements).forEach(function (name) {\n var style = state.styles[name] || {};\n var attributes = state.attributes[name] || {};\n var element = state.elements[name]; // arrow is optional + virtual elements\n\n if (!isHTMLElement(element) || !getNodeName(element)) {\n return;\n } // Flow doesn't support to extend this property, but it's the most\n // effective way to apply styles to an HTMLElement\n // $FlowFixMe[cannot-write]\n\n\n Object.assign(element.style, style);\n Object.keys(attributes).forEach(function (name) {\n var value = attributes[name];\n\n if (value === false) {\n element.removeAttribute(name);\n } else {\n element.setAttribute(name, value === true ? '' : value);\n }\n });\n });\n}\n\nfunction effect(_ref2) {\n var state = _ref2.state;\n var initialStyles = {\n popper: {\n position: state.options.strategy,\n left: '0',\n top: '0',\n margin: '0'\n },\n arrow: {\n position: 'absolute'\n },\n reference: {}\n };\n Object.assign(state.elements.popper.style, initialStyles.popper);\n state.styles = initialStyles;\n\n if (state.elements.arrow) {\n Object.assign(state.elements.arrow.style, initialStyles.arrow);\n }\n\n return function () {\n Object.keys(state.elements).forEach(function (name) {\n var element = state.elements[name];\n var attributes = state.attributes[name] || {};\n var styleProperties = Object.keys(state.styles.hasOwnProperty(name) ? state.styles[name] : initialStyles[name]); // Set all values to an empty string to unset them\n\n var style = styleProperties.reduce(function (style, property) {\n style[property] = '';\n return style;\n }, {}); // arrow is optional + virtual elements\n\n if (!isHTMLElement(element) || !getNodeName(element)) {\n return;\n }\n\n Object.assign(element.style, style);\n Object.keys(attributes).forEach(function (attribute) {\n element.removeAttribute(attribute);\n });\n });\n };\n} // eslint-disable-next-line import/no-unused-modules\n\n\nexport default {\n name: 'applyStyles',\n enabled: true,\n phase: 'write',\n fn: applyStyles,\n effect: effect,\n requires: ['computeStyles']\n};","import { auto } from \"../enums.js\";\nexport default function getBasePlacement(placement) {\n return placement.split('-')[0];\n}","export var max = Math.max;\nexport var min = Math.min;\nexport var round = Math.round;","export default function getUAString() {\n var uaData = navigator.userAgentData;\n\n if (uaData != null && uaData.brands && Array.isArray(uaData.brands)) {\n return uaData.brands.map(function (item) {\n return item.brand + \"/\" + item.version;\n }).join(' ');\n }\n\n return navigator.userAgent;\n}","import getUAString from \"../utils/userAgent.js\";\nexport default function isLayoutViewport() {\n return !/^((?!chrome|android).)*safari/i.test(getUAString());\n}","import { isElement, isHTMLElement } from \"./instanceOf.js\";\nimport { round } from \"../utils/math.js\";\nimport getWindow from \"./getWindow.js\";\nimport isLayoutViewport from \"./isLayoutViewport.js\";\nexport default function getBoundingClientRect(element, includeScale, isFixedStrategy) {\n if (includeScale === void 0) {\n includeScale = false;\n }\n\n if (isFixedStrategy === void 0) {\n isFixedStrategy = false;\n }\n\n var clientRect = element.getBoundingClientRect();\n var scaleX = 1;\n var scaleY = 1;\n\n if (includeScale && isHTMLElement(element)) {\n scaleX = element.offsetWidth > 0 ? round(clientRect.width) / element.offsetWidth || 1 : 1;\n scaleY = element.offsetHeight > 0 ? round(clientRect.height) / element.offsetHeight || 1 : 1;\n }\n\n var _ref = isElement(element) ? getWindow(element) : window,\n visualViewport = _ref.visualViewport;\n\n var addVisualOffsets = !isLayoutViewport() && isFixedStrategy;\n var x = (clientRect.left + (addVisualOffsets && visualViewport ? visualViewport.offsetLeft : 0)) / scaleX;\n var y = (clientRect.top + (addVisualOffsets && visualViewport ? visualViewport.offsetTop : 0)) / scaleY;\n var width = clientRect.width / scaleX;\n var height = clientRect.height / scaleY;\n return {\n width: width,\n height: height,\n top: y,\n right: x + width,\n bottom: y + height,\n left: x,\n x: x,\n y: y\n };\n}","import getBoundingClientRect from \"./getBoundingClientRect.js\"; // Returns the layout rect of an element relative to its offsetParent. Layout\n// means it doesn't take into account transforms.\n\nexport default function getLayoutRect(element) {\n var clientRect = getBoundingClientRect(element); // Use the clientRect sizes if it's not been transformed.\n // Fixes https://github.com/popperjs/popper-core/issues/1223\n\n var width = element.offsetWidth;\n var height = element.offsetHeight;\n\n if (Math.abs(clientRect.width - width) <= 1) {\n width = clientRect.width;\n }\n\n if (Math.abs(clientRect.height - height) <= 1) {\n height = clientRect.height;\n }\n\n return {\n x: element.offsetLeft,\n y: element.offsetTop,\n width: width,\n height: height\n };\n}","import { isShadowRoot } from \"./instanceOf.js\";\nexport default function contains(parent, child) {\n var rootNode = child.getRootNode && child.getRootNode(); // First, attempt with faster native method\n\n if (parent.contains(child)) {\n return true;\n } // then fallback to custom implementation with Shadow DOM support\n else if (rootNode && isShadowRoot(rootNode)) {\n var next = child;\n\n do {\n if (next && parent.isSameNode(next)) {\n return true;\n } // $FlowFixMe[prop-missing]: need a better way to handle this...\n\n\n next = next.parentNode || next.host;\n } while (next);\n } // Give up, the result is false\n\n\n return false;\n}","import getWindow from \"./getWindow.js\";\nexport default function getComputedStyle(element) {\n return getWindow(element).getComputedStyle(element);\n}","import getNodeName from \"./getNodeName.js\";\nexport default function isTableElement(element) {\n return ['table', 'td', 'th'].indexOf(getNodeName(element)) >= 0;\n}","import { isElement } from \"./instanceOf.js\";\nexport default function getDocumentElement(element) {\n // $FlowFixMe[incompatible-return]: assume body is always available\n return ((isElement(element) ? element.ownerDocument : // $FlowFixMe[prop-missing]\n element.document) || window.document).documentElement;\n}","import getNodeName from \"./getNodeName.js\";\nimport getDocumentElement from \"./getDocumentElement.js\";\nimport { isShadowRoot } from \"./instanceOf.js\";\nexport default function getParentNode(element) {\n if (getNodeName(element) === 'html') {\n return element;\n }\n\n return (// this is a quicker (but less type safe) way to save quite some bytes from the bundle\n // $FlowFixMe[incompatible-return]\n // $FlowFixMe[prop-missing]\n element.assignedSlot || // step into the shadow DOM of the parent of a slotted node\n element.parentNode || ( // DOM Element detected\n isShadowRoot(element) ? element.host : null) || // ShadowRoot detected\n // $FlowFixMe[incompatible-call]: HTMLElement is a Node\n getDocumentElement(element) // fallback\n\n );\n}","import getWindow from \"./getWindow.js\";\nimport getNodeName from \"./getNodeName.js\";\nimport getComputedStyle from \"./getComputedStyle.js\";\nimport { isHTMLElement, isShadowRoot } from \"./instanceOf.js\";\nimport isTableElement from \"./isTableElement.js\";\nimport getParentNode from \"./getParentNode.js\";\nimport getUAString from \"../utils/userAgent.js\";\n\nfunction getTrueOffsetParent(element) {\n if (!isHTMLElement(element) || // https://github.com/popperjs/popper-core/issues/837\n getComputedStyle(element).position === 'fixed') {\n return null;\n }\n\n return element.offsetParent;\n} // `.offsetParent` reports `null` for fixed elements, while absolute elements\n// return the containing block\n\n\nfunction getContainingBlock(element) {\n var isFirefox = /firefox/i.test(getUAString());\n var isIE = /Trident/i.test(getUAString());\n\n if (isIE && isHTMLElement(element)) {\n // In IE 9, 10 and 11 fixed elements containing block is always established by the viewport\n var elementCss = getComputedStyle(element);\n\n if (elementCss.position === 'fixed') {\n return null;\n }\n }\n\n var currentNode = getParentNode(element);\n\n if (isShadowRoot(currentNode)) {\n currentNode = currentNode.host;\n }\n\n while (isHTMLElement(currentNode) && ['html', 'body'].indexOf(getNodeName(currentNode)) < 0) {\n var css = getComputedStyle(currentNode); // This is non-exhaustive but covers the most common CSS properties that\n // create a containing block.\n // https://developer.mozilla.org/en-US/docs/Web/CSS/Containing_block#identifying_the_containing_block\n\n if (css.transform !== 'none' || css.perspective !== 'none' || css.contain === 'paint' || ['transform', 'perspective'].indexOf(css.willChange) !== -1 || isFirefox && css.willChange === 'filter' || isFirefox && css.filter && css.filter !== 'none') {\n return currentNode;\n } else {\n currentNode = currentNode.parentNode;\n }\n }\n\n return null;\n} // Gets the closest ancestor positioned element. Handles some edge cases,\n// such as table ancestors and cross browser bugs.\n\n\nexport default function getOffsetParent(element) {\n var window = getWindow(element);\n var offsetParent = getTrueOffsetParent(element);\n\n while (offsetParent && isTableElement(offsetParent) && getComputedStyle(offsetParent).position === 'static') {\n offsetParent = getTrueOffsetParent(offsetParent);\n }\n\n if (offsetParent && (getNodeName(offsetParent) === 'html' || getNodeName(offsetParent) === 'body' && getComputedStyle(offsetParent).position === 'static')) {\n return window;\n }\n\n return offsetParent || getContainingBlock(element) || window;\n}","export default function getMainAxisFromPlacement(placement) {\n return ['top', 'bottom'].indexOf(placement) >= 0 ? 'x' : 'y';\n}","import { max as mathMax, min as mathMin } from \"./math.js\";\nexport function within(min, value, max) {\n return mathMax(min, mathMin(value, max));\n}\nexport function withinMaxClamp(min, value, max) {\n var v = within(min, value, max);\n return v > max ? max : v;\n}","export default function getFreshSideObject() {\n return {\n top: 0,\n right: 0,\n bottom: 0,\n left: 0\n };\n}","import getFreshSideObject from \"./getFreshSideObject.js\";\nexport default function mergePaddingObject(paddingObject) {\n return Object.assign({}, getFreshSideObject(), paddingObject);\n}","export default function expandToHashMap(value, keys) {\n return keys.reduce(function (hashMap, key) {\n hashMap[key] = value;\n return hashMap;\n }, {});\n}","import getBasePlacement from \"../utils/getBasePlacement.js\";\nimport getLayoutRect from \"../dom-utils/getLayoutRect.js\";\nimport contains from \"../dom-utils/contains.js\";\nimport getOffsetParent from \"../dom-utils/getOffsetParent.js\";\nimport getMainAxisFromPlacement from \"../utils/getMainAxisFromPlacement.js\";\nimport { within } from \"../utils/within.js\";\nimport mergePaddingObject from \"../utils/mergePaddingObject.js\";\nimport expandToHashMap from \"../utils/expandToHashMap.js\";\nimport { left, right, basePlacements, top, bottom } from \"../enums.js\"; // eslint-disable-next-line import/no-unused-modules\n\nvar toPaddingObject = function toPaddingObject(padding, state) {\n padding = typeof padding === 'function' ? padding(Object.assign({}, state.rects, {\n placement: state.placement\n })) : padding;\n return mergePaddingObject(typeof padding !== 'number' ? padding : expandToHashMap(padding, basePlacements));\n};\n\nfunction arrow(_ref) {\n var _state$modifiersData$;\n\n var state = _ref.state,\n name = _ref.name,\n options = _ref.options;\n var arrowElement = state.elements.arrow;\n var popperOffsets = state.modifiersData.popperOffsets;\n var basePlacement = getBasePlacement(state.placement);\n var axis = getMainAxisFromPlacement(basePlacement);\n var isVertical = [left, right].indexOf(basePlacement) >= 0;\n var len = isVertical ? 'height' : 'width';\n\n if (!arrowElement || !popperOffsets) {\n return;\n }\n\n var paddingObject = toPaddingObject(options.padding, state);\n var arrowRect = getLayoutRect(arrowElement);\n var minProp = axis === 'y' ? top : left;\n var maxProp = axis === 'y' ? bottom : right;\n var endDiff = state.rects.reference[len] + state.rects.reference[axis] - popperOffsets[axis] - state.rects.popper[len];\n var startDiff = popperOffsets[axis] - state.rects.reference[axis];\n var arrowOffsetParent = getOffsetParent(arrowElement);\n var clientSize = arrowOffsetParent ? axis === 'y' ? arrowOffsetParent.clientHeight || 0 : arrowOffsetParent.clientWidth || 0 : 0;\n var centerToReference = endDiff / 2 - startDiff / 2; // Make sure the arrow doesn't overflow the popper if the center point is\n // outside of the popper bounds\n\n var min = paddingObject[minProp];\n var max = clientSize - arrowRect[len] - paddingObject[maxProp];\n var center = clientSize / 2 - arrowRect[len] / 2 + centerToReference;\n var offset = within(min, center, max); // Prevents breaking syntax highlighting...\n\n var axisProp = axis;\n state.modifiersData[name] = (_state$modifiersData$ = {}, _state$modifiersData$[axisProp] = offset, _state$modifiersData$.centerOffset = offset - center, _state$modifiersData$);\n}\n\nfunction effect(_ref2) {\n var state = _ref2.state,\n options = _ref2.options;\n var _options$element = options.element,\n arrowElement = _options$element === void 0 ? '[data-popper-arrow]' : _options$element;\n\n if (arrowElement == null) {\n return;\n } // CSS selector\n\n\n if (typeof arrowElement === 'string') {\n arrowElement = state.elements.popper.querySelector(arrowElement);\n\n if (!arrowElement) {\n return;\n }\n }\n\n if (!contains(state.elements.popper, arrowElement)) {\n return;\n }\n\n state.elements.arrow = arrowElement;\n} // eslint-disable-next-line import/no-unused-modules\n\n\nexport default {\n name: 'arrow',\n enabled: true,\n phase: 'main',\n fn: arrow,\n effect: effect,\n requires: ['popperOffsets'],\n requiresIfExists: ['preventOverflow']\n};","export default function getVariation(placement) {\n return placement.split('-')[1];\n}","import { top, left, right, bottom, end } from \"../enums.js\";\nimport getOffsetParent from \"../dom-utils/getOffsetParent.js\";\nimport getWindow from \"../dom-utils/getWindow.js\";\nimport getDocumentElement from \"../dom-utils/getDocumentElement.js\";\nimport getComputedStyle from \"../dom-utils/getComputedStyle.js\";\nimport getBasePlacement from \"../utils/getBasePlacement.js\";\nimport getVariation from \"../utils/getVariation.js\";\nimport { round } from \"../utils/math.js\"; // eslint-disable-next-line import/no-unused-modules\n\nvar unsetSides = {\n top: 'auto',\n right: 'auto',\n bottom: 'auto',\n left: 'auto'\n}; // Round the offsets to the nearest suitable subpixel based on the DPR.\n// Zooming can change the DPR, but it seems to report a value that will\n// cleanly divide the values into the appropriate subpixels.\n\nfunction roundOffsetsByDPR(_ref, win) {\n var x = _ref.x,\n y = _ref.y;\n var dpr = win.devicePixelRatio || 1;\n return {\n x: round(x * dpr) / dpr || 0,\n y: round(y * dpr) / dpr || 0\n };\n}\n\nexport function mapToStyles(_ref2) {\n var _Object$assign2;\n\n var popper = _ref2.popper,\n popperRect = _ref2.popperRect,\n placement = _ref2.placement,\n variation = _ref2.variation,\n offsets = _ref2.offsets,\n position = _ref2.position,\n gpuAcceleration = _ref2.gpuAcceleration,\n adaptive = _ref2.adaptive,\n roundOffsets = _ref2.roundOffsets,\n isFixed = _ref2.isFixed;\n var _offsets$x = offsets.x,\n x = _offsets$x === void 0 ? 0 : _offsets$x,\n _offsets$y = offsets.y,\n y = _offsets$y === void 0 ? 0 : _offsets$y;\n\n var _ref3 = typeof roundOffsets === 'function' ? roundOffsets({\n x: x,\n y: y\n }) : {\n x: x,\n y: y\n };\n\n x = _ref3.x;\n y = _ref3.y;\n var hasX = offsets.hasOwnProperty('x');\n var hasY = offsets.hasOwnProperty('y');\n var sideX = left;\n var sideY = top;\n var win = window;\n\n if (adaptive) {\n var offsetParent = getOffsetParent(popper);\n var heightProp = 'clientHeight';\n var widthProp = 'clientWidth';\n\n if (offsetParent === getWindow(popper)) {\n offsetParent = getDocumentElement(popper);\n\n if (getComputedStyle(offsetParent).position !== 'static' && position === 'absolute') {\n heightProp = 'scrollHeight';\n widthProp = 'scrollWidth';\n }\n } // $FlowFixMe[incompatible-cast]: force type refinement, we compare offsetParent with window above, but Flow doesn't detect it\n\n\n offsetParent = offsetParent;\n\n if (placement === top || (placement === left || placement === right) && variation === end) {\n sideY = bottom;\n var offsetY = isFixed && offsetParent === win && win.visualViewport ? win.visualViewport.height : // $FlowFixMe[prop-missing]\n offsetParent[heightProp];\n y -= offsetY - popperRect.height;\n y *= gpuAcceleration ? 1 : -1;\n }\n\n if (placement === left || (placement === top || placement === bottom) && variation === end) {\n sideX = right;\n var offsetX = isFixed && offsetParent === win && win.visualViewport ? win.visualViewport.width : // $FlowFixMe[prop-missing]\n offsetParent[widthProp];\n x -= offsetX - popperRect.width;\n x *= gpuAcceleration ? 1 : -1;\n }\n }\n\n var commonStyles = Object.assign({\n position: position\n }, adaptive && unsetSides);\n\n var _ref4 = roundOffsets === true ? roundOffsetsByDPR({\n x: x,\n y: y\n }, getWindow(popper)) : {\n x: x,\n y: y\n };\n\n x = _ref4.x;\n y = _ref4.y;\n\n if (gpuAcceleration) {\n var _Object$assign;\n\n return Object.assign({}, commonStyles, (_Object$assign = {}, _Object$assign[sideY] = hasY ? '0' : '', _Object$assign[sideX] = hasX ? '0' : '', _Object$assign.transform = (win.devicePixelRatio || 1) <= 1 ? \"translate(\" + x + \"px, \" + y + \"px)\" : \"translate3d(\" + x + \"px, \" + y + \"px, 0)\", _Object$assign));\n }\n\n return Object.assign({}, commonStyles, (_Object$assign2 = {}, _Object$assign2[sideY] = hasY ? y + \"px\" : '', _Object$assign2[sideX] = hasX ? x + \"px\" : '', _Object$assign2.transform = '', _Object$assign2));\n}\n\nfunction computeStyles(_ref5) {\n var state = _ref5.state,\n options = _ref5.options;\n var _options$gpuAccelerat = options.gpuAcceleration,\n gpuAcceleration = _options$gpuAccelerat === void 0 ? true : _options$gpuAccelerat,\n _options$adaptive = options.adaptive,\n adaptive = _options$adaptive === void 0 ? true : _options$adaptive,\n _options$roundOffsets = options.roundOffsets,\n roundOffsets = _options$roundOffsets === void 0 ? true : _options$roundOffsets;\n var commonStyles = {\n placement: getBasePlacement(state.placement),\n variation: getVariation(state.placement),\n popper: state.elements.popper,\n popperRect: state.rects.popper,\n gpuAcceleration: gpuAcceleration,\n isFixed: state.options.strategy === 'fixed'\n };\n\n if (state.modifiersData.popperOffsets != null) {\n state.styles.popper = Object.assign({}, state.styles.popper, mapToStyles(Object.assign({}, commonStyles, {\n offsets: state.modifiersData.popperOffsets,\n position: state.options.strategy,\n adaptive: adaptive,\n roundOffsets: roundOffsets\n })));\n }\n\n if (state.modifiersData.arrow != null) {\n state.styles.arrow = Object.assign({}, state.styles.arrow, mapToStyles(Object.assign({}, commonStyles, {\n offsets: state.modifiersData.arrow,\n position: 'absolute',\n adaptive: false,\n roundOffsets: roundOffsets\n })));\n }\n\n state.attributes.popper = Object.assign({}, state.attributes.popper, {\n 'data-popper-placement': state.placement\n });\n} // eslint-disable-next-line import/no-unused-modules\n\n\nexport default {\n name: 'computeStyles',\n enabled: true,\n phase: 'beforeWrite',\n fn: computeStyles,\n data: {}\n};","import getWindow from \"../dom-utils/getWindow.js\"; // eslint-disable-next-line import/no-unused-modules\n\nvar passive = {\n passive: true\n};\n\nfunction effect(_ref) {\n var state = _ref.state,\n instance = _ref.instance,\n options = _ref.options;\n var _options$scroll = options.scroll,\n scroll = _options$scroll === void 0 ? true : _options$scroll,\n _options$resize = options.resize,\n resize = _options$resize === void 0 ? true : _options$resize;\n var window = getWindow(state.elements.popper);\n var scrollParents = [].concat(state.scrollParents.reference, state.scrollParents.popper);\n\n if (scroll) {\n scrollParents.forEach(function (scrollParent) {\n scrollParent.addEventListener('scroll', instance.update, passive);\n });\n }\n\n if (resize) {\n window.addEventListener('resize', instance.update, passive);\n }\n\n return function () {\n if (scroll) {\n scrollParents.forEach(function (scrollParent) {\n scrollParent.removeEventListener('scroll', instance.update, passive);\n });\n }\n\n if (resize) {\n window.removeEventListener('resize', instance.update, passive);\n }\n };\n} // eslint-disable-next-line import/no-unused-modules\n\n\nexport default {\n name: 'eventListeners',\n enabled: true,\n phase: 'write',\n fn: function fn() {},\n effect: effect,\n data: {}\n};","var hash = {\n left: 'right',\n right: 'left',\n bottom: 'top',\n top: 'bottom'\n};\nexport default function getOppositePlacement(placement) {\n return placement.replace(/left|right|bottom|top/g, function (matched) {\n return hash[matched];\n });\n}","var hash = {\n start: 'end',\n end: 'start'\n};\nexport default function getOppositeVariationPlacement(placement) {\n return placement.replace(/start|end/g, function (matched) {\n return hash[matched];\n });\n}","import getWindow from \"./getWindow.js\";\nexport default function getWindowScroll(node) {\n var win = getWindow(node);\n var scrollLeft = win.pageXOffset;\n var scrollTop = win.pageYOffset;\n return {\n scrollLeft: scrollLeft,\n scrollTop: scrollTop\n };\n}","import getBoundingClientRect from \"./getBoundingClientRect.js\";\nimport getDocumentElement from \"./getDocumentElement.js\";\nimport getWindowScroll from \"./getWindowScroll.js\";\nexport default function getWindowScrollBarX(element) {\n // If has a CSS width greater than the viewport, then this will be\n // incorrect for RTL.\n // Popper 1 is broken in this case and never had a bug report so let's assume\n // it's not an issue. I don't think anyone ever specifies width on \n // anyway.\n // Browsers where the left scrollbar doesn't cause an issue report `0` for\n // this (e.g. Edge 2019, IE11, Safari)\n return getBoundingClientRect(getDocumentElement(element)).left + getWindowScroll(element).scrollLeft;\n}","import getWindow from \"./getWindow.js\";\nimport getDocumentElement from \"./getDocumentElement.js\";\nimport getWindowScrollBarX from \"./getWindowScrollBarX.js\";\nimport isLayoutViewport from \"./isLayoutViewport.js\";\nexport default function getViewportRect(element, strategy) {\n var win = getWindow(element);\n var html = getDocumentElement(element);\n var visualViewport = win.visualViewport;\n var width = html.clientWidth;\n var height = html.clientHeight;\n var x = 0;\n var y = 0;\n\n if (visualViewport) {\n width = visualViewport.width;\n height = visualViewport.height;\n var layoutViewport = isLayoutViewport();\n\n if (layoutViewport || !layoutViewport && strategy === 'fixed') {\n x = visualViewport.offsetLeft;\n y = visualViewport.offsetTop;\n }\n }\n\n return {\n width: width,\n height: height,\n x: x + getWindowScrollBarX(element),\n y: y\n };\n}","import getDocumentElement from \"./getDocumentElement.js\";\nimport getComputedStyle from \"./getComputedStyle.js\";\nimport getWindowScrollBarX from \"./getWindowScrollBarX.js\";\nimport getWindowScroll from \"./getWindowScroll.js\";\nimport { max } from \"../utils/math.js\"; // Gets the entire size of the scrollable document area, even extending outside\n// of the `` and `` rect bounds if horizontally scrollable\n\nexport default function getDocumentRect(element) {\n var _element$ownerDocumen;\n\n var html = getDocumentElement(element);\n var winScroll = getWindowScroll(element);\n var body = (_element$ownerDocumen = element.ownerDocument) == null ? void 0 : _element$ownerDocumen.body;\n var width = max(html.scrollWidth, html.clientWidth, body ? body.scrollWidth : 0, body ? body.clientWidth : 0);\n var height = max(html.scrollHeight, html.clientHeight, body ? body.scrollHeight : 0, body ? body.clientHeight : 0);\n var x = -winScroll.scrollLeft + getWindowScrollBarX(element);\n var y = -winScroll.scrollTop;\n\n if (getComputedStyle(body || html).direction === 'rtl') {\n x += max(html.clientWidth, body ? body.clientWidth : 0) - width;\n }\n\n return {\n width: width,\n height: height,\n x: x,\n y: y\n };\n}","import getComputedStyle from \"./getComputedStyle.js\";\nexport default function isScrollParent(element) {\n // Firefox wants us to check `-x` and `-y` variations as well\n var _getComputedStyle = getComputedStyle(element),\n overflow = _getComputedStyle.overflow,\n overflowX = _getComputedStyle.overflowX,\n overflowY = _getComputedStyle.overflowY;\n\n return /auto|scroll|overlay|hidden/.test(overflow + overflowY + overflowX);\n}","import getParentNode from \"./getParentNode.js\";\nimport isScrollParent from \"./isScrollParent.js\";\nimport getNodeName from \"./getNodeName.js\";\nimport { isHTMLElement } from \"./instanceOf.js\";\nexport default function getScrollParent(node) {\n if (['html', 'body', '#document'].indexOf(getNodeName(node)) >= 0) {\n // $FlowFixMe[incompatible-return]: assume body is always available\n return node.ownerDocument.body;\n }\n\n if (isHTMLElement(node) && isScrollParent(node)) {\n return node;\n }\n\n return getScrollParent(getParentNode(node));\n}","import getScrollParent from \"./getScrollParent.js\";\nimport getParentNode from \"./getParentNode.js\";\nimport getWindow from \"./getWindow.js\";\nimport isScrollParent from \"./isScrollParent.js\";\n/*\ngiven a DOM element, return the list of all scroll parents, up the list of ancesors\nuntil we get to the top window object. This list is what we attach scroll listeners\nto, because if any of these parent elements scroll, we'll need to re-calculate the\nreference element's position.\n*/\n\nexport default function listScrollParents(element, list) {\n var _element$ownerDocumen;\n\n if (list === void 0) {\n list = [];\n }\n\n var scrollParent = getScrollParent(element);\n var isBody = scrollParent === ((_element$ownerDocumen = element.ownerDocument) == null ? void 0 : _element$ownerDocumen.body);\n var win = getWindow(scrollParent);\n var target = isBody ? [win].concat(win.visualViewport || [], isScrollParent(scrollParent) ? scrollParent : []) : scrollParent;\n var updatedList = list.concat(target);\n return isBody ? updatedList : // $FlowFixMe[incompatible-call]: isBody tells us target will be an HTMLElement here\n updatedList.concat(listScrollParents(getParentNode(target)));\n}","export default function rectToClientRect(rect) {\n return Object.assign({}, rect, {\n left: rect.x,\n top: rect.y,\n right: rect.x + rect.width,\n bottom: rect.y + rect.height\n });\n}","import { viewport } from \"../enums.js\";\nimport getViewportRect from \"./getViewportRect.js\";\nimport getDocumentRect from \"./getDocumentRect.js\";\nimport listScrollParents from \"./listScrollParents.js\";\nimport getOffsetParent from \"./getOffsetParent.js\";\nimport getDocumentElement from \"./getDocumentElement.js\";\nimport getComputedStyle from \"./getComputedStyle.js\";\nimport { isElement, isHTMLElement } from \"./instanceOf.js\";\nimport getBoundingClientRect from \"./getBoundingClientRect.js\";\nimport getParentNode from \"./getParentNode.js\";\nimport contains from \"./contains.js\";\nimport getNodeName from \"./getNodeName.js\";\nimport rectToClientRect from \"../utils/rectToClientRect.js\";\nimport { max, min } from \"../utils/math.js\";\n\nfunction getInnerBoundingClientRect(element, strategy) {\n var rect = getBoundingClientRect(element, false, strategy === 'fixed');\n rect.top = rect.top + element.clientTop;\n rect.left = rect.left + element.clientLeft;\n rect.bottom = rect.top + element.clientHeight;\n rect.right = rect.left + element.clientWidth;\n rect.width = element.clientWidth;\n rect.height = element.clientHeight;\n rect.x = rect.left;\n rect.y = rect.top;\n return rect;\n}\n\nfunction getClientRectFromMixedType(element, clippingParent, strategy) {\n return clippingParent === viewport ? rectToClientRect(getViewportRect(element, strategy)) : isElement(clippingParent) ? getInnerBoundingClientRect(clippingParent, strategy) : rectToClientRect(getDocumentRect(getDocumentElement(element)));\n} // A \"clipping parent\" is an overflowable container with the characteristic of\n// clipping (or hiding) overflowing elements with a position different from\n// `initial`\n\n\nfunction getClippingParents(element) {\n var clippingParents = listScrollParents(getParentNode(element));\n var canEscapeClipping = ['absolute', 'fixed'].indexOf(getComputedStyle(element).position) >= 0;\n var clipperElement = canEscapeClipping && isHTMLElement(element) ? getOffsetParent(element) : element;\n\n if (!isElement(clipperElement)) {\n return [];\n } // $FlowFixMe[incompatible-return]: https://github.com/facebook/flow/issues/1414\n\n\n return clippingParents.filter(function (clippingParent) {\n return isElement(clippingParent) && contains(clippingParent, clipperElement) && getNodeName(clippingParent) !== 'body';\n });\n} // Gets the maximum area that the element is visible in due to any number of\n// clipping parents\n\n\nexport default function getClippingRect(element, boundary, rootBoundary, strategy) {\n var mainClippingParents = boundary === 'clippingParents' ? getClippingParents(element) : [].concat(boundary);\n var clippingParents = [].concat(mainClippingParents, [rootBoundary]);\n var firstClippingParent = clippingParents[0];\n var clippingRect = clippingParents.reduce(function (accRect, clippingParent) {\n var rect = getClientRectFromMixedType(element, clippingParent, strategy);\n accRect.top = max(rect.top, accRect.top);\n accRect.right = min(rect.right, accRect.right);\n accRect.bottom = min(rect.bottom, accRect.bottom);\n accRect.left = max(rect.left, accRect.left);\n return accRect;\n }, getClientRectFromMixedType(element, firstClippingParent, strategy));\n clippingRect.width = clippingRect.right - clippingRect.left;\n clippingRect.height = clippingRect.bottom - clippingRect.top;\n clippingRect.x = clippingRect.left;\n clippingRect.y = clippingRect.top;\n return clippingRect;\n}","import getBasePlacement from \"./getBasePlacement.js\";\nimport getVariation from \"./getVariation.js\";\nimport getMainAxisFromPlacement from \"./getMainAxisFromPlacement.js\";\nimport { top, right, bottom, left, start, end } from \"../enums.js\";\nexport default function computeOffsets(_ref) {\n var reference = _ref.reference,\n element = _ref.element,\n placement = _ref.placement;\n var basePlacement = placement ? getBasePlacement(placement) : null;\n var variation = placement ? getVariation(placement) : null;\n var commonX = reference.x + reference.width / 2 - element.width / 2;\n var commonY = reference.y + reference.height / 2 - element.height / 2;\n var offsets;\n\n switch (basePlacement) {\n case top:\n offsets = {\n x: commonX,\n y: reference.y - element.height\n };\n break;\n\n case bottom:\n offsets = {\n x: commonX,\n y: reference.y + reference.height\n };\n break;\n\n case right:\n offsets = {\n x: reference.x + reference.width,\n y: commonY\n };\n break;\n\n case left:\n offsets = {\n x: reference.x - element.width,\n y: commonY\n };\n break;\n\n default:\n offsets = {\n x: reference.x,\n y: reference.y\n };\n }\n\n var mainAxis = basePlacement ? getMainAxisFromPlacement(basePlacement) : null;\n\n if (mainAxis != null) {\n var len = mainAxis === 'y' ? 'height' : 'width';\n\n switch (variation) {\n case start:\n offsets[mainAxis] = offsets[mainAxis] - (reference[len] / 2 - element[len] / 2);\n break;\n\n case end:\n offsets[mainAxis] = offsets[mainAxis] + (reference[len] / 2 - element[len] / 2);\n break;\n\n default:\n }\n }\n\n return offsets;\n}","import getClippingRect from \"../dom-utils/getClippingRect.js\";\nimport getDocumentElement from \"../dom-utils/getDocumentElement.js\";\nimport getBoundingClientRect from \"../dom-utils/getBoundingClientRect.js\";\nimport computeOffsets from \"./computeOffsets.js\";\nimport rectToClientRect from \"./rectToClientRect.js\";\nimport { clippingParents, reference, popper, bottom, top, right, basePlacements, viewport } from \"../enums.js\";\nimport { isElement } from \"../dom-utils/instanceOf.js\";\nimport mergePaddingObject from \"./mergePaddingObject.js\";\nimport expandToHashMap from \"./expandToHashMap.js\"; // eslint-disable-next-line import/no-unused-modules\n\nexport default function detectOverflow(state, options) {\n if (options === void 0) {\n options = {};\n }\n\n var _options = options,\n _options$placement = _options.placement,\n placement = _options$placement === void 0 ? state.placement : _options$placement,\n _options$strategy = _options.strategy,\n strategy = _options$strategy === void 0 ? state.strategy : _options$strategy,\n _options$boundary = _options.boundary,\n boundary = _options$boundary === void 0 ? clippingParents : _options$boundary,\n _options$rootBoundary = _options.rootBoundary,\n rootBoundary = _options$rootBoundary === void 0 ? viewport : _options$rootBoundary,\n _options$elementConte = _options.elementContext,\n elementContext = _options$elementConte === void 0 ? popper : _options$elementConte,\n _options$altBoundary = _options.altBoundary,\n altBoundary = _options$altBoundary === void 0 ? false : _options$altBoundary,\n _options$padding = _options.padding,\n padding = _options$padding === void 0 ? 0 : _options$padding;\n var paddingObject = mergePaddingObject(typeof padding !== 'number' ? padding : expandToHashMap(padding, basePlacements));\n var altContext = elementContext === popper ? reference : popper;\n var popperRect = state.rects.popper;\n var element = state.elements[altBoundary ? altContext : elementContext];\n var clippingClientRect = getClippingRect(isElement(element) ? element : element.contextElement || getDocumentElement(state.elements.popper), boundary, rootBoundary, strategy);\n var referenceClientRect = getBoundingClientRect(state.elements.reference);\n var popperOffsets = computeOffsets({\n reference: referenceClientRect,\n element: popperRect,\n strategy: 'absolute',\n placement: placement\n });\n var popperClientRect = rectToClientRect(Object.assign({}, popperRect, popperOffsets));\n var elementClientRect = elementContext === popper ? popperClientRect : referenceClientRect; // positive = overflowing the clipping rect\n // 0 or negative = within the clipping rect\n\n var overflowOffsets = {\n top: clippingClientRect.top - elementClientRect.top + paddingObject.top,\n bottom: elementClientRect.bottom - clippingClientRect.bottom + paddingObject.bottom,\n left: clippingClientRect.left - elementClientRect.left + paddingObject.left,\n right: elementClientRect.right - clippingClientRect.right + paddingObject.right\n };\n var offsetData = state.modifiersData.offset; // Offsets can be applied only to the popper element\n\n if (elementContext === popper && offsetData) {\n var offset = offsetData[placement];\n Object.keys(overflowOffsets).forEach(function (key) {\n var multiply = [right, bottom].indexOf(key) >= 0 ? 1 : -1;\n var axis = [top, bottom].indexOf(key) >= 0 ? 'y' : 'x';\n overflowOffsets[key] += offset[axis] * multiply;\n });\n }\n\n return overflowOffsets;\n}","import getVariation from \"./getVariation.js\";\nimport { variationPlacements, basePlacements, placements as allPlacements } from \"../enums.js\";\nimport detectOverflow from \"./detectOverflow.js\";\nimport getBasePlacement from \"./getBasePlacement.js\";\nexport default function computeAutoPlacement(state, options) {\n if (options === void 0) {\n options = {};\n }\n\n var _options = options,\n placement = _options.placement,\n boundary = _options.boundary,\n rootBoundary = _options.rootBoundary,\n padding = _options.padding,\n flipVariations = _options.flipVariations,\n _options$allowedAutoP = _options.allowedAutoPlacements,\n allowedAutoPlacements = _options$allowedAutoP === void 0 ? allPlacements : _options$allowedAutoP;\n var variation = getVariation(placement);\n var placements = variation ? flipVariations ? variationPlacements : variationPlacements.filter(function (placement) {\n return getVariation(placement) === variation;\n }) : basePlacements;\n var allowedPlacements = placements.filter(function (placement) {\n return allowedAutoPlacements.indexOf(placement) >= 0;\n });\n\n if (allowedPlacements.length === 0) {\n allowedPlacements = placements;\n } // $FlowFixMe[incompatible-type]: Flow seems to have problems with two array unions...\n\n\n var overflows = allowedPlacements.reduce(function (acc, placement) {\n acc[placement] = detectOverflow(state, {\n placement: placement,\n boundary: boundary,\n rootBoundary: rootBoundary,\n padding: padding\n })[getBasePlacement(placement)];\n return acc;\n }, {});\n return Object.keys(overflows).sort(function (a, b) {\n return overflows[a] - overflows[b];\n });\n}","import getOppositePlacement from \"../utils/getOppositePlacement.js\";\nimport getBasePlacement from \"../utils/getBasePlacement.js\";\nimport getOppositeVariationPlacement from \"../utils/getOppositeVariationPlacement.js\";\nimport detectOverflow from \"../utils/detectOverflow.js\";\nimport computeAutoPlacement from \"../utils/computeAutoPlacement.js\";\nimport { bottom, top, start, right, left, auto } from \"../enums.js\";\nimport getVariation from \"../utils/getVariation.js\"; // eslint-disable-next-line import/no-unused-modules\n\nfunction getExpandedFallbackPlacements(placement) {\n if (getBasePlacement(placement) === auto) {\n return [];\n }\n\n var oppositePlacement = getOppositePlacement(placement);\n return [getOppositeVariationPlacement(placement), oppositePlacement, getOppositeVariationPlacement(oppositePlacement)];\n}\n\nfunction flip(_ref) {\n var state = _ref.state,\n options = _ref.options,\n name = _ref.name;\n\n if (state.modifiersData[name]._skip) {\n return;\n }\n\n var _options$mainAxis = options.mainAxis,\n checkMainAxis = _options$mainAxis === void 0 ? true : _options$mainAxis,\n _options$altAxis = options.altAxis,\n checkAltAxis = _options$altAxis === void 0 ? true : _options$altAxis,\n specifiedFallbackPlacements = options.fallbackPlacements,\n padding = options.padding,\n boundary = options.boundary,\n rootBoundary = options.rootBoundary,\n altBoundary = options.altBoundary,\n _options$flipVariatio = options.flipVariations,\n flipVariations = _options$flipVariatio === void 0 ? true : _options$flipVariatio,\n allowedAutoPlacements = options.allowedAutoPlacements;\n var preferredPlacement = state.options.placement;\n var basePlacement = getBasePlacement(preferredPlacement);\n var isBasePlacement = basePlacement === preferredPlacement;\n var fallbackPlacements = specifiedFallbackPlacements || (isBasePlacement || !flipVariations ? [getOppositePlacement(preferredPlacement)] : getExpandedFallbackPlacements(preferredPlacement));\n var placements = [preferredPlacement].concat(fallbackPlacements).reduce(function (acc, placement) {\n return acc.concat(getBasePlacement(placement) === auto ? computeAutoPlacement(state, {\n placement: placement,\n boundary: boundary,\n rootBoundary: rootBoundary,\n padding: padding,\n flipVariations: flipVariations,\n allowedAutoPlacements: allowedAutoPlacements\n }) : placement);\n }, []);\n var referenceRect = state.rects.reference;\n var popperRect = state.rects.popper;\n var checksMap = new Map();\n var makeFallbackChecks = true;\n var firstFittingPlacement = placements[0];\n\n for (var i = 0; i < placements.length; i++) {\n var placement = placements[i];\n\n var _basePlacement = getBasePlacement(placement);\n\n var isStartVariation = getVariation(placement) === start;\n var isVertical = [top, bottom].indexOf(_basePlacement) >= 0;\n var len = isVertical ? 'width' : 'height';\n var overflow = detectOverflow(state, {\n placement: placement,\n boundary: boundary,\n rootBoundary: rootBoundary,\n altBoundary: altBoundary,\n padding: padding\n });\n var mainVariationSide = isVertical ? isStartVariation ? right : left : isStartVariation ? bottom : top;\n\n if (referenceRect[len] > popperRect[len]) {\n mainVariationSide = getOppositePlacement(mainVariationSide);\n }\n\n var altVariationSide = getOppositePlacement(mainVariationSide);\n var checks = [];\n\n if (checkMainAxis) {\n checks.push(overflow[_basePlacement] <= 0);\n }\n\n if (checkAltAxis) {\n checks.push(overflow[mainVariationSide] <= 0, overflow[altVariationSide] <= 0);\n }\n\n if (checks.every(function (check) {\n return check;\n })) {\n firstFittingPlacement = placement;\n makeFallbackChecks = false;\n break;\n }\n\n checksMap.set(placement, checks);\n }\n\n if (makeFallbackChecks) {\n // `2` may be desired in some cases – research later\n var numberOfChecks = flipVariations ? 3 : 1;\n\n var _loop = function _loop(_i) {\n var fittingPlacement = placements.find(function (placement) {\n var checks = checksMap.get(placement);\n\n if (checks) {\n return checks.slice(0, _i).every(function (check) {\n return check;\n });\n }\n });\n\n if (fittingPlacement) {\n firstFittingPlacement = fittingPlacement;\n return \"break\";\n }\n };\n\n for (var _i = numberOfChecks; _i > 0; _i--) {\n var _ret = _loop(_i);\n\n if (_ret === \"break\") break;\n }\n }\n\n if (state.placement !== firstFittingPlacement) {\n state.modifiersData[name]._skip = true;\n state.placement = firstFittingPlacement;\n state.reset = true;\n }\n} // eslint-disable-next-line import/no-unused-modules\n\n\nexport default {\n name: 'flip',\n enabled: true,\n phase: 'main',\n fn: flip,\n requiresIfExists: ['offset'],\n data: {\n _skip: false\n }\n};","import { top, bottom, left, right } from \"../enums.js\";\nimport detectOverflow from \"../utils/detectOverflow.js\";\n\nfunction getSideOffsets(overflow, rect, preventedOffsets) {\n if (preventedOffsets === void 0) {\n preventedOffsets = {\n x: 0,\n y: 0\n };\n }\n\n return {\n top: overflow.top - rect.height - preventedOffsets.y,\n right: overflow.right - rect.width + preventedOffsets.x,\n bottom: overflow.bottom - rect.height + preventedOffsets.y,\n left: overflow.left - rect.width - preventedOffsets.x\n };\n}\n\nfunction isAnySideFullyClipped(overflow) {\n return [top, right, bottom, left].some(function (side) {\n return overflow[side] >= 0;\n });\n}\n\nfunction hide(_ref) {\n var state = _ref.state,\n name = _ref.name;\n var referenceRect = state.rects.reference;\n var popperRect = state.rects.popper;\n var preventedOffsets = state.modifiersData.preventOverflow;\n var referenceOverflow = detectOverflow(state, {\n elementContext: 'reference'\n });\n var popperAltOverflow = detectOverflow(state, {\n altBoundary: true\n });\n var referenceClippingOffsets = getSideOffsets(referenceOverflow, referenceRect);\n var popperEscapeOffsets = getSideOffsets(popperAltOverflow, popperRect, preventedOffsets);\n var isReferenceHidden = isAnySideFullyClipped(referenceClippingOffsets);\n var hasPopperEscaped = isAnySideFullyClipped(popperEscapeOffsets);\n state.modifiersData[name] = {\n referenceClippingOffsets: referenceClippingOffsets,\n popperEscapeOffsets: popperEscapeOffsets,\n isReferenceHidden: isReferenceHidden,\n hasPopperEscaped: hasPopperEscaped\n };\n state.attributes.popper = Object.assign({}, state.attributes.popper, {\n 'data-popper-reference-hidden': isReferenceHidden,\n 'data-popper-escaped': hasPopperEscaped\n });\n} // eslint-disable-next-line import/no-unused-modules\n\n\nexport default {\n name: 'hide',\n enabled: true,\n phase: 'main',\n requiresIfExists: ['preventOverflow'],\n fn: hide\n};","import getBasePlacement from \"../utils/getBasePlacement.js\";\nimport { top, left, right, placements } from \"../enums.js\"; // eslint-disable-next-line import/no-unused-modules\n\nexport function distanceAndSkiddingToXY(placement, rects, offset) {\n var basePlacement = getBasePlacement(placement);\n var invertDistance = [left, top].indexOf(basePlacement) >= 0 ? -1 : 1;\n\n var _ref = typeof offset === 'function' ? offset(Object.assign({}, rects, {\n placement: placement\n })) : offset,\n skidding = _ref[0],\n distance = _ref[1];\n\n skidding = skidding || 0;\n distance = (distance || 0) * invertDistance;\n return [left, right].indexOf(basePlacement) >= 0 ? {\n x: distance,\n y: skidding\n } : {\n x: skidding,\n y: distance\n };\n}\n\nfunction offset(_ref2) {\n var state = _ref2.state,\n options = _ref2.options,\n name = _ref2.name;\n var _options$offset = options.offset,\n offset = _options$offset === void 0 ? [0, 0] : _options$offset;\n var data = placements.reduce(function (acc, placement) {\n acc[placement] = distanceAndSkiddingToXY(placement, state.rects, offset);\n return acc;\n }, {});\n var _data$state$placement = data[state.placement],\n x = _data$state$placement.x,\n y = _data$state$placement.y;\n\n if (state.modifiersData.popperOffsets != null) {\n state.modifiersData.popperOffsets.x += x;\n state.modifiersData.popperOffsets.y += y;\n }\n\n state.modifiersData[name] = data;\n} // eslint-disable-next-line import/no-unused-modules\n\n\nexport default {\n name: 'offset',\n enabled: true,\n phase: 'main',\n requires: ['popperOffsets'],\n fn: offset\n};","import computeOffsets from \"../utils/computeOffsets.js\";\n\nfunction popperOffsets(_ref) {\n var state = _ref.state,\n name = _ref.name;\n // Offsets are the actual position the popper needs to have to be\n // properly positioned near its reference element\n // This is the most basic placement, and will be adjusted by\n // the modifiers in the next step\n state.modifiersData[name] = computeOffsets({\n reference: state.rects.reference,\n element: state.rects.popper,\n strategy: 'absolute',\n placement: state.placement\n });\n} // eslint-disable-next-line import/no-unused-modules\n\n\nexport default {\n name: 'popperOffsets',\n enabled: true,\n phase: 'read',\n fn: popperOffsets,\n data: {}\n};","export default function getAltAxis(axis) {\n return axis === 'x' ? 'y' : 'x';\n}","import { top, left, right, bottom, start } from \"../enums.js\";\nimport getBasePlacement from \"../utils/getBasePlacement.js\";\nimport getMainAxisFromPlacement from \"../utils/getMainAxisFromPlacement.js\";\nimport getAltAxis from \"../utils/getAltAxis.js\";\nimport { within, withinMaxClamp } from \"../utils/within.js\";\nimport getLayoutRect from \"../dom-utils/getLayoutRect.js\";\nimport getOffsetParent from \"../dom-utils/getOffsetParent.js\";\nimport detectOverflow from \"../utils/detectOverflow.js\";\nimport getVariation from \"../utils/getVariation.js\";\nimport getFreshSideObject from \"../utils/getFreshSideObject.js\";\nimport { min as mathMin, max as mathMax } from \"../utils/math.js\";\n\nfunction preventOverflow(_ref) {\n var state = _ref.state,\n options = _ref.options,\n name = _ref.name;\n var _options$mainAxis = options.mainAxis,\n checkMainAxis = _options$mainAxis === void 0 ? true : _options$mainAxis,\n _options$altAxis = options.altAxis,\n checkAltAxis = _options$altAxis === void 0 ? false : _options$altAxis,\n boundary = options.boundary,\n rootBoundary = options.rootBoundary,\n altBoundary = options.altBoundary,\n padding = options.padding,\n _options$tether = options.tether,\n tether = _options$tether === void 0 ? true : _options$tether,\n _options$tetherOffset = options.tetherOffset,\n tetherOffset = _options$tetherOffset === void 0 ? 0 : _options$tetherOffset;\n var overflow = detectOverflow(state, {\n boundary: boundary,\n rootBoundary: rootBoundary,\n padding: padding,\n altBoundary: altBoundary\n });\n var basePlacement = getBasePlacement(state.placement);\n var variation = getVariation(state.placement);\n var isBasePlacement = !variation;\n var mainAxis = getMainAxisFromPlacement(basePlacement);\n var altAxis = getAltAxis(mainAxis);\n var popperOffsets = state.modifiersData.popperOffsets;\n var referenceRect = state.rects.reference;\n var popperRect = state.rects.popper;\n var tetherOffsetValue = typeof tetherOffset === 'function' ? tetherOffset(Object.assign({}, state.rects, {\n placement: state.placement\n })) : tetherOffset;\n var normalizedTetherOffsetValue = typeof tetherOffsetValue === 'number' ? {\n mainAxis: tetherOffsetValue,\n altAxis: tetherOffsetValue\n } : Object.assign({\n mainAxis: 0,\n altAxis: 0\n }, tetherOffsetValue);\n var offsetModifierState = state.modifiersData.offset ? state.modifiersData.offset[state.placement] : null;\n var data = {\n x: 0,\n y: 0\n };\n\n if (!popperOffsets) {\n return;\n }\n\n if (checkMainAxis) {\n var _offsetModifierState$;\n\n var mainSide = mainAxis === 'y' ? top : left;\n var altSide = mainAxis === 'y' ? bottom : right;\n var len = mainAxis === 'y' ? 'height' : 'width';\n var offset = popperOffsets[mainAxis];\n var min = offset + overflow[mainSide];\n var max = offset - overflow[altSide];\n var additive = tether ? -popperRect[len] / 2 : 0;\n var minLen = variation === start ? referenceRect[len] : popperRect[len];\n var maxLen = variation === start ? -popperRect[len] : -referenceRect[len]; // We need to include the arrow in the calculation so the arrow doesn't go\n // outside the reference bounds\n\n var arrowElement = state.elements.arrow;\n var arrowRect = tether && arrowElement ? getLayoutRect(arrowElement) : {\n width: 0,\n height: 0\n };\n var arrowPaddingObject = state.modifiersData['arrow#persistent'] ? state.modifiersData['arrow#persistent'].padding : getFreshSideObject();\n var arrowPaddingMin = arrowPaddingObject[mainSide];\n var arrowPaddingMax = arrowPaddingObject[altSide]; // If the reference length is smaller than the arrow length, we don't want\n // to include its full size in the calculation. If the reference is small\n // and near the edge of a boundary, the popper can overflow even if the\n // reference is not overflowing as well (e.g. virtual elements with no\n // width or height)\n\n var arrowLen = within(0, referenceRect[len], arrowRect[len]);\n var minOffset = isBasePlacement ? referenceRect[len] / 2 - additive - arrowLen - arrowPaddingMin - normalizedTetherOffsetValue.mainAxis : minLen - arrowLen - arrowPaddingMin - normalizedTetherOffsetValue.mainAxis;\n var maxOffset = isBasePlacement ? -referenceRect[len] / 2 + additive + arrowLen + arrowPaddingMax + normalizedTetherOffsetValue.mainAxis : maxLen + arrowLen + arrowPaddingMax + normalizedTetherOffsetValue.mainAxis;\n var arrowOffsetParent = state.elements.arrow && getOffsetParent(state.elements.arrow);\n var clientOffset = arrowOffsetParent ? mainAxis === 'y' ? arrowOffsetParent.clientTop || 0 : arrowOffsetParent.clientLeft || 0 : 0;\n var offsetModifierValue = (_offsetModifierState$ = offsetModifierState == null ? void 0 : offsetModifierState[mainAxis]) != null ? _offsetModifierState$ : 0;\n var tetherMin = offset + minOffset - offsetModifierValue - clientOffset;\n var tetherMax = offset + maxOffset - offsetModifierValue;\n var preventedOffset = within(tether ? mathMin(min, tetherMin) : min, offset, tether ? mathMax(max, tetherMax) : max);\n popperOffsets[mainAxis] = preventedOffset;\n data[mainAxis] = preventedOffset - offset;\n }\n\n if (checkAltAxis) {\n var _offsetModifierState$2;\n\n var _mainSide = mainAxis === 'x' ? top : left;\n\n var _altSide = mainAxis === 'x' ? bottom : right;\n\n var _offset = popperOffsets[altAxis];\n\n var _len = altAxis === 'y' ? 'height' : 'width';\n\n var _min = _offset + overflow[_mainSide];\n\n var _max = _offset - overflow[_altSide];\n\n var isOriginSide = [top, left].indexOf(basePlacement) !== -1;\n\n var _offsetModifierValue = (_offsetModifierState$2 = offsetModifierState == null ? void 0 : offsetModifierState[altAxis]) != null ? _offsetModifierState$2 : 0;\n\n var _tetherMin = isOriginSide ? _min : _offset - referenceRect[_len] - popperRect[_len] - _offsetModifierValue + normalizedTetherOffsetValue.altAxis;\n\n var _tetherMax = isOriginSide ? _offset + referenceRect[_len] + popperRect[_len] - _offsetModifierValue - normalizedTetherOffsetValue.altAxis : _max;\n\n var _preventedOffset = tether && isOriginSide ? withinMaxClamp(_tetherMin, _offset, _tetherMax) : within(tether ? _tetherMin : _min, _offset, tether ? _tetherMax : _max);\n\n popperOffsets[altAxis] = _preventedOffset;\n data[altAxis] = _preventedOffset - _offset;\n }\n\n state.modifiersData[name] = data;\n} // eslint-disable-next-line import/no-unused-modules\n\n\nexport default {\n name: 'preventOverflow',\n enabled: true,\n phase: 'main',\n fn: preventOverflow,\n requiresIfExists: ['offset']\n};","export default function getHTMLElementScroll(element) {\n return {\n scrollLeft: element.scrollLeft,\n scrollTop: element.scrollTop\n };\n}","import getWindowScroll from \"./getWindowScroll.js\";\nimport getWindow from \"./getWindow.js\";\nimport { isHTMLElement } from \"./instanceOf.js\";\nimport getHTMLElementScroll from \"./getHTMLElementScroll.js\";\nexport default function getNodeScroll(node) {\n if (node === getWindow(node) || !isHTMLElement(node)) {\n return getWindowScroll(node);\n } else {\n return getHTMLElementScroll(node);\n }\n}","import getBoundingClientRect from \"./getBoundingClientRect.js\";\nimport getNodeScroll from \"./getNodeScroll.js\";\nimport getNodeName from \"./getNodeName.js\";\nimport { isHTMLElement } from \"./instanceOf.js\";\nimport getWindowScrollBarX from \"./getWindowScrollBarX.js\";\nimport getDocumentElement from \"./getDocumentElement.js\";\nimport isScrollParent from \"./isScrollParent.js\";\nimport { round } from \"../utils/math.js\";\n\nfunction isElementScaled(element) {\n var rect = element.getBoundingClientRect();\n var scaleX = round(rect.width) / element.offsetWidth || 1;\n var scaleY = round(rect.height) / element.offsetHeight || 1;\n return scaleX !== 1 || scaleY !== 1;\n} // Returns the composite rect of an element relative to its offsetParent.\n// Composite means it takes into account transforms as well as layout.\n\n\nexport default function getCompositeRect(elementOrVirtualElement, offsetParent, isFixed) {\n if (isFixed === void 0) {\n isFixed = false;\n }\n\n var isOffsetParentAnElement = isHTMLElement(offsetParent);\n var offsetParentIsScaled = isHTMLElement(offsetParent) && isElementScaled(offsetParent);\n var documentElement = getDocumentElement(offsetParent);\n var rect = getBoundingClientRect(elementOrVirtualElement, offsetParentIsScaled, isFixed);\n var scroll = {\n scrollLeft: 0,\n scrollTop: 0\n };\n var offsets = {\n x: 0,\n y: 0\n };\n\n if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) {\n if (getNodeName(offsetParent) !== 'body' || // https://github.com/popperjs/popper-core/issues/1078\n isScrollParent(documentElement)) {\n scroll = getNodeScroll(offsetParent);\n }\n\n if (isHTMLElement(offsetParent)) {\n offsets = getBoundingClientRect(offsetParent, true);\n offsets.x += offsetParent.clientLeft;\n offsets.y += offsetParent.clientTop;\n } else if (documentElement) {\n offsets.x = getWindowScrollBarX(documentElement);\n }\n }\n\n return {\n x: rect.left + scroll.scrollLeft - offsets.x,\n y: rect.top + scroll.scrollTop - offsets.y,\n width: rect.width,\n height: rect.height\n };\n}","import { modifierPhases } from \"../enums.js\"; // source: https://stackoverflow.com/questions/49875255\n\nfunction order(modifiers) {\n var map = new Map();\n var visited = new Set();\n var result = [];\n modifiers.forEach(function (modifier) {\n map.set(modifier.name, modifier);\n }); // On visiting object, check for its dependencies and visit them recursively\n\n function sort(modifier) {\n visited.add(modifier.name);\n var requires = [].concat(modifier.requires || [], modifier.requiresIfExists || []);\n requires.forEach(function (dep) {\n if (!visited.has(dep)) {\n var depModifier = map.get(dep);\n\n if (depModifier) {\n sort(depModifier);\n }\n }\n });\n result.push(modifier);\n }\n\n modifiers.forEach(function (modifier) {\n if (!visited.has(modifier.name)) {\n // check for visited object\n sort(modifier);\n }\n });\n return result;\n}\n\nexport default function orderModifiers(modifiers) {\n // order based on dependencies\n var orderedModifiers = order(modifiers); // order based on phase\n\n return modifierPhases.reduce(function (acc, phase) {\n return acc.concat(orderedModifiers.filter(function (modifier) {\n return modifier.phase === phase;\n }));\n }, []);\n}","export default function debounce(fn) {\n var pending;\n return function () {\n if (!pending) {\n pending = new Promise(function (resolve) {\n Promise.resolve().then(function () {\n pending = undefined;\n resolve(fn());\n });\n });\n }\n\n return pending;\n };\n}","export default function mergeByName(modifiers) {\n var merged = modifiers.reduce(function (merged, current) {\n var existing = merged[current.name];\n merged[current.name] = existing ? Object.assign({}, existing, current, {\n options: Object.assign({}, existing.options, current.options),\n data: Object.assign({}, existing.data, current.data)\n }) : current;\n return merged;\n }, {}); // IE11 does not support Object.values\n\n return Object.keys(merged).map(function (key) {\n return merged[key];\n });\n}","import getCompositeRect from \"./dom-utils/getCompositeRect.js\";\nimport getLayoutRect from \"./dom-utils/getLayoutRect.js\";\nimport listScrollParents from \"./dom-utils/listScrollParents.js\";\nimport getOffsetParent from \"./dom-utils/getOffsetParent.js\";\nimport orderModifiers from \"./utils/orderModifiers.js\";\nimport debounce from \"./utils/debounce.js\";\nimport mergeByName from \"./utils/mergeByName.js\";\nimport detectOverflow from \"./utils/detectOverflow.js\";\nimport { isElement } from \"./dom-utils/instanceOf.js\";\nvar DEFAULT_OPTIONS = {\n placement: 'bottom',\n modifiers: [],\n strategy: 'absolute'\n};\n\nfunction areValidElements() {\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n return !args.some(function (element) {\n return !(element && typeof element.getBoundingClientRect === 'function');\n });\n}\n\nexport function popperGenerator(generatorOptions) {\n if (generatorOptions === void 0) {\n generatorOptions = {};\n }\n\n var _generatorOptions = generatorOptions,\n _generatorOptions$def = _generatorOptions.defaultModifiers,\n defaultModifiers = _generatorOptions$def === void 0 ? [] : _generatorOptions$def,\n _generatorOptions$def2 = _generatorOptions.defaultOptions,\n defaultOptions = _generatorOptions$def2 === void 0 ? DEFAULT_OPTIONS : _generatorOptions$def2;\n return function createPopper(reference, popper, options) {\n if (options === void 0) {\n options = defaultOptions;\n }\n\n var state = {\n placement: 'bottom',\n orderedModifiers: [],\n options: Object.assign({}, DEFAULT_OPTIONS, defaultOptions),\n modifiersData: {},\n elements: {\n reference: reference,\n popper: popper\n },\n attributes: {},\n styles: {}\n };\n var effectCleanupFns = [];\n var isDestroyed = false;\n var instance = {\n state: state,\n setOptions: function setOptions(setOptionsAction) {\n var options = typeof setOptionsAction === 'function' ? setOptionsAction(state.options) : setOptionsAction;\n cleanupModifierEffects();\n state.options = Object.assign({}, defaultOptions, state.options, options);\n state.scrollParents = {\n reference: isElement(reference) ? listScrollParents(reference) : reference.contextElement ? listScrollParents(reference.contextElement) : [],\n popper: listScrollParents(popper)\n }; // Orders the modifiers based on their dependencies and `phase`\n // properties\n\n var orderedModifiers = orderModifiers(mergeByName([].concat(defaultModifiers, state.options.modifiers))); // Strip out disabled modifiers\n\n state.orderedModifiers = orderedModifiers.filter(function (m) {\n return m.enabled;\n });\n runModifierEffects();\n return instance.update();\n },\n // Sync update – it will always be executed, even if not necessary. This\n // is useful for low frequency updates where sync behavior simplifies the\n // logic.\n // For high frequency updates (e.g. `resize` and `scroll` events), always\n // prefer the async Popper#update method\n forceUpdate: function forceUpdate() {\n if (isDestroyed) {\n return;\n }\n\n var _state$elements = state.elements,\n reference = _state$elements.reference,\n popper = _state$elements.popper; // Don't proceed if `reference` or `popper` are not valid elements\n // anymore\n\n if (!areValidElements(reference, popper)) {\n return;\n } // Store the reference and popper rects to be read by modifiers\n\n\n state.rects = {\n reference: getCompositeRect(reference, getOffsetParent(popper), state.options.strategy === 'fixed'),\n popper: getLayoutRect(popper)\n }; // Modifiers have the ability to reset the current update cycle. The\n // most common use case for this is the `flip` modifier changing the\n // placement, which then needs to re-run all the modifiers, because the\n // logic was previously ran for the previous placement and is therefore\n // stale/incorrect\n\n state.reset = false;\n state.placement = state.options.placement; // On each update cycle, the `modifiersData` property for each modifier\n // is filled with the initial data specified by the modifier. This means\n // it doesn't persist and is fresh on each update.\n // To ensure persistent data, use `${name}#persistent`\n\n state.orderedModifiers.forEach(function (modifier) {\n return state.modifiersData[modifier.name] = Object.assign({}, modifier.data);\n });\n\n for (var index = 0; index < state.orderedModifiers.length; index++) {\n if (state.reset === true) {\n state.reset = false;\n index = -1;\n continue;\n }\n\n var _state$orderedModifie = state.orderedModifiers[index],\n fn = _state$orderedModifie.fn,\n _state$orderedModifie2 = _state$orderedModifie.options,\n _options = _state$orderedModifie2 === void 0 ? {} : _state$orderedModifie2,\n name = _state$orderedModifie.name;\n\n if (typeof fn === 'function') {\n state = fn({\n state: state,\n options: _options,\n name: name,\n instance: instance\n }) || state;\n }\n }\n },\n // Async and optimistically optimized update – it will not be executed if\n // not necessary (debounced to run at most once-per-tick)\n update: debounce(function () {\n return new Promise(function (resolve) {\n instance.forceUpdate();\n resolve(state);\n });\n }),\n destroy: function destroy() {\n cleanupModifierEffects();\n isDestroyed = true;\n }\n };\n\n if (!areValidElements(reference, popper)) {\n return instance;\n }\n\n instance.setOptions(options).then(function (state) {\n if (!isDestroyed && options.onFirstUpdate) {\n options.onFirstUpdate(state);\n }\n }); // Modifiers have the ability to execute arbitrary code before the first\n // update cycle runs. They will be executed in the same order as the update\n // cycle. This is useful when a modifier adds some persistent data that\n // other modifiers need to use, but the modifier is run after the dependent\n // one.\n\n function runModifierEffects() {\n state.orderedModifiers.forEach(function (_ref) {\n var name = _ref.name,\n _ref$options = _ref.options,\n options = _ref$options === void 0 ? {} : _ref$options,\n effect = _ref.effect;\n\n if (typeof effect === 'function') {\n var cleanupFn = effect({\n state: state,\n name: name,\n instance: instance,\n options: options\n });\n\n var noopFn = function noopFn() {};\n\n effectCleanupFns.push(cleanupFn || noopFn);\n }\n });\n }\n\n function cleanupModifierEffects() {\n effectCleanupFns.forEach(function (fn) {\n return fn();\n });\n effectCleanupFns = [];\n }\n\n return instance;\n };\n}\nexport var createPopper = /*#__PURE__*/popperGenerator(); // eslint-disable-next-line import/no-unused-modules\n\nexport { detectOverflow };","import { popperGenerator, detectOverflow } from \"./createPopper.js\";\nimport eventListeners from \"./modifiers/eventListeners.js\";\nimport popperOffsets from \"./modifiers/popperOffsets.js\";\nimport computeStyles from \"./modifiers/computeStyles.js\";\nimport applyStyles from \"./modifiers/applyStyles.js\";\nimport offset from \"./modifiers/offset.js\";\nimport flip from \"./modifiers/flip.js\";\nimport preventOverflow from \"./modifiers/preventOverflow.js\";\nimport arrow from \"./modifiers/arrow.js\";\nimport hide from \"./modifiers/hide.js\";\nvar defaultModifiers = [eventListeners, popperOffsets, computeStyles, applyStyles, offset, flip, preventOverflow, arrow, hide];\nvar createPopper = /*#__PURE__*/popperGenerator({\n defaultModifiers: defaultModifiers\n}); // eslint-disable-next-line import/no-unused-modules\n\nexport { createPopper, popperGenerator, defaultModifiers, detectOverflow }; // eslint-disable-next-line import/no-unused-modules\n\nexport { createPopper as createPopperLite } from \"./popper-lite.js\"; // eslint-disable-next-line import/no-unused-modules\n\nexport * from \"./modifiers/index.js\";","import { useRef, useEffect } from 'react';\n/**\r\n * Creates DOM element to be used as React root.\r\n */\nfunction createRootElement(id) {\n var rootContainer = document.createElement('div');\n rootContainer.setAttribute('id', id);\n return rootContainer;\n}\n\n/**\r\n * Appends element as last child of body.\r\n */\nfunction addRootElement(rootElem) {\n document.body.append(rootElem);\n}\n\n/**\r\n * Hook to create a React Portal.\r\n * Automatically handles creating and tearing-down the root elements (no SRR\r\n * makes this trivial), so there is no need to ensure the parent target already\r\n * exists.\r\n * @example\r\n * const target = usePortal(id, [id]);\r\n * return createPortal(children, target);\r\n * @param {String} id The id of the target container, e.g 'modal' or 'spotlight'\r\n * @returns {HTMLElement} The DOM node to use as the Portal target.\r\n */\nfunction usePortal(id) {\n var rootElemRef = useRef(null);\n useEffect(function () {\n // Look for existing target dom element to append to\n var existingParent = document.querySelector(\"#\".concat(id));\n // Parent is either a new root or the existing dom element\n var parentElem = existingParent || createRootElement(id);\n\n // If there is no existing DOM element, add a new one.\n if (!existingParent) {\n addRootElement(parentElem);\n }\n\n // Add the detached element to the parent\n if (rootElemRef.current) {\n parentElem.append(rootElemRef.current);\n }\n return function removeElement() {\n if (rootElemRef.current) {\n rootElemRef.current.remove();\n }\n if (parentElem.childNodes.length === -1) {\n parentElem.remove();\n }\n };\n }, []);\n\n /**\r\n * It's important we evaluate this lazily:\r\n * - We need first render to contain the DOM element, so it shouldn't happen\r\n * in useEffect. We would normally put this in the constructor().\r\n * - We can't do 'const rootElemRef = useRef(document.createElement('div))',\r\n * since this will run every single render (that's a lot).\r\n * - We want the ref to consistently point to the same DOM element and only\r\n * ever run once.\r\n * @link https://reactjs.org/docs/hooks-faq.html#how-to-create-expensive-objects-lazily\r\n */\n function getRootElem() {\n if (!rootElemRef.current) {\n rootElemRef.current = document.createElement('div');\n }\n return rootElemRef.current;\n }\n return getRootElem();\n}\nexport default usePortal;\nexport { usePortal };","export var Position = {\n AutoStart: 'auto-start',\n Auto: 'auto',\n AutoEnd: 'auto-end',\n TopStart: 'top-start',\n Top: 'top',\n TopEnd: 'top-end',\n BottomStart: 'bottom-start',\n Bottom: 'bottom',\n BottomEnd: 'bottom-end',\n LeftStart: 'left-start',\n Left: 'left',\n LeftEnd: 'left-end',\n RightStart: 'right-start',\n Right: 'right',\n RightEnd: 'right-end'\n};","export var Strategy = {\n Absloute: 'absolute',\n Fixed: 'fixed'\n};","import _defineProperty from \"@babel/runtime/helpers/defineProperty\";\nvar _PopperMixin;\nimport { css } from 'styled-components';\nimport { Position } from './types';\nexport var PopperMixin = (_PopperMixin = {}, _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_PopperMixin, Position.Auto, css([\"top:0px;bottom:0px;left:0px;right:0px;\"])), Position.AutoEnd, css([\"top:0px;bottom:0px;left:0px;right:0px;\"])), Position.AutoStart, css([\"top:0px;bottom:0px;left:0px;right:0px;\"])), Position.Right, css([\"left:-4px;\"])), Position.RightEnd, css([\"left:-4px;\"])), Position.RightStart, css([\"left:-4px;\"])), Position.Left, css([\"right:-4px;\"])), Position.LeftEnd, css([\"right:-4px;\"])), Position.LeftStart, css([\"right:-4px;\"])), Position.Top, css([\"bottom:-4px;\"])), _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_PopperMixin, Position.TopEnd, css([\"bottom:-4px;\"])), Position.TopStart, css([\"bottom:-4px;\"])), Position.Bottom, css([\"top:-4px;\"])), Position.BottomEnd, css([\"top:-4px;\"])), Position.BottomStart, css([\"top:-4px;\"])));","import styled, { css } from 'styled-components';\nimport { generateClassNames, applyDisplayNames } from '../../utils/functions';\nimport { Color as PColor } from '../../utils/types/palette';\nimport { PopperMixin } from './popper.mixin';\nimport { Position } from './types';\nvar baseClassName = 'Popper';\nvar Popper = /*#__PURE__*/styled.div.attrs({\n className: generateClassNames(baseClassName, 'root')\n}).withConfig({\n componentId: \"sc-1373tsp-0\"\n})([\"\"]);\nvar PopperWrapper = /*#__PURE__*/styled.div.attrs({\n className: generateClassNames(baseClassName, 'wrapper')\n}).withConfig({\n componentId: \"sc-1373tsp-1\"\n})(function (_ref) {\n var zIndex = _ref.zIndex;\n return css([\"position:relative;z-index:\", \";\"], zIndex);\n});\nvar Arrow = /*#__PURE__*/styled.div.attrs({\n className: generateClassNames(baseClassName, 'arrow')\n}).withConfig({\n componentId: \"sc-1373tsp-2\"\n})(function (_ref2) {\n var _ref2$warning = _ref2.warning,\n warning = _ref2$warning === void 0 ? false : _ref2$warning,\n _ref2$position = _ref2.position,\n position = _ref2$position === void 0 ? Position.Right : _ref2$position,\n theme = _ref2.theme;\n return css([\"width:8px;height:8px;position:absolute;&::before{content:'';background:\", \";width:8px;height:8px;transform:rotate(45deg);position:absolute;top:0;left:0;z-index:-1;}\", \"\"], warning ? theme.palette[PColor.BackgroundOrange] : theme.palette[PColor.BackgroundGrey], PopperMixin[position]);\n});\nvar Overlay = /*#__PURE__*/styled.div.attrs({\n className: generateClassNames(baseClassName, 'Overlay')\n}).withConfig({\n componentId: \"sc-1373tsp-3\"\n})(function () {\n return css([\"position:fixed;right:0;bottom:0;top:0;left:0;background-color:transparent;\"]);\n});\nvar Styled = applyDisplayNames({\n Popper: Popper,\n Overlay: Overlay,\n Arrow: Arrow,\n PopperWrapper: PopperWrapper\n});\nexport default Styled;","import _extends from \"@babel/runtime/helpers/extends\";\nimport _defineProperty from \"@babel/runtime/helpers/defineProperty\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/objectWithoutProperties\";\nvar _excluded = [\"anchorEl\", \"children\", \"open\", \"warning\", \"position\", \"arrow\", \"popperOptions\", \"onClick\", \"overlay\", \"zIndex\", \"enableUnderlayingEvent\", \"wrapperStyles\"];\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nimport React, { useRef, useEffect } from 'react';\nimport { createPortal } from 'react-dom';\nimport PT from 'prop-types';\nimport { createPopper } from '@popperjs/core';\nimport usePortal from '../../hooks/use-portal';\nimport { intrinsicComponent, generateClassNames, useForkRef, objectValues } from '../../utils/functions';\nimport { Position, Strategy } from './types';\nimport Styled from './popper.styles';\nvar Popper = intrinsicComponent(function (_ref, ref) {\n var anchorEl = _ref.anchorEl,\n children = _ref.children,\n open = _ref.open,\n _ref$warning = _ref.warning,\n warning = _ref$warning === void 0 ? false : _ref$warning,\n _ref$position = _ref.position,\n initialPlacement = _ref$position === void 0 ? 'bottom' : _ref$position,\n _ref$arrow = _ref.arrow,\n arrow = _ref$arrow === void 0 ? false : _ref$arrow,\n popperOptions = _ref.popperOptions,\n onClick = _ref.onClick,\n _ref$overlay = _ref.overlay,\n overlay = _ref$overlay === void 0 ? false : _ref$overlay,\n _ref$zIndex = _ref.zIndex,\n zIndex = _ref$zIndex === void 0 ? 1300 : _ref$zIndex,\n enableUnderlayingEvent = _ref.enableUnderlayingEvent,\n _ref$wrapperStyles = _ref.wrapperStyles,\n wrapperStyles = _ref$wrapperStyles === void 0 ? {} : _ref$wrapperStyles,\n rest = _objectWithoutProperties(_ref, _excluded);\n var target = usePortal(generateClassNames('Popper'));\n var popperRef = useRef(null);\n var handlePopperRef = useForkRef(popperRef, ref);\n useEffect(function () {\n if (!anchorEl || !open || popperRef.current === null) {\n return undefined;\n }\n var defaultModifiers = [{\n name: 'arrow',\n options: {\n element: '[data-popper-arrow]'\n }\n }, {\n name: 'offset',\n options: {\n offset: [0, 10]\n }\n }];\n var popperModifiers = arrow ? defaultModifiers : [];\n if (popperOptions && popperOptions.modifiers != null) {\n popperModifiers = popperModifiers.concat(popperOptions.modifiers);\n }\n var popper = createPopper(anchorEl, popperRef.current, _objectSpread(_objectSpread({\n placement: initialPlacement\n }, popperOptions), {}, {\n modifiers: popperModifiers\n }));\n handlePopperRef.current = popper;\n return function () {\n popper.destroy();\n handlePopperRef.current = null;\n };\n }, [anchorEl, open, popperOptions, initialPlacement, arrow]);\n var passEventToUnderlayingEvent = function passEventToUnderlayingEvent(event) {\n setTimeout(function () {\n if (event.clientX && event.clientY) {\n var elem = document.elementFromPoint(event.clientX, event.clientY);\n if (elem) {\n elem.dispatchEvent(event.nativeEvent);\n }\n }\n }, 0);\n };\n var handleOnClicking = function handleOnClicking(event) {\n event.persist();\n event.preventDefault();\n event.stopPropagation();\n if (onClick) {\n onClick(event);\n }\n if (enableUnderlayingEvent) {\n passEventToUnderlayingEvent(event);\n }\n };\n var renderOverlay = function renderOverlay() {\n return /*#__PURE__*/React.createElement(Styled.Overlay, {\n onClick: handleOnClicking,\n onContextMenu: handleOnClicking\n });\n };\n if (!open) {\n return /*#__PURE__*/React.createElement(\"div\", {\n hidden: true,\n ref: handlePopperRef\n });\n }\n var render = function render() {\n var _handlePopperRef$stat;\n return /*#__PURE__*/React.createElement(Styled.PopperWrapper, {\n zIndex: zIndex,\n style: _objectSpread({}, wrapperStyles)\n }, overlay && renderOverlay(), /*#__PURE__*/React.createElement(Styled.Popper, _extends({\n ref: handlePopperRef\n }, rest), children, arrow && /*#__PURE__*/React.createElement(Styled.Arrow, {\n warning: warning,\n \"data-popper-arrow\": true,\n position: (handlePopperRef === null || handlePopperRef === void 0 || (_handlePopperRef$stat = handlePopperRef.state) === null || _handlePopperRef$stat === void 0 ? void 0 : _handlePopperRef$stat.placement) || initialPlacement\n })));\n };\n return /*#__PURE__*/createPortal(render(), target);\n});\nPopper.defaultProps = {};\nexport var propTypes = {\n anchorEl: PT.oneOfType([PT.instanceOf(Element), PT.object]),\n popperOptions: PT.shape({\n modifiers: PT.arrayOf(PT.shape({\n data: PT.object,\n effect: PT.func,\n enabled: PT.bool,\n fn: PT.func,\n name: PT.any.isRequired,\n options: PT.object,\n phase: PT.oneOf(['afterMain', 'afterRead', 'afterWrite', 'beforeMain', 'beforeRead', 'beforeWrite', 'main', 'read', 'write']),\n requires: PT.arrayOf(PT.string),\n requiresIfExists: PT.arrayOf(PT.string)\n })),\n onFirstUpdate: PT.func,\n placement: PT.oneOf(objectValues(Position)),\n strategy: PT.oneOf(objectValues(Strategy))\n }),\n overlay: PT.bool,\n warning: PT.bool,\n arrow: PT.bool,\n zIndex: PT.number,\n enableUnderlayingEvent: PT.bool,\n wrapperStyles: PT.object\n};\nPopper.propTypes = propTypes;\nexport default Popper;","import styled, { css, keyframes } from 'styled-components';\nimport { generateClassNames, applyDisplayNames, scrollBar } from '../../utils/functions';\nimport { Color as PColor } from '../../utils/types/palette';\nimport { BorderRadiusSize as BRSize } from '../../utils/types/shape';\nvar baseClassName = 'Menu';\nvar Overlay = /*#__PURE__*/styled.div.attrs({\n className: generateClassNames(baseClassName, 'Overlay')\n}).withConfig({\n componentId: \"sc-10okxhw-0\"\n})(function () {\n return css([\"position:fixed;right:0;bottom:0;top:0;left:0;background-color:transparent;z-index:-1;\"]);\n});\nvar opacityKeyframes = /*#__PURE__*/keyframes([\"from{opacity:0;}to{opacity:1;}\"]);\nvar transformKeyframes = /*#__PURE__*/keyframes([\"from{transform:scale(0.97);margin-top:0px;}to{transform:scale(1);margin-top:4px;}\"]);\nvar fadeInAnimation = /*#__PURE__*/css([\"animation:\", \" 250ms 0ms cubic-bezier(0.4,0,0.2,1),\", \" 250ms cubic-bezier(0.4,0,0.2,1);\"], opacityKeyframes, transformKeyframes);\nvar Menu = /*#__PURE__*/styled.div.attrs({\n className: generateClassNames(baseClassName, 'root')\n}).withConfig({\n componentId: \"sc-10okxhw-1\"\n})(function (_ref) {\n var rect = _ref.rect,\n theme = _ref.theme,\n scroll = _ref.scroll,\n _ref$maxHeight = _ref.maxHeight,\n maxHeight = _ref$maxHeight === void 0 ? '' : _ref$maxHeight;\n return css([\"min-width:\", \"px;width:195px;min-height:16px;overflow-x:hidden;overflow-y:auto;transition:opacity 250ms cubic-bezier(0.4,0,0,1),transform 250ms cubic-bezier(0.4,0,0,1),margin-top 250ms cubic-bezier(0.4,0,0,1);outline:0;box-shadow:0 2px 4px \", \";border-radius:\", \";\", \" \", \" margin-top:4px;\", \"\"], rect.width, theme.palette[PColor.MediumShadow], theme.shape.borderRadius[BRSize.Md], scroll && scrollBar, maxHeight && css([\"max-height:\", \";\"], Number.isNaN(+maxHeight) ? maxHeight : \"\".concat(maxHeight, \"px\")), fadeInAnimation);\n});\nvar Styled = applyDisplayNames({\n Menu: Menu,\n Overlay: Overlay\n});\nexport default Styled;","import _extends from \"@babel/runtime/helpers/extends\";\nimport _defineProperty from \"@babel/runtime/helpers/defineProperty\";\nimport _slicedToArray from \"@babel/runtime/helpers/slicedToArray\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/objectWithoutProperties\";\nvar _excluded = [\"id\", \"children\", \"open\", \"fullWidth\", \"anchorElPosition\", \"anchorEl\", \"onClose\", \"containerProps\", \"alignCenter\", \"maxHeight\", \"position\", \"popperOptions\", \"enableOverlay\", \"zIndex\", \"hideScroll\", \"scroll\", \"enableUnderlayingEvent\", \"popperWrapperStyles\"];\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nimport React, { useState, useEffect, useCallback, useRef } from 'react';\nimport PT from 'prop-types';\nimport { intrinsicComponent, objectValues } from '../../utils/functions';\nimport { propTypes as popperPropTypes } from '../popper/popper.component';\nimport { Position } from '../popper/types';\nimport Popper from '../popper';\nimport Styled from './menu.styles';\nvar Menu = intrinsicComponent(function (_ref, ref) {\n var id = _ref.id,\n children = _ref.children,\n open = _ref.open,\n fullWidth = _ref.fullWidth,\n anchorElPosition = _ref.anchorElPosition,\n anchorEl = _ref.anchorEl,\n onClose = _ref.onClose,\n containerProps = _ref.containerProps,\n alignCenter = _ref.alignCenter,\n maxHeight = _ref.maxHeight,\n position = _ref.position,\n popperOptions = _ref.popperOptions,\n _ref$enableOverlay = _ref.enableOverlay,\n enableOverlay = _ref$enableOverlay === void 0 ? true : _ref$enableOverlay,\n zIndex = _ref.zIndex,\n _ref$hideScroll = _ref.hideScroll,\n hideScroll = _ref$hideScroll === void 0 ? true : _ref$hideScroll,\n _ref$scroll = _ref.scroll,\n scroll = _ref$scroll === void 0 ? true : _ref$scroll,\n _ref$enableUnderlayin = _ref.enableUnderlayingEvent,\n enableUnderlayingEvent = _ref$enableUnderlayin === void 0 ? false : _ref$enableUnderlayin,\n _ref$popperWrapperSty = _ref.popperWrapperStyles,\n popperWrapperStyles = _ref$popperWrapperSty === void 0 ? {} : _ref$popperWrapperSty,\n rest = _objectWithoutProperties(_ref, _excluded);\n var _useState = useState(null),\n _useState2 = _slicedToArray(_useState, 2),\n timeout = _useState2[0],\n setTimeoutState = _useState2[1];\n var _useState3 = useState(new DOMRect()),\n _useState4 = _slicedToArray(_useState3, 2),\n rect = _useState4[0],\n setRect = _useState4[1];\n var menuRef = useRef(null);\n var updateRect = useCallback(function () {\n var _anchorEl$getBounding;\n var defaultPosition = _objectSpread({\n top: 0,\n left: 0,\n height: 0,\n width: 0\n }, anchorElPosition || {});\n var defaultRect = new DOMRect(defaultPosition.left, defaultPosition.top, defaultPosition.width, defaultPosition.height);\n setRect((_anchorEl$getBounding = anchorEl === null || anchorEl === void 0 ? void 0 : anchorEl.getBoundingClientRect()) !== null && _anchorEl$getBounding !== void 0 ? _anchorEl$getBounding : defaultRect);\n }, [open, timeout, anchorEl]);\n var handleWindowSizeChanged = useCallback(function () {\n if (open) {\n if (timeout) {\n clearTimeout(timeout);\n }\n setTimeoutState(setTimeout(updateRect, 300));\n }\n }, [open, timeout]);\n useEffect(function () {\n window.addEventListener('resize', handleWindowSizeChanged);\n return function () {\n window.removeEventListener('resize', handleWindowSizeChanged);\n };\n }, [handleWindowSizeChanged]);\n useEffect(function () {\n updateRect();\n }, [anchorElPosition, updateRect]);\n useEffect(function () {\n if (hideScroll) {\n if (open) {\n document.body.classList.add('Menu-open');\n updateRect();\n } else {\n document.body.classList.remove('Menu-open');\n }\n return function () {\n document.body.classList.remove('Menu-open');\n };\n }\n }, [open, updateRect]);\n var handleClose = function handleClose(event) {\n if (typeof onClose === 'function') {\n onClose(event);\n }\n };\n return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Popper, {\n ref: menuRef,\n position: position || 'bottom-start',\n open: Boolean(anchorEl),\n anchorEl: anchorEl,\n overlay: Boolean(enableOverlay),\n onClick: handleClose,\n popperOptions: popperOptions,\n zIndex: zIndex,\n enableUnderlayingEvent: enableUnderlayingEvent,\n wrapperStyles: popperWrapperStyles\n }, /*#__PURE__*/React.createElement(Styled.Menu, _extends({}, containerProps, {\n alignCenter: Boolean(alignCenter),\n scroll: scroll,\n rect: rect\n }, rest, {\n ref: ref,\n maxHeight: maxHeight\n }), children)));\n});\nexport var defaultProps = {\n open: false,\n containerProps: {},\n maxHeight: 250,\n position: Position.BottomStart,\n enableOverlay: true,\n hideScroll: true,\n scroll: true\n};\nMenu.defaultProps = defaultProps;\nexport var propTypes = {\n anchorElPosition: PT.shape({\n left: PT.number,\n right: PT.number,\n top: PT.number,\n bottom: PT.number\n }),\n anchorEl: PT.instanceOf(Element),\n open: PT.bool,\n fullWidth: PT.bool,\n onClose: PT.func,\n id: PT.string,\n containerProps: PT.object,\n alignCenter: PT.bool,\n maxHeight: PT.oneOfType([PT.string, PT.number]),\n popperOptions: popperPropTypes.popperOptions,\n position: PT.oneOf(objectValues(Position)),\n enableOverlay: PT.bool,\n zIndex: PT.number,\n hideScroll: PT.bool,\n scroll: PT.bool,\n enableUnderlayingEvent: PT.bool,\n popperWrapperStyles: PT.object,\n style: PT.object\n};\nMenu.propTypes = propTypes;\nexport default Menu;","export var Size = {\n Sm: 'sm',\n Md: 'md'\n};","import _defineProperty from \"@babel/runtime/helpers/defineProperty\";\nimport { css } from 'styled-components';\n// import type { With } from '../../utils/types';\n\n// import { Color as PaletteColor } from '../../utils/types/palette';\nimport { FontVariant as FV } from '../../utils/types/typography';\nimport { Size } from './types';\nexport var sizeMenuItemMixin = _defineProperty(_defineProperty({}, Size.Sm, function (_ref) {\n var font = _ref.theme.typography.font;\n return css([\"padding:8px 16px;min-height:32px;\", \"\"], font[FV.LabelMedium]);\n}), Size.Md, function (_ref2) {\n var font = _ref2.theme.typography.font;\n return css([\"padding:11px 16px;min-height:40px;\", \"\"], font[FV.LabelLarge]);\n});","import styled, { css } from 'styled-components';\nimport { generateClassNames, applyDisplayNames } from '../../utils/functions';\nimport { Color as PColor } from '../../utils/types/palette';\n// import { BorderRadiusSize as BRSize } from '../../utils/types/shape';\n\nimport { sizeMenuItemMixin } from './menu-item.mixin';\nimport { Size } from './types';\nvar baseClassName = 'MenuItem';\nvar Icon = /*#__PURE__*/styled.span.attrs({\n className: generateClassNames(baseClassName, 'Icon')\n}).withConfig({\n componentId: \"sc-rrzye0-0\"\n})(function (_ref) {\n var palette = _ref.theme.palette,\n disabled = _ref.disabled;\n return css([\"flex-shrink:0;margin-right:10px;color:\", \";\"], disabled ? palette[PColor.TextPlaceholder] : palette[PColor.IconsPrimary]);\n});\nvar Actions = /*#__PURE__*/styled(Icon).attrs({\n className: generateClassNames(baseClassName, 'Actions')\n}).withConfig({\n componentId: \"sc-rrzye0-1\"\n})(function () {\n return css([\"margin-right:0px;margin-left:16px;\"]);\n});\nvar Label = /*#__PURE__*/styled.span.attrs({\n className: generateClassNames(baseClassName, 'Label')\n}).withConfig({\n componentId: \"sc-rrzye0-2\"\n})([\"align-items:center;column-gap:4px;flex-grow:1;\"]);\nvar MenuItemWrapper = /*#__PURE__*/styled.div.attrs({\n className: generateClassNames(baseClassName, 'wrapper')\n}).withConfig({\n componentId: \"sc-rrzye0-3\"\n})(function (_ref2) {\n var _ref2$divider = _ref2.divider,\n divider = _ref2$divider === void 0 ? false : _ref2$divider,\n _ref2$noOptionsText = _ref2.noOptionsText,\n noOptionsText = _ref2$noOptionsText === void 0 ? false : _ref2$noOptionsText,\n _ref2$disabled = _ref2.disabled,\n disabled = _ref2$disabled === void 0 ? false : _ref2$disabled,\n theme = _ref2.theme;\n return css([\"\", \" \", \"\"], divider && css([\"width:100%;height:1px;background:\", \";box-sizing:border-box;\"], theme.palette[PColor.BordersSecondary]), (noOptionsText || disabled) && css([\"color:\", \";\"], theme.palette[PColor.ButtonDisabledText]));\n});\nvar MenuItem = /*#__PURE__*/styled.div.attrs({\n className: generateClassNames(baseClassName, 'root')\n}).withConfig({\n componentId: \"sc-rrzye0-4\"\n})(function (_ref3) {\n var _ref3$size = _ref3.size,\n size = _ref3$size === void 0 ? Size.Sm : _ref3$size,\n active = _ref3.active,\n theme = _ref3.theme,\n _ref3$disableHover = _ref3.disableHover,\n disableHover = _ref3$disableHover === void 0 ? false : _ref3$disableHover,\n noOptionsText = _ref3.noOptionsText,\n disabled = _ref3.disabled;\n return css([\"display:flex;justify-content:space-between;flex-direction:row;align-items:center;width:100%;background:\", \";color:\", \";cursor:pointer;box-sizing:border-box;transition:all 100ms ease-out;\", \" &:focus-within,&:focus,&:hover{\", \";\", \"}\", \"\"], theme.palette[active ? PColor.BackgroundActive : PColor.BackgroundSecondary], theme.palette[PColor.TextPrimary], sizeMenuItemMixin[size], !disableHover && \"background-color: \".concat(theme.palette[PColor.BackgroundHover]), (noOptionsText || disabled) && css([\"cursor:default;background-color:white;\"]), (noOptionsText || disabled) && css([\"& > svg{path{fill:\", \";}}color:\", \";\"], theme.palette[PColor.ButtonDisabledText], theme.palette[PColor.ButtonDisabledText]));\n});\nvar MenuPrefix = /*#__PURE__*/styled.div.attrs({\n className: generateClassNames(baseClassName, 'prefix')\n}).withConfig({\n componentId: \"sc-rrzye0-5\"\n})(function () {\n return css([\"display:flex;\"]);\n});\nvar MenuContent = /*#__PURE__*/styled.div.attrs({\n className: generateClassNames(baseClassName, 'content')\n}).withConfig({\n componentId: \"sc-rrzye0-6\"\n})(function () {\n return css([\"flex-grow:1;line-height:16px;\"]);\n});\nvar MenuSuffix = /*#__PURE__*/styled.div.attrs({\n className: generateClassNames(baseClassName, 'suffix')\n}).withConfig({\n componentId: \"sc-rrzye0-7\"\n})(function () {\n return css([\"display:flex;margin-left:8px;\"]);\n});\nvar Styled = applyDisplayNames({\n MenuItemWrapper: MenuItemWrapper,\n MenuItem: MenuItem,\n MenuPrefix: MenuPrefix,\n MenuContent: MenuContent,\n MenuSuffix: MenuSuffix,\n Label: Label,\n Icon: Icon,\n Actions: Actions\n});\nexport default Styled;","import _defineProperty from \"@babel/runtime/helpers/defineProperty\";\nimport _extends from \"@babel/runtime/helpers/extends\";\nimport _slicedToArray from \"@babel/runtime/helpers/slicedToArray\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/objectWithoutProperties\";\nvar _excluded = [\"list\", \"depth\", \"children\", \"disableHover\", \"noOptionsText\", \"disabled\", \"enableScrollIntoView\"];\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nimport React, { useRef, useEffect } from 'react';\nimport Arrow from '@scaleflex/icons/arrow';\nimport PT from 'prop-types';\nimport { intrinsicComponent, objectValues } from '../../utils/functions';\nimport Menu from '../menu';\nimport { Size } from './types';\nimport Styled from './menu-item.styles';\nvar MenuItem = intrinsicComponent(function (_ref, ref) {\n var list = _ref.list,\n _ref$depth = _ref.depth,\n depth = _ref$depth === void 0 ? 0 : _ref$depth,\n children = _ref.children,\n disableHover = _ref.disableHover,\n noOptionsText = _ref.noOptionsText,\n disabled = _ref.disabled,\n enableScrollIntoView = _ref.enableScrollIntoView,\n props = _objectWithoutProperties(_ref, _excluded);\n var menuItemRef = useRef(null);\n var _React$useState = React.useState(null),\n _React$useState2 = _slicedToArray(_React$useState, 2),\n anchorEl = _React$useState2[0],\n setAnchorEl = _React$useState2[1];\n var _React$useState3 = React.useState([]),\n _React$useState4 = _slicedToArray(_React$useState3, 2),\n selectedIds = _React$useState4[0],\n setSelectedIds = _React$useState4[1];\n var handleOpenMenu = function handleOpenMenu(event) {\n setAnchorEl(event.currentTarget);\n };\n var handleScroll = function handleScroll() {\n var _menuItemRef$current;\n (_menuItemRef$current = menuItemRef.current) === null || _menuItemRef$current === void 0 || _menuItemRef$current.scrollIntoView({\n behavior: 'auto',\n block: 'nearest'\n });\n };\n useEffect(function () {\n if (props.active && enableScrollIntoView) {\n handleScroll();\n }\n }, [props.active]);\n var handleSelectedId = function handleSelectedId(ev, selected, depthLevel) {\n var updatedArray = selectedIds.slice(0);\n updatedArray[depthLevel] = selected;\n setSelectedIds(updatedArray);\n handleOpenMenu(ev);\n };\n var handleCloseSubMenu = function handleCloseSubMenu(depthLevel) {\n var updatedArray = selectedIds.slice(0);\n updatedArray[depthLevel] = '';\n setSelectedIds(updatedArray);\n setAnchorEl(null);\n };\n var renderItems = function renderItems(options) {\n var depthLevel = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;\n return options.map(function (option) {\n var hasOptions = option.subList && option.subList.length > 0;\n var subMenu;\n if (selectedIds[depthLevel] === option.key && hasOptions) {\n var newDepthLevel = depthLevel + 1;\n subMenu = /*#__PURE__*/React.createElement(Menu, _extends({\n key: option.key,\n position: \"right\",\n open: Boolean(anchorEl),\n anchorEl: anchorEl,\n enableOverlay: false\n }, option.subMenuProps), /*#__PURE__*/React.createElement(MenuItem, _extends({\n list: option.subList,\n depth: newDepthLevel\n }, props)));\n }\n if (option.content === 'divider') {\n return /*#__PURE__*/React.createElement(Styled.MenuItemWrapper, {\n divider: true,\n key: option.key\n });\n }\n return /*#__PURE__*/React.createElement(Styled.MenuItemWrapper, _extends({\n disabled: false,\n key: option.key,\n onMouseLeave: function onMouseLeave() {\n return handleCloseSubMenu(depthLevel);\n }\n }, props), /*#__PURE__*/React.createElement(Styled.MenuItem, _extends({}, props, {\n className: option.className,\n ref: ref,\n active: Boolean(option.active),\n onClick: option.onClick ? function (event) {\n return option.onClick(_objectSpread({\n event: event\n }, props));\n } : undefined,\n onMouseEnter: function onMouseEnter(ev) {\n return handleSelectedId(ev, option.key, depthLevel);\n },\n disableHover: disableHover || option.disableHover\n }), option.prefix && /*#__PURE__*/React.createElement(Styled.MenuPrefix, null, typeof option.prefix === 'function' ? option.prefix(props) : option.prefix), option.content && /*#__PURE__*/React.createElement(Styled.MenuContent, null, typeof option.content === 'function' ? option.content(props) : option.content), (option.suffix || option.subList) && /*#__PURE__*/React.createElement(Styled.MenuSuffix, null, typeof option.suffix === 'function' ? option.suffix(props) : option.suffix, option.subList && /*#__PURE__*/React.createElement(Arrow, {\n size: 10,\n color: \"#768A9F\"\n }))), subMenu);\n });\n };\n if (!list) {\n if (props.value === 'divider') {\n return /*#__PURE__*/React.createElement(Styled.MenuItemWrapper, {\n divider: true,\n key: props.value\n });\n }\n return /*#__PURE__*/React.createElement(Styled.MenuItemWrapper, {\n noOptionsText: Boolean(noOptionsText),\n disabled: Boolean(disabled)\n }, /*#__PURE__*/React.createElement(Styled.MenuItem, _extends({}, props, {\n ref: menuItemRef,\n disableHover: disableHover,\n noOptionsText: noOptionsText,\n disabled: disabled\n }), children));\n }\n return /*#__PURE__*/React.createElement(React.Fragment, null, renderItems(list, depth));\n});\nMenuItem.displayName = 'MenuItem';\nexport var defaultProps = {\n size: Size.Sm,\n active: false\n};\nMenuItem.defaultProps = defaultProps;\nMenuItem.propTypes = {\n size: PT.oneOf(objectValues(Size)),\n children: PT.oneOfType([PT.node, PT.func]),\n active: PT.bool,\n value: PT.oneOfType([PT.string, PT.number, PT.bool, PT.oneOf([null])]),\n depth: PT.number,\n disableHover: PT.bool,\n noOptionsText: PT.bool,\n disabled: PT.bool,\n enableScrollIntoView: PT.bool\n};\nexport default MenuItem;\n// list: PT.arrayOf(\n// PT.shape({\n// key: PT.string.isRequired,\n// content: PT.oneOfType([PT.string, PT.node]).isRequired,\n// prefix: PT.oneOfType([PT.string, PT.node]),\n// subList: PT.arrayOf(PT.object),\n// suffix: PT.oneOfType([PT.string, PT.node]),\n// onClick: PT.func,\n// disabled: PT.bool,\n// })\n// ),","import _extends from \"@babel/runtime/helpers/extends\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/objectWithoutProperties\";\nvar _excluded = [\"children\", \"disabled\", \"size\"];\nimport React from 'react';\nimport PT from 'prop-types';\nimport { intrinsicComponent, objectValues } from '../../utils/functions';\nimport { Size } from './types';\nimport Styled from './menu-item.styles';\nvar getIconSize = function getIconSize(sizeName) {\n switch (sizeName) {\n case Size.Md:\n return 16;\n case Size.Sm:\n default:\n return 14;\n }\n};\nvar MenuItemIcon = intrinsicComponent(function (_ref, ref) {\n var children = _ref.children,\n disabled = _ref.disabled,\n _ref$size = _ref.size,\n size = _ref$size === void 0 ? Size.Md : _ref$size,\n rest = _objectWithoutProperties(_ref, _excluded);\n return /*#__PURE__*/React.createElement(Styled.Icon, _extends({\n disabled: disabled\n }, rest, {\n ref: ref\n }), children && typeof children === 'function' ? children({\n size: getIconSize(size)\n }) : children);\n});\nMenuItemIcon.defaultProps = {\n size: Size.Md\n};\nMenuItemIcon.propTypes = {\n size: PT.oneOf(objectValues(Size)),\n children: PT.oneOfType([PT.node, PT.func]).isRequired,\n disabled: PT.bool\n};\nexport default MenuItemIcon;","import _extends from \"@babel/runtime/helpers/extends\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/objectWithoutProperties\";\nvar _excluded = [\"children\"];\nimport React from 'react';\nimport { intrinsicComponent } from '../../utils/functions';\nimport Styled from './menu-item.styles';\nvar MenuItemLabel = intrinsicComponent(function (_ref, ref) {\n var children = _ref.children,\n rest = _objectWithoutProperties(_ref, _excluded);\n return /*#__PURE__*/React.createElement(Styled.Label, _extends({}, rest, {\n ref: ref\n }), children);\n});\nMenuItemLabel.displayName = 'MenuItemLabel';\nexport default MenuItemLabel;","import _extends from \"@babel/runtime/helpers/extends\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/objectWithoutProperties\";\nvar _excluded = [\"children\"];\nimport React from 'react';\nimport PT from 'prop-types';\nimport { intrinsicComponent, objectValues } from '../../utils/functions';\nimport { Size } from './types';\nimport Styled from './menu-item.styles';\nvar MenuItemActions = intrinsicComponent(function (_ref, ref) {\n var children = _ref.children,\n rest = _objectWithoutProperties(_ref, _excluded);\n return /*#__PURE__*/React.createElement(Styled.Actions, _extends({}, rest, {\n ref: ref\n }), children && typeof children === 'function' ? children({\n size: rest.size\n }) : children);\n});\nMenuItemActions.displayName = 'MenuItemActions';\nMenuItemActions.defaultProps = {\n size: Size.Md\n};\nMenuItemActions.propTypes = {\n size: PT.oneOf(objectValues(Size)),\n children: PT.oneOfType([PT.node, PT.func]).isRequired\n};\nexport default MenuItemActions;","import _extends from \"@babel/runtime/helpers/extends\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/objectWithoutProperties\";\nvar _excluded = [\"color\", \"size\"];\nimport React from 'react';\nimport { intrinsicComponent } from './utils/functions';\nexport var CrossOutline = intrinsicComponent(function (_ref, ref) {\n var _ref$color = _ref.color,\n color = _ref$color === void 0 ? 'currentColor' : _ref$color,\n _ref$size = _ref.size,\n size = _ref$size === void 0 ? 14 : _ref$size,\n rest = _objectWithoutProperties(_ref, _excluded);\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n ref: ref,\n width: size,\n height: size,\n viewBox: \"0 0 44 44\",\n fill: \"none\",\n xmlns: \"http://www.w3.org/2000/svg\"\n }, rest), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M43.3196 40.0403C44.2253 40.9461 44.2253 42.4146 43.3196 43.3204C42.4138 44.2262 40.9453 44.2262 40.0396 43.3204L21.9997 25.2802L3.95952 43.3207C3.05376 44.2264 1.58525 44.2264 0.679494 43.3207C-0.226258 42.4149 -0.226258 40.9464 0.679495 40.0406L18.7197 22.0001L0.679313 3.95941C-0.226437 3.05364 -0.226439 1.5851 0.679314 0.679328C1.58507 -0.226442 3.05358 -0.226443 3.95934 0.679328L21.9997 18.72L40.0398 0.679604C40.9455 -0.226163 42.414 -0.226165 43.3198 0.679605C44.2255 1.58537 44.2255 3.05392 43.3198 3.95969L25.2797 22.0001L43.3196 40.0403Z\",\n fill: color\n }));\n});\nexport default CrossOutline;","import _defineProperty from \"@babel/runtime/helpers/defineProperty\";\nimport { css } from 'styled-components';\nimport { FontVariant as FV } from '../../utils/types/typography';\nimport { InputSize } from '../../utils/types';\nexport var sizeHintMixin = _defineProperty(_defineProperty({}, InputSize.Sm, function (_ref) {\n var font = _ref.theme.typography.font;\n return css(font[FV.LabelExtraSmallUp]);\n}), InputSize.Md, function (_ref2) {\n var font = _ref2.theme.typography.font;\n return css(font[FV.LabelSmall]);\n});","import styled, { css } from 'styled-components';\nimport { generateClassNames, applyDisplayNames } from '../../utils/functions';\nimport { InputSize } from '../../utils/types';\nimport { Color as PColor } from '../../utils/types/palette';\nimport { sizeHintMixin } from './form-hint.mixin';\nvar baseClassName = 'FormHint';\nvar FormHint = /*#__PURE__*/styled.span.attrs({\n className: generateClassNames(baseClassName, 'root')\n}).withConfig({\n componentId: \"sc-1vu99sv-0\"\n})(function (_ref) {\n var _ref$size = _ref.size,\n size = _ref$size === void 0 ? InputSize.Md : _ref$size,\n _ref$error = _ref.error,\n error = _ref$error === void 0 ? false : _ref$error,\n _ref$disabled = _ref.disabled,\n disabled = _ref$disabled === void 0 ? false : _ref$disabled,\n theme = _ref.theme;\n return css([\"display:flex;align-items:center;color:\", \";\", \" \", \"\"], error ? theme.palette[PColor.Error] : theme.palette[PColor.TextSecondary], disabled && css([\"color:\", \";\"], theme.palette[PColor.ButtonDisabledText]), sizeHintMixin[size]);\n});\nvar Styled = applyDisplayNames({\n FormHint: FormHint\n});\nexport default Styled;","import _extends from \"@babel/runtime/helpers/extends\";\nimport React from 'react';\nimport PT from 'prop-types';\nimport { intrinsicComponent, objectValues } from '../../utils/functions';\nimport { InputSize } from '../../utils/types';\nimport Styled from './form-hint.styles';\nvar FormHint = intrinsicComponent(function (props, ref) {\n return /*#__PURE__*/React.createElement(Styled.FormHint, _extends({\n ref: ref\n }, props));\n});\nFormHint.defaultProps = {\n error: false\n};\nFormHint.propTypes = {\n error: PT.bool,\n size: PT.oneOf(objectValues(InputSize))\n};\nexport default FormHint;","import _defineProperty from \"@babel/runtime/helpers/defineProperty\";\nimport { css } from 'styled-components';\nimport { Color as PaletteColor } from '../../utils/types/palette';\nimport { BadgeColor } from '../../utils/types';\nexport var colorBadgeMixin = _defineProperty(_defineProperty(_defineProperty({}, BadgeColor.Primary, function (_ref) {\n var palette = _ref.theme.palette;\n return css([\"background-color:\", \";color:\", \";\"], palette[PaletteColor.AccentPrimary], palette[PaletteColor.ButtonPrimaryText]);\n}), BadgeColor.White, function (_ref2) {\n var palette = _ref2.theme.palette;\n return css([\"background-color:\", \";color:\", \";\"], palette[PaletteColor.ButtonPrimaryText], palette[PaletteColor.AccentPrimary]);\n}), BadgeColor.Secondary, function (_ref3) {\n var palette = _ref3.theme.palette;\n return css([\"background-color:\", \";color:\", \";\"], palette[PaletteColor.Accent_1_2_Opacity], palette[PaletteColor.TextPrimary]);\n});","import styled, { css } from 'styled-components';\nimport { generateClassNames, applyDisplayNames } from '../../utils/functions';\nimport { colorBadgeMixin } from './badge.mixin';\nvar baseClassName = 'Badge';\nvar defaultSize = 20;\nvar BadgeRoot = /*#__PURE__*/styled.span.attrs({\n className: generateClassNames(baseClassName, 'root')\n}).withConfig({\n componentId: \"sc-1rfm40m-0\"\n})([\"position:relative;display:inline-flex;flex-shrink:0;vertical-align:middle;\"]);\nvar Badge = /*#__PURE__*/styled.span.attrs({\n className: generateClassNames(baseClassName)\n}).withConfig({\n componentId: \"sc-1rfm40m-1\"\n})(function (_ref) {\n var size = _ref.size,\n _ref$color = _ref.color,\n color = _ref$color === void 0 ? 'secondary' : _ref$color,\n fontSize = _ref.fontSize,\n _ref$padding = _ref.padding,\n padding = _ref$padding === void 0 ? '0 6px' : _ref$padding,\n inline = _ref.inline;\n return css([\"\", \" display:flex;flex-wrap:wrap;flex-direction:row;justify-content:center;align-items:center;align-content:center;height:\", \"px;min-width:\", \"px;line-height:1;padding:\", \";font-size:\", \";box-sizing:border-box;transition:transform 225ms cubic-bezier(0.4,0,0.2,1) 0ms;border-radius:\", \"px;z-index:1;\", \"\"], inline ? '' : 'position: absolute;', size || defaultSize, size || defaultSize, typeof padding === 'number' ? \"\".concat(padding, \"px\") : padding, typeof fontSize === 'number' ? \"\".concat(fontSize, \"px\") : fontSize, (size || defaultSize) / 2, colorBadgeMixin[color]);\n});\nvar Styled = applyDisplayNames({\n BadgeRoot: BadgeRoot,\n Badge: Badge\n});\nexport default Styled;","import _objectWithoutProperties from \"@babel/runtime/helpers/objectWithoutProperties\";\nvar _excluded = [\"badgeContent\"];\nimport React from 'react';\nimport PT from 'prop-types';\nimport { intrinsicComponent, objectValues } from '../../utils/functions';\nimport { BadgeColor } from '../../utils/types';\nimport Styled from './badge.styles';\nvar Badge = intrinsicComponent(function (_ref, ref) {\n var badgeContent = _ref.badgeContent,\n rest = _objectWithoutProperties(_ref, _excluded);\n return /*#__PURE__*/React.createElement(Styled.BadgeRoot, {\n ref: ref\n }, /*#__PURE__*/React.createElement(Styled.Badge, rest, badgeContent));\n});\nBadge.defaultProps = {\n color: BadgeColor.Secondary,\n inline: false\n};\nBadge.propTypes = {\n color: PT.oneOf(objectValues(BadgeColor)),\n badgeContent: PT.node,\n size: PT.oneOfType([PT.number]),\n fontSize: PT.oneOfType([PT.number, PT.string]),\n padding: PT.oneOfType([PT.number, PT.string]),\n inline: PT.bool\n};\nexport default Badge;","import _extends from \"@babel/runtime/helpers/extends\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/objectWithoutProperties\";\nvar _excluded = [\"color\", \"size\"];\nimport React from 'react';\nimport { intrinsicComponent } from './utils/functions';\nexport var Spinner = intrinsicComponent(function (_ref, ref) {\n var _ref$color = _ref.color,\n color = _ref$color === void 0 ? 'currentColor' : _ref$color,\n _ref$size = _ref.size,\n size = _ref$size === void 0 ? 28 : _ref$size,\n rest = _objectWithoutProperties(_ref, _excluded);\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n ref: ref,\n width: size,\n height: size,\n viewBox: \"0 0 50 50\",\n fill: \"none\",\n xmlns: \"http://www.w3.org/2000/svg\"\n }, rest), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M41.3465 44.355C33.5656 50.7844 22.9687 51.6268 14.3708 47.3665L17.8949 44.4545C24.754 47.117 32.7424 46.1093 38.709 41.1792C44.6755 36.249 47.1546 28.6071 45.8085 21.3893L49.3325 18.4773C51.9291 27.6967 49.1274 37.9256 41.3465 44.355Z\",\n fill: color\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M36.1749 2.63356L32.6509 5.54555C25.821 2.91828 17.838 3.86187 11.8366 8.82088C5.87009 13.7511 3.42028 21.4282 4.7372 28.6107L1.21311 31.5227C-1.38344 22.3034 1.45314 12.0456 9.19916 5.64502C16.9801 -0.784402 27.5768 -1.62682 36.1749 2.63356Z\",\n fill: color\n }));\n});\nexport default Spinner;","import _extends from \"@babel/runtime/helpers/extends\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/objectWithoutProperties\";\nvar _excluded = [\"color\", \"size\"];\nimport React from 'react';\nimport { intrinsicComponent } from './utils/functions';\nexport var TwoArrowsRight = intrinsicComponent(function (_ref, ref) {\n var _ref$color = _ref.color,\n color = _ref$color === void 0 ? 'currentColor' : _ref$color,\n _ref$size = _ref.size,\n size = _ref$size === void 0 ? 14 : _ref$size,\n rest = _objectWithoutProperties(_ref, _excluded);\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n ref: ref,\n width: size,\n height: size,\n viewBox: \"0 0 12 12\",\n fill: \"none\",\n xmlns: \"http://www.w3.org/2000/svg\"\n }, rest), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M5.74299 0.152553C5.95998 -0.056404 6.30528 -0.0498885 6.51424 0.167105C6.7232 0.384099 6.71668 0.7294 6.49969 0.938357L1.43832 5.81227L6.51398 11.0759C6.72309 11.2928 6.71681 11.6381 6.49996 11.8472C6.28311 12.0563 5.9378 12.05 5.7287 11.8332L0.274151 6.1766C0.17369 6.07242 0.118752 5.93258 0.121433 5.78788C0.124113 5.64317 0.184193 5.50547 0.288444 5.40508L5.74299 0.152553Z\",\n fill: color\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M10.9549 0.152554C11.1719 -0.0564031 11.5172 -0.0498876 11.7262 0.167106C11.9351 0.3841 11.9286 0.729401 11.7116 0.938357L6.65023 5.81227L11.7259 11.0759C11.935 11.2928 11.9287 11.6381 11.7119 11.8472C11.495 12.0563 11.1497 12.05 10.9406 11.8332L5.48606 6.1766C5.3856 6.07242 5.33067 5.93258 5.33335 5.78788C5.33603 5.64317 5.39611 5.50547 5.50036 5.40508L10.9549 0.152554Z\",\n fill: color\n }));\n});\nexport default TwoArrowsRight;","import _extends from \"@babel/runtime/helpers/extends\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/objectWithoutProperties\";\nvar _excluded = [\"color\", \"size\"];\nimport React from 'react';\nimport { intrinsicComponent } from './utils/functions';\nexport var TwoArrowsLeft = intrinsicComponent(function (_ref, ref) {\n var _ref$color = _ref.color,\n color = _ref$color === void 0 ? 'currentColor' : _ref$color,\n _ref$size = _ref.size,\n size = _ref$size === void 0 ? 14 : _ref$size,\n rest = _objectWithoutProperties(_ref, _excluded);\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n ref: ref,\n width: size,\n height: size,\n viewBox: \"0 0 12 12\",\n fill: \"none\",\n xmlns: \"http://www.w3.org/2000/svg\"\n }, rest), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M6.25714 11.8474C6.04014 12.0564 5.69484 12.0499 5.48588 11.8329C5.27693 11.6159 5.28344 11.2706 5.50043 11.0616L10.5618 6.18773L5.48614 0.924074C5.27704 0.707224 5.28331 0.361919 5.50016 0.152813C5.71701 -0.0562931 6.06232 -0.0500145 6.27143 0.166835L11.726 5.8234C11.8264 5.92758 11.8814 6.06742 11.8787 6.21212C11.876 6.35683 11.8159 6.49453 11.7117 6.59492L6.25714 11.8474Z\",\n fill: color\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M1.04522 11.8474C0.828227 12.0564 0.482925 12.0499 0.273969 11.8329C0.065012 11.6159 0.0715275 11.2706 0.288521 11.0616L5.34989 6.18773L0.274227 0.924074C0.0651226 0.707224 0.0714006 0.361919 0.28825 0.152813C0.5051 -0.0562931 0.850407 -0.0500145 1.05951 0.166835L6.51406 5.8234C6.61452 5.92758 6.66946 6.06742 6.66678 6.21212C6.6641 6.35683 6.60402 6.49453 6.49977 6.59492L1.04522 11.8474Z\",\n fill: color\n }));\n});\nexport default TwoArrowsLeft;","export var ButtonType = {\n Default: 'default',\n Sidebar: 'sidebar'\n};","export var SideBar = {\n Left: 'left',\n Right: 'right'\n};","import { ButtonSize } from '../../utils/types';\nexport var getIconSize = function getIconSize(sizeName) {\n switch (sizeName) {\n case ButtonSize.Lg:\n return 18;\n case ButtonSize.Md:\n return 16;\n case ButtonSize.Sm:\n return 14;\n case ButtonSize.Xs:\n return 12;\n default:\n return 16;\n }\n};\nexport var getSideBarIconSize = function getSideBarIconSize(sizeName) {\n switch (sizeName) {\n case ButtonSize.Lg:\n return 12;\n case ButtonSize.Md:\n return 11;\n case ButtonSize.Sm:\n return 10;\n default:\n return 11;\n }\n};","import _defineProperty from \"@babel/runtime/helpers/defineProperty\";\nvar _colorButtonMixin;\nimport { css } from 'styled-components';\nimport StyledBadge from '../badge/badge.styles';\nimport { Color as PaletteColor } from '../../utils/types/palette';\nimport { FontVariant } from '../../utils/types/typography';\nimport { ButtonSize, ButtonColor } from '../../utils/types';\nexport var colorButtonMixin = (_colorButtonMixin = {}, _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_colorButtonMixin, ButtonColor.Primary, function (_ref) {\n var palette = _ref.theme.palette,\n active = _ref.active;\n return css([\"background-color:\", \";color:\", \";\", \"{color:\", \";background:transparent;}&:hover{background-color:\", \";}&:active{background-color:\", \";}\", \" &:disabled{color:\", \";background:\", \";cursor:default;\", \"{color:\", \";background:transparent;}}\"], palette[PaletteColor.AccentStateless], palette[PaletteColor.ButtonPrimaryText], StyledBadge.Badge, palette[PaletteColor.ButtonPrimaryText], palette[PaletteColor.AccentPrimaryHover], palette[PaletteColor.AccentPrimaryActive], active && css([\"background-color:\", \";&:hover,&:focus{background-color:\", \";}\"], palette[PaletteColor.AccentPrimaryActive], palette[PaletteColor.AccentPrimaryActive]), palette[PaletteColor.BordersDisabled], palette[PaletteColor.Accent_1_2_Opacity], StyledBadge.Badge, palette[PaletteColor.BordersDisabled]);\n}), ButtonColor.Secondary, function (_ref2) {\n var palette = _ref2.theme.palette,\n active = _ref2.active;\n return css([\"background-color:\", \";color:\", \";border:1px solid \", \";\", \"{color:\", \";background:transparent;}&:hover{color:\", \";background-color:\", \";\", \"{color:\", \";}}&:focus{color:\", \";background-color:\", \";border:1px solid \", \";\", \"{color:\", \";}}&:active{color:\", \";background-color:\", \";\", \"{color:\", \";}}\", \" &:disabled{color:\", \";background:\", \";border:none;cursor:default;\", \"{color:\", \";}}\"], palette[PaletteColor.BackgroundStateless], palette[PaletteColor.AccentStateless], palette[PaletteColor.AccentStateless], StyledBadge.Badge, palette[PaletteColor.AccentStateless], palette[PaletteColor.ButtonPrimaryText], palette[PaletteColor.AccentPrimaryHover], StyledBadge.Badge, palette[PaletteColor.ButtonPrimaryText], palette[PaletteColor.AccentPrimaryActive], palette[PaletteColor.Accent_1_2_Opacity], palette[PaletteColor.AccentPrimaryActive], StyledBadge.Badge, palette[PaletteColor.AccentPrimaryActive], palette[PaletteColor.ButtonPrimaryText], palette[PaletteColor.AccentPrimaryActive], StyledBadge.Badge, palette[PaletteColor.ButtonPrimaryText], active && css([\"color:\", \";background-color:\", \";\", \"{color:\", \";}&:hover,&:focus{color:\", \";background-color:\", \";\", \"{color:\", \";}}\"], palette[PaletteColor.ButtonPrimaryText], palette[PaletteColor.AccentPrimaryActive], StyledBadge.Badge, palette[PaletteColor.ButtonPrimaryText], palette[PaletteColor.ButtonPrimaryText], palette[PaletteColor.AccentPrimaryActive], StyledBadge.Badge, palette[PaletteColor.ButtonPrimaryText]), palette[PaletteColor.BordersDisabled], palette[PaletteColor.Accent_1_2_Opacity], StyledBadge.Badge, palette[PaletteColor.BordersDisabled]);\n}), ButtonColor.Basic, function (_ref3) {\n var palette = _ref3.theme.palette,\n active = _ref3.active;\n return css([\"background-color:transparent;border:1px solid \", \";color:\", \";\", \"{background-color:transparent;color:\", \";}&:hover{background-color:\", \";color:\", \";\", \"{color:\", \";}}&:active{background-color:\", \";color:\", \";\", \"{color:\", \";}}\", \" &:disabled{background-color:\", \";color:\", \";cursor:default;border:none;\", \"{color:\", \";}}\"], palette[PaletteColor.BordersButton], palette[PaletteColor.LinkStateless], StyledBadge.Badge, palette[PaletteColor.LinkStateless], palette[PaletteColor.BackgroundHover], palette[PaletteColor.LinkHover], StyledBadge.Badge, palette[PaletteColor.LinkHover], palette[PaletteColor.BackgroundActive], palette[PaletteColor.LinkHover], StyledBadge.Badge, palette[PaletteColor.LinkHover], active && css([\"background-color:\", \";color:\", \";\", \"{color:\", \";}&:hover,&:focus{background-color:\", \";color:\", \";}\"], palette[PaletteColor.BackgroundActive], palette[PaletteColor.LinkHover], StyledBadge.Badge, palette[PaletteColor.LinkHover], palette[PaletteColor.BackgroundActive], palette[PaletteColor.LinkHover]), palette[PaletteColor.Accent_1_2_Opacity], palette[PaletteColor.BordersDisabled], StyledBadge.Badge, palette[PaletteColor.BordersDisabled]);\n}), ButtonColor.LinkPrimary, function (_ref4) {\n var palette = _ref4.theme.palette,\n active = _ref4.active;\n return css([\"color:\", \";background-color:transparent;padding:0px !important;&:hover{background-color:transparent;color:\", \";}&:active{color:\", \";}\", \" &:disabled{background-color:transparent;color:\", \";cursor:default;}\"], palette[PaletteColor.AccentStateless], palette[PaletteColor.AccentPrimaryHover], palette[PaletteColor.AccentPrimaryActive], active && css([\"color:\", \";&:hover,&:focus{color:\", \";\"], palette[PaletteColor.AccentPrimaryActive], palette[PaletteColor.AccentPrimaryActive]), palette[PaletteColor.BordersDisabled]);\n}), ButtonColor.LinkSecondary, function (_ref5) {\n var palette = _ref5.theme.palette,\n active = _ref5.active;\n return css([\"color:\", \";background-color:transparent;padding:0px !important;&:hover{background-color:transparent;color:\", \";}&:active{color:\", \";}\", \" &:disabled{background-color:transparent;color:\", \";cursor:default;}\"], palette[PaletteColor.LinkStateless], palette[PaletteColor.AccentPrimaryHover], palette[PaletteColor.AccentPrimaryActive], active && css([\"color:\", \";&:hover,&:focus{color:\", \";}\"], palette[PaletteColor.AccentPrimaryActive], palette[PaletteColor.AccentPrimaryActive]), palette[PaletteColor.BordersDisabled]);\n}), ButtonColor.LinkBasicPrimary, function (_ref6) {\n var palette = _ref6.theme.palette,\n active = _ref6.active;\n return css([\"color:\", \";background-color:transparent;padding:0px !important;&:hover{background-color:transparent;color:\", \";}&:active{color:\", \";}\", \" &:disabled{background-color:transparent;color:\", \";cursor:default;}\"], palette[PaletteColor.AccentStateless], palette[PaletteColor.AccentPrimaryHover], palette[PaletteColor.AccentPrimaryActive], active && css([\"color:\", \";&:hover,&:focus{color:\", \";}\"], palette[PaletteColor.AccentPrimaryActive], palette[PaletteColor.AccentPrimaryActive]), palette[PaletteColor.BordersDisabled]);\n}), ButtonColor.LinkBasicSecondary, function (_ref7) {\n var palette = _ref7.theme.palette,\n active = _ref7.active;\n return css([\"color:\", \";background-color:transparent;padding:0px !important;&:hover{background-color:transparent;color:\", \";}&:active{color:\", \";}\", \" &:disabled{background-color:transparent;color:\", \";cursor:default;}\"], palette[PaletteColor.LinkStateless], palette[PaletteColor.AccentPrimaryHover], palette[PaletteColor.AccentPrimaryActive], active && css([\"color:\", \";&:hover,&:focus{color:\", \";}\"], palette[PaletteColor.AccentPrimaryActive], palette[PaletteColor.AccentPrimaryActive]), palette[PaletteColor.BordersDisabled]);\n}), ButtonColor.ErrorPrimary, function (_ref8) {\n var palette = _ref8.theme.palette,\n active = _ref8.active;\n return css([\"background-color:\", \";color:\", \";\", \"{color:\", \";background:transparent;}&:hover{background-color:\", \";}&:active{background-color:\", \";}\", \" &:disabled{background-color:\", \";color:\", \";cursor:default;\", \"{color:\", \";background:transparent;}}\"], palette[PaletteColor.Error], palette[PaletteColor.ButtonPrimaryText], StyledBadge.Badge, palette[PaletteColor.ButtonPrimaryText], palette[PaletteColor.ErrorHover], palette[PaletteColor.ErrorActive], active && css([\"background-color:\", \";&:hover,&:focus{background-color:\", \";}\"], palette[PaletteColor.ErrorActive], palette[PaletteColor.ErrorActive]), palette[PaletteColor.Accent_1_2_Opacity], palette[PaletteColor.BordersDisabled], StyledBadge.Badge, palette[PaletteColor.BordersDisabled]);\n}), ButtonColor.ErrorSecondary, function (_ref9) {\n var palette = _ref9.theme.palette,\n active = _ref9.active;\n return css([\"background-color:\", \";color:\", \";border:1px solid \", \";\", \"{color:\", \";background-color:transparent;}&:hover{background-color:\", \";color:\", \";border:none;\", \"{color:\", \";}}&:active{background-color:\", \";color:\", \";border:none;}\", \" &:disabled{color:\", \";background:\", \";border:none;cursor:default;\", \"{color:\", \";}}\"], palette[PaletteColor.BackgroundStateless], palette[PaletteColor.LinkStateless], palette[PaletteColor.BordersButton], StyledBadge.Badge, palette[PaletteColor.LinkStateless], palette[PaletteColor.ErrorHover], palette[PaletteColor.ButtonPrimaryText], StyledBadge.Badge, palette[PaletteColor.ButtonPrimaryText], palette[PaletteColor.ErrorActive], palette[PaletteColor.ButtonPrimaryText], active && css([\"background-color:\", \";color:\", \";border:none;&:hover,&:focus{background-color:\", \";}\"], palette[PaletteColor.ErrorActive], palette[PaletteColor.ButtonPrimaryText], palette[PaletteColor.ErrorActive]), palette[PaletteColor.BordersDisabled], palette[PaletteColor.Accent_1_2_Opacity], StyledBadge.Badge, palette[PaletteColor.BordersDisabled]);\n}), ButtonColor.ErrorBasic, function (_ref10) {\n var palette = _ref10.theme.palette,\n active = _ref10.active;\n return css([\"color:\", \";background-color:transparent;&:hover{color:\", \";}&:active{color:\", \";}\", \" &:disabled{color:\", \";cursor:default;}\"], palette[PaletteColor.LinkStateless], palette[PaletteColor.ErrorHover], palette[PaletteColor.ErrorActive], active && css([\"color:\", \";&:hover,&:focus{color:\", \";}\"], palette[PaletteColor.ErrorActive], palette[PaletteColor.ErrorActive]), palette[PaletteColor.BordersDisabled]);\n}), _defineProperty(_defineProperty(_defineProperty(_colorButtonMixin, ButtonColor.WarningPrimary, function (_ref11) {\n var palette = _ref11.theme.palette,\n active = _ref11.active;\n return css([\"background-color:\", \";color:\", \";\", \"{color:\", \";background:transparent;}&:hover{background-color:\", \";}&:active{background-color:\", \";}\", \" &:disabled{background-color:\", \";color:\", \";cursor:default;\", \"{color:\", \";background:transparent;}}\"], palette[PaletteColor.Warning], palette[PaletteColor.ButtonPrimaryText], StyledBadge.Badge, palette[PaletteColor.ButtonPrimaryText], palette[PaletteColor.WarningHover], palette[PaletteColor.WarningActive], active && css([\"background-color:\", \";&:hover,&:focus{background-color:\", \";}\"], palette[PaletteColor.WarningActive], palette[PaletteColor.WarningActive]), palette[PaletteColor.Accent_1_2_Opacity], palette[PaletteColor.BordersDisabled], StyledBadge.Badge, palette[PaletteColor.BordersDisabled]);\n}), ButtonColor.WarningSecondary, function (_ref12) {\n var palette = _ref12.theme.palette,\n active = _ref12.active;\n return css([\"background-color:\", \";color:\", \";border:1px solid \", \";\", \"{color:\", \";background-color:transparent;}&:hover{background-color:\", \";color:\", \";border:none;\", \"{color:\", \";}}&:active{background-color:\", \";color:\", \";border:none;}\", \" &:disabled{color:\", \";background:\", \";border:none;cursor:default;\", \"{color:\", \";}}\"], palette[PaletteColor.BackgroundStateless], palette[PaletteColor.LinkStateless], palette[PaletteColor.BordersButton], StyledBadge.Badge, palette[PaletteColor.LinkStateless], palette[PaletteColor.WarningHover], palette[PaletteColor.ButtonPrimaryText], StyledBadge.Badge, palette[PaletteColor.ButtonPrimaryText], palette[PaletteColor.WarningActive], palette[PaletteColor.ButtonPrimaryText], active && css([\"background-color:\", \";color:\", \";border:none;\", \"{color:\", \";background-color:transparent;}&:hover,&:focus{background-color:\", \";}\"], palette[PaletteColor.WarningActive], palette[PaletteColor.ButtonPrimaryText], StyledBadge.Badge, palette[PaletteColor.ButtonPrimaryText], palette[PaletteColor.WarningActive]), palette[PaletteColor.BordersDisabled], palette[PaletteColor.Accent_1_2_Opacity], StyledBadge.Badge, palette[PaletteColor.BordersDisabled]);\n}), ButtonColor.WarningBasic, function (_ref13) {\n var palette = _ref13.theme.palette,\n active = _ref13.active;\n return css([\"color:\", \";background-color:transparent;&:hover{color:\", \";}&:active{color:\", \";}\", \" &:disabled{color:\", \";cursor:default;}\"], palette[PaletteColor.LinkStateless], palette[PaletteColor.WarningHover], palette[PaletteColor.WarningActive], active && css([\"color:\", \";&:hover,&:focus{color:\", \";}\"], palette[PaletteColor.WarningActive], palette[PaletteColor.WarningActive]), palette[PaletteColor.BordersDisabled]);\n}));\nexport var sizeButtonMixin = _defineProperty(_defineProperty(_defineProperty(_defineProperty({}, ButtonSize.Xs, css([\"padding:5px 10px;\"])), ButtonSize.Sm, css([\"padding:8px 12px;\"])), ButtonSize.Md, css([\"padding:11px 16px;\"])), ButtonSize.Lg, css([\"padding:14px 24px;\"]));\nexport var sizeSecondaryButtonMixin = _defineProperty(_defineProperty(_defineProperty(_defineProperty({}, ButtonSize.Xs, css([\"padding:4px 10px;\"])), ButtonSize.Sm, css([\"padding:7px 12px;\"])), ButtonSize.Md, css([\"padding:10px 16px;\"])), ButtonSize.Lg, css([\"padding:13px 24px;\"]));\nexport var sizeSidebarMixin = _defineProperty(_defineProperty(_defineProperty(_defineProperty({}, ButtonSize.Xs, css([\"padding:5px 10px;\"])), ButtonSize.Sm, css([\"padding:8px 12px;\"])), ButtonSize.Md, css([\"padding:11px 14px;\"])), ButtonSize.Lg, css([\"padding:14px 16px;\"]));\nexport var sizeSidebarDividerMixin = _defineProperty(_defineProperty(_defineProperty(_defineProperty({}, ButtonSize.Xs, css([\"height:14px;\"])), ButtonSize.Sm, css([\"height:16px;\"])), ButtonSize.Md, css([\"height:18px;\"])), ButtonSize.Lg, css([\"height:20px;\"]));\nexport var paddingIconLabelMixin = _defineProperty(_defineProperty(_defineProperty(_defineProperty({}, ButtonSize.Xs, css([\"margin-right:5px;\"])), ButtonSize.Sm, css([\"margin-right:6px;\"])), ButtonSize.Md, css([\"margin-right:7px;\"])), ButtonSize.Lg, css([\"margin-right:8px;\"]));\nexport var sizeButtonLabelMixin = _defineProperty(_defineProperty(_defineProperty(_defineProperty({}, ButtonSize.Xs, function (_ref14) {\n var font = _ref14.theme.typography.font;\n return css(font[FontVariant.ButtonSm]);\n}), ButtonSize.Sm, function (_ref15) {\n var font = _ref15.theme.typography.font;\n return css(font[FontVariant.ButtonMd]);\n}), ButtonSize.Md, function (_ref16) {\n var font = _ref16.theme.typography.font;\n return css(font[FontVariant.ButtonLg]);\n}), ButtonSize.Lg, function (_ref17) {\n var font = _ref17.theme.typography.font;\n return css(font[FontVariant.ButtonLgUp]);\n});","import styled, { css } from 'styled-components';\nimport { generateClassNames, applyDisplayNames } from '../../utils/functions';\nimport { BorderRadiusSize as BRSize } from '../../utils/types/shape';\nimport { colorButtonMixin, sizeButtonMixin, sizeButtonLabelMixin, sizeSidebarMixin, sizeSidebarDividerMixin, paddingIconLabelMixin, sizeSecondaryButtonMixin } from './button.mixin';\nimport { Color as PaletteColor } from '../../utils/types/palette';\nimport { ButtonSize, ButtonColor } from '../../utils/types';\nimport { ButtonType, SideBar } from './types';\nvar baseClassName = 'Button';\nvar Label = /*#__PURE__*/styled.span.attrs({\n className: generateClassNames(baseClassName, 'Label')\n}).withConfig({\n componentId: \"sc-lxwit0-0\"\n})([\"display:flex;\"]);\nvar Badge = /*#__PURE__*/styled.span.attrs({\n className: generateClassNames(baseClassName, 'Badge')\n}).withConfig({\n componentId: \"sc-lxwit0-1\"\n})([\"display:flex;margin-left:5px;\"]);\nvar Wrapper = /*#__PURE__*/styled.span.attrs({\n className: generateClassNames(baseClassName, 'Body')\n}).withConfig({\n componentId: \"sc-lxwit0-2\"\n})(function () {\n return css([\"display:flex;align-items:center;\"]);\n});\nvar Button = /*#__PURE__*/styled.button.attrs({\n className: generateClassNames(baseClassName, 'root')\n}).withConfig({\n componentId: \"sc-lxwit0-3\"\n})(function (_ref) {\n var _ref$color = _ref.color,\n color = _ref$color === void 0 ? ButtonColor.Secondary : _ref$color,\n _ref$size = _ref.size,\n size = _ref$size === void 0 ? ButtonSize.Md : _ref$size,\n buttonType = _ref.buttonType,\n active = _ref.active,\n theme = _ref.theme;\n return css([\"display:inline-flex;flex-shrink:0;flex-direction:row;align-items:center;justify-content:center;border-radius:\", \";transition:all 100ms ease-out;border:0;cursor:pointer;outline:none;\", \" \", \" \", \" \", \"{\", \" \", \"}\", \"{\", \"}\", \"\"], theme.shape.borderRadius[BRSize.Md], buttonType !== ButtonType.Sidebar && colorButtonMixin[color], buttonType === ButtonType.Sidebar ? sizeSidebarMixin[size] : sizeButtonMixin[size], color === ButtonColor.Secondary && sizeSecondaryButtonMixin[size], Label, sizeButtonLabelMixin[size], (color === ButtonColor.LinkBasicPrimary || color === ButtonColor.LinkBasicSecondary) && \"font-weight: 400\", Badge, sizeButtonLabelMixin[size], buttonType === ButtonType.Sidebar && css([\"background-color:\", \";color:\", \";border:1px solid \", \";\", \" \", \" &:disabled{color:\", \";background:\", \";border:none;cursor:default;}\"], theme.palette[PaletteColor.ButtonPrimaryText], theme.palette[PaletteColor.LinkStateless], theme.palette[PaletteColor.BordersButton], !active && css([\"&:hover{color:\", \";background-color:\", \";border:none;}&:active{color:\", \";background-color:\", \";border:none;}\"], theme.palette[PaletteColor.ButtonPrimaryText], theme.palette[PaletteColor.AccentPrimaryHover], theme.palette[PaletteColor.ButtonPrimaryText], theme.palette[PaletteColor.AccentPrimaryActive]), active && css([\"background-color:\", \";color:\", \";border:1px solid \", \";\"], theme.palette[PaletteColor.Accent_1_2_Opacity], theme.palette[PaletteColor.AccentPrimaryActive], theme.palette[PaletteColor.AccentPrimaryActive]), theme.palette[PaletteColor.BordersDisabled], theme.palette[PaletteColor.AccentPrimaryDisabled]));\n});\nvar StartIcon = /*#__PURE__*/styled.span.attrs({\n className: generateClassNames(baseClassName, 'StartIcon')\n}).withConfig({\n componentId: \"sc-lxwit0-4\"\n})(function (_ref2) {\n var $loading = _ref2.$loading,\n _ref2$size = _ref2.size,\n size = _ref2$size === void 0 ? ButtonSize.Md : _ref2$size;\n return css([\"display:flex;svg{animation:\", \";}\", \"\"], $loading ? 'spinner 1.2s linear infinite' : '1.2s', paddingIconLabelMixin[size]);\n});\nvar SideArrows = /*#__PURE__*/styled.span.attrs({\n className: generateClassNames(baseClassName, 'SideBar')\n}).withConfig({\n componentId: \"sc-lxwit0-5\"\n})(function (_ref3) {\n var sideBarType = _ref3.sideBarType;\n return css([\"display:flex;\", \":12px;\"], \"margin-\".concat(sideBarType === SideBar.Left ? 'right' : 'left'));\n});\nvar Divider = /*#__PURE__*/styled.span.attrs({\n className: generateClassNames(baseClassName, 'Divider')\n}).withConfig({\n componentId: \"sc-lxwit0-6\"\n})(function (_ref4) {\n var sideBarType = _ref4.sideBarType,\n _ref4$size = _ref4.size,\n size = _ref4$size === void 0 ? ButtonSize.Md : _ref4$size;\n return css([\"border-left-style:solid;border-width:1px;\", \" \", \":12px;\"], sizeSidebarDividerMixin[size], \"margin-\".concat(sideBarType === SideBar.Left ? 'right' : 'left'));\n});\nvar EndIcon = /*#__PURE__*/styled.span.attrs({\n className: generateClassNames(baseClassName, 'EndIcon')\n}).withConfig({\n componentId: \"sc-lxwit0-7\"\n})([\"display:flex;margin-left:6px;\"]);\nvar Styled = applyDisplayNames({\n Button: Button,\n Wrapper: Wrapper,\n Label: Label,\n SideArrows: SideArrows,\n Divider: Divider,\n StartIcon: StartIcon,\n EndIcon: EndIcon,\n Badge: Badge\n});\nexport default Styled;","import _extends from \"@babel/runtime/helpers/extends\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/objectWithoutProperties\";\nvar _excluded = [\"children\", \"startIcon\", \"endIcon\", \"badge\", \"color\", \"active\", \"buttonType\", \"sideBarType\", \"size\", \"loading\", \"disabled\"];\nimport React from 'react';\nimport PT from 'prop-types';\nimport SpinnerIcon from '@scaleflex/icons/spinner';\nimport TwoArrowsRight from '@scaleflex/icons/two-arrows-right';\nimport TwoArrowsLeft from '@scaleflex/icons/two-arrows-left';\nimport { intrinsicComponent, objectValues } from '../../utils/functions';\nimport Badge from '../badge';\nimport { ButtonSize, ButtonColor } from '../../utils/types';\nimport { ButtonType, SideBar } from './types';\nimport { getIconSize, getSideBarIconSize } from './button.utils';\nimport Styled from './button.styles';\nvar Button = intrinsicComponent(function (_ref, ref) {\n var children = _ref.children,\n startIcon = _ref.startIcon,\n endIcon = _ref.endIcon,\n badge = _ref.badge,\n color = _ref.color,\n active = _ref.active,\n buttonType = _ref.buttonType,\n _ref$sideBarType = _ref.sideBarType,\n sideBarType = _ref$sideBarType === void 0 ? SideBar.Left : _ref$sideBarType,\n size = _ref.size,\n loading = _ref.loading,\n disabled = _ref.disabled,\n rest = _objectWithoutProperties(_ref, _excluded);\n var getSideBarArrows = function getSideBarArrows(props) {\n switch (sideBarType) {\n case SideBar.Right:\n return active ? /*#__PURE__*/React.createElement(TwoArrowsLeft, props) : /*#__PURE__*/React.createElement(TwoArrowsRight, props);\n case SideBar.Left:\n return active ? /*#__PURE__*/React.createElement(TwoArrowsRight, props) : /*#__PURE__*/React.createElement(TwoArrowsLeft, props);\n default:\n }\n };\n var getSideBarSection = function getSideBarSection() {\n var sideBarSection = [/*#__PURE__*/React.createElement(Styled.SideArrows, {\n key: \"arrows\",\n sideBarType: sideBarType\n }, getSideBarArrows({\n size: getSideBarIconSize(size)\n }))];\n var divider = /*#__PURE__*/React.createElement(Styled.Divider, {\n key: \"divider\",\n size: size,\n sideBarType: sideBarType\n });\n if (sideBarType === SideBar.Right) {\n sideBarSection.unshift(divider);\n } else {\n sideBarSection.push(divider);\n }\n return buttonType === ButtonType.Sidebar && sideBarSection;\n };\n return /*#__PURE__*/React.createElement(Styled.Button, _extends({\n type: \"button\",\n buttonType: buttonType\n }, rest, {\n disabled: loading || disabled,\n sideBarType: sideBarType,\n color: color,\n active: active,\n size: size,\n ref: ref\n }), sideBarType === SideBar.Left && getSideBarSection(), /*#__PURE__*/React.createElement(Styled.Wrapper, null, startIcon && /*#__PURE__*/React.createElement(Styled.StartIcon, {\n $loading: loading,\n size: size\n }, typeof startIcon === 'function' ? loading ? /*#__PURE__*/React.createElement(SpinnerIcon, {\n size: getIconSize(size)\n }) : startIcon({\n size: getIconSize(size)\n }) :\n // eslint-disable-next-line unicorn/no-nested-ternary\n loading ? /*#__PURE__*/React.createElement(SpinnerIcon, {\n size: getIconSize(size)\n }) : startIcon), loading && !startIcon && /*#__PURE__*/React.createElement(Styled.StartIcon, {\n $loading: loading\n }, /*#__PURE__*/React.createElement(SpinnerIcon, {\n size: getIconSize(size)\n })), /*#__PURE__*/React.createElement(Styled.Label, null, children), endIcon && /*#__PURE__*/React.createElement(Styled.EndIcon, null, typeof endIcon === 'function' ? endIcon({\n size: getIconSize(size)\n }) : endIcon)), sideBarType === SideBar.Right && getSideBarSection(), badge && /*#__PURE__*/React.createElement(Styled.Badge, null, /*#__PURE__*/React.createElement(Badge, {\n inline: true,\n size: 14,\n padding: \"0 1px\",\n badgeContent: badge,\n color: color === ButtonColor.Primary ? 'white' : 'secondary'\n })));\n});\nButton.defaultProps = {\n size: ButtonSize.Md,\n color: ButtonColor.Secondary,\n buttonType: ButtonType.Default,\n active: false\n};\nButton.propTypes = {\n size: PT.oneOf(objectValues(ButtonSize)),\n color: PT.oneOf(objectValues(ButtonColor)),\n buttonType: PT.oneOf(objectValues(ButtonType)),\n sideBarType: PT.oneOf(objectValues(SideBar)),\n startIcon: PT.oneOfType([PT.node, PT.func]),\n endIcon: PT.oneOfType([PT.node, PT.func]),\n badge: PT.node,\n active: PT.bool,\n loading: PT.bool,\n disabled: PT.bool\n};\nexport default Button;","import _extends from \"@babel/runtime/helpers/extends\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/objectWithoutProperties\";\nvar _excluded = [\"color\", \"size\"];\nimport React from 'react';\nimport { intrinsicComponent } from './utils/functions';\nexport var Image2 = intrinsicComponent(function (_ref, ref) {\n var _ref$color = _ref.color,\n color = _ref$color === void 0 ? 'currentColor' : _ref$color,\n _ref$size = _ref.size,\n size = _ref$size === void 0 ? 14 : _ref$size,\n rest = _objectWithoutProperties(_ref, _excluded);\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n ref: ref,\n width: size,\n height: size,\n viewBox: \"0 0 42 42\",\n fill: \"none\",\n xmlns: \"http://www.w3.org/2000/svg\"\n }, rest), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M0.483002 4.49014V37.5097C0.483002 38.5725 0.90519 39.5917 1.65669 40.3432C2.40819 41.0947 3.42745 41.5169 4.49023 41.5169H37.5098C38.5726 41.5169 39.5918 41.0947 40.3433 40.3432C41.0948 39.5917 41.517 38.5725 41.517 37.5097V4.49014C41.517 3.42735 41.0948 2.4081 40.3433 1.6566C39.5918 0.905099 38.5726 0.48291 37.5098 0.48291H4.49023C3.42745 0.48291 2.40819 0.905099 1.65669 1.6566C0.90519 2.4081 0.483002 3.42735 0.483002 4.49014ZM38.9272 5.87776V31.3044L26.3817 19.5446L21.8068 22.3356L14.8048 15.3337L3.07279 23.0543V6.06233C3.07279 5.2695 3.38775 4.50913 3.94836 3.94851C4.50898 3.38789 5.26935 3.07294 6.06218 3.07294H36.1222C36.8661 3.07294 37.5795 3.36844 38.1055 3.89444C38.6316 4.42044 38.9272 5.13385 38.9272 5.87776Z\",\n fill: color\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M30.4602 15.6943C33.066 15.6943 35.1784 13.5819 35.1784 10.976C35.1784 8.37021 33.066 6.25777 30.4602 6.25777C27.8543 6.25777 25.7419 8.37021 25.7419 10.976C25.7419 13.5819 27.8543 15.6943 30.4602 15.6943Z\",\n fill: color\n }));\n});\nexport default Image2;","import _extends from \"@babel/runtime/helpers/extends\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/objectWithoutProperties\";\nvar _excluded = [\"color\", \"size\"];\nimport React from 'react';\nimport { intrinsicComponent } from './utils/functions';\nexport var Undo = intrinsicComponent(function (_ref, ref) {\n var _ref$color = _ref.color,\n color = _ref$color === void 0 ? 'currentColor' : _ref$color,\n _ref$size = _ref.size,\n size = _ref$size === void 0 ? 14 : _ref$size,\n rest = _objectWithoutProperties(_ref, _excluded);\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n ref: ref,\n width: size,\n height: size,\n viewBox: \"0 0 40 50\",\n fill: \"none\",\n xmlns: \"http://www.w3.org/2000/svg\"\n }, rest), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M39.5112 31.2036C39.5112 41.568 31.0785 50 20.7148 50H14.0613C12.9587 50 12.0652 49.1066 12.0652 48.004V47.3386C12.0652 46.2359 12.9586 45.3425 14.0613 45.3425H20.7148C28.5107 45.3425 34.8537 38.9995 34.8537 31.2036C34.8537 23.4078 28.5107 17.0648 20.7148 17.0648H8.4394L16.8935 25.5189C17.8015 26.4266 17.8015 27.9042 16.8935 28.8119C16.0124 29.6923 14.479 29.691 13.5999 28.8119L1.17111 16.3828C0.731285 15.943 0.488892 15.3581 0.488892 14.7359C0.488892 14.1142 0.731285 13.529 1.17111 13.0894L13.6006 0.65976C14.4797 -0.220001 16.0144 -0.220001 16.8936 0.65976C17.8016 1.56722 17.8016 3.04511 16.8936 3.95246L8.43951 12.4072H20.7148C31.0785 12.4072 39.5112 20.8395 39.5112 31.2036Z\",\n fill: color\n }));\n});\nexport default Undo;","import _extends from \"@babel/runtime/helpers/extends\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/objectWithoutProperties\";\nvar _excluded = [\"color\", \"size\"];\nimport React from 'react';\nimport { intrinsicComponent } from './utils/functions';\nexport var Redo = intrinsicComponent(function (_ref, ref) {\n var _ref$color = _ref.color,\n color = _ref$color === void 0 ? 'currentColor' : _ref$color,\n _ref$size = _ref.size,\n size = _ref$size === void 0 ? 14 : _ref$size,\n rest = _objectWithoutProperties(_ref, _excluded);\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n ref: ref,\n width: size,\n height: size,\n viewBox: \"0 0 40 50\",\n fill: \"none\",\n xmlns: \"http://www.w3.org/2000/svg\"\n }, rest), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M0.98 31.2037C0.98 41.568 9.41216 50 19.7752 50H26.4284C27.5309 50 28.4244 49.1066 28.4244 48.004V47.3386C28.4244 46.2359 27.531 45.3425 26.4284 45.3425H19.7752C11.9798 45.3425 5.6372 38.9995 5.6372 31.2037C5.6372 23.4079 11.9798 17.0648 19.7752 17.0648H32.05L23.5964 25.5189C22.6884 26.4266 22.6884 27.9043 23.5964 28.812C24.4774 29.6924 26.0107 29.6911 26.8897 28.812L39.3178 16.3828C39.7576 15.943 40 15.3582 40 14.736C40 14.1142 39.7576 13.5291 39.3178 13.0895L26.8891 0.659821C26.01 -0.21994 24.4754 -0.21994 23.5962 0.659821C22.6883 1.56728 22.6883 3.04517 23.5962 3.95252L32.0498 12.4073H19.7752C9.41216 12.4073 0.98 20.8396 0.98 31.2037Z\",\n fill: color\n }));\n});\nexport default Redo;","import _extends from \"@babel/runtime/helpers/extends\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/objectWithoutProperties\";\nvar _excluded = [\"color\", \"size\"];\nimport React from 'react';\nimport { intrinsicComponent } from './utils/functions';\nexport var Line = intrinsicComponent(function (_ref, ref) {\n var _ref$color = _ref.color,\n color = _ref$color === void 0 ? 'currentColor' : _ref$color,\n _ref$size = _ref.size,\n size = _ref$size === void 0 ? 14 : _ref$size,\n rest = _objectWithoutProperties(_ref, _excluded);\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n ref: ref,\n width: size,\n height: size,\n viewBox: \"0 0 50 50\",\n fill: \"none\",\n xmlns: \"http://www.w3.org/2000/svg\"\n }, rest), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M40.1901 7.27549L7.59689 39.8687C6.83412 40.6315 6.83412 41.8681 7.59689 42.6308C8.35965 43.3936 9.59626 43.3936 10.359 42.6308L42.9522 10.0376C43.715 9.27486 43.715 8.03825 42.9522 7.27549C42.1895 6.51272 40.9529 6.51272 40.1901 7.27549Z\",\n fill: color\n }));\n});\nexport default Line;","import _extends from \"@babel/runtime/helpers/extends\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/objectWithoutProperties\";\nvar _excluded = [\"color\", \"size\"];\nimport React from 'react';\nimport { intrinsicComponent } from './utils/functions';\nexport var ImageFilters = intrinsicComponent(function (_ref, ref) {\n var _ref$color = _ref.color,\n color = _ref$color === void 0 ? 'currentColor' : _ref$color,\n _ref$size = _ref.size,\n size = _ref$size === void 0 ? 14 : _ref$size,\n rest = _objectWithoutProperties(_ref, _excluded);\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n ref: ref,\n width: size,\n height: size,\n viewBox: \"0 0 50 50\",\n fill: \"none\",\n xmlns: \"http://www.w3.org/2000/svg\"\n }, rest), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M41.2229 16.7653C41.3215 12.426 39.7436 8.284 36.6864 5.02956C33.6292 1.77513 29.4872 -2.09808e-05 25.0493 -2.09808e-05C20.6114 -2.09808e-05 16.3708 1.77513 13.3136 5.02956C10.2564 8.18538 8.6785 12.3274 8.77712 16.7653C3.45168 19.5266 0 25.1479 0 31.1637C0 37.2781 3.25444 42.6035 8.57988 45.4635C11.0454 46.7455 13.7081 47.4359 16.2722 47.4359C19.3294 47.4359 22.288 46.5483 24.9507 44.8718C29.9803 48.1262 36.0947 48.3234 41.4201 45.4635C46.7456 42.6035 50 37.2781 50 31.1637C50 25.0493 46.6469 19.5266 41.2229 16.7653ZM22.7811 43.0966C18.6391 45.3649 13.7081 45.3649 9.56607 42.998C5.22682 40.5325 2.66272 36.1933 2.66272 31.1637C2.66272 26.43 5.12821 22.0907 9.1716 19.6252C10.1578 24.359 13.3136 28.501 17.6529 30.6706C17.4556 35.4043 19.3294 39.8422 22.7811 43.0966ZM32.1499 27.8106C31.4596 24.5562 29.783 21.499 27.3176 19.2307C30.6706 17.357 34.8126 17.0611 38.4615 18.3432C37.7712 22.2879 35.503 25.7396 32.1499 27.8106ZM20.6114 28.1065C21.3018 25.2465 22.8797 22.6824 25.0493 20.8087C27.5148 22.8797 29.1913 25.8382 29.6844 28.9941C26.7258 30.0789 23.4714 30.0789 20.4142 28.9941C20.4142 28.6982 20.5128 28.4023 20.6114 28.1065ZM25.0493 17.4556C23.57 16.4694 21.8935 15.7791 20.1183 15.3846C19.428 15.1874 18.6391 15.6805 18.5404 16.3708C18.4418 16.7653 18.5404 17.0611 18.7377 17.357C18.9349 17.6528 19.2308 17.8501 19.5266 17.9487C20.7101 18.2446 21.7949 18.639 22.7811 19.2307C20.3156 21.499 18.6391 24.4576 17.9487 27.8106C14.5957 25.7396 12.2288 22.2879 11.6371 18.3432C11.9329 18.2446 12.1302 18.1459 12.426 18.0473C12.7219 17.9487 13.0178 17.7515 13.215 17.357C13.4122 17.0611 13.4122 16.6666 13.3136 16.3708C13.1164 15.6805 12.3274 15.286 11.6371 15.4832C11.5385 15.4832 11.5385 15.4832 11.4398 15.5818C11.8343 8.48124 17.7515 2.6627 25.0493 2.6627C32.3471 2.6627 38.2643 8.38262 38.6588 15.5818C34.0237 14.2012 28.9941 14.8915 25.0493 17.4556ZM29.783 31.7554C29.5858 35.5029 27.9093 39.0532 25.0493 41.5187C22.1893 39.0532 20.4142 35.6016 20.3156 31.7554C23.3728 32.7416 26.7258 32.7416 29.783 31.7554ZM32.4458 30.6706C36.785 28.4023 39.8422 24.359 40.927 19.6252C44.9704 22.0907 47.4359 26.43 47.4359 31.1637C47.4359 36.0947 44.8718 40.5325 40.5325 42.998C36.3905 45.3649 31.4596 45.3649 27.3176 43.0966C30.7692 39.8422 32.643 35.4043 32.4458 30.6706Z\",\n fill: color\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M15.5819 14.8915C14.9901 14.9901 14.497 15.5818 14.497 16.1735C14.497 16.8639 15.0888 17.5542 15.8777 17.5542C16.6667 17.5542 17.2584 16.9625 17.2584 16.1735C17.2584 15.7791 17.0611 15.3846 16.7653 15.1874C16.3708 14.9901 15.9763 14.8915 15.5819 14.8915Z\",\n fill: color\n }));\n});\nexport default ImageFilters;","import _extends from \"@babel/runtime/helpers/extends\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/objectWithoutProperties\";\nvar _excluded = [\"color\", \"size\"];\nimport React from 'react';\nimport { intrinsicComponent } from './utils/functions';\nexport var Crop = intrinsicComponent(function (_ref, ref) {\n var _ref$color = _ref.color,\n color = _ref$color === void 0 ? 'currentColor' : _ref$color,\n _ref$size = _ref.size,\n size = _ref$size === void 0 ? 14 : _ref$size,\n rest = _objectWithoutProperties(_ref, _excluded);\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n ref: ref,\n width: size,\n height: size,\n viewBox: \"0 0 50 50\",\n fill: \"none\",\n xmlns: \"http://www.w3.org/2000/svg\"\n }, rest), /*#__PURE__*/React.createElement(\"path\", {\n fillRule: \"evenodd\",\n clipRule: \"evenodd\",\n d: \"M5 2.00049C3.34315 2.00049 2 3.34364 2 5.00049V16.7505H5.5V5.50049H16.75V2.00049H5ZM45 2.00049H33.25V5.50049H44.5V16.7505H48V5.00049C48 3.34363 46.6569 2.00049 45 2.00049ZM5.5 33.2505H2V45.0005C2 46.6573 3.34315 48.0005 5 48.0005H16.75V44.5005H5.5V33.2505ZM48 33.2505H44.5V44.5005H33.25V48.0005H45C46.6569 48.0005 48 46.6573 48 45.0005V33.2505Z\",\n fill: color\n }));\n});\nexport default Crop;","import _extends from \"@babel/runtime/helpers/extends\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/objectWithoutProperties\";\nvar _excluded = [\"color\", \"size\"];\nimport React from 'react';\nimport { intrinsicComponent } from './utils/functions';\nexport var CropLandscape = intrinsicComponent(function (_ref, ref) {\n var _ref$color = _ref.color,\n color = _ref$color === void 0 ? 'currentColor' : _ref$color,\n _ref$size = _ref.size,\n size = _ref$size === void 0 ? 14 : _ref$size,\n rest = _objectWithoutProperties(_ref, _excluded);\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n ref: ref,\n width: size,\n height: size,\n viewBox: \"0 0 53 37\",\n fill: \"none\",\n xmlns: \"http://www.w3.org/2000/svg\"\n }, rest), /*#__PURE__*/React.createElement(\"path\", {\n fillRule: \"evenodd\",\n clipRule: \"evenodd\",\n d: \"M4.11841 3.93799V32.063H47.8684V3.93799H4.11841ZM3.49341 0.812988C2.1127 0.812988 0.993408 1.91229 0.993408 3.26835V32.7326C0.993408 34.0887 2.1127 35.188 3.49341 35.188H48.4934C49.8741 35.188 50.9934 34.0887 50.9934 32.7326V3.26835C50.9934 1.91229 49.8741 0.812988 48.4934 0.812988H3.49341Z\",\n fill: color\n }));\n});\nexport default CropLandscape;","import _extends from \"@babel/runtime/helpers/extends\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/objectWithoutProperties\";\nvar _excluded = [\"color\", \"size\"];\nimport React from 'react';\nimport { intrinsicComponent } from './utils/functions';\nexport var Resize = intrinsicComponent(function (_ref, ref) {\n var _ref$color = _ref.color,\n color = _ref$color === void 0 ? 'currentColor' : _ref$color,\n _ref$size = _ref.size,\n size = _ref$size === void 0 ? 14 : _ref$size,\n rest = _objectWithoutProperties(_ref, _excluded);\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n ref: ref,\n width: size,\n height: size,\n viewBox: \"0 0 50 50\",\n fill: \"none\",\n xmlns: \"http://www.w3.org/2000/svg\"\n }, rest), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M0.5 0.5H3V2.375H2.375V3H0.5V0.5Z\",\n fill: color\n }), /*#__PURE__*/React.createElement(\"path\", {\n fillRule: \"evenodd\",\n clipRule: \"evenodd\",\n d: \"M0.5 21.125H3V21.2693H24.7308V43H24.875V45.5L0.5 45.5001V21.125ZM22.2308 43L3 43.0001V23.7693H22.2308V43Z\",\n fill: color\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M43 45.5H45.5V43H43.625V43.625H43V45.5Z\",\n fill: color\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M45.5 3V0.5H43V2.375H43.625V3H45.5Z\",\n fill: color\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M6.125 0.5V3H9.875V0.5H6.125Z\",\n fill: color\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M13.625 0.5V3H17.375V0.5H13.625Z\",\n fill: color\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M21.125 0.5V3H24.875V0.5H21.125Z\",\n fill: color\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M28.625 0.5V3H32.375V0.5H28.625Z\",\n fill: color\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M36.125 0.5V3H39.875V0.5H36.125Z\",\n fill: color\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M45.5 6.125H43V9.875H45.5V6.125Z\",\n fill: color\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M45.5 13.625H43V17.375H45.5V13.625Z\",\n fill: color\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M45.5 21.125H43V24.875H45.5V21.125Z\",\n fill: color\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M45.5 28.625H43V32.375H45.5V28.625Z\",\n fill: color\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M45.5 36.125H43V39.875H45.5V36.125Z\",\n fill: color\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M39.875 45.5V43H36.125V45.5H39.875Z\",\n fill: color\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M32.375 45.5V43H28.625V45.5H32.375Z\",\n fill: color\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M0.5 17.375H3V13.625H0.5V17.375Z\",\n fill: color\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M0.5 9.875H3V6.125H0.5V9.875Z\",\n fill: color\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M35.1391 9.23718L26.3209 17.8619C25.8274 18.3446 25.8186 19.136 26.3013 19.6295C26.784 20.1231 27.5754 20.1319 28.069 19.6492L37.1012 10.815V16.9907C37.1012 17.681 37.6609 18.2407 38.3512 18.2407C39.0416 18.2407 39.6012 17.681 39.6012 16.9907V7.98718C39.6012 7.29683 39.0416 6.73718 38.3512 6.73718L29.3477 6.73718C28.6574 6.73718 28.0977 7.29683 28.0977 7.98718C28.0977 8.67754 28.6574 9.23718 29.3477 9.23718L35.1391 9.23718Z\",\n fill: color\n }));\n});\nexport default Resize;","import _extends from \"@babel/runtime/helpers/extends\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/objectWithoutProperties\";\nvar _excluded = [\"color\", \"size\"];\nimport React from 'react';\nimport { intrinsicComponent } from './utils/functions';\nexport var Watermark = intrinsicComponent(function (_ref, ref) {\n var _ref$color = _ref.color,\n color = _ref$color === void 0 ? 'currentColor' : _ref$color,\n _ref$size = _ref.size,\n size = _ref$size === void 0 ? 14 : _ref$size,\n rest = _objectWithoutProperties(_ref, _excluded);\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n ref: ref,\n width: size,\n height: size,\n viewBox: \"0 0 50 50\",\n fill: \"none\",\n xmlns: \"http://www.w3.org/2000/svg\"\n }, rest), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M42.1323 0.500031H2.73399C1.42693 0.500031 0.399963 1.527 0.399963 2.83406V43.166C0.399963 44.4731 1.42693 45.5 2.73399 45.5H42.1323C43.4394 45.5 44.4664 44.4731 44.4664 43.166V2.83406C44.4664 1.527 43.4394 0.500031 42.1323 0.500031ZM41.6655 3.30086V25.8942L36.624 21.693C36.1572 21.2262 35.4103 21.2262 34.8502 21.5996L28.595 26.2677L15.5244 11.2365C15.3377 10.9565 14.9643 10.7697 14.5908 10.7697C14.2174 10.7697 13.8439 10.9565 13.5639 11.1432L3.20079 21.693V3.30086H41.6655ZM3.20079 42.6992V39.8984C4.22776 40.3652 5.72154 40.832 7.58876 40.832C9.36262 40.832 10.483 40.2718 11.3232 39.805C12.0701 39.4316 12.5369 39.1515 13.3771 39.2448C14.3108 39.3382 14.8709 39.5249 15.4311 39.805C16.2713 40.0851 17.2049 40.4585 18.9788 40.4585V38.3112C17.6717 38.3112 17.0182 38.0312 16.178 37.7511C15.5244 37.471 14.6842 37.1909 13.5639 37.0975C12.0701 36.9108 11.1365 37.471 10.2962 37.8444C9.54934 38.2179 8.80245 38.5913 7.4954 38.5913C5.06801 38.5913 3.6676 37.7511 3.10743 37.2843V35.0436C4.1344 35.5104 5.62818 35.9772 7.4954 35.9772C9.26926 35.9772 10.3896 35.417 11.2298 34.9502C11.9767 34.5768 12.4435 34.2967 13.2838 34.3901C14.2174 34.4834 14.7776 34.6702 15.3377 34.9502C16.178 35.2303 17.1116 35.6038 18.8854 35.6038V33.4565C17.5784 33.4565 16.9249 33.1764 16.0846 32.8963C15.4311 32.6162 14.5908 32.3361 13.4705 32.2428C11.9767 32.056 11.0431 32.6162 10.2029 32.9897C9.45598 33.3631 8.70909 33.7365 7.40204 33.7365C4.97465 33.7365 3.57424 32.8963 3.01407 32.4295V30.1888C4.04104 30.6556 5.53482 31.1224 7.40204 31.1224C9.1759 31.1224 10.2962 30.5623 11.1365 30.0955C11.8834 29.722 12.3502 29.4419 13.1904 29.5353C14.124 29.6287 14.6842 29.8154 15.2444 30.0955C16.0846 30.3755 17.0182 30.749 18.7921 30.749V28.6017C17.485 28.6017 16.8315 28.3216 15.9912 28.0415C15.3377 27.7614 14.4975 27.4814 13.3771 27.388C11.8834 27.2013 10.9498 27.7614 10.1095 28.1349C9.36262 28.5083 8.61573 28.8818 7.30868 28.8818C4.88129 28.8818 3.48088 28.0415 2.92071 27.5747V25.7075L14.124 14.2241L27.1012 29.0685C27.568 29.6287 28.4083 29.722 28.9684 29.2552L35.4103 24.4004L41.3854 29.4419V42.6058H3.20079V42.6992Z\",\n fill: color\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M32.7029 15.7179C35.4103 15.7179 37.651 13.4772 37.651 10.7697C37.651 8.06227 35.4103 5.82161 32.7029 5.82161C29.9954 5.82161 27.7547 8.06227 27.7547 10.7697C27.7547 13.4772 29.9954 15.7179 32.7029 15.7179ZM32.7029 8.15563C34.1966 8.15563 35.317 9.36933 35.317 10.7697C35.317 12.1702 34.1033 13.3838 32.7029 13.3838C31.3025 13.3838 30.0888 12.1702 30.0888 10.7697C30.0888 9.36933 31.2091 8.15563 32.7029 8.15563Z\",\n fill: color\n }));\n});\nexport default Watermark;","import _extends from \"@babel/runtime/helpers/extends\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/objectWithoutProperties\";\nvar _excluded = [\"color\", \"size\"];\nimport React from 'react';\nimport { intrinsicComponent } from './utils/functions';\nexport var Images = intrinsicComponent(function (_ref, ref) {\n var _ref$color = _ref.color,\n color = _ref$color === void 0 ? 'currentColor' : _ref$color,\n _ref$size = _ref.size,\n size = _ref$size === void 0 ? 14 : _ref$size,\n rest = _objectWithoutProperties(_ref, _excluded);\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n ref: ref,\n width: size,\n height: size,\n viewBox: \"0 0 50 50\",\n fill: \"none\",\n xmlns: \"http://www.w3.org/2000/svg\"\n }, rest), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M43.4164 5.98527H1.06762C0.533808 5.98527 0 6.53674 0 7.08821V49C0 49.7353 0.533808 50.1029 1.06762 50.1029H43.4164C44.1281 50.1029 44.484 49.7353 44.484 49V7.08821C44.484 6.53674 44.1281 5.98527 43.4164 5.98527ZM35.7651 13.1544C37.9004 13.1544 39.5 15.0809 39.5 17.1029C39.5 19.3088 37.7224 20.6029 35.7651 20.6029C33.8078 20.6029 32 19.125 32 17.1029C31.8221 14.897 33.6299 13.1544 35.7651 13.1544ZM1.9573 45.875C2.13523 45.6912 14.2349 30.9853 16.548 27.8603C16.726 27.4926 17.2598 27.4926 17.4377 27.8603L29.7153 43.4853L35.0534 37.4191C35.4093 37.0514 35.7651 37.2353 35.9431 37.4191L42.5267 45.875H1.9573Z\",\n fill: color\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M48.9164 -3.8147e-06H6.74555C6.03381 -3.8147e-06 5.5 0.367643 5.5 1.10294V4.29294H7.5V2.20588H47.6892V39H46.2473V44.1176H48.9164C49.6281 44.1176 49.984 43.75 49.984 43.0147V1.10294C49.984 0.367643 49.6281 -3.8147e-06 48.9164 -3.8147e-06Z\",\n fill: color\n }));\n});\nexport default Images;","import _extends from \"@babel/runtime/helpers/extends\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/objectWithoutProperties\";\nvar _excluded = [\"color\", \"size\"];\nimport React from 'react';\nimport { intrinsicComponent } from './utils/functions';\nexport var Reset = intrinsicComponent(function (_ref, ref) {\n var _ref$color = _ref.color,\n color = _ref$color === void 0 ? 'currentColor' : _ref$color,\n _ref$size = _ref.size,\n size = _ref$size === void 0 ? 14 : _ref$size,\n rest = _objectWithoutProperties(_ref, _excluded);\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n ref: ref,\n width: size,\n height: size,\n viewBox: \"0 0 52 52\",\n fill: \"none\",\n xmlns: \"http://www.w3.org/2000/svg\"\n }, rest), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M25 0C38.8071 0 50 11.1929 50 25C50 38.807 38.8071 50 25 50C14.111 50 4.854 43.0397 1.42326 33.333C0.963005 32.0312 1.6455 30.603 2.94725 30.143C4.249 29.6828 5.67725 30.365 6.1375 31.667C8.88425 39.4382 16.2957 45 25 45C36.0457 45 45 36.0457 45 25C45 13.9543 36.0457 5 25 5C21.121 5 17.8345 6.40292 14.7095 8.6015C12.6078 10.0803 10.663 11.8526 8.6895 13.75H16.25C17.6308 13.75 18.75 14.8693 18.75 16.25C18.75 17.6307 17.6308 18.75 16.25 18.75H2.5C1.11926 18.75 0 17.6307 0 16.25V2.5C0 1.1193 1.11926 0 2.5 0C3.88075 0 5 1.1193 5 2.5V10.3593C7.12075 8.31457 9.38601 6.23342 11.8325 4.51222C15.5128 1.9229 19.7882 0 25 0Z\",\n fill: color\n }));\n});\nexport default Reset;","import _extends from \"@babel/runtime/helpers/extends\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/objectWithoutProperties\";\nvar _excluded = [\"color\", \"size\"];\nimport React from 'react';\nimport { intrinsicComponent } from './utils/functions';\nexport var Text = intrinsicComponent(function (_ref, ref) {\n var _ref$color = _ref.color,\n color = _ref$color === void 0 ? 'currentColor' : _ref$color,\n _ref$size = _ref.size,\n size = _ref$size === void 0 ? 14 : _ref$size,\n rest = _objectWithoutProperties(_ref, _excluded);\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n ref: ref,\n width: size,\n height: size,\n viewBox: \"0 0 50 50\",\n fill: \"none\",\n xmlns: \"http://www.w3.org/2000/svg\"\n }, rest), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M39.4229 8.89453L39.7891 16.6582H38.8613C38.6823 15.291 38.4382 14.3145 38.1289 13.7285C37.6243 12.7845 36.9489 12.0928 36.1025 11.6533C35.2725 11.1976 34.1738 10.9697 32.8066 10.9697H28.1436V36.2627C28.1436 38.2972 28.3633 39.5667 28.8027 40.0713C29.4212 40.7549 30.3734 41.0967 31.6592 41.0967H32.8066V42H18.7686V41.0967H19.9404C21.3402 41.0967 22.333 40.6735 22.9189 39.8271C23.277 39.3063 23.4561 38.1182 23.4561 36.2627V10.9697H19.4766C17.9303 10.9697 16.8317 11.0837 16.1807 11.3115C15.3343 11.6208 14.61 12.2148 14.0078 13.0938C13.4056 13.9727 13.0475 15.1608 12.9336 16.6582H12.0059L12.3965 8.89453H39.4229Z\",\n fill: color\n }));\n});\nexport default Text;","import _extends from \"@babel/runtime/helpers/extends\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/objectWithoutProperties\";\nvar _excluded = [\"color\", \"size\"];\nimport React from 'react';\nimport { intrinsicComponent } from './utils/functions';\nexport var TextAlignLeft = intrinsicComponent(function (_ref, ref) {\n var _ref$color = _ref.color,\n color = _ref$color === void 0 ? 'currentColor' : _ref$color,\n _ref$size = _ref.size,\n size = _ref$size === void 0 ? 14 : _ref$size,\n rest = _objectWithoutProperties(_ref, _excluded);\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n ref: ref,\n width: size,\n height: size,\n viewBox: \"0 0 45 29\",\n fill: \"none\",\n xmlns: \"http://www.w3.org/2000/svg\"\n }, rest), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M0 1.89502C0 1.20466 0.559644 0.64502 1.25 0.64502H28.75C29.4404 0.64502 30 1.20466 30 1.89502C30 2.58538 29.4404 3.14502 28.75 3.14502H1.25C0.559645 3.14502 0 2.58538 0 1.89502Z\",\n fill: color\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M0 14.395C0 13.7047 0.559644 13.145 1.25 13.145H43.75C44.4404 13.145 45 13.7047 45 14.395C45 15.0854 44.4404 15.645 43.75 15.645H1.25C0.559645 15.645 0 15.0854 0 14.395Z\",\n fill: color\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M1.25 25.645C0.559644 25.645 0 26.2047 0 26.895C0 27.5854 0.559645 28.145 1.25 28.145H28.75C29.4404 28.145 30 27.5854 30 26.895C30 26.2047 29.4404 25.645 28.75 25.645H1.25Z\",\n fill: color\n }));\n});\nexport default TextAlignLeft;","import _extends from \"@babel/runtime/helpers/extends\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/objectWithoutProperties\";\nvar _excluded = [\"color\", \"size\"];\nimport React from 'react';\nimport { intrinsicComponent } from './utils/functions';\nexport var TextAlignCenter = intrinsicComponent(function (_ref, ref) {\n var _ref$color = _ref.color,\n color = _ref$color === void 0 ? 'currentColor' : _ref$color,\n _ref$size = _ref.size,\n size = _ref$size === void 0 ? 14 : _ref$size,\n rest = _objectWithoutProperties(_ref, _excluded);\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n ref: ref,\n width: size,\n height: size,\n viewBox: \"0 0 46 28\",\n fill: \"none\",\n xmlns: \"http://www.w3.org/2000/svg\"\n }, rest), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M38 1.50049C38 0.810132 37.4404 0.250488 36.75 0.250488H9.25C8.55964 0.250488 8 0.810132 8 1.50049C8 2.19084 8.55964 2.75049 9.25 2.75049H36.75C37.4404 2.75049 38 2.19084 38 1.50049Z\",\n fill: color\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M45.5 14.0005C45.5 13.3101 44.9404 12.7505 44.25 12.7505H1.75C1.05964 12.7505 0.5 13.3101 0.5 14.0005C0.5 14.6908 1.05964 15.2505 1.75 15.2505H44.25C44.9404 15.2505 45.5 14.6908 45.5 14.0005Z\",\n fill: color\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M36.75 25.2505C37.4404 25.2505 38 25.8101 38 26.5005C38 27.1908 37.4404 27.7505 36.75 27.7505H9.25C8.55964 27.7505 8 27.1908 8 26.5005C8 25.8101 8.55964 25.2505 9.25 25.2505H36.75Z\",\n fill: color\n }));\n});\nexport default TextAlignCenter;","import _extends from \"@babel/runtime/helpers/extends\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/objectWithoutProperties\";\nvar _excluded = [\"color\", \"size\"];\nimport React from 'react';\nimport { intrinsicComponent } from './utils/functions';\nexport var RotationLeft = intrinsicComponent(function (_ref, ref) {\n var _ref$color = _ref.color,\n color = _ref$color === void 0 ? 'currentColor' : _ref$color,\n _ref$size = _ref.size,\n size = _ref$size === void 0 ? 14 : _ref$size,\n rest = _objectWithoutProperties(_ref, _excluded);\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n ref: ref,\n width: size,\n height: size,\n viewBox: \"0 0 45 43\",\n fill: \"none\",\n xmlns: \"http://www.w3.org/2000/svg\"\n }, rest), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M2.66027 14.6997L3.59752 14.4437L3.09232 3.93218C3.05918 3.24262 2.47331 2.71049 1.78375 2.74363C1.09419 2.77677 0.562061 3.36263 0.595202 4.05219L1.16041 15.8123C1.19355 16.5018 1.77942 17.034 2.46898 17.0008L14.2291 16.4356C14.9186 16.4025 15.4508 15.8166 15.4176 15.1271C15.3845 14.4375 14.7986 13.9054 14.1091 13.9385L5.48447 14.353C8.23224 7.41077 15.0052 2.50049 22.925 2.50049C33.2802 2.50049 41.6748 10.8951 41.6748 21.2503C41.6748 22.4035 41.5706 23.5324 41.3713 24.6281L43.7968 25.261C44.0449 23.9622 44.1748 22.6214 44.1748 21.2503C44.1748 9.51435 34.6609 0.000488281 22.925 0.000488281C15.0467 0.000488281 8.16974 4.28779 4.50001 10.6566L2.66027 14.6997Z\",\n fill: color\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M9.88491 34.708L8.27773 36.6309C8.82614 37.1539 9.40248 37.6479 10.0043 38.1103L11.5276 36.128C10.9528 35.6863 10.4043 35.2121 9.88491 34.708Z\",\n fill: color\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M12.3142 39.6567C13.9038 40.5764 15.6235 41.2961 17.439 41.7814L18.0846 39.3662C16.4846 38.9385 14.9685 38.3041 13.5662 37.4928L12.3142 39.6567Z\",\n fill: color\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M20.1654 42.3209C21.0738 42.4394 22.0002 42.5005 22.9408 42.5005C23.8815 42.5005 24.8079 42.4394 25.7162 42.3209L25.3929 39.8419C24.5915 39.9465 23.7731 40.0005 22.9408 40.0005C22.1086 40.0005 21.2902 39.9465 20.4888 39.8419L20.1654 42.3209Z\",\n fill: color\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M28.4427 41.7814C30.2582 41.2961 31.9779 40.5764 33.5674 39.6567L32.3154 37.4928C30.9132 38.3041 29.397 38.9385 27.7971 39.3662L28.4427 41.7814Z\",\n fill: color\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M35.8774 38.1103C37.3494 36.9791 38.6692 35.6594 39.8004 34.1873L37.8181 32.664C36.8193 33.9638 35.6538 35.1292 34.354 36.128L35.8774 38.1103Z\",\n fill: color\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M41.3468 31.8773C42.2665 30.2878 42.9862 28.5681 43.4715 26.7526L41.0563 26.107C40.6286 27.707 39.9942 29.2231 39.1829 30.6253L41.3468 31.8773Z\",\n fill: color\n }));\n});\nexport default RotationLeft;","import _extends from \"@babel/runtime/helpers/extends\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/objectWithoutProperties\";\nvar _excluded = [\"color\", \"size\"];\nimport React from 'react';\nimport { intrinsicComponent } from './utils/functions';\nexport var RotationRight = intrinsicComponent(function (_ref, ref) {\n var _ref$color = _ref.color,\n color = _ref$color === void 0 ? 'currentColor' : _ref$color,\n _ref$size = _ref.size,\n size = _ref$size === void 0 ? 14 : _ref$size,\n rest = _objectWithoutProperties(_ref, _excluded);\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n ref: ref,\n width: size,\n height: size,\n viewBox: \"0 0 50 50\",\n fill: \"none\",\n xmlns: \"http://www.w3.org/2000/svg\"\n }, rest), /*#__PURE__*/React.createElement(\"g\", {\n clipPath: \"url(#clip0)\"\n }, /*#__PURE__*/React.createElement(\"path\", {\n d: \"M50.2753 26.8064H24.4689L36.5656 14.7096C32.735 11.0806 28.7027 9.66933 23.6624 9.66933C13.3802 9.66933 6.32372 15.3145 3.50118 25.5967L0.275391 24.7903C3.50118 13.0968 11.9689 6.44355 23.6625 6.44355C29.7109 6.44355 34.348 8.25806 38.9851 12.2903L50.2754 1L50.2753 26.8064Z\",\n fill: color\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M34.5495 46.3628L33.1382 44.3467C33.743 43.9435 34.3479 43.3386 34.9527 42.9355L36.5656 44.75C35.9608 45.1532 35.3559 45.758 34.5495 46.3628Z\",\n fill: color\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M27.2913 49.387C26.6865 49.5886 26.0817 49.5886 25.4768 49.7903L25.0736 47.3709C26.4848 47.1693 27.8962 46.7661 29.3074 46.3628L30.1139 48.5806C29.1058 48.9838 28.2994 49.1854 27.2913 49.387ZM20.4365 49.9919C18.8235 49.7903 17.2107 49.5886 15.5978 48.9838L16.4042 46.766C17.8155 47.1693 19.2268 47.5724 20.6381 47.5724L20.4365 49.9919ZM11.1623 46.9677C9.75104 46.1612 8.33971 45.1532 7.13003 43.9435L8.74296 42.129C9.75104 43.137 10.9607 43.9435 12.372 44.7499L11.1623 46.9677ZM3.90425 40.3144C2.89617 38.9032 2.08974 37.2903 1.6865 35.879L3.90425 35.0726C4.50909 36.4838 5.11393 37.6935 5.92036 38.9032L3.90425 40.3144Z\",\n fill: color\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M3.2996 30.0322L0.880241 30.2338C0.678647 29.2257 0.678647 28.4193 0.678647 27.4112H3.09801C3.09801 28.4193 3.2996 29.2258 3.2996 30.0322Z\",\n fill: color\n })), /*#__PURE__*/React.createElement(\"defs\", null, /*#__PURE__*/React.createElement(\"rect\", {\n width: \"50\",\n height: \"50\",\n fill: \"white\",\n transform: \"translate(0.275391)\"\n })));\n});\nexport default RotationRight;","import _extends from \"@babel/runtime/helpers/extends\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/objectWithoutProperties\";\nvar _excluded = [\"color\", \"size\"];\nimport React from 'react';\nimport { intrinsicComponent } from './utils/functions';\nexport var LockOutline = intrinsicComponent(function (_ref, ref) {\n var _ref$color = _ref.color,\n color = _ref$color === void 0 ? 'currentColor' : _ref$color,\n _ref$size = _ref.size,\n size = _ref$size === void 0 ? 14 : _ref$size,\n rest = _objectWithoutProperties(_ref, _excluded);\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n ref: ref,\n width: size,\n height: size,\n viewBox: \"0 0 51 51\",\n fill: \"none\",\n xmlns: \"http://www.w3.org/2000/svg\"\n }, rest), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M40.5 20H38V12.5C38 5.6 32.4 0 25.5 0C18.6 0 13 5.6 13 12.5V20H10.5C9.1 20 8 21.1 8 22.5V47.5C8 48.9 9.1 50 10.5 50H40.5C41.9 50 43 48.9 43 47.5V22.5C43 21.1 41.9 20 40.5 20ZM15.5 12.5C15.5 7 20 2.5 25.5 2.5C31 2.5 35.5 7 35.5 12.5V20H15.5V12.5ZM40.5 47.5H10.5V22.5H40.5V47.5Z\",\n fill: color\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M24.3 37.3V41.3H26.8V37.3C28.3 36.8 29.3 35.4 29.3 33.8C29.3 31.7 27.6 30 25.5 30C23.4 30 21.7 31.7 21.7 33.8C21.8 35.4 22.8 36.8 24.3 37.3ZM25.5 32.5C26.2 32.5 26.8 33.1 26.8 33.8C26.8 34.5 26.2 35.1 25.5 35.1C24.8 35.1 24.2 34.5 24.2 33.8C24.3 33.1 24.8 32.5 25.5 32.5Z\",\n fill: color\n }));\n});\nexport default LockOutline;","import _extends from \"@babel/runtime/helpers/extends\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/objectWithoutProperties\";\nvar _excluded = [\"color\", \"size\"];\nimport React from 'react';\nimport { intrinsicComponent } from './utils/functions';\nexport var UnlockOutline = intrinsicComponent(function (_ref, ref) {\n var _ref$color = _ref.color,\n color = _ref$color === void 0 ? 'currentColor' : _ref$color,\n _ref$size = _ref.size,\n size = _ref$size === void 0 ? 14 : _ref$size,\n rest = _objectWithoutProperties(_ref, _excluded);\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n ref: ref,\n width: size,\n height: size,\n viewBox: \"0 0 52 52\",\n fill: \"none\",\n xmlns: \"http://www.w3.org/2000/svg\"\n }, rest), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M36.2754 7.5C34.2754 3.1 29.8754 0 24.7754 0C17.8754 0 12.2754 5.6 12.2754 12.5V20H9.77539C8.37539 20 7.27539 21.1 7.27539 22.5V47.5C7.27539 48.9 8.37539 50 9.77539 50H39.7754C41.1754 50 42.2754 48.9 42.2754 47.5V22.5C42.2754 21.1 41.1754 20 39.7754 20H14.7754V12.5C14.7754 7 19.2754 2.5 24.7754 2.5C28.4754 2.5 31.7754 4.5 33.4754 7.6L36.2754 7.5ZM39.7754 47.5H9.77539V22.5H39.7754V47.5Z\",\n fill: color\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M24.7754 30C22.6754 30 20.9754 31.7 20.9754 33.7C20.9754 35.3 21.9754 36.7 23.4754 37.2V41.2H25.9754V37.2C27.4754 36.7 28.4754 35.3 28.4754 33.7C28.5754 31.7 26.8754 30 24.7754 30ZM24.7754 35C24.0754 35 23.4754 34.4 23.4754 33.7C23.4754 33 24.0754 32.4 24.7754 32.4C25.4754 32.4 25.9754 33 25.9754 33.7C25.9754 34.4 25.4754 35 24.7754 35Z\",\n fill: color\n }));\n});\nexport default UnlockOutline;","import _extends from \"@babel/runtime/helpers/extends\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/objectWithoutProperties\";\nvar _excluded = [\"color\", \"size\"];\nimport React from 'react';\nimport { intrinsicComponent } from './utils/functions';\nexport var Point = intrinsicComponent(function (_ref, ref) {\n var _ref$color = _ref.color,\n color = _ref$color === void 0 ? 'currentColor' : _ref$color,\n _ref$size = _ref.size,\n size = _ref$size === void 0 ? 14 : _ref$size,\n rest = _objectWithoutProperties(_ref, _excluded);\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n ref: ref,\n width: size,\n height: size,\n viewBox: \"0 0 50 50\",\n fill: \"none\",\n xmlns: \"http://www.w3.org/2000/svg\"\n }, rest), /*#__PURE__*/React.createElement(\"circle\", {\n cx: \"25\",\n cy: \"25\",\n r: \"8.33333\",\n fill: color\n }));\n});\nexport default Point;","import _extends from \"@babel/runtime/helpers/extends\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/objectWithoutProperties\";\nvar _excluded = [\"color\", \"size\"];\nimport React from 'react';\nimport { intrinsicComponent } from './utils/functions';\nexport var About = intrinsicComponent(function (_ref, ref) {\n var _ref$color = _ref.color,\n color = _ref$color === void 0 ? 'currentColor' : _ref$color,\n _ref$size = _ref.size,\n size = _ref$size === void 0 ? 14 : _ref$size,\n rest = _objectWithoutProperties(_ref, _excluded);\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n ref: ref,\n width: size,\n height: size,\n viewBox: \"0 0 50 50\",\n fill: \"none\",\n xmlns: \"http://www.w3.org/2000/svg\"\n }, rest), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M42.6793 7.32203C32.916 -2.44013 17.0863 -2.44122 7.32197 7.32203C-2.44128 17.0853 -2.4402 32.915 7.32197 42.6793C17.0852 52.4404 32.9149 52.4415 42.6793 42.6793C52.4414 32.915 52.4403 17.0864 42.6793 7.32203ZM28.2605 35.8705C28.2605 37.6716 26.8007 39.1314 24.9995 39.1314C23.1984 39.1314 21.7386 37.6716 21.7386 35.8705V22.8267C21.7386 21.0256 23.1984 19.5658 24.9995 19.5658C26.8007 19.5658 28.2605 21.0256 28.2605 22.8267V35.8705ZM24.9419 17.2527C23.0636 17.2527 21.8114 15.9222 21.8506 14.2798C21.8114 12.558 23.0636 11.2678 24.98 11.2678C26.8974 11.2678 28.1105 12.5591 28.1507 14.2798C28.1496 15.9222 26.8985 17.2527 24.9419 17.2527Z\",\n fill: color\n }));\n});\nexport default About;","import _extends from \"@babel/runtime/helpers/extends\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/objectWithoutProperties\";\nvar _excluded = [\"color\", \"size\"];\nimport React from 'react';\nimport { intrinsicComponent } from './utils/functions';\nexport var Warning = intrinsicComponent(function (_ref, ref) {\n var _ref$color = _ref.color,\n color = _ref$color === void 0 ? 'currentColor' : _ref$color,\n _ref$size = _ref.size,\n size = _ref$size === void 0 ? 14 : _ref$size,\n rest = _objectWithoutProperties(_ref, _excluded);\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n ref: ref,\n width: size,\n height: size,\n viewBox: \"0 0 50 50\",\n fill: \"none\",\n xmlns: \"http://www.w3.org/2000/svg\"\n }, rest), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M48.9856 38.314L31.3034 3.80423C29.9688 1.42247 27.6118 0 24.9985 0C22.3852 0 20.0282 1.42247 18.6936 3.80423C18.6836 3.82245 18.6751 3.84067 18.665 3.8589L1.04158 38.2594C-0.321602 40.6914 -0.347383 43.612 0.971367 46.0713C2.29314 48.5321 4.67439 50 7.345 50H42.5544C45.225 50 47.7041 48.5321 49.0258 46.0713C50.3445 43.6121 50.3188 40.6913 48.9856 38.314ZM22.0659 15.8013C22.0659 14.0842 23.3789 12.6924 24.9985 12.6924C26.6182 12.6924 27.9311 14.0843 27.9311 15.8013V28.2372C27.9311 29.9541 26.6181 31.3462 24.9985 31.3462C23.3789 31.3462 22.0659 29.954 22.0659 28.2372V15.8013ZM24.9985 43.7821C22.5728 43.7821 20.5995 41.6902 20.5995 39.1186C20.5995 36.5471 22.5727 34.4552 24.9985 34.4552C27.4242 34.4552 29.3974 36.5471 29.3974 39.1186C29.3975 41.6901 27.4243 43.7821 24.9985 43.7821Z\",\n fill: color\n }));\n});\nexport default Warning;","import _extends from \"@babel/runtime/helpers/extends\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/objectWithoutProperties\";\nvar _excluded = [\"color\", \"size\"];\nimport React from 'react';\nimport { intrinsicComponent } from './utils/functions';\nexport var InfoOutline = intrinsicComponent(function (_ref, ref) {\n var _ref$color = _ref.color,\n color = _ref$color === void 0 ? 'currentColor' : _ref$color,\n _ref$size = _ref.size,\n size = _ref$size === void 0 ? 14 : _ref$size,\n rest = _objectWithoutProperties(_ref, _excluded);\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n ref: ref,\n width: size,\n height: size,\n viewBox: \"0 0 50 50\",\n fill: \"none\",\n xmlns: \"http://www.w3.org/2000/svg\"\n }, rest), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M25 50C11.2033 50 0 38.7967 0 25C0 11.2033 11.2033 0 25 0C38.7967 0 50 11.2033 50 25C50 38.7967 38.6929 50 25 50ZM25 3.52697C13.1743 3.52697 3.63071 13.1743 3.63071 24.8963C3.63071 36.6183 13.278 46.2656 25 46.2656C36.8257 46.2656 46.3693 36.6183 46.3693 24.8963C46.3693 13.1743 36.8257 3.52697 25 3.52697Z\",\n fill: color\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M28.3755 13.125C28.3755 11.3992 26.9765 10 25.2505 10C23.5245 10 22.1255 11.3992 22.1255 13.125C22.1255 14.8516 23.5245 16.25 25.2505 16.25C26.9765 16.25 28.3755 14.8516 28.3755 13.125Z\",\n fill: color\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M20.563 38.5H29.938C30.8009 38.5 31.5005 37.8012 31.5005 36.9375C31.5005 36.0746 30.8009 35.375 29.938 35.375H28.3755V20.9375C28.3755 20.0746 27.6759 19.375 26.813 19.375H20.563C19.7001 19.375 19.0005 20.0746 19.0005 20.9375C19.0005 21.8012 19.7001 22.5 20.563 22.5H22.1255V35.375H20.563C19.7001 35.375 19.0005 36.0746 19.0005 36.9375C19.0005 37.8012 19.7001 38.5 20.563 38.5Z\",\n fill: color\n }));\n});\nexport default InfoOutline;","import _extends from \"@babel/runtime/helpers/extends\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/objectWithoutProperties\";\nvar _excluded = [\"color\", \"size\"];\nimport React from 'react';\nimport { intrinsicComponent } from './utils/functions';\nexport var ImageOutline = intrinsicComponent(function (_ref, ref) {\n var _ref$color = _ref.color,\n color = _ref$color === void 0 ? 'currentColor' : _ref$color,\n _ref$size = _ref.size,\n size = _ref$size === void 0 ? 14 : _ref$size,\n rest = _objectWithoutProperties(_ref, _excluded);\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n ref: ref,\n width: size,\n height: size,\n viewBox: \"0 0 50 50\",\n fill: \"none\",\n xmlns: \"http://www.w3.org/2000/svg\"\n }, rest), /*#__PURE__*/React.createElement(\"path\", {\n fillRule: \"evenodd\",\n clipRule: \"evenodd\",\n d: \"M31.3032 17.8662C34.0646 17.8662 36.3032 15.6276 36.3032 12.8662C36.3032 10.1048 34.0646 7.86618 31.3032 7.86618C28.5418 7.86618 26.3032 10.1048 26.3032 12.8662C26.3032 15.6276 28.5418 17.8662 31.3032 17.8662ZM31.3032 15.3662C32.6839 15.3662 33.8032 14.2469 33.8032 12.8662C33.8032 11.4855 32.6839 10.3662 31.3032 10.3662C29.9225 10.3662 28.8032 11.4855 28.8032 12.8662C28.8032 14.2469 29.9225 15.3662 31.3032 15.3662Z\",\n fill: color\n }), /*#__PURE__*/React.createElement(\"path\", {\n fillRule: \"evenodd\",\n clipRule: \"evenodd\",\n d: \"M15.9372 15.1063C16.3967 15.0794 16.8338 15.3071 17.075 15.6991L25.0831 28.7141L29.8357 24.4289C30.0935 24.1966 30.4362 24.0818 30.7819 24.1121C31.1276 24.1424 31.4452 24.3151 31.6586 24.5887L40.2822 35.6497C40.5759 36.0264 40.6292 36.5376 40.4196 36.9668C40.21 37.396 39.7741 37.6683 39.2964 37.6683H6.70331C6.2766 37.6683 5.87937 37.4506 5.64974 37.091C5.42011 36.7313 5.38981 36.2794 5.56937 35.8923L14.8765 15.8282C15.0702 15.4106 15.4777 15.1333 15.9372 15.1063ZM16.1652 18.991L8.66108 35.1683H36.7368L30.5126 27.1848L25.6422 31.5761C25.3666 31.8246 24.9947 31.9378 24.6274 31.885C24.26 31.8322 23.9351 31.6189 23.7406 31.3027L16.1652 18.991Z\",\n fill: color\n }), /*#__PURE__*/React.createElement(\"path\", {\n fillRule: \"evenodd\",\n clipRule: \"evenodd\",\n d: \"M0.5 3C0.5 1.61929 1.61929 0.5 3 0.5H43C44.3807 0.5 45.5 1.61929 45.5 3V43C45.5 44.3807 44.3807 45.5 43 45.5H3C1.61929 45.5 0.5 44.3807 0.5 43V3ZM3 3H43V43H3V3Z\",\n fill: color\n }));\n});\nexport default ImageOutline;","import _extends from \"@babel/runtime/helpers/extends\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/objectWithoutProperties\";\nvar _excluded = [\"color\", \"size\"];\nimport React from 'react';\nimport { intrinsicComponent } from './utils/functions';\nexport var Custom = intrinsicComponent(function (_ref, ref) {\n var _ref$color = _ref.color,\n color = _ref$color === void 0 ? 'currentColor' : _ref$color,\n _ref$size = _ref.size,\n size = _ref$size === void 0 ? 14 : _ref$size,\n rest = _objectWithoutProperties(_ref, _excluded);\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n ref: ref,\n width: size,\n height: size,\n viewBox: \"0 0 50 50\",\n fill: \"none\",\n xmlns: \"http://www.w3.org/2000/svg\"\n }, rest), /*#__PURE__*/React.createElement(\"path\", {\n fillRule: \"evenodd\",\n clipRule: \"evenodd\",\n d: \"M0.562515 0.562512H3.68752V2.90626H2.90627V3.68751H0.562515V0.562512ZM0.562515 44.3125V47.4375H3.68752V45.0938H2.90627V44.3125H0.562515ZM44.3125 47.4375H47.4375V44.3125H45.0938V45.0938H44.3125V47.4375ZM47.4375 3.68751V0.562512H44.3125V2.90626H45.0938V3.68751H47.4375ZM7.59376 0.562512V3.68751H12.2813V0.562512H7.59376ZM16.9688 0.562512V3.68751H21.6563V0.562512H16.9688ZM26.3438 0.562512V3.68751H31.0313V0.562512H26.3438ZM35.7188 0.562512V3.68751H40.4063V0.562512H35.7188ZM47.4375 7.59376H44.3125V12.2813H47.4375V7.59376ZM47.4375 16.9688H44.3125V21.6563H47.4375V16.9688ZM47.4375 26.3438H44.3125V31.0313H47.4375V26.3438ZM47.4375 35.7188H44.3125V40.4063H47.4375V35.7188ZM40.4063 47.4375V44.3125H35.7188V47.4375H40.4063ZM31.0313 47.4375V44.3125H26.3438V47.4375H31.0313ZM21.6563 47.4375V44.3125H16.9688V47.4375H21.6563ZM12.2813 47.4375V44.3125H7.59377V47.4375H12.2813ZM0.562515 40.4063H3.68752V35.7188H0.562515V40.4063ZM0.562515 31.0313H3.68752V26.3438H0.562515V31.0313ZM0.562515 21.6563H3.68752V16.9688H0.562515V21.6563ZM0.562515 12.2813H3.68752V7.59376H0.562515V12.2813Z\",\n fill: color\n }));\n});\nexport default Custom;","import _extends from \"@babel/runtime/helpers/extends\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/objectWithoutProperties\";\nvar _excluded = [\"color\", \"size\"];\nimport React from 'react';\nimport { intrinsicComponent } from './utils/functions';\nexport var FlipY = intrinsicComponent(function (_ref, ref) {\n var _ref$color = _ref.color,\n color = _ref$color === void 0 ? 'currentColor' : _ref$color,\n _ref$size = _ref.size,\n size = _ref$size === void 0 ? 14 : _ref$size,\n rest = _objectWithoutProperties(_ref, _excluded);\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n ref: ref,\n width: size,\n height: size,\n viewBox: \"0 0 50 50\",\n fill: \"none\",\n xmlns: \"http://www.w3.org/2000/svg\"\n }, rest), /*#__PURE__*/React.createElement(\"path\", {\n fillRule: \"evenodd\",\n clipRule: \"evenodd\",\n d: \"M37.5001 24.0625C38.2086 24.0625 38.8284 23.5858 39.0102 22.901C39.1921 22.2162 38.8904 21.4948 38.2753 21.1433L3.27531 1.14333C2.79171 0.866989 2.19757 0.868973 1.71583 1.14854C1.23409 1.4281 0.937592 1.94298 0.937592 2.49996V22.5C0.937592 23.3629 1.63715 24.0625 2.50009 24.0625L37.5001 24.0625ZM4.06259 20.9375L4.06259 5.19243L31.6164 20.9375L4.06259 20.9375Z\",\n fill: color\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M38.2753 28.8566C38.8904 28.5051 39.1921 27.7837 39.0102 27.0989C38.8284 26.4142 38.2086 25.9375 37.5001 25.9375H35.3126V26.9504L34.5374 27.3933L35.3126 28.75V29.0625H35.4912L36.0878 30.1066L38.2753 28.8566Z\",\n fill: color\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M27.3378 35.1066L31.7128 32.6066L30.1624 29.8933L25.7874 32.3933L27.3378 35.1066Z\",\n fill: color\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M30.9376 25.9375H26.5626L26.5626 29.0625H30.9376L30.9376 25.9375Z\",\n fill: color\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M18.5878 40.1066L22.9628 37.6066L21.4124 34.8933L17.0374 37.3933L18.5878 40.1066Z\",\n fill: color\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M22.1876 25.9375H17.8126V29.0625H22.1876V25.9375Z\",\n fill: color\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M9.83781 45.1066L14.2128 42.6066L12.6624 39.8933L8.28738 42.3933L9.83781 45.1066Z\",\n fill: color\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M13.4376 25.9375H9.0626V29.0625H13.4376V25.9375Z\",\n fill: color\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M3.27531 48.8566L5.46281 47.6066L4.06259 45.1562V45H3.97331L3.91238 44.8933L3.72578 45H0.937592V47.5C0.937592 48.0569 1.23409 48.5718 1.71583 48.8514C2.19758 49.1309 2.79171 49.1329 3.27531 48.8566Z\",\n fill: color\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M4.6876 25.9375L2.50009 25.9375C1.63715 25.9375 0.937592 26.637 0.937592 27.5V30H4.06259V29.0625H4.6876V25.9375Z\",\n fill: color\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M0.937592 35V40L4.06259 40V35H0.937592Z\",\n fill: color\n }));\n});\nexport default FlipY;","import _extends from \"@babel/runtime/helpers/extends\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/objectWithoutProperties\";\nvar _excluded = [\"color\", \"size\"];\nimport React from 'react';\nimport { intrinsicComponent } from './utils/functions';\nexport var FlipX = intrinsicComponent(function (_ref, ref) {\n var _ref$color = _ref.color,\n color = _ref$color === void 0 ? 'currentColor' : _ref$color,\n _ref$size = _ref.size,\n size = _ref$size === void 0 ? 14 : _ref$size,\n rest = _objectWithoutProperties(_ref, _excluded);\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n ref: ref,\n width: size,\n height: size,\n viewBox: \"0 0 50 50\",\n fill: \"none\",\n xmlns: \"http://www.w3.org/2000/svg\"\n }, rest), /*#__PURE__*/React.createElement(\"path\", {\n fillRule: \"evenodd\",\n clipRule: \"evenodd\",\n d: \"M24.0625 1.93758C24.0625 1.22909 23.5858 0.609274 22.901 0.427427C22.2163 0.245581 21.4949 0.547225 21.1434 1.16237L1.14337 39.2874C0.867028 39.771 0.869012 40.3651 1.14858 40.8468C1.42814 41.3286 1.94302 41.6251 2.5 41.6251H22.5C23.3629 41.6251 24.0625 40.9255 24.0625 40.0626V1.93758ZM20.9375 38.5001H5.19247L20.9375 7.82128V38.5001Z\",\n fill: color\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M28.8566 1.16237C28.5051 0.547225 27.7837 0.245581 27.099 0.427428C26.4142 0.609274 25.9375 1.22909 25.9375 1.93758V4.12508H26.9504L27.3934 4.9003L28.75 4.12508H29.0625V3.94651L30.1066 3.34986L28.8566 1.16237Z\",\n fill: color\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M35.1066 12.0999L32.6066 7.72486L29.8934 9.2753L32.3934 13.6503L35.1066 12.0999Z\",\n fill: color\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M25.9375 8.50008V12.8751H29.0625V8.50008H25.9375Z\",\n fill: color\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M40.1066 23.9749L37.6066 19.5999L34.8934 21.1503L37.3934 25.5253L40.1066 23.9749Z\",\n fill: color\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M25.9375 20.3751V24.7501H29.0625V20.3751H25.9375Z\",\n fill: color\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M45.1066 32.7249L42.6066 28.3499L39.8934 29.9003L42.3934 34.2753L45.1066 32.7249Z\",\n fill: color\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M25.9375 29.1251V33.5001H29.0625V29.1251H25.9375Z\",\n fill: color\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M48.8566 39.2874L47.6066 37.0999L45.1562 38.5001H45V38.5894L44.8934 38.6503L45 38.8369V41.6251H47.5C48.057 41.6251 48.5719 41.3286 48.8514 40.8468C49.131 40.3651 49.133 39.771 48.8566 39.2874Z\",\n fill: color\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M25.9375 37.8751V40.0626C25.9375 40.9255 26.6371 41.6251 27.5 41.6251H30V38.5001H29.0625V37.8751H25.9375Z\",\n fill: color\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M35 41.6251H40V38.5001H35V41.6251Z\",\n fill: color\n }));\n});\nexport default FlipX;","import _extends from \"@babel/runtime/helpers/extends\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/objectWithoutProperties\";\nvar _excluded = [\"color\", \"size\"];\nimport React from 'react';\nimport { intrinsicComponent } from './utils/functions';\nexport var Ellipse = intrinsicComponent(function (_ref, ref) {\n var _ref$color = _ref.color,\n color = _ref$color === void 0 ? 'currentColor' : _ref$color,\n _ref$size = _ref.size,\n size = _ref$size === void 0 ? 14 : _ref$size,\n rest = _objectWithoutProperties(_ref, _excluded);\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n ref: ref,\n width: size,\n height: size,\n viewBox: \"0 0 52 52\",\n fill: \"none\",\n xmlns: \"http://www.w3.org/2000/svg\"\n }, rest), /*#__PURE__*/React.createElement(\"path\", {\n fillRule: \"evenodd\",\n clipRule: \"evenodd\",\n d: \"M25.2047 46.875C37.2859 46.875 47.0797 37.0812 47.0797 25C47.0797 12.9188 37.2859 3.125 25.2047 3.125C13.1235 3.125 3.32968 12.9188 3.32968 25C3.32968 37.0812 13.1235 46.875 25.2047 46.875ZM25.2047 50C39.0118 50 50.2047 38.8071 50.2047 25C50.2047 11.1929 39.0118 0 25.2047 0C11.3976 0 0.204681 11.1929 0.204681 25C0.204681 38.8071 11.3976 50 25.2047 50Z\",\n fill: color\n }));\n});\nexport default Ellipse;","import _extends from \"@babel/runtime/helpers/extends\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/objectWithoutProperties\";\nvar _excluded = [\"color\", \"size\"];\nimport React from 'react';\nimport { intrinsicComponent } from './utils/functions';\nexport var Landscape = intrinsicComponent(function (_ref, ref) {\n var _ref$color = _ref.color,\n color = _ref$color === void 0 ? 'currentColor' : _ref$color,\n _ref$size = _ref.size,\n size = _ref$size === void 0 ? 14 : _ref$size,\n rest = _objectWithoutProperties(_ref, _excluded);\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n ref: ref,\n width: size,\n height: size,\n viewBox: \"0 0 51 36\",\n fill: \"none\",\n xmlns: \"http://www.w3.org/2000/svg\"\n }, rest), /*#__PURE__*/React.createElement(\"path\", {\n fillRule: \"evenodd\",\n clipRule: \"evenodd\",\n d: \"M4.11841 3.93805V32.063H47.8684V3.93805H4.11841ZM3.49341 0.813049C2.1127 0.813049 0.993408 1.91235 0.993408 3.26841V32.7327C0.993408 34.0887 2.1127 35.188 3.49341 35.188H48.4934C49.8741 35.188 50.9934 34.0887 50.9934 32.7327V3.26841C50.9934 1.91235 49.8741 0.813049 48.4934 0.813049H3.49341Z\",\n fill: color\n }));\n});\nexport default Landscape;","import _extends from \"@babel/runtime/helpers/extends\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/objectWithoutProperties\";\nvar _excluded = [\"color\", \"size\"];\nimport React from 'react';\nimport { intrinsicComponent } from './utils/functions';\nexport var Stroke = intrinsicComponent(function (_ref, ref) {\n var _ref$color = _ref.color,\n color = _ref$color === void 0 ? 'currentColor' : _ref$color,\n _ref$size = _ref.size,\n size = _ref$size === void 0 ? 14 : _ref$size,\n rest = _objectWithoutProperties(_ref, _excluded);\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n ref: ref,\n width: size,\n height: size,\n viewBox: \"0 0 50 50\",\n fill: \"none\",\n xmlns: \"http://www.w3.org/2000/svg\"\n }, rest), /*#__PURE__*/React.createElement(\"path\", {\n fillRule: \"evenodd\",\n clipRule: \"evenodd\",\n d: \"M5.50015 7.9997C5.50015 6.61898 6.61944 5.49969 8.00015 5.49969H38.0002C39.3809 5.49969 40.5002 6.61898 40.5002 7.99969V37.9997C40.5002 39.3804 39.3809 40.4997 38.0002 40.4997H8.00015C6.61944 40.4997 5.50015 39.3804 5.50015 37.9997V7.9997ZM8.00015 7.99969H38.0002V37.9997H8.00015V7.99969Z\",\n fill: color\n }), /*#__PURE__*/React.createElement(\"path\", {\n fillRule: \"evenodd\",\n clipRule: \"evenodd\",\n d: \"M0.5 3C0.5 1.61929 1.61929 0.5 3 0.5H43C44.3807 0.5 45.5 1.61929 45.5 3V43C45.5 44.3807 44.3807 45.5 43 45.5H3C1.61929 45.5 0.5 44.3807 0.5 43V3ZM3 3H43V43H3V3Z\",\n fill: color\n }));\n});\nexport default Stroke;","import _extends from \"@babel/runtime/helpers/extends\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/objectWithoutProperties\";\nvar _excluded = [\"color\", \"size\"];\nimport React from 'react';\nimport { intrinsicComponent } from './utils/functions';\nexport var Transparency = intrinsicComponent(function (_ref, ref) {\n var _ref$color = _ref.color,\n color = _ref$color === void 0 ? 'currentColor' : _ref$color,\n _ref$size = _ref.size,\n size = _ref$size === void 0 ? 14 : _ref$size,\n rest = _objectWithoutProperties(_ref, _excluded);\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n ref: ref,\n width: size,\n height: size,\n viewBox: \"0 0 50 50\",\n fill: \"none\",\n xmlns: \"http://www.w3.org/2000/svg\"\n }, rest), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M0.166672 0.166664H8.50001V8.5H0.166672V0.166664Z\",\n fill: color\n }), /*#__PURE__*/React.createElement(\"path\", {\n fillRule: \"evenodd\",\n clipRule: \"evenodd\",\n d: \"M16.8333 8.5H8.50001V16.8333H0.166672V25.1667H8.50001V33.5H0.166672V41.8333H8.50001V33.5H16.8333V41.8333H25.1667V33.5H33.5V41.8333H41.8333V33.5H33.5V25.1667H41.8333V16.8333H33.5V8.5H41.8333V0.166664H33.5V8.5H25.1667V0.166664H16.8333V8.5ZM16.8333 16.8333V8.5H25.1667V16.8333H16.8333ZM16.8333 25.1667V33.5H25.1667V25.1667H33.5V16.8333H25.1667V25.1667H16.8333ZM16.8333 25.1667H8.50001V16.8333H16.8333V25.1667Z\",\n fill: color\n }));\n});\nexport default Transparency;","import _extends from \"@babel/runtime/helpers/extends\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/objectWithoutProperties\";\nvar _excluded = [\"color\", \"size\"];\nimport React from 'react';\nimport { intrinsicComponent } from './utils/functions';\nexport var Shadow = intrinsicComponent(function (_ref, ref) {\n var _ref$color = _ref.color,\n color = _ref$color === void 0 ? 'currentColor' : _ref$color,\n _ref$size = _ref.size,\n size = _ref$size === void 0 ? 14 : _ref$size,\n rest = _objectWithoutProperties(_ref, _excluded);\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n ref: ref,\n width: size,\n height: size,\n viewBox: \"0 0 50 50\",\n fill: \"none\",\n xmlns: \"http://www.w3.org/2000/svg\"\n }, rest), /*#__PURE__*/React.createElement(\"path\", {\n fillRule: \"evenodd\",\n clipRule: \"evenodd\",\n d: \"M2.95831 0.458374C1.5776 0.458374 0.458313 1.57766 0.458313 2.95837V35.4584C0.458313 36.8391 1.5776 37.9584 2.95831 37.9584H7.54167V43.7917C7.54167 45.8627 9.2206 47.5417 11.2917 47.5417H43.7917C45.8627 47.5417 47.5417 45.8627 47.5417 43.7917V11.2917C47.5417 9.22059 45.8627 7.54166 43.7917 7.54166H37.9583V2.95837C37.9583 1.57766 36.839 0.458374 35.4583 0.458374H2.95831ZM35.4583 2.95837H2.95831L2.95831 35.4584H35.4583V2.95837ZM15.7267 37.9584L10.0417 43.746V37.9584H15.7267ZM11.5135 45.0417L18.4712 37.9584H28.5529L21.4696 45.0417H11.5135ZM24.4159 45.0417H34.2932L45.0417 34.1339V24.0207L37.9583 31.3242V35.4584C37.9583 36.8391 36.839 37.9584 35.4583 37.9584H31.4912C31.4689 37.9859 31.445 38.0126 31.4194 38.0382L24.4159 45.0417ZM45.0417 21.3515L37.9583 28.655V18.9107L45.0417 11.8338V21.3515ZM37.0311 45.0417H43.7917C44.482 45.0417 45.0417 44.482 45.0417 43.7917V36.9124L37.0311 45.0417ZM43.8844 10.045C43.8538 10.0428 43.8229 10.0417 43.7917 10.0417H37.9583V15.9657L43.8844 10.045Z\",\n fill: color\n }));\n});\nexport default Shadow;","import _extends from \"@babel/runtime/helpers/extends\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/objectWithoutProperties\";\nvar _excluded = [\"color\", \"size\"];\nimport React from 'react';\nimport { intrinsicComponent } from './utils/functions';\nexport var RadiusCorner = intrinsicComponent(function (_ref, ref) {\n var _ref$color = _ref.color,\n color = _ref$color === void 0 ? 'currentColor' : _ref$color,\n _ref$size = _ref.size,\n size = _ref$size === void 0 ? 14 : _ref$size,\n rest = _objectWithoutProperties(_ref, _excluded);\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n ref: ref,\n width: size,\n height: size,\n viewBox: \"0 0 50 50\",\n fill: \"none\",\n xmlns: \"http://www.w3.org/2000/svg\"\n }, rest), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M3 3H23V0.5H3C1.61929 0.5 0.5 1.61929 0.5 3V43C0.5 44.3807 1.61929 45.5 3 45.5H43C44.3807 45.5 45.5 44.3807 45.5 43V23H43V43H3V3Z\",\n fill: color\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M45.5 7.25076H43V5.50076C43 5.15718 42.9321 4.83576 42.8113 4.54446L45.1206 3.58682C45.3651 4.17636 45.5 4.82281 45.5 5.50076V7.25076Z\",\n fill: color\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M24.75 0.500763V3.00076H28.25V0.500763H24.75Z\",\n fill: color\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M31.75 0.500763V3.00076H35.25V0.500763H31.75Z\",\n fill: color\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M38.75 0.500763V3.00076H40.5C40.8436 3.00076 41.165 3.06868 41.4563 3.18948L42.414 0.880166C41.8244 0.635694 41.178 0.500763 40.5 0.500763H38.75Z\",\n fill: color\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M45.5 10.7508H43V14.2508H45.5V10.7508Z\",\n fill: color\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M45.5 17.7508H43V21.2508H45.5V17.7508Z\",\n fill: color\n }));\n});\nexport default RadiusCorner;","import _extends from \"@babel/runtime/helpers/extends\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/objectWithoutProperties\";\nvar _excluded = [\"color\", \"size\"];\nimport React from 'react';\nimport { intrinsicComponent } from './utils/functions';\nexport var Position = intrinsicComponent(function (_ref, ref) {\n var _ref$color = _ref.color,\n color = _ref$color === void 0 ? 'currentColor' : _ref$color,\n _ref$size = _ref.size,\n size = _ref$size === void 0 ? 14 : _ref$size,\n rest = _objectWithoutProperties(_ref, _excluded);\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n ref: ref,\n width: size,\n height: size,\n viewBox: \"0 0 50 50\",\n fill: \"none\",\n xmlns: \"http://www.w3.org/2000/svg\"\n }, rest), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M9.25008 9.24878H11.7501V10.9675H10.9688V11.7488H9.25008V9.24878Z\",\n fill: color\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M9.25008 34.2488V36.7488H11.7501V35.03H10.9688V34.2488H9.25008Z\",\n fill: color\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M34.2501 36.7488H36.7501V34.2488H35.0313V35.03H34.2501V36.7488Z\",\n fill: color\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M36.7501 11.7488V9.24878H34.2501V10.9675H35.0313V11.7488H36.7501Z\",\n fill: color\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M14.4063 9.24878V11.7488H17.8438V9.24878H14.4063Z\",\n fill: color\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M21.2813 9.24878V11.7488H24.7188V9.24878H21.2813Z\",\n fill: color\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M28.1563 9.24878V11.7488H31.5938V9.24878H28.1563Z\",\n fill: color\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M36.7501 14.405H34.2501V17.8425H36.7501V14.405Z\",\n fill: color\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M36.7501 21.28H34.2501V24.7175H36.7501V21.28Z\",\n fill: color\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M36.7501 28.155H34.2501V31.5925H36.7501V28.155Z\",\n fill: color\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M31.5938 36.7488V34.2488H28.1563V36.7488H31.5938Z\",\n fill: color\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M24.7188 36.7488V34.2488H21.2813V36.7488H24.7188Z\",\n fill: color\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M17.8438 36.7488V34.2488H14.4063V36.7488H17.8438Z\",\n fill: color\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M9.25008 31.5925H11.7501V28.155H9.25008V31.5925Z\",\n fill: color\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M9.25008 24.7175H11.7501V21.28H9.25008V24.7175Z\",\n fill: color\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M9.25008 17.8425H11.7501V14.405H9.25008V17.8425Z\",\n fill: color\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M23.0002 26.7497C25.0712 26.7497 26.7502 25.0708 26.7502 22.9997C26.7502 20.9286 25.0712 19.2497 23.0002 19.2497C20.9291 19.2497 19.2502 20.9286 19.2502 22.9997C19.2502 25.0708 20.9291 26.7497 23.0002 26.7497Z\",\n fill: color\n }), /*#__PURE__*/React.createElement(\"path\", {\n fillRule: \"evenodd\",\n clipRule: \"evenodd\",\n d: \"M3 0.5C1.61929 0.5 0.5 1.61929 0.5 3V43C0.5 44.3807 1.61929 45.5 3 45.5H43C44.3807 45.5 45.5 44.3807 45.5 43V3C45.5 1.61929 44.3807 0.5 43 0.5H3ZM43 3H3V43H43V3Z\",\n fill: color\n }));\n});\nexport default Position;","import _extends from \"@babel/runtime/helpers/extends\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/objectWithoutProperties\";\nvar _excluded = [\"color\", \"size\"];\nimport React from 'react';\nimport { intrinsicComponent } from './utils/functions';\nexport var Spacing = intrinsicComponent(function (_ref, ref) {\n var _ref$color = _ref.color,\n color = _ref$color === void 0 ? 'currentColor' : _ref$color,\n _ref$size = _ref.size,\n size = _ref$size === void 0 ? 14 : _ref$size,\n rest = _objectWithoutProperties(_ref, _excluded);\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n ref: ref,\n width: size,\n height: size,\n viewBox: \"0 0 50 50\",\n fill: \"none\",\n xmlns: \"http://www.w3.org/2000/svg\"\n }, rest), /*#__PURE__*/React.createElement(\"path\", {\n fillRule: \"evenodd\",\n clipRule: \"evenodd\",\n d: \"M4.29986 0.991788C4.78802 0.503633 5.57947 0.503633 6.06763 0.991788L9.367 4.29116C9.85516 4.77932 9.85516 5.57077 9.367 6.05893C8.87885 6.54708 8.08739 6.54708 7.59924 6.05893L6.43374 4.89344V34.0829L7.59924 32.9174C8.08739 32.4293 8.87885 32.4293 9.367 32.9174C9.85516 33.4056 9.85516 34.197 9.367 34.6852L6.06763 37.9846C5.8332 38.219 5.51524 38.3507 5.18371 38.3507C4.85217 38.3507 4.53422 38.219 4.29981 37.9845L1.00084 34.6851C0.512712 34.1969 0.512761 33.4055 1.00095 32.9174C1.48913 32.4292 2.28059 32.4293 2.76871 32.9175L3.93374 34.0827V4.89344L2.76825 6.05893C2.2801 6.54708 1.48864 6.54708 1.00049 6.05893C0.51233 5.57077 0.51233 4.77932 1.00049 4.29116L4.29986 0.991788ZM13.1588 8.34109V1.49725H46.3156V8.34102H43.398V7.19776C43.398 5.54595 42.0562 4.20442 40.4047 4.20442H31.8516V26.0992C31.8516 28.1387 33.5088 29.7957 35.5481 29.7957H36.5137V32.4599H23.01V29.7957H23.9756C26.0151 29.7957 27.6721 28.1387 27.6721 26.0992V4.20448H19.0697C17.418 4.20448 16.0763 5.54604 16.0763 7.19783V8.34109H13.1588ZM46.9995 39.7088C47.4877 39.2207 47.4877 38.4292 46.9995 37.9411L43.7001 34.6417C43.212 34.1535 42.4205 34.1535 41.9324 34.6417C41.4442 35.1298 41.4442 35.9213 41.9324 36.4095L43.0979 37.5749L15.0832 37.5749L16.2484 36.4099C16.7366 35.9218 16.7366 35.1303 16.2485 34.6421C15.7604 34.154 14.9689 34.1539 14.4807 34.642L11.1814 37.941C10.9469 38.1754 10.8152 38.4934 10.8152 38.8249C10.8152 39.1564 10.9469 39.4744 11.1813 39.7088L14.4807 43.0082C14.9688 43.4964 15.7603 43.4964 16.2485 43.0082C16.7366 42.5201 16.7366 41.7286 16.2485 41.2404L15.083 40.0749L43.0979 40.0749L41.9324 41.2404C41.4442 41.7286 41.4442 42.5201 41.9324 43.0082C42.4205 43.4964 43.212 43.4964 43.7001 43.0082L46.9995 39.7088Z\",\n fill: color\n }));\n});\nexport default Spacing;","import _extends from \"@babel/runtime/helpers/extends\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/objectWithoutProperties\";\nvar _excluded = [\"color\", \"size\"];\nimport React from 'react';\nimport { intrinsicComponent } from './utils/functions';\nexport var Padding = intrinsicComponent(function (_ref, ref) {\n var _ref$color = _ref.color,\n color = _ref$color === void 0 ? 'currentColor' : _ref$color,\n _ref$size = _ref.size,\n size = _ref$size === void 0 ? 14 : _ref$size,\n rest = _objectWithoutProperties(_ref, _excluded);\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n ref: ref,\n width: size,\n height: size,\n viewBox: \"0 0 50 50\",\n fill: \"none\",\n xmlns: \"http://www.w3.org/2000/svg\"\n }, rest), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M13.8334 9.19949C13.8334 8.50914 14.3931 7.94949 15.0834 7.94949H31.3334C32.0238 7.94949 32.5834 8.50914 32.5834 9.19949C32.5834 9.88985 32.0238 10.4495 31.3334 10.4495H15.0834C14.3931 10.4495 13.8334 9.88985 13.8334 9.19949Z\",\n fill: color\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M15.0834 35.5496C14.3931 35.5496 13.8334 36.1092 13.8334 36.7996C13.8334 37.4899 14.3931 38.0496 15.0834 38.0496H31.3334C32.0238 38.0496 32.5834 37.4899 32.5834 36.7996C32.5834 36.1092 32.0238 35.5496 31.3334 35.5496H15.0834Z\",\n fill: color\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M36.8001 13.4163C37.4905 13.4163 38.0501 13.9759 38.0501 14.6663V30.9163C38.0501 31.6066 37.4905 32.1663 36.8001 32.1663C36.1098 32.1663 35.5501 31.6066 35.5501 30.9163V14.6663C35.5501 13.9759 36.1098 13.4163 36.8001 13.4163Z\",\n fill: color\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M10.45 14.6663C10.45 13.9759 9.89038 13.4163 9.20003 13.4163C8.50967 13.4163 7.95003 13.9759 7.95003 14.6663L7.95003 30.9163C7.95003 31.6066 8.50967 32.1663 9.20003 32.1663C9.89038 32.1663 10.45 31.6066 10.45 30.9163L10.45 14.6663Z\",\n fill: color\n }), /*#__PURE__*/React.createElement(\"path\", {\n fillRule: \"evenodd\",\n clipRule: \"evenodd\",\n d: \"M3 0.5C1.61929 0.5 0.5 1.61929 0.5 3V43C0.5 44.3807 1.61929 45.5 3 45.5H43C44.3807 45.5 45.5 44.3807 45.5 43V3C45.5 1.61929 44.3807 0.5 43 0.5H3ZM43 3H3V43H43V3Z\",\n fill: color\n }));\n});\nexport default Padding;","import _extends from \"@babel/runtime/helpers/extends\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/objectWithoutProperties\";\nvar _excluded = [\"color\", \"size\"];\nimport React from 'react';\nimport { intrinsicComponent } from './utils/functions';\nexport var Polygon = intrinsicComponent(function (_ref, ref) {\n var _ref$color = _ref.color,\n color = _ref$color === void 0 ? 'currentColor' : _ref$color,\n _ref$size = _ref.size,\n size = _ref$size === void 0 ? 14 : _ref$size,\n rest = _objectWithoutProperties(_ref, _excluded);\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n ref: ref,\n width: size,\n height: size,\n viewBox: \"0 0 50 50\",\n fill: \"none\",\n xmlns: \"http://www.w3.org/2000/svg\"\n }, rest), /*#__PURE__*/React.createElement(\"path\", {\n fillRule: \"evenodd\",\n clipRule: \"evenodd\",\n d: \"M44.103 18.4866L24.0002 3.8811L3.89749 18.4866L11.5761 42.1188H36.4244L44.103 18.4866ZM25.8371 1.35293C24.7418 0.557164 23.2587 0.557162 22.1634 1.35292L2.06066 15.9584C0.96539 16.7542 0.507082 18.1647 0.925439 19.4523L8.604 43.0845C9.02236 44.372 10.2222 45.2438 11.5761 45.2438H36.4244C37.7782 45.2438 38.9781 44.372 39.3965 43.0845L47.075 19.4523C47.4934 18.1647 47.0351 16.7542 45.9398 15.9584L25.8371 1.35293Z\",\n fill: color\n }));\n});\nexport default Polygon;","import _extends from \"@babel/runtime/helpers/extends\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/objectWithoutProperties\";\nvar _excluded = [\"color\", \"size\"];\nimport React from 'react';\nimport { intrinsicComponent } from './utils/functions';\nexport var PolygonSides = intrinsicComponent(function (_ref, ref) {\n var _ref$color = _ref.color,\n color = _ref$color === void 0 ? 'currentColor' : _ref$color,\n _ref$size = _ref.size,\n size = _ref$size === void 0 ? 14 : _ref$size,\n rest = _objectWithoutProperties(_ref, _excluded);\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n ref: ref,\n width: size,\n height: size,\n viewBox: \"0 0 50 48\",\n fill: \"none\",\n xmlns: \"http://www.w3.org/2000/svg\"\n }, rest), /*#__PURE__*/React.createElement(\"path\", {\n fillRule: \"evenodd\",\n clipRule: \"evenodd\",\n d: \"M23.0078 29.9669H25.835L24.7803 35.9727H27.4609L28.5156 29.9669H32.2363V27.4473H28.9551L29.6875 23.2872H33.3496V20.7383H30.1416L31.2109 14.6446H28.5303L27.4609 20.7383H24.6191L25.6885 14.6446H23.0225L21.9531 20.7383H18.1006V23.2872H21.499L20.7666 27.4473H17.002V29.9669H20.3271L19.2725 35.9727H21.9531L23.0078 29.9669ZM26.2744 27.4473H23.4473L24.165 23.2872H27.0068L26.2744 27.4473Z\",\n fill: color\n }), /*#__PURE__*/React.createElement(\"path\", {\n fillRule: \"evenodd\",\n clipRule: \"evenodd\",\n d: \"M23.5448 0.821208C24.421 0.184598 25.6075 0.184597 26.4837 0.821207L48.4803 16.8026C49.3565 17.4392 49.7231 18.5677 49.3885 19.5977L40.9865 45.4562C40.6518 46.4862 39.692 47.1836 38.6089 47.1836H11.4197C10.3366 47.1836 9.37672 46.4862 9.04204 45.4562L0.640107 19.5977C0.305422 18.5677 0.672067 17.4392 1.54829 16.8026L23.5448 0.821208ZM25.0143 2.84375L47.0108 18.8252L38.6089 44.6836H11.4197L3.01775 18.8252L25.0143 2.84375Z\",\n fill: color\n }));\n});\nexport default PolygonSides;","import _extends from \"@babel/runtime/helpers/extends\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/objectWithoutProperties\";\nvar _excluded = [\"color\", \"size\"];\nimport React from 'react';\nimport { intrinsicComponent } from './utils/functions';\nexport var ArrowRight = intrinsicComponent(function (_ref, ref) {\n var _ref$color = _ref.color,\n color = _ref$color === void 0 ? 'currentColor' : _ref$color,\n _ref$size = _ref.size,\n size = _ref$size === void 0 ? 14 : _ref$size,\n rest = _objectWithoutProperties(_ref, _excluded);\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n ref: ref,\n width: size,\n height: size,\n viewBox: \"0 0 46 30\",\n fill: \"none\",\n xmlns: \"http://www.w3.org/2000/svg\"\n }, rest), /*#__PURE__*/React.createElement(\"path\", {\n fillRule: \"evenodd\",\n clipRule: \"evenodd\",\n d: \"M45.5 15.0005C45.5 15.7079 45.2003 16.3822 44.6753 16.8562L30.8291 29.3562C29.8042 30.2814 28.2234 30.2006 27.2982 29.1758C26.373 28.1509 26.4537 26.57 27.4786 25.6448L36.5 17.5005L3 17.5005C1.61928 17.5005 0.499999 16.3812 0.499999 15.0005C0.499999 13.6198 1.61929 12.5005 3 12.5005L36.5 12.5005L27.4786 4.35618C26.4537 3.43096 26.373 1.85011 27.2982 0.82525C28.2234 -0.199608 29.8042 -0.280382 30.8291 0.644837L44.6753 13.1448C45.2003 13.6189 45.5 14.2931 45.5 15.0005Z\",\n fill: color\n }));\n});\nexport default ArrowRight;","import _extends from \"@babel/runtime/helpers/extends\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/objectWithoutProperties\";\nvar _excluded = [\"color\", \"size\"];\nimport React from 'react';\nimport { intrinsicComponent } from './utils/functions';\nexport var FontItalic = intrinsicComponent(function (_ref, ref) {\n var _ref$color = _ref.color,\n color = _ref$color === void 0 ? 'currentColor' : _ref$color,\n _ref$size = _ref.size,\n size = _ref$size === void 0 ? 14 : _ref$size,\n rest = _objectWithoutProperties(_ref, _excluded);\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n ref: ref,\n width: size,\n height: size,\n viewBox: \"0 0 50 50\",\n fill: \"none\",\n xmlns: \"http://www.w3.org/2000/svg\"\n }, rest), /*#__PURE__*/React.createElement(\"path\", {\n fillRule: \"evenodd\",\n clipRule: \"evenodd\",\n d: \"M19 48L26.9931 2H31.2019L23.2087 48H19Z\",\n fill: color\n }));\n});\nexport default FontItalic;","import _extends from \"@babel/runtime/helpers/extends\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/objectWithoutProperties\";\nvar _excluded = [\"color\", \"size\"];\nimport React from 'react';\nimport { intrinsicComponent } from './utils/functions';\nexport var FontBold = intrinsicComponent(function (_ref, ref) {\n var _ref$color = _ref.color,\n color = _ref$color === void 0 ? 'currentColor' : _ref$color,\n _ref$size = _ref.size,\n size = _ref$size === void 0 ? 14 : _ref$size,\n rest = _objectWithoutProperties(_ref, _excluded);\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n ref: ref,\n width: size,\n height: size,\n viewBox: \"0 0 14 18\",\n fill: \"none\",\n xmlns: \"http://www.w3.org/2000/svg\"\n }, rest), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M0.214966 17.4813V0.518677H6.61123C8.82693 0.518677 10.5075 0.914783 11.653 1.70699C12.7985 2.49144 13.3712 3.64481 13.3712 5.16709C13.3712 5.99814 13.1413 6.7321 12.6814 7.36898C12.2216 7.99809 11.5819 8.46021 10.7625 8.75535C11.699 8.97282 12.4348 9.41164 12.9699 10.0718C13.5133 10.732 13.7851 11.5397 13.7851 12.4951C13.7851 14.1261 13.2249 15.361 12.1045 16.1998C10.9841 17.0386 9.38713 17.4658 7.31357 17.4813H0.214966ZM3.97748 10.0951V14.6736H7.20069C8.08697 14.6736 8.77677 14.4795 9.27007 14.0911C9.77174 13.695 10.0226 13.1513 10.0226 12.4601C10.0226 10.9067 9.1572 10.1184 7.42644 10.0951H3.97748ZM3.97748 7.62528H6.76173C8.65971 7.59421 9.6087 6.89132 9.6087 5.5166C9.6087 4.74769 9.36623 4.19625 8.88128 3.86228C8.4047 3.52054 7.64801 3.34967 6.61123 3.34967H3.97748V7.62528Z\",\n fill: color\n }));\n});\nexport default FontBold;","import _extends from \"@babel/runtime/helpers/extends\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/objectWithoutProperties\";\nvar _excluded = [\"color\", \"size\"];\nimport React from 'react';\nimport { intrinsicComponent } from './utils/functions';\nexport var UploadOutline = intrinsicComponent(function (_ref, ref) {\n var _ref$color = _ref.color,\n color = _ref$color === void 0 ? 'currentColor' : _ref$color,\n _ref$size = _ref.size,\n size = _ref$size === void 0 ? 14 : _ref$size,\n rest = _objectWithoutProperties(_ref, _excluded);\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n ref: ref,\n width: size,\n height: size,\n viewBox: \"0 0 50 50\",\n fill: \"none\",\n xmlns: \"http://www.w3.org/2000/svg\"\n }, rest), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M17.5911 1.54582C16.7075 0.680052 15.2937 0.680014 14.4101 1.54573L4.05296 11.6925C3.15635 12.5709 3.14159 14.0098 4.01999 14.9064C4.89839 15.8031 6.33733 15.8178 7.23394 14.9394L13.7278 8.57741V30.4419C13.7278 31.6971 14.7454 32.7147 16.0006 32.7147C17.2558 32.7147 18.2733 31.6971 18.2733 30.4419V8.57782L24.766 14.9393C25.6625 15.8178 27.1015 15.8031 27.9799 14.9065C28.8584 14.01 28.8437 12.571 27.9471 11.6926L17.5911 1.54582Z\",\n fill: color\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M2.78827 36.5543C1.53308 36.5543 0.515541 37.5719 0.515541 38.827C0.515541 40.0822 1.53308 41.0998 2.78827 41.0998H29.1519C30.4071 41.0998 31.4246 40.0822 31.4246 38.827C31.4246 37.5719 30.4071 36.5543 29.1519 36.5543H2.78827Z\",\n fill: color\n }));\n});\nexport default UploadOutline;","import _extends from \"@babel/runtime/helpers/extends\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/objectWithoutProperties\";\nvar _excluded = [\"color\", \"size\"];\nimport React from 'react';\nimport { intrinsicComponent } from './utils/functions';\nexport var ArrowLeftOutline = intrinsicComponent(function (_ref, ref) {\n var _ref$color = _ref.color,\n color = _ref$color === void 0 ? 'currentColor' : _ref$color,\n _ref$size = _ref.size,\n size = _ref$size === void 0 ? 14 : _ref$size,\n rest = _objectWithoutProperties(_ref, _excluded);\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n ref: ref,\n width: size,\n height: size,\n viewBox: \"0 0 28 50\",\n fill: \"none\",\n xmlns: \"http://www.w3.org/2000/svg\"\n }, rest), /*#__PURE__*/React.createElement(\"path\", {\n fillRule: \"evenodd\",\n clipRule: \"evenodd\",\n d: \"M26.907 0.71085C25.7493 -0.292553 23.9445 -0.224769 22.8758 0.862251L0.931376 23.1837C-0.0773525 24.2097 -0.0773525 25.7913 0.931376 26.8173L22.8758 49.1388C23.9445 50.2258 25.7493 50.2936 26.907 49.2902C28.0647 48.2868 28.1369 46.5921 27.0683 45.5051L6.90997 25.0005L27.0683 4.49589C28.1369 3.40888 28.0647 1.71425 26.907 0.71085Z\",\n fill: color\n }));\n});\nexport default ArrowLeftOutline;","import _extends from \"@babel/runtime/helpers/extends\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/objectWithoutProperties\";\nvar _excluded = [\"color\", \"size\"];\nimport React from 'react';\nimport { intrinsicComponent } from './utils/functions';\nexport var ArrowRightOutline = intrinsicComponent(function (_ref, ref) {\n var _ref$color = _ref.color,\n color = _ref$color === void 0 ? 'currentColor' : _ref$color,\n _ref$size = _ref.size,\n size = _ref$size === void 0 ? 14 : _ref$size,\n rest = _objectWithoutProperties(_ref, _excluded);\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n ref: ref,\n width: size,\n height: size,\n viewBox: \"0 0 28 50\",\n fill: \"none\",\n xmlns: \"http://www.w3.org/2000/svg\"\n }, rest), /*#__PURE__*/React.createElement(\"path\", {\n fillRule: \"evenodd\",\n clipRule: \"evenodd\",\n d: \"M1.09286 0.71085C2.25057 -0.292553 4.05541 -0.224769 5.12407 0.862251L27.0685 23.1837C28.0772 24.2097 28.0772 25.7913 27.0685 26.8173L5.12407 49.1388C4.05541 50.2258 2.25057 50.2936 1.09286 49.2902C-0.0648579 48.2868 -0.137051 46.5921 0.93161 45.5051L21.0899 25.0005L0.93161 4.49589C-0.137051 3.40888 -0.0648579 1.71425 1.09286 0.71085Z\",\n fill: color\n }));\n});\nexport default ArrowRightOutline;","import _extends from \"@babel/runtime/helpers/extends\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/objectWithoutProperties\";\nvar _excluded = [\"color\", \"size\"];\nimport React from 'react';\nimport { intrinsicComponent } from './utils/functions';\nexport var PlusOutline = intrinsicComponent(function (_ref, ref) {\n var _ref$color = _ref.color,\n color = _ref$color === void 0 ? 'currentColor' : _ref$color,\n _ref$size = _ref.size,\n size = _ref$size === void 0 ? 14 : _ref$size,\n rest = _objectWithoutProperties(_ref, _excluded);\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n ref: ref,\n width: size,\n height: size,\n viewBox: \"0 0 38 38\",\n fill: \"none\",\n xmlns: \"http://www.w3.org/2000/svg\"\n }, rest), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M16.9167 21.0838L16.9167 35.6672C16.9167 36.8177 17.8494 37.7505 19 37.7505C20.1506 37.7505 21.0833 36.8177 21.0833 35.6672L21.0833 21.0838H35.6667C36.8173 21.0838 37.75 20.1511 37.75 19.0005C37.75 17.8499 36.8173 16.9172 35.6667 16.9172L21.0833 16.9172L21.0833 2.33382C21.0833 1.18323 20.1506 0.250488 19 0.250488C17.8494 0.250488 16.9167 1.18323 16.9167 2.33382L16.9167 16.9172H2.33333C1.18274 16.9172 0.25 17.8499 0.25 19.0005C0.25 20.1511 1.18274 21.0838 2.33333 21.0838H16.9167Z\",\n fill: color\n }));\n});\nexport default PlusOutline;","import _extends from \"@babel/runtime/helpers/extends\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/objectWithoutProperties\";\nvar _excluded = [\"color\", \"size\"];\nimport React from 'react';\nimport { intrinsicComponent } from './utils/functions';\nexport var ArrowTool = intrinsicComponent(function (_ref, ref) {\n var _ref$color = _ref.color,\n color = _ref$color === void 0 ? 'currentColor' : _ref$color,\n _ref$size = _ref.size,\n size = _ref$size === void 0 ? 14 : _ref$size,\n rest = _objectWithoutProperties(_ref, _excluded);\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n ref: ref,\n width: size,\n height: size,\n viewBox: \"0 0 50 50\",\n fill: \"none\",\n xmlns: \"http://www.w3.org/2000/svg\"\n }, rest), /*#__PURE__*/React.createElement(\"path\", {\n fillRule: \"evenodd\",\n clipRule: \"evenodd\",\n d: \"M1.04757 38.9503C0.437373 38.3401 0.437373 37.3508 1.04757 36.7406L33.9229 3.86697L23.8354 3.33584C22.9736 3.29047 22.3118 2.5551 22.3572 1.69335C22.4026 0.831601 23.138 0.169794 23.9997 0.215167L37.5909 0.930759C38.3892 0.972794 39.027 1.61063 39.0691 2.40894L39.7846 16.0001C39.83 16.8619 39.1682 17.5972 38.3065 17.6426C37.4447 17.688 36.7093 17.0262 36.664 16.1644L36.1328 6.07651L3.25728 38.9503C2.64708 39.5605 1.65776 39.5605 1.04757 38.9503Z\",\n fill: color\n }));\n});\nexport default ArrowTool;","import _extends from \"@babel/runtime/helpers/extends\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/objectWithoutProperties\";\nvar _excluded = [\"color\", \"size\"];\nimport React from 'react';\nimport { intrinsicComponent } from './utils/functions';\nexport var Compare = intrinsicComponent(function (_ref, ref) {\n var _ref$color = _ref.color,\n color = _ref$color === void 0 ? 'currentColor' : _ref$color,\n _ref$size = _ref.size,\n size = _ref$size === void 0 ? 14 : _ref$size,\n rest = _objectWithoutProperties(_ref, _excluded);\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n ref: ref,\n width: size,\n height: size,\n viewBox: \"0 0 52 52\",\n fill: \"none\",\n xmlns: \"http://www.w3.org/2000/svg\"\n }, rest), /*#__PURE__*/React.createElement(\"path\", {\n fillRule: \"evenodd\",\n clipRule: \"evenodd\",\n d: \"M27.1607 4.16667V2.08333C27.1607 0.93274 26.2279 0 25.0773 0C23.9267 0 22.994 0.932741 22.994 2.08333V4.16667H4.244C1.94281 4.16667 0.0773315 6.03215 0.0773315 8.33333V41.6667C0.0773315 43.9679 1.94281 45.8333 4.244 45.8333H22.994V47.9167C22.994 49.0673 23.9267 50 25.0773 50C26.2279 50 27.1607 49.0673 27.1607 47.9167V45.8333H45.9107C48.2118 45.8333 50.0773 43.9678 50.0773 41.6667V8.33333C50.0773 6.03215 48.2119 4.16667 45.9107 4.16667H27.1607ZM22.994 8.33333H4.244L4.244 41.6667H22.994V8.33333ZM27.1607 41.6667V8.33333H45.9107V41.6667H27.1607Z\",\n fill: color\n }));\n});\nexport default Compare;","import _extends from \"@babel/runtime/helpers/extends\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/objectWithoutProperties\";\nvar _excluded = [\"color\", \"size\"];\nimport React from 'react';\nimport { intrinsicComponent } from './utils/functions';\nexport var MinusOutline = intrinsicComponent(function (_ref, ref) {\n var _ref$color = _ref.color,\n color = _ref$color === void 0 ? 'currentColor' : _ref$color,\n _ref$size = _ref.size,\n size = _ref$size === void 0 ? 14 : _ref$size,\n rest = _objectWithoutProperties(_ref, _excluded);\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n ref: ref,\n width: size,\n height: size,\n viewBox: \"0 0 38 6\",\n fill: \"none\",\n xmlns: \"http://www.w3.org/2000/svg\"\n }, rest), /*#__PURE__*/React.createElement(\"path\", {\n fillRule: \"evenodd\",\n clipRule: \"evenodd\",\n d: \"M35.835 5.0769L2.16498 5.0769C1.00277 5.0769 0.0606079 4.14726 0.0606079 3.00048C0.060608 1.85371 1.00277 0.924072 2.16498 0.924072L35.835 0.924074C36.9972 0.924074 37.9394 1.85372 37.9394 3.00049C37.9394 4.14726 36.9972 5.0769 35.835 5.0769Z\",\n fill: color\n }));\n});\nexport default MinusOutline;","import _extends from \"@babel/runtime/helpers/extends\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/objectWithoutProperties\";\nvar _excluded = [\"color\", \"size\"];\nimport React from 'react';\nimport { intrinsicComponent } from './utils/functions';\nexport var Temprature = intrinsicComponent(function (_ref, ref) {\n var _ref$color = _ref.color,\n color = _ref$color === void 0 ? 'currentColor' : _ref$color,\n _ref$size = _ref.size,\n size = _ref$size === void 0 ? 14 : _ref$size,\n rest = _objectWithoutProperties(_ref, _excluded);\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n ref: ref,\n width: size,\n height: size,\n viewBox: \"0 0 50 50\",\n fill: \"none\",\n xmlns: \"http://www.w3.org/2000/svg\"\n }, rest), /*#__PURE__*/React.createElement(\"path\", {\n fillRule: \"evenodd\",\n clipRule: \"evenodd\",\n d: \"M9.48799 3.125H17.0311L17.0311 24.4063C17.0311 26.6148 18.1889 28.4084 19.5429 29.5401C21.7011 31.3438 23.0656 34.0456 23.0656 37.069C23.0656 42.4847 18.6753 46.875 13.2595 46.875C7.84382 46.875 3.45351 42.4847 3.45351 37.069C3.45351 34.0456 4.81799 31.3438 6.97617 29.5401C8.33021 28.4084 9.48799 26.6148 9.48799 24.4063V3.125ZM20.1561 3.125C20.1561 1.39911 18.757 0 17.0311 0H9.48799C7.7621 0 6.36299 1.39911 6.36299 3.125V24.4063C6.36299 25.4785 5.79482 26.4547 4.97216 27.1423C2.13398 29.5143 0.328506 33.0808 0.328506 37.069C0.328506 44.2106 6.11793 50 13.2595 50C20.4012 50 26.1906 44.2106 26.1906 37.069C26.1906 33.0808 24.3851 29.5143 21.5469 27.1423C20.7243 26.4547 20.1561 25.4785 20.1561 24.4063V3.125ZM35.6715 1.25C35.6715 0.559645 35.1119 0 34.4215 0H28.1715C27.4812 0 26.9215 0.559644 26.9215 1.25C26.9215 1.94036 27.4812 2.5 28.1715 2.5L34.4215 2.5C35.1119 2.5 35.6715 1.94036 35.6715 1.25ZM35.6715 8.24951C35.6715 7.55916 35.1119 6.99951 34.4215 6.99951H28.1715C27.4812 6.99951 26.9215 7.55916 26.9215 8.24951C26.9215 8.93987 27.4812 9.49951 28.1715 9.49951H34.4215C35.1119 9.49951 35.6715 8.93987 35.6715 8.24951ZM34.4215 13.999C35.1119 13.999 35.6715 14.5587 35.6715 15.249C35.6715 15.9394 35.1119 16.499 34.4215 16.499H28.1715C27.4812 16.499 26.9215 15.9394 26.9215 15.249C26.9215 14.5587 27.4812 13.999 28.1715 13.999H34.4215ZM13.2594 43.7501C16.366 43.7501 18.8844 41.2317 18.8844 38.1251C18.8844 35.4037 16.9519 33.1337 14.3844 32.6126V10.3662C14.3844 9.67582 13.8247 9.11617 13.1344 9.11617C12.444 9.11617 11.8844 9.67582 11.8844 10.3662V32.6694C9.44245 33.2829 7.63441 35.4928 7.63441 38.1251C7.63441 41.2317 10.1528 43.7501 13.2594 43.7501Z\",\n fill: color\n }));\n});\nexport default Temprature;","import _extends from \"@babel/runtime/helpers/extends\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/objectWithoutProperties\";\nvar _excluded = [\"color\", \"size\"];\nimport React from 'react';\nimport { intrinsicComponent } from './utils/functions';\nexport var Contrast = intrinsicComponent(function (_ref, ref) {\n var _ref$color = _ref.color,\n color = _ref$color === void 0 ? 'currentColor' : _ref$color,\n _ref$size = _ref.size,\n size = _ref$size === void 0 ? 14 : _ref$size,\n rest = _objectWithoutProperties(_ref, _excluded);\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n ref: ref,\n width: size,\n height: size,\n viewBox: \"0 0 50 50\",\n fill: \"none\",\n xmlns: \"http://www.w3.org/2000/svg\"\n }, rest), /*#__PURE__*/React.createElement(\"path\", {\n fillRule: \"evenodd\",\n clipRule: \"evenodd\",\n d: \"M20.4376 40.6858V38.5625V4.18746V3.31418C10.8133 4.10816 3.25006 12.1708 3.25006 22C3.25006 31.8292 10.8133 39.8918 20.4376 40.6858ZM40.7501 22C40.7501 31.8292 33.1868 39.8918 23.5626 40.6858V38.5625V4.18746V3.31418C33.1868 4.10816 40.7501 12.1708 40.7501 22ZM43.8751 22C43.8751 34.0812 34.0813 43.875 22.0001 43.875C9.91883 43.875 0.125061 34.0812 0.125061 22C0.125061 9.91877 9.91883 0.125 22.0001 0.125C34.0813 0.125 43.8751 9.91877 43.8751 22Z\",\n fill: color\n }));\n});\nexport default Contrast;","import _extends from \"@babel/runtime/helpers/extends\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/objectWithoutProperties\";\nvar _excluded = [\"color\", \"size\"];\nimport React from 'react';\nimport { intrinsicComponent } from './utils/functions';\nexport var FineTune = intrinsicComponent(function (_ref, ref) {\n var _ref$color = _ref.color,\n color = _ref$color === void 0 ? 'currentColor' : _ref$color,\n _ref$size = _ref.size,\n size = _ref$size === void 0 ? 14 : _ref$size,\n rest = _objectWithoutProperties(_ref, _excluded);\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n ref: ref,\n width: size,\n height: size,\n viewBox: \"0 0 50 50\",\n fill: \"none\",\n xmlns: \"http://www.w3.org/2000/svg\"\n }, rest), /*#__PURE__*/React.createElement(\"path\", {\n fillRule: \"evenodd\",\n clipRule: \"evenodd\",\n d: \"M16.3679 7.50003C15.7995 10.005 13.5592 11.875 10.8823 11.875C8.20528 11.875 5.96506 10.005 5.39665 7.50003H1.5448C0.854444 7.50003 0.2948 6.94039 0.2948 6.25003C0.2948 5.55967 0.854444 5.00003 1.5448 5.00003H5.39665C5.96506 2.49504 8.20528 0.625031 10.8823 0.625031C13.5592 0.625031 15.7995 2.49504 16.3679 5.00003H48.4557C49.1461 5.00003 49.7057 5.55967 49.7057 6.25003C49.7057 6.94039 49.1461 7.50003 48.4557 7.50003H16.3679ZM14.0073 6.25003C14.0073 7.97592 12.6082 9.37503 10.8823 9.37503C9.15637 9.37503 7.75726 7.97592 7.75726 6.25003C7.75726 4.52414 9.15637 3.12503 10.8823 3.12503C12.6082 3.12503 14.0073 4.52414 14.0073 6.25003Z\",\n fill: color\n }), /*#__PURE__*/React.createElement(\"path\", {\n fillRule: \"evenodd\",\n clipRule: \"evenodd\",\n d: \"M34.5715 27.625C37.2485 27.625 39.4887 25.755 40.0571 23.25H48.4554C49.1458 23.25 49.7054 22.6904 49.7054 22C49.7054 21.3096 49.1458 20.75 48.4554 20.75H40.0571C39.4887 18.245 37.2485 16.375 34.5715 16.375C31.8946 16.375 29.6543 18.245 29.0859 20.75H1.5448C0.854444 20.75 0.2948 21.3096 0.2948 22C0.2948 22.6904 0.854444 23.25 1.5448 23.25H29.0859C29.6543 25.755 31.8946 27.625 34.5715 27.625ZM34.5715 25.125C36.2974 25.125 37.6965 23.7259 37.6965 22C37.6965 20.2741 36.2974 18.875 34.5715 18.875C32.8456 18.875 31.4465 20.2741 31.4465 22C31.4465 23.7259 32.8456 25.125 34.5715 25.125Z\",\n fill: color\n }), /*#__PURE__*/React.createElement(\"path\", {\n fillRule: \"evenodd\",\n clipRule: \"evenodd\",\n d: \"M22.7702 39C22.2018 41.505 19.9615 43.375 17.2845 43.375C14.6076 43.375 12.3673 41.505 11.7989 39H1.5448C0.854444 39 0.2948 38.4403 0.2948 37.75C0.2948 37.0596 0.854444 36.5 1.5448 36.5H11.7989C12.3673 33.995 14.6076 32.125 17.2845 32.125C19.9615 32.125 22.2018 33.995 22.7702 36.5H48.4554C49.1458 36.5 49.7054 37.0596 49.7054 37.75C49.7054 38.4403 49.1458 39 48.4554 39H22.7702ZM20.4095 37.75C20.4095 39.4759 19.0104 40.875 17.2845 40.875C15.5587 40.875 14.1595 39.4759 14.1595 37.75C14.1595 36.0241 15.5587 34.625 17.2845 34.625C19.0104 34.625 20.4095 36.0241 20.4095 37.75Z\",\n fill: color\n }));\n});\nexport default FineTune;","import _extends from \"@babel/runtime/helpers/extends\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/objectWithoutProperties\";\nvar _excluded = [\"color\", \"size\"];\nimport React from 'react';\nimport { intrinsicComponent } from './utils/functions';\nexport var Saturation = intrinsicComponent(function (_ref, ref) {\n var _ref$color = _ref.color,\n color = _ref$color === void 0 ? 'currentColor' : _ref$color,\n _ref$size = _ref.size,\n size = _ref$size === void 0 ? 14 : _ref$size,\n rest = _objectWithoutProperties(_ref, _excluded);\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n ref: ref,\n width: size,\n height: size,\n viewBox: \"0 0 50 50\",\n fill: \"none\",\n xmlns: \"http://www.w3.org/2000/svg\"\n }, rest), /*#__PURE__*/React.createElement(\"path\", {\n fillRule: \"evenodd\",\n clipRule: \"evenodd\",\n d: \"M37.2341 37.6984H37.5121V37.4237C41.4447 33.4687 43.875 28.0182 43.875 22C43.875 15.9819 41.4447 10.5314 37.5121 6.57632V6.30045H37.2328C33.2942 2.47819 27.9219 0.125031 22 0.125031C9.91877 0.125031 0.125 9.9188 0.125 22C0.125 34.0813 9.91877 43.875 22 43.875C24.718 43.875 27.3203 43.3793 29.7213 42.4733H30.5303V42.1494C33.0389 41.0861 35.308 39.5679 37.2341 37.6984ZM20.4257 3.31519C10.807 4.1148 3.25 12.1749 3.25 22C3.25 31.8252 10.807 39.8853 20.4257 40.6849V3.31519ZM34.3871 36.0759C33.221 37.1029 31.9263 37.9873 30.5303 38.7017V5.29836C31.9263 6.01281 33.221 6.89715 34.3871 7.92411V36.0759ZM37.5121 11.4641C39.5556 14.4669 40.75 18.094 40.75 22C40.75 25.9061 39.5556 29.5332 37.5121 32.536V11.4641ZM23.5507 40.6868C24.8796 40.578 26.1693 40.3307 27.4053 39.9592V4.04089C26.1693 3.66941 24.8796 3.42203 23.5507 3.31324V40.6868Z\",\n fill: color\n }));\n});\nexport default Saturation;","import _extends from \"@babel/runtime/helpers/extends\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/objectWithoutProperties\";\nvar _excluded = [\"color\", \"size\"];\nimport React from 'react';\nimport { intrinsicComponent } from './utils/functions';\nexport var Annotate = intrinsicComponent(function (_ref, ref) {\n var _ref$color = _ref.color,\n color = _ref$color === void 0 ? 'currentColor' : _ref$color,\n _ref$size = _ref.size,\n size = _ref$size === void 0 ? 14 : _ref$size,\n rest = _objectWithoutProperties(_ref, _excluded);\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n ref: ref,\n width: size,\n height: size,\n viewBox: \"0 0 50 50\",\n fill: \"none\",\n xmlns: \"http://www.w3.org/2000/svg\"\n }, rest), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M46.1442 31.379C45.4585 31.379 44.8974 31.9429 44.8974 32.6321V43.7349C44.8974 45.8025 43.2267 47.4817 41.157 47.4943H6.22156C4.16433 47.4943 2.49361 45.8151 2.48114 43.7349V11.1283C2.48114 9.06067 4.15186 7.38147 6.22156 7.36894H17.2807C17.9665 7.36894 18.5275 6.80503 18.5275 6.1158C18.5275 5.42658 17.9665 4.86267 17.2807 4.86267H6.22156C2.79284 4.8752 0 7.66969 0 11.1283V43.7349C0 47.1935 2.79284 50.0005 6.22156 50.0005H41.157C44.5982 50.0005 47.3786 47.1935 47.3786 43.7474V32.6321C47.391 31.9429 46.83 31.379 46.1442 31.379Z\",\n fill: color\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M46.8923 1.65462C44.698 -0.55089 41.157 -0.55089 38.9627 1.65462L16.7571 23.9729C16.6075 24.1233 16.4953 24.3113 16.4329 24.5243L13.5154 35.1258C13.3907 35.5644 13.5154 36.0281 13.8396 36.3413C14.1513 36.6546 14.6251 36.7799 15.049 36.6672L25.5969 33.7348C25.8089 33.6722 25.9959 33.5719 26.1455 33.409L48.3636 11.0782C50.5455 8.87267 50.5455 5.31377 48.3636 3.10826L46.8923 1.65462ZM19.4751 24.7875L37.6535 6.51678L43.5135 12.4065L25.3351 30.6897L19.4751 24.7875ZM18.3031 27.1559L22.9911 31.8677L16.5077 33.6722L18.3031 27.1559ZM46.5931 9.31127L45.2715 10.6396L39.4115 4.74986L40.7331 3.42154C41.9425 2.206 43.9249 2.206 45.1343 3.42154L46.5931 4.88771C47.815 6.11578 47.815 8.09573 46.5931 9.31127Z\",\n fill: color\n }));\n});\nexport default Annotate;","import _extends from \"@babel/runtime/helpers/extends\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/objectWithoutProperties\";\nvar _excluded = [\"color\", \"size\"];\nimport React from 'react';\nimport { intrinsicComponent } from './utils/functions';\nexport var Blur = intrinsicComponent(function (_ref, ref) {\n var _ref$color = _ref.color,\n color = _ref$color === void 0 ? 'currentColor' : _ref$color,\n _ref$size = _ref.size,\n size = _ref$size === void 0 ? 14 : _ref$size,\n rest = _objectWithoutProperties(_ref, _excluded);\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n ref: ref,\n width: size,\n height: size,\n viewBox: \"0 0 50 50\",\n fill: \"none\",\n xmlns: \"http://www.w3.org/2000/svg\"\n }, rest), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M18.3626 41.293C17.5103 41.4285 16.7096 40.8474 16.5742 39.9952C16.4387 39.143 17.0198 38.3423 17.872 38.2068C18.2902 38.1403 18.6988 38.0456 19.0958 37.9246C21.9368 37.059 24.1957 34.8468 25.1254 32.0335C25.2671 31.6049 25.378 31.1621 25.4555 30.7076C25.6005 29.857 26.4076 29.2849 27.2583 29.4299C28.109 29.5749 28.681 30.3821 28.536 31.2327C28.432 31.8429 28.283 32.4379 28.0926 33.0142C26.8449 36.7893 23.8206 39.7519 20.0065 40.914C19.4728 41.0766 18.9239 41.2038 18.3626 41.293Z\",\n fill: color\n }), /*#__PURE__*/React.createElement(\"path\", {\n fillRule: \"evenodd\",\n clipRule: \"evenodd\",\n d: \"M33.9356 31.0645C33.9356 23.9644 24.1764 8.59028 19.4747 1.59549C18.2785 -0.184172 15.7216 -0.184172 14.5254 1.59548C9.82374 8.59028 0.0645752 23.9644 0.0645752 31.0645C0.0645752 40.4177 7.64685 48 17.0001 48C26.3533 48 33.9356 40.4177 33.9356 31.0645ZM30.8106 31.0645C30.8106 29.8836 30.375 28.0316 29.4236 25.578C28.5 23.1959 27.1988 20.5159 25.7187 17.7756C22.8106 12.3913 19.3287 6.98743 17.0001 3.51586C14.6715 6.98743 11.1895 12.3913 8.28145 17.7756C6.80135 20.5159 5.50017 23.1959 4.57655 25.578C3.62517 28.0316 3.18958 29.8836 3.18958 31.0645C3.18958 38.6918 9.37274 44.875 17.0001 44.875C24.6274 44.875 30.8106 38.6918 30.8106 31.0645Z\",\n fill: color\n }));\n});\nexport default Blur;","import _extends from \"@babel/runtime/helpers/extends\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/objectWithoutProperties\";\nvar _excluded = [\"color\", \"size\"];\nimport React from 'react';\nimport { intrinsicComponent } from './utils/functions';\nexport var PinOutline = intrinsicComponent(function (_ref, ref) {\n var _ref$color = _ref.color,\n color = _ref$color === void 0 ? 'currentColor' : _ref$color,\n _ref$size = _ref.size,\n size = _ref$size === void 0 ? 14 : _ref$size,\n rest = _objectWithoutProperties(_ref, _excluded);\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n ref: ref,\n width: size,\n height: size,\n viewBox: \"0 0 50 50\",\n fill: \"none\",\n xmlns: \"http://www.w3.org/2000/svg\"\n }, rest), /*#__PURE__*/React.createElement(\"path\", {\n fillRule: \"evenodd\",\n clipRule: \"evenodd\",\n d: \"M43.0081 15.2287L36.7869 17.6214L28.935 29.9601C30.5809 33.9266 30.3662 38.0903 27.1408 41.3158L26.5656 41.8909C25.9554 42.5011 24.9661 42.5011 24.3559 41.8909L14.4122 31.9472L2.99211 43.3673C2.38192 43.9775 1.3926 43.9775 0.782403 43.3673C0.17221 42.7571 0.172211 41.7678 0.782403 41.1576L12.2025 29.7375L2.25883 19.7938C1.64864 19.1836 1.64864 18.1943 2.25883 17.5841L2.50512 17.3378C5.73058 14.1123 10.2231 13.5688 14.1897 15.2147L26.5283 7.36283L28.9211 1.14165C29.327 0.0863053 30.6847 -0.201832 31.4843 0.597706L43.552 12.6655C44.3516 13.465 44.0634 14.8228 43.0081 15.2287ZM29.0752 9.44618L30.9747 4.50752L39.6422 13.1751L34.7035 15.0745L25.4251 29.655L26.0486 31.1577C27.234 34.0146 27.0773 36.5309 25.4342 38.5498L5.64209 18.7576C7.75439 17.2384 10.4304 17.0382 12.992 18.1011L14.4948 18.7246L29.0752 9.44618Z\",\n fill: color\n }));\n});\nexport default PinOutline;","import _extends from \"@babel/runtime/helpers/extends\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/objectWithoutProperties\";\nvar _excluded = [\"color\", \"size\"];\nimport React from 'react';\nimport { intrinsicComponent } from './utils/functions';\nexport var Duplicate = intrinsicComponent(function (_ref, ref) {\n var _ref$color = _ref.color,\n color = _ref$color === void 0 ? 'currentColor' : _ref$color,\n _ref$size = _ref.size,\n size = _ref$size === void 0 ? 14 : _ref$size,\n rest = _objectWithoutProperties(_ref, _excluded);\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n ref: ref,\n width: size,\n height: size,\n viewBox: \"0 0 50 50\",\n fill: \"none\",\n xmlns: \"http://www.w3.org/2000/svg\"\n }, rest), /*#__PURE__*/React.createElement(\"path\", {\n fillRule: \"evenodd\",\n clipRule: \"evenodd\",\n d: \"M0.312012 34.847V3.39883C0.312012 1.67294 1.71112 0.273834 3.43701 0.273834H26.807C28.5329 0.273834 29.932 1.67294 29.932 3.39883V34.847C29.932 36.5729 28.5329 37.972 26.807 37.972H3.43701C1.71112 37.972 0.312012 36.5729 0.312012 34.847ZM3.43701 34.847V3.39883L26.807 3.39883L26.807 34.847L3.43701 34.847Z\",\n fill: color\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M35.6874 12.5434C35.6874 11.6805 34.9878 10.9809 34.1249 10.9809C33.2619 10.9809 32.5624 11.6805 32.5624 12.5434V40.6009H9.89033C9.02739 40.6009 8.32783 41.3005 8.32783 42.1634C8.32783 43.0263 9.02739 43.7259 9.89033 43.7259H34.1249C34.9878 43.7259 35.6874 43.0263 35.6874 42.1634V12.5434Z\",\n fill: color\n }));\n});\nexport default Duplicate;","import _extends from \"@babel/runtime/helpers/extends\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/objectWithoutProperties\";\nvar _excluded = [\"color\", \"size\"];\nimport React from 'react';\nimport { intrinsicComponent } from './utils/functions';\nexport var DeleteOutline = intrinsicComponent(function (_ref, ref) {\n var _ref$color = _ref.color,\n color = _ref$color === void 0 ? 'currentColor' : _ref$color,\n _ref$size = _ref.size,\n size = _ref$size === void 0 ? 14 : _ref$size,\n rest = _objectWithoutProperties(_ref, _excluded);\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n ref: ref,\n width: size,\n height: size,\n viewBox: \"0 0 50 50\",\n fill: \"none\",\n xmlns: \"http://www.w3.org/2000/svg\"\n }, rest), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M15.75 17.3125C15.75 16.4496 16.4496 15.75 17.3125 15.75C18.1754 15.75 18.875 16.4496 18.875 17.3125L18.875 32.9375C18.875 33.8005 18.1754 34.5 17.3125 34.5C16.4496 34.5 15.75 33.8005 15.75 32.9375L15.75 17.3125Z\",\n fill: color\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M26.6875 15.75C25.8246 15.75 25.125 16.4496 25.125 17.3125L25.125 32.9375C25.125 33.8005 25.8246 34.5 26.6875 34.5C27.5504 34.5 28.25 33.8005 28.25 32.9375V17.3125C28.25 16.4496 27.5504 15.75 26.6875 15.75Z\",\n fill: color\n }), /*#__PURE__*/React.createElement(\"path\", {\n fillRule: \"evenodd\",\n clipRule: \"evenodd\",\n d: \"M12.625 6.37503V3.25003C12.625 1.52414 14.0241 0.125031 15.75 0.125031H28.25C29.9759 0.125031 31.375 1.52414 31.375 3.25003V6.37503H42.3125C43.1754 6.37503 43.875 7.07459 43.875 7.93753C43.875 8.80048 43.1754 9.50003 42.3125 9.50003H39.1875V40.75C39.1875 42.4759 37.7884 43.875 36.0625 43.875H7.9375C6.21161 43.875 4.8125 42.4759 4.8125 40.75V9.50003L1.6875 9.50003C0.824554 9.50003 0.125 8.80048 0.125 7.93753C0.125 7.07459 0.824555 6.37503 1.6875 6.37503H12.625ZM15.75 3.25003H28.25V6.37503H15.75V3.25003ZM7.9375 9.50003L7.9375 40.75H36.0625V9.50003H7.9375Z\",\n fill: color\n }));\n});\nexport default DeleteOutline;","import _extends from \"@babel/runtime/helpers/extends\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/objectWithoutProperties\";\nvar _excluded = [\"color\", \"size\"];\nimport React from 'react';\nimport { intrinsicComponent } from './utils/functions';\nexport var CropFrame = intrinsicComponent(function (_ref, ref) {\n var _ref$color = _ref.color,\n color = _ref$color === void 0 ? 'currentColor' : _ref$color,\n _ref$size = _ref.size,\n size = _ref$size === void 0 ? 14 : _ref$size,\n rest = _objectWithoutProperties(_ref, _excluded);\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n ref: ref,\n width: size,\n height: size,\n viewBox: \"0 0 50 50\",\n fill: \"none\",\n xmlns: \"http://www.w3.org/2000/svg\"\n }, rest), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M43 3H31.75V0.5H43C44.3807 0.5 45.5 1.61929 45.5 3V14.25H43V3Z\",\n fill: color\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M3 14.25V3H14.25V0.5H3C1.61929 0.5 0.5 1.61929 0.5 3V14.25H3Z\",\n fill: color\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M0.5 31.75V43C0.5 44.3807 1.61929 45.5 3 45.5H14.25V43H3V31.75H0.5Z\",\n fill: color\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M43 31.75H45.5V43C45.5 44.3807 44.3807 45.5 43 45.5H31.75V43H43V31.75Z\",\n fill: color\n }));\n});\nexport default CropFrame;","import _extends from \"@babel/runtime/helpers/extends\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/objectWithoutProperties\";\nvar _excluded = [\"color\", \"size\"];\nimport React from 'react';\nimport { intrinsicComponent } from './utils/functions';\nexport var Portrait = intrinsicComponent(function (_ref, ref) {\n var _ref$color = _ref.color,\n color = _ref$color === void 0 ? 'currentColor' : _ref$color,\n _ref$size = _ref.size,\n size = _ref$size === void 0 ? 14 : _ref$size,\n rest = _objectWithoutProperties(_ref, _excluded);\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n ref: ref,\n width: size,\n height: size,\n viewBox: \"0 0 36 52\",\n fill: \"none\",\n xmlns: \"http://www.w3.org/2000/svg\"\n }, rest), /*#__PURE__*/React.createElement(\"path\", {\n fillRule: \"evenodd\",\n clipRule: \"evenodd\",\n d: \"M32.0559 46.8755L32.0559 3.12555L3.93091 3.12555L3.93091 46.8755H32.0559ZM35.1809 3.12555C35.1809 1.39966 33.7818 0.000549316 32.0559 0.000549316H3.93091C2.20502 0.000549316 0.805908 1.39966 0.805908 3.12555V46.8755C0.805908 48.6014 2.20502 50.0005 3.93091 50.0005H32.0559C33.7818 50.0005 35.1809 48.6014 35.1809 46.8755L35.1809 3.12555Z\",\n fill: color\n }));\n});\nexport default Portrait;","import _extends from \"@babel/runtime/helpers/extends\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/objectWithoutProperties\";\nvar _excluded = [\"color\", \"size\"];\nimport React from 'react';\nimport { intrinsicComponent } from './utils/functions';\nexport var WarningOutline = intrinsicComponent(function (_ref, ref) {\n var _ref$color = _ref.color,\n color = _ref$color === void 0 ? 'currentColor' : _ref$color,\n _ref$size = _ref.size,\n size = _ref$size === void 0 ? 14 : _ref$size,\n rest = _objectWithoutProperties(_ref, _excluded);\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n ref: ref,\n width: size,\n height: size,\n viewBox: \"0 0 50 50\",\n fill: \"none\",\n xmlns: \"http://www.w3.org/2000/svg\"\n }, rest), /*#__PURE__*/React.createElement(\"path\", {\n fillRule: \"evenodd\",\n clipRule: \"evenodd\",\n d: \"M45.961 39.0119L28.2837 7.27185C27.5934 6.17538 26.3971 5.5 24.9981 5.5C23.5956 5.5 22.3967 6.17887 21.7073 7.28034L4.06571 38.9613L4.03009 39.0197C3.33595 40.159 3.32316 41.4697 3.9939 42.6216C4.67405 43.786 5.89 44.5 7.34459 44.5H42.554C44.0596 44.5 45.3464 43.7436 46.0016 42.6231C46.6817 41.4564 46.652 40.1455 45.9968 39.0706L45.961 39.0119ZM49.0254 44.3856C47.7038 46.6495 45.2246 48 42.554 48H7.34459C4.67398 48 2.29272 46.6495 0.970942 44.3856C-0.347811 42.1231 -0.322029 39.4361 1.04116 37.1987L18.6646 5.55018C18.6697 5.5418 18.6743 5.53342 18.6789 5.52504C18.6836 5.51666 18.6882 5.50828 18.6932 5.49989C20.0278 3.30867 22.3849 2 24.9981 2C27.6114 2 29.9685 3.30867 31.303 5.49989L48.9853 37.2489C50.3185 39.436 50.3442 42.1232 49.0254 44.3856Z\",\n fill: color\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M22.0001 16C22.0001 14.3431 23.3433 13 25.0001 13C26.657 13 28.0001 14.3431 28.0001 16V28C28.0001 29.6569 26.657 31 25.0001 31C23.3433 31 22.0001 29.6569 22.0001 28V16Z\",\n fill: color\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M28.0001 37C28.0001 38.6569 26.657 40 25.0001 40C23.3433 40 22.0001 38.6569 22.0001 37C22.0001 35.3431 23.3433 34 25.0001 34C26.657 34 28.0001 35.3431 28.0001 37Z\",\n fill: color\n }));\n});\nexport default WarningOutline;","import _extends from \"@babel/runtime/helpers/extends\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/objectWithoutProperties\";\nvar _excluded = [\"color\", \"size\"];\nimport React from 'react';\nimport { intrinsicComponent } from './utils/functions';\nexport var Success = intrinsicComponent(function (_ref, ref) {\n var _ref$color = _ref.color,\n color = _ref$color === void 0 ? 'currentColor' : _ref$color,\n _ref$size = _ref.size,\n size = _ref$size === void 0 ? 14 : _ref$size,\n rest = _objectWithoutProperties(_ref, _excluded);\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n ref: ref,\n width: size,\n height: size,\n viewBox: \"0 0 21 21\",\n fill: \"none\",\n xmlns: \"http://www.w3.org/2000/svg\"\n }, rest), /*#__PURE__*/React.createElement(\"path\", {\n fillRule: \"evenodd\",\n clipRule: \"evenodd\",\n d: \"M20.5 10.5001C20.5 16.023 16.0228 20.5001 10.5 20.5001C4.97714 20.5001 0.5 16.023 0.5 10.5001C0.5 4.97727 4.97714 0.500122 10.5 0.500122C16.0228 0.500122 20.5 4.97727 20.5 10.5001ZM7.88239 9.56904C8.00439 9.62145 8.11473 9.69763 8.20698 9.79314L9.49998 11.0861L12.793 7.79314C12.8852 7.69763 12.9956 7.62145 13.1176 7.56904C13.2396 7.51663 13.3708 7.48905 13.5036 7.48789C13.6363 7.48674 13.768 7.51204 13.8909 7.56232C14.0138 7.6126 14.1255 7.68686 14.2194 7.78075C14.3133 7.87464 14.3875 7.98629 14.4378 8.10919C14.4881 8.23208 14.5134 8.36376 14.5122 8.49654C14.5111 8.62932 14.4835 8.76054 14.4311 8.88255C14.3787 9.00455 14.3025 9.1149 14.207 9.20714L10.207 13.2071C10.0194 13.3946 9.76514 13.4999 9.49998 13.4999C9.23482 13.4999 8.98051 13.3946 8.79298 13.2071L6.79298 11.2071C6.69747 11.1149 6.62129 11.0046 6.56888 10.8825C6.51647 10.7605 6.48889 10.6293 6.48773 10.4965C6.48658 10.3638 6.51188 10.2321 6.56216 10.1092C6.61244 9.98629 6.6867 9.87464 6.78059 9.78075C6.87448 9.68686 6.98613 9.6126 7.10903 9.56232C7.23193 9.51204 7.3636 9.48674 7.49638 9.48789C7.62916 9.48905 7.76038 9.51663 7.88239 9.56904Z\",\n fill: color\n }));\n});\nexport default Success;","import _extends from \"@babel/runtime/helpers/extends\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/objectWithoutProperties\";\nvar _excluded = [\"color\", \"size\"];\nimport React from 'react';\nimport { intrinsicComponent } from './utils/functions';\nexport var Error = intrinsicComponent(function (_ref, ref) {\n var _ref$color = _ref.color,\n color = _ref$color === void 0 ? 'currentColor' : _ref$color,\n _ref$size = _ref.size,\n size = _ref$size === void 0 ? 14 : _ref$size,\n rest = _objectWithoutProperties(_ref, _excluded);\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n ref: ref,\n width: size,\n height: size,\n viewBox: \"0 0 21 21\",\n fill: \"none\",\n xmlns: \"http://www.w3.org/2000/svg\"\n }, rest), /*#__PURE__*/React.createElement(\"path\", {\n fillRule: \"evenodd\",\n clipRule: \"evenodd\",\n d: \"M10.5 20.5001C16.0228 20.5001 20.5 16.023 20.5 10.5001C20.5 4.97727 16.0228 0.500122 10.5 0.500122C4.97715 0.500122 0.5 4.97727 0.5 10.5001C0.5 16.023 4.97715 20.5001 10.5 20.5001ZM15.4375 7.0912L11.8155 10.7132L15.4638 14.309C15.6213 14.4665 15.7 14.6503 15.7 14.8865C15.7 15.1227 15.6213 15.3064 15.4638 15.4639C15.3063 15.6214 15.1226 15.7001 14.8864 15.7001C14.6501 15.7001 14.4664 15.6214 14.3089 15.4639L10.6869 11.8419L7.06483 15.4639C6.77612 15.7789 6.25118 15.7789 5.93622 15.4639C5.77874 15.3064 5.7 15.0964 5.7 14.8865C5.7 14.6765 5.77874 14.4928 5.93622 14.3353L9.55827 10.7132L5.93622 7.0912C5.77874 6.93372 5.7 6.72374 5.7 6.51377C5.7 6.3038 5.77874 6.12007 5.93622 5.96259C6.25118 5.64763 6.74987 5.64763 7.06483 5.96259L10.6869 9.58464L14.3089 5.93634C14.5976 5.62138 15.1226 5.62138 15.4375 5.93634C15.595 6.09382 15.6738 6.27755 15.6738 6.51377C15.6738 6.74999 15.595 6.93372 15.4375 7.0912Z\",\n fill: color\n }));\n});\nexport default Error;","import _extends from \"@babel/runtime/helpers/extends\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/objectWithoutProperties\";\nvar _excluded = [\"color\", \"size\"];\nimport React from 'react';\nimport { intrinsicComponent } from './utils/functions';\nexport var ErrorOutline = intrinsicComponent(function (_ref, ref) {\n var _ref$color = _ref.color,\n color = _ref$color === void 0 ? 'currentColor' : _ref$color,\n _ref$size = _ref.size,\n size = _ref$size === void 0 ? 14 : _ref$size,\n rest = _objectWithoutProperties(_ref, _excluded);\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n ref: ref,\n width: size,\n height: size,\n viewBox: \"0 0 52 52\",\n fill: \"none\",\n xmlns: \"http://www.w3.org/2000/svg\"\n }, rest), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M37.3438 16.4782L28.2887 25.5333L37.4095 34.5228C37.8032 34.9165 38 35.3758 38 35.9664C38 36.5569 37.8032 37.0162 37.4095 37.4099C37.0158 37.8036 36.5564 38.0005 35.9659 38.0005C35.3753 38.0005 34.916 37.8036 34.5223 37.4099L25.4672 28.3548L16.4121 37.4099C15.6903 38.1973 14.378 38.1973 13.5906 37.4099C13.1969 37.0162 13 36.4913 13 35.9664C13 35.4414 13.1969 34.9821 13.5906 34.5884L22.6457 25.5333L13.5906 16.4782C13.1969 16.0845 13 15.5595 13 15.0346C13 14.5097 13.1969 14.0504 13.5906 13.6567C14.378 12.8693 15.6247 12.8693 16.4121 13.6567L25.4672 22.7118L34.5223 13.591C35.2441 12.8036 36.5564 12.8036 37.3438 13.591C37.7375 13.9847 37.9344 14.4441 37.9344 15.0346C37.9344 15.6252 37.7375 16.0845 37.3438 16.4782Z\",\n fill: color\n }), /*#__PURE__*/React.createElement(\"path\", {\n fillRule: \"evenodd\",\n clipRule: \"evenodd\",\n d: \"M-0.000488281 25.0005C-0.000488281 38.7972 11.2028 50.0005 24.9995 50.0005C38.6925 50.0005 49.9995 38.7972 49.9995 25.0005C49.9995 11.2038 38.7962 0.000488281 24.9995 0.000488281C11.2028 0.000488281 -0.000488281 11.2038 -0.000488281 25.0005ZM3.63022 24.8968C3.63022 13.1748 13.1738 3.52746 24.9995 3.52746C36.8252 3.52746 46.3688 13.1748 46.3688 24.8968C46.3688 36.6187 36.8252 46.266 24.9995 46.266C13.2775 46.266 3.63022 36.6187 3.63022 24.8968Z\",\n fill: color\n }));\n});\nexport default ErrorOutline;","import _extends from \"@babel/runtime/helpers/extends\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/objectWithoutProperties\";\nvar _excluded = [\"color\", \"size\"];\nimport React from 'react';\nimport { intrinsicComponent } from './utils/functions';\nexport var Loading = intrinsicComponent(function (_ref, ref) {\n var _ref$color = _ref.color,\n color = _ref$color === void 0 ? 'currentColor' : _ref$color,\n _ref$size = _ref.size,\n size = _ref$size === void 0 ? 14 : _ref$size,\n rest = _objectWithoutProperties(_ref, _excluded);\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n ref: ref,\n width: size,\n height: size,\n viewBox: \"0 0 50 50\",\n fill: \"none\",\n xmlns: \"http://www.w3.org/2000/svg\"\n }, rest), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M29.9338 5.26853C27.8524 4.75154 25.7006 4.56814 23.5381 4.72351C22.4874 4.799 21.4379 4.95535 20.4183 5.18855L19.3724 0.636496C20.6245 0.350265 21.9128 0.158175 23.2017 0.065597C25.8579 -0.125223 28.5034 0.100753 31.0653 0.737277L29.9338 5.26853Z\",\n fill: color\n }), /*#__PURE__*/React.createElement(\"path\", {\n opacity: \"0.9\",\n d: \"M40.6131 11.9278C38.5498 9.48098 35.9044 7.52805 32.963 6.2805L34.7952 1.98303C38.4106 3.51633 41.6615 5.91575 44.1962 8.922L40.6131 11.9278Z\",\n fill: color\n }), /*#__PURE__*/React.createElement(\"path\", {\n opacity: \"0.8\",\n d: \"M45.3329 23.5739L45.3303 23.5392C45.097 20.3085 44.1359 17.275 42.4734 14.5227L46.4838 12.1129C48.5302 15.501 49.7133 19.2325 50 23.2036L45.3329 23.5739Z\",\n fill: color\n }), /*#__PURE__*/React.createElement(\"path\", {\n opacity: \"0.7\",\n d: \"M46.2688 38.2308L42.2981 35.7565C43.9958 33.0458 45.0372 29.9357 45.3095 26.7618L49.9744 27.1604C49.639 31.0674 48.3577 34.8958 46.2688 38.2308Z\",\n fill: color\n }), /*#__PURE__*/React.createElement(\"path\", {\n opacity: \"0.6\",\n d: \"M34.4209 48.1735L32.6626 43.8456C35.6192 42.6505 38.2938 40.7405 40.3975 38.3222L43.9338 41.3828C41.3483 44.3551 38.0588 46.7033 34.4209 48.1735V48.1735Z\",\n fill: color\n }), /*#__PURE__*/React.createElement(\"path\", {\n opacity: \"0.5\",\n d: \"M26.8033 49.9345C24.1593 50.1242 21.5262 49.9011 18.9766 49.2716L20.1013 44.7386C22.1729 45.25 24.3148 45.4309 26.4673 45.2766C27.5283 45.2004 28.5879 45.0416 29.6165 44.8049L30.6697 49.3551C29.4061 49.6459 28.1052 49.841 26.8033 49.9345V49.9345Z\",\n fill: color\n }), /*#__PURE__*/React.createElement(\"path\", {\n opacity: \"0.4\",\n d: \"M15.2449 48.0311C11.6272 46.5033 8.37276 44.1086 5.83362 41.1063L9.412 38.0952C11.479 40.5388 14.1272 42.4877 17.0704 43.7306L15.2449 48.0311Z\",\n fill: color\n }), /*#__PURE__*/React.createElement(\"path\", {\n opacity: \"0.3\",\n d: \"M3.54069 37.9198C1.48217 34.5223 0.292537 30.78 0.00479729 26.7959L0 26.7274L4.66972 26.3918L4.67579 26.478C4.90861 29.7017 5.87511 32.7443 7.54751 35.504L3.54069 37.9198Z\",\n fill: color\n }), /*#__PURE__*/React.createElement(\"path\", {\n opacity: \"0.2\",\n d: \"M4.69761 23.2075L0.0335693 22.802C0.374666 18.8955 1.66191 15.0691 3.75587 11.7373L7.72274 14.2175C6.02088 16.9257 4.97478 20.0344 4.69761 23.2075V23.2075Z\",\n fill: color\n }));\n});\nexport default Loading;","import _extends from \"@babel/runtime/helpers/extends\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/objectWithoutProperties\";\nvar _excluded = [\"color\", \"color2\", \"size\"];\nimport React from 'react';\nimport { intrinsicComponent } from './utils/functions';\nexport var ColorPicker = intrinsicComponent(function (_ref, ref) {\n var _ref$color = _ref.color,\n color = _ref$color === void 0 ? 'currentColor' : _ref$color,\n _ref$color2 = _ref.color2,\n color2 = _ref$color2 === void 0 ? '#F8FAFB' : _ref$color2,\n _ref$size = _ref.size,\n size = _ref$size === void 0 ? 14 : _ref$size,\n rest = _objectWithoutProperties(_ref, _excluded);\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n ref: ref,\n width: size,\n height: size,\n viewBox: \"0 0 42 42\",\n fill: \"none\",\n xmlns: \"http://www.w3.org/2000/svg\"\n }, rest), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M42.0001 6.11477C42.0001 4.48089 41.3639 2.94468 40.2086 1.78931C37.8238 -0.595528 33.9433 -0.595878 31.5582 1.78931L25.666 7.68191L22.9908 5.00654C22.5351 4.5509 21.7965 4.5509 21.3407 5.00654L17.8405 8.50695C17.3849 8.96259 17.3849 9.70141 17.8405 10.1572L20.5157 12.8325L3.63971 29.7097C3.5116 29.8378 3.41511 29.9939 3.35783 30.1658L2.27826 33.4048L1.30626 34.3769C-0.435198 36.1186 -0.435314 38.9525 1.30626 40.6943C3.04783 42.436 5.88157 42.4359 7.62314 40.6943L8.59514 39.7223L11.834 38.6426C12.0058 38.5853 12.1619 38.4888 12.29 38.3607L29.1661 21.4835L31.8413 24.1588C32.297 24.6145 33.0357 24.6145 33.4914 24.1588L36.9916 20.6584C37.4472 20.2028 37.4472 19.464 36.9916 19.0082L34.3164 16.3328L40.2086 10.4402C41.3639 9.28486 42.0001 7.74876 42.0001 6.11477ZM20.5157 26.8341H9.81507L22.1658 14.4826L27.516 19.8333L20.5157 26.8341ZM32.6663 21.6836L20.3156 9.332L22.1657 7.48168L34.5163 19.8333L32.6663 21.6836ZM38.5585 8.79014L32.6663 14.6827L27.316 9.332L33.2081 3.4394C34.6833 1.96421 37.0835 1.96409 38.5584 3.4394C40.0263 4.84774 40.0261 7.3818 38.5585 8.79014Z\",\n fill: color\n }));\n});\nexport default ColorPicker;","import _extends from \"@babel/runtime/helpers/extends\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/objectWithoutProperties\";\nvar _excluded = [\"color\", \"size\"];\nimport React from 'react';\nimport { intrinsicComponent } from './utils/functions';\nexport var Menu = intrinsicComponent(function (_ref, ref) {\n var _ref$color = _ref.color,\n color = _ref$color === void 0 ? 'currentColor' : _ref$color,\n _ref$size = _ref.size,\n size = _ref$size === void 0 ? 14 : _ref$size,\n rest = _objectWithoutProperties(_ref, _excluded);\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n ref: ref,\n width: size,\n height: size,\n viewBox: \"0 0 50 50\",\n fill: \"none\",\n xmlns: \"http://www.w3.org/2000/svg\"\n }, rest), /*#__PURE__*/React.createElement(\"path\", {\n fillRule: \"evenodd\",\n clipRule: \"evenodd\",\n d: \"M0 7.75049C0 6.92206 0.671573 6.25049 1.5 6.25049H48.5C49.3284 6.25049 50 6.92206 50 7.75049V9.43806C50 10.2665 49.3284 10.9381 48.5 10.9381H1.5C0.671571 10.9381 0 10.2665 0 9.43806V7.75049ZM0 24.1567C0 23.3283 0.671573 22.6567 1.5 22.6567H48.5C49.3284 22.6567 50 23.3283 50 24.1567V25.8443C50 26.6727 49.3284 27.3443 48.5 27.3443H1.5C0.671571 27.3443 0 26.6727 0 25.8443V24.1567ZM1.5 39.0629C0.671573 39.0629 0 39.7345 0 40.5629V42.2505C0 43.0789 0.671571 43.7505 1.5 43.7505H48.5C49.3284 43.7505 50 43.0789 50 42.2505V40.5629C50 39.7345 49.3284 39.0629 48.5 39.0629H1.5Z\",\n fill: color\n }));\n});\nexport default Menu;","import _extends from \"@babel/runtime/helpers/extends\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/objectWithoutProperties\";\nvar _excluded = [\"color\", \"size\"];\nimport React from 'react';\nimport { intrinsicComponent } from './utils/functions';\nexport var MoveDownOutline = intrinsicComponent(function (_ref, ref) {\n var _ref$color = _ref.color,\n color = _ref$color === void 0 ? 'currentColor' : _ref$color,\n _ref$size = _ref.size,\n size = _ref$size === void 0 ? 14 : _ref$size,\n rest = _objectWithoutProperties(_ref, _excluded);\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n ref: ref,\n width: size,\n height: size,\n viewBox: \"0 0 46 26\",\n fill: \"none\",\n xmlns: \"http://www.w3.org/2000/svg\"\n }, rest), /*#__PURE__*/React.createElement(\"path\", {\n fillRule: \"evenodd\",\n clipRule: \"evenodd\",\n d: \"M1.23229 1.23267C2.20863 0.256387 3.79154 0.256434 4.76782 1.23277L22.9989 19.465L41.2323 1.23267C42.2086 0.256387 43.7915 0.256434 44.7678 1.23277C45.7441 2.20911 45.7441 3.79203 44.7677 4.76831L24.7665 24.7683C24.2977 25.2371 23.6618 25.5005 22.9987 25.5005C22.3357 25.5005 21.6998 25.2371 21.231 24.7682L1.23218 4.7682C0.255899 3.79186 0.255946 2.20895 1.23229 1.23267Z\",\n fill: color\n }));\n});\nexport default MoveDownOutline;","import _extends from \"@babel/runtime/helpers/extends\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/objectWithoutProperties\";\nvar _excluded = [\"color\", \"size\"];\nimport React from 'react';\nimport { intrinsicComponent } from './utils/functions';\nexport var MoveUpOutline = intrinsicComponent(function (_ref, ref) {\n var _ref$color = _ref.color,\n color = _ref$color === void 0 ? 'currentColor' : _ref$color,\n _ref$size = _ref.size,\n size = _ref$size === void 0 ? 14 : _ref$size,\n rest = _objectWithoutProperties(_ref, _excluded);\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n ref: ref,\n width: size,\n height: size,\n viewBox: \"0 0 46 26\",\n fill: \"none\",\n xmlns: \"http://www.w3.org/2000/svg\"\n }, rest), /*#__PURE__*/React.createElement(\"path\", {\n fillRule: \"evenodd\",\n clipRule: \"evenodd\",\n d: \"M21.2326 1.23271C22.2089 0.256404 23.7918 0.256417 24.7681 1.23274L44.7678 21.2327C45.7441 22.2091 45.7441 23.792 44.7678 24.7683C43.7914 25.7446 42.2085 25.7446 41.2322 24.7682L23.0003 6.53602L4.76775 24.7683C3.79143 25.7446 2.20852 25.7446 1.23222 24.7682C0.255916 23.7919 0.255928 22.209 1.23225 21.2327L21.2326 1.23271Z\",\n fill: color\n }));\n});\nexport default MoveUpOutline;","import _extends from \"@babel/runtime/helpers/extends\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/objectWithoutProperties\";\nvar _excluded = [\"color\", \"size\"];\nimport React from 'react';\nimport { intrinsicComponent } from './utils/functions';\nexport var ArrowSidebarLeftOutline = intrinsicComponent(function (_ref, ref) {\n var _ref$color = _ref.color,\n color = _ref$color === void 0 ? 'currentColor' : _ref$color,\n _ref$size = _ref.size,\n size = _ref$size === void 0 ? 14 : _ref$size,\n rest = _objectWithoutProperties(_ref, _excluded);\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n ref: ref,\n width: size,\n height: size,\n viewBox: \"0 0 50 50\",\n fill: \"none\",\n xmlns: \"http://www.w3.org/2000/svg\"\n }, rest), /*#__PURE__*/React.createElement(\"path\", {\n fillRule: \"evenodd\",\n clipRule: \"evenodd\",\n d: \"M25 47.5006C37.4264 47.5006 47.5 37.427 47.5 25.0006C47.5 12.5742 37.4264 2.50061 25 2.50061C12.5736 2.50061 2.5 12.5742 2.5 25.0006C2.5 37.427 12.5736 47.5006 25 47.5006ZM25 50.0006C38.8071 50.0006 50 38.8077 50 25.0006C50 11.1935 38.8071 0.000610352 25 0.000610352C11.1929 0.000610352 0 11.1935 0 25.0006C0 38.8077 11.1929 50.0006 25 50.0006Z\",\n fill: color\n }), /*#__PURE__*/React.createElement(\"path\", {\n fillRule: \"evenodd\",\n clipRule: \"evenodd\",\n d: \"M27.7355 35.1357C27.1751 35.7705 26.2217 35.7926 25.6359 35.1773L17.3026 26.423C17.0301 26.1368 16.8819 25.755 16.8752 25.3647C16.8686 24.9745 17.0037 24.5881 17.2652 24.2923L25.5985 14.8647C26.1593 14.2302 27.1128 14.2089 27.6981 14.8247C28.2539 15.4093 28.2679 16.3516 27.7348 16.9546L20.36 25.2978L27.6974 33.0057C28.2536 33.59 28.2681 34.5323 27.7355 35.1357ZM26.6695 34.3756C26.7058 34.3748 26.753 34.3599 26.7984 34.3085C26.9042 34.1886 26.8989 33.9798 26.792 33.8676L19.0594 25.7444C18.8357 25.5095 18.829 25.1425 19.0438 24.8995L26.7983 16.1268C26.9041 16.007 26.899 15.7983 26.7921 15.6859C26.7464 15.6377 26.7001 15.6249 26.6639 15.6256C26.6276 15.6263 26.5805 15.6412 26.5351 15.6926L18.2017 25.1202C18.1562 25.1717 18.1235 25.2514 18.1251 25.3435C18.1266 25.4356 18.1619 25.5128 18.208 25.5612L26.5413 34.3154C26.5871 34.3635 26.6334 34.3763 26.6695 34.3756Z\",\n fill: color\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M26.7984 34.3085C26.753 34.3599 26.7058 34.3748 26.6695 34.3756C26.6334 34.3763 26.5871 34.3635 26.5413 34.3154L18.208 25.5612C18.1619 25.5128 18.1266 25.4356 18.1251 25.3435C18.1235 25.2514 18.1562 25.1717 18.2017 25.1202L26.5351 15.6926C26.5805 15.6412 26.6276 15.6263 26.6639 15.6256C26.7001 15.6249 26.7464 15.6377 26.7921 15.6859C26.899 15.7983 26.9041 16.007 26.7983 16.1268L19.0438 24.8995C18.829 25.1425 18.8357 25.5095 19.0594 25.7444L26.792 33.8676C26.8989 33.9798 26.9042 34.1886 26.7984 34.3085Z\",\n fill: color\n }));\n});\nexport default ArrowSidebarLeftOutline;","import _extends from \"@babel/runtime/helpers/extends\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/objectWithoutProperties\";\nvar _excluded = [\"color\", \"size\"];\nimport React from 'react';\nimport { intrinsicComponent } from './utils/functions';\nexport var ArrowSidebarRightOutline = intrinsicComponent(function (_ref, ref) {\n var _ref$color = _ref.color,\n color = _ref$color === void 0 ? 'currentColor' : _ref$color,\n _ref$size = _ref.size,\n size = _ref$size === void 0 ? 14 : _ref$size,\n rest = _objectWithoutProperties(_ref, _excluded);\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n ref: ref,\n width: size,\n height: size,\n viewBox: \"0 0 50 50\",\n fill: \"none\",\n xmlns: \"http://www.w3.org/2000/svg\"\n }, rest), /*#__PURE__*/React.createElement(\"path\", {\n fillRule: \"evenodd\",\n clipRule: \"evenodd\",\n d: \"M25 47.5006C37.4264 47.5006 47.5 37.427 47.5 25.0006C47.5 12.5742 37.4264 2.50061 25 2.50061C12.5736 2.50061 2.5 12.5742 2.5 25.0006C2.5 37.427 12.5736 47.5006 25 47.5006ZM25 50.0006C38.8071 50.0006 50 38.8077 50 25.0006C50 11.1935 38.8071 0.000610352 25 0.000610352C11.1929 0.000610352 0 11.1935 0 25.0006C0 38.8077 11.1929 50.0006 25 50.0006Z\",\n fill: color\n }), /*#__PURE__*/React.createElement(\"path\", {\n fillRule: \"evenodd\",\n clipRule: \"evenodd\",\n d: \"M22.2645 14.8655C22.8249 14.2307 23.7783 14.2086 24.3641 14.8239L32.6974 23.5781C32.9699 23.8644 33.1181 24.2461 33.1248 24.6364C33.1314 25.0267 32.9963 25.4131 32.7348 25.7089L24.4015 35.1365C23.8406 35.7709 22.8872 35.7923 22.3019 35.1765C21.7461 34.5919 21.7321 33.6496 22.2652 33.0465L29.6399 24.7034L22.3026 16.9954C21.7464 16.4112 21.7319 15.4689 22.2645 14.8655ZM23.3305 15.6256C23.2942 15.6264 23.247 15.6413 23.2016 15.6927C23.0958 15.8126 23.1011 16.0214 23.208 16.1336L30.9406 24.2568C31.1643 24.4917 31.171 24.8586 30.9562 25.1016L23.2017 33.8744C23.0959 33.9942 23.101 34.2029 23.2079 34.3153C23.2536 34.3634 23.2999 34.3763 23.3361 34.3756C23.3724 34.3748 23.4195 34.36 23.4649 34.3086L31.7983 24.881C31.8438 24.8295 31.8765 24.7497 31.8749 24.6577C31.8734 24.5656 31.838 24.4883 31.792 24.44L23.4587 15.6858C23.4129 15.6377 23.3666 15.6249 23.3305 15.6256Z\",\n fill: color\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M23.2016 15.6927C23.247 15.6413 23.2942 15.6264 23.3305 15.6256C23.3666 15.6249 23.4129 15.6377 23.4587 15.6858L31.792 24.44C31.838 24.4883 31.8734 24.5656 31.8749 24.6577C31.8765 24.7497 31.8438 24.8295 31.7983 24.881L23.4649 34.3086C23.4195 34.36 23.3724 34.3748 23.3361 34.3756C23.2999 34.3763 23.2536 34.3634 23.2079 34.3153C23.101 34.2029 23.0959 33.9942 23.2017 33.8744L30.9562 25.1016C31.171 24.8586 31.1643 24.4917 30.9406 24.2568L23.208 16.1336C23.1011 16.0214 23.0958 15.8126 23.2016 15.6927Z\",\n fill: color\n }));\n});\nexport default ArrowSidebarRightOutline;","import _extends from \"@babel/runtime/helpers/extends\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/objectWithoutProperties\";\nvar _excluded = [\"color\", \"size\"];\nimport React from 'react';\nimport { intrinsicComponent } from './utils/functions';\nexport var Annotation = intrinsicComponent(function (_ref, ref) {\n var _ref$color = _ref.color,\n color = _ref$color === void 0 ? 'currentColor' : _ref$color,\n _ref$size = _ref.size,\n size = _ref$size === void 0 ? 14 : _ref$size,\n rest = _objectWithoutProperties(_ref, _excluded);\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n ref: ref,\n width: size,\n height: size,\n viewBox: \"0 0 50 50\",\n fill: \"none\",\n xmlns: \"http://www.w3.org/2000/svg\"\n }, rest), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M48.5577 38.9423H34.8557C31.8069 38.9423 29.327 41.4224 29.327 44.4712C29.327 45.9293 28.1406 47.1157 26.6827 47.1157H5.52902C4.07066 47.1157 2.88467 45.9293 2.88467 44.4712V42.5459C2.88467 41.0886 4.07028 39.9025 5.5275 39.9018L9.33952 39.8999C9.34067 39.8999 9.34219 39.8995 9.34334 39.8995C9.38683 39.8995 9.43031 39.8968 9.47418 39.893C9.49211 39.8915 9.50966 39.8884 9.52759 39.8861C9.54628 39.8835 9.56535 39.8819 9.58405 39.8789L19.7636 38.1229C19.7689 38.1217 19.7739 38.1206 19.7788 38.1195C19.7948 38.1164 19.8105 38.113 19.8261 38.1095C19.8517 38.1038 19.8769 38.0981 19.9017 38.0908C19.9192 38.0863 19.9368 38.0809 19.9543 38.0756C19.9776 38.068 20.0008 38.0599 20.0241 38.0512C20.0409 38.0447 20.0581 38.039 20.0748 38.0321C20.1107 38.0168 20.1458 38.0008 20.1805 37.9829C20.1942 37.9756 20.208 37.9672 20.2217 37.9596C20.2461 37.9459 20.2702 37.9321 20.2938 37.9169C20.3083 37.9077 20.3228 37.8978 20.3373 37.8879C20.3602 37.8719 20.3831 37.8551 20.4052 37.8375C20.417 37.8284 20.4292 37.8192 20.4411 37.8093C20.4746 37.7815 20.5074 37.7525 20.5383 37.7212L46.2479 12.0109C48.3097 9.94895 48.3097 6.59377 46.2479 4.53146L43.2632 1.54708C41.2014 -0.515234 37.846 -0.514853 35.7841 1.54708L10.075 27.2574C10.0437 27.2883 10.0147 27.3215 9.9865 27.355C9.97696 27.3665 9.9678 27.3783 9.95865 27.3901C9.9411 27.4127 9.92432 27.4355 9.90829 27.4588C9.89838 27.4729 9.88846 27.4874 9.8793 27.5019C9.86443 27.5252 9.85069 27.5488 9.83734 27.5729C9.82857 27.5885 9.81941 27.6042 9.81102 27.6198C9.79424 27.653 9.77898 27.6862 9.76448 27.7205C9.75723 27.7377 9.75113 27.7556 9.74426 27.7732C9.73625 27.7953 9.72824 27.8178 9.72099 27.8403C9.71527 27.8586 9.70993 27.8769 9.70497 27.8952C9.69849 27.9189 9.69276 27.9429 9.68742 27.9673C9.68361 27.9841 9.67979 28.0009 9.67674 28.0177C9.6756 28.0226 9.67445 28.0272 9.67369 28.0318L8.12378 37.0158L5.52597 37.017C2.47879 37.0185 0 39.4989 0 42.5459V44.4712C0 47.5201 2.48032 50.0005 5.52902 50.0005H26.6827C29.7314 50.0005 32.2117 47.5201 32.2117 44.4712C32.2117 43.0132 33.3977 41.8267 34.8557 41.8267H48.5577C49.3542 41.8267 50 41.1813 50 40.3847C50 39.5878 49.3542 38.9423 48.5577 38.9423ZM12.043 31.2653L16.5306 35.7531L11.1076 36.6885L12.043 31.2653ZM33.5567 7.85382L35.7288 10.026L15.3065 30.4493L13.1344 28.2771L33.5567 7.85382ZM19.5183 34.6613L17.3462 32.4891L37.7689 12.0658L39.941 14.238L19.5183 34.6613ZM37.8239 3.58651C38.7611 2.64958 40.2859 2.64958 41.2235 3.58651L44.2078 6.57126C45.145 7.50858 45.145 9.03376 44.2078 9.97108L41.9804 12.1986L35.5965 5.81401L37.8239 3.58651Z\",\n fill: color\n }));\n});\nexport default Annotation;","import _extends from \"@babel/runtime/helpers/extends\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/objectWithoutProperties\";\nvar _excluded = [\"color\", \"size\"];\nimport React from 'react';\nimport { intrinsicComponent } from './utils/functions';\nexport var Rotate90 = intrinsicComponent(function (_ref, ref) {\n var _ref$color = _ref.color,\n color = _ref$color === void 0 ? 'currentColor' : _ref$color,\n _ref$size = _ref.size,\n size = _ref$size === void 0 ? 14 : _ref$size,\n rest = _objectWithoutProperties(_ref, _excluded);\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n ref: ref,\n width: size,\n height: size,\n viewBox: \"0 0 52 42\",\n fill: \"none\",\n xmlns: \"http://www.w3.org/2000/svg\"\n }, rest), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M46.4326 40.0282C46.1217 40.5666 45.6098 40.9595 45.0093 41.1204C44.4088 41.2813 43.7691 41.197 43.2307 40.8862C42.6923 40.5754 42.2995 40.0634 42.1386 39.463C41.9777 38.8625 42.0619 38.2227 42.3727 37.6843C45.2819 32.6454 46.0703 26.6571 44.5644 21.0369C43.0584 15.4167 39.3816 10.6249 34.3426 7.71563C25.1427 2.4043 13.7736 4.38306 6.93632 12.1744L14.5457 12.0831H14.5744C15.196 12.0795 15.7937 12.3229 16.2358 12.7599C16.678 13.1969 16.9284 13.7916 16.9321 14.4133C16.9357 15.0349 16.6923 15.6326 16.2553 16.0747C15.8183 16.5169 15.2236 16.7673 14.6019 16.771L2.37222 16.9175H2.34409C2.03391 16.9175 1.72681 16.856 1.44059 16.7364C1.15437 16.6169 0.894721 16.4417 0.676697 16.2211C0.458674 16.0004 0.28661 15.7387 0.170478 15.4511C0.0543471 15.1635 -0.00354164 14.8557 0.000167612 14.5455L0.147346 2.31591C0.151046 2.00811 0.215338 1.70404 0.336549 1.42108C0.457761 1.13812 0.633519 0.881802 0.853788 0.666765C1.07406 0.451728 1.33453 0.282182 1.62032 0.167807C1.90611 0.0534328 2.21164 -0.00353076 2.51944 0.000169355C2.82725 0.00386947 3.13132 0.0681609 3.41428 0.189372C3.69724 0.310584 3.95356 0.486342 4.16859 0.706611C4.38363 0.926881 4.55318 1.18735 4.66755 1.47314C4.78193 1.75894 4.83889 2.06446 4.83519 2.37227L4.77171 7.65586C9.37537 3.16334 15.4496 0.489016 21.8718 0.127065C28.2941 -0.234886 34.6303 1.74001 39.7096 5.6868C44.7889 9.63359 48.2679 15.2855 49.5038 21.5981C50.7397 27.9107 49.6485 34.4574 46.4326 40.0282Z\",\n fill: color\n }), /*#__PURE__*/React.createElement(\"path\", {\n fillRule: \"evenodd\",\n clipRule: \"evenodd\",\n d: \"M25 28C26.6569 28 28 26.6569 28 25C28 23.3431 26.6569 22 25 22C23.3431 22 22 23.3431 22 25C22 26.6569 23.3431 28 25 28ZM25 32C28.866 32 32 28.866 32 25C32 21.134 28.866 18 25 18C21.134 18 18 21.134 18 25C18 28.866 21.134 32 25 32Z\",\n fill: color\n }));\n});\nexport default Rotate90;","function _objectDestructuringEmpty(t) {\n if (null == t) throw new TypeError(\"Cannot destructure \" + t);\n}\nexport { _objectDestructuringEmpty as default };","export var Size = {\n Xs: 'xs',\n Sm: 'sm',\n Md: 'md',\n Lg: 'lg'\n};","import _defineProperty from \"@babel/runtime/helpers/defineProperty\";\nimport styled, { css } from 'styled-components';\nimport { generateClassNames, applyDisplayNames } from '../../utils/functions';\nimport { Color as PaletteColor } from '../../utils/types/palette';\nimport { Size } from './types';\nvar baseClassName = 'CrossButton';\nvar crossButtonPaddingMixin = _defineProperty(_defineProperty(_defineProperty(_defineProperty({}, Size.Xs, css([\"padding:5px;height:20px;\"])), Size.Sm, css([\"padding:6px;height:24px;\"])), Size.Md, css([\"padding:9px;\"])), Size.Lg, css([\"padding:12px;\"]));\nvar CrossButton = /*#__PURE__*/styled.button.attrs({\n className: generateClassNames(baseClassName, 'root')\n}).withConfig({\n componentId: \"sc-ygfku-0\"\n})(function (_ref) {\n var _ref$size = _ref.size,\n size = _ref$size === void 0 ? Size.Lg : _ref$size,\n theme = _ref.theme;\n return css([\"display:flex;justify-content:center;align-items:center;cursor:pointer;border-radius:4px;\", \" color:\", \";background:transparent;border:none;transition:all 100ms ease-out;&:hover{color:\", \";background:\", \";}&:active{color:\", \";background:\", \";}\"], crossButtonPaddingMixin[size], theme.palette[PaletteColor.IconsSecondary], theme.palette[PaletteColor.IconsPrimary], theme.palette[PaletteColor.BackgroundHover], theme.palette[PaletteColor.IconsPrimaryHover], theme.palette[PaletteColor.BackgroundActive]);\n});\nvar Styled = applyDisplayNames({\n CrossButton: CrossButton\n});\nexport default Styled;","import _objectDestructuringEmpty from \"@babel/runtime/helpers/objectDestructuringEmpty\";\nimport _extends from \"@babel/runtime/helpers/extends\";\nimport React from 'react';\nimport PT from 'prop-types';\nimport CrossOutline from '@scaleflex/icons/cross-outline';\nimport { intrinsicComponent, objectValues } from '../../utils/functions';\nimport { Size } from './types';\nimport Styled from './cross-button.styles';\nvar getIconSize = function getIconSize(sizeName) {\n switch (sizeName) {\n case Size.Lg:\n return 16;\n case Size.Xs:\n return 10;\n case Size.Sm:\n default:\n return 12;\n }\n};\nvar CrossButton = intrinsicComponent(function (_ref, ref) {\n var rest = _extends({}, (_objectDestructuringEmpty(_ref), _ref));\n return /*#__PURE__*/React.createElement(Styled.CrossButton, _extends({}, rest, {\n ref: ref\n }), /*#__PURE__*/React.createElement(CrossOutline, {\n size: getIconSize(rest.size)\n }));\n});\nCrossButton.defaultProps = {\n size: Size.Lg\n};\nCrossButton.propTypes = {\n size: PT.oneOf(objectValues(Size))\n};\nexport default CrossButton;","import styled, { css } from 'styled-components';\nimport { generateClassNames, applyDisplayNames } from '../../utils/functions';\nimport { Color as PColor } from '../../utils/types/palette';\n// import { BorderRadiusSize as BRSize } from '../../utils/types/shape';\nimport InputStyled from '../input/input.styles';\nimport { fontSizeInputMixin } from '../input/input.mixin';\nimport { Size } from '../menu-item/types';\nimport CrossButton from '../cross-button/cross-button.component';\nvar baseClassName = 'Select';\nvar Icon = /*#__PURE__*/styled.span.attrs({\n className: generateClassNames(baseClassName, 'Icon')\n}).withConfig({\n componentId: \"sc-mfrapg-0\"\n})(function (_ref) {\n var palette = _ref.theme.palette,\n size = _ref.size;\n return css([\"display:flex;flex-shrink:0;color:\", \";padding:\", \";\"], palette[PColor.IconsPrimary], size === Size.Md ? '2.5px' : '2px');\n});\nvar TickIcon = /*#__PURE__*/styled.span.attrs({\n className: generateClassNames(baseClassName, 'tickIcon')\n}).withConfig({\n componentId: \"sc-mfrapg-1\"\n})(function (_ref2) {\n var palette = _ref2.theme.palette;\n return css([\"color:\", \";\"], palette[PColor.AccentStateless]);\n});\nvar Container = /*#__PURE__*/styled.div.attrs({\n className: generateClassNames(baseClassName, 'Container')\n}).withConfig({\n componentId: \"sc-mfrapg-2\"\n})(function (_ref3) {\n var _ref3$fullWidth = _ref3.fullWidth,\n fullWidth = _ref3$fullWidth === void 0 ? false : _ref3$fullWidth;\n return css([\"position:relative;display:inline-flex;\", \"\"], fullWidth ? 'width: 100%' : '');\n});\nvar StyledCrossButton = /*#__PURE__*/styled(CrossButton).attrs({\n className: generateClassNames(baseClassName, 'CrossButton')\n}).withConfig({\n componentId: \"sc-mfrapg-3\"\n})(function () {\n return css([\"display:none;margin-right:6px;\"]);\n});\nvar Select = /*#__PURE__*/styled(InputStyled.Input).attrs({\n className: generateClassNames(baseClassName, 'root')\n}).withConfig({\n componentId: \"sc-mfrapg-4\"\n})(function (_ref4) {\n var palette = _ref4.theme.palette,\n disabled = _ref4.disabled,\n readOnly = _ref4.readOnly,\n _ref4$size = _ref4.size,\n size = _ref4$size === void 0 ? 'sm' : _ref4$size,\n isValueExists = _ref4.isValueExists;\n return css([\"cursor:\", \";user-select:none;gap:0px;background:\", \";\", \" \", \";\"], disabled || readOnly ? 'default' : 'pointer', disabled ? palette[PColor.BackgroundHover] : palette[PColor.BackgroundStateless], isValueExists && \"\\n &:hover {\\n \".concat(StyledCrossButton, \" {\\n display: flex;\\n }\\n }\\n \"), fontSizeInputMixin[size]);\n});\nvar Label = /*#__PURE__*/styled.label.attrs({\n className: generateClassNames(baseClassName, 'Label')\n}).withConfig({\n componentId: \"sc-mfrapg-5\"\n})(function (_ref5) {\n var hideEllipsis = _ref5.hideEllipsis,\n _ref5$size = _ref5.size,\n size = _ref5$size === void 0 ? Size.Md : _ref5$size;\n return \"\\n flex-grow: 1;\\n margin-right: \".concat(size === Size.Md ? 8 : 12, \"px;\\n\\n \").concat(!hideEllipsis && css([\"white-space:nowrap;text-overflow:ellipsis;overflow:hidden;\"]), \"\\n \");\n});\nvar Placeholder = /*#__PURE__*/styled.span.attrs({\n className: generateClassNames(baseClassName, 'Placeholder')\n}).withConfig({\n componentId: \"sc-mfrapg-6\"\n})(function (_ref6) {\n var palette = _ref6.theme.palette,\n size = _ref6.size;\n return css([\"width:100%;color:\", \";margin-right:\", \"px;\"], palette[PColor.TextPlaceholder], size === Size.Md ? 16 : 12);\n});\nvar Input = /*#__PURE__*/styled.input.attrs({\n className: generateClassNames(baseClassName, 'Input'),\n 'aria-hidden': 'true',\n tabindex: '-1'\n}).withConfig({\n componentId: \"sc-mfrapg-7\"\n})([\"left:0;width:100%;bottom:0;opacity:0;position:absolute;pointer-events:none;box-sizing:border-box;\"]);\nvar Styled = applyDisplayNames({\n Container: Container,\n Select: Select,\n Label: Label,\n Icon: Icon,\n TickIcon: TickIcon,\n Input: Input,\n Placeholder: Placeholder,\n StyledCrossButton: StyledCrossButton\n});\nexport default Styled;","import _defineProperty from \"@babel/runtime/helpers/defineProperty\";\nimport _typeof from \"@babel/runtime/helpers/typeof\";\nimport _toConsumableArray from \"@babel/runtime/helpers/toConsumableArray\";\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nimport React from 'react';\nimport { Tick } from '@scaleflex/icons/tick';\nimport { MenuItemActions, MenuItemLabel } from '../menu-item';\nimport { InputSize } from '../../utils/types';\nimport Styled from './select.styles';\nexport var getIconSize = function getIconSize(size) {\n switch (size) {\n case InputSize.Md:\n return 16;\n case InputSize.Sm:\n default:\n return 14;\n }\n};\nexport var renderIcon = function renderIcon(_icon, size) {\n return _icon ? /*#__PURE__*/React.createElement(Styled.Icon, null, typeof _icon === 'function' ? _icon({\n size: getIconSize(size)\n }) : _icon) : undefined;\n};\nvar generateChildren = function generateChildren(children) {\n var isActive = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;\n var size = arguments.length > 2 ? arguments[2] : undefined;\n var hideMenuItemsActions = arguments.length > 3 ? arguments[3] : undefined;\n var miChildren = /*#__PURE__*/React.createElement(MenuItemLabel, null, children);\n if (isActive && children) {\n var miActions = /*#__PURE__*/React.createElement(MenuItemActions, null, /*#__PURE__*/React.createElement(Styled.TickIcon, null, /*#__PURE__*/React.createElement(Tick, {\n size: getIconSize(size)\n })));\n if (React.Children.count(children) === 1) {\n return /*#__PURE__*/React.createElement(React.Fragment, null, miChildren, !hideMenuItemsActions && miActions);\n }\n if (React.Children.count(children) > 1 && !React.Children.toArray(children).some(function (child) {\n var _child$type;\n return (child === null || child === void 0 || (_child$type = child.type) === null || _child$type === void 0 ? void 0 : _child$type.displayName) === 'MenuItemActions';\n })) {\n return /*#__PURE__*/React.createElement(React.Fragment, null, children, miActions);\n }\n }\n return miChildren;\n};\nexport var renderOption = function renderOption(menuItem, _ref) {\n var _type, _props, _props2, _props3;\n var value = _ref.value,\n _ref$multiple = _ref.multiple,\n multiple = _ref$multiple === void 0 ? false : _ref$multiple,\n _ref$size = _ref.size,\n size = _ref$size === void 0 ? InputSize.Md : _ref$size,\n _ref$hideMenuItemsAct = _ref.hideMenuItemsActions,\n hideMenuItemsActions = _ref$hideMenuItemsAct === void 0 ? false : _ref$hideMenuItemsAct,\n onClose = _ref.onClose,\n onChange = _ref.onChange;\n if (! /*#__PURE__*/React.isValidElement(menuItem)) {\n return menuItem;\n }\n if (((_type = menuItem.type) === null || _type === void 0 ? void 0 : _type.displayName) !== 'MenuItem') {\n return /*#__PURE__*/React.cloneElement(menuItem);\n }\n var menuItemValue = menuItem === null || menuItem === void 0 || (_props = menuItem.props) === null || _props === void 0 ? void 0 : _props.value;\n var valueArr = multiple ? Array.isArray(value) ? value : [] : [value];\n var active = valueArr.length > 0 && valueArr.includes(menuItemValue);\n var isDisabledMenuItem = menuItem === null || menuItem === void 0 || (_props2 = menuItem.props) === null || _props2 === void 0 ? void 0 : _props2.disabled;\n return /*#__PURE__*/React.cloneElement(menuItem, {\n active: active,\n size: size,\n children: generateChildren(menuItem === null || menuItem === void 0 || (_props3 = menuItem.props) === null || _props3 === void 0 ? void 0 : _props3.children, active, size, hideMenuItemsActions),\n onClick: function onClick() {\n var _menuItemValue$toStri;\n if (!multiple && typeof onClose === 'function') {\n onClose();\n }\n if (typeof onChange === 'function' && !isDisabledMenuItem && !!(menuItemValue !== null && menuItemValue !== void 0 && (_menuItemValue$toStri = menuItemValue.toString()) !== null && _menuItemValue$toStri !== void 0 && _menuItemValue$toStri.length)) {\n var newValue = menuItemValue;\n if (multiple) {\n newValue = _toConsumableArray(Array.isArray(value) ? value : []);\n var index = newValue.indexOf(menuItemValue);\n if (index > -1) {\n newValue.splice(index, 1);\n } else {\n newValue.push(menuItemValue);\n }\n }\n onChange(newValue);\n }\n }\n });\n};\nvar getOptionValue = function getOptionValue(option) {\n var children = option.props ? option.props.children : option;\n if (Array.isArray(children)) return children.map(function (child) {\n return getOptionValue(child);\n }).join(' ');\n if (_typeof(children) === 'object') return getOptionValue(children.props.children);\n return children;\n};\nvar renderOptionValue = function renderOptionValue(option, showSelectionKey) {\n if (option && option.children) {\n var child = showSelectionKey ? option.value : option.children;\n while (typeof child !== 'string') {\n if (Array.isArray(child)) {\n child = getOptionValue(child[1]);\n } else {\n child = getOptionValue(child);\n }\n }\n return child;\n }\n};\nexport var renderValue = function renderValue(_ref2) {\n var value = _ref2.value,\n _ref2$multiple = _ref2.multiple,\n multiple = _ref2$multiple === void 0 ? false : _ref2$multiple,\n children = _ref2.children,\n _ref2$showSelectionKe = _ref2.showSelectionKey,\n showSelectionKey = _ref2$showSelectionKe === void 0 ? false : _ref2$showSelectionKe;\n var optionsProps = [];\n React.Children.forEach(children, function (child) {\n if ( /*#__PURE__*/React.isValidElement(child)) {\n var _type2 = child === null || child === void 0 ? void 0 : child.type,\n displayName = _type2.displayName;\n if (displayName === 'MenuItem' && Boolean(child.props)) {\n optionsProps.push(_objectSpread({}, child.props));\n }\n }\n });\n var activeOptions = multiple ? optionsProps.filter(function (itemProps) {\n return Array.isArray(value) && value.includes(itemProps.value);\n }) : [optionsProps.find(function (itemProps) {\n return itemProps.value === value;\n })];\n if (activeOptions.length > 0) {\n return activeOptions.map(function (option) {\n return renderOptionValue(option, showSelectionKey);\n }).join(', ');\n }\n return Array.isArray(value) ? value.join(', ') : value;\n};","import _extends from \"@babel/runtime/helpers/extends\";\nimport _slicedToArray from \"@babel/runtime/helpers/slicedToArray\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/objectWithoutProperties\";\nvar _excluded = [\"children\", \"size\", \"error\", \"multiple\", \"onChange\", \"value\", \"fullWidth\", \"selectProps\", \"MenuProps\", \"readOnly\", \"disabled\", \"scroll\", \"placeholder\", \"showSelectionKey\", \"hideMenuItemsActions\", \"showClearIcon\", \"renderLabel\", \"onRequestClose\", \"hideEllipsis\"];\nimport React, { useState } from 'react';\nimport PT from 'prop-types';\nimport { intrinsicComponent, objectValues } from '../../utils/functions';\nimport ArrowTick from '../arrow-tick';\nimport Menu from '../menu';\nimport { propTypes as menuPropTypes } from '../menu/menu.component';\nimport { renderValue, renderOption } from './select.utils';\nimport { InputSize } from '../../utils/types';\nimport Styled from './select.styles';\nimport { Size } from '../cross-button/types';\nvar Select = intrinsicComponent(function (_ref, ref) {\n var _value$toString;\n var children = _ref.children,\n size = _ref.size,\n error = _ref.error,\n multiple = _ref.multiple,\n onChange = _ref.onChange,\n value = _ref.value,\n fullWidth = _ref.fullWidth,\n selectProps = _ref.selectProps,\n MenuProps = _ref.MenuProps,\n readOnly = _ref.readOnly,\n disabled = _ref.disabled,\n _ref$scroll = _ref.scroll,\n scroll = _ref$scroll === void 0 ? true : _ref$scroll,\n placeholder = _ref.placeholder,\n showSelectionKey = _ref.showSelectionKey,\n hideMenuItemsActions = _ref.hideMenuItemsActions,\n showClearIcon = _ref.showClearIcon,\n renderLabel = _ref.renderLabel,\n onRequestClose = _ref.onRequestClose,\n _ref$hideEllipsis = _ref.hideEllipsis,\n hideEllipsis = _ref$hideEllipsis === void 0 ? false : _ref$hideEllipsis,\n rest = _objectWithoutProperties(_ref, _excluded);\n var _useState = useState(undefined),\n _useState2 = _slicedToArray(_useState, 2),\n anchorEl = _useState2[0],\n setAnchorEl = _useState2[1];\n var open = Boolean(anchorEl);\n var handleClick = function handleClick(event) {\n return setAnchorEl(event.currentTarget);\n };\n var isValueExists = Array.isArray(value) ? !!value.length : !!(value !== null && value !== void 0 && (_value$toString = value.toString()) !== null && _value$toString !== void 0 && _value$toString.length);\n var handleClose = function handleClose() {\n if (onRequestClose) {\n onRequestClose();\n }\n setAnchorEl(undefined);\n };\n var handleClearSelection = function handleClearSelection(event) {\n event.stopPropagation();\n if (typeof onChange === 'function') {\n onChange('');\n }\n };\n return /*#__PURE__*/React.createElement(Styled.Container, {\n ref: ref,\n fullWidth: Boolean(fullWidth)\n }, /*#__PURE__*/React.createElement(Styled.Select, _extends({}, rest, {\n disabled: disabled,\n size: size,\n error: error,\n fullWidth: Boolean(fullWidth),\n readOnly: readOnly,\n showSelectionKey: showSelectionKey,\n isValueExists: isValueExists,\n onClick: readOnly || disabled ? undefined : handleClick\n }), isValueExists && /*#__PURE__*/React.createElement(Styled.Label, {\n hideEllipsis: hideEllipsis,\n size: size\n }, typeof renderLabel === 'function' ? renderLabel(value) : renderValue({\n value: value,\n multiple: multiple,\n children: children,\n showSelectionKey: showSelectionKey\n })), !isValueExists && /*#__PURE__*/React.createElement(Styled.Placeholder, {\n size: size\n }, placeholder), !readOnly && showClearIcon && /*#__PURE__*/React.createElement(Styled.StyledCrossButton, {\n size: size === Size.Md ? Size.Sm : Size.Xs,\n onClick: handleClearSelection\n }), /*#__PURE__*/React.createElement(Styled.Icon, {\n size: size\n }, /*#__PURE__*/React.createElement(ArrowTick, {\n type: open ? 'top' : 'bottom',\n IconProps: {\n size: size === Size.Md ? 11 : 10\n }\n })), /*#__PURE__*/React.createElement(Styled.Input, selectProps)), /*#__PURE__*/React.createElement(Menu, _extends({\n onClose: handleClose,\n scroll: scroll,\n open: open,\n anchorEl: anchorEl\n }, MenuProps), React.Children.map(children, function (child) {\n return renderOption(child, {\n value: value,\n multiple: multiple,\n size: size,\n hideMenuItemsActions: hideMenuItemsActions,\n onClose: handleClose,\n onChange: readOnly || disabled ? undefined : onChange\n });\n })));\n});\nexport var defaultProps = {\n size: InputSize.Md,\n error: false,\n multiple: false,\n fullWidth: false,\n readOnly: false,\n disabled: false,\n showClearIcon: false,\n scroll: true,\n hideMenuItemsActions: false\n};\nSelect.defaultProps = defaultProps;\nexport var simpleValuePropTypes = PT.oneOfType([PT.string, PT.number, PT.oneOf([null])]);\nexport var propTypes = {\n size: PT.oneOf(objectValues(InputSize)),\n error: PT.bool,\n multiple: PT.bool,\n fullWidth: PT.bool,\n children: PT.oneOfType([PT.element, PT.arrayOf(PT.element)]),\n value: PT.oneOfType([PT.string, PT.number, PT.bool, PT.oneOf([null]), PT.arrayOf(simpleValuePropTypes)]),\n onChange: PT.func,\n MenuProps: PT.exact(menuPropTypes),\n // eslint-disable-next-line react/forbid-prop-types\n selectProps: PT.object,\n readOnly: PT.bool,\n disabled: PT.bool,\n showClearIcon: PT.bool,\n hideMenuItemsActions: PT.bool,\n showSelectionKey: PT.bool,\n scroll: PT.bool,\n renderLabel: PT.func,\n onRequestClose: PT.func,\n hideEllipsis: PT.bool\n};\nSelect.propTypes = propTypes;\nexport default Select;","function useDrag(onMove, onStart, onEnd) {\n var onDragging = function onDragging(e) {\n if (typeof onMove === 'function') {\n var _e$touches;\n onMove(((_e$touches = e.touches) === null || _e$touches === void 0 ? void 0 : _e$touches[0]) || e);\n }\n };\n var disableSliding = function disableSliding(e) {\n document.removeEventListener('mousemove', onDragging);\n document.removeEventListener('mouseup', disableSliding);\n document.removeEventListener('mouseleave', disableSliding);\n document.removeEventListener('touchmove', onDragging);\n document.removeEventListener('touchend', disableSliding);\n document.removeEventListener('touchcancel', disableSliding);\n if (typeof onEnd === 'function') {\n var _e$touches2;\n onEnd(((_e$touches2 = e.touches) === null || _e$touches2 === void 0 ? void 0 : _e$touches2[0]) || e);\n }\n };\n var enableDrag = function enableDrag(e) {\n document.addEventListener('mousemove', onDragging);\n document.addEventListener('mouseup', disableSliding);\n document.addEventListener('mouseleave', disableSliding);\n document.addEventListener('touchmove', onDragging);\n document.addEventListener('touchend', disableSliding);\n document.addEventListener('touchcancel', disableSliding);\n if (typeof onStart === 'function') {\n var _e$touches3;\n onStart(((_e$touches3 = e.touches) === null || _e$touches3 === void 0 ? void 0 : _e$touches3[0]) || e);\n }\n };\n return {\n onMouseDown: enableDrag,\n onTouchStart: enableDrag\n };\n}\nexport default useDrag;","import _defineProperty from \"@babel/runtime/helpers/defineProperty\";\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nimport styled, { css } from 'styled-components';\nimport { generateClassNames, applyDisplayNames } from '../../utils/functions';\nimport { Color as PColor } from '../../utils/types/palette';\nvar baseClassName = 'ColorPicker';\nvar colorItemClassName = 'ColorItem';\n\n// const ColorPicker = styled.div.attrs({\n// className: generateClassNames(baseClassName, 'root'),\n// })`\n// display: flex;\n// flex-direction: column;\n// align-items: center;\n// `;\n\nvar ColorPickerWrapper = /*#__PURE__*/styled.div.attrs({\n className: generateClassNames(baseClassName, 'root')\n}).withConfig({\n componentId: \"sc-qj4xo5-0\"\n})([\"background-color:\", \";box-shadow:0px 1px 2px rgba(78,77,77,0.15);border-radius:2px;padding:12px;max-width:300px;\"], function (_ref) {\n var theme = _ref.theme;\n return theme.palette[PColor.BackgroundSecondary];\n});\nvar ColorPickerIcon = /*#__PURE__*/styled.div.attrs({\n className: generateClassNames(baseClassName, 'icon')\n}).withConfig({\n componentId: \"sc-qj4xo5-1\"\n})([\"display:flex;justify-content:space-between;align-items:center;cursor:pointer;\"]);\nvar RangePickerWrapper = /*#__PURE__*/styled.div.attrs({\n className: generateClassNames(baseClassName, 'range-picker')\n}).withConfig({\n componentId: \"sc-qj4xo5-2\"\n})(function (_ref2) {\n var color = _ref2.color;\n return css([\"position:relative;border-radius:2px;width:100%;height:180px;user-select:none;cursor:crosshair;background-color:\", \";\"], color);\n});\nvar WhiteGradient = /*#__PURE__*/styled.div.attrs({\n className: generateClassNames(baseClassName, 'white-gradient')\n}).withConfig({\n componentId: \"sc-qj4xo5-3\"\n})([\"background:linear-gradient(to right,white 0%,rgba(255,255,255,0) 100%);z-index:0;position:absolute;width:100%;height:100%;border-radius:2px;user-select:none;pointer-events:none;top:-1px;\"]);\nvar BlackGradient = /*#__PURE__*/styled.div.attrs({\n className: generateClassNames(baseClassName, 'black-gradient')\n}).withConfig({\n componentId: \"sc-qj4xo5-4\"\n})([\"background:linear-gradient(to bottom,rgba(0,0,0,0) 0%,black 100%);z-index:1;position:absolute;width:100%;height:100%;border-radius:2px;user-select:none;pointer-events:none;\"]);\nvar ColorPointer = /*#__PURE__*/styled.span.attrs(function (_ref3) {\n var _ref3$left = _ref3.left,\n left = _ref3$left === void 0 ? 0 : _ref3$left,\n _ref3$top = _ref3.top,\n top = _ref3$top === void 0 ? 0 : _ref3$top,\n _ref3$considerTopWidt = _ref3.considerTopWidth,\n considerTopWidth = _ref3$considerTopWidt === void 0 ? false : _ref3$considerTopWidt,\n style = _ref3.style;\n return {\n className: generateClassNames(baseClassName, 'pointer'),\n style: _objectSpread({\n left: left - 7,\n // 7\n top: top - (considerTopWidth ? 7 : 0)\n }, style)\n };\n}).withConfig({\n componentId: \"sc-qj4xo5-5\"\n})(function (_ref4) {\n var theme = _ref4.theme,\n pointerColor = _ref4.pointerColor;\n return css([\"display:inline-block;box-sizing:border-box;width:15px;height:15px;border-radius:20px;box-shadow:0px 1px 2px rgba(78,77,77,0.15);border:2px solid \", \";background-color:\", \";position:absolute;cursor:pointer;z-index:11;user-select:none;outline:none;\"], theme.palette[PColor.BackgroundSecondary], pointerColor);\n});\nvar BarWrapper = /*#__PURE__*/styled.div.attrs({\n className: generateClassNames(baseClassName, 'bar-wrapper')\n}).withConfig({\n componentId: \"sc-qj4xo5-6\"\n})([\"margin-top:8px;position:relative;width:100%;height:12px;\"]);\nvar Bar = /*#__PURE__*/styled.table.attrs({\n className: generateClassNames(baseClassName, 'bar')\n}).withConfig({\n componentId: \"sc-qj4xo5-7\"\n})([\"border-radius:4px;width:100%;height:8px;border-collapse:collapse;\"]);\nvar BarColorStop = /*#__PURE__*/styled.td.attrs(function (_ref5) {\n var $color = _ref5.$color;\n return {\n className: generateClassNames(baseClassName, 'stop'),\n style: {\n backgroundColor: $color\n }\n };\n}).withConfig({\n componentId: \"sc-qj4xo5-8\"\n})([\"padding:0;user-select:none;pointer-events:none;&:first-child{width:4px;border-top-left-radius:4px;border-bottom-left-radius:4px;}&:last-child{width:4px;border-top-right-radius:4px;border-bottom-right-radius:4px;}\"]);\nvar ColorPickerAction = /*#__PURE__*/styled.div.attrs({\n className: generateClassNames(baseClassName, 'action')\n}).withConfig({\n componentId: \"sc-qj4xo5-9\"\n})([\"display:flex;justify-content:space-between;align-items:center;gap:12px;margin-bottom:12px;\"]);\nvar ColorItemWrapper = /*#__PURE__*/styled.label.attrs({\n className: generateClassNames(colorItemClassName, 'label')\n}).withConfig({\n componentId: \"sc-qj4xo5-10\"\n})(function (_ref6) {\n var theme = _ref6.theme,\n size = _ref6.size,\n color = _ref6.color,\n stroke = _ref6.stroke,\n value = _ref6.value;\n return css([\"border-radius:2px;border:\", \";box-sizing:border-box;width:\", \"px;height:\", \"px;background-color:\", \";user-select:none;display:flex;align-items:center;justify-content:center;cursor:pointer;transition:all 300ms;margin-bottom:8px;background:\", \";input{display:none;}\"], \"1px solid \".concat(stroke), size, size, color, value === 'rgba(0,0,0,0)' && \"repeating-conic-gradient(\".concat(theme.palette[PColor.LinkPrimary], \" 0% 25%, transparent 0% 50%) 50% / 8px 8px\"));\n});\nvar ColorItemsContainer = /*#__PURE__*/styled.div.withConfig({\n componentId: \"sc-qj4xo5-11\"\n})([\"display:flex;flex-wrap:wrap;align-content:space-between;margin-top:14px;margin-left:12px;& > .item{margin-right:8px;display:flex;justify-content:center;}\"]);\nvar Select = /*#__PURE__*/styled.div.attrs({\n className: generateClassNames(baseClassName, 'select')\n}).withConfig({\n componentId: \"sc-qj4xo5-12\"\n})(function (_ref7) {\n var value = _ref7.value;\n return css([\"width:\", \";\"], value === 'rgb' ? '25%' : '35%');\n});\nvar SelectWrapper = /*#__PURE__*/styled.div.withConfig({\n componentId: \"sc-qj4xo5-13\"\n})({\n display: 'flex',\n alignItems: 'center',\n gap: '12px'\n});\nvar Styled = applyDisplayNames({\n ColorPickerWrapper: ColorPickerWrapper,\n RangePickerWrapper: RangePickerWrapper,\n WhiteGradient: WhiteGradient,\n BlackGradient: BlackGradient,\n ColorPointer: ColorPointer,\n BarWrapper: BarWrapper,\n Bar: Bar,\n BarColorStop: BarColorStop,\n ColorPickerAction: ColorPickerAction,\n ColorPickerIcon: ColorPickerIcon,\n ColorItemsContainer: ColorItemsContainer,\n ColorItemWrapper: ColorItemWrapper,\n Select: Select,\n SelectWrapper: SelectWrapper\n});\nexport default Styled;","import React, { useMemo } from 'react';\nimport PT from 'prop-types';\nimport Tick from '@scaleflex/icons/tick';\nimport { intrinsicComponent } from '../../utils/functions';\nimport Styled from './color-picker.styles';\nvar ColorItem = intrinsicComponent(function (_ref, ref) {\n var value = _ref.value,\n onChange = _ref.onChange,\n checked = _ref.checked,\n _ref$size = _ref.size,\n size = _ref$size === void 0 ? 24 : _ref$size;\n var checkIconColor = useMemo(function () {\n if (value === '#ffffff' || value === 'rgba(0,0,0,0)') {\n return 'black';\n }\n return 'white';\n }, [value]);\n return /*#__PURE__*/React.createElement(Styled.ColorItemWrapper, {\n ref: ref,\n color: value,\n size: size,\n stroke: value === 'rgba(0,0,0,0)' ? '#a8a8a8' : '#E9EEF2',\n value: value\n }, /*#__PURE__*/React.createElement(\"input\", {\n type: \"radio\",\n value: value,\n checked: checked,\n onChange: onChange\n }), checked && /*#__PURE__*/React.createElement(Tick, {\n color: checkIconColor\n }));\n});\nColorItem.defaultProps = {};\nColorItem.propTypes = {\n value: PT.string.isRequired,\n checked: PT.bool,\n onChange: PT.func.isRequired,\n size: PT.number\n};\nexport default ColorItem;","import _extends from \"@babel/runtime/helpers/extends\";\nimport _defineProperty from \"@babel/runtime/helpers/defineProperty\";\nimport _toConsumableArray from \"@babel/runtime/helpers/toConsumableArray\";\nimport _slicedToArray from \"@babel/runtime/helpers/slicedToArray\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/objectWithoutProperties\";\nvar _excluded = [\"defaultColor\", \"onChange\", \"pinnedColors\", \"showTransparentColor\", \"hidePinIcon\", \"containerProps\"];\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nimport React, { useState, useMemo, useEffect } from 'react';\nimport PT from 'prop-types';\nimport { PinOutline, DeleteOutline } from '@scaleflex/icons';\nimport Select from '../select';\nimport MenuItem from '../menu-item';\nimport Input from '../input';\nimport useDrag from '../../hooks/use-drag';\nimport { intrinsicComponent, colorToHsl, hexToRgb, hslToHex, hslToHsv, hsvToHsl, restrictNumber, mapNumber, colorToHex, getElemDocumentCoords, rgbToHex, validateHex, rgbStringToArray } from '../../utils/functions';\nimport Styled from './color-picker.styles';\nimport ColorItem from './color-item.component';\nvar transparentColor = ['rgba(0,0,0,0)'];\nvar transparentColorHex = '#00000000';\nvar colorsHuesCount = 360;\nvar ColorPicker = intrinsicComponent(function (_ref, ref) {\n var _ref$defaultColor = _ref.defaultColor,\n defaultColor = _ref$defaultColor === void 0 ? '#000000' : _ref$defaultColor,\n onChange = _ref.onChange,\n _ref$pinnedColors = _ref.pinnedColors,\n pinnedColors = _ref$pinnedColors === void 0 ? [] : _ref$pinnedColors,\n _ref$showTransparentC = _ref.showTransparentColor,\n showTransparentColor = _ref$showTransparentC === void 0 ? false : _ref$showTransparentC,\n _ref$hidePinIcon = _ref.hidePinIcon,\n hidePinIcon = _ref$hidePinIcon === void 0 ? false : _ref$hidePinIcon,\n containerProps = _ref.containerProps,\n rest = _objectWithoutProperties(_ref, _excluded);\n var showedColors = showTransparentColor ? transparentColor.concat(pinnedColors) : pinnedColors;\n var isTransparentColor = function isTransparentColor(color) {\n return color === transparentColorHex || color === transparentColor[0];\n };\n var _useState = useState({\n color: '#ff0000',\n pointerLeft: 0\n }),\n _useState2 = _slicedToArray(_useState, 2),\n bar = _useState2[0],\n setBar = _useState2[1];\n var _useState3 = useState({\n color: isTransparentColor(defaultColor) ? '#00000000' : colorToHex(defaultColor) || '#000000',\n pointer: {\n left: 0,\n top: 0\n }\n }),\n _useState4 = _slicedToArray(_useState3, 2),\n rangePicker = _useState4[0],\n setRangePicker = _useState4[1];\n var _useState5 = useState(showedColors),\n _useState6 = _slicedToArray(_useState5, 2),\n localPinnedColors = _useState6[0],\n setLocalPinnedColors = _useState6[1];\n var _useState7 = useState('hex'),\n _useState8 = _slicedToArray(_useState7, 2),\n inputType = _useState8[0],\n setInputType = _useState8[1];\n var _useState9 = useState([]),\n _useState10 = _slicedToArray(_useState9, 2),\n rgbColorValue = _useState10[0],\n setRgbColorValue = _useState10[1];\n var _useState11 = useState(colorToHex(rangePicker.color)),\n _useState12 = _slicedToArray(_useState11, 2),\n hexInputValue = _useState12[0],\n setHexInputValue = _useState12[1];\n var _useState13 = useState(null),\n _useState14 = _slicedToArray(_useState13, 2),\n barRef = _useState14[0],\n setBarRef = _useState14[1];\n var _useState15 = useState(null),\n _useState16 = _slicedToArray(_useState15, 2),\n rangePickerRef = _useState16[0],\n setRangePickerRef = _useState16[1];\n var isColorChecked = function isColorChecked(checkedColor) {\n if (checkedColor === transparentColor[0] && rangePicker.color === transparentColorHex) {\n return true;\n }\n return checkedColor === rangePicker.color;\n };\n var filterTransparentColor = function filterTransparentColor(colors) {\n return colors.filter(function (item) {\n return item !== 'rgba(0,0,0,0)';\n });\n };\n var getRgbColor = function getRgbColor(color) {\n return isTransparentColor(color) ? transparentColor[0] : \"rgb(\".concat(hexToRgb(color).join(', '), \")\");\n };\n var handlePinnedColors = function handlePinnedColors(hexColor, type) {\n if (type === 'add') {\n var newLocalPinnedColors = [].concat(_toConsumableArray(localPinnedColors), [hexColor]);\n setLocalPinnedColors(newLocalPinnedColors);\n if (typeof onChange === 'function') {\n onChange(rangePicker.color, getRgbColor(hexColor), filterTransparentColor(newLocalPinnedColors));\n }\n } else {\n var _newLocalPinnedColors = localPinnedColors.filter(function (item) {\n return item !== rangePicker.color;\n });\n setLocalPinnedColors(_newLocalPinnedColors);\n if (typeof onChange === 'function') {\n onChange(rangePicker.color, getRgbColor(hexColor), filterTransparentColor(_newLocalPinnedColors));\n }\n }\n };\n var changeBarPosByColor = function changeBarPosByColor(color) {\n if (barRef !== null) {\n var _ref2 = getElemDocumentCoords(barRef),\n left = _ref2.left;\n var _colorToHsl = colorToHsl(color || rangePicker.color),\n _colorToHsl2 = _slicedToArray(_colorToHsl, 1),\n h = _colorToHsl2[0];\n var targetColorElem = barRef.querySelector(\"[data-hue='\".concat(h, \"']\"));\n if (targetColorElem !== null) {\n var targetColorRgb = targetColorElem.style.backgroundColor || bar.color;\n setBar({\n color: targetColorRgb,\n pointerLeft: getElemDocumentCoords(targetColorElem).left - left || bar.pointerLeft\n });\n }\n }\n };\n var handleRgbInput = function handleRgbInput(value, index) {\n if (value > 255 || Number.isNaN(value)) {\n return;\n }\n var rgbArr = rgbColorValue;\n rgbArr[index] = value;\n var newHexColor = rgbToHex.apply(void 0, _toConsumableArray(rgbArr));\n setRgbColorValue(_toConsumableArray(rgbArr));\n if (validateHex(newHexColor)) {\n setRangePicker(_objectSpread(_objectSpread({}, rangePicker), {}, {\n color: newHexColor\n }));\n changeBarPosByColor(newHexColor);\n }\n };\n var updateRgb = function updateRgb(color) {\n if (color.includes('rgb')) {\n setRgbColorValue(rgbStringToArray(color));\n } else {\n setRgbColorValue(hexToRgb(color));\n }\n };\n var getHexColor = function getHexColor(color) {\n return isTransparentColor(color) ? transparentColorHex : color;\n };\n var changeRangePickerPointerPosByColor = function changeRangePickerPointerPosByColor(color) {\n if (rangePickerRef !== null) {\n var _ref3 = getElemDocumentCoords(rangePickerRef),\n width = _ref3.width,\n height = _ref3.height;\n var colorHsl = colorToHsl(color);\n var colorHsv = hslToHsv(colorHsl[0], colorHsl[1] / 100, colorHsl[2] / 100);\n var left = mapNumber(colorHsv[1], 0, 100, 0, width);\n var top = height - mapNumber(colorHsv[2], 0, 100, 0, height);\n setRangePicker({\n color: getHexColor(color),\n pointer: {\n left: left,\n top: top\n }\n });\n changeBarPosByColor(color);\n updateRgb(color);\n if (typeof onChange === 'function') {\n onChange(getHexColor(color), getRgbColor(color), filterTransparentColor(localPinnedColors));\n }\n }\n };\n var changeRangePickerColorByPosition = function changeRangePickerColorByPosition(left, top, barColor) {\n if (rangePickerRef !== null) {\n var _ref4 = getElemDocumentCoords(rangePickerRef),\n width = _ref4.width,\n height = _ref4.height;\n var _colorToHsl3 = colorToHsl(barColor),\n _colorToHsl4 = _slicedToArray(_colorToHsl3, 1),\n barColorHue = _colorToHsl4[0];\n var restrictedLeft = restrictNumber(left, 0, width) || 0;\n var restrictedTop = restrictNumber(top, 0, height) || 0;\n var hsl = hsvToHsl(barColorHue, restrictedLeft / width, (height - restrictedTop) / height);\n var hexColor = hslToHex(hsl[0], hsl[1], hsl[2]);\n setRangePicker({\n color: hexColor,\n pointer: {\n left: restrictedLeft,\n top: restrictedTop\n }\n });\n if (typeof onChange === 'function') {\n onChange(hexColor, \"rgb(\".concat(hexToRgb(hexColor).join(', '), \")\"), filterTransparentColor(localPinnedColors));\n }\n }\n };\n var changeBarColorByPosition = function changeBarColorByPosition(pointerLeft) {\n var barElem = barRef;\n if (barElem !== null) {\n var _ref5 = getElemDocumentCoords(barElem),\n width = _ref5.width;\n var mappedPointerLeft = restrictNumber(Math.round(mapNumber(pointerLeft, 0, width, 0, colorsHuesCount)), 0, colorsHuesCount);\n var targetColorElem = barElem.querySelector(\"[data-hue='\".concat(mappedPointerLeft, \"']\"));\n var targetColorRgb = targetColorElem.style.backgroundColor;\n setBar({\n color: targetColorRgb,\n pointerLeft: restrictNumber(pointerLeft, 0, width)\n });\n return targetColorRgb;\n }\n return bar.color;\n };\n var updateBarColor = function updateBarColor(e) {\n var barElem = barRef;\n if (barElem !== null) {\n var _e$touches;\n var _ref6 = getElemDocumentCoords(barElem),\n left = _ref6.left;\n var pointerEvent = ((_e$touches = e.touches) === null || _e$touches === void 0 ? void 0 : _e$touches[0]) || e;\n var barColor = changeBarColorByPosition(pointerEvent.pageX - left);\n changeRangePickerColorByPosition(rangePicker.pointer.left, rangePicker.pointer.top, barColor);\n }\n };\n var updateRangePickerColor = function updateRangePickerColor(e) {\n var rangePickerElem = rangePickerRef;\n if (rangePickerElem !== null) {\n var _ref7 = getElemDocumentCoords(rangePickerElem),\n left = _ref7.left,\n top = _ref7.top,\n height = _ref7.height,\n width = _ref7.width;\n var pointerLeft = e ? restrictNumber(e.pageX - left, 0, width) : rangePicker.pointer.left || 0;\n var pointerTop = e ? restrictNumber(e.pageY - top, 0, height) : rangePicker.pointer.left || 0;\n changeRangePickerColorByPosition(pointerLeft, pointerTop, bar.color);\n }\n };\n var moveBarPointerByArrows = function moveBarPointerByArrows(e) {\n if (e.key !== 'ArrowLeft' && e.key !== 'ArrowRight') {\n return;\n }\n changeBarColorByPosition(bar.pointerLeft + (e.key === 'ArrowLeft' ? -1 : 1));\n };\n var moveRangePickerPointerByArrows = function moveRangePickerPointerByArrows(e) {\n var currentDirection = 0;\n if (e.key === 'ArrowLeft' || e.key === 'ArrowUp') {\n currentDirection = -1;\n } else if (e.key === 'ArrowRight' || e.key === 'ArrowDown') {\n currentDirection = 1;\n }\n if (currentDirection) {\n changeRangePickerColorByPosition((rangePicker.pointer.left || 0) + (['ArrowLeft', 'ArrowRight'].includes(e.key) ? currentDirection : 0), (rangePicker.pointer.top || 0) + (['ArrowUp', 'ArrowDown'].includes(e.key) ? currentDirection : 0), bar.color);\n }\n };\n var validateHexAndUpdate = function validateHexAndUpdate(color) {\n var testHex = validateHex(color);\n if (testHex) {\n changeRangePickerPointerPosByColor(color);\n }\n setHexInputValue(color);\n };\n useEffect(function () {\n changeBarPosByColor(rangePicker.color);\n changeRangePickerPointerPosByColor(rangePicker.color);\n }, [barRef]);\n useEffect(function () {\n setHexInputValue(rangePicker.color);\n updateRgb(rangePicker.color);\n }, [rangePicker.color]);\n var barColors = useMemo(function () {\n return _toConsumableArray(new Array(colorsHuesCount + 1)).map(function (_, h) {\n return /*#__PURE__*/React.createElement(Styled.BarColorStop, {\n key: h,\n $color: \"hsl(\".concat(h, \", 100%, 50%)\"),\n \"data-hue\": h\n });\n });\n }, []);\n var barPointSliding = useDrag(updateBarColor, updateBarColor, null);\n var rangePickerPointSliding = useDrag(updateRangePickerColor, updateRangePickerColor, null);\n return /*#__PURE__*/React.createElement(Styled.ColorPickerWrapper, _extends({\n ref: ref\n }, rest), /*#__PURE__*/React.createElement(Styled.ColorPickerAction, null, /*#__PURE__*/React.createElement(Styled.SelectWrapper, null, /*#__PURE__*/React.createElement(Styled.Select, {\n value: inputType\n }, /*#__PURE__*/React.createElement(Select, {\n size: \"sm\",\n value: inputType,\n MenuProps: _objectSpread({\n zIndex: 11112\n }, containerProps),\n onChange: function onChange(ev) {\n return setInputType(ev);\n },\n fullWidth: true,\n hideEllipsis: true\n }, /*#__PURE__*/React.createElement(MenuItem, {\n value: \"hex\"\n }, \"Hex\"), /*#__PURE__*/React.createElement(MenuItem, {\n value: \"rgb\"\n }, \"RGB\"))), inputType === 'hex' ? /*#__PURE__*/React.createElement(Input, {\n size: \"sm\",\n error: !/^#([\\da-f]{3}){1,2}$/i.test(rangePicker.color),\n value: hexInputValue,\n onChange: function onChange(e) {\n return validateHexAndUpdate(e.target.value);\n },\n style: {\n width: '45%'\n }\n }) : rgbColorValue.map(function (rgb, index) {\n return /*#__PURE__*/React.createElement(Input, {\n key: index,\n size: \"sm\",\n value: rgb,\n onChange: function onChange(e) {\n var _e$target;\n return handleRgbInput(Number((_e$target = e.target) === null || _e$target === void 0 ? void 0 : _e$target.value), index);\n },\n style: {\n width: '20%'\n }\n });\n })), rangePicker.color !== transparentColorHex && !hidePinIcon && /*#__PURE__*/React.createElement(Styled.ColorPickerIcon, {\n onClick: function onClick() {\n return localPinnedColors.some(function (checkedColor) {\n return isColorChecked(checkedColor);\n }) ? handlePinnedColors(rangePicker.color, 'delete') : handlePinnedColors(rangePicker.color, 'add');\n }\n }, localPinnedColors.some(function (checkedColor) {\n return isColorChecked(checkedColor);\n }) ? /*#__PURE__*/React.createElement(DeleteOutline, null) : /*#__PURE__*/React.createElement(PinOutline, null))), /*#__PURE__*/React.createElement(Styled.RangePickerWrapper, _extends({\n ref: setRangePickerRef,\n color: bar.color\n }, rangePickerPointSliding), /*#__PURE__*/React.createElement(Styled.WhiteGradient, null), /*#__PURE__*/React.createElement(Styled.BlackGradient, null), /*#__PURE__*/React.createElement(Styled.ColorPointer, {\n tabIndex: -1,\n left: rangePicker.pointer.left || 0,\n top: rangePicker.pointer.top || 0,\n onKeyDown: moveRangePickerPointerByArrows,\n pointerColor: hexInputValue,\n considerTopWidth: true\n })), /*#__PURE__*/React.createElement(Styled.BarWrapper, barPointSliding, /*#__PURE__*/React.createElement(Styled.Bar, {\n ref: setBarRef\n }, /*#__PURE__*/React.createElement(\"tbody\", null, /*#__PURE__*/React.createElement(\"tr\", null, barColors))), /*#__PURE__*/React.createElement(Styled.ColorPointer, {\n tabIndex: -1,\n left: bar.pointerLeft,\n onKeyDown: moveBarPointerByArrows,\n considerTopWidth: false,\n pointerColor: hexInputValue,\n style: {\n top: -3\n }\n })), /*#__PURE__*/React.createElement(Styled.ColorItemsContainer, null, localPinnedColors.map(function (color) {\n return /*#__PURE__*/React.createElement(\"div\", {\n className: \"item\",\n key: color\n }, /*#__PURE__*/React.createElement(ColorItem, {\n value: color,\n checked: isColorChecked(color),\n onChange: function onChange(ev) {\n return changeRangePickerPointerPosByColor(ev.target.value);\n }\n }));\n })));\n});\nColorPicker.defaultProps = {\n defaultColor: '#000000',\n pinnedColors: [],\n showTransparentColor: false,\n hidePinIcon: false\n};\nColorPicker.propTypes = {\n defaultColor: PT.string,\n onChange: PT.func,\n pinnedColors: PT.array,\n showTransparentColor: PT.bool,\n hidePinIcon: PT.bool\n};\nexport default ColorPicker;","import _defineProperty from \"@babel/runtime/helpers/defineProperty\";\nimport { css } from 'styled-components';\nimport { Color as PaletteColor } from '../../utils/types/palette';\nimport { ButtonSize, IconButtonColor } from '../../utils/types';\nexport var colorButtonMixin = _defineProperty(_defineProperty(_defineProperty({}, IconButtonColor.Primary, function (_ref) {\n var palette = _ref.theme.palette,\n active = _ref.active;\n return css([\"background-color:\", \";color:\", \";&:hover{background-color:\", \";}&:focus{background-color:\", \";}&:active{background-color:\", \";}\", \" &:disabled{color:\", \";background:\", \";cursor:default;}\"], palette[PaletteColor.AccentStateless], palette[PaletteColor.IconsInvert], palette[PaletteColor.AccentPrimaryHover], palette[PaletteColor.AccentPrimaryActive], palette[PaletteColor.AccentPrimaryActive], active && css([\"background-color:\", \";&:hover,&:focus{background-color:\", \";}\"], palette[PaletteColor.AccentPrimaryActive], palette[PaletteColor.AccentPrimaryActive]), palette[PaletteColor.BordersDisabled], palette[PaletteColor.Accent_1_2_Opacity]);\n}), IconButtonColor.Secondary, function (_ref2) {\n var palette = _ref2.theme.palette,\n active = _ref2.active;\n return css([\"background-color:\", \";color:\", \";border:1px solid \", \";&:hover{color:\", \";background-color:\", \";}&:focus{background-color:\", \";color:\", \";border:1px solid \", \";}&:active{color:\", \";background-color:\", \";}\", \" &:disabled{color:\", \";background:\", \";border:none;cursor:default;}\"], palette[PaletteColor.BackgroundStateless], palette[PaletteColor.AccentStateless], palette[PaletteColor.AccentStateless], palette[PaletteColor.IconsInvert], palette[PaletteColor.AccentPrimaryHover], palette[PaletteColor.Accent_1_2_Opacity], palette[PaletteColor.AccentPrimaryActive], palette[PaletteColor.AccentPrimaryActive], palette[PaletteColor.IconsInvert], palette[PaletteColor.AccentPrimaryActive], active && css([\"color:\", \";background-color:\", \";&:hover,&:focus{color:\", \";background-color:\", \";}\"], palette[PaletteColor.IconsInvert], palette[PaletteColor.AccentPrimaryActive], palette[PaletteColor.IconsInvert], palette[PaletteColor.AccentPrimaryActive]), palette[PaletteColor.BordersDisabled], palette[PaletteColor.Accent_1_2_Opacity]);\n}), IconButtonColor.Basic, function (_ref3) {\n var palette = _ref3.theme.palette,\n active = _ref3.active;\n return css([\"background-color:transparent;color:\", \";border:none;&:hover{background-color:\", \";color:\", \";}&:focus{background-color:\", \";color:\", \";}&:active{background-color:\", \";color:\", \";}\", \" &:disabled{background-color:transparent;color:\", \";cursor:default;}\"], palette[PaletteColor.IconsPrimary], palette[PaletteColor.BackgroundHover], palette[PaletteColor.IconsPrimaryHover], palette[PaletteColor.BackgroundActive], palette[PaletteColor.LinkActive], palette[PaletteColor.BackgroundActive], palette[PaletteColor.LinkActive], active && css([\"background-color:\", \";color:\", \";&:hover,&:focus{background-color:\", \";color:\", \";}\"], palette[PaletteColor.BackgroundActive], palette[PaletteColor.LinkActive], palette[PaletteColor.BackgroundActive], palette[PaletteColor.LinkActive]), palette[PaletteColor.BordersDisabled]);\n});\nexport var squarePaddingMixin = _defineProperty(_defineProperty(_defineProperty(_defineProperty({}, ButtonSize.Xs, css([\"padding:6px;\"])), ButtonSize.Sm, css([\"padding:9px;\"])), ButtonSize.Md, css([\"padding:12px;\"])), ButtonSize.Lg, css([\"padding:11px;\"]));","import styled, { css } from 'styled-components';\nimport { generateClassNames, applyDisplayNames } from '../../utils/functions';\nimport ButtonStyled from '../button/button.styles';\nimport { colorButtonMixin, squarePaddingMixin } from './icon-button.mixin';\nimport { ButtonSize, IconButtonColor } from '../../utils/types';\nvar baseClassName = 'IconButton';\nvar IconButton = /*#__PURE__*/styled(ButtonStyled.Button).attrs({\n className: generateClassNames(baseClassName, 'root')\n}).withConfig({\n componentId: \"sc-10edh45-0\"\n})(function (_ref) {\n var _ref$color = _ref.color,\n color = _ref$color === void 0 ? IconButtonColor.Secondary : _ref$color,\n _ref$size = _ref.size,\n size = _ref$size === void 0 ? ButtonSize.Md : _ref$size;\n return css([\"\", \" \", \"\"], squarePaddingMixin[size], colorButtonMixin[color]);\n});\nvar Styled = applyDisplayNames({\n IconButton: IconButton\n});\nexport default Styled;","import _extends from \"@babel/runtime/helpers/extends\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/objectWithoutProperties\";\nvar _excluded = [\"children\"];\nimport React from 'react';\nimport PT from 'prop-types';\nimport { intrinsicComponent, objectValues } from '../../utils/functions';\nimport { getIconSize } from '../button/button.utils';\nimport { ButtonSize, IconButtonColor } from '../../utils/types';\nimport Styled from './icon-button.styles';\nvar IconButton = intrinsicComponent(function (_ref, ref) {\n var children = _ref.children,\n rest = _objectWithoutProperties(_ref, _excluded);\n return /*#__PURE__*/React.createElement(Styled.IconButton, _extends({}, rest, {\n ref: ref\n }), children && (typeof children === 'function' ? children({\n size: getIconSize(rest.size)\n }) : children));\n});\nIconButton.defaultProps = {\n size: ButtonSize.Md,\n color: IconButtonColor.Secondary,\n active: false\n};\nIconButton.propTypes = {\n children: PT.oneOfType([PT.node, PT.func]).isRequired,\n size: PT.oneOf(objectValues(ButtonSize)),\n color: PT.oneOf(objectValues(IconButtonColor)),\n disabled: PT.bool,\n active: PT.bool\n};\nexport default IconButton;","export var onClickByMouseDown = function onClickByMouseDown(event, callback) {\n event.preventDefault();\n if (event.button !== 0) {\n return;\n }\n if (callback) {\n callback(event);\n }\n};","import _defineProperty from \"@babel/runtime/helpers/defineProperty\";\nimport { css } from 'styled-components';\nimport { InputSize } from '../../utils/types';\nimport { Color as PaletteColor } from '../../utils/types/palette';\nimport { FontVariant as FV } from '../../utils/types/typography';\nexport var errorMixin = function errorMixin(_ref) {\n var palette = _ref.theme.palette;\n return css([\"background:\", \" !important;border:1px solid \", \" !important;\"], palette[PaletteColor.BackgroundSecondary], palette[PaletteColor.Error]);\n};\nexport var heightTextAreaMixin = _defineProperty(_defineProperty({}, InputSize.Sm, function () {\n return css([\"height:136px;\"]);\n}), InputSize.Md, function () {\n return css([\"height:152px;\"]);\n});\nexport var sizeTextAreaMixin = _defineProperty(_defineProperty({}, InputSize.Sm, function (_ref2) {\n var font = _ref2.theme.typography.font;\n return css([\"padding:8px 12px;\", \"\"], font[FV.InputMd]);\n}), InputSize.Md, function (_ref3) {\n var font = _ref3.theme.typography.font;\n return css([\"padding:8px 16px;\", \"\"], font[FV.InputLg]);\n});","import styled, { css } from 'styled-components';\nimport { generateClassNames, applyDisplayNames } from '../../utils/functions';\nimport { InputSize } from '../../utils/types';\nimport { Color as PColor } from '../../utils/types/palette';\nimport { BorderRadiusSize as BRSize } from '../../utils/types/shape';\nimport { errorMixin, sizeTextAreaMixin, heightTextAreaMixin } from './textarea.mixin';\nimport { getInputBackgroundColor, getInputTextColor, getInputBorderColor } from '../input/input.utils';\nvar baseClassName = 'Textarea';\nvar Textarea = /*#__PURE__*/styled.div.attrs({\n className: generateClassNames(baseClassName, 'root')\n}).withConfig({\n componentId: \"sc-1usif6k-0\"\n})(function (_ref) {\n var _ref$size = _ref.size,\n size = _ref$size === void 0 ? InputSize.Md : _ref$size,\n _ref$error = _ref.error,\n error = _ref$error === void 0 ? false : _ref$error,\n _ref$fullWidth = _ref.fullWidth,\n fullWidth = _ref$fullWidth === void 0 ? false : _ref$fullWidth,\n _ref$readOnly = _ref.readOnly,\n readOnly = _ref$readOnly === void 0 ? false : _ref$readOnly,\n _ref$disabled = _ref.disabled,\n disabled = _ref$disabled === void 0 ? false : _ref$disabled,\n _ref$autoSize = _ref.autoSize,\n autoSize = _ref$autoSize === void 0 ? false : _ref$autoSize,\n theme = _ref.theme;\n return css([\"position:relative;display:inline-flex;flex-direction:column;align-items:flex-end;justify-content:space-between;cursor:text;box-sizing:border-box;transition:all 100ms ease-out;width:\", \";pointer-events:\", \";background-color:\", \";border-radius:\", \";border:1px solid \", \";color:\", \";\", \" \", \" &:hover{color:\", \";}\", \" \", \"\"], fullWidth ? '100%' : '300px', disabled ? 'none' : 'auto', getInputBackgroundColor(readOnly, disabled), theme.shape.borderRadius[BRSize.Md], getInputBorderColor(readOnly, disabled), disabled ? theme.palette[PColor.TextPlaceholder] : theme.palette[PColor.TextPrimary], heightTextAreaMixin[size], !readOnly && !disabled && css([\"&:focus-within{background-color:\", \"!important;border:1px solid \", \";&:hover{border:1px solid \", \";}}&:hover{background-color:\", \";border:1px solid \", \";}\"], theme.palette[PColor.BackgroundSecondary], theme.palette[PColor.AccentStateless], theme.palette[PColor.AccentStateless], theme.palette[PColor.BackgroundStateless], theme.palette[PColor.BordersPrimaryHover]), getInputTextColor(readOnly, disabled), error && errorMixin, autoSize && css([\"width:auto;height:auto;\"]));\n});\nvar Base = /*#__PURE__*/styled.textarea.attrs({\n className: generateClassNames(baseClassName, 'Base')\n}).withConfig({\n componentId: \"sc-1usif6k-1\"\n})(function (_ref2) {\n var palette = _ref2.theme.palette,\n _ref2$readOnly = _ref2.readOnly,\n readOnly = _ref2$readOnly === void 0 ? false : _ref2$readOnly,\n _ref2$size = _ref2.size,\n size = _ref2$size === void 0 ? InputSize.Md : _ref2$size;\n return css([\"display:block;width:100%;height:100%;color:inherit;outline:none;resize:none;min-width:0;margin:0;padding:0;border:0;background-color:transparent;outline:none;font-size:inherit;line-height:inherit;color:inherit;font-weight:inherit;font-family:inherit;box-sizing:border-box;flex:1;\", \" \", \";&::placeholder{color:\", \";}::-webkit-scrollbar{width:12px;}::-webkit-scrollbar-track{width:8px;}::-webkit-scrollbar-thumb{background:\", \";border-radius:8px;border:4px solid \", \";}\"], readOnly && \"padding-bottom: 0px;\", sizeTextAreaMixin[size], palette[PColor.TextPlaceholder], palette[PColor.BorderPrimaryStateless], palette[PColor.BackgroundStateless]);\n});\nvar ActionsButtonsWrapper = /*#__PURE__*/styled.div.attrs({\n className: generateClassNames(baseClassName, 'ActionsButtonsWrapper')\n}).withConfig({\n componentId: \"sc-1usif6k-2\"\n})(function (_ref3) {\n var _ref3$size = _ref3.size,\n size = _ref3$size === void 0 ? InputSize.Md : _ref3$size;\n return css([\"display:flex;align-items:center;width:100%;column-gap:12px;box-sizing:border-box;\", \";.SfxButton-Label{font-weight:500;}\"], sizeTextAreaMixin[size]);\n});\nvar CopyIcon = /*#__PURE__*/styled.span.attrs({\n className: generateClassNames(baseClassName, 'CopyIcon')\n}).withConfig({\n componentId: \"sc-1usif6k-3\"\n})(function (_ref4) {\n var palette = _ref4.theme.palette;\n return css([\"cursor:pointer;color:\", \";margin-left:auto;\"], palette[PColor.IconsPrimary]);\n});\nvar Styled = applyDisplayNames({\n Textarea: Textarea,\n CopyIcon: CopyIcon,\n Base: Base,\n ActionsButtonsWrapper: ActionsButtonsWrapper\n});\nexport default Styled;","import _extends from \"@babel/runtime/helpers/extends\";\nimport _defineProperty from \"@babel/runtime/helpers/defineProperty\";\nimport _slicedToArray from \"@babel/runtime/helpers/slicedToArray\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/objectWithoutProperties\";\nvar _excluded = [\"fullWidth\", \"size\", \"value\", \"readOnly\", \"disabled\", \"error\", \"cols\", \"rows\", \"copyTextMessage\", \"copySuccessIcon\", \"showActionButton\", \"showClearButton\", \"showCopyIcon\", \"disableActionButton\", \"isActionButtonLoading\", \"actionButtonLabel\", \"clearAllButtonLabel\", \"onClickActionButton\", \"onClear\", \"onChange\"];\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nimport React, { useState, useEffect, useRef } from 'react';\nimport PT from 'prop-types';\nimport CopyOutline from '@scaleflex/icons/copy-outline';\nimport { onClickByMouseDown } from '../../utils/functions/on-click-by-mouse-down';\nimport { intrinsicComponent, objectValues, useForkRef } from '../../utils/functions';\nimport { InputSize } from '../../utils/types';\nimport { handleCopyIcon } from '../input/input.utils';\nimport { getIconSize } from '../button/button.utils';\nimport InputStyled from '../input/input.styles';\nimport { Size } from '../menu-item/types';\nimport Button from '../button';\nimport Styled from './textarea.styles';\nvar Textarea = intrinsicComponent(function (_ref, ref) {\n var _inputRef$current;\n var fullWidth = _ref.fullWidth,\n size = _ref.size,\n value = _ref.value,\n readOnly = _ref.readOnly,\n disabled = _ref.disabled,\n error = _ref.error,\n cols = _ref.cols,\n rows = _ref.rows,\n _ref$copyTextMessage = _ref.copyTextMessage,\n copyTextMessage = _ref$copyTextMessage === void 0 ? '' : _ref$copyTextMessage,\n copySuccessIcon = _ref.copySuccessIcon,\n _ref$showActionButton = _ref.showActionButton,\n showActionButton = _ref$showActionButton === void 0 ? false : _ref$showActionButton,\n _ref$showClearButton = _ref.showClearButton,\n showClearButton = _ref$showClearButton === void 0 ? false : _ref$showClearButton,\n _ref$showCopyIcon = _ref.showCopyIcon,\n showCopyIcon = _ref$showCopyIcon === void 0 ? false : _ref$showCopyIcon,\n _ref$disableActionBut = _ref.disableActionButton,\n disableActionButton = _ref$disableActionBut === void 0 ? false : _ref$disableActionBut,\n _ref$isActionButtonLo = _ref.isActionButtonLoading,\n isActionButtonLoading = _ref$isActionButtonLo === void 0 ? false : _ref$isActionButtonLo,\n actionButtonLabel = _ref.actionButtonLabel,\n clearAllButtonLabel = _ref.clearAllButtonLabel,\n onClickActionButton = _ref.onClickActionButton,\n onClear = _ref.onClear,\n onChange = _ref.onChange,\n rest = _objectWithoutProperties(_ref, _excluded);\n var inputRef = useRef(null);\n var textareaRef = useForkRef(inputRef, ref);\n var _useState = useState(false),\n _useState2 = _slicedToArray(_useState, 2),\n isHovering = _useState2[0],\n setIsHovering = _useState2[1];\n var _useState3 = useState({}),\n _useState4 = _slicedToArray(_useState3, 2),\n overflowStyles = _useState4[0],\n setOverflowStyles = _useState4[1];\n var _useState5 = useState(false),\n _useState6 = _slicedToArray(_useState5, 2),\n showCopyMessage = _useState6[0],\n setShowCopyMessage = _useState6[1];\n var _useState7 = useState(value),\n _useState8 = _slicedToArray(_useState7, 2),\n inputValue = _useState8[0],\n setInputValue = _useState8[1];\n var actionButtonHandler = function actionButtonHandler(event) {\n if (onClickActionButton) {\n onClickActionButton(event);\n }\n };\n var clearAllHandler = function clearAllHandler(event) {\n setInputValue('');\n if (onClear) {\n onClear(event);\n }\n };\n var onChangeHandler = function onChangeHandler(event) {\n setInputValue(event.target.value);\n if (onChange) {\n onChange(event);\n }\n };\n var copyIconHandler = function copyIconHandler() {\n if (showCopyIcon) {\n handleCopyIcon(inputValue, setShowCopyMessage);\n }\n };\n useEffect(function () {\n var current = inputRef.current;\n if (current && current.scrollHeight > current.clientHeight) {\n setOverflowStyles({\n paddingRight: size === Size.Md ? '4px' : '0px'\n });\n }\n }, [(_inputRef$current = inputRef.current) === null || _inputRef$current === void 0 ? void 0 : _inputRef$current.scrollHeight, size]);\n useEffect(function () {\n setTimeout(function () {\n return setShowCopyMessage(false);\n }, 2000);\n }, [showCopyMessage]);\n useEffect(function () {\n setInputValue(value);\n }, [value]);\n var handleEntering = function handleEntering() {\n setTimeout(function () {\n setIsHovering(true);\n }, 150);\n };\n var handleLeaving = function handleLeaving() {\n setTimeout(function () {\n setIsHovering(false);\n }, 200);\n };\n var renderCopyText = function renderCopyText() {\n return /*#__PURE__*/React.createElement(InputStyled.NotificationBox, {\n size: size,\n isTextarea: true\n }, /*#__PURE__*/React.createElement(InputStyled.NotificationIcon, null, copySuccessIcon), /*#__PURE__*/React.createElement(InputStyled.NotificationText, null, copyTextMessage));\n };\n return /*#__PURE__*/React.createElement(Styled.Textarea, {\n size: size,\n value: inputValue,\n onMouseEnter: handleEntering,\n onMouseLeave: handleLeaving,\n readOnly: readOnly,\n disabled: disabled,\n fullWidth: Boolean(fullWidth),\n error: error,\n autoSize: Boolean(cols) || Boolean(rows)\n }, /*#__PURE__*/React.createElement(Styled.Base, _extends({}, rest, {\n value: inputValue,\n ref: textareaRef,\n size: size,\n onChange: onChangeHandler,\n readOnly: readOnly,\n disabled: disabled,\n style: _objectSpread({}, overflowStyles)\n })), (showActionButton || showClearButton || showCopyIcon) && /*#__PURE__*/React.createElement(Styled.ActionsButtonsWrapper, {\n size: size\n }, showActionButton && /*#__PURE__*/React.createElement(Button, {\n color: \"link-primary\",\n size: \"sm\",\n disabled: disableActionButton,\n loading: isActionButtonLoading,\n onMouseDown: function onMouseDown(event) {\n return onClickByMouseDown(event, actionButtonHandler);\n }\n }, actionButtonLabel), showClearButton && /*#__PURE__*/React.createElement(Button, {\n color: \"link-secondary\",\n size: \"sm\",\n onMouseDown: function onMouseDown(event) {\n return onClickByMouseDown(event, clearAllHandler);\n }\n }, clearAllButtonLabel), showCopyIcon && /*#__PURE__*/React.createElement(Styled.CopyIcon, {\n showCopyIcon: isHovering && inputValue.length > 0,\n size: size,\n onMouseDown: function onMouseDown(event) {\n return onClickByMouseDown(event, copyIconHandler);\n }\n }, /*#__PURE__*/React.createElement(CopyOutline, {\n size: getIconSize(size)\n }), showCopyMessage && renderCopyText())));\n});\nTextarea.defaultProps = {\n size: InputSize.Md,\n error: false,\n fullWidth: false,\n readOnly: false,\n disabled: false,\n disableActionButton: false,\n isActionButtonLoading: false,\n actionButtonLabel: 'Action',\n clearAllButtonLabel: 'Clear all'\n};\nexport var propTypes = {\n error: PT.bool,\n readOnly: PT.bool,\n disabled: PT.bool,\n fullWidth: PT.bool,\n disableActionButton: PT.bool,\n isActionButtonLoading: PT.bool,\n value: PT.any,\n size: PT.oneOf(objectValues(InputSize)),\n copySuccessIcon: PT.oneOfType([PT.node, PT.func]),\n copyTextMessage: PT.string,\n cols: PT.number,\n rows: PT.number,\n showActionButton: PT.bool,\n showClearButton: PT.bool,\n showCopyIcon: PT.bool,\n actionButtonLabel: PT.string,\n clearAllButtonLabel: PT.string,\n onClickActionButton: PT.func,\n onClear: PT.func\n};\nTextarea.propTypes = propTypes;\nexport default Textarea;","export var Type = {\n Input: 'input',\n Textarea: 'textarea'\n};","import styled from 'styled-components';\nimport { generateClassNames, applyDisplayNames } from '../../utils/functions';\nimport StyledLabel from '../label/label.styles';\nimport StyledFormHint from '../form-hint/form-hint.styles';\nvar baseClassName = 'InputGroup';\nvar InputGroup = /*#__PURE__*/styled.div.attrs({\n className: generateClassNames(baseClassName, 'root')\n}).withConfig({\n componentId: \"sc-zhtjwh-0\"\n})([\"\", \"{margin-top:4px;}\", \"{margin-bottom:4px;}\"], StyledFormHint.FormHint, StyledLabel.Label);\nvar Styled = applyDisplayNames({\n InputGroup: InputGroup\n});\nexport default Styled;","import _defineProperty from \"@babel/runtime/helpers/defineProperty\";\nimport _extends from \"@babel/runtime/helpers/extends\";\nimport _typeof from \"@babel/runtime/helpers/typeof\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/objectWithoutProperties\";\nvar _excluded = [\"children\", \"type\", \"error\", \"label\", \"hint\", \"LabelProps\", \"InputProps\", \"inputProps\", \"inputRef\", \"TextareaProps\", \"readOnly\", \"disabled\", \"size\", \"value\"];\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nimport React from 'react';\nimport PT from 'prop-types';\nimport { intrinsicComponent, objectValues } from '../../utils/functions';\nimport Label from '../label';\nimport { propTypes as labelPropTypes } from '../label/label.component';\nimport Input from '../input';\nimport { propTypes as inputPropTypes } from '../input/input.component';\nimport { InputSize } from '../../utils/types';\nimport Textarea from '../textarea';\nimport { propTypes as textareaPropTypes } from '../textarea/textarea.component';\nimport FormHint from '../form-hint';\nimport { Type } from './types';\nimport Styled from './input-group.styles';\nvar InputGroup = intrinsicComponent(function (_ref, ref) {\n var children = _ref.children,\n type = _ref.type,\n error = _ref.error,\n label = _ref.label,\n hint = _ref.hint,\n LabelPropsData = _ref.LabelProps,\n InputPropsData = _ref.InputProps,\n inputProps = _ref.inputProps,\n inputRef = _ref.inputRef,\n TextareaPropsData = _ref.TextareaProps,\n readOnly = _ref.readOnly,\n disabled = _ref.disabled,\n size = _ref.size,\n value = _ref.value,\n rest = _objectWithoutProperties(_ref, _excluded);\n var renderLabel = function renderLabel() {\n if (label) {\n if (typeof label === 'function') {\n return label({\n error: error\n });\n }\n if (_typeof(label) === 'object') {\n return label;\n }\n return /*#__PURE__*/React.createElement(Label, _extends({\n size: size,\n error: error,\n disabled: disabled\n }, LabelPropsData || {}), label);\n }\n return null;\n };\n var renderField = function renderField() {\n var fieldProps = _objectSpread({\n value: value,\n readOnly: readOnly,\n disabled: disabled,\n size: size,\n error: error\n }, rest);\n if (type === Type.Input) {\n return /*#__PURE__*/React.createElement(Input, _extends({}, fieldProps, InputPropsData || {}, inputProps, {\n ref: (inputRef === null || inputRef === void 0 ? void 0 : inputRef.ref) || inputRef,\n readOnly: readOnly,\n disabled: disabled\n }));\n }\n if (type === Type.Textarea) {\n return /*#__PURE__*/React.createElement(Textarea, _extends({}, fieldProps, TextareaPropsData || {}));\n }\n return null;\n };\n var renderHint = function renderHint() {\n if (hint) {\n if (typeof hint === 'function') {\n return hint({\n error: error\n });\n }\n if (_typeof(hint) === 'object') {\n return hint;\n }\n return /*#__PURE__*/React.createElement(FormHint, {\n size: size,\n error: error,\n disabled: disabled\n }, hint);\n }\n return null;\n };\n return /*#__PURE__*/React.createElement(Styled.InputGroup, {\n ref: ref\n }, renderLabel(), renderField(), renderHint());\n});\nInputGroup.defaultProps = {\n type: Type.Input,\n error: false,\n readOnly: false\n};\nInputGroup.propTypes = {\n type: PT.oneOf(objectValues(Type)),\n size: PT.oneOf(objectValues(InputSize)),\n label: PT.node,\n hint: PT.node,\n error: PT.bool,\n value: PT.any,\n LabelProps: PT.exact(labelPropTypes),\n InputProps: PT.exact(inputPropTypes),\n inputProps: PT.object,\n inputRef: PT.oneOfType([PT.func, PT.object]),\n TextareaProps: PT.exact(textareaPropTypes),\n readOnly: PT.bool,\n disabled: PT.bool\n};\nexport default InputGroup;","export var Size = {\n Xs: 'xs',\n Sm: 'sm',\n Md: 'md',\n Lg: 'lg',\n Xl: 'xl'\n};","import * as React from 'react';\nvar ModalMenuContext = /*#__PURE__*/React.createContext({\n modalOpened: false\n});\nif (process.env.NODE_ENV !== 'production') {\n ModalMenuContext.displayName = 'ModalMenuContext';\n}\nexport default ModalMenuContext;","import _defineProperty from \"@babel/runtime/helpers/defineProperty\";\nimport { css } from 'styled-components';\nimport { Size } from './types';\nexport var modalSizeMixin = _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({}, Size.Xs, css([\"max-width:300px;\"])), Size.Sm, css([\"max-width:600px;\"])), Size.Md, css([\"max-width:960px;\"])), Size.Lg, css([\"max-width:1280px;\"])), Size.Xl, css([\"max-width:1920px;\"]));","import styled, { css } from 'styled-components';\nimport { generateClassNames, applyDisplayNames } from '../../utils/functions';\nimport { Color as PColor } from '../../utils/types/palette';\nimport { BorderRadiusSize as BRSize } from '../../utils/types/shape';\nimport { modalSizeMixin } from './modal.mixin';\nimport { Size } from './types';\nvar baseClassName = 'Modal';\nvar Wrapper = /*#__PURE__*/styled.div.attrs({\n className: generateClassNames(baseClassName, 'Wrapper')\n}).withConfig({\n componentId: \"sc-80m07l-0\"\n})(function (_ref) {\n var open = _ref.open;\n return css([\"position:fixed;right:0px;bottom:0px;top:0px;left:0px;z-index:1200;visibility:\", \";\"], open ? 'visible' : 'hidden');\n});\nvar Overlay = /*#__PURE__*/styled.div.attrs({\n className: generateClassNames(baseClassName, 'Overlay')\n}).withConfig({\n componentId: \"sc-80m07l-1\"\n})(function (_ref2) {\n var open = _ref2.open;\n return css([\"position:fixed;right:0px;bottom:0px;top:0px;left:0px;background-color:rgba(0,0,0,0.5);z-index:-1;transition:opacity 251ms cubic-bezier(0.4,0,0.2,1) 0ms;opacity:\", \";\"], open ? '1' : '0');\n});\nvar Container = /*#__PURE__*/styled.div.attrs({\n className: generateClassNames(baseClassName, 'Container')\n}).withConfig({\n componentId: \"sc-80m07l-2\"\n})(function (_ref3) {\n var theme = _ref3.theme,\n _ref3$open = _ref3.open,\n open = _ref3$open === void 0 ? false : _ref3$open,\n _ref3$fullWidth = _ref3.fullWidth,\n fullWidth = _ref3$fullWidth === void 0 ? false : _ref3$fullWidth,\n _ref3$maxWidth = _ref3.maxWidth,\n maxWidth = _ref3$maxWidth === void 0 ? Size.Sm : _ref3$maxWidth;\n return css([\"position:absolute;overflow-x:hidden;overflow-y:auto;transition:opacity 251ms cubic-bezier(0.4,0,0.2,1) 0ms,transform 167ms cubic-bezier(0.4,0,0.2,1) 0ms;outline:0;border-radius:\", \";background-color:\", \";box-shadow:0px 2px 4px \", \";visibility:\", \";opacity:\", \";display:flex;max-height:calc(100% - 64px);flex-direction:column;\", \" \", \" top:50%;left:50%;transform:translate(-50%,-50%);\"], theme.shape.borderRadius[BRSize.Lg], theme.palette[PColor.BackgroundSecondary], theme.palette[PColor.LightShadow], open ? 'visible' : 'hidden', open ? '1' : '0', fullWidth && css([\"width:calc(100% - 64px);\"]), modalSizeMixin[maxWidth]);\n});\nvar Modal = /*#__PURE__*/styled.div.attrs({\n className: generateClassNames(baseClassName, 'root')\n}).withConfig({\n componentId: \"sc-80m07l-3\"\n})(function () {\n return css([\"position:relative;padding-top:8px;padding-bottom:8px;margin:0;padding:0;outline:0;display:flex;flex-direction:column;\"]);\n});\nvar Styled = applyDisplayNames({\n Modal: Modal,\n Wrapper: Wrapper,\n Overlay: Overlay,\n Container: Container\n});\nexport default Styled;","import _extends from \"@babel/runtime/helpers/extends\";\nimport _defineProperty from \"@babel/runtime/helpers/defineProperty\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/objectWithoutProperties\";\nvar _excluded = [\"children\", \"open\", \"onClose\", \"maxWidth\", \"fullWidth\", \"modalStyles\", \"hideOverlay\", \"disableOverlayClick\"];\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nimport React, { useEffect, isValidElement } from 'react';\nimport { createPortal } from 'react-dom';\nimport PT from 'prop-types';\nimport { intrinsicComponent, objectValues } from '../../utils/functions';\nimport { Size } from './types';\nimport ModalMenuContext from './modal-menu-context';\nimport Styled from './modal.styles';\nvar isValidSingleFragmentChildren = function isValidSingleFragmentChildren(children) {\n return children && /*#__PURE__*/isValidElement(children) && React.Children.count(children) === 1 && children.type === React.Fragment;\n};\nvar Modal = intrinsicComponent(function (_ref, ref) {\n var _children = _ref.children,\n open = _ref.open,\n onClose = _ref.onClose,\n maxWidth = _ref.maxWidth,\n fullWidth = _ref.fullWidth,\n modalStyles = _ref.modalStyles,\n hideOverlay = _ref.hideOverlay,\n disableOverlayClick = _ref.disableOverlayClick,\n rest = _objectWithoutProperties(_ref, _excluded);\n var children = isValidSingleFragmentChildren(_children) ? _children.props.children : _children;\n\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n var target = document.querySelector('body');\n useEffect(function () {\n if (open) {\n document.body.classList.add('Modal-open');\n } else {\n document.body.classList.remove('Modal-open');\n }\n return function () {\n document.body.classList.remove('Modal-open');\n };\n }, [open]);\n var handleClose = function handleClose() {\n if (typeof onClose === 'function') {\n onClose();\n }\n };\n useEffect(function () {\n var keyListener = function keyListener(ev) {\n if (ev.key === 'Escape') {\n handleClose();\n }\n };\n document.addEventListener('keydown', keyListener);\n return function () {\n return document.removeEventListener('keydown', keyListener);\n };\n });\n var render = function render() {\n return /*#__PURE__*/React.createElement(ModalMenuContext.Provider, {\n value: {\n modalOpened: Boolean(open)\n }\n }, /*#__PURE__*/React.createElement(Styled.Wrapper, {\n style: _objectSpread({}, modalStyles),\n open: Boolean(open),\n ref: ref\n }, !hideOverlay && /*#__PURE__*/React.createElement(Styled.Overlay, {\n onClick: function onClick() {\n return disableOverlayClick ? null : handleClose();\n },\n open: Boolean(open)\n }), /*#__PURE__*/React.createElement(Styled.Container, _extends({}, rest, {\n maxWidth: maxWidth,\n fullWidth: fullWidth,\n open: Boolean(open)\n }), /*#__PURE__*/React.createElement(Styled.Modal, null, React.Children.map(children, function (child) {\n if ( /*#__PURE__*/isValidElement(child) && child.type.displayName === 'ModalTitle') {\n return /*#__PURE__*/React.cloneElement(child, _objectSpread({\n onClose: handleClose\n }, child.props || {}));\n }\n return child;\n })))));\n };\n return /*#__PURE__*/createPortal(render(), target);\n});\nexport var defaultProps = {\n open: false,\n fullWidth: false,\n disableOverlayClick: false,\n hideOverlay: false,\n maxWidth: Size.Xs\n};\nModal.defaultProps = defaultProps;\nexport var propTypes = {\n onClose: PT.func,\n modalStyles: PT.object,\n disableOverlayClick: PT.bool,\n hideOverlay: PT.bool,\n children: PT.node.isRequired,\n maxWidth: PT.oneOf(objectValues(Size)),\n open: PT.bool,\n fullWidth: PT.bool\n};\nModal.propTypes = propTypes;\nexport default Modal;","export var Align = {\n Left: 'left',\n Center: 'center',\n Right: 'right'\n};","import styled, { css } from 'styled-components';\nimport { generateClassNames, applyDisplayNames } from '../../utils/functions';\nimport { Align } from './types';\nvar baseClassName = 'ModalActions';\nvar ModalActions = /*#__PURE__*/styled.div.attrs({\n className: generateClassNames(baseClassName, 'root')\n}).withConfig({\n componentId: \"sc-1wg6u00-0\"\n})(function (_ref) {\n var _ref$align = _ref.align,\n align = _ref$align === void 0 ? Align.Center : _ref$align;\n return css([\"position:relative;display:flex;align-items:center;padding:24px;justify-content:\", \";gap:12px;\"], align === Align.Right ? 'flex-end' : align);\n});\nvar Styled = applyDisplayNames({\n ModalActions: ModalActions\n});\nexport default Styled;","import _extends from \"@babel/runtime/helpers/extends\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/objectWithoutProperties\";\nvar _excluded = [\"children\"];\nimport React from 'react';\nimport PT from 'prop-types';\nimport { intrinsicComponent, objectValues } from '../../utils/functions';\nimport Styled from './modal-actions.styles';\nimport { Align } from './types';\nvar ModalActions = intrinsicComponent(function (_ref, ref) {\n var children = _ref.children,\n rest = _objectWithoutProperties(_ref, _excluded);\n return /*#__PURE__*/React.createElement(Styled.ModalActions, _extends({}, rest, {\n ref: ref\n }), children);\n});\nModalActions.defaultProps = {\n align: Align.Center\n};\nModalActions.propTypes = {\n children: PT.node.isRequired,\n align: PT.oneOf(objectValues(Align))\n};\nModalActions.displayName = 'ModalActions';\nexport default ModalActions;","import styled, { css } from 'styled-components';\nimport { generateClassNames, applyDisplayNames } from '../../utils/functions';\nvar baseClassName = 'ModalContent';\nvar ModalContent = /*#__PURE__*/styled.div.attrs({\n className: generateClassNames(baseClassName, 'root')\n}).withConfig({\n componentId: \"sc-1ng1w0v-0\"\n})(function () {\n return css([\"position:relative;padding:12px 24px 0px;\"]);\n});\nvar Styled = applyDisplayNames({\n ModalContent: ModalContent\n});\nexport default Styled;","import _extends from \"@babel/runtime/helpers/extends\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/objectWithoutProperties\";\nvar _excluded = [\"children\"];\nimport React from 'react';\nimport PT from 'prop-types';\nimport { intrinsicComponent } from '../../utils/functions';\nimport Styled from './modal-content.styles';\nvar ModalContent = intrinsicComponent(function (_ref, ref) {\n var children = _ref.children,\n rest = _objectWithoutProperties(_ref, _excluded);\n return /*#__PURE__*/React.createElement(Styled.ModalContent, _extends({}, rest, {\n ref: ref\n }), children);\n});\nModalContent.defaultProps = {};\nModalContent.propTypes = {\n children: PT.node.isRequired\n};\nModalContent.displayName = 'ModalContent';\nexport default ModalContent;","export var Variant = {\n Default: 'default',\n WithIcon: 'with-icon'\n};","import styled, { css } from 'styled-components';\nimport { generateClassNames, applyDisplayNames } from '../../utils/functions';\nimport { Color as PColor } from '../../utils/types/palette';\nimport { BorderRadiusSize as BRSize } from '../../utils/types/shape';\nimport { Variant } from './types';\nvar baseClassName = 'ModalTitle';\nvar Icon = /*#__PURE__*/styled.div.attrs({\n className: generateClassNames(baseClassName, 'Icon')\n}).withConfig({\n componentId: \"sc-l3tf49-0\"\n})(function (_ref) {\n var palette = _ref.theme.palette;\n return css([\"display:flex;margin-bottom:8px;padding:14.5px;border-radius:50%;background:\", \";color:\", \";\"], palette[PColor.Accent_1_2_Opacity], palette[PColor.AccentStateless]);\n});\nvar LabelPrimary = /*#__PURE__*/styled.div.attrs({\n className: generateClassNames(baseClassName, 'LabelPrimary')\n}).withConfig({\n componentId: \"sc-l3tf49-1\"\n})(function (_ref2) {\n var _ref2$variant = _ref2.variant,\n variant = _ref2$variant === void 0 ? Variant.Default : _ref2$variant;\n return css([\"font-size:18px;line-height:27px;font-weight:\", \";\"], variant === Variant.Default ? 400 : 500);\n});\nvar LabelSecondary = /*#__PURE__*/styled.div.attrs({\n className: generateClassNames(baseClassName, 'LabelSecondary')\n}).withConfig({\n componentId: \"sc-l3tf49-2\"\n})([\"font-size:12px;line-height:14px;margin-top:4px;\"]);\nvar Close = /*#__PURE__*/styled.div.attrs({\n className: generateClassNames(baseClassName, 'Close')\n}).withConfig({\n componentId: \"sc-l3tf49-3\"\n})(function (_ref3) {\n var _ref3$variant = _ref3.variant,\n variant = _ref3$variant === void 0 ? Variant.Default : _ref3$variant,\n palette = _ref3.theme.palette;\n return css([\"position:absolute;display:flex;top:\", \"px;right:\", \"px;color:\", \";&:hover{color:\", \";}cursor:pointer;\"], variant === Variant.WithIcon ? 2 : 8, variant === Variant.WithIcon ? 2 : 8, palette[PColor.IconsSecondary], palette[PColor.AccentPrimary]);\n});\nvar ModalTitle = /*#__PURE__*/styled.div.attrs({\n className: generateClassNames(baseClassName, 'root')\n}).withConfig({\n componentId: \"sc-l3tf49-4\"\n})(function (_ref4) {\n var _ref4$variant = _ref4.variant,\n variant = _ref4$variant === void 0 ? Variant.Default : _ref4$variant,\n _ref4$theme = _ref4.theme,\n palette = _ref4$theme.palette,\n borderRadius = _ref4$theme.shape.borderRadius;\n return css([\"position:relative;color:\", \";border-radius:\", \" \", \" 0px 0px;\", \" \", \" \", \"\"], palette[PColor.TextPrimary], borderRadius[BRSize.Md], borderRadius[BRSize.Md], function () {\n var paddingY = variant === Variant.WithIcon ? 26 : 14;\n var paddingX = variant === Variant.WithIcon ? 12 : 14;\n var paddingLeft = 18;\n var paddingRight = variant === Variant.WithIcon ? paddingLeft : 40;\n return css([\"padding:\", \"px \", \"px \", \"px \", \"px;\"], paddingY, paddingRight, paddingX, paddingLeft);\n }, variant === Variant.Default && css([\"background:\", \";border-bottom:1px solid \", \";\"], palette[PColor.BackgroundPrimary], palette[PColor.BordersSecondary]), variant === Variant.WithIcon && css([\"display:flex;align-items:center;flex-direction:column;\"]));\n});\nvar Styled = applyDisplayNames({\n ModalTitle: ModalTitle,\n LabelPrimary: LabelPrimary,\n LabelSecondary: LabelSecondary,\n Close: Close,\n Icon: Icon\n});\nexport default Styled;","import _extends from \"@babel/runtime/helpers/extends\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/objectWithoutProperties\";\nvar _excluded = [\"secondary\", \"onClose\", \"primaryLabelStyles\"];\nimport React from 'react';\nimport PT from 'prop-types';\nimport { intrinsicComponent, objectValues } from '../../utils/functions';\nimport CrossButton from '../cross-button';\nimport Styled from './modal-title.styles';\nimport { Variant } from './types';\nvar ModalTitle = intrinsicComponent(function (_ref, ref) {\n var secondary = _ref.secondary,\n onClose = _ref.onClose,\n primaryLabelStyles = _ref.primaryLabelStyles,\n rest = _objectWithoutProperties(_ref, _excluded);\n return /*#__PURE__*/React.createElement(Styled.ModalTitle, _extends({}, rest, {\n ref: ref\n }), rest.icon && /*#__PURE__*/React.createElement(Styled.Icon, {\n iconShadow: Boolean(rest.iconShadow)\n }, rest.icon), /*#__PURE__*/React.createElement(Styled.LabelPrimary, {\n variant: rest.variant,\n style: primaryLabelStyles\n }, rest.primary), rest.variant === Variant.WithIcon && secondary && /*#__PURE__*/React.createElement(Styled.LabelSecondary, null, secondary), /*#__PURE__*/React.createElement(Styled.Close, {\n variant: rest.variant\n }, /*#__PURE__*/React.createElement(CrossButton, {\n size: \"lg\",\n onClick: onClose\n })));\n});\nModalTitle.defaultProps = {\n iconShadow: true,\n variant: Variant.Default\n};\nModalTitle.propTypes = {\n primary: PT.node.isRequired,\n secondary: PT.node,\n icon: PT.node,\n iconShadow: PT.bool,\n onClose: PT.func,\n primaryLabelStyles: PT.object,\n variant: PT.oneOf(objectValues(Variant))\n};\nModalTitle.displayName = 'ModalTitle';\nexport default ModalTitle;","export var Status = {\n Success: 'success',\n Info: 'info',\n Error: 'error',\n Warning: 'warning'\n};","import styled, { css } from 'styled-components';\nimport { generateClassNames, applyDisplayNames } from '../../utils/functions';\nvar baseClassName = 'PopupStatus';\nvar PopupStatus = /*#__PURE__*/styled.span.attrs({\n className: generateClassNames(baseClassName, 'root')\n}).withConfig({\n componentId: \"sc-qash56-0\"\n})(function () {\n return css([\"display:flex;\"]);\n});\nvar Styled = applyDisplayNames({\n PopupStatus: PopupStatus\n});\nexport default Styled;","import _extends from \"@babel/runtime/helpers/extends\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/objectWithoutProperties\";\nvar _excluded = [\"status\", \"notificationBackground\"];\nimport React from 'react';\nimport PT from 'prop-types';\nimport { Success, About, Error, Warning, InfoOutline, WarningOutline, ErrorOutline } from '@scaleflex/icons';\nimport { lightPalette } from '@scaleflex/ui/theme/roots/palette';\nimport { Color } from '@scaleflex/ui/utils/types/palette';\nimport { intrinsicComponent, objectValues } from '../../utils/functions';\nimport { Status } from './types';\nimport Styled from './popup-status.styles';\nvar getPopupStatusIcon = function getPopupStatusIcon(status, notificationBackground) {\n switch (status) {\n case Status.Warning:\n return notificationBackground ? /*#__PURE__*/React.createElement(Warning, {\n color: lightPalette[Color.Warning],\n size: 20\n }) : /*#__PURE__*/React.createElement(WarningOutline, {\n color: lightPalette[Color.Warning],\n size: 12\n });\n case Status.Error:\n return notificationBackground ? /*#__PURE__*/React.createElement(Error, {\n color: lightPalette[Color.Error],\n size: 20\n }) : /*#__PURE__*/React.createElement(ErrorOutline, {\n color: lightPalette[Color.Error],\n size: 12\n });\n case Status.Info:\n return notificationBackground ? /*#__PURE__*/React.createElement(About, {\n color: lightPalette[Color.Info],\n size: 20\n }) : /*#__PURE__*/React.createElement(InfoOutline, {\n color: lightPalette[Color.Info],\n size: 12\n });\n case Status.Success:\n default:\n return /*#__PURE__*/React.createElement(Success, {\n color: lightPalette[Color.Success],\n size: 20\n });\n }\n};\nvar PopupStatus = intrinsicComponent(function (_ref, ref) {\n var status = _ref.status,\n _ref$notificationBack = _ref.notificationBackground,\n notificationBackground = _ref$notificationBack === void 0 ? true : _ref$notificationBack,\n rest = _objectWithoutProperties(_ref, _excluded);\n return /*#__PURE__*/React.createElement(Styled.PopupStatus, _extends({\n status: status\n }, rest, {\n ref: ref\n }), getPopupStatusIcon(status, notificationBackground));\n});\nexport var defaultProps = {\n status: Status.Success\n};\nPopupStatus.defaultProps = defaultProps;\nexport var propTypes = {\n status: PT.oneOf(objectValues(Status))\n};\nPopupStatus.propTypes = propTypes;\nexport default PopupStatus;","import _defineProperty from \"@babel/runtime/helpers/defineProperty\";\nimport { css } from 'styled-components';\nimport { Color as PaletteColor } from '@scaleflex/ui/utils/types/palette';\nimport { Status } from '../popup-status/types';\nexport var popupContentMixin = _defineProperty(_defineProperty(_defineProperty(_defineProperty({}, Status.Success, function (_ref) {\n var palette = _ref.theme.palette;\n return css([\"background-color:\", \";\"], palette[PaletteColor.BackgroundGreen]);\n}), Status.Info, function (_ref2) {\n var palette = _ref2.theme.palette;\n return css([\"background-color:\", \";\"], palette[PaletteColor.BackgroundBlue]);\n}), Status.Error, function (_ref3) {\n var palette = _ref3.theme.palette;\n return css([\"background-color:\", \";\"], palette[PaletteColor.BackgroundRed]);\n}), Status.Warning, function (_ref4) {\n var palette = _ref4.theme.palette;\n return css([\"background-color:\", \";\"], palette[PaletteColor.BackgroundOrange]);\n});","import styled, { css } from 'styled-components';\nimport { generateClassNames, applyDisplayNames } from '../../utils/functions';\nimport { Color as PColor } from '../../utils/types/palette';\nimport { FontVariant } from '../../utils/types/typography';\nimport { popupContentMixin } from './popup-content.mixin';\nvar baseClassName = 'PopupContent';\nvar LabelWrapper = /*#__PURE__*/styled.span.attrs({\n className: generateClassNames(baseClassName, 'LabelWrapper')\n}).withConfig({\n componentId: \"sc-njbmnt-0\"\n})(function (_ref) {\n var palette = _ref.theme.palette;\n return css([\"display:flex;flex-grow:1;margin-left:44px;margin-right:28px;padding:16px;padding-right:0;overflow:hidden;background:\", \";\"], palette[PColor.ButtonPrimaryText]);\n});\nvar Label = /*#__PURE__*/styled.span.attrs({\n className: generateClassNames(baseClassName, 'Label')\n}).withConfig({\n componentId: \"sc-njbmnt-1\"\n})(function (_ref2) {\n var _ref2$theme = _ref2.theme,\n palette = _ref2$theme.palette,\n font = _ref2$theme.typography.font;\n return css([\"max-width:100%;overflow:hidden;text-overflow:ellipsis;color:\", \";\", \"\"], palette[PColor.TextPrimary], font[FontVariant.TextSmallUp]);\n});\nvar PopupContent = /*#__PURE__*/styled.div.attrs({\n className: generateClassNames(baseClassName, 'PopupContent')\n}).withConfig({\n componentId: \"sc-njbmnt-2\"\n})(function (_ref3) {\n var theme = _ref3.theme;\n return css([\"position:relative;display:flex;align-items:center;width:360px;border-radius:4px;box-shadow:0px 2px 6px \", \";\"], theme.palette[PColor.LargeShadow]);\n});\nvar CloseWrapper = /*#__PURE__*/styled.div.attrs({\n className: generateClassNames(baseClassName, 'PopupContent')\n}).withConfig({\n componentId: \"sc-njbmnt-3\"\n})(function (_ref4) {\n var theme = _ref4.theme;\n return css([\"position:absolute;top:0;right:0;display:flex;justify-content:center;align-items:flex-start;box-sizing:border-box;padding:2px;height:fit-content;cursor:pointer;background:\", \";border-radius:0 4px 4px 0;height:100%;\"], theme.palette[PColor.BackgroundStateless]);\n});\nvar PopupStatus = /*#__PURE__*/styled.div.attrs({\n className: generateClassNames(baseClassName, 'PopupStatus')\n}).withConfig({\n componentId: \"sc-njbmnt-4\"\n})(function (_ref5) {\n var _ref5$status = _ref5.status,\n status = _ref5$status === void 0 ? 'success' : _ref5$status;\n return css([\"position:absolute;display:flex;left:0;z-index:1;height:100%;min-width:44px;align-items:center;justify-content:center;box-sizing:border-box;border-radius:4px 0 0 4px;\", \"\"], popupContentMixin[status]);\n});\nvar Styled = applyDisplayNames({\n PopupContent: PopupContent,\n PopupStatus: PopupStatus,\n LabelWrapper: LabelWrapper,\n CloseWrapper: CloseWrapper,\n Label: Label\n});\nexport default Styled;","import _defineProperty from \"@babel/runtime/helpers/defineProperty\";\nimport _extends from \"@babel/runtime/helpers/extends\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/objectWithoutProperties\";\nvar _excluded = [\"onClose\", \"message\", \"status\"];\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nimport React from 'react';\nimport PT from 'prop-types';\nimport { intrinsicComponent } from '../../utils/functions';\nimport PopupStatus from '../popup-status';\nimport CrossButton from '../cross-button/cross-button.component';\nimport { defaultProps as popupStatusDefaultProps, propTypes as popupStatusPropTypes } from '../popup-status/popup-status.component';\nimport Styled from './popup-content.styles';\nvar PopupContent = intrinsicComponent(function (_ref, ref) {\n var onClose = _ref.onClose,\n message = _ref.message,\n status = _ref.status,\n rest = _objectWithoutProperties(_ref, _excluded);\n return /*#__PURE__*/React.createElement(Styled.PopupContent, _extends({}, rest, {\n ref: ref\n }), /*#__PURE__*/React.createElement(Styled.PopupStatus, _extends({\n status: status,\n message: message\n }, rest), /*#__PURE__*/React.createElement(PopupStatus, {\n status: status\n })), /*#__PURE__*/React.createElement(Styled.LabelWrapper, null, /*#__PURE__*/React.createElement(Styled.Label, null, message)), /*#__PURE__*/React.createElement(Styled.CloseWrapper, null, /*#__PURE__*/React.createElement(CrossButton, {\n size: \"sm\",\n onClick: onClose\n })));\n});\nexport var defaultProps = _objectSpread({}, popupStatusDefaultProps);\nPopupContent.defaultProps = defaultProps;\nexport var propTypes = _objectSpread(_objectSpread({}, popupStatusPropTypes), {}, {\n message: PT.node.isRequired,\n onClose: PT.func\n});\nPopupContent.propTypes = propTypes;\nexport default PopupContent;","export var Horizontal = {\n Center: 'center',\n Left: 'left',\n Right: 'right'\n};","export var Vertical = {\n Top: 'top',\n Bottom: 'bottom'\n};","import _defineProperty from \"@babel/runtime/helpers/defineProperty\";\nimport { css } from 'styled-components';\n// import type { WithTheme } from '../../theme/entity';\n// import { Color as PaletteColor } from '../../utils/types/palette';\nimport { Horizontal, Vertical } from './types';\nexport var positionHorizontalMixin = _defineProperty(_defineProperty(_defineProperty({}, Horizontal.Left, css([\"left:25px;right:auto;\"])), Horizontal.Center, css([\"left:50%;right:auto;transform:translateX(-50%);\"])), Horizontal.Right, css([\"left:auto;right:25px;\"]));\nexport var positionVerticalMixin = _defineProperty(_defineProperty({}, Vertical.Top, css([\"top:25px;bottom:auto;\"])), Vertical.Bottom, css([\"top:auto;bottom:25px;\"]));\n\n// export const errorMixin = ({ theme: { palette } }: WithTheme) => css`\n// background: ${palette[PaletteColor.BackgroundSecondary]} !important;\n// border: 1px solid ${palette[PaletteColor.Error]} !important;\n// `;","import styled, { css } from 'styled-components';\nimport { generateClassNames, applyDisplayNames } from '../../utils/functions';\n// import type { WithTheme } from '../../theme/entity';\n// import { Color as PColor } from '../../utils/types/palette';\n// import { FontVariant } from '../../utils/types/typography';\n// import { BorderRadiusSize as BRSize } from '../../utils/types/shape';\n\nimport { positionHorizontalMixin, positionVerticalMixin } from './popup.mixin';\nimport { Horizontal, Vertical } from './types';\nvar baseClassName = 'Popup';\nvar Popup = /*#__PURE__*/styled.div.attrs({\n className: generateClassNames(baseClassName, 'root')\n}).withConfig({\n componentId: \"sc-jmtjri-0\"\n})(function (_ref) {\n var anchorOrigin = _ref.anchorOrigin;\n return css([\"position:fixed;display:flex;align-items:center;justify-content:center;z-index:1400;\", \" \", \"\"], positionHorizontalMixin[(anchorOrigin === null || anchorOrigin === void 0 ? void 0 : anchorOrigin.horizontal) || Horizontal.Left], positionVerticalMixin[(anchorOrigin === null || anchorOrigin === void 0 ? void 0 : anchorOrigin.vertical) || Vertical.Bottom]);\n});\nvar Styled = applyDisplayNames({\n Popup: Popup\n});\nexport default Styled;","import _defineProperty from \"@babel/runtime/helpers/defineProperty\";\nimport _extends from \"@babel/runtime/helpers/extends\";\nimport _slicedToArray from \"@babel/runtime/helpers/slicedToArray\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/objectWithoutProperties\";\nvar _excluded = [\"autoHideDuration\", \"anchorOrigin\", \"open\", \"onClose\"];\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nimport React, { useEffect, useState } from 'react';\nimport { createPortal } from 'react-dom';\nimport PT from 'prop-types';\nimport { intrinsicComponent, objectValues, generateClassNames } from '../../utils/functions';\nimport usePortal from '../../hooks/use-portal';\nimport PopupContent, { defaultProps as cDefaultProps, propTypes as cPropTypes } from '../popup-content/popup-content.component';\nimport { Horizontal, Vertical } from './types';\nimport Styled from './popup.styles';\nvar Popup = intrinsicComponent(function (props, ref) {\n var autoHideDuration = props.autoHideDuration,\n anchorOrigin = props.anchorOrigin,\n open = props.open,\n onClose = props.onClose,\n rest = _objectWithoutProperties(props, _excluded);\n var target = usePortal(generateClassNames('Popup'));\n var _useState = useState(autoHideDuration),\n _useState2 = _slicedToArray(_useState, 2),\n hoverHideDuration = _useState2[0],\n setHoverHideDuration = _useState2[1];\n var _useState3 = useState(false),\n _useState4 = _slicedToArray(_useState3, 2),\n isHovering = _useState4[0],\n setIsHovering = _useState4[1];\n var handleMouseLeave = function handleMouseLeave() {\n setIsHovering(false);\n setHoverHideDuration(1000);\n };\n useEffect(function () {\n if (open) setHoverHideDuration(autoHideDuration);\n }, [open]);\n useEffect(function () {\n var timeout = null;\n if (open && !isHovering && hoverHideDuration && typeof onClose === 'function') {\n timeout = setTimeout(onClose, hoverHideDuration);\n }\n return function () {\n if (timeout) {\n clearTimeout(timeout);\n }\n };\n }, [hoverHideDuration, isHovering, open, onClose]);\n var render = function render() {\n if (!open) {\n return null;\n }\n return /*#__PURE__*/React.createElement(Styled.Popup, _extends({\n onMouseEnter: function onMouseEnter() {\n return setIsHovering(true);\n },\n onMouseLeave: handleMouseLeave\n }, props), /*#__PURE__*/React.createElement(PopupContent, _extends({\n onClose: onClose\n }, rest, {\n ref: ref\n })));\n };\n return /*#__PURE__*/createPortal(render(), target);\n});\nPopup.defaultProps = _objectSpread(_objectSpread({}, cDefaultProps), {}, {\n open: false,\n autoHideDuration: 5000,\n anchorOrigin: {\n vertical: Vertical.Bottom,\n horizontal: Horizontal.Left\n }\n});\nPopup.propTypes = _objectSpread(_objectSpread({}, cPropTypes), {}, {\n anchorOrigin: PT.exact({\n vertical: PT.oneOf(objectValues(Vertical)),\n horizontal: PT.oneOf(objectValues(Horizontal))\n }),\n open: PT.bool,\n autoHideDuration: PT.number,\n onClose: PT.func\n});\nexport default Popup;","import styled, { css } from 'styled-components';\nimport { generateClassNames, applyDisplayNames } from '../../utils/functions';\nimport { Color as PC } from '../../utils/types/palette';\nvar baseClassName = 'RotationSlider';\nvar RotationSliderList = /*#__PURE__*/styled.ul.attrs({\n className: generateClassNames(baseClassName, 'list')\n}).withConfig({\n componentId: \"sc-1xuruq0-0\"\n})([\"display:flex;align-items:center;position:relative;padding:0;width:100%;list-style:none;\"]);\nvar RotationSliderBigDot = /*#__PURE__*/styled.li.attrs({\n className: generateClassNames(baseClassName, 'big-dot')\n}).withConfig({\n componentId: \"sc-1xuruq0-1\"\n})(function (_ref) {\n var palette = _ref.theme.palette;\n return css([\"width:8px;height:8px;border-radius:50%;background-color:\", \";cursor:pointer;\"], palette[PC.LinkPrimary]);\n});\nvar RotationSliderSmallDotWrapper = /*#__PURE__*/styled.div.attrs({\n className: generateClassNames(baseClassName, 'small-dot-wrapper')\n}).withConfig({\n componentId: \"sc-1xuruq0-2\"\n})([\"padding:2px;\"]);\nvar RotationSliderSmallDot = /*#__PURE__*/styled.li.attrs({\n className: generateClassNames(baseClassName, 'small-dot')\n}).withConfig({\n componentId: \"sc-1xuruq0-3\"\n})(function (_ref2) {\n var palette = _ref2.theme.palette;\n return css([\"width:2px;height:2px;border-radius:50%;background-color:\", \";cursor:pointer;\"], palette[PC.LinkPrimary]);\n});\nvar RotationSliderControl = /*#__PURE__*/styled.span.attrs({\n className: generateClassNames(baseClassName, 'control')\n}).withConfig({\n componentId: \"sc-1xuruq0-4\"\n})(function (_ref3) {\n var palette = _ref3.theme.palette;\n return css([\"display:flex;justify-content:center;align-items:center;position:absolute;height:18px;width:2px;transform:translate(-50%,-50%);top:50%;background-color:\", \";& > input{border:0px;clip:rect(0px,0px,0px,0px);height:100%;margin:-1px;overflow:hidden;padding:0px;position:absolute;white-space:nowrap;width:100%;direction:ltr;}&::before{position:absolute;content:'';border-radius:inherit;width:100%;height:100%;box-shadow:0px 3px 1px -2px rgb(0 0 0 / 20%),0px 2px 2px 0px rgb(0 0 0 / 14%),0px 1px 5px 0px rgb(0 0 0 / 12%);}&::after{position:absolute;content:'';border-radius:50%;width:42px;height:42px;top:50%;left:50%;transform:translate(-50%,-50%);}\"], palette[PC.LinkActive]);\n});\nvar RotationSliderMark = /*#__PURE__*/styled.div.attrs({\n className: generateClassNames(baseClassName, 'mark')\n}).withConfig({\n componentId: \"sc-1xuruq0-5\"\n})([\"padding:4px;\"]);\nvar RotationSliderMarkText = /*#__PURE__*/styled.span.attrs({\n className: generateClassNames(baseClassName, 'mark-text')\n}).withConfig({\n componentId: \"sc-1xuruq0-6\"\n})(function (_ref4) {\n var palette = _ref4.theme.palette;\n return css([\"position:absolute;top:20px;font-size:14px;transform:translateX(-10%);color:\", \";\"], palette[PC.TextPrimary]);\n});\nvar Styled = applyDisplayNames({\n RotationSliderList: RotationSliderList,\n RotationSliderBigDot: RotationSliderBigDot,\n RotationSliderSmallDotWrapper: RotationSliderSmallDotWrapper,\n RotationSliderSmallDot: RotationSliderSmallDot,\n RotationSliderControl: RotationSliderControl,\n RotationSliderMark: RotationSliderMark,\n RotationSliderMarkText: RotationSliderMarkText\n});\nexport default Styled;","import _extends from \"@babel/runtime/helpers/extends\";\nimport _defineProperty from \"@babel/runtime/helpers/defineProperty\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/objectWithoutProperties\";\nvar _excluded = [\"min\", \"max\", \"angle\", \"onChange\", \"onMouseDown\", \"onMouseUp\", \"step\", \"labelTooltipOptions\", \"annotation\", \"hideMarkText\", \"showCurrentMarkText\", \"value\", \"railProps\", \"trackProps\", \"thumbProps\", \"labelTooltipProps\", \"markStyles\", \"markTextStyles\"];\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nimport React from 'react';\nimport PT from 'prop-types';\nimport { intrinsicComponent, objectValues } from '../../utils/functions';\nimport Slider from '../slider';\nimport { LabelTooltip } from '../slider/types';\nimport Styled from './rotation-slider.styles';\nvar RotationSlider = intrinsicComponent(function (_ref, ref) {\n var _ref$min = _ref.min,\n min = _ref$min === void 0 ? 0 : _ref$min,\n _ref$max = _ref.max,\n max = _ref$max === void 0 ? 100 : _ref$max,\n _ref$angle = _ref.angle,\n angle = _ref$angle === void 0 ? 10 : _ref$angle,\n onChange = _ref.onChange,\n onMouseDown = _ref.onMouseDown,\n onMouseUp = _ref.onMouseUp,\n _ref$step = _ref.step,\n step = _ref$step === void 0 ? 1 : _ref$step,\n _ref$labelTooltipOpti = _ref.labelTooltipOptions,\n labelTooltipOptions = _ref$labelTooltipOpti === void 0 ? LabelTooltip.Off : _ref$labelTooltipOpti,\n _ref$annotation = _ref.annotation,\n annotation = _ref$annotation === void 0 ? '°' : _ref$annotation,\n _ref$hideMarkText = _ref.hideMarkText,\n hideMarkText = _ref$hideMarkText === void 0 ? false : _ref$hideMarkText,\n _ref$showCurrentMarkT = _ref.showCurrentMarkText,\n showCurrentMarkText = _ref$showCurrentMarkT === void 0 ? false : _ref$showCurrentMarkT,\n value = _ref.value,\n _ref$railProps = _ref.railProps,\n railProps = _ref$railProps === void 0 ? {} : _ref$railProps,\n _ref$trackProps = _ref.trackProps,\n trackProps = _ref$trackProps === void 0 ? {} : _ref$trackProps,\n _ref$thumbProps = _ref.thumbProps,\n thumbProps = _ref$thumbProps === void 0 ? {} : _ref$thumbProps,\n _ref$labelTooltipProp = _ref.labelTooltipProps,\n labelTooltipProps = _ref$labelTooltipProp === void 0 ? {} : _ref$labelTooltipProp,\n _ref$markStyles = _ref.markStyles,\n markStyles = _ref$markStyles === void 0 ? {} : _ref$markStyles,\n _ref$markTextStyles = _ref.markTextStyles,\n markTextStyles = _ref$markTextStyles === void 0 ? {} : _ref$markTextStyles,\n rest = _objectWithoutProperties(_ref, _excluded);\n var handleChange = function handleChange(event, newValue) {\n if (onChange) {\n onChange(event, newValue);\n }\n };\n var getValue = function getValue() {\n if (value || value === 0) {\n if (value > max) {\n return max;\n }\n if (value < min) {\n return min;\n }\n return value;\n }\n return min;\n };\n var showMarkText = function showMarkText(index) {\n if (hideMarkText) return false;\n if (!showCurrentMarkText) return true;\n return getValue() === index;\n };\n var renderBar = function renderBar() {\n var barDom = [];\n var barDiv;\n for (var i = min; i <= max; i += step) {\n barDiv = [];\n if (i % angle === 0 || i === max) {\n barDiv = /*#__PURE__*/React.createElement(Styled.RotationSliderMark, {\n key: i,\n style: _objectSpread({}, markStyles)\n }, showMarkText(i) && /*#__PURE__*/React.createElement(Styled.RotationSliderMarkText, {\n style: _objectSpread({}, markTextStyles)\n }, i === min + 1 ? max : i, /*#__PURE__*/React.createElement(\"sup\", null, annotation)), /*#__PURE__*/React.createElement(Styled.RotationSliderBigDot, null));\n } else if (i % 10 === 0) {\n barDiv = /*#__PURE__*/React.createElement(Styled.RotationSliderSmallDotWrapper, {\n key: i\n }, /*#__PURE__*/React.createElement(Styled.RotationSliderSmallDot, null));\n }\n if (!Array.isArray(barDiv)) {\n barDom.push(barDiv);\n }\n }\n return barDom;\n };\n return /*#__PURE__*/React.createElement(Slider, _extends({\n min: min,\n max: max,\n step: step,\n value: getValue(),\n hideTrack: true,\n hideAnnotation: true,\n annotation: annotation,\n onChange: handleChange,\n labelTooltip: labelTooltipOptions,\n ref: ref,\n components: {\n Rail: function Rail(props, style) {\n return /*#__PURE__*/React.createElement(Styled.RotationSliderList, _extends({}, props, {\n styles: _objectSpread({}, style)\n }), renderBar());\n },\n Thumb: Styled.RotationSliderControl\n },\n componentsProps: {\n rail: _objectSpread(_objectSpread({}, railProps), {}, {\n style: _objectSpread({}, railProps.style)\n }),\n track: _objectSpread(_objectSpread({}, trackProps), {}, {\n style: _objectSpread({}, trackProps.style)\n }),\n thumb: _objectSpread(_objectSpread({}, thumbProps), {}, {\n style: _objectSpread({\n top: '15%'\n }, thumbProps.style)\n }),\n labelTooltip: _objectSpread(_objectSpread({}, labelTooltipProps), {}, {\n style: _objectSpread({}, labelTooltipProps.style)\n })\n }\n }, rest, {\n defaultValue: Number(rest.defaultValue),\n style: _objectSpread({\n width: 'auto',\n height: 'auto'\n }, rest.style)\n }));\n});\nRotationSlider.defaultProps = {\n annotation: '°',\n min: 0,\n max: 100,\n step: 1,\n labelTooltipOptions: LabelTooltip.Off\n};\nRotationSlider.propTypes = {\n value: PT.oneOfType([PT.array, PT.number]),\n min: PT.number,\n max: PT.number,\n angle: PT.number,\n onChange: PT.func,\n onMouseDown: PT.func,\n onMouseUp: PT.func,\n step: PT.number,\n annotation: PT.string,\n hideMarkText: PT.bool,\n showCurrentMarkText: PT.bool,\n railProps: PT.object,\n trackProps: PT.object,\n thumbProps: PT.object,\n labelTooltipProps: PT.object,\n markStyles: PT.object,\n markTextStyles: PT.object,\n labelTooltipOptions: PT.oneOf(objectValues(LabelTooltip))\n};\nexport default RotationSlider;","import styled from 'styled-components';\nimport { generateClassNames, applyDisplayNames } from '../../utils/functions';\n// import type { With } from '../../utils/types';\n// import type { WithTheme } from '../../theme/entity';\n// import { Color as PColor } from '../../utils/types/palette';\n// import type { SelectGroupProps } from './select-group.props';\nimport StyledInputGroup from '../input-group/input-group.styles';\nvar baseClassName = 'SelectGroup';\nvar SelectGroup = /*#__PURE__*/styled(StyledInputGroup.InputGroup).attrs({\n className: generateClassNames(baseClassName, 'root')\n}).withConfig({\n componentId: \"sc-1uvutwe-0\"\n})([\"\"]);\nvar Styled = applyDisplayNames({\n SelectGroup: SelectGroup\n});\nexport default Styled;","import _defineProperty from \"@babel/runtime/helpers/defineProperty\";\nimport _extends from \"@babel/runtime/helpers/extends\";\nimport _typeof from \"@babel/runtime/helpers/typeof\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/objectWithoutProperties\";\nvar _excluded = [\"children\", \"size\", \"error\", \"label\", \"placeholder\", \"hint\", \"LabelProps\", \"SelectProps\", \"selectProps\", \"scroll\", \"fullWidth\", \"showSelectionKey\", \"value\", \"multiple\", \"hideMenuItemsActions\", \"onChange\", \"readOnly\", \"disabled\", \"showClearIcon\"];\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nimport React from 'react';\nimport PT from 'prop-types';\nimport { InputSize } from '../../utils/types';\nimport { intrinsicComponent, objectValues } from '../../utils/functions';\nimport Label from '../label';\nimport { propTypes as labelPropTypes } from '../label/label.component';\nimport Select from '../select';\nimport { propTypes as selectPropTypes } from '../select/select.component';\nimport FormHint from '../form-hint';\nimport Styled from './select-group.styles';\nvar SelectGroup = intrinsicComponent(function (_ref, ref) {\n var children = _ref.children,\n size = _ref.size,\n error = _ref.error,\n label = _ref.label,\n placeholder = _ref.placeholder,\n hint = _ref.hint,\n LabelPropsData = _ref.LabelProps,\n SelectPropsData = _ref.SelectProps,\n selectProps = _ref.selectProps,\n _ref$scroll = _ref.scroll,\n scroll = _ref$scroll === void 0 ? true : _ref$scroll,\n fullWidth = _ref.fullWidth,\n showSelectionKey = _ref.showSelectionKey,\n value = _ref.value,\n multiple = _ref.multiple,\n hideMenuItemsActions = _ref.hideMenuItemsActions,\n onChange = _ref.onChange,\n readOnly = _ref.readOnly,\n disabled = _ref.disabled,\n showClearIcon = _ref.showClearIcon,\n rest = _objectWithoutProperties(_ref, _excluded);\n var renderLabel = function renderLabel() {\n if (label) {\n if (typeof label === 'function') {\n return label({\n error: error\n });\n }\n if (_typeof(label) === 'object') {\n return label;\n }\n return /*#__PURE__*/React.createElement(Label, _extends({\n error: error\n }, LabelPropsData || {}), label);\n }\n return null;\n };\n var renderHint = function renderHint() {\n if (hint) {\n if (typeof hint === 'function') {\n return hint({\n error: error\n });\n }\n if (_typeof(hint) === 'object') {\n return hint;\n }\n return /*#__PURE__*/React.createElement(FormHint, {\n error: error\n }, hint);\n }\n return null;\n };\n return /*#__PURE__*/React.createElement(Styled.SelectGroup, _extends({}, rest, {\n ref: ref\n }), renderLabel(), /*#__PURE__*/React.createElement(Select, _extends({\n error: error,\n value: value,\n size: size,\n scroll: scroll,\n onChange: onChange,\n multiple: multiple,\n fullWidth: Boolean(fullWidth)\n }, SelectPropsData || {}, {\n selectProps: selectProps,\n readOnly: readOnly,\n disabled: disabled,\n placeholder: placeholder,\n showSelectionKey: showSelectionKey,\n hideMenuItemsActions: hideMenuItemsActions,\n showClearIcon: showClearIcon\n }), children), renderHint());\n});\nSelectGroup.defaultProps = {\n error: false,\n fullWidth: false,\n readOnly: false,\n disabled: false,\n scroll: true,\n hideMenuItemsActions: false\n};\nvar size = selectPropTypes.size,\n restSelectPropTypes = _objectWithoutProperties(selectPropTypes, [\"size\"]);\nSelectGroup.propTypes = _objectSpread(_objectSpread({}, restSelectPropTypes), {}, {\n // Extends from SelectProps: multiple, error, children, value, onChange\n fullWidth: PT.bool,\n size: PT.oneOf(objectValues(InputSize)),\n label: PT.node,\n hint: PT.node,\n LabelProps: PT.exact(labelPropTypes),\n SelectProps: PT.exact(selectPropTypes),\n selectProps: PT.object,\n readOnly: PT.bool,\n scroll: PT.bool,\n showSelectionKey: PT.bool,\n disabled: PT.bool\n});\nexport default SelectGroup;","import styled, { css } from 'styled-components';\nimport { generateClassNames, applyDisplayNames } from '../../utils/functions';\nimport { Color as PColor } from '../../utils/types/palette';\nvar baseClassName = 'Backdrop';\nvar Backdrop = /*#__PURE__*/styled.div.attrs({\n className: generateClassNames(baseClassName, 'root')\n}).withConfig({\n componentId: \"sc-txa5a-0\"\n})(function (_ref) {\n var palette = _ref.theme.palette;\n return css([\"position:fixed;display:flex;align-items:center;justify-content:center;inset:0px;background-color:\", \";transition:opacity 251ms cubic-bezier(0.4,0,0.2,1) 0ms;opacity:1;z-index:-1;\"], palette[PColor.Extra_0_3_Overlay]);\n});\nvar Styled = applyDisplayNames({\n Backdrop: Backdrop\n});\nexport default Styled;","import _objectDestructuringEmpty from \"@babel/runtime/helpers/objectDestructuringEmpty\";\nimport _extends from \"@babel/runtime/helpers/extends\";\nimport React from 'react';\nimport { intrinsicComponent } from '../../utils/functions';\nimport Styled from './backdrop.styles';\nvar Backdrop = intrinsicComponent(function (_ref, ref) {\n var rest = _extends({}, (_objectDestructuringEmpty(_ref), _ref));\n return /*#__PURE__*/React.createElement(Styled.Backdrop, _extends({}, rest, {\n ref: ref\n }));\n});\nBackdrop.defaultProps = {};\nBackdrop.propTypes = {};\nexport default Backdrop;","import styled, { css } from 'styled-components';\nimport { generateClassNames, applyDisplayNames, scrollBar } from '../../utils/functions';\nimport { Color as PColor } from '../../utils/types/palette';\nimport { Shadows as PShadows } from '../../utils/types/shadows';\nimport { FontVariant as FV } from '../../utils/types/typography/font-variant';\nimport Accordion from '../accordion/accordion.component';\nimport AccordionHeaderStyled from '../accordion-header/accordion-header.styles';\nimport AccordionDetailsStyled from '../accordion-details/accordion-details.styles';\nvar baseClassName = 'Drawer';\nvar TemporaryDrawer = /*#__PURE__*/styled.div.attrs({\n className: generateClassNames(baseClassName, 'temporary')\n}).withConfig({\n componentId: \"sc-1riasfx-0\"\n})(function (_ref) {\n var open = _ref.open;\n return css([\"position:absolute;inset:0px;z-index:1200;visibility:\", \";\"], !open && 'hidden');\n});\nvar PersistentDrawer = /*#__PURE__*/styled.div.attrs({\n className: generateClassNames(baseClassName, 'persistent')\n}).withConfig({\n componentId: \"sc-1riasfx-1\"\n})([\"\"]);\nvar Drawer = /*#__PURE__*/styled.div.attrs({\n className: generateClassNames(baseClassName, 'root')\n}).withConfig({\n componentId: \"sc-1riasfx-2\"\n})(function (_ref2) {\n var open = _ref2.open,\n isCollapsed = _ref2.isCollapsed,\n _ref2$top = _ref2.top,\n top = _ref2$top === void 0 ? 0 : _ref2$top,\n _ref2$theme = _ref2.theme,\n palette = _ref2$theme.palette,\n shadows = _ref2$theme.shadows,\n breakpoints = _ref2$theme.breakpoints;\n return css([\"display:flex;flex-direction:column;flex:1 0 auto;background-color:\", \";box-shadow:\", \";overflow-y:overlay;overflow-x:hidden;transform:\", \";visibility:\", \";transition:200ms;height:calc(100% - \", \"px);\", \"{margin-top:0px;height:100%;}\", \" &{margin-top:0px;height:100%;}box-sizing:border-box;width:\", \";\", \"\"], palette[PColor.BackgroundStateless], shadows[PShadows.LeftPanelMd], open ? 'none' : 'translateX(-100%)', !open && 'hidden', top, breakpoints.down('md'), breakpoints.classes.sm, isCollapsed ? '68px' : '302px', scrollBar);\n});\nvar Header = /*#__PURE__*/styled.div.attrs({\n className: generateClassNames(baseClassName, 'header')\n}).withConfig({\n componentId: \"sc-1riasfx-3\"\n})(function (_ref3) {\n var isCollapsed = _ref3.isCollapsed;\n return css([\"display:\", \";justify-content:flex-start;align-items:center;position:relative;text-decoration:none;width:100%;box-sizing:border-box;text-align:left;margin-top:12px;transition:background-color 100ms ease-out;\"], isCollapsed ? 'none' : 'flex');\n});\nvar Body = /*#__PURE__*/styled.div.attrs({\n className: generateClassNames(baseClassName, 'body')\n}).withConfig({\n componentId: \"sc-1riasfx-4\"\n})([\"flex:1 1 auto;.SfxAccordionDetails-root{margin:0;}\"]);\nvar Footer = /*#__PURE__*/styled.div.attrs({\n className: generateClassNames(baseClassName, 'footer')\n}).withConfig({\n componentId: \"sc-1riasfx-5\"\n})(function (_ref4) {\n var isCollapsed = _ref4.isCollapsed;\n return css([\"display:flex;flex-direction:column;width:100%;padding:\", \";\"], isCollapsed ? '0px' : '0px 8px');\n});\nvar List = /*#__PURE__*/styled.ul.attrs({\n className: generateClassNames(baseClassName, 'list')\n}).withConfig({\n componentId: \"sc-1riasfx-6\"\n})(function () {\n return css([\"list-style:none;margin:12px 0;padding:0;position:relative;\"]);\n});\nvar Item = /*#__PURE__*/styled.li.attrs({\n className: generateClassNames(baseClassName, 'item')\n}).withConfig({\n componentId: \"sc-1riasfx-7\"\n})(function (_ref5) {\n var palette = _ref5.theme.palette,\n isCollapsed = _ref5.isCollapsed,\n selected = _ref5.selected;\n return css([\"display:\", \";justify-content:flex-start;align-items:center;position:relative;text-decoration:none;width:100%;box-sizing:border-box;text-align:left;padding:13px 16px;transition:background-color 100ms ease-out;margin-bottom:4px;cursor:pointer;&:hover{background-color:\", \";& > *{color:\", \";}}\", \"\"], isCollapsed ? 'none' : 'flex', palette[PColor.BackgroundActive], palette[PColor.AccentStateless], selected && css([\"background-color:\", \";& > *{color:\", \" !important;}\"], palette[PColor.BackgroundActive], palette[PColor.AccentStateless]));\n});\nvar ItemText = /*#__PURE__*/styled.div.attrs({\n className: generateClassNames(baseClassName, 'text')\n}).withConfig({\n componentId: \"sc-1riasfx-8\"\n})(function (_ref6) {\n var _ref6$theme = _ref6.theme,\n palette = _ref6$theme.palette,\n font = _ref6$theme.typography.font,\n fontKey = _ref6.font,\n isCollapsed = _ref6.isCollapsed;\n return css([\"flex:1 1 auto;color:\", \";\", \";transition:color 100ms ease-out;display:\", \";user-select:none;\"], palette[PColor.TextPrimary], font[fontKey || FV.LabelLarge], isCollapsed && 'none');\n});\nvar Icon = /*#__PURE__*/styled.div.attrs({\n className: generateClassNames(baseClassName, 'icon')\n}).withConfig({\n componentId: \"sc-1riasfx-9\"\n})(function (_ref7) {\n var palette = _ref7.theme.palette,\n isCollapsed = _ref7.isCollapsed;\n return css([\"display:flex;flex-shrink:0;color:\", \";margin-right:\", \";transition:color 100ms ease-out;\"], palette[PColor.IconsPrimary], isCollapsed ? '0px' : '12px');\n});\nvar ItemButton = /*#__PURE__*/styled.div.attrs({\n className: generateClassNames(baseClassName, 'item-button')\n}).withConfig({\n componentId: \"sc-1riasfx-10\"\n})(function (_ref8) {\n var palette = _ref8.theme.palette,\n isCollapsed = _ref8.isCollapsed,\n selected = _ref8.selected;\n return css([\"display:flex;justify-content:\", \";align-items:center;border-radius:4px;box-sizing:border-box;text-align:left;padding:\", \";width:\", \";margin-bottom:8px;margin:\", \";transition:background-color 150ms cubic-bezier(0.4,0,0.2,1) 0ms;cursor:pointer;&:hover{background-color:\", \";& > *{color:\", \";}}\", \"\"], isCollapsed ? 'center' : 'flex-start', isCollapsed ? '12px 0px' : '13px 16px', isCollapsed && '56px', isCollapsed && '8px auto', palette[PColor.BackgroundActive], palette[PColor.AccentStateless], selected && css([\"background-color:\", \";& > *{color:\", \";}\"], palette[PColor.BackgroundActive], palette[PColor.AccentStateless]));\n});\nvar CollapsedButton = /*#__PURE__*/styled(ItemButton).attrs({\n className: generateClassNames(baseClassName, 'item-button')\n}).withConfig({\n componentId: \"sc-1riasfx-11\"\n})(function (_ref9) {\n var isCollapsed = _ref9.isCollapsed;\n return css([\"\", \"\"], !isCollapsed && css([\"padding:13px 16px;\"]));\n});\nvar DrawerAccordion = /*#__PURE__*/styled(Accordion).attrs({\n className: generateClassNames(baseClassName, 'accordion')\n}).withConfig({\n componentId: \"sc-1riasfx-12\"\n})(function (_ref10) {\n var _ref10$theme = _ref10.theme,\n palette = _ref10$theme.palette,\n font = _ref10$theme.typography.font,\n selected = _ref10.selected;\n return css([\"\", \"{padding:13px 16px;transition:background-color 100ms ease-out;\", \"{\", \";color:\", \";}&:hover{background-color:\", \";& > *{color:\", \";}}\", \"}\", \"{padding:0px 16px;}\"], AccordionHeaderStyled.Header, AccordionHeaderStyled.Label, font[FV.LabelLargeEmphasis], palette[PColor.TextPrimary], palette[PColor.BackgroundActive], palette[PColor.AccentStateless], selected && css([\"\", \"{color:\", \";}\"], AccordionHeaderStyled.Label, palette[PColor.AccentStateless]), AccordionDetailsStyled.AccordionDetails);\n});\nvar Styled = applyDisplayNames({\n TemporaryDrawer: TemporaryDrawer,\n PersistentDrawer: PersistentDrawer,\n Drawer: Drawer,\n Header: Header,\n Body: Body,\n Footer: Footer,\n List: List,\n Item: Item,\n ItemButton: ItemButton,\n Icon: Icon,\n ItemText: ItemText,\n DrawerAccordion: DrawerAccordion,\n CollapsedButton: CollapsedButton\n});\nexport default Styled;","import { createContext } from 'react';\nvar DrawerContext = /*#__PURE__*/createContext({\n isCollapsed: false,\n size: 20\n});\nif (process.env.NODE_ENV !== 'production') {\n DrawerContext.displayName = 'DrawerContext';\n}\nexport default DrawerContext;","import _extends from \"@babel/runtime/helpers/extends\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/objectWithoutProperties\";\nvar _excluded = [\"children\", \"font\"];\nimport React, { useContext } from 'react';\nimport PT from 'prop-types';\nimport { intrinsicComponent, objectValues } from '../../utils/functions';\nimport { FontVariant } from '../../utils/types/typography/font-variant';\nimport Styled from './drawer.styles';\nimport DrawerContext from './drawer.context';\nvar DrawerItemText = intrinsicComponent(function (_ref, ref) {\n var children = _ref.children,\n font = _ref.font,\n rest = _objectWithoutProperties(_ref, _excluded);\n var _useContext = useContext(DrawerContext),\n isCollapsed = _useContext.isCollapsed;\n return /*#__PURE__*/React.createElement(Styled.ItemText, _extends({\n font: font,\n isCollapsed: isCollapsed\n }, rest, {\n ref: ref\n }), children);\n});\nDrawerItemText.defaultProps = {};\nDrawerItemText.propTypes = {\n font: PT.oneOf(objectValues(FontVariant))\n};\nexport default DrawerItemText;","import _extends from \"@babel/runtime/helpers/extends\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/objectWithoutProperties\";\nvar _excluded = [\"children\", \"size\"];\nimport React, { useContext } from 'react';\nimport PT from 'prop-types';\nimport { intrinsicComponent } from '../../utils/functions';\nimport Styled from './drawer.styles';\nimport DrawerContext from './drawer.context';\nvar DrawerItemIcon = intrinsicComponent(function (_ref, ref) {\n var children = _ref.children,\n iconSize = _ref.size,\n rest = _objectWithoutProperties(_ref, _excluded);\n var _useContext = useContext(DrawerContext),\n isCollapsed = _useContext.isCollapsed,\n size = _useContext.size;\n return /*#__PURE__*/React.createElement(Styled.Icon, _extends({}, rest, {\n isCollapsed: isCollapsed,\n ref: ref\n }), children && typeof children === 'function' ? children({\n size: size || iconSize\n }) : children);\n});\nDrawerItemIcon.defaultProps = {\n size: 20\n};\nDrawerItemIcon.propTypes = {\n size: PT.number,\n children: PT.oneOfType([PT.node, PT.func]).isRequired\n};\nexport default DrawerItemIcon;","export var Variant = {\n Auto: 'auto',\n Temporary: 'temporary',\n Persistent: 'persistent'\n};","import _defineProperty from \"@babel/runtime/helpers/defineProperty\";\nimport _extends from \"@babel/runtime/helpers/extends\";\nimport _slicedToArray from \"@babel/runtime/helpers/slicedToArray\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/objectWithoutProperties\";\nvar _excluded = [\"children\", \"open\", \"iconsSize\", \"collapsed\", \"top\", \"hideBackdrop\", \"disablePortal\", \"collapseButtonLabel\", \"persistentDrawerStyles\", \"temproryDrawerStyles\", \"variant\", \"onClose\", \"onCollapse\", \"onCollapseClick\"];\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nimport React, { useState, useEffect, useMemo, useRef } from 'react';\nimport { createPortal } from 'react-dom';\nimport PT from 'prop-types';\nimport ArrowSidebarLeftOutline from '@scaleflex/icons/arrow-sidebar-left-outline';\nimport ArrowSidebarRightOutline from '@scaleflex/icons/arrow-sidebar-right-outline';\nimport { intrinsicComponent, objectValues } from '../../utils/functions';\nimport { useMediaQuery, useTheme } from '../../theme/hooks';\nimport DrawerItemText from './drawer-item-text-component';\nimport DrawerItemIcon from './drawer-item-icon.component';\nimport DrawerContext from './drawer.context';\nimport Backdrop from '../backdrop';\nimport Styled from './drawer.styles';\nimport { Variant } from './types';\nvar Drawer = intrinsicComponent(function (_ref, ref) {\n var children = _ref.children,\n open = _ref.open,\n _ref$iconsSize = _ref.iconsSize,\n iconsSize = _ref$iconsSize === void 0 ? 20 : _ref$iconsSize,\n _ref$collapsed = _ref.collapsed,\n collapsed = _ref$collapsed === void 0 ? false : _ref$collapsed,\n top = _ref.top,\n hideBackdrop = _ref.hideBackdrop,\n disablePortal = _ref.disablePortal,\n _ref$collapseButtonLa = _ref.collapseButtonLabel,\n collapseButtonLabel = _ref$collapseButtonLa === void 0 ? 'Collapse menu' : _ref$collapseButtonLa,\n _ref$persistentDrawer = _ref.persistentDrawerStyles,\n persistentDrawerStyles = _ref$persistentDrawer === void 0 ? {} : _ref$persistentDrawer,\n _ref$temproryDrawerSt = _ref.temproryDrawerStyles,\n temproryDrawerStyles = _ref$temproryDrawerSt === void 0 ? {} : _ref$temproryDrawerSt,\n _ref$variant = _ref.variant,\n variant = _ref$variant === void 0 ? Variant.Auto : _ref$variant,\n onClose = _ref.onClose,\n onCollapse = _ref.onCollapse,\n onCollapseClick = _ref.onCollapseClick,\n rest = _objectWithoutProperties(_ref, _excluded);\n var theme = useTheme();\n var matchDownXl = useMediaQuery(theme.breakpoints.down('xl'));\n var _useState = useState(collapsed),\n _useState2 = _slicedToArray(_useState, 2),\n isCollapsed = _useState2[0],\n setIsCollapsed = _useState2[1];\n var temproryDrawerRef = useRef(null);\n var DrawerIconsSize = useMemo(function () {\n return iconsSize;\n }, [iconsSize]);\n var target = document.querySelector('body');\n useEffect(function () {\n setIsCollapsed(collapsed);\n }, [collapsed]);\n useEffect(function () {\n if (onCollapse) {\n onCollapse(isCollapsed);\n }\n }, [isCollapsed]);\n var handleCollapse = function handleCollapse() {\n var newCollpaseState = !isCollapsed;\n setIsCollapsed(newCollpaseState);\n if (onCollapseClick) {\n onCollapseClick(newCollpaseState);\n }\n };\n var handleClose = function handleClose() {\n if (typeof onClose === 'function') {\n onClose();\n }\n };\n var keyListener = function keyListener(ev) {\n var isTemporaryDrawer = false;\n if (temproryDrawerRef !== null && temproryDrawerRef !== void 0 && temproryDrawerRef.current) {\n var _temproryDrawerRef$cu;\n isTemporaryDrawer = (temproryDrawerRef === null || temproryDrawerRef === void 0 || (_temproryDrawerRef$cu = temproryDrawerRef.current) === null || _temproryDrawerRef$cu === void 0 ? void 0 : _temproryDrawerRef$cu.offsetWidth) > 0;\n }\n if (ev.key === 'Escape' && isTemporaryDrawer) {\n handleClose();\n }\n };\n useEffect(function () {\n document.addEventListener('keydown', keyListener);\n return function () {\n return document.removeEventListener('keydown', keyListener);\n };\n }, []);\n var renderDrawer = function renderDrawer(showCollapsedButton) {\n return /*#__PURE__*/React.createElement(Styled.Drawer, _extends({\n open: open,\n top: top\n }, rest, {\n isCollapsed: showCollapsedButton ? isCollapsed : false,\n ref: ref\n }), children, showCollapsedButton && /*#__PURE__*/React.createElement(Styled.CollapsedButton, {\n onClick: handleCollapse,\n isCollapsed: isCollapsed\n }, /*#__PURE__*/React.createElement(DrawerItemIcon, null, isCollapsed ? function (props) {\n return /*#__PURE__*/React.createElement(ArrowSidebarRightOutline, _extends({}, props, {\n size: iconsSize\n }));\n } : function (props) {\n return /*#__PURE__*/React.createElement(ArrowSidebarLeftOutline, _extends({}, props, {\n size: iconsSize\n }));\n }), /*#__PURE__*/React.createElement(DrawerItemText, null, collapseButtonLabel)));\n };\n var renderBackdrop = function renderBackdrop() {\n return !hideBackdrop && open ? /*#__PURE__*/React.createElement(Backdrop, {\n onClick: onClose\n }) : null;\n };\n var temporaryDrawer = function temporaryDrawer() {\n return disablePortal ? /*#__PURE__*/React.createElement(Styled.TemporaryDrawer, {\n ref: temproryDrawerRef,\n style: _objectSpread({}, temproryDrawerStyles),\n open: open\n }, renderBackdrop(), renderDrawer(false)) : ( /*#__PURE__*/createPortal( /*#__PURE__*/React.createElement(Styled.TemporaryDrawer, {\n ref: temproryDrawerRef,\n style: _objectSpread({}, temproryDrawerStyles),\n open: open\n }, renderBackdrop(), renderDrawer(false)), target));\n };\n var persistentDrawer = function persistentDrawer() {\n return /*#__PURE__*/React.createElement(Styled.PersistentDrawer, {\n style: _objectSpread({}, persistentDrawerStyles)\n }, renderDrawer(true));\n };\n var getDrawerVariant = function getDrawerVariant() {\n switch (variant) {\n case Variant.Auto:\n return matchDownXl ? temporaryDrawer() : persistentDrawer();\n case Variant.Temporary:\n return temporaryDrawer();\n case Variant.Persistent:\n return persistentDrawer();\n default:\n return matchDownXl ? temporaryDrawer() : persistentDrawer();\n }\n };\n return /*#__PURE__*/React.createElement(DrawerContext.Provider, {\n value: {\n isCollapsed: !matchDownXl ? isCollapsed : false,\n size: DrawerIconsSize\n }\n }, getDrawerVariant());\n});\nexport var defaultProps = {\n open: false,\n hideBackdrop: false,\n iconsSize: 20,\n variant: Variant.Auto\n};\nDrawer.defaultProps = defaultProps;\nexport var propTypes = {\n onClose: PT.func.isRequired,\n onCollapse: PT.func,\n onCollapseClick: PT.func,\n children: PT.node.isRequired,\n top: PT.number,\n iconsSize: PT.number,\n open: PT.bool,\n hideBackdrop: PT.bool,\n collapsed: PT.bool,\n disablePortal: PT.bool,\n collapseButtonLabel: PT.string,\n persistentDrawerStyles: PT.object,\n temproryDrawerStyles: PT.object,\n variant: PT.oneOf(objectValues(Variant))\n};\nDrawer.propTypes = propTypes;\nexport default Drawer;","import _extends from \"@babel/runtime/helpers/extends\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/objectWithoutProperties\";\nvar _excluded = [\"children\"];\nimport React, { useContext } from 'react';\nimport { intrinsicComponent } from '../../utils/functions';\nimport DrawerContext from './drawer.context';\nimport Styled from './drawer.styles';\nvar DrawerHeader = intrinsicComponent(function (_ref, ref) {\n var children = _ref.children,\n rest = _objectWithoutProperties(_ref, _excluded);\n var _useContext = useContext(DrawerContext),\n isCollapsed = _useContext.isCollapsed;\n return /*#__PURE__*/React.createElement(Styled.Header, _extends({}, rest, {\n isCollapsed: isCollapsed,\n ref: ref\n }), children);\n});\nDrawerHeader.defaultProps = {};\nDrawerHeader.propTypes = {};\nexport default DrawerHeader;","import _extends from \"@babel/runtime/helpers/extends\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/objectWithoutProperties\";\nvar _excluded = [\"children\"];\nimport React from 'react';\nimport { intrinsicComponent } from '../../utils/functions';\nimport Styled from './drawer.styles';\nvar DrawerBody = intrinsicComponent(function (_ref, ref) {\n var children = _ref.children,\n rest = _objectWithoutProperties(_ref, _excluded);\n return /*#__PURE__*/React.createElement(Styled.Body, _extends({}, rest, {\n ref: ref\n }), children);\n});\nDrawerBody.defaultProps = {};\nDrawerBody.propTypes = {};\nexport default DrawerBody;","import _extends from \"@babel/runtime/helpers/extends\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/objectWithoutProperties\";\nvar _excluded = [\"children\"];\nimport React from 'react';\nimport { intrinsicComponent } from '../../utils/functions';\nimport Styled from './drawer.styles';\nvar DrawerList = intrinsicComponent(function (_ref, ref) {\n var children = _ref.children,\n rest = _objectWithoutProperties(_ref, _excluded);\n return /*#__PURE__*/React.createElement(Styled.List, _extends({}, rest, {\n ref: ref\n }), children);\n});\nDrawerList.defaultProps = {};\nDrawerList.propTypes = {};\nexport default DrawerList;","import _extends from \"@babel/runtime/helpers/extends\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/objectWithoutProperties\";\nvar _excluded = [\"children\", \"selected\"];\nimport React, { useContext } from 'react';\nimport PT from 'prop-types';\nimport { intrinsicComponent } from '../../utils/functions';\nimport DrawerContext from './drawer.context';\nimport Styled from './drawer.styles';\nvar DrawerItem = intrinsicComponent(function (_ref, ref) {\n var children = _ref.children,\n selected = _ref.selected,\n rest = _objectWithoutProperties(_ref, _excluded);\n var _useContext = useContext(DrawerContext),\n isCollapsed = _useContext.isCollapsed;\n return /*#__PURE__*/React.createElement(Styled.Item, _extends({\n selected: selected,\n isCollapsed: isCollapsed\n }, rest, {\n ref: ref\n }), children);\n});\nDrawerItem.defaultProps = {\n selected: false\n};\nDrawerItem.propTypes = {\n selected: PT.bool\n};\nexport default DrawerItem;","import{Input,Label}from\"@scaleflex/ui/core\";import styled from\"styled-components\";import{FontVariant as FV}from\"@scaleflex/ui/utils/types/typography\";var StyledHSVOptions=styled.div.withConfig({componentId:\"sc-1rfxjvn-0\"})([\"display:flex;width:100%;justify-content:space-between;gap:10px;.SfxSlider-root{min-width:100px;}\",\"\"],function(a){var b=a.isPhoneScreen;return b&&\"\\n flex-direction: column;\\n\\n .SfxSlider-root {\\n min-width: 230px;\\n }\\n \"}),StyledSliderContainer=styled.div.withConfig({componentId:\"sc-1rfxjvn-1\"})([\"display:flex;flex-direction:column;\"]),StyledSliderLabel=styled(Label).withConfig({componentId:\"sc-1rfxjvn-2\"})([\"\",\";\"],function(a){var b=a.theme;return b.typography.font[FV.LabelExtraSmallUp]}),StyledSliderWrapper=styled.div.withConfig({componentId:\"sc-1rfxjvn-3\"})([\"display:flex;align-items:center;\"]),StyledSliderInput=styled(Input).withConfig({componentId:\"sc-1rfxjvn-4\"})([\"display:inline-block;width:40px;height:28px;padding:6px 2px;margin-left:10px;border:none;.SfxInput-Base{text-align:center;width:100%;min-width:100%;max-width:100%;}\"]);export{StyledHSVOptions,StyledSliderContainer,StyledSliderLabel,StyledSliderWrapper,StyledSliderInput};","import _slicedToArray from\"@babel/runtime/helpers/slicedToArray\";import React from\"react\";import Konva from\"konva\";import{useFinetune}from\"../../../hooks\";import restrictNumber from\"../../../utils/restrictNumber\";import Slider from\"../../common/Slider\";import{StyledSliderContainer,StyledSliderInput,StyledSliderLabel,StyledSliderWrapper}from\"../tools.styled\";var MIN_VALUE=-1,DEFAULT_VALUE={brightness:0},MAX_VALUE=1,sliderStyle={width:150,padding:0,margin:0},BrightnessOptions=function(a){var b,c,d=a.t,e=useFinetune(Konva.Filters.Brighten,DEFAULT_VALUE),f=_slicedToArray(e,2),g=f[0],h=f[1],i=function(a){h({brightness:restrictNumber(a,MIN_VALUE,MAX_VALUE)})};return React.createElement(StyledSliderContainer,{className:\"FIE_brightness-option-wrapper\"},React.createElement(StyledSliderLabel,{className:\"FIE_brightness-option-label\"},d(\"brightness\")),React.createElement(StyledSliderWrapper,null,React.createElement(Slider,{className:\"FIE_brightness-option\",min:MIN_VALUE,step:.05,max:MAX_VALUE,width:\"124px\",value:null!==(b=g.brightness)&&void 0!==b?b:DEFAULT_VALUE.brightness,onChange:i,style:sliderStyle}),React.createElement(StyledSliderInput,{value:null!==(c=g.brightness)&&void 0!==c?c:DEFAULT_VALUE.brightness,onChange:function onChange(a){var b=a.target.value;return i(b)}})))};export default BrightnessOptions;","import{DEFAULT_ZOOM_FACTOR}from\"./constants\";var getZoomFitFactor=function(a,b){return Math.min(a.width/b.width,a.height/b.height)||DEFAULT_ZOOM_FACTOR};export default getZoomFitFactor;","import Custom from\"@scaleflex/icons/custom\";import Ellipse from\"@scaleflex/icons/ellipse\";import Landscape from\"@scaleflex/icons/landscape\";import Portrait from\"@scaleflex/icons/portrait\";import ImageOutline from\"@scaleflex/icons/image-outline\";import{CUSTOM_CROP,ELLIPSE_CROP,ORIGINAL_CROP}from\"../../../utils/constants\";import toPrecisedFloat from\"../../../utils/toPrecisedFloat\";export var DEFAULT_CROP_PRESETS=[{titleKey:\"custom\",ratio:CUSTOM_CROP,icon:Custom,hide:function hide(){var a=0n.width||d.height>n.height?getZoomFitFactor(n,d):DEFAULT_ZOOM_FACTOR}})),c()};return React.createElement(React.Fragment,null,React.createElement(StyledToolsBarItemButtonWrapper,null,React.createElement(StyledToolsBarItemButtonLabel,{className:\"FIE_crop-tool-label FIE_selected-crop-preset-label\",isPhoneScreen:r},g(l||\"cropTool\")),React.createElement(StyledOpenMenuButton,{className:\"FIE_crop-presets-opener-button\",color:\"link-secondary\",size:\"lg\"},b?React.createElement(MoveUpOutline,{size:10}):React.createElement(MoveDownOutline,{size:10}))),React.createElement(Menu,{className:\"FIE_crop-presets-menu\",anchorEl:b,enableOverlay:!0,onClose:c,open:!!b,position:\"top\",popperOptions:{modifiers:[{name:\"offset\",options:{offset:[0,4]}}]},maxHeight:\"100%\"},React.createElement(StyledMenu,null,s.map(function renderPreset(a){var b=a.titleKey,c=a.descriptionKey,d=a.ratio,e=a.width,f=a.height,h=a.groups,i=a.icon,j=a.disableManualResize,l=a.noEffect;return h?React.createElement(CropPresetGroupsList,{key:b,titleKey:b,groups:h,Icon:i,theme:p,onItemSelect:t,t:g,disableManualResize:j}):React.createElement(CropPresetItem,{key:d,ratio:null!==d&&void 0!==d?d:toPrecisedFloat(e/f),titleKey:b,t:g,description:g(c),Icon:i,isActive:(k||ORIGINAL_CROP)===(null!==d&&void 0!==d?d:toPrecisedFloat(e/f))&&!m,theme:p,width:e,height:f,onClick:t,disableManualResize:j,noEffect:l})}))))};CropPresetsOption.defaultProps={anchorEl:null};export default CropPresetsOption;","import _slicedToArray from\"@babel/runtime/helpers/slicedToArray\";import React,{useState}from\"react\";import{Crop as CropIcon}from\"@scaleflex/icons/crop\";import{useStore}from\"../../../hooks\";import ToolsBarItemButton from\"../../ToolsBar/ToolsBarItemButton\";import{TOOLS_IDS}from\"../../../utils/constants\";import{StyledToolsBarItemButtonLabel}from\"../../ToolsBar/ToolsBar.styled\";import CropPresetsOption from\"./CropPresetsOption\";var Crop=function(a){var b=a.selectTool,c=a.isSelected,d=useStore(),e=d.config,f=d.t,g=useState(),h=_slicedToArray(g,2),i=h[0],j=h[1];return React.createElement(ToolsBarItemButton,{className:\"FIE_crop-tool\",id:TOOLS_IDS.CROP,Icon:CropIcon,onClick:function selectToolAndShowPresets(a,c){b(a),j(c.currentTarget)},isSelected:c},e[TOOLS_IDS.CROP].noPresets?React.createElement(StyledToolsBarItemButtonLabel,{className:\"FIE_crop-tool-label\"},f(\"cropTool\")):React.createElement(CropPresetsOption,{anchorEl:i,onClose:function closeCropPresets(){j(null)}}))};Crop.defaultProps={isSelected:!1};export default Crop;","import React,{useCallback,useMemo}from\"react\";import{FlipX as FlipXIcon}from\"@scaleflex/icons/flip-x\";import ToolsBarItemButton from\"../../ToolsBar/ToolsBarItemButton\";import{FLIP_DIRECTIONS,TOOLS_IDS}from\"../../../utils/constants\";import{TOGGLE_FLIP}from\"../../../actions\";import{usePhoneScreen,useStore}from\"../../../hooks\";var xFlipReverseSideStyle={transform:\"scaleX(-1)\"},FlipX=function(a){var b=a.selectTool,c=a.isSelected,d=a.t,e=useStore(),f=e.dispatch,g=e.adjustments.isFlippedX,h=usePhoneScreen(320),i=useMemo(function(){return{reverseLabelOfCurrXFlipDir:g?d(\"unFlipX\"):d(\"flipX\"),reverseIconOfCurrXFlipDir:function(){return React.createElement(FlipXIcon,{size:h?20:16,style:g?xFlipReverseSideStyle:void 0})}}},[g]),j=i.reverseLabelOfCurrXFlipDir,k=i.reverseIconOfCurrXFlipDir,l=useCallback(function(){f({type:TOGGLE_FLIP,payload:{direction:FLIP_DIRECTIONS.X}})},[]),m=useCallback(function(a){b(a),l()},[]);return React.createElement(ToolsBarItemButton,{className:\"FIE_flip-x-tool-button\",id:TOOLS_IDS.FLIP_X,label:j,Icon:k,onClick:m,isSelected:c})};FlipX.defaultProps={isSelected:!1};export default FlipX;","import React,{useCallback,useMemo}from\"react\";import{FlipY as FlipYIcon}from\"@scaleflex/icons/flip-y\";import ToolsBarItemButton from\"../../ToolsBar/ToolsBarItemButton\";import{FLIP_DIRECTIONS,TOOLS_IDS}from\"../../../utils/constants\";import{TOGGLE_FLIP}from\"../../../actions\";import{usePhoneScreen,useStore}from\"../../../hooks\";var xFlipReverseSideStyle={transform:\"scaleY(-1)\"},FlipY=function(a){var b=a.selectTool,c=a.isSelected,d=a.t,e=useStore(),f=e.dispatch,g=e.adjustments.isFlippedY,h=usePhoneScreen(320),i=useMemo(function(){return{reverseLabelOfCurrXFlipDir:g?d(\"unFlipY\"):d(\"flipY\"),reverseIconOfCurrXFlipDir:function(){return React.createElement(FlipYIcon,{size:h?20:16,style:g?xFlipReverseSideStyle:void 0})}}},[g]),j=i.reverseLabelOfCurrXFlipDir,k=i.reverseIconOfCurrXFlipDir,l=useCallback(function(){f({type:TOGGLE_FLIP,payload:{direction:FLIP_DIRECTIONS.Y}})},[]),m=useCallback(function(a){b(a),l()},[]);return React.createElement(ToolsBarItemButton,{className:\"FIE_flip-y-tool-button\",id:TOOLS_IDS.FLIP_Y,label:j,Icon:k,onClick:m,isSelected:c})};FlipY.defaultProps={isSelected:!1};export default FlipY;","import React from\"react\";import{RotationLeft as RotateIcon}from\"@scaleflex/icons/rotation-left\";import ToolsBarItemButton from\"../../ToolsBar/ToolsBarItemButton\";import{TOOLS_IDS}from\"../../../utils/constants\";var RotateButton=function(a){var b=a.selectTool,c=a.isSelected,d=a.t;return React.createElement(ToolsBarItemButton,{className:\"FIE_rotate-tool-button\",id:TOOLS_IDS.ROTATE,label:d(\"rotateTool\"),Icon:RotateIcon,onClick:b,isSelected:c})};RotateButton.defaultProps={isSelected:!1};export default RotateButton;","import styled from\"styled-components\";import{IconButton,RotationSlider}from\"@scaleflex/ui/core\";import{Color as PC}from\"@scaleflex/ui/utils/types/palette\";var StyledRotationOptions=styled.div.withConfig({componentId:\"sc-wbx58r-0\"})([\"display:flex;align-items:center;gap:16px;\"]),StyledRotationSlider=styled(RotationSlider).withConfig({componentId:\"sc-wbx58r-1\"})([\".SfxRotationSlider-control{width:1px;height:10px;background-color:\",\";&:before{box-shadow:unset;}}.SfxRotationSlider-mark,.SfxRotationSlider-small-dot-wrapper{padding:0;.SfxRotationSlider-mark-text{top:10px;}.SfxRotationSlider-big-dot{width:4px;height:4px;}.SfxRotationSlider-small-dot{width:1px;height:1px;}}.SfxRotationSlider-list{gap:4px;}\"],function(a){var b=a.theme.palette;return b[PC.IconsSecondary]}),StyledRotateButton=styled(IconButton).withConfig({componentId:\"sc-wbx58r-2\"})([\"\"]);export{StyledRotationOptions,StyledRotationSlider,StyledRotateButton};","import React from\"react\";import RotationLeft from\"@scaleflex/icons/rotation-left\";import RotationRight from\"@scaleflex/icons/rotation-right\";import{Rotate90}from\"@scaleflex/icons\";import{useDebouncedCallback,usePhoneScreen,useStore}from\"../../../hooks\";import{CHANGE_ROTATION,SET_RESIZE}from\"../../../actions\";import restrictNumber from\"../../../utils/restrictNumber\";import getSizeAfterRotation from\"../../../utils/getSizeAfterRotation\";import{TOOLS_IDS}from\"../../../utils/constants\";import ToolsBarItemButton from\"../../ToolsBar/ToolsBarItemButton\";import{StyledRotationOptions,StyledRotationSlider,StyledRotateButton}from\"./Rotate.styled\";var RotateOptions=function(){var a=useStore(),b=a.dispatch,c=a.adjustments.rotation,d=void 0===c?0:c,e=a.resize,f=void 0===e?{}:e,g=a.config,h=g[TOOLS_IDS.ROTATE],i=usePhoneScreen(),j=useDebouncedCallback(function(a,c){var d=restrictNumber(c,-180,180);if(b({type:CHANGE_ROTATION,payload:{rotation:d}}),f.width&&f.height){var e=getSizeAfterRotation(f.width,f.height,d);b({type:SET_RESIZE,payload:{width:e.width,height:e.height}})}},20);return\"buttons\"===h.componentType?React.createElement(React.Fragment,null,React.createElement(ToolsBarItemButton,{className:\"FIE_rotate_button_left\",id:TOOLS_IDS.IMAGE,label:\"-\".concat(h.angle,\"\\xB0\"),Icon:RotationLeft,onClick:function changeRotationButtonNegative(a){var b=d-h.angle;j(a,b)}}),React.createElement(ToolsBarItemButton,{className:\"FIE_rotate_button_right\",id:TOOLS_IDS.IMAGE,label:\"+\".concat(h.angle,\"\\xB0\"),Icon:RotationRight,onClick:function changeRotationButtonPositive(a){var b=d+h.angle;j(a,b)}})):React.createElement(StyledRotationOptions,null,React.createElement(StyledRotationSlider,{className:\"FIE_rotate-slider\",showCurrentMarkText:!0,min:-180,max:180,step:i?h.angle/3:1,value:d,angle:h.angle||90,onChange:j}),React.createElement(StyledRotateButton,{size:\"sm\",color:\"basic\",onClick:function onClick(a){return j(a,d+90)}},React.createElement(Rotate90,{width:15})))};export default RotateOptions;","import React from\"react\";import{Contrast as ContrastIcon}from\"@scaleflex/icons/contrast\";import ToolsBarItemButton from\"../../ToolsBar/ToolsBarItemButton\";import{TOOLS_IDS}from\"../../../utils/constants\";var Contrast=function(a){var b=a.selectTool,c=a.isSelected,d=a.t;return React.createElement(ToolsBarItemButton,{className:\"FIE_contrast-tool-button\",id:TOOLS_IDS.CONTRAST,label:d(\"contrastTool\"),Icon:ContrastIcon,onClick:b,isSelected:c})};Contrast.defaultProps={isSelected:!1};export default Contrast;","import _slicedToArray from\"@babel/runtime/helpers/slicedToArray\";import React from\"react\";import Konva from\"konva\";import{useFinetune}from\"../../../hooks\";import restrictNumber from\"../../../utils/restrictNumber\";import Slider from\"../../common/Slider\";import{StyledSliderContainer,StyledSliderInput,StyledSliderLabel,StyledSliderWrapper}from\"../tools.styled\";var MIN_VALUE=-100,DEFAULT_VALUE={contrast:0},MAX_VALUE=100,sliderStyle={width:150,padding:0,margin:0},ContrastOptions=function(a){var b,c,d=a.t,e=useFinetune(Konva.Filters.Contrast,DEFAULT_VALUE),f=_slicedToArray(e,2),g=f[0],h=f[1],i=function(a){h({contrast:restrictNumber(a,MIN_VALUE,MAX_VALUE)})};return React.createElement(StyledSliderContainer,{className:\"FIE_contrast-option-wrapper\"},React.createElement(StyledSliderLabel,{className:\"FIE_contrast-option-label\"},d(\"contrastTool\")),React.createElement(StyledSliderWrapper,null,React.createElement(Slider,{className:\"FIE_contrast-option\",min:MIN_VALUE,max:MAX_VALUE,width:\"124px\",value:null!==(b=g.contrast)&&void 0!==b?b:DEFAULT_VALUE.contrast,onChange:i,style:sliderStyle}),React.createElement(StyledSliderInput,{value:null!==(c=g.contrast)&&void 0!==c?c:DEFAULT_VALUE.contrast,onChange:function onChange(a){var b=a.target.value;return i(b)}})))};export default ContrastOptions;","import React from\"react\";import{Saturation as SaturationIcon}from\"@scaleflex/icons/saturation\";import ToolsBarItemButton from\"../../ToolsBar/ToolsBarItemButton\";import{TOOLS_IDS}from\"../../../utils/constants\";var HSV=function(a){var b=a.selectTool,c=a.isSelected,d=a.t;return React.createElement(ToolsBarItemButton,{className:\"FIE_hsv-tool-button\",id:TOOLS_IDS.HSV,label:d(\"hsvTool\"),Icon:SaturationIcon,onClick:b,isSelected:c})};HSV.defaultProps={isSelected:!1};export default HSV;","import _defineProperty from\"@babel/runtime/helpers/defineProperty\";import _slicedToArray from\"@babel/runtime/helpers/slicedToArray\";import React from\"react\";import Konva from\"konva\";import{useFinetune,usePhoneScreen}from\"../../../hooks\";import Slider from\"../../common/Slider\";import{StyledHSVOptions,StyledSliderContainer,StyledSliderLabel,StyledSliderInput,StyledSliderWrapper}from\"../tools.styled\";var DEFAULT_VALUE={hue:0,saturation:0,value:0},MAX_VALUE={hue:259,saturation:10,value:2},sliderStyle={padding:0,margin:0},isPhoneScreen=usePhoneScreen(),HSVOptions=function(a){var b,c,d,e,f,g,h=a.t,i=useFinetune(Konva.Filters.HSV,DEFAULT_VALUE),j=_slicedToArray(i,2),k=j[0],l=j[1],m=function(a,b){l(_defineProperty({},a,b>MAX_VALUE[a]?MAX_VALUE[a]:+b))};return React.createElement(StyledHSVOptions,{isPhoneScreen:isPhoneScreen},React.createElement(StyledSliderContainer,{className:\"FIE_hue-option-wrapper\"},React.createElement(StyledSliderLabel,{className:\"FIE_hue-option-label\"},h(\"hue\")),React.createElement(StyledSliderWrapper,null,React.createElement(Slider,{className:\"FIE_hue-option\",min:0,step:1,max:259,value:null!==(b=k.hue)&&void 0!==b?b:DEFAULT_VALUE.hue,onChange:function onChange(a){return m(\"hue\",a)},style:sliderStyle}),React.createElement(StyledSliderInput,{value:null!==(c=k.hue)&&void 0!==c?c:DEFAULT_VALUE.hue,onChange:function onChange(a){var b=a.target.value;return m(\"hue\",b)}}))),React.createElement(StyledSliderContainer,{className:\"FIE_saturation-option-wrapper\"},React.createElement(StyledSliderLabel,{className:\"FIE_saturation-option-label\"},h(\"saturation\")),React.createElement(StyledSliderWrapper,null,React.createElement(Slider,{className:\"FIE_saturation-option\",min:-2,step:.5,max:10,value:null!==(d=k.saturation)&&void 0!==d?d:DEFAULT_VALUE.saturation,onChange:function onChange(a){return m(\"saturation\",a)},style:sliderStyle}),React.createElement(StyledSliderInput,{value:null!==(e=k.saturation)&&void 0!==e?e:DEFAULT_VALUE.saturation,onChange:function onChange(a){var b=a.target.value;return m(\"saturation\",b)}}))),React.createElement(StyledSliderContainer,{className:\"FIE_value-option-wrapper\"},React.createElement(StyledSliderLabel,{className:\"FIE_value-option-label\"},h(\"value\")),React.createElement(StyledSliderWrapper,null,React.createElement(Slider,{className:\"FIE_value-option\",min:-2,step:.1,max:2,value:null!==(f=k.value)&&void 0!==f?f:DEFAULT_VALUE.value,onChange:function onChange(a){return m(\"value\",a)},style:sliderStyle}),React.createElement(StyledSliderInput,{value:null!==(g=k.value)&&void 0!==g?g:DEFAULT_VALUE.value,onChange:function onChange(a){var b=a.target.value;return m(\"value\",b)}}))))};export default HSVOptions;","import React from\"react\";import{Blur as BlurIcon}from\"@scaleflex/icons/blur\";import ToolsBarItemButton from\"../../ToolsBar/ToolsBarItemButton\";import{TOOLS_IDS}from\"../../../utils/constants\";var Blur=function(a){var b=a.selectTool,c=a.isSelected,d=a.t;return React.createElement(ToolsBarItemButton,{className:\"FIE_blur-tool-button\",id:TOOLS_IDS.BLUR,label:d(\"blurTool\"),Icon:BlurIcon,onClick:b,isSelected:c})};Blur.defaultProps={isSelected:!1};export default Blur;","import _slicedToArray from\"@babel/runtime/helpers/slicedToArray\";import React from\"react\";import Konva from\"konva\";import{useFinetune}from\"../../../hooks\";import restrictNumber from\"../../../utils/restrictNumber\";import Slider from\"../../common/Slider\";import{StyledSliderContainer,StyledSliderInput,StyledSliderLabel,StyledSliderWrapper}from\"../tools.styled\";var MIN_VALUE=0,DEFAULT_VALUE={blurRadius:0},MAX_VALUE=100,sliderStyle={width:150,padding:0,margin:0},BlurOptions=function(a){var b,c,d=a.t,e=useFinetune(Konva.Filters.Blur,DEFAULT_VALUE),f=_slicedToArray(e,2),g=f[0],h=f[1],i=function(a){h({blurRadius:restrictNumber(a,MIN_VALUE,MAX_VALUE)})};return React.createElement(StyledSliderContainer,{className:\"FIE_blur-option-wrapper\"},React.createElement(StyledSliderLabel,{className:\"FIE_blur-option-label\"},d(\"blur\")),React.createElement(StyledSliderWrapper,null,React.createElement(Slider,{className:\"FIE_blur-option\",min:MIN_VALUE,max:MAX_VALUE,width:\"124px\",value:null!==(b=g.blurRadius)&&void 0!==b?b:DEFAULT_VALUE.blurRadius,onChange:i,style:sliderStyle}),React.createElement(StyledSliderInput,{value:null!==(c=g.blurRadius)&&void 0!==c?c:DEFAULT_VALUE.blurRadius,onChange:function onChange(a){var b=a.target.value;return i(b)}})))};export default BlurOptions;","import React from\"react\";import{Temprature as WarmthIcon}from\"@scaleflex/icons/tempreture\";import ToolsBarItemButton from\"../../ToolsBar/ToolsBarItemButton\";import{TOOLS_IDS}from\"../../../utils/constants\";var Warmth=function(a){var b=a.selectTool,c=a.isSelected,d=a.t;return React.createElement(ToolsBarItemButton,{className:\"FIE_warmth-tool-button\",id:TOOLS_IDS.WARMTH,label:d(\"warmthTool\"),Icon:WarmthIcon,onClick:b,isSelected:c})};Warmth.defaultProps={isSelected:!1};export default Warmth;","import _slicedToArray from\"@babel/runtime/helpers/slicedToArray\";import React from\"react\";import{useFinetune}from\"../../../hooks\";import restrictNumber from\"../../../utils/restrictNumber\";import{Warmth as CustomWarmth}from\"../../../custom/finetunes\";import Slider from\"../../common/Slider\";import{StyledSliderContainer,StyledSliderInput,StyledSliderLabel,StyledSliderWrapper}from\"../tools.styled\";var MIN_VALUE=0,DEFAULT_VALUE={warmth:0},MAX_VALUE=200,sliderStyle={width:150,padding:0,margin:0},WarmthOptions=function(a){var b,c,d=a.t,e=useFinetune(CustomWarmth,DEFAULT_VALUE),f=_slicedToArray(e,2),g=f[0],h=f[1],i=function(a){h({warmth:restrictNumber(a,MIN_VALUE,MAX_VALUE)})};return React.createElement(StyledSliderContainer,{className:\"FIE_warmth-option-wrapper\"},React.createElement(StyledSliderLabel,{className:\"FIE_warmth-option-label\"},d(\"warmthTool\")),React.createElement(StyledSliderWrapper,null,React.createElement(Slider,{className:\"FIE_warmth-option\",min:MIN_VALUE,max:MAX_VALUE,width:\"124px\",value:null!==(b=g.warmth)&&void 0!==b?b:DEFAULT_VALUE.warmth,onChange:i,style:sliderStyle}),React.createElement(StyledSliderInput,{value:null!==(c=g.warmth)&&void 0!==c?c:DEFAULT_VALUE.warmth,onChange:function onChange(a){var b=a.target.value;return i(b)}})))};export default WarmthOptions;","import styled,{css}from\"styled-components\";import{Color as PC}from\"@scaleflex/ui/utils/types/palette\";var StyledCarouselWrapper=styled.div.withConfig({componentId:\"sc-1nr0bka-0\"})([\"max-width:680px;min-width:150px;position:relative;overflow:hidden;touch-action:pan-y pinch-zoom;\"]),StyledCarousel=styled.ul.withConfig({componentId:\"sc-1nr0bka-1\"})([\"padding:0;margin:0;white-space:nowrap;overflow:hidden;\"]),StyledCarouselItem=styled.li.withConfig({componentId:\"sc-1nr0bka-2\"})([\"padding:4px;display:inline-block;list-style-type:none;user-select:none;\"]),arrowsCommonStyles=css([\"position:absolute;top:0;height:100%;width:60px;cursor:pointer;display:flex;align-items:center;justify-content:center;z-index:1;svg{color:\",\";}\"],function(a){var b=a.theme.palette;return b[PC.IconsSecondary]}),StyledPrevArrowWrapper=styled.div.withConfig({componentId:\"sc-1nr0bka-3\"})([\"\",\" left:0;justify-content:flex-start;background:linear-gradient( 90deg,#ffffff 1.56%,rgba(255,255,255,0.89) 52.4%,rgba(255,255,255,0.532165) 76.04%,rgba(255,255,255,0) 100% );\"],arrowsCommonStyles),StyledNextArrowWrapper=styled.div.withConfig({componentId:\"sc-1nr0bka-4\"})([\"\",\" right:0;justify-content:flex-end;background:linear-gradient( 270deg,#ffffff 1.56%,rgba(255,255,255,0.89) 52.4%,rgba(255,255,255,0.532165) 76.04%,rgba(255,255,255,0) 100% );\"],arrowsCommonStyles);export{StyledCarouselWrapper,StyledCarousel,StyledCarouselItem,StyledPrevArrowWrapper,StyledNextArrowWrapper};","import _slicedToArray from\"@babel/runtime/helpers/slicedToArray\";import React,{Children,useRef,useState,useEffect}from\"react\";import{ArrowLeftOutline,ArrowRightOutline}from\"@scaleflex/icons\";import{useResizeObserver}from\"../../../hooks\";import debounce from\"../../../utils/debounce\";import getScrollOffset from\"../../../utils/getScrollOffset\";import{StyledCarouselWrapper,StyledCarousel,StyledCarouselItem,StyledNextArrowWrapper,StyledPrevArrowWrapper}from\"./Carousel.styled\";var Carousel=function(a){var b=a.children,c=a.style,d=a.className,f=useRef(!1),g=useRef(),h=useResizeObserver(),i=_slicedToArray(h,1),j=i[0],k=useState(!1),l=_slicedToArray(k,2),m=l[0],n=l[1],o=useState(!1),p=_slicedToArray(o,2),q=p[0],r=p[1],s=Children.toArray(b),t=function(){if(g.current){var a=g.current,b=a.scrollWidth,c=a.offsetWidth,d=a.scrollLeft,e=Math.round(b-c),f=Math.round(e-d);n(0j,l=k?MAX_FILTER_PREVIEW_WIDTH:MAX_FILTER_PREVIEW_HEIGHT*j,m=k?MAX_FILTER_PREVIEW_WIDTH/j:MAX_FILTER_PREVIEW_HEIGHT;return React.createElement(StyledFilterItem,{className:\"FIE_filters-item\",onClick:h,\"aria-selected\":e},React.createElement(FilterItemPreview,{className:\"FIE_filters-item-preview\",width:MAX_FILTER_PREVIEW_WIDTH,height:MAX_FILTER_PREVIEW_HEIGHT},React.createElement(Layer,{onTap:h},React.createElement(Image,{image:f,filters:c?[c]:[],width:l,height:m,x:-(l-MAX_FILTER_PREVIEW_WIDTH)/2,y:-(m-MAX_FILTER_PREVIEW_HEIGHT)/2,ref:g}))),React.createElement(FilterItemLabel,{className:\"FIE_filters-item-label\"},b))};FilterItem.defaultProps={filterFn:void 0};export default memo(FilterItem);","import Konva from\"konva\";import*as CustomKonvaFilters from\"../../../custom/filters\";var konvaFilters=Konva.Filters;export var AVAILABLE_FILTERS=[{label:\"Original\",filterFn:null},{label:\"Invert\",filterFn:konvaFilters.Invert},{label:\"Black & White\",filterFn:CustomKonvaFilters.BlackAndWhite},{label:\"Sepia\",filterFn:konvaFilters.Sepia},{label:\"Solarize\",filterFn:konvaFilters.Solarize},{label:\"Clarendon\",filterFn:CustomKonvaFilters.Clarendon},{label:\"Gingham\",filterFn:CustomKonvaFilters.Gingham},{label:\"Moon\",filterFn:CustomKonvaFilters.Moon},{label:\"Lark\",filterFn:CustomKonvaFilters.Lark},{label:\"Reyes\",filterFn:CustomKonvaFilters.Reyes},{label:\"Juno\",filterFn:CustomKonvaFilters.Juno},{label:\"Slumber\",filterFn:CustomKonvaFilters.Slumber},{label:\"Crema\",filterFn:CustomKonvaFilters.Crema},{label:\"Ludwig\",filterFn:CustomKonvaFilters.Ludwig},{label:\"Aden\",filterFn:CustomKonvaFilters.Aden},{label:\"Perpetua\",filterFn:CustomKonvaFilters.Perpetua},{label:\"Amaro\",filterFn:CustomKonvaFilters.Amaro},{label:\"Mayfair\",filterFn:CustomKonvaFilters.Mayfair},{label:\"Rise\",filterFn:CustomKonvaFilters.Rise},{label:\"Hudson\",filterFn:CustomKonvaFilters.Hudson},{label:\"Valencia\",filterFn:CustomKonvaFilters.Valencia},{label:\"X-Pro II\",filterFn:CustomKonvaFilters.XPro2},{label:\"Sierra\",filterFn:CustomKonvaFilters.Sierra},{label:\"Willow\",filterFn:CustomKonvaFilters.Willow},{label:\"Lo-Fi\",filterFn:CustomKonvaFilters.LoFi},{label:\"Inkwell\",filterFn:konvaFilters.Grayscale},{label:\"Hefe\",filterFn:CustomKonvaFilters.Hefe},{label:\"Nashville\",filterFn:CustomKonvaFilters.Nashville},{label:\"Stinson\",filterFn:CustomKonvaFilters.Stinson},{label:\"Vesper\",filterFn:CustomKonvaFilters.Vesper},{label:\"Earlybird\",filterFn:CustomKonvaFilters.Earlybird},{label:\"Brannan\",filterFn:CustomKonvaFilters.Brannan},{label:\"Sutro\",filterFn:CustomKonvaFilters.Sutro},{label:\"Toaster\",filterFn:CustomKonvaFilters.Toaster},{label:\"Walden\",filterFn:CustomKonvaFilters.Walden},{label:\"1977\",filterFn:CustomKonvaFilters.NinteenSeventySeven},{label:\"Kelvin\",filterFn:CustomKonvaFilters.Kelvin},{label:\"Maven\",filterFn:CustomKonvaFilters.Maven},{label:\"Ginza\",filterFn:CustomKonvaFilters.Ginza},{label:\"Skyline\",filterFn:CustomKonvaFilters.Skyline},{label:\"Dogpatch\",filterFn:CustomKonvaFilters.Dogpatch},{label:\"Brooklyn\",filterFn:CustomKonvaFilters.Brooklyn},{label:\"Helena\",filterFn:CustomKonvaFilters.Helena},{label:\"Ashby\",filterFn:CustomKonvaFilters.Ashby},{label:\"Charmes\",filterFn:CustomKonvaFilters.Charmes}];","import _slicedToArray from\"@babel/runtime/helpers/slicedToArray\";import React from\"react\";import{useFilter,useStore}from\"../../../hooks\";import Carousel from\"../../common/Carousel\";import FilterItem from\"./FilterItem\";import{AVAILABLE_FILTERS}from\"./Filters.constants\";var style={maxWidth:\"100%\",width:\"100%\"},Filters=function(){var a=useStore(),b=a.originalImage,c=useFilter(),d=_slicedToArray(c,2),e=d[0],f=d[1];return React.createElement(Carousel,{className:\"FIE_filters\",style:style},AVAILABLE_FILTERS.map(function(a){return React.createElement(FilterItem,{key:a.label,filterLabel:a.label,filterFn:a.filterFn,applyFilter:f,isActive:e===a.filterFn,image:b})}))};export default Filters;","import React from\"react\";import{Text as TextIcon}from\"@scaleflex/icons/text\";import ToolsBarItemButton from\"../../ToolsBar/ToolsBarItemButton\";import{TOOLS_IDS}from\"../../../utils/constants\";var TextButton=function(a){var b=a.selectTool,c=a.isSelected,d=a.t;return React.createElement(ToolsBarItemButton,{className:\"FIE_text-tool-button\",id:TOOLS_IDS.TEXT,label:d(\"textTool\"),Icon:TextIcon,onClick:b,isSelected:c})};TextButton.defaultProps={isSelected:!1};export default TextButton;","import styled from\"styled-components\";import Label from\"@scaleflex/ui/core/label\";import{Color as PC}from\"@scaleflex/ui/utils/types/palette\";var StyledOptions=styled.div.withConfig({componentId:\"sc-qvjmv1-0\"})([\"display:flex;align-items:center;justify-content:center;padding:8px 16px;margin-top:4px;gap:8px;flex-wrap:wrap;\",\" svg{color:\",\";}\"],function(a){var b=a.isPhoneScreen;return b&&\"\\n max-width: 315px;\\n padding: 0;\\n \"},function(a){var b=a.theme.palette;return b[PC.IconsPrimary]}),StyledOptionsWrapper=styled.div.withConfig({componentId:\"sc-qvjmv1-1\"})([\"display:flex;flex-wrap:wrap;margin-left:-4px;gap:4px;.FIE_annotation-option-triggerer{padding:6px;}\"]),StyledOptionPopupContent=styled.div.withConfig({componentId:\"sc-qvjmv1-2\"})([\"background:\",\";border-radius:4px;display:flex;flex-direction:column;padding:8px 12px;overflow:visible;\",\" \",\" *{font-family:'Roboto',sans-serif;}\"],function(a){var b=a.theme;return b.palette[\"bg-secondary\"]},function(a){var b=a.position;return b&&\"\\n display: grid;\\n grid-template-columns: repeat(4, auto);\\n padding: 0;\\n margin-top: 8px;\\n box-shadow: 0px 1px 2px \".concat(function(a){var b=a.theme;return b.palette[\"light-shadow\"]},\";\\n \")},function(a){var b=a.disablePadding;return b&&\"\\n padding: 0;\\n \"}),StyledSpacedOptionFields=styled.div.withConfig({componentId:\"sc-qvjmv1-3\"})([\"display:flex;align-items:center;gap:12px;\",\"\"],function(a){var b=a.preventFlex;return b&&\"\\n display: block;\\n\\n label {\\n margin-bottom: 8px;\\n }\\n \"}),StyledTwoColumnsContainer=styled.div.withConfig({componentId:\"sc-qvjmv1-4\"})([\"display:flex;align-items:center;justify-content:space-between;\"]),StyledColumn=styled.div.withConfig({componentId:\"sc-qvjmv1-5\"})([\"&:not(:first-child){margin-left:12px;}\"]),StyledIconWrapper=styled.div.withConfig({componentId:\"sc-qvjmv1-6\"})(function(a){var b=a.theme,c=a.addThinBorder,d=a.secondaryIconColor,e=a.active,f=a.watermarkTool;return\"\\n cursor: pointer;\\n padding: \".concat(f?\"6px\":\"8px 12px\",\";\\n border-radius: 2px;\\n display: flex;\\n justify-content: center;\\n align-items: center;\\n gap: 6px;\\n\\n svg {\\n vertical-align: middle;\\n margin: 0 auto;\\n }\\n\\n \").concat(c?\"border: 0.5px solid \".concat(b.palette[\"borders-secondary\"],\";\\n padding: 8px 8px;\"):\"\",\";\\n color: \").concat(d?b.palette[PC.IconsSecondary]:\"\",\";\\n\\n \").concat(e&&\"\\n border-radius: 4px;\\n border-color: \".concat(b.palette[PC.AccentStateless],\";\\n background-color: \").concat(b.palette[PC.BackgroundActive],\";\\n\\n * {\\n color: \").concat(b.palette[PC.AccentStateless],\";\\n }\\n \"),\"\\n\\n :hover {\\n background: \").concat(b.palette[\"bg-primary-active\"],\";\\n }\\n \")}),StyledIconLabel=styled(Label).withConfig({componentId:\"sc-qvjmv1-7\"})([\"color:\",\";\"],function(a){var b=a.theme.palette;return b[PC.TextPrimary]});export{StyledTwoColumnsContainer,StyledColumn,StyledIconWrapper,StyledSpacedOptionFields,StyledOptions,StyledOptionsWrapper,StyledOptionPopupContent,StyledIconLabel};","import React from\"react\";import restrictNumber from\"../../../utils/restrictNumber\";import{Label}from\"@scaleflex/ui/core\";import{StyledSpacedOptionFields,StyledIconLabel,StyledOptionPopupContent}from\"./AnnotationOptions.styled\";import Slider from\"../Slider\";var MIN_PERCENTANGE=0,MAX_PERCENTANGE=1,OpacityField=function(a){var b=a.annotation,c=a.updateAnnotation,d=a.t,e=b.opacity,f=Math.round(100*e);return React.createElement(StyledOptionPopupContent,{disablePadding:!0},React.createElement(Label,null,d(\"transparency\")),React.createElement(StyledSpacedOptionFields,null,React.createElement(Slider,{annotation:\"%\",onChange:function changeOpacity(a){c({opacity:restrictNumber(a/100,MIN_PERCENTANGE,MAX_PERCENTANGE)})},value:f,noMargin:!0}),React.createElement(StyledIconLabel,null,\"\".concat(f,\"%\"))))};export default OpacityField;","import{Modal,ModalActions as SfxModalActions}from\"@scaleflex/ui/core\";import styled from\"styled-components\";import{Color as PC}from\"@scaleflex/ui/utils/types/palette\";var ColorPickerModal=styled(Modal).withConfig({componentId:\"sc-7tf41j-0\"})([\"max-width:350px;\"]),ColorPickerWrap=styled.div.withConfig({componentId:\"sc-7tf41j-1\"})([\".SfxColorPicker-root{max-width:100%;padding:0;box-shadow:none;border:none;\",\"}.SfxColorPicker-action{display:flex;gap:12px;.SfxColorPicker-select{width:100px;}.SfxInput-root{width:190px !important;}}.SfxColorPicker-icon{color:\",\";}.SfxColorPicker-range-picker,.SfxColorPicker-bar-wrapper{width:100%;}\"],function(a){var b=a.hideModalTitle;return b&&\"padding-top: 12px;\"},function(a){var b=a.theme.palette;return b[PC.IconsPrimary]}),ModalActions=styled(SfxModalActions).withConfig({componentId:\"sc-7tf41j-2\"})([\"gap:12px;padding:24px;.SfxButton-root{flex:1;margin:0;height:40px;}\"]),Styled={ColorPickerModal:ColorPickerModal,ColorPickerWrap:ColorPickerWrap,ModalActions:ModalActions};export default Styled;","import React from\"react\";import{Button,ColorPicker,ModalContent,ModalTitle}from\"@scaleflex/ui/core\";import ColorPickerIcon from\"@scaleflex/icons/color-picker\";import{useStore}from\"../../../hooks\";import Styled from\"./ColorPickerModal.styled\";var modalStyles={zIndex:1301},ColorPickerModal=function(a){var b=a.hideModalTitle,c=a.defaultColor,d=void 0===c?\"\":c,e=a.onChange,f=a.open,g=a.pinnedColors,h=a.onClose,i=a.onApply,j=useStore(),k=j.t;return f?React.createElement(Styled.ColorPickerModal,{onClose:h,open:f,fullWidth:!0,modalStyles:modalStyles},!b&&React.createElement(ModalTitle,{onClose:h,primary:k(\"colorPickerModalTitleLabel\",\"Pick color\"),icon:React.createElement(ColorPickerIcon,{size:29}),iconShadow:!0,variant:\"with-icon\"}),React.createElement(ModalContent,null,React.createElement(Styled.ColorPickerWrap,{hideModalTitle:b},React.createElement(ColorPicker,{onChange:e,pinnedColors:g,defaultColor:d,showTransparentColor:!0}))),React.createElement(Styled.ModalActions,null,React.createElement(Button,{color:\"basic\",onClick:h},k(\"cancel\")),React.createElement(Button,{color:\"primary\",onClick:i},k(\"apply\")))):null};ColorPickerModal.defaultProps={defaultColor:\"\",pinnedColors:[],onChange:function onChange(){},open:!1,hideModalTitle:!1,onClose:function onClose(){},onApply:function onApply(){}};export default ColorPickerModal;","import styled from\"styled-components\";import{Color as PC}from\"@scaleflex/ui/utils/types/palette\";var StyledPickerTrigger=styled.div.attrs(function(a){var b=a.$color;return{style:{background:\"rgba(0,0,0,0)\"===b?\"repeating-conic-gradient(#5d6d7e 0% 25%, transparent 0% 50%) 50% / 8px 8px\":b}}}).withConfig({componentId:\"sc-zmv0gj-0\"})([\"background:\",\";border-radius:4px;width:32px;height:32px;border:1px solid \",\";cursor:pointer;box-sizing:border-box;\"],function(a){var b=a.theme;return b.palette[\"icons-primary\"]},function(a){var b=a.theme;return b.palette[PC.BorderPrimaryStateless]});export{StyledPickerTrigger};","import _defineProperty from\"@babel/runtime/helpers/defineProperty\";import _slicedToArray from\"@babel/runtime/helpers/slicedToArray\";import React,{useEffect,useRef,useState}from\"react\";import{useStore}from\"../../../hooks\";import{SET_LATEST_COLOR}from\"../../../actions\";import ColorPickerModal from\"../ColorPickerModal\";import{StyledPickerTrigger}from\"./ColorInput.styled\";var pinnedColorsKey=\"FIE_pinnedColors\",ColorInput=function(a){var b,c=a.onChange,d=a.color,e=a.colorFor,f=useStore(),g=f.selectionsIds,h=void 0===g?[]:g,i=f.config.annotationsCommon,j=void 0===i?{}:i,k=f.dispatch,l=f.latestColors,m=void 0===l?{}:l,n=m[e],o=useState(),p=_slicedToArray(o,2),q=p[0],r=p[1],s=useState(function(){return n||d||j.fill}),t=_slicedToArray(s,2),u=t[0],v=t[1],w=useState(null!==(b=window)&&void 0!==b&&b.localStorage?JSON.parse(localStorage.getItem(pinnedColorsKey)||\"[]\"):[]),x=_slicedToArray(w,2),y=x[0],z=x[1],A=useRef(u),B=function(a){var b;if(null!==(b=window)&&void 0!==b&&b.localStorage){var c=window.localStorage.getItem(pinnedColorsKey);if(JSON.stringify(a)!==c){var d=a.slice(-9);window.localStorage.setItem(pinnedColorsKey,JSON.stringify(d)),z(d)}}},C=function(a){r(q?null:a.currentTarget)};return useEffect(function(){var a=0===h.length&&n||d;v(a),c(a)},[d,h]),React.createElement(React.Fragment,null,React.createElement(StyledPickerTrigger,{className:\"FIE_color-picker-triggerer\",onClick:C,$color:u,onChange:c}),React.createElement(ColorPickerModal,{hideModalTitle:!0,onChange:function changeColor(a,b,d){v(b),c(b),B(d),n!==b&&k({type:SET_LATEST_COLOR,payload:{latestColors:_defineProperty({},e,b)}})},defaultColor:u,pinnedColors:y,open:!!q,onClose:function closePicker(a){c(A.current||u),C(a)},onApply:C}))};ColorInput.defaultProps={color:void 0};export default ColorInput;","import React from\"react\";import restrictNumber from\"../../../utils/restrictNumber\";import ColorInput from\"../ColorInput\";import{StyledSpacedOptionFields}from\"./AnnotationOptions.styled\";import Slider from\"../Slider\";var MIN_PERCENTANGE=0,MAX_PERCENTANGE=100,StrokeFields=function(a){var b=a.annotation,c=a.updateAnnotation,d=b.stroke,e=b.strokeWidth;return React.createElement(StyledSpacedOptionFields,null,React.createElement(Slider,{annotation:\"px\",onChange:function changeStrokeWidth(a){c({strokeWidth:restrictNumber(a,MIN_PERCENTANGE,MAX_PERCENTANGE)})},value:e,noMargin:!0}),React.createElement(ColorInput,{color:d,onChange:function changeStrokeColor(a){c({stroke:a})},colorFor:\"stroke\"}))};export default StrokeFields;","import _defineProperty from\"@babel/runtime/helpers/defineProperty\";import React from\"react\";import Label from\"@scaleflex/ui/core/label\";import restrictNumber from\"../../../utils/restrictNumber\";import ColorInput from\"../ColorInput\";import{StyledTwoColumnsContainer,StyledColumn,StyledSpacedOptionFields}from\"./AnnotationOptions.styled\";import Slider from\"../Slider\";var ShadowFields=function(a){var b=a.annotation,c=a.updateAnnotation,d=a.t,e=b.shadowOffsetX,f=b.shadowOffsetY,g=b.shadowBlur,h=b.shadowColor,i=b.shadowOpacity,j=function(a,b){var d=2parseFloat(k))){var m=Math.min(10*h.width,10*h.height),o=getSizeAfterRotation(h.width,h.height,n),p=_defineProperty({},f,k?restrictNumber(k,0,m):k),q=\"height\"===f,r=q?\"width\":\"height\",s=null!==(d=c.ratioUnlocked)&&void 0!==d?d:i.ratioUnlocked;if(!s){var t=o.width/o.height;p[r]=q?Math.round(p[f]*t):Math.round(p[f]/t)}if(p[f]!==i[f]||p[r]!==i[r]){if(\"function\"==typeof b)return void b(p);g({type:SET_RESIZE,payload:p});var u=l.width&&l.height&&l||j,v=_objectSpread(_objectSpread({},i),p);g({type:ZOOM_CANVAS,payload:{factor:v.width&&v.height?getZoomFitFactor(u,v):DEFAULT_ZOOM_FACTOR,isAbsoluteZoom:!0}})}}},r=\"undefined\"==typeof i.width&&\"undefined\"==typeof i.height||h.width===i.width&&h.height===i.height,s=getProperDimensions((c.width||c.height)&&c||i,l,j,h,n),t=i.manualChangeDisabled,u=\"undefined\"!=typeof i.width&&!i.width,v=\"undefined\"!=typeof i.height&&!i.height;return React.createElement(StyledResizeWrapper,{className:\"FIE_resize-tool-options\",alignment:e},React.createElement(StyledResizeInput,{className:\"FIE_resize-width-option\",value:u?\"\":s.width,name:\"width\",onChange:t?void 0:q,inputMode:\"numeric\",title:p(\"resizeWidthTitle\"),label:p(\"width\"),inputProps:{type:\"number\"},size:\"sm\",iconEnd:\"px\",placeholder:\"Width\",disabled:t}),React.createElement(StyledRatioLockIcon,{className:\"FIE_resize-ratio-locker\",title:p(\"toggleRatioLockTitle\"),onClick:t?void 0:function toggleRatioLock(){return\"function\"==typeof b?void b({ratioUnlocked:!c.ratioUnlocked}):void g({type:SET_RESIZE,payload:{ratioUnlocked:!i.ratioUnlocked}})},color:\"basic\",size:\"sm\",disabled:t},c.ratioUnlocked||i.ratioUnlocked?React.createElement(UnlockOutline,{size:16,color:o.palette.success}):React.createElement(LockOutline,{size:16,color:o.palette.error})),React.createElement(StyledResizeInput,{className:\"FIE_resize-height-option\",value:v?\"\":s.height,name:\"height\",onChange:t?void 0:q,inputMode:\"numeric\",title:p(\"resizeHeightTitle\"),label:p(\"height\"),inputProps:{type:\"number\"},size:\"sm\",iconEnd:\"px\",placeholder:\"Height\",disabled:t}),!d&&React.createElement(StyledResetButton,{className:\"FIE_resize-reset-button\",size:\"sm\",color:\"basic\",onClick:r||t?void 0:function resetResize(){g({type:SET_RESIZE,payload:{width:void 0,height:void 0,ratioUnlocked:!1}});var a=l.width&&l.height&&l||j;g({type:ZOOM_CANVAS,payload:{factor:getZoomFitFactor(a,a)}})},disabled:r||t},React.createElement(Reset,null)))};Resize.defaultProps={onChange:void 0,currentSize:{},hideResetButton:!1,alignment:\"center\"};export default Resize;","import styled from\"styled-components\";var StyledWatermarkWrapper=styled.div.withConfig({componentId:\"sc-fvaj5j-0\"})([\"display:flex;align-items:center;justify-content:center;flex-wrap:wrap;gap:8px;overflow:hidden;\",\";\"],function(a){var b=a.noWrap;return b?\"flex-wrap: nowrap;\":\"\"}),StyledControlsWrapper=styled.div.withConfig({componentId:\"sc-fvaj5j-1\"})([\"margin-bottom:8px;\"]),StyledWatermarkGalleryItem=styled.div.withConfig({componentId:\"sc-fvaj5j-2\"})(function(a){var b=a.theme;return\"\\n padding: 6px 4px;\\n border: 1px solid \".concat(b.palette[\"borders-secondary\"],\";\\n width: fit-content;\\n height: 32px;\\n border-radius: 2px;\\n overflow: hidden;\\n cursor: pointer;\\n border-radius: 4px;\\n\\n :hover {\\n background: \").concat(b.palette[\"bg-primary-active\"],\";\\n }\\n\\n &[aria-selected='true'] {\\n background: \").concat(b.palette[\"bg-primary-active\"],\";\\n border-color: \").concat(b.palette[\"accent-primary-active\"],\";\\n }\\n\\n img {\\n max-width: 100%;\\n max-height: 100%;\\n }\\n \")});export{StyledWatermarkWrapper,StyledControlsWrapper,StyledWatermarkGalleryItem};","import React,{useMemo}from\"react\";import{useStore}from\"../../../hooks\";import{TOOLS_IDS,WATERMARK_ANNOTATION_ID}from\"../../../utils/constants\";import Carousel from\"../../common/Carousel\";import{SET_FEEDBACK}from\"../../../actions\";import{StyledWatermarkGalleryItem}from\"./Watermark.styled\";var WatermarksGallery=function(a){var b=a.addImgWatermark,c=a.loadAndSetWatermarkImg,d=a.style,e=useStore(),f=e.config,g=e.annotations,h=e.dispatch,i=e.t,j=useMemo(function(){var a;return null===(a=(g[WATERMARK_ANNOTATION_ID]||{}).image)||void 0===a?void 0:a.src},[g[WATERMARK_ANNOTATION_ID]]),k=function(a){var c=a.currentTarget.children[0];if(c.complete){if(!c.naturalWidth)return void h({type:SET_FEEDBACK,payload:{feedback:{message:i(\"mutualizedFailedToLoadImg\"),duration:2e3}}});b(c)}},l=f[TOOLS_IDS.WATERMARK]||{},m=l.gallery,n=void 0===m?[]:m;return 0===n.length?null:React.createElement(Carousel,{className:\"FIE_watermark-gallery\",style:d},n.map(function(a){var b=(null===a||void 0===a?void 0:a.url)||a,d=(null===a||void 0===a?void 0:a.previewUrl)||b;return React.createElement(StyledWatermarkGalleryItem,{className:\"FIE_watermark-selected-item\",onClick:function onClick(a){return b===d?k(a):c(b)},key:b,\"aria-selected\":b===j},React.createElement(\"img\",{src:d,alt:\"Failed to load.\",crossOrigin:\"Anonymous\",draggable:!1}))}))};WatermarksGallery.defaultProps={style:void 0};export default WatermarksGallery;","import _slicedToArray from\"@babel/runtime/helpers/slicedToArray\";import React,{useState}from\"react\";import Menu from\"@scaleflex/ui/core/menu\";import Padding from\"@scaleflex/icons/padding\";import restrictNumber from\"../../../utils/restrictNumber\";import{StyledSpacedOptionFields,StyledIconWrapper,StyledOptionPopupContent,StyledIconLabel}from\"../../common/AnnotationOptions/AnnotationOptions.styled\";import Slider from\"../../common/Slider\";import{Label}from\"@scaleflex/ui/core\";var WatermarkPadding=function(a){var b=a.watermark,c=a.saveWatermark,d=a.t,e=useState(null),f=_slicedToArray(e,2),g=f[0],h=f[1],i=b.padding||0;return React.createElement(React.Fragment,null,React.createElement(StyledIconWrapper,{className:\"FIE_watermark-padding-triggerer\",title:d(\"padding\"),onClick:function openOptionPopup(a){h(a.currentTarget)},active:g},React.createElement(Padding,{size:20})),React.createElement(Menu,{className:\"FIE_watermark-padding-popup\",anchorEl:g,open:!!g,onClose:function closeOptionPopup(){h(null)},position:\"top\"},React.createElement(StyledOptionPopupContent,null,React.createElement(Label,null,d(\"padding\")),React.createElement(StyledSpacedOptionFields,null,React.createElement(Slider,{annotation:\"px\",onChange:function updatePadding(a){c({padding:restrictNumber(a,0,100)})},value:i,noMargin:!0}),React.createElement(StyledIconLabel,null,\"\".concat(i,\"px\"))))))};export default WatermarkPadding;","import _defineProperty from\"@babel/runtime/helpers/defineProperty\";import _slicedToArray from\"@babel/runtime/helpers/slicedToArray\";function ownKeys(a,b){var c=Object.keys(a);if(Object.getOwnPropertySymbols){var d=Object.getOwnPropertySymbols(a);b&&(d=d.filter(function(b){return Object.getOwnPropertyDescriptor(a,b).enumerable})),c.push.apply(c,d)}return c}function _objectSpread(a){for(var b,c=1;cr?s*w/c:r*w/b,g=_objectSpread(_objectSpread(_objectSpread({},e.annotationsCommon),e[TOOLS_IDS.IMAGE]),{},{scaleX:d,scaleY:d,padding:1,image:a,width:b,height:c,x:t+r/2-b*d/2,y:u+s/2-c*d/2,id:WATERMARK_ANNOTATION_ID,name:TOOLS_IDS.IMAGE,replaceCurrent:!0});f({type:SET_ANNOTATION,payload:g})},y=function(a){f({type:SET_ANNOTATION,payload:_objectSpread(_objectSpread({},\"function\"==typeof a?a(q):a),{},{id:WATERMARK_ANNOTATION_ID})})},z=function(a){f({type:SET_FEEDBACK,payload:{feedback:{message:a,status:FEEDBACK_STATUSES.WARNING}}})},A=function(a,b){if(a){n(!0);var c=new Image;c.onload=function(){x(c),b&&URL.revokeObjectURL(a),n(!1)},c.onerror=function(){z(g(\"mutualizedFailedToLoadImg\")),b&&URL.revokeObjectURL(a),n(!1)},c.src=a}};useEffect(function(){q&&(f({type:CLEAR_ANNOTATIONS_SELECTIONS}),f({type:SELECT_ANNOTATION,payload:{annotationId:\"watermark\"}}))},[q]),useEffect(function(){q&&(0===d.length||d[0].id!==WATERMARK_ANNOTATION_ID)&&f({type:SELECT_ANNOTATION,payload:{annotationId:\"watermark\"}})},[d]);var B=[(!e.useCloudimage||\"function\"==typeof p.onUploadWatermarkImgClick)&&{key:\"upload-watermark\",label:g(\"uploadWatermark\"),icon:UploadOutline,onClick:function handleUploadWatermarkClick(){if(\"function\"==typeof p.onUploadWatermarkImgClick){var a=p.onUploadWatermarkImgClick(A);return void(a instanceof Promise&&a.then(function(){var a=0b.factor,f={x:(a.x-b.x||0)/b.factor,y:(a.y-b.y||0)/b.factor},g={x:a.x-f.x*a.factor,y:a.y-f.y*a.factor};if(e&&1===b.factor||(g.x=Math.min(0,Math.max(g.x,c*(1-b.factor))),g.y=Math.min(0,Math.max(g.y,d*(1-b.factor)))),1>a.factor){var h=c-c*a.factor,i=d-d*a.factor;g.x+=h/2,g.y+=i/2}return _objectSpread(_objectSpread({},g),{},{factor:a.factor})};export default calculateZoomData;","import _defineProperty from\"@babel/runtime/helpers/defineProperty\";import _objectWithoutProperties from\"@babel/runtime/helpers/objectWithoutProperties\";var _excluded=[\"preparedDimensions\"];function ownKeys(a,b){var c=Object.keys(a);if(Object.getOwnPropertySymbols){var d=Object.getOwnPropertySymbols(a);b&&(d=d.filter(function(b){return Object.getOwnPropertyDescriptor(a,b).enumerable})),c.push.apply(c,d)}return c}function _objectSpread(a){for(var b,c=1;cf.x+f.width&&(g.width=f.x+f.width-g.x),g.y+g.height>f.y+f.height&&(g.height=f.y+f.height-g.y),\"number\"==typeof d&&!compareRatios(g.width/g.height,d)){var h=g.height*d,i=g.width/d;toPrecisedFloat(g.y+i)<=f.y+f.height?g.height=i:g.width=h}if((e.minWidth&&g.width<=e.minWidth||e.maxWidth&&g.width>=e.maxWidth)&&(g.width=restrictNumber(g.width,e.minWidth,e.maxWidth),g.x=a.x,g.y=a.y,\"number\"==typeof d&&(g.height=g.width/d)),(e.minHeight&&b.height<=e.minHeight||e.maxHeight&&b.height>=e.maxHeight)&&(g.height=restrictNumber(g.height,e.minHeight,e.maxHeight),g.x=a.x,g.y=a.y,\"number\"==typeof d&&(g.width=g.height*d)),\"string\"==typeof e.lockCropAreaAt){var j=getPositionByPlaceLabel(e.lockCropAreaAt,f,g),k=j.x,l=j.y;g.x=k,g.y=l}return g};","import _extends from\"@babel/runtime/helpers/extends\";import _defineProperty from\"@babel/runtime/helpers/defineProperty\";function ownKeys(a,b){var c=Object.keys(a);if(Object.getOwnPropertySymbols){var d=Object.getOwnPropertySymbols(a);b&&(d=d.filter(function(b){return Object.getOwnPropertyDescriptor(a,b).enumerable})),c.push.apply(c,d)}return c}function _objectSpread(a){for(var b,c=1;c=n.width&&j.height>=n.height;n.width&&n.height&&(df.scaledBy?f.scaledBy:1,J=_objectSpread(_objectSpread({},f),{},{width:f.width/I,height:f.height/I});F=boundResizing(J,_objectSpread(_objectSpread({},J),{},{x:0,y:0}),_objectSpread(_objectSpread({},J),{},{abstractX:0,abstractY:0}),!(A||B)&&C(),v)}else F=j;var K=F,L=K.x,M=void 0===L?0:L,x=K.y,N=void 0===x?0:x,y=K.width,O=K.height,P={x:k?f.width-M-y:M,y:l?f.height-N-O:N,ref:q,fill:\"#FFFFFF\",scaleX:1,scaleY:1,globalCompositeOperation:\"destination-out\",onDragEnd:w?void 0:H,onDragMove:w?void 0:function limitDragging(a){var b=a.target;b.setAttrs(boundDragging(b.attrs,t.current))},onTransformEnd:w?void 0:H,draggable:!w};return React.createElement(React.Fragment,null,React.createElement(Image,{image:e,x:k?f.width:0,y:l?f.height:0,width:f.width,height:f.height,filters:[Konva.Filters.Blur,Konva.Filters.Brighten],blurRadius:10,brightness:-.3,scaleX:k?-1:1,scaleY:l?-1:1,ref:s}),B?React.createElement(Ellipse,_extends({},P,{radiusX:y/2,radiusY:O/2,offset:{x:-y/2,y:-O/2}})):React.createElement(Rect,_extends({},P,{width:j.noEffect?0:y,height:j.noEffect?0:O})),j.noEffect&&React.createElement(TextNode,{name:\"Text\",id:\"no-preview-text-node\",text:p(\"cropItemNoEffect\"),x:f.width/2-noEffectTextDimensions.width/2,y:f.height/2-noEffectTextDimensions.height/2,fontSize:20,fill:\"#ffffff\",stroke:\"#ff0000\",strokeWidth:.2,shadowColor:\"#ff0000\",shadowBlur:10,annotationEvents:{},align:\"center\",width:noEffectTextDimensions.width,height:noEffectTextDimensions.height}),React.createElement(Transformer,{centeredScaling:!1,flipEnabled:!1,rotateEnabled:!1,nodes:q.current?[q.current]:[],anchorSize:14,anchorCornerRadius:7,enabledAnchors:G,ignoreStroke:!1,anchorStroke:c.palette[\"accent-primary\"],anchorFill:c.palette[\"access-primary\"],anchorStrokeWidth:2,borderStroke:c.palette[\"accent-primary\"],borderStrokeWidth:2,borderDash:[4],keepRatio:!A||!B,ref:r,boundBoxFunc:function boundBoxFunc(a,b){return boundResizing(a,b,t.current,!(A||B)&&C(),v)}}))};export default CropTransformer;","import React,{useMemo}from\"react\";import{Transformer}from\"react-konva\";import{NODES_TRANSFORMER_ID,POINTER_ICONS,TOOLS_IDS}from\"../../../utils/constants\";import{useStore}from\"../../../hooks\";import{CHANGE_POINTER_ICON,ENABLE_TEXT_CONTENT_EDIT}from\"../../../actions\";var NodesTransformer=function(){var a,b=useStore(),c=b.selectionsIds,d=void 0===c?[]:c,e=b.theme,f=b.designLayer,g=b.dispatch,h=b.config.useCloudimage,i=useMemo(function(){return null!==f&&void 0!==f&&f.findOne?d.map(function(a){return f.findOne(\"#\".concat(a))}).filter(Boolean):[]},[d]),j=function(){1===i.length&&i[0].name()===TOOLS_IDS.TEXT&&g({type:ENABLE_TEXT_CONTENT_EDIT,payload:{textIdOfEditableContent:i[0].id()}})},k=h?[\"top-left\",\"bottom-left\",\"top-right\",\"bottom-right\"]:void 0;return React.createElement(Transformer,{id:NODES_TRANSFORMER_ID,centeredScaling:!1,rotationSnaps:[0,45,90,135,180,225,270,315],nodes:i,rotateAnchorOffset:30,anchorSize:14,anchorCornerRadius:7,padding:1===i.length?null!==(a=i[0].attrs.padding)&&void 0!==a?a:1:1,ignoreStroke:!1,anchorStroke:e.palette[\"accent-primary\"],anchorFill:e.palette[\"access-primary\"],anchorStrokeWidth:2,borderStroke:e.palette[\"accent-primary\"],borderStrokeWidth:2,borderDash:[4],rotateEnabled:!h,onMouseOver:function changePointerIconToMove(){g({type:CHANGE_POINTER_ICON,payload:{pointerCssIcon:POINTER_ICONS.MOVE}})},onMouseLeave:function changePointerIconToDraw(){g({type:CHANGE_POINTER_ICON,payload:{pointerCssIcon:POINTER_ICONS.DRAW}})},onDblClick:j,onDblTap:j,enabledAnchors:k,flipEnabled:!h,shouldOverdrawWholeArea:!0})};export default NodesTransformer;","import React from\"react\";import{Layer}from\"react-konva\";import{useStore}from\"../../../hooks\";import{TOOLS_IDS,TRANSFORMERS_LAYER_ID}from\"../../../utils/constants\";import CropTransformer from\"./CropTransformer\";import NodesTransformer from\"./NodesTransformer\";var TransformersLayer=function(){var a=useStore(),b=a.toolId,c=a.shownImageDimensions;return React.createElement(Layer,{id:TRANSFORMERS_LAYER_ID,x:c.abstractX||0,y:c.abstractY||0},React.createElement(NodesTransformer,null),b===TOOLS_IDS.CROP&&React.createElement(CropTransformer,null))};export default TransformersLayer;","import styled from\"styled-components\";var StyledNodeControls=styled.div.withConfig({componentId:\"sc-1tst9ex-0\"})(function(a){var b=a.theme,c=a.top,d=a.left;return\"\\n position: absolute;\\n z-index: 1;\\n background: \".concat(b.palette[\"bg-secondary\"],\";\\n border-radius: 2px;\\n display: flex;\\n align-items: center;\\n justify-content: center;\\n box-shadow: 0px 1px 2px \").concat(b.palette[\"light-shadow\"],\";\\n top: \").concat((c||0)+8,\"px;\\n left: \").concat((d||0)+4,\"px;\\n transform: translateX(-50%);\\n height: 32px;\\n\")});export{StyledNodeControls};","import _slicedToArray from\"@babel/runtime/helpers/slicedToArray\";import React,{useEffect,useMemo,useState}from\"react\";import IconButton from\"@scaleflex/ui/core/icon-button\";import DeleteOutline from\"@scaleflex/icons/delete-outline\";import Duplicate from\"@scaleflex/icons/duplicate\";import{useStore}from\"../../hooks\";import{DUPLICATE_ANNOTATIONS,REMOVE_ANNOTATIONS}from\"../../actions\";import{NODES_TRANSFORMER_ID,WATERMARK_ANNOTATION_ID}from\"../../utils/constants\";import debounce from\"../../utils/debounce\";import{StyledNodeControls}from\"./NodeControls.styled\";var NodeControls=function(){var a=useStore(),b=a.selectionsIds,c=void 0===b?[]:b,d=a.designLayer,e=a.annotations,f=a.dispatch,g=useState({left:0,top:0}),h=_slicedToArray(g,2),i=h[0],j=h[1],k=useMemo(function(){var a;return null===d||void 0===d||null===(a=d.getStage())||void 0===a?void 0:a.findOne(\"#\".concat(NODES_TRANSFORMER_ID))},[d]),l=c.length,m=debounce(function(){k&&j({left:(k.x()+k.width()/2)*k.scaleX(),top:(k.y()+k.height())*k.scaleY()})},0);if(useEffect(function(){m()},[c,k,e]),0===l||!k)return null;return React.createElement(StyledNodeControls,{className:\"FIE_annotation-controls-overlay\",left:i.left,top:i.top},c[0]!==WATERMARK_ANNOTATION_ID&&React.createElement(IconButton,{color:\"basic\",size:\"sm\",onClick:function duplicateSelectedNodes(){f({type:DUPLICATE_ANNOTATIONS,payload:{annotationsIds:c}})}},React.createElement(Duplicate,null)),React.createElement(IconButton,{color:\"basic\",size:\"sm\",onClick:function removeSelectedNodes(){f({type:REMOVE_ANNOTATIONS,payload:{annotationsIds:c}})}},React.createElement(DeleteOutline,null)))};export default NodeControls;","import _defineProperty from\"@babel/runtime/helpers/defineProperty\";function ownKeys(a,b){var c=Object.keys(a);if(Object.getOwnPropertySymbols){var d=Object.getOwnPropertySymbols(a);b&&(d=d.filter(function(b){return Object.getOwnPropertyDescriptor(a,b).enumerable})),c.push.apply(c,d)}return c}function _objectSpread(a){for(var b,c=1;ct),w=_slicedToArray(v,2),x=w[0],y=w[1],z=useMemo(function(){return{cursor:g===POINTER_ICONS.DEFAULT&&h===TABS_IDS.ANNOTATE?POINTER_ICONS.DRAW:g}},[h,g]),A=function(a){f({type:ZOOM_CANVAS,payload:a})},B=useCallback(function(a){var b,c;a.evt.preventDefault(),null===(b=(c=a.currentTarget).container)||void 0===b||b.call(c).focus(),a.target instanceof Konva.Stage&&0t&&u&&(a.preventDefault(),y(!0),f({type:CHANGE_POINTER_ICON,payload:{pointerCssIcon:POINTER_ICONS.DRAG}}))},E=function(a){\"Space\"===a.code&&(a.preventDefault(),C())},F=function(){c.current&&c.current.container().focus()};useEffect(function(){f({type:CHANGE_POINTER_ICON,payload:{pointerCssIcon:POINTER_ICONS[x?\"DRAG\":\"DEFAULT\"]}})},[x]),useEffect(function(){y(h!==TABS_IDS.ANNOTATE&&h!==TABS_IDS.WATERMARK&&p.factor>t);var a;return c.current&&(a=c.current.container(),a.addEventListener(\"mouseenter\",F),a.addEventListener(\"keydown\",D),a.addEventListener(\"keyup\",E)),function(){a&&(a.removeEventListener(\"mouseenter\",F),a.removeEventListener(\"keydown\",D),a.removeEventListener(\"keyup\",E))}},[h,p.factor,t]);var G=l*(u&&p.factor||t);return React.createElement(StyledCanvasNode,{className:\"FIE_canvas-node\",tabIndex:-1,ref:c,width:j,height:k,scaleX:G,scaleY:G,x:u&&p.x||null,y:u&&p.y||null,zoomFactor:u&&p.factor||t,onWheel:u?function handleZoom(a){a.evt.preventDefault();var b=(p.factor||t)+a.evt.deltaY*-ZOOM_DELTA_TO_SCALE_CONVERT_FACTOR,c=a.currentTarget.getPointerPosition();A(_objectSpread(_objectSpread({},c),{},{factor:b}))}:void 0,onTap:B,onClick:B,onTouchMove:u?function(a){return zoomOnTouchesMove(a,A)}:void 0,onDragStart:function preventDraggingIfMultiTouches(a){var b;1<(null===(b=a.evt.touches)||void 0===b?void 0:b.length)&&y(!1)},onTouchEnd:u?function endTouchesZoomingEnablePanning(){endTouchesZooming(C)}:void 0,dragBoundFunc:function dragBoundFunc(a){var b=Math.min(0,Math.max(a.x,j*(1-p.factor))),c=Math.min(0,Math.max(a.y,k*(1-p.factor)));return{x:b,y:c}},draggable:u&&x,onDragEnd:function handleCanvasDragEnd(a){a.currentTarget.draggable()&&\"stage\"===a.target.nodeType.toLowerCase()&&u&&x&&A({factor:p.factor,x:a.target.x(),y:a.target.y(),preparedDimensions:!0})},style:z},b)};export default memo(CanvasNode);","import _slicedToArray from\"@babel/runtime/helpers/slicedToArray\";import React,{useCallback,useEffect,useRef}from\"react\";import{DesignLayer,TransformersLayer}from\"../Layers\";import{AppProviderOverridenValue}from\"../../context\";import{SET_CANVAS_SIZE}from\"../../actions\";import{useResizeObserver,useStore}from\"../../hooks\";import NodeControls from\"../NodeControls\";import CanvasNode from\"./CanvasNode\";import{CanvasContainer,StyledOrignalImage}from\"./MainCanvas.styled\";var MainCanvas=function(){var a=useResizeObserver(),b=_slicedToArray(a,1),c=b[0],d=useStore(),e=useRef(null),f=useCallback(function(a){var b=a.width,c=a.height;d.dispatch({type:SET_CANVAS_SIZE,payload:{canvasWidth:b,canvasHeight:c}})},[]);return useEffect(function(){c(e.current,f)},[]),React.createElement(CanvasContainer,{className:\"FIE_canvas-container\",ref:e},!d.textIdOfEditableContent&&React.createElement(NodeControls,null),d.isShowOriginalImage&&React.createElement(StyledOrignalImage,{className:\"FIE_original-image-compare\",src:d.originalImage.src}),React.createElement(CanvasNode,null,React.createElement(AppProviderOverridenValue,{overridingValue:d},React.createElement(DesignLayer,null),React.createElement(TransformersLayer,null))))};export default MainCanvas;","import styled from\"styled-components\";import{Color as PC}from\"@scaleflex/ui/utils/types/palette\";var StyledSeparator=styled.div.withConfig({componentId:\"sc-etsyb6-0\"})([\"display:inline-block;height:\",\";width:\",\";border-radius:1px;background:\",\";\"],function(a){return a.height},function(a){return a.width},function(a){var b=a.theme.palette;return b[PC.BordersSecondary]});export{StyledSeparator};","import React from\"react\";import{StyledSeparator}from\"./Separator.styled\";var Separator=function(a){var b=a.height,c=a.width;return React.createElement(StyledSeparator,{height:b,width:c})};Separator.defaultProps={height:\"24px\",width:\"1px\"};export default Separator;","import styled from\"styled-components\";import Button from\"@scaleflex/ui/core/button\";import IconButton from\"@scaleflex/ui/core/icon-button\";import Label from\"@scaleflex/ui/core/label\";import{CrossButton,InputGroup,SelectGroup}from\"@scaleflex/ui/core\";import{Color as PC}from\"@scaleflex/ui/utils/types/palette\";import{FontVariant as FV}from\"@scaleflex/ui/utils/types/typography\";var StyledTopbar=styled.div.withConfig({componentId:\"sc-21g986-0\"})([\"padding:16px;box-sizing:border-box;position:relative;width:100%;display:flex;flex-wrap:wrap;gap:16px;align-items:center;justify-content:space-between;border-bottom:1px solid \",\";[data-phone='true'] &{padding:6px 6px 4px 6px;\",\"}\"],function(a){var b=a.theme.palette;return b[PC.BordersSecondary]},function(a){var b=a.isPhoneScreen;return b&&\"\\n padding: 12px 12px 0px;\\n gap: 12px;\\n \"}),StyledMainButtonsWrapper=styled.div.withConfig({componentId:\"sc-21g986-1\"})([\"display:flex;align-items:center;order:1;\"]),StyledControlButtonsWrapper=styled.div.withConfig({componentId:\"sc-21g986-2\"})([\"display:flex;align-items:center;order:3;gap:4px;\"]),StyledHistoryButton=styled(IconButton).withConfig({componentId:\"sc-21g986-3\"})([\"margin:\",\";svg{color:\",\";}\"],function(a){var b=a.margin;return null!==b&&void 0!==b?b:\"0 4px\"},function(a){var b=a.theme.palette,c=a.disabled;return c?b[PC.IconsMuted]:b[PC.IconsPrimary]}),StyledZoomingWrapper=styled.div.withConfig({componentId:\"sc-21g986-4\"})([\"display:flex;align-items:center;gap:2px;\"]),StyledDimensionsLabel=styled(Label).withConfig({componentId:\"sc-21g986-5\"})([\"flex-shrink:0;color:\",\";\",\";\"],function(a){var b=a.theme.palette;return b[PC.TextPlaceholder]},function(a){var b=a.theme.typography;return b.font[FV.LabelMedium]}),StyledSmallButton=styled(IconButton).withConfig({componentId:\"sc-21g986-6\"})([\"padding:8px;svg{color:\",\";}\"],function(a){var b=a.theme.palette,c=a.showBackButton;return c?b[PC.IconsPrimary]:b[PC.IconsMuted]}),StyledFlexCenterAlignedContainer=styled.div.withConfig({componentId:\"sc-21g986-7\"})([\"width:\",\";height:32px;display:block;width:100%;order:4;\",\";@media (min-width:761px){display:flex;align-items:center;justify-content:center;width:fit-content;order:2;}\"],function(a){var b=a.showBackButton;return b?\"318px\":\"384px\"},function(a){var b=a.reverseDirection;return b?\"flex-direction: row-reverse\":\"\"}),StyledZoomPercentageLabel=styled(Label).withConfig({componentId:\"sc-21g986-8\"})([\"cursor:pointer;color:\",\";\",\";\"],function(a){var b=a.theme.palette;return b[PC.TextPrimary]},function(a){var b=a.theme.typography;return b.font[FV.InputMd]}),StyledBackButtonLabel=styled.span.withConfig({componentId:\"sc-21g986-9\"})([\"\",\";\"],function(a){var b=a.theme.typography;return b.font[FV.ButtonMdEmphasis]}),StyledCloseButton=styled(CrossButton).withConfig({componentId:\"sc-21g986-10\"})([\"padding:8px;z-index:111;\"]),StyledSaveButton=styled(Button).withConfig({componentId:\"sc-21g986-11\"})([\"padding:4px 12px;\"]),StyledFileNameInput=styled(InputGroup).withConfig({componentId:\"sc-21g986-12\"})([\"\"]),StyledFileExtensionSelect=styled(SelectGroup).withConfig({componentId:\"sc-21g986-13\"})([\"margin-top:16px;\"]),StyledQualityWrapper=styled.div.withConfig({componentId:\"sc-21g986-14\"})([\"width:100%;margin-top:16px;\"]),StyledResizeOnSave=styled.div.withConfig({componentId:\"sc-21g986-15\"})([\"margin-top:16px;width:100%;\"]),StyledResizeOnSaveLabel=styled(Label).withConfig({componentId:\"sc-21g986-16\"})([\"margin-bottom:4px;\"]),StyledHistoryButtons=styled.div.withConfig({componentId:\"sc-21g986-17\"})([\"display:flex;gap:6px;\"]),StyledImageOptionsButtons=styled.div.withConfig({componentId:\"sc-21g986-18\"})([\"display:flex;gap:12px;justify-content:\",\";\"],function(a){var b=a.isPhoneScreen;return b?\"space-between\":\"center\"}),StyledMenuIconButton=styled(IconButton).withConfig({componentId:\"sc-21g986-19\"})([\"@media (min-width:761px){display:none;}\"]),StyledDimensionsButtons=styled.div.withConfig({componentId:\"sc-21g986-20\"})([\"display:flex;gap:12px;align-items:center;\"]);export{StyledTopbar,StyledFlexCenterAlignedContainer,StyledHistoryButton,StyledZoomingWrapper,StyledSmallButton,StyledZoomPercentageLabel,StyledBackButtonLabel,StyledCloseButton,StyledSaveButton,StyledFileNameInput,StyledFileExtensionSelect,StyledQualityWrapper,StyledResizeOnSave,StyledDimensionsLabel,StyledMainButtonsWrapper,StyledControlButtonsWrapper,StyledHistoryButtons,StyledImageOptionsButtons,StyledMenuIconButton,StyledDimensionsButtons,StyledResizeOnSaveLabel};","import styled,{css}from\"styled-components\";import modalTitle from\"@scaleflex/ui/core/modal-title\";import{Modal,ModalActions}from\"@scaleflex/ui/core\";import{Color as PC}from\"@scaleflex/ui/utils/types/palette\";import{FontVariant as FV}from\"@scaleflex/ui/utils/types/typography\";var StyledModal=styled(Modal).withConfig({componentId:\"sc-kpjpf5-0\"})([\"width:\",\";max-width:unset;\"],function(a){var b=a.width;return b||\"300px\"}),StyledModalTitle=styled(modalTitle).withConfig({componentId:\"sc-kpjpf5-1\"})(function(a){var b=a.theme,c=a.isWarning;return css([\"padding-bottom:0;.SfxModalTitle-Icon{background-color:\",\";}.SfxModalTitle-LabelPrimary{margin-bottom:24px;\",\";}.SfxModalTitle-LabelSecondary{\",\";text-align:center;}\"],c&&b.palette[PC.Orange_0_1_Overlay],b.typography.font[FV.TitleH3],b.typography.font[FV.TextLarge])}),StyledModalActions=styled(ModalActions).withConfig({componentId:\"sc-kpjpf5-2\"})([\"gap:12px;padding:24px;.SfxButton-root{flex:1;margin:0;height:40px;}\"]);export{StyledModal,StyledModalTitle,StyledModalActions};","import React from\"react\";import{Button,ModalContent}from\"@scaleflex/ui/core\";import{StyledModal,StyledModalTitle,StyledModalActions}from\"./Modal.styled\";var Modal=function(a){var b=a.title,c=a.hint,d=a.Icon,f=a.onDone,g=a.onCancel,h=a.doneLabel,i=a.cancelLabel,j=a.isOpened,k=a.doneButtonStyle,l=a.doneButtonColor,m=void 0===l?\"basic\":l,n=a.cancelButtonColor,o=void 0===n?\"basic\":n,p=a.children,q=a.areButtonsDisabled,r=a.zIndex,s=a.className,t=a.width,u=a.isWarning;return React.createElement(StyledModal,{className:s,open:j,onClose:g,style:{zIndex:r},onKeyUp:function onKeyUp(a){\"Enter\"===a.key&&f(a)},width:t},React.createElement(StyledModalTitle,{icon:React.createElement(d,{size:25}),iconShadow:!0,isWarning:u,onClose:g,primary:b,secondary:c,variant:\"with-icon\"}),p&&React.createElement(ModalContent,null,p),React.createElement(StyledModalActions,{align:\"center\"},React.createElement(Button,{color:o,onClick:g,size:\"md\",disabled:q},i),React.createElement(Button,{color:m,onClick:f,size:\"md\",warning:u,style:k,disabled:q},h)))};Modal.defaultProps={hint:\"\",isOpened:!1,doneLabel:\"Yes\",cancelLabel:\"No\",doneButtonStyle:void 0,doneButtonColor:\"basic\",cancelButtonColor:\"basic\",children:void 0,areButtonsDisabled:!1,zIndex:void 0,className:void 0,width:\"\",isWarning:!1};export default Modal;","import _slicedToArray from\"@babel/runtime/helpers/slicedToArray\";import React,{useState,useCallback}from\"react\";import{Warning}from\"@scaleflex/icons\";import{useStore}from\"../../hooks\";import{RESET}from\"../../actions\";import Modal from\"../common/Modal\";import{CLOSING_REASONS}from\"../../utils/constants\";var ConfirmationModal=function(a){var b=a.children,c=a.isReset,d=useStore(),e=d.t,f=d.theme,g=d.config,h=d.dispatch,i=d.isResetted,j=d.haveNotSavedChanges,k=d.config.onClose,l=useState(!1),m=_slicedToArray(l,2),n=m[0],o=m[1];if(\"function\"!=typeof k&&!c)return React.createElement(\"span\",null);var p=function(){o(!1)},q=useCallback(function(){h({type:RESET,payload:{config:g}}),p()},[g]),r=function(){c||(k(CLOSING_REASONS.CLOSE_BUTTON,j),q())};return React.createElement(React.Fragment,null,React.cloneElement(b,{onClick:!(void 0!==i)||i?r:function openModal(){o(!0)}}),n&&React.createElement(Modal,{title:c?e(\"warning\"):e(\"discardChanges\"),hint:c?e(\"changesLoseWarningHint\"):e(\"discardChangesWarningHint\"),isOpened:n,onCancel:p,onDone:c?q:r,Icon:function WarningIcon(){return React.createElement(Warning,{color:f.palette.warning,size:25})},doneLabel:e(\"confirm\"),doneButtonColor:\"warning-primary\",cancelLabel:e(\"cancel\"),width:\"400px\",isWarning:!0}))};ConfirmationModal.defaultProps={isReset:!1};export default ConfirmationModal;","import React from\"react\";import CrossOutline from\"@scaleflex/icons/cross-outline\";import{useStore}from\"../../hooks\";import Separator from\"../common/Separator\";import{StyledCloseButton}from\"./Topbar.styled\";import ConfirmationModal from\"./ConfirmationModal\";var CloseButton=function(){var a=useStore(),b=a.config.onClose;return\"function\"==typeof b?React.createElement(React.Fragment,null,React.createElement(Separator,null),React.createElement(ConfirmationModal,null,React.createElement(StyledCloseButton,{className:\"FIE_topbar-close-button\",color:\"basic\",size:\"md\"},React.createElement(CrossOutline,null)))):null};export default CloseButton;","import{DEFAULT_SAVE_QUALITY}from\"./constants\";var getDefaultSaveQuality=function(a){return 0>=a||1 svg:not([color]){color:\",\"}:disabled,[aria-disabled=\\\"true\\\"]{cursor:not-allowed;}&::-webkit-scrollbar{width:4px;height:4px;}&::-webkit-scrollbar-track{background:rgba(203,211,218,0.35);}&::-webkit-scrollbar-thumb{background:rgba(203,211,218,1);border-radius:10px;}}\"],ROOT_CONTAINER_CLASS_NAME,ROOT_CONTAINER_CLASS_NAME,function(a){var b=a.theme;return b.palette[\"icons-primary\"]});export{FontsFaces,OverrideDefaultStyles};","import React,{useEffect,memo}from\"react\";import ThemeProvider from\"@scaleflex/ui/theme\";import App from\"../App\";import{AppProvider}from\"../../context\";import defaultConfig from\"../../context/defaultConfig\";import deepMerge from\"../../utils/deepMerge\";import assignFinetuneNamesToKonva from\"../../utils/assignFinetuneNamesToKonva\";import{FontsFaces,OverrideDefaultStyles}from\"./globalStyles\";var AssemblyPoint=function(a){var b=a.source,c=a.useCloudimage,d=a.cloudimage;if(!b||\"string\"!=typeof b&&!(b instanceof HTMLImageElement))throw new Error(\"`source` property is required either a string of image url or a HTMLImageElement for the image that will be edited.\");if(c){var e,f;if(null!==d&&void 0!==d&&null!==(e=d.imageSealing)&&void 0!==e&&e.enable&&!(null!==d&&void 0!==d&&null!==(f=d.imageSealing)&&void 0!==f&&f.salt))throw new Error(\"`salt` property of imageSealing object is required in cloudimage mode as long as `imageSealing` is enabled.\")}useEffect(function(){assignFinetuneNamesToKonva()},[]);var g=deepMerge(defaultConfig,a);return React.createElement(React.StrictMode,null,React.createElement(ThemeProvider,{theme:g.theme},React.createElement(FontsFaces,null),React.createElement(OverrideDefaultStyles,null),React.createElement(AppProvider,{config:g},React.createElement(App,null))))};AssemblyPoint.defaultProps={useCloudimage:!1,cloudimage:{}};export default memo(AssemblyPoint);","import _typeof from\"@babel/runtime/helpers/typeof\";import _classCallCheck from\"@babel/runtime/helpers/classCallCheck\";import _createClass from\"@babel/runtime/helpers/createClass\";import _defineProperty from\"@babel/runtime/helpers/defineProperty\";function ownKeys(a,b){var c=Object.keys(a);if(Object.getOwnPropertySymbols){var d=Object.getOwnPropertySymbols(a);b&&(d=d.filter(function(b){return Object.getOwnPropertyDescriptor(a,b).enumerable})),c.push.apply(c,d)}return c}function _objectSpread(a){for(var b,c=1;carguments.length?b:c;throw new TypeError(\"Private element is not present on this object\")}import{createElement}from\"react\";import{createRoot}from\"react-dom/client\";import AssemblyPoint,{TOOLS,TABS}from\"react-filerobot-image-editor\";import deepMerge from\"react-filerobot-image-editor/lib/utils/deepMerge\";var _root=new WeakMap,_getCurrentImgDataFnRef=new WeakMap,_updateStateFnRef=new WeakMap,FilerobotImageEditor=function(){function a(b){var c=1>>1,e=a[d];if(0>>1;dg(C,c))ng(x,C)?(a[d]=x,a[n]=c,d=n):(a[d]=C,a[m]=c,d=m);else if(ng(x,c))a[d]=x,a[n]=c,d=n;else break a}}return b}\nfunction g(a,b){var c=a.sortIndex-b.sortIndex;return 0!==c?c:a.id-b.id}if(\"object\"===typeof performance&&\"function\"===typeof performance.now){var l=performance;exports.unstable_now=function(){return l.now()}}else{var p=Date,q=p.now();exports.unstable_now=function(){return p.now()-q}}var r=[],t=[],u=1,v=null,y=3,z=!1,A=!1,B=!1,D=\"function\"===typeof setTimeout?setTimeout:null,E=\"function\"===typeof clearTimeout?clearTimeout:null,F=\"undefined\"!==typeof setImmediate?setImmediate:null;\n\"undefined\"!==typeof navigator&&void 0!==navigator.scheduling&&void 0!==navigator.scheduling.isInputPending&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function G(a){for(var b=h(t);null!==b;){if(null===b.callback)k(t);else if(b.startTime<=a)k(t),b.sortIndex=b.expirationTime,f(r,b);else break;b=h(t)}}function H(a){B=!1;G(a);if(!A)if(null!==h(r))A=!0,I(J);else{var b=h(t);null!==b&&K(H,b.startTime-a)}}\nfunction J(a,b){A=!1;B&&(B=!1,E(L),L=-1);z=!0;var c=y;try{G(b);for(v=h(r);null!==v&&(!(v.expirationTime>b)||a&&!M());){var d=v.callback;if(\"function\"===typeof d){v.callback=null;y=v.priorityLevel;var e=d(v.expirationTime<=b);b=exports.unstable_now();\"function\"===typeof e?v.callback=e:v===h(r)&&k(r);G(b)}else k(r);v=h(r)}if(null!==v)var w=!0;else{var m=h(t);null!==m&&K(H,m.startTime-b);w=!1}return w}finally{v=null,y=c,z=!1}}var N=!1,O=null,L=-1,P=5,Q=-1;\nfunction M(){return exports.unstable_now()-Qa||125d?(a.sortIndex=c,f(t,a),null===h(r)&&a===h(t)&&(B?(E(L),L=-1):B=!0,K(H,c-d))):(a.sortIndex=e,f(r,a),A||z||(A=!0,I(J)));return a};\nexports.unstable_shouldYield=M;exports.unstable_wrapCallback=function(a){var b=y;return function(){var c=y;y=b;try{return a.apply(this,arguments)}finally{y=c}}};\n","'use strict';\n\nif (process.env.NODE_ENV === 'production') {\n module.exports = require('./cjs/scheduler.production.min.js');\n} else {\n module.exports = require('./cjs/scheduler.development.js');\n}\n","/**\n * @license React\n * react-dom.production.min.js\n *\n * Copyright (c) Facebook, Inc. and its affiliates.\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 Modernizr 3.0.0pre (Custom Build) | MIT\n*/\n'use strict';var aa=require(\"react\"),ca=require(\"scheduler\");function p(a){for(var b=\"https://reactjs.org/docs/error-decoder.html?invariant=\"+a,c=1;cb}return!1}function v(a,b,c,d,e,f,g){this.acceptsBooleans=2===b||3===b||4===b;this.attributeName=d;this.attributeNamespace=e;this.mustUseProperty=c;this.propertyName=a;this.type=b;this.sanitizeURL=f;this.removeEmptyString=g}var z={};\n\"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style\".split(\" \").forEach(function(a){z[a]=new v(a,0,!1,a,null,!1,!1)});[[\"acceptCharset\",\"accept-charset\"],[\"className\",\"class\"],[\"htmlFor\",\"for\"],[\"httpEquiv\",\"http-equiv\"]].forEach(function(a){var b=a[0];z[b]=new v(b,1,!1,a[1],null,!1,!1)});[\"contentEditable\",\"draggable\",\"spellCheck\",\"value\"].forEach(function(a){z[a]=new v(a,2,!1,a.toLowerCase(),null,!1,!1)});\n[\"autoReverse\",\"externalResourcesRequired\",\"focusable\",\"preserveAlpha\"].forEach(function(a){z[a]=new v(a,2,!1,a,null,!1,!1)});\"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope\".split(\" \").forEach(function(a){z[a]=new v(a,3,!1,a.toLowerCase(),null,!1,!1)});\n[\"checked\",\"multiple\",\"muted\",\"selected\"].forEach(function(a){z[a]=new v(a,3,!0,a,null,!1,!1)});[\"capture\",\"download\"].forEach(function(a){z[a]=new v(a,4,!1,a,null,!1,!1)});[\"cols\",\"rows\",\"size\",\"span\"].forEach(function(a){z[a]=new v(a,6,!1,a,null,!1,!1)});[\"rowSpan\",\"start\"].forEach(function(a){z[a]=new v(a,5,!1,a.toLowerCase(),null,!1,!1)});var ra=/[\\-:]([a-z])/g;function sa(a){return a[1].toUpperCase()}\n\"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height\".split(\" \").forEach(function(a){var b=a.replace(ra,\nsa);z[b]=new v(b,1,!1,a,null,!1,!1)});\"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type\".split(\" \").forEach(function(a){var b=a.replace(ra,sa);z[b]=new v(b,1,!1,a,\"http://www.w3.org/1999/xlink\",!1,!1)});[\"xml:base\",\"xml:lang\",\"xml:space\"].forEach(function(a){var b=a.replace(ra,sa);z[b]=new v(b,1,!1,a,\"http://www.w3.org/XML/1998/namespace\",!1,!1)});[\"tabIndex\",\"crossOrigin\"].forEach(function(a){z[a]=new v(a,1,!1,a.toLowerCase(),null,!1,!1)});\nz.xlinkHref=new v(\"xlinkHref\",1,!1,\"xlink:href\",\"http://www.w3.org/1999/xlink\",!0,!1);[\"src\",\"href\",\"action\",\"formAction\"].forEach(function(a){z[a]=new v(a,1,!1,a.toLowerCase(),null,!0,!0)});\nfunction ta(a,b,c,d){var e=z.hasOwnProperty(b)?z[b]:null;if(null!==e?0!==e.type:d||!(2h||e[g]!==f[h]){var k=\"\\n\"+e[g].replace(\" at new \",\" at \");a.displayName&&k.includes(\"\")&&(k=k.replace(\"\",a.displayName));return k}while(1<=g&&0<=h)}break}}}finally{Na=!1,Error.prepareStackTrace=c}return(a=a?a.displayName||a.name:\"\")?Ma(a):\"\"}\nfunction Pa(a){switch(a.tag){case 5:return Ma(a.type);case 16:return Ma(\"Lazy\");case 13:return Ma(\"Suspense\");case 19:return Ma(\"SuspenseList\");case 0:case 2:case 15:return a=Oa(a.type,!1),a;case 11:return a=Oa(a.type.render,!1),a;case 1:return a=Oa(a.type,!0),a;default:return\"\"}}\nfunction Qa(a){if(null==a)return null;if(\"function\"===typeof a)return a.displayName||a.name||null;if(\"string\"===typeof a)return a;switch(a){case ya:return\"Fragment\";case wa:return\"Portal\";case Aa:return\"Profiler\";case za:return\"StrictMode\";case Ea:return\"Suspense\";case Fa:return\"SuspenseList\"}if(\"object\"===typeof a)switch(a.$$typeof){case Ca:return(a.displayName||\"Context\")+\".Consumer\";case Ba:return(a._context.displayName||\"Context\")+\".Provider\";case Da:var b=a.render;a=a.displayName;a||(a=b.displayName||\nb.name||\"\",a=\"\"!==a?\"ForwardRef(\"+a+\")\":\"ForwardRef\");return a;case Ga:return b=a.displayName||null,null!==b?b:Qa(a.type)||\"Memo\";case Ha:b=a._payload;a=a._init;try{return Qa(a(b))}catch(c){}}return null}\nfunction Ra(a){var b=a.type;switch(a.tag){case 24:return\"Cache\";case 9:return(b.displayName||\"Context\")+\".Consumer\";case 10:return(b._context.displayName||\"Context\")+\".Provider\";case 18:return\"DehydratedFragment\";case 11:return a=b.render,a=a.displayName||a.name||\"\",b.displayName||(\"\"!==a?\"ForwardRef(\"+a+\")\":\"ForwardRef\");case 7:return\"Fragment\";case 5:return b;case 4:return\"Portal\";case 3:return\"Root\";case 6:return\"Text\";case 16:return Qa(b);case 8:return b===za?\"StrictMode\":\"Mode\";case 22:return\"Offscreen\";\ncase 12:return\"Profiler\";case 21:return\"Scope\";case 13:return\"Suspense\";case 19:return\"SuspenseList\";case 25:return\"TracingMarker\";case 1:case 0:case 17:case 2:case 14:case 15:if(\"function\"===typeof b)return b.displayName||b.name||null;if(\"string\"===typeof b)return b}return null}function Sa(a){switch(typeof a){case \"boolean\":case \"number\":case \"string\":case \"undefined\":return a;case \"object\":return a;default:return\"\"}}\nfunction Ta(a){var b=a.type;return(a=a.nodeName)&&\"input\"===a.toLowerCase()&&(\"checkbox\"===b||\"radio\"===b)}\nfunction Ua(a){var b=Ta(a)?\"checked\":\"value\",c=Object.getOwnPropertyDescriptor(a.constructor.prototype,b),d=\"\"+a[b];if(!a.hasOwnProperty(b)&&\"undefined\"!==typeof c&&\"function\"===typeof c.get&&\"function\"===typeof c.set){var e=c.get,f=c.set;Object.defineProperty(a,b,{configurable:!0,get:function(){return e.call(this)},set:function(a){d=\"\"+a;f.call(this,a)}});Object.defineProperty(a,b,{enumerable:c.enumerable});return{getValue:function(){return d},setValue:function(a){d=\"\"+a},stopTracking:function(){a._valueTracker=\nnull;delete a[b]}}}}function Va(a){a._valueTracker||(a._valueTracker=Ua(a))}function Wa(a){if(!a)return!1;var b=a._valueTracker;if(!b)return!0;var c=b.getValue();var d=\"\";a&&(d=Ta(a)?a.checked?\"true\":\"false\":a.value);a=d;return a!==c?(b.setValue(a),!0):!1}function Xa(a){a=a||(\"undefined\"!==typeof document?document:void 0);if(\"undefined\"===typeof a)return null;try{return a.activeElement||a.body}catch(b){return a.body}}\nfunction Ya(a,b){var c=b.checked;return A({},b,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:null!=c?c:a._wrapperState.initialChecked})}function Za(a,b){var c=null==b.defaultValue?\"\":b.defaultValue,d=null!=b.checked?b.checked:b.defaultChecked;c=Sa(null!=b.value?b.value:c);a._wrapperState={initialChecked:d,initialValue:c,controlled:\"checkbox\"===b.type||\"radio\"===b.type?null!=b.checked:null!=b.value}}function ab(a,b){b=b.checked;null!=b&&ta(a,\"checked\",b,!1)}\nfunction bb(a,b){ab(a,b);var c=Sa(b.value),d=b.type;if(null!=c)if(\"number\"===d){if(0===c&&\"\"===a.value||a.value!=c)a.value=\"\"+c}else a.value!==\"\"+c&&(a.value=\"\"+c);else if(\"submit\"===d||\"reset\"===d){a.removeAttribute(\"value\");return}b.hasOwnProperty(\"value\")?cb(a,b.type,c):b.hasOwnProperty(\"defaultValue\")&&cb(a,b.type,Sa(b.defaultValue));null==b.checked&&null!=b.defaultChecked&&(a.defaultChecked=!!b.defaultChecked)}\nfunction db(a,b,c){if(b.hasOwnProperty(\"value\")||b.hasOwnProperty(\"defaultValue\")){var d=b.type;if(!(\"submit\"!==d&&\"reset\"!==d||void 0!==b.value&&null!==b.value))return;b=\"\"+a._wrapperState.initialValue;c||b===a.value||(a.value=b);a.defaultValue=b}c=a.name;\"\"!==c&&(a.name=\"\");a.defaultChecked=!!a._wrapperState.initialChecked;\"\"!==c&&(a.name=c)}\nfunction cb(a,b,c){if(\"number\"!==b||Xa(a.ownerDocument)!==a)null==c?a.defaultValue=\"\"+a._wrapperState.initialValue:a.defaultValue!==\"\"+c&&(a.defaultValue=\"\"+c)}var eb=Array.isArray;\nfunction fb(a,b,c,d){a=a.options;if(b){b={};for(var e=0;e\"+b.valueOf().toString()+\"\";for(b=mb.firstChild;a.firstChild;)a.removeChild(a.firstChild);for(;b.firstChild;)a.appendChild(b.firstChild)}});\nfunction ob(a,b){if(b){var c=a.firstChild;if(c&&c===a.lastChild&&3===c.nodeType){c.nodeValue=b;return}}a.textContent=b}\nvar pb={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,\nzoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},qb=[\"Webkit\",\"ms\",\"Moz\",\"O\"];Object.keys(pb).forEach(function(a){qb.forEach(function(b){b=b+a.charAt(0).toUpperCase()+a.substring(1);pb[b]=pb[a]})});function rb(a,b,c){return null==b||\"boolean\"===typeof b||\"\"===b?\"\":c||\"number\"!==typeof b||0===b||pb.hasOwnProperty(a)&&pb[a]?(\"\"+b).trim():b+\"px\"}\nfunction sb(a,b){a=a.style;for(var c in b)if(b.hasOwnProperty(c)){var d=0===c.indexOf(\"--\"),e=rb(c,b[c],d);\"float\"===c&&(c=\"cssFloat\");d?a.setProperty(c,e):a[c]=e}}var tb=A({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});\nfunction ub(a,b){if(b){if(tb[a]&&(null!=b.children||null!=b.dangerouslySetInnerHTML))throw Error(p(137,a));if(null!=b.dangerouslySetInnerHTML){if(null!=b.children)throw Error(p(60));if(\"object\"!==typeof b.dangerouslySetInnerHTML||!(\"__html\"in b.dangerouslySetInnerHTML))throw Error(p(61));}if(null!=b.style&&\"object\"!==typeof b.style)throw Error(p(62));}}\nfunction vb(a,b){if(-1===a.indexOf(\"-\"))return\"string\"===typeof b.is;switch(a){case \"annotation-xml\":case \"color-profile\":case \"font-face\":case \"font-face-src\":case \"font-face-uri\":case \"font-face-format\":case \"font-face-name\":case \"missing-glyph\":return!1;default:return!0}}var wb=null;function xb(a){a=a.target||a.srcElement||window;a.correspondingUseElement&&(a=a.correspondingUseElement);return 3===a.nodeType?a.parentNode:a}var yb=null,zb=null,Ab=null;\nfunction Bb(a){if(a=Cb(a)){if(\"function\"!==typeof yb)throw Error(p(280));var b=a.stateNode;b&&(b=Db(b),yb(a.stateNode,a.type,b))}}function Eb(a){zb?Ab?Ab.push(a):Ab=[a]:zb=a}function Fb(){if(zb){var a=zb,b=Ab;Ab=zb=null;Bb(a);if(b)for(a=0;a>>=0;return 0===a?32:31-(pc(a)/qc|0)|0}var rc=64,sc=4194304;\nfunction tc(a){switch(a&-a){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return a&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return a&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;\ndefault:return a}}function uc(a,b){var c=a.pendingLanes;if(0===c)return 0;var d=0,e=a.suspendedLanes,f=a.pingedLanes,g=c&268435455;if(0!==g){var h=g&~e;0!==h?d=tc(h):(f&=g,0!==f&&(d=tc(f)))}else g=c&~e,0!==g?d=tc(g):0!==f&&(d=tc(f));if(0===d)return 0;if(0!==b&&b!==d&&0===(b&e)&&(e=d&-d,f=b&-b,e>=f||16===e&&0!==(f&4194240)))return b;0!==(d&4)&&(d|=c&16);b=a.entangledLanes;if(0!==b)for(a=a.entanglements,b&=d;0c;c++)b.push(a);return b}\nfunction Ac(a,b,c){a.pendingLanes|=b;536870912!==b&&(a.suspendedLanes=0,a.pingedLanes=0);a=a.eventTimes;b=31-oc(b);a[b]=c}function Bc(a,b){var c=a.pendingLanes&~b;a.pendingLanes=b;a.suspendedLanes=0;a.pingedLanes=0;a.expiredLanes&=b;a.mutableReadLanes&=b;a.entangledLanes&=b;b=a.entanglements;var d=a.eventTimes;for(a=a.expirationTimes;0=be),ee=String.fromCharCode(32),fe=!1;\nfunction ge(a,b){switch(a){case \"keyup\":return-1!==$d.indexOf(b.keyCode);case \"keydown\":return 229!==b.keyCode;case \"keypress\":case \"mousedown\":case \"focusout\":return!0;default:return!1}}function he(a){a=a.detail;return\"object\"===typeof a&&\"data\"in a?a.data:null}var ie=!1;function je(a,b){switch(a){case \"compositionend\":return he(b);case \"keypress\":if(32!==b.which)return null;fe=!0;return ee;case \"textInput\":return a=b.data,a===ee&&fe?null:a;default:return null}}\nfunction ke(a,b){if(ie)return\"compositionend\"===a||!ae&&ge(a,b)?(a=nd(),md=ld=kd=null,ie=!1,a):null;switch(a){case \"paste\":return null;case \"keypress\":if(!(b.ctrlKey||b.altKey||b.metaKey)||b.ctrlKey&&b.altKey){if(b.char&&1=b)return{node:c,offset:b-a};a=d}a:{for(;c;){if(c.nextSibling){c=c.nextSibling;break a}c=c.parentNode}c=void 0}c=Je(c)}}function Le(a,b){return a&&b?a===b?!0:a&&3===a.nodeType?!1:b&&3===b.nodeType?Le(a,b.parentNode):\"contains\"in a?a.contains(b):a.compareDocumentPosition?!!(a.compareDocumentPosition(b)&16):!1:!1}\nfunction Me(){for(var a=window,b=Xa();b instanceof a.HTMLIFrameElement;){try{var c=\"string\"===typeof b.contentWindow.location.href}catch(d){c=!1}if(c)a=b.contentWindow;else break;b=Xa(a.document)}return b}function Ne(a){var b=a&&a.nodeName&&a.nodeName.toLowerCase();return b&&(\"input\"===b&&(\"text\"===a.type||\"search\"===a.type||\"tel\"===a.type||\"url\"===a.type||\"password\"===a.type)||\"textarea\"===b||\"true\"===a.contentEditable)}\nfunction Oe(a){var b=Me(),c=a.focusedElem,d=a.selectionRange;if(b!==c&&c&&c.ownerDocument&&Le(c.ownerDocument.documentElement,c)){if(null!==d&&Ne(c))if(b=d.start,a=d.end,void 0===a&&(a=b),\"selectionStart\"in c)c.selectionStart=b,c.selectionEnd=Math.min(a,c.value.length);else if(a=(b=c.ownerDocument||document)&&b.defaultView||window,a.getSelection){a=a.getSelection();var e=c.textContent.length,f=Math.min(d.start,e);d=void 0===d.end?f:Math.min(d.end,e);!a.extend&&f>d&&(e=d,d=f,f=e);e=Ke(c,f);var g=Ke(c,\nd);e&&g&&(1!==a.rangeCount||a.anchorNode!==e.node||a.anchorOffset!==e.offset||a.focusNode!==g.node||a.focusOffset!==g.offset)&&(b=b.createRange(),b.setStart(e.node,e.offset),a.removeAllRanges(),f>d?(a.addRange(b),a.extend(g.node,g.offset)):(b.setEnd(g.node,g.offset),a.addRange(b)))}b=[];for(a=c;a=a.parentNode;)1===a.nodeType&&b.push({element:a,left:a.scrollLeft,top:a.scrollTop});\"function\"===typeof c.focus&&c.focus();for(c=0;c=document.documentMode,Qe=null,Re=null,Se=null,Te=!1;\nfunction Ue(a,b,c){var d=c.window===c?c.document:9===c.nodeType?c:c.ownerDocument;Te||null==Qe||Qe!==Xa(d)||(d=Qe,\"selectionStart\"in d&&Ne(d)?d={start:d.selectionStart,end:d.selectionEnd}:(d=(d.ownerDocument&&d.ownerDocument.defaultView||window).getSelection(),d={anchorNode:d.anchorNode,anchorOffset:d.anchorOffset,focusNode:d.focusNode,focusOffset:d.focusOffset}),Se&&Ie(Se,d)||(Se=d,d=oe(Re,\"onSelect\"),0Tf||(a.current=Sf[Tf],Sf[Tf]=null,Tf--)}function G(a,b){Tf++;Sf[Tf]=a.current;a.current=b}var Vf={},H=Uf(Vf),Wf=Uf(!1),Xf=Vf;function Yf(a,b){var c=a.type.contextTypes;if(!c)return Vf;var d=a.stateNode;if(d&&d.__reactInternalMemoizedUnmaskedChildContext===b)return d.__reactInternalMemoizedMaskedChildContext;var e={},f;for(f in c)e[f]=b[f];d&&(a=a.stateNode,a.__reactInternalMemoizedUnmaskedChildContext=b,a.__reactInternalMemoizedMaskedChildContext=e);return e}\nfunction Zf(a){a=a.childContextTypes;return null!==a&&void 0!==a}function $f(){E(Wf);E(H)}function ag(a,b,c){if(H.current!==Vf)throw Error(p(168));G(H,b);G(Wf,c)}function bg(a,b,c){var d=a.stateNode;b=b.childContextTypes;if(\"function\"!==typeof d.getChildContext)return c;d=d.getChildContext();for(var e in d)if(!(e in b))throw Error(p(108,Ra(a)||\"Unknown\",e));return A({},c,d)}\nfunction cg(a){a=(a=a.stateNode)&&a.__reactInternalMemoizedMergedChildContext||Vf;Xf=H.current;G(H,a);G(Wf,Wf.current);return!0}function dg(a,b,c){var d=a.stateNode;if(!d)throw Error(p(169));c?(a=bg(a,b,Xf),d.__reactInternalMemoizedMergedChildContext=a,E(Wf),E(H),G(H,a)):E(Wf);G(Wf,c)}var eg=null,fg=!1,gg=!1;function hg(a){null===eg?eg=[a]:eg.push(a)}function ig(a){fg=!0;hg(a)}\nfunction jg(){if(!gg&&null!==eg){gg=!0;var a=0,b=C;try{var c=eg;for(C=1;a>=g;e-=g;rg=1<<32-oc(b)+e|c<w?(x=u,u=null):x=u.sibling;var n=r(e,u,h[w],k);if(null===n){null===u&&(u=x);break}a&&u&&null===n.alternate&&b(e,u);g=f(n,g,w);null===m?l=n:m.sibling=n;m=n;u=x}if(w===h.length)return c(e,u),I&&tg(e,w),l;if(null===u){for(;ww?(x=m,m=null):x=m.sibling;var t=r(e,m,n.value,k);if(null===t){null===m&&(m=x);break}a&&m&&null===t.alternate&&b(e,m);g=f(t,g,w);null===u?l=t:u.sibling=t;u=t;m=x}if(n.done)return c(e,\nm),I&&tg(e,w),l;if(null===m){for(;!n.done;w++,n=h.next())n=q(e,n.value,k),null!==n&&(g=f(n,g,w),null===u?l=n:u.sibling=n,u=n);I&&tg(e,w);return l}for(m=d(e,m);!n.done;w++,n=h.next())n=y(m,e,w,n.value,k),null!==n&&(a&&null!==n.alternate&&m.delete(null===n.key?w:n.key),g=f(n,g,w),null===u?l=n:u.sibling=n,u=n);a&&m.forEach(function(a){return b(e,a)});I&&tg(e,w);return l}function J(a,d,f,h){\"object\"===typeof f&&null!==f&&f.type===ya&&null===f.key&&(f=f.props.children);if(\"object\"===typeof f&&null!==f){switch(f.$$typeof){case va:a:{for(var k=\nf.key,l=d;null!==l;){if(l.key===k){k=f.type;if(k===ya){if(7===l.tag){c(a,l.sibling);d=e(l,f.props.children);d.return=a;a=d;break a}}else if(l.elementType===k||\"object\"===typeof k&&null!==k&&k.$$typeof===Ha&&Ng(k)===l.type){c(a,l.sibling);d=e(l,f.props);d.ref=Lg(a,l,f);d.return=a;a=d;break a}c(a,l);break}else b(a,l);l=l.sibling}f.type===ya?(d=Tg(f.props.children,a.mode,h,f.key),d.return=a,a=d):(h=Rg(f.type,f.key,f.props,null,a.mode,h),h.ref=Lg(a,d,f),h.return=a,a=h)}return g(a);case wa:a:{for(l=f.key;null!==\nd;){if(d.key===l)if(4===d.tag&&d.stateNode.containerInfo===f.containerInfo&&d.stateNode.implementation===f.implementation){c(a,d.sibling);d=e(d,f.children||[]);d.return=a;a=d;break a}else{c(a,d);break}else b(a,d);d=d.sibling}d=Sg(f,a.mode,h);d.return=a;a=d}return g(a);case Ha:return l=f._init,J(a,d,l(f._payload),h)}if(eb(f))return n(a,d,f,h);if(Ka(f))return t(a,d,f,h);Mg(a,f)}return\"string\"===typeof f&&\"\"!==f||\"number\"===typeof f?(f=\"\"+f,null!==d&&6===d.tag?(c(a,d.sibling),d=e(d,f),d.return=a,a=d):\n(c(a,d),d=Qg(f,a.mode,h),d.return=a,a=d),g(a)):c(a,d)}return J}var Ug=Og(!0),Vg=Og(!1),Wg=Uf(null),Xg=null,Yg=null,Zg=null;function $g(){Zg=Yg=Xg=null}function ah(a){var b=Wg.current;E(Wg);a._currentValue=b}function bh(a,b,c){for(;null!==a;){var d=a.alternate;(a.childLanes&b)!==b?(a.childLanes|=b,null!==d&&(d.childLanes|=b)):null!==d&&(d.childLanes&b)!==b&&(d.childLanes|=b);if(a===c)break;a=a.return}}\nfunction ch(a,b){Xg=a;Zg=Yg=null;a=a.dependencies;null!==a&&null!==a.firstContext&&(0!==(a.lanes&b)&&(dh=!0),a.firstContext=null)}function eh(a){var b=a._currentValue;if(Zg!==a)if(a={context:a,memoizedValue:b,next:null},null===Yg){if(null===Xg)throw Error(p(308));Yg=a;Xg.dependencies={lanes:0,firstContext:a}}else Yg=Yg.next=a;return b}var fh=null;function gh(a){null===fh?fh=[a]:fh.push(a)}\nfunction hh(a,b,c,d){var e=b.interleaved;null===e?(c.next=c,gh(b)):(c.next=e.next,e.next=c);b.interleaved=c;return ih(a,d)}function ih(a,b){a.lanes|=b;var c=a.alternate;null!==c&&(c.lanes|=b);c=a;for(a=a.return;null!==a;)a.childLanes|=b,c=a.alternate,null!==c&&(c.childLanes|=b),c=a,a=a.return;return 3===c.tag?c.stateNode:null}var jh=!1;function kh(a){a.updateQueue={baseState:a.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}\nfunction lh(a,b){a=a.updateQueue;b.updateQueue===a&&(b.updateQueue={baseState:a.baseState,firstBaseUpdate:a.firstBaseUpdate,lastBaseUpdate:a.lastBaseUpdate,shared:a.shared,effects:a.effects})}function mh(a,b){return{eventTime:a,lane:b,tag:0,payload:null,callback:null,next:null}}\nfunction nh(a,b,c){var d=a.updateQueue;if(null===d)return null;d=d.shared;if(0!==(K&2)){var e=d.pending;null===e?b.next=b:(b.next=e.next,e.next=b);d.pending=b;return ih(a,c)}e=d.interleaved;null===e?(b.next=b,gh(d)):(b.next=e.next,e.next=b);d.interleaved=b;return ih(a,c)}function oh(a,b,c){b=b.updateQueue;if(null!==b&&(b=b.shared,0!==(c&4194240))){var d=b.lanes;d&=a.pendingLanes;c|=d;b.lanes=c;Cc(a,c)}}\nfunction ph(a,b){var c=a.updateQueue,d=a.alternate;if(null!==d&&(d=d.updateQueue,c===d)){var e=null,f=null;c=c.firstBaseUpdate;if(null!==c){do{var g={eventTime:c.eventTime,lane:c.lane,tag:c.tag,payload:c.payload,callback:c.callback,next:null};null===f?e=f=g:f=f.next=g;c=c.next}while(null!==c);null===f?e=f=b:f=f.next=b}else e=f=b;c={baseState:d.baseState,firstBaseUpdate:e,lastBaseUpdate:f,shared:d.shared,effects:d.effects};a.updateQueue=c;return}a=c.lastBaseUpdate;null===a?c.firstBaseUpdate=b:a.next=\nb;c.lastBaseUpdate=b}\nfunction qh(a,b,c,d){var e=a.updateQueue;jh=!1;var f=e.firstBaseUpdate,g=e.lastBaseUpdate,h=e.shared.pending;if(null!==h){e.shared.pending=null;var k=h,l=k.next;k.next=null;null===g?f=l:g.next=l;g=k;var m=a.alternate;null!==m&&(m=m.updateQueue,h=m.lastBaseUpdate,h!==g&&(null===h?m.firstBaseUpdate=l:h.next=l,m.lastBaseUpdate=k))}if(null!==f){var q=e.baseState;g=0;m=l=k=null;h=f;do{var r=h.lane,y=h.eventTime;if((d&r)===r){null!==m&&(m=m.next={eventTime:y,lane:0,tag:h.tag,payload:h.payload,callback:h.callback,\nnext:null});a:{var n=a,t=h;r=b;y=c;switch(t.tag){case 1:n=t.payload;if(\"function\"===typeof n){q=n.call(y,q,r);break a}q=n;break a;case 3:n.flags=n.flags&-65537|128;case 0:n=t.payload;r=\"function\"===typeof n?n.call(y,q,r):n;if(null===r||void 0===r)break a;q=A({},q,r);break a;case 2:jh=!0}}null!==h.callback&&0!==h.lane&&(a.flags|=64,r=e.effects,null===r?e.effects=[h]:r.push(h))}else y={eventTime:y,lane:r,tag:h.tag,payload:h.payload,callback:h.callback,next:null},null===m?(l=m=y,k=q):m=m.next=y,g|=r;\nh=h.next;if(null===h)if(h=e.shared.pending,null===h)break;else r=h,h=r.next,r.next=null,e.lastBaseUpdate=r,e.shared.pending=null}while(1);null===m&&(k=q);e.baseState=k;e.firstBaseUpdate=l;e.lastBaseUpdate=m;b=e.shared.interleaved;if(null!==b){e=b;do g|=e.lane,e=e.next;while(e!==b)}else null===f&&(e.shared.lanes=0);rh|=g;a.lanes=g;a.memoizedState=q}}\nfunction sh(a,b,c){a=b.effects;b.effects=null;if(null!==a)for(b=0;bc?c:4;a(!0);var d=Gh.transition;Gh.transition={};try{a(!1),b()}finally{C=c,Gh.transition=d}}function wi(){return Uh().memoizedState}\nfunction xi(a,b,c){var d=yi(a);c={lane:d,action:c,hasEagerState:!1,eagerState:null,next:null};if(zi(a))Ai(b,c);else if(c=hh(a,b,c,d),null!==c){var e=R();gi(c,a,d,e);Bi(c,b,d)}}\nfunction ii(a,b,c){var d=yi(a),e={lane:d,action:c,hasEagerState:!1,eagerState:null,next:null};if(zi(a))Ai(b,e);else{var f=a.alternate;if(0===a.lanes&&(null===f||0===f.lanes)&&(f=b.lastRenderedReducer,null!==f))try{var g=b.lastRenderedState,h=f(g,c);e.hasEagerState=!0;e.eagerState=h;if(He(h,g)){var k=b.interleaved;null===k?(e.next=e,gh(b)):(e.next=k.next,k.next=e);b.interleaved=e;return}}catch(l){}finally{}c=hh(a,b,e,d);null!==c&&(e=R(),gi(c,a,d,e),Bi(c,b,d))}}\nfunction zi(a){var b=a.alternate;return a===M||null!==b&&b===M}function Ai(a,b){Jh=Ih=!0;var c=a.pending;null===c?b.next=b:(b.next=c.next,c.next=b);a.pending=b}function Bi(a,b,c){if(0!==(c&4194240)){var d=b.lanes;d&=a.pendingLanes;c|=d;b.lanes=c;Cc(a,c)}}\nvar Rh={readContext:eh,useCallback:P,useContext:P,useEffect:P,useImperativeHandle:P,useInsertionEffect:P,useLayoutEffect:P,useMemo:P,useReducer:P,useRef:P,useState:P,useDebugValue:P,useDeferredValue:P,useTransition:P,useMutableSource:P,useSyncExternalStore:P,useId:P,unstable_isNewReconciler:!1},Oh={readContext:eh,useCallback:function(a,b){Th().memoizedState=[a,void 0===b?null:b];return a},useContext:eh,useEffect:mi,useImperativeHandle:function(a,b,c){c=null!==c&&void 0!==c?c.concat([a]):null;return ki(4194308,\n4,pi.bind(null,b,a),c)},useLayoutEffect:function(a,b){return ki(4194308,4,a,b)},useInsertionEffect:function(a,b){return ki(4,2,a,b)},useMemo:function(a,b){var c=Th();b=void 0===b?null:b;a=a();c.memoizedState=[a,b];return a},useReducer:function(a,b,c){var d=Th();b=void 0!==c?c(b):b;d.memoizedState=d.baseState=b;a={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:a,lastRenderedState:b};d.queue=a;a=a.dispatch=xi.bind(null,M,a);return[d.memoizedState,a]},useRef:function(a){var b=\nTh();a={current:a};return b.memoizedState=a},useState:hi,useDebugValue:ri,useDeferredValue:function(a){return Th().memoizedState=a},useTransition:function(){var a=hi(!1),b=a[0];a=vi.bind(null,a[1]);Th().memoizedState=a;return[b,a]},useMutableSource:function(){},useSyncExternalStore:function(a,b,c){var d=M,e=Th();if(I){if(void 0===c)throw Error(p(407));c=c()}else{c=b();if(null===Q)throw Error(p(349));0!==(Hh&30)||di(d,b,c)}e.memoizedState=c;var f={value:c,getSnapshot:b};e.queue=f;mi(ai.bind(null,d,\nf,a),[a]);d.flags|=2048;bi(9,ci.bind(null,d,f,c,b),void 0,null);return c},useId:function(){var a=Th(),b=Q.identifierPrefix;if(I){var c=sg;var d=rg;c=(d&~(1<<32-oc(d)-1)).toString(32)+c;b=\":\"+b+\"R\"+c;c=Kh++;0\\x3c/script>\",a=a.removeChild(a.firstChild)):\n\"string\"===typeof d.is?a=g.createElement(c,{is:d.is}):(a=g.createElement(c),\"select\"===c&&(g=a,d.multiple?g.multiple=!0:d.size&&(g.size=d.size))):a=g.createElementNS(a,c);a[Of]=b;a[Pf]=d;zj(a,b,!1,!1);b.stateNode=a;a:{g=vb(c,d);switch(c){case \"dialog\":D(\"cancel\",a);D(\"close\",a);e=d;break;case \"iframe\":case \"object\":case \"embed\":D(\"load\",a);e=d;break;case \"video\":case \"audio\":for(e=0;eGj&&(b.flags|=128,d=!0,Dj(f,!1),b.lanes=4194304)}else{if(!d)if(a=Ch(g),null!==a){if(b.flags|=128,d=!0,c=a.updateQueue,null!==c&&(b.updateQueue=c,b.flags|=4),Dj(f,!0),null===f.tail&&\"hidden\"===f.tailMode&&!g.alternate&&!I)return S(b),null}else 2*B()-f.renderingStartTime>Gj&&1073741824!==c&&(b.flags|=128,d=!0,Dj(f,!1),b.lanes=4194304);f.isBackwards?(g.sibling=b.child,b.child=g):(c=f.last,null!==c?c.sibling=g:b.child=g,f.last=g)}if(null!==f.tail)return b=f.tail,f.rendering=\nb,f.tail=b.sibling,f.renderingStartTime=B(),b.sibling=null,c=L.current,G(L,d?c&1|2:c&1),b;S(b);return null;case 22:case 23:return Hj(),d=null!==b.memoizedState,null!==a&&null!==a.memoizedState!==d&&(b.flags|=8192),d&&0!==(b.mode&1)?0!==(fj&1073741824)&&(S(b),b.subtreeFlags&6&&(b.flags|=8192)):S(b),null;case 24:return null;case 25:return null}throw Error(p(156,b.tag));}\nfunction Ij(a,b){wg(b);switch(b.tag){case 1:return Zf(b.type)&&$f(),a=b.flags,a&65536?(b.flags=a&-65537|128,b):null;case 3:return zh(),E(Wf),E(H),Eh(),a=b.flags,0!==(a&65536)&&0===(a&128)?(b.flags=a&-65537|128,b):null;case 5:return Bh(b),null;case 13:E(L);a=b.memoizedState;if(null!==a&&null!==a.dehydrated){if(null===b.alternate)throw Error(p(340));Ig()}a=b.flags;return a&65536?(b.flags=a&-65537|128,b):null;case 19:return E(L),null;case 4:return zh(),null;case 10:return ah(b.type._context),null;case 22:case 23:return Hj(),\nnull;case 24:return null;default:return null}}var Jj=!1,U=!1,Kj=\"function\"===typeof WeakSet?WeakSet:Set,V=null;function Lj(a,b){var c=a.ref;if(null!==c)if(\"function\"===typeof c)try{c(null)}catch(d){W(a,b,d)}else c.current=null}function Mj(a,b,c){try{c()}catch(d){W(a,b,d)}}var Nj=!1;\nfunction Oj(a,b){Cf=dd;a=Me();if(Ne(a)){if(\"selectionStart\"in a)var c={start:a.selectionStart,end:a.selectionEnd};else a:{c=(c=a.ownerDocument)&&c.defaultView||window;var d=c.getSelection&&c.getSelection();if(d&&0!==d.rangeCount){c=d.anchorNode;var e=d.anchorOffset,f=d.focusNode;d=d.focusOffset;try{c.nodeType,f.nodeType}catch(F){c=null;break a}var g=0,h=-1,k=-1,l=0,m=0,q=a,r=null;b:for(;;){for(var y;;){q!==c||0!==e&&3!==q.nodeType||(h=g+e);q!==f||0!==d&&3!==q.nodeType||(k=g+d);3===q.nodeType&&(g+=\nq.nodeValue.length);if(null===(y=q.firstChild))break;r=q;q=y}for(;;){if(q===a)break b;r===c&&++l===e&&(h=g);r===f&&++m===d&&(k=g);if(null!==(y=q.nextSibling))break;q=r;r=q.parentNode}q=y}c=-1===h||-1===k?null:{start:h,end:k}}else c=null}c=c||{start:0,end:0}}else c=null;Df={focusedElem:a,selectionRange:c};dd=!1;for(V=b;null!==V;)if(b=V,a=b.child,0!==(b.subtreeFlags&1028)&&null!==a)a.return=b,V=a;else for(;null!==V;){b=V;try{var n=b.alternate;if(0!==(b.flags&1024))switch(b.tag){case 0:case 11:case 15:break;\ncase 1:if(null!==n){var t=n.memoizedProps,J=n.memoizedState,x=b.stateNode,w=x.getSnapshotBeforeUpdate(b.elementType===b.type?t:Ci(b.type,t),J);x.__reactInternalSnapshotBeforeUpdate=w}break;case 3:var u=b.stateNode.containerInfo;1===u.nodeType?u.textContent=\"\":9===u.nodeType&&u.documentElement&&u.removeChild(u.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(p(163));}}catch(F){W(b,b.return,F)}a=b.sibling;if(null!==a){a.return=b.return;V=a;break}V=b.return}n=Nj;Nj=!1;return n}\nfunction Pj(a,b,c){var d=b.updateQueue;d=null!==d?d.lastEffect:null;if(null!==d){var e=d=d.next;do{if((e.tag&a)===a){var f=e.destroy;e.destroy=void 0;void 0!==f&&Mj(b,c,f)}e=e.next}while(e!==d)}}function Qj(a,b){b=b.updateQueue;b=null!==b?b.lastEffect:null;if(null!==b){var c=b=b.next;do{if((c.tag&a)===a){var d=c.create;c.destroy=d()}c=c.next}while(c!==b)}}function Rj(a){var b=a.ref;if(null!==b){var c=a.stateNode;switch(a.tag){case 5:a=c;break;default:a=c}\"function\"===typeof b?b(a):b.current=a}}\nfunction Sj(a){var b=a.alternate;null!==b&&(a.alternate=null,Sj(b));a.child=null;a.deletions=null;a.sibling=null;5===a.tag&&(b=a.stateNode,null!==b&&(delete b[Of],delete b[Pf],delete b[of],delete b[Qf],delete b[Rf]));a.stateNode=null;a.return=null;a.dependencies=null;a.memoizedProps=null;a.memoizedState=null;a.pendingProps=null;a.stateNode=null;a.updateQueue=null}function Tj(a){return 5===a.tag||3===a.tag||4===a.tag}\nfunction Uj(a){a:for(;;){for(;null===a.sibling;){if(null===a.return||Tj(a.return))return null;a=a.return}a.sibling.return=a.return;for(a=a.sibling;5!==a.tag&&6!==a.tag&&18!==a.tag;){if(a.flags&2)continue a;if(null===a.child||4===a.tag)continue a;else a.child.return=a,a=a.child}if(!(a.flags&2))return a.stateNode}}\nfunction Vj(a,b,c){var d=a.tag;if(5===d||6===d)a=a.stateNode,b?8===c.nodeType?c.parentNode.insertBefore(a,b):c.insertBefore(a,b):(8===c.nodeType?(b=c.parentNode,b.insertBefore(a,c)):(b=c,b.appendChild(a)),c=c._reactRootContainer,null!==c&&void 0!==c||null!==b.onclick||(b.onclick=Bf));else if(4!==d&&(a=a.child,null!==a))for(Vj(a,b,c),a=a.sibling;null!==a;)Vj(a,b,c),a=a.sibling}\nfunction Wj(a,b,c){var d=a.tag;if(5===d||6===d)a=a.stateNode,b?c.insertBefore(a,b):c.appendChild(a);else if(4!==d&&(a=a.child,null!==a))for(Wj(a,b,c),a=a.sibling;null!==a;)Wj(a,b,c),a=a.sibling}var X=null,Xj=!1;function Yj(a,b,c){for(c=c.child;null!==c;)Zj(a,b,c),c=c.sibling}\nfunction Zj(a,b,c){if(lc&&\"function\"===typeof lc.onCommitFiberUnmount)try{lc.onCommitFiberUnmount(kc,c)}catch(h){}switch(c.tag){case 5:U||Lj(c,b);case 6:var d=X,e=Xj;X=null;Yj(a,b,c);X=d;Xj=e;null!==X&&(Xj?(a=X,c=c.stateNode,8===a.nodeType?a.parentNode.removeChild(c):a.removeChild(c)):X.removeChild(c.stateNode));break;case 18:null!==X&&(Xj?(a=X,c=c.stateNode,8===a.nodeType?Kf(a.parentNode,c):1===a.nodeType&&Kf(a,c),bd(a)):Kf(X,c.stateNode));break;case 4:d=X;e=Xj;X=c.stateNode.containerInfo;Xj=!0;\nYj(a,b,c);X=d;Xj=e;break;case 0:case 11:case 14:case 15:if(!U&&(d=c.updateQueue,null!==d&&(d=d.lastEffect,null!==d))){e=d=d.next;do{var f=e,g=f.destroy;f=f.tag;void 0!==g&&(0!==(f&2)?Mj(c,b,g):0!==(f&4)&&Mj(c,b,g));e=e.next}while(e!==d)}Yj(a,b,c);break;case 1:if(!U&&(Lj(c,b),d=c.stateNode,\"function\"===typeof d.componentWillUnmount))try{d.props=c.memoizedProps,d.state=c.memoizedState,d.componentWillUnmount()}catch(h){W(c,b,h)}Yj(a,b,c);break;case 21:Yj(a,b,c);break;case 22:c.mode&1?(U=(d=U)||null!==\nc.memoizedState,Yj(a,b,c),U=d):Yj(a,b,c);break;default:Yj(a,b,c)}}function ak(a){var b=a.updateQueue;if(null!==b){a.updateQueue=null;var c=a.stateNode;null===c&&(c=a.stateNode=new Kj);b.forEach(function(b){var d=bk.bind(null,a,b);c.has(b)||(c.add(b),b.then(d,d))})}}\nfunction ck(a,b){var c=b.deletions;if(null!==c)for(var d=0;de&&(e=g);d&=~f}d=e;d=B()-d;d=(120>d?120:480>d?480:1080>d?1080:1920>d?1920:3E3>d?3E3:4320>d?4320:1960*lk(d/1960))-d;if(10a?16:a;if(null===wk)var d=!1;else{a=wk;wk=null;xk=0;if(0!==(K&6))throw Error(p(331));var e=K;K|=4;for(V=a.current;null!==V;){var f=V,g=f.child;if(0!==(V.flags&16)){var h=f.deletions;if(null!==h){for(var k=0;kB()-fk?Kk(a,0):rk|=c);Dk(a,b)}function Yk(a,b){0===b&&(0===(a.mode&1)?b=1:(b=sc,sc<<=1,0===(sc&130023424)&&(sc=4194304)));var c=R();a=ih(a,b);null!==a&&(Ac(a,b,c),Dk(a,c))}function uj(a){var b=a.memoizedState,c=0;null!==b&&(c=b.retryLane);Yk(a,c)}\nfunction bk(a,b){var c=0;switch(a.tag){case 13:var d=a.stateNode;var e=a.memoizedState;null!==e&&(c=e.retryLane);break;case 19:d=a.stateNode;break;default:throw Error(p(314));}null!==d&&d.delete(b);Yk(a,c)}var Vk;\nVk=function(a,b,c){if(null!==a)if(a.memoizedProps!==b.pendingProps||Wf.current)dh=!0;else{if(0===(a.lanes&c)&&0===(b.flags&128))return dh=!1,yj(a,b,c);dh=0!==(a.flags&131072)?!0:!1}else dh=!1,I&&0!==(b.flags&1048576)&&ug(b,ng,b.index);b.lanes=0;switch(b.tag){case 2:var d=b.type;ij(a,b);a=b.pendingProps;var e=Yf(b,H.current);ch(b,c);e=Nh(null,b,d,a,e,c);var f=Sh();b.flags|=1;\"object\"===typeof e&&null!==e&&\"function\"===typeof e.render&&void 0===e.$$typeof?(b.tag=1,b.memoizedState=null,b.updateQueue=\nnull,Zf(d)?(f=!0,cg(b)):f=!1,b.memoizedState=null!==e.state&&void 0!==e.state?e.state:null,kh(b),e.updater=Ei,b.stateNode=e,e._reactInternals=b,Ii(b,d,a,c),b=jj(null,b,d,!0,f,c)):(b.tag=0,I&&f&&vg(b),Xi(null,b,e,c),b=b.child);return b;case 16:d=b.elementType;a:{ij(a,b);a=b.pendingProps;e=d._init;d=e(d._payload);b.type=d;e=b.tag=Zk(d);a=Ci(d,a);switch(e){case 0:b=cj(null,b,d,a,c);break a;case 1:b=hj(null,b,d,a,c);break a;case 11:b=Yi(null,b,d,a,c);break a;case 14:b=$i(null,b,d,Ci(d.type,a),c);break a}throw Error(p(306,\nd,\"\"));}return b;case 0:return d=b.type,e=b.pendingProps,e=b.elementType===d?e:Ci(d,e),cj(a,b,d,e,c);case 1:return d=b.type,e=b.pendingProps,e=b.elementType===d?e:Ci(d,e),hj(a,b,d,e,c);case 3:a:{kj(b);if(null===a)throw Error(p(387));d=b.pendingProps;f=b.memoizedState;e=f.element;lh(a,b);qh(b,d,null,c);var g=b.memoizedState;d=g.element;if(f.isDehydrated)if(f={element:d,isDehydrated:!1,cache:g.cache,pendingSuspenseBoundaries:g.pendingSuspenseBoundaries,transitions:g.transitions},b.updateQueue.baseState=\nf,b.memoizedState=f,b.flags&256){e=Ji(Error(p(423)),b);b=lj(a,b,d,c,e);break a}else if(d!==e){e=Ji(Error(p(424)),b);b=lj(a,b,d,c,e);break a}else for(yg=Lf(b.stateNode.containerInfo.firstChild),xg=b,I=!0,zg=null,c=Vg(b,null,d,c),b.child=c;c;)c.flags=c.flags&-3|4096,c=c.sibling;else{Ig();if(d===e){b=Zi(a,b,c);break a}Xi(a,b,d,c)}b=b.child}return b;case 5:return Ah(b),null===a&&Eg(b),d=b.type,e=b.pendingProps,f=null!==a?a.memoizedProps:null,g=e.children,Ef(d,e)?g=null:null!==f&&Ef(d,f)&&(b.flags|=32),\ngj(a,b),Xi(a,b,g,c),b.child;case 6:return null===a&&Eg(b),null;case 13:return oj(a,b,c);case 4:return yh(b,b.stateNode.containerInfo),d=b.pendingProps,null===a?b.child=Ug(b,null,d,c):Xi(a,b,d,c),b.child;case 11:return d=b.type,e=b.pendingProps,e=b.elementType===d?e:Ci(d,e),Yi(a,b,d,e,c);case 7:return Xi(a,b,b.pendingProps,c),b.child;case 8:return Xi(a,b,b.pendingProps.children,c),b.child;case 12:return Xi(a,b,b.pendingProps.children,c),b.child;case 10:a:{d=b.type._context;e=b.pendingProps;f=b.memoizedProps;\ng=e.value;G(Wg,d._currentValue);d._currentValue=g;if(null!==f)if(He(f.value,g)){if(f.children===e.children&&!Wf.current){b=Zi(a,b,c);break a}}else for(f=b.child,null!==f&&(f.return=b);null!==f;){var h=f.dependencies;if(null!==h){g=f.child;for(var k=h.firstContext;null!==k;){if(k.context===d){if(1===f.tag){k=mh(-1,c&-c);k.tag=2;var l=f.updateQueue;if(null!==l){l=l.shared;var m=l.pending;null===m?k.next=k:(k.next=m.next,m.next=k);l.pending=k}}f.lanes|=c;k=f.alternate;null!==k&&(k.lanes|=c);bh(f.return,\nc,b);h.lanes|=c;break}k=k.next}}else if(10===f.tag)g=f.type===b.type?null:f.child;else if(18===f.tag){g=f.return;if(null===g)throw Error(p(341));g.lanes|=c;h=g.alternate;null!==h&&(h.lanes|=c);bh(g,c,b);g=f.sibling}else g=f.child;if(null!==g)g.return=f;else for(g=f;null!==g;){if(g===b){g=null;break}f=g.sibling;if(null!==f){f.return=g.return;g=f;break}g=g.return}f=g}Xi(a,b,e.children,c);b=b.child}return b;case 9:return e=b.type,d=b.pendingProps.children,ch(b,c),e=eh(e),d=d(e),b.flags|=1,Xi(a,b,d,c),\nb.child;case 14:return d=b.type,e=Ci(d,b.pendingProps),e=Ci(d.type,e),$i(a,b,d,e,c);case 15:return bj(a,b,b.type,b.pendingProps,c);case 17:return d=b.type,e=b.pendingProps,e=b.elementType===d?e:Ci(d,e),ij(a,b),b.tag=1,Zf(d)?(a=!0,cg(b)):a=!1,ch(b,c),Gi(b,d,e),Ii(b,d,e,c),jj(null,b,d,!0,a,c);case 19:return xj(a,b,c);case 22:return dj(a,b,c)}throw Error(p(156,b.tag));};function Fk(a,b){return ac(a,b)}\nfunction $k(a,b,c,d){this.tag=a;this.key=c;this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null;this.index=0;this.ref=null;this.pendingProps=b;this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null;this.mode=d;this.subtreeFlags=this.flags=0;this.deletions=null;this.childLanes=this.lanes=0;this.alternate=null}function Bg(a,b,c,d){return new $k(a,b,c,d)}function aj(a){a=a.prototype;return!(!a||!a.isReactComponent)}\nfunction Zk(a){if(\"function\"===typeof a)return aj(a)?1:0;if(void 0!==a&&null!==a){a=a.$$typeof;if(a===Da)return 11;if(a===Ga)return 14}return 2}\nfunction Pg(a,b){var c=a.alternate;null===c?(c=Bg(a.tag,b,a.key,a.mode),c.elementType=a.elementType,c.type=a.type,c.stateNode=a.stateNode,c.alternate=a,a.alternate=c):(c.pendingProps=b,c.type=a.type,c.flags=0,c.subtreeFlags=0,c.deletions=null);c.flags=a.flags&14680064;c.childLanes=a.childLanes;c.lanes=a.lanes;c.child=a.child;c.memoizedProps=a.memoizedProps;c.memoizedState=a.memoizedState;c.updateQueue=a.updateQueue;b=a.dependencies;c.dependencies=null===b?null:{lanes:b.lanes,firstContext:b.firstContext};\nc.sibling=a.sibling;c.index=a.index;c.ref=a.ref;return c}\nfunction Rg(a,b,c,d,e,f){var g=2;d=a;if(\"function\"===typeof a)aj(a)&&(g=1);else if(\"string\"===typeof a)g=5;else a:switch(a){case ya:return Tg(c.children,e,f,b);case za:g=8;e|=8;break;case Aa:return a=Bg(12,c,b,e|2),a.elementType=Aa,a.lanes=f,a;case Ea:return a=Bg(13,c,b,e),a.elementType=Ea,a.lanes=f,a;case Fa:return a=Bg(19,c,b,e),a.elementType=Fa,a.lanes=f,a;case Ia:return pj(c,e,f,b);default:if(\"object\"===typeof a&&null!==a)switch(a.$$typeof){case Ba:g=10;break a;case Ca:g=9;break a;case Da:g=11;\nbreak a;case Ga:g=14;break a;case Ha:g=16;d=null;break a}throw Error(p(130,null==a?a:typeof a,\"\"));}b=Bg(g,c,b,e);b.elementType=a;b.type=d;b.lanes=f;return b}function Tg(a,b,c,d){a=Bg(7,a,d,b);a.lanes=c;return a}function pj(a,b,c,d){a=Bg(22,a,d,b);a.elementType=Ia;a.lanes=c;a.stateNode={isHidden:!1};return a}function Qg(a,b,c){a=Bg(6,a,null,b);a.lanes=c;return a}\nfunction Sg(a,b,c){b=Bg(4,null!==a.children?a.children:[],a.key,b);b.lanes=c;b.stateNode={containerInfo:a.containerInfo,pendingChildren:null,implementation:a.implementation};return b}\nfunction al(a,b,c,d,e){this.tag=b;this.containerInfo=a;this.finishedWork=this.pingCache=this.current=this.pendingChildren=null;this.timeoutHandle=-1;this.callbackNode=this.pendingContext=this.context=null;this.callbackPriority=0;this.eventTimes=zc(0);this.expirationTimes=zc(-1);this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0;this.entanglements=zc(0);this.identifierPrefix=d;this.onRecoverableError=e;this.mutableSourceEagerHydrationData=\nnull}function bl(a,b,c,d,e,f,g,h,k){a=new al(a,b,c,h,k);1===b?(b=1,!0===f&&(b|=8)):b=0;f=Bg(3,null,null,b);a.current=f;f.stateNode=a;f.memoizedState={element:d,isDehydrated:c,cache:null,transitions:null,pendingSuspenseBoundaries:null};kh(f);return a}function cl(a,b,c){var d=3 q) && (t = (f = f.replace(' ', ':')).length), 0 < A && void 0 !== (C = H(1, f, c, d, D, z, p.length, h, a, h)) && 0 === (t = (f = C.trim()).length) && (f = '\\x00\\x00'), q = f.charCodeAt(0), g = f.charCodeAt(1), q) {\n case 0:\n break;\n\n case 64:\n if (105 === g || 99 === g) {\n G += f + e.charAt(l);\n break;\n }\n\n default:\n 58 !== f.charCodeAt(t - 1) && (p += P(f, q, g, f.charCodeAt(2)));\n }\n I = r = u = q = 0;\n f = '';\n g = e.charCodeAt(++l);\n }\n }\n\n switch (g) {\n case 13:\n case 10:\n 47 === b ? b = 0 : 0 === 1 + q && 107 !== h && 0 < f.length && (r = 1, f += '\\x00');\n 0 < A * Y && H(0, f, c, d, D, z, p.length, h, a, h);\n z = 1;\n D++;\n break;\n\n case 59:\n case 125:\n if (0 === b + n + v + m) {\n z++;\n break;\n }\n\n default:\n z++;\n y = e.charAt(l);\n\n switch (g) {\n case 9:\n case 32:\n if (0 === n + m + b) switch (x) {\n case 44:\n case 58:\n case 9:\n case 32:\n y = '';\n break;\n\n default:\n 32 !== g && (y = ' ');\n }\n break;\n\n case 0:\n y = '\\\\0';\n break;\n\n case 12:\n y = '\\\\f';\n break;\n\n case 11:\n y = '\\\\v';\n break;\n\n case 38:\n 0 === n + b + m && (r = I = 1, y = '\\f' + y);\n break;\n\n case 108:\n if (0 === n + b + m + E && 0 < u) switch (l - u) {\n case 2:\n 112 === x && 58 === e.charCodeAt(l - 3) && (E = x);\n\n case 8:\n 111 === K && (E = K);\n }\n break;\n\n case 58:\n 0 === n + b + m && (u = l);\n break;\n\n case 44:\n 0 === b + v + n + m && (r = 1, y += '\\r');\n break;\n\n case 34:\n case 39:\n 0 === b && (n = n === g ? 0 : 0 === n ? g : n);\n break;\n\n case 91:\n 0 === n + b + v && m++;\n break;\n\n case 93:\n 0 === n + b + v && m--;\n break;\n\n case 41:\n 0 === n + b + m && v--;\n break;\n\n case 40:\n if (0 === n + b + m) {\n if (0 === q) switch (2 * x + 3 * K) {\n case 533:\n break;\n\n default:\n q = 1;\n }\n v++;\n }\n\n break;\n\n case 64:\n 0 === b + v + n + m + u + k && (k = 1);\n break;\n\n case 42:\n case 47:\n if (!(0 < n + m + v)) switch (b) {\n case 0:\n switch (2 * g + 3 * e.charCodeAt(l + 1)) {\n case 235:\n b = 47;\n break;\n\n case 220:\n t = l, b = 42;\n }\n\n break;\n\n case 42:\n 47 === g && 42 === x && t + 2 !== l && (33 === e.charCodeAt(t + 2) && (p += e.substring(t, l + 1)), y = '', b = 0);\n }\n }\n\n 0 === b && (f += y);\n }\n\n K = x;\n x = g;\n l++;\n }\n\n t = p.length;\n\n if (0 < t) {\n r = c;\n if (0 < A && (C = H(2, p, r, d, D, z, t, h, a, h), void 0 !== C && 0 === (p = C).length)) return G + p + F;\n p = r.join(',') + '{' + p + '}';\n\n if (0 !== w * E) {\n 2 !== w || L(p, 2) || (E = 0);\n\n switch (E) {\n case 111:\n p = p.replace(ha, ':-moz-$1') + p;\n break;\n\n case 112:\n p = p.replace(Q, '::-webkit-input-$1') + p.replace(Q, '::-moz-$1') + p.replace(Q, ':-ms-input-$1') + p;\n }\n\n E = 0;\n }\n }\n\n return G + p + F;\n }\n\n function X(d, c, e) {\n var h = c.trim().split(ia);\n c = h;\n var a = h.length,\n m = d.length;\n\n switch (m) {\n case 0:\n case 1:\n var b = 0;\n\n for (d = 0 === m ? '' : d[0] + ' '; b < a; ++b) {\n c[b] = Z(d, c[b], e).trim();\n }\n\n break;\n\n default:\n var v = b = 0;\n\n for (c = []; b < a; ++b) {\n for (var n = 0; n < m; ++n) {\n c[v++] = Z(d[n] + ' ', h[b], e).trim();\n }\n }\n\n }\n\n return c;\n }\n\n function Z(d, c, e) {\n var h = c.charCodeAt(0);\n 33 > h && (h = (c = c.trim()).charCodeAt(0));\n\n switch (h) {\n case 38:\n return c.replace(F, '$1' + d.trim());\n\n case 58:\n return d.trim() + c.replace(F, '$1' + d.trim());\n\n default:\n if (0 < 1 * e && 0 < c.indexOf('\\f')) return c.replace(F, (58 === d.charCodeAt(0) ? '' : '$1') + d.trim());\n }\n\n return d + c;\n }\n\n function P(d, c, e, h) {\n var a = d + ';',\n m = 2 * c + 3 * e + 4 * h;\n\n if (944 === m) {\n d = a.indexOf(':', 9) + 1;\n var b = a.substring(d, a.length - 1).trim();\n b = a.substring(0, d).trim() + b + ';';\n return 1 === w || 2 === w && L(b, 1) ? '-webkit-' + b + b : b;\n }\n\n if (0 === w || 2 === w && !L(a, 1)) return a;\n\n switch (m) {\n case 1015:\n return 97 === a.charCodeAt(10) ? '-webkit-' + a + a : a;\n\n case 951:\n return 116 === a.charCodeAt(3) ? '-webkit-' + a + a : a;\n\n case 963:\n return 110 === a.charCodeAt(5) ? '-webkit-' + a + a : a;\n\n case 1009:\n if (100 !== a.charCodeAt(4)) break;\n\n case 969:\n case 942:\n return '-webkit-' + a + a;\n\n case 978:\n return '-webkit-' + a + '-moz-' + a + a;\n\n case 1019:\n case 983:\n return '-webkit-' + a + '-moz-' + a + '-ms-' + a + a;\n\n case 883:\n if (45 === a.charCodeAt(8)) return '-webkit-' + a + a;\n if (0 < a.indexOf('image-set(', 11)) return a.replace(ja, '$1-webkit-$2') + a;\n break;\n\n case 932:\n if (45 === a.charCodeAt(4)) switch (a.charCodeAt(5)) {\n case 103:\n return '-webkit-box-' + a.replace('-grow', '') + '-webkit-' + a + '-ms-' + a.replace('grow', 'positive') + a;\n\n case 115:\n return '-webkit-' + a + '-ms-' + a.replace('shrink', 'negative') + a;\n\n case 98:\n return '-webkit-' + a + '-ms-' + a.replace('basis', 'preferred-size') + a;\n }\n return '-webkit-' + a + '-ms-' + a + a;\n\n case 964:\n return '-webkit-' + a + '-ms-flex-' + a + a;\n\n case 1023:\n if (99 !== a.charCodeAt(8)) break;\n b = a.substring(a.indexOf(':', 15)).replace('flex-', '').replace('space-between', 'justify');\n return '-webkit-box-pack' + b + '-webkit-' + a + '-ms-flex-pack' + b + a;\n\n case 1005:\n return ka.test(a) ? a.replace(aa, ':-webkit-') + a.replace(aa, ':-moz-') + a : a;\n\n case 1e3:\n b = a.substring(13).trim();\n c = b.indexOf('-') + 1;\n\n switch (b.charCodeAt(0) + b.charCodeAt(c)) {\n case 226:\n b = a.replace(G, 'tb');\n break;\n\n case 232:\n b = a.replace(G, 'tb-rl');\n break;\n\n case 220:\n b = a.replace(G, 'lr');\n break;\n\n default:\n return a;\n }\n\n return '-webkit-' + a + '-ms-' + b + a;\n\n case 1017:\n if (-1 === a.indexOf('sticky', 9)) break;\n\n case 975:\n c = (a = d).length - 10;\n b = (33 === a.charCodeAt(c) ? a.substring(0, c) : a).substring(d.indexOf(':', 7) + 1).trim();\n\n switch (m = b.charCodeAt(0) + (b.charCodeAt(7) | 0)) {\n case 203:\n if (111 > b.charCodeAt(8)) break;\n\n case 115:\n a = a.replace(b, '-webkit-' + b) + ';' + a;\n break;\n\n case 207:\n case 102:\n a = a.replace(b, '-webkit-' + (102 < m ? 'inline-' : '') + 'box') + ';' + a.replace(b, '-webkit-' + b) + ';' + a.replace(b, '-ms-' + b + 'box') + ';' + a;\n }\n\n return a + ';';\n\n case 938:\n if (45 === a.charCodeAt(5)) switch (a.charCodeAt(6)) {\n case 105:\n return b = a.replace('-items', ''), '-webkit-' + a + '-webkit-box-' + b + '-ms-flex-' + b + a;\n\n case 115:\n return '-webkit-' + a + '-ms-flex-item-' + a.replace(ba, '') + a;\n\n default:\n return '-webkit-' + a + '-ms-flex-line-pack' + a.replace('align-content', '').replace(ba, '') + a;\n }\n break;\n\n case 973:\n case 989:\n if (45 !== a.charCodeAt(3) || 122 === a.charCodeAt(4)) break;\n\n case 931:\n case 953:\n if (!0 === la.test(d)) return 115 === (b = d.substring(d.indexOf(':') + 1)).charCodeAt(0) ? P(d.replace('stretch', 'fill-available'), c, e, h).replace(':fill-available', ':stretch') : a.replace(b, '-webkit-' + b) + a.replace(b, '-moz-' + b.replace('fill-', '')) + a;\n break;\n\n case 962:\n if (a = '-webkit-' + a + (102 === a.charCodeAt(5) ? '-ms-' + a : '') + a, 211 === e + h && 105 === a.charCodeAt(13) && 0 < a.indexOf('transform', 10)) return a.substring(0, a.indexOf(';', 27) + 1).replace(ma, '$1-webkit-$2') + a;\n }\n\n return a;\n }\n\n function L(d, c) {\n var e = d.indexOf(1 === c ? ':' : '{'),\n h = d.substring(0, 3 !== c ? e : 10);\n e = d.substring(e + 1, d.length - 1);\n return R(2 !== c ? h : h.replace(na, '$1'), e, c);\n }\n\n function ea(d, c) {\n var e = P(c, c.charCodeAt(0), c.charCodeAt(1), c.charCodeAt(2));\n return e !== c + ';' ? e.replace(oa, ' or ($1)').substring(4) : '(' + c + ')';\n }\n\n function H(d, c, e, h, a, m, b, v, n, q) {\n for (var g = 0, x = c, w; g < A; ++g) {\n switch (w = S[g].call(B, d, x, e, h, a, m, b, v, n, q)) {\n case void 0:\n case !1:\n case !0:\n case null:\n break;\n\n default:\n x = w;\n }\n }\n\n if (x !== c) return x;\n }\n\n function T(d) {\n switch (d) {\n case void 0:\n case null:\n A = S.length = 0;\n break;\n\n default:\n if ('function' === typeof d) S[A++] = d;else if ('object' === typeof d) for (var c = 0, e = d.length; c < e; ++c) {\n T(d[c]);\n } else Y = !!d | 0;\n }\n\n return T;\n }\n\n function U(d) {\n d = d.prefix;\n void 0 !== d && (R = null, d ? 'function' !== typeof d ? w = 1 : (w = 2, R = d) : w = 0);\n return U;\n }\n\n function B(d, c) {\n var e = d;\n 33 > e.charCodeAt(0) && (e = e.trim());\n V = e;\n e = [V];\n\n if (0 < A) {\n var h = H(-1, c, e, e, D, z, 0, 0, 0, 0);\n void 0 !== h && 'string' === typeof h && (c = h);\n }\n\n var a = M(O, e, c, 0, 0);\n 0 < A && (h = H(-2, a, e, e, D, z, a.length, 0, 0, 0), void 0 !== h && (a = h));\n V = '';\n E = 0;\n z = D = 1;\n return a;\n }\n\n var ca = /^\\0+/g,\n N = /[\\0\\r\\f]/g,\n aa = /: */g,\n ka = /zoo|gra/,\n ma = /([,: ])(transform)/g,\n ia = /,\\r+?/g,\n F = /([\\t\\r\\n ])*\\f?&/g,\n fa = /@(k\\w+)\\s*(\\S*)\\s*/,\n Q = /::(place)/g,\n ha = /:(read-only)/g,\n G = /[svh]\\w+-[tblr]{2}/,\n da = /\\(\\s*(.*)\\s*\\)/g,\n oa = /([\\s\\S]*?);/g,\n ba = /-self|flex-/g,\n na = /[^]*?(:[rp][el]a[\\w-]+)[^]*/,\n la = /stretch|:\\s*\\w+\\-(?:conte|avail)/,\n ja = /([^-])(image-set\\()/,\n z = 1,\n D = 1,\n E = 0,\n w = 1,\n O = [],\n S = [],\n A = 0,\n R = null,\n Y = 0,\n V = '';\n B.use = T;\n B.set = U;\n void 0 !== W && U(W);\n return B;\n}\n\nexport default stylis_min;\n","var unitlessKeys = {\n animationIterationCount: 1,\n borderImageOutset: 1,\n borderImageSlice: 1,\n borderImageWidth: 1,\n boxFlex: 1,\n boxFlexGroup: 1,\n boxOrdinalGroup: 1,\n columnCount: 1,\n columns: 1,\n flex: 1,\n flexGrow: 1,\n flexPositive: 1,\n flexShrink: 1,\n flexNegative: 1,\n flexOrder: 1,\n gridRow: 1,\n gridRowEnd: 1,\n gridRowSpan: 1,\n gridRowStart: 1,\n gridColumn: 1,\n gridColumnEnd: 1,\n gridColumnSpan: 1,\n gridColumnStart: 1,\n msGridRow: 1,\n msGridRowSpan: 1,\n msGridColumn: 1,\n msGridColumnSpan: 1,\n fontWeight: 1,\n lineHeight: 1,\n opacity: 1,\n order: 1,\n orphans: 1,\n tabSize: 1,\n widows: 1,\n zIndex: 1,\n zoom: 1,\n WebkitLineClamp: 1,\n // SVG-related properties\n fillOpacity: 1,\n floodOpacity: 1,\n stopOpacity: 1,\n strokeDasharray: 1,\n strokeDashoffset: 1,\n strokeMiterlimit: 1,\n strokeOpacity: 1,\n strokeWidth: 1\n};\n\nexport default unitlessKeys;\n","function memoize(fn) {\n var cache = Object.create(null);\n return function (arg) {\n if (cache[arg] === undefined) cache[arg] = fn(arg);\n return cache[arg];\n };\n}\n\nexport { memoize as default };\n","import memoize from '@emotion/memoize';\n\n// eslint-disable-next-line no-undef\nvar reactPropsRegex = /^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|abbr|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|disableRemotePlayback|download|draggable|encType|enterKeyHint|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|translate|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|incremental|fallback|inert|itemProp|itemScope|itemType|itemID|itemRef|on|option|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/; // https://esbench.com/bench/5bfee68a4cd7e6009ef61d23\n\nvar isPropValid = /* #__PURE__ */memoize(function (prop) {\n return reactPropsRegex.test(prop) || prop.charCodeAt(0) === 111\n /* o */\n && prop.charCodeAt(1) === 110\n /* n */\n && prop.charCodeAt(2) < 91;\n}\n/* Z+1 */\n);\n\nexport { isPropValid as default };\n","/** @license React v16.13.1\n * react-is.production.min.js\n *\n * Copyright (c) Facebook, Inc. and its affiliates.\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'use strict';var b=\"function\"===typeof Symbol&&Symbol.for,c=b?Symbol.for(\"react.element\"):60103,d=b?Symbol.for(\"react.portal\"):60106,e=b?Symbol.for(\"react.fragment\"):60107,f=b?Symbol.for(\"react.strict_mode\"):60108,g=b?Symbol.for(\"react.profiler\"):60114,h=b?Symbol.for(\"react.provider\"):60109,k=b?Symbol.for(\"react.context\"):60110,l=b?Symbol.for(\"react.async_mode\"):60111,m=b?Symbol.for(\"react.concurrent_mode\"):60111,n=b?Symbol.for(\"react.forward_ref\"):60112,p=b?Symbol.for(\"react.suspense\"):60113,q=b?\nSymbol.for(\"react.suspense_list\"):60120,r=b?Symbol.for(\"react.memo\"):60115,t=b?Symbol.for(\"react.lazy\"):60116,v=b?Symbol.for(\"react.block\"):60121,w=b?Symbol.for(\"react.fundamental\"):60117,x=b?Symbol.for(\"react.responder\"):60118,y=b?Symbol.for(\"react.scope\"):60119;\nfunction z(a){if(\"object\"===typeof a&&null!==a){var u=a.$$typeof;switch(u){case c:switch(a=a.type,a){case l:case m:case e:case g:case f:case p:return a;default:switch(a=a&&a.$$typeof,a){case k:case n:case t:case r:case h:return a;default:return u}}case d:return u}}}function A(a){return z(a)===m}exports.AsyncMode=l;exports.ConcurrentMode=m;exports.ContextConsumer=k;exports.ContextProvider=h;exports.Element=c;exports.ForwardRef=n;exports.Fragment=e;exports.Lazy=t;exports.Memo=r;exports.Portal=d;\nexports.Profiler=g;exports.StrictMode=f;exports.Suspense=p;exports.isAsyncMode=function(a){return A(a)||z(a)===l};exports.isConcurrentMode=A;exports.isContextConsumer=function(a){return z(a)===k};exports.isContextProvider=function(a){return z(a)===h};exports.isElement=function(a){return\"object\"===typeof a&&null!==a&&a.$$typeof===c};exports.isForwardRef=function(a){return z(a)===n};exports.isFragment=function(a){return z(a)===e};exports.isLazy=function(a){return z(a)===t};\nexports.isMemo=function(a){return z(a)===r};exports.isPortal=function(a){return z(a)===d};exports.isProfiler=function(a){return z(a)===g};exports.isStrictMode=function(a){return z(a)===f};exports.isSuspense=function(a){return z(a)===p};\nexports.isValidElementType=function(a){return\"string\"===typeof a||\"function\"===typeof a||a===e||a===m||a===g||a===f||a===p||a===q||\"object\"===typeof a&&null!==a&&(a.$$typeof===t||a.$$typeof===r||a.$$typeof===h||a.$$typeof===k||a.$$typeof===n||a.$$typeof===w||a.$$typeof===x||a.$$typeof===y||a.$$typeof===v)};exports.typeOf=z;\n","'use strict';\n\nif (process.env.NODE_ENV === 'production') {\n module.exports = require('./cjs/react-is.production.min.js');\n} else {\n module.exports = require('./cjs/react-is.development.js');\n}\n","'use strict';\n\nvar reactIs = require('react-is');\n\n/**\n * Copyright 2015, Yahoo! Inc.\n * Copyrights licensed under the New BSD License. See the accompanying LICENSE file for terms.\n */\nvar REACT_STATICS = {\n childContextTypes: true,\n contextType: true,\n contextTypes: true,\n defaultProps: true,\n displayName: true,\n getDefaultProps: true,\n getDerivedStateFromError: true,\n getDerivedStateFromProps: true,\n mixins: true,\n propTypes: true,\n type: true\n};\nvar KNOWN_STATICS = {\n name: true,\n length: true,\n prototype: true,\n caller: true,\n callee: true,\n arguments: true,\n arity: true\n};\nvar FORWARD_REF_STATICS = {\n '$$typeof': true,\n render: true,\n defaultProps: true,\n displayName: true,\n propTypes: true\n};\nvar MEMO_STATICS = {\n '$$typeof': true,\n compare: true,\n defaultProps: true,\n displayName: true,\n propTypes: true,\n type: true\n};\nvar TYPE_STATICS = {};\nTYPE_STATICS[reactIs.ForwardRef] = FORWARD_REF_STATICS;\nTYPE_STATICS[reactIs.Memo] = MEMO_STATICS;\n\nfunction getStatics(component) {\n // React v16.11 and below\n if (reactIs.isMemo(component)) {\n return MEMO_STATICS;\n } // React v16.12 and above\n\n\n return TYPE_STATICS[component['$$typeof']] || REACT_STATICS;\n}\n\nvar defineProperty = Object.defineProperty;\nvar getOwnPropertyNames = Object.getOwnPropertyNames;\nvar getOwnPropertySymbols = Object.getOwnPropertySymbols;\nvar getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;\nvar getPrototypeOf = Object.getPrototypeOf;\nvar objectPrototype = Object.prototype;\nfunction hoistNonReactStatics(targetComponent, sourceComponent, blacklist) {\n if (typeof sourceComponent !== 'string') {\n // don't hoist over string (html) components\n if (objectPrototype) {\n var inheritedComponent = getPrototypeOf(sourceComponent);\n\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 var targetStatics = getStatics(targetComponent);\n var sourceStatics = getStatics(sourceComponent);\n\n for (var i = 0; i < keys.length; ++i) {\n var key = keys[i];\n\n if (!KNOWN_STATICS[key] && !(blacklist && blacklist[key]) && !(sourceStatics && sourceStatics[key]) && !(targetStatics && targetStatics[key])) {\n var descriptor = getOwnPropertyDescriptor(sourceComponent, key);\n\n try {\n // Avoid failures from read-only properties\n defineProperty(targetComponent, key, descriptor);\n } catch (e) {}\n }\n }\n }\n\n return targetComponent;\n}\n\nmodule.exports = hoistNonReactStatics;\n","import{typeOf as e,isElement as t,isValidElementType as n}from\"react-is\";import r,{useState as o,useContext as s,useMemo as i,useEffect as a,useRef as c,createElement as u,useLayoutEffect as l}from\"react\";import d from\"shallowequal\";import h from\"@emotion/stylis\";import p from\"@emotion/unitless\";import f from\"@emotion/is-prop-valid\";import m from\"hoist-non-react-statics\";function y(){return(y=Object.assign||function(e){for(var t=1;t ({})}\\n```\\n\\n',8:'ThemeProvider: Please make your \"theme\" prop an object.\\n\\n',9:\"Missing document ``\\n\\n\",10:\"Cannot find a StyleSheet instance. Usually this happens if there are multiple copies of styled-components loaded at once. Check out this issue for how to troubleshoot and fix the common cases where this situation can happen: https://github.com/styled-components/styled-components/issues/1941#issuecomment-417862021\\n\\n\",11:\"_This error was replaced with a dev-time warning, it will be deleted for v4 final._ [createGlobalStyle] received children which will not be rendered. Please use the component without passing children elements.\\n\\n\",12:\"It seems you are interpolating a keyframe declaration (%s) into an untagged string. This was supported in styled-components v3, but is not longer supported in v4 as keyframes are now injected on-demand. Please wrap your string in the css\\\\`\\\\` helper which ensures the styles are injected correctly. See https://www.styled-components.com/docs/api#css\\n\\n\",13:\"%s is not a styled component and cannot be referred to via component selector. See https://www.styled-components.com/docs/advanced#referring-to-other-components for more details.\\n\\n\",14:'ThemeProvider: \"theme\" prop is required.\\n\\n',15:\"A stylis plugin has been supplied that is not named. We need a name for each plugin to be able to prevent styling collisions between different stylis configurations within the same app. Before you pass your plugin to ``, please make sure each plugin is uniquely-named, e.g.\\n\\n```js\\nObject.defineProperty(importedPlugin, 'name', { value: 'some-unique-name' });\\n```\\n\\n\",16:\"Reached the limit of how many styled components may be created at group %s.\\nYou may only create up to 1,073,741,824 components. If you're creating components dynamically,\\nas for instance in your render method then you may be running into this limitation.\\n\\n\",17:\"CSSStyleSheet could not be found on HTMLStyleElement.\\nHas styled-components' style tag been unmounted or altered by another script?\\n\"}:{};function R(){for(var e=arguments.length<=0?void 0:arguments[0],t=[],n=1,r=arguments.length;n1?t-1:0),r=1;r0?\" Args: \"+n.join(\", \"):\"\")):new Error(R.apply(void 0,[O[e]].concat(n)).trim())}var j=function(){function e(e){this.groupSizes=new Uint32Array(512),this.length=512,this.tag=e}var t=e.prototype;return t.indexOfGroup=function(e){for(var t=0,n=0;n=this.groupSizes.length){for(var n=this.groupSizes,r=n.length,o=r;e>=o;)(o<<=1)<0&&D(16,\"\"+e);this.groupSizes=new Uint32Array(o),this.groupSizes.set(n),this.length=o;for(var s=r;s=this.length||0===this.groupSizes[e])return t;for(var n=this.groupSizes[e],r=this.indexOfGroup(e),o=r+n,s=r;s1<<30)&&D(16,\"\"+t),T.set(e,t),x.set(t,e),t},B=function(e){return x.get(e)},z=function(e,t){t>=k&&(k=t+1),T.set(e,t),x.set(t,e)},M=\"style[\"+N+'][data-styled-version=\"5.3.11\"]',G=new RegExp(\"^\"+N+'\\\\.g(\\\\d+)\\\\[id=\"([\\\\w\\\\d-]+)\"\\\\].*?\"([^\"]*)'),L=function(e,t,n){for(var r,o=n.split(\",\"),s=0,i=o.length;s=0;n--){var r=t[n];if(r&&1===r.nodeType&&r.hasAttribute(N))return r}}(n),s=void 0!==o?o.nextSibling:null;r.setAttribute(N,\"active\"),r.setAttribute(\"data-styled-version\",\"5.3.11\");var i=Y();return i&&r.setAttribute(\"nonce\",i),n.insertBefore(r,s),r},H=function(){function e(e){var t=this.element=q(e);t.appendChild(document.createTextNode(\"\")),this.sheet=function(e){if(e.sheet)return e.sheet;for(var t=document.styleSheets,n=0,r=t.length;n=0){var n=document.createTextNode(t),r=this.nodes[e];return this.element.insertBefore(n,r||null),this.length++,!0}return!1},t.deleteRule=function(e){this.element.removeChild(this.nodes[e]),this.length--},t.getRule=function(e){return e0&&(u+=e+\",\")})),r+=\"\"+a+c+'{content:\"'+u+'\"}/*!sc*/\\n'}}}return r}(this)},e}(),Z=/(a)(d)/gi,K=function(e){return String.fromCharCode(e+(e>25?39:97))};function Q(e){var t,n=\"\";for(t=Math.abs(e);t>52;t=t/52|0)n=K(t%52)+n;return(K(t%52)+n).replace(Z,\"$1-$2\")}var ee=function(e,t){for(var n=t.length;n;)e=33*e^t.charCodeAt(--n);return e},te=function(e){return ee(5381,e)};function ne(e){for(var t=0;t>>0);if(!t.hasNameForId(r,i)){var a=n(s,\".\"+i,void 0,r);t.insertRules(r,i,a)}o.push(i),this.staticRulesId=i}else{for(var c=this.rules.length,u=ee(this.baseHash,n.hash),l=\"\",d=0;d>>0);if(!t.hasNameForId(r,m)){var y=n(l,\".\"+m,void 0,r);t.insertRules(r,m,y)}o.push(m)}}return o.join(\" \")},e}(),se=/^\\s*\\/\\/.*$/gm,ie=[\":\",\"[\",\".\",\"#\"];function ae(e){var t,n,r,o,s=void 0===e?w:e,i=s.options,a=void 0===i?w:i,c=s.plugins,u=void 0===c?S:c,l=new h(a),d=[],p=function(e){function t(t){if(t)try{e(t+\"}\")}catch(e){}}return function(n,r,o,s,i,a,c,u,l,d){switch(n){case 1:if(0===l&&64===r.charCodeAt(0))return e(r+\";\"),\"\";break;case 2:if(0===u)return r+\"/*|*/\";break;case 3:switch(u){case 102:case 112:return e(o[0]+r),\"\";default:return r+(0===d?\"/*|*/\":\"\")}case-2:r.split(\"/*|*/}\").forEach(t)}}}((function(e){d.push(e)})),f=function(e,r,s){return 0===r&&-1!==ie.indexOf(s[n.length])||s.match(o)?e:\".\"+t};function m(e,s,i,a){void 0===a&&(a=\"&\");var c=e.replace(se,\"\"),u=s&&i?i+\" \"+s+\" { \"+c+\" }\":c;return t=a,n=s,r=new RegExp(\"\\\\\"+n+\"\\\\b\",\"g\"),o=new RegExp(\"(\\\\\"+n+\"\\\\b){2,}\"),l(i||!s?\"\":s,u)}return l.use([].concat(u,[function(e,t,o){2===e&&o.length&&o[0].lastIndexOf(n)>0&&(o[0]=o[0].replace(r,f))},p,function(e){if(-2===e){var t=d;return d=[],t}}])),m.hash=u.length?u.reduce((function(e,t){return t.name||D(15),ee(e,t.name)}),5381).toString():\"\",m}var ce=r.createContext(),ue=ce.Consumer,le=r.createContext(),de=(le.Consumer,new X),he=ae();function pe(){return s(ce)||de}function fe(){return s(le)||he}function me(e){var t=o(e.stylisPlugins),n=t[0],s=t[1],c=pe(),u=i((function(){var t=c;return e.sheet?t=e.sheet:e.target&&(t=t.reconstructWithOptions({target:e.target},!1)),e.disableCSSOMInjection&&(t=t.reconstructWithOptions({useCSSOMInjection:!1})),t}),[e.disableCSSOMInjection,e.sheet,e.target]),l=i((function(){return ae({options:{prefix:!e.disableVendorPrefixes},plugins:n})}),[e.disableVendorPrefixes,n]);return a((function(){d(n,e.stylisPlugins)||s(e.stylisPlugins)}),[e.stylisPlugins]),r.createElement(ce.Provider,{value:u},r.createElement(le.Provider,{value:l},\"production\"!==process.env.NODE_ENV?r.Children.only(e.children):e.children))}var ye=function(){function e(e,t){var n=this;this.inject=function(e,t){void 0===t&&(t=he);var r=n.name+t.hash;e.hasNameForId(n.id,r)||e.insertRules(n.id,r,t(n.rules,r,\"@keyframes\"))},this.toString=function(){return D(12,String(n.name))},this.name=e,this.id=\"sc-keyframes-\"+e,this.rules=t}return e.prototype.getName=function(e){return void 0===e&&(e=he),this.name+e.hash},e}(),ve=/([A-Z])/,ge=/([A-Z])/g,Se=/^ms-/,we=function(e){return\"-\"+e.toLowerCase()};function Ee(e){return ve.test(e)?e.replace(ge,we).replace(Se,\"-ms-\"):e}var be=function(e){return null==e||!1===e||\"\"===e};function _e(e,n,r,o){if(Array.isArray(e)){for(var s,i=[],a=0,c=e.length;a1?t-1:0),r=1;r1?t-1:0),i=1;i?@[\\\\\\]^`{|}~-]+/g,De=/(^-|-$)/g;function je(e){return e.replace(Re,\"-\").replace(De,\"\")}var Te=function(e){return Q(te(e)>>>0)};function xe(e){return\"string\"==typeof e&&(\"production\"===process.env.NODE_ENV||e.charAt(0)===e.charAt(0).toLowerCase())}var ke=function(e){return\"function\"==typeof e||\"object\"==typeof e&&null!==e&&!Array.isArray(e)},Ve=function(e){return\"__proto__\"!==e&&\"constructor\"!==e&&\"prototype\"!==e};function Be(e,t,n){var r=e[n];ke(t)&&ke(r)?ze(r,t):e[n]=t}function ze(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r=0||(o[n]=e[n]);return o}(t,[\"componentId\"]),s=r&&r+\"-\"+(xe(e)?e:je(b(e)));return Ye(e,y({},o,{attrs:g,componentId:s}),n)},Object.defineProperty(A,\"defaultProps\",{get:function(){return this._foldedDefaultProps},set:function(t){this._foldedDefaultProps=o?ze({},e.defaultProps,t):t}}),\"production\"!==process.env.NODE_ENV&&(Pe(p,v),A.warnTooManyClasses=function(e,t){var n={},r=!1;return function(o){if(!r&&(n[o]=!0,Object.keys(n).length>=200)){var s=t?' with the id of \"'+t+'\"':\"\";console.warn(\"Over 200 classes were generated for component \"+e+s+\".\\nConsider using the attrs method, together with a style object for frequently changed styles.\\nExample:\\n const Component = styled.div.attrs(props => ({\\n style: {\\n background: props.background,\\n },\\n }))`width: 100%;`\\n\\n \"),r=!0,n={}}}}(p,v)),Object.defineProperty(A,\"toString\",{value:function(){return\".\"+A.styledComponentId}}),i&&m(A,e,{attrs:!0,componentStyle:!0,displayName:!0,foldedComponentIds:!0,shouldForwardProp:!0,styledComponentId:!0,target:!0,withComponent:!0}),A}var qe=function(e){return function e(t,r,o){if(void 0===o&&(o=w),!n(r))return D(1,String(r));var s=function(){return t(r,o,Ae.apply(void 0,arguments))};return s.withConfig=function(n){return e(t,r,y({},o,{},n))},s.attrs=function(n){return e(t,r,y({},o,{attrs:Array.prototype.concat(o.attrs,n).filter(Boolean)}))},s}(Ye,e)};[\"a\",\"abbr\",\"address\",\"area\",\"article\",\"aside\",\"audio\",\"b\",\"base\",\"bdi\",\"bdo\",\"big\",\"blockquote\",\"body\",\"br\",\"button\",\"canvas\",\"caption\",\"cite\",\"code\",\"col\",\"colgroup\",\"data\",\"datalist\",\"dd\",\"del\",\"details\",\"dfn\",\"dialog\",\"div\",\"dl\",\"dt\",\"em\",\"embed\",\"fieldset\",\"figcaption\",\"figure\",\"footer\",\"form\",\"h1\",\"h2\",\"h3\",\"h4\",\"h5\",\"h6\",\"head\",\"header\",\"hgroup\",\"hr\",\"html\",\"i\",\"iframe\",\"img\",\"input\",\"ins\",\"kbd\",\"keygen\",\"label\",\"legend\",\"li\",\"link\",\"main\",\"map\",\"mark\",\"marquee\",\"menu\",\"menuitem\",\"meta\",\"meter\",\"nav\",\"noscript\",\"object\",\"ol\",\"optgroup\",\"option\",\"output\",\"p\",\"param\",\"picture\",\"pre\",\"progress\",\"q\",\"rp\",\"rt\",\"ruby\",\"s\",\"samp\",\"script\",\"section\",\"select\",\"small\",\"source\",\"span\",\"strong\",\"style\",\"sub\",\"summary\",\"sup\",\"table\",\"tbody\",\"td\",\"textarea\",\"tfoot\",\"th\",\"thead\",\"time\",\"title\",\"tr\",\"track\",\"u\",\"ul\",\"var\",\"video\",\"wbr\",\"circle\",\"clipPath\",\"defs\",\"ellipse\",\"foreignObject\",\"g\",\"image\",\"line\",\"linearGradient\",\"marker\",\"mask\",\"path\",\"pattern\",\"polygon\",\"polyline\",\"radialGradient\",\"rect\",\"stop\",\"svg\",\"text\",\"textPath\",\"tspan\"].forEach((function(e){qe[e]=qe(e)}));var He=function(){function e(e,t){this.rules=e,this.componentId=t,this.isStatic=ne(e),X.registerId(this.componentId+1)}var t=e.prototype;return t.createStyles=function(e,t,n,r){var o=r(_e(this.rules,t,n,r).join(\"\"),\"\"),s=this.componentId+e;n.insertRules(s,s,o)},t.removeStyles=function(e,t){t.clearRules(this.componentId+e)},t.renderStyles=function(e,t,n,r){e>2&&X.registerId(this.componentId+e),this.removeStyles(e,n),this.createStyles(e,t,n,r)},e}();function $e(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),o=1;o meta tag to the stylesheet, or simply embedding it manually in your index.html section for a simpler app.\"),t.server&&h(d,e,t,o,n),l((function(){if(!t.server)return h(d,e,t,o,n),function(){return u.removeStyles(d,t)}}),[d,e,t,o,n]),null}function h(e,t,n,r,o){if(u.isStatic)u.renderStyles(e,P,n,o);else{var s=y({},t,{theme:Oe(t,r,d.defaultProps)});u.renderStyles(e,s,n,o)}}return\"production\"!==process.env.NODE_ENV&&Pe(a),r.memo(d)}function We(e){\"production\"!==process.env.NODE_ENV&&\"undefined\"!=typeof navigator&&\"ReactNative\"===navigator.product&&console.warn(\"`keyframes` cannot be used on ReactNative, only on the web. To do animation in ReactNative please use Animated.\");for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r\"+t+\"\"},this.getStyleTags=function(){return e.sealed?D(2):e._emitSheetCSS()},this.getStyleElement=function(){var t;if(e.sealed)return D(2);var n=((t={})[N]=\"\",t[\"data-styled-version\"]=\"5.3.11\",t.dangerouslySetInnerHTML={__html:e.instance.toString()},t),o=Y();return o&&(n.nonce=o),[r.createElement(\"style\",y({},n,{key:\"sc-0-0\"}))]},this.seal=function(){e.sealed=!0},this.instance=new X({isServer:!0}),this.sealed=!1}var t=e.prototype;return t.collectStyles=function(e){return this.sealed?D(2):r.createElement(me,{sheet:this.instance},e)},t.interleaveWithNodeStream=function(e){return D(3)},e}(),Je=function(e){var t=r.forwardRef((function(t,n){var o=s(Me),i=e.defaultProps,a=Oe(t,o,i);return\"production\"!==process.env.NODE_ENV&&void 0===a&&console.warn('[withTheme] You are not using a ThemeProvider nor passing a theme prop or a theme in defaultProps in component class \"'+b(e)+'\"'),r.createElement(e,y({},t,{theme:a,ref:n}))}));return m(t,e),t.displayName=\"WithTheme(\"+b(e)+\")\",t},Xe=function(){return s(Me)},Ze={StyleSheet:X,masterSheet:de};\"production\"!==process.env.NODE_ENV&&\"undefined\"!=typeof navigator&&\"ReactNative\"===navigator.product&&console.warn(\"It looks like you've imported 'styled-components' on React Native.\\nPerhaps you're looking to import 'styled-components/native'?\\nRead more about this at https://www.styled-components.com/docs/basics#react-native\"),\"production\"!==process.env.NODE_ENV&&\"test\"!==process.env.NODE_ENV&&\"undefined\"!=typeof window&&(window[\"__styled-components-init__\"]=window[\"__styled-components-init__\"]||0,1===window[\"__styled-components-init__\"]&&console.warn(\"It looks like there are several instances of 'styled-components' initialized in this application. This may cause dynamic styles to not render properly, errors during the rehydration process, a missing theme prop, and makes your application bigger without good reason.\\n\\nSee https://s-c.sh/2BAXzed for more info.\"),window[\"__styled-components-init__\"]+=1);export default qe;export{Ue as ServerStyleSheet,ue as StyleSheetConsumer,ce as StyleSheetContext,me as StyleSheetManager,Ge as ThemeConsumer,Me as ThemeContext,Le as ThemeProvider,Ze as __PRIVATE__,$e as createGlobalStyle,Ae as css,_ as isStyledComponent,We as keyframes,Xe as useTheme,A as version,Je as withTheme};\n//# sourceMappingURL=styled-components.browser.esm.js.map\n","/**\n * Lodash (Custom Build) \n * Build: `lodash modularize exports=\"npm\" -o ./`\n * Copyright OpenJS Foundation and other contributors \n * Released under MIT license \n * Based on Underscore.js 1.8.3 \n * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors\n */\n\n/** Used as the size to enable large array optimizations. */\nvar LARGE_ARRAY_SIZE = 200;\n\n/** Used to stand-in for `undefined` hash values. */\nvar HASH_UNDEFINED = '__lodash_hash_undefined__';\n\n/** Used to detect hot functions by number of calls within a span of milliseconds. */\nvar HOT_COUNT = 800,\n HOT_SPAN = 16;\n\n/** Used as references for various `Number` constants. */\nvar MAX_SAFE_INTEGER = 9007199254740991;\n\n/** `Object#toString` result references. */\nvar argsTag = '[object Arguments]',\n arrayTag = '[object Array]',\n asyncTag = '[object AsyncFunction]',\n boolTag = '[object Boolean]',\n dateTag = '[object Date]',\n errorTag = '[object Error]',\n funcTag = '[object Function]',\n genTag = '[object GeneratorFunction]',\n mapTag = '[object Map]',\n numberTag = '[object Number]',\n nullTag = '[object Null]',\n objectTag = '[object Object]',\n proxyTag = '[object Proxy]',\n regexpTag = '[object RegExp]',\n setTag = '[object Set]',\n stringTag = '[object String]',\n undefinedTag = '[object Undefined]',\n weakMapTag = '[object WeakMap]';\n\nvar arrayBufferTag = '[object ArrayBuffer]',\n dataViewTag = '[object DataView]',\n float32Tag = '[object Float32Array]',\n float64Tag = '[object Float64Array]',\n int8Tag = '[object Int8Array]',\n int16Tag = '[object Int16Array]',\n int32Tag = '[object Int32Array]',\n uint8Tag = '[object Uint8Array]',\n uint8ClampedTag = '[object Uint8ClampedArray]',\n uint16Tag = '[object Uint16Array]',\n uint32Tag = '[object Uint32Array]';\n\n/**\n * Used to match `RegExp`\n * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).\n */\nvar reRegExpChar = /[\\\\^$.*+?()[\\]{}|]/g;\n\n/** Used to detect host constructors (Safari). */\nvar reIsHostCtor = /^\\[object .+?Constructor\\]$/;\n\n/** Used to detect unsigned integer values. */\nvar reIsUint = /^(?:0|[1-9]\\d*)$/;\n\n/** Used to identify `toStringTag` values of typed arrays. */\nvar typedArrayTags = {};\ntypedArrayTags[float32Tag] = typedArrayTags[float64Tag] =\ntypedArrayTags[int8Tag] = typedArrayTags[int16Tag] =\ntypedArrayTags[int32Tag] = typedArrayTags[uint8Tag] =\ntypedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] =\ntypedArrayTags[uint32Tag] = true;\ntypedArrayTags[argsTag] = typedArrayTags[arrayTag] =\ntypedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] =\ntypedArrayTags[dataViewTag] = typedArrayTags[dateTag] =\ntypedArrayTags[errorTag] = typedArrayTags[funcTag] =\ntypedArrayTags[mapTag] = typedArrayTags[numberTag] =\ntypedArrayTags[objectTag] = typedArrayTags[regexpTag] =\ntypedArrayTags[setTag] = typedArrayTags[stringTag] =\ntypedArrayTags[weakMapTag] = false;\n\n/** Detect free variable `global` from Node.js. */\nvar freeGlobal = typeof global == 'object' && global && global.Object === Object && global;\n\n/** Detect free variable `self`. */\nvar freeSelf = typeof self == 'object' && self && self.Object === Object && self;\n\n/** Used as a reference to the global object. */\nvar root = freeGlobal || freeSelf || Function('return this')();\n\n/** Detect free variable `exports`. */\nvar freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports;\n\n/** Detect free variable `module`. */\nvar freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;\n\n/** Detect the popular CommonJS extension `module.exports`. */\nvar moduleExports = freeModule && freeModule.exports === freeExports;\n\n/** Detect free variable `process` from Node.js. */\nvar freeProcess = moduleExports && freeGlobal.process;\n\n/** Used to access faster Node.js helpers. */\nvar nodeUtil = (function() {\n try {\n // Use `util.types` for Node.js 10+.\n var types = freeModule && freeModule.require && freeModule.require('util').types;\n\n if (types) {\n return types;\n }\n\n // Legacy `process.binding('util')` for Node.js < 10.\n return freeProcess && freeProcess.binding && freeProcess.binding('util');\n } catch (e) {}\n}());\n\n/* Node.js helper references. */\nvar nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray;\n\n/**\n * A faster alternative to `Function#apply`, this function invokes `func`\n * with the `this` binding of `thisArg` and the arguments of `args`.\n *\n * @private\n * @param {Function} func The function to invoke.\n * @param {*} thisArg The `this` binding of `func`.\n * @param {Array} args The arguments to invoke `func` with.\n * @returns {*} Returns the result of `func`.\n */\nfunction apply(func, thisArg, args) {\n switch (args.length) {\n case 0: return func.call(thisArg);\n case 1: return func.call(thisArg, args[0]);\n case 2: return func.call(thisArg, args[0], args[1]);\n case 3: return func.call(thisArg, args[0], args[1], args[2]);\n }\n return func.apply(thisArg, args);\n}\n\n/**\n * The base implementation of `_.times` without support for iteratee shorthands\n * or max array length checks.\n *\n * @private\n * @param {number} n The number of times to invoke `iteratee`.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns the array of results.\n */\nfunction baseTimes(n, iteratee) {\n var index = -1,\n result = Array(n);\n\n while (++index < n) {\n result[index] = iteratee(index);\n }\n return result;\n}\n\n/**\n * The base implementation of `_.unary` without support for storing metadata.\n *\n * @private\n * @param {Function} func The function to cap arguments for.\n * @returns {Function} Returns the new capped function.\n */\nfunction baseUnary(func) {\n return function(value) {\n return func(value);\n };\n}\n\n/**\n * Gets the value at `key` of `object`.\n *\n * @private\n * @param {Object} [object] The object to query.\n * @param {string} key The key of the property to get.\n * @returns {*} Returns the property value.\n */\nfunction getValue(object, key) {\n return object == null ? undefined : object[key];\n}\n\n/**\n * Creates a unary function that invokes `func` with its argument transformed.\n *\n * @private\n * @param {Function} func The function to wrap.\n * @param {Function} transform The argument transform.\n * @returns {Function} Returns the new function.\n */\nfunction overArg(func, transform) {\n return function(arg) {\n return func(transform(arg));\n };\n}\n\n/** Used for built-in method references. */\nvar arrayProto = Array.prototype,\n funcProto = Function.prototype,\n objectProto = Object.prototype;\n\n/** Used to detect overreaching core-js shims. */\nvar coreJsData = root['__core-js_shared__'];\n\n/** Used to resolve the decompiled source of functions. */\nvar funcToString = funcProto.toString;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/** Used to detect methods masquerading as native. */\nvar maskSrcKey = (function() {\n var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');\n return uid ? ('Symbol(src)_1.' + uid) : '';\n}());\n\n/**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar nativeObjectToString = objectProto.toString;\n\n/** Used to infer the `Object` constructor. */\nvar objectCtorString = funcToString.call(Object);\n\n/** Used to detect if a method is native. */\nvar reIsNative = RegExp('^' +\n funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\\\$&')\n .replace(/hasOwnProperty|(function).*?(?=\\\\\\()| for .+?(?=\\\\\\])/g, '$1.*?') + '$'\n);\n\n/** Built-in value references. */\nvar Buffer = moduleExports ? root.Buffer : undefined,\n Symbol = root.Symbol,\n Uint8Array = root.Uint8Array,\n allocUnsafe = Buffer ? Buffer.allocUnsafe : undefined,\n getPrototype = overArg(Object.getPrototypeOf, Object),\n objectCreate = Object.create,\n propertyIsEnumerable = objectProto.propertyIsEnumerable,\n splice = arrayProto.splice,\n symToStringTag = Symbol ? Symbol.toStringTag : undefined;\n\nvar defineProperty = (function() {\n try {\n var func = getNative(Object, 'defineProperty');\n func({}, '', {});\n return func;\n } catch (e) {}\n}());\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined,\n nativeMax = Math.max,\n nativeNow = Date.now;\n\n/* Built-in method references that are verified to be native. */\nvar Map = getNative(root, 'Map'),\n nativeCreate = getNative(Object, 'create');\n\n/**\n * The base implementation of `_.create` without support for assigning\n * properties to the created object.\n *\n * @private\n * @param {Object} proto The object to inherit from.\n * @returns {Object} Returns the new object.\n */\nvar baseCreate = (function() {\n function object() {}\n return function(proto) {\n if (!isObject(proto)) {\n return {};\n }\n if (objectCreate) {\n return objectCreate(proto);\n }\n object.prototype = proto;\n var result = new object;\n object.prototype = undefined;\n return result;\n };\n}());\n\n/**\n * Creates a hash object.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction Hash(entries) {\n var index = -1,\n length = entries == null ? 0 : entries.length;\n\n this.clear();\n while (++index < length) {\n var entry = entries[index];\n this.set(entry[0], entry[1]);\n }\n}\n\n/**\n * Removes all key-value entries from the hash.\n *\n * @private\n * @name clear\n * @memberOf Hash\n */\nfunction hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n}\n\n/**\n * Removes `key` and its value from the hash.\n *\n * @private\n * @name delete\n * @memberOf Hash\n * @param {Object} hash The hash to modify.\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction hashDelete(key) {\n var result = this.has(key) && delete this.__data__[key];\n this.size -= result ? 1 : 0;\n return result;\n}\n\n/**\n * Gets the hash value for `key`.\n *\n * @private\n * @name get\n * @memberOf Hash\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction hashGet(key) {\n var data = this.__data__;\n if (nativeCreate) {\n var result = data[key];\n return result === HASH_UNDEFINED ? undefined : result;\n }\n return hasOwnProperty.call(data, key) ? data[key] : undefined;\n}\n\n/**\n * Checks if a hash value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf Hash\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction hashHas(key) {\n var data = this.__data__;\n return nativeCreate ? (data[key] !== undefined) : hasOwnProperty.call(data, key);\n}\n\n/**\n * Sets the hash `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf Hash\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the hash instance.\n */\nfunction hashSet(key, value) {\n var data = this.__data__;\n this.size += this.has(key) ? 0 : 1;\n data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;\n return this;\n}\n\n// Add methods to `Hash`.\nHash.prototype.clear = hashClear;\nHash.prototype['delete'] = hashDelete;\nHash.prototype.get = hashGet;\nHash.prototype.has = hashHas;\nHash.prototype.set = hashSet;\n\n/**\n * Creates an list cache object.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction ListCache(entries) {\n var index = -1,\n length = entries == null ? 0 : entries.length;\n\n this.clear();\n while (++index < length) {\n var entry = entries[index];\n this.set(entry[0], entry[1]);\n }\n}\n\n/**\n * Removes all key-value entries from the list cache.\n *\n * @private\n * @name clear\n * @memberOf ListCache\n */\nfunction listCacheClear() {\n this.__data__ = [];\n this.size = 0;\n}\n\n/**\n * Removes `key` and its value from the list cache.\n *\n * @private\n * @name delete\n * @memberOf ListCache\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction listCacheDelete(key) {\n var data = this.__data__,\n index = assocIndexOf(data, key);\n\n if (index < 0) {\n return false;\n }\n var lastIndex = data.length - 1;\n if (index == lastIndex) {\n data.pop();\n } else {\n splice.call(data, index, 1);\n }\n --this.size;\n return true;\n}\n\n/**\n * Gets the list cache value for `key`.\n *\n * @private\n * @name get\n * @memberOf ListCache\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction listCacheGet(key) {\n var data = this.__data__,\n index = assocIndexOf(data, key);\n\n return index < 0 ? undefined : data[index][1];\n}\n\n/**\n * Checks if a list cache value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf ListCache\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction listCacheHas(key) {\n return assocIndexOf(this.__data__, key) > -1;\n}\n\n/**\n * Sets the list cache `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf ListCache\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the list cache instance.\n */\nfunction listCacheSet(key, value) {\n var data = this.__data__,\n index = assocIndexOf(data, key);\n\n if (index < 0) {\n ++this.size;\n data.push([key, value]);\n } else {\n data[index][1] = value;\n }\n return this;\n}\n\n// Add methods to `ListCache`.\nListCache.prototype.clear = listCacheClear;\nListCache.prototype['delete'] = listCacheDelete;\nListCache.prototype.get = listCacheGet;\nListCache.prototype.has = listCacheHas;\nListCache.prototype.set = listCacheSet;\n\n/**\n * Creates a map cache object to store key-value pairs.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction MapCache(entries) {\n var index = -1,\n length = entries == null ? 0 : entries.length;\n\n this.clear();\n while (++index < length) {\n var entry = entries[index];\n this.set(entry[0], entry[1]);\n }\n}\n\n/**\n * Removes all key-value entries from the map.\n *\n * @private\n * @name clear\n * @memberOf MapCache\n */\nfunction mapCacheClear() {\n this.size = 0;\n this.__data__ = {\n 'hash': new Hash,\n 'map': new (Map || ListCache),\n 'string': new Hash\n };\n}\n\n/**\n * Removes `key` and its value from the map.\n *\n * @private\n * @name delete\n * @memberOf MapCache\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction mapCacheDelete(key) {\n var result = getMapData(this, key)['delete'](key);\n this.size -= result ? 1 : 0;\n return result;\n}\n\n/**\n * Gets the map value for `key`.\n *\n * @private\n * @name get\n * @memberOf MapCache\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction mapCacheGet(key) {\n return getMapData(this, key).get(key);\n}\n\n/**\n * Checks if a map value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf MapCache\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction mapCacheHas(key) {\n return getMapData(this, key).has(key);\n}\n\n/**\n * Sets the map `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf MapCache\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the map cache instance.\n */\nfunction mapCacheSet(key, value) {\n var data = getMapData(this, key),\n size = data.size;\n\n data.set(key, value);\n this.size += data.size == size ? 0 : 1;\n return this;\n}\n\n// Add methods to `MapCache`.\nMapCache.prototype.clear = mapCacheClear;\nMapCache.prototype['delete'] = mapCacheDelete;\nMapCache.prototype.get = mapCacheGet;\nMapCache.prototype.has = mapCacheHas;\nMapCache.prototype.set = mapCacheSet;\n\n/**\n * Creates a stack cache object to store key-value pairs.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction Stack(entries) {\n var data = this.__data__ = new ListCache(entries);\n this.size = data.size;\n}\n\n/**\n * Removes all key-value entries from the stack.\n *\n * @private\n * @name clear\n * @memberOf Stack\n */\nfunction stackClear() {\n this.__data__ = new ListCache;\n this.size = 0;\n}\n\n/**\n * Removes `key` and its value from the stack.\n *\n * @private\n * @name delete\n * @memberOf Stack\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction stackDelete(key) {\n var data = this.__data__,\n result = data['delete'](key);\n\n this.size = data.size;\n return result;\n}\n\n/**\n * Gets the stack value for `key`.\n *\n * @private\n * @name get\n * @memberOf Stack\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction stackGet(key) {\n return this.__data__.get(key);\n}\n\n/**\n * Checks if a stack value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf Stack\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction stackHas(key) {\n return this.__data__.has(key);\n}\n\n/**\n * Sets the stack `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf Stack\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the stack cache instance.\n */\nfunction stackSet(key, value) {\n var data = this.__data__;\n if (data instanceof ListCache) {\n var pairs = data.__data__;\n if (!Map || (pairs.length < LARGE_ARRAY_SIZE - 1)) {\n pairs.push([key, value]);\n this.size = ++data.size;\n return this;\n }\n data = this.__data__ = new MapCache(pairs);\n }\n data.set(key, value);\n this.size = data.size;\n return this;\n}\n\n// Add methods to `Stack`.\nStack.prototype.clear = stackClear;\nStack.prototype['delete'] = stackDelete;\nStack.prototype.get = stackGet;\nStack.prototype.has = stackHas;\nStack.prototype.set = stackSet;\n\n/**\n * Creates an array of the enumerable property names of the array-like `value`.\n *\n * @private\n * @param {*} value The value to query.\n * @param {boolean} inherited Specify returning inherited property names.\n * @returns {Array} Returns the array of property names.\n */\nfunction arrayLikeKeys(value, inherited) {\n var isArr = isArray(value),\n isArg = !isArr && isArguments(value),\n isBuff = !isArr && !isArg && isBuffer(value),\n isType = !isArr && !isArg && !isBuff && isTypedArray(value),\n skipIndexes = isArr || isArg || isBuff || isType,\n result = skipIndexes ? baseTimes(value.length, String) : [],\n length = result.length;\n\n for (var key in value) {\n if ((inherited || hasOwnProperty.call(value, key)) &&\n !(skipIndexes && (\n // Safari 9 has enumerable `arguments.length` in strict mode.\n key == 'length' ||\n // Node.js 0.10 has enumerable non-index properties on buffers.\n (isBuff && (key == 'offset' || key == 'parent')) ||\n // PhantomJS 2 has enumerable non-index properties on typed arrays.\n (isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset')) ||\n // Skip index properties.\n isIndex(key, length)\n ))) {\n result.push(key);\n }\n }\n return result;\n}\n\n/**\n * This function is like `assignValue` except that it doesn't assign\n * `undefined` values.\n *\n * @private\n * @param {Object} object The object to modify.\n * @param {string} key The key of the property to assign.\n * @param {*} value The value to assign.\n */\nfunction assignMergeValue(object, key, value) {\n if ((value !== undefined && !eq(object[key], value)) ||\n (value === undefined && !(key in object))) {\n baseAssignValue(object, key, value);\n }\n}\n\n/**\n * Assigns `value` to `key` of `object` if the existing value is not equivalent\n * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * for equality comparisons.\n *\n * @private\n * @param {Object} object The object to modify.\n * @param {string} key The key of the property to assign.\n * @param {*} value The value to assign.\n */\nfunction assignValue(object, key, value) {\n var objValue = object[key];\n if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) ||\n (value === undefined && !(key in object))) {\n baseAssignValue(object, key, value);\n }\n}\n\n/**\n * Gets the index at which the `key` is found in `array` of key-value pairs.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {*} key The key to search for.\n * @returns {number} Returns the index of the matched value, else `-1`.\n */\nfunction assocIndexOf(array, key) {\n var length = array.length;\n while (length--) {\n if (eq(array[length][0], key)) {\n return length;\n }\n }\n return -1;\n}\n\n/**\n * The base implementation of `assignValue` and `assignMergeValue` without\n * value checks.\n *\n * @private\n * @param {Object} object The object to modify.\n * @param {string} key The key of the property to assign.\n * @param {*} value The value to assign.\n */\nfunction baseAssignValue(object, key, value) {\n if (key == '__proto__' && defineProperty) {\n defineProperty(object, key, {\n 'configurable': true,\n 'enumerable': true,\n 'value': value,\n 'writable': true\n });\n } else {\n object[key] = value;\n }\n}\n\n/**\n * The base implementation of `baseForOwn` which iterates over `object`\n * properties returned by `keysFunc` and invokes `iteratee` for each property.\n * Iteratee functions may exit iteration early by explicitly returning `false`.\n *\n * @private\n * @param {Object} object The object to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @param {Function} keysFunc The function to get the keys of `object`.\n * @returns {Object} Returns `object`.\n */\nvar baseFor = createBaseFor();\n\n/**\n * The base implementation of `getTag` without fallbacks for buggy environments.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the `toStringTag`.\n */\nfunction baseGetTag(value) {\n if (value == null) {\n return value === undefined ? undefinedTag : nullTag;\n }\n return (symToStringTag && symToStringTag in Object(value))\n ? getRawTag(value)\n : objectToString(value);\n}\n\n/**\n * The base implementation of `_.isArguments`.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an `arguments` object,\n */\nfunction baseIsArguments(value) {\n return isObjectLike(value) && baseGetTag(value) == argsTag;\n}\n\n/**\n * The base implementation of `_.isNative` without bad shim checks.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a native function,\n * else `false`.\n */\nfunction baseIsNative(value) {\n if (!isObject(value) || isMasked(value)) {\n return false;\n }\n var pattern = isFunction(value) ? reIsNative : reIsHostCtor;\n return pattern.test(toSource(value));\n}\n\n/**\n * The base implementation of `_.isTypedArray` without Node.js optimizations.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.\n */\nfunction baseIsTypedArray(value) {\n return isObjectLike(value) &&\n isLength(value.length) && !!typedArrayTags[baseGetTag(value)];\n}\n\n/**\n * The base implementation of `_.keysIn` which doesn't treat sparse arrays as dense.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n */\nfunction baseKeysIn(object) {\n if (!isObject(object)) {\n return nativeKeysIn(object);\n }\n var isProto = isPrototype(object),\n result = [];\n\n for (var key in object) {\n if (!(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) {\n result.push(key);\n }\n }\n return result;\n}\n\n/**\n * The base implementation of `_.merge` without support for multiple sources.\n *\n * @private\n * @param {Object} object The destination object.\n * @param {Object} source The source object.\n * @param {number} srcIndex The index of `source`.\n * @param {Function} [customizer] The function to customize merged values.\n * @param {Object} [stack] Tracks traversed source values and their merged\n * counterparts.\n */\nfunction baseMerge(object, source, srcIndex, customizer, stack) {\n if (object === source) {\n return;\n }\n baseFor(source, function(srcValue, key) {\n stack || (stack = new Stack);\n if (isObject(srcValue)) {\n baseMergeDeep(object, source, key, srcIndex, baseMerge, customizer, stack);\n }\n else {\n var newValue = customizer\n ? customizer(safeGet(object, key), srcValue, (key + ''), object, source, stack)\n : undefined;\n\n if (newValue === undefined) {\n newValue = srcValue;\n }\n assignMergeValue(object, key, newValue);\n }\n }, keysIn);\n}\n\n/**\n * A specialized version of `baseMerge` for arrays and objects which performs\n * deep merges and tracks traversed objects enabling objects with circular\n * references to be merged.\n *\n * @private\n * @param {Object} object The destination object.\n * @param {Object} source The source object.\n * @param {string} key The key of the value to merge.\n * @param {number} srcIndex The index of `source`.\n * @param {Function} mergeFunc The function to merge values.\n * @param {Function} [customizer] The function to customize assigned values.\n * @param {Object} [stack] Tracks traversed source values and their merged\n * counterparts.\n */\nfunction baseMergeDeep(object, source, key, srcIndex, mergeFunc, customizer, stack) {\n var objValue = safeGet(object, key),\n srcValue = safeGet(source, key),\n stacked = stack.get(srcValue);\n\n if (stacked) {\n assignMergeValue(object, key, stacked);\n return;\n }\n var newValue = customizer\n ? customizer(objValue, srcValue, (key + ''), object, source, stack)\n : undefined;\n\n var isCommon = newValue === undefined;\n\n if (isCommon) {\n var isArr = isArray(srcValue),\n isBuff = !isArr && isBuffer(srcValue),\n isTyped = !isArr && !isBuff && isTypedArray(srcValue);\n\n newValue = srcValue;\n if (isArr || isBuff || isTyped) {\n if (isArray(objValue)) {\n newValue = objValue;\n }\n else if (isArrayLikeObject(objValue)) {\n newValue = copyArray(objValue);\n }\n else if (isBuff) {\n isCommon = false;\n newValue = cloneBuffer(srcValue, true);\n }\n else if (isTyped) {\n isCommon = false;\n newValue = cloneTypedArray(srcValue, true);\n }\n else {\n newValue = [];\n }\n }\n else if (isPlainObject(srcValue) || isArguments(srcValue)) {\n newValue = objValue;\n if (isArguments(objValue)) {\n newValue = toPlainObject(objValue);\n }\n else if (!isObject(objValue) || isFunction(objValue)) {\n newValue = initCloneObject(srcValue);\n }\n }\n else {\n isCommon = false;\n }\n }\n if (isCommon) {\n // Recursively merge objects and arrays (susceptible to call stack limits).\n stack.set(srcValue, newValue);\n mergeFunc(newValue, srcValue, srcIndex, customizer, stack);\n stack['delete'](srcValue);\n }\n assignMergeValue(object, key, newValue);\n}\n\n/**\n * The base implementation of `_.rest` which doesn't validate or coerce arguments.\n *\n * @private\n * @param {Function} func The function to apply a rest parameter to.\n * @param {number} [start=func.length-1] The start position of the rest parameter.\n * @returns {Function} Returns the new function.\n */\nfunction baseRest(func, start) {\n return setToString(overRest(func, start, identity), func + '');\n}\n\n/**\n * The base implementation of `setToString` without support for hot loop shorting.\n *\n * @private\n * @param {Function} func The function to modify.\n * @param {Function} string The `toString` result.\n * @returns {Function} Returns `func`.\n */\nvar baseSetToString = !defineProperty ? identity : function(func, string) {\n return defineProperty(func, 'toString', {\n 'configurable': true,\n 'enumerable': false,\n 'value': constant(string),\n 'writable': true\n });\n};\n\n/**\n * Creates a clone of `buffer`.\n *\n * @private\n * @param {Buffer} buffer The buffer to clone.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Buffer} Returns the cloned buffer.\n */\nfunction cloneBuffer(buffer, isDeep) {\n if (isDeep) {\n return buffer.slice();\n }\n var length = buffer.length,\n result = allocUnsafe ? allocUnsafe(length) : new buffer.constructor(length);\n\n buffer.copy(result);\n return result;\n}\n\n/**\n * Creates a clone of `arrayBuffer`.\n *\n * @private\n * @param {ArrayBuffer} arrayBuffer The array buffer to clone.\n * @returns {ArrayBuffer} Returns the cloned array buffer.\n */\nfunction cloneArrayBuffer(arrayBuffer) {\n var result = new arrayBuffer.constructor(arrayBuffer.byteLength);\n new Uint8Array(result).set(new Uint8Array(arrayBuffer));\n return result;\n}\n\n/**\n * Creates a clone of `typedArray`.\n *\n * @private\n * @param {Object} typedArray The typed array to clone.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Object} Returns the cloned typed array.\n */\nfunction cloneTypedArray(typedArray, isDeep) {\n var buffer = isDeep ? cloneArrayBuffer(typedArray.buffer) : typedArray.buffer;\n return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length);\n}\n\n/**\n * Copies the values of `source` to `array`.\n *\n * @private\n * @param {Array} source The array to copy values from.\n * @param {Array} [array=[]] The array to copy values to.\n * @returns {Array} Returns `array`.\n */\nfunction copyArray(source, array) {\n var index = -1,\n length = source.length;\n\n array || (array = Array(length));\n while (++index < length) {\n array[index] = source[index];\n }\n return array;\n}\n\n/**\n * Copies properties of `source` to `object`.\n *\n * @private\n * @param {Object} source The object to copy properties from.\n * @param {Array} props The property identifiers to copy.\n * @param {Object} [object={}] The object to copy properties to.\n * @param {Function} [customizer] The function to customize copied values.\n * @returns {Object} Returns `object`.\n */\nfunction copyObject(source, props, object, customizer) {\n var isNew = !object;\n object || (object = {});\n\n var index = -1,\n length = props.length;\n\n while (++index < length) {\n var key = props[index];\n\n var newValue = customizer\n ? customizer(object[key], source[key], key, object, source)\n : undefined;\n\n if (newValue === undefined) {\n newValue = source[key];\n }\n if (isNew) {\n baseAssignValue(object, key, newValue);\n } else {\n assignValue(object, key, newValue);\n }\n }\n return object;\n}\n\n/**\n * Creates a function like `_.assign`.\n *\n * @private\n * @param {Function} assigner The function to assign values.\n * @returns {Function} Returns the new assigner function.\n */\nfunction createAssigner(assigner) {\n return baseRest(function(object, sources) {\n var index = -1,\n length = sources.length,\n customizer = length > 1 ? sources[length - 1] : undefined,\n guard = length > 2 ? sources[2] : undefined;\n\n customizer = (assigner.length > 3 && typeof customizer == 'function')\n ? (length--, customizer)\n : undefined;\n\n if (guard && isIterateeCall(sources[0], sources[1], guard)) {\n customizer = length < 3 ? undefined : customizer;\n length = 1;\n }\n object = Object(object);\n while (++index < length) {\n var source = sources[index];\n if (source) {\n assigner(object, source, index, customizer);\n }\n }\n return object;\n });\n}\n\n/**\n * Creates a base function for methods like `_.forIn` and `_.forOwn`.\n *\n * @private\n * @param {boolean} [fromRight] Specify iterating from right to left.\n * @returns {Function} Returns the new base function.\n */\nfunction createBaseFor(fromRight) {\n return function(object, iteratee, keysFunc) {\n var index = -1,\n iterable = Object(object),\n props = keysFunc(object),\n length = props.length;\n\n while (length--) {\n var key = props[fromRight ? length : ++index];\n if (iteratee(iterable[key], key, iterable) === false) {\n break;\n }\n }\n return object;\n };\n}\n\n/**\n * Gets the data for `map`.\n *\n * @private\n * @param {Object} map The map to query.\n * @param {string} key The reference key.\n * @returns {*} Returns the map data.\n */\nfunction getMapData(map, key) {\n var data = map.__data__;\n return isKeyable(key)\n ? data[typeof key == 'string' ? 'string' : 'hash']\n : data.map;\n}\n\n/**\n * Gets the native function at `key` of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {string} key The key of the method to get.\n * @returns {*} Returns the function if it's native, else `undefined`.\n */\nfunction getNative(object, key) {\n var value = getValue(object, key);\n return baseIsNative(value) ? value : undefined;\n}\n\n/**\n * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the raw `toStringTag`.\n */\nfunction getRawTag(value) {\n var isOwn = hasOwnProperty.call(value, symToStringTag),\n tag = value[symToStringTag];\n\n try {\n value[symToStringTag] = undefined;\n var unmasked = true;\n } catch (e) {}\n\n var result = nativeObjectToString.call(value);\n if (unmasked) {\n if (isOwn) {\n value[symToStringTag] = tag;\n } else {\n delete value[symToStringTag];\n }\n }\n return result;\n}\n\n/**\n * Initializes an object clone.\n *\n * @private\n * @param {Object} object The object to clone.\n * @returns {Object} Returns the initialized clone.\n */\nfunction initCloneObject(object) {\n return (typeof object.constructor == 'function' && !isPrototype(object))\n ? baseCreate(getPrototype(object))\n : {};\n}\n\n/**\n * Checks if `value` is a valid array-like index.\n *\n * @private\n * @param {*} value The value to check.\n * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.\n * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.\n */\nfunction isIndex(value, length) {\n var type = typeof value;\n length = length == null ? MAX_SAFE_INTEGER : length;\n\n return !!length &&\n (type == 'number' ||\n (type != 'symbol' && reIsUint.test(value))) &&\n (value > -1 && value % 1 == 0 && value < length);\n}\n\n/**\n * Checks if the given arguments are from an iteratee call.\n *\n * @private\n * @param {*} value The potential iteratee value argument.\n * @param {*} index The potential iteratee index or key argument.\n * @param {*} object The potential iteratee object argument.\n * @returns {boolean} Returns `true` if the arguments are from an iteratee call,\n * else `false`.\n */\nfunction isIterateeCall(value, index, object) {\n if (!isObject(object)) {\n return false;\n }\n var type = typeof index;\n if (type == 'number'\n ? (isArrayLike(object) && isIndex(index, object.length))\n : (type == 'string' && index in object)\n ) {\n return eq(object[index], value);\n }\n return false;\n}\n\n/**\n * Checks if `value` is suitable for use as unique object key.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is suitable, else `false`.\n */\nfunction isKeyable(value) {\n var type = typeof value;\n return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')\n ? (value !== '__proto__')\n : (value === null);\n}\n\n/**\n * Checks if `func` has its source masked.\n *\n * @private\n * @param {Function} func The function to check.\n * @returns {boolean} Returns `true` if `func` is masked, else `false`.\n */\nfunction isMasked(func) {\n return !!maskSrcKey && (maskSrcKey in func);\n}\n\n/**\n * Checks if `value` is likely a prototype object.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a prototype, else `false`.\n */\nfunction isPrototype(value) {\n var Ctor = value && value.constructor,\n proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto;\n\n return value === proto;\n}\n\n/**\n * This function is like\n * [`Object.keys`](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)\n * except that it includes inherited enumerable properties.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n */\nfunction nativeKeysIn(object) {\n var result = [];\n if (object != null) {\n for (var key in Object(object)) {\n result.push(key);\n }\n }\n return result;\n}\n\n/**\n * Converts `value` to a string using `Object.prototype.toString`.\n *\n * @private\n * @param {*} value The value to convert.\n * @returns {string} Returns the converted string.\n */\nfunction objectToString(value) {\n return nativeObjectToString.call(value);\n}\n\n/**\n * A specialized version of `baseRest` which transforms the rest array.\n *\n * @private\n * @param {Function} func The function to apply a rest parameter to.\n * @param {number} [start=func.length-1] The start position of the rest parameter.\n * @param {Function} transform The rest array transform.\n * @returns {Function} Returns the new function.\n */\nfunction overRest(func, start, transform) {\n start = nativeMax(start === undefined ? (func.length - 1) : start, 0);\n return function() {\n var args = arguments,\n index = -1,\n length = nativeMax(args.length - start, 0),\n array = Array(length);\n\n while (++index < length) {\n array[index] = args[start + index];\n }\n index = -1;\n var otherArgs = Array(start + 1);\n while (++index < start) {\n otherArgs[index] = args[index];\n }\n otherArgs[start] = transform(array);\n return apply(func, this, otherArgs);\n };\n}\n\n/**\n * Gets the value at `key`, unless `key` is \"__proto__\" or \"constructor\".\n *\n * @private\n * @param {Object} object The object to query.\n * @param {string} key The key of the property to get.\n * @returns {*} Returns the property value.\n */\nfunction safeGet(object, key) {\n if (key === 'constructor' && typeof object[key] === 'function') {\n return;\n }\n\n if (key == '__proto__') {\n return;\n }\n\n return object[key];\n}\n\n/**\n * Sets the `toString` method of `func` to return `string`.\n *\n * @private\n * @param {Function} func The function to modify.\n * @param {Function} string The `toString` result.\n * @returns {Function} Returns `func`.\n */\nvar setToString = shortOut(baseSetToString);\n\n/**\n * Creates a function that'll short out and invoke `identity` instead\n * of `func` when it's called `HOT_COUNT` or more times in `HOT_SPAN`\n * milliseconds.\n *\n * @private\n * @param {Function} func The function to restrict.\n * @returns {Function} Returns the new shortable function.\n */\nfunction shortOut(func) {\n var count = 0,\n lastCalled = 0;\n\n return function() {\n var stamp = nativeNow(),\n remaining = HOT_SPAN - (stamp - lastCalled);\n\n lastCalled = stamp;\n if (remaining > 0) {\n if (++count >= HOT_COUNT) {\n return arguments[0];\n }\n } else {\n count = 0;\n }\n return func.apply(undefined, arguments);\n };\n}\n\n/**\n * Converts `func` to its source code.\n *\n * @private\n * @param {Function} func The function to convert.\n * @returns {string} Returns the source code.\n */\nfunction toSource(func) {\n if (func != null) {\n try {\n return funcToString.call(func);\n } catch (e) {}\n try {\n return (func + '');\n } catch (e) {}\n }\n return '';\n}\n\n/**\n * Performs a\n * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * comparison between two values to determine if they are equivalent.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n * @example\n *\n * var object = { 'a': 1 };\n * var other = { 'a': 1 };\n *\n * _.eq(object, object);\n * // => true\n *\n * _.eq(object, other);\n * // => false\n *\n * _.eq('a', 'a');\n * // => true\n *\n * _.eq('a', Object('a'));\n * // => false\n *\n * _.eq(NaN, NaN);\n * // => true\n */\nfunction eq(value, other) {\n return value === other || (value !== value && other !== other);\n}\n\n/**\n * Checks if `value` is likely an `arguments` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an `arguments` object,\n * else `false`.\n * @example\n *\n * _.isArguments(function() { return arguments; }());\n * // => true\n *\n * _.isArguments([1, 2, 3]);\n * // => false\n */\nvar isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) {\n return isObjectLike(value) && hasOwnProperty.call(value, 'callee') &&\n !propertyIsEnumerable.call(value, 'callee');\n};\n\n/**\n * Checks if `value` is classified as an `Array` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an array, else `false`.\n * @example\n *\n * _.isArray([1, 2, 3]);\n * // => true\n *\n * _.isArray(document.body.children);\n * // => false\n *\n * _.isArray('abc');\n * // => false\n *\n * _.isArray(_.noop);\n * // => false\n */\nvar isArray = Array.isArray;\n\n/**\n * Checks if `value` is array-like. A value is considered array-like if it's\n * not a function and has a `value.length` that's an integer greater than or\n * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is array-like, else `false`.\n * @example\n *\n * _.isArrayLike([1, 2, 3]);\n * // => true\n *\n * _.isArrayLike(document.body.children);\n * // => true\n *\n * _.isArrayLike('abc');\n * // => true\n *\n * _.isArrayLike(_.noop);\n * // => false\n */\nfunction isArrayLike(value) {\n return value != null && isLength(value.length) && !isFunction(value);\n}\n\n/**\n * This method is like `_.isArrayLike` except that it also checks if `value`\n * is an object.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an array-like object,\n * else `false`.\n * @example\n *\n * _.isArrayLikeObject([1, 2, 3]);\n * // => true\n *\n * _.isArrayLikeObject(document.body.children);\n * // => true\n *\n * _.isArrayLikeObject('abc');\n * // => false\n *\n * _.isArrayLikeObject(_.noop);\n * // => false\n */\nfunction isArrayLikeObject(value) {\n return isObjectLike(value) && isArrayLike(value);\n}\n\n/**\n * Checks if `value` is a buffer.\n *\n * @static\n * @memberOf _\n * @since 4.3.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a buffer, else `false`.\n * @example\n *\n * _.isBuffer(new Buffer(2));\n * // => true\n *\n * _.isBuffer(new Uint8Array(2));\n * // => false\n */\nvar isBuffer = nativeIsBuffer || stubFalse;\n\n/**\n * Checks if `value` is classified as a `Function` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a function, else `false`.\n * @example\n *\n * _.isFunction(_);\n * // => true\n *\n * _.isFunction(/abc/);\n * // => false\n */\nfunction isFunction(value) {\n if (!isObject(value)) {\n return false;\n }\n // The use of `Object#toString` avoids issues with the `typeof` operator\n // in Safari 9 which returns 'object' for typed arrays and other constructors.\n var tag = baseGetTag(value);\n return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag;\n}\n\n/**\n * Checks if `value` is a valid array-like length.\n *\n * **Note:** This method is loosely based on\n * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.\n * @example\n *\n * _.isLength(3);\n * // => true\n *\n * _.isLength(Number.MIN_VALUE);\n * // => false\n *\n * _.isLength(Infinity);\n * // => false\n *\n * _.isLength('3');\n * // => false\n */\nfunction isLength(value) {\n return typeof value == 'number' &&\n value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;\n}\n\n/**\n * Checks if `value` is the\n * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)\n * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an object, else `false`.\n * @example\n *\n * _.isObject({});\n * // => true\n *\n * _.isObject([1, 2, 3]);\n * // => true\n *\n * _.isObject(_.noop);\n * // => true\n *\n * _.isObject(null);\n * // => false\n */\nfunction isObject(value) {\n var type = typeof value;\n return value != null && (type == 'object' || type == 'function');\n}\n\n/**\n * Checks if `value` is object-like. A value is object-like if it's not `null`\n * and has a `typeof` result of \"object\".\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is object-like, else `false`.\n * @example\n *\n * _.isObjectLike({});\n * // => true\n *\n * _.isObjectLike([1, 2, 3]);\n * // => true\n *\n * _.isObjectLike(_.noop);\n * // => false\n *\n * _.isObjectLike(null);\n * // => false\n */\nfunction isObjectLike(value) {\n return value != null && typeof value == 'object';\n}\n\n/**\n * Checks if `value` is a plain object, that is, an object created by the\n * `Object` constructor or one with a `[[Prototype]]` of `null`.\n *\n * @static\n * @memberOf _\n * @since 0.8.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a plain object, else `false`.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * }\n *\n * _.isPlainObject(new Foo);\n * // => false\n *\n * _.isPlainObject([1, 2, 3]);\n * // => false\n *\n * _.isPlainObject({ 'x': 0, 'y': 0 });\n * // => true\n *\n * _.isPlainObject(Object.create(null));\n * // => true\n */\nfunction isPlainObject(value) {\n if (!isObjectLike(value) || baseGetTag(value) != objectTag) {\n return false;\n }\n var proto = getPrototype(value);\n if (proto === null) {\n return true;\n }\n var Ctor = hasOwnProperty.call(proto, 'constructor') && proto.constructor;\n return typeof Ctor == 'function' && Ctor instanceof Ctor &&\n funcToString.call(Ctor) == objectCtorString;\n}\n\n/**\n * Checks if `value` is classified as a typed array.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.\n * @example\n *\n * _.isTypedArray(new Uint8Array);\n * // => true\n *\n * _.isTypedArray([]);\n * // => false\n */\nvar isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;\n\n/**\n * Converts `value` to a plain object flattening inherited enumerable string\n * keyed properties of `value` to own properties of the plain object.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Lang\n * @param {*} value The value to convert.\n * @returns {Object} Returns the converted plain object.\n * @example\n *\n * function Foo() {\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.assign({ 'a': 1 }, new Foo);\n * // => { 'a': 1, 'b': 2 }\n *\n * _.assign({ 'a': 1 }, _.toPlainObject(new Foo));\n * // => { 'a': 1, 'b': 2, 'c': 3 }\n */\nfunction toPlainObject(value) {\n return copyObject(value, keysIn(value));\n}\n\n/**\n * Creates an array of the own and inherited enumerable property names of `object`.\n *\n * **Note:** Non-object values are coerced to objects.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Object\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.keysIn(new Foo);\n * // => ['a', 'b', 'c'] (iteration order is not guaranteed)\n */\nfunction keysIn(object) {\n return isArrayLike(object) ? arrayLikeKeys(object, true) : baseKeysIn(object);\n}\n\n/**\n * This method is like `_.assign` except that it recursively merges own and\n * inherited enumerable string keyed properties of source objects into the\n * destination object. Source properties that resolve to `undefined` are\n * skipped if a destination value exists. Array and plain object properties\n * are merged recursively. Other objects and value types are overridden by\n * assignment. Source objects are applied from left to right. Subsequent\n * sources overwrite property assignments of previous sources.\n *\n * **Note:** This method mutates `object`.\n *\n * @static\n * @memberOf _\n * @since 0.5.0\n * @category Object\n * @param {Object} object The destination object.\n * @param {...Object} [sources] The source objects.\n * @returns {Object} Returns `object`.\n * @example\n *\n * var object = {\n * 'a': [{ 'b': 2 }, { 'd': 4 }]\n * };\n *\n * var other = {\n * 'a': [{ 'c': 3 }, { 'e': 5 }]\n * };\n *\n * _.merge(object, other);\n * // => { 'a': [{ 'b': 2, 'c': 3 }, { 'd': 4, 'e': 5 }] }\n */\nvar merge = createAssigner(function(object, source, srcIndex) {\n baseMerge(object, source, srcIndex);\n});\n\n/**\n * Creates a function that returns `value`.\n *\n * @static\n * @memberOf _\n * @since 2.4.0\n * @category Util\n * @param {*} value The value to return from the new function.\n * @returns {Function} Returns the new constant function.\n * @example\n *\n * var objects = _.times(2, _.constant({ 'a': 1 }));\n *\n * console.log(objects);\n * // => [{ 'a': 1 }, { 'a': 1 }]\n *\n * console.log(objects[0] === objects[1]);\n * // => true\n */\nfunction constant(value) {\n return function() {\n return value;\n };\n}\n\n/**\n * This method returns the first argument it receives.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Util\n * @param {*} value Any value.\n * @returns {*} Returns `value`.\n * @example\n *\n * var object = { 'a': 1 };\n *\n * console.log(_.identity(object) === object);\n * // => true\n */\nfunction identity(value) {\n return value;\n}\n\n/**\n * This method returns `false`.\n *\n * @static\n * @memberOf _\n * @since 4.13.0\n * @category Util\n * @returns {boolean} Returns `false`.\n * @example\n *\n * _.times(2, _.stubFalse);\n * // => [false, false]\n */\nfunction stubFalse() {\n return false;\n}\n\nmodule.exports = merge;\n","import _defineProperty from \"@babel/runtime/helpers/defineProperty\";\nexport var record = function record(keys, valueType) {\n return keys.reduce(function (toObject, key) {\n return Object.assign(toObject, _defineProperty({}, key, valueType));\n }, {});\n};","function _arrayLikeToArray(r, a) {\n (null == a || a > r.length) && (a = r.length);\n for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e];\n return n;\n}\nexport { _arrayLikeToArray as default };","import arrayLikeToArray from \"./arrayLikeToArray.js\";\nfunction _arrayWithoutHoles(r) {\n if (Array.isArray(r)) return arrayLikeToArray(r);\n}\nexport { _arrayWithoutHoles as default };","function _iterableToArray(r) {\n if (\"undefined\" != typeof Symbol && null != r[Symbol.iterator] || null != r[\"@@iterator\"]) return Array.from(r);\n}\nexport { _iterableToArray as default };","import arrayLikeToArray from \"./arrayLikeToArray.js\";\nfunction _unsupportedIterableToArray(r, a) {\n if (r) {\n if (\"string\" == typeof r) return arrayLikeToArray(r, a);\n var t = {}.toString.call(r).slice(8, -1);\n return \"Object\" === t && r.constructor && (t = r.constructor.name), \"Map\" === t || \"Set\" === t ? Array.from(r) : \"Arguments\" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? arrayLikeToArray(r, a) : void 0;\n }\n}\nexport { _unsupportedIterableToArray as default };","function _nonIterableSpread() {\n throw new TypeError(\"Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\");\n}\nexport { _nonIterableSpread as default };","import arrayWithoutHoles from \"./arrayWithoutHoles.js\";\nimport iterableToArray from \"./iterableToArray.js\";\nimport unsupportedIterableToArray from \"./unsupportedIterableToArray.js\";\nimport nonIterableSpread from \"./nonIterableSpread.js\";\nfunction _toConsumableArray(r) {\n return arrayWithoutHoles(r) || iterableToArray(r) || unsupportedIterableToArray(r) || nonIterableSpread();\n}\nexport { _toConsumableArray as default };","import _toConsumableArray from \"@babel/runtime/helpers/toConsumableArray\";\nexport function generateClassNames(componentName, subClassNames) {\n var generateClassName = function generateClassName(subClassName) {\n return \"Sfx\".concat(componentName).concat(subClassName ? \"-\".concat(subClassName) : '');\n };\n var classNameArray = [];\n if (subClassNames) {\n if (Array.isArray(subClassNames)) {\n classNameArray.push.apply(classNameArray, _toConsumableArray(subClassNames.filter(function (subClassName) {\n return typeof subClassName === 'string';\n }).map(function (subClassName) {\n return generateClassName(subClassName);\n })));\n } else if (typeof subClassNames === 'string') {\n classNameArray.push(generateClassName(subClassNames));\n }\n }\n if (classNameArray.length === 0) {\n classNameArray.push(generateClassName());\n }\n return classNameArray.join(' ');\n}","import { forwardRef } from 'react';\n/**\r\n * Wrapper around React's `forwardRef` function, which adds a `displayName` to each component\r\n * created using it\r\n */\nexport function intrinsicComponent(render, displayName) {\n var component = /*#__PURE__*/forwardRef(render);\n // eslint-disable-next-line immutable/no-mutation\n component.displayName = displayName || render.name;\n return component;\n}","/**\r\n * Type-safe Object.keys\r\n */\nexport function objectKeys(object) {\n return Object.keys(object);\n}","/**\r\n * Type-safe Object.values\r\n */\nexport function objectValues(object) {\n return Object.values(object);\n}","/**\r\n * If your prop can be either a function or a plain value, this function handles\r\n * its usage for you – just provide the reference for a 'maybe function' and the arguments\r\n * to call it with\r\n */\nexport function applyPolymorphicFunctionProp(prop) {\n for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n args[_key - 1] = arguments[_key];\n }\n return typeof prop === 'function' ? prop.apply(void 0, args) : prop;\n}","import _defineProperty from \"@babel/runtime/helpers/defineProperty\";\n/**\r\n * If you are using a namespace for your styled components, this can come in handy giving each\r\n * styled component in this namespace a displayName which gives better debugging experience\r\n */\nexport function applyDisplayNames(styledObject) {\n return Object.keys(styledObject).reduce(function (newStyledObject, styledComponentName) {\n var styledComponent = styledObject[styledComponentName];\n styledComponent.displayName = \"\".concat(styledComponentName);\n return Object.assign(newStyledObject, _defineProperty({}, styledComponentName, styledComponent));\n }, {});\n}","/**\r\n * passes {value} to {ref}\r\n * Useful if you want to expose the ref of an inner component to the public API\r\n * while still using it inside the component.\r\n * @param ref A ref callback or ref object. If anything falsy, this is a no-op.\r\n */\nexport default function setRef(ref, value) {\n if (typeof ref === 'function') {\n ref(value);\n } else if (ref) {\n ref.current = value;\n }\n}","import * as React from 'react';\nimport setRef from './set-ref';\nexport function useForkRef(refA, refB) {\n /**\r\n * This will create a new function if the ref props change and are defined.\r\n * This means react will call the old forkRef with `null` and the new forkRef\r\n * with the ref. Cleanup naturally emerges from this behavior.\r\n */\n return React.useMemo(function () {\n if (refA == null && refB == null) {\n return null;\n }\n return function (refValue) {\n setRef(refA, refValue);\n setRef(refB, refValue);\n };\n }, [refA, refB]);\n}","export function restrictNumber(number) {\n var min = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;\n var max = arguments.length > 2 ? arguments[2] : undefined;\n // we are not assigning default value for it as if max was null it will override the default value.\n var currentMax = max || 1000000;\n var convertedNumber = +number;\n return Math.min(Math.max(min, convertedNumber), currentMax);\n}","export function mapNumber(number, oldMin, oldMax, newMin, newMax) {\n return (number - oldMin) * (newMax - newMin) / (oldMax - oldMin) + newMin;\n}","import _toConsumableArray from \"@babel/runtime/helpers/toConsumableArray\";\nexport var rgbStringToArray = function rgbStringToArray(rgbColorString) {\n return rgbColorString.replaceAll(/[^\\d,]/gi, '').split(',').map(function (n) {\n return +n;\n });\n};\nexport var hexToRgb = function hexToRgb(hexColor) {\n // if (!hexColor) return { r: 0, g: 0, b: 0 };\n if (!hexColor) return [0, 0, 0];\n return [Number.parseInt(hexColor.slice(1, 3), 16), Number.parseInt(hexColor.slice(3, 5), 16), Number.parseInt(hexColor.slice(5, 7), 16)];\n};\nvar rgbChannelToHex = function rgbChannelToHex(channel) {\n return channel.toString(16).padStart(2, '0');\n};\nexport var rgbToHex = function rgbToHex() {\n for (var _len = arguments.length, rgbColor = new Array(_len), _key = 0; _key < _len; _key++) {\n rgbColor[_key] = arguments[_key];\n }\n return \"#\".concat(rgbColor.map(rgbChannelToHex).join(''));\n};\nexport var hslToHex = function hslToHex(h, s, l) {\n var dividedL = l / 100;\n var a = s * Math.min(dividedL, 1 - dividedL) / 100;\n var f = function f(n) {\n var k = (n + h / 30) % 12;\n var color = dividedL - a * Math.max(Math.min(k - 3, 9 - k, 1), -1);\n return rgbChannelToHex(Math.round(255 * color));\n };\n return \"#\".concat(f(0)).concat(f(8)).concat(f(4));\n};\nexport var rgbToHsl = function rgbToHsl() {\n for (var _len2 = arguments.length, rgbColor = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {\n rgbColor[_key2] = arguments[_key2];\n }\n var r = rgbColor[0],\n g = rgbColor[1],\n b = rgbColor[2];\n r /= 255;\n g /= 255;\n b /= 255;\n var min = Math.min(r, g, b);\n var max = Math.max(r, g, b);\n var h;\n var s;\n var l = (max + min) / 2;\n if (max === min) {\n h = 0;\n s = 0;\n } else {\n var diff = max - min;\n s = l > 0.5 ? diff / (2 - max - min) : diff / (max + min);\n switch (max) {\n case r:\n h = (g - b) / diff + (g < b ? 6 : 0);\n break;\n case g:\n h = (b - r) / diff + 2;\n break;\n case b:\n h = (r - g) / diff + 4;\n break;\n default:\n h = 0;\n }\n h /= 6;\n }\n\n // * 360 for having the hue in degrees\n return [Math.round(h * 360), Math.round(s * 100), Math.round(l * 100)];\n};\nexport var colorToHsl = function colorToHsl(color) {\n if (color.startsWith('#')) {\n var hex = color;\n if (color.length === 4) {\n hex = \"#\".concat(color[1]).concat(color[1]).concat(color[2]).concat(color[2]).concat(color[3]).concat(color[3]);\n }\n return rgbToHsl.apply(void 0, _toConsumableArray(hexToRgb(hex)));\n }\n if (color.startsWith('rgb')) {\n var colorInRgb = rgbStringToArray(color);\n return rgbToHsl.apply(void 0, _toConsumableArray(colorInRgb));\n }\n\n // if the color is in text and no one from previous then return the default color which is black\n if (typeof color === 'string') {\n return [0, 0, 0];\n }\n return color;\n};\nexport var colorToRgb = function colorToRgb(color) {\n // we are not handling (hsl/color name) here cause we are accepting only HEX and RGB colors as default colors from user.\n if (color.startsWith('#')) {\n return hexToRgb(color);\n }\n if (color.startsWith('rgb')) {\n return rgbStringToArray(color);\n }\n if (typeof color === 'string') {\n return [0, 0, 0];\n }\n return color;\n};\nexport var colorToHex = function colorToHex(color) {\n if (color.startsWith('#')) {\n if (color.length === 7) {\n return color;\n }\n return \"#\".concat(color[0]).concat(color[0]).concat(color[1]).concat(color[1]).concat(color[2]).concat(color[2]);\n }\n if (color.startsWith('rgb')) {\n return rgbToHex.apply(void 0, _toConsumableArray(rgbStringToArray(color)));\n }\n if (typeof color === 'string') {\n return '#000000';\n }\n return color;\n};\nvar checkIsBlack = function checkIsBlack(s, l) {\n return l === 0 && (s === 0 || s === 1);\n};\nvar checkIsWhite = function checkIsWhite(s, l) {\n return s === 0 && l === 1;\n};\n\n// both hsv and hsl values are in [0, 1] except h is in [0, 360]\nexport var hsvToHsl = function hsvToHsl(h, s, v) {\n var newS = s;\n var l = (2 - s) * v / 2;\n if (l !== 0) {\n if (l === 1) {\n newS = 0;\n } else if (l < 0.5) {\n newS = newS * v / (l * 2);\n } else {\n newS = newS * v / (2 - l * 2);\n }\n }\n var isBlack = checkIsBlack(newS, l);\n return [isBlack || checkIsWhite(newS, l) ? 0 : h, isBlack ? 0 : Math.round(newS * 100), Math.round(l * 100)];\n};\n\n// both hsv and hsl values are in [0, 1] except h is in [0, 360]\nexport var hslToHsv = function hslToHsv(h, s, l) {\n var newS = s;\n var newL = l * 2;\n newS *= newL <= 1 ? newL : 2 - newL;\n var v = (newL + newS) / 2;\n newS = 2 * newS / (newL + newS);\n\n // return [h, newS, v];\n var isBlack = checkIsBlack(newS, l);\n return [isBlack || checkIsWhite(newS, l) ? 0 : h, isBlack ? 0 : Math.round(newS * 100), Math.round(v * 100)];\n};\n\n// TODO: validating 3 color code for Hex\n// /^#([\\da-f]{3}){1,2}$/i.test(color)colorToHex\nexport var validateHex = function validateHex(color) {\n return /^#[\\da-f]{6}$/i.test(color);\n};","export function getElemDocumentCoords(elem) {\n if (!elem) {\n return null;\n }\n var box = elem.getBoundingClientRect();\n var _document = document,\n body = _document.body;\n var docEl = document.documentElement;\n var scrollTop = window.pageYOffset || docEl.scrollTop || body.scrollTop;\n var scrollLeft = window.pageXOffset || docEl.scrollLeft || body.scrollLeft;\n var clientTop = docEl.clientTop || body.clientTop || 0;\n var clientLeft = docEl.clientLeft || body.clientLeft || 0;\n var top = box.top + scrollTop - clientTop;\n var left = box.left + scrollLeft - clientLeft;\n return {\n top: Math.round(top),\n left: Math.round(left),\n width: box.width,\n height: box.height\n };\n}","export function asc(a, b) {\n return a - b;\n}\nexport function valueToPercent(value, min, max) {\n return (value - min) * 100 / (max - min);\n}\nexport function percentToValue(percent, min, max) {\n return (max - min) * percent + min;\n}\nfunction getDecimalPrecision(num) {\n // This handles the case when num is very small (0.00000001), js will turn this into 1e-8.\n // When num is bigger than 1 or less than -1 it won't get converted to this notation so it's fine.\n if (Math.abs(num) < 1) {\n var parts = num.toExponential().split('e-');\n var matissaDecimalPart = parts[0].split('.')[1];\n return (matissaDecimalPart ? matissaDecimalPart.length : 0) + Number.parseInt(parts[1], 10);\n }\n var decimalPart = num.toString().split('.')[1];\n return decimalPart ? decimalPart.length : 0;\n}\nexport function roundValueToStep(value, step, min) {\n var nearest = Math.round((value - min) / step) * step + min;\n return Number(nearest.toFixed(getDecimalPrecision(step)));\n}\nexport function setValueIndex(_ref) {\n var values = _ref.values,\n newValue = _ref.newValue,\n index = _ref.index;\n var output = values.slice();\n output[index] = newValue;\n return output.sort(asc);\n}\nexport function findClosest(values, currentValue) {\n var _values$reduce = values.reduce(function (acc, value, index) {\n var distance = Math.abs(currentValue - value);\n if (acc === null || distance < acc.distance || distance === acc.distance) {\n return {\n distance: distance,\n index: index\n };\n }\n return acc;\n }, null),\n closestIndex = _values$reduce.index;\n return closestIndex;\n}\nexport function ownerDocument(node) {\n return node && node.ownerDocument || document;\n}\nexport function clamp(value, min, max) {\n if (value == null) {\n return min;\n }\n return Math.min(Math.max(min, value), max);\n}\nexport function trackFinger(event, touchId) {\n if (touchId.current !== undefined && event.changedTouches) {\n for (var i = 0; i < event.changedTouches.length; i += 1) {\n var touch = event.changedTouches[i];\n if (touch.identifier === touchId.current) {\n return {\n x: touch.clientX,\n y: touch.clientY\n };\n }\n }\n return false;\n }\n return {\n x: event.clientX,\n y: event.clientY\n };\n}\nexport var axisProps = {\n horizontal: {\n offset: function offset(percent) {\n return {\n left: \"\".concat(percent, \"%\")\n };\n },\n leap: function leap(percent) {\n return {\n width: \"\".concat(percent, \"%\")\n };\n }\n },\n 'horizontal-reverse': {\n offset: function offset(percent) {\n return {\n right: \"\".concat(percent, \"%\")\n };\n },\n leap: function leap(percent) {\n return {\n width: \"\".concat(percent, \"%\")\n };\n }\n },\n vertical: {\n offset: function offset(percent) {\n return {\n bottom: \"\".concat(percent, \"%\")\n };\n },\n leap: function leap(percent) {\n return {\n height: \"\".concat(percent, \"%\")\n };\n }\n }\n};\nexport function focusThumb(_ref2) {\n var sliderRef = _ref2.sliderRef,\n activeIndex = _ref2.activeIndex,\n setActive = _ref2.setActive;\n var doc = ownerDocument(sliderRef.current);\n if (!sliderRef.current.contains(doc.activeElement) || Number(doc.activeElement.getAttribute('data-index')) !== activeIndex) {\n var _sliderRef$current$qu;\n (_sliderRef$current$qu = sliderRef.current.querySelector(\"[type=\\\"range\\\"][data-index=\\\"\".concat(activeIndex, \"\\\"]\"))) === null || _sliderRef$current$qu === void 0 || _sliderRef$current$qu.focus();\n }\n if (setActive) {\n setActive(activeIndex);\n }\n}","export var Color = {\n TextPrimary: 'txt-primary',\n TextSecondary: 'txt-secondary',\n TextSecondaryInvert: 'txt-secondary-invert',\n TextPlaceholder: 'txt-placeholder',\n TextWarning: 'txt-warning',\n TextError: 'txt-error',\n TextInfo: 'txt-info',\n AccentPrimary: 'accent-primary',\n AccentPrimaryHover: 'accent-primary-hover',\n AccentPrimaryActive: 'accent-primary-active',\n AccentPrimaryDisabled: 'accent-primary-disabled',\n AccentSecondaryDisabled: 'accent-secondary-disabled',\n AccentStateless: 'accent-stateless',\n AccentStateless_0_4_Opacity: 'accent-stateless_0_4_opacity',\n Accent_0_5_Opacity: 'accent_0_5_opacity',\n Accent_1_2_Opacity: 'accent_1_2_opacity',\n Accent_1_8_Opacity: 'accent_1_8_opacity',\n Accent_2_8_Opacity: 'accent_2_8_opacity',\n Accent_4_0_Opacity: 'accent_4_0_opacity',\n BackgroundGrey: 'bg-grey',\n BackgroundStateless: 'bg-stateless',\n BackgroundActive: 'bg-active',\n BackgroundBaseLight: 'bg-base-light',\n BackgroundBaseMedium: 'bg-base-medium',\n BackgroundPrimary: 'bg-primary',\n BackgroundPrimaryLight: 'bg-primary-light',\n BackgroundPrimaryHover: 'bg-primary-hover',\n BackgroundPrimaryActive: 'bg-primary-active',\n BackgroundPrimaryStateless: 'bg-primary-stateless',\n BackgroundPrimary_0_5_Opacity: 'bg-primary-0-5-opacity',\n BackgroundSecondary: 'bg-secondary',\n BackgroundHover: 'bg-hover',\n BackgroundGreen: 'bg-green',\n BackgroundGreenMedium: 'bg-green-medium',\n BackgroundBlue: 'bg-blue',\n BackgroundRed: 'bg-red',\n BackgroundRedLight: 'bg-red-light',\n BackgroundRedMedium: 'background-red-medium',\n BackgroundOrange: 'bg-orange',\n BackgroundTooltip: 'bg-tooltip',\n IconsPrimary: 'icon-primary',\n IconsPrimaryOpacity_0_6: 'icons-primary-opacity-0-6',\n IconsSecondary: 'icons-secondary',\n IconsPlaceholder: 'icons-placeholder',\n IconsInvert: 'icons-invert',\n IconsMuted: 'icons-muted',\n IconsPrimaryHover: 'icons-primary-hover',\n IconsSecondaryHover: 'icons-secondary-hover',\n ButtonPrimaryText: 'btn-primary-text',\n ButtonPrimaryText_0_6: 'btn-primary-text-0-6',\n ButtonPrimaryText_0_4: 'btn-primary-text-0-4',\n ButtonDisabledText: 'btn-disabled-text',\n ButtonSecondaryText: 'btn-secondary-text',\n LinkPrimary: 'link-primary',\n LinkStateless: 'link-stateless',\n LinkHover: 'link-hover',\n LinkActive: 'link-active',\n LinkMuted: 'link-muted',\n LinkPressed: 'link-pressed',\n BordersPrimary: 'borders-primary',\n BordersPrimaryHover: 'borders-primary-hover',\n BordersSecondary: 'borders-secondary',\n BordersStrong: 'borders-strong',\n BordersInvert: 'borders-invert',\n BorderHoverBottom: 'border-hover-bottom',\n BorderActiveBottom: 'border-active-bottom',\n BorderPrimaryStateless: 'border-primary-stateless',\n BordersDisabled: 'borders-disabled',\n BordersButton: 'borders-button',\n BordersItem: 'borders-item',\n BordersBaseLight: 'borders-base-light',\n BordersBaseMedium: 'borders-base-medium',\n BordersGreen: 'borders-green',\n BordersGreenMedium: 'borders-green-medium',\n BordersRed: 'borders-red',\n ActiveSecondary: 'active-secondary',\n ActiveSecondaryHover: 'active-secondary-hover',\n Tag: 'tag',\n StatesErrorDisabledText: 'states-error-disabled-text',\n Error: 'error',\n Error_0_28_Opacity: 'error-0-28-opacity',\n Error_0_12_Opacity: 'error-0-12-opacity',\n ErrorHover: 'error-hover',\n ErrorActive: 'error-active',\n Success: 'success',\n SuccessHover: 'success-hover',\n SuccessActive: 'success-Active',\n Warning: 'warning',\n WarningHover: 'warning-hover',\n WarningActive: 'warning-active',\n Info: 'info',\n Modified: 'modified',\n Red: 'red',\n Orange: 'orange',\n Salad: 'salad',\n Green: 'green',\n Blue: 'blue',\n Indigo: 'indigo',\n Violet: 'violet',\n Pink: 'pink',\n GradientRight: 'gradient-right',\n Extra_0_3_Overlay: 'extra-0-3-overlay',\n GradientRightActive: 'gradient-right-active',\n GradientRightHover: 'gradient-right-hover',\n Extra_0_5_Overlay: 'extra-0-5-overlay',\n Extra_0_7_Overlay: 'extra-0-7-overlay',\n Extra_0_9_Overlay: 'extra-0-9-overlay',\n Red_0_1_Overlay: 'red-0-1-overlay',\n Orange_0_1_Overlay: 'orange-0-1-overlay',\n Accent_0_8_Overlay: 'accent-0-8-overlay',\n Link: 'link',\n Camera: 'camera',\n GoogleDrive: 'google-drive',\n Dropbox: 'dropbox',\n OneDrive: 'one-drive',\n Device: 'device',\n Instagram: 'instagram',\n FreeImages: 'free-images',\n FreeIcons: 'free-icons',\n Canvas: 'canvas',\n Box: 'box',\n ScreenCast: 'screen-cast',\n Unsplash: 'unsplash',\n LightShadow: 'light-shadow',\n MediumShadow: 'medium-shadow',\n LargeShadow: 'large-shadow',\n XLargeShadow: 'x-large-shadow'\n};","import { css } from 'styled-components';\nimport { Color as PaletteColor } from '../types/palette';\nexport var scrollBar = function scrollBar(_ref) {\n var palette = _ref.theme.palette;\n return css([\"scrollbar-color:\", \" \", \";scrollbar-width:thin;::-webkit-scrollbar{width:12px;}::-webkit-scrollbar-track{margin-block:6px;}::-webkit-scrollbar-thumb{background:\", \";border:4px solid \", \";border-radius:99px;padding:4px 6px;background-clip:padding-box;}\"], palette[PaletteColor.IconsMuted], palette[PaletteColor.ActiveSecondary], palette[PaletteColor.Extra_0_3_Overlay], palette[PaletteColor.ActiveSecondary]);\n};","export var Breakpoint = {\n Xs: 'xs',\n Sm: 'sm',\n Md: 'md',\n Lg: 'lg',\n Xl: 'xl',\n Xxl: 'xxl',\n Xxxl: 'xxxl'\n};\nexport var BreakpointClass = {\n Xs: '.sfx-breakpoint-xs',\n Sm: '.sfx-breakpoint-sm',\n Md: '.sfx-breakpoint-md',\n Lg: '.sfx-breakpoint-lg',\n Xl: '.sfx-breakpoint-xl',\n Xxl: '.sfx-breakpoint-xxl',\n Xxxl: '.sfx-breakpoint-xxxl'\n};","export var Shadows = {\n ShadowSm: 'shadow-sm',\n ShadowMd: 'shadow-md',\n ShadowLg: 'shadow-lg',\n ShadowXl: 'shadow-xl',\n Label: 'label',\n Header: 'header',\n HeaderPopup: 'header-popup',\n FooterPopup: 'footer-popup',\n LeftPanelMd: 'left-panel-md',\n RightPanelMd: 'right-panel-md',\n LeftPanelSm: 'left-panel-sm',\n RightPanelSm: 'right-panel-sm'\n};","export var FontWeight = {\n Thin: 100,\n ExtraLight: 200,\n Light: 300,\n Regular: 400,\n Medium: 500,\n SemiBold: 600,\n Bold: 700,\n ExtraBold: 800,\n Black: 900\n};","export var FontVariant = {\n TextExtraSmall: 'text-extra-small',\n TextSmall: 'text-small',\n TextSmallUp: 'text-small-up',\n TextMedium: 'text-medium',\n TextLarge: 'text-large',\n TextExtraLarge: 'text-extra-large',\n TextXExtraLarge: 'text-x-extra-large',\n TitleH6: 'title-h6',\n TitleH5: 'title-h5',\n TitleH4: 'title-h4',\n TitleH3: 'title-h3',\n TitleH2: 'title-h2',\n TitleH1: 'title-h1',\n LabelExtraSmall: 'label-extra-small',\n LabelExtraSmallEmphasis: 'label-extra-small-emphasis',\n LabelExtraSmallUp: 'label-extra-small-up',\n LabelSmall: 'label-small',\n LabelSmallEmphasis: 'label-small-emphasis',\n LabelSmallUp: 'label-small-up',\n LabelSmallUpEmphasis: 'label-small-up-emphasis',\n LabelMedium: 'label-medium',\n LabelMediumEmphasis: 'label-medium-emphasis',\n LabelLarge: 'label-large',\n LabelLargeEmphasis: 'label-large-emphasis',\n LabelLargeUp: 'label-large-up',\n LabelExtraLargeEmphasis: 'label-extra-large-emphasis',\n LabelExtraLarge: 'label-extra-large',\n LabelXExtraLargeEmphasis: 'label-x-extra-large-emphasis',\n LabelXExtraLarge: 'label-x-extra-large',\n LabelXXExtraLargeEmphasis: 'label-x-x-extra-large-emphasis',\n LabelXXExtraLarge: 'label-x-x-extra-large',\n LabelXXXExtraLarge: 'label-x-x-x-extra-large',\n ButtonSmEmphasis: 'btn-sm-emphasis',\n ButtonSm: 'btn-sm',\n ButtonSmUpEmphasis: 'btn-sm-up-emphasis',\n ButtonSmUp: 'btn-sm-up',\n ButtonMdEmphasis: 'btn-md-emphasis',\n ButtonMd: 'btn-md',\n ButtonLgEmphasis: 'btn-lg-emphasis',\n ButtonLg: 'btn-lg',\n ButtonLgUpEmphasis: 'btn-lg-up-emphasis',\n ButtonLgUp: 'btn-lg-up',\n LinkSmall: 'link-small',\n LinkSmallEmphasis: 'link-small-emphasis',\n LinkSmallUp: 'link-small-up',\n LinkSmallUpEmphasis: 'link-small-up-emphasis',\n LinkMedium: 'link-medium',\n LinkMediumEmphasis: 'link-medium-emphasis',\n LinkLarge: 'link-large',\n LinkLargeEmphasis: 'link-large-emphasis',\n LinkLargeUp: 'link-large-up',\n LinkLargeUpEmphasis: 'link-large-up-emphasis',\n InputSm: 'input-sm',\n InputSmUp: 'input-sm-up',\n InputMd: 'input-md',\n InputLg: 'input-lg'\n};","export var BorderRadiusSize = {\n Sm: 'sm',\n Md: 'md',\n Lg: 'lg'\n};","import { createGlobalStyle, css } from 'styled-components';\nvar Typography = /*#__PURE__*/createGlobalStyle([\"\", \";\"], function (_ref) {\n var theme = _ref.theme;\n var baseLineHeight = theme.typography.baseLineHeight;\n return css([\"h1,h2,h3,h4,h5,h6,p,small{line-height:\", \";}\"], baseLineHeight);\n});\nexport default Typography;","import _defineProperty from \"@babel/runtime/helpers/defineProperty\";\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\n/* eslint-disable sonarjs/no-duplicate-string */\nimport { FontVariant, FontWeight } from '../../../../utils/types/typography';\nvar defaultFontValue = {\n fontFamily: '\"Roboto\"',\n fontStyle: 'normal',\n fontWeight: FontWeight.Regular\n};\nvar getLabelFontVariants = function getLabelFontVariants() {\n var _ref;\n var fontOverride = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n return _ref = {}, _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_ref, FontVariant.LabelExtraSmall, _objectSpread(_objectSpread({}, defaultFontValue), {}, {\n fontSize: '10px',\n lineHeight: '12px'\n }, fontOverride)), FontVariant.LabelExtraSmallEmphasis, _objectSpread(_objectSpread({}, defaultFontValue), {}, {\n fontWeight: 'Bold',\n fontSize: '10px',\n lineHeight: '12px'\n }, fontOverride)), FontVariant.LabelExtraSmallUp, _objectSpread(_objectSpread({}, defaultFontValue), {}, {\n fontSize: '11px',\n lineHeight: '12px'\n }, fontOverride)), FontVariant.LabelSmall, _objectSpread(_objectSpread({}, defaultFontValue), {}, {\n fontSize: '12px',\n lineHeight: '14px'\n }, fontOverride)), FontVariant.LabelSmallEmphasis, _objectSpread(_objectSpread({}, defaultFontValue), {}, {\n fontWeight: FontWeight.Medium,\n fontSize: '12px',\n lineHeight: '14px'\n }, fontOverride)), FontVariant.LabelSmallUp, _objectSpread(_objectSpread({\n fontSize: '13px',\n lineHeight: '16px'\n }, defaultFontValue), fontOverride)), FontVariant.LabelSmallUpEmphasis, _objectSpread(_objectSpread({}, defaultFontValue), {}, {\n fontWeight: FontWeight.Medium,\n fontSize: '13px',\n lineHeight: '16px'\n }, fontOverride)), FontVariant.LabelMedium, _objectSpread(_objectSpread({\n fontSize: '14px',\n lineHeight: '16px'\n }, defaultFontValue), fontOverride)), FontVariant.LabelMediumEmphasis, _objectSpread(_objectSpread({}, defaultFontValue), {}, {\n fontWeight: FontWeight.Medium,\n fontSize: '14px',\n lineHeight: '16px'\n }, fontOverride)), FontVariant.LabelLarge, _objectSpread(_objectSpread({}, defaultFontValue), {}, {\n fontSize: '16px',\n lineHeight: '18px'\n }, fontOverride)), _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_ref, FontVariant.LabelLargeEmphasis, _objectSpread(_objectSpread({}, defaultFontValue), {}, {\n fontWeight: FontWeight.Medium,\n fontSize: '16px',\n lineHeight: '18px'\n }, fontOverride)), FontVariant.LabelLargeUp, _objectSpread(_objectSpread({}, defaultFontValue), {}, {\n fontWeight: FontWeight.Regular,\n fontSize: '18px',\n lineHeight: '20px'\n }, fontOverride)), FontVariant.LabelExtraLargeEmphasis, _objectSpread(_objectSpread({}, defaultFontValue), {}, {\n fontWeight: FontWeight.Medium,\n fontSize: '24px',\n lineHeight: '28px'\n }, fontOverride)), FontVariant.LabelExtraLarge, _objectSpread(_objectSpread({}, defaultFontValue), {}, {\n fontWeight: FontWeight.Regular,\n fontSize: '24px',\n lineHeight: '28px'\n }, fontOverride)), FontVariant.LabelXExtraLargeEmphasis, _objectSpread(_objectSpread({}, defaultFontValue), {}, {\n fontWeight: FontWeight.Medium,\n fontSize: '32px',\n lineHeight: '36px'\n }, fontOverride)), FontVariant.LabelXExtraLarge, _objectSpread(_objectSpread({}, defaultFontValue), {}, {\n fontSize: '32px',\n lineHeight: '36px'\n }, fontOverride)), FontVariant.LabelXXExtraLargeEmphasis, _objectSpread(_objectSpread({}, defaultFontValue), {}, {\n fontWeight: FontWeight.Medium,\n fontSize: '48px',\n lineHeight: '54px'\n }, fontOverride)), FontVariant.LabelXXExtraLarge, _objectSpread(_objectSpread({}, defaultFontValue), {}, {\n fontSize: '48px',\n lineHeight: '54px'\n }, fontOverride)), FontVariant.LabelXXXExtraLarge, _objectSpread(_objectSpread({}, defaultFontValue), {}, {\n fontSize: '60px',\n lineHeight: '68px'\n }, fontOverride));\n};\nvar getTextFontVariants = function getTextFontVariants() {\n var fontOverride = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n return _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({}, FontVariant.TextExtraSmall, _objectSpread(_objectSpread({}, getLabelFontVariants()[FontVariant.LabelExtraSmallUp]), {}, {\n lineHeight: '14px'\n }, fontOverride)), FontVariant.TextSmall, _objectSpread(_objectSpread({}, defaultFontValue), {}, {\n fontSize: '12px',\n lineHeight: '18px'\n }, fontOverride)), FontVariant.TextSmallUp, _objectSpread(_objectSpread({}, defaultFontValue), {}, {\n fontSize: '13px',\n lineHeight: '18px'\n }, fontOverride)), FontVariant.TextMedium, _objectSpread(_objectSpread({}, defaultFontValue), {}, {\n fontSize: '14px',\n lineHeight: '20px'\n }, fontOverride)), FontVariant.TextLarge, _objectSpread(_objectSpread({}, defaultFontValue), {}, {\n fontSize: '16px',\n lineHeight: '22px'\n }, fontOverride)), FontVariant.TextExtraLarge, _objectSpread(_objectSpread({}, defaultFontValue), {}, {\n fontSize: '18px',\n lineHeight: '26px'\n }, fontOverride)), FontVariant.TextXExtraLarge, _objectSpread(_objectSpread({}, defaultFontValue), {}, {\n fontSize: '28px',\n lineHeight: '40px'\n }, fontOverride));\n};\nvar getButtonFontVariants = function getButtonFontVariants() {\n var fontOverride = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n return _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({}, FontVariant.ButtonSmEmphasis, _objectSpread(_objectSpread({}, defaultFontValue), {}, {\n fontWeight: FontWeight.Medium,\n fontSize: '12px',\n lineHeight: '14px'\n }, fontOverride)), FontVariant.ButtonSm, _objectSpread(_objectSpread({}, defaultFontValue), {}, {\n fontSize: '12px',\n lineHeight: '14px'\n }, fontOverride)), FontVariant.ButtonSmUpEmphasis, _objectSpread(_objectSpread({}, defaultFontValue), {}, {\n fontWeight: FontWeight.Medium,\n fontSize: '13px',\n lineHeight: '16px'\n }, fontOverride)), FontVariant.ButtonSmUp, _objectSpread(_objectSpread({}, defaultFontValue), {}, {\n fontSize: '13px',\n lineHeight: '16px'\n }, fontOverride)), FontVariant.ButtonMdEmphasis, _objectSpread(_objectSpread({}, defaultFontValue), {}, {\n fontWeight: FontWeight.Medium,\n fontSize: '14px',\n lineHeight: '16px'\n }, fontOverride)), FontVariant.ButtonMd, _objectSpread(_objectSpread({}, defaultFontValue), {}, {\n fontSize: '14px',\n lineHeight: '16px'\n }, fontOverride)), FontVariant.ButtonLgEmphasis, _objectSpread(_objectSpread({}, defaultFontValue), {}, {\n fontWeight: FontWeight.Medium,\n fontSize: '16px',\n lineHeight: '18px'\n }, fontOverride)), FontVariant.ButtonLg, _objectSpread(_objectSpread({}, defaultFontValue), {}, {\n fontSize: '16px',\n lineHeight: '18px'\n }, fontOverride)), FontVariant.ButtonLgUpEmphasis, _objectSpread(_objectSpread({}, defaultFontValue), {}, {\n fontWeight: FontWeight.Medium,\n fontSize: '18px',\n lineHeight: '20px'\n }, fontOverride)), FontVariant.ButtonLgUp, _objectSpread(_objectSpread({}, defaultFontValue), {}, {\n fontSize: '18px',\n lineHeight: '20px'\n }, fontOverride));\n};\nvar getLinkFontVariants = function getLinkFontVariants() {\n var fontOverride = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n return _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({}, FontVariant.LinkSmall, _objectSpread(_objectSpread({}, defaultFontValue), {}, {\n fontSize: '12px',\n lineHeight: '14px'\n }, fontOverride)), FontVariant.LinkSmallEmphasis, _objectSpread(_objectSpread({}, defaultFontValue), {}, {\n fontWeight: FontWeight.Medium,\n fontSize: '12px',\n lineHeight: '14px'\n }, fontOverride)), FontVariant.LinkSmallUp, _objectSpread(_objectSpread({}, defaultFontValue), {}, {\n fontSize: '13px',\n lineHeight: '16px'\n }, fontOverride)), FontVariant.LinkSmallUpEmphasis, _objectSpread(_objectSpread({}, defaultFontValue), {}, {\n fontWeight: FontWeight.Medium,\n fontSize: '13px',\n lineHeight: '16px'\n }, fontOverride)), FontVariant.LinkMedium, _objectSpread(_objectSpread({}, defaultFontValue), {}, {\n fontSize: '14px',\n lineHeight: '16px'\n }, fontOverride)), FontVariant.LinkMediumEmphasis, _objectSpread(_objectSpread({}, defaultFontValue), {}, {\n fontWeight: FontWeight.Medium,\n fontSize: '14px',\n lineHeight: '16px'\n }, fontOverride)), FontVariant.LinkLarge, _objectSpread(_objectSpread({}, defaultFontValue), {}, {\n fontSize: '16px',\n lineHeight: '18px'\n }, fontOverride)), FontVariant.LinkLargeEmphasis, _objectSpread(_objectSpread({}, defaultFontValue), {}, {\n fontWeight: FontWeight.Medium,\n fontSize: '16px',\n lineHeight: '18px'\n }, fontOverride)), FontVariant.LinkLargeUp, _objectSpread(_objectSpread({}, defaultFontValue), {}, {\n fontSize: '18px',\n lineHeight: '20px'\n }, fontOverride)), FontVariant.LinkLargeUpEmphasis, _objectSpread(_objectSpread({}, defaultFontValue), {}, {\n fontWeight: FontWeight.Medium,\n fontSize: '18px',\n lineHeight: '20px'\n }, fontOverride));\n};\nvar getInputFontVariants = function getInputFontVariants() {\n var fontOverride = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n return _defineProperty(_defineProperty(_defineProperty(_defineProperty({}, FontVariant.InputSm, _objectSpread(_objectSpread({}, defaultFontValue), {}, {\n fontSize: '12px',\n lineHeight: '14px'\n }, fontOverride)), FontVariant.InputSmUp, _objectSpread(_objectSpread({}, defaultFontValue), {}, {\n fontSize: '13px',\n lineHeight: '16px'\n }, fontOverride)), FontVariant.InputMd, _objectSpread(_objectSpread({}, defaultFontValue), {}, {\n fontSize: '14px',\n lineHeight: '16px'\n }, fontOverride)), FontVariant.InputLg, _objectSpread(_objectSpread({}, defaultFontValue), {}, {\n fontSize: '16px',\n lineHeight: '18px'\n }, fontOverride));\n};\nvar getTitleFontVariants = function getTitleFontVariants() {\n var fontOverride = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n return _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({}, FontVariant.TitleH6, _objectSpread(_objectSpread({}, defaultFontValue), {}, {\n fontWeight: FontWeight.Medium,\n fontSize: '12px',\n lineHeight: '18px'\n }, fontOverride)), FontVariant.TitleH5, _objectSpread(_objectSpread({}, defaultFontValue), {}, {\n fontWeight: FontWeight.Medium,\n fontSize: '14px',\n lineHeight: '21px'\n }, fontOverride)), FontVariant.TitleH4, _objectSpread(_objectSpread({}, defaultFontValue), {}, {\n fontWeight: FontWeight.Medium,\n fontSize: '16px',\n lineHeight: '24px'\n }, fontOverride)), FontVariant.TitleH3, _objectSpread(_objectSpread({}, defaultFontValue), {}, {\n fontWeight: FontWeight.Medium,\n fontSize: '18px',\n lineHeight: '27px'\n }, fontOverride)), FontVariant.TitleH2, _objectSpread(_objectSpread({}, defaultFontValue), {}, {\n fontWeight: FontWeight.Medium,\n fontSize: '20px',\n lineHeight: '30px'\n }, fontOverride)), FontVariant.TitleH1, _objectSpread(_objectSpread({}, defaultFontValue), {}, {\n fontWeight: FontWeight.Medium,\n fontSize: '28px',\n lineHeight: '42px'\n }, fontOverride));\n};\n\n// eslint-disable-next-line @typescript-eslint/explicit-function-return-type\nexport var getDefaultTypography = function getDefaultTypography() {\n var typographyOverride = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n return _objectSpread(_objectSpread({\n fontFamily: defaultFontValue.fontFamily,\n baseLineHeight: 1.375\n }, typographyOverride), {}, {\n font: _objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread({}, getLabelFontVariants(typographyOverride)), getTextFontVariants(typographyOverride)), getButtonFontVariants(typographyOverride)), getLinkFontVariants(typographyOverride)), getInputFontVariants(typographyOverride)), getTitleFontVariants(typographyOverride))\n });\n};","import { createGlobalStyle /* , css */ } from 'styled-components';\n\n// Example with theme: ${({ theme }) => css``;\n\nvar CommonStyles = /*#__PURE__*/createGlobalStyle([\"@keyframes spinner{0%{transform:rotate(0deg);}100%{transform:rotate(360deg);}}.Menu-open{overflow:hidden;}.Modal-open{overflow:hidden;}\"]);\nexport default CommonStyles;","import _defineProperty from \"@babel/runtime/helpers/defineProperty\";\nvar _lightPalette;\n/* eslint-disable sonarjs/no-duplicate-string */\nimport { Color } from '../../../../utils/types/palette';\nexport var lightPalette = (_lightPalette = {}, _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_lightPalette, Color.TextPrimary, 'rgba(55, 65, 75, 1)'), Color.TextSecondary, 'rgba(118, 138, 159, 1)'), Color.TextSecondaryInvert, 'rgba(213, 216, 220, 1)'), Color.TextPlaceholder, 'rgba(169, 182, 194, 1)'), Color.TextWarning, 'rgba(196, 110, 0, 1)'), Color.TextError, 'rgba(185, 33, 46, 1)'), Color.TextInfo, 'rgba(35, 117, 171, 1)'), Color.AccentPrimary, 'rgba(104, 121, 235, 1)'), Color.AccentPrimaryHover, 'rgba(96, 111, 209, 1)'), Color.AccentPrimaryActive, 'rgba(73, 88, 188, 1)'), _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_lightPalette, Color.AccentPrimaryDisabled, 'rgba(233, 238, 242, 1)'), Color.AccentSecondaryDisabled, '#F9FBFC'), Color.AccentStateless, 'rgba(104, 121, 235, 1)'), Color.AccentStateless_0_4_Opacity, 'rgba(104, 121, 235, 0.4)'), Color.Accent_0_5_Opacity, 'rgba(104, 121, 235, 0.05)'), Color.Accent_1_2_Opacity, 'rgba(104, 121, 235, 0.12)'), Color.Accent_1_8_Opacity, 'rgba(104, 121, 235, 0.18)'), Color.Accent_2_8_Opacity, 'rgba(104, 121, 235, 0.28)'), Color.Accent_4_0_Opacity, 'rgba(104, 121, 235, 0.4)'), Color.BackgroundGrey, 'rgba(216, 224, 232, 1)'), _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_lightPalette, Color.BackgroundStateless, 'rgba(255, 255, 255, 1)'), Color.BackgroundActive, 'rgba(243, 247, 250, 1)'), Color.BackgroundBaseLight, 'rgba(235, 239, 252, 1)'), Color.BackgroundBaseMedium, 'rgba(227, 231, 251, 1)'), Color.BackgroundPrimary, 'rgba(248, 250, 251, 1)'), Color.BackgroundPrimaryLight, 'rgba(243, 245, 247, 1)'), Color.BackgroundPrimaryHover, 'rgba(239, 243, 246, 1)'), Color.BackgroundPrimaryActive, 'rgba(93, 109, 126, 1)'), Color.BackgroundPrimary_0_5_Opacity, 'rgba(255, 255, 255, 0.500)'), Color.BackgroundPrimaryStateless, '#CCD6DE'), _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_lightPalette, Color.BackgroundSecondary, 'rgba(255, 255, 255, 1)'), Color.BackgroundHover, 'rgba(249, 251, 252, 1)'), Color.BackgroundGreen, 'rgba(237, 250, 244, 1)'), Color.BackgroundGreenMedium, 'rgba(227, 250, 239, 1)'), Color.BackgroundBlue, 'rgba(244, 249, 255, 1)'), Color.BackgroundRed, 'rgba(253, 244, 242, 1)'), Color.BackgroundRedLight, 'rgba(255, 245, 245, 1)'), Color.BackgroundRedMedium, 'rgba(247, 228, 230, 1)'), Color.BackgroundOrange, 'rgba(255, 249, 242, 1)'), Color.BackgroundTooltip, 'rgba(79, 98, 118, 1)'), _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_lightPalette, Color.IconsPrimary, 'rgba(118, 138, 159, 1)'), Color.IconsPrimaryOpacity_0_6, 'rgba(93, 109, 126, 0.600)'), Color.IconsSecondary, 'rgba(151, 166, 182, 1)'), Color.IconsPlaceholder, 'rgba(223, 231, 237, 1)'), Color.IconsInvert, 'rgba(255, 255, 255, 1)'), Color.IconsMuted, 'rgba(169, 182, 194, 1)'), Color.IconsPrimaryHover, 'rgba(79, 98, 118, 1)'), Color.IconsSecondaryHover, 'rgba(118, 138, 159, 1)'), Color.ButtonPrimaryText, 'rgba(255, 255, 255, 1)'), Color.ButtonPrimaryText_0_6, 'rgba(255, 255, 255, 0.6)'), _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_lightPalette, Color.ButtonPrimaryText_0_4, 'rgba(255, 255, 255, 0.4)'), Color.ButtonDisabledText, 'rgba(169, 182, 194, 1)'), Color.ButtonSecondaryText, 'rgba(0, 0, 0, 1)'), Color.LinkPrimary, 'rgba(118, 138, 159, 1)'), Color.LinkStateless, 'rgba(118, 138, 159, 1)'), Color.LinkHover, 'rgba(79, 98, 118, 1)'), Color.LinkActive, 'rgba(55, 65, 75, 1)'), Color.LinkPressed, 'rgba(104, 121, 235, 1)'), Color.LinkMuted, 'rgba(169, 182, 194, 1)'), Color.BordersPrimary, 'rgba(204, 214, 222, 1)'), _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_lightPalette, Color.BordersPrimaryHover, 'rgba(104, 118, 134, 1)'), Color.BordersSecondary, 'rgba(236, 240, 243, 1)'), Color.BordersStrong, 'rgba(204, 214, 222, 1)'), Color.BordersInvert, 'rgba(85, 99, 115, 1)'), Color.BorderHoverBottom, 'rgba(104, 121, 235, 0.18)'), Color.BorderActiveBottom, '#4958BC'), Color.BorderPrimaryStateless, 'rgba(204, 214, 222, 1)'), Color.BordersDisabled, 'rgba(73, 88, 188, 0.4)'), Color.BordersButton, 'rgba(151, 166, 182, 1)'), Color.BordersItem, 'rgba(226, 232, 236, 1)'), _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_lightPalette, Color.BordersBaseLight, 'rgba(211, 219, 250, 1)'), Color.BordersBaseMedium, 'rgba(164, 175, 227, 1)'), Color.BordersGreen, 'rgba(27, 161, 99, 0.22)'), Color.BordersGreenMedium, 'rgba(27, 161, 99, 0.4)'), Color.BordersRed, 'rgba(185, 33, 46, 0.4)'), Color.ActiveSecondary, '#FFFFFF'), Color.ActiveSecondaryHover, 'rgba(104, 121, 235, 0.05)'), Color.Error, 'rgba(246, 61, 61, 1)'), Color.Error_0_28_Opacity, 'rgba(185, 33, 46, 0.28)'), Color.Error_0_12_Opacity, 'rgba(255, 86, 78, 0.1)'), _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_lightPalette, Color.ErrorHover, 'rgba(216, 46, 46, 1)'), Color.ErrorActive, 'rgba(185, 33, 46, 1)'), Color.Success, 'rgba(38, 193, 122, 1)'), Color.SuccessHover, 'rgba(30, 154, 98, 1)'), Color.SuccessActive, 'rgba(23, 116, 73, 1)'), Color.Warning, 'rgba(255, 172, 74, 1)'), Color.WarningHover, 'rgba(237, 145, 7, 1)'), Color.WarningActive, 'rgba(224, 135, 0, 1)'), Color.Info, 'rgba(41, 127, 184, 1)'), Color.Modified, 'rgba(165, 166, 246, 1)'), _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_lightPalette, Color.Red, 'rgba(219, 46, 50, 1)'), Color.Orange, 'rgba(255, 168, 0, 1)'), Color.Salad, 'rgba(143, 176, 33, 1)'), Color.Green, 'rgba(22, 160, 134, 1)'), Color.Blue, 'rgba(41, 127, 184, 1)'), Color.Indigo, 'rgba(91, 72, 162, 1)'), Color.Violet, 'rgba(141, 68, 173, 1)'), Color.Pink, 'rgba(211, 92, 158, 1)'), Color.GradientRight, 'linear-gradient(270deg, #FFFFFF 1.56%, rgba(255, 255, 255, 0.89) 52.4%, rgba(255, 255, 255, 0.532165) 76.04%, rgba(255, 255, 255, 0) 100%)'), Color.Extra_0_3_Overlay, 'rgba(79, 98, 118, 0.3)'), _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_lightPalette, Color.GradientRightActive, 'linear-gradient(270deg, #F3F7FA 1.56%, #F3F7FA 52.4%, rgba(243, 247, 250, 0.53) 76.04%, rgba(243, 247, 250, 0) 100%)'), Color.GradientRightHover, 'linear-gradient(270deg, #F9FBFC 1.56%, #F9FBFC 52.4%, rgba(249, 251, 252, 0.53) 76.04%, rgba(249, 251, 252, 0) 100%)'), Color.Extra_0_5_Overlay, 'rgba(79, 98, 118, 0.5)'), Color.Extra_0_7_Overlay, 'rgba(79, 98, 118, 0.7)'), Color.Extra_0_9_Overlay, 'rgba(79, 98, 118, 0.9)'), Color.Red_0_1_Overlay, 'rgba(232, 91, 70, 0.1)'), Color.Orange_0_1_Overlay, 'rgba(250, 157, 47, 0.1)'), Color.Accent_0_8_Overlay, 'rgba(104, 121, 235, 0.08)'), Color.Link, 'rgba(250, 166, 68, 1)'), Color.Camera, 'rgba(73, 186, 224, 1)'), _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_lightPalette, Color.GoogleDrive, 'rgba(81, 136, 238, 1)'), Color.Dropbox, 'rgba(17, 40, 124, 1)'), Color.OneDrive, 'rgba(40, 100, 186, 1)'), Color.Device, 'rgba(102, 73, 209, 1)'), Color.Instagram, 'rgba(244, 70, 154, 1)'), Color.Unsplash, 'rgba(173, 38, 220, 1)'), Color.FreeImages, 'rgba(16, 163, 135, 1)'), Color.FreeIcons, 'rgba(62, 207, 139, 1)'), Color.Canvas, 'rgba(36, 190, 202, 1)'), Color.Box, 'rgba(0, 97, 213, 1)'), _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_lightPalette, Color.ScreenCast, 'rgba(48, 61, 78, 1)'), Color.Tag, '#889AAC'), Color.StatesErrorDisabledText, 'rgba(185, 33, 46, 0.3)'), Color.LightShadow, 'rgba(146, 166, 188, 0.2)'), Color.MediumShadow, 'rgba(146, 166, 188, 0.24)'), Color.LargeShadow, 'rgba(146, 166, 188, 0.32)'), Color.XLargeShadow, 'rgba(146, 166, 188, 0.5)'));\nexport var defaultPalette = lightPalette;","import _defineProperty from \"@babel/runtime/helpers/defineProperty\";\nvar _shadows;\nimport { Shadows } from '../../../../utils/types/shadows';\nexport var shadows = (_shadows = {}, _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_shadows, Shadows.ShadowSm, '0px 1px 2px 0px rgba(146, 166, 188, 0.2)'), Shadows.ShadowMd, ' 0px 1px 4px 0px rgba(146, 166, 188, 0.24)'), Shadows.ShadowLg, ' 0px 2px 6px 0px rgba(146, 166, 188, 0.32)'), Shadows.ShadowXl, ' 0px 2px 6px 0px rgba(146, 166, 188, 0.5)'), Shadows.Label, ' 0px 1px 3px 0px rgba(77, 78, 78, 0.15)'), Shadows.Header, ' 0px 6px 10px 0px rgba(146, 166, 188, 0.2)'), Shadows.HeaderPopup, ' 0px 3px 7px 0px rgba(146, 166, 188, 0.16)'), Shadows.FooterPopup, ' 0px -4px 8px 0px rgba(208, 215, 220, 0.22)'), Shadows.LeftPanelMd, ' 6px 8px 12px 0px rgba(146, 166, 188, 0.14)'), Shadows.RightPanelMd, '-6px 8px 12px 0px rgba(146, 166, 188, 0.14)'), _defineProperty(_defineProperty(_shadows, Shadows.LeftPanelSm, '6px -4px 12px 0px rgba(146, 166, 188, 0.14)'), Shadows.RightPanelSm, '-6px -4px 12px 0px rgba(146, 166, 188, 0.14)'));\nexport var defaultShadows = shadows;","import _defineProperty from \"@babel/runtime/helpers/defineProperty\";\nimport { Breakpoint } from '../../../../utils/types/css';\nexport var defaultBreakpoints = {\n keys: [Breakpoint.Xs, Breakpoint.Sm, Breakpoint.Md, Breakpoint.Lg, Breakpoint.Xl],\n values: _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({}, Breakpoint.Xs, 0), Breakpoint.Sm, 576), Breakpoint.Md, 768), Breakpoint.Lg, 1084), Breakpoint.Xl, 1342), Breakpoint.Xxl, 1600), Breakpoint.Xxxl, 1920),\n classes: _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({}, Breakpoint.Xs, '.sfx-breakpoint-xs'), Breakpoint.Sm, '.sfx-breakpoint-sm'), Breakpoint.Md, '.sfx-breakpoint-md'), Breakpoint.Lg, '.sfx-breakpoint-lg'), Breakpoint.Xl, '.sfx-breakpoint-xl'), Breakpoint.Xxl, '.sfx-breakpoint-xxl'), Breakpoint.Xxxl, '.sfx-breakpoint-xxxl'),\n getBreakpointClass: function getBreakpointClass() {\n return '';\n },\n up: function up() {\n return '';\n },\n down: function down() {\n return '';\n },\n between: function between() {\n return '';\n },\n only: function only() {\n return '';\n }\n};","import { defaultBreakpoints } from './default-breakpoints';\nvar createBreakpoints = function createBreakpoints(breakpoints) {\n var _breakpoints$values = breakpoints.values,\n values = _breakpoints$values === void 0 ? defaultBreakpoints.values : _breakpoints$values,\n _breakpoints$classes = breakpoints.classes,\n classes = _breakpoints$classes === void 0 ? defaultBreakpoints.classes : _breakpoints$classes;\n var unit = 'px';\n var keys = Object.keys(values);\n var up = function up(key) {\n var value = typeof values[key] === 'number' ? values[key] : key;\n return \"@media (min-width:\".concat(value).concat(unit, \")\");\n };\n var down = function down(key) {\n var value = values[key];\n return \"@media (max-width:\".concat(value).concat(unit, \")\");\n };\n var between = function between(start, end) {\n var endIndex = keys.indexOf(end);\n return \"@media (min-width:\".concat(values[start]).concat(unit, \") and (max-width:\").concat(values[keys[endIndex]]).concat(unit, \")\");\n };\n var only = function only(key) {\n if (keys.indexOf(key) + 1 < keys.length) {\n return between(key, keys[keys.indexOf(key) + 1]);\n }\n return up(key);\n };\n var getBreakpointClass = function getBreakpointClass(width, hideSelector) {\n var removeSelector = function removeSelector(str) {\n return str.slice(1);\n };\n if (width >= values.xs && width < values.sm) {\n return hideSelector ? removeSelector(classes.xs) : classes.xs;\n }\n if (width >= values.sm && width < values.md) {\n return hideSelector ? removeSelector(classes.sm) : classes.sm;\n }\n if (width >= values.md && width < values.lg) {\n return hideSelector ? removeSelector(classes.md) : classes.md;\n }\n if (width >= values.lg && width < values.xl) {\n return hideSelector ? removeSelector(classes.lg) : classes.lg;\n }\n if (width >= values.xl && width < values.xxl) {\n return hideSelector ? removeSelector(classes.xl) : classes.xl;\n }\n if (width >= values.xxl && width < values.xxxl) {\n return hideSelector ? removeSelector(classes.xxl) : classes.xxl;\n }\n if (width >= values.xxxl) {\n return hideSelector ? removeSelector(classes.xxxl) : classes.xxxl;\n }\n return hideSelector ? removeSelector(classes.md) : classes.md;\n };\n return {\n keys: keys,\n values: values,\n classes: classes,\n getBreakpointClass: getBreakpointClass,\n up: up,\n down: down,\n between: between,\n only: only\n };\n};\nexport default createBreakpoints;","import _objectWithoutProperties from \"@babel/runtime/helpers/objectWithoutProperties\";\nimport _defineProperty from \"@babel/runtime/helpers/defineProperty\";\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nimport React, { useMemo } from 'react';\nimport PT from 'prop-types';\nimport { ThemeProvider as SCThemeProvider } from 'styled-components';\nimport merge from 'lodash.merge';\nimport { record } from '../../utils/types/prop-types';\nimport { applyPolymorphicFunctionProp, objectKeys, objectValues } from '../../utils/functions';\nimport { Breakpoint } from '../../utils/types/css';\nimport { Color } from '../../utils/types/palette';\nimport { Shadows } from '../../utils/types/shadows';\nimport { FontVariant } from '../../utils/types/typography';\nimport { BorderRadiusSize } from '../../utils/types/shape';\nimport { Typography, CommonStyles } from '../roots';\nimport { defaultPalette } from '../roots/palette';\nimport { defaultShadows } from '../roots/shadows';\nimport { getDefaultTypography } from '../roots/typography';\nimport createBreakpoints from '../roots/breakpoints/entity/create-breakpoints';\nvar defaultShape = {\n borderRadius: _defineProperty(_defineProperty(_defineProperty({}, BorderRadiusSize.Sm, '2px'), BorderRadiusSize.Md, '4px'), BorderRadiusSize.Lg, '8px')\n};\nvar ThemeProvider = function ThemeProvider(_ref) {\n var children = _ref.children,\n _ref$theme = _ref.theme,\n theme = _ref$theme === void 0 ? {} : _ref$theme;\n var _theme$palette = theme.palette,\n paletteOverride = _theme$palette === void 0 ? {} : _theme$palette,\n _theme$breakpoints = theme.breakpoints,\n breakpointsOverride = _theme$breakpoints === void 0 ? {} : _theme$breakpoints,\n _theme$typography = theme.typography,\n typographyOverride = _theme$typography === void 0 ? {} : _theme$typography,\n _theme$shape = theme.shape,\n shapeOverride = _theme$shape === void 0 ? {} : _theme$shape,\n _theme$shadows = theme.shadows,\n shadowsOverride = _theme$shadows === void 0 ? {} : _theme$shadows;\n var finalTheme = useMemo(function () {\n var palette = _objectSpread(_objectSpread({}, defaultPalette), paletteOverride);\n var breakpoints = createBreakpoints(breakpointsOverride);\n var shadows = _objectSpread(_objectSpread({}, defaultShadows), shadowsOverride);\n return {\n palette: palette,\n breakpoints: breakpoints,\n typography: getDefaultTypography(typographyOverride),\n shape: _objectSpread({}, merge(_objectSpread({}, defaultShape), _objectSpread({}, shapeOverride))),\n shadows: shadows\n };\n return {};\n }, [JSON.stringify(theme)]);\n return /*#__PURE__*/React.createElement(SCThemeProvider, {\n theme: finalTheme\n }, /*#__PURE__*/React.createElement(React.Fragment, null, applyPolymorphicFunctionProp(children, finalTheme), /*#__PURE__*/React.createElement(CommonStyles, null), /*#__PURE__*/React.createElement(Typography, null)));\n};\nvar _getDefaultTypography = getDefaultTypography(),\n baseLineHeight = _getDefaultTypography.baseLineHeight,\n font = _getDefaultTypography.font,\n typography = _objectWithoutProperties(_getDefaultTypography, [\"baseLineHeight\", \"font\"]);\nThemeProvider.propTypes = {\n children: PT.oneOfType([PT.node, PT.func, PT.arrayOf(PT.node)]).isRequired,\n theme: PT.exact({\n breakpoints: PT.exact({\n keys: PT.arrayOf(PT.string),\n values: PT.exact(record(objectValues(Breakpoint), PT.number)),\n classes: PT.exact(record(objectValues(Breakpoint), PT.string)),\n getBreakpointClass: PT.func,\n up: PT.func,\n down: PT.func,\n between: PT.func,\n only: PT.func\n }),\n palette: PT.exact(record(objectValues(Color), PT.string)),\n shadows: PT.exact(record(objectValues(Shadows), PT.string)),\n shape: PT.exact({\n borderRadius: PT.exact(record(objectValues(BorderRadiusSize), PT.string))\n }),\n typography: PT.exact(_objectSpread({\n baseLineHeight: PT.oneOfType([PT.string, PT.number]),\n font: PT.exact(record(objectValues(FontVariant), PT.object))\n }, record(objectKeys(typography), PT.string)))\n })\n};\nexport default ThemeProvider;","function _arrayWithHoles(r) {\n if (Array.isArray(r)) return r;\n}\nexport { _arrayWithHoles as default };","function _iterableToArrayLimit(r, l) {\n var t = null == r ? null : \"undefined\" != typeof Symbol && r[Symbol.iterator] || r[\"@@iterator\"];\n if (null != t) {\n var e,\n n,\n i,\n u,\n a = [],\n f = !0,\n o = !1;\n try {\n if (i = (t = t.call(r)).next, 0 === l) {\n if (Object(t) !== t) return;\n f = !1;\n } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0);\n } catch (r) {\n o = !0, n = r;\n } finally {\n try {\n if (!f && null != t[\"return\"] && (u = t[\"return\"](), Object(u) !== u)) return;\n } finally {\n if (o) throw n;\n }\n }\n return a;\n }\n}\nexport { _iterableToArrayLimit as default };","function _nonIterableRest() {\n throw new TypeError(\"Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\");\n}\nexport { _nonIterableRest as default };","import arrayWithHoles from \"./arrayWithHoles.js\";\nimport iterableToArrayLimit from \"./iterableToArrayLimit.js\";\nimport unsupportedIterableToArray from \"./unsupportedIterableToArray.js\";\nimport nonIterableRest from \"./nonIterableRest.js\";\nfunction _slicedToArray(r, e) {\n return arrayWithHoles(r) || iterableToArrayLimit(r, e) || unsupportedIterableToArray(r, e) || nonIterableRest();\n}\nexport { _slicedToArray as default };","function _extends() {\n return _extends = Object.assign ? Object.assign.bind() : function (n) {\n for (var e = 1; e < arguments.length; e++) {\n var t = arguments[e];\n for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]);\n }\n return n;\n }, _extends.apply(null, arguments);\n}\nexport { _extends as default };","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports._registerNode = exports.Konva = exports.glob = void 0;\nconst PI_OVER_180 = Math.PI / 180;\nfunction detectBrowser() {\n return (typeof window !== 'undefined' &&\n ({}.toString.call(window) === '[object Window]' ||\n {}.toString.call(window) === '[object global]'));\n}\nexports.glob = typeof global !== 'undefined'\n ? global\n : typeof window !== 'undefined'\n ? window\n : typeof WorkerGlobalScope !== 'undefined'\n ? self\n : {};\nexports.Konva = {\n _global: exports.glob,\n version: '9.3.15',\n isBrowser: detectBrowser(),\n isUnminified: /param/.test(function (param) { }.toString()),\n dblClickWindow: 400,\n getAngle(angle) {\n return exports.Konva.angleDeg ? angle * PI_OVER_180 : angle;\n },\n enableTrace: false,\n pointerEventsEnabled: true,\n autoDrawEnabled: true,\n hitOnDragEnabled: false,\n capturePointerEventsEnabled: false,\n _mouseListenClick: false,\n _touchListenClick: false,\n _pointerListenClick: false,\n _mouseInDblClickWindow: false,\n _touchInDblClickWindow: false,\n _pointerInDblClickWindow: false,\n _mouseDblClickPointerId: null,\n _touchDblClickPointerId: null,\n _pointerDblClickPointerId: null,\n _fixTextRendering: false,\n pixelRatio: (typeof window !== 'undefined' && window.devicePixelRatio) || 1,\n dragDistance: 3,\n angleDeg: true,\n showWarnings: true,\n dragButtons: [0, 1],\n isDragging() {\n return exports.Konva['DD'].isDragging;\n },\n isTransforming() {\n var _a;\n return (_a = exports.Konva['Transformer']) === null || _a === void 0 ? void 0 : _a.isTransforming();\n },\n isDragReady() {\n return !!exports.Konva['DD'].node;\n },\n releaseCanvasOnDestroy: true,\n document: exports.glob.document,\n _injectGlobal(Konva) {\n exports.glob.Konva = Konva;\n },\n};\nconst _registerNode = (NodeClass) => {\n exports.Konva[NodeClass.prototype.getClassName()] = NodeClass;\n};\nexports._registerNode = _registerNode;\nexports.Konva._injectGlobal(exports.Konva);\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Util = exports.Transform = void 0;\nconst Global_1 = require(\"./Global\");\nclass Transform {\n constructor(m = [1, 0, 0, 1, 0, 0]) {\n this.dirty = false;\n this.m = (m && m.slice()) || [1, 0, 0, 1, 0, 0];\n }\n reset() {\n this.m[0] = 1;\n this.m[1] = 0;\n this.m[2] = 0;\n this.m[3] = 1;\n this.m[4] = 0;\n this.m[5] = 0;\n }\n copy() {\n return new Transform(this.m);\n }\n copyInto(tr) {\n tr.m[0] = this.m[0];\n tr.m[1] = this.m[1];\n tr.m[2] = this.m[2];\n tr.m[3] = this.m[3];\n tr.m[4] = this.m[4];\n tr.m[5] = this.m[5];\n }\n point(point) {\n var m = this.m;\n return {\n x: m[0] * point.x + m[2] * point.y + m[4],\n y: m[1] * point.x + m[3] * point.y + m[5],\n };\n }\n translate(x, y) {\n this.m[4] += this.m[0] * x + this.m[2] * y;\n this.m[5] += this.m[1] * x + this.m[3] * y;\n return this;\n }\n scale(sx, sy) {\n this.m[0] *= sx;\n this.m[1] *= sx;\n this.m[2] *= sy;\n this.m[3] *= sy;\n return this;\n }\n rotate(rad) {\n var c = Math.cos(rad);\n var s = Math.sin(rad);\n var m11 = this.m[0] * c + this.m[2] * s;\n var m12 = this.m[1] * c + this.m[3] * s;\n var m21 = this.m[0] * -s + this.m[2] * c;\n var m22 = this.m[1] * -s + this.m[3] * c;\n this.m[0] = m11;\n this.m[1] = m12;\n this.m[2] = m21;\n this.m[3] = m22;\n return this;\n }\n getTranslation() {\n return {\n x: this.m[4],\n y: this.m[5],\n };\n }\n skew(sx, sy) {\n var m11 = this.m[0] + this.m[2] * sy;\n var m12 = this.m[1] + this.m[3] * sy;\n var m21 = this.m[2] + this.m[0] * sx;\n var m22 = this.m[3] + this.m[1] * sx;\n this.m[0] = m11;\n this.m[1] = m12;\n this.m[2] = m21;\n this.m[3] = m22;\n return this;\n }\n multiply(matrix) {\n var m11 = this.m[0] * matrix.m[0] + this.m[2] * matrix.m[1];\n var m12 = this.m[1] * matrix.m[0] + this.m[3] * matrix.m[1];\n var m21 = this.m[0] * matrix.m[2] + this.m[2] * matrix.m[3];\n var m22 = this.m[1] * matrix.m[2] + this.m[3] * matrix.m[3];\n var dx = this.m[0] * matrix.m[4] + this.m[2] * matrix.m[5] + this.m[4];\n var dy = this.m[1] * matrix.m[4] + this.m[3] * matrix.m[5] + this.m[5];\n this.m[0] = m11;\n this.m[1] = m12;\n this.m[2] = m21;\n this.m[3] = m22;\n this.m[4] = dx;\n this.m[5] = dy;\n return this;\n }\n invert() {\n var d = 1 / (this.m[0] * this.m[3] - this.m[1] * this.m[2]);\n var m0 = this.m[3] * d;\n var m1 = -this.m[1] * d;\n var m2 = -this.m[2] * d;\n var m3 = this.m[0] * d;\n var m4 = d * (this.m[2] * this.m[5] - this.m[3] * this.m[4]);\n var m5 = d * (this.m[1] * this.m[4] - this.m[0] * this.m[5]);\n this.m[0] = m0;\n this.m[1] = m1;\n this.m[2] = m2;\n this.m[3] = m3;\n this.m[4] = m4;\n this.m[5] = m5;\n return this;\n }\n getMatrix() {\n return this.m;\n }\n decompose() {\n var a = this.m[0];\n var b = this.m[1];\n var c = this.m[2];\n var d = this.m[3];\n var e = this.m[4];\n var f = this.m[5];\n var delta = a * d - b * c;\n let result = {\n x: e,\n y: f,\n rotation: 0,\n scaleX: 0,\n scaleY: 0,\n skewX: 0,\n skewY: 0,\n };\n if (a != 0 || b != 0) {\n var r = Math.sqrt(a * a + b * b);\n result.rotation = b > 0 ? Math.acos(a / r) : -Math.acos(a / r);\n result.scaleX = r;\n result.scaleY = delta / r;\n result.skewX = (a * c + b * d) / delta;\n result.skewY = 0;\n }\n else if (c != 0 || d != 0) {\n var s = Math.sqrt(c * c + d * d);\n result.rotation =\n Math.PI / 2 - (d > 0 ? Math.acos(-c / s) : -Math.acos(c / s));\n result.scaleX = delta / s;\n result.scaleY = s;\n result.skewX = 0;\n result.skewY = (a * c + b * d) / delta;\n }\n else {\n }\n result.rotation = exports.Util._getRotation(result.rotation);\n return result;\n }\n}\nexports.Transform = Transform;\nvar OBJECT_ARRAY = '[object Array]', OBJECT_NUMBER = '[object Number]', OBJECT_STRING = '[object String]', OBJECT_BOOLEAN = '[object Boolean]', PI_OVER_DEG180 = Math.PI / 180, DEG180_OVER_PI = 180 / Math.PI, HASH = '#', EMPTY_STRING = '', ZERO = '0', KONVA_WARNING = 'Konva warning: ', KONVA_ERROR = 'Konva error: ', RGB_PAREN = 'rgb(', COLORS = {\n aliceblue: [240, 248, 255],\n antiquewhite: [250, 235, 215],\n aqua: [0, 255, 255],\n aquamarine: [127, 255, 212],\n azure: [240, 255, 255],\n beige: [245, 245, 220],\n bisque: [255, 228, 196],\n black: [0, 0, 0],\n blanchedalmond: [255, 235, 205],\n blue: [0, 0, 255],\n blueviolet: [138, 43, 226],\n brown: [165, 42, 42],\n burlywood: [222, 184, 135],\n cadetblue: [95, 158, 160],\n chartreuse: [127, 255, 0],\n chocolate: [210, 105, 30],\n coral: [255, 127, 80],\n cornflowerblue: [100, 149, 237],\n cornsilk: [255, 248, 220],\n crimson: [220, 20, 60],\n cyan: [0, 255, 255],\n darkblue: [0, 0, 139],\n darkcyan: [0, 139, 139],\n darkgoldenrod: [184, 132, 11],\n darkgray: [169, 169, 169],\n darkgreen: [0, 100, 0],\n darkgrey: [169, 169, 169],\n darkkhaki: [189, 183, 107],\n darkmagenta: [139, 0, 139],\n darkolivegreen: [85, 107, 47],\n darkorange: [255, 140, 0],\n darkorchid: [153, 50, 204],\n darkred: [139, 0, 0],\n darksalmon: [233, 150, 122],\n darkseagreen: [143, 188, 143],\n darkslateblue: [72, 61, 139],\n darkslategray: [47, 79, 79],\n darkslategrey: [47, 79, 79],\n darkturquoise: [0, 206, 209],\n darkviolet: [148, 0, 211],\n deeppink: [255, 20, 147],\n deepskyblue: [0, 191, 255],\n dimgray: [105, 105, 105],\n dimgrey: [105, 105, 105],\n dodgerblue: [30, 144, 255],\n firebrick: [178, 34, 34],\n floralwhite: [255, 255, 240],\n forestgreen: [34, 139, 34],\n fuchsia: [255, 0, 255],\n gainsboro: [220, 220, 220],\n ghostwhite: [248, 248, 255],\n gold: [255, 215, 0],\n goldenrod: [218, 165, 32],\n gray: [128, 128, 128],\n green: [0, 128, 0],\n greenyellow: [173, 255, 47],\n grey: [128, 128, 128],\n honeydew: [240, 255, 240],\n hotpink: [255, 105, 180],\n indianred: [205, 92, 92],\n indigo: [75, 0, 130],\n ivory: [255, 255, 240],\n khaki: [240, 230, 140],\n lavender: [230, 230, 250],\n lavenderblush: [255, 240, 245],\n lawngreen: [124, 252, 0],\n lemonchiffon: [255, 250, 205],\n lightblue: [173, 216, 230],\n lightcoral: [240, 128, 128],\n lightcyan: [224, 255, 255],\n lightgoldenrodyellow: [250, 250, 210],\n lightgray: [211, 211, 211],\n lightgreen: [144, 238, 144],\n lightgrey: [211, 211, 211],\n lightpink: [255, 182, 193],\n lightsalmon: [255, 160, 122],\n lightseagreen: [32, 178, 170],\n lightskyblue: [135, 206, 250],\n lightslategray: [119, 136, 153],\n lightslategrey: [119, 136, 153],\n lightsteelblue: [176, 196, 222],\n lightyellow: [255, 255, 224],\n lime: [0, 255, 0],\n limegreen: [50, 205, 50],\n linen: [250, 240, 230],\n magenta: [255, 0, 255],\n maroon: [128, 0, 0],\n mediumaquamarine: [102, 205, 170],\n mediumblue: [0, 0, 205],\n mediumorchid: [186, 85, 211],\n mediumpurple: [147, 112, 219],\n mediumseagreen: [60, 179, 113],\n mediumslateblue: [123, 104, 238],\n mediumspringgreen: [0, 250, 154],\n mediumturquoise: [72, 209, 204],\n mediumvioletred: [199, 21, 133],\n midnightblue: [25, 25, 112],\n mintcream: [245, 255, 250],\n mistyrose: [255, 228, 225],\n moccasin: [255, 228, 181],\n navajowhite: [255, 222, 173],\n navy: [0, 0, 128],\n oldlace: [253, 245, 230],\n olive: [128, 128, 0],\n olivedrab: [107, 142, 35],\n orange: [255, 165, 0],\n orangered: [255, 69, 0],\n orchid: [218, 112, 214],\n palegoldenrod: [238, 232, 170],\n palegreen: [152, 251, 152],\n paleturquoise: [175, 238, 238],\n palevioletred: [219, 112, 147],\n papayawhip: [255, 239, 213],\n peachpuff: [255, 218, 185],\n peru: [205, 133, 63],\n pink: [255, 192, 203],\n plum: [221, 160, 203],\n powderblue: [176, 224, 230],\n purple: [128, 0, 128],\n rebeccapurple: [102, 51, 153],\n red: [255, 0, 0],\n rosybrown: [188, 143, 143],\n royalblue: [65, 105, 225],\n saddlebrown: [139, 69, 19],\n salmon: [250, 128, 114],\n sandybrown: [244, 164, 96],\n seagreen: [46, 139, 87],\n seashell: [255, 245, 238],\n sienna: [160, 82, 45],\n silver: [192, 192, 192],\n skyblue: [135, 206, 235],\n slateblue: [106, 90, 205],\n slategray: [119, 128, 144],\n slategrey: [119, 128, 144],\n snow: [255, 255, 250],\n springgreen: [0, 255, 127],\n steelblue: [70, 130, 180],\n tan: [210, 180, 140],\n teal: [0, 128, 128],\n thistle: [216, 191, 216],\n transparent: [255, 255, 255, 0],\n tomato: [255, 99, 71],\n turquoise: [64, 224, 208],\n violet: [238, 130, 238],\n wheat: [245, 222, 179],\n white: [255, 255, 255],\n whitesmoke: [245, 245, 245],\n yellow: [255, 255, 0],\n yellowgreen: [154, 205, 5],\n}, RGB_REGEX = /rgb\\((\\d{1,3}),(\\d{1,3}),(\\d{1,3})\\)/, animQueue = [];\nconst req = (typeof requestAnimationFrame !== 'undefined' && requestAnimationFrame) ||\n function (f) {\n setTimeout(f, 60);\n };\nexports.Util = {\n _isElement(obj) {\n return !!(obj && obj.nodeType == 1);\n },\n _isFunction(obj) {\n return !!(obj && obj.constructor && obj.call && obj.apply);\n },\n _isPlainObject(obj) {\n return !!obj && obj.constructor === Object;\n },\n _isArray(obj) {\n return Object.prototype.toString.call(obj) === OBJECT_ARRAY;\n },\n _isNumber(obj) {\n return (Object.prototype.toString.call(obj) === OBJECT_NUMBER &&\n !isNaN(obj) &&\n isFinite(obj));\n },\n _isString(obj) {\n return Object.prototype.toString.call(obj) === OBJECT_STRING;\n },\n _isBoolean(obj) {\n return Object.prototype.toString.call(obj) === OBJECT_BOOLEAN;\n },\n isObject(val) {\n return val instanceof Object;\n },\n isValidSelector(selector) {\n if (typeof selector !== 'string') {\n return false;\n }\n var firstChar = selector[0];\n return (firstChar === '#' ||\n firstChar === '.' ||\n firstChar === firstChar.toUpperCase());\n },\n _sign(number) {\n if (number === 0) {\n return 1;\n }\n if (number > 0) {\n return 1;\n }\n else {\n return -1;\n }\n },\n requestAnimFrame(callback) {\n animQueue.push(callback);\n if (animQueue.length === 1) {\n req(function () {\n const queue = animQueue;\n animQueue = [];\n queue.forEach(function (cb) {\n cb();\n });\n });\n }\n },\n createCanvasElement() {\n var canvas = document.createElement('canvas');\n try {\n canvas.style = canvas.style || {};\n }\n catch (e) { }\n return canvas;\n },\n createImageElement() {\n return document.createElement('img');\n },\n _isInDocument(el) {\n while ((el = el.parentNode)) {\n if (el == document) {\n return true;\n }\n }\n return false;\n },\n _urlToImage(url, callback) {\n var imageObj = exports.Util.createImageElement();\n imageObj.onload = function () {\n callback(imageObj);\n };\n imageObj.src = url;\n },\n _rgbToHex(r, g, b) {\n return ((1 << 24) + (r << 16) + (g << 8) + b).toString(16).slice(1);\n },\n _hexToRgb(hex) {\n hex = hex.replace(HASH, EMPTY_STRING);\n var bigint = parseInt(hex, 16);\n return {\n r: (bigint >> 16) & 255,\n g: (bigint >> 8) & 255,\n b: bigint & 255,\n };\n },\n getRandomColor() {\n var randColor = ((Math.random() * 0xffffff) << 0).toString(16);\n while (randColor.length < 6) {\n randColor = ZERO + randColor;\n }\n return HASH + randColor;\n },\n getRGB(color) {\n var rgb;\n if (color in COLORS) {\n rgb = COLORS[color];\n return {\n r: rgb[0],\n g: rgb[1],\n b: rgb[2],\n };\n }\n else if (color[0] === HASH) {\n return this._hexToRgb(color.substring(1));\n }\n else if (color.substr(0, 4) === RGB_PAREN) {\n rgb = RGB_REGEX.exec(color.replace(/ /g, ''));\n return {\n r: parseInt(rgb[1], 10),\n g: parseInt(rgb[2], 10),\n b: parseInt(rgb[3], 10),\n };\n }\n else {\n return {\n r: 0,\n g: 0,\n b: 0,\n };\n }\n },\n colorToRGBA(str) {\n str = str || 'black';\n return (exports.Util._namedColorToRBA(str) ||\n exports.Util._hex3ColorToRGBA(str) ||\n exports.Util._hex4ColorToRGBA(str) ||\n exports.Util._hex6ColorToRGBA(str) ||\n exports.Util._hex8ColorToRGBA(str) ||\n exports.Util._rgbColorToRGBA(str) ||\n exports.Util._rgbaColorToRGBA(str) ||\n exports.Util._hslColorToRGBA(str));\n },\n _namedColorToRBA(str) {\n var c = COLORS[str.toLowerCase()];\n if (!c) {\n return null;\n }\n return {\n r: c[0],\n g: c[1],\n b: c[2],\n a: 1,\n };\n },\n _rgbColorToRGBA(str) {\n if (str.indexOf('rgb(') === 0) {\n str = str.match(/rgb\\(([^)]+)\\)/)[1];\n var parts = str.split(/ *, */).map(Number);\n return {\n r: parts[0],\n g: parts[1],\n b: parts[2],\n a: 1,\n };\n }\n },\n _rgbaColorToRGBA(str) {\n if (str.indexOf('rgba(') === 0) {\n str = str.match(/rgba\\(([^)]+)\\)/)[1];\n var parts = str.split(/ *, */).map((n, index) => {\n if (n.slice(-1) === '%') {\n return index === 3 ? parseInt(n) / 100 : (parseInt(n) / 100) * 255;\n }\n return Number(n);\n });\n return {\n r: parts[0],\n g: parts[1],\n b: parts[2],\n a: parts[3],\n };\n }\n },\n _hex8ColorToRGBA(str) {\n if (str[0] === '#' && str.length === 9) {\n return {\n r: parseInt(str.slice(1, 3), 16),\n g: parseInt(str.slice(3, 5), 16),\n b: parseInt(str.slice(5, 7), 16),\n a: parseInt(str.slice(7, 9), 16) / 0xff,\n };\n }\n },\n _hex6ColorToRGBA(str) {\n if (str[0] === '#' && str.length === 7) {\n return {\n r: parseInt(str.slice(1, 3), 16),\n g: parseInt(str.slice(3, 5), 16),\n b: parseInt(str.slice(5, 7), 16),\n a: 1,\n };\n }\n },\n _hex4ColorToRGBA(str) {\n if (str[0] === '#' && str.length === 5) {\n return {\n r: parseInt(str[1] + str[1], 16),\n g: parseInt(str[2] + str[2], 16),\n b: parseInt(str[3] + str[3], 16),\n a: parseInt(str[4] + str[4], 16) / 0xff,\n };\n }\n },\n _hex3ColorToRGBA(str) {\n if (str[0] === '#' && str.length === 4) {\n return {\n r: parseInt(str[1] + str[1], 16),\n g: parseInt(str[2] + str[2], 16),\n b: parseInt(str[3] + str[3], 16),\n a: 1,\n };\n }\n },\n _hslColorToRGBA(str) {\n if (/hsl\\((\\d+),\\s*([\\d.]+)%,\\s*([\\d.]+)%\\)/g.test(str)) {\n const [_, ...hsl] = /hsl\\((\\d+),\\s*([\\d.]+)%,\\s*([\\d.]+)%\\)/g.exec(str);\n const h = Number(hsl[0]) / 360;\n const s = Number(hsl[1]) / 100;\n const l = Number(hsl[2]) / 100;\n let t2;\n let t3;\n let val;\n if (s === 0) {\n val = l * 255;\n return {\n r: Math.round(val),\n g: Math.round(val),\n b: Math.round(val),\n a: 1,\n };\n }\n if (l < 0.5) {\n t2 = l * (1 + s);\n }\n else {\n t2 = l + s - l * s;\n }\n const t1 = 2 * l - t2;\n const rgb = [0, 0, 0];\n for (let i = 0; i < 3; i++) {\n t3 = h + (1 / 3) * -(i - 1);\n if (t3 < 0) {\n t3++;\n }\n if (t3 > 1) {\n t3--;\n }\n if (6 * t3 < 1) {\n val = t1 + (t2 - t1) * 6 * t3;\n }\n else if (2 * t3 < 1) {\n val = t2;\n }\n else if (3 * t3 < 2) {\n val = t1 + (t2 - t1) * (2 / 3 - t3) * 6;\n }\n else {\n val = t1;\n }\n rgb[i] = val * 255;\n }\n return {\n r: Math.round(rgb[0]),\n g: Math.round(rgb[1]),\n b: Math.round(rgb[2]),\n a: 1,\n };\n }\n },\n haveIntersection(r1, r2) {\n return !(r2.x > r1.x + r1.width ||\n r2.x + r2.width < r1.x ||\n r2.y > r1.y + r1.height ||\n r2.y + r2.height < r1.y);\n },\n cloneObject(obj) {\n var retObj = {};\n for (var key in obj) {\n if (this._isPlainObject(obj[key])) {\n retObj[key] = this.cloneObject(obj[key]);\n }\n else if (this._isArray(obj[key])) {\n retObj[key] = this.cloneArray(obj[key]);\n }\n else {\n retObj[key] = obj[key];\n }\n }\n return retObj;\n },\n cloneArray(arr) {\n return arr.slice(0);\n },\n degToRad(deg) {\n return deg * PI_OVER_DEG180;\n },\n radToDeg(rad) {\n return rad * DEG180_OVER_PI;\n },\n _degToRad(deg) {\n exports.Util.warn('Util._degToRad is removed. Please use public Util.degToRad instead.');\n return exports.Util.degToRad(deg);\n },\n _radToDeg(rad) {\n exports.Util.warn('Util._radToDeg is removed. Please use public Util.radToDeg instead.');\n return exports.Util.radToDeg(rad);\n },\n _getRotation(radians) {\n return Global_1.Konva.angleDeg ? exports.Util.radToDeg(radians) : radians;\n },\n _capitalize(str) {\n return str.charAt(0).toUpperCase() + str.slice(1);\n },\n throw(str) {\n throw new Error(KONVA_ERROR + str);\n },\n error(str) {\n console.error(KONVA_ERROR + str);\n },\n warn(str) {\n if (!Global_1.Konva.showWarnings) {\n return;\n }\n console.warn(KONVA_WARNING + str);\n },\n each(obj, func) {\n for (var key in obj) {\n func(key, obj[key]);\n }\n },\n _inRange(val, left, right) {\n return left <= val && val < right;\n },\n _getProjectionToSegment(x1, y1, x2, y2, x3, y3) {\n var x, y, dist;\n var pd2 = (x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2);\n if (pd2 == 0) {\n x = x1;\n y = y1;\n dist = (x3 - x2) * (x3 - x2) + (y3 - y2) * (y3 - y2);\n }\n else {\n var u = ((x3 - x1) * (x2 - x1) + (y3 - y1) * (y2 - y1)) / pd2;\n if (u < 0) {\n x = x1;\n y = y1;\n dist = (x1 - x3) * (x1 - x3) + (y1 - y3) * (y1 - y3);\n }\n else if (u > 1.0) {\n x = x2;\n y = y2;\n dist = (x2 - x3) * (x2 - x3) + (y2 - y3) * (y2 - y3);\n }\n else {\n x = x1 + u * (x2 - x1);\n y = y1 + u * (y2 - y1);\n dist = (x - x3) * (x - x3) + (y - y3) * (y - y3);\n }\n }\n return [x, y, dist];\n },\n _getProjectionToLine(pt, line, isClosed) {\n var pc = exports.Util.cloneObject(pt);\n var dist = Number.MAX_VALUE;\n line.forEach(function (p1, i) {\n if (!isClosed && i === line.length - 1) {\n return;\n }\n var p2 = line[(i + 1) % line.length];\n var proj = exports.Util._getProjectionToSegment(p1.x, p1.y, p2.x, p2.y, pt.x, pt.y);\n var px = proj[0], py = proj[1], pdist = proj[2];\n if (pdist < dist) {\n pc.x = px;\n pc.y = py;\n dist = pdist;\n }\n });\n return pc;\n },\n _prepareArrayForTween(startArray, endArray, isClosed) {\n var n, start = [], end = [];\n if (startArray.length > endArray.length) {\n var temp = endArray;\n endArray = startArray;\n startArray = temp;\n }\n for (n = 0; n < startArray.length; n += 2) {\n start.push({\n x: startArray[n],\n y: startArray[n + 1],\n });\n }\n for (n = 0; n < endArray.length; n += 2) {\n end.push({\n x: endArray[n],\n y: endArray[n + 1],\n });\n }\n var newStart = [];\n end.forEach(function (point) {\n var pr = exports.Util._getProjectionToLine(point, start, isClosed);\n newStart.push(pr.x);\n newStart.push(pr.y);\n });\n return newStart;\n },\n _prepareToStringify(obj) {\n var desc;\n obj.visitedByCircularReferenceRemoval = true;\n for (var key in obj) {\n if (!(obj.hasOwnProperty(key) && obj[key] && typeof obj[key] == 'object')) {\n continue;\n }\n desc = Object.getOwnPropertyDescriptor(obj, key);\n if (obj[key].visitedByCircularReferenceRemoval ||\n exports.Util._isElement(obj[key])) {\n if (desc.configurable) {\n delete obj[key];\n }\n else {\n return null;\n }\n }\n else if (exports.Util._prepareToStringify(obj[key]) === null) {\n if (desc.configurable) {\n delete obj[key];\n }\n else {\n return null;\n }\n }\n }\n delete obj.visitedByCircularReferenceRemoval;\n return obj;\n },\n _assign(target, source) {\n for (var key in source) {\n target[key] = source[key];\n }\n return target;\n },\n _getFirstPointerId(evt) {\n if (!evt.touches) {\n return evt.pointerId || 999;\n }\n else {\n return evt.changedTouches[0].identifier;\n }\n },\n releaseCanvas(...canvases) {\n if (!Global_1.Konva.releaseCanvasOnDestroy)\n return;\n canvases.forEach((c) => {\n c.width = 0;\n c.height = 0;\n });\n },\n drawRoundedRectPath(context, width, height, cornerRadius) {\n let topLeft = 0;\n let topRight = 0;\n let bottomLeft = 0;\n let bottomRight = 0;\n if (typeof cornerRadius === 'number') {\n topLeft =\n topRight =\n bottomLeft =\n bottomRight =\n Math.min(cornerRadius, width / 2, height / 2);\n }\n else {\n topLeft = Math.min(cornerRadius[0] || 0, width / 2, height / 2);\n topRight = Math.min(cornerRadius[1] || 0, width / 2, height / 2);\n bottomRight = Math.min(cornerRadius[2] || 0, width / 2, height / 2);\n bottomLeft = Math.min(cornerRadius[3] || 0, width / 2, height / 2);\n }\n context.moveTo(topLeft, 0);\n context.lineTo(width - topRight, 0);\n context.arc(width - topRight, topRight, topRight, (Math.PI * 3) / 2, 0, false);\n context.lineTo(width, height - bottomRight);\n context.arc(width - bottomRight, height - bottomRight, bottomRight, 0, Math.PI / 2, false);\n context.lineTo(bottomLeft, height);\n context.arc(bottomLeft, height - bottomLeft, bottomLeft, Math.PI / 2, Math.PI, false);\n context.lineTo(0, topLeft);\n context.arc(topLeft, topLeft, topLeft, Math.PI, (Math.PI * 3) / 2, false);\n },\n};\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.getComponentValidator = exports.getBooleanValidator = exports.getNumberArrayValidator = exports.getFunctionValidator = exports.getStringOrGradientValidator = exports.getStringValidator = exports.getNumberOrAutoValidator = exports.getNumberOrArrayOfNumbersValidator = exports.getNumberValidator = exports.alphaComponent = exports.RGBComponent = void 0;\nconst Global_1 = require(\"./Global\");\nconst Util_1 = require(\"./Util\");\nfunction _formatValue(val) {\n if (Util_1.Util._isString(val)) {\n return '\"' + val + '\"';\n }\n if (Object.prototype.toString.call(val) === '[object Number]') {\n return val;\n }\n if (Util_1.Util._isBoolean(val)) {\n return val;\n }\n return Object.prototype.toString.call(val);\n}\nfunction RGBComponent(val) {\n if (val > 255) {\n return 255;\n }\n else if (val < 0) {\n return 0;\n }\n return Math.round(val);\n}\nexports.RGBComponent = RGBComponent;\nfunction alphaComponent(val) {\n if (val > 1) {\n return 1;\n }\n else if (val < 0.0001) {\n return 0.0001;\n }\n return val;\n}\nexports.alphaComponent = alphaComponent;\nfunction getNumberValidator() {\n if (Global_1.Konva.isUnminified) {\n return function (val, attr) {\n if (!Util_1.Util._isNumber(val)) {\n Util_1.Util.warn(_formatValue(val) +\n ' is a not valid value for \"' +\n attr +\n '\" attribute. The value should be a number.');\n }\n return val;\n };\n }\n}\nexports.getNumberValidator = getNumberValidator;\nfunction getNumberOrArrayOfNumbersValidator(noOfElements) {\n if (Global_1.Konva.isUnminified) {\n return function (val, attr) {\n let isNumber = Util_1.Util._isNumber(val);\n let isValidArray = Util_1.Util._isArray(val) && val.length == noOfElements;\n if (!isNumber && !isValidArray) {\n Util_1.Util.warn(_formatValue(val) +\n ' is a not valid value for \"' +\n attr +\n '\" attribute. The value should be a number or Array(' +\n noOfElements +\n ')');\n }\n return val;\n };\n }\n}\nexports.getNumberOrArrayOfNumbersValidator = getNumberOrArrayOfNumbersValidator;\nfunction getNumberOrAutoValidator() {\n if (Global_1.Konva.isUnminified) {\n return function (val, attr) {\n var isNumber = Util_1.Util._isNumber(val);\n var isAuto = val === 'auto';\n if (!(isNumber || isAuto)) {\n Util_1.Util.warn(_formatValue(val) +\n ' is a not valid value for \"' +\n attr +\n '\" attribute. The value should be a number or \"auto\".');\n }\n return val;\n };\n }\n}\nexports.getNumberOrAutoValidator = getNumberOrAutoValidator;\nfunction getStringValidator() {\n if (Global_1.Konva.isUnminified) {\n return function (val, attr) {\n if (!Util_1.Util._isString(val)) {\n Util_1.Util.warn(_formatValue(val) +\n ' is a not valid value for \"' +\n attr +\n '\" attribute. The value should be a string.');\n }\n return val;\n };\n }\n}\nexports.getStringValidator = getStringValidator;\nfunction getStringOrGradientValidator() {\n if (Global_1.Konva.isUnminified) {\n return function (val, attr) {\n const isString = Util_1.Util._isString(val);\n const isGradient = Object.prototype.toString.call(val) === '[object CanvasGradient]' ||\n (val && val.addColorStop);\n if (!(isString || isGradient)) {\n Util_1.Util.warn(_formatValue(val) +\n ' is a not valid value for \"' +\n attr +\n '\" attribute. The value should be a string or a native gradient.');\n }\n return val;\n };\n }\n}\nexports.getStringOrGradientValidator = getStringOrGradientValidator;\nfunction getFunctionValidator() {\n if (Global_1.Konva.isUnminified) {\n return function (val, attr) {\n if (!Util_1.Util._isFunction(val)) {\n Util_1.Util.warn(_formatValue(val) +\n ' is a not valid value for \"' +\n attr +\n '\" attribute. The value should be a function.');\n }\n return val;\n };\n }\n}\nexports.getFunctionValidator = getFunctionValidator;\nfunction getNumberArrayValidator() {\n if (Global_1.Konva.isUnminified) {\n return function (val, attr) {\n const TypedArray = Int8Array ? Object.getPrototypeOf(Int8Array) : null;\n if (TypedArray && val instanceof TypedArray) {\n return val;\n }\n if (!Util_1.Util._isArray(val)) {\n Util_1.Util.warn(_formatValue(val) +\n ' is a not valid value for \"' +\n attr +\n '\" attribute. The value should be a array of numbers.');\n }\n else {\n val.forEach(function (item) {\n if (!Util_1.Util._isNumber(item)) {\n Util_1.Util.warn('\"' +\n attr +\n '\" attribute has non numeric element ' +\n item +\n '. Make sure that all elements are numbers.');\n }\n });\n }\n return val;\n };\n }\n}\nexports.getNumberArrayValidator = getNumberArrayValidator;\nfunction getBooleanValidator() {\n if (Global_1.Konva.isUnminified) {\n return function (val, attr) {\n var isBool = val === true || val === false;\n if (!isBool) {\n Util_1.Util.warn(_formatValue(val) +\n ' is a not valid value for \"' +\n attr +\n '\" attribute. The value should be a boolean.');\n }\n return val;\n };\n }\n}\nexports.getBooleanValidator = getBooleanValidator;\nfunction getComponentValidator(components) {\n if (Global_1.Konva.isUnminified) {\n return function (val, attr) {\n if (val === undefined || val === null) {\n return val;\n }\n if (!Util_1.Util.isObject(val)) {\n Util_1.Util.warn(_formatValue(val) +\n ' is a not valid value for \"' +\n attr +\n '\" attribute. The value should be an object with properties ' +\n components);\n }\n return val;\n };\n }\n}\nexports.getComponentValidator = getComponentValidator;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Factory = void 0;\nconst Util_1 = require(\"./Util\");\nconst Validators_1 = require(\"./Validators\");\nvar GET = 'get', SET = 'set';\nexports.Factory = {\n addGetterSetter(constructor, attr, def, validator, after) {\n exports.Factory.addGetter(constructor, attr, def);\n exports.Factory.addSetter(constructor, attr, validator, after);\n exports.Factory.addOverloadedGetterSetter(constructor, attr);\n },\n addGetter(constructor, attr, def) {\n var method = GET + Util_1.Util._capitalize(attr);\n constructor.prototype[method] =\n constructor.prototype[method] ||\n function () {\n var val = this.attrs[attr];\n return val === undefined ? def : val;\n };\n },\n addSetter(constructor, attr, validator, after) {\n var method = SET + Util_1.Util._capitalize(attr);\n if (!constructor.prototype[method]) {\n exports.Factory.overWriteSetter(constructor, attr, validator, after);\n }\n },\n overWriteSetter(constructor, attr, validator, after) {\n var method = SET + Util_1.Util._capitalize(attr);\n constructor.prototype[method] = function (val) {\n if (validator && val !== undefined && val !== null) {\n val = validator.call(this, val, attr);\n }\n this._setAttr(attr, val);\n if (after) {\n after.call(this);\n }\n return this;\n };\n },\n addComponentsGetterSetter(constructor, attr, components, validator, after) {\n var len = components.length, capitalize = Util_1.Util._capitalize, getter = GET + capitalize(attr), setter = SET + capitalize(attr), n, component;\n constructor.prototype[getter] = function () {\n var ret = {};\n for (n = 0; n < len; n++) {\n component = components[n];\n ret[component] = this.getAttr(attr + capitalize(component));\n }\n return ret;\n };\n var basicValidator = (0, Validators_1.getComponentValidator)(components);\n constructor.prototype[setter] = function (val) {\n var oldVal = this.attrs[attr], key;\n if (validator) {\n val = validator.call(this, val);\n }\n if (basicValidator) {\n basicValidator.call(this, val, attr);\n }\n for (key in val) {\n if (!val.hasOwnProperty(key)) {\n continue;\n }\n this._setAttr(attr + capitalize(key), val[key]);\n }\n if (!val) {\n components.forEach((component) => {\n this._setAttr(attr + capitalize(component), undefined);\n });\n }\n this._fireChangeEvent(attr, oldVal, val);\n if (after) {\n after.call(this);\n }\n return this;\n };\n exports.Factory.addOverloadedGetterSetter(constructor, attr);\n },\n addOverloadedGetterSetter(constructor, attr) {\n var capitalizedAttr = Util_1.Util._capitalize(attr), setter = SET + capitalizedAttr, getter = GET + capitalizedAttr;\n constructor.prototype[attr] = function () {\n if (arguments.length) {\n this[setter](arguments[0]);\n return this;\n }\n return this[getter]();\n };\n },\n addDeprecatedGetterSetter(constructor, attr, def, validator) {\n Util_1.Util.error('Adding deprecated ' + attr);\n var method = GET + Util_1.Util._capitalize(attr);\n var message = attr +\n ' property is deprecated and will be removed soon. Look at Konva change log for more information.';\n constructor.prototype[method] = function () {\n Util_1.Util.error(message);\n var val = this.attrs[attr];\n return val === undefined ? def : val;\n };\n exports.Factory.addSetter(constructor, attr, validator, function () {\n Util_1.Util.error(message);\n });\n exports.Factory.addOverloadedGetterSetter(constructor, attr);\n },\n backCompat(constructor, methods) {\n Util_1.Util.each(methods, function (oldMethodName, newMethodName) {\n var method = constructor.prototype[newMethodName];\n var oldGetter = GET + Util_1.Util._capitalize(oldMethodName);\n var oldSetter = SET + Util_1.Util._capitalize(oldMethodName);\n function deprecated() {\n method.apply(this, arguments);\n Util_1.Util.error('\"' +\n oldMethodName +\n '\" method is deprecated and will be removed soon. Use \"\"' +\n newMethodName +\n '\" instead.');\n }\n constructor.prototype[oldMethodName] = deprecated;\n constructor.prototype[oldGetter] = deprecated;\n constructor.prototype[oldSetter] = deprecated;\n });\n },\n afterSetFilter() {\n this._filterUpToDate = false;\n },\n};\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.HitContext = exports.SceneContext = exports.Context = void 0;\nconst Util_1 = require(\"./Util\");\nconst Global_1 = require(\"./Global\");\nfunction simplifyArray(arr) {\n var retArr = [], len = arr.length, util = Util_1.Util, n, val;\n for (n = 0; n < len; n++) {\n val = arr[n];\n if (util._isNumber(val)) {\n val = Math.round(val * 1000) / 1000;\n }\n else if (!util._isString(val)) {\n val = val + '';\n }\n retArr.push(val);\n }\n return retArr;\n}\nvar COMMA = ',', OPEN_PAREN = '(', CLOSE_PAREN = ')', OPEN_PAREN_BRACKET = '([', CLOSE_BRACKET_PAREN = '])', SEMICOLON = ';', DOUBLE_PAREN = '()', EQUALS = '=', CONTEXT_METHODS = [\n 'arc',\n 'arcTo',\n 'beginPath',\n 'bezierCurveTo',\n 'clearRect',\n 'clip',\n 'closePath',\n 'createLinearGradient',\n 'createPattern',\n 'createRadialGradient',\n 'drawImage',\n 'ellipse',\n 'fill',\n 'fillText',\n 'getImageData',\n 'createImageData',\n 'lineTo',\n 'moveTo',\n 'putImageData',\n 'quadraticCurveTo',\n 'rect',\n 'roundRect',\n 'restore',\n 'rotate',\n 'save',\n 'scale',\n 'setLineDash',\n 'setTransform',\n 'stroke',\n 'strokeText',\n 'transform',\n 'translate',\n];\nvar CONTEXT_PROPERTIES = [\n 'fillStyle',\n 'strokeStyle',\n 'shadowColor',\n 'shadowBlur',\n 'shadowOffsetX',\n 'shadowOffsetY',\n 'letterSpacing',\n 'lineCap',\n 'lineDashOffset',\n 'lineJoin',\n 'lineWidth',\n 'miterLimit',\n 'direction',\n 'font',\n 'textAlign',\n 'textBaseline',\n 'globalAlpha',\n 'globalCompositeOperation',\n 'imageSmoothingEnabled',\n];\nconst traceArrMax = 100;\nclass Context {\n constructor(canvas) {\n this.canvas = canvas;\n if (Global_1.Konva.enableTrace) {\n this.traceArr = [];\n this._enableTrace();\n }\n }\n fillShape(shape) {\n if (shape.fillEnabled()) {\n this._fill(shape);\n }\n }\n _fill(shape) {\n }\n strokeShape(shape) {\n if (shape.hasStroke()) {\n this._stroke(shape);\n }\n }\n _stroke(shape) {\n }\n fillStrokeShape(shape) {\n if (shape.attrs.fillAfterStrokeEnabled) {\n this.strokeShape(shape);\n this.fillShape(shape);\n }\n else {\n this.fillShape(shape);\n this.strokeShape(shape);\n }\n }\n getTrace(relaxed, rounded) {\n var traceArr = this.traceArr, len = traceArr.length, str = '', n, trace, method, args;\n for (n = 0; n < len; n++) {\n trace = traceArr[n];\n method = trace.method;\n if (method) {\n args = trace.args;\n str += method;\n if (relaxed) {\n str += DOUBLE_PAREN;\n }\n else {\n if (Util_1.Util._isArray(args[0])) {\n str += OPEN_PAREN_BRACKET + args.join(COMMA) + CLOSE_BRACKET_PAREN;\n }\n else {\n if (rounded) {\n args = args.map((a) => typeof a === 'number' ? Math.floor(a) : a);\n }\n str += OPEN_PAREN + args.join(COMMA) + CLOSE_PAREN;\n }\n }\n }\n else {\n str += trace.property;\n if (!relaxed) {\n str += EQUALS + trace.val;\n }\n }\n str += SEMICOLON;\n }\n return str;\n }\n clearTrace() {\n this.traceArr = [];\n }\n _trace(str) {\n var traceArr = this.traceArr, len;\n traceArr.push(str);\n len = traceArr.length;\n if (len >= traceArrMax) {\n traceArr.shift();\n }\n }\n reset() {\n var pixelRatio = this.getCanvas().getPixelRatio();\n this.setTransform(1 * pixelRatio, 0, 0, 1 * pixelRatio, 0, 0);\n }\n getCanvas() {\n return this.canvas;\n }\n clear(bounds) {\n var canvas = this.getCanvas();\n if (bounds) {\n this.clearRect(bounds.x || 0, bounds.y || 0, bounds.width || 0, bounds.height || 0);\n }\n else {\n this.clearRect(0, 0, canvas.getWidth() / canvas.pixelRatio, canvas.getHeight() / canvas.pixelRatio);\n }\n }\n _applyLineCap(shape) {\n const lineCap = shape.attrs.lineCap;\n if (lineCap) {\n this.setAttr('lineCap', lineCap);\n }\n }\n _applyOpacity(shape) {\n var absOpacity = shape.getAbsoluteOpacity();\n if (absOpacity !== 1) {\n this.setAttr('globalAlpha', absOpacity);\n }\n }\n _applyLineJoin(shape) {\n const lineJoin = shape.attrs.lineJoin;\n if (lineJoin) {\n this.setAttr('lineJoin', lineJoin);\n }\n }\n setAttr(attr, val) {\n this._context[attr] = val;\n }\n arc(x, y, radius, startAngle, endAngle, counterClockwise) {\n this._context.arc(x, y, radius, startAngle, endAngle, counterClockwise);\n }\n arcTo(x1, y1, x2, y2, radius) {\n this._context.arcTo(x1, y1, x2, y2, radius);\n }\n beginPath() {\n this._context.beginPath();\n }\n bezierCurveTo(cp1x, cp1y, cp2x, cp2y, x, y) {\n this._context.bezierCurveTo(cp1x, cp1y, cp2x, cp2y, x, y);\n }\n clearRect(x, y, width, height) {\n this._context.clearRect(x, y, width, height);\n }\n clip(...args) {\n this._context.clip.apply(this._context, args);\n }\n closePath() {\n this._context.closePath();\n }\n createImageData(width, height) {\n var a = arguments;\n if (a.length === 2) {\n return this._context.createImageData(width, height);\n }\n else if (a.length === 1) {\n return this._context.createImageData(width);\n }\n }\n createLinearGradient(x0, y0, x1, y1) {\n return this._context.createLinearGradient(x0, y0, x1, y1);\n }\n createPattern(image, repetition) {\n return this._context.createPattern(image, repetition);\n }\n createRadialGradient(x0, y0, r0, x1, y1, r1) {\n return this._context.createRadialGradient(x0, y0, r0, x1, y1, r1);\n }\n drawImage(image, sx, sy, sWidth, sHeight, dx, dy, dWidth, dHeight) {\n var a = arguments, _context = this._context;\n if (a.length === 3) {\n _context.drawImage(image, sx, sy);\n }\n else if (a.length === 5) {\n _context.drawImage(image, sx, sy, sWidth, sHeight);\n }\n else if (a.length === 9) {\n _context.drawImage(image, sx, sy, sWidth, sHeight, dx, dy, dWidth, dHeight);\n }\n }\n ellipse(x, y, radiusX, radiusY, rotation, startAngle, endAngle, counterclockwise) {\n this._context.ellipse(x, y, radiusX, radiusY, rotation, startAngle, endAngle, counterclockwise);\n }\n isPointInPath(x, y, path, fillRule) {\n if (path) {\n return this._context.isPointInPath(path, x, y, fillRule);\n }\n return this._context.isPointInPath(x, y, fillRule);\n }\n fill(...args) {\n this._context.fill.apply(this._context, args);\n }\n fillRect(x, y, width, height) {\n this._context.fillRect(x, y, width, height);\n }\n strokeRect(x, y, width, height) {\n this._context.strokeRect(x, y, width, height);\n }\n fillText(text, x, y, maxWidth) {\n if (maxWidth) {\n this._context.fillText(text, x, y, maxWidth);\n }\n else {\n this._context.fillText(text, x, y);\n }\n }\n measureText(text) {\n return this._context.measureText(text);\n }\n getImageData(sx, sy, sw, sh) {\n return this._context.getImageData(sx, sy, sw, sh);\n }\n lineTo(x, y) {\n this._context.lineTo(x, y);\n }\n moveTo(x, y) {\n this._context.moveTo(x, y);\n }\n rect(x, y, width, height) {\n this._context.rect(x, y, width, height);\n }\n roundRect(x, y, width, height, radii) {\n this._context.roundRect(x, y, width, height, radii);\n }\n putImageData(imageData, dx, dy) {\n this._context.putImageData(imageData, dx, dy);\n }\n quadraticCurveTo(cpx, cpy, x, y) {\n this._context.quadraticCurveTo(cpx, cpy, x, y);\n }\n restore() {\n this._context.restore();\n }\n rotate(angle) {\n this._context.rotate(angle);\n }\n save() {\n this._context.save();\n }\n scale(x, y) {\n this._context.scale(x, y);\n }\n setLineDash(segments) {\n if (this._context.setLineDash) {\n this._context.setLineDash(segments);\n }\n else if ('mozDash' in this._context) {\n this._context['mozDash'] = segments;\n }\n else if ('webkitLineDash' in this._context) {\n this._context['webkitLineDash'] = segments;\n }\n }\n getLineDash() {\n return this._context.getLineDash();\n }\n setTransform(a, b, c, d, e, f) {\n this._context.setTransform(a, b, c, d, e, f);\n }\n stroke(path2d) {\n if (path2d) {\n this._context.stroke(path2d);\n }\n else {\n this._context.stroke();\n }\n }\n strokeText(text, x, y, maxWidth) {\n this._context.strokeText(text, x, y, maxWidth);\n }\n transform(a, b, c, d, e, f) {\n this._context.transform(a, b, c, d, e, f);\n }\n translate(x, y) {\n this._context.translate(x, y);\n }\n _enableTrace() {\n var that = this, len = CONTEXT_METHODS.length, origSetter = this.setAttr, n, args;\n var func = function (methodName) {\n var origMethod = that[methodName], ret;\n that[methodName] = function () {\n args = simplifyArray(Array.prototype.slice.call(arguments, 0));\n ret = origMethod.apply(that, arguments);\n that._trace({\n method: methodName,\n args: args,\n });\n return ret;\n };\n };\n for (n = 0; n < len; n++) {\n func(CONTEXT_METHODS[n]);\n }\n that.setAttr = function () {\n origSetter.apply(that, arguments);\n var prop = arguments[0];\n var val = arguments[1];\n if (prop === 'shadowOffsetX' ||\n prop === 'shadowOffsetY' ||\n prop === 'shadowBlur') {\n val = val / this.canvas.getPixelRatio();\n }\n that._trace({\n property: prop,\n val: val,\n });\n };\n }\n _applyGlobalCompositeOperation(node) {\n const op = node.attrs.globalCompositeOperation;\n var def = !op || op === 'source-over';\n if (!def) {\n this.setAttr('globalCompositeOperation', op);\n }\n }\n}\nexports.Context = Context;\nCONTEXT_PROPERTIES.forEach(function (prop) {\n Object.defineProperty(Context.prototype, prop, {\n get() {\n return this._context[prop];\n },\n set(val) {\n this._context[prop] = val;\n },\n });\n});\nclass SceneContext extends Context {\n constructor(canvas, { willReadFrequently = false } = {}) {\n super(canvas);\n this._context = canvas._canvas.getContext('2d', {\n willReadFrequently,\n });\n }\n _fillColor(shape) {\n var fill = shape.fill();\n this.setAttr('fillStyle', fill);\n shape._fillFunc(this);\n }\n _fillPattern(shape) {\n this.setAttr('fillStyle', shape._getFillPattern());\n shape._fillFunc(this);\n }\n _fillLinearGradient(shape) {\n var grd = shape._getLinearGradient();\n if (grd) {\n this.setAttr('fillStyle', grd);\n shape._fillFunc(this);\n }\n }\n _fillRadialGradient(shape) {\n const grd = shape._getRadialGradient();\n if (grd) {\n this.setAttr('fillStyle', grd);\n shape._fillFunc(this);\n }\n }\n _fill(shape) {\n const hasColor = shape.fill(), fillPriority = shape.getFillPriority();\n if (hasColor && fillPriority === 'color') {\n this._fillColor(shape);\n return;\n }\n const hasPattern = shape.getFillPatternImage();\n if (hasPattern && fillPriority === 'pattern') {\n this._fillPattern(shape);\n return;\n }\n const hasLinearGradient = shape.getFillLinearGradientColorStops();\n if (hasLinearGradient && fillPriority === 'linear-gradient') {\n this._fillLinearGradient(shape);\n return;\n }\n const hasRadialGradient = shape.getFillRadialGradientColorStops();\n if (hasRadialGradient && fillPriority === 'radial-gradient') {\n this._fillRadialGradient(shape);\n return;\n }\n if (hasColor) {\n this._fillColor(shape);\n }\n else if (hasPattern) {\n this._fillPattern(shape);\n }\n else if (hasLinearGradient) {\n this._fillLinearGradient(shape);\n }\n else if (hasRadialGradient) {\n this._fillRadialGradient(shape);\n }\n }\n _strokeLinearGradient(shape) {\n const start = shape.getStrokeLinearGradientStartPoint(), end = shape.getStrokeLinearGradientEndPoint(), colorStops = shape.getStrokeLinearGradientColorStops(), grd = this.createLinearGradient(start.x, start.y, end.x, end.y);\n if (colorStops) {\n for (var n = 0; n < colorStops.length; n += 2) {\n grd.addColorStop(colorStops[n], colorStops[n + 1]);\n }\n this.setAttr('strokeStyle', grd);\n }\n }\n _stroke(shape) {\n var dash = shape.dash(), strokeScaleEnabled = shape.getStrokeScaleEnabled();\n if (shape.hasStroke()) {\n if (!strokeScaleEnabled) {\n this.save();\n var pixelRatio = this.getCanvas().getPixelRatio();\n this.setTransform(pixelRatio, 0, 0, pixelRatio, 0, 0);\n }\n this._applyLineCap(shape);\n if (dash && shape.dashEnabled()) {\n this.setLineDash(dash);\n this.setAttr('lineDashOffset', shape.dashOffset());\n }\n this.setAttr('lineWidth', shape.strokeWidth());\n if (!shape.getShadowForStrokeEnabled()) {\n this.setAttr('shadowColor', 'rgba(0,0,0,0)');\n }\n var hasLinearGradient = shape.getStrokeLinearGradientColorStops();\n if (hasLinearGradient) {\n this._strokeLinearGradient(shape);\n }\n else {\n this.setAttr('strokeStyle', shape.stroke());\n }\n shape._strokeFunc(this);\n if (!strokeScaleEnabled) {\n this.restore();\n }\n }\n }\n _applyShadow(shape) {\n var _a, _b, _c;\n var color = (_a = shape.getShadowRGBA()) !== null && _a !== void 0 ? _a : 'black', blur = (_b = shape.getShadowBlur()) !== null && _b !== void 0 ? _b : 5, offset = (_c = shape.getShadowOffset()) !== null && _c !== void 0 ? _c : {\n x: 0,\n y: 0,\n }, scale = shape.getAbsoluteScale(), ratio = this.canvas.getPixelRatio(), scaleX = scale.x * ratio, scaleY = scale.y * ratio;\n this.setAttr('shadowColor', color);\n this.setAttr('shadowBlur', blur * Math.min(Math.abs(scaleX), Math.abs(scaleY)));\n this.setAttr('shadowOffsetX', offset.x * scaleX);\n this.setAttr('shadowOffsetY', offset.y * scaleY);\n }\n}\nexports.SceneContext = SceneContext;\nclass HitContext extends Context {\n constructor(canvas) {\n super(canvas);\n this._context = canvas._canvas.getContext('2d', {\n willReadFrequently: true,\n });\n }\n _fill(shape) {\n this.save();\n this.setAttr('fillStyle', shape.colorKey);\n shape._fillFuncHit(this);\n this.restore();\n }\n strokeShape(shape) {\n if (shape.hasHitStroke()) {\n this._stroke(shape);\n }\n }\n _stroke(shape) {\n if (shape.hasHitStroke()) {\n const strokeScaleEnabled = shape.getStrokeScaleEnabled();\n if (!strokeScaleEnabled) {\n this.save();\n var pixelRatio = this.getCanvas().getPixelRatio();\n this.setTransform(pixelRatio, 0, 0, pixelRatio, 0, 0);\n }\n this._applyLineCap(shape);\n var hitStrokeWidth = shape.hitStrokeWidth();\n var strokeWidth = hitStrokeWidth === 'auto' ? shape.strokeWidth() : hitStrokeWidth;\n this.setAttr('lineWidth', strokeWidth);\n this.setAttr('strokeStyle', shape.colorKey);\n shape._strokeFuncHit(this);\n if (!strokeScaleEnabled) {\n this.restore();\n }\n }\n }\n}\nexports.HitContext = HitContext;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.HitCanvas = exports.SceneCanvas = exports.Canvas = void 0;\nconst Util_1 = require(\"./Util\");\nconst Context_1 = require(\"./Context\");\nconst Global_1 = require(\"./Global\");\nconst Factory_1 = require(\"./Factory\");\nconst Validators_1 = require(\"./Validators\");\nvar _pixelRatio;\nfunction getDevicePixelRatio() {\n if (_pixelRatio) {\n return _pixelRatio;\n }\n var canvas = Util_1.Util.createCanvasElement();\n var context = canvas.getContext('2d');\n _pixelRatio = (function () {\n var devicePixelRatio = Global_1.Konva._global.devicePixelRatio || 1, backingStoreRatio = context.webkitBackingStorePixelRatio ||\n context.mozBackingStorePixelRatio ||\n context.msBackingStorePixelRatio ||\n context.oBackingStorePixelRatio ||\n context.backingStorePixelRatio ||\n 1;\n return devicePixelRatio / backingStoreRatio;\n })();\n Util_1.Util.releaseCanvas(canvas);\n return _pixelRatio;\n}\nclass Canvas {\n constructor(config) {\n this.pixelRatio = 1;\n this.width = 0;\n this.height = 0;\n this.isCache = false;\n var conf = config || {};\n var pixelRatio = conf.pixelRatio || Global_1.Konva.pixelRatio || getDevicePixelRatio();\n this.pixelRatio = pixelRatio;\n this._canvas = Util_1.Util.createCanvasElement();\n this._canvas.style.padding = '0';\n this._canvas.style.margin = '0';\n this._canvas.style.border = '0';\n this._canvas.style.background = 'transparent';\n this._canvas.style.position = 'absolute';\n this._canvas.style.top = '0';\n this._canvas.style.left = '0';\n }\n getContext() {\n return this.context;\n }\n getPixelRatio() {\n return this.pixelRatio;\n }\n setPixelRatio(pixelRatio) {\n var previousRatio = this.pixelRatio;\n this.pixelRatio = pixelRatio;\n this.setSize(this.getWidth() / previousRatio, this.getHeight() / previousRatio);\n }\n setWidth(width) {\n this.width = this._canvas.width = width * this.pixelRatio;\n this._canvas.style.width = width + 'px';\n var pixelRatio = this.pixelRatio, _context = this.getContext()._context;\n _context.scale(pixelRatio, pixelRatio);\n }\n setHeight(height) {\n this.height = this._canvas.height = height * this.pixelRatio;\n this._canvas.style.height = height + 'px';\n var pixelRatio = this.pixelRatio, _context = this.getContext()._context;\n _context.scale(pixelRatio, pixelRatio);\n }\n getWidth() {\n return this.width;\n }\n getHeight() {\n return this.height;\n }\n setSize(width, height) {\n this.setWidth(width || 0);\n this.setHeight(height || 0);\n }\n toDataURL(mimeType, quality) {\n try {\n return this._canvas.toDataURL(mimeType, quality);\n }\n catch (e) {\n try {\n return this._canvas.toDataURL();\n }\n catch (err) {\n Util_1.Util.error('Unable to get data URL. ' +\n err.message +\n ' For more info read https://konvajs.org/docs/posts/Tainted_Canvas.html.');\n return '';\n }\n }\n }\n}\nexports.Canvas = Canvas;\nFactory_1.Factory.addGetterSetter(Canvas, 'pixelRatio', undefined, (0, Validators_1.getNumberValidator)());\nclass SceneCanvas extends Canvas {\n constructor(config = { width: 0, height: 0, willReadFrequently: false }) {\n super(config);\n this.context = new Context_1.SceneContext(this, {\n willReadFrequently: config.willReadFrequently,\n });\n this.setSize(config.width, config.height);\n }\n}\nexports.SceneCanvas = SceneCanvas;\nclass HitCanvas extends Canvas {\n constructor(config = { width: 0, height: 0 }) {\n super(config);\n this.hitCanvas = true;\n this.context = new Context_1.HitContext(this);\n this.setSize(config.width, config.height);\n }\n}\nexports.HitCanvas = HitCanvas;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.DD = void 0;\nconst Global_1 = require(\"./Global\");\nconst Util_1 = require(\"./Util\");\nexports.DD = {\n get isDragging() {\n var flag = false;\n exports.DD._dragElements.forEach((elem) => {\n if (elem.dragStatus === 'dragging') {\n flag = true;\n }\n });\n return flag;\n },\n justDragged: false,\n get node() {\n var node;\n exports.DD._dragElements.forEach((elem) => {\n node = elem.node;\n });\n return node;\n },\n _dragElements: new Map(),\n _drag(evt) {\n const nodesToFireEvents = [];\n exports.DD._dragElements.forEach((elem, key) => {\n const { node } = elem;\n const stage = node.getStage();\n stage.setPointersPositions(evt);\n if (elem.pointerId === undefined) {\n elem.pointerId = Util_1.Util._getFirstPointerId(evt);\n }\n const pos = stage._changedPointerPositions.find((pos) => pos.id === elem.pointerId);\n if (!pos) {\n return;\n }\n if (elem.dragStatus !== 'dragging') {\n var dragDistance = node.dragDistance();\n var distance = Math.max(Math.abs(pos.x - elem.startPointerPos.x), Math.abs(pos.y - elem.startPointerPos.y));\n if (distance < dragDistance) {\n return;\n }\n node.startDrag({ evt });\n if (!node.isDragging()) {\n return;\n }\n }\n node._setDragPosition(evt, elem);\n nodesToFireEvents.push(node);\n });\n nodesToFireEvents.forEach((node) => {\n node.fire('dragmove', {\n type: 'dragmove',\n target: node,\n evt: evt,\n }, true);\n });\n },\n _endDragBefore(evt) {\n const drawNodes = [];\n exports.DD._dragElements.forEach((elem) => {\n const { node } = elem;\n const stage = node.getStage();\n if (evt) {\n stage.setPointersPositions(evt);\n }\n const pos = stage._changedPointerPositions.find((pos) => pos.id === elem.pointerId);\n if (!pos) {\n return;\n }\n if (elem.dragStatus === 'dragging' || elem.dragStatus === 'stopped') {\n exports.DD.justDragged = true;\n Global_1.Konva._mouseListenClick = false;\n Global_1.Konva._touchListenClick = false;\n Global_1.Konva._pointerListenClick = false;\n elem.dragStatus = 'stopped';\n }\n const drawNode = elem.node.getLayer() ||\n (elem.node instanceof Global_1.Konva['Stage'] && elem.node);\n if (drawNode && drawNodes.indexOf(drawNode) === -1) {\n drawNodes.push(drawNode);\n }\n });\n drawNodes.forEach((drawNode) => {\n drawNode.draw();\n });\n },\n _endDragAfter(evt) {\n exports.DD._dragElements.forEach((elem, key) => {\n if (elem.dragStatus === 'stopped') {\n elem.node.fire('dragend', {\n type: 'dragend',\n target: elem.node,\n evt: evt,\n }, true);\n }\n if (elem.dragStatus !== 'dragging') {\n exports.DD._dragElements.delete(key);\n }\n });\n },\n};\nif (Global_1.Konva.isBrowser) {\n window.addEventListener('mouseup', exports.DD._endDragBefore, true);\n window.addEventListener('touchend', exports.DD._endDragBefore, true);\n window.addEventListener('mousemove', exports.DD._drag);\n window.addEventListener('touchmove', exports.DD._drag);\n window.addEventListener('mouseup', exports.DD._endDragAfter, false);\n window.addEventListener('touchend', exports.DD._endDragAfter, false);\n}\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Node = void 0;\nconst Util_1 = require(\"./Util\");\nconst Factory_1 = require(\"./Factory\");\nconst Canvas_1 = require(\"./Canvas\");\nconst Global_1 = require(\"./Global\");\nconst DragAndDrop_1 = require(\"./DragAndDrop\");\nconst Validators_1 = require(\"./Validators\");\nvar ABSOLUTE_OPACITY = 'absoluteOpacity', ALL_LISTENERS = 'allEventListeners', ABSOLUTE_TRANSFORM = 'absoluteTransform', ABSOLUTE_SCALE = 'absoluteScale', CANVAS = 'canvas', CHANGE = 'Change', CHILDREN = 'children', KONVA = 'konva', LISTENING = 'listening', MOUSEENTER = 'mouseenter', MOUSELEAVE = 'mouseleave', NAME = 'name', SET = 'set', SHAPE = 'Shape', SPACE = ' ', STAGE = 'stage', TRANSFORM = 'transform', UPPER_STAGE = 'Stage', VISIBLE = 'visible', TRANSFORM_CHANGE_STR = [\n 'xChange.konva',\n 'yChange.konva',\n 'scaleXChange.konva',\n 'scaleYChange.konva',\n 'skewXChange.konva',\n 'skewYChange.konva',\n 'rotationChange.konva',\n 'offsetXChange.konva',\n 'offsetYChange.konva',\n 'transformsEnabledChange.konva',\n].join(SPACE);\nlet idCounter = 1;\nclass Node {\n constructor(config) {\n this._id = idCounter++;\n this.eventListeners = {};\n this.attrs = {};\n this.index = 0;\n this._allEventListeners = null;\n this.parent = null;\n this._cache = new Map();\n this._attachedDepsListeners = new Map();\n this._lastPos = null;\n this._batchingTransformChange = false;\n this._needClearTransformCache = false;\n this._filterUpToDate = false;\n this._isUnderCache = false;\n this._dragEventId = null;\n this._shouldFireChangeEvents = false;\n this.setAttrs(config);\n this._shouldFireChangeEvents = true;\n }\n hasChildren() {\n return false;\n }\n _clearCache(attr) {\n if ((attr === TRANSFORM || attr === ABSOLUTE_TRANSFORM) &&\n this._cache.get(attr)) {\n this._cache.get(attr).dirty = true;\n }\n else if (attr) {\n this._cache.delete(attr);\n }\n else {\n this._cache.clear();\n }\n }\n _getCache(attr, privateGetter) {\n var cache = this._cache.get(attr);\n var isTransform = attr === TRANSFORM || attr === ABSOLUTE_TRANSFORM;\n var invalid = cache === undefined || (isTransform && cache.dirty === true);\n if (invalid) {\n cache = privateGetter.call(this);\n this._cache.set(attr, cache);\n }\n return cache;\n }\n _calculate(name, deps, getter) {\n if (!this._attachedDepsListeners.get(name)) {\n const depsString = deps.map((dep) => dep + 'Change.konva').join(SPACE);\n this.on(depsString, () => {\n this._clearCache(name);\n });\n this._attachedDepsListeners.set(name, true);\n }\n return this._getCache(name, getter);\n }\n _getCanvasCache() {\n return this._cache.get(CANVAS);\n }\n _clearSelfAndDescendantCache(attr) {\n this._clearCache(attr);\n if (attr === ABSOLUTE_TRANSFORM) {\n this.fire('absoluteTransformChange');\n }\n }\n clearCache() {\n if (this._cache.has(CANVAS)) {\n const { scene, filter, hit } = this._cache.get(CANVAS);\n Util_1.Util.releaseCanvas(scene, filter, hit);\n this._cache.delete(CANVAS);\n }\n this._clearSelfAndDescendantCache();\n this._requestDraw();\n return this;\n }\n cache(config) {\n var conf = config || {};\n var rect = {};\n if (conf.x === undefined ||\n conf.y === undefined ||\n conf.width === undefined ||\n conf.height === undefined) {\n rect = this.getClientRect({\n skipTransform: true,\n relativeTo: this.getParent() || undefined,\n });\n }\n var width = Math.ceil(conf.width || rect.width), height = Math.ceil(conf.height || rect.height), pixelRatio = conf.pixelRatio, x = conf.x === undefined ? Math.floor(rect.x) : conf.x, y = conf.y === undefined ? Math.floor(rect.y) : conf.y, offset = conf.offset || 0, drawBorder = conf.drawBorder || false, hitCanvasPixelRatio = conf.hitCanvasPixelRatio || 1;\n if (!width || !height) {\n Util_1.Util.error('Can not cache the node. Width or height of the node equals 0. Caching is skipped.');\n return;\n }\n const extraPaddingX = Math.abs(Math.round(rect.x) - x) > 0.5 ? 1 : 0;\n const extraPaddingY = Math.abs(Math.round(rect.y) - y) > 0.5 ? 1 : 0;\n width += offset * 2 + extraPaddingX;\n height += offset * 2 + extraPaddingY;\n x -= offset;\n y -= offset;\n var cachedSceneCanvas = new Canvas_1.SceneCanvas({\n pixelRatio: pixelRatio,\n width: width,\n height: height,\n }), cachedFilterCanvas = new Canvas_1.SceneCanvas({\n pixelRatio: pixelRatio,\n width: 0,\n height: 0,\n willReadFrequently: true,\n }), cachedHitCanvas = new Canvas_1.HitCanvas({\n pixelRatio: hitCanvasPixelRatio,\n width: width,\n height: height,\n }), sceneContext = cachedSceneCanvas.getContext(), hitContext = cachedHitCanvas.getContext();\n cachedHitCanvas.isCache = true;\n cachedSceneCanvas.isCache = true;\n this._cache.delete(CANVAS);\n this._filterUpToDate = false;\n if (conf.imageSmoothingEnabled === false) {\n cachedSceneCanvas.getContext()._context.imageSmoothingEnabled = false;\n cachedFilterCanvas.getContext()._context.imageSmoothingEnabled = false;\n }\n sceneContext.save();\n hitContext.save();\n sceneContext.translate(-x, -y);\n hitContext.translate(-x, -y);\n this._isUnderCache = true;\n this._clearSelfAndDescendantCache(ABSOLUTE_OPACITY);\n this._clearSelfAndDescendantCache(ABSOLUTE_SCALE);\n this.drawScene(cachedSceneCanvas, this);\n this.drawHit(cachedHitCanvas, this);\n this._isUnderCache = false;\n sceneContext.restore();\n hitContext.restore();\n if (drawBorder) {\n sceneContext.save();\n sceneContext.beginPath();\n sceneContext.rect(0, 0, width, height);\n sceneContext.closePath();\n sceneContext.setAttr('strokeStyle', 'red');\n sceneContext.setAttr('lineWidth', 5);\n sceneContext.stroke();\n sceneContext.restore();\n }\n this._cache.set(CANVAS, {\n scene: cachedSceneCanvas,\n filter: cachedFilterCanvas,\n hit: cachedHitCanvas,\n x: x,\n y: y,\n });\n this._requestDraw();\n return this;\n }\n isCached() {\n return this._cache.has(CANVAS);\n }\n getClientRect(config) {\n throw new Error('abstract \"getClientRect\" method call');\n }\n _transformedRect(rect, top) {\n var points = [\n { x: rect.x, y: rect.y },\n { x: rect.x + rect.width, y: rect.y },\n { x: rect.x + rect.width, y: rect.y + rect.height },\n { x: rect.x, y: rect.y + rect.height },\n ];\n var minX = Infinity, minY = Infinity, maxX = -Infinity, maxY = -Infinity;\n var trans = this.getAbsoluteTransform(top);\n points.forEach(function (point) {\n var transformed = trans.point(point);\n if (minX === undefined) {\n minX = maxX = transformed.x;\n minY = maxY = transformed.y;\n }\n minX = Math.min(minX, transformed.x);\n minY = Math.min(minY, transformed.y);\n maxX = Math.max(maxX, transformed.x);\n maxY = Math.max(maxY, transformed.y);\n });\n return {\n x: minX,\n y: minY,\n width: maxX - minX,\n height: maxY - minY,\n };\n }\n _drawCachedSceneCanvas(context) {\n context.save();\n context._applyOpacity(this);\n context._applyGlobalCompositeOperation(this);\n const canvasCache = this._getCanvasCache();\n context.translate(canvasCache.x, canvasCache.y);\n var cacheCanvas = this._getCachedSceneCanvas();\n var ratio = cacheCanvas.pixelRatio;\n context.drawImage(cacheCanvas._canvas, 0, 0, cacheCanvas.width / ratio, cacheCanvas.height / ratio);\n context.restore();\n }\n _drawCachedHitCanvas(context) {\n var canvasCache = this._getCanvasCache(), hitCanvas = canvasCache.hit;\n context.save();\n context.translate(canvasCache.x, canvasCache.y);\n context.drawImage(hitCanvas._canvas, 0, 0, hitCanvas.width / hitCanvas.pixelRatio, hitCanvas.height / hitCanvas.pixelRatio);\n context.restore();\n }\n _getCachedSceneCanvas() {\n var filters = this.filters(), cachedCanvas = this._getCanvasCache(), sceneCanvas = cachedCanvas.scene, filterCanvas = cachedCanvas.filter, filterContext = filterCanvas.getContext(), len, imageData, n, filter;\n if (filters) {\n if (!this._filterUpToDate) {\n var ratio = sceneCanvas.pixelRatio;\n filterCanvas.setSize(sceneCanvas.width / sceneCanvas.pixelRatio, sceneCanvas.height / sceneCanvas.pixelRatio);\n try {\n len = filters.length;\n filterContext.clear();\n filterContext.drawImage(sceneCanvas._canvas, 0, 0, sceneCanvas.getWidth() / ratio, sceneCanvas.getHeight() / ratio);\n imageData = filterContext.getImageData(0, 0, filterCanvas.getWidth(), filterCanvas.getHeight());\n for (n = 0; n < len; n++) {\n filter = filters[n];\n if (typeof filter !== 'function') {\n Util_1.Util.error('Filter should be type of function, but got ' +\n typeof filter +\n ' instead. Please check correct filters');\n continue;\n }\n filter.call(this, imageData);\n filterContext.putImageData(imageData, 0, 0);\n }\n }\n catch (e) {\n Util_1.Util.error('Unable to apply filter. ' +\n e.message +\n ' This post my help you https://konvajs.org/docs/posts/Tainted_Canvas.html.');\n }\n this._filterUpToDate = true;\n }\n return filterCanvas;\n }\n return sceneCanvas;\n }\n on(evtStr, handler) {\n this._cache && this._cache.delete(ALL_LISTENERS);\n if (arguments.length === 3) {\n return this._delegate.apply(this, arguments);\n }\n var events = evtStr.split(SPACE), len = events.length, n, event, parts, baseEvent, name;\n for (n = 0; n < len; n++) {\n event = events[n];\n parts = event.split('.');\n baseEvent = parts[0];\n name = parts[1] || '';\n if (!this.eventListeners[baseEvent]) {\n this.eventListeners[baseEvent] = [];\n }\n this.eventListeners[baseEvent].push({\n name: name,\n handler: handler,\n });\n }\n return this;\n }\n off(evtStr, callback) {\n var events = (evtStr || '').split(SPACE), len = events.length, n, t, event, parts, baseEvent, name;\n this._cache && this._cache.delete(ALL_LISTENERS);\n if (!evtStr) {\n for (t in this.eventListeners) {\n this._off(t);\n }\n }\n for (n = 0; n < len; n++) {\n event = events[n];\n parts = event.split('.');\n baseEvent = parts[0];\n name = parts[1];\n if (baseEvent) {\n if (this.eventListeners[baseEvent]) {\n this._off(baseEvent, name, callback);\n }\n }\n else {\n for (t in this.eventListeners) {\n this._off(t, name, callback);\n }\n }\n }\n return this;\n }\n dispatchEvent(evt) {\n var e = {\n target: this,\n type: evt.type,\n evt: evt,\n };\n this.fire(evt.type, e);\n return this;\n }\n addEventListener(type, handler) {\n this.on(type, function (evt) {\n handler.call(this, evt.evt);\n });\n return this;\n }\n removeEventListener(type) {\n this.off(type);\n return this;\n }\n _delegate(event, selector, handler) {\n var stopNode = this;\n this.on(event, function (evt) {\n var targets = evt.target.findAncestors(selector, true, stopNode);\n for (var i = 0; i < targets.length; i++) {\n evt = Util_1.Util.cloneObject(evt);\n evt.currentTarget = targets[i];\n handler.call(targets[i], evt);\n }\n });\n }\n remove() {\n if (this.isDragging()) {\n this.stopDrag();\n }\n DragAndDrop_1.DD._dragElements.delete(this._id);\n this._remove();\n return this;\n }\n _clearCaches() {\n this._clearSelfAndDescendantCache(ABSOLUTE_TRANSFORM);\n this._clearSelfAndDescendantCache(ABSOLUTE_OPACITY);\n this._clearSelfAndDescendantCache(ABSOLUTE_SCALE);\n this._clearSelfAndDescendantCache(STAGE);\n this._clearSelfAndDescendantCache(VISIBLE);\n this._clearSelfAndDescendantCache(LISTENING);\n }\n _remove() {\n this._clearCaches();\n var parent = this.getParent();\n if (parent && parent.children) {\n parent.children.splice(this.index, 1);\n parent._setChildrenIndices();\n this.parent = null;\n }\n }\n destroy() {\n this.remove();\n this.clearCache();\n return this;\n }\n getAttr(attr) {\n var method = 'get' + Util_1.Util._capitalize(attr);\n if (Util_1.Util._isFunction(this[method])) {\n return this[method]();\n }\n return this.attrs[attr];\n }\n getAncestors() {\n var parent = this.getParent(), ancestors = [];\n while (parent) {\n ancestors.push(parent);\n parent = parent.getParent();\n }\n return ancestors;\n }\n getAttrs() {\n return (this.attrs || {});\n }\n setAttrs(config) {\n this._batchTransformChanges(() => {\n var key, method;\n if (!config) {\n return this;\n }\n for (key in config) {\n if (key === CHILDREN) {\n continue;\n }\n method = SET + Util_1.Util._capitalize(key);\n if (Util_1.Util._isFunction(this[method])) {\n this[method](config[key]);\n }\n else {\n this._setAttr(key, config[key]);\n }\n }\n });\n return this;\n }\n isListening() {\n return this._getCache(LISTENING, this._isListening);\n }\n _isListening(relativeTo) {\n const listening = this.listening();\n if (!listening) {\n return false;\n }\n const parent = this.getParent();\n if (parent && parent !== relativeTo && this !== relativeTo) {\n return parent._isListening(relativeTo);\n }\n else {\n return true;\n }\n }\n isVisible() {\n return this._getCache(VISIBLE, this._isVisible);\n }\n _isVisible(relativeTo) {\n const visible = this.visible();\n if (!visible) {\n return false;\n }\n const parent = this.getParent();\n if (parent && parent !== relativeTo && this !== relativeTo) {\n return parent._isVisible(relativeTo);\n }\n else {\n return true;\n }\n }\n shouldDrawHit(top, skipDragCheck = false) {\n if (top) {\n return this._isVisible(top) && this._isListening(top);\n }\n var layer = this.getLayer();\n var layerUnderDrag = false;\n DragAndDrop_1.DD._dragElements.forEach((elem) => {\n if (elem.dragStatus !== 'dragging') {\n return;\n }\n else if (elem.node.nodeType === 'Stage') {\n layerUnderDrag = true;\n }\n else if (elem.node.getLayer() === layer) {\n layerUnderDrag = true;\n }\n });\n var dragSkip = !skipDragCheck &&\n !Global_1.Konva.hitOnDragEnabled &&\n (layerUnderDrag || Global_1.Konva.isTransforming());\n return this.isListening() && this.isVisible() && !dragSkip;\n }\n show() {\n this.visible(true);\n return this;\n }\n hide() {\n this.visible(false);\n return this;\n }\n getZIndex() {\n return this.index || 0;\n }\n getAbsoluteZIndex() {\n var depth = this.getDepth(), that = this, index = 0, nodes, len, n, child;\n function addChildren(children) {\n nodes = [];\n len = children.length;\n for (n = 0; n < len; n++) {\n child = children[n];\n index++;\n if (child.nodeType !== SHAPE) {\n nodes = nodes.concat(child.getChildren().slice());\n }\n if (child._id === that._id) {\n n = len;\n }\n }\n if (nodes.length > 0 && nodes[0].getDepth() <= depth) {\n addChildren(nodes);\n }\n }\n const stage = this.getStage();\n if (that.nodeType !== UPPER_STAGE && stage) {\n addChildren(stage.getChildren());\n }\n return index;\n }\n getDepth() {\n var depth = 0, parent = this.parent;\n while (parent) {\n depth++;\n parent = parent.parent;\n }\n return depth;\n }\n _batchTransformChanges(func) {\n this._batchingTransformChange = true;\n func();\n this._batchingTransformChange = false;\n if (this._needClearTransformCache) {\n this._clearCache(TRANSFORM);\n this._clearSelfAndDescendantCache(ABSOLUTE_TRANSFORM);\n }\n this._needClearTransformCache = false;\n }\n setPosition(pos) {\n this._batchTransformChanges(() => {\n this.x(pos.x);\n this.y(pos.y);\n });\n return this;\n }\n getPosition() {\n return {\n x: this.x(),\n y: this.y(),\n };\n }\n getRelativePointerPosition() {\n const stage = this.getStage();\n if (!stage) {\n return null;\n }\n var pos = stage.getPointerPosition();\n if (!pos) {\n return null;\n }\n var transform = this.getAbsoluteTransform().copy();\n transform.invert();\n return transform.point(pos);\n }\n getAbsolutePosition(top) {\n let haveCachedParent = false;\n let parent = this.parent;\n while (parent) {\n if (parent.isCached()) {\n haveCachedParent = true;\n break;\n }\n parent = parent.parent;\n }\n if (haveCachedParent && !top) {\n top = true;\n }\n var absoluteMatrix = this.getAbsoluteTransform(top).getMatrix(), absoluteTransform = new Util_1.Transform(), offset = this.offset();\n absoluteTransform.m = absoluteMatrix.slice();\n absoluteTransform.translate(offset.x, offset.y);\n return absoluteTransform.getTranslation();\n }\n setAbsolutePosition(pos) {\n const { x, y, ...origTrans } = this._clearTransform();\n this.attrs.x = x;\n this.attrs.y = y;\n this._clearCache(TRANSFORM);\n var it = this._getAbsoluteTransform().copy();\n it.invert();\n it.translate(pos.x, pos.y);\n pos = {\n x: this.attrs.x + it.getTranslation().x,\n y: this.attrs.y + it.getTranslation().y,\n };\n this._setTransform(origTrans);\n this.setPosition({ x: pos.x, y: pos.y });\n this._clearCache(TRANSFORM);\n this._clearSelfAndDescendantCache(ABSOLUTE_TRANSFORM);\n return this;\n }\n _setTransform(trans) {\n var key;\n for (key in trans) {\n this.attrs[key] = trans[key];\n }\n }\n _clearTransform() {\n var trans = {\n x: this.x(),\n y: this.y(),\n rotation: this.rotation(),\n scaleX: this.scaleX(),\n scaleY: this.scaleY(),\n offsetX: this.offsetX(),\n offsetY: this.offsetY(),\n skewX: this.skewX(),\n skewY: this.skewY(),\n };\n this.attrs.x = 0;\n this.attrs.y = 0;\n this.attrs.rotation = 0;\n this.attrs.scaleX = 1;\n this.attrs.scaleY = 1;\n this.attrs.offsetX = 0;\n this.attrs.offsetY = 0;\n this.attrs.skewX = 0;\n this.attrs.skewY = 0;\n return trans;\n }\n move(change) {\n var changeX = change.x, changeY = change.y, x = this.x(), y = this.y();\n if (changeX !== undefined) {\n x += changeX;\n }\n if (changeY !== undefined) {\n y += changeY;\n }\n this.setPosition({ x: x, y: y });\n return this;\n }\n _eachAncestorReverse(func, top) {\n var family = [], parent = this.getParent(), len, n;\n if (top && top._id === this._id) {\n return;\n }\n family.unshift(this);\n while (parent && (!top || parent._id !== top._id)) {\n family.unshift(parent);\n parent = parent.parent;\n }\n len = family.length;\n for (n = 0; n < len; n++) {\n func(family[n]);\n }\n }\n rotate(theta) {\n this.rotation(this.rotation() + theta);\n return this;\n }\n moveToTop() {\n if (!this.parent) {\n Util_1.Util.warn('Node has no parent. moveToTop function is ignored.');\n return false;\n }\n var index = this.index, len = this.parent.getChildren().length;\n if (index < len - 1) {\n this.parent.children.splice(index, 1);\n this.parent.children.push(this);\n this.parent._setChildrenIndices();\n return true;\n }\n return false;\n }\n moveUp() {\n if (!this.parent) {\n Util_1.Util.warn('Node has no parent. moveUp function is ignored.');\n return false;\n }\n var index = this.index, len = this.parent.getChildren().length;\n if (index < len - 1) {\n this.parent.children.splice(index, 1);\n this.parent.children.splice(index + 1, 0, this);\n this.parent._setChildrenIndices();\n return true;\n }\n return false;\n }\n moveDown() {\n if (!this.parent) {\n Util_1.Util.warn('Node has no parent. moveDown function is ignored.');\n return false;\n }\n var index = this.index;\n if (index > 0) {\n this.parent.children.splice(index, 1);\n this.parent.children.splice(index - 1, 0, this);\n this.parent._setChildrenIndices();\n return true;\n }\n return false;\n }\n moveToBottom() {\n if (!this.parent) {\n Util_1.Util.warn('Node has no parent. moveToBottom function is ignored.');\n return false;\n }\n var index = this.index;\n if (index > 0) {\n this.parent.children.splice(index, 1);\n this.parent.children.unshift(this);\n this.parent._setChildrenIndices();\n return true;\n }\n return false;\n }\n setZIndex(zIndex) {\n if (!this.parent) {\n Util_1.Util.warn('Node has no parent. zIndex parameter is ignored.');\n return this;\n }\n if (zIndex < 0 || zIndex >= this.parent.children.length) {\n Util_1.Util.warn('Unexpected value ' +\n zIndex +\n ' for zIndex property. zIndex is just index of a node in children of its parent. Expected value is from 0 to ' +\n (this.parent.children.length - 1) +\n '.');\n }\n var index = this.index;\n this.parent.children.splice(index, 1);\n this.parent.children.splice(zIndex, 0, this);\n this.parent._setChildrenIndices();\n return this;\n }\n getAbsoluteOpacity() {\n return this._getCache(ABSOLUTE_OPACITY, this._getAbsoluteOpacity);\n }\n _getAbsoluteOpacity() {\n var absOpacity = this.opacity();\n var parent = this.getParent();\n if (parent && !parent._isUnderCache) {\n absOpacity *= parent.getAbsoluteOpacity();\n }\n return absOpacity;\n }\n moveTo(newContainer) {\n if (this.getParent() !== newContainer) {\n this._remove();\n newContainer.add(this);\n }\n return this;\n }\n toObject() {\n var attrs = this.getAttrs(), key, val, getter, defaultValue, nonPlainObject;\n const obj = {\n attrs: {},\n className: this.getClassName(),\n };\n for (key in attrs) {\n val = attrs[key];\n nonPlainObject =\n Util_1.Util.isObject(val) && !Util_1.Util._isPlainObject(val) && !Util_1.Util._isArray(val);\n if (nonPlainObject) {\n continue;\n }\n getter = typeof this[key] === 'function' && this[key];\n delete attrs[key];\n defaultValue = getter ? getter.call(this) : null;\n attrs[key] = val;\n if (defaultValue !== val) {\n obj.attrs[key] = val;\n }\n }\n return Util_1.Util._prepareToStringify(obj);\n }\n toJSON() {\n return JSON.stringify(this.toObject());\n }\n getParent() {\n return this.parent;\n }\n findAncestors(selector, includeSelf, stopNode) {\n var res = [];\n if (includeSelf && this._isMatch(selector)) {\n res.push(this);\n }\n var ancestor = this.parent;\n while (ancestor) {\n if (ancestor === stopNode) {\n return res;\n }\n if (ancestor._isMatch(selector)) {\n res.push(ancestor);\n }\n ancestor = ancestor.parent;\n }\n return res;\n }\n isAncestorOf(node) {\n return false;\n }\n findAncestor(selector, includeSelf, stopNode) {\n return this.findAncestors(selector, includeSelf, stopNode)[0];\n }\n _isMatch(selector) {\n if (!selector) {\n return false;\n }\n if (typeof selector === 'function') {\n return selector(this);\n }\n var selectorArr = selector.replace(/ /g, '').split(','), len = selectorArr.length, n, sel;\n for (n = 0; n < len; n++) {\n sel = selectorArr[n];\n if (!Util_1.Util.isValidSelector(sel)) {\n Util_1.Util.warn('Selector \"' +\n sel +\n '\" is invalid. Allowed selectors examples are \"#foo\", \".bar\" or \"Group\".');\n Util_1.Util.warn('If you have a custom shape with such className, please change it to start with upper letter like \"Triangle\".');\n Util_1.Util.warn('Konva is awesome, right?');\n }\n if (sel.charAt(0) === '#') {\n if (this.id() === sel.slice(1)) {\n return true;\n }\n }\n else if (sel.charAt(0) === '.') {\n if (this.hasName(sel.slice(1))) {\n return true;\n }\n }\n else if (this.className === sel || this.nodeType === sel) {\n return true;\n }\n }\n return false;\n }\n getLayer() {\n var parent = this.getParent();\n return parent ? parent.getLayer() : null;\n }\n getStage() {\n return this._getCache(STAGE, this._getStage);\n }\n _getStage() {\n var parent = this.getParent();\n if (parent) {\n return parent.getStage();\n }\n else {\n return null;\n }\n }\n fire(eventType, evt = {}, bubble) {\n evt.target = evt.target || this;\n if (bubble) {\n this._fireAndBubble(eventType, evt);\n }\n else {\n this._fire(eventType, evt);\n }\n return this;\n }\n getAbsoluteTransform(top) {\n if (top) {\n return this._getAbsoluteTransform(top);\n }\n else {\n return this._getCache(ABSOLUTE_TRANSFORM, this._getAbsoluteTransform);\n }\n }\n _getAbsoluteTransform(top) {\n var at;\n if (top) {\n at = new Util_1.Transform();\n this._eachAncestorReverse(function (node) {\n var transformsEnabled = node.transformsEnabled();\n if (transformsEnabled === 'all') {\n at.multiply(node.getTransform());\n }\n else if (transformsEnabled === 'position') {\n at.translate(node.x() - node.offsetX(), node.y() - node.offsetY());\n }\n }, top);\n return at;\n }\n else {\n at = this._cache.get(ABSOLUTE_TRANSFORM) || new Util_1.Transform();\n if (this.parent) {\n this.parent.getAbsoluteTransform().copyInto(at);\n }\n else {\n at.reset();\n }\n var transformsEnabled = this.transformsEnabled();\n if (transformsEnabled === 'all') {\n at.multiply(this.getTransform());\n }\n else if (transformsEnabled === 'position') {\n const x = this.attrs.x || 0;\n const y = this.attrs.y || 0;\n const offsetX = this.attrs.offsetX || 0;\n const offsetY = this.attrs.offsetY || 0;\n at.translate(x - offsetX, y - offsetY);\n }\n at.dirty = false;\n return at;\n }\n }\n getAbsoluteScale(top) {\n var parent = this;\n while (parent) {\n if (parent._isUnderCache) {\n top = parent;\n }\n parent = parent.getParent();\n }\n const transform = this.getAbsoluteTransform(top);\n const attrs = transform.decompose();\n return {\n x: attrs.scaleX,\n y: attrs.scaleY,\n };\n }\n getAbsoluteRotation() {\n return this.getAbsoluteTransform().decompose().rotation;\n }\n getTransform() {\n return this._getCache(TRANSFORM, this._getTransform);\n }\n _getTransform() {\n var _a, _b;\n var m = this._cache.get(TRANSFORM) || new Util_1.Transform();\n m.reset();\n var x = this.x(), y = this.y(), rotation = Global_1.Konva.getAngle(this.rotation()), scaleX = (_a = this.attrs.scaleX) !== null && _a !== void 0 ? _a : 1, scaleY = (_b = this.attrs.scaleY) !== null && _b !== void 0 ? _b : 1, skewX = this.attrs.skewX || 0, skewY = this.attrs.skewY || 0, offsetX = this.attrs.offsetX || 0, offsetY = this.attrs.offsetY || 0;\n if (x !== 0 || y !== 0) {\n m.translate(x, y);\n }\n if (rotation !== 0) {\n m.rotate(rotation);\n }\n if (skewX !== 0 || skewY !== 0) {\n m.skew(skewX, skewY);\n }\n if (scaleX !== 1 || scaleY !== 1) {\n m.scale(scaleX, scaleY);\n }\n if (offsetX !== 0 || offsetY !== 0) {\n m.translate(-1 * offsetX, -1 * offsetY);\n }\n m.dirty = false;\n return m;\n }\n clone(obj) {\n var attrs = Util_1.Util.cloneObject(this.attrs), key, allListeners, len, n, listener;\n for (key in obj) {\n attrs[key] = obj[key];\n }\n var node = new this.constructor(attrs);\n for (key in this.eventListeners) {\n allListeners = this.eventListeners[key];\n len = allListeners.length;\n for (n = 0; n < len; n++) {\n listener = allListeners[n];\n if (listener.name.indexOf(KONVA) < 0) {\n if (!node.eventListeners[key]) {\n node.eventListeners[key] = [];\n }\n node.eventListeners[key].push(listener);\n }\n }\n }\n return node;\n }\n _toKonvaCanvas(config) {\n config = config || {};\n var box = this.getClientRect();\n var stage = this.getStage(), x = config.x !== undefined ? config.x : Math.floor(box.x), y = config.y !== undefined ? config.y : Math.floor(box.y), pixelRatio = config.pixelRatio || 1, canvas = new Canvas_1.SceneCanvas({\n width: config.width || Math.ceil(box.width) || (stage ? stage.width() : 0),\n height: config.height ||\n Math.ceil(box.height) ||\n (stage ? stage.height() : 0),\n pixelRatio: pixelRatio,\n }), context = canvas.getContext();\n const bufferCanvas = new Canvas_1.SceneCanvas({\n width: canvas.width / canvas.pixelRatio + Math.abs(x),\n height: canvas.height / canvas.pixelRatio + Math.abs(y),\n pixelRatio: canvas.pixelRatio,\n });\n if (config.imageSmoothingEnabled === false) {\n context._context.imageSmoothingEnabled = false;\n }\n context.save();\n if (x || y) {\n context.translate(-1 * x, -1 * y);\n }\n this.drawScene(canvas, undefined, bufferCanvas);\n context.restore();\n return canvas;\n }\n toCanvas(config) {\n return this._toKonvaCanvas(config)._canvas;\n }\n toDataURL(config) {\n config = config || {};\n var mimeType = config.mimeType || null, quality = config.quality || null;\n var url = this._toKonvaCanvas(config).toDataURL(mimeType, quality);\n if (config.callback) {\n config.callback(url);\n }\n return url;\n }\n toImage(config) {\n return new Promise((resolve, reject) => {\n try {\n const callback = config === null || config === void 0 ? void 0 : config.callback;\n if (callback)\n delete config.callback;\n Util_1.Util._urlToImage(this.toDataURL(config), function (img) {\n resolve(img);\n callback === null || callback === void 0 ? void 0 : callback(img);\n });\n }\n catch (err) {\n reject(err);\n }\n });\n }\n toBlob(config) {\n return new Promise((resolve, reject) => {\n try {\n const callback = config === null || config === void 0 ? void 0 : config.callback;\n if (callback)\n delete config.callback;\n this.toCanvas(config).toBlob((blob) => {\n resolve(blob);\n callback === null || callback === void 0 ? void 0 : callback(blob);\n }, config === null || config === void 0 ? void 0 : config.mimeType, config === null || config === void 0 ? void 0 : config.quality);\n }\n catch (err) {\n reject(err);\n }\n });\n }\n setSize(size) {\n this.width(size.width);\n this.height(size.height);\n return this;\n }\n getSize() {\n return {\n width: this.width(),\n height: this.height(),\n };\n }\n getClassName() {\n return this.className || this.nodeType;\n }\n getType() {\n return this.nodeType;\n }\n getDragDistance() {\n if (this.attrs.dragDistance !== undefined) {\n return this.attrs.dragDistance;\n }\n else if (this.parent) {\n return this.parent.getDragDistance();\n }\n else {\n return Global_1.Konva.dragDistance;\n }\n }\n _off(type, name, callback) {\n var evtListeners = this.eventListeners[type], i, evtName, handler;\n for (i = 0; i < evtListeners.length; i++) {\n evtName = evtListeners[i].name;\n handler = evtListeners[i].handler;\n if ((evtName !== 'konva' || name === 'konva') &&\n (!name || evtName === name) &&\n (!callback || callback === handler)) {\n evtListeners.splice(i, 1);\n if (evtListeners.length === 0) {\n delete this.eventListeners[type];\n break;\n }\n i--;\n }\n }\n }\n _fireChangeEvent(attr, oldVal, newVal) {\n this._fire(attr + CHANGE, {\n oldVal: oldVal,\n newVal: newVal,\n });\n }\n addName(name) {\n if (!this.hasName(name)) {\n var oldName = this.name();\n var newName = oldName ? oldName + ' ' + name : name;\n this.name(newName);\n }\n return this;\n }\n hasName(name) {\n if (!name) {\n return false;\n }\n const fullName = this.name();\n if (!fullName) {\n return false;\n }\n var names = (fullName || '').split(/\\s/g);\n return names.indexOf(name) !== -1;\n }\n removeName(name) {\n var names = (this.name() || '').split(/\\s/g);\n var index = names.indexOf(name);\n if (index !== -1) {\n names.splice(index, 1);\n this.name(names.join(' '));\n }\n return this;\n }\n setAttr(attr, val) {\n var func = this[SET + Util_1.Util._capitalize(attr)];\n if (Util_1.Util._isFunction(func)) {\n func.call(this, val);\n }\n else {\n this._setAttr(attr, val);\n }\n return this;\n }\n _requestDraw() {\n if (Global_1.Konva.autoDrawEnabled) {\n const drawNode = this.getLayer() || this.getStage();\n drawNode === null || drawNode === void 0 ? void 0 : drawNode.batchDraw();\n }\n }\n _setAttr(key, val) {\n var oldVal = this.attrs[key];\n if (oldVal === val && !Util_1.Util.isObject(val)) {\n return;\n }\n if (val === undefined || val === null) {\n delete this.attrs[key];\n }\n else {\n this.attrs[key] = val;\n }\n if (this._shouldFireChangeEvents) {\n this._fireChangeEvent(key, oldVal, val);\n }\n this._requestDraw();\n }\n _setComponentAttr(key, component, val) {\n var oldVal;\n if (val !== undefined) {\n oldVal = this.attrs[key];\n if (!oldVal) {\n this.attrs[key] = this.getAttr(key);\n }\n this.attrs[key][component] = val;\n this._fireChangeEvent(key, oldVal, val);\n }\n }\n _fireAndBubble(eventType, evt, compareShape) {\n if (evt && this.nodeType === SHAPE) {\n evt.target = this;\n }\n var shouldStop = (eventType === MOUSEENTER || eventType === MOUSELEAVE) &&\n ((compareShape &&\n (this === compareShape ||\n (this.isAncestorOf && this.isAncestorOf(compareShape)))) ||\n (this.nodeType === 'Stage' && !compareShape));\n if (!shouldStop) {\n this._fire(eventType, evt);\n var stopBubble = (eventType === MOUSEENTER || eventType === MOUSELEAVE) &&\n compareShape &&\n compareShape.isAncestorOf &&\n compareShape.isAncestorOf(this) &&\n !compareShape.isAncestorOf(this.parent);\n if (((evt && !evt.cancelBubble) || !evt) &&\n this.parent &&\n this.parent.isListening() &&\n !stopBubble) {\n if (compareShape && compareShape.parent) {\n this._fireAndBubble.call(this.parent, eventType, evt, compareShape);\n }\n else {\n this._fireAndBubble.call(this.parent, eventType, evt);\n }\n }\n }\n }\n _getProtoListeners(eventType) {\n var _a, _b, _c;\n const allListeners = (_a = this._cache.get(ALL_LISTENERS)) !== null && _a !== void 0 ? _a : {};\n let events = allListeners === null || allListeners === void 0 ? void 0 : allListeners[eventType];\n if (events === undefined) {\n events = [];\n let obj = Object.getPrototypeOf(this);\n while (obj) {\n const hierarchyEvents = (_c = (_b = obj.eventListeners) === null || _b === void 0 ? void 0 : _b[eventType]) !== null && _c !== void 0 ? _c : [];\n events.push(...hierarchyEvents);\n obj = Object.getPrototypeOf(obj);\n }\n allListeners[eventType] = events;\n this._cache.set(ALL_LISTENERS, allListeners);\n }\n return events;\n }\n _fire(eventType, evt) {\n evt = evt || {};\n evt.currentTarget = this;\n evt.type = eventType;\n const topListeners = this._getProtoListeners(eventType);\n if (topListeners) {\n for (var i = 0; i < topListeners.length; i++) {\n topListeners[i].handler.call(this, evt);\n }\n }\n const selfListeners = this.eventListeners[eventType];\n if (selfListeners) {\n for (var i = 0; i < selfListeners.length; i++) {\n selfListeners[i].handler.call(this, evt);\n }\n }\n }\n draw() {\n this.drawScene();\n this.drawHit();\n return this;\n }\n _createDragElement(evt) {\n var pointerId = evt ? evt.pointerId : undefined;\n var stage = this.getStage();\n var ap = this.getAbsolutePosition();\n if (!stage) {\n return;\n }\n var pos = stage._getPointerById(pointerId) ||\n stage._changedPointerPositions[0] ||\n ap;\n DragAndDrop_1.DD._dragElements.set(this._id, {\n node: this,\n startPointerPos: pos,\n offset: {\n x: pos.x - ap.x,\n y: pos.y - ap.y,\n },\n dragStatus: 'ready',\n pointerId,\n });\n }\n startDrag(evt, bubbleEvent = true) {\n if (!DragAndDrop_1.DD._dragElements.has(this._id)) {\n this._createDragElement(evt);\n }\n const elem = DragAndDrop_1.DD._dragElements.get(this._id);\n elem.dragStatus = 'dragging';\n this.fire('dragstart', {\n type: 'dragstart',\n target: this,\n evt: evt && evt.evt,\n }, bubbleEvent);\n }\n _setDragPosition(evt, elem) {\n const pos = this.getStage()._getPointerById(elem.pointerId);\n if (!pos) {\n return;\n }\n var newNodePos = {\n x: pos.x - elem.offset.x,\n y: pos.y - elem.offset.y,\n };\n var dbf = this.dragBoundFunc();\n if (dbf !== undefined) {\n const bounded = dbf.call(this, newNodePos, evt);\n if (!bounded) {\n Util_1.Util.warn('dragBoundFunc did not return any value. That is unexpected behavior. You must return new absolute position from dragBoundFunc.');\n }\n else {\n newNodePos = bounded;\n }\n }\n if (!this._lastPos ||\n this._lastPos.x !== newNodePos.x ||\n this._lastPos.y !== newNodePos.y) {\n this.setAbsolutePosition(newNodePos);\n this._requestDraw();\n }\n this._lastPos = newNodePos;\n }\n stopDrag(evt) {\n const elem = DragAndDrop_1.DD._dragElements.get(this._id);\n if (elem) {\n elem.dragStatus = 'stopped';\n }\n DragAndDrop_1.DD._endDragBefore(evt);\n DragAndDrop_1.DD._endDragAfter(evt);\n }\n setDraggable(draggable) {\n this._setAttr('draggable', draggable);\n this._dragChange();\n }\n isDragging() {\n const elem = DragAndDrop_1.DD._dragElements.get(this._id);\n return elem ? elem.dragStatus === 'dragging' : false;\n }\n _listenDrag() {\n this._dragCleanup();\n this.on('mousedown.konva touchstart.konva', function (evt) {\n var shouldCheckButton = evt.evt['button'] !== undefined;\n var canDrag = !shouldCheckButton || Global_1.Konva.dragButtons.indexOf(evt.evt['button']) >= 0;\n if (!canDrag) {\n return;\n }\n if (this.isDragging()) {\n return;\n }\n var hasDraggingChild = false;\n DragAndDrop_1.DD._dragElements.forEach((elem) => {\n if (this.isAncestorOf(elem.node)) {\n hasDraggingChild = true;\n }\n });\n if (!hasDraggingChild) {\n this._createDragElement(evt);\n }\n });\n }\n _dragChange() {\n if (this.attrs.draggable) {\n this._listenDrag();\n }\n else {\n this._dragCleanup();\n var stage = this.getStage();\n if (!stage) {\n return;\n }\n const dragElement = DragAndDrop_1.DD._dragElements.get(this._id);\n const isDragging = dragElement && dragElement.dragStatus === 'dragging';\n const isReady = dragElement && dragElement.dragStatus === 'ready';\n if (isDragging) {\n this.stopDrag();\n }\n else if (isReady) {\n DragAndDrop_1.DD._dragElements.delete(this._id);\n }\n }\n }\n _dragCleanup() {\n this.off('mousedown.konva');\n this.off('touchstart.konva');\n }\n isClientRectOnScreen(margin = { x: 0, y: 0 }) {\n const stage = this.getStage();\n if (!stage) {\n return false;\n }\n const screenRect = {\n x: -margin.x,\n y: -margin.y,\n width: stage.width() + 2 * margin.x,\n height: stage.height() + 2 * margin.y,\n };\n return Util_1.Util.haveIntersection(screenRect, this.getClientRect());\n }\n static create(data, container) {\n if (Util_1.Util._isString(data)) {\n data = JSON.parse(data);\n }\n return this._createNode(data, container);\n }\n static _createNode(obj, container) {\n var className = Node.prototype.getClassName.call(obj), children = obj.children, no, len, n;\n if (container) {\n obj.attrs.container = container;\n }\n if (!Global_1.Konva[className]) {\n Util_1.Util.warn('Can not find a node with class name \"' +\n className +\n '\". Fallback to \"Shape\".');\n className = 'Shape';\n }\n const Class = Global_1.Konva[className];\n no = new Class(obj.attrs);\n if (children) {\n len = children.length;\n for (n = 0; n < len; n++) {\n no.add(Node._createNode(children[n]));\n }\n }\n return no;\n }\n}\nexports.Node = Node;\nNode.prototype.nodeType = 'Node';\nNode.prototype._attrsAffectingSize = [];\nNode.prototype.eventListeners = {};\nNode.prototype.on.call(Node.prototype, TRANSFORM_CHANGE_STR, function () {\n if (this._batchingTransformChange) {\n this._needClearTransformCache = true;\n return;\n }\n this._clearCache(TRANSFORM);\n this._clearSelfAndDescendantCache(ABSOLUTE_TRANSFORM);\n});\nNode.prototype.on.call(Node.prototype, 'visibleChange.konva', function () {\n this._clearSelfAndDescendantCache(VISIBLE);\n});\nNode.prototype.on.call(Node.prototype, 'listeningChange.konva', function () {\n this._clearSelfAndDescendantCache(LISTENING);\n});\nNode.prototype.on.call(Node.prototype, 'opacityChange.konva', function () {\n this._clearSelfAndDescendantCache(ABSOLUTE_OPACITY);\n});\nconst addGetterSetter = Factory_1.Factory.addGetterSetter;\naddGetterSetter(Node, 'zIndex');\naddGetterSetter(Node, 'absolutePosition');\naddGetterSetter(Node, 'position');\naddGetterSetter(Node, 'x', 0, (0, Validators_1.getNumberValidator)());\naddGetterSetter(Node, 'y', 0, (0, Validators_1.getNumberValidator)());\naddGetterSetter(Node, 'globalCompositeOperation', 'source-over', (0, Validators_1.getStringValidator)());\naddGetterSetter(Node, 'opacity', 1, (0, Validators_1.getNumberValidator)());\naddGetterSetter(Node, 'name', '', (0, Validators_1.getStringValidator)());\naddGetterSetter(Node, 'id', '', (0, Validators_1.getStringValidator)());\naddGetterSetter(Node, 'rotation', 0, (0, Validators_1.getNumberValidator)());\nFactory_1.Factory.addComponentsGetterSetter(Node, 'scale', ['x', 'y']);\naddGetterSetter(Node, 'scaleX', 1, (0, Validators_1.getNumberValidator)());\naddGetterSetter(Node, 'scaleY', 1, (0, Validators_1.getNumberValidator)());\nFactory_1.Factory.addComponentsGetterSetter(Node, 'skew', ['x', 'y']);\naddGetterSetter(Node, 'skewX', 0, (0, Validators_1.getNumberValidator)());\naddGetterSetter(Node, 'skewY', 0, (0, Validators_1.getNumberValidator)());\nFactory_1.Factory.addComponentsGetterSetter(Node, 'offset', ['x', 'y']);\naddGetterSetter(Node, 'offsetX', 0, (0, Validators_1.getNumberValidator)());\naddGetterSetter(Node, 'offsetY', 0, (0, Validators_1.getNumberValidator)());\naddGetterSetter(Node, 'dragDistance', null, (0, Validators_1.getNumberValidator)());\naddGetterSetter(Node, 'width', 0, (0, Validators_1.getNumberValidator)());\naddGetterSetter(Node, 'height', 0, (0, Validators_1.getNumberValidator)());\naddGetterSetter(Node, 'listening', true, (0, Validators_1.getBooleanValidator)());\naddGetterSetter(Node, 'preventDefault', true, (0, Validators_1.getBooleanValidator)());\naddGetterSetter(Node, 'filters', null, function (val) {\n this._filterUpToDate = false;\n return val;\n});\naddGetterSetter(Node, 'visible', true, (0, Validators_1.getBooleanValidator)());\naddGetterSetter(Node, 'transformsEnabled', 'all', (0, Validators_1.getStringValidator)());\naddGetterSetter(Node, 'size');\naddGetterSetter(Node, 'dragBoundFunc');\naddGetterSetter(Node, 'draggable', false, (0, Validators_1.getBooleanValidator)());\nFactory_1.Factory.backCompat(Node, {\n rotateDeg: 'rotate',\n setRotationDeg: 'setRotation',\n getRotationDeg: 'getRotation',\n});\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Container = void 0;\nconst Factory_1 = require(\"./Factory\");\nconst Node_1 = require(\"./Node\");\nconst Validators_1 = require(\"./Validators\");\nclass Container extends Node_1.Node {\n constructor() {\n super(...arguments);\n this.children = [];\n }\n getChildren(filterFunc) {\n if (!filterFunc) {\n return this.children || [];\n }\n const children = this.children || [];\n var results = [];\n children.forEach(function (child) {\n if (filterFunc(child)) {\n results.push(child);\n }\n });\n return results;\n }\n hasChildren() {\n return this.getChildren().length > 0;\n }\n removeChildren() {\n this.getChildren().forEach((child) => {\n child.parent = null;\n child.index = 0;\n child.remove();\n });\n this.children = [];\n this._requestDraw();\n return this;\n }\n destroyChildren() {\n this.getChildren().forEach((child) => {\n child.parent = null;\n child.index = 0;\n child.destroy();\n });\n this.children = [];\n this._requestDraw();\n return this;\n }\n add(...children) {\n if (children.length === 0) {\n return this;\n }\n if (children.length > 1) {\n for (var i = 0; i < children.length; i++) {\n this.add(children[i]);\n }\n return this;\n }\n const child = children[0];\n if (child.getParent()) {\n child.moveTo(this);\n return this;\n }\n this._validateAdd(child);\n child.index = this.getChildren().length;\n child.parent = this;\n child._clearCaches();\n this.getChildren().push(child);\n this._fire('add', {\n child: child,\n });\n this._requestDraw();\n return this;\n }\n destroy() {\n if (this.hasChildren()) {\n this.destroyChildren();\n }\n super.destroy();\n return this;\n }\n find(selector) {\n return this._generalFind(selector, false);\n }\n findOne(selector) {\n var result = this._generalFind(selector, true);\n return result.length > 0 ? result[0] : undefined;\n }\n _generalFind(selector, findOne) {\n var retArr = [];\n this._descendants((node) => {\n const valid = node._isMatch(selector);\n if (valid) {\n retArr.push(node);\n }\n if (valid && findOne) {\n return true;\n }\n return false;\n });\n return retArr;\n }\n _descendants(fn) {\n let shouldStop = false;\n const children = this.getChildren();\n for (const child of children) {\n shouldStop = fn(child);\n if (shouldStop) {\n return true;\n }\n if (!child.hasChildren()) {\n continue;\n }\n shouldStop = child._descendants(fn);\n if (shouldStop) {\n return true;\n }\n }\n return false;\n }\n toObject() {\n var obj = Node_1.Node.prototype.toObject.call(this);\n obj.children = [];\n this.getChildren().forEach((child) => {\n obj.children.push(child.toObject());\n });\n return obj;\n }\n isAncestorOf(node) {\n var parent = node.getParent();\n while (parent) {\n if (parent._id === this._id) {\n return true;\n }\n parent = parent.getParent();\n }\n return false;\n }\n clone(obj) {\n var node = Node_1.Node.prototype.clone.call(this, obj);\n this.getChildren().forEach(function (no) {\n node.add(no.clone());\n });\n return node;\n }\n getAllIntersections(pos) {\n var arr = [];\n this.find('Shape').forEach((shape) => {\n if (shape.isVisible() && shape.intersects(pos)) {\n arr.push(shape);\n }\n });\n return arr;\n }\n _clearSelfAndDescendantCache(attr) {\n var _a;\n super._clearSelfAndDescendantCache(attr);\n if (this.isCached()) {\n return;\n }\n (_a = this.children) === null || _a === void 0 ? void 0 : _a.forEach(function (node) {\n node._clearSelfAndDescendantCache(attr);\n });\n }\n _setChildrenIndices() {\n var _a;\n (_a = this.children) === null || _a === void 0 ? void 0 : _a.forEach(function (child, n) {\n child.index = n;\n });\n this._requestDraw();\n }\n drawScene(can, top, bufferCanvas) {\n var layer = this.getLayer(), canvas = can || (layer && layer.getCanvas()), context = canvas && canvas.getContext(), cachedCanvas = this._getCanvasCache(), cachedSceneCanvas = cachedCanvas && cachedCanvas.scene;\n var caching = canvas && canvas.isCache;\n if (!this.isVisible() && !caching) {\n return this;\n }\n if (cachedSceneCanvas) {\n context.save();\n var m = this.getAbsoluteTransform(top).getMatrix();\n context.transform(m[0], m[1], m[2], m[3], m[4], m[5]);\n this._drawCachedSceneCanvas(context);\n context.restore();\n }\n else {\n this._drawChildren('drawScene', canvas, top, bufferCanvas);\n }\n return this;\n }\n drawHit(can, top) {\n if (!this.shouldDrawHit(top)) {\n return this;\n }\n var layer = this.getLayer(), canvas = can || (layer && layer.hitCanvas), context = canvas && canvas.getContext(), cachedCanvas = this._getCanvasCache(), cachedHitCanvas = cachedCanvas && cachedCanvas.hit;\n if (cachedHitCanvas) {\n context.save();\n var m = this.getAbsoluteTransform(top).getMatrix();\n context.transform(m[0], m[1], m[2], m[3], m[4], m[5]);\n this._drawCachedHitCanvas(context);\n context.restore();\n }\n else {\n this._drawChildren('drawHit', canvas, top);\n }\n return this;\n }\n _drawChildren(drawMethod, canvas, top, bufferCanvas) {\n var _a;\n var context = canvas && canvas.getContext(), clipWidth = this.clipWidth(), clipHeight = this.clipHeight(), clipFunc = this.clipFunc(), hasClip = (typeof clipWidth === 'number' && typeof clipHeight === 'number') ||\n clipFunc;\n const selfCache = top === this;\n if (hasClip) {\n context.save();\n var transform = this.getAbsoluteTransform(top);\n var m = transform.getMatrix();\n context.transform(m[0], m[1], m[2], m[3], m[4], m[5]);\n context.beginPath();\n let clipArgs;\n if (clipFunc) {\n clipArgs = clipFunc.call(this, context, this);\n }\n else {\n var clipX = this.clipX();\n var clipY = this.clipY();\n context.rect(clipX || 0, clipY || 0, clipWidth, clipHeight);\n }\n context.clip.apply(context, clipArgs);\n m = transform.copy().invert().getMatrix();\n context.transform(m[0], m[1], m[2], m[3], m[4], m[5]);\n }\n var hasComposition = !selfCache &&\n this.globalCompositeOperation() !== 'source-over' &&\n drawMethod === 'drawScene';\n if (hasComposition) {\n context.save();\n context._applyGlobalCompositeOperation(this);\n }\n (_a = this.children) === null || _a === void 0 ? void 0 : _a.forEach(function (child) {\n child[drawMethod](canvas, top, bufferCanvas);\n });\n if (hasComposition) {\n context.restore();\n }\n if (hasClip) {\n context.restore();\n }\n }\n getClientRect(config = {}) {\n var _a;\n var skipTransform = config.skipTransform;\n var relativeTo = config.relativeTo;\n var minX, minY, maxX, maxY;\n var selfRect = {\n x: Infinity,\n y: Infinity,\n width: 0,\n height: 0,\n };\n var that = this;\n (_a = this.children) === null || _a === void 0 ? void 0 : _a.forEach(function (child) {\n if (!child.visible()) {\n return;\n }\n var rect = child.getClientRect({\n relativeTo: that,\n skipShadow: config.skipShadow,\n skipStroke: config.skipStroke,\n });\n if (rect.width === 0 && rect.height === 0) {\n return;\n }\n if (minX === undefined) {\n minX = rect.x;\n minY = rect.y;\n maxX = rect.x + rect.width;\n maxY = rect.y + rect.height;\n }\n else {\n minX = Math.min(minX, rect.x);\n minY = Math.min(minY, rect.y);\n maxX = Math.max(maxX, rect.x + rect.width);\n maxY = Math.max(maxY, rect.y + rect.height);\n }\n });\n var shapes = this.find('Shape');\n var hasVisible = false;\n for (var i = 0; i < shapes.length; i++) {\n var shape = shapes[i];\n if (shape._isVisible(this)) {\n hasVisible = true;\n break;\n }\n }\n if (hasVisible && minX !== undefined) {\n selfRect = {\n x: minX,\n y: minY,\n width: maxX - minX,\n height: maxY - minY,\n };\n }\n else {\n selfRect = {\n x: 0,\n y: 0,\n width: 0,\n height: 0,\n };\n }\n if (!skipTransform) {\n return this._transformedRect(selfRect, relativeTo);\n }\n return selfRect;\n }\n}\nexports.Container = Container;\nFactory_1.Factory.addComponentsGetterSetter(Container, 'clip', [\n 'x',\n 'y',\n 'width',\n 'height',\n]);\nFactory_1.Factory.addGetterSetter(Container, 'clipX', undefined, (0, Validators_1.getNumberValidator)());\nFactory_1.Factory.addGetterSetter(Container, 'clipY', undefined, (0, Validators_1.getNumberValidator)());\nFactory_1.Factory.addGetterSetter(Container, 'clipWidth', undefined, (0, Validators_1.getNumberValidator)());\nFactory_1.Factory.addGetterSetter(Container, 'clipHeight', undefined, (0, Validators_1.getNumberValidator)());\nFactory_1.Factory.addGetterSetter(Container, 'clipFunc');\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.releaseCapture = exports.setPointerCapture = exports.hasPointerCapture = exports.createEvent = exports.getCapturedShape = void 0;\nconst Global_1 = require(\"./Global\");\nconst Captures = new Map();\nconst SUPPORT_POINTER_EVENTS = Global_1.Konva._global['PointerEvent'] !== undefined;\nfunction getCapturedShape(pointerId) {\n return Captures.get(pointerId);\n}\nexports.getCapturedShape = getCapturedShape;\nfunction createEvent(evt) {\n return {\n evt,\n pointerId: evt.pointerId,\n };\n}\nexports.createEvent = createEvent;\nfunction hasPointerCapture(pointerId, shape) {\n return Captures.get(pointerId) === shape;\n}\nexports.hasPointerCapture = hasPointerCapture;\nfunction setPointerCapture(pointerId, shape) {\n releaseCapture(pointerId);\n const stage = shape.getStage();\n if (!stage)\n return;\n Captures.set(pointerId, shape);\n if (SUPPORT_POINTER_EVENTS) {\n shape._fire('gotpointercapture', createEvent(new PointerEvent('gotpointercapture')));\n }\n}\nexports.setPointerCapture = setPointerCapture;\nfunction releaseCapture(pointerId, target) {\n const shape = Captures.get(pointerId);\n if (!shape)\n return;\n const stage = shape.getStage();\n if (stage && stage.content) {\n }\n Captures.delete(pointerId);\n if (SUPPORT_POINTER_EVENTS) {\n shape._fire('lostpointercapture', createEvent(new PointerEvent('lostpointercapture')));\n }\n}\nexports.releaseCapture = releaseCapture;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Stage = exports.stages = void 0;\nconst Util_1 = require(\"./Util\");\nconst Factory_1 = require(\"./Factory\");\nconst Container_1 = require(\"./Container\");\nconst Global_1 = require(\"./Global\");\nconst Canvas_1 = require(\"./Canvas\");\nconst DragAndDrop_1 = require(\"./DragAndDrop\");\nconst Global_2 = require(\"./Global\");\nconst PointerEvents = require(\"./PointerEvents\");\nvar STAGE = 'Stage', STRING = 'string', PX = 'px', MOUSEOUT = 'mouseout', MOUSELEAVE = 'mouseleave', MOUSEOVER = 'mouseover', MOUSEENTER = 'mouseenter', MOUSEMOVE = 'mousemove', MOUSEDOWN = 'mousedown', MOUSEUP = 'mouseup', POINTERMOVE = 'pointermove', POINTERDOWN = 'pointerdown', POINTERUP = 'pointerup', POINTERCANCEL = 'pointercancel', LOSTPOINTERCAPTURE = 'lostpointercapture', POINTEROUT = 'pointerout', POINTERLEAVE = 'pointerleave', POINTEROVER = 'pointerover', POINTERENTER = 'pointerenter', CONTEXTMENU = 'contextmenu', TOUCHSTART = 'touchstart', TOUCHEND = 'touchend', TOUCHMOVE = 'touchmove', TOUCHCANCEL = 'touchcancel', WHEEL = 'wheel', MAX_LAYERS_NUMBER = 5, EVENTS = [\n [MOUSEENTER, '_pointerenter'],\n [MOUSEDOWN, '_pointerdown'],\n [MOUSEMOVE, '_pointermove'],\n [MOUSEUP, '_pointerup'],\n [MOUSELEAVE, '_pointerleave'],\n [TOUCHSTART, '_pointerdown'],\n [TOUCHMOVE, '_pointermove'],\n [TOUCHEND, '_pointerup'],\n [TOUCHCANCEL, '_pointercancel'],\n [MOUSEOVER, '_pointerover'],\n [WHEEL, '_wheel'],\n [CONTEXTMENU, '_contextmenu'],\n [POINTERDOWN, '_pointerdown'],\n [POINTERMOVE, '_pointermove'],\n [POINTERUP, '_pointerup'],\n [POINTERCANCEL, '_pointercancel'],\n [LOSTPOINTERCAPTURE, '_lostpointercapture'],\n];\nconst EVENTS_MAP = {\n mouse: {\n [POINTEROUT]: MOUSEOUT,\n [POINTERLEAVE]: MOUSELEAVE,\n [POINTEROVER]: MOUSEOVER,\n [POINTERENTER]: MOUSEENTER,\n [POINTERMOVE]: MOUSEMOVE,\n [POINTERDOWN]: MOUSEDOWN,\n [POINTERUP]: MOUSEUP,\n [POINTERCANCEL]: 'mousecancel',\n pointerclick: 'click',\n pointerdblclick: 'dblclick',\n },\n touch: {\n [POINTEROUT]: 'touchout',\n [POINTERLEAVE]: 'touchleave',\n [POINTEROVER]: 'touchover',\n [POINTERENTER]: 'touchenter',\n [POINTERMOVE]: TOUCHMOVE,\n [POINTERDOWN]: TOUCHSTART,\n [POINTERUP]: TOUCHEND,\n [POINTERCANCEL]: TOUCHCANCEL,\n pointerclick: 'tap',\n pointerdblclick: 'dbltap',\n },\n pointer: {\n [POINTEROUT]: POINTEROUT,\n [POINTERLEAVE]: POINTERLEAVE,\n [POINTEROVER]: POINTEROVER,\n [POINTERENTER]: POINTERENTER,\n [POINTERMOVE]: POINTERMOVE,\n [POINTERDOWN]: POINTERDOWN,\n [POINTERUP]: POINTERUP,\n [POINTERCANCEL]: POINTERCANCEL,\n pointerclick: 'pointerclick',\n pointerdblclick: 'pointerdblclick',\n },\n};\nconst getEventType = (type) => {\n if (type.indexOf('pointer') >= 0) {\n return 'pointer';\n }\n if (type.indexOf('touch') >= 0) {\n return 'touch';\n }\n return 'mouse';\n};\nconst getEventsMap = (eventType) => {\n const type = getEventType(eventType);\n if (type === 'pointer') {\n return Global_1.Konva.pointerEventsEnabled && EVENTS_MAP.pointer;\n }\n if (type === 'touch') {\n return EVENTS_MAP.touch;\n }\n if (type === 'mouse') {\n return EVENTS_MAP.mouse;\n }\n};\nfunction checkNoClip(attrs = {}) {\n if (attrs.clipFunc || attrs.clipWidth || attrs.clipHeight) {\n Util_1.Util.warn('Stage does not support clipping. Please use clip for Layers or Groups.');\n }\n return attrs;\n}\nconst NO_POINTERS_MESSAGE = `Pointer position is missing and not registered by the stage. Looks like it is outside of the stage container. You can set it manually from event: stage.setPointersPositions(event);`;\nexports.stages = [];\nclass Stage extends Container_1.Container {\n constructor(config) {\n super(checkNoClip(config));\n this._pointerPositions = [];\n this._changedPointerPositions = [];\n this._buildDOM();\n this._bindContentEvents();\n exports.stages.push(this);\n this.on('widthChange.konva heightChange.konva', this._resizeDOM);\n this.on('visibleChange.konva', this._checkVisibility);\n this.on('clipWidthChange.konva clipHeightChange.konva clipFuncChange.konva', () => {\n checkNoClip(this.attrs);\n });\n this._checkVisibility();\n }\n _validateAdd(child) {\n const isLayer = child.getType() === 'Layer';\n const isFastLayer = child.getType() === 'FastLayer';\n const valid = isLayer || isFastLayer;\n if (!valid) {\n Util_1.Util.throw('You may only add layers to the stage.');\n }\n }\n _checkVisibility() {\n if (!this.content) {\n return;\n }\n const style = this.visible() ? '' : 'none';\n this.content.style.display = style;\n }\n setContainer(container) {\n if (typeof container === STRING) {\n if (container.charAt(0) === '.') {\n var className = container.slice(1);\n container = document.getElementsByClassName(className)[0];\n }\n else {\n var id;\n if (container.charAt(0) !== '#') {\n id = container;\n }\n else {\n id = container.slice(1);\n }\n container = document.getElementById(id);\n }\n if (!container) {\n throw 'Can not find container in document with id ' + id;\n }\n }\n this._setAttr('container', container);\n if (this.content) {\n if (this.content.parentElement) {\n this.content.parentElement.removeChild(this.content);\n }\n container.appendChild(this.content);\n }\n return this;\n }\n shouldDrawHit() {\n return true;\n }\n clear() {\n var layers = this.children, len = layers.length, n;\n for (n = 0; n < len; n++) {\n layers[n].clear();\n }\n return this;\n }\n clone(obj) {\n if (!obj) {\n obj = {};\n }\n obj.container =\n typeof document !== 'undefined' && document.createElement('div');\n return Container_1.Container.prototype.clone.call(this, obj);\n }\n destroy() {\n super.destroy();\n var content = this.content;\n if (content && Util_1.Util._isInDocument(content)) {\n this.container().removeChild(content);\n }\n var index = exports.stages.indexOf(this);\n if (index > -1) {\n exports.stages.splice(index, 1);\n }\n Util_1.Util.releaseCanvas(this.bufferCanvas._canvas, this.bufferHitCanvas._canvas);\n return this;\n }\n getPointerPosition() {\n const pos = this._pointerPositions[0] || this._changedPointerPositions[0];\n if (!pos) {\n Util_1.Util.warn(NO_POINTERS_MESSAGE);\n return null;\n }\n return {\n x: pos.x,\n y: pos.y,\n };\n }\n _getPointerById(id) {\n return this._pointerPositions.find((p) => p.id === id);\n }\n getPointersPositions() {\n return this._pointerPositions;\n }\n getStage() {\n return this;\n }\n getContent() {\n return this.content;\n }\n _toKonvaCanvas(config) {\n config = config || {};\n config.x = config.x || 0;\n config.y = config.y || 0;\n config.width = config.width || this.width();\n config.height = config.height || this.height();\n var canvas = new Canvas_1.SceneCanvas({\n width: config.width,\n height: config.height,\n pixelRatio: config.pixelRatio || 1,\n });\n var _context = canvas.getContext()._context;\n var layers = this.children;\n if (config.x || config.y) {\n _context.translate(-1 * config.x, -1 * config.y);\n }\n layers.forEach(function (layer) {\n if (!layer.isVisible()) {\n return;\n }\n var layerCanvas = layer._toKonvaCanvas(config);\n _context.drawImage(layerCanvas._canvas, config.x, config.y, layerCanvas.getWidth() / layerCanvas.getPixelRatio(), layerCanvas.getHeight() / layerCanvas.getPixelRatio());\n });\n return canvas;\n }\n getIntersection(pos) {\n if (!pos) {\n return null;\n }\n var layers = this.children, len = layers.length, end = len - 1, n;\n for (n = end; n >= 0; n--) {\n const shape = layers[n].getIntersection(pos);\n if (shape) {\n return shape;\n }\n }\n return null;\n }\n _resizeDOM() {\n var width = this.width();\n var height = this.height();\n if (this.content) {\n this.content.style.width = width + PX;\n this.content.style.height = height + PX;\n }\n this.bufferCanvas.setSize(width, height);\n this.bufferHitCanvas.setSize(width, height);\n this.children.forEach((layer) => {\n layer.setSize({ width, height });\n layer.draw();\n });\n }\n add(layer, ...rest) {\n if (arguments.length > 1) {\n for (var i = 0; i < arguments.length; i++) {\n this.add(arguments[i]);\n }\n return this;\n }\n super.add(layer);\n var length = this.children.length;\n if (length > MAX_LAYERS_NUMBER) {\n Util_1.Util.warn('The stage has ' +\n length +\n ' layers. Recommended maximum number of layers is 3-5. Adding more layers into the stage may drop the performance. Rethink your tree structure, you can use Konva.Group.');\n }\n layer.setSize({ width: this.width(), height: this.height() });\n layer.draw();\n if (Global_1.Konva.isBrowser) {\n this.content.appendChild(layer.canvas._canvas);\n }\n return this;\n }\n getParent() {\n return null;\n }\n getLayer() {\n return null;\n }\n hasPointerCapture(pointerId) {\n return PointerEvents.hasPointerCapture(pointerId, this);\n }\n setPointerCapture(pointerId) {\n PointerEvents.setPointerCapture(pointerId, this);\n }\n releaseCapture(pointerId) {\n PointerEvents.releaseCapture(pointerId, this);\n }\n getLayers() {\n return this.children;\n }\n _bindContentEvents() {\n if (!Global_1.Konva.isBrowser) {\n return;\n }\n EVENTS.forEach(([event, methodName]) => {\n this.content.addEventListener(event, (evt) => {\n this[methodName](evt);\n }, { passive: false });\n });\n }\n _pointerenter(evt) {\n this.setPointersPositions(evt);\n const events = getEventsMap(evt.type);\n if (events) {\n this._fire(events.pointerenter, {\n evt: evt,\n target: this,\n currentTarget: this,\n });\n }\n }\n _pointerover(evt) {\n this.setPointersPositions(evt);\n const events = getEventsMap(evt.type);\n if (events) {\n this._fire(events.pointerover, {\n evt: evt,\n target: this,\n currentTarget: this,\n });\n }\n }\n _getTargetShape(evenType) {\n let shape = this[evenType + 'targetShape'];\n if (shape && !shape.getStage()) {\n shape = null;\n }\n return shape;\n }\n _pointerleave(evt) {\n const events = getEventsMap(evt.type);\n const eventType = getEventType(evt.type);\n if (!events) {\n return;\n }\n this.setPointersPositions(evt);\n var targetShape = this._getTargetShape(eventType);\n var eventsEnabled = !(Global_1.Konva.isDragging() || Global_1.Konva.isTransforming()) || Global_1.Konva.hitOnDragEnabled;\n if (targetShape && eventsEnabled) {\n targetShape._fireAndBubble(events.pointerout, { evt: evt });\n targetShape._fireAndBubble(events.pointerleave, { evt: evt });\n this._fire(events.pointerleave, {\n evt: evt,\n target: this,\n currentTarget: this,\n });\n this[eventType + 'targetShape'] = null;\n }\n else if (eventsEnabled) {\n this._fire(events.pointerleave, {\n evt: evt,\n target: this,\n currentTarget: this,\n });\n this._fire(events.pointerout, {\n evt: evt,\n target: this,\n currentTarget: this,\n });\n }\n this.pointerPos = null;\n this._pointerPositions = [];\n }\n _pointerdown(evt) {\n const events = getEventsMap(evt.type);\n const eventType = getEventType(evt.type);\n if (!events) {\n return;\n }\n this.setPointersPositions(evt);\n var triggeredOnShape = false;\n this._changedPointerPositions.forEach((pos) => {\n var shape = this.getIntersection(pos);\n DragAndDrop_1.DD.justDragged = false;\n Global_1.Konva['_' + eventType + 'ListenClick'] = true;\n if (!shape || !shape.isListening()) {\n this[eventType + 'ClickStartShape'] = undefined;\n return;\n }\n if (Global_1.Konva.capturePointerEventsEnabled) {\n shape.setPointerCapture(pos.id);\n }\n this[eventType + 'ClickStartShape'] = shape;\n shape._fireAndBubble(events.pointerdown, {\n evt: evt,\n pointerId: pos.id,\n });\n triggeredOnShape = true;\n const isTouch = evt.type.indexOf('touch') >= 0;\n if (shape.preventDefault() && evt.cancelable && isTouch) {\n evt.preventDefault();\n }\n });\n if (!triggeredOnShape) {\n this._fire(events.pointerdown, {\n evt: evt,\n target: this,\n currentTarget: this,\n pointerId: this._pointerPositions[0].id,\n });\n }\n }\n _pointermove(evt) {\n const events = getEventsMap(evt.type);\n const eventType = getEventType(evt.type);\n if (!events) {\n return;\n }\n if (Global_1.Konva.isDragging() && DragAndDrop_1.DD.node.preventDefault() && evt.cancelable) {\n evt.preventDefault();\n }\n this.setPointersPositions(evt);\n var eventsEnabled = !(Global_1.Konva.isDragging() || Global_1.Konva.isTransforming()) || Global_1.Konva.hitOnDragEnabled;\n if (!eventsEnabled) {\n return;\n }\n var processedShapesIds = {};\n let triggeredOnShape = false;\n var targetShape = this._getTargetShape(eventType);\n this._changedPointerPositions.forEach((pos) => {\n const shape = (PointerEvents.getCapturedShape(pos.id) ||\n this.getIntersection(pos));\n const pointerId = pos.id;\n const event = { evt: evt, pointerId };\n var differentTarget = targetShape !== shape;\n if (differentTarget && targetShape) {\n targetShape._fireAndBubble(events.pointerout, { ...event }, shape);\n targetShape._fireAndBubble(events.pointerleave, { ...event }, shape);\n }\n if (shape) {\n if (processedShapesIds[shape._id]) {\n return;\n }\n processedShapesIds[shape._id] = true;\n }\n if (shape && shape.isListening()) {\n triggeredOnShape = true;\n if (differentTarget) {\n shape._fireAndBubble(events.pointerover, { ...event }, targetShape);\n shape._fireAndBubble(events.pointerenter, { ...event }, targetShape);\n this[eventType + 'targetShape'] = shape;\n }\n shape._fireAndBubble(events.pointermove, { ...event });\n }\n else {\n if (targetShape) {\n this._fire(events.pointerover, {\n evt: evt,\n target: this,\n currentTarget: this,\n pointerId,\n });\n this[eventType + 'targetShape'] = null;\n }\n }\n });\n if (!triggeredOnShape) {\n this._fire(events.pointermove, {\n evt: evt,\n target: this,\n currentTarget: this,\n pointerId: this._changedPointerPositions[0].id,\n });\n }\n }\n _pointerup(evt) {\n const events = getEventsMap(evt.type);\n const eventType = getEventType(evt.type);\n if (!events) {\n return;\n }\n this.setPointersPositions(evt);\n const clickStartShape = this[eventType + 'ClickStartShape'];\n const clickEndShape = this[eventType + 'ClickEndShape'];\n var processedShapesIds = {};\n let triggeredOnShape = false;\n this._changedPointerPositions.forEach((pos) => {\n const shape = (PointerEvents.getCapturedShape(pos.id) ||\n this.getIntersection(pos));\n if (shape) {\n shape.releaseCapture(pos.id);\n if (processedShapesIds[shape._id]) {\n return;\n }\n processedShapesIds[shape._id] = true;\n }\n const pointerId = pos.id;\n const event = { evt: evt, pointerId };\n let fireDblClick = false;\n if (Global_1.Konva['_' + eventType + 'InDblClickWindow']) {\n fireDblClick = true;\n clearTimeout(this[eventType + 'DblTimeout']);\n }\n else if (!DragAndDrop_1.DD.justDragged) {\n Global_1.Konva['_' + eventType + 'InDblClickWindow'] = true;\n clearTimeout(this[eventType + 'DblTimeout']);\n }\n this[eventType + 'DblTimeout'] = setTimeout(function () {\n Global_1.Konva['_' + eventType + 'InDblClickWindow'] = false;\n }, Global_1.Konva.dblClickWindow);\n if (shape && shape.isListening()) {\n triggeredOnShape = true;\n this[eventType + 'ClickEndShape'] = shape;\n shape._fireAndBubble(events.pointerup, { ...event });\n if (Global_1.Konva['_' + eventType + 'ListenClick'] &&\n clickStartShape &&\n clickStartShape === shape) {\n shape._fireAndBubble(events.pointerclick, { ...event });\n if (fireDblClick && clickEndShape && clickEndShape === shape) {\n shape._fireAndBubble(events.pointerdblclick, { ...event });\n }\n }\n }\n else {\n this[eventType + 'ClickEndShape'] = null;\n if (Global_1.Konva['_' + eventType + 'ListenClick']) {\n this._fire(events.pointerclick, {\n evt: evt,\n target: this,\n currentTarget: this,\n pointerId,\n });\n }\n if (fireDblClick) {\n this._fire(events.pointerdblclick, {\n evt: evt,\n target: this,\n currentTarget: this,\n pointerId,\n });\n }\n }\n });\n if (!triggeredOnShape) {\n this._fire(events.pointerup, {\n evt: evt,\n target: this,\n currentTarget: this,\n pointerId: this._changedPointerPositions[0].id,\n });\n }\n Global_1.Konva['_' + eventType + 'ListenClick'] = false;\n if (evt.cancelable && eventType !== 'touch') {\n evt.preventDefault();\n }\n }\n _contextmenu(evt) {\n this.setPointersPositions(evt);\n var shape = this.getIntersection(this.getPointerPosition());\n if (shape && shape.isListening()) {\n shape._fireAndBubble(CONTEXTMENU, { evt: evt });\n }\n else {\n this._fire(CONTEXTMENU, {\n evt: evt,\n target: this,\n currentTarget: this,\n });\n }\n }\n _wheel(evt) {\n this.setPointersPositions(evt);\n var shape = this.getIntersection(this.getPointerPosition());\n if (shape && shape.isListening()) {\n shape._fireAndBubble(WHEEL, { evt: evt });\n }\n else {\n this._fire(WHEEL, {\n evt: evt,\n target: this,\n currentTarget: this,\n });\n }\n }\n _pointercancel(evt) {\n this.setPointersPositions(evt);\n const shape = PointerEvents.getCapturedShape(evt.pointerId) ||\n this.getIntersection(this.getPointerPosition());\n if (shape) {\n shape._fireAndBubble(POINTERUP, PointerEvents.createEvent(evt));\n }\n PointerEvents.releaseCapture(evt.pointerId);\n }\n _lostpointercapture(evt) {\n PointerEvents.releaseCapture(evt.pointerId);\n }\n setPointersPositions(evt) {\n var contentPosition = this._getContentPosition(), x = null, y = null;\n evt = evt ? evt : window.event;\n if (evt.touches !== undefined) {\n this._pointerPositions = [];\n this._changedPointerPositions = [];\n Array.prototype.forEach.call(evt.touches, (touch) => {\n this._pointerPositions.push({\n id: touch.identifier,\n x: (touch.clientX - contentPosition.left) / contentPosition.scaleX,\n y: (touch.clientY - contentPosition.top) / contentPosition.scaleY,\n });\n });\n Array.prototype.forEach.call(evt.changedTouches || evt.touches, (touch) => {\n this._changedPointerPositions.push({\n id: touch.identifier,\n x: (touch.clientX - contentPosition.left) / contentPosition.scaleX,\n y: (touch.clientY - contentPosition.top) / contentPosition.scaleY,\n });\n });\n }\n else {\n x = (evt.clientX - contentPosition.left) / contentPosition.scaleX;\n y = (evt.clientY - contentPosition.top) / contentPosition.scaleY;\n this.pointerPos = {\n x: x,\n y: y,\n };\n this._pointerPositions = [{ x, y, id: Util_1.Util._getFirstPointerId(evt) }];\n this._changedPointerPositions = [\n { x, y, id: Util_1.Util._getFirstPointerId(evt) },\n ];\n }\n }\n _setPointerPosition(evt) {\n Util_1.Util.warn('Method _setPointerPosition is deprecated. Use \"stage.setPointersPositions(event)\" instead.');\n this.setPointersPositions(evt);\n }\n _getContentPosition() {\n if (!this.content || !this.content.getBoundingClientRect) {\n return {\n top: 0,\n left: 0,\n scaleX: 1,\n scaleY: 1,\n };\n }\n var rect = this.content.getBoundingClientRect();\n return {\n top: rect.top,\n left: rect.left,\n scaleX: rect.width / this.content.clientWidth || 1,\n scaleY: rect.height / this.content.clientHeight || 1,\n };\n }\n _buildDOM() {\n this.bufferCanvas = new Canvas_1.SceneCanvas({\n width: this.width(),\n height: this.height(),\n });\n this.bufferHitCanvas = new Canvas_1.HitCanvas({\n pixelRatio: 1,\n width: this.width(),\n height: this.height(),\n });\n if (!Global_1.Konva.isBrowser) {\n return;\n }\n var container = this.container();\n if (!container) {\n throw 'Stage has no container. A container is required.';\n }\n container.innerHTML = '';\n this.content = document.createElement('div');\n this.content.style.position = 'relative';\n this.content.style.userSelect = 'none';\n this.content.className = 'konvajs-content';\n this.content.setAttribute('role', 'presentation');\n container.appendChild(this.content);\n this._resizeDOM();\n }\n cache() {\n Util_1.Util.warn('Cache function is not allowed for stage. You may use cache only for layers, groups and shapes.');\n return this;\n }\n clearCache() {\n return this;\n }\n batchDraw() {\n this.getChildren().forEach(function (layer) {\n layer.batchDraw();\n });\n return this;\n }\n}\nexports.Stage = Stage;\nStage.prototype.nodeType = STAGE;\n(0, Global_2._registerNode)(Stage);\nFactory_1.Factory.addGetterSetter(Stage, 'container');\nif (Global_1.Konva.isBrowser) {\n document.addEventListener('visibilitychange', () => {\n exports.stages.forEach((stage) => {\n stage.batchDraw();\n });\n });\n}\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Shape = exports.shapes = void 0;\nconst Global_1 = require(\"./Global\");\nconst Util_1 = require(\"./Util\");\nconst Factory_1 = require(\"./Factory\");\nconst Node_1 = require(\"./Node\");\nconst Validators_1 = require(\"./Validators\");\nconst Global_2 = require(\"./Global\");\nconst PointerEvents = require(\"./PointerEvents\");\nvar HAS_SHADOW = 'hasShadow';\nvar SHADOW_RGBA = 'shadowRGBA';\nvar patternImage = 'patternImage';\nvar linearGradient = 'linearGradient';\nvar radialGradient = 'radialGradient';\nlet dummyContext;\nfunction getDummyContext() {\n if (dummyContext) {\n return dummyContext;\n }\n dummyContext = Util_1.Util.createCanvasElement().getContext('2d');\n return dummyContext;\n}\nexports.shapes = {};\nfunction _fillFunc(context) {\n const fillRule = this.attrs.fillRule;\n if (fillRule) {\n context.fill(fillRule);\n }\n else {\n context.fill();\n }\n}\nfunction _strokeFunc(context) {\n context.stroke();\n}\nfunction _fillFuncHit(context) {\n const fillRule = this.attrs.fillRule;\n if (fillRule) {\n context.fill(fillRule);\n }\n else {\n context.fill();\n }\n}\nfunction _strokeFuncHit(context) {\n context.stroke();\n}\nfunction _clearHasShadowCache() {\n this._clearCache(HAS_SHADOW);\n}\nfunction _clearGetShadowRGBACache() {\n this._clearCache(SHADOW_RGBA);\n}\nfunction _clearFillPatternCache() {\n this._clearCache(patternImage);\n}\nfunction _clearLinearGradientCache() {\n this._clearCache(linearGradient);\n}\nfunction _clearRadialGradientCache() {\n this._clearCache(radialGradient);\n}\nclass Shape extends Node_1.Node {\n constructor(config) {\n super(config);\n let key;\n while (true) {\n key = Util_1.Util.getRandomColor();\n if (key && !(key in exports.shapes)) {\n break;\n }\n }\n this.colorKey = key;\n exports.shapes[key] = this;\n }\n getContext() {\n Util_1.Util.warn('shape.getContext() method is deprecated. Please do not use it.');\n return this.getLayer().getContext();\n }\n getCanvas() {\n Util_1.Util.warn('shape.getCanvas() method is deprecated. Please do not use it.');\n return this.getLayer().getCanvas();\n }\n getSceneFunc() {\n return this.attrs.sceneFunc || this['_sceneFunc'];\n }\n getHitFunc() {\n return this.attrs.hitFunc || this['_hitFunc'];\n }\n hasShadow() {\n return this._getCache(HAS_SHADOW, this._hasShadow);\n }\n _hasShadow() {\n return (this.shadowEnabled() &&\n this.shadowOpacity() !== 0 &&\n !!(this.shadowColor() ||\n this.shadowBlur() ||\n this.shadowOffsetX() ||\n this.shadowOffsetY()));\n }\n _getFillPattern() {\n return this._getCache(patternImage, this.__getFillPattern);\n }\n __getFillPattern() {\n if (this.fillPatternImage()) {\n var ctx = getDummyContext();\n const pattern = ctx.createPattern(this.fillPatternImage(), this.fillPatternRepeat() || 'repeat');\n if (pattern && pattern.setTransform) {\n const tr = new Util_1.Transform();\n tr.translate(this.fillPatternX(), this.fillPatternY());\n tr.rotate(Global_1.Konva.getAngle(this.fillPatternRotation()));\n tr.scale(this.fillPatternScaleX(), this.fillPatternScaleY());\n tr.translate(-1 * this.fillPatternOffsetX(), -1 * this.fillPatternOffsetY());\n const m = tr.getMatrix();\n const matrix = typeof DOMMatrix === 'undefined'\n ? {\n a: m[0],\n b: m[1],\n c: m[2],\n d: m[3],\n e: m[4],\n f: m[5],\n }\n : new DOMMatrix(m);\n pattern.setTransform(matrix);\n }\n return pattern;\n }\n }\n _getLinearGradient() {\n return this._getCache(linearGradient, this.__getLinearGradient);\n }\n __getLinearGradient() {\n var colorStops = this.fillLinearGradientColorStops();\n if (colorStops) {\n var ctx = getDummyContext();\n var start = this.fillLinearGradientStartPoint();\n var end = this.fillLinearGradientEndPoint();\n var grd = ctx.createLinearGradient(start.x, start.y, end.x, end.y);\n for (var n = 0; n < colorStops.length; n += 2) {\n grd.addColorStop(colorStops[n], colorStops[n + 1]);\n }\n return grd;\n }\n }\n _getRadialGradient() {\n return this._getCache(radialGradient, this.__getRadialGradient);\n }\n __getRadialGradient() {\n var colorStops = this.fillRadialGradientColorStops();\n if (colorStops) {\n var ctx = getDummyContext();\n var start = this.fillRadialGradientStartPoint();\n var end = this.fillRadialGradientEndPoint();\n var grd = ctx.createRadialGradient(start.x, start.y, this.fillRadialGradientStartRadius(), end.x, end.y, this.fillRadialGradientEndRadius());\n for (var n = 0; n < colorStops.length; n += 2) {\n grd.addColorStop(colorStops[n], colorStops[n + 1]);\n }\n return grd;\n }\n }\n getShadowRGBA() {\n return this._getCache(SHADOW_RGBA, this._getShadowRGBA);\n }\n _getShadowRGBA() {\n if (!this.hasShadow()) {\n return;\n }\n var rgba = Util_1.Util.colorToRGBA(this.shadowColor());\n if (rgba) {\n return ('rgba(' +\n rgba.r +\n ',' +\n rgba.g +\n ',' +\n rgba.b +\n ',' +\n rgba.a * (this.shadowOpacity() || 1) +\n ')');\n }\n }\n hasFill() {\n return this._calculate('hasFill', [\n 'fillEnabled',\n 'fill',\n 'fillPatternImage',\n 'fillLinearGradientColorStops',\n 'fillRadialGradientColorStops',\n ], () => {\n return (this.fillEnabled() &&\n !!(this.fill() ||\n this.fillPatternImage() ||\n this.fillLinearGradientColorStops() ||\n this.fillRadialGradientColorStops()));\n });\n }\n hasStroke() {\n return this._calculate('hasStroke', [\n 'strokeEnabled',\n 'strokeWidth',\n 'stroke',\n 'strokeLinearGradientColorStops',\n ], () => {\n return (this.strokeEnabled() &&\n this.strokeWidth() &&\n !!(this.stroke() || this.strokeLinearGradientColorStops()));\n });\n }\n hasHitStroke() {\n const width = this.hitStrokeWidth();\n if (width === 'auto') {\n return this.hasStroke();\n }\n return this.strokeEnabled() && !!width;\n }\n intersects(point) {\n var stage = this.getStage();\n if (!stage) {\n return false;\n }\n const bufferHitCanvas = stage.bufferHitCanvas;\n bufferHitCanvas.getContext().clear();\n this.drawHit(bufferHitCanvas, undefined, true);\n const p = bufferHitCanvas.context.getImageData(Math.round(point.x), Math.round(point.y), 1, 1).data;\n return p[3] > 0;\n }\n destroy() {\n Node_1.Node.prototype.destroy.call(this);\n delete exports.shapes[this.colorKey];\n delete this.colorKey;\n return this;\n }\n _useBufferCanvas(forceFill) {\n var _a;\n const perfectDrawEnabled = (_a = this.attrs.perfectDrawEnabled) !== null && _a !== void 0 ? _a : true;\n if (!perfectDrawEnabled) {\n return false;\n }\n const hasFill = forceFill || this.hasFill();\n const hasStroke = this.hasStroke();\n const isTransparent = this.getAbsoluteOpacity() !== 1;\n if (hasFill && hasStroke && isTransparent) {\n return true;\n }\n const hasShadow = this.hasShadow();\n const strokeForShadow = this.shadowForStrokeEnabled();\n if (hasFill && hasStroke && hasShadow && strokeForShadow) {\n return true;\n }\n return false;\n }\n setStrokeHitEnabled(val) {\n Util_1.Util.warn('strokeHitEnabled property is deprecated. Please use hitStrokeWidth instead.');\n if (val) {\n this.hitStrokeWidth('auto');\n }\n else {\n this.hitStrokeWidth(0);\n }\n }\n getStrokeHitEnabled() {\n if (this.hitStrokeWidth() === 0) {\n return false;\n }\n else {\n return true;\n }\n }\n getSelfRect() {\n var size = this.size();\n return {\n x: this._centroid ? -size.width / 2 : 0,\n y: this._centroid ? -size.height / 2 : 0,\n width: size.width,\n height: size.height,\n };\n }\n getClientRect(config = {}) {\n let hasCachedParent = false;\n let parent = this.getParent();\n while (parent) {\n if (parent.isCached()) {\n hasCachedParent = true;\n break;\n }\n parent = parent.getParent();\n }\n const skipTransform = config.skipTransform;\n const relativeTo = config.relativeTo || (hasCachedParent && this.getStage()) || undefined;\n const fillRect = this.getSelfRect();\n const applyStroke = !config.skipStroke && this.hasStroke();\n const strokeWidth = (applyStroke && this.strokeWidth()) || 0;\n const fillAndStrokeWidth = fillRect.width + strokeWidth;\n const fillAndStrokeHeight = fillRect.height + strokeWidth;\n const applyShadow = !config.skipShadow && this.hasShadow();\n const shadowOffsetX = applyShadow ? this.shadowOffsetX() : 0;\n const shadowOffsetY = applyShadow ? this.shadowOffsetY() : 0;\n const preWidth = fillAndStrokeWidth + Math.abs(shadowOffsetX);\n const preHeight = fillAndStrokeHeight + Math.abs(shadowOffsetY);\n const blurRadius = (applyShadow && this.shadowBlur()) || 0;\n const width = preWidth + blurRadius * 2;\n const height = preHeight + blurRadius * 2;\n const rect = {\n width: width,\n height: height,\n x: -(strokeWidth / 2 + blurRadius) +\n Math.min(shadowOffsetX, 0) +\n fillRect.x,\n y: -(strokeWidth / 2 + blurRadius) +\n Math.min(shadowOffsetY, 0) +\n fillRect.y,\n };\n if (!skipTransform) {\n return this._transformedRect(rect, relativeTo);\n }\n return rect;\n }\n drawScene(can, top, bufferCanvas) {\n var layer = this.getLayer();\n var canvas = can || layer.getCanvas(), context = canvas.getContext(), cachedCanvas = this._getCanvasCache(), drawFunc = this.getSceneFunc(), hasShadow = this.hasShadow(), stage, bufferContext;\n var skipBuffer = canvas.isCache;\n var cachingSelf = top === this;\n if (!this.isVisible() && !cachingSelf) {\n return this;\n }\n if (cachedCanvas) {\n context.save();\n var m = this.getAbsoluteTransform(top).getMatrix();\n context.transform(m[0], m[1], m[2], m[3], m[4], m[5]);\n this._drawCachedSceneCanvas(context);\n context.restore();\n return this;\n }\n if (!drawFunc) {\n return this;\n }\n context.save();\n if (this._useBufferCanvas() && !skipBuffer) {\n stage = this.getStage();\n const bc = bufferCanvas || stage.bufferCanvas;\n bufferContext = bc.getContext();\n bufferContext.clear();\n bufferContext.save();\n bufferContext._applyLineJoin(this);\n var o = this.getAbsoluteTransform(top).getMatrix();\n bufferContext.transform(o[0], o[1], o[2], o[3], o[4], o[5]);\n drawFunc.call(this, bufferContext, this);\n bufferContext.restore();\n var ratio = bc.pixelRatio;\n if (hasShadow) {\n context._applyShadow(this);\n }\n context._applyOpacity(this);\n context._applyGlobalCompositeOperation(this);\n context.drawImage(bc._canvas, 0, 0, bc.width / ratio, bc.height / ratio);\n }\n else {\n context._applyLineJoin(this);\n if (!cachingSelf) {\n var o = this.getAbsoluteTransform(top).getMatrix();\n context.transform(o[0], o[1], o[2], o[3], o[4], o[5]);\n context._applyOpacity(this);\n context._applyGlobalCompositeOperation(this);\n }\n if (hasShadow) {\n context._applyShadow(this);\n }\n drawFunc.call(this, context, this);\n }\n context.restore();\n return this;\n }\n drawHit(can, top, skipDragCheck = false) {\n if (!this.shouldDrawHit(top, skipDragCheck)) {\n return this;\n }\n var layer = this.getLayer(), canvas = can || layer.hitCanvas, context = canvas && canvas.getContext(), drawFunc = this.hitFunc() || this.sceneFunc(), cachedCanvas = this._getCanvasCache(), cachedHitCanvas = cachedCanvas && cachedCanvas.hit;\n if (!this.colorKey) {\n Util_1.Util.warn('Looks like your canvas has a destroyed shape in it. Do not reuse shape after you destroyed it. If you want to reuse shape you should call remove() instead of destroy()');\n }\n if (cachedHitCanvas) {\n context.save();\n var m = this.getAbsoluteTransform(top).getMatrix();\n context.transform(m[0], m[1], m[2], m[3], m[4], m[5]);\n this._drawCachedHitCanvas(context);\n context.restore();\n return this;\n }\n if (!drawFunc) {\n return this;\n }\n context.save();\n context._applyLineJoin(this);\n const selfCache = this === top;\n if (!selfCache) {\n var o = this.getAbsoluteTransform(top).getMatrix();\n context.transform(o[0], o[1], o[2], o[3], o[4], o[5]);\n }\n drawFunc.call(this, context, this);\n context.restore();\n return this;\n }\n drawHitFromCache(alphaThreshold = 0) {\n var cachedCanvas = this._getCanvasCache(), sceneCanvas = this._getCachedSceneCanvas(), hitCanvas = cachedCanvas.hit, hitContext = hitCanvas.getContext(), hitWidth = hitCanvas.getWidth(), hitHeight = hitCanvas.getHeight(), hitImageData, hitData, len, rgbColorKey, i, alpha;\n hitContext.clear();\n hitContext.drawImage(sceneCanvas._canvas, 0, 0, hitWidth, hitHeight);\n try {\n hitImageData = hitContext.getImageData(0, 0, hitWidth, hitHeight);\n hitData = hitImageData.data;\n len = hitData.length;\n rgbColorKey = Util_1.Util._hexToRgb(this.colorKey);\n for (i = 0; i < len; i += 4) {\n alpha = hitData[i + 3];\n if (alpha > alphaThreshold) {\n hitData[i] = rgbColorKey.r;\n hitData[i + 1] = rgbColorKey.g;\n hitData[i + 2] = rgbColorKey.b;\n hitData[i + 3] = 255;\n }\n else {\n hitData[i + 3] = 0;\n }\n }\n hitContext.putImageData(hitImageData, 0, 0);\n }\n catch (e) {\n Util_1.Util.error('Unable to draw hit graph from cached scene canvas. ' + e.message);\n }\n return this;\n }\n hasPointerCapture(pointerId) {\n return PointerEvents.hasPointerCapture(pointerId, this);\n }\n setPointerCapture(pointerId) {\n PointerEvents.setPointerCapture(pointerId, this);\n }\n releaseCapture(pointerId) {\n PointerEvents.releaseCapture(pointerId, this);\n }\n}\nexports.Shape = Shape;\nShape.prototype._fillFunc = _fillFunc;\nShape.prototype._strokeFunc = _strokeFunc;\nShape.prototype._fillFuncHit = _fillFuncHit;\nShape.prototype._strokeFuncHit = _strokeFuncHit;\nShape.prototype._centroid = false;\nShape.prototype.nodeType = 'Shape';\n(0, Global_2._registerNode)(Shape);\nShape.prototype.eventListeners = {};\nShape.prototype.on.call(Shape.prototype, 'shadowColorChange.konva shadowBlurChange.konva shadowOffsetChange.konva shadowOpacityChange.konva shadowEnabledChange.konva', _clearHasShadowCache);\nShape.prototype.on.call(Shape.prototype, 'shadowColorChange.konva shadowOpacityChange.konva shadowEnabledChange.konva', _clearGetShadowRGBACache);\nShape.prototype.on.call(Shape.prototype, 'fillPriorityChange.konva fillPatternImageChange.konva fillPatternRepeatChange.konva fillPatternScaleXChange.konva fillPatternScaleYChange.konva fillPatternOffsetXChange.konva fillPatternOffsetYChange.konva fillPatternXChange.konva fillPatternYChange.konva fillPatternRotationChange.konva', _clearFillPatternCache);\nShape.prototype.on.call(Shape.prototype, 'fillPriorityChange.konva fillLinearGradientColorStopsChange.konva fillLinearGradientStartPointXChange.konva fillLinearGradientStartPointYChange.konva fillLinearGradientEndPointXChange.konva fillLinearGradientEndPointYChange.konva', _clearLinearGradientCache);\nShape.prototype.on.call(Shape.prototype, 'fillPriorityChange.konva fillRadialGradientColorStopsChange.konva fillRadialGradientStartPointXChange.konva fillRadialGradientStartPointYChange.konva fillRadialGradientEndPointXChange.konva fillRadialGradientEndPointYChange.konva fillRadialGradientStartRadiusChange.konva fillRadialGradientEndRadiusChange.konva', _clearRadialGradientCache);\nFactory_1.Factory.addGetterSetter(Shape, 'stroke', undefined, (0, Validators_1.getStringOrGradientValidator)());\nFactory_1.Factory.addGetterSetter(Shape, 'strokeWidth', 2, (0, Validators_1.getNumberValidator)());\nFactory_1.Factory.addGetterSetter(Shape, 'fillAfterStrokeEnabled', false);\nFactory_1.Factory.addGetterSetter(Shape, 'hitStrokeWidth', 'auto', (0, Validators_1.getNumberOrAutoValidator)());\nFactory_1.Factory.addGetterSetter(Shape, 'strokeHitEnabled', true, (0, Validators_1.getBooleanValidator)());\nFactory_1.Factory.addGetterSetter(Shape, 'perfectDrawEnabled', true, (0, Validators_1.getBooleanValidator)());\nFactory_1.Factory.addGetterSetter(Shape, 'shadowForStrokeEnabled', true, (0, Validators_1.getBooleanValidator)());\nFactory_1.Factory.addGetterSetter(Shape, 'lineJoin');\nFactory_1.Factory.addGetterSetter(Shape, 'lineCap');\nFactory_1.Factory.addGetterSetter(Shape, 'sceneFunc');\nFactory_1.Factory.addGetterSetter(Shape, 'hitFunc');\nFactory_1.Factory.addGetterSetter(Shape, 'dash');\nFactory_1.Factory.addGetterSetter(Shape, 'dashOffset', 0, (0, Validators_1.getNumberValidator)());\nFactory_1.Factory.addGetterSetter(Shape, 'shadowColor', undefined, (0, Validators_1.getStringValidator)());\nFactory_1.Factory.addGetterSetter(Shape, 'shadowBlur', 0, (0, Validators_1.getNumberValidator)());\nFactory_1.Factory.addGetterSetter(Shape, 'shadowOpacity', 1, (0, Validators_1.getNumberValidator)());\nFactory_1.Factory.addComponentsGetterSetter(Shape, 'shadowOffset', ['x', 'y']);\nFactory_1.Factory.addGetterSetter(Shape, 'shadowOffsetX', 0, (0, Validators_1.getNumberValidator)());\nFactory_1.Factory.addGetterSetter(Shape, 'shadowOffsetY', 0, (0, Validators_1.getNumberValidator)());\nFactory_1.Factory.addGetterSetter(Shape, 'fillPatternImage');\nFactory_1.Factory.addGetterSetter(Shape, 'fill', undefined, (0, Validators_1.getStringOrGradientValidator)());\nFactory_1.Factory.addGetterSetter(Shape, 'fillPatternX', 0, (0, Validators_1.getNumberValidator)());\nFactory_1.Factory.addGetterSetter(Shape, 'fillPatternY', 0, (0, Validators_1.getNumberValidator)());\nFactory_1.Factory.addGetterSetter(Shape, 'fillLinearGradientColorStops');\nFactory_1.Factory.addGetterSetter(Shape, 'strokeLinearGradientColorStops');\nFactory_1.Factory.addGetterSetter(Shape, 'fillRadialGradientStartRadius', 0);\nFactory_1.Factory.addGetterSetter(Shape, 'fillRadialGradientEndRadius', 0);\nFactory_1.Factory.addGetterSetter(Shape, 'fillRadialGradientColorStops');\nFactory_1.Factory.addGetterSetter(Shape, 'fillPatternRepeat', 'repeat');\nFactory_1.Factory.addGetterSetter(Shape, 'fillEnabled', true);\nFactory_1.Factory.addGetterSetter(Shape, 'strokeEnabled', true);\nFactory_1.Factory.addGetterSetter(Shape, 'shadowEnabled', true);\nFactory_1.Factory.addGetterSetter(Shape, 'dashEnabled', true);\nFactory_1.Factory.addGetterSetter(Shape, 'strokeScaleEnabled', true);\nFactory_1.Factory.addGetterSetter(Shape, 'fillPriority', 'color');\nFactory_1.Factory.addComponentsGetterSetter(Shape, 'fillPatternOffset', ['x', 'y']);\nFactory_1.Factory.addGetterSetter(Shape, 'fillPatternOffsetX', 0, (0, Validators_1.getNumberValidator)());\nFactory_1.Factory.addGetterSetter(Shape, 'fillPatternOffsetY', 0, (0, Validators_1.getNumberValidator)());\nFactory_1.Factory.addComponentsGetterSetter(Shape, 'fillPatternScale', ['x', 'y']);\nFactory_1.Factory.addGetterSetter(Shape, 'fillPatternScaleX', 1, (0, Validators_1.getNumberValidator)());\nFactory_1.Factory.addGetterSetter(Shape, 'fillPatternScaleY', 1, (0, Validators_1.getNumberValidator)());\nFactory_1.Factory.addComponentsGetterSetter(Shape, 'fillLinearGradientStartPoint', [\n 'x',\n 'y',\n]);\nFactory_1.Factory.addComponentsGetterSetter(Shape, 'strokeLinearGradientStartPoint', [\n 'x',\n 'y',\n]);\nFactory_1.Factory.addGetterSetter(Shape, 'fillLinearGradientStartPointX', 0);\nFactory_1.Factory.addGetterSetter(Shape, 'strokeLinearGradientStartPointX', 0);\nFactory_1.Factory.addGetterSetter(Shape, 'fillLinearGradientStartPointY', 0);\nFactory_1.Factory.addGetterSetter(Shape, 'strokeLinearGradientStartPointY', 0);\nFactory_1.Factory.addComponentsGetterSetter(Shape, 'fillLinearGradientEndPoint', [\n 'x',\n 'y',\n]);\nFactory_1.Factory.addComponentsGetterSetter(Shape, 'strokeLinearGradientEndPoint', [\n 'x',\n 'y',\n]);\nFactory_1.Factory.addGetterSetter(Shape, 'fillLinearGradientEndPointX', 0);\nFactory_1.Factory.addGetterSetter(Shape, 'strokeLinearGradientEndPointX', 0);\nFactory_1.Factory.addGetterSetter(Shape, 'fillLinearGradientEndPointY', 0);\nFactory_1.Factory.addGetterSetter(Shape, 'strokeLinearGradientEndPointY', 0);\nFactory_1.Factory.addComponentsGetterSetter(Shape, 'fillRadialGradientStartPoint', [\n 'x',\n 'y',\n]);\nFactory_1.Factory.addGetterSetter(Shape, 'fillRadialGradientStartPointX', 0);\nFactory_1.Factory.addGetterSetter(Shape, 'fillRadialGradientStartPointY', 0);\nFactory_1.Factory.addComponentsGetterSetter(Shape, 'fillRadialGradientEndPoint', [\n 'x',\n 'y',\n]);\nFactory_1.Factory.addGetterSetter(Shape, 'fillRadialGradientEndPointX', 0);\nFactory_1.Factory.addGetterSetter(Shape, 'fillRadialGradientEndPointY', 0);\nFactory_1.Factory.addGetterSetter(Shape, 'fillPatternRotation', 0);\nFactory_1.Factory.addGetterSetter(Shape, 'fillRule', undefined, (0, Validators_1.getStringValidator)());\nFactory_1.Factory.backCompat(Shape, {\n dashArray: 'dash',\n getDashArray: 'getDash',\n setDashArray: 'getDash',\n drawFunc: 'sceneFunc',\n getDrawFunc: 'getSceneFunc',\n setDrawFunc: 'setSceneFunc',\n drawHitFunc: 'hitFunc',\n getDrawHitFunc: 'getHitFunc',\n setDrawHitFunc: 'setHitFunc',\n});\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Layer = void 0;\nconst Util_1 = require(\"./Util\");\nconst Container_1 = require(\"./Container\");\nconst Node_1 = require(\"./Node\");\nconst Factory_1 = require(\"./Factory\");\nconst Canvas_1 = require(\"./Canvas\");\nconst Validators_1 = require(\"./Validators\");\nconst Shape_1 = require(\"./Shape\");\nconst Global_1 = require(\"./Global\");\nvar HASH = '#', BEFORE_DRAW = 'beforeDraw', DRAW = 'draw', INTERSECTION_OFFSETS = [\n { x: 0, y: 0 },\n { x: -1, y: -1 },\n { x: 1, y: -1 },\n { x: 1, y: 1 },\n { x: -1, y: 1 },\n], INTERSECTION_OFFSETS_LEN = INTERSECTION_OFFSETS.length;\nclass Layer extends Container_1.Container {\n constructor(config) {\n super(config);\n this.canvas = new Canvas_1.SceneCanvas();\n this.hitCanvas = new Canvas_1.HitCanvas({\n pixelRatio: 1,\n });\n this._waitingForDraw = false;\n this.on('visibleChange.konva', this._checkVisibility);\n this._checkVisibility();\n this.on('imageSmoothingEnabledChange.konva', this._setSmoothEnabled);\n this._setSmoothEnabled();\n }\n createPNGStream() {\n const c = this.canvas._canvas;\n return c.createPNGStream();\n }\n getCanvas() {\n return this.canvas;\n }\n getNativeCanvasElement() {\n return this.canvas._canvas;\n }\n getHitCanvas() {\n return this.hitCanvas;\n }\n getContext() {\n return this.getCanvas().getContext();\n }\n clear(bounds) {\n this.getContext().clear(bounds);\n this.getHitCanvas().getContext().clear(bounds);\n return this;\n }\n setZIndex(index) {\n super.setZIndex(index);\n var stage = this.getStage();\n if (stage && stage.content) {\n stage.content.removeChild(this.getNativeCanvasElement());\n if (index < stage.children.length - 1) {\n stage.content.insertBefore(this.getNativeCanvasElement(), stage.children[index + 1].getCanvas()._canvas);\n }\n else {\n stage.content.appendChild(this.getNativeCanvasElement());\n }\n }\n return this;\n }\n moveToTop() {\n Node_1.Node.prototype.moveToTop.call(this);\n var stage = this.getStage();\n if (stage && stage.content) {\n stage.content.removeChild(this.getNativeCanvasElement());\n stage.content.appendChild(this.getNativeCanvasElement());\n }\n return true;\n }\n moveUp() {\n var moved = Node_1.Node.prototype.moveUp.call(this);\n if (!moved) {\n return false;\n }\n var stage = this.getStage();\n if (!stage || !stage.content) {\n return false;\n }\n stage.content.removeChild(this.getNativeCanvasElement());\n if (this.index < stage.children.length - 1) {\n stage.content.insertBefore(this.getNativeCanvasElement(), stage.children[this.index + 1].getCanvas()._canvas);\n }\n else {\n stage.content.appendChild(this.getNativeCanvasElement());\n }\n return true;\n }\n moveDown() {\n if (Node_1.Node.prototype.moveDown.call(this)) {\n var stage = this.getStage();\n if (stage) {\n var children = stage.children;\n if (stage.content) {\n stage.content.removeChild(this.getNativeCanvasElement());\n stage.content.insertBefore(this.getNativeCanvasElement(), children[this.index + 1].getCanvas()._canvas);\n }\n }\n return true;\n }\n return false;\n }\n moveToBottom() {\n if (Node_1.Node.prototype.moveToBottom.call(this)) {\n var stage = this.getStage();\n if (stage) {\n var children = stage.children;\n if (stage.content) {\n stage.content.removeChild(this.getNativeCanvasElement());\n stage.content.insertBefore(this.getNativeCanvasElement(), children[1].getCanvas()._canvas);\n }\n }\n return true;\n }\n return false;\n }\n getLayer() {\n return this;\n }\n remove() {\n var _canvas = this.getNativeCanvasElement();\n Node_1.Node.prototype.remove.call(this);\n if (_canvas && _canvas.parentNode && Util_1.Util._isInDocument(_canvas)) {\n _canvas.parentNode.removeChild(_canvas);\n }\n return this;\n }\n getStage() {\n return this.parent;\n }\n setSize({ width, height }) {\n this.canvas.setSize(width, height);\n this.hitCanvas.setSize(width, height);\n this._setSmoothEnabled();\n return this;\n }\n _validateAdd(child) {\n var type = child.getType();\n if (type !== 'Group' && type !== 'Shape') {\n Util_1.Util.throw('You may only add groups and shapes to a layer.');\n }\n }\n _toKonvaCanvas(config) {\n config = config || {};\n config.width = config.width || this.getWidth();\n config.height = config.height || this.getHeight();\n config.x = config.x !== undefined ? config.x : this.x();\n config.y = config.y !== undefined ? config.y : this.y();\n return Node_1.Node.prototype._toKonvaCanvas.call(this, config);\n }\n _checkVisibility() {\n const visible = this.visible();\n if (visible) {\n this.canvas._canvas.style.display = 'block';\n }\n else {\n this.canvas._canvas.style.display = 'none';\n }\n }\n _setSmoothEnabled() {\n this.getContext()._context.imageSmoothingEnabled =\n this.imageSmoothingEnabled();\n }\n getWidth() {\n if (this.parent) {\n return this.parent.width();\n }\n }\n setWidth() {\n Util_1.Util.warn('Can not change width of layer. Use \"stage.width(value)\" function instead.');\n }\n getHeight() {\n if (this.parent) {\n return this.parent.height();\n }\n }\n setHeight() {\n Util_1.Util.warn('Can not change height of layer. Use \"stage.height(value)\" function instead.');\n }\n batchDraw() {\n if (!this._waitingForDraw) {\n this._waitingForDraw = true;\n Util_1.Util.requestAnimFrame(() => {\n this.draw();\n this._waitingForDraw = false;\n });\n }\n return this;\n }\n getIntersection(pos) {\n if (!this.isListening() || !this.isVisible()) {\n return null;\n }\n var spiralSearchDistance = 1;\n var continueSearch = false;\n while (true) {\n for (let i = 0; i < INTERSECTION_OFFSETS_LEN; i++) {\n const intersectionOffset = INTERSECTION_OFFSETS[i];\n const obj = this._getIntersection({\n x: pos.x + intersectionOffset.x * spiralSearchDistance,\n y: pos.y + intersectionOffset.y * spiralSearchDistance,\n });\n const shape = obj.shape;\n if (shape) {\n return shape;\n }\n continueSearch = !!obj.antialiased;\n if (!obj.antialiased) {\n break;\n }\n }\n if (continueSearch) {\n spiralSearchDistance += 1;\n }\n else {\n return null;\n }\n }\n }\n _getIntersection(pos) {\n const ratio = this.hitCanvas.pixelRatio;\n const p = this.hitCanvas.context.getImageData(Math.round(pos.x * ratio), Math.round(pos.y * ratio), 1, 1).data;\n const p3 = p[3];\n if (p3 === 255) {\n const colorKey = Util_1.Util._rgbToHex(p[0], p[1], p[2]);\n const shape = Shape_1.shapes[HASH + colorKey];\n if (shape) {\n return {\n shape: shape,\n };\n }\n return {\n antialiased: true,\n };\n }\n else if (p3 > 0) {\n return {\n antialiased: true,\n };\n }\n return {};\n }\n drawScene(can, top) {\n var layer = this.getLayer(), canvas = can || (layer && layer.getCanvas());\n this._fire(BEFORE_DRAW, {\n node: this,\n });\n if (this.clearBeforeDraw()) {\n canvas.getContext().clear();\n }\n Container_1.Container.prototype.drawScene.call(this, canvas, top);\n this._fire(DRAW, {\n node: this,\n });\n return this;\n }\n drawHit(can, top) {\n var layer = this.getLayer(), canvas = can || (layer && layer.hitCanvas);\n if (layer && layer.clearBeforeDraw()) {\n layer.getHitCanvas().getContext().clear();\n }\n Container_1.Container.prototype.drawHit.call(this, canvas, top);\n return this;\n }\n enableHitGraph() {\n this.hitGraphEnabled(true);\n return this;\n }\n disableHitGraph() {\n this.hitGraphEnabled(false);\n return this;\n }\n setHitGraphEnabled(val) {\n Util_1.Util.warn('hitGraphEnabled method is deprecated. Please use layer.listening() instead.');\n this.listening(val);\n }\n getHitGraphEnabled(val) {\n Util_1.Util.warn('hitGraphEnabled method is deprecated. Please use layer.listening() instead.');\n return this.listening();\n }\n toggleHitCanvas() {\n if (!this.parent || !this.parent['content']) {\n return;\n }\n var parent = this.parent;\n var added = !!this.hitCanvas._canvas.parentNode;\n if (added) {\n parent.content.removeChild(this.hitCanvas._canvas);\n }\n else {\n parent.content.appendChild(this.hitCanvas._canvas);\n }\n }\n destroy() {\n Util_1.Util.releaseCanvas(this.getNativeCanvasElement(), this.getHitCanvas()._canvas);\n return super.destroy();\n }\n}\nexports.Layer = Layer;\nLayer.prototype.nodeType = 'Layer';\n(0, Global_1._registerNode)(Layer);\nFactory_1.Factory.addGetterSetter(Layer, 'imageSmoothingEnabled', true);\nFactory_1.Factory.addGetterSetter(Layer, 'clearBeforeDraw', true);\nFactory_1.Factory.addGetterSetter(Layer, 'hitGraphEnabled', true, (0, Validators_1.getBooleanValidator)());\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.FastLayer = void 0;\nconst Util_1 = require(\"./Util\");\nconst Layer_1 = require(\"./Layer\");\nconst Global_1 = require(\"./Global\");\nclass FastLayer extends Layer_1.Layer {\n constructor(attrs) {\n super(attrs);\n this.listening(false);\n Util_1.Util.warn('Konva.Fast layer is deprecated. Please use \"new Konva.Layer({ listening: false })\" instead.');\n }\n}\nexports.FastLayer = FastLayer;\nFastLayer.prototype.nodeType = 'FastLayer';\n(0, Global_1._registerNode)(FastLayer);\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Group = void 0;\nconst Util_1 = require(\"./Util\");\nconst Container_1 = require(\"./Container\");\nconst Global_1 = require(\"./Global\");\nclass Group extends Container_1.Container {\n _validateAdd(child) {\n var type = child.getType();\n if (type !== 'Group' && type !== 'Shape') {\n Util_1.Util.throw('You may only add groups and shapes to groups.');\n }\n }\n}\nexports.Group = Group;\nGroup.prototype.nodeType = 'Group';\n(0, Global_1._registerNode)(Group);\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Animation = void 0;\nconst Global_1 = require(\"./Global\");\nconst Util_1 = require(\"./Util\");\nconst now = (function () {\n if (Global_1.glob.performance && Global_1.glob.performance.now) {\n return function () {\n return Global_1.glob.performance.now();\n };\n }\n return function () {\n return new Date().getTime();\n };\n})();\nclass Animation {\n constructor(func, layers) {\n this.id = Animation.animIdCounter++;\n this.frame = {\n time: 0,\n timeDiff: 0,\n lastTime: now(),\n frameRate: 0,\n };\n this.func = func;\n this.setLayers(layers);\n }\n setLayers(layers) {\n let lays = [];\n if (layers) {\n lays = Array.isArray(layers) ? layers : [layers];\n }\n this.layers = lays;\n return this;\n }\n getLayers() {\n return this.layers;\n }\n addLayer(layer) {\n const layers = this.layers;\n const len = layers.length;\n for (let n = 0; n < len; n++) {\n if (layers[n]._id === layer._id) {\n return false;\n }\n }\n this.layers.push(layer);\n return true;\n }\n isRunning() {\n const a = Animation;\n const animations = a.animations;\n const len = animations.length;\n for (let n = 0; n < len; n++) {\n if (animations[n].id === this.id) {\n return true;\n }\n }\n return false;\n }\n start() {\n this.stop();\n this.frame.timeDiff = 0;\n this.frame.lastTime = now();\n Animation._addAnimation(this);\n return this;\n }\n stop() {\n Animation._removeAnimation(this);\n return this;\n }\n _updateFrameObject(time) {\n this.frame.timeDiff = time - this.frame.lastTime;\n this.frame.lastTime = time;\n this.frame.time += this.frame.timeDiff;\n this.frame.frameRate = 1000 / this.frame.timeDiff;\n }\n static _addAnimation(anim) {\n this.animations.push(anim);\n this._handleAnimation();\n }\n static _removeAnimation(anim) {\n const id = anim.id;\n const animations = this.animations;\n const len = animations.length;\n for (let n = 0; n < len; n++) {\n if (animations[n].id === id) {\n this.animations.splice(n, 1);\n break;\n }\n }\n }\n static _runFrames() {\n const layerHash = {};\n const animations = this.animations;\n for (let n = 0; n < animations.length; n++) {\n const anim = animations[n];\n const layers = anim.layers;\n const func = anim.func;\n anim._updateFrameObject(now());\n const layersLen = layers.length;\n let needRedraw;\n if (func) {\n needRedraw = func.call(anim, anim.frame) !== false;\n }\n else {\n needRedraw = true;\n }\n if (!needRedraw) {\n continue;\n }\n for (let i = 0; i < layersLen; i++) {\n const layer = layers[i];\n if (layer._id !== undefined) {\n layerHash[layer._id] = layer;\n }\n }\n }\n for (let key in layerHash) {\n if (!layerHash.hasOwnProperty(key)) {\n continue;\n }\n layerHash[key].batchDraw();\n }\n }\n static _animationLoop() {\n const Anim = Animation;\n if (Anim.animations.length) {\n Anim._runFrames();\n Util_1.Util.requestAnimFrame(Anim._animationLoop);\n }\n else {\n Anim.animRunning = false;\n }\n }\n static _handleAnimation() {\n if (!this.animRunning) {\n this.animRunning = true;\n Util_1.Util.requestAnimFrame(this._animationLoop);\n }\n }\n}\nexports.Animation = Animation;\nAnimation.animations = [];\nAnimation.animIdCounter = 0;\nAnimation.animRunning = false;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Easings = exports.Tween = void 0;\nconst Util_1 = require(\"./Util\");\nconst Animation_1 = require(\"./Animation\");\nconst Node_1 = require(\"./Node\");\nconst Global_1 = require(\"./Global\");\nvar blacklist = {\n node: 1,\n duration: 1,\n easing: 1,\n onFinish: 1,\n yoyo: 1,\n}, PAUSED = 1, PLAYING = 2, REVERSING = 3, idCounter = 0, colorAttrs = ['fill', 'stroke', 'shadowColor'];\nclass TweenEngine {\n constructor(prop, propFunc, func, begin, finish, duration, yoyo) {\n this.prop = prop;\n this.propFunc = propFunc;\n this.begin = begin;\n this._pos = begin;\n this.duration = duration;\n this._change = 0;\n this.prevPos = 0;\n this.yoyo = yoyo;\n this._time = 0;\n this._position = 0;\n this._startTime = 0;\n this._finish = 0;\n this.func = func;\n this._change = finish - this.begin;\n this.pause();\n }\n fire(str) {\n var handler = this[str];\n if (handler) {\n handler();\n }\n }\n setTime(t) {\n if (t > this.duration) {\n if (this.yoyo) {\n this._time = this.duration;\n this.reverse();\n }\n else {\n this.finish();\n }\n }\n else if (t < 0) {\n if (this.yoyo) {\n this._time = 0;\n this.play();\n }\n else {\n this.reset();\n }\n }\n else {\n this._time = t;\n this.update();\n }\n }\n getTime() {\n return this._time;\n }\n setPosition(p) {\n this.prevPos = this._pos;\n this.propFunc(p);\n this._pos = p;\n }\n getPosition(t) {\n if (t === undefined) {\n t = this._time;\n }\n return this.func(t, this.begin, this._change, this.duration);\n }\n play() {\n this.state = PLAYING;\n this._startTime = this.getTimer() - this._time;\n this.onEnterFrame();\n this.fire('onPlay');\n }\n reverse() {\n this.state = REVERSING;\n this._time = this.duration - this._time;\n this._startTime = this.getTimer() - this._time;\n this.onEnterFrame();\n this.fire('onReverse');\n }\n seek(t) {\n this.pause();\n this._time = t;\n this.update();\n this.fire('onSeek');\n }\n reset() {\n this.pause();\n this._time = 0;\n this.update();\n this.fire('onReset');\n }\n finish() {\n this.pause();\n this._time = this.duration;\n this.update();\n this.fire('onFinish');\n }\n update() {\n this.setPosition(this.getPosition(this._time));\n this.fire('onUpdate');\n }\n onEnterFrame() {\n var t = this.getTimer() - this._startTime;\n if (this.state === PLAYING) {\n this.setTime(t);\n }\n else if (this.state === REVERSING) {\n this.setTime(this.duration - t);\n }\n }\n pause() {\n this.state = PAUSED;\n this.fire('onPause');\n }\n getTimer() {\n return new Date().getTime();\n }\n}\nclass Tween {\n constructor(config) {\n var that = this, node = config.node, nodeId = node._id, duration, easing = config.easing || exports.Easings.Linear, yoyo = !!config.yoyo, key;\n if (typeof config.duration === 'undefined') {\n duration = 0.3;\n }\n else if (config.duration === 0) {\n duration = 0.001;\n }\n else {\n duration = config.duration;\n }\n this.node = node;\n this._id = idCounter++;\n var layers = node.getLayer() ||\n (node instanceof Global_1.Konva['Stage'] ? node.getLayers() : null);\n if (!layers) {\n Util_1.Util.error('Tween constructor have `node` that is not in a layer. Please add node into layer first.');\n }\n this.anim = new Animation_1.Animation(function () {\n that.tween.onEnterFrame();\n }, layers);\n this.tween = new TweenEngine(key, function (i) {\n that._tweenFunc(i);\n }, easing, 0, 1, duration * 1000, yoyo);\n this._addListeners();\n if (!Tween.attrs[nodeId]) {\n Tween.attrs[nodeId] = {};\n }\n if (!Tween.attrs[nodeId][this._id]) {\n Tween.attrs[nodeId][this._id] = {};\n }\n if (!Tween.tweens[nodeId]) {\n Tween.tweens[nodeId] = {};\n }\n for (key in config) {\n if (blacklist[key] === undefined) {\n this._addAttr(key, config[key]);\n }\n }\n this.reset();\n this.onFinish = config.onFinish;\n this.onReset = config.onReset;\n this.onUpdate = config.onUpdate;\n }\n _addAttr(key, end) {\n var node = this.node, nodeId = node._id, start, diff, tweenId, n, len, trueEnd, trueStart, endRGBA;\n tweenId = Tween.tweens[nodeId][key];\n if (tweenId) {\n delete Tween.attrs[nodeId][tweenId][key];\n }\n start = node.getAttr(key);\n if (Util_1.Util._isArray(end)) {\n diff = [];\n len = Math.max(end.length, start.length);\n if (key === 'points' && end.length !== start.length) {\n if (end.length > start.length) {\n trueStart = start;\n start = Util_1.Util._prepareArrayForTween(start, end, node.closed());\n }\n else {\n trueEnd = end;\n end = Util_1.Util._prepareArrayForTween(end, start, node.closed());\n }\n }\n if (key.indexOf('fill') === 0) {\n for (n = 0; n < len; n++) {\n if (n % 2 === 0) {\n diff.push(end[n] - start[n]);\n }\n else {\n var startRGBA = Util_1.Util.colorToRGBA(start[n]);\n endRGBA = Util_1.Util.colorToRGBA(end[n]);\n start[n] = startRGBA;\n diff.push({\n r: endRGBA.r - startRGBA.r,\n g: endRGBA.g - startRGBA.g,\n b: endRGBA.b - startRGBA.b,\n a: endRGBA.a - startRGBA.a,\n });\n }\n }\n }\n else {\n for (n = 0; n < len; n++) {\n diff.push(end[n] - start[n]);\n }\n }\n }\n else if (colorAttrs.indexOf(key) !== -1) {\n start = Util_1.Util.colorToRGBA(start);\n endRGBA = Util_1.Util.colorToRGBA(end);\n diff = {\n r: endRGBA.r - start.r,\n g: endRGBA.g - start.g,\n b: endRGBA.b - start.b,\n a: endRGBA.a - start.a,\n };\n }\n else {\n diff = end - start;\n }\n Tween.attrs[nodeId][this._id][key] = {\n start: start,\n diff: diff,\n end: end,\n trueEnd: trueEnd,\n trueStart: trueStart,\n };\n Tween.tweens[nodeId][key] = this._id;\n }\n _tweenFunc(i) {\n var node = this.node, attrs = Tween.attrs[node._id][this._id], key, attr, start, diff, newVal, n, len, end;\n for (key in attrs) {\n attr = attrs[key];\n start = attr.start;\n diff = attr.diff;\n end = attr.end;\n if (Util_1.Util._isArray(start)) {\n newVal = [];\n len = Math.max(start.length, end.length);\n if (key.indexOf('fill') === 0) {\n for (n = 0; n < len; n++) {\n if (n % 2 === 0) {\n newVal.push((start[n] || 0) + diff[n] * i);\n }\n else {\n newVal.push('rgba(' +\n Math.round(start[n].r + diff[n].r * i) +\n ',' +\n Math.round(start[n].g + diff[n].g * i) +\n ',' +\n Math.round(start[n].b + diff[n].b * i) +\n ',' +\n (start[n].a + diff[n].a * i) +\n ')');\n }\n }\n }\n else {\n for (n = 0; n < len; n++) {\n newVal.push((start[n] || 0) + diff[n] * i);\n }\n }\n }\n else if (colorAttrs.indexOf(key) !== -1) {\n newVal =\n 'rgba(' +\n Math.round(start.r + diff.r * i) +\n ',' +\n Math.round(start.g + diff.g * i) +\n ',' +\n Math.round(start.b + diff.b * i) +\n ',' +\n (start.a + diff.a * i) +\n ')';\n }\n else {\n newVal = start + diff * i;\n }\n node.setAttr(key, newVal);\n }\n }\n _addListeners() {\n this.tween.onPlay = () => {\n this.anim.start();\n };\n this.tween.onReverse = () => {\n this.anim.start();\n };\n this.tween.onPause = () => {\n this.anim.stop();\n };\n this.tween.onFinish = () => {\n var node = this.node;\n var attrs = Tween.attrs[node._id][this._id];\n if (attrs.points && attrs.points.trueEnd) {\n node.setAttr('points', attrs.points.trueEnd);\n }\n if (this.onFinish) {\n this.onFinish.call(this);\n }\n };\n this.tween.onReset = () => {\n var node = this.node;\n var attrs = Tween.attrs[node._id][this._id];\n if (attrs.points && attrs.points.trueStart) {\n node.points(attrs.points.trueStart);\n }\n if (this.onReset) {\n this.onReset();\n }\n };\n this.tween.onUpdate = () => {\n if (this.onUpdate) {\n this.onUpdate.call(this);\n }\n };\n }\n play() {\n this.tween.play();\n return this;\n }\n reverse() {\n this.tween.reverse();\n return this;\n }\n reset() {\n this.tween.reset();\n return this;\n }\n seek(t) {\n this.tween.seek(t * 1000);\n return this;\n }\n pause() {\n this.tween.pause();\n return this;\n }\n finish() {\n this.tween.finish();\n return this;\n }\n destroy() {\n var nodeId = this.node._id, thisId = this._id, attrs = Tween.tweens[nodeId], key;\n this.pause();\n for (key in attrs) {\n delete Tween.tweens[nodeId][key];\n }\n delete Tween.attrs[nodeId][thisId];\n }\n}\nexports.Tween = Tween;\nTween.attrs = {};\nTween.tweens = {};\nNode_1.Node.prototype.to = function (params) {\n var onFinish = params.onFinish;\n params.node = this;\n params.onFinish = function () {\n this.destroy();\n if (onFinish) {\n onFinish();\n }\n };\n var tween = new Tween(params);\n tween.play();\n};\nexports.Easings = {\n BackEaseIn(t, b, c, d) {\n var s = 1.70158;\n return c * (t /= d) * t * ((s + 1) * t - s) + b;\n },\n BackEaseOut(t, b, c, d) {\n var s = 1.70158;\n return c * ((t = t / d - 1) * t * ((s + 1) * t + s) + 1) + b;\n },\n BackEaseInOut(t, b, c, d) {\n var s = 1.70158;\n if ((t /= d / 2) < 1) {\n return (c / 2) * (t * t * (((s *= 1.525) + 1) * t - s)) + b;\n }\n return (c / 2) * ((t -= 2) * t * (((s *= 1.525) + 1) * t + s) + 2) + b;\n },\n ElasticEaseIn(t, b, c, d, a, p) {\n var s = 0;\n if (t === 0) {\n return b;\n }\n if ((t /= d) === 1) {\n return b + c;\n }\n if (!p) {\n p = d * 0.3;\n }\n if (!a || a < Math.abs(c)) {\n a = c;\n s = p / 4;\n }\n else {\n s = (p / (2 * Math.PI)) * Math.asin(c / a);\n }\n return (-(a *\n Math.pow(2, 10 * (t -= 1)) *\n Math.sin(((t * d - s) * (2 * Math.PI)) / p)) + b);\n },\n ElasticEaseOut(t, b, c, d, a, p) {\n var s = 0;\n if (t === 0) {\n return b;\n }\n if ((t /= d) === 1) {\n return b + c;\n }\n if (!p) {\n p = d * 0.3;\n }\n if (!a || a < Math.abs(c)) {\n a = c;\n s = p / 4;\n }\n else {\n s = (p / (2 * Math.PI)) * Math.asin(c / a);\n }\n return (a * Math.pow(2, -10 * t) * Math.sin(((t * d - s) * (2 * Math.PI)) / p) +\n c +\n b);\n },\n ElasticEaseInOut(t, b, c, d, a, p) {\n var s = 0;\n if (t === 0) {\n return b;\n }\n if ((t /= d / 2) === 2) {\n return b + c;\n }\n if (!p) {\n p = d * (0.3 * 1.5);\n }\n if (!a || a < Math.abs(c)) {\n a = c;\n s = p / 4;\n }\n else {\n s = (p / (2 * Math.PI)) * Math.asin(c / a);\n }\n if (t < 1) {\n return (-0.5 *\n (a *\n Math.pow(2, 10 * (t -= 1)) *\n Math.sin(((t * d - s) * (2 * Math.PI)) / p)) +\n b);\n }\n return (a *\n Math.pow(2, -10 * (t -= 1)) *\n Math.sin(((t * d - s) * (2 * Math.PI)) / p) *\n 0.5 +\n c +\n b);\n },\n BounceEaseOut(t, b, c, d) {\n if ((t /= d) < 1 / 2.75) {\n return c * (7.5625 * t * t) + b;\n }\n else if (t < 2 / 2.75) {\n return c * (7.5625 * (t -= 1.5 / 2.75) * t + 0.75) + b;\n }\n else if (t < 2.5 / 2.75) {\n return c * (7.5625 * (t -= 2.25 / 2.75) * t + 0.9375) + b;\n }\n else {\n return c * (7.5625 * (t -= 2.625 / 2.75) * t + 0.984375) + b;\n }\n },\n BounceEaseIn(t, b, c, d) {\n return c - exports.Easings.BounceEaseOut(d - t, 0, c, d) + b;\n },\n BounceEaseInOut(t, b, c, d) {\n if (t < d / 2) {\n return exports.Easings.BounceEaseIn(t * 2, 0, c, d) * 0.5 + b;\n }\n else {\n return exports.Easings.BounceEaseOut(t * 2 - d, 0, c, d) * 0.5 + c * 0.5 + b;\n }\n },\n EaseIn(t, b, c, d) {\n return c * (t /= d) * t + b;\n },\n EaseOut(t, b, c, d) {\n return -c * (t /= d) * (t - 2) + b;\n },\n EaseInOut(t, b, c, d) {\n if ((t /= d / 2) < 1) {\n return (c / 2) * t * t + b;\n }\n return (-c / 2) * (--t * (t - 2) - 1) + b;\n },\n StrongEaseIn(t, b, c, d) {\n return c * (t /= d) * t * t * t * t + b;\n },\n StrongEaseOut(t, b, c, d) {\n return c * ((t = t / d - 1) * t * t * t * t + 1) + b;\n },\n StrongEaseInOut(t, b, c, d) {\n if ((t /= d / 2) < 1) {\n return (c / 2) * t * t * t * t * t + b;\n }\n return (c / 2) * ((t -= 2) * t * t * t * t + 2) + b;\n },\n Linear(t, b, c, d) {\n return (c * t) / d + b;\n },\n};\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Konva = void 0;\nconst Global_1 = require(\"./Global\");\nconst Util_1 = require(\"./Util\");\nconst Node_1 = require(\"./Node\");\nconst Container_1 = require(\"./Container\");\nconst Stage_1 = require(\"./Stage\");\nconst Layer_1 = require(\"./Layer\");\nconst FastLayer_1 = require(\"./FastLayer\");\nconst Group_1 = require(\"./Group\");\nconst DragAndDrop_1 = require(\"./DragAndDrop\");\nconst Shape_1 = require(\"./Shape\");\nconst Animation_1 = require(\"./Animation\");\nconst Tween_1 = require(\"./Tween\");\nconst Context_1 = require(\"./Context\");\nconst Canvas_1 = require(\"./Canvas\");\nexports.Konva = Util_1.Util._assign(Global_1.Konva, {\n Util: Util_1.Util,\n Transform: Util_1.Transform,\n Node: Node_1.Node,\n Container: Container_1.Container,\n Stage: Stage_1.Stage,\n stages: Stage_1.stages,\n Layer: Layer_1.Layer,\n FastLayer: FastLayer_1.FastLayer,\n Group: Group_1.Group,\n DD: DragAndDrop_1.DD,\n Shape: Shape_1.Shape,\n shapes: Shape_1.shapes,\n Animation: Animation_1.Animation,\n Tween: Tween_1.Tween,\n Easings: Tween_1.Easings,\n Context: Context_1.Context,\n Canvas: Canvas_1.Canvas,\n});\nexports.default = exports.Konva;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Arc = void 0;\nconst Factory_1 = require(\"../Factory\");\nconst Shape_1 = require(\"../Shape\");\nconst Global_1 = require(\"../Global\");\nconst Validators_1 = require(\"../Validators\");\nconst Global_2 = require(\"../Global\");\nclass Arc extends Shape_1.Shape {\n _sceneFunc(context) {\n var angle = Global_1.Konva.getAngle(this.angle()), clockwise = this.clockwise();\n context.beginPath();\n context.arc(0, 0, this.outerRadius(), 0, angle, clockwise);\n context.arc(0, 0, this.innerRadius(), angle, 0, !clockwise);\n context.closePath();\n context.fillStrokeShape(this);\n }\n getWidth() {\n return this.outerRadius() * 2;\n }\n getHeight() {\n return this.outerRadius() * 2;\n }\n setWidth(width) {\n this.outerRadius(width / 2);\n }\n setHeight(height) {\n this.outerRadius(height / 2);\n }\n getSelfRect() {\n const innerRadius = this.innerRadius();\n const outerRadius = this.outerRadius();\n const clockwise = this.clockwise();\n const angle = Global_1.Konva.getAngle(clockwise ? 360 - this.angle() : this.angle());\n const boundLeftRatio = Math.cos(Math.min(angle, Math.PI));\n const boundRightRatio = 1;\n const boundTopRatio = Math.sin(Math.min(Math.max(Math.PI, angle), (3 * Math.PI) / 2));\n const boundBottomRatio = Math.sin(Math.min(angle, Math.PI / 2));\n const boundLeft = boundLeftRatio * (boundLeftRatio > 0 ? innerRadius : outerRadius);\n const boundRight = boundRightRatio * (boundRightRatio > 0 ? outerRadius : innerRadius);\n const boundTop = boundTopRatio * (boundTopRatio > 0 ? innerRadius : outerRadius);\n const boundBottom = boundBottomRatio * (boundBottomRatio > 0 ? outerRadius : innerRadius);\n return {\n x: boundLeft,\n y: clockwise ? -1 * boundBottom : boundTop,\n width: boundRight - boundLeft,\n height: boundBottom - boundTop,\n };\n }\n}\nexports.Arc = Arc;\nArc.prototype._centroid = true;\nArc.prototype.className = 'Arc';\nArc.prototype._attrsAffectingSize = ['innerRadius', 'outerRadius'];\n(0, Global_2._registerNode)(Arc);\nFactory_1.Factory.addGetterSetter(Arc, 'innerRadius', 0, (0, Validators_1.getNumberValidator)());\nFactory_1.Factory.addGetterSetter(Arc, 'outerRadius', 0, (0, Validators_1.getNumberValidator)());\nFactory_1.Factory.addGetterSetter(Arc, 'angle', 0, (0, Validators_1.getNumberValidator)());\nFactory_1.Factory.addGetterSetter(Arc, 'clockwise', false, (0, Validators_1.getBooleanValidator)());\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Line = void 0;\nconst Factory_1 = require(\"../Factory\");\nconst Shape_1 = require(\"../Shape\");\nconst Validators_1 = require(\"../Validators\");\nconst Global_1 = require(\"../Global\");\nfunction getControlPoints(x0, y0, x1, y1, x2, y2, t) {\n var d01 = Math.sqrt(Math.pow(x1 - x0, 2) + Math.pow(y1 - y0, 2)), d12 = Math.sqrt(Math.pow(x2 - x1, 2) + Math.pow(y2 - y1, 2)), fa = (t * d01) / (d01 + d12), fb = (t * d12) / (d01 + d12), p1x = x1 - fa * (x2 - x0), p1y = y1 - fa * (y2 - y0), p2x = x1 + fb * (x2 - x0), p2y = y1 + fb * (y2 - y0);\n return [p1x, p1y, p2x, p2y];\n}\nfunction expandPoints(p, tension) {\n var len = p.length, allPoints = [], n, cp;\n for (n = 2; n < len - 2; n += 2) {\n cp = getControlPoints(p[n - 2], p[n - 1], p[n], p[n + 1], p[n + 2], p[n + 3], tension);\n if (isNaN(cp[0])) {\n continue;\n }\n allPoints.push(cp[0]);\n allPoints.push(cp[1]);\n allPoints.push(p[n]);\n allPoints.push(p[n + 1]);\n allPoints.push(cp[2]);\n allPoints.push(cp[3]);\n }\n return allPoints;\n}\nclass Line extends Shape_1.Shape {\n constructor(config) {\n super(config);\n this.on('pointsChange.konva tensionChange.konva closedChange.konva bezierChange.konva', function () {\n this._clearCache('tensionPoints');\n });\n }\n _sceneFunc(context) {\n var points = this.points(), length = points.length, tension = this.tension(), closed = this.closed(), bezier = this.bezier(), tp, len, n;\n if (!length) {\n return;\n }\n context.beginPath();\n context.moveTo(points[0], points[1]);\n if (tension !== 0 && length > 4) {\n tp = this.getTensionPoints();\n len = tp.length;\n n = closed ? 0 : 4;\n if (!closed) {\n context.quadraticCurveTo(tp[0], tp[1], tp[2], tp[3]);\n }\n while (n < len - 2) {\n context.bezierCurveTo(tp[n++], tp[n++], tp[n++], tp[n++], tp[n++], tp[n++]);\n }\n if (!closed) {\n context.quadraticCurveTo(tp[len - 2], tp[len - 1], points[length - 2], points[length - 1]);\n }\n }\n else if (bezier) {\n n = 2;\n while (n < length) {\n context.bezierCurveTo(points[n++], points[n++], points[n++], points[n++], points[n++], points[n++]);\n }\n }\n else {\n for (n = 2; n < length; n += 2) {\n context.lineTo(points[n], points[n + 1]);\n }\n }\n if (closed) {\n context.closePath();\n context.fillStrokeShape(this);\n }\n else {\n context.strokeShape(this);\n }\n }\n getTensionPoints() {\n return this._getCache('tensionPoints', this._getTensionPoints);\n }\n _getTensionPoints() {\n if (this.closed()) {\n return this._getTensionPointsClosed();\n }\n else {\n return expandPoints(this.points(), this.tension());\n }\n }\n _getTensionPointsClosed() {\n var p = this.points(), len = p.length, tension = this.tension(), firstControlPoints = getControlPoints(p[len - 2], p[len - 1], p[0], p[1], p[2], p[3], tension), lastControlPoints = getControlPoints(p[len - 4], p[len - 3], p[len - 2], p[len - 1], p[0], p[1], tension), middle = expandPoints(p, tension), tp = [firstControlPoints[2], firstControlPoints[3]]\n .concat(middle)\n .concat([\n lastControlPoints[0],\n lastControlPoints[1],\n p[len - 2],\n p[len - 1],\n lastControlPoints[2],\n lastControlPoints[3],\n firstControlPoints[0],\n firstControlPoints[1],\n p[0],\n p[1],\n ]);\n return tp;\n }\n getWidth() {\n return this.getSelfRect().width;\n }\n getHeight() {\n return this.getSelfRect().height;\n }\n getSelfRect() {\n var points = this.points();\n if (points.length < 4) {\n return {\n x: points[0] || 0,\n y: points[1] || 0,\n width: 0,\n height: 0,\n };\n }\n if (this.tension() !== 0) {\n points = [\n points[0],\n points[1],\n ...this._getTensionPoints(),\n points[points.length - 2],\n points[points.length - 1],\n ];\n }\n else {\n points = this.points();\n }\n var minX = points[0];\n var maxX = points[0];\n var minY = points[1];\n var maxY = points[1];\n var x, y;\n for (var i = 0; i < points.length / 2; i++) {\n x = points[i * 2];\n y = points[i * 2 + 1];\n minX = Math.min(minX, x);\n maxX = Math.max(maxX, x);\n minY = Math.min(minY, y);\n maxY = Math.max(maxY, y);\n }\n return {\n x: minX,\n y: minY,\n width: maxX - minX,\n height: maxY - minY,\n };\n }\n}\nexports.Line = Line;\nLine.prototype.className = 'Line';\nLine.prototype._attrsAffectingSize = ['points', 'bezier', 'tension'];\n(0, Global_1._registerNode)(Line);\nFactory_1.Factory.addGetterSetter(Line, 'closed', false);\nFactory_1.Factory.addGetterSetter(Line, 'bezier', false);\nFactory_1.Factory.addGetterSetter(Line, 'tension', 0, (0, Validators_1.getNumberValidator)());\nFactory_1.Factory.addGetterSetter(Line, 'points', [], (0, Validators_1.getNumberArrayValidator)());\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.t2length = exports.getQuadraticArcLength = exports.getCubicArcLength = exports.binomialCoefficients = exports.cValues = exports.tValues = void 0;\nexports.tValues = [\n [],\n [],\n [\n -0.5773502691896257645091487805019574556476,\n 0.5773502691896257645091487805019574556476,\n ],\n [\n 0, -0.7745966692414833770358530799564799221665,\n 0.7745966692414833770358530799564799221665,\n ],\n [\n -0.3399810435848562648026657591032446872005,\n 0.3399810435848562648026657591032446872005,\n -0.8611363115940525752239464888928095050957,\n 0.8611363115940525752239464888928095050957,\n ],\n [\n 0, -0.5384693101056830910363144207002088049672,\n 0.5384693101056830910363144207002088049672,\n -0.9061798459386639927976268782993929651256,\n 0.9061798459386639927976268782993929651256,\n ],\n [\n 0.6612093864662645136613995950199053470064,\n -0.6612093864662645136613995950199053470064,\n -0.2386191860831969086305017216807119354186,\n 0.2386191860831969086305017216807119354186,\n -0.9324695142031520278123015544939946091347,\n 0.9324695142031520278123015544939946091347,\n ],\n [\n 0, 0.4058451513773971669066064120769614633473,\n -0.4058451513773971669066064120769614633473,\n -0.7415311855993944398638647732807884070741,\n 0.7415311855993944398638647732807884070741,\n -0.9491079123427585245261896840478512624007,\n 0.9491079123427585245261896840478512624007,\n ],\n [\n -0.1834346424956498049394761423601839806667,\n 0.1834346424956498049394761423601839806667,\n -0.5255324099163289858177390491892463490419,\n 0.5255324099163289858177390491892463490419,\n -0.7966664774136267395915539364758304368371,\n 0.7966664774136267395915539364758304368371,\n -0.9602898564975362316835608685694729904282,\n 0.9602898564975362316835608685694729904282,\n ],\n [\n 0, -0.8360311073266357942994297880697348765441,\n 0.8360311073266357942994297880697348765441,\n -0.9681602395076260898355762029036728700494,\n 0.9681602395076260898355762029036728700494,\n -0.3242534234038089290385380146433366085719,\n 0.3242534234038089290385380146433366085719,\n -0.6133714327005903973087020393414741847857,\n 0.6133714327005903973087020393414741847857,\n ],\n [\n -0.1488743389816312108848260011297199846175,\n 0.1488743389816312108848260011297199846175,\n -0.4333953941292471907992659431657841622,\n 0.4333953941292471907992659431657841622,\n -0.6794095682990244062343273651148735757692,\n 0.6794095682990244062343273651148735757692,\n -0.8650633666889845107320966884234930485275,\n 0.8650633666889845107320966884234930485275,\n -0.9739065285171717200779640120844520534282,\n 0.9739065285171717200779640120844520534282,\n ],\n [\n 0, -0.2695431559523449723315319854008615246796,\n 0.2695431559523449723315319854008615246796,\n -0.5190961292068118159257256694586095544802,\n 0.5190961292068118159257256694586095544802,\n -0.7301520055740493240934162520311534580496,\n 0.7301520055740493240934162520311534580496,\n -0.8870625997680952990751577693039272666316,\n 0.8870625997680952990751577693039272666316,\n -0.9782286581460569928039380011228573907714,\n 0.9782286581460569928039380011228573907714,\n ],\n [\n -0.1252334085114689154724413694638531299833,\n 0.1252334085114689154724413694638531299833,\n -0.3678314989981801937526915366437175612563,\n 0.3678314989981801937526915366437175612563,\n -0.587317954286617447296702418940534280369,\n 0.587317954286617447296702418940534280369,\n -0.7699026741943046870368938332128180759849,\n 0.7699026741943046870368938332128180759849,\n -0.9041172563704748566784658661190961925375,\n 0.9041172563704748566784658661190961925375,\n -0.9815606342467192506905490901492808229601,\n 0.9815606342467192506905490901492808229601,\n ],\n [\n 0, -0.2304583159551347940655281210979888352115,\n 0.2304583159551347940655281210979888352115,\n -0.4484927510364468528779128521276398678019,\n 0.4484927510364468528779128521276398678019,\n -0.6423493394403402206439846069955156500716,\n 0.6423493394403402206439846069955156500716,\n -0.8015780907333099127942064895828598903056,\n 0.8015780907333099127942064895828598903056,\n -0.9175983992229779652065478365007195123904,\n 0.9175983992229779652065478365007195123904,\n -0.9841830547185881494728294488071096110649,\n 0.9841830547185881494728294488071096110649,\n ],\n [\n -0.1080549487073436620662446502198347476119,\n 0.1080549487073436620662446502198347476119,\n -0.3191123689278897604356718241684754668342,\n 0.3191123689278897604356718241684754668342,\n -0.5152486363581540919652907185511886623088,\n 0.5152486363581540919652907185511886623088,\n -0.6872929048116854701480198030193341375384,\n 0.6872929048116854701480198030193341375384,\n -0.8272013150697649931897947426503949610397,\n 0.8272013150697649931897947426503949610397,\n -0.928434883663573517336391139377874264477,\n 0.928434883663573517336391139377874264477,\n -0.986283808696812338841597266704052801676,\n 0.986283808696812338841597266704052801676,\n ],\n [\n 0, -0.2011940939974345223006283033945962078128,\n 0.2011940939974345223006283033945962078128,\n -0.3941513470775633698972073709810454683627,\n 0.3941513470775633698972073709810454683627,\n -0.5709721726085388475372267372539106412383,\n 0.5709721726085388475372267372539106412383,\n -0.7244177313601700474161860546139380096308,\n 0.7244177313601700474161860546139380096308,\n -0.8482065834104272162006483207742168513662,\n 0.8482065834104272162006483207742168513662,\n -0.9372733924007059043077589477102094712439,\n 0.9372733924007059043077589477102094712439,\n -0.9879925180204854284895657185866125811469,\n 0.9879925180204854284895657185866125811469,\n ],\n [\n -0.0950125098376374401853193354249580631303,\n 0.0950125098376374401853193354249580631303,\n -0.281603550779258913230460501460496106486,\n 0.281603550779258913230460501460496106486,\n -0.45801677765722738634241944298357757354,\n 0.45801677765722738634241944298357757354,\n -0.6178762444026437484466717640487910189918,\n 0.6178762444026437484466717640487910189918,\n -0.7554044083550030338951011948474422683538,\n 0.7554044083550030338951011948474422683538,\n -0.8656312023878317438804678977123931323873,\n 0.8656312023878317438804678977123931323873,\n -0.9445750230732325760779884155346083450911,\n 0.9445750230732325760779884155346083450911,\n -0.9894009349916499325961541734503326274262,\n 0.9894009349916499325961541734503326274262,\n ],\n [\n 0, -0.1784841814958478558506774936540655574754,\n 0.1784841814958478558506774936540655574754,\n -0.3512317634538763152971855170953460050405,\n 0.3512317634538763152971855170953460050405,\n -0.5126905370864769678862465686295518745829,\n 0.5126905370864769678862465686295518745829,\n -0.6576711592166907658503022166430023351478,\n 0.6576711592166907658503022166430023351478,\n -0.7815140038968014069252300555204760502239,\n 0.7815140038968014069252300555204760502239,\n -0.8802391537269859021229556944881556926234,\n 0.8802391537269859021229556944881556926234,\n -0.9506755217687677612227169578958030214433,\n 0.9506755217687677612227169578958030214433,\n -0.9905754753144173356754340199406652765077,\n 0.9905754753144173356754340199406652765077,\n ],\n [\n -0.0847750130417353012422618529357838117333,\n 0.0847750130417353012422618529357838117333,\n -0.2518862256915055095889728548779112301628,\n 0.2518862256915055095889728548779112301628,\n -0.4117511614628426460359317938330516370789,\n 0.4117511614628426460359317938330516370789,\n -0.5597708310739475346078715485253291369276,\n 0.5597708310739475346078715485253291369276,\n -0.6916870430603532078748910812888483894522,\n 0.6916870430603532078748910812888483894522,\n -0.8037049589725231156824174550145907971032,\n 0.8037049589725231156824174550145907971032,\n -0.8926024664975557392060605911271455154078,\n 0.8926024664975557392060605911271455154078,\n -0.9558239495713977551811958929297763099728,\n 0.9558239495713977551811958929297763099728,\n -0.9915651684209309467300160047061507702525,\n 0.9915651684209309467300160047061507702525,\n ],\n [\n 0, -0.1603586456402253758680961157407435495048,\n 0.1603586456402253758680961157407435495048,\n -0.3165640999636298319901173288498449178922,\n 0.3165640999636298319901173288498449178922,\n -0.4645707413759609457172671481041023679762,\n 0.4645707413759609457172671481041023679762,\n -0.6005453046616810234696381649462392798683,\n 0.6005453046616810234696381649462392798683,\n -0.7209661773352293786170958608237816296571,\n 0.7209661773352293786170958608237816296571,\n -0.8227146565371428249789224867127139017745,\n 0.8227146565371428249789224867127139017745,\n -0.9031559036148179016426609285323124878093,\n 0.9031559036148179016426609285323124878093,\n -0.960208152134830030852778840687651526615,\n 0.960208152134830030852778840687651526615,\n -0.9924068438435844031890176702532604935893,\n 0.9924068438435844031890176702532604935893,\n ],\n [\n -0.0765265211334973337546404093988382110047,\n 0.0765265211334973337546404093988382110047,\n -0.227785851141645078080496195368574624743,\n 0.227785851141645078080496195368574624743,\n -0.3737060887154195606725481770249272373957,\n 0.3737060887154195606725481770249272373957,\n -0.5108670019508270980043640509552509984254,\n 0.5108670019508270980043640509552509984254,\n -0.6360536807265150254528366962262859367433,\n 0.6360536807265150254528366962262859367433,\n -0.7463319064601507926143050703556415903107,\n 0.7463319064601507926143050703556415903107,\n -0.8391169718222188233945290617015206853296,\n 0.8391169718222188233945290617015206853296,\n -0.9122344282513259058677524412032981130491,\n 0.9122344282513259058677524412032981130491,\n -0.963971927277913791267666131197277221912,\n 0.963971927277913791267666131197277221912,\n -0.9931285991850949247861223884713202782226,\n 0.9931285991850949247861223884713202782226,\n ],\n [\n 0, -0.1455618541608950909370309823386863301163,\n 0.1455618541608950909370309823386863301163,\n -0.288021316802401096600792516064600319909,\n 0.288021316802401096600792516064600319909,\n -0.4243421202074387835736688885437880520964,\n 0.4243421202074387835736688885437880520964,\n -0.551618835887219807059018796724313286622,\n 0.551618835887219807059018796724313286622,\n -0.667138804197412319305966669990339162597,\n 0.667138804197412319305966669990339162597,\n -0.7684399634756779086158778513062280348209,\n 0.7684399634756779086158778513062280348209,\n -0.8533633645833172836472506385875676702761,\n 0.8533633645833172836472506385875676702761,\n -0.9200993341504008287901871337149688941591,\n 0.9200993341504008287901871337149688941591,\n -0.9672268385663062943166222149076951614246,\n 0.9672268385663062943166222149076951614246,\n -0.9937521706203895002602420359379409291933,\n 0.9937521706203895002602420359379409291933,\n ],\n [\n -0.0697392733197222212138417961186280818222,\n 0.0697392733197222212138417961186280818222,\n -0.2078604266882212854788465339195457342156,\n 0.2078604266882212854788465339195457342156,\n -0.3419358208920842251581474204273796195591,\n 0.3419358208920842251581474204273796195591,\n -0.4693558379867570264063307109664063460953,\n 0.4693558379867570264063307109664063460953,\n -0.5876404035069115929588769276386473488776,\n 0.5876404035069115929588769276386473488776,\n -0.6944872631866827800506898357622567712673,\n 0.6944872631866827800506898357622567712673,\n -0.7878168059792081620042779554083515213881,\n 0.7878168059792081620042779554083515213881,\n -0.8658125777203001365364256370193787290847,\n 0.8658125777203001365364256370193787290847,\n -0.9269567721871740005206929392590531966353,\n 0.9269567721871740005206929392590531966353,\n -0.9700604978354287271239509867652687108059,\n 0.9700604978354287271239509867652687108059,\n -0.994294585482399292073031421161298980393,\n 0.994294585482399292073031421161298980393,\n ],\n [\n 0, -0.1332568242984661109317426822417661370104,\n 0.1332568242984661109317426822417661370104,\n -0.264135680970344930533869538283309602979,\n 0.264135680970344930533869538283309602979,\n -0.390301038030290831421488872880605458578,\n 0.390301038030290831421488872880605458578,\n -0.5095014778460075496897930478668464305448,\n 0.5095014778460075496897930478668464305448,\n -0.6196098757636461563850973116495956533871,\n 0.6196098757636461563850973116495956533871,\n -0.7186613631319501944616244837486188483299,\n 0.7186613631319501944616244837486188483299,\n -0.8048884016188398921511184069967785579414,\n 0.8048884016188398921511184069967785579414,\n -0.8767523582704416673781568859341456716389,\n 0.8767523582704416673781568859341456716389,\n -0.9329710868260161023491969890384229782357,\n 0.9329710868260161023491969890384229782357,\n -0.9725424712181152319560240768207773751816,\n 0.9725424712181152319560240768207773751816,\n -0.9947693349975521235239257154455743605736,\n 0.9947693349975521235239257154455743605736,\n ],\n [\n -0.0640568928626056260850430826247450385909,\n 0.0640568928626056260850430826247450385909,\n -0.1911188674736163091586398207570696318404,\n 0.1911188674736163091586398207570696318404,\n -0.3150426796961633743867932913198102407864,\n 0.3150426796961633743867932913198102407864,\n -0.4337935076260451384870842319133497124524,\n 0.4337935076260451384870842319133497124524,\n -0.5454214713888395356583756172183723700107,\n 0.5454214713888395356583756172183723700107,\n -0.6480936519369755692524957869107476266696,\n 0.6480936519369755692524957869107476266696,\n -0.7401241915785543642438281030999784255232,\n 0.7401241915785543642438281030999784255232,\n -0.8200019859739029219539498726697452080761,\n 0.8200019859739029219539498726697452080761,\n -0.8864155270044010342131543419821967550873,\n 0.8864155270044010342131543419821967550873,\n -0.9382745520027327585236490017087214496548,\n 0.9382745520027327585236490017087214496548,\n -0.9747285559713094981983919930081690617411,\n 0.9747285559713094981983919930081690617411,\n -0.9951872199970213601799974097007368118745,\n 0.9951872199970213601799974097007368118745,\n ],\n];\nexports.cValues = [\n [],\n [],\n [1.0, 1.0],\n [\n 0.8888888888888888888888888888888888888888,\n 0.5555555555555555555555555555555555555555,\n 0.5555555555555555555555555555555555555555,\n ],\n [\n 0.6521451548625461426269360507780005927646,\n 0.6521451548625461426269360507780005927646,\n 0.3478548451374538573730639492219994072353,\n 0.3478548451374538573730639492219994072353,\n ],\n [\n 0.5688888888888888888888888888888888888888,\n 0.4786286704993664680412915148356381929122,\n 0.4786286704993664680412915148356381929122,\n 0.2369268850561890875142640407199173626432,\n 0.2369268850561890875142640407199173626432,\n ],\n [\n 0.3607615730481386075698335138377161116615,\n 0.3607615730481386075698335138377161116615,\n 0.4679139345726910473898703439895509948116,\n 0.4679139345726910473898703439895509948116,\n 0.1713244923791703450402961421727328935268,\n 0.1713244923791703450402961421727328935268,\n ],\n [\n 0.4179591836734693877551020408163265306122,\n 0.3818300505051189449503697754889751338783,\n 0.3818300505051189449503697754889751338783,\n 0.2797053914892766679014677714237795824869,\n 0.2797053914892766679014677714237795824869,\n 0.1294849661688696932706114326790820183285,\n 0.1294849661688696932706114326790820183285,\n ],\n [\n 0.3626837833783619829651504492771956121941,\n 0.3626837833783619829651504492771956121941,\n 0.3137066458778872873379622019866013132603,\n 0.3137066458778872873379622019866013132603,\n 0.2223810344533744705443559944262408844301,\n 0.2223810344533744705443559944262408844301,\n 0.1012285362903762591525313543099621901153,\n 0.1012285362903762591525313543099621901153,\n ],\n [\n 0.3302393550012597631645250692869740488788,\n 0.1806481606948574040584720312429128095143,\n 0.1806481606948574040584720312429128095143,\n 0.0812743883615744119718921581105236506756,\n 0.0812743883615744119718921581105236506756,\n 0.3123470770400028400686304065844436655987,\n 0.3123470770400028400686304065844436655987,\n 0.2606106964029354623187428694186328497718,\n 0.2606106964029354623187428694186328497718,\n ],\n [\n 0.295524224714752870173892994651338329421,\n 0.295524224714752870173892994651338329421,\n 0.2692667193099963550912269215694693528597,\n 0.2692667193099963550912269215694693528597,\n 0.2190863625159820439955349342281631924587,\n 0.2190863625159820439955349342281631924587,\n 0.1494513491505805931457763396576973324025,\n 0.1494513491505805931457763396576973324025,\n 0.0666713443086881375935688098933317928578,\n 0.0666713443086881375935688098933317928578,\n ],\n [\n 0.272925086777900630714483528336342189156,\n 0.2628045445102466621806888698905091953727,\n 0.2628045445102466621806888698905091953727,\n 0.2331937645919904799185237048431751394317,\n 0.2331937645919904799185237048431751394317,\n 0.1862902109277342514260976414316558916912,\n 0.1862902109277342514260976414316558916912,\n 0.1255803694649046246346942992239401001976,\n 0.1255803694649046246346942992239401001976,\n 0.0556685671161736664827537204425485787285,\n 0.0556685671161736664827537204425485787285,\n ],\n [\n 0.2491470458134027850005624360429512108304,\n 0.2491470458134027850005624360429512108304,\n 0.2334925365383548087608498989248780562594,\n 0.2334925365383548087608498989248780562594,\n 0.2031674267230659217490644558097983765065,\n 0.2031674267230659217490644558097983765065,\n 0.160078328543346226334652529543359071872,\n 0.160078328543346226334652529543359071872,\n 0.1069393259953184309602547181939962242145,\n 0.1069393259953184309602547181939962242145,\n 0.047175336386511827194615961485017060317,\n 0.047175336386511827194615961485017060317,\n ],\n [\n 0.2325515532308739101945895152688359481566,\n 0.2262831802628972384120901860397766184347,\n 0.2262831802628972384120901860397766184347,\n 0.2078160475368885023125232193060527633865,\n 0.2078160475368885023125232193060527633865,\n 0.1781459807619457382800466919960979955128,\n 0.1781459807619457382800466919960979955128,\n 0.1388735102197872384636017768688714676218,\n 0.1388735102197872384636017768688714676218,\n 0.0921214998377284479144217759537971209236,\n 0.0921214998377284479144217759537971209236,\n 0.0404840047653158795200215922009860600419,\n 0.0404840047653158795200215922009860600419,\n ],\n [\n 0.2152638534631577901958764433162600352749,\n 0.2152638534631577901958764433162600352749,\n 0.2051984637212956039659240656612180557103,\n 0.2051984637212956039659240656612180557103,\n 0.1855383974779378137417165901251570362489,\n 0.1855383974779378137417165901251570362489,\n 0.1572031671581935345696019386238421566056,\n 0.1572031671581935345696019386238421566056,\n 0.1215185706879031846894148090724766259566,\n 0.1215185706879031846894148090724766259566,\n 0.0801580871597602098056332770628543095836,\n 0.0801580871597602098056332770628543095836,\n 0.0351194603317518630318328761381917806197,\n 0.0351194603317518630318328761381917806197,\n ],\n [\n 0.2025782419255612728806201999675193148386,\n 0.1984314853271115764561183264438393248186,\n 0.1984314853271115764561183264438393248186,\n 0.1861610000155622110268005618664228245062,\n 0.1861610000155622110268005618664228245062,\n 0.1662692058169939335532008604812088111309,\n 0.1662692058169939335532008604812088111309,\n 0.1395706779261543144478047945110283225208,\n 0.1395706779261543144478047945110283225208,\n 0.1071592204671719350118695466858693034155,\n 0.1071592204671719350118695466858693034155,\n 0.0703660474881081247092674164506673384667,\n 0.0703660474881081247092674164506673384667,\n 0.0307532419961172683546283935772044177217,\n 0.0307532419961172683546283935772044177217,\n ],\n [\n 0.1894506104550684962853967232082831051469,\n 0.1894506104550684962853967232082831051469,\n 0.1826034150449235888667636679692199393835,\n 0.1826034150449235888667636679692199393835,\n 0.1691565193950025381893120790303599622116,\n 0.1691565193950025381893120790303599622116,\n 0.1495959888165767320815017305474785489704,\n 0.1495959888165767320815017305474785489704,\n 0.1246289712555338720524762821920164201448,\n 0.1246289712555338720524762821920164201448,\n 0.0951585116824927848099251076022462263552,\n 0.0951585116824927848099251076022462263552,\n 0.0622535239386478928628438369943776942749,\n 0.0622535239386478928628438369943776942749,\n 0.0271524594117540948517805724560181035122,\n 0.0271524594117540948517805724560181035122,\n ],\n [\n 0.1794464703562065254582656442618856214487,\n 0.1765627053669926463252709901131972391509,\n 0.1765627053669926463252709901131972391509,\n 0.1680041021564500445099706637883231550211,\n 0.1680041021564500445099706637883231550211,\n 0.1540457610768102880814315948019586119404,\n 0.1540457610768102880814315948019586119404,\n 0.1351363684685254732863199817023501973721,\n 0.1351363684685254732863199817023501973721,\n 0.1118838471934039710947883856263559267358,\n 0.1118838471934039710947883856263559267358,\n 0.0850361483171791808835353701910620738504,\n 0.0850361483171791808835353701910620738504,\n 0.0554595293739872011294401653582446605128,\n 0.0554595293739872011294401653582446605128,\n 0.0241483028685479319601100262875653246916,\n 0.0241483028685479319601100262875653246916,\n ],\n [\n 0.1691423829631435918406564701349866103341,\n 0.1691423829631435918406564701349866103341,\n 0.1642764837458327229860537764659275904123,\n 0.1642764837458327229860537764659275904123,\n 0.1546846751262652449254180038363747721932,\n 0.1546846751262652449254180038363747721932,\n 0.1406429146706506512047313037519472280955,\n 0.1406429146706506512047313037519472280955,\n 0.1225552067114784601845191268002015552281,\n 0.1225552067114784601845191268002015552281,\n 0.1009420441062871655628139849248346070628,\n 0.1009420441062871655628139849248346070628,\n 0.0764257302548890565291296776166365256053,\n 0.0764257302548890565291296776166365256053,\n 0.0497145488949697964533349462026386416808,\n 0.0497145488949697964533349462026386416808,\n 0.0216160135264833103133427102664524693876,\n 0.0216160135264833103133427102664524693876,\n ],\n [\n 0.1610544498487836959791636253209167350399,\n 0.1589688433939543476499564394650472016787,\n 0.1589688433939543476499564394650472016787,\n 0.152766042065859666778855400897662998461,\n 0.152766042065859666778855400897662998461,\n 0.1426067021736066117757461094419029724756,\n 0.1426067021736066117757461094419029724756,\n 0.1287539625393362276755157848568771170558,\n 0.1287539625393362276755157848568771170558,\n 0.1115666455473339947160239016817659974813,\n 0.1115666455473339947160239016817659974813,\n 0.0914900216224499994644620941238396526609,\n 0.0914900216224499994644620941238396526609,\n 0.0690445427376412265807082580060130449618,\n 0.0690445427376412265807082580060130449618,\n 0.0448142267656996003328381574019942119517,\n 0.0448142267656996003328381574019942119517,\n 0.0194617882297264770363120414644384357529,\n 0.0194617882297264770363120414644384357529,\n ],\n [\n 0.1527533871307258506980843319550975934919,\n 0.1527533871307258506980843319550975934919,\n 0.1491729864726037467878287370019694366926,\n 0.1491729864726037467878287370019694366926,\n 0.1420961093183820513292983250671649330345,\n 0.1420961093183820513292983250671649330345,\n 0.1316886384491766268984944997481631349161,\n 0.1316886384491766268984944997481631349161,\n 0.118194531961518417312377377711382287005,\n 0.118194531961518417312377377711382287005,\n 0.1019301198172404350367501354803498761666,\n 0.1019301198172404350367501354803498761666,\n 0.0832767415767047487247581432220462061001,\n 0.0832767415767047487247581432220462061001,\n 0.0626720483341090635695065351870416063516,\n 0.0626720483341090635695065351870416063516,\n 0.040601429800386941331039952274932109879,\n 0.040601429800386941331039952274932109879,\n 0.0176140071391521183118619623518528163621,\n 0.0176140071391521183118619623518528163621,\n ],\n [\n 0.1460811336496904271919851476833711882448,\n 0.1445244039899700590638271665537525436099,\n 0.1445244039899700590638271665537525436099,\n 0.1398873947910731547221334238675831108927,\n 0.1398873947910731547221334238675831108927,\n 0.132268938633337461781052574496775604329,\n 0.132268938633337461781052574496775604329,\n 0.1218314160537285341953671771257335983563,\n 0.1218314160537285341953671771257335983563,\n 0.1087972991671483776634745780701056420336,\n 0.1087972991671483776634745780701056420336,\n 0.0934444234560338615532897411139320884835,\n 0.0934444234560338615532897411139320884835,\n 0.0761001136283793020170516533001831792261,\n 0.0761001136283793020170516533001831792261,\n 0.0571344254268572082836358264724479574912,\n 0.0571344254268572082836358264724479574912,\n 0.0369537897708524937999506682993296661889,\n 0.0369537897708524937999506682993296661889,\n 0.0160172282577743333242246168584710152658,\n 0.0160172282577743333242246168584710152658,\n ],\n [\n 0.1392518728556319933754102483418099578739,\n 0.1392518728556319933754102483418099578739,\n 0.1365414983460151713525738312315173965863,\n 0.1365414983460151713525738312315173965863,\n 0.1311735047870623707329649925303074458757,\n 0.1311735047870623707329649925303074458757,\n 0.1232523768105124242855609861548144719594,\n 0.1232523768105124242855609861548144719594,\n 0.1129322960805392183934006074217843191142,\n 0.1129322960805392183934006074217843191142,\n 0.1004141444428809649320788378305362823508,\n 0.1004141444428809649320788378305362823508,\n 0.0859416062170677274144436813727028661891,\n 0.0859416062170677274144436813727028661891,\n 0.0697964684245204880949614189302176573987,\n 0.0697964684245204880949614189302176573987,\n 0.0522933351526832859403120512732112561121,\n 0.0522933351526832859403120512732112561121,\n 0.0337749015848141547933022468659129013491,\n 0.0337749015848141547933022468659129013491,\n 0.0146279952982722006849910980471854451902,\n 0.0146279952982722006849910980471854451902,\n ],\n [\n 0.1336545721861061753514571105458443385831,\n 0.132462039404696617371642464703316925805,\n 0.132462039404696617371642464703316925805,\n 0.1289057221880821499785953393997936532597,\n 0.1289057221880821499785953393997936532597,\n 0.1230490843067295304675784006720096548158,\n 0.1230490843067295304675784006720096548158,\n 0.1149966402224113649416435129339613014914,\n 0.1149966402224113649416435129339613014914,\n 0.1048920914645414100740861850147438548584,\n 0.1048920914645414100740861850147438548584,\n 0.0929157660600351474770186173697646486034,\n 0.0929157660600351474770186173697646486034,\n 0.0792814117767189549228925247420432269137,\n 0.0792814117767189549228925247420432269137,\n 0.0642324214085258521271696151589109980391,\n 0.0642324214085258521271696151589109980391,\n 0.0480376717310846685716410716320339965612,\n 0.0480376717310846685716410716320339965612,\n 0.0309880058569794443106942196418845053837,\n 0.0309880058569794443106942196418845053837,\n 0.0134118594871417720813094934586150649766,\n 0.0134118594871417720813094934586150649766,\n ],\n [\n 0.1279381953467521569740561652246953718517,\n 0.1279381953467521569740561652246953718517,\n 0.1258374563468282961213753825111836887264,\n 0.1258374563468282961213753825111836887264,\n 0.121670472927803391204463153476262425607,\n 0.121670472927803391204463153476262425607,\n 0.1155056680537256013533444839067835598622,\n 0.1155056680537256013533444839067835598622,\n 0.1074442701159656347825773424466062227946,\n 0.1074442701159656347825773424466062227946,\n 0.0976186521041138882698806644642471544279,\n 0.0976186521041138882698806644642471544279,\n 0.086190161531953275917185202983742667185,\n 0.086190161531953275917185202983742667185,\n 0.0733464814110803057340336152531165181193,\n 0.0733464814110803057340336152531165181193,\n 0.0592985849154367807463677585001085845412,\n 0.0592985849154367807463677585001085845412,\n 0.0442774388174198061686027482113382288593,\n 0.0442774388174198061686027482113382288593,\n 0.0285313886289336631813078159518782864491,\n 0.0285313886289336631813078159518782864491,\n 0.0123412297999871995468056670700372915759,\n 0.0123412297999871995468056670700372915759,\n ],\n];\nexports.binomialCoefficients = [[1], [1, 1], [1, 2, 1], [1, 3, 3, 1]];\nconst getCubicArcLength = (xs, ys, t) => {\n let z;\n let sum;\n let correctedT;\n const n = 20;\n z = t / 2;\n sum = 0;\n for (let i = 0; i < n; i++) {\n correctedT = z * exports.tValues[n][i] + z;\n sum += exports.cValues[n][i] * BFunc(xs, ys, correctedT);\n }\n return z * sum;\n};\nexports.getCubicArcLength = getCubicArcLength;\nconst getQuadraticArcLength = (xs, ys, t) => {\n if (t === undefined) {\n t = 1;\n }\n const ax = xs[0] - 2 * xs[1] + xs[2];\n const ay = ys[0] - 2 * ys[1] + ys[2];\n const bx = 2 * xs[1] - 2 * xs[0];\n const by = 2 * ys[1] - 2 * ys[0];\n const A = 4 * (ax * ax + ay * ay);\n const B = 4 * (ax * bx + ay * by);\n const C = bx * bx + by * by;\n if (A === 0) {\n return (t * Math.sqrt(Math.pow(xs[2] - xs[0], 2) + Math.pow(ys[2] - ys[0], 2)));\n }\n const b = B / (2 * A);\n const c = C / A;\n const u = t + b;\n const k = c - b * b;\n const uuk = u * u + k > 0 ? Math.sqrt(u * u + k) : 0;\n const bbk = b * b + k > 0 ? Math.sqrt(b * b + k) : 0;\n const term = b + Math.sqrt(b * b + k) !== 0\n ? k * Math.log(Math.abs((u + uuk) / (b + bbk)))\n : 0;\n return (Math.sqrt(A) / 2) * (u * uuk - b * bbk + term);\n};\nexports.getQuadraticArcLength = getQuadraticArcLength;\nfunction BFunc(xs, ys, t) {\n const xbase = getDerivative(1, t, xs);\n const ybase = getDerivative(1, t, ys);\n const combined = xbase * xbase + ybase * ybase;\n return Math.sqrt(combined);\n}\nconst getDerivative = (derivative, t, vs) => {\n const n = vs.length - 1;\n let _vs;\n let value;\n if (n === 0) {\n return 0;\n }\n if (derivative === 0) {\n value = 0;\n for (let k = 0; k <= n; k++) {\n value +=\n exports.binomialCoefficients[n][k] *\n Math.pow(1 - t, n - k) *\n Math.pow(t, k) *\n vs[k];\n }\n return value;\n }\n else {\n _vs = new Array(n);\n for (let k = 0; k < n; k++) {\n _vs[k] = n * (vs[k + 1] - vs[k]);\n }\n return getDerivative(derivative - 1, t, _vs);\n }\n};\nconst t2length = (length, totalLength, func) => {\n let error = 1;\n let t = length / totalLength;\n let step = (length - func(t)) / totalLength;\n let numIterations = 0;\n while (error > 0.001) {\n const increasedTLength = func(t + step);\n const increasedTError = Math.abs(length - increasedTLength) / totalLength;\n if (increasedTError < error) {\n error = increasedTError;\n t += step;\n }\n else {\n const decreasedTLength = func(t - step);\n const decreasedTError = Math.abs(length - decreasedTLength) / totalLength;\n if (decreasedTError < error) {\n error = decreasedTError;\n t -= step;\n }\n else {\n step /= 2;\n }\n }\n numIterations++;\n if (numIterations > 500) {\n break;\n }\n }\n return t;\n};\nexports.t2length = t2length;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Path = void 0;\nconst Factory_1 = require(\"../Factory\");\nconst Shape_1 = require(\"../Shape\");\nconst Global_1 = require(\"../Global\");\nconst BezierFunctions_1 = require(\"../BezierFunctions\");\nclass Path extends Shape_1.Shape {\n constructor(config) {\n super(config);\n this.dataArray = [];\n this.pathLength = 0;\n this._readDataAttribute();\n this.on('dataChange.konva', function () {\n this._readDataAttribute();\n });\n }\n _readDataAttribute() {\n this.dataArray = Path.parsePathData(this.data());\n this.pathLength = Path.getPathLength(this.dataArray);\n }\n _sceneFunc(context) {\n var ca = this.dataArray;\n context.beginPath();\n var isClosed = false;\n for (var n = 0; n < ca.length; n++) {\n var c = ca[n].command;\n var p = ca[n].points;\n switch (c) {\n case 'L':\n context.lineTo(p[0], p[1]);\n break;\n case 'M':\n context.moveTo(p[0], p[1]);\n break;\n case 'C':\n context.bezierCurveTo(p[0], p[1], p[2], p[3], p[4], p[5]);\n break;\n case 'Q':\n context.quadraticCurveTo(p[0], p[1], p[2], p[3]);\n break;\n case 'A':\n var cx = p[0], cy = p[1], rx = p[2], ry = p[3], theta = p[4], dTheta = p[5], psi = p[6], fs = p[7];\n var r = rx > ry ? rx : ry;\n var scaleX = rx > ry ? 1 : rx / ry;\n var scaleY = rx > ry ? ry / rx : 1;\n context.translate(cx, cy);\n context.rotate(psi);\n context.scale(scaleX, scaleY);\n context.arc(0, 0, r, theta, theta + dTheta, 1 - fs);\n context.scale(1 / scaleX, 1 / scaleY);\n context.rotate(-psi);\n context.translate(-cx, -cy);\n break;\n case 'z':\n isClosed = true;\n context.closePath();\n break;\n }\n }\n if (!isClosed && !this.hasFill()) {\n context.strokeShape(this);\n }\n else {\n context.fillStrokeShape(this);\n }\n }\n getSelfRect() {\n var points = [];\n this.dataArray.forEach(function (data) {\n if (data.command === 'A') {\n var start = data.points[4];\n var dTheta = data.points[5];\n var end = data.points[4] + dTheta;\n var inc = Math.PI / 180.0;\n if (Math.abs(start - end) < inc) {\n inc = Math.abs(start - end);\n }\n if (dTheta < 0) {\n for (let t = start - inc; t > end; t -= inc) {\n const point = Path.getPointOnEllipticalArc(data.points[0], data.points[1], data.points[2], data.points[3], t, 0);\n points.push(point.x, point.y);\n }\n }\n else {\n for (let t = start + inc; t < end; t += inc) {\n const point = Path.getPointOnEllipticalArc(data.points[0], data.points[1], data.points[2], data.points[3], t, 0);\n points.push(point.x, point.y);\n }\n }\n }\n else if (data.command === 'C') {\n for (let t = 0.0; t <= 1; t += 0.01) {\n const point = Path.getPointOnCubicBezier(t, data.start.x, data.start.y, data.points[0], data.points[1], data.points[2], data.points[3], data.points[4], data.points[5]);\n points.push(point.x, point.y);\n }\n }\n else {\n points = points.concat(data.points);\n }\n });\n var minX = points[0];\n var maxX = points[0];\n var minY = points[1];\n var maxY = points[1];\n var x, y;\n for (var i = 0; i < points.length / 2; i++) {\n x = points[i * 2];\n y = points[i * 2 + 1];\n if (!isNaN(x)) {\n minX = Math.min(minX, x);\n maxX = Math.max(maxX, x);\n }\n if (!isNaN(y)) {\n minY = Math.min(minY, y);\n maxY = Math.max(maxY, y);\n }\n }\n return {\n x: minX,\n y: minY,\n width: maxX - minX,\n height: maxY - minY,\n };\n }\n getLength() {\n return this.pathLength;\n }\n getPointAtLength(length) {\n return Path.getPointAtLengthOfDataArray(length, this.dataArray);\n }\n static getLineLength(x1, y1, x2, y2) {\n return Math.sqrt((x2 - x1) * (x2 - x1) + (y2 - y1) * (y2 - y1));\n }\n static getPathLength(dataArray) {\n let pathLength = 0;\n for (var i = 0; i < dataArray.length; ++i) {\n pathLength += dataArray[i].pathLength;\n }\n return pathLength;\n }\n static getPointAtLengthOfDataArray(length, dataArray) {\n var points, i = 0, ii = dataArray.length;\n if (!ii) {\n return null;\n }\n while (i < ii && length > dataArray[i].pathLength) {\n length -= dataArray[i].pathLength;\n ++i;\n }\n if (i === ii) {\n points = dataArray[i - 1].points.slice(-2);\n return {\n x: points[0],\n y: points[1],\n };\n }\n if (length < 0.01) {\n points = dataArray[i].points.slice(0, 2);\n return {\n x: points[0],\n y: points[1],\n };\n }\n var cp = dataArray[i];\n var p = cp.points;\n switch (cp.command) {\n case 'L':\n return Path.getPointOnLine(length, cp.start.x, cp.start.y, p[0], p[1]);\n case 'C':\n return Path.getPointOnCubicBezier((0, BezierFunctions_1.t2length)(length, Path.getPathLength(dataArray), (i) => {\n return (0, BezierFunctions_1.getCubicArcLength)([cp.start.x, p[0], p[2], p[4]], [cp.start.y, p[1], p[3], p[5]], i);\n }), cp.start.x, cp.start.y, p[0], p[1], p[2], p[3], p[4], p[5]);\n case 'Q':\n return Path.getPointOnQuadraticBezier((0, BezierFunctions_1.t2length)(length, Path.getPathLength(dataArray), (i) => {\n return (0, BezierFunctions_1.getQuadraticArcLength)([cp.start.x, p[0], p[2]], [cp.start.y, p[1], p[3]], i);\n }), cp.start.x, cp.start.y, p[0], p[1], p[2], p[3]);\n case 'A':\n var cx = p[0], cy = p[1], rx = p[2], ry = p[3], theta = p[4], dTheta = p[5], psi = p[6];\n theta += (dTheta * length) / cp.pathLength;\n return Path.getPointOnEllipticalArc(cx, cy, rx, ry, theta, psi);\n }\n return null;\n }\n static getPointOnLine(dist, P1x, P1y, P2x, P2y, fromX, fromY) {\n fromX = fromX !== null && fromX !== void 0 ? fromX : P1x;\n fromY = fromY !== null && fromY !== void 0 ? fromY : P1y;\n const len = this.getLineLength(P1x, P1y, P2x, P2y);\n if (len < 1e-10) {\n return { x: P1x, y: P1y };\n }\n if (P2x === P1x) {\n return { x: fromX, y: fromY + (P2y > P1y ? dist : -dist) };\n }\n const m = (P2y - P1y) / (P2x - P1x);\n const run = Math.sqrt((dist * dist) / (1 + m * m)) * (P2x < P1x ? -1 : 1);\n const rise = m * run;\n if (Math.abs(fromY - P1y - m * (fromX - P1x)) < 1e-10) {\n return { x: fromX + run, y: fromY + rise };\n }\n const u = ((fromX - P1x) * (P2x - P1x) + (fromY - P1y) * (P2y - P1y)) / (len * len);\n const ix = P1x + u * (P2x - P1x);\n const iy = P1y + u * (P2y - P1y);\n const pRise = this.getLineLength(fromX, fromY, ix, iy);\n const pRun = Math.sqrt(dist * dist - pRise * pRise);\n const adjustedRun = Math.sqrt((pRun * pRun) / (1 + m * m)) * (P2x < P1x ? -1 : 1);\n const adjustedRise = m * adjustedRun;\n return { x: ix + adjustedRun, y: iy + adjustedRise };\n }\n static getPointOnCubicBezier(pct, P1x, P1y, P2x, P2y, P3x, P3y, P4x, P4y) {\n function CB1(t) {\n return t * t * t;\n }\n function CB2(t) {\n return 3 * t * t * (1 - t);\n }\n function CB3(t) {\n return 3 * t * (1 - t) * (1 - t);\n }\n function CB4(t) {\n return (1 - t) * (1 - t) * (1 - t);\n }\n var x = P4x * CB1(pct) + P3x * CB2(pct) + P2x * CB3(pct) + P1x * CB4(pct);\n var y = P4y * CB1(pct) + P3y * CB2(pct) + P2y * CB3(pct) + P1y * CB4(pct);\n return {\n x: x,\n y: y,\n };\n }\n static getPointOnQuadraticBezier(pct, P1x, P1y, P2x, P2y, P3x, P3y) {\n function QB1(t) {\n return t * t;\n }\n function QB2(t) {\n return 2 * t * (1 - t);\n }\n function QB3(t) {\n return (1 - t) * (1 - t);\n }\n var x = P3x * QB1(pct) + P2x * QB2(pct) + P1x * QB3(pct);\n var y = P3y * QB1(pct) + P2y * QB2(pct) + P1y * QB3(pct);\n return {\n x: x,\n y: y,\n };\n }\n static getPointOnEllipticalArc(cx, cy, rx, ry, theta, psi) {\n var cosPsi = Math.cos(psi), sinPsi = Math.sin(psi);\n var pt = {\n x: rx * Math.cos(theta),\n y: ry * Math.sin(theta),\n };\n return {\n x: cx + (pt.x * cosPsi - pt.y * sinPsi),\n y: cy + (pt.x * sinPsi + pt.y * cosPsi),\n };\n }\n static parsePathData(data) {\n if (!data) {\n return [];\n }\n var cs = data;\n var cc = [\n 'm',\n 'M',\n 'l',\n 'L',\n 'v',\n 'V',\n 'h',\n 'H',\n 'z',\n 'Z',\n 'c',\n 'C',\n 'q',\n 'Q',\n 't',\n 'T',\n 's',\n 'S',\n 'a',\n 'A',\n ];\n cs = cs.replace(new RegExp(' ', 'g'), ',');\n for (var n = 0; n < cc.length; n++) {\n cs = cs.replace(new RegExp(cc[n], 'g'), '|' + cc[n]);\n }\n var arr = cs.split('|');\n var ca = [];\n var coords = [];\n var cpx = 0;\n var cpy = 0;\n var re = /([-+]?((\\d+\\.\\d+)|((\\d+)|(\\.\\d+)))(?:e[-+]?\\d+)?)/gi;\n var match;\n for (n = 1; n < arr.length; n++) {\n var str = arr[n];\n var c = str.charAt(0);\n str = str.slice(1);\n coords.length = 0;\n while ((match = re.exec(str))) {\n coords.push(match[0]);\n }\n var p = [];\n for (var j = 0, jlen = coords.length; j < jlen; j++) {\n if (coords[j] === '00') {\n p.push(0, 0);\n continue;\n }\n var parsed = parseFloat(coords[j]);\n if (!isNaN(parsed)) {\n p.push(parsed);\n }\n else {\n p.push(0);\n }\n }\n while (p.length > 0) {\n if (isNaN(p[0])) {\n break;\n }\n var cmd = '';\n var points = [];\n var startX = cpx, startY = cpy;\n var prevCmd, ctlPtx, ctlPty;\n var rx, ry, psi, fa, fs, x1, y1;\n switch (c) {\n case 'l':\n cpx += p.shift();\n cpy += p.shift();\n cmd = 'L';\n points.push(cpx, cpy);\n break;\n case 'L':\n cpx = p.shift();\n cpy = p.shift();\n points.push(cpx, cpy);\n break;\n case 'm':\n var dx = p.shift();\n var dy = p.shift();\n cpx += dx;\n cpy += dy;\n cmd = 'M';\n if (ca.length > 2 && ca[ca.length - 1].command === 'z') {\n for (var idx = ca.length - 2; idx >= 0; idx--) {\n if (ca[idx].command === 'M') {\n cpx = ca[idx].points[0] + dx;\n cpy = ca[idx].points[1] + dy;\n break;\n }\n }\n }\n points.push(cpx, cpy);\n c = 'l';\n break;\n case 'M':\n cpx = p.shift();\n cpy = p.shift();\n cmd = 'M';\n points.push(cpx, cpy);\n c = 'L';\n break;\n case 'h':\n cpx += p.shift();\n cmd = 'L';\n points.push(cpx, cpy);\n break;\n case 'H':\n cpx = p.shift();\n cmd = 'L';\n points.push(cpx, cpy);\n break;\n case 'v':\n cpy += p.shift();\n cmd = 'L';\n points.push(cpx, cpy);\n break;\n case 'V':\n cpy = p.shift();\n cmd = 'L';\n points.push(cpx, cpy);\n break;\n case 'C':\n points.push(p.shift(), p.shift(), p.shift(), p.shift());\n cpx = p.shift();\n cpy = p.shift();\n points.push(cpx, cpy);\n break;\n case 'c':\n points.push(cpx + p.shift(), cpy + p.shift(), cpx + p.shift(), cpy + p.shift());\n cpx += p.shift();\n cpy += p.shift();\n cmd = 'C';\n points.push(cpx, cpy);\n break;\n case 'S':\n ctlPtx = cpx;\n ctlPty = cpy;\n prevCmd = ca[ca.length - 1];\n if (prevCmd.command === 'C') {\n ctlPtx = cpx + (cpx - prevCmd.points[2]);\n ctlPty = cpy + (cpy - prevCmd.points[3]);\n }\n points.push(ctlPtx, ctlPty, p.shift(), p.shift());\n cpx = p.shift();\n cpy = p.shift();\n cmd = 'C';\n points.push(cpx, cpy);\n break;\n case 's':\n ctlPtx = cpx;\n ctlPty = cpy;\n prevCmd = ca[ca.length - 1];\n if (prevCmd.command === 'C') {\n ctlPtx = cpx + (cpx - prevCmd.points[2]);\n ctlPty = cpy + (cpy - prevCmd.points[3]);\n }\n points.push(ctlPtx, ctlPty, cpx + p.shift(), cpy + p.shift());\n cpx += p.shift();\n cpy += p.shift();\n cmd = 'C';\n points.push(cpx, cpy);\n break;\n case 'Q':\n points.push(p.shift(), p.shift());\n cpx = p.shift();\n cpy = p.shift();\n points.push(cpx, cpy);\n break;\n case 'q':\n points.push(cpx + p.shift(), cpy + p.shift());\n cpx += p.shift();\n cpy += p.shift();\n cmd = 'Q';\n points.push(cpx, cpy);\n break;\n case 'T':\n ctlPtx = cpx;\n ctlPty = cpy;\n prevCmd = ca[ca.length - 1];\n if (prevCmd.command === 'Q') {\n ctlPtx = cpx + (cpx - prevCmd.points[0]);\n ctlPty = cpy + (cpy - prevCmd.points[1]);\n }\n cpx = p.shift();\n cpy = p.shift();\n cmd = 'Q';\n points.push(ctlPtx, ctlPty, cpx, cpy);\n break;\n case 't':\n ctlPtx = cpx;\n ctlPty = cpy;\n prevCmd = ca[ca.length - 1];\n if (prevCmd.command === 'Q') {\n ctlPtx = cpx + (cpx - prevCmd.points[0]);\n ctlPty = cpy + (cpy - prevCmd.points[1]);\n }\n cpx += p.shift();\n cpy += p.shift();\n cmd = 'Q';\n points.push(ctlPtx, ctlPty, cpx, cpy);\n break;\n case 'A':\n rx = p.shift();\n ry = p.shift();\n psi = p.shift();\n fa = p.shift();\n fs = p.shift();\n x1 = cpx;\n y1 = cpy;\n cpx = p.shift();\n cpy = p.shift();\n cmd = 'A';\n points = this.convertEndpointToCenterParameterization(x1, y1, cpx, cpy, fa, fs, rx, ry, psi);\n break;\n case 'a':\n rx = p.shift();\n ry = p.shift();\n psi = p.shift();\n fa = p.shift();\n fs = p.shift();\n x1 = cpx;\n y1 = cpy;\n cpx += p.shift();\n cpy += p.shift();\n cmd = 'A';\n points = this.convertEndpointToCenterParameterization(x1, y1, cpx, cpy, fa, fs, rx, ry, psi);\n break;\n }\n ca.push({\n command: cmd || c,\n points: points,\n start: {\n x: startX,\n y: startY,\n },\n pathLength: this.calcLength(startX, startY, cmd || c, points),\n });\n }\n if (c === 'z' || c === 'Z') {\n ca.push({\n command: 'z',\n points: [],\n start: undefined,\n pathLength: 0,\n });\n }\n }\n return ca;\n }\n static calcLength(x, y, cmd, points) {\n var len, p1, p2, t;\n var path = Path;\n switch (cmd) {\n case 'L':\n return path.getLineLength(x, y, points[0], points[1]);\n case 'C':\n return (0, BezierFunctions_1.getCubicArcLength)([x, points[0], points[2], points[4]], [y, points[1], points[3], points[5]], 1);\n case 'Q':\n return (0, BezierFunctions_1.getQuadraticArcLength)([x, points[0], points[2]], [y, points[1], points[3]], 1);\n case 'A':\n len = 0.0;\n var start = points[4];\n var dTheta = points[5];\n var end = points[4] + dTheta;\n var inc = Math.PI / 180.0;\n if (Math.abs(start - end) < inc) {\n inc = Math.abs(start - end);\n }\n p1 = path.getPointOnEllipticalArc(points[0], points[1], points[2], points[3], start, 0);\n if (dTheta < 0) {\n for (t = start - inc; t > end; t -= inc) {\n p2 = path.getPointOnEllipticalArc(points[0], points[1], points[2], points[3], t, 0);\n len += path.getLineLength(p1.x, p1.y, p2.x, p2.y);\n p1 = p2;\n }\n }\n else {\n for (t = start + inc; t < end; t += inc) {\n p2 = path.getPointOnEllipticalArc(points[0], points[1], points[2], points[3], t, 0);\n len += path.getLineLength(p1.x, p1.y, p2.x, p2.y);\n p1 = p2;\n }\n }\n p2 = path.getPointOnEllipticalArc(points[0], points[1], points[2], points[3], end, 0);\n len += path.getLineLength(p1.x, p1.y, p2.x, p2.y);\n return len;\n }\n return 0;\n }\n static convertEndpointToCenterParameterization(x1, y1, x2, y2, fa, fs, rx, ry, psiDeg) {\n var psi = psiDeg * (Math.PI / 180.0);\n var xp = (Math.cos(psi) * (x1 - x2)) / 2.0 + (Math.sin(psi) * (y1 - y2)) / 2.0;\n var yp = (-1 * Math.sin(psi) * (x1 - x2)) / 2.0 +\n (Math.cos(psi) * (y1 - y2)) / 2.0;\n var lambda = (xp * xp) / (rx * rx) + (yp * yp) / (ry * ry);\n if (lambda > 1) {\n rx *= Math.sqrt(lambda);\n ry *= Math.sqrt(lambda);\n }\n var f = Math.sqrt((rx * rx * (ry * ry) - rx * rx * (yp * yp) - ry * ry * (xp * xp)) /\n (rx * rx * (yp * yp) + ry * ry * (xp * xp)));\n if (fa === fs) {\n f *= -1;\n }\n if (isNaN(f)) {\n f = 0;\n }\n var cxp = (f * rx * yp) / ry;\n var cyp = (f * -ry * xp) / rx;\n var cx = (x1 + x2) / 2.0 + Math.cos(psi) * cxp - Math.sin(psi) * cyp;\n var cy = (y1 + y2) / 2.0 + Math.sin(psi) * cxp + Math.cos(psi) * cyp;\n var vMag = function (v) {\n return Math.sqrt(v[0] * v[0] + v[1] * v[1]);\n };\n var vRatio = function (u, v) {\n return (u[0] * v[0] + u[1] * v[1]) / (vMag(u) * vMag(v));\n };\n var vAngle = function (u, v) {\n return (u[0] * v[1] < u[1] * v[0] ? -1 : 1) * Math.acos(vRatio(u, v));\n };\n var theta = vAngle([1, 0], [(xp - cxp) / rx, (yp - cyp) / ry]);\n var u = [(xp - cxp) / rx, (yp - cyp) / ry];\n var v = [(-1 * xp - cxp) / rx, (-1 * yp - cyp) / ry];\n var dTheta = vAngle(u, v);\n if (vRatio(u, v) <= -1) {\n dTheta = Math.PI;\n }\n if (vRatio(u, v) >= 1) {\n dTheta = 0;\n }\n if (fs === 0 && dTheta > 0) {\n dTheta = dTheta - 2 * Math.PI;\n }\n if (fs === 1 && dTheta < 0) {\n dTheta = dTheta + 2 * Math.PI;\n }\n return [cx, cy, rx, ry, theta, dTheta, psi, fs];\n }\n}\nexports.Path = Path;\nPath.prototype.className = 'Path';\nPath.prototype._attrsAffectingSize = ['data'];\n(0, Global_1._registerNode)(Path);\nFactory_1.Factory.addGetterSetter(Path, 'data');\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Arrow = void 0;\nconst Factory_1 = require(\"../Factory\");\nconst Line_1 = require(\"./Line\");\nconst Validators_1 = require(\"../Validators\");\nconst Global_1 = require(\"../Global\");\nconst Path_1 = require(\"./Path\");\nclass Arrow extends Line_1.Line {\n _sceneFunc(ctx) {\n super._sceneFunc(ctx);\n var PI2 = Math.PI * 2;\n var points = this.points();\n var tp = points;\n var fromTension = this.tension() !== 0 && points.length > 4;\n if (fromTension) {\n tp = this.getTensionPoints();\n }\n var length = this.pointerLength();\n var n = points.length;\n var dx, dy;\n if (fromTension) {\n const lp = [\n tp[tp.length - 4],\n tp[tp.length - 3],\n tp[tp.length - 2],\n tp[tp.length - 1],\n points[n - 2],\n points[n - 1],\n ];\n const lastLength = Path_1.Path.calcLength(tp[tp.length - 4], tp[tp.length - 3], 'C', lp);\n const previous = Path_1.Path.getPointOnQuadraticBezier(Math.min(1, 1 - length / lastLength), lp[0], lp[1], lp[2], lp[3], lp[4], lp[5]);\n dx = points[n - 2] - previous.x;\n dy = points[n - 1] - previous.y;\n }\n else {\n dx = points[n - 2] - points[n - 4];\n dy = points[n - 1] - points[n - 3];\n }\n var radians = (Math.atan2(dy, dx) + PI2) % PI2;\n var width = this.pointerWidth();\n if (this.pointerAtEnding()) {\n ctx.save();\n ctx.beginPath();\n ctx.translate(points[n - 2], points[n - 1]);\n ctx.rotate(radians);\n ctx.moveTo(0, 0);\n ctx.lineTo(-length, width / 2);\n ctx.lineTo(-length, -width / 2);\n ctx.closePath();\n ctx.restore();\n this.__fillStroke(ctx);\n }\n if (this.pointerAtBeginning()) {\n ctx.save();\n ctx.beginPath();\n ctx.translate(points[0], points[1]);\n if (fromTension) {\n dx = (tp[0] + tp[2]) / 2 - points[0];\n dy = (tp[1] + tp[3]) / 2 - points[1];\n }\n else {\n dx = points[2] - points[0];\n dy = points[3] - points[1];\n }\n ctx.rotate((Math.atan2(-dy, -dx) + PI2) % PI2);\n ctx.moveTo(0, 0);\n ctx.lineTo(-length, width / 2);\n ctx.lineTo(-length, -width / 2);\n ctx.closePath();\n ctx.restore();\n this.__fillStroke(ctx);\n }\n }\n __fillStroke(ctx) {\n var isDashEnabled = this.dashEnabled();\n if (isDashEnabled) {\n this.attrs.dashEnabled = false;\n ctx.setLineDash([]);\n }\n ctx.fillStrokeShape(this);\n if (isDashEnabled) {\n this.attrs.dashEnabled = true;\n }\n }\n getSelfRect() {\n const lineRect = super.getSelfRect();\n const offset = this.pointerWidth() / 2;\n return {\n x: lineRect.x - offset,\n y: lineRect.y - offset,\n width: lineRect.width + offset * 2,\n height: lineRect.height + offset * 2,\n };\n }\n}\nexports.Arrow = Arrow;\nArrow.prototype.className = 'Arrow';\n(0, Global_1._registerNode)(Arrow);\nFactory_1.Factory.addGetterSetter(Arrow, 'pointerLength', 10, (0, Validators_1.getNumberValidator)());\nFactory_1.Factory.addGetterSetter(Arrow, 'pointerWidth', 10, (0, Validators_1.getNumberValidator)());\nFactory_1.Factory.addGetterSetter(Arrow, 'pointerAtBeginning', false);\nFactory_1.Factory.addGetterSetter(Arrow, 'pointerAtEnding', true);\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Circle = void 0;\nconst Factory_1 = require(\"../Factory\");\nconst Shape_1 = require(\"../Shape\");\nconst Validators_1 = require(\"../Validators\");\nconst Global_1 = require(\"../Global\");\nclass Circle extends Shape_1.Shape {\n _sceneFunc(context) {\n context.beginPath();\n context.arc(0, 0, this.attrs.radius || 0, 0, Math.PI * 2, false);\n context.closePath();\n context.fillStrokeShape(this);\n }\n getWidth() {\n return this.radius() * 2;\n }\n getHeight() {\n return this.radius() * 2;\n }\n setWidth(width) {\n if (this.radius() !== width / 2) {\n this.radius(width / 2);\n }\n }\n setHeight(height) {\n if (this.radius() !== height / 2) {\n this.radius(height / 2);\n }\n }\n}\nexports.Circle = Circle;\nCircle.prototype._centroid = true;\nCircle.prototype.className = 'Circle';\nCircle.prototype._attrsAffectingSize = ['radius'];\n(0, Global_1._registerNode)(Circle);\nFactory_1.Factory.addGetterSetter(Circle, 'radius', 0, (0, Validators_1.getNumberValidator)());\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Ellipse = void 0;\nconst Factory_1 = require(\"../Factory\");\nconst Shape_1 = require(\"../Shape\");\nconst Validators_1 = require(\"../Validators\");\nconst Global_1 = require(\"../Global\");\nclass Ellipse extends Shape_1.Shape {\n _sceneFunc(context) {\n var rx = this.radiusX(), ry = this.radiusY();\n context.beginPath();\n context.save();\n if (rx !== ry) {\n context.scale(1, ry / rx);\n }\n context.arc(0, 0, rx, 0, Math.PI * 2, false);\n context.restore();\n context.closePath();\n context.fillStrokeShape(this);\n }\n getWidth() {\n return this.radiusX() * 2;\n }\n getHeight() {\n return this.radiusY() * 2;\n }\n setWidth(width) {\n this.radiusX(width / 2);\n }\n setHeight(height) {\n this.radiusY(height / 2);\n }\n}\nexports.Ellipse = Ellipse;\nEllipse.prototype.className = 'Ellipse';\nEllipse.prototype._centroid = true;\nEllipse.prototype._attrsAffectingSize = ['radiusX', 'radiusY'];\n(0, Global_1._registerNode)(Ellipse);\nFactory_1.Factory.addComponentsGetterSetter(Ellipse, 'radius', ['x', 'y']);\nFactory_1.Factory.addGetterSetter(Ellipse, 'radiusX', 0, (0, Validators_1.getNumberValidator)());\nFactory_1.Factory.addGetterSetter(Ellipse, 'radiusY', 0, (0, Validators_1.getNumberValidator)());\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Image = void 0;\nconst Util_1 = require(\"../Util\");\nconst Factory_1 = require(\"../Factory\");\nconst Shape_1 = require(\"../Shape\");\nconst Global_1 = require(\"../Global\");\nconst Validators_1 = require(\"../Validators\");\nclass Image extends Shape_1.Shape {\n constructor(attrs) {\n super(attrs);\n this.on('imageChange.konva', () => {\n this._setImageLoad();\n });\n this._setImageLoad();\n }\n _setImageLoad() {\n const image = this.image();\n if (image && image.complete) {\n return;\n }\n if (image && image.readyState === 4) {\n return;\n }\n if (image && image['addEventListener']) {\n image['addEventListener']('load', () => {\n this._requestDraw();\n });\n }\n }\n _useBufferCanvas() {\n const hasCornerRadius = !!this.cornerRadius();\n const hasShadow = this.hasShadow();\n if (hasCornerRadius && hasShadow) {\n return true;\n }\n return super._useBufferCanvas(true);\n }\n _sceneFunc(context) {\n const width = this.getWidth();\n const height = this.getHeight();\n const cornerRadius = this.cornerRadius();\n const image = this.attrs.image;\n let params;\n if (image) {\n const cropWidth = this.attrs.cropWidth;\n const cropHeight = this.attrs.cropHeight;\n if (cropWidth && cropHeight) {\n params = [\n image,\n this.cropX(),\n this.cropY(),\n cropWidth,\n cropHeight,\n 0,\n 0,\n width,\n height,\n ];\n }\n else {\n params = [image, 0, 0, width, height];\n }\n }\n if (this.hasFill() || this.hasStroke() || cornerRadius) {\n context.beginPath();\n cornerRadius\n ? Util_1.Util.drawRoundedRectPath(context, width, height, cornerRadius)\n : context.rect(0, 0, width, height);\n context.closePath();\n context.fillStrokeShape(this);\n }\n if (image) {\n if (cornerRadius) {\n context.clip();\n }\n context.drawImage.apply(context, params);\n }\n }\n _hitFunc(context) {\n var width = this.width(), height = this.height(), cornerRadius = this.cornerRadius();\n context.beginPath();\n if (!cornerRadius) {\n context.rect(0, 0, width, height);\n }\n else {\n Util_1.Util.drawRoundedRectPath(context, width, height, cornerRadius);\n }\n context.closePath();\n context.fillStrokeShape(this);\n }\n getWidth() {\n var _a, _b;\n return (_a = this.attrs.width) !== null && _a !== void 0 ? _a : (_b = this.image()) === null || _b === void 0 ? void 0 : _b.width;\n }\n getHeight() {\n var _a, _b;\n return (_a = this.attrs.height) !== null && _a !== void 0 ? _a : (_b = this.image()) === null || _b === void 0 ? void 0 : _b.height;\n }\n static fromURL(url, callback, onError = null) {\n var img = Util_1.Util.createImageElement();\n img.onload = function () {\n var image = new Image({\n image: img,\n });\n callback(image);\n };\n img.onerror = onError;\n img.crossOrigin = 'Anonymous';\n img.src = url;\n }\n}\nexports.Image = Image;\nImage.prototype.className = 'Image';\n(0, Global_1._registerNode)(Image);\nFactory_1.Factory.addGetterSetter(Image, 'cornerRadius', 0, (0, Validators_1.getNumberOrArrayOfNumbersValidator)(4));\nFactory_1.Factory.addGetterSetter(Image, 'image');\nFactory_1.Factory.addComponentsGetterSetter(Image, 'crop', ['x', 'y', 'width', 'height']);\nFactory_1.Factory.addGetterSetter(Image, 'cropX', 0, (0, Validators_1.getNumberValidator)());\nFactory_1.Factory.addGetterSetter(Image, 'cropY', 0, (0, Validators_1.getNumberValidator)());\nFactory_1.Factory.addGetterSetter(Image, 'cropWidth', 0, (0, Validators_1.getNumberValidator)());\nFactory_1.Factory.addGetterSetter(Image, 'cropHeight', 0, (0, Validators_1.getNumberValidator)());\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Tag = exports.Label = void 0;\nconst Factory_1 = require(\"../Factory\");\nconst Shape_1 = require(\"../Shape\");\nconst Group_1 = require(\"../Group\");\nconst Validators_1 = require(\"../Validators\");\nconst Global_1 = require(\"../Global\");\nvar ATTR_CHANGE_LIST = [\n 'fontFamily',\n 'fontSize',\n 'fontStyle',\n 'padding',\n 'lineHeight',\n 'text',\n 'width',\n 'height',\n 'pointerDirection',\n 'pointerWidth',\n 'pointerHeight',\n], CHANGE_KONVA = 'Change.konva', NONE = 'none', UP = 'up', RIGHT = 'right', DOWN = 'down', LEFT = 'left', attrChangeListLen = ATTR_CHANGE_LIST.length;\nclass Label extends Group_1.Group {\n constructor(config) {\n super(config);\n this.on('add.konva', function (evt) {\n this._addListeners(evt.child);\n this._sync();\n });\n }\n getText() {\n return this.find('Text')[0];\n }\n getTag() {\n return this.find('Tag')[0];\n }\n _addListeners(text) {\n var that = this, n;\n var func = function () {\n that._sync();\n };\n for (n = 0; n < attrChangeListLen; n++) {\n text.on(ATTR_CHANGE_LIST[n] + CHANGE_KONVA, func);\n }\n }\n getWidth() {\n return this.getText().width();\n }\n getHeight() {\n return this.getText().height();\n }\n _sync() {\n var text = this.getText(), tag = this.getTag(), width, height, pointerDirection, pointerWidth, x, y, pointerHeight;\n if (text && tag) {\n width = text.width();\n height = text.height();\n pointerDirection = tag.pointerDirection();\n pointerWidth = tag.pointerWidth();\n pointerHeight = tag.pointerHeight();\n x = 0;\n y = 0;\n switch (pointerDirection) {\n case UP:\n x = width / 2;\n y = -1 * pointerHeight;\n break;\n case RIGHT:\n x = width + pointerWidth;\n y = height / 2;\n break;\n case DOWN:\n x = width / 2;\n y = height + pointerHeight;\n break;\n case LEFT:\n x = -1 * pointerWidth;\n y = height / 2;\n break;\n }\n tag.setAttrs({\n x: -1 * x,\n y: -1 * y,\n width: width,\n height: height,\n });\n text.setAttrs({\n x: -1 * x,\n y: -1 * y,\n });\n }\n }\n}\nexports.Label = Label;\nLabel.prototype.className = 'Label';\n(0, Global_1._registerNode)(Label);\nclass Tag extends Shape_1.Shape {\n _sceneFunc(context) {\n var width = this.width(), height = this.height(), pointerDirection = this.pointerDirection(), pointerWidth = this.pointerWidth(), pointerHeight = this.pointerHeight(), cornerRadius = this.cornerRadius();\n let topLeft = 0;\n let topRight = 0;\n let bottomLeft = 0;\n let bottomRight = 0;\n if (typeof cornerRadius === 'number') {\n topLeft =\n topRight =\n bottomLeft =\n bottomRight =\n Math.min(cornerRadius, width / 2, height / 2);\n }\n else {\n topLeft = Math.min(cornerRadius[0] || 0, width / 2, height / 2);\n topRight = Math.min(cornerRadius[1] || 0, width / 2, height / 2);\n bottomRight = Math.min(cornerRadius[2] || 0, width / 2, height / 2);\n bottomLeft = Math.min(cornerRadius[3] || 0, width / 2, height / 2);\n }\n context.beginPath();\n context.moveTo(topLeft, 0);\n if (pointerDirection === UP) {\n context.lineTo((width - pointerWidth) / 2, 0);\n context.lineTo(width / 2, -1 * pointerHeight);\n context.lineTo((width + pointerWidth) / 2, 0);\n }\n context.lineTo(width - topRight, 0);\n context.arc(width - topRight, topRight, topRight, (Math.PI * 3) / 2, 0, false);\n if (pointerDirection === RIGHT) {\n context.lineTo(width, (height - pointerHeight) / 2);\n context.lineTo(width + pointerWidth, height / 2);\n context.lineTo(width, (height + pointerHeight) / 2);\n }\n context.lineTo(width, height - bottomRight);\n context.arc(width - bottomRight, height - bottomRight, bottomRight, 0, Math.PI / 2, false);\n if (pointerDirection === DOWN) {\n context.lineTo((width + pointerWidth) / 2, height);\n context.lineTo(width / 2, height + pointerHeight);\n context.lineTo((width - pointerWidth) / 2, height);\n }\n context.lineTo(bottomLeft, height);\n context.arc(bottomLeft, height - bottomLeft, bottomLeft, Math.PI / 2, Math.PI, false);\n if (pointerDirection === LEFT) {\n context.lineTo(0, (height + pointerHeight) / 2);\n context.lineTo(-1 * pointerWidth, height / 2);\n context.lineTo(0, (height - pointerHeight) / 2);\n }\n context.lineTo(0, topLeft);\n context.arc(topLeft, topLeft, topLeft, Math.PI, (Math.PI * 3) / 2, false);\n context.closePath();\n context.fillStrokeShape(this);\n }\n getSelfRect() {\n var x = 0, y = 0, pointerWidth = this.pointerWidth(), pointerHeight = this.pointerHeight(), direction = this.pointerDirection(), width = this.width(), height = this.height();\n if (direction === UP) {\n y -= pointerHeight;\n height += pointerHeight;\n }\n else if (direction === DOWN) {\n height += pointerHeight;\n }\n else if (direction === LEFT) {\n x -= pointerWidth * 1.5;\n width += pointerWidth;\n }\n else if (direction === RIGHT) {\n width += pointerWidth * 1.5;\n }\n return {\n x: x,\n y: y,\n width: width,\n height: height,\n };\n }\n}\nexports.Tag = Tag;\nTag.prototype.className = 'Tag';\n(0, Global_1._registerNode)(Tag);\nFactory_1.Factory.addGetterSetter(Tag, 'pointerDirection', NONE);\nFactory_1.Factory.addGetterSetter(Tag, 'pointerWidth', 0, (0, Validators_1.getNumberValidator)());\nFactory_1.Factory.addGetterSetter(Tag, 'pointerHeight', 0, (0, Validators_1.getNumberValidator)());\nFactory_1.Factory.addGetterSetter(Tag, 'cornerRadius', 0, (0, Validators_1.getNumberOrArrayOfNumbersValidator)(4));\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Rect = void 0;\nconst Factory_1 = require(\"../Factory\");\nconst Shape_1 = require(\"../Shape\");\nconst Global_1 = require(\"../Global\");\nconst Util_1 = require(\"../Util\");\nconst Validators_1 = require(\"../Validators\");\nclass Rect extends Shape_1.Shape {\n _sceneFunc(context) {\n var cornerRadius = this.cornerRadius(), width = this.width(), height = this.height();\n context.beginPath();\n if (!cornerRadius) {\n context.rect(0, 0, width, height);\n }\n else {\n Util_1.Util.drawRoundedRectPath(context, width, height, cornerRadius);\n }\n context.closePath();\n context.fillStrokeShape(this);\n }\n}\nexports.Rect = Rect;\nRect.prototype.className = 'Rect';\n(0, Global_1._registerNode)(Rect);\nFactory_1.Factory.addGetterSetter(Rect, 'cornerRadius', 0, (0, Validators_1.getNumberOrArrayOfNumbersValidator)(4));\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.RegularPolygon = void 0;\nconst Factory_1 = require(\"../Factory\");\nconst Shape_1 = require(\"../Shape\");\nconst Validators_1 = require(\"../Validators\");\nconst Global_1 = require(\"../Global\");\nclass RegularPolygon extends Shape_1.Shape {\n _sceneFunc(context) {\n const points = this._getPoints();\n context.beginPath();\n context.moveTo(points[0].x, points[0].y);\n for (var n = 1; n < points.length; n++) {\n context.lineTo(points[n].x, points[n].y);\n }\n context.closePath();\n context.fillStrokeShape(this);\n }\n _getPoints() {\n const sides = this.attrs.sides;\n const radius = this.attrs.radius || 0;\n const points = [];\n for (var n = 0; n < sides; n++) {\n points.push({\n x: radius * Math.sin((n * 2 * Math.PI) / sides),\n y: -1 * radius * Math.cos((n * 2 * Math.PI) / sides),\n });\n }\n return points;\n }\n getSelfRect() {\n const points = this._getPoints();\n var minX = points[0].x;\n var maxX = points[0].y;\n var minY = points[0].x;\n var maxY = points[0].y;\n points.forEach((point) => {\n minX = Math.min(minX, point.x);\n maxX = Math.max(maxX, point.x);\n minY = Math.min(minY, point.y);\n maxY = Math.max(maxY, point.y);\n });\n return {\n x: minX,\n y: minY,\n width: maxX - minX,\n height: maxY - minY,\n };\n }\n getWidth() {\n return this.radius() * 2;\n }\n getHeight() {\n return this.radius() * 2;\n }\n setWidth(width) {\n this.radius(width / 2);\n }\n setHeight(height) {\n this.radius(height / 2);\n }\n}\nexports.RegularPolygon = RegularPolygon;\nRegularPolygon.prototype.className = 'RegularPolygon';\nRegularPolygon.prototype._centroid = true;\nRegularPolygon.prototype._attrsAffectingSize = ['radius'];\n(0, Global_1._registerNode)(RegularPolygon);\nFactory_1.Factory.addGetterSetter(RegularPolygon, 'radius', 0, (0, Validators_1.getNumberValidator)());\nFactory_1.Factory.addGetterSetter(RegularPolygon, 'sides', 0, (0, Validators_1.getNumberValidator)());\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Ring = void 0;\nconst Factory_1 = require(\"../Factory\");\nconst Shape_1 = require(\"../Shape\");\nconst Validators_1 = require(\"../Validators\");\nconst Global_1 = require(\"../Global\");\nvar PIx2 = Math.PI * 2;\nclass Ring extends Shape_1.Shape {\n _sceneFunc(context) {\n context.beginPath();\n context.arc(0, 0, this.innerRadius(), 0, PIx2, false);\n context.moveTo(this.outerRadius(), 0);\n context.arc(0, 0, this.outerRadius(), PIx2, 0, true);\n context.closePath();\n context.fillStrokeShape(this);\n }\n getWidth() {\n return this.outerRadius() * 2;\n }\n getHeight() {\n return this.outerRadius() * 2;\n }\n setWidth(width) {\n this.outerRadius(width / 2);\n }\n setHeight(height) {\n this.outerRadius(height / 2);\n }\n}\nexports.Ring = Ring;\nRing.prototype.className = 'Ring';\nRing.prototype._centroid = true;\nRing.prototype._attrsAffectingSize = ['innerRadius', 'outerRadius'];\n(0, Global_1._registerNode)(Ring);\nFactory_1.Factory.addGetterSetter(Ring, 'innerRadius', 0, (0, Validators_1.getNumberValidator)());\nFactory_1.Factory.addGetterSetter(Ring, 'outerRadius', 0, (0, Validators_1.getNumberValidator)());\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Sprite = void 0;\nconst Factory_1 = require(\"../Factory\");\nconst Shape_1 = require(\"../Shape\");\nconst Animation_1 = require(\"../Animation\");\nconst Validators_1 = require(\"../Validators\");\nconst Global_1 = require(\"../Global\");\nclass Sprite extends Shape_1.Shape {\n constructor(config) {\n super(config);\n this._updated = true;\n this.anim = new Animation_1.Animation(() => {\n var updated = this._updated;\n this._updated = false;\n return updated;\n });\n this.on('animationChange.konva', function () {\n this.frameIndex(0);\n });\n this.on('frameIndexChange.konva', function () {\n this._updated = true;\n });\n this.on('frameRateChange.konva', function () {\n if (!this.anim.isRunning()) {\n return;\n }\n clearInterval(this.interval);\n this._setInterval();\n });\n }\n _sceneFunc(context) {\n var anim = this.animation(), index = this.frameIndex(), ix4 = index * 4, set = this.animations()[anim], offsets = this.frameOffsets(), x = set[ix4 + 0], y = set[ix4 + 1], width = set[ix4 + 2], height = set[ix4 + 3], image = this.image();\n if (this.hasFill() || this.hasStroke()) {\n context.beginPath();\n context.rect(0, 0, width, height);\n context.closePath();\n context.fillStrokeShape(this);\n }\n if (image) {\n if (offsets) {\n var offset = offsets[anim], ix2 = index * 2;\n context.drawImage(image, x, y, width, height, offset[ix2 + 0], offset[ix2 + 1], width, height);\n }\n else {\n context.drawImage(image, x, y, width, height, 0, 0, width, height);\n }\n }\n }\n _hitFunc(context) {\n var anim = this.animation(), index = this.frameIndex(), ix4 = index * 4, set = this.animations()[anim], offsets = this.frameOffsets(), width = set[ix4 + 2], height = set[ix4 + 3];\n context.beginPath();\n if (offsets) {\n var offset = offsets[anim];\n var ix2 = index * 2;\n context.rect(offset[ix2 + 0], offset[ix2 + 1], width, height);\n }\n else {\n context.rect(0, 0, width, height);\n }\n context.closePath();\n context.fillShape(this);\n }\n _useBufferCanvas() {\n return super._useBufferCanvas(true);\n }\n _setInterval() {\n var that = this;\n this.interval = setInterval(function () {\n that._updateIndex();\n }, 1000 / this.frameRate());\n }\n start() {\n if (this.isRunning()) {\n return;\n }\n var layer = this.getLayer();\n this.anim.setLayers(layer);\n this._setInterval();\n this.anim.start();\n }\n stop() {\n this.anim.stop();\n clearInterval(this.interval);\n }\n isRunning() {\n return this.anim.isRunning();\n }\n _updateIndex() {\n var index = this.frameIndex(), animation = this.animation(), animations = this.animations(), anim = animations[animation], len = anim.length / 4;\n if (index < len - 1) {\n this.frameIndex(index + 1);\n }\n else {\n this.frameIndex(0);\n }\n }\n}\nexports.Sprite = Sprite;\nSprite.prototype.className = 'Sprite';\n(0, Global_1._registerNode)(Sprite);\nFactory_1.Factory.addGetterSetter(Sprite, 'animation');\nFactory_1.Factory.addGetterSetter(Sprite, 'animations');\nFactory_1.Factory.addGetterSetter(Sprite, 'frameOffsets');\nFactory_1.Factory.addGetterSetter(Sprite, 'image');\nFactory_1.Factory.addGetterSetter(Sprite, 'frameIndex', 0, (0, Validators_1.getNumberValidator)());\nFactory_1.Factory.addGetterSetter(Sprite, 'frameRate', 17, (0, Validators_1.getNumberValidator)());\nFactory_1.Factory.backCompat(Sprite, {\n index: 'frameIndex',\n getIndex: 'getFrameIndex',\n setIndex: 'setFrameIndex',\n});\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Star = void 0;\nconst Factory_1 = require(\"../Factory\");\nconst Shape_1 = require(\"../Shape\");\nconst Validators_1 = require(\"../Validators\");\nconst Global_1 = require(\"../Global\");\nclass Star extends Shape_1.Shape {\n _sceneFunc(context) {\n var innerRadius = this.innerRadius(), outerRadius = this.outerRadius(), numPoints = this.numPoints();\n context.beginPath();\n context.moveTo(0, 0 - outerRadius);\n for (var n = 1; n < numPoints * 2; n++) {\n var radius = n % 2 === 0 ? outerRadius : innerRadius;\n var x = radius * Math.sin((n * Math.PI) / numPoints);\n var y = -1 * radius * Math.cos((n * Math.PI) / numPoints);\n context.lineTo(x, y);\n }\n context.closePath();\n context.fillStrokeShape(this);\n }\n getWidth() {\n return this.outerRadius() * 2;\n }\n getHeight() {\n return this.outerRadius() * 2;\n }\n setWidth(width) {\n this.outerRadius(width / 2);\n }\n setHeight(height) {\n this.outerRadius(height / 2);\n }\n}\nexports.Star = Star;\nStar.prototype.className = 'Star';\nStar.prototype._centroid = true;\nStar.prototype._attrsAffectingSize = ['innerRadius', 'outerRadius'];\n(0, Global_1._registerNode)(Star);\nFactory_1.Factory.addGetterSetter(Star, 'numPoints', 5, (0, Validators_1.getNumberValidator)());\nFactory_1.Factory.addGetterSetter(Star, 'innerRadius', 0, (0, Validators_1.getNumberValidator)());\nFactory_1.Factory.addGetterSetter(Star, 'outerRadius', 0, (0, Validators_1.getNumberValidator)());\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Text = exports.stringToArray = void 0;\nconst Util_1 = require(\"../Util\");\nconst Factory_1 = require(\"../Factory\");\nconst Shape_1 = require(\"../Shape\");\nconst Global_1 = require(\"../Global\");\nconst Validators_1 = require(\"../Validators\");\nconst Global_2 = require(\"../Global\");\nfunction stringToArray(string) {\n return [...string].reduce((acc, char, index, array) => {\n if (/\\p{Emoji_Modifier_Base}\\p{Emoji_Modifier}?(?:\\u200D\\p{Emoji_Presentation})+/u.test(char)) {\n acc.push(char);\n }\n else if (/\\p{Regional_Indicator}{2}/u.test(char + (array[index + 1] || ''))) {\n acc.push(char + array[index + 1]);\n }\n else if (index > 0 && /\\p{Mn}|\\p{Me}|\\p{Mc}/u.test(char)) {\n acc[acc.length - 1] += char;\n }\n else {\n acc.push(char);\n }\n return acc;\n }, []);\n}\nexports.stringToArray = stringToArray;\nvar AUTO = 'auto', CENTER = 'center', INHERIT = 'inherit', JUSTIFY = 'justify', CHANGE_KONVA = 'Change.konva', CONTEXT_2D = '2d', DASH = '-', LEFT = 'left', LTR = 'ltr', TEXT = 'text', TEXT_UPPER = 'Text', TOP = 'top', BOTTOM = 'bottom', MIDDLE = 'middle', NORMAL = 'normal', PX_SPACE = 'px ', SPACE = ' ', RIGHT = 'right', RTL = 'rtl', WORD = 'word', CHAR = 'char', NONE = 'none', ELLIPSIS = '…', ATTR_CHANGE_LIST = [\n 'direction',\n 'fontFamily',\n 'fontSize',\n 'fontStyle',\n 'fontVariant',\n 'padding',\n 'align',\n 'verticalAlign',\n 'lineHeight',\n 'text',\n 'width',\n 'height',\n 'wrap',\n 'ellipsis',\n 'letterSpacing',\n], attrChangeListLen = ATTR_CHANGE_LIST.length;\nfunction normalizeFontFamily(fontFamily) {\n return fontFamily\n .split(',')\n .map((family) => {\n family = family.trim();\n const hasSpace = family.indexOf(' ') >= 0;\n const hasQuotes = family.indexOf('\"') >= 0 || family.indexOf(\"'\") >= 0;\n if (hasSpace && !hasQuotes) {\n family = `\"${family}\"`;\n }\n return family;\n })\n .join(', ');\n}\nvar dummyContext;\nfunction getDummyContext() {\n if (dummyContext) {\n return dummyContext;\n }\n dummyContext = Util_1.Util.createCanvasElement().getContext(CONTEXT_2D);\n return dummyContext;\n}\nfunction _fillFunc(context) {\n context.fillText(this._partialText, this._partialTextX, this._partialTextY);\n}\nfunction _strokeFunc(context) {\n context.setAttr('miterLimit', 2);\n context.strokeText(this._partialText, this._partialTextX, this._partialTextY);\n}\nfunction checkDefaultFill(config) {\n config = config || {};\n if (!config.fillLinearGradientColorStops &&\n !config.fillRadialGradientColorStops &&\n !config.fillPatternImage) {\n config.fill = config.fill || 'black';\n }\n return config;\n}\nclass Text extends Shape_1.Shape {\n constructor(config) {\n super(checkDefaultFill(config));\n this._partialTextX = 0;\n this._partialTextY = 0;\n for (var n = 0; n < attrChangeListLen; n++) {\n this.on(ATTR_CHANGE_LIST[n] + CHANGE_KONVA, this._setTextData);\n }\n this._setTextData();\n }\n _sceneFunc(context) {\n var textArr = this.textArr, textArrLen = textArr.length;\n if (!this.text()) {\n return;\n }\n var padding = this.padding(), fontSize = this.fontSize(), lineHeightPx = this.lineHeight() * fontSize, verticalAlign = this.verticalAlign(), direction = this.direction(), alignY = 0, align = this.align(), totalWidth = this.getWidth(), letterSpacing = this.letterSpacing(), fill = this.fill(), textDecoration = this.textDecoration(), shouldUnderline = textDecoration.indexOf('underline') !== -1, shouldLineThrough = textDecoration.indexOf('line-through') !== -1, n;\n direction = direction === INHERIT ? context.direction : direction;\n var translateY = lineHeightPx / 2;\n var baseline = MIDDLE;\n if (Global_1.Konva._fixTextRendering) {\n var metrics = this.measureSize('M');\n baseline = 'alphabetic';\n translateY =\n (metrics.fontBoundingBoxAscent - metrics.fontBoundingBoxDescent) / 2 +\n lineHeightPx / 2;\n }\n var lineTranslateX = 0;\n var lineTranslateY = 0;\n if (direction === RTL) {\n context.setAttr('direction', direction);\n }\n context.setAttr('font', this._getContextFont());\n context.setAttr('textBaseline', baseline);\n context.setAttr('textAlign', LEFT);\n if (verticalAlign === MIDDLE) {\n alignY = (this.getHeight() - textArrLen * lineHeightPx - padding * 2) / 2;\n }\n else if (verticalAlign === BOTTOM) {\n alignY = this.getHeight() - textArrLen * lineHeightPx - padding * 2;\n }\n context.translate(padding, alignY + padding);\n for (n = 0; n < textArrLen; n++) {\n var lineTranslateX = 0;\n var lineTranslateY = 0;\n var obj = textArr[n], text = obj.text, width = obj.width, lastLine = obj.lastInParagraph, spacesNumber, oneWord, lineWidth;\n context.save();\n if (align === RIGHT) {\n lineTranslateX += totalWidth - width - padding * 2;\n }\n else if (align === CENTER) {\n lineTranslateX += (totalWidth - width - padding * 2) / 2;\n }\n if (shouldUnderline) {\n context.save();\n context.beginPath();\n let yOffset = Global_1.Konva._fixTextRendering\n ? Math.round(fontSize / 4)\n : Math.round(fontSize / 2);\n const x = lineTranslateX;\n const y = translateY + lineTranslateY + yOffset;\n context.moveTo(x, y);\n spacesNumber = text.split(' ').length - 1;\n oneWord = spacesNumber === 0;\n lineWidth =\n align === JUSTIFY && !lastLine ? totalWidth - padding * 2 : width;\n context.lineTo(x + Math.round(lineWidth), y);\n context.lineWidth = fontSize / 15;\n const gradient = this._getLinearGradient();\n context.strokeStyle = gradient || fill;\n context.stroke();\n context.restore();\n }\n if (shouldLineThrough) {\n context.save();\n context.beginPath();\n let yOffset = Global_1.Konva._fixTextRendering ? -Math.round(fontSize / 4) : 0;\n context.moveTo(lineTranslateX, translateY + lineTranslateY + yOffset);\n spacesNumber = text.split(' ').length - 1;\n oneWord = spacesNumber === 0;\n lineWidth =\n align === JUSTIFY && lastLine && !oneWord\n ? totalWidth - padding * 2\n : width;\n context.lineTo(lineTranslateX + Math.round(lineWidth), translateY + lineTranslateY + yOffset);\n context.lineWidth = fontSize / 15;\n const gradient = this._getLinearGradient();\n context.strokeStyle = gradient || fill;\n context.stroke();\n context.restore();\n }\n if (direction !== RTL && (letterSpacing !== 0 || align === JUSTIFY)) {\n spacesNumber = text.split(' ').length - 1;\n var array = stringToArray(text);\n for (var li = 0; li < array.length; li++) {\n var letter = array[li];\n if (letter === ' ' && !lastLine && align === JUSTIFY) {\n lineTranslateX += (totalWidth - padding * 2 - width) / spacesNumber;\n }\n this._partialTextX = lineTranslateX;\n this._partialTextY = translateY + lineTranslateY;\n this._partialText = letter;\n context.fillStrokeShape(this);\n lineTranslateX += this.measureSize(letter).width + letterSpacing;\n }\n }\n else {\n if (letterSpacing !== 0) {\n context.setAttr('letterSpacing', `${letterSpacing}px`);\n }\n this._partialTextX = lineTranslateX;\n this._partialTextY = translateY + lineTranslateY;\n this._partialText = text;\n context.fillStrokeShape(this);\n }\n context.restore();\n if (textArrLen > 1) {\n translateY += lineHeightPx;\n }\n }\n }\n _hitFunc(context) {\n var width = this.getWidth(), height = this.getHeight();\n context.beginPath();\n context.rect(0, 0, width, height);\n context.closePath();\n context.fillStrokeShape(this);\n }\n setText(text) {\n var str = Util_1.Util._isString(text)\n ? text\n : text === null || text === undefined\n ? ''\n : text + '';\n this._setAttr(TEXT, str);\n return this;\n }\n getWidth() {\n var isAuto = this.attrs.width === AUTO || this.attrs.width === undefined;\n return isAuto ? this.getTextWidth() + this.padding() * 2 : this.attrs.width;\n }\n getHeight() {\n var isAuto = this.attrs.height === AUTO || this.attrs.height === undefined;\n return isAuto\n ? this.fontSize() * this.textArr.length * this.lineHeight() +\n this.padding() * 2\n : this.attrs.height;\n }\n getTextWidth() {\n return this.textWidth;\n }\n getTextHeight() {\n Util_1.Util.warn('text.getTextHeight() method is deprecated. Use text.height() - for full height and text.fontSize() - for one line height.');\n return this.textHeight;\n }\n measureSize(text) {\n var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;\n var _context = getDummyContext(), fontSize = this.fontSize(), metrics;\n _context.save();\n _context.font = this._getContextFont();\n metrics = _context.measureText(text);\n _context.restore();\n const scaleFactor = fontSize / 100;\n return {\n actualBoundingBoxAscent: (_a = metrics.actualBoundingBoxAscent) !== null && _a !== void 0 ? _a : 71.58203125 * scaleFactor,\n actualBoundingBoxDescent: (_b = metrics.actualBoundingBoxDescent) !== null && _b !== void 0 ? _b : 0,\n actualBoundingBoxLeft: (_c = metrics.actualBoundingBoxLeft) !== null && _c !== void 0 ? _c : -7.421875 * scaleFactor,\n actualBoundingBoxRight: (_d = metrics.actualBoundingBoxRight) !== null && _d !== void 0 ? _d : 75.732421875 * scaleFactor,\n alphabeticBaseline: (_e = metrics.alphabeticBaseline) !== null && _e !== void 0 ? _e : 0,\n emHeightAscent: (_f = metrics.emHeightAscent) !== null && _f !== void 0 ? _f : 100 * scaleFactor,\n emHeightDescent: (_g = metrics.emHeightDescent) !== null && _g !== void 0 ? _g : -20 * scaleFactor,\n fontBoundingBoxAscent: (_h = metrics.fontBoundingBoxAscent) !== null && _h !== void 0 ? _h : 91 * scaleFactor,\n fontBoundingBoxDescent: (_j = metrics.fontBoundingBoxDescent) !== null && _j !== void 0 ? _j : 21 * scaleFactor,\n hangingBaseline: (_k = metrics.hangingBaseline) !== null && _k !== void 0 ? _k : 72.80000305175781 * scaleFactor,\n ideographicBaseline: (_l = metrics.ideographicBaseline) !== null && _l !== void 0 ? _l : -21 * scaleFactor,\n width: metrics.width,\n height: fontSize,\n };\n }\n _getContextFont() {\n return (this.fontStyle() +\n SPACE +\n this.fontVariant() +\n SPACE +\n (this.fontSize() + PX_SPACE) +\n normalizeFontFamily(this.fontFamily()));\n }\n _addTextLine(line) {\n const align = this.align();\n if (align === JUSTIFY) {\n line = line.trim();\n }\n var width = this._getTextWidth(line);\n return this.textArr.push({\n text: line,\n width: width,\n lastInParagraph: false,\n });\n }\n _getTextWidth(text) {\n var letterSpacing = this.letterSpacing();\n var length = text.length;\n return (getDummyContext().measureText(text).width +\n (length ? letterSpacing * (length - 1) : 0));\n }\n _setTextData() {\n var lines = this.text().split('\\n'), fontSize = +this.fontSize(), textWidth = 0, lineHeightPx = this.lineHeight() * fontSize, width = this.attrs.width, height = this.attrs.height, fixedWidth = width !== AUTO && width !== undefined, fixedHeight = height !== AUTO && height !== undefined, padding = this.padding(), maxWidth = width - padding * 2, maxHeightPx = height - padding * 2, currentHeightPx = 0, wrap = this.wrap(), shouldWrap = wrap !== NONE, wrapAtWord = wrap !== CHAR && shouldWrap, shouldAddEllipsis = this.ellipsis();\n this.textArr = [];\n getDummyContext().font = this._getContextFont();\n var additionalWidth = shouldAddEllipsis ? this._getTextWidth(ELLIPSIS) : 0;\n for (var i = 0, max = lines.length; i < max; ++i) {\n var line = lines[i];\n var lineWidth = this._getTextWidth(line);\n if (fixedWidth && lineWidth > maxWidth) {\n while (line.length > 0) {\n var low = 0, high = line.length, match = '', matchWidth = 0;\n while (low < high) {\n var mid = (low + high) >>> 1, substr = line.slice(0, mid + 1), substrWidth = this._getTextWidth(substr) + additionalWidth;\n if (substrWidth <= maxWidth) {\n low = mid + 1;\n match = substr;\n matchWidth = substrWidth;\n }\n else {\n high = mid;\n }\n }\n if (match) {\n if (wrapAtWord) {\n var wrapIndex;\n var nextChar = line[match.length];\n var nextIsSpaceOrDash = nextChar === SPACE || nextChar === DASH;\n if (nextIsSpaceOrDash && matchWidth <= maxWidth) {\n wrapIndex = match.length;\n }\n else {\n wrapIndex =\n Math.max(match.lastIndexOf(SPACE), match.lastIndexOf(DASH)) +\n 1;\n }\n if (wrapIndex > 0) {\n low = wrapIndex;\n match = match.slice(0, low);\n matchWidth = this._getTextWidth(match);\n }\n }\n match = match.trimRight();\n this._addTextLine(match);\n textWidth = Math.max(textWidth, matchWidth);\n currentHeightPx += lineHeightPx;\n var shouldHandleEllipsis = this._shouldHandleEllipsis(currentHeightPx);\n if (shouldHandleEllipsis) {\n this._tryToAddEllipsisToLastLine();\n break;\n }\n line = line.slice(low);\n line = line.trimLeft();\n if (line.length > 0) {\n lineWidth = this._getTextWidth(line);\n if (lineWidth <= maxWidth) {\n this._addTextLine(line);\n currentHeightPx += lineHeightPx;\n textWidth = Math.max(textWidth, lineWidth);\n break;\n }\n }\n }\n else {\n break;\n }\n }\n }\n else {\n this._addTextLine(line);\n currentHeightPx += lineHeightPx;\n textWidth = Math.max(textWidth, lineWidth);\n if (this._shouldHandleEllipsis(currentHeightPx) && i < max - 1) {\n this._tryToAddEllipsisToLastLine();\n }\n }\n if (this.textArr[this.textArr.length - 1]) {\n this.textArr[this.textArr.length - 1].lastInParagraph = true;\n }\n if (fixedHeight && currentHeightPx + lineHeightPx > maxHeightPx) {\n break;\n }\n }\n this.textHeight = fontSize;\n this.textWidth = textWidth;\n }\n _shouldHandleEllipsis(currentHeightPx) {\n var fontSize = +this.fontSize(), lineHeightPx = this.lineHeight() * fontSize, height = this.attrs.height, fixedHeight = height !== AUTO && height !== undefined, padding = this.padding(), maxHeightPx = height - padding * 2, wrap = this.wrap(), shouldWrap = wrap !== NONE;\n return (!shouldWrap ||\n (fixedHeight && currentHeightPx + lineHeightPx > maxHeightPx));\n }\n _tryToAddEllipsisToLastLine() {\n var width = this.attrs.width, fixedWidth = width !== AUTO && width !== undefined, padding = this.padding(), maxWidth = width - padding * 2, shouldAddEllipsis = this.ellipsis();\n var lastLine = this.textArr[this.textArr.length - 1];\n if (!lastLine || !shouldAddEllipsis) {\n return;\n }\n if (fixedWidth) {\n var haveSpace = this._getTextWidth(lastLine.text + ELLIPSIS) < maxWidth;\n if (!haveSpace) {\n lastLine.text = lastLine.text.slice(0, lastLine.text.length - 3);\n }\n }\n this.textArr.splice(this.textArr.length - 1, 1);\n this._addTextLine(lastLine.text + ELLIPSIS);\n }\n getStrokeScaleEnabled() {\n return true;\n }\n _useBufferCanvas() {\n const hasLine = this.textDecoration().indexOf('underline') !== -1 ||\n this.textDecoration().indexOf('line-through') !== -1;\n const hasShadow = this.hasShadow();\n if (hasLine && hasShadow) {\n return true;\n }\n return super._useBufferCanvas();\n }\n}\nexports.Text = Text;\nText.prototype._fillFunc = _fillFunc;\nText.prototype._strokeFunc = _strokeFunc;\nText.prototype.className = TEXT_UPPER;\nText.prototype._attrsAffectingSize = [\n 'text',\n 'fontSize',\n 'padding',\n 'wrap',\n 'lineHeight',\n 'letterSpacing',\n];\n(0, Global_2._registerNode)(Text);\nFactory_1.Factory.overWriteSetter(Text, 'width', (0, Validators_1.getNumberOrAutoValidator)());\nFactory_1.Factory.overWriteSetter(Text, 'height', (0, Validators_1.getNumberOrAutoValidator)());\nFactory_1.Factory.addGetterSetter(Text, 'direction', INHERIT);\nFactory_1.Factory.addGetterSetter(Text, 'fontFamily', 'Arial');\nFactory_1.Factory.addGetterSetter(Text, 'fontSize', 12, (0, Validators_1.getNumberValidator)());\nFactory_1.Factory.addGetterSetter(Text, 'fontStyle', NORMAL);\nFactory_1.Factory.addGetterSetter(Text, 'fontVariant', NORMAL);\nFactory_1.Factory.addGetterSetter(Text, 'padding', 0, (0, Validators_1.getNumberValidator)());\nFactory_1.Factory.addGetterSetter(Text, 'align', LEFT);\nFactory_1.Factory.addGetterSetter(Text, 'verticalAlign', TOP);\nFactory_1.Factory.addGetterSetter(Text, 'lineHeight', 1, (0, Validators_1.getNumberValidator)());\nFactory_1.Factory.addGetterSetter(Text, 'wrap', WORD);\nFactory_1.Factory.addGetterSetter(Text, 'ellipsis', false, (0, Validators_1.getBooleanValidator)());\nFactory_1.Factory.addGetterSetter(Text, 'letterSpacing', 0, (0, Validators_1.getNumberValidator)());\nFactory_1.Factory.addGetterSetter(Text, 'text', '', (0, Validators_1.getStringValidator)());\nFactory_1.Factory.addGetterSetter(Text, 'textDecoration', '');\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.TextPath = void 0;\nconst Util_1 = require(\"../Util\");\nconst Factory_1 = require(\"../Factory\");\nconst Shape_1 = require(\"../Shape\");\nconst Path_1 = require(\"./Path\");\nconst Text_1 = require(\"./Text\");\nconst Validators_1 = require(\"../Validators\");\nconst Global_1 = require(\"../Global\");\nvar EMPTY_STRING = '', NORMAL = 'normal';\nfunction _fillFunc(context) {\n context.fillText(this.partialText, 0, 0);\n}\nfunction _strokeFunc(context) {\n context.strokeText(this.partialText, 0, 0);\n}\nclass TextPath extends Shape_1.Shape {\n constructor(config) {\n super(config);\n this.dummyCanvas = Util_1.Util.createCanvasElement();\n this.dataArray = [];\n this._readDataAttribute();\n this.on('dataChange.konva', function () {\n this._readDataAttribute();\n this._setTextData();\n });\n this.on('textChange.konva alignChange.konva letterSpacingChange.konva kerningFuncChange.konva fontSizeChange.konva fontFamilyChange.konva', this._setTextData);\n this._setTextData();\n }\n _getTextPathLength() {\n return Path_1.Path.getPathLength(this.dataArray);\n }\n _getPointAtLength(length) {\n if (!this.attrs.data) {\n return null;\n }\n const totalLength = this.pathLength;\n if (length - 1 > totalLength) {\n return null;\n }\n return Path_1.Path.getPointAtLengthOfDataArray(length, this.dataArray);\n }\n _readDataAttribute() {\n this.dataArray = Path_1.Path.parsePathData(this.attrs.data);\n this.pathLength = this._getTextPathLength();\n }\n _sceneFunc(context) {\n context.setAttr('font', this._getContextFont());\n context.setAttr('textBaseline', this.textBaseline());\n context.setAttr('textAlign', 'left');\n context.save();\n var textDecoration = this.textDecoration();\n var fill = this.fill();\n var fontSize = this.fontSize();\n var glyphInfo = this.glyphInfo;\n if (textDecoration === 'underline') {\n context.beginPath();\n }\n for (var i = 0; i < glyphInfo.length; i++) {\n context.save();\n var p0 = glyphInfo[i].p0;\n context.translate(p0.x, p0.y);\n context.rotate(glyphInfo[i].rotation);\n this.partialText = glyphInfo[i].text;\n context.fillStrokeShape(this);\n if (textDecoration === 'underline') {\n if (i === 0) {\n context.moveTo(0, fontSize / 2 + 1);\n }\n context.lineTo(fontSize, fontSize / 2 + 1);\n }\n context.restore();\n }\n if (textDecoration === 'underline') {\n context.strokeStyle = fill;\n context.lineWidth = fontSize / 20;\n context.stroke();\n }\n context.restore();\n }\n _hitFunc(context) {\n context.beginPath();\n var glyphInfo = this.glyphInfo;\n if (glyphInfo.length >= 1) {\n var p0 = glyphInfo[0].p0;\n context.moveTo(p0.x, p0.y);\n }\n for (var i = 0; i < glyphInfo.length; i++) {\n var p1 = glyphInfo[i].p1;\n context.lineTo(p1.x, p1.y);\n }\n context.setAttr('lineWidth', this.fontSize());\n context.setAttr('strokeStyle', this.colorKey);\n context.stroke();\n }\n getTextWidth() {\n return this.textWidth;\n }\n getTextHeight() {\n Util_1.Util.warn('text.getTextHeight() method is deprecated. Use text.height() - for full height and text.fontSize() - for one line height.');\n return this.textHeight;\n }\n setText(text) {\n return Text_1.Text.prototype.setText.call(this, text);\n }\n _getContextFont() {\n return Text_1.Text.prototype._getContextFont.call(this);\n }\n _getTextSize(text) {\n var dummyCanvas = this.dummyCanvas;\n var _context = dummyCanvas.getContext('2d');\n _context.save();\n _context.font = this._getContextFont();\n var metrics = _context.measureText(text);\n _context.restore();\n return {\n width: metrics.width,\n height: parseInt(`${this.fontSize()}`, 10),\n };\n }\n _setTextData() {\n const { width, height } = this._getTextSize(this.attrs.text);\n this.textWidth = width;\n this.textHeight = height;\n this.glyphInfo = [];\n if (!this.attrs.data) {\n return null;\n }\n const letterSpacing = this.letterSpacing();\n const align = this.align();\n const kerningFunc = this.kerningFunc();\n const textWidth = Math.max(this.textWidth + ((this.attrs.text || '').length - 1) * letterSpacing, 0);\n let offset = 0;\n if (align === 'center') {\n offset = Math.max(0, this.pathLength / 2 - textWidth / 2);\n }\n if (align === 'right') {\n offset = Math.max(0, this.pathLength - textWidth);\n }\n const charArr = (0, Text_1.stringToArray)(this.text());\n let offsetToGlyph = offset;\n for (var i = 0; i < charArr.length; i++) {\n const charStartPoint = this._getPointAtLength(offsetToGlyph);\n if (!charStartPoint)\n return;\n let glyphWidth = this._getTextSize(charArr[i]).width + letterSpacing;\n if (charArr[i] === ' ' && align === 'justify') {\n const numberOfSpaces = this.text().split(' ').length - 1;\n glyphWidth += (this.pathLength - textWidth) / numberOfSpaces;\n }\n const charEndPoint = this._getPointAtLength(offsetToGlyph + glyphWidth);\n if (!charEndPoint)\n return;\n const width = Path_1.Path.getLineLength(charStartPoint.x, charStartPoint.y, charEndPoint.x, charEndPoint.y);\n let kern = 0;\n if (kerningFunc) {\n try {\n kern = kerningFunc(charArr[i - 1], charArr[i]) * this.fontSize();\n }\n catch (e) {\n kern = 0;\n }\n }\n charStartPoint.x += kern;\n charEndPoint.x += kern;\n this.textWidth += kern;\n const midpoint = Path_1.Path.getPointOnLine(kern + width / 2.0, charStartPoint.x, charStartPoint.y, charEndPoint.x, charEndPoint.y);\n const rotation = Math.atan2(charEndPoint.y - charStartPoint.y, charEndPoint.x - charStartPoint.x);\n this.glyphInfo.push({\n transposeX: midpoint.x,\n transposeY: midpoint.y,\n text: charArr[i],\n rotation: rotation,\n p0: charStartPoint,\n p1: charEndPoint,\n });\n offsetToGlyph += glyphWidth;\n }\n }\n getSelfRect() {\n if (!this.glyphInfo.length) {\n return {\n x: 0,\n y: 0,\n width: 0,\n height: 0,\n };\n }\n var points = [];\n this.glyphInfo.forEach(function (info) {\n points.push(info.p0.x);\n points.push(info.p0.y);\n points.push(info.p1.x);\n points.push(info.p1.y);\n });\n var minX = points[0] || 0;\n var maxX = points[0] || 0;\n var minY = points[1] || 0;\n var maxY = points[1] || 0;\n var x, y;\n for (var i = 0; i < points.length / 2; i++) {\n x = points[i * 2];\n y = points[i * 2 + 1];\n minX = Math.min(minX, x);\n maxX = Math.max(maxX, x);\n minY = Math.min(minY, y);\n maxY = Math.max(maxY, y);\n }\n var fontSize = this.fontSize();\n return {\n x: minX - fontSize / 2,\n y: minY - fontSize / 2,\n width: maxX - minX + fontSize,\n height: maxY - minY + fontSize,\n };\n }\n destroy() {\n Util_1.Util.releaseCanvas(this.dummyCanvas);\n return super.destroy();\n }\n}\nexports.TextPath = TextPath;\nTextPath.prototype._fillFunc = _fillFunc;\nTextPath.prototype._strokeFunc = _strokeFunc;\nTextPath.prototype._fillFuncHit = _fillFunc;\nTextPath.prototype._strokeFuncHit = _strokeFunc;\nTextPath.prototype.className = 'TextPath';\nTextPath.prototype._attrsAffectingSize = ['text', 'fontSize', 'data'];\n(0, Global_1._registerNode)(TextPath);\nFactory_1.Factory.addGetterSetter(TextPath, 'data');\nFactory_1.Factory.addGetterSetter(TextPath, 'fontFamily', 'Arial');\nFactory_1.Factory.addGetterSetter(TextPath, 'fontSize', 12, (0, Validators_1.getNumberValidator)());\nFactory_1.Factory.addGetterSetter(TextPath, 'fontStyle', NORMAL);\nFactory_1.Factory.addGetterSetter(TextPath, 'align', 'left');\nFactory_1.Factory.addGetterSetter(TextPath, 'letterSpacing', 0, (0, Validators_1.getNumberValidator)());\nFactory_1.Factory.addGetterSetter(TextPath, 'textBaseline', 'middle');\nFactory_1.Factory.addGetterSetter(TextPath, 'fontVariant', NORMAL);\nFactory_1.Factory.addGetterSetter(TextPath, 'text', EMPTY_STRING);\nFactory_1.Factory.addGetterSetter(TextPath, 'textDecoration', null);\nFactory_1.Factory.addGetterSetter(TextPath, 'kerningFunc', null);\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Transformer = void 0;\nconst Util_1 = require(\"../Util\");\nconst Factory_1 = require(\"../Factory\");\nconst Node_1 = require(\"../Node\");\nconst Shape_1 = require(\"../Shape\");\nconst Rect_1 = require(\"./Rect\");\nconst Group_1 = require(\"../Group\");\nconst Global_1 = require(\"../Global\");\nconst Validators_1 = require(\"../Validators\");\nconst Global_2 = require(\"../Global\");\nvar EVENTS_NAME = 'tr-konva';\nvar ATTR_CHANGE_LIST = [\n 'resizeEnabledChange',\n 'rotateAnchorOffsetChange',\n 'rotateEnabledChange',\n 'enabledAnchorsChange',\n 'anchorSizeChange',\n 'borderEnabledChange',\n 'borderStrokeChange',\n 'borderStrokeWidthChange',\n 'borderDashChange',\n 'anchorStrokeChange',\n 'anchorStrokeWidthChange',\n 'anchorFillChange',\n 'anchorCornerRadiusChange',\n 'ignoreStrokeChange',\n 'anchorStyleFuncChange',\n]\n .map((e) => e + `.${EVENTS_NAME}`)\n .join(' ');\nvar NODES_RECT = 'nodesRect';\nvar TRANSFORM_CHANGE_STR = [\n 'widthChange',\n 'heightChange',\n 'scaleXChange',\n 'scaleYChange',\n 'skewXChange',\n 'skewYChange',\n 'rotationChange',\n 'offsetXChange',\n 'offsetYChange',\n 'transformsEnabledChange',\n 'strokeWidthChange',\n];\nvar ANGLES = {\n 'top-left': -45,\n 'top-center': 0,\n 'top-right': 45,\n 'middle-right': -90,\n 'middle-left': 90,\n 'bottom-left': -135,\n 'bottom-center': 180,\n 'bottom-right': 135,\n};\nconst TOUCH_DEVICE = 'ontouchstart' in Global_1.Konva._global;\nfunction getCursor(anchorName, rad, rotateCursor) {\n if (anchorName === 'rotater') {\n return rotateCursor;\n }\n rad += Util_1.Util.degToRad(ANGLES[anchorName] || 0);\n var angle = ((Util_1.Util.radToDeg(rad) % 360) + 360) % 360;\n if (Util_1.Util._inRange(angle, 315 + 22.5, 360) || Util_1.Util._inRange(angle, 0, 22.5)) {\n return 'ns-resize';\n }\n else if (Util_1.Util._inRange(angle, 45 - 22.5, 45 + 22.5)) {\n return 'nesw-resize';\n }\n else if (Util_1.Util._inRange(angle, 90 - 22.5, 90 + 22.5)) {\n return 'ew-resize';\n }\n else if (Util_1.Util._inRange(angle, 135 - 22.5, 135 + 22.5)) {\n return 'nwse-resize';\n }\n else if (Util_1.Util._inRange(angle, 180 - 22.5, 180 + 22.5)) {\n return 'ns-resize';\n }\n else if (Util_1.Util._inRange(angle, 225 - 22.5, 225 + 22.5)) {\n return 'nesw-resize';\n }\n else if (Util_1.Util._inRange(angle, 270 - 22.5, 270 + 22.5)) {\n return 'ew-resize';\n }\n else if (Util_1.Util._inRange(angle, 315 - 22.5, 315 + 22.5)) {\n return 'nwse-resize';\n }\n else {\n Util_1.Util.error('Transformer has unknown angle for cursor detection: ' + angle);\n return 'pointer';\n }\n}\nvar ANCHORS_NAMES = [\n 'top-left',\n 'top-center',\n 'top-right',\n 'middle-right',\n 'middle-left',\n 'bottom-left',\n 'bottom-center',\n 'bottom-right',\n];\nvar MAX_SAFE_INTEGER = 100000000;\nfunction getCenter(shape) {\n return {\n x: shape.x +\n (shape.width / 2) * Math.cos(shape.rotation) +\n (shape.height / 2) * Math.sin(-shape.rotation),\n y: shape.y +\n (shape.height / 2) * Math.cos(shape.rotation) +\n (shape.width / 2) * Math.sin(shape.rotation),\n };\n}\nfunction rotateAroundPoint(shape, angleRad, point) {\n const x = point.x +\n (shape.x - point.x) * Math.cos(angleRad) -\n (shape.y - point.y) * Math.sin(angleRad);\n const y = point.y +\n (shape.x - point.x) * Math.sin(angleRad) +\n (shape.y - point.y) * Math.cos(angleRad);\n return {\n ...shape,\n rotation: shape.rotation + angleRad,\n x,\n y,\n };\n}\nfunction rotateAroundCenter(shape, deltaRad) {\n const center = getCenter(shape);\n return rotateAroundPoint(shape, deltaRad, center);\n}\nfunction getSnap(snaps, newRotationRad, tol) {\n let snapped = newRotationRad;\n for (let i = 0; i < snaps.length; i++) {\n const angle = Global_1.Konva.getAngle(snaps[i]);\n const absDiff = Math.abs(angle - newRotationRad) % (Math.PI * 2);\n const dif = Math.min(absDiff, Math.PI * 2 - absDiff);\n if (dif < tol) {\n snapped = angle;\n }\n }\n return snapped;\n}\nlet activeTransformersCount = 0;\nclass Transformer extends Group_1.Group {\n constructor(config) {\n super(config);\n this._movingAnchorName = null;\n this._transforming = false;\n this._createElements();\n this._handleMouseMove = this._handleMouseMove.bind(this);\n this._handleMouseUp = this._handleMouseUp.bind(this);\n this.update = this.update.bind(this);\n this.on(ATTR_CHANGE_LIST, this.update);\n if (this.getNode()) {\n this.update();\n }\n }\n attachTo(node) {\n this.setNode(node);\n return this;\n }\n setNode(node) {\n Util_1.Util.warn('tr.setNode(shape), tr.node(shape) and tr.attachTo(shape) methods are deprecated. Please use tr.nodes(nodesArray) instead.');\n return this.setNodes([node]);\n }\n getNode() {\n return this._nodes && this._nodes[0];\n }\n _getEventNamespace() {\n return EVENTS_NAME + this._id;\n }\n setNodes(nodes = []) {\n if (this._nodes && this._nodes.length) {\n this.detach();\n }\n const filteredNodes = nodes.filter((node) => {\n if (node.isAncestorOf(this)) {\n Util_1.Util.error('Konva.Transformer cannot be an a child of the node you are trying to attach');\n return false;\n }\n return true;\n });\n this._nodes = nodes = filteredNodes;\n if (nodes.length === 1 && this.useSingleNodeRotation()) {\n this.rotation(nodes[0].getAbsoluteRotation());\n }\n else {\n this.rotation(0);\n }\n this._nodes.forEach((node) => {\n const onChange = () => {\n if (this.nodes().length === 1 && this.useSingleNodeRotation()) {\n this.rotation(this.nodes()[0].getAbsoluteRotation());\n }\n this._resetTransformCache();\n if (!this._transforming && !this.isDragging()) {\n this.update();\n }\n };\n const additionalEvents = node._attrsAffectingSize\n .map((prop) => prop + 'Change.' + this._getEventNamespace())\n .join(' ');\n node.on(additionalEvents, onChange);\n node.on(TRANSFORM_CHANGE_STR.map((e) => e + `.${this._getEventNamespace()}`).join(' '), onChange);\n node.on(`absoluteTransformChange.${this._getEventNamespace()}`, onChange);\n this._proxyDrag(node);\n });\n this._resetTransformCache();\n var elementsCreated = !!this.findOne('.top-left');\n if (elementsCreated) {\n this.update();\n }\n return this;\n }\n _proxyDrag(node) {\n let lastPos;\n node.on(`dragstart.${this._getEventNamespace()}`, (e) => {\n lastPos = node.getAbsolutePosition();\n if (!this.isDragging() && node !== this.findOne('.back')) {\n this.startDrag(e, false);\n }\n });\n node.on(`dragmove.${this._getEventNamespace()}`, (e) => {\n if (!lastPos) {\n return;\n }\n const abs = node.getAbsolutePosition();\n const dx = abs.x - lastPos.x;\n const dy = abs.y - lastPos.y;\n this.nodes().forEach((otherNode) => {\n if (otherNode === node) {\n return;\n }\n if (otherNode.isDragging()) {\n return;\n }\n const otherAbs = otherNode.getAbsolutePosition();\n otherNode.setAbsolutePosition({\n x: otherAbs.x + dx,\n y: otherAbs.y + dy,\n });\n otherNode.startDrag(e);\n });\n lastPos = null;\n });\n }\n getNodes() {\n return this._nodes || [];\n }\n getActiveAnchor() {\n return this._movingAnchorName;\n }\n detach() {\n if (this._nodes) {\n this._nodes.forEach((node) => {\n node.off('.' + this._getEventNamespace());\n });\n }\n this._nodes = [];\n this._resetTransformCache();\n }\n _resetTransformCache() {\n this._clearCache(NODES_RECT);\n this._clearCache('transform');\n this._clearSelfAndDescendantCache('absoluteTransform');\n }\n _getNodeRect() {\n return this._getCache(NODES_RECT, this.__getNodeRect);\n }\n __getNodeShape(node, rot = this.rotation(), relative) {\n var rect = node.getClientRect({\n skipTransform: true,\n skipShadow: true,\n skipStroke: this.ignoreStroke(),\n });\n var absScale = node.getAbsoluteScale(relative);\n var absPos = node.getAbsolutePosition(relative);\n var dx = rect.x * absScale.x - node.offsetX() * absScale.x;\n var dy = rect.y * absScale.y - node.offsetY() * absScale.y;\n const rotation = (Global_1.Konva.getAngle(node.getAbsoluteRotation()) + Math.PI * 2) %\n (Math.PI * 2);\n const box = {\n x: absPos.x + dx * Math.cos(rotation) + dy * Math.sin(-rotation),\n y: absPos.y + dy * Math.cos(rotation) + dx * Math.sin(rotation),\n width: rect.width * absScale.x,\n height: rect.height * absScale.y,\n rotation: rotation,\n };\n return rotateAroundPoint(box, -Global_1.Konva.getAngle(rot), {\n x: 0,\n y: 0,\n });\n }\n __getNodeRect() {\n var node = this.getNode();\n if (!node) {\n return {\n x: -MAX_SAFE_INTEGER,\n y: -MAX_SAFE_INTEGER,\n width: 0,\n height: 0,\n rotation: 0,\n };\n }\n const totalPoints = [];\n this.nodes().map((node) => {\n const box = node.getClientRect({\n skipTransform: true,\n skipShadow: true,\n skipStroke: this.ignoreStroke(),\n });\n var points = [\n { x: box.x, y: box.y },\n { x: box.x + box.width, y: box.y },\n { x: box.x + box.width, y: box.y + box.height },\n { x: box.x, y: box.y + box.height },\n ];\n var trans = node.getAbsoluteTransform();\n points.forEach(function (point) {\n var transformed = trans.point(point);\n totalPoints.push(transformed);\n });\n });\n const tr = new Util_1.Transform();\n tr.rotate(-Global_1.Konva.getAngle(this.rotation()));\n var minX = Infinity, minY = Infinity, maxX = -Infinity, maxY = -Infinity;\n totalPoints.forEach(function (point) {\n var transformed = tr.point(point);\n if (minX === undefined) {\n minX = maxX = transformed.x;\n minY = maxY = transformed.y;\n }\n minX = Math.min(minX, transformed.x);\n minY = Math.min(minY, transformed.y);\n maxX = Math.max(maxX, transformed.x);\n maxY = Math.max(maxY, transformed.y);\n });\n tr.invert();\n const p = tr.point({ x: minX, y: minY });\n return {\n x: p.x,\n y: p.y,\n width: maxX - minX,\n height: maxY - minY,\n rotation: Global_1.Konva.getAngle(this.rotation()),\n };\n }\n getX() {\n return this._getNodeRect().x;\n }\n getY() {\n return this._getNodeRect().y;\n }\n getWidth() {\n return this._getNodeRect().width;\n }\n getHeight() {\n return this._getNodeRect().height;\n }\n _createElements() {\n this._createBack();\n ANCHORS_NAMES.forEach((name) => {\n this._createAnchor(name);\n });\n this._createAnchor('rotater');\n }\n _createAnchor(name) {\n var anchor = new Rect_1.Rect({\n stroke: 'rgb(0, 161, 255)',\n fill: 'white',\n strokeWidth: 1,\n name: name + ' _anchor',\n dragDistance: 0,\n draggable: true,\n hitStrokeWidth: TOUCH_DEVICE ? 10 : 'auto',\n });\n var self = this;\n anchor.on('mousedown touchstart', function (e) {\n self._handleMouseDown(e);\n });\n anchor.on('dragstart', (e) => {\n anchor.stopDrag();\n e.cancelBubble = true;\n });\n anchor.on('dragend', (e) => {\n e.cancelBubble = true;\n });\n anchor.on('mouseenter', () => {\n var rad = Global_1.Konva.getAngle(this.rotation());\n var rotateCursor = this.rotateAnchorCursor();\n var cursor = getCursor(name, rad, rotateCursor);\n anchor.getStage().content &&\n (anchor.getStage().content.style.cursor = cursor);\n this._cursorChange = true;\n });\n anchor.on('mouseout', () => {\n anchor.getStage().content &&\n (anchor.getStage().content.style.cursor = '');\n this._cursorChange = false;\n });\n this.add(anchor);\n }\n _createBack() {\n var back = new Shape_1.Shape({\n name: 'back',\n width: 0,\n height: 0,\n draggable: true,\n sceneFunc(ctx, shape) {\n var tr = shape.getParent();\n var padding = tr.padding();\n ctx.beginPath();\n ctx.rect(-padding, -padding, shape.width() + padding * 2, shape.height() + padding * 2);\n ctx.moveTo(shape.width() / 2, -padding);\n if (tr.rotateEnabled() && tr.rotateLineVisible()) {\n ctx.lineTo(shape.width() / 2, -tr.rotateAnchorOffset() * Util_1.Util._sign(shape.height()) - padding);\n }\n ctx.fillStrokeShape(shape);\n },\n hitFunc: (ctx, shape) => {\n if (!this.shouldOverdrawWholeArea()) {\n return;\n }\n var padding = this.padding();\n ctx.beginPath();\n ctx.rect(-padding, -padding, shape.width() + padding * 2, shape.height() + padding * 2);\n ctx.fillStrokeShape(shape);\n },\n });\n this.add(back);\n this._proxyDrag(back);\n back.on('dragstart', (e) => {\n e.cancelBubble = true;\n });\n back.on('dragmove', (e) => {\n e.cancelBubble = true;\n });\n back.on('dragend', (e) => {\n e.cancelBubble = true;\n });\n this.on('dragmove', (e) => {\n this.update();\n });\n }\n _handleMouseDown(e) {\n if (this._transforming) {\n return;\n }\n this._movingAnchorName = e.target.name().split(' ')[0];\n var attrs = this._getNodeRect();\n var width = attrs.width;\n var height = attrs.height;\n var hypotenuse = Math.sqrt(Math.pow(width, 2) + Math.pow(height, 2));\n this.sin = Math.abs(height / hypotenuse);\n this.cos = Math.abs(width / hypotenuse);\n if (typeof window !== 'undefined') {\n window.addEventListener('mousemove', this._handleMouseMove);\n window.addEventListener('touchmove', this._handleMouseMove);\n window.addEventListener('mouseup', this._handleMouseUp, true);\n window.addEventListener('touchend', this._handleMouseUp, true);\n }\n this._transforming = true;\n var ap = e.target.getAbsolutePosition();\n var pos = e.target.getStage().getPointerPosition();\n this._anchorDragOffset = {\n x: pos.x - ap.x,\n y: pos.y - ap.y,\n };\n activeTransformersCount++;\n this._fire('transformstart', { evt: e.evt, target: this.getNode() });\n this._nodes.forEach((target) => {\n target._fire('transformstart', { evt: e.evt, target });\n });\n }\n _handleMouseMove(e) {\n var x, y, newHypotenuse;\n var anchorNode = this.findOne('.' + this._movingAnchorName);\n var stage = anchorNode.getStage();\n stage.setPointersPositions(e);\n const pp = stage.getPointerPosition();\n let newNodePos = {\n x: pp.x - this._anchorDragOffset.x,\n y: pp.y - this._anchorDragOffset.y,\n };\n const oldAbs = anchorNode.getAbsolutePosition();\n if (this.anchorDragBoundFunc()) {\n newNodePos = this.anchorDragBoundFunc()(oldAbs, newNodePos, e);\n }\n anchorNode.setAbsolutePosition(newNodePos);\n const newAbs = anchorNode.getAbsolutePosition();\n if (oldAbs.x === newAbs.x && oldAbs.y === newAbs.y) {\n return;\n }\n if (this._movingAnchorName === 'rotater') {\n var attrs = this._getNodeRect();\n x = anchorNode.x() - attrs.width / 2;\n y = -anchorNode.y() + attrs.height / 2;\n let delta = Math.atan2(-y, x) + Math.PI / 2;\n if (attrs.height < 0) {\n delta -= Math.PI;\n }\n var oldRotation = Global_1.Konva.getAngle(this.rotation());\n const newRotation = oldRotation + delta;\n const tol = Global_1.Konva.getAngle(this.rotationSnapTolerance());\n const snappedRot = getSnap(this.rotationSnaps(), newRotation, tol);\n const diff = snappedRot - attrs.rotation;\n const shape = rotateAroundCenter(attrs, diff);\n this._fitNodesInto(shape, e);\n return;\n }\n var shiftBehavior = this.shiftBehavior();\n var keepProportion;\n if (shiftBehavior === 'inverted') {\n keepProportion = this.keepRatio() && !e.shiftKey;\n }\n else if (shiftBehavior === 'none') {\n keepProportion = this.keepRatio();\n }\n else {\n keepProportion = this.keepRatio() || e.shiftKey;\n }\n var centeredScaling = this.centeredScaling() || e.altKey;\n if (this._movingAnchorName === 'top-left') {\n if (keepProportion) {\n var comparePoint = centeredScaling\n ? {\n x: this.width() / 2,\n y: this.height() / 2,\n }\n : {\n x: this.findOne('.bottom-right').x(),\n y: this.findOne('.bottom-right').y(),\n };\n newHypotenuse = Math.sqrt(Math.pow(comparePoint.x - anchorNode.x(), 2) +\n Math.pow(comparePoint.y - anchorNode.y(), 2));\n var reverseX = this.findOne('.top-left').x() > comparePoint.x ? -1 : 1;\n var reverseY = this.findOne('.top-left').y() > comparePoint.y ? -1 : 1;\n x = newHypotenuse * this.cos * reverseX;\n y = newHypotenuse * this.sin * reverseY;\n this.findOne('.top-left').x(comparePoint.x - x);\n this.findOne('.top-left').y(comparePoint.y - y);\n }\n }\n else if (this._movingAnchorName === 'top-center') {\n this.findOne('.top-left').y(anchorNode.y());\n }\n else if (this._movingAnchorName === 'top-right') {\n if (keepProportion) {\n var comparePoint = centeredScaling\n ? {\n x: this.width() / 2,\n y: this.height() / 2,\n }\n : {\n x: this.findOne('.bottom-left').x(),\n y: this.findOne('.bottom-left').y(),\n };\n newHypotenuse = Math.sqrt(Math.pow(anchorNode.x() - comparePoint.x, 2) +\n Math.pow(comparePoint.y - anchorNode.y(), 2));\n var reverseX = this.findOne('.top-right').x() < comparePoint.x ? -1 : 1;\n var reverseY = this.findOne('.top-right').y() > comparePoint.y ? -1 : 1;\n x = newHypotenuse * this.cos * reverseX;\n y = newHypotenuse * this.sin * reverseY;\n this.findOne('.top-right').x(comparePoint.x + x);\n this.findOne('.top-right').y(comparePoint.y - y);\n }\n var pos = anchorNode.position();\n this.findOne('.top-left').y(pos.y);\n this.findOne('.bottom-right').x(pos.x);\n }\n else if (this._movingAnchorName === 'middle-left') {\n this.findOne('.top-left').x(anchorNode.x());\n }\n else if (this._movingAnchorName === 'middle-right') {\n this.findOne('.bottom-right').x(anchorNode.x());\n }\n else if (this._movingAnchorName === 'bottom-left') {\n if (keepProportion) {\n var comparePoint = centeredScaling\n ? {\n x: this.width() / 2,\n y: this.height() / 2,\n }\n : {\n x: this.findOne('.top-right').x(),\n y: this.findOne('.top-right').y(),\n };\n newHypotenuse = Math.sqrt(Math.pow(comparePoint.x - anchorNode.x(), 2) +\n Math.pow(anchorNode.y() - comparePoint.y, 2));\n var reverseX = comparePoint.x < anchorNode.x() ? -1 : 1;\n var reverseY = anchorNode.y() < comparePoint.y ? -1 : 1;\n x = newHypotenuse * this.cos * reverseX;\n y = newHypotenuse * this.sin * reverseY;\n anchorNode.x(comparePoint.x - x);\n anchorNode.y(comparePoint.y + y);\n }\n pos = anchorNode.position();\n this.findOne('.top-left').x(pos.x);\n this.findOne('.bottom-right').y(pos.y);\n }\n else if (this._movingAnchorName === 'bottom-center') {\n this.findOne('.bottom-right').y(anchorNode.y());\n }\n else if (this._movingAnchorName === 'bottom-right') {\n if (keepProportion) {\n var comparePoint = centeredScaling\n ? {\n x: this.width() / 2,\n y: this.height() / 2,\n }\n : {\n x: this.findOne('.top-left').x(),\n y: this.findOne('.top-left').y(),\n };\n newHypotenuse = Math.sqrt(Math.pow(anchorNode.x() - comparePoint.x, 2) +\n Math.pow(anchorNode.y() - comparePoint.y, 2));\n var reverseX = this.findOne('.bottom-right').x() < comparePoint.x ? -1 : 1;\n var reverseY = this.findOne('.bottom-right').y() < comparePoint.y ? -1 : 1;\n x = newHypotenuse * this.cos * reverseX;\n y = newHypotenuse * this.sin * reverseY;\n this.findOne('.bottom-right').x(comparePoint.x + x);\n this.findOne('.bottom-right').y(comparePoint.y + y);\n }\n }\n else {\n console.error(new Error('Wrong position argument of selection resizer: ' +\n this._movingAnchorName));\n }\n var centeredScaling = this.centeredScaling() || e.altKey;\n if (centeredScaling) {\n var topLeft = this.findOne('.top-left');\n var bottomRight = this.findOne('.bottom-right');\n var topOffsetX = topLeft.x();\n var topOffsetY = topLeft.y();\n var bottomOffsetX = this.getWidth() - bottomRight.x();\n var bottomOffsetY = this.getHeight() - bottomRight.y();\n bottomRight.move({\n x: -topOffsetX,\n y: -topOffsetY,\n });\n topLeft.move({\n x: bottomOffsetX,\n y: bottomOffsetY,\n });\n }\n var absPos = this.findOne('.top-left').getAbsolutePosition();\n x = absPos.x;\n y = absPos.y;\n var width = this.findOne('.bottom-right').x() - this.findOne('.top-left').x();\n var height = this.findOne('.bottom-right').y() - this.findOne('.top-left').y();\n this._fitNodesInto({\n x: x,\n y: y,\n width: width,\n height: height,\n rotation: Global_1.Konva.getAngle(this.rotation()),\n }, e);\n }\n _handleMouseUp(e) {\n this._removeEvents(e);\n }\n getAbsoluteTransform() {\n return this.getTransform();\n }\n _removeEvents(e) {\n var _a;\n if (this._transforming) {\n this._transforming = false;\n if (typeof window !== 'undefined') {\n window.removeEventListener('mousemove', this._handleMouseMove);\n window.removeEventListener('touchmove', this._handleMouseMove);\n window.removeEventListener('mouseup', this._handleMouseUp, true);\n window.removeEventListener('touchend', this._handleMouseUp, true);\n }\n var node = this.getNode();\n activeTransformersCount--;\n this._fire('transformend', { evt: e, target: node });\n (_a = this.getLayer()) === null || _a === void 0 ? void 0 : _a.batchDraw();\n if (node) {\n this._nodes.forEach((target) => {\n var _a;\n target._fire('transformend', { evt: e, target });\n (_a = target.getLayer()) === null || _a === void 0 ? void 0 : _a.batchDraw();\n });\n }\n this._movingAnchorName = null;\n }\n }\n _fitNodesInto(newAttrs, evt) {\n var oldAttrs = this._getNodeRect();\n const minSize = 1;\n if (Util_1.Util._inRange(newAttrs.width, -this.padding() * 2 - minSize, minSize)) {\n this.update();\n return;\n }\n if (Util_1.Util._inRange(newAttrs.height, -this.padding() * 2 - minSize, minSize)) {\n this.update();\n return;\n }\n var t = new Util_1.Transform();\n t.rotate(Global_1.Konva.getAngle(this.rotation()));\n if (this._movingAnchorName &&\n newAttrs.width < 0 &&\n this._movingAnchorName.indexOf('left') >= 0) {\n const offset = t.point({\n x: -this.padding() * 2,\n y: 0,\n });\n newAttrs.x += offset.x;\n newAttrs.y += offset.y;\n newAttrs.width += this.padding() * 2;\n this._movingAnchorName = this._movingAnchorName.replace('left', 'right');\n this._anchorDragOffset.x -= offset.x;\n this._anchorDragOffset.y -= offset.y;\n }\n else if (this._movingAnchorName &&\n newAttrs.width < 0 &&\n this._movingAnchorName.indexOf('right') >= 0) {\n const offset = t.point({\n x: this.padding() * 2,\n y: 0,\n });\n this._movingAnchorName = this._movingAnchorName.replace('right', 'left');\n this._anchorDragOffset.x -= offset.x;\n this._anchorDragOffset.y -= offset.y;\n newAttrs.width += this.padding() * 2;\n }\n if (this._movingAnchorName &&\n newAttrs.height < 0 &&\n this._movingAnchorName.indexOf('top') >= 0) {\n const offset = t.point({\n x: 0,\n y: -this.padding() * 2,\n });\n newAttrs.x += offset.x;\n newAttrs.y += offset.y;\n this._movingAnchorName = this._movingAnchorName.replace('top', 'bottom');\n this._anchorDragOffset.x -= offset.x;\n this._anchorDragOffset.y -= offset.y;\n newAttrs.height += this.padding() * 2;\n }\n else if (this._movingAnchorName &&\n newAttrs.height < 0 &&\n this._movingAnchorName.indexOf('bottom') >= 0) {\n const offset = t.point({\n x: 0,\n y: this.padding() * 2,\n });\n this._movingAnchorName = this._movingAnchorName.replace('bottom', 'top');\n this._anchorDragOffset.x -= offset.x;\n this._anchorDragOffset.y -= offset.y;\n newAttrs.height += this.padding() * 2;\n }\n if (this.boundBoxFunc()) {\n const bounded = this.boundBoxFunc()(oldAttrs, newAttrs);\n if (bounded) {\n newAttrs = bounded;\n }\n else {\n Util_1.Util.warn('boundBoxFunc returned falsy. You should return new bound rect from it!');\n }\n }\n const baseSize = 10000000;\n const oldTr = new Util_1.Transform();\n oldTr.translate(oldAttrs.x, oldAttrs.y);\n oldTr.rotate(oldAttrs.rotation);\n oldTr.scale(oldAttrs.width / baseSize, oldAttrs.height / baseSize);\n const newTr = new Util_1.Transform();\n const newScaleX = newAttrs.width / baseSize;\n const newScaleY = newAttrs.height / baseSize;\n if (this.flipEnabled() === false) {\n newTr.translate(newAttrs.x, newAttrs.y);\n newTr.rotate(newAttrs.rotation);\n newTr.translate(newAttrs.width < 0 ? newAttrs.width : 0, newAttrs.height < 0 ? newAttrs.height : 0);\n newTr.scale(Math.abs(newScaleX), Math.abs(newScaleY));\n }\n else {\n newTr.translate(newAttrs.x, newAttrs.y);\n newTr.rotate(newAttrs.rotation);\n newTr.scale(newScaleX, newScaleY);\n }\n const delta = newTr.multiply(oldTr.invert());\n this._nodes.forEach((node) => {\n var _a;\n const parentTransform = node.getParent().getAbsoluteTransform();\n const localTransform = node.getTransform().copy();\n localTransform.translate(node.offsetX(), node.offsetY());\n const newLocalTransform = new Util_1.Transform();\n newLocalTransform\n .multiply(parentTransform.copy().invert())\n .multiply(delta)\n .multiply(parentTransform)\n .multiply(localTransform);\n const attrs = newLocalTransform.decompose();\n node.setAttrs(attrs);\n (_a = node.getLayer()) === null || _a === void 0 ? void 0 : _a.batchDraw();\n });\n this.rotation(Util_1.Util._getRotation(newAttrs.rotation));\n this._nodes.forEach((node) => {\n this._fire('transform', { evt: evt, target: node });\n node._fire('transform', { evt: evt, target: node });\n });\n this._resetTransformCache();\n this.update();\n this.getLayer().batchDraw();\n }\n forceUpdate() {\n this._resetTransformCache();\n this.update();\n }\n _batchChangeChild(selector, attrs) {\n const anchor = this.findOne(selector);\n anchor.setAttrs(attrs);\n }\n update() {\n var _a;\n var attrs = this._getNodeRect();\n this.rotation(Util_1.Util._getRotation(attrs.rotation));\n var width = attrs.width;\n var height = attrs.height;\n var enabledAnchors = this.enabledAnchors();\n var resizeEnabled = this.resizeEnabled();\n var padding = this.padding();\n var anchorSize = this.anchorSize();\n const anchors = this.find('._anchor');\n anchors.forEach((node) => {\n node.setAttrs({\n width: anchorSize,\n height: anchorSize,\n offsetX: anchorSize / 2,\n offsetY: anchorSize / 2,\n stroke: this.anchorStroke(),\n strokeWidth: this.anchorStrokeWidth(),\n fill: this.anchorFill(),\n cornerRadius: this.anchorCornerRadius(),\n });\n });\n this._batchChangeChild('.top-left', {\n x: 0,\n y: 0,\n offsetX: anchorSize / 2 + padding,\n offsetY: anchorSize / 2 + padding,\n visible: resizeEnabled && enabledAnchors.indexOf('top-left') >= 0,\n });\n this._batchChangeChild('.top-center', {\n x: width / 2,\n y: 0,\n offsetY: anchorSize / 2 + padding,\n visible: resizeEnabled && enabledAnchors.indexOf('top-center') >= 0,\n });\n this._batchChangeChild('.top-right', {\n x: width,\n y: 0,\n offsetX: anchorSize / 2 - padding,\n offsetY: anchorSize / 2 + padding,\n visible: resizeEnabled && enabledAnchors.indexOf('top-right') >= 0,\n });\n this._batchChangeChild('.middle-left', {\n x: 0,\n y: height / 2,\n offsetX: anchorSize / 2 + padding,\n visible: resizeEnabled && enabledAnchors.indexOf('middle-left') >= 0,\n });\n this._batchChangeChild('.middle-right', {\n x: width,\n y: height / 2,\n offsetX: anchorSize / 2 - padding,\n visible: resizeEnabled && enabledAnchors.indexOf('middle-right') >= 0,\n });\n this._batchChangeChild('.bottom-left', {\n x: 0,\n y: height,\n offsetX: anchorSize / 2 + padding,\n offsetY: anchorSize / 2 - padding,\n visible: resizeEnabled && enabledAnchors.indexOf('bottom-left') >= 0,\n });\n this._batchChangeChild('.bottom-center', {\n x: width / 2,\n y: height,\n offsetY: anchorSize / 2 - padding,\n visible: resizeEnabled && enabledAnchors.indexOf('bottom-center') >= 0,\n });\n this._batchChangeChild('.bottom-right', {\n x: width,\n y: height,\n offsetX: anchorSize / 2 - padding,\n offsetY: anchorSize / 2 - padding,\n visible: resizeEnabled && enabledAnchors.indexOf('bottom-right') >= 0,\n });\n this._batchChangeChild('.rotater', {\n x: width / 2,\n y: -this.rotateAnchorOffset() * Util_1.Util._sign(height) - padding,\n visible: this.rotateEnabled(),\n });\n this._batchChangeChild('.back', {\n width: width,\n height: height,\n visible: this.borderEnabled(),\n stroke: this.borderStroke(),\n strokeWidth: this.borderStrokeWidth(),\n dash: this.borderDash(),\n x: 0,\n y: 0,\n });\n const styleFunc = this.anchorStyleFunc();\n if (styleFunc) {\n anchors.forEach((node) => {\n styleFunc(node);\n });\n }\n (_a = this.getLayer()) === null || _a === void 0 ? void 0 : _a.batchDraw();\n }\n isTransforming() {\n return this._transforming;\n }\n stopTransform() {\n if (this._transforming) {\n this._removeEvents();\n var anchorNode = this.findOne('.' + this._movingAnchorName);\n if (anchorNode) {\n anchorNode.stopDrag();\n }\n }\n }\n destroy() {\n if (this.getStage() && this._cursorChange) {\n this.getStage().content && (this.getStage().content.style.cursor = '');\n }\n Group_1.Group.prototype.destroy.call(this);\n this.detach();\n this._removeEvents();\n return this;\n }\n toObject() {\n return Node_1.Node.prototype.toObject.call(this);\n }\n clone(obj) {\n var node = Node_1.Node.prototype.clone.call(this, obj);\n return node;\n }\n getClientRect() {\n if (this.nodes().length > 0) {\n return super.getClientRect();\n }\n else {\n return { x: 0, y: 0, width: 0, height: 0 };\n }\n }\n}\nexports.Transformer = Transformer;\nTransformer.isTransforming = () => {\n return activeTransformersCount > 0;\n};\nfunction validateAnchors(val) {\n if (!(val instanceof Array)) {\n Util_1.Util.warn('enabledAnchors value should be an array');\n }\n if (val instanceof Array) {\n val.forEach(function (name) {\n if (ANCHORS_NAMES.indexOf(name) === -1) {\n Util_1.Util.warn('Unknown anchor name: ' +\n name +\n '. Available names are: ' +\n ANCHORS_NAMES.join(', '));\n }\n });\n }\n return val || [];\n}\nTransformer.prototype.className = 'Transformer';\n(0, Global_2._registerNode)(Transformer);\nFactory_1.Factory.addGetterSetter(Transformer, 'enabledAnchors', ANCHORS_NAMES, validateAnchors);\nFactory_1.Factory.addGetterSetter(Transformer, 'flipEnabled', true, (0, Validators_1.getBooleanValidator)());\nFactory_1.Factory.addGetterSetter(Transformer, 'resizeEnabled', true);\nFactory_1.Factory.addGetterSetter(Transformer, 'anchorSize', 10, (0, Validators_1.getNumberValidator)());\nFactory_1.Factory.addGetterSetter(Transformer, 'rotateEnabled', true);\nFactory_1.Factory.addGetterSetter(Transformer, 'rotateLineVisible', true);\nFactory_1.Factory.addGetterSetter(Transformer, 'rotationSnaps', []);\nFactory_1.Factory.addGetterSetter(Transformer, 'rotateAnchorOffset', 50, (0, Validators_1.getNumberValidator)());\nFactory_1.Factory.addGetterSetter(Transformer, 'rotateAnchorCursor', 'crosshair');\nFactory_1.Factory.addGetterSetter(Transformer, 'rotationSnapTolerance', 5, (0, Validators_1.getNumberValidator)());\nFactory_1.Factory.addGetterSetter(Transformer, 'borderEnabled', true);\nFactory_1.Factory.addGetterSetter(Transformer, 'anchorStroke', 'rgb(0, 161, 255)');\nFactory_1.Factory.addGetterSetter(Transformer, 'anchorStrokeWidth', 1, (0, Validators_1.getNumberValidator)());\nFactory_1.Factory.addGetterSetter(Transformer, 'anchorFill', 'white');\nFactory_1.Factory.addGetterSetter(Transformer, 'anchorCornerRadius', 0, (0, Validators_1.getNumberValidator)());\nFactory_1.Factory.addGetterSetter(Transformer, 'borderStroke', 'rgb(0, 161, 255)');\nFactory_1.Factory.addGetterSetter(Transformer, 'borderStrokeWidth', 1, (0, Validators_1.getNumberValidator)());\nFactory_1.Factory.addGetterSetter(Transformer, 'borderDash');\nFactory_1.Factory.addGetterSetter(Transformer, 'keepRatio', true);\nFactory_1.Factory.addGetterSetter(Transformer, 'shiftBehavior', 'default');\nFactory_1.Factory.addGetterSetter(Transformer, 'centeredScaling', false);\nFactory_1.Factory.addGetterSetter(Transformer, 'ignoreStroke', false);\nFactory_1.Factory.addGetterSetter(Transformer, 'padding', 0, (0, Validators_1.getNumberValidator)());\nFactory_1.Factory.addGetterSetter(Transformer, 'node');\nFactory_1.Factory.addGetterSetter(Transformer, 'nodes');\nFactory_1.Factory.addGetterSetter(Transformer, 'boundBoxFunc');\nFactory_1.Factory.addGetterSetter(Transformer, 'anchorDragBoundFunc');\nFactory_1.Factory.addGetterSetter(Transformer, 'anchorStyleFunc');\nFactory_1.Factory.addGetterSetter(Transformer, 'shouldOverdrawWholeArea', false);\nFactory_1.Factory.addGetterSetter(Transformer, 'useSingleNodeRotation', true);\nFactory_1.Factory.backCompat(Transformer, {\n lineEnabled: 'borderEnabled',\n rotateHandlerOffset: 'rotateAnchorOffset',\n enabledHandlers: 'enabledAnchors',\n});\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Wedge = void 0;\nconst Factory_1 = require(\"../Factory\");\nconst Shape_1 = require(\"../Shape\");\nconst Global_1 = require(\"../Global\");\nconst Validators_1 = require(\"../Validators\");\nconst Global_2 = require(\"../Global\");\nclass Wedge extends Shape_1.Shape {\n _sceneFunc(context) {\n context.beginPath();\n context.arc(0, 0, this.radius(), 0, Global_1.Konva.getAngle(this.angle()), this.clockwise());\n context.lineTo(0, 0);\n context.closePath();\n context.fillStrokeShape(this);\n }\n getWidth() {\n return this.radius() * 2;\n }\n getHeight() {\n return this.radius() * 2;\n }\n setWidth(width) {\n this.radius(width / 2);\n }\n setHeight(height) {\n this.radius(height / 2);\n }\n}\nexports.Wedge = Wedge;\nWedge.prototype.className = 'Wedge';\nWedge.prototype._centroid = true;\nWedge.prototype._attrsAffectingSize = ['radius'];\n(0, Global_2._registerNode)(Wedge);\nFactory_1.Factory.addGetterSetter(Wedge, 'radius', 0, (0, Validators_1.getNumberValidator)());\nFactory_1.Factory.addGetterSetter(Wedge, 'angle', 0, (0, Validators_1.getNumberValidator)());\nFactory_1.Factory.addGetterSetter(Wedge, 'clockwise', false);\nFactory_1.Factory.backCompat(Wedge, {\n angleDeg: 'angle',\n getAngleDeg: 'getAngle',\n setAngleDeg: 'setAngle',\n});\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Blur = void 0;\nconst Factory_1 = require(\"../Factory\");\nconst Node_1 = require(\"../Node\");\nconst Validators_1 = require(\"../Validators\");\nfunction BlurStack() {\n this.r = 0;\n this.g = 0;\n this.b = 0;\n this.a = 0;\n this.next = null;\n}\nvar mul_table = [\n 512, 512, 456, 512, 328, 456, 335, 512, 405, 328, 271, 456, 388, 335, 292,\n 512, 454, 405, 364, 328, 298, 271, 496, 456, 420, 388, 360, 335, 312, 292,\n 273, 512, 482, 454, 428, 405, 383, 364, 345, 328, 312, 298, 284, 271, 259,\n 496, 475, 456, 437, 420, 404, 388, 374, 360, 347, 335, 323, 312, 302, 292,\n 282, 273, 265, 512, 497, 482, 468, 454, 441, 428, 417, 405, 394, 383, 373,\n 364, 354, 345, 337, 328, 320, 312, 305, 298, 291, 284, 278, 271, 265, 259,\n 507, 496, 485, 475, 465, 456, 446, 437, 428, 420, 412, 404, 396, 388, 381,\n 374, 367, 360, 354, 347, 341, 335, 329, 323, 318, 312, 307, 302, 297, 292,\n 287, 282, 278, 273, 269, 265, 261, 512, 505, 497, 489, 482, 475, 468, 461,\n 454, 447, 441, 435, 428, 422, 417, 411, 405, 399, 394, 389, 383, 378, 373,\n 368, 364, 359, 354, 350, 345, 341, 337, 332, 328, 324, 320, 316, 312, 309,\n 305, 301, 298, 294, 291, 287, 284, 281, 278, 274, 271, 268, 265, 262, 259,\n 257, 507, 501, 496, 491, 485, 480, 475, 470, 465, 460, 456, 451, 446, 442,\n 437, 433, 428, 424, 420, 416, 412, 408, 404, 400, 396, 392, 388, 385, 381,\n 377, 374, 370, 367, 363, 360, 357, 354, 350, 347, 344, 341, 338, 335, 332,\n 329, 326, 323, 320, 318, 315, 312, 310, 307, 304, 302, 299, 297, 294, 292,\n 289, 287, 285, 282, 280, 278, 275, 273, 271, 269, 267, 265, 263, 261, 259,\n];\nvar shg_table = [\n 9, 11, 12, 13, 13, 14, 14, 15, 15, 15, 15, 16, 16, 16, 16, 17, 17, 17, 17, 17,\n 17, 17, 18, 18, 18, 18, 18, 18, 18, 18, 18, 19, 19, 19, 19, 19, 19, 19, 19,\n 19, 19, 19, 19, 19, 19, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,\n 20, 20, 20, 20, 20, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21,\n 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 22, 22, 22, 22, 22, 22,\n 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22,\n 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 23, 23, 23, 23, 23, 23, 23,\n 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23,\n 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23,\n 23, 23, 23, 23, 23, 23, 23, 23, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24,\n 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24,\n 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24,\n 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24,\n 24, 24, 24, 24, 24, 24, 24,\n];\nfunction filterGaussBlurRGBA(imageData, radius) {\n var pixels = imageData.data, width = imageData.width, height = imageData.height;\n var x, y, i, p, yp, yi, yw, r_sum, g_sum, b_sum, a_sum, r_out_sum, g_out_sum, b_out_sum, a_out_sum, r_in_sum, g_in_sum, b_in_sum, a_in_sum, pr, pg, pb, pa, rbs;\n var div = radius + radius + 1, widthMinus1 = width - 1, heightMinus1 = height - 1, radiusPlus1 = radius + 1, sumFactor = (radiusPlus1 * (radiusPlus1 + 1)) / 2, stackStart = new BlurStack(), stackEnd = null, stack = stackStart, stackIn = null, stackOut = null, mul_sum = mul_table[radius], shg_sum = shg_table[radius];\n for (i = 1; i < div; i++) {\n stack = stack.next = new BlurStack();\n if (i === radiusPlus1) {\n stackEnd = stack;\n }\n }\n stack.next = stackStart;\n yw = yi = 0;\n for (y = 0; y < height; y++) {\n r_in_sum =\n g_in_sum =\n b_in_sum =\n a_in_sum =\n r_sum =\n g_sum =\n b_sum =\n a_sum =\n 0;\n r_out_sum = radiusPlus1 * (pr = pixels[yi]);\n g_out_sum = radiusPlus1 * (pg = pixels[yi + 1]);\n b_out_sum = radiusPlus1 * (pb = pixels[yi + 2]);\n a_out_sum = radiusPlus1 * (pa = pixels[yi + 3]);\n r_sum += sumFactor * pr;\n g_sum += sumFactor * pg;\n b_sum += sumFactor * pb;\n a_sum += sumFactor * pa;\n stack = stackStart;\n for (i = 0; i < radiusPlus1; i++) {\n stack.r = pr;\n stack.g = pg;\n stack.b = pb;\n stack.a = pa;\n stack = stack.next;\n }\n for (i = 1; i < radiusPlus1; i++) {\n p = yi + ((widthMinus1 < i ? widthMinus1 : i) << 2);\n r_sum += (stack.r = pr = pixels[p]) * (rbs = radiusPlus1 - i);\n g_sum += (stack.g = pg = pixels[p + 1]) * rbs;\n b_sum += (stack.b = pb = pixels[p + 2]) * rbs;\n a_sum += (stack.a = pa = pixels[p + 3]) * rbs;\n r_in_sum += pr;\n g_in_sum += pg;\n b_in_sum += pb;\n a_in_sum += pa;\n stack = stack.next;\n }\n stackIn = stackStart;\n stackOut = stackEnd;\n for (x = 0; x < width; x++) {\n pixels[yi + 3] = pa = (a_sum * mul_sum) >> shg_sum;\n if (pa !== 0) {\n pa = 255 / pa;\n pixels[yi] = ((r_sum * mul_sum) >> shg_sum) * pa;\n pixels[yi + 1] = ((g_sum * mul_sum) >> shg_sum) * pa;\n pixels[yi + 2] = ((b_sum * mul_sum) >> shg_sum) * pa;\n }\n else {\n pixels[yi] = pixels[yi + 1] = pixels[yi + 2] = 0;\n }\n r_sum -= r_out_sum;\n g_sum -= g_out_sum;\n b_sum -= b_out_sum;\n a_sum -= a_out_sum;\n r_out_sum -= stackIn.r;\n g_out_sum -= stackIn.g;\n b_out_sum -= stackIn.b;\n a_out_sum -= stackIn.a;\n p = (yw + ((p = x + radius + 1) < widthMinus1 ? p : widthMinus1)) << 2;\n r_in_sum += stackIn.r = pixels[p];\n g_in_sum += stackIn.g = pixels[p + 1];\n b_in_sum += stackIn.b = pixels[p + 2];\n a_in_sum += stackIn.a = pixels[p + 3];\n r_sum += r_in_sum;\n g_sum += g_in_sum;\n b_sum += b_in_sum;\n a_sum += a_in_sum;\n stackIn = stackIn.next;\n r_out_sum += pr = stackOut.r;\n g_out_sum += pg = stackOut.g;\n b_out_sum += pb = stackOut.b;\n a_out_sum += pa = stackOut.a;\n r_in_sum -= pr;\n g_in_sum -= pg;\n b_in_sum -= pb;\n a_in_sum -= pa;\n stackOut = stackOut.next;\n yi += 4;\n }\n yw += width;\n }\n for (x = 0; x < width; x++) {\n g_in_sum =\n b_in_sum =\n a_in_sum =\n r_in_sum =\n g_sum =\n b_sum =\n a_sum =\n r_sum =\n 0;\n yi = x << 2;\n r_out_sum = radiusPlus1 * (pr = pixels[yi]);\n g_out_sum = radiusPlus1 * (pg = pixels[yi + 1]);\n b_out_sum = radiusPlus1 * (pb = pixels[yi + 2]);\n a_out_sum = radiusPlus1 * (pa = pixels[yi + 3]);\n r_sum += sumFactor * pr;\n g_sum += sumFactor * pg;\n b_sum += sumFactor * pb;\n a_sum += sumFactor * pa;\n stack = stackStart;\n for (i = 0; i < radiusPlus1; i++) {\n stack.r = pr;\n stack.g = pg;\n stack.b = pb;\n stack.a = pa;\n stack = stack.next;\n }\n yp = width;\n for (i = 1; i <= radius; i++) {\n yi = (yp + x) << 2;\n r_sum += (stack.r = pr = pixels[yi]) * (rbs = radiusPlus1 - i);\n g_sum += (stack.g = pg = pixels[yi + 1]) * rbs;\n b_sum += (stack.b = pb = pixels[yi + 2]) * rbs;\n a_sum += (stack.a = pa = pixels[yi + 3]) * rbs;\n r_in_sum += pr;\n g_in_sum += pg;\n b_in_sum += pb;\n a_in_sum += pa;\n stack = stack.next;\n if (i < heightMinus1) {\n yp += width;\n }\n }\n yi = x;\n stackIn = stackStart;\n stackOut = stackEnd;\n for (y = 0; y < height; y++) {\n p = yi << 2;\n pixels[p + 3] = pa = (a_sum * mul_sum) >> shg_sum;\n if (pa > 0) {\n pa = 255 / pa;\n pixels[p] = ((r_sum * mul_sum) >> shg_sum) * pa;\n pixels[p + 1] = ((g_sum * mul_sum) >> shg_sum) * pa;\n pixels[p + 2] = ((b_sum * mul_sum) >> shg_sum) * pa;\n }\n else {\n pixels[p] = pixels[p + 1] = pixels[p + 2] = 0;\n }\n r_sum -= r_out_sum;\n g_sum -= g_out_sum;\n b_sum -= b_out_sum;\n a_sum -= a_out_sum;\n r_out_sum -= stackIn.r;\n g_out_sum -= stackIn.g;\n b_out_sum -= stackIn.b;\n a_out_sum -= stackIn.a;\n p =\n (x +\n ((p = y + radiusPlus1) < heightMinus1 ? p : heightMinus1) * width) <<\n 2;\n r_sum += r_in_sum += stackIn.r = pixels[p];\n g_sum += g_in_sum += stackIn.g = pixels[p + 1];\n b_sum += b_in_sum += stackIn.b = pixels[p + 2];\n a_sum += a_in_sum += stackIn.a = pixels[p + 3];\n stackIn = stackIn.next;\n r_out_sum += pr = stackOut.r;\n g_out_sum += pg = stackOut.g;\n b_out_sum += pb = stackOut.b;\n a_out_sum += pa = stackOut.a;\n r_in_sum -= pr;\n g_in_sum -= pg;\n b_in_sum -= pb;\n a_in_sum -= pa;\n stackOut = stackOut.next;\n yi += width;\n }\n }\n}\nconst Blur = function Blur(imageData) {\n var radius = Math.round(this.blurRadius());\n if (radius > 0) {\n filterGaussBlurRGBA(imageData, radius);\n }\n};\nexports.Blur = Blur;\nFactory_1.Factory.addGetterSetter(Node_1.Node, 'blurRadius', 0, (0, Validators_1.getNumberValidator)(), Factory_1.Factory.afterSetFilter);\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Brighten = void 0;\nconst Factory_1 = require(\"../Factory\");\nconst Node_1 = require(\"../Node\");\nconst Validators_1 = require(\"../Validators\");\nconst Brighten = function (imageData) {\n var brightness = this.brightness() * 255, data = imageData.data, len = data.length, i;\n for (i = 0; i < len; i += 4) {\n data[i] += brightness;\n data[i + 1] += brightness;\n data[i + 2] += brightness;\n }\n};\nexports.Brighten = Brighten;\nFactory_1.Factory.addGetterSetter(Node_1.Node, 'brightness', 0, (0, Validators_1.getNumberValidator)(), Factory_1.Factory.afterSetFilter);\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Contrast = void 0;\nconst Factory_1 = require(\"../Factory\");\nconst Node_1 = require(\"../Node\");\nconst Validators_1 = require(\"../Validators\");\nconst Contrast = function (imageData) {\n var adjust = Math.pow((this.contrast() + 100) / 100, 2);\n var data = imageData.data, nPixels = data.length, red = 150, green = 150, blue = 150, i;\n for (i = 0; i < nPixels; i += 4) {\n red = data[i];\n green = data[i + 1];\n blue = data[i + 2];\n red /= 255;\n red -= 0.5;\n red *= adjust;\n red += 0.5;\n red *= 255;\n green /= 255;\n green -= 0.5;\n green *= adjust;\n green += 0.5;\n green *= 255;\n blue /= 255;\n blue -= 0.5;\n blue *= adjust;\n blue += 0.5;\n blue *= 255;\n red = red < 0 ? 0 : red > 255 ? 255 : red;\n green = green < 0 ? 0 : green > 255 ? 255 : green;\n blue = blue < 0 ? 0 : blue > 255 ? 255 : blue;\n data[i] = red;\n data[i + 1] = green;\n data[i + 2] = blue;\n }\n};\nexports.Contrast = Contrast;\nFactory_1.Factory.addGetterSetter(Node_1.Node, 'contrast', 0, (0, Validators_1.getNumberValidator)(), Factory_1.Factory.afterSetFilter);\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Emboss = void 0;\nconst Factory_1 = require(\"../Factory\");\nconst Node_1 = require(\"../Node\");\nconst Util_1 = require(\"../Util\");\nconst Validators_1 = require(\"../Validators\");\nconst Emboss = function (imageData) {\n var strength = this.embossStrength() * 10, greyLevel = this.embossWhiteLevel() * 255, direction = this.embossDirection(), blend = this.embossBlend(), dirY = 0, dirX = 0, data = imageData.data, w = imageData.width, h = imageData.height, w4 = w * 4, y = h;\n switch (direction) {\n case 'top-left':\n dirY = -1;\n dirX = -1;\n break;\n case 'top':\n dirY = -1;\n dirX = 0;\n break;\n case 'top-right':\n dirY = -1;\n dirX = 1;\n break;\n case 'right':\n dirY = 0;\n dirX = 1;\n break;\n case 'bottom-right':\n dirY = 1;\n dirX = 1;\n break;\n case 'bottom':\n dirY = 1;\n dirX = 0;\n break;\n case 'bottom-left':\n dirY = 1;\n dirX = -1;\n break;\n case 'left':\n dirY = 0;\n dirX = -1;\n break;\n default:\n Util_1.Util.error('Unknown emboss direction: ' + direction);\n }\n do {\n var offsetY = (y - 1) * w4;\n var otherY = dirY;\n if (y + otherY < 1) {\n otherY = 0;\n }\n if (y + otherY > h) {\n otherY = 0;\n }\n var offsetYOther = (y - 1 + otherY) * w * 4;\n var x = w;\n do {\n var offset = offsetY + (x - 1) * 4;\n var otherX = dirX;\n if (x + otherX < 1) {\n otherX = 0;\n }\n if (x + otherX > w) {\n otherX = 0;\n }\n var offsetOther = offsetYOther + (x - 1 + otherX) * 4;\n var dR = data[offset] - data[offsetOther];\n var dG = data[offset + 1] - data[offsetOther + 1];\n var dB = data[offset + 2] - data[offsetOther + 2];\n var dif = dR;\n var absDif = dif > 0 ? dif : -dif;\n var absG = dG > 0 ? dG : -dG;\n var absB = dB > 0 ? dB : -dB;\n if (absG > absDif) {\n dif = dG;\n }\n if (absB > absDif) {\n dif = dB;\n }\n dif *= strength;\n if (blend) {\n var r = data[offset] + dif;\n var g = data[offset + 1] + dif;\n var b = data[offset + 2] + dif;\n data[offset] = r > 255 ? 255 : r < 0 ? 0 : r;\n data[offset + 1] = g > 255 ? 255 : g < 0 ? 0 : g;\n data[offset + 2] = b > 255 ? 255 : b < 0 ? 0 : b;\n }\n else {\n var grey = greyLevel - dif;\n if (grey < 0) {\n grey = 0;\n }\n else if (grey > 255) {\n grey = 255;\n }\n data[offset] = data[offset + 1] = data[offset + 2] = grey;\n }\n } while (--x);\n } while (--y);\n};\nexports.Emboss = Emboss;\nFactory_1.Factory.addGetterSetter(Node_1.Node, 'embossStrength', 0.5, (0, Validators_1.getNumberValidator)(), Factory_1.Factory.afterSetFilter);\nFactory_1.Factory.addGetterSetter(Node_1.Node, 'embossWhiteLevel', 0.5, (0, Validators_1.getNumberValidator)(), Factory_1.Factory.afterSetFilter);\nFactory_1.Factory.addGetterSetter(Node_1.Node, 'embossDirection', 'top-left', null, Factory_1.Factory.afterSetFilter);\nFactory_1.Factory.addGetterSetter(Node_1.Node, 'embossBlend', false, null, Factory_1.Factory.afterSetFilter);\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Enhance = void 0;\nconst Factory_1 = require(\"../Factory\");\nconst Node_1 = require(\"../Node\");\nconst Validators_1 = require(\"../Validators\");\nfunction remap(fromValue, fromMin, fromMax, toMin, toMax) {\n var fromRange = fromMax - fromMin, toRange = toMax - toMin, toValue;\n if (fromRange === 0) {\n return toMin + toRange / 2;\n }\n if (toRange === 0) {\n return toMin;\n }\n toValue = (fromValue - fromMin) / fromRange;\n toValue = toRange * toValue + toMin;\n return toValue;\n}\nconst Enhance = function (imageData) {\n var data = imageData.data, nSubPixels = data.length, rMin = data[0], rMax = rMin, r, gMin = data[1], gMax = gMin, g, bMin = data[2], bMax = bMin, b, i;\n var enhanceAmount = this.enhance();\n if (enhanceAmount === 0) {\n return;\n }\n for (i = 0; i < nSubPixels; i += 4) {\n r = data[i + 0];\n if (r < rMin) {\n rMin = r;\n }\n else if (r > rMax) {\n rMax = r;\n }\n g = data[i + 1];\n if (g < gMin) {\n gMin = g;\n }\n else if (g > gMax) {\n gMax = g;\n }\n b = data[i + 2];\n if (b < bMin) {\n bMin = b;\n }\n else if (b > bMax) {\n bMax = b;\n }\n }\n if (rMax === rMin) {\n rMax = 255;\n rMin = 0;\n }\n if (gMax === gMin) {\n gMax = 255;\n gMin = 0;\n }\n if (bMax === bMin) {\n bMax = 255;\n bMin = 0;\n }\n var rMid, rGoalMax, rGoalMin, gMid, gGoalMax, gGoalMin, bMid, bGoalMax, bGoalMin;\n if (enhanceAmount > 0) {\n rGoalMax = rMax + enhanceAmount * (255 - rMax);\n rGoalMin = rMin - enhanceAmount * (rMin - 0);\n gGoalMax = gMax + enhanceAmount * (255 - gMax);\n gGoalMin = gMin - enhanceAmount * (gMin - 0);\n bGoalMax = bMax + enhanceAmount * (255 - bMax);\n bGoalMin = bMin - enhanceAmount * (bMin - 0);\n }\n else {\n rMid = (rMax + rMin) * 0.5;\n rGoalMax = rMax + enhanceAmount * (rMax - rMid);\n rGoalMin = rMin + enhanceAmount * (rMin - rMid);\n gMid = (gMax + gMin) * 0.5;\n gGoalMax = gMax + enhanceAmount * (gMax - gMid);\n gGoalMin = gMin + enhanceAmount * (gMin - gMid);\n bMid = (bMax + bMin) * 0.5;\n bGoalMax = bMax + enhanceAmount * (bMax - bMid);\n bGoalMin = bMin + enhanceAmount * (bMin - bMid);\n }\n for (i = 0; i < nSubPixels; i += 4) {\n data[i + 0] = remap(data[i + 0], rMin, rMax, rGoalMin, rGoalMax);\n data[i + 1] = remap(data[i + 1], gMin, gMax, gGoalMin, gGoalMax);\n data[i + 2] = remap(data[i + 2], bMin, bMax, bGoalMin, bGoalMax);\n }\n};\nexports.Enhance = Enhance;\nFactory_1.Factory.addGetterSetter(Node_1.Node, 'enhance', 0, (0, Validators_1.getNumberValidator)(), Factory_1.Factory.afterSetFilter);\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Grayscale = void 0;\nconst Grayscale = function (imageData) {\n var data = imageData.data, len = data.length, i, brightness;\n for (i = 0; i < len; i += 4) {\n brightness = 0.34 * data[i] + 0.5 * data[i + 1] + 0.16 * data[i + 2];\n data[i] = brightness;\n data[i + 1] = brightness;\n data[i + 2] = brightness;\n }\n};\nexports.Grayscale = Grayscale;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.HSL = void 0;\nconst Factory_1 = require(\"../Factory\");\nconst Node_1 = require(\"../Node\");\nconst Validators_1 = require(\"../Validators\");\nFactory_1.Factory.addGetterSetter(Node_1.Node, 'hue', 0, (0, Validators_1.getNumberValidator)(), Factory_1.Factory.afterSetFilter);\nFactory_1.Factory.addGetterSetter(Node_1.Node, 'saturation', 0, (0, Validators_1.getNumberValidator)(), Factory_1.Factory.afterSetFilter);\nFactory_1.Factory.addGetterSetter(Node_1.Node, 'luminance', 0, (0, Validators_1.getNumberValidator)(), Factory_1.Factory.afterSetFilter);\nconst HSL = function (imageData) {\n var data = imageData.data, nPixels = data.length, v = 1, s = Math.pow(2, this.saturation()), h = Math.abs(this.hue() + 360) % 360, l = this.luminance() * 127, i;\n var vsu = v * s * Math.cos((h * Math.PI) / 180), vsw = v * s * Math.sin((h * Math.PI) / 180);\n var rr = 0.299 * v + 0.701 * vsu + 0.167 * vsw, rg = 0.587 * v - 0.587 * vsu + 0.33 * vsw, rb = 0.114 * v - 0.114 * vsu - 0.497 * vsw;\n var gr = 0.299 * v - 0.299 * vsu - 0.328 * vsw, gg = 0.587 * v + 0.413 * vsu + 0.035 * vsw, gb = 0.114 * v - 0.114 * vsu + 0.293 * vsw;\n var br = 0.299 * v - 0.3 * vsu + 1.25 * vsw, bg = 0.587 * v - 0.586 * vsu - 1.05 * vsw, bb = 0.114 * v + 0.886 * vsu - 0.2 * vsw;\n var r, g, b, a;\n for (i = 0; i < nPixels; i += 4) {\n r = data[i + 0];\n g = data[i + 1];\n b = data[i + 2];\n a = data[i + 3];\n data[i + 0] = rr * r + rg * g + rb * b + l;\n data[i + 1] = gr * r + gg * g + gb * b + l;\n data[i + 2] = br * r + bg * g + bb * b + l;\n data[i + 3] = a;\n }\n};\nexports.HSL = HSL;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.HSV = void 0;\nconst Factory_1 = require(\"../Factory\");\nconst Node_1 = require(\"../Node\");\nconst Validators_1 = require(\"../Validators\");\nconst HSV = function (imageData) {\n var data = imageData.data, nPixels = data.length, v = Math.pow(2, this.value()), s = Math.pow(2, this.saturation()), h = Math.abs(this.hue() + 360) % 360, i;\n var vsu = v * s * Math.cos((h * Math.PI) / 180), vsw = v * s * Math.sin((h * Math.PI) / 180);\n var rr = 0.299 * v + 0.701 * vsu + 0.167 * vsw, rg = 0.587 * v - 0.587 * vsu + 0.33 * vsw, rb = 0.114 * v - 0.114 * vsu - 0.497 * vsw;\n var gr = 0.299 * v - 0.299 * vsu - 0.328 * vsw, gg = 0.587 * v + 0.413 * vsu + 0.035 * vsw, gb = 0.114 * v - 0.114 * vsu + 0.293 * vsw;\n var br = 0.299 * v - 0.3 * vsu + 1.25 * vsw, bg = 0.587 * v - 0.586 * vsu - 1.05 * vsw, bb = 0.114 * v + 0.886 * vsu - 0.2 * vsw;\n var r, g, b, a;\n for (i = 0; i < nPixels; i += 4) {\n r = data[i + 0];\n g = data[i + 1];\n b = data[i + 2];\n a = data[i + 3];\n data[i + 0] = rr * r + rg * g + rb * b;\n data[i + 1] = gr * r + gg * g + gb * b;\n data[i + 2] = br * r + bg * g + bb * b;\n data[i + 3] = a;\n }\n};\nexports.HSV = HSV;\nFactory_1.Factory.addGetterSetter(Node_1.Node, 'hue', 0, (0, Validators_1.getNumberValidator)(), Factory_1.Factory.afterSetFilter);\nFactory_1.Factory.addGetterSetter(Node_1.Node, 'saturation', 0, (0, Validators_1.getNumberValidator)(), Factory_1.Factory.afterSetFilter);\nFactory_1.Factory.addGetterSetter(Node_1.Node, 'value', 0, (0, Validators_1.getNumberValidator)(), Factory_1.Factory.afterSetFilter);\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Invert = void 0;\nconst Invert = function (imageData) {\n var data = imageData.data, len = data.length, i;\n for (i = 0; i < len; i += 4) {\n data[i] = 255 - data[i];\n data[i + 1] = 255 - data[i + 1];\n data[i + 2] = 255 - data[i + 2];\n }\n};\nexports.Invert = Invert;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Kaleidoscope = void 0;\nconst Factory_1 = require(\"../Factory\");\nconst Node_1 = require(\"../Node\");\nconst Util_1 = require(\"../Util\");\nconst Validators_1 = require(\"../Validators\");\nvar ToPolar = function (src, dst, opt) {\n var srcPixels = src.data, dstPixels = dst.data, xSize = src.width, ySize = src.height, xMid = opt.polarCenterX || xSize / 2, yMid = opt.polarCenterY || ySize / 2, i, x, y, r = 0, g = 0, b = 0, a = 0;\n var rad, rMax = Math.sqrt(xMid * xMid + yMid * yMid);\n x = xSize - xMid;\n y = ySize - yMid;\n rad = Math.sqrt(x * x + y * y);\n rMax = rad > rMax ? rad : rMax;\n var rSize = ySize, tSize = xSize, radius, theta;\n var conversion = ((360 / tSize) * Math.PI) / 180, sin, cos;\n for (theta = 0; theta < tSize; theta += 1) {\n sin = Math.sin(theta * conversion);\n cos = Math.cos(theta * conversion);\n for (radius = 0; radius < rSize; radius += 1) {\n x = Math.floor(xMid + ((rMax * radius) / rSize) * cos);\n y = Math.floor(yMid + ((rMax * radius) / rSize) * sin);\n i = (y * xSize + x) * 4;\n r = srcPixels[i + 0];\n g = srcPixels[i + 1];\n b = srcPixels[i + 2];\n a = srcPixels[i + 3];\n i = (theta + radius * xSize) * 4;\n dstPixels[i + 0] = r;\n dstPixels[i + 1] = g;\n dstPixels[i + 2] = b;\n dstPixels[i + 3] = a;\n }\n }\n};\nvar FromPolar = function (src, dst, opt) {\n var srcPixels = src.data, dstPixels = dst.data, xSize = src.width, ySize = src.height, xMid = opt.polarCenterX || xSize / 2, yMid = opt.polarCenterY || ySize / 2, i, x, y, dx, dy, r = 0, g = 0, b = 0, a = 0;\n var rad, rMax = Math.sqrt(xMid * xMid + yMid * yMid);\n x = xSize - xMid;\n y = ySize - yMid;\n rad = Math.sqrt(x * x + y * y);\n rMax = rad > rMax ? rad : rMax;\n var rSize = ySize, tSize = xSize, radius, theta, phaseShift = opt.polarRotation || 0;\n var x1, y1;\n for (x = 0; x < xSize; x += 1) {\n for (y = 0; y < ySize; y += 1) {\n dx = x - xMid;\n dy = y - yMid;\n radius = (Math.sqrt(dx * dx + dy * dy) * rSize) / rMax;\n theta = ((Math.atan2(dy, dx) * 180) / Math.PI + 360 + phaseShift) % 360;\n theta = (theta * tSize) / 360;\n x1 = Math.floor(theta);\n y1 = Math.floor(radius);\n i = (y1 * xSize + x1) * 4;\n r = srcPixels[i + 0];\n g = srcPixels[i + 1];\n b = srcPixels[i + 2];\n a = srcPixels[i + 3];\n i = (y * xSize + x) * 4;\n dstPixels[i + 0] = r;\n dstPixels[i + 1] = g;\n dstPixels[i + 2] = b;\n dstPixels[i + 3] = a;\n }\n }\n};\nconst Kaleidoscope = function (imageData) {\n var xSize = imageData.width, ySize = imageData.height;\n var x, y, xoff, i, r, g, b, a, srcPos, dstPos;\n var power = Math.round(this.kaleidoscopePower());\n var angle = Math.round(this.kaleidoscopeAngle());\n var offset = Math.floor((xSize * (angle % 360)) / 360);\n if (power < 1) {\n return;\n }\n var tempCanvas = Util_1.Util.createCanvasElement();\n tempCanvas.width = xSize;\n tempCanvas.height = ySize;\n var scratchData = tempCanvas\n .getContext('2d')\n .getImageData(0, 0, xSize, ySize);\n Util_1.Util.releaseCanvas(tempCanvas);\n ToPolar(imageData, scratchData, {\n polarCenterX: xSize / 2,\n polarCenterY: ySize / 2,\n });\n var minSectionSize = xSize / Math.pow(2, power);\n while (minSectionSize <= 8) {\n minSectionSize = minSectionSize * 2;\n power -= 1;\n }\n minSectionSize = Math.ceil(minSectionSize);\n var sectionSize = minSectionSize;\n var xStart = 0, xEnd = sectionSize, xDelta = 1;\n if (offset + minSectionSize > xSize) {\n xStart = sectionSize;\n xEnd = 0;\n xDelta = -1;\n }\n for (y = 0; y < ySize; y += 1) {\n for (x = xStart; x !== xEnd; x += xDelta) {\n xoff = Math.round(x + offset) % xSize;\n srcPos = (xSize * y + xoff) * 4;\n r = scratchData.data[srcPos + 0];\n g = scratchData.data[srcPos + 1];\n b = scratchData.data[srcPos + 2];\n a = scratchData.data[srcPos + 3];\n dstPos = (xSize * y + x) * 4;\n scratchData.data[dstPos + 0] = r;\n scratchData.data[dstPos + 1] = g;\n scratchData.data[dstPos + 2] = b;\n scratchData.data[dstPos + 3] = a;\n }\n }\n for (y = 0; y < ySize; y += 1) {\n sectionSize = Math.floor(minSectionSize);\n for (i = 0; i < power; i += 1) {\n for (x = 0; x < sectionSize + 1; x += 1) {\n srcPos = (xSize * y + x) * 4;\n r = scratchData.data[srcPos + 0];\n g = scratchData.data[srcPos + 1];\n b = scratchData.data[srcPos + 2];\n a = scratchData.data[srcPos + 3];\n dstPos = (xSize * y + sectionSize * 2 - x - 1) * 4;\n scratchData.data[dstPos + 0] = r;\n scratchData.data[dstPos + 1] = g;\n scratchData.data[dstPos + 2] = b;\n scratchData.data[dstPos + 3] = a;\n }\n sectionSize *= 2;\n }\n }\n FromPolar(scratchData, imageData, { polarRotation: 0 });\n};\nexports.Kaleidoscope = Kaleidoscope;\nFactory_1.Factory.addGetterSetter(Node_1.Node, 'kaleidoscopePower', 2, (0, Validators_1.getNumberValidator)(), Factory_1.Factory.afterSetFilter);\nFactory_1.Factory.addGetterSetter(Node_1.Node, 'kaleidoscopeAngle', 0, (0, Validators_1.getNumberValidator)(), Factory_1.Factory.afterSetFilter);\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Mask = void 0;\nconst Factory_1 = require(\"../Factory\");\nconst Node_1 = require(\"../Node\");\nconst Validators_1 = require(\"../Validators\");\nfunction pixelAt(idata, x, y) {\n var idx = (y * idata.width + x) * 4;\n var d = [];\n d.push(idata.data[idx++], idata.data[idx++], idata.data[idx++], idata.data[idx++]);\n return d;\n}\nfunction rgbDistance(p1, p2) {\n return Math.sqrt(Math.pow(p1[0] - p2[0], 2) +\n Math.pow(p1[1] - p2[1], 2) +\n Math.pow(p1[2] - p2[2], 2));\n}\nfunction rgbMean(pTab) {\n var m = [0, 0, 0];\n for (var i = 0; i < pTab.length; i++) {\n m[0] += pTab[i][0];\n m[1] += pTab[i][1];\n m[2] += pTab[i][2];\n }\n m[0] /= pTab.length;\n m[1] /= pTab.length;\n m[2] /= pTab.length;\n return m;\n}\nfunction backgroundMask(idata, threshold) {\n var rgbv_no = pixelAt(idata, 0, 0);\n var rgbv_ne = pixelAt(idata, idata.width - 1, 0);\n var rgbv_so = pixelAt(idata, 0, idata.height - 1);\n var rgbv_se = pixelAt(idata, idata.width - 1, idata.height - 1);\n var thres = threshold || 10;\n if (rgbDistance(rgbv_no, rgbv_ne) < thres &&\n rgbDistance(rgbv_ne, rgbv_se) < thres &&\n rgbDistance(rgbv_se, rgbv_so) < thres &&\n rgbDistance(rgbv_so, rgbv_no) < thres) {\n var mean = rgbMean([rgbv_ne, rgbv_no, rgbv_se, rgbv_so]);\n var mask = [];\n for (var i = 0; i < idata.width * idata.height; i++) {\n var d = rgbDistance(mean, [\n idata.data[i * 4],\n idata.data[i * 4 + 1],\n idata.data[i * 4 + 2],\n ]);\n mask[i] = d < thres ? 0 : 255;\n }\n return mask;\n }\n}\nfunction applyMask(idata, mask) {\n for (var i = 0; i < idata.width * idata.height; i++) {\n idata.data[4 * i + 3] = mask[i];\n }\n}\nfunction erodeMask(mask, sw, sh) {\n var weights = [1, 1, 1, 1, 0, 1, 1, 1, 1];\n var side = Math.round(Math.sqrt(weights.length));\n var halfSide = Math.floor(side / 2);\n var maskResult = [];\n for (var y = 0; y < sh; y++) {\n for (var x = 0; x < sw; x++) {\n var so = y * sw + x;\n var a = 0;\n for (var cy = 0; cy < side; cy++) {\n for (var cx = 0; cx < side; cx++) {\n var scy = y + cy - halfSide;\n var scx = x + cx - halfSide;\n if (scy >= 0 && scy < sh && scx >= 0 && scx < sw) {\n var srcOff = scy * sw + scx;\n var wt = weights[cy * side + cx];\n a += mask[srcOff] * wt;\n }\n }\n }\n maskResult[so] = a === 255 * 8 ? 255 : 0;\n }\n }\n return maskResult;\n}\nfunction dilateMask(mask, sw, sh) {\n var weights = [1, 1, 1, 1, 1, 1, 1, 1, 1];\n var side = Math.round(Math.sqrt(weights.length));\n var halfSide = Math.floor(side / 2);\n var maskResult = [];\n for (var y = 0; y < sh; y++) {\n for (var x = 0; x < sw; x++) {\n var so = y * sw + x;\n var a = 0;\n for (var cy = 0; cy < side; cy++) {\n for (var cx = 0; cx < side; cx++) {\n var scy = y + cy - halfSide;\n var scx = x + cx - halfSide;\n if (scy >= 0 && scy < sh && scx >= 0 && scx < sw) {\n var srcOff = scy * sw + scx;\n var wt = weights[cy * side + cx];\n a += mask[srcOff] * wt;\n }\n }\n }\n maskResult[so] = a >= 255 * 4 ? 255 : 0;\n }\n }\n return maskResult;\n}\nfunction smoothEdgeMask(mask, sw, sh) {\n var weights = [1 / 9, 1 / 9, 1 / 9, 1 / 9, 1 / 9, 1 / 9, 1 / 9, 1 / 9, 1 / 9];\n var side = Math.round(Math.sqrt(weights.length));\n var halfSide = Math.floor(side / 2);\n var maskResult = [];\n for (var y = 0; y < sh; y++) {\n for (var x = 0; x < sw; x++) {\n var so = y * sw + x;\n var a = 0;\n for (var cy = 0; cy < side; cy++) {\n for (var cx = 0; cx < side; cx++) {\n var scy = y + cy - halfSide;\n var scx = x + cx - halfSide;\n if (scy >= 0 && scy < sh && scx >= 0 && scx < sw) {\n var srcOff = scy * sw + scx;\n var wt = weights[cy * side + cx];\n a += mask[srcOff] * wt;\n }\n }\n }\n maskResult[so] = a;\n }\n }\n return maskResult;\n}\nconst Mask = function (imageData) {\n var threshold = this.threshold(), mask = backgroundMask(imageData, threshold);\n if (mask) {\n mask = erodeMask(mask, imageData.width, imageData.height);\n mask = dilateMask(mask, imageData.width, imageData.height);\n mask = smoothEdgeMask(mask, imageData.width, imageData.height);\n applyMask(imageData, mask);\n }\n return imageData;\n};\nexports.Mask = Mask;\nFactory_1.Factory.addGetterSetter(Node_1.Node, 'threshold', 0, (0, Validators_1.getNumberValidator)(), Factory_1.Factory.afterSetFilter);\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Noise = void 0;\nconst Factory_1 = require(\"../Factory\");\nconst Node_1 = require(\"../Node\");\nconst Validators_1 = require(\"../Validators\");\nconst Noise = function (imageData) {\n var amount = this.noise() * 255, data = imageData.data, nPixels = data.length, half = amount / 2, i;\n for (i = 0; i < nPixels; i += 4) {\n data[i + 0] += half - 2 * half * Math.random();\n data[i + 1] += half - 2 * half * Math.random();\n data[i + 2] += half - 2 * half * Math.random();\n }\n};\nexports.Noise = Noise;\nFactory_1.Factory.addGetterSetter(Node_1.Node, 'noise', 0.2, (0, Validators_1.getNumberValidator)(), Factory_1.Factory.afterSetFilter);\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Pixelate = void 0;\nconst Factory_1 = require(\"../Factory\");\nconst Util_1 = require(\"../Util\");\nconst Node_1 = require(\"../Node\");\nconst Validators_1 = require(\"../Validators\");\nconst Pixelate = function (imageData) {\n var pixelSize = Math.ceil(this.pixelSize()), width = imageData.width, height = imageData.height, x, y, i, red, green, blue, alpha, nBinsX = Math.ceil(width / pixelSize), nBinsY = Math.ceil(height / pixelSize), xBinStart, xBinEnd, yBinStart, yBinEnd, xBin, yBin, pixelsInBin, data = imageData.data;\n if (pixelSize <= 0) {\n Util_1.Util.error('pixelSize value can not be <= 0');\n return;\n }\n for (xBin = 0; xBin < nBinsX; xBin += 1) {\n for (yBin = 0; yBin < nBinsY; yBin += 1) {\n red = 0;\n green = 0;\n blue = 0;\n alpha = 0;\n xBinStart = xBin * pixelSize;\n xBinEnd = xBinStart + pixelSize;\n yBinStart = yBin * pixelSize;\n yBinEnd = yBinStart + pixelSize;\n pixelsInBin = 0;\n for (x = xBinStart; x < xBinEnd; x += 1) {\n if (x >= width) {\n continue;\n }\n for (y = yBinStart; y < yBinEnd; y += 1) {\n if (y >= height) {\n continue;\n }\n i = (width * y + x) * 4;\n red += data[i + 0];\n green += data[i + 1];\n blue += data[i + 2];\n alpha += data[i + 3];\n pixelsInBin += 1;\n }\n }\n red = red / pixelsInBin;\n green = green / pixelsInBin;\n blue = blue / pixelsInBin;\n alpha = alpha / pixelsInBin;\n for (x = xBinStart; x < xBinEnd; x += 1) {\n if (x >= width) {\n continue;\n }\n for (y = yBinStart; y < yBinEnd; y += 1) {\n if (y >= height) {\n continue;\n }\n i = (width * y + x) * 4;\n data[i + 0] = red;\n data[i + 1] = green;\n data[i + 2] = blue;\n data[i + 3] = alpha;\n }\n }\n }\n }\n};\nexports.Pixelate = Pixelate;\nFactory_1.Factory.addGetterSetter(Node_1.Node, 'pixelSize', 8, (0, Validators_1.getNumberValidator)(), Factory_1.Factory.afterSetFilter);\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Posterize = void 0;\nconst Factory_1 = require(\"../Factory\");\nconst Node_1 = require(\"../Node\");\nconst Validators_1 = require(\"../Validators\");\nconst Posterize = function (imageData) {\n var levels = Math.round(this.levels() * 254) + 1, data = imageData.data, len = data.length, scale = 255 / levels, i;\n for (i = 0; i < len; i += 1) {\n data[i] = Math.floor(data[i] / scale) * scale;\n }\n};\nexports.Posterize = Posterize;\nFactory_1.Factory.addGetterSetter(Node_1.Node, 'levels', 0.5, (0, Validators_1.getNumberValidator)(), Factory_1.Factory.afterSetFilter);\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.RGB = void 0;\nconst Factory_1 = require(\"../Factory\");\nconst Node_1 = require(\"../Node\");\nconst Validators_1 = require(\"../Validators\");\nconst RGB = function (imageData) {\n var data = imageData.data, nPixels = data.length, red = this.red(), green = this.green(), blue = this.blue(), i, brightness;\n for (i = 0; i < nPixels; i += 4) {\n brightness =\n (0.34 * data[i] + 0.5 * data[i + 1] + 0.16 * data[i + 2]) / 255;\n data[i] = brightness * red;\n data[i + 1] = brightness * green;\n data[i + 2] = brightness * blue;\n data[i + 3] = data[i + 3];\n }\n};\nexports.RGB = RGB;\nFactory_1.Factory.addGetterSetter(Node_1.Node, 'red', 0, function (val) {\n this._filterUpToDate = false;\n if (val > 255) {\n return 255;\n }\n else if (val < 0) {\n return 0;\n }\n else {\n return Math.round(val);\n }\n});\nFactory_1.Factory.addGetterSetter(Node_1.Node, 'green', 0, function (val) {\n this._filterUpToDate = false;\n if (val > 255) {\n return 255;\n }\n else if (val < 0) {\n return 0;\n }\n else {\n return Math.round(val);\n }\n});\nFactory_1.Factory.addGetterSetter(Node_1.Node, 'blue', 0, Validators_1.RGBComponent, Factory_1.Factory.afterSetFilter);\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.RGBA = void 0;\nconst Factory_1 = require(\"../Factory\");\nconst Node_1 = require(\"../Node\");\nconst Validators_1 = require(\"../Validators\");\nconst RGBA = function (imageData) {\n var data = imageData.data, nPixels = data.length, red = this.red(), green = this.green(), blue = this.blue(), alpha = this.alpha(), i, ia;\n for (i = 0; i < nPixels; i += 4) {\n ia = 1 - alpha;\n data[i] = red * alpha + data[i] * ia;\n data[i + 1] = green * alpha + data[i + 1] * ia;\n data[i + 2] = blue * alpha + data[i + 2] * ia;\n }\n};\nexports.RGBA = RGBA;\nFactory_1.Factory.addGetterSetter(Node_1.Node, 'red', 0, function (val) {\n this._filterUpToDate = false;\n if (val > 255) {\n return 255;\n }\n else if (val < 0) {\n return 0;\n }\n else {\n return Math.round(val);\n }\n});\nFactory_1.Factory.addGetterSetter(Node_1.Node, 'green', 0, function (val) {\n this._filterUpToDate = false;\n if (val > 255) {\n return 255;\n }\n else if (val < 0) {\n return 0;\n }\n else {\n return Math.round(val);\n }\n});\nFactory_1.Factory.addGetterSetter(Node_1.Node, 'blue', 0, Validators_1.RGBComponent, Factory_1.Factory.afterSetFilter);\nFactory_1.Factory.addGetterSetter(Node_1.Node, 'alpha', 1, function (val) {\n this._filterUpToDate = false;\n if (val > 1) {\n return 1;\n }\n else if (val < 0) {\n return 0;\n }\n else {\n return val;\n }\n});\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Sepia = void 0;\nconst Sepia = function (imageData) {\n var data = imageData.data, nPixels = data.length, i, r, g, b;\n for (i = 0; i < nPixels; i += 4) {\n r = data[i + 0];\n g = data[i + 1];\n b = data[i + 2];\n data[i + 0] = Math.min(255, r * 0.393 + g * 0.769 + b * 0.189);\n data[i + 1] = Math.min(255, r * 0.349 + g * 0.686 + b * 0.168);\n data[i + 2] = Math.min(255, r * 0.272 + g * 0.534 + b * 0.131);\n }\n};\nexports.Sepia = Sepia;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Solarize = void 0;\nconst Solarize = function (imageData) {\n var data = imageData.data, w = imageData.width, h = imageData.height, w4 = w * 4, y = h;\n do {\n var offsetY = (y - 1) * w4;\n var x = w;\n do {\n var offset = offsetY + (x - 1) * 4;\n var r = data[offset];\n var g = data[offset + 1];\n var b = data[offset + 2];\n if (r > 127) {\n r = 255 - r;\n }\n if (g > 127) {\n g = 255 - g;\n }\n if (b > 127) {\n b = 255 - b;\n }\n data[offset] = r;\n data[offset + 1] = g;\n data[offset + 2] = b;\n } while (--x);\n } while (--y);\n};\nexports.Solarize = Solarize;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Threshold = void 0;\nconst Factory_1 = require(\"../Factory\");\nconst Node_1 = require(\"../Node\");\nconst Validators_1 = require(\"../Validators\");\nconst Threshold = function (imageData) {\n var level = this.threshold() * 255, data = imageData.data, len = data.length, i;\n for (i = 0; i < len; i += 1) {\n data[i] = data[i] < level ? 0 : 255;\n }\n};\nexports.Threshold = Threshold;\nFactory_1.Factory.addGetterSetter(Node_1.Node, 'threshold', 0.5, (0, Validators_1.getNumberValidator)(), Factory_1.Factory.afterSetFilter);\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Konva = void 0;\nconst _CoreInternals_1 = require(\"./_CoreInternals\");\nconst Arc_1 = require(\"./shapes/Arc\");\nconst Arrow_1 = require(\"./shapes/Arrow\");\nconst Circle_1 = require(\"./shapes/Circle\");\nconst Ellipse_1 = require(\"./shapes/Ellipse\");\nconst Image_1 = require(\"./shapes/Image\");\nconst Label_1 = require(\"./shapes/Label\");\nconst Line_1 = require(\"./shapes/Line\");\nconst Path_1 = require(\"./shapes/Path\");\nconst Rect_1 = require(\"./shapes/Rect\");\nconst RegularPolygon_1 = require(\"./shapes/RegularPolygon\");\nconst Ring_1 = require(\"./shapes/Ring\");\nconst Sprite_1 = require(\"./shapes/Sprite\");\nconst Star_1 = require(\"./shapes/Star\");\nconst Text_1 = require(\"./shapes/Text\");\nconst TextPath_1 = require(\"./shapes/TextPath\");\nconst Transformer_1 = require(\"./shapes/Transformer\");\nconst Wedge_1 = require(\"./shapes/Wedge\");\nconst Blur_1 = require(\"./filters/Blur\");\nconst Brighten_1 = require(\"./filters/Brighten\");\nconst Contrast_1 = require(\"./filters/Contrast\");\nconst Emboss_1 = require(\"./filters/Emboss\");\nconst Enhance_1 = require(\"./filters/Enhance\");\nconst Grayscale_1 = require(\"./filters/Grayscale\");\nconst HSL_1 = require(\"./filters/HSL\");\nconst HSV_1 = require(\"./filters/HSV\");\nconst Invert_1 = require(\"./filters/Invert\");\nconst Kaleidoscope_1 = require(\"./filters/Kaleidoscope\");\nconst Mask_1 = require(\"./filters/Mask\");\nconst Noise_1 = require(\"./filters/Noise\");\nconst Pixelate_1 = require(\"./filters/Pixelate\");\nconst Posterize_1 = require(\"./filters/Posterize\");\nconst RGB_1 = require(\"./filters/RGB\");\nconst RGBA_1 = require(\"./filters/RGBA\");\nconst Sepia_1 = require(\"./filters/Sepia\");\nconst Solarize_1 = require(\"./filters/Solarize\");\nconst Threshold_1 = require(\"./filters/Threshold\");\nexports.Konva = _CoreInternals_1.Konva.Util._assign(_CoreInternals_1.Konva, {\n Arc: Arc_1.Arc,\n Arrow: Arrow_1.Arrow,\n Circle: Circle_1.Circle,\n Ellipse: Ellipse_1.Ellipse,\n Image: Image_1.Image,\n Label: Label_1.Label,\n Tag: Label_1.Tag,\n Line: Line_1.Line,\n Path: Path_1.Path,\n Rect: Rect_1.Rect,\n RegularPolygon: RegularPolygon_1.RegularPolygon,\n Ring: Ring_1.Ring,\n Sprite: Sprite_1.Sprite,\n Star: Star_1.Star,\n Text: Text_1.Text,\n TextPath: TextPath_1.TextPath,\n Transformer: Transformer_1.Transformer,\n Wedge: Wedge_1.Wedge,\n Filters: {\n Blur: Blur_1.Blur,\n Brighten: Brighten_1.Brighten,\n Contrast: Contrast_1.Contrast,\n Emboss: Emboss_1.Emboss,\n Enhance: Enhance_1.Enhance,\n Grayscale: Grayscale_1.Grayscale,\n HSL: HSL_1.HSL,\n HSV: HSV_1.HSV,\n Invert: Invert_1.Invert,\n Kaleidoscope: Kaleidoscope_1.Kaleidoscope,\n Mask: Mask_1.Mask,\n Noise: Noise_1.Noise,\n Pixelate: Pixelate_1.Pixelate,\n Posterize: Posterize_1.Posterize,\n RGB: RGB_1.RGB,\n RGBA: RGBA_1.RGBA,\n Sepia: Sepia_1.Sepia,\n Solarize: Solarize_1.Solarize,\n Threshold: Threshold_1.Threshold,\n },\n});\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst _FullInternals_1 = require(\"./_FullInternals\");\nmodule.exports = _FullInternals_1.Konva;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Konva = void 0;\nvar _CoreInternals_1 = require(\"./_CoreInternals\");\nObject.defineProperty(exports, \"Konva\", { enumerable: true, get: function () { return _CoreInternals_1.Konva; } });\nconst _CoreInternals_2 = require(\"./_CoreInternals\");\nmodule.exports = _CoreInternals_2.Konva;\n","/**\n * @license React\n * react-reconciler.production.min.js\n *\n * Copyright (c) Facebook, Inc. and its affiliates.\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 */\nmodule.exports = function $$$reconciler($$$hostConfig) {\n var exports = {};\n'use strict';var aa=require(\"react\"),ba=require(\"scheduler\"),ca=Object.assign;function n(a){for(var b=\"https://reactjs.org/docs/error-decoder.html?invariant=\"+a,c=1;ch||e[g]!==f[h]){var k=\"\\n\"+e[g].replace(\" at new \",\" at \");a.displayName&&k.includes(\"\")&&(k=k.replace(\"\",a.displayName));return k}while(1<=g&&0<=h)}break}}}finally{dc=!1,Error.prepareStackTrace=c}return(a=a?a.displayName||a.name:\"\")?cc(a):\"\"}var fc=Object.prototype.hasOwnProperty,gc=[],hc=-1;function ic(a){return{current:a}}\nfunction q(a){0>hc||(a.current=gc[hc],gc[hc]=null,hc--)}function v(a,b){hc++;gc[hc]=a.current;a.current=b}var jc={},x=ic(jc),z=ic(!1),kc=jc;function mc(a,b){var c=a.type.contextTypes;if(!c)return jc;var d=a.stateNode;if(d&&d.__reactInternalMemoizedUnmaskedChildContext===b)return d.__reactInternalMemoizedMaskedChildContext;var e={},f;for(f in c)e[f]=b[f];d&&(a=a.stateNode,a.__reactInternalMemoizedUnmaskedChildContext=b,a.__reactInternalMemoizedMaskedChildContext=e);return e}\nfunction A(a){a=a.childContextTypes;return null!==a&&void 0!==a}function nc(){q(z);q(x)}function oc(a,b,c){if(x.current!==jc)throw Error(n(168));v(x,b);v(z,c)}function pc(a,b,c){var d=a.stateNode;b=b.childContextTypes;if(\"function\"!==typeof d.getChildContext)return c;d=d.getChildContext();for(var e in d)if(!(e in b))throw Error(n(108,va(a)||\"Unknown\",e));return ca({},c,d)}\nfunction qc(a){a=(a=a.stateNode)&&a.__reactInternalMemoizedMergedChildContext||jc;kc=x.current;v(x,a);v(z,z.current);return!0}function rc(a,b,c){var d=a.stateNode;if(!d)throw Error(n(169));c?(a=pc(a,b,kc),d.__reactInternalMemoizedMergedChildContext=a,q(z),q(x),v(x,a)):q(z);v(z,c)}var tc=Math.clz32?Math.clz32:sc,uc=Math.log,vc=Math.LN2;function sc(a){a>>>=0;return 0===a?32:31-(uc(a)/vc|0)|0}var wc=64,xc=4194304;\nfunction yc(a){switch(a&-a){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return a&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return a&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;\ndefault:return a}}function zc(a,b){var c=a.pendingLanes;if(0===c)return 0;var d=0,e=a.suspendedLanes,f=a.pingedLanes,g=c&268435455;if(0!==g){var h=g&~e;0!==h?d=yc(h):(f&=g,0!==f&&(d=yc(f)))}else g=c&~e,0!==g?d=yc(g):0!==f&&(d=yc(f));if(0===d)return 0;if(0!==b&&b!==d&&0===(b&e)&&(e=d&-d,f=b&-b,e>=f||16===e&&0!==(f&4194240)))return b;0!==(d&4)&&(d|=c&16);b=a.entangledLanes;if(0!==b)for(a=a.entanglements,b&=d;0c;c++)b.push(a);return b}\nfunction Fc(a,b,c){a.pendingLanes|=b;536870912!==b&&(a.suspendedLanes=0,a.pingedLanes=0);a=a.eventTimes;b=31-tc(b);a[b]=c}function Gc(a,b){var c=a.pendingLanes&~b;a.pendingLanes=b;a.suspendedLanes=0;a.pingedLanes=0;a.expiredLanes&=b;a.mutableReadLanes&=b;a.entangledLanes&=b;b=a.entanglements;var d=a.eventTimes;for(a=a.expirationTimes;0>=g;e-=g;id=1<<32-tc(b)+e|c<t?(E=u,u=null):E=u.sibling;var y=p(e,u,h[t],k);if(null===y){null===u&&(u=E);break}a&&u&&null===y.alternate&&b(e,u);g=f(y,g,t);null===m?l=y:m.sibling=y;m=y;u=E}if(t===h.length)return c(e,u),F&&kd(e,t),l;if(null===u){for(;tt?(E=m,m=null):E=m.sibling;var w=p(e,m,y.value,k);if(null===w){null===m&&(m=E);break}a&&m&&null===w.alternate&&b(e,m);g=f(w,g,t);null===u?l=w:u.sibling=w;u=w;m=E}if(y.done)return c(e,\nm),F&&kd(e,t),l;if(null===m){for(;!y.done;t++,y=h.next())y=r(e,y.value,k),null!==y&&(g=f(y,g,t),null===u?l=y:u.sibling=y,u=y);F&&kd(e,t);return l}for(m=d(e,m);!y.done;t++,y=h.next())y=B(m,e,t,y.value,k),null!==y&&(a&&null!==y.alternate&&m.delete(null===y.key?t:y.key),g=f(y,g,t),null===u?l=y:u.sibling=y,u=y);a&&m.forEach(function(a){return b(e,a)});F&&kd(e,t);return l}function ya(a,d,f,h){\"object\"===typeof f&&null!==f&&f.type===ha&&null===f.key&&(f=f.props.children);if(\"object\"===typeof f&&null!==\nf){switch(f.$$typeof){case ea:a:{for(var k=f.key,l=d;null!==l;){if(l.key===k){k=f.type;if(k===ha){if(7===l.tag){c(a,l.sibling);d=e(l,f.props.children);d.return=a;a=d;break a}}else if(l.elementType===k||\"object\"===typeof k&&null!==k&&k.$$typeof===qa&&Hd(k)===l.type){c(a,l.sibling);d=e(l,f.props);d.ref=Fd(a,l,f);d.return=a;a=d;break a}c(a,l);break}else b(a,l);l=l.sibling}f.type===ha?(d=Nd(f.props.children,a.mode,h,f.key),d.return=a,a=d):(h=Ld(f.type,f.key,f.props,null,a.mode,h),h.ref=Fd(a,d,f),h.return=\na,a=h)}return g(a);case fa:a:{for(l=f.key;null!==d;){if(d.key===l)if(4===d.tag&&d.stateNode.containerInfo===f.containerInfo&&d.stateNode.implementation===f.implementation){c(a,d.sibling);d=e(d,f.children||[]);d.return=a;a=d;break a}else{c(a,d);break}else b(a,d);d=d.sibling}d=Md(f,a.mode,h);d.return=a;a=d}return g(a);case qa:return l=f._init,ya(a,d,l(f._payload),h)}if(Da(f))return w(a,d,f,h);if(ta(f))return Y(a,d,f,h);Gd(a,f)}return\"string\"===typeof f&&\"\"!==f||\"number\"===typeof f?(f=\"\"+f,null!==d&&\n6===d.tag?(c(a,d.sibling),d=e(d,f),d.return=a,a=d):(c(a,d),d=Kd(f,a.mode,h),d.return=a,a=d),g(a)):c(a,d)}return ya}var Od=Id(!0),Pd=Id(!1),Qd=ic(null),Rd=null,Sd=null,Td=null;function Ud(){Td=Sd=Rd=null}function Vd(a,b,c){Sa?(v(Qd,b._currentValue),b._currentValue=c):(v(Qd,b._currentValue2),b._currentValue2=c)}function Wd(a){var b=Qd.current;q(Qd);Sa?a._currentValue=b:a._currentValue2=b}\nfunction Xd(a,b,c){for(;null!==a;){var d=a.alternate;(a.childLanes&b)!==b?(a.childLanes|=b,null!==d&&(d.childLanes|=b)):null!==d&&(d.childLanes&b)!==b&&(d.childLanes|=b);if(a===c)break;a=a.return}}function Yd(a,b){Rd=a;Td=Sd=null;a=a.dependencies;null!==a&&null!==a.firstContext&&(0!==(a.lanes&b)&&(G=!0),a.firstContext=null)}\nfunction Zd(a){var b=Sa?a._currentValue:a._currentValue2;if(Td!==a)if(a={context:a,memoizedValue:b,next:null},null===Sd){if(null===Rd)throw Error(n(308));Sd=a;Rd.dependencies={lanes:0,firstContext:a}}else Sd=Sd.next=a;return b}var $d=null;function ae(a){null===$d?$d=[a]:$d.push(a)}function be(a,b,c,d){var e=b.interleaved;null===e?(c.next=c,ae(b)):(c.next=e.next,e.next=c);b.interleaved=c;return ce(a,d)}\nfunction ce(a,b){a.lanes|=b;var c=a.alternate;null!==c&&(c.lanes|=b);c=a;for(a=a.return;null!==a;)a.childLanes|=b,c=a.alternate,null!==c&&(c.childLanes|=b),c=a,a=a.return;return 3===c.tag?c.stateNode:null}var de=!1;function ee(a){a.updateQueue={baseState:a.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}\nfunction fe(a,b){a=a.updateQueue;b.updateQueue===a&&(b.updateQueue={baseState:a.baseState,firstBaseUpdate:a.firstBaseUpdate,lastBaseUpdate:a.lastBaseUpdate,shared:a.shared,effects:a.effects})}function ge(a,b){return{eventTime:a,lane:b,tag:0,payload:null,callback:null,next:null}}\nfunction he(a,b,c){var d=a.updateQueue;if(null===d)return null;d=d.shared;if(0!==(H&2)){var e=d.pending;null===e?b.next=b:(b.next=e.next,e.next=b);d.pending=b;return ce(a,c)}e=d.interleaved;null===e?(b.next=b,ae(d)):(b.next=e.next,e.next=b);d.interleaved=b;return ce(a,c)}function ie(a,b,c){b=b.updateQueue;if(null!==b&&(b=b.shared,0!==(c&4194240))){var d=b.lanes;d&=a.pendingLanes;c|=d;b.lanes=c;Hc(a,c)}}\nfunction je(a,b){var c=a.updateQueue,d=a.alternate;if(null!==d&&(d=d.updateQueue,c===d)){var e=null,f=null;c=c.firstBaseUpdate;if(null!==c){do{var g={eventTime:c.eventTime,lane:c.lane,tag:c.tag,payload:c.payload,callback:c.callback,next:null};null===f?e=f=g:f=f.next=g;c=c.next}while(null!==c);null===f?e=f=b:f=f.next=b}else e=f=b;c={baseState:d.baseState,firstBaseUpdate:e,lastBaseUpdate:f,shared:d.shared,effects:d.effects};a.updateQueue=c;return}a=c.lastBaseUpdate;null===a?c.firstBaseUpdate=b:a.next=\nb;c.lastBaseUpdate=b}\nfunction ke(a,b,c,d){var e=a.updateQueue;de=!1;var f=e.firstBaseUpdate,g=e.lastBaseUpdate,h=e.shared.pending;if(null!==h){e.shared.pending=null;var k=h,l=k.next;k.next=null;null===g?f=l:g.next=l;g=k;var m=a.alternate;null!==m&&(m=m.updateQueue,h=m.lastBaseUpdate,h!==g&&(null===h?m.firstBaseUpdate=l:h.next=l,m.lastBaseUpdate=k))}if(null!==f){var r=e.baseState;g=0;m=l=k=null;h=f;do{var p=h.lane,B=h.eventTime;if((d&p)===p){null!==m&&(m=m.next={eventTime:B,lane:0,tag:h.tag,payload:h.payload,callback:h.callback,\nnext:null});a:{var w=a,Y=h;p=b;B=c;switch(Y.tag){case 1:w=Y.payload;if(\"function\"===typeof w){r=w.call(B,r,p);break a}r=w;break a;case 3:w.flags=w.flags&-65537|128;case 0:w=Y.payload;p=\"function\"===typeof w?w.call(B,r,p):w;if(null===p||void 0===p)break a;r=ca({},r,p);break a;case 2:de=!0}}null!==h.callback&&0!==h.lane&&(a.flags|=64,p=e.effects,null===p?e.effects=[h]:p.push(h))}else B={eventTime:B,lane:p,tag:h.tag,payload:h.payload,callback:h.callback,next:null},null===m?(l=m=B,k=r):m=m.next=B,g|=\np;h=h.next;if(null===h)if(h=e.shared.pending,null===h)break;else p=h,h=p.next,p.next=null,e.lastBaseUpdate=p,e.shared.pending=null}while(1);null===m&&(k=r);e.baseState=k;e.firstBaseUpdate=l;e.lastBaseUpdate=m;b=e.shared.interleaved;if(null!==b){e=b;do g|=e.lane,e=e.next;while(e!==b)}else null===f&&(e.shared.lanes=0);le|=g;a.lanes=g;a.memoizedState=r}}\nfunction me(a,b,c){a=b.effects;b.effects=null;if(null!==a)for(b=0;bc?c:4;a(!0);var d=Ae.transition;Ae.transition={};try{a(!1),b()}finally{C=c,Ae.transition=d}}function rf(){return Oe().memoizedState}\nfunction sf(a,b,c){var d=tf(a);c={lane:d,action:c,hasEagerState:!1,eagerState:null,next:null};if(uf(a))vf(b,c);else if(c=be(a,b,c,d),null!==c){var e=O();af(c,a,d,e);wf(c,b,d)}}\nfunction cf(a,b,c){var d=tf(a),e={lane:d,action:c,hasEagerState:!1,eagerState:null,next:null};if(uf(a))vf(b,e);else{var f=a.alternate;if(0===a.lanes&&(null===f||0===f.lanes)&&(f=b.lastRenderedReducer,null!==f))try{var g=b.lastRenderedState,h=f(g,c);e.hasEagerState=!0;e.eagerState=h;if(Vc(h,g)){var k=b.interleaved;null===k?(e.next=e,ae(b)):(e.next=k.next,k.next=e);b.interleaved=e;return}}catch(l){}finally{}c=be(a,b,e,d);null!==c&&(e=O(),af(c,a,d,e),wf(c,b,d))}}\nfunction uf(a){var b=a.alternate;return a===J||null!==b&&b===J}function vf(a,b){De=Ce=!0;var c=a.pending;null===c?b.next=b:(b.next=c.next,c.next=b);a.pending=b}function wf(a,b,c){if(0!==(c&4194240)){var d=b.lanes;d&=a.pendingLanes;c|=d;b.lanes=c;Hc(a,c)}}\nvar Le={readContext:Zd,useCallback:M,useContext:M,useEffect:M,useImperativeHandle:M,useInsertionEffect:M,useLayoutEffect:M,useMemo:M,useReducer:M,useRef:M,useState:M,useDebugValue:M,useDeferredValue:M,useTransition:M,useMutableSource:M,useSyncExternalStore:M,useId:M,unstable_isNewReconciler:!1},Ie={readContext:Zd,useCallback:function(a,b){Ne().memoizedState=[a,void 0===b?null:b];return a},useContext:Zd,useEffect:gf,useImperativeHandle:function(a,b,c){c=null!==c&&void 0!==c?c.concat([a]):null;return ef(4194308,\n4,kf.bind(null,b,a),c)},useLayoutEffect:function(a,b){return ef(4194308,4,a,b)},useInsertionEffect:function(a,b){return ef(4,2,a,b)},useMemo:function(a,b){var c=Ne();b=void 0===b?null:b;a=a();c.memoizedState=[a,b];return a},useReducer:function(a,b,c){var d=Ne();b=void 0!==c?c(b):b;d.memoizedState=d.baseState=b;a={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:a,lastRenderedState:b};d.queue=a;a=a.dispatch=sf.bind(null,J,a);return[d.memoizedState,a]},useRef:function(a){var b=\nNe();a={current:a};return b.memoizedState=a},useState:bf,useDebugValue:mf,useDeferredValue:function(a){return Ne().memoizedState=a},useTransition:function(){var a=bf(!1),b=a[0];a=qf.bind(null,a[1]);Ne().memoizedState=a;return[b,a]},useMutableSource:function(){},useSyncExternalStore:function(a,b,c){var d=J,e=Ne();if(F){if(void 0===c)throw Error(n(407));c=c()}else{c=b();if(null===N)throw Error(n(349));0!==(Be&30)||Ye(d,b,c)}e.memoizedState=c;var f={value:c,getSnapshot:b};e.queue=f;gf(Ve.bind(null,d,\nf,a),[a]);d.flags|=2048;We(9,Xe.bind(null,d,f,c,b),void 0,null);return c},useId:function(){var a=Ne(),b=N.identifierPrefix;if(F){var c=jd;var d=id;c=(d&~(1<<32-tc(d)-1)).toString(32)+c;b=\":\"+b+\"R\"+c;c=Ee++;0Dg&&(b.flags|=128,d=!0,Ag(e,!1),b.lanes=4194304)}else{if(!d)if(a=we(f),null!==a){if(b.flags|=128,d=!0,a=a.updateQueue,null!==a&&(b.updateQueue=a,b.flags|=4),Ag(e,!0),null===e.tail&&\"hidden\"===e.tailMode&&!f.alternate&&!F)return Q(b),null}else 2*D()-e.renderingStartTime>Dg&&1073741824!==c&&(b.flags|=128,d=!0,Ag(e,!1),b.lanes=\n4194304);e.isBackwards?(f.sibling=b.child,b.child=f):(a=e.last,null!==a?a.sibling=f:b.child=f,e.last=f)}if(null!==e.tail)return b=e.tail,e.rendering=b,e.tail=b.sibling,e.renderingStartTime=D(),b.sibling=null,a=I.current,v(I,d?a&1|2:a&1),b;Q(b);return null;case 22:case 23:return Eg(),c=null!==b.memoizedState,null!==a&&null!==a.memoizedState!==c&&(b.flags|=8192),c&&0!==(b.mode&1)?0!==($f&1073741824)&&(Q(b),Ta&&b.subtreeFlags&6&&(b.flags|=8192)):Q(b),null;case 24:return null;case 25:return null}throw Error(n(156,\nb.tag));}\nfunction Fg(a,b){nd(b);switch(b.tag){case 1:return A(b.type)&&nc(),a=b.flags,a&65536?(b.flags=a&-65537|128,b):null;case 3:return te(),q(z),q(x),ye(),a=b.flags,0!==(a&65536)&&0===(a&128)?(b.flags=a&-65537|128,b):null;case 5:return ve(b),null;case 13:q(I);a=b.memoizedState;if(null!==a&&null!==a.dehydrated){if(null===b.alternate)throw Error(n(340));Ad()}a=b.flags;return a&65536?(b.flags=a&-65537|128,b):null;case 19:return q(I),null;case 4:return te(),null;case 10:return Wd(b.type._context),null;case 22:case 23:return Eg(),\nnull;case 24:return null;default:return null}}var Gg=!1,S=!1,Hg=\"function\"===typeof WeakSet?WeakSet:Set,T=null;function Ig(a,b){var c=a.ref;if(null!==c)if(\"function\"===typeof c)try{c(null)}catch(d){U(a,b,d)}else c.current=null}function Jg(a,b,c){try{c()}catch(d){U(a,b,d)}}var Kg=!1;\nfunction Lg(a,b){Ha(a.containerInfo);for(T=b;null!==T;)if(a=T,b=a.child,0!==(a.subtreeFlags&1028)&&null!==b)b.return=a,T=b;else for(;null!==T;){a=T;try{var c=a.alternate;if(0!==(a.flags&1024))switch(a.tag){case 0:case 11:case 15:break;case 1:if(null!==c){var d=c.memoizedProps,e=c.memoizedState,f=a.stateNode,g=f.getSnapshotBeforeUpdate(a.elementType===a.type?d:xf(a.type,d),e);f.__reactInternalSnapshotBeforeUpdate=g}break;case 3:Ta&&xb(a.stateNode.containerInfo);break;case 5:case 6:case 4:case 17:break;\ndefault:throw Error(n(163));}}catch(h){U(a,a.return,h)}b=a.sibling;if(null!==b){b.return=a.return;T=b;break}T=a.return}c=Kg;Kg=!1;return c}function Mg(a,b,c){var d=b.updateQueue;d=null!==d?d.lastEffect:null;if(null!==d){var e=d=d.next;do{if((e.tag&a)===a){var f=e.destroy;e.destroy=void 0;void 0!==f&&Jg(b,c,f)}e=e.next}while(e!==d)}}function Ng(a,b){b=b.updateQueue;b=null!==b?b.lastEffect:null;if(null!==b){var c=b=b.next;do{if((c.tag&a)===a){var d=c.create;c.destroy=d()}c=c.next}while(c!==b)}}\nfunction Og(a){var b=a.ref;if(null!==b){var c=a.stateNode;switch(a.tag){case 5:a=Ea(c);break;default:a=c}\"function\"===typeof b?b(a):b.current=a}}function Pg(a){var b=a.alternate;null!==b&&(a.alternate=null,Pg(b));a.child=null;a.deletions=null;a.sibling=null;5===a.tag&&(b=a.stateNode,null!==b&&Za(b));a.stateNode=null;a.return=null;a.dependencies=null;a.memoizedProps=null;a.memoizedState=null;a.pendingProps=null;a.stateNode=null;a.updateQueue=null}\nfunction Qg(a){return 5===a.tag||3===a.tag||4===a.tag}function Rg(a){a:for(;;){for(;null===a.sibling;){if(null===a.return||Qg(a.return))return null;a=a.return}a.sibling.return=a.return;for(a=a.sibling;5!==a.tag&&6!==a.tag&&18!==a.tag;){if(a.flags&2)continue a;if(null===a.child||4===a.tag)continue a;else a.child.return=a,a=a.child}if(!(a.flags&2))return a.stateNode}}\nfunction Sg(a,b,c){var d=a.tag;if(5===d||6===d)a=a.stateNode,b?pb(c,a,b):kb(c,a);else if(4!==d&&(a=a.child,null!==a))for(Sg(a,b,c),a=a.sibling;null!==a;)Sg(a,b,c),a=a.sibling}function Tg(a,b,c){var d=a.tag;if(5===d||6===d)a=a.stateNode,b?ob(c,a,b):jb(c,a);else if(4!==d&&(a=a.child,null!==a))for(Tg(a,b,c),a=a.sibling;null!==a;)Tg(a,b,c),a=a.sibling}var V=null,Ug=!1;function Vg(a,b,c){for(c=c.child;null!==c;)Wg(a,b,c),c=c.sibling}\nfunction Wg(a,b,c){if(Sc&&\"function\"===typeof Sc.onCommitFiberUnmount)try{Sc.onCommitFiberUnmount(Rc,c)}catch(h){}switch(c.tag){case 5:S||Ig(c,b);case 6:if(Ta){var d=V,e=Ug;V=null;Vg(a,b,c);V=d;Ug=e;null!==V&&(Ug?rb(V,c.stateNode):qb(V,c.stateNode))}else Vg(a,b,c);break;case 18:Ta&&null!==V&&(Ug?Yb(V,c.stateNode):Xb(V,c.stateNode));break;case 4:Ta?(d=V,e=Ug,V=c.stateNode.containerInfo,Ug=!0,Vg(a,b,c),V=d,Ug=e):(Ua&&(d=c.stateNode.containerInfo,e=zb(d),Cb(d,e)),Vg(a,b,c));break;case 0:case 11:case 14:case 15:if(!S&&\n(d=c.updateQueue,null!==d&&(d=d.lastEffect,null!==d))){e=d=d.next;do{var f=e,g=f.destroy;f=f.tag;void 0!==g&&(0!==(f&2)?Jg(c,b,g):0!==(f&4)&&Jg(c,b,g));e=e.next}while(e!==d)}Vg(a,b,c);break;case 1:if(!S&&(Ig(c,b),d=c.stateNode,\"function\"===typeof d.componentWillUnmount))try{d.props=c.memoizedProps,d.state=c.memoizedState,d.componentWillUnmount()}catch(h){U(c,b,h)}Vg(a,b,c);break;case 21:Vg(a,b,c);break;case 22:c.mode&1?(S=(d=S)||null!==c.memoizedState,Vg(a,b,c),S=d):Vg(a,b,c);break;default:Vg(a,b,\nc)}}function Xg(a){var b=a.updateQueue;if(null!==b){a.updateQueue=null;var c=a.stateNode;null===c&&(c=a.stateNode=new Hg);b.forEach(function(b){var d=Yg.bind(null,a,b);c.has(b)||(c.add(b),b.then(d,d))})}}\nfunction Zg(a,b){var c=b.deletions;if(null!==c)for(var d=0;d\";case ih:return\":has(\"+(ph(a)||\"\")+\")\";case jh:return'[role=\"'+a.value+'\"]';case lh:return'\"'+a.value+'\"';case kh:return'[data-testname=\"'+a.value+'\"]';default:throw Error(n(365));}}\nfunction qh(a,b){var c=[];a=[a,0];for(var d=0;de&&(e=g);d&=~f}d=e;d=D()-d;d=(120>d?120:480>d?480:1080>d?1080:1920>d?1920:3E3>d?3E3:4320>d?4320:1960*sh(d/1960))-d;if(10a?16:a;if(null===Dh)var d=!1;else{a=Dh;Dh=null;Eh=0;if(0!==(H&6))throw Error(n(331));var e=H;H|=4;for(T=a.current;null!==T;){var f=T,g=f.child;if(0!==(T.flags&16)){var h=f.deletions;if(null!==h){for(var k=0;kD()-bh?Rh(a,0):xh|=c);Kh(a,b)}function di(a,b){0===b&&(0===(a.mode&1)?b=1:(b=xc,xc<<=1,0===(xc&130023424)&&(xc=4194304)));var c=O();a=ce(a,b);null!==a&&(Fc(a,b,c),Kh(a,c))}function og(a){var b=a.memoizedState,c=0;null!==b&&(c=b.retryLane);di(a,c)}\nfunction Yg(a,b){var c=0;switch(a.tag){case 13:var d=a.stateNode;var e=a.memoizedState;null!==e&&(c=e.retryLane);break;case 19:d=a.stateNode;break;default:throw Error(n(314));}null!==d&&d.delete(b);di(a,c)}var ai;\nai=function(a,b,c){if(null!==a)if(a.memoizedProps!==b.pendingProps||z.current)G=!0;else{if(0===(a.lanes&c)&&0===(b.flags&128))return G=!1,sg(a,b,c);G=0!==(a.flags&131072)?!0:!1}else G=!1,F&&0!==(b.flags&1048576)&&ld(b,ed,b.index);b.lanes=0;switch(b.tag){case 2:var d=b.type;cg(a,b);a=b.pendingProps;var e=mc(b,x.current);Yd(b,c);e=He(null,b,d,a,e,c);var f=Me();b.flags|=1;\"object\"===typeof e&&null!==e&&\"function\"===typeof e.render&&void 0===e.$$typeof?(b.tag=1,b.memoizedState=null,b.updateQueue=null,\nA(d)?(f=!0,qc(b)):f=!1,b.memoizedState=null!==e.state&&void 0!==e.state?e.state:null,ee(b),e.updater=zf,b.stateNode=e,e._reactInternals=b,Df(b,d,a,c),b=dg(null,b,d,!0,f,c)):(b.tag=0,F&&f&&md(b),P(null,b,e,c),b=b.child);return b;case 16:d=b.elementType;a:{cg(a,b);a=b.pendingProps;e=d._init;d=e(d._payload);b.type=d;e=b.tag=ei(d);a=xf(d,a);switch(e){case 0:b=Xf(null,b,d,a,c);break a;case 1:b=bg(null,b,d,a,c);break a;case 11:b=Sf(null,b,d,a,c);break a;case 14:b=Uf(null,b,d,xf(d.type,a),c);break a}throw Error(n(306,\nd,\"\"));}return b;case 0:return d=b.type,e=b.pendingProps,e=b.elementType===d?e:xf(d,e),Xf(a,b,d,e,c);case 1:return d=b.type,e=b.pendingProps,e=b.elementType===d?e:xf(d,e),bg(a,b,d,e,c);case 3:a:{eg(b);if(null===a)throw Error(n(387));d=b.pendingProps;f=b.memoizedState;e=f.element;fe(a,b);ke(b,d,null,c);var g=b.memoizedState;d=g.element;if(Va&&f.isDehydrated)if(f={element:d,isDehydrated:!1,cache:g.cache,pendingSuspenseBoundaries:g.pendingSuspenseBoundaries,transitions:g.transitions},b.updateQueue.baseState=\nf,b.memoizedState=f,b.flags&256){e=Ef(Error(n(423)),b);b=fg(a,b,d,c,e);break a}else if(d!==e){e=Ef(Error(n(424)),b);b=fg(a,b,d,c,e);break a}else for(Va&&(pd=Pb(b.stateNode.containerInfo),od=b,F=!0,rd=null,qd=!1),c=Pd(b,null,d,c),b.child=c;c;)c.flags=c.flags&-3|4096,c=c.sibling;else{Ad();if(d===e){b=Tf(a,b,c);break a}P(a,b,d,c)}b=b.child}return b;case 5:return ue(b),null===a&&wd(b),d=b.type,e=b.pendingProps,f=null!==a?a.memoizedProps:null,g=e.children,Na(d,e)?g=null:null!==f&&Na(d,f)&&(b.flags|=32),\nag(a,b),P(a,b,g,c),b.child;case 6:return null===a&&wd(b),null;case 13:return ig(a,b,c);case 4:return se(b,b.stateNode.containerInfo),d=b.pendingProps,null===a?b.child=Od(b,null,d,c):P(a,b,d,c),b.child;case 11:return d=b.type,e=b.pendingProps,e=b.elementType===d?e:xf(d,e),Sf(a,b,d,e,c);case 7:return P(a,b,b.pendingProps,c),b.child;case 8:return P(a,b,b.pendingProps.children,c),b.child;case 12:return P(a,b,b.pendingProps.children,c),b.child;case 10:a:{d=b.type._context;e=b.pendingProps;f=b.memoizedProps;\ng=e.value;Vd(b,d,g);if(null!==f)if(Vc(f.value,g)){if(f.children===e.children&&!z.current){b=Tf(a,b,c);break a}}else for(f=b.child,null!==f&&(f.return=b);null!==f;){var h=f.dependencies;if(null!==h){g=f.child;for(var k=h.firstContext;null!==k;){if(k.context===d){if(1===f.tag){k=ge(-1,c&-c);k.tag=2;var l=f.updateQueue;if(null!==l){l=l.shared;var m=l.pending;null===m?k.next=k:(k.next=m.next,m.next=k);l.pending=k}}f.lanes|=c;k=f.alternate;null!==k&&(k.lanes|=c);Xd(f.return,c,b);h.lanes|=c;break}k=k.next}}else if(10===\nf.tag)g=f.type===b.type?null:f.child;else if(18===f.tag){g=f.return;if(null===g)throw Error(n(341));g.lanes|=c;h=g.alternate;null!==h&&(h.lanes|=c);Xd(g,c,b);g=f.sibling}else g=f.child;if(null!==g)g.return=f;else for(g=f;null!==g;){if(g===b){g=null;break}f=g.sibling;if(null!==f){f.return=g.return;g=f;break}g=g.return}f=g}P(a,b,e.children,c);b=b.child}return b;case 9:return e=b.type,d=b.pendingProps.children,Yd(b,c),e=Zd(e),d=d(e),b.flags|=1,P(a,b,d,c),b.child;case 14:return d=b.type,e=xf(d,b.pendingProps),\ne=xf(d.type,e),Uf(a,b,d,e,c);case 15:return Wf(a,b,b.type,b.pendingProps,c);case 17:return d=b.type,e=b.pendingProps,e=b.elementType===d?e:xf(d,e),cg(a,b),b.tag=1,A(d)?(a=!0,qc(b)):a=!1,Yd(b,c),Bf(b,d,e),Df(b,d,e,c),dg(null,b,d,!0,a,c);case 19:return rg(a,b,c);case 22:return Yf(a,b,c)}throw Error(n(156,b.tag));};function Mh(a,b){return Jc(a,b)}\nfunction fi(a,b,c,d){this.tag=a;this.key=c;this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null;this.index=0;this.ref=null;this.pendingProps=b;this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null;this.mode=d;this.subtreeFlags=this.flags=0;this.deletions=null;this.childLanes=this.lanes=0;this.alternate=null}function td(a,b,c,d){return new fi(a,b,c,d)}function Vf(a){a=a.prototype;return!(!a||!a.isReactComponent)}\nfunction ei(a){if(\"function\"===typeof a)return Vf(a)?1:0;if(void 0!==a&&null!==a){a=a.$$typeof;if(a===ma)return 11;if(a===pa)return 14}return 2}\nfunction Jd(a,b){var c=a.alternate;null===c?(c=td(a.tag,b,a.key,a.mode),c.elementType=a.elementType,c.type=a.type,c.stateNode=a.stateNode,c.alternate=a,a.alternate=c):(c.pendingProps=b,c.type=a.type,c.flags=0,c.subtreeFlags=0,c.deletions=null);c.flags=a.flags&14680064;c.childLanes=a.childLanes;c.lanes=a.lanes;c.child=a.child;c.memoizedProps=a.memoizedProps;c.memoizedState=a.memoizedState;c.updateQueue=a.updateQueue;b=a.dependencies;c.dependencies=null===b?null:{lanes:b.lanes,firstContext:b.firstContext};\nc.sibling=a.sibling;c.index=a.index;c.ref=a.ref;return c}\nfunction Ld(a,b,c,d,e,f){var g=2;d=a;if(\"function\"===typeof a)Vf(a)&&(g=1);else if(\"string\"===typeof a)g=5;else a:switch(a){case ha:return Nd(c.children,e,f,b);case ia:g=8;e|=8;break;case ja:return a=td(12,c,b,e|2),a.elementType=ja,a.lanes=f,a;case na:return a=td(13,c,b,e),a.elementType=na,a.lanes=f,a;case oa:return a=td(19,c,b,e),a.elementType=oa,a.lanes=f,a;case ra:return jg(c,e,f,b);default:if(\"object\"===typeof a&&null!==a)switch(a.$$typeof){case ka:g=10;break a;case la:g=9;break a;case ma:g=11;\nbreak a;case pa:g=14;break a;case qa:g=16;d=null;break a}throw Error(n(130,null==a?a:typeof a,\"\"));}b=td(g,c,b,e);b.elementType=a;b.type=d;b.lanes=f;return b}function Nd(a,b,c,d){a=td(7,a,d,b);a.lanes=c;return a}function jg(a,b,c,d){a=td(22,a,d,b);a.elementType=ra;a.lanes=c;a.stateNode={isHidden:!1};return a}function Kd(a,b,c){a=td(6,a,null,b);a.lanes=c;return a}\nfunction Md(a,b,c){b=td(4,null!==a.children?a.children:[],a.key,b);b.lanes=c;b.stateNode={containerInfo:a.containerInfo,pendingChildren:null,implementation:a.implementation};return b}\nfunction gi(a,b,c,d,e){this.tag=b;this.containerInfo=a;this.finishedWork=this.pingCache=this.current=this.pendingChildren=null;this.timeoutHandle=Ra;this.callbackNode=this.pendingContext=this.context=null;this.callbackPriority=0;this.eventTimes=Ec(0);this.expirationTimes=Ec(-1);this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0;this.entanglements=Ec(0);this.identifierPrefix=d;this.onRecoverableError=e;Va&&(this.mutableSourceEagerHydrationData=\nnull)}function hi(a,b,c,d,e,f,g,h,k){a=new gi(a,b,c,h,k);1===b?(b=1,!0===f&&(b|=8)):b=0;f=td(3,null,null,b);a.current=f;f.stateNode=a;f.memoizedState={element:d,isDehydrated:c,cache:null,transitions:null,pendingSuspenseBoundaries:null};ee(f);return a}\nfunction ii(a){if(!a)return jc;a=a._reactInternals;a:{if(wa(a)!==a||1!==a.tag)throw Error(n(170));var b=a;do{switch(b.tag){case 3:b=b.stateNode.context;break a;case 1:if(A(b.type)){b=b.stateNode.__reactInternalMemoizedMergedChildContext;break a}}b=b.return}while(null!==b);throw Error(n(171));}if(1===a.tag){var c=a.type;if(A(c))return pc(a,c,b)}return b}\nfunction ji(a){var b=a._reactInternals;if(void 0===b){if(\"function\"===typeof a.render)throw Error(n(188));a=Object.keys(a).join(\",\");throw Error(n(268,a));}a=Aa(b);return null===a?null:a.stateNode}function ki(a,b){a=a.memoizedState;if(null!==a&&null!==a.dehydrated){var c=a.retryLane;a.retryLane=0!==c&&c=l&&f>=r&&e<=m&&g<=p){a.splice(b,1);break}else if(!(d!==l||c.width!==k.width||pg)){r>f&&(k.height+=r-f,k.y=f);pe)){l>d&&(k.width+=\nl-d,k.x=d);mc&&(c=g)),g \")+\"\\n\\nNo matching component was found for:\\n \")+a.join(\" > \")}return null};\nexports.getPublicRootInstance=function(a){a=a.current;if(!a.child)return null;switch(a.child.tag){case 5:return Ea(a.child.stateNode);default:return a.child.stateNode}};\nexports.injectIntoDevTools=function(a){a={bundleType:a.bundleType,version:a.version,rendererPackageName:a.rendererPackageName,rendererConfig:a.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:da.ReactCurrentDispatcher,findHostInstanceByFiber:mi,findFiberByHostInstance:a.findFiberByHostInstance||\nni,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:\"18.3.1\"};if(\"undefined\"===typeof __REACT_DEVTOOLS_GLOBAL_HOOK__)a=!1;else{var b=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(b.isDisabled||!b.supportsFiber)a=!0;else{try{Rc=b.inject(a),Sc=b}catch(c){}a=b.checkDCE?!0:!1}}return a};exports.isAlreadyRendering=function(){return!1};\nexports.observeVisibleRects=function(a,b,c,d){if(!bb)throw Error(n(363));a=rh(a,b);var e=ib(a,c,d).disconnect;return{disconnect:function(){e()}}};exports.registerMutableSourceForHydration=function(a,b){var c=b._getVersion;c=c(b._source);null==a.mutableSourceEagerHydrationData?a.mutableSourceEagerHydrationData=[b,c]:a.mutableSourceEagerHydrationData.push(b,c)};exports.runWithPriority=function(a,b){var c=C;try{return C=a,b()}finally{C=c}};exports.shouldError=function(){return null};\nexports.shouldSuspend=function(){return!1};exports.updateContainer=function(a,b,c,d){var e=b.current,f=O(),g=tf(e);c=ii(c);null===b.context?b.context=c:b.pendingContext=c;b=ge(f,g);b.payload={element:a};d=void 0===d?null:d;null!==d&&(b.callback=d);a=he(e,b,g);null!==a&&(af(a,e,g,f),ie(a,e,g));return g};\n\n return exports;\n};\n","'use strict';\n\nif (process.env.NODE_ENV === 'production') {\n module.exports = require('./cjs/react-reconciler.production.min.js');\n} else {\n module.exports = require('./cjs/react-reconciler.development.js');\n}\n","/**\n * @license React\n * react-reconciler-constants.production.min.js\n *\n * Copyright (c) Facebook, Inc. and its affiliates.\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'use strict';exports.ConcurrentRoot=1;exports.ContinuousEventPriority=4;exports.DefaultEventPriority=16;exports.DiscreteEventPriority=1;exports.IdleEventPriority=536870912;exports.LegacyRoot=0;\n","'use strict';\n\nif (process.env.NODE_ENV === 'production') {\n module.exports = require('./cjs/react-reconciler-constants.production.min.js');\n} else {\n module.exports = require('./cjs/react-reconciler-constants.development.js');\n}\n","import { Konva } from 'konva/lib/Global.js';\nconst propsToSkip = {\n children: true,\n ref: true,\n key: true,\n style: true,\n forwardedRef: true,\n unstable_applyCache: true,\n unstable_applyDrawHitFromCache: true,\n};\nlet zIndexWarningShowed = false;\nlet dragWarningShowed = false;\nexport const EVENTS_NAMESPACE = '.react-konva-event';\nlet useStrictMode = false;\nexport function toggleStrictMode(value) {\n useStrictMode = value;\n}\nconst DRAGGABLE_WARNING = `ReactKonva: You have a Konva node with draggable = true and position defined but no onDragMove or onDragEnd events are handled.\nPosition of a node will be changed during drag&drop, so you should update state of the react app as well.\nConsider to add onDragMove or onDragEnd events.\nFor more info see: https://github.com/konvajs/react-konva/issues/256\n`;\nconst Z_INDEX_WARNING = `ReactKonva: You are using \"zIndex\" attribute for a Konva node.\nreact-konva may get confused with ordering. Just define correct order of elements in your render function of a component.\nFor more info see: https://github.com/konvajs/react-konva/issues/194\n`;\nconst EMPTY_PROPS = {};\nexport function applyNodeProps(instance, props, oldProps = EMPTY_PROPS) {\n // don't use zIndex in react-konva\n if (!zIndexWarningShowed && 'zIndex' in props) {\n console.warn(Z_INDEX_WARNING);\n zIndexWarningShowed = true;\n }\n // check correct draggable usage\n if (!dragWarningShowed && props.draggable) {\n var hasPosition = props.x !== undefined || props.y !== undefined;\n var hasEvents = props.onDragEnd || props.onDragMove;\n if (hasPosition && !hasEvents) {\n console.warn(DRAGGABLE_WARNING);\n dragWarningShowed = true;\n }\n }\n // check old props\n // we need to unset properties that are not in new props\n // and remove all events\n for (var key in oldProps) {\n if (propsToSkip[key]) {\n continue;\n }\n var isEvent = key.slice(0, 2) === 'on';\n var propChanged = oldProps[key] !== props[key];\n // if that is a changed event, we need to remove it\n if (isEvent && propChanged) {\n var eventName = key.substr(2).toLowerCase();\n if (eventName.substr(0, 7) === 'content') {\n eventName =\n 'content' +\n eventName.substr(7, 1).toUpperCase() +\n eventName.substr(8);\n }\n instance.off(eventName, oldProps[key]);\n }\n var toRemove = !props.hasOwnProperty(key);\n if (toRemove) {\n instance.setAttr(key, undefined);\n }\n }\n var strictUpdate = useStrictMode || props._useStrictMode;\n var updatedProps = {};\n var hasUpdates = false;\n const newEvents = {};\n for (var key in props) {\n if (propsToSkip[key]) {\n continue;\n }\n var isEvent = key.slice(0, 2) === 'on';\n var toAdd = oldProps[key] !== props[key];\n if (isEvent && toAdd) {\n var eventName = key.substr(2).toLowerCase();\n if (eventName.substr(0, 7) === 'content') {\n eventName =\n 'content' +\n eventName.substr(7, 1).toUpperCase() +\n eventName.substr(8);\n }\n // check that event is not undefined\n if (props[key]) {\n newEvents[eventName] = props[key];\n }\n }\n if (!isEvent &&\n (props[key] !== oldProps[key] ||\n (strictUpdate && props[key] !== instance.getAttr(key)))) {\n hasUpdates = true;\n updatedProps[key] = props[key];\n }\n }\n if (hasUpdates) {\n instance.setAttrs(updatedProps);\n updatePicture(instance);\n }\n // subscribe to events AFTER we set attrs\n // we need it to fix https://github.com/konvajs/react-konva/issues/471\n // settings attrs may add events. Like \"draggable: true\" will add \"mousedown\" listener\n for (var eventName in newEvents) {\n instance.on(eventName + EVENTS_NAMESPACE, newEvents[eventName]);\n }\n}\nexport function updatePicture(node) {\n if (!Konva.autoDrawEnabled) {\n var drawingNode = node.getLayer() || node.getStage();\n drawingNode && drawingNode.batchDraw();\n }\n}\n","import Konva from 'konva/lib/Core.js';\nimport { applyNodeProps, updatePicture, EVENTS_NAMESPACE } from './makeUpdates.js';\nexport { unstable_now as now, unstable_IdlePriority as idlePriority, unstable_runWithPriority as run, } from 'scheduler';\nimport { DefaultEventPriority } from 'react-reconciler/constants.js';\nconst NO_CONTEXT = {};\nconst UPDATE_SIGNAL = {};\n// for react-spring capability\nKonva.Node.prototype._applyProps = applyNodeProps;\nexport function appendInitialChild(parentInstance, child) {\n if (typeof child === 'string') {\n // Noop for string children of Text (eg foo)\n console.error(`Do not use plain text as child of Konva.Node. You are using text: ${child}`);\n return;\n }\n parentInstance.add(child);\n updatePicture(parentInstance);\n}\nexport function createInstance(type, props, internalInstanceHandle) {\n let NodeClass = Konva[type];\n if (!NodeClass) {\n console.error(`Konva has no node with the type ${type}. Group will be used instead. If you use minimal version of react-konva, just import required nodes into Konva: \"import \"konva/lib/shapes/${type}\" If you want to render DOM elements as part of canvas tree take a look into this demo: https://konvajs.github.io/docs/react/DOM_Portal.html`);\n NodeClass = Konva.Group;\n }\n // we need to split props into events and non events\n // we we can pass non events into constructor directly\n // that way the performance should be better\n // we we apply change \"applyNodeProps\"\n // then it will trigger change events on first run\n // but we don't need them!\n const propsWithoutEvents = {};\n const propsWithOnlyEvents = {};\n for (var key in props) {\n var isEvent = key.slice(0, 2) === 'on';\n if (isEvent) {\n propsWithOnlyEvents[key] = props[key];\n }\n else {\n propsWithoutEvents[key] = props[key];\n }\n }\n const instance = new NodeClass(propsWithoutEvents);\n applyNodeProps(instance, propsWithOnlyEvents);\n return instance;\n}\nexport function createTextInstance(text, rootContainerInstance, internalInstanceHandle) {\n console.error(`Text components are not supported for now in ReactKonva. Your text is: \"${text}\"`);\n}\nexport function finalizeInitialChildren(domElement, type, props) {\n return false;\n}\nexport function getPublicInstance(instance) {\n return instance;\n}\nexport function prepareForCommit() {\n return null;\n}\nexport function preparePortalMount() {\n return null;\n}\nexport function prepareUpdate(domElement, type, oldProps, newProps) {\n return UPDATE_SIGNAL;\n}\nexport function resetAfterCommit() {\n // Noop\n}\nexport function resetTextContent(domElement) {\n // Noop\n}\nexport function shouldDeprioritizeSubtree(type, props) {\n return false;\n}\nexport function getRootHostContext() {\n return NO_CONTEXT;\n}\nexport function getChildHostContext() {\n return NO_CONTEXT;\n}\nexport const scheduleTimeout = setTimeout;\nexport const cancelTimeout = clearTimeout;\nexport const noTimeout = -1;\n// export const schedulePassiveEffects = scheduleDeferredCallback;\n// export const cancelPassiveEffects = cancelDeferredCallback;\nexport function shouldSetTextContent(type, props) {\n return false;\n}\n// The Konva renderer is secondary to the React DOM renderer.\nexport const isPrimaryRenderer = false;\nexport const warnsIfNotActing = true;\nexport const supportsMutation = true;\nexport function appendChild(parentInstance, child) {\n if (child.parent === parentInstance) {\n child.moveToTop();\n }\n else {\n parentInstance.add(child);\n }\n updatePicture(parentInstance);\n}\nexport function appendChildToContainer(parentInstance, child) {\n if (child.parent === parentInstance) {\n child.moveToTop();\n }\n else {\n parentInstance.add(child);\n }\n updatePicture(parentInstance);\n}\nexport function insertBefore(parentInstance, child, beforeChild) {\n // child._remove() will not stop dragging\n // but child.remove() will stop it, but we don't need it\n // removing will reset zIndexes\n child._remove();\n parentInstance.add(child);\n child.setZIndex(beforeChild.getZIndex());\n updatePicture(parentInstance);\n}\nexport function insertInContainerBefore(parentInstance, child, beforeChild) {\n insertBefore(parentInstance, child, beforeChild);\n}\nexport function removeChild(parentInstance, child) {\n child.destroy();\n child.off(EVENTS_NAMESPACE);\n updatePicture(parentInstance);\n}\nexport function removeChildFromContainer(parentInstance, child) {\n child.destroy();\n child.off(EVENTS_NAMESPACE);\n updatePicture(parentInstance);\n}\nexport function commitTextUpdate(textInstance, oldText, newText) {\n console.error(`Text components are not yet supported in ReactKonva. You text is: \"${newText}\"`);\n}\nexport function commitMount(instance, type, newProps) {\n // Noop\n}\nexport function commitUpdate(instance, updatePayload, type, oldProps, newProps) {\n applyNodeProps(instance, newProps, oldProps);\n}\nexport function hideInstance(instance) {\n instance.hide();\n updatePicture(instance);\n}\nexport function hideTextInstance(textInstance) {\n // Noop\n}\nexport function unhideInstance(instance, props) {\n if (props.visible == null || props.visible) {\n instance.show();\n }\n}\nexport function unhideTextInstance(textInstance, text) {\n // Noop\n}\nexport function clearContainer(container) {\n // Noop\n}\nexport function detachDeletedInstance() { }\nexport const getCurrentEventPriority = () => DefaultEventPriority;\n","import * as React from \"react\";\nvar __defProp = Object.defineProperty;\nvar __defProps = Object.defineProperties;\nvar __getOwnPropDescs = Object.getOwnPropertyDescriptors;\nvar __getOwnPropSymbols = Object.getOwnPropertySymbols;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __propIsEnum = Object.prototype.propertyIsEnumerable;\nvar __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;\nvar __spreadValues = (a, b) => {\n for (var prop in b || (b = {}))\n if (__hasOwnProp.call(b, prop))\n __defNormalProp(a, prop, b[prop]);\n if (__getOwnPropSymbols)\n for (var prop of __getOwnPropSymbols(b)) {\n if (__propIsEnum.call(b, prop))\n __defNormalProp(a, prop, b[prop]);\n }\n return a;\n};\nvar __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));\nvar _a, _b;\nconst useIsomorphicLayoutEffect = typeof window !== \"undefined\" && (((_a = window.document) == null ? void 0 : _a.createElement) || ((_b = window.navigator) == null ? void 0 : _b.product) === \"ReactNative\") ? React.useLayoutEffect : React.useEffect;\nfunction traverseFiber(fiber, ascending, selector) {\n if (!fiber)\n return;\n if (selector(fiber) === true)\n return fiber;\n let child = ascending ? fiber.return : fiber.child;\n while (child) {\n const match = traverseFiber(child, ascending, selector);\n if (match)\n return match;\n child = ascending ? null : child.sibling;\n }\n}\nfunction wrapContext(context) {\n try {\n return Object.defineProperties(context, {\n _currentRenderer: {\n get() {\n return null;\n },\n set() {\n }\n },\n _currentRenderer2: {\n get() {\n return null;\n },\n set() {\n }\n }\n });\n } catch (_) {\n return context;\n }\n}\nconst error = console.error;\nconsole.error = function() {\n const message = [...arguments].join(\"\");\n if ((message == null ? void 0 : message.startsWith(\"Warning:\")) && message.includes(\"useContext\")) {\n console.error = error;\n return;\n }\n return error.apply(this, arguments);\n};\nconst FiberContext = wrapContext(React.createContext(null));\nclass FiberProvider extends React.Component {\n render() {\n return /* @__PURE__ */ React.createElement(FiberContext.Provider, {\n value: this._reactInternals\n }, this.props.children);\n }\n}\nfunction useFiber() {\n const root = React.useContext(FiberContext);\n if (root === null)\n throw new Error(\"its-fine: useFiber must be called within a !\");\n const id = React.useId();\n const fiber = React.useMemo(() => {\n for (const maybeFiber of [root, root == null ? void 0 : root.alternate]) {\n if (!maybeFiber)\n continue;\n const fiber2 = traverseFiber(maybeFiber, false, (node) => {\n let state = node.memoizedState;\n while (state) {\n if (state.memoizedState === id)\n return true;\n state = state.next;\n }\n });\n if (fiber2)\n return fiber2;\n }\n }, [root, id]);\n return fiber;\n}\nfunction useContainer() {\n const fiber = useFiber();\n const root = React.useMemo(\n () => traverseFiber(fiber, true, (node) => {\n var _a2;\n return ((_a2 = node.stateNode) == null ? void 0 : _a2.containerInfo) != null;\n }),\n [fiber]\n );\n return root == null ? void 0 : root.stateNode.containerInfo;\n}\nfunction useNearestChild(type) {\n const fiber = useFiber();\n const childRef = React.useRef();\n useIsomorphicLayoutEffect(() => {\n var _a2;\n childRef.current = (_a2 = traverseFiber(\n fiber,\n false,\n (node) => typeof node.type === \"string\" && (type === void 0 || node.type === type)\n )) == null ? void 0 : _a2.stateNode;\n }, [fiber]);\n return childRef;\n}\nfunction useNearestParent(type) {\n const fiber = useFiber();\n const parentRef = React.useRef();\n useIsomorphicLayoutEffect(() => {\n var _a2;\n parentRef.current = (_a2 = traverseFiber(\n fiber,\n true,\n (node) => typeof node.type === \"string\" && (type === void 0 || node.type === type)\n )) == null ? void 0 : _a2.stateNode;\n }, [fiber]);\n return parentRef;\n}\nfunction useContextMap() {\n const fiber = useFiber();\n const [contextMap] = React.useState(() => /* @__PURE__ */ new Map());\n contextMap.clear();\n let node = fiber;\n while (node) {\n if (node.type && typeof node.type === \"object\") {\n const enableRenderableContext = node.type._context === void 0 && node.type.Provider === node.type;\n const context = enableRenderableContext ? node.type : node.type._context;\n if (context && context !== FiberContext && !contextMap.has(context)) {\n contextMap.set(context, React.useContext(wrapContext(context)));\n }\n }\n node = node.return;\n }\n return contextMap;\n}\nfunction useContextBridge() {\n const contextMap = useContextMap();\n return React.useMemo(\n () => Array.from(contextMap.keys()).reduce(\n (Prev, context) => (props) => /* @__PURE__ */ React.createElement(Prev, null, /* @__PURE__ */ React.createElement(context.Provider, __spreadProps(__spreadValues({}, props), {\n value: contextMap.get(context)\n }))),\n (props) => /* @__PURE__ */ React.createElement(FiberProvider, __spreadValues({}, props))\n ),\n [contextMap]\n );\n}\nexport {\n FiberProvider,\n traverseFiber,\n useContainer,\n useContextBridge,\n useContextMap,\n useFiber,\n useNearestChild,\n useNearestParent\n};\n//# sourceMappingURL=index.js.map\n","/**\n * Based on ReactArt.js\n * Copyright (c) 2017-present Lavrenov Anton.\n * All rights reserved.\n *\n * MIT\n */\n'use strict';\nimport React from 'react';\nimport Konva from 'konva/lib/Core.js';\nimport ReactFiberReconciler from 'react-reconciler';\nimport { LegacyRoot } from 'react-reconciler/constants.js';\nimport * as HostConfig from './ReactKonvaHostConfig.js';\nimport { applyNodeProps, toggleStrictMode } from './makeUpdates.js';\nimport { useContextBridge, FiberProvider } from 'its-fine';\nfunction usePrevious(value) {\n const ref = React.useRef({});\n React.useLayoutEffect(() => {\n ref.current = value;\n });\n React.useLayoutEffect(() => {\n return () => {\n // when using suspense it is possible that stage is unmounted\n // but React still keep component ref\n // in that case we need to manually flush props\n // we have a special test for that\n ref.current = {};\n };\n }, []);\n return ref.current;\n}\nconst StageWrap = (props) => {\n const container = React.useRef();\n const stage = React.useRef();\n const fiberRef = React.useRef();\n const oldProps = usePrevious(props);\n const Bridge = useContextBridge();\n const _setRef = (stage) => {\n const { forwardedRef } = props;\n if (!forwardedRef) {\n return;\n }\n if (typeof forwardedRef === 'function') {\n forwardedRef(stage);\n }\n else {\n forwardedRef.current = stage;\n }\n };\n React.useLayoutEffect(() => {\n stage.current = new Konva.Stage({\n width: props.width,\n height: props.height,\n container: container.current,\n });\n _setRef(stage.current);\n // @ts-ignore\n fiberRef.current = KonvaRenderer.createContainer(stage.current, LegacyRoot, false, null);\n KonvaRenderer.updateContainer(React.createElement(Bridge, {}, props.children), fiberRef.current);\n return () => {\n if (!Konva.isBrowser) {\n return;\n }\n _setRef(null);\n KonvaRenderer.updateContainer(null, fiberRef.current, null);\n stage.current.destroy();\n };\n }, []);\n React.useLayoutEffect(() => {\n _setRef(stage.current);\n applyNodeProps(stage.current, props, oldProps);\n KonvaRenderer.updateContainer(React.createElement(Bridge, {}, props.children), fiberRef.current, null);\n });\n return React.createElement('div', {\n ref: container,\n id: props.id,\n accessKey: props.accessKey,\n className: props.className,\n role: props.role,\n style: props.style,\n tabIndex: props.tabIndex,\n title: props.title,\n });\n};\nexport const Layer = 'Layer';\nexport const FastLayer = 'FastLayer';\nexport const Group = 'Group';\nexport const Label = 'Label';\nexport const Rect = 'Rect';\nexport const Circle = 'Circle';\nexport const Ellipse = 'Ellipse';\nexport const Wedge = 'Wedge';\nexport const Line = 'Line';\nexport const Sprite = 'Sprite';\nexport const Image = 'Image';\nexport const Text = 'Text';\nexport const TextPath = 'TextPath';\nexport const Star = 'Star';\nexport const Ring = 'Ring';\nexport const Arc = 'Arc';\nexport const Tag = 'Tag';\nexport const Path = 'Path';\nexport const RegularPolygon = 'RegularPolygon';\nexport const Arrow = 'Arrow';\nexport const Shape = 'Shape';\nexport const Transformer = 'Transformer';\n// @ts-ignore\nexport const KonvaRenderer = ReactFiberReconciler(HostConfig);\nKonvaRenderer.injectIntoDevTools({\n // @ts-ignore\n findHostInstanceByFiber: () => null,\n bundleType: process.env.NODE_ENV !== 'production' ? 1 : 0,\n version: React.version,\n rendererPackageName: 'react-konva',\n});\nexport const Stage = React.forwardRef((props, ref) => {\n return React.createElement(FiberProvider, {}, React.createElement(StageWrap, { ...props, forwardedRef: ref }));\n});\nexport const useStrictMode = toggleStrictMode;\n","var getDimensionsMinimalRatio=function(a,b,c,d){return Math.min(a/c,b/d)||1};export default getDimensionsMinimalRatio;","export var ROOT_CONTAINER_CLASS_NAME=\"FIE_root\";export var DESIGN_LAYER_ID=\"FIE_design-layer\";export var TRANSFORMERS_LAYER_ID=\"FIE_transformers-layer\";export var IMAGE_NODE_ID=\"FIE_original-image\";export var NODES_TRANSFORMER_ID=\"FIE_nodes-transformer\";export var WATERMARK_ANNOTATION_ID=\"watermark\";export var TRANSLATIONS_GRID_UUID=\"353297d2-40b4-4684-a875-45a2178a8157\";export var DEFAULT_SAVE_QUALITY=.92;export var TABS_IDS={FINETUNE:\"Finetune\",FILTERS:\"Filters\",ADJUST:\"Adjust\",WATERMARK:\"Watermark\",ANNOTATE:\"Annotate\",RESIZE:\"Resize\"};export var TOOLS_IDS={CROP:\"Crop\",ROTATE:\"Rotate\",FLIP_X:\"Flip_X\",FLIP_Y:\"Flip_Y\",BRIGHTNESS:\"Brightness\",CONTRAST:\"Contrast\",HSV:\"HueSaturationValue\",WARMTH:\"Warmth\",BLUR:\"Blur\",THRESHOLD:\"Threshold\",POSTERIZE:\"Posterize\",PIXELATE:\"Pixelate\",NOISE:\"Noise\",FILTERS:\"Filters\",RECT:\"Rect\",ELLIPSE:\"Ellipse\",POLYGON:\"Polygon\",TEXT:\"Text\",LINE:\"Line\",IMAGE:\"Image\",ARROW:\"Arrow\",WATERMARK:\"Watermark\",PEN:\"Pen\",RESIZE:\"Resize\"};export var FLIP_DIRECTIONS={X:\"X\",Y:\"Y\"};export var DEFAULT_ZOOM_FACTOR=1;export var SUPPORTED_IMAGE_TYPES=[\"png\",\"jpeg\",\"jpg\",\"webp\"];export var POSSIBLE_IMAGE_TYPES=[].concat(SUPPORTED_IMAGE_TYPES,[\"svg\",\"gif\",\"avif\",\"apng\"]);export var DEFAULT_IMAGE_TYPE=SUPPORTED_IMAGE_TYPES[0];export var POINTER_ICONS={DEFAULT:\"default\",DRAW:\"crosshair\",SELECT:\"pointer\",MOVE:\"move\",DRAG:\"GRAB\"};export var DEFAULT_ENABLED_ANCHORS=[\"top-left\",\"top-center\",\"top-right\",\"middle-right\",\"middle-left\",\"bottom-left\",\"bottom-center\",\"bottom-right\"];export var ORIGINAL_CROP=\"Crop\";export var CUSTOM_CROP=\"custom\";export var ELLIPSE_CROP=\"ellipse\";export var POSITIONS={TOP_LEFT:\"top-left\",TOP_CENTER:\"top-center\",TOP_RIGHT:\"top-right\",MIDDLE_LEFT:\"middle-left\",MIDDLE_CENTER:\"middle-center\",MIDDLE_RIGHT:\"middle-right\",BOTTOM_LEFT:\"bottom-left\",BOTTOM_CENTER:\"bottom-center\",BOTTOM_RIGHT:\"bottom-right\"};export var MIN_CROP={WIDTH:14,HEIGHT:14};export var CLOSING_REASONS={AFTER_SAVE:\"after-saving\",CLOSE_BUTTON:\"close-button-clicked\",BACK_BUTTON:\"back-button-clicked\"};export var FEEDBACK_STATUSES={WARNING:\"warning\",ERROR:\"error\"};export var EDITOR_TO_CLOUDIMG_POSITIONS={top:\"north\",bottom:\"south\",left:\"west\",center:\"center\",right:\"east\"};export var CLOUDIMG_TO_EDITOR_POSITIONS={northwest:\"top-left\",northcenter:\"top-center\",northeast:\"top-right\",centerwest:\"center-left\",centercenter:\"center-center\",centereast:\"center-right\",southwest:\"bottom-left\",southcenter:\"bottom-center\",southeast:\"bottom-right\"};","import{ELLIPSE_CROP}from\"./constants\";var cropImage=function(a,b){var c=!!(2 {\n exports.Konva[NodeClass.prototype.getClassName()] = NodeClass;\n};\nexports._registerNode = _registerNode;\nexports.Konva._injectGlobal(exports.Konva);\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Util = exports.Transform = void 0;\nconst Global_1 = require(\"./Global\");\nclass Transform {\n constructor(m = [1, 0, 0, 1, 0, 0]) {\n this.dirty = false;\n this.m = (m && m.slice()) || [1, 0, 0, 1, 0, 0];\n }\n reset() {\n this.m[0] = 1;\n this.m[1] = 0;\n this.m[2] = 0;\n this.m[3] = 1;\n this.m[4] = 0;\n this.m[5] = 0;\n }\n copy() {\n return new Transform(this.m);\n }\n copyInto(tr) {\n tr.m[0] = this.m[0];\n tr.m[1] = this.m[1];\n tr.m[2] = this.m[2];\n tr.m[3] = this.m[3];\n tr.m[4] = this.m[4];\n tr.m[5] = this.m[5];\n }\n point(point) {\n var m = this.m;\n return {\n x: m[0] * point.x + m[2] * point.y + m[4],\n y: m[1] * point.x + m[3] * point.y + m[5],\n };\n }\n translate(x, y) {\n this.m[4] += this.m[0] * x + this.m[2] * y;\n this.m[5] += this.m[1] * x + this.m[3] * y;\n return this;\n }\n scale(sx, sy) {\n this.m[0] *= sx;\n this.m[1] *= sx;\n this.m[2] *= sy;\n this.m[3] *= sy;\n return this;\n }\n rotate(rad) {\n var c = Math.cos(rad);\n var s = Math.sin(rad);\n var m11 = this.m[0] * c + this.m[2] * s;\n var m12 = this.m[1] * c + this.m[3] * s;\n var m21 = this.m[0] * -s + this.m[2] * c;\n var m22 = this.m[1] * -s + this.m[3] * c;\n this.m[0] = m11;\n this.m[1] = m12;\n this.m[2] = m21;\n this.m[3] = m22;\n return this;\n }\n getTranslation() {\n return {\n x: this.m[4],\n y: this.m[5],\n };\n }\n skew(sx, sy) {\n var m11 = this.m[0] + this.m[2] * sy;\n var m12 = this.m[1] + this.m[3] * sy;\n var m21 = this.m[2] + this.m[0] * sx;\n var m22 = this.m[3] + this.m[1] * sx;\n this.m[0] = m11;\n this.m[1] = m12;\n this.m[2] = m21;\n this.m[3] = m22;\n return this;\n }\n multiply(matrix) {\n var m11 = this.m[0] * matrix.m[0] + this.m[2] * matrix.m[1];\n var m12 = this.m[1] * matrix.m[0] + this.m[3] * matrix.m[1];\n var m21 = this.m[0] * matrix.m[2] + this.m[2] * matrix.m[3];\n var m22 = this.m[1] * matrix.m[2] + this.m[3] * matrix.m[3];\n var dx = this.m[0] * matrix.m[4] + this.m[2] * matrix.m[5] + this.m[4];\n var dy = this.m[1] * matrix.m[4] + this.m[3] * matrix.m[5] + this.m[5];\n this.m[0] = m11;\n this.m[1] = m12;\n this.m[2] = m21;\n this.m[3] = m22;\n this.m[4] = dx;\n this.m[5] = dy;\n return this;\n }\n invert() {\n var d = 1 / (this.m[0] * this.m[3] - this.m[1] * this.m[2]);\n var m0 = this.m[3] * d;\n var m1 = -this.m[1] * d;\n var m2 = -this.m[2] * d;\n var m3 = this.m[0] * d;\n var m4 = d * (this.m[2] * this.m[5] - this.m[3] * this.m[4]);\n var m5 = d * (this.m[1] * this.m[4] - this.m[0] * this.m[5]);\n this.m[0] = m0;\n this.m[1] = m1;\n this.m[2] = m2;\n this.m[3] = m3;\n this.m[4] = m4;\n this.m[5] = m5;\n return this;\n }\n getMatrix() {\n return this.m;\n }\n decompose() {\n var a = this.m[0];\n var b = this.m[1];\n var c = this.m[2];\n var d = this.m[3];\n var e = this.m[4];\n var f = this.m[5];\n var delta = a * d - b * c;\n let result = {\n x: e,\n y: f,\n rotation: 0,\n scaleX: 0,\n scaleY: 0,\n skewX: 0,\n skewY: 0,\n };\n if (a != 0 || b != 0) {\n var r = Math.sqrt(a * a + b * b);\n result.rotation = b > 0 ? Math.acos(a / r) : -Math.acos(a / r);\n result.scaleX = r;\n result.scaleY = delta / r;\n result.skewX = (a * c + b * d) / delta;\n result.skewY = 0;\n }\n else if (c != 0 || d != 0) {\n var s = Math.sqrt(c * c + d * d);\n result.rotation =\n Math.PI / 2 - (d > 0 ? Math.acos(-c / s) : -Math.acos(c / s));\n result.scaleX = delta / s;\n result.scaleY = s;\n result.skewX = 0;\n result.skewY = (a * c + b * d) / delta;\n }\n else {\n }\n result.rotation = exports.Util._getRotation(result.rotation);\n return result;\n }\n}\nexports.Transform = Transform;\nvar OBJECT_ARRAY = '[object Array]', OBJECT_NUMBER = '[object Number]', OBJECT_STRING = '[object String]', OBJECT_BOOLEAN = '[object Boolean]', PI_OVER_DEG180 = Math.PI / 180, DEG180_OVER_PI = 180 / Math.PI, HASH = '#', EMPTY_STRING = '', ZERO = '0', KONVA_WARNING = 'Konva warning: ', KONVA_ERROR = 'Konva error: ', RGB_PAREN = 'rgb(', COLORS = {\n aliceblue: [240, 248, 255],\n antiquewhite: [250, 235, 215],\n aqua: [0, 255, 255],\n aquamarine: [127, 255, 212],\n azure: [240, 255, 255],\n beige: [245, 245, 220],\n bisque: [255, 228, 196],\n black: [0, 0, 0],\n blanchedalmond: [255, 235, 205],\n blue: [0, 0, 255],\n blueviolet: [138, 43, 226],\n brown: [165, 42, 42],\n burlywood: [222, 184, 135],\n cadetblue: [95, 158, 160],\n chartreuse: [127, 255, 0],\n chocolate: [210, 105, 30],\n coral: [255, 127, 80],\n cornflowerblue: [100, 149, 237],\n cornsilk: [255, 248, 220],\n crimson: [220, 20, 60],\n cyan: [0, 255, 255],\n darkblue: [0, 0, 139],\n darkcyan: [0, 139, 139],\n darkgoldenrod: [184, 132, 11],\n darkgray: [169, 169, 169],\n darkgreen: [0, 100, 0],\n darkgrey: [169, 169, 169],\n darkkhaki: [189, 183, 107],\n darkmagenta: [139, 0, 139],\n darkolivegreen: [85, 107, 47],\n darkorange: [255, 140, 0],\n darkorchid: [153, 50, 204],\n darkred: [139, 0, 0],\n darksalmon: [233, 150, 122],\n darkseagreen: [143, 188, 143],\n darkslateblue: [72, 61, 139],\n darkslategray: [47, 79, 79],\n darkslategrey: [47, 79, 79],\n darkturquoise: [0, 206, 209],\n darkviolet: [148, 0, 211],\n deeppink: [255, 20, 147],\n deepskyblue: [0, 191, 255],\n dimgray: [105, 105, 105],\n dimgrey: [105, 105, 105],\n dodgerblue: [30, 144, 255],\n firebrick: [178, 34, 34],\n floralwhite: [255, 255, 240],\n forestgreen: [34, 139, 34],\n fuchsia: [255, 0, 255],\n gainsboro: [220, 220, 220],\n ghostwhite: [248, 248, 255],\n gold: [255, 215, 0],\n goldenrod: [218, 165, 32],\n gray: [128, 128, 128],\n green: [0, 128, 0],\n greenyellow: [173, 255, 47],\n grey: [128, 128, 128],\n honeydew: [240, 255, 240],\n hotpink: [255, 105, 180],\n indianred: [205, 92, 92],\n indigo: [75, 0, 130],\n ivory: [255, 255, 240],\n khaki: [240, 230, 140],\n lavender: [230, 230, 250],\n lavenderblush: [255, 240, 245],\n lawngreen: [124, 252, 0],\n lemonchiffon: [255, 250, 205],\n lightblue: [173, 216, 230],\n lightcoral: [240, 128, 128],\n lightcyan: [224, 255, 255],\n lightgoldenrodyellow: [250, 250, 210],\n lightgray: [211, 211, 211],\n lightgreen: [144, 238, 144],\n lightgrey: [211, 211, 211],\n lightpink: [255, 182, 193],\n lightsalmon: [255, 160, 122],\n lightseagreen: [32, 178, 170],\n lightskyblue: [135, 206, 250],\n lightslategray: [119, 136, 153],\n lightslategrey: [119, 136, 153],\n lightsteelblue: [176, 196, 222],\n lightyellow: [255, 255, 224],\n lime: [0, 255, 0],\n limegreen: [50, 205, 50],\n linen: [250, 240, 230],\n magenta: [255, 0, 255],\n maroon: [128, 0, 0],\n mediumaquamarine: [102, 205, 170],\n mediumblue: [0, 0, 205],\n mediumorchid: [186, 85, 211],\n mediumpurple: [147, 112, 219],\n mediumseagreen: [60, 179, 113],\n mediumslateblue: [123, 104, 238],\n mediumspringgreen: [0, 250, 154],\n mediumturquoise: [72, 209, 204],\n mediumvioletred: [199, 21, 133],\n midnightblue: [25, 25, 112],\n mintcream: [245, 255, 250],\n mistyrose: [255, 228, 225],\n moccasin: [255, 228, 181],\n navajowhite: [255, 222, 173],\n navy: [0, 0, 128],\n oldlace: [253, 245, 230],\n olive: [128, 128, 0],\n olivedrab: [107, 142, 35],\n orange: [255, 165, 0],\n orangered: [255, 69, 0],\n orchid: [218, 112, 214],\n palegoldenrod: [238, 232, 170],\n palegreen: [152, 251, 152],\n paleturquoise: [175, 238, 238],\n palevioletred: [219, 112, 147],\n papayawhip: [255, 239, 213],\n peachpuff: [255, 218, 185],\n peru: [205, 133, 63],\n pink: [255, 192, 203],\n plum: [221, 160, 203],\n powderblue: [176, 224, 230],\n purple: [128, 0, 128],\n rebeccapurple: [102, 51, 153],\n red: [255, 0, 0],\n rosybrown: [188, 143, 143],\n royalblue: [65, 105, 225],\n saddlebrown: [139, 69, 19],\n salmon: [250, 128, 114],\n sandybrown: [244, 164, 96],\n seagreen: [46, 139, 87],\n seashell: [255, 245, 238],\n sienna: [160, 82, 45],\n silver: [192, 192, 192],\n skyblue: [135, 206, 235],\n slateblue: [106, 90, 205],\n slategray: [119, 128, 144],\n slategrey: [119, 128, 144],\n snow: [255, 255, 250],\n springgreen: [0, 255, 127],\n steelblue: [70, 130, 180],\n tan: [210, 180, 140],\n teal: [0, 128, 128],\n thistle: [216, 191, 216],\n transparent: [255, 255, 255, 0],\n tomato: [255, 99, 71],\n turquoise: [64, 224, 208],\n violet: [238, 130, 238],\n wheat: [245, 222, 179],\n white: [255, 255, 255],\n whitesmoke: [245, 245, 245],\n yellow: [255, 255, 0],\n yellowgreen: [154, 205, 5],\n}, RGB_REGEX = /rgb\\((\\d{1,3}),(\\d{1,3}),(\\d{1,3})\\)/, animQueue = [];\nconst req = (typeof requestAnimationFrame !== 'undefined' && requestAnimationFrame) ||\n function (f) {\n setTimeout(f, 60);\n };\nexports.Util = {\n _isElement(obj) {\n return !!(obj && obj.nodeType == 1);\n },\n _isFunction(obj) {\n return !!(obj && obj.constructor && obj.call && obj.apply);\n },\n _isPlainObject(obj) {\n return !!obj && obj.constructor === Object;\n },\n _isArray(obj) {\n return Object.prototype.toString.call(obj) === OBJECT_ARRAY;\n },\n _isNumber(obj) {\n return (Object.prototype.toString.call(obj) === OBJECT_NUMBER &&\n !isNaN(obj) &&\n isFinite(obj));\n },\n _isString(obj) {\n return Object.prototype.toString.call(obj) === OBJECT_STRING;\n },\n _isBoolean(obj) {\n return Object.prototype.toString.call(obj) === OBJECT_BOOLEAN;\n },\n isObject(val) {\n return val instanceof Object;\n },\n isValidSelector(selector) {\n if (typeof selector !== 'string') {\n return false;\n }\n var firstChar = selector[0];\n return (firstChar === '#' ||\n firstChar === '.' ||\n firstChar === firstChar.toUpperCase());\n },\n _sign(number) {\n if (number === 0) {\n return 1;\n }\n if (number > 0) {\n return 1;\n }\n else {\n return -1;\n }\n },\n requestAnimFrame(callback) {\n animQueue.push(callback);\n if (animQueue.length === 1) {\n req(function () {\n const queue = animQueue;\n animQueue = [];\n queue.forEach(function (cb) {\n cb();\n });\n });\n }\n },\n createCanvasElement() {\n var canvas = document.createElement('canvas');\n try {\n canvas.style = canvas.style || {};\n }\n catch (e) { }\n return canvas;\n },\n createImageElement() {\n return document.createElement('img');\n },\n _isInDocument(el) {\n while ((el = el.parentNode)) {\n if (el == document) {\n return true;\n }\n }\n return false;\n },\n _urlToImage(url, callback) {\n var imageObj = exports.Util.createImageElement();\n imageObj.onload = function () {\n callback(imageObj);\n };\n imageObj.src = url;\n },\n _rgbToHex(r, g, b) {\n return ((1 << 24) + (r << 16) + (g << 8) + b).toString(16).slice(1);\n },\n _hexToRgb(hex) {\n hex = hex.replace(HASH, EMPTY_STRING);\n var bigint = parseInt(hex, 16);\n return {\n r: (bigint >> 16) & 255,\n g: (bigint >> 8) & 255,\n b: bigint & 255,\n };\n },\n getRandomColor() {\n var randColor = ((Math.random() * 0xffffff) << 0).toString(16);\n while (randColor.length < 6) {\n randColor = ZERO + randColor;\n }\n return HASH + randColor;\n },\n getRGB(color) {\n var rgb;\n if (color in COLORS) {\n rgb = COLORS[color];\n return {\n r: rgb[0],\n g: rgb[1],\n b: rgb[2],\n };\n }\n else if (color[0] === HASH) {\n return this._hexToRgb(color.substring(1));\n }\n else if (color.substr(0, 4) === RGB_PAREN) {\n rgb = RGB_REGEX.exec(color.replace(/ /g, ''));\n return {\n r: parseInt(rgb[1], 10),\n g: parseInt(rgb[2], 10),\n b: parseInt(rgb[3], 10),\n };\n }\n else {\n return {\n r: 0,\n g: 0,\n b: 0,\n };\n }\n },\n colorToRGBA(str) {\n str = str || 'black';\n return (exports.Util._namedColorToRBA(str) ||\n exports.Util._hex3ColorToRGBA(str) ||\n exports.Util._hex4ColorToRGBA(str) ||\n exports.Util._hex6ColorToRGBA(str) ||\n exports.Util._hex8ColorToRGBA(str) ||\n exports.Util._rgbColorToRGBA(str) ||\n exports.Util._rgbaColorToRGBA(str) ||\n exports.Util._hslColorToRGBA(str));\n },\n _namedColorToRBA(str) {\n var c = COLORS[str.toLowerCase()];\n if (!c) {\n return null;\n }\n return {\n r: c[0],\n g: c[1],\n b: c[2],\n a: 1,\n };\n },\n _rgbColorToRGBA(str) {\n if (str.indexOf('rgb(') === 0) {\n str = str.match(/rgb\\(([^)]+)\\)/)[1];\n var parts = str.split(/ *, */).map(Number);\n return {\n r: parts[0],\n g: parts[1],\n b: parts[2],\n a: 1,\n };\n }\n },\n _rgbaColorToRGBA(str) {\n if (str.indexOf('rgba(') === 0) {\n str = str.match(/rgba\\(([^)]+)\\)/)[1];\n var parts = str.split(/ *, */).map((n, index) => {\n if (n.slice(-1) === '%') {\n return index === 3 ? parseInt(n) / 100 : (parseInt(n) / 100) * 255;\n }\n return Number(n);\n });\n return {\n r: parts[0],\n g: parts[1],\n b: parts[2],\n a: parts[3],\n };\n }\n },\n _hex8ColorToRGBA(str) {\n if (str[0] === '#' && str.length === 9) {\n return {\n r: parseInt(str.slice(1, 3), 16),\n g: parseInt(str.slice(3, 5), 16),\n b: parseInt(str.slice(5, 7), 16),\n a: parseInt(str.slice(7, 9), 16) / 0xff,\n };\n }\n },\n _hex6ColorToRGBA(str) {\n if (str[0] === '#' && str.length === 7) {\n return {\n r: parseInt(str.slice(1, 3), 16),\n g: parseInt(str.slice(3, 5), 16),\n b: parseInt(str.slice(5, 7), 16),\n a: 1,\n };\n }\n },\n _hex4ColorToRGBA(str) {\n if (str[0] === '#' && str.length === 5) {\n return {\n r: parseInt(str[1] + str[1], 16),\n g: parseInt(str[2] + str[2], 16),\n b: parseInt(str[3] + str[3], 16),\n a: parseInt(str[4] + str[4], 16) / 0xff,\n };\n }\n },\n _hex3ColorToRGBA(str) {\n if (str[0] === '#' && str.length === 4) {\n return {\n r: parseInt(str[1] + str[1], 16),\n g: parseInt(str[2] + str[2], 16),\n b: parseInt(str[3] + str[3], 16),\n a: 1,\n };\n }\n },\n _hslColorToRGBA(str) {\n if (/hsl\\((\\d+),\\s*([\\d.]+)%,\\s*([\\d.]+)%\\)/g.test(str)) {\n const [_, ...hsl] = /hsl\\((\\d+),\\s*([\\d.]+)%,\\s*([\\d.]+)%\\)/g.exec(str);\n const h = Number(hsl[0]) / 360;\n const s = Number(hsl[1]) / 100;\n const l = Number(hsl[2]) / 100;\n let t2;\n let t3;\n let val;\n if (s === 0) {\n val = l * 255;\n return {\n r: Math.round(val),\n g: Math.round(val),\n b: Math.round(val),\n a: 1,\n };\n }\n if (l < 0.5) {\n t2 = l * (1 + s);\n }\n else {\n t2 = l + s - l * s;\n }\n const t1 = 2 * l - t2;\n const rgb = [0, 0, 0];\n for (let i = 0; i < 3; i++) {\n t3 = h + (1 / 3) * -(i - 1);\n if (t3 < 0) {\n t3++;\n }\n if (t3 > 1) {\n t3--;\n }\n if (6 * t3 < 1) {\n val = t1 + (t2 - t1) * 6 * t3;\n }\n else if (2 * t3 < 1) {\n val = t2;\n }\n else if (3 * t3 < 2) {\n val = t1 + (t2 - t1) * (2 / 3 - t3) * 6;\n }\n else {\n val = t1;\n }\n rgb[i] = val * 255;\n }\n return {\n r: Math.round(rgb[0]),\n g: Math.round(rgb[1]),\n b: Math.round(rgb[2]),\n a: 1,\n };\n }\n },\n haveIntersection(r1, r2) {\n return !(r2.x > r1.x + r1.width ||\n r2.x + r2.width < r1.x ||\n r2.y > r1.y + r1.height ||\n r2.y + r2.height < r1.y);\n },\n cloneObject(obj) {\n var retObj = {};\n for (var key in obj) {\n if (this._isPlainObject(obj[key])) {\n retObj[key] = this.cloneObject(obj[key]);\n }\n else if (this._isArray(obj[key])) {\n retObj[key] = this.cloneArray(obj[key]);\n }\n else {\n retObj[key] = obj[key];\n }\n }\n return retObj;\n },\n cloneArray(arr) {\n return arr.slice(0);\n },\n degToRad(deg) {\n return deg * PI_OVER_DEG180;\n },\n radToDeg(rad) {\n return rad * DEG180_OVER_PI;\n },\n _degToRad(deg) {\n exports.Util.warn('Util._degToRad is removed. Please use public Util.degToRad instead.');\n return exports.Util.degToRad(deg);\n },\n _radToDeg(rad) {\n exports.Util.warn('Util._radToDeg is removed. Please use public Util.radToDeg instead.');\n return exports.Util.radToDeg(rad);\n },\n _getRotation(radians) {\n return Global_1.Konva.angleDeg ? exports.Util.radToDeg(radians) : radians;\n },\n _capitalize(str) {\n return str.charAt(0).toUpperCase() + str.slice(1);\n },\n throw(str) {\n throw new Error(KONVA_ERROR + str);\n },\n error(str) {\n console.error(KONVA_ERROR + str);\n },\n warn(str) {\n if (!Global_1.Konva.showWarnings) {\n return;\n }\n console.warn(KONVA_WARNING + str);\n },\n each(obj, func) {\n for (var key in obj) {\n func(key, obj[key]);\n }\n },\n _inRange(val, left, right) {\n return left <= val && val < right;\n },\n _getProjectionToSegment(x1, y1, x2, y2, x3, y3) {\n var x, y, dist;\n var pd2 = (x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2);\n if (pd2 == 0) {\n x = x1;\n y = y1;\n dist = (x3 - x2) * (x3 - x2) + (y3 - y2) * (y3 - y2);\n }\n else {\n var u = ((x3 - x1) * (x2 - x1) + (y3 - y1) * (y2 - y1)) / pd2;\n if (u < 0) {\n x = x1;\n y = y1;\n dist = (x1 - x3) * (x1 - x3) + (y1 - y3) * (y1 - y3);\n }\n else if (u > 1.0) {\n x = x2;\n y = y2;\n dist = (x2 - x3) * (x2 - x3) + (y2 - y3) * (y2 - y3);\n }\n else {\n x = x1 + u * (x2 - x1);\n y = y1 + u * (y2 - y1);\n dist = (x - x3) * (x - x3) + (y - y3) * (y - y3);\n }\n }\n return [x, y, dist];\n },\n _getProjectionToLine(pt, line, isClosed) {\n var pc = exports.Util.cloneObject(pt);\n var dist = Number.MAX_VALUE;\n line.forEach(function (p1, i) {\n if (!isClosed && i === line.length - 1) {\n return;\n }\n var p2 = line[(i + 1) % line.length];\n var proj = exports.Util._getProjectionToSegment(p1.x, p1.y, p2.x, p2.y, pt.x, pt.y);\n var px = proj[0], py = proj[1], pdist = proj[2];\n if (pdist < dist) {\n pc.x = px;\n pc.y = py;\n dist = pdist;\n }\n });\n return pc;\n },\n _prepareArrayForTween(startArray, endArray, isClosed) {\n var n, start = [], end = [];\n if (startArray.length > endArray.length) {\n var temp = endArray;\n endArray = startArray;\n startArray = temp;\n }\n for (n = 0; n < startArray.length; n += 2) {\n start.push({\n x: startArray[n],\n y: startArray[n + 1],\n });\n }\n for (n = 0; n < endArray.length; n += 2) {\n end.push({\n x: endArray[n],\n y: endArray[n + 1],\n });\n }\n var newStart = [];\n end.forEach(function (point) {\n var pr = exports.Util._getProjectionToLine(point, start, isClosed);\n newStart.push(pr.x);\n newStart.push(pr.y);\n });\n return newStart;\n },\n _prepareToStringify(obj) {\n var desc;\n obj.visitedByCircularReferenceRemoval = true;\n for (var key in obj) {\n if (!(obj.hasOwnProperty(key) && obj[key] && typeof obj[key] == 'object')) {\n continue;\n }\n desc = Object.getOwnPropertyDescriptor(obj, key);\n if (obj[key].visitedByCircularReferenceRemoval ||\n exports.Util._isElement(obj[key])) {\n if (desc.configurable) {\n delete obj[key];\n }\n else {\n return null;\n }\n }\n else if (exports.Util._prepareToStringify(obj[key]) === null) {\n if (desc.configurable) {\n delete obj[key];\n }\n else {\n return null;\n }\n }\n }\n delete obj.visitedByCircularReferenceRemoval;\n return obj;\n },\n _assign(target, source) {\n for (var key in source) {\n target[key] = source[key];\n }\n return target;\n },\n _getFirstPointerId(evt) {\n if (!evt.touches) {\n return evt.pointerId || 999;\n }\n else {\n return evt.changedTouches[0].identifier;\n }\n },\n releaseCanvas(...canvases) {\n if (!Global_1.Konva.releaseCanvasOnDestroy)\n return;\n canvases.forEach((c) => {\n c.width = 0;\n c.height = 0;\n });\n },\n drawRoundedRectPath(context, width, height, cornerRadius) {\n let topLeft = 0;\n let topRight = 0;\n let bottomLeft = 0;\n let bottomRight = 0;\n if (typeof cornerRadius === 'number') {\n topLeft =\n topRight =\n bottomLeft =\n bottomRight =\n Math.min(cornerRadius, width / 2, height / 2);\n }\n else {\n topLeft = Math.min(cornerRadius[0] || 0, width / 2, height / 2);\n topRight = Math.min(cornerRadius[1] || 0, width / 2, height / 2);\n bottomRight = Math.min(cornerRadius[2] || 0, width / 2, height / 2);\n bottomLeft = Math.min(cornerRadius[3] || 0, width / 2, height / 2);\n }\n context.moveTo(topLeft, 0);\n context.lineTo(width - topRight, 0);\n context.arc(width - topRight, topRight, topRight, (Math.PI * 3) / 2, 0, false);\n context.lineTo(width, height - bottomRight);\n context.arc(width - bottomRight, height - bottomRight, bottomRight, 0, Math.PI / 2, false);\n context.lineTo(bottomLeft, height);\n context.arc(bottomLeft, height - bottomLeft, bottomLeft, Math.PI / 2, Math.PI, false);\n context.lineTo(0, topLeft);\n context.arc(topLeft, topLeft, topLeft, Math.PI, (Math.PI * 3) / 2, false);\n },\n};\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.getComponentValidator = exports.getBooleanValidator = exports.getNumberArrayValidator = exports.getFunctionValidator = exports.getStringOrGradientValidator = exports.getStringValidator = exports.getNumberOrAutoValidator = exports.getNumberOrArrayOfNumbersValidator = exports.getNumberValidator = exports.alphaComponent = exports.RGBComponent = void 0;\nconst Global_1 = require(\"./Global\");\nconst Util_1 = require(\"./Util\");\nfunction _formatValue(val) {\n if (Util_1.Util._isString(val)) {\n return '\"' + val + '\"';\n }\n if (Object.prototype.toString.call(val) === '[object Number]') {\n return val;\n }\n if (Util_1.Util._isBoolean(val)) {\n return val;\n }\n return Object.prototype.toString.call(val);\n}\nfunction RGBComponent(val) {\n if (val > 255) {\n return 255;\n }\n else if (val < 0) {\n return 0;\n }\n return Math.round(val);\n}\nexports.RGBComponent = RGBComponent;\nfunction alphaComponent(val) {\n if (val > 1) {\n return 1;\n }\n else if (val < 0.0001) {\n return 0.0001;\n }\n return val;\n}\nexports.alphaComponent = alphaComponent;\nfunction getNumberValidator() {\n if (Global_1.Konva.isUnminified) {\n return function (val, attr) {\n if (!Util_1.Util._isNumber(val)) {\n Util_1.Util.warn(_formatValue(val) +\n ' is a not valid value for \"' +\n attr +\n '\" attribute. The value should be a number.');\n }\n return val;\n };\n }\n}\nexports.getNumberValidator = getNumberValidator;\nfunction getNumberOrArrayOfNumbersValidator(noOfElements) {\n if (Global_1.Konva.isUnminified) {\n return function (val, attr) {\n let isNumber = Util_1.Util._isNumber(val);\n let isValidArray = Util_1.Util._isArray(val) && val.length == noOfElements;\n if (!isNumber && !isValidArray) {\n Util_1.Util.warn(_formatValue(val) +\n ' is a not valid value for \"' +\n attr +\n '\" attribute. The value should be a number or Array(' +\n noOfElements +\n ')');\n }\n return val;\n };\n }\n}\nexports.getNumberOrArrayOfNumbersValidator = getNumberOrArrayOfNumbersValidator;\nfunction getNumberOrAutoValidator() {\n if (Global_1.Konva.isUnminified) {\n return function (val, attr) {\n var isNumber = Util_1.Util._isNumber(val);\n var isAuto = val === 'auto';\n if (!(isNumber || isAuto)) {\n Util_1.Util.warn(_formatValue(val) +\n ' is a not valid value for \"' +\n attr +\n '\" attribute. The value should be a number or \"auto\".');\n }\n return val;\n };\n }\n}\nexports.getNumberOrAutoValidator = getNumberOrAutoValidator;\nfunction getStringValidator() {\n if (Global_1.Konva.isUnminified) {\n return function (val, attr) {\n if (!Util_1.Util._isString(val)) {\n Util_1.Util.warn(_formatValue(val) +\n ' is a not valid value for \"' +\n attr +\n '\" attribute. The value should be a string.');\n }\n return val;\n };\n }\n}\nexports.getStringValidator = getStringValidator;\nfunction getStringOrGradientValidator() {\n if (Global_1.Konva.isUnminified) {\n return function (val, attr) {\n const isString = Util_1.Util._isString(val);\n const isGradient = Object.prototype.toString.call(val) === '[object CanvasGradient]' ||\n (val && val.addColorStop);\n if (!(isString || isGradient)) {\n Util_1.Util.warn(_formatValue(val) +\n ' is a not valid value for \"' +\n attr +\n '\" attribute. The value should be a string or a native gradient.');\n }\n return val;\n };\n }\n}\nexports.getStringOrGradientValidator = getStringOrGradientValidator;\nfunction getFunctionValidator() {\n if (Global_1.Konva.isUnminified) {\n return function (val, attr) {\n if (!Util_1.Util._isFunction(val)) {\n Util_1.Util.warn(_formatValue(val) +\n ' is a not valid value for \"' +\n attr +\n '\" attribute. The value should be a function.');\n }\n return val;\n };\n }\n}\nexports.getFunctionValidator = getFunctionValidator;\nfunction getNumberArrayValidator() {\n if (Global_1.Konva.isUnminified) {\n return function (val, attr) {\n const TypedArray = Int8Array ? Object.getPrototypeOf(Int8Array) : null;\n if (TypedArray && val instanceof TypedArray) {\n return val;\n }\n if (!Util_1.Util._isArray(val)) {\n Util_1.Util.warn(_formatValue(val) +\n ' is a not valid value for \"' +\n attr +\n '\" attribute. The value should be a array of numbers.');\n }\n else {\n val.forEach(function (item) {\n if (!Util_1.Util._isNumber(item)) {\n Util_1.Util.warn('\"' +\n attr +\n '\" attribute has non numeric element ' +\n item +\n '. Make sure that all elements are numbers.');\n }\n });\n }\n return val;\n };\n }\n}\nexports.getNumberArrayValidator = getNumberArrayValidator;\nfunction getBooleanValidator() {\n if (Global_1.Konva.isUnminified) {\n return function (val, attr) {\n var isBool = val === true || val === false;\n if (!isBool) {\n Util_1.Util.warn(_formatValue(val) +\n ' is a not valid value for \"' +\n attr +\n '\" attribute. The value should be a boolean.');\n }\n return val;\n };\n }\n}\nexports.getBooleanValidator = getBooleanValidator;\nfunction getComponentValidator(components) {\n if (Global_1.Konva.isUnminified) {\n return function (val, attr) {\n if (val === undefined || val === null) {\n return val;\n }\n if (!Util_1.Util.isObject(val)) {\n Util_1.Util.warn(_formatValue(val) +\n ' is a not valid value for \"' +\n attr +\n '\" attribute. The value should be an object with properties ' +\n components);\n }\n return val;\n };\n }\n}\nexports.getComponentValidator = getComponentValidator;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Factory = void 0;\nconst Util_1 = require(\"./Util\");\nconst Validators_1 = require(\"./Validators\");\nvar GET = 'get', SET = 'set';\nexports.Factory = {\n addGetterSetter(constructor, attr, def, validator, after) {\n exports.Factory.addGetter(constructor, attr, def);\n exports.Factory.addSetter(constructor, attr, validator, after);\n exports.Factory.addOverloadedGetterSetter(constructor, attr);\n },\n addGetter(constructor, attr, def) {\n var method = GET + Util_1.Util._capitalize(attr);\n constructor.prototype[method] =\n constructor.prototype[method] ||\n function () {\n var val = this.attrs[attr];\n return val === undefined ? def : val;\n };\n },\n addSetter(constructor, attr, validator, after) {\n var method = SET + Util_1.Util._capitalize(attr);\n if (!constructor.prototype[method]) {\n exports.Factory.overWriteSetter(constructor, attr, validator, after);\n }\n },\n overWriteSetter(constructor, attr, validator, after) {\n var method = SET + Util_1.Util._capitalize(attr);\n constructor.prototype[method] = function (val) {\n if (validator && val !== undefined && val !== null) {\n val = validator.call(this, val, attr);\n }\n this._setAttr(attr, val);\n if (after) {\n after.call(this);\n }\n return this;\n };\n },\n addComponentsGetterSetter(constructor, attr, components, validator, after) {\n var len = components.length, capitalize = Util_1.Util._capitalize, getter = GET + capitalize(attr), setter = SET + capitalize(attr), n, component;\n constructor.prototype[getter] = function () {\n var ret = {};\n for (n = 0; n < len; n++) {\n component = components[n];\n ret[component] = this.getAttr(attr + capitalize(component));\n }\n return ret;\n };\n var basicValidator = (0, Validators_1.getComponentValidator)(components);\n constructor.prototype[setter] = function (val) {\n var oldVal = this.attrs[attr], key;\n if (validator) {\n val = validator.call(this, val);\n }\n if (basicValidator) {\n basicValidator.call(this, val, attr);\n }\n for (key in val) {\n if (!val.hasOwnProperty(key)) {\n continue;\n }\n this._setAttr(attr + capitalize(key), val[key]);\n }\n if (!val) {\n components.forEach((component) => {\n this._setAttr(attr + capitalize(component), undefined);\n });\n }\n this._fireChangeEvent(attr, oldVal, val);\n if (after) {\n after.call(this);\n }\n return this;\n };\n exports.Factory.addOverloadedGetterSetter(constructor, attr);\n },\n addOverloadedGetterSetter(constructor, attr) {\n var capitalizedAttr = Util_1.Util._capitalize(attr), setter = SET + capitalizedAttr, getter = GET + capitalizedAttr;\n constructor.prototype[attr] = function () {\n if (arguments.length) {\n this[setter](arguments[0]);\n return this;\n }\n return this[getter]();\n };\n },\n addDeprecatedGetterSetter(constructor, attr, def, validator) {\n Util_1.Util.error('Adding deprecated ' + attr);\n var method = GET + Util_1.Util._capitalize(attr);\n var message = attr +\n ' property is deprecated and will be removed soon. Look at Konva change log for more information.';\n constructor.prototype[method] = function () {\n Util_1.Util.error(message);\n var val = this.attrs[attr];\n return val === undefined ? def : val;\n };\n exports.Factory.addSetter(constructor, attr, validator, function () {\n Util_1.Util.error(message);\n });\n exports.Factory.addOverloadedGetterSetter(constructor, attr);\n },\n backCompat(constructor, methods) {\n Util_1.Util.each(methods, function (oldMethodName, newMethodName) {\n var method = constructor.prototype[newMethodName];\n var oldGetter = GET + Util_1.Util._capitalize(oldMethodName);\n var oldSetter = SET + Util_1.Util._capitalize(oldMethodName);\n function deprecated() {\n method.apply(this, arguments);\n Util_1.Util.error('\"' +\n oldMethodName +\n '\" method is deprecated and will be removed soon. Use \"\"' +\n newMethodName +\n '\" instead.');\n }\n constructor.prototype[oldMethodName] = deprecated;\n constructor.prototype[oldGetter] = deprecated;\n constructor.prototype[oldSetter] = deprecated;\n });\n },\n afterSetFilter() {\n this._filterUpToDate = false;\n },\n};\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.HitContext = exports.SceneContext = exports.Context = void 0;\nconst Util_1 = require(\"./Util\");\nconst Global_1 = require(\"./Global\");\nfunction simplifyArray(arr) {\n var retArr = [], len = arr.length, util = Util_1.Util, n, val;\n for (n = 0; n < len; n++) {\n val = arr[n];\n if (util._isNumber(val)) {\n val = Math.round(val * 1000) / 1000;\n }\n else if (!util._isString(val)) {\n val = val + '';\n }\n retArr.push(val);\n }\n return retArr;\n}\nvar COMMA = ',', OPEN_PAREN = '(', CLOSE_PAREN = ')', OPEN_PAREN_BRACKET = '([', CLOSE_BRACKET_PAREN = '])', SEMICOLON = ';', DOUBLE_PAREN = '()', EQUALS = '=', CONTEXT_METHODS = [\n 'arc',\n 'arcTo',\n 'beginPath',\n 'bezierCurveTo',\n 'clearRect',\n 'clip',\n 'closePath',\n 'createLinearGradient',\n 'createPattern',\n 'createRadialGradient',\n 'drawImage',\n 'ellipse',\n 'fill',\n 'fillText',\n 'getImageData',\n 'createImageData',\n 'lineTo',\n 'moveTo',\n 'putImageData',\n 'quadraticCurveTo',\n 'rect',\n 'roundRect',\n 'restore',\n 'rotate',\n 'save',\n 'scale',\n 'setLineDash',\n 'setTransform',\n 'stroke',\n 'strokeText',\n 'transform',\n 'translate',\n];\nvar CONTEXT_PROPERTIES = [\n 'fillStyle',\n 'strokeStyle',\n 'shadowColor',\n 'shadowBlur',\n 'shadowOffsetX',\n 'shadowOffsetY',\n 'letterSpacing',\n 'lineCap',\n 'lineDashOffset',\n 'lineJoin',\n 'lineWidth',\n 'miterLimit',\n 'direction',\n 'font',\n 'textAlign',\n 'textBaseline',\n 'globalAlpha',\n 'globalCompositeOperation',\n 'imageSmoothingEnabled',\n];\nconst traceArrMax = 100;\nclass Context {\n constructor(canvas) {\n this.canvas = canvas;\n if (Global_1.Konva.enableTrace) {\n this.traceArr = [];\n this._enableTrace();\n }\n }\n fillShape(shape) {\n if (shape.fillEnabled()) {\n this._fill(shape);\n }\n }\n _fill(shape) {\n }\n strokeShape(shape) {\n if (shape.hasStroke()) {\n this._stroke(shape);\n }\n }\n _stroke(shape) {\n }\n fillStrokeShape(shape) {\n if (shape.attrs.fillAfterStrokeEnabled) {\n this.strokeShape(shape);\n this.fillShape(shape);\n }\n else {\n this.fillShape(shape);\n this.strokeShape(shape);\n }\n }\n getTrace(relaxed, rounded) {\n var traceArr = this.traceArr, len = traceArr.length, str = '', n, trace, method, args;\n for (n = 0; n < len; n++) {\n trace = traceArr[n];\n method = trace.method;\n if (method) {\n args = trace.args;\n str += method;\n if (relaxed) {\n str += DOUBLE_PAREN;\n }\n else {\n if (Util_1.Util._isArray(args[0])) {\n str += OPEN_PAREN_BRACKET + args.join(COMMA) + CLOSE_BRACKET_PAREN;\n }\n else {\n if (rounded) {\n args = args.map((a) => typeof a === 'number' ? Math.floor(a) : a);\n }\n str += OPEN_PAREN + args.join(COMMA) + CLOSE_PAREN;\n }\n }\n }\n else {\n str += trace.property;\n if (!relaxed) {\n str += EQUALS + trace.val;\n }\n }\n str += SEMICOLON;\n }\n return str;\n }\n clearTrace() {\n this.traceArr = [];\n }\n _trace(str) {\n var traceArr = this.traceArr, len;\n traceArr.push(str);\n len = traceArr.length;\n if (len >= traceArrMax) {\n traceArr.shift();\n }\n }\n reset() {\n var pixelRatio = this.getCanvas().getPixelRatio();\n this.setTransform(1 * pixelRatio, 0, 0, 1 * pixelRatio, 0, 0);\n }\n getCanvas() {\n return this.canvas;\n }\n clear(bounds) {\n var canvas = this.getCanvas();\n if (bounds) {\n this.clearRect(bounds.x || 0, bounds.y || 0, bounds.width || 0, bounds.height || 0);\n }\n else {\n this.clearRect(0, 0, canvas.getWidth() / canvas.pixelRatio, canvas.getHeight() / canvas.pixelRatio);\n }\n }\n _applyLineCap(shape) {\n const lineCap = shape.attrs.lineCap;\n if (lineCap) {\n this.setAttr('lineCap', lineCap);\n }\n }\n _applyOpacity(shape) {\n var absOpacity = shape.getAbsoluteOpacity();\n if (absOpacity !== 1) {\n this.setAttr('globalAlpha', absOpacity);\n }\n }\n _applyLineJoin(shape) {\n const lineJoin = shape.attrs.lineJoin;\n if (lineJoin) {\n this.setAttr('lineJoin', lineJoin);\n }\n }\n setAttr(attr, val) {\n this._context[attr] = val;\n }\n arc(x, y, radius, startAngle, endAngle, counterClockwise) {\n this._context.arc(x, y, radius, startAngle, endAngle, counterClockwise);\n }\n arcTo(x1, y1, x2, y2, radius) {\n this._context.arcTo(x1, y1, x2, y2, radius);\n }\n beginPath() {\n this._context.beginPath();\n }\n bezierCurveTo(cp1x, cp1y, cp2x, cp2y, x, y) {\n this._context.bezierCurveTo(cp1x, cp1y, cp2x, cp2y, x, y);\n }\n clearRect(x, y, width, height) {\n this._context.clearRect(x, y, width, height);\n }\n clip(...args) {\n this._context.clip.apply(this._context, args);\n }\n closePath() {\n this._context.closePath();\n }\n createImageData(width, height) {\n var a = arguments;\n if (a.length === 2) {\n return this._context.createImageData(width, height);\n }\n else if (a.length === 1) {\n return this._context.createImageData(width);\n }\n }\n createLinearGradient(x0, y0, x1, y1) {\n return this._context.createLinearGradient(x0, y0, x1, y1);\n }\n createPattern(image, repetition) {\n return this._context.createPattern(image, repetition);\n }\n createRadialGradient(x0, y0, r0, x1, y1, r1) {\n return this._context.createRadialGradient(x0, y0, r0, x1, y1, r1);\n }\n drawImage(image, sx, sy, sWidth, sHeight, dx, dy, dWidth, dHeight) {\n var a = arguments, _context = this._context;\n if (a.length === 3) {\n _context.drawImage(image, sx, sy);\n }\n else if (a.length === 5) {\n _context.drawImage(image, sx, sy, sWidth, sHeight);\n }\n else if (a.length === 9) {\n _context.drawImage(image, sx, sy, sWidth, sHeight, dx, dy, dWidth, dHeight);\n }\n }\n ellipse(x, y, radiusX, radiusY, rotation, startAngle, endAngle, counterclockwise) {\n this._context.ellipse(x, y, radiusX, radiusY, rotation, startAngle, endAngle, counterclockwise);\n }\n isPointInPath(x, y, path, fillRule) {\n if (path) {\n return this._context.isPointInPath(path, x, y, fillRule);\n }\n return this._context.isPointInPath(x, y, fillRule);\n }\n fill(...args) {\n this._context.fill.apply(this._context, args);\n }\n fillRect(x, y, width, height) {\n this._context.fillRect(x, y, width, height);\n }\n strokeRect(x, y, width, height) {\n this._context.strokeRect(x, y, width, height);\n }\n fillText(text, x, y, maxWidth) {\n if (maxWidth) {\n this._context.fillText(text, x, y, maxWidth);\n }\n else {\n this._context.fillText(text, x, y);\n }\n }\n measureText(text) {\n return this._context.measureText(text);\n }\n getImageData(sx, sy, sw, sh) {\n return this._context.getImageData(sx, sy, sw, sh);\n }\n lineTo(x, y) {\n this._context.lineTo(x, y);\n }\n moveTo(x, y) {\n this._context.moveTo(x, y);\n }\n rect(x, y, width, height) {\n this._context.rect(x, y, width, height);\n }\n roundRect(x, y, width, height, radii) {\n this._context.roundRect(x, y, width, height, radii);\n }\n putImageData(imageData, dx, dy) {\n this._context.putImageData(imageData, dx, dy);\n }\n quadraticCurveTo(cpx, cpy, x, y) {\n this._context.quadraticCurveTo(cpx, cpy, x, y);\n }\n restore() {\n this._context.restore();\n }\n rotate(angle) {\n this._context.rotate(angle);\n }\n save() {\n this._context.save();\n }\n scale(x, y) {\n this._context.scale(x, y);\n }\n setLineDash(segments) {\n if (this._context.setLineDash) {\n this._context.setLineDash(segments);\n }\n else if ('mozDash' in this._context) {\n this._context['mozDash'] = segments;\n }\n else if ('webkitLineDash' in this._context) {\n this._context['webkitLineDash'] = segments;\n }\n }\n getLineDash() {\n return this._context.getLineDash();\n }\n setTransform(a, b, c, d, e, f) {\n this._context.setTransform(a, b, c, d, e, f);\n }\n stroke(path2d) {\n if (path2d) {\n this._context.stroke(path2d);\n }\n else {\n this._context.stroke();\n }\n }\n strokeText(text, x, y, maxWidth) {\n this._context.strokeText(text, x, y, maxWidth);\n }\n transform(a, b, c, d, e, f) {\n this._context.transform(a, b, c, d, e, f);\n }\n translate(x, y) {\n this._context.translate(x, y);\n }\n _enableTrace() {\n var that = this, len = CONTEXT_METHODS.length, origSetter = this.setAttr, n, args;\n var func = function (methodName) {\n var origMethod = that[methodName], ret;\n that[methodName] = function () {\n args = simplifyArray(Array.prototype.slice.call(arguments, 0));\n ret = origMethod.apply(that, arguments);\n that._trace({\n method: methodName,\n args: args,\n });\n return ret;\n };\n };\n for (n = 0; n < len; n++) {\n func(CONTEXT_METHODS[n]);\n }\n that.setAttr = function () {\n origSetter.apply(that, arguments);\n var prop = arguments[0];\n var val = arguments[1];\n if (prop === 'shadowOffsetX' ||\n prop === 'shadowOffsetY' ||\n prop === 'shadowBlur') {\n val = val / this.canvas.getPixelRatio();\n }\n that._trace({\n property: prop,\n val: val,\n });\n };\n }\n _applyGlobalCompositeOperation(node) {\n const op = node.attrs.globalCompositeOperation;\n var def = !op || op === 'source-over';\n if (!def) {\n this.setAttr('globalCompositeOperation', op);\n }\n }\n}\nexports.Context = Context;\nCONTEXT_PROPERTIES.forEach(function (prop) {\n Object.defineProperty(Context.prototype, prop, {\n get() {\n return this._context[prop];\n },\n set(val) {\n this._context[prop] = val;\n },\n });\n});\nclass SceneContext extends Context {\n constructor(canvas, { willReadFrequently = false } = {}) {\n super(canvas);\n this._context = canvas._canvas.getContext('2d', {\n willReadFrequently,\n });\n }\n _fillColor(shape) {\n var fill = shape.fill();\n this.setAttr('fillStyle', fill);\n shape._fillFunc(this);\n }\n _fillPattern(shape) {\n this.setAttr('fillStyle', shape._getFillPattern());\n shape._fillFunc(this);\n }\n _fillLinearGradient(shape) {\n var grd = shape._getLinearGradient();\n if (grd) {\n this.setAttr('fillStyle', grd);\n shape._fillFunc(this);\n }\n }\n _fillRadialGradient(shape) {\n const grd = shape._getRadialGradient();\n if (grd) {\n this.setAttr('fillStyle', grd);\n shape._fillFunc(this);\n }\n }\n _fill(shape) {\n const hasColor = shape.fill(), fillPriority = shape.getFillPriority();\n if (hasColor && fillPriority === 'color') {\n this._fillColor(shape);\n return;\n }\n const hasPattern = shape.getFillPatternImage();\n if (hasPattern && fillPriority === 'pattern') {\n this._fillPattern(shape);\n return;\n }\n const hasLinearGradient = shape.getFillLinearGradientColorStops();\n if (hasLinearGradient && fillPriority === 'linear-gradient') {\n this._fillLinearGradient(shape);\n return;\n }\n const hasRadialGradient = shape.getFillRadialGradientColorStops();\n if (hasRadialGradient && fillPriority === 'radial-gradient') {\n this._fillRadialGradient(shape);\n return;\n }\n if (hasColor) {\n this._fillColor(shape);\n }\n else if (hasPattern) {\n this._fillPattern(shape);\n }\n else if (hasLinearGradient) {\n this._fillLinearGradient(shape);\n }\n else if (hasRadialGradient) {\n this._fillRadialGradient(shape);\n }\n }\n _strokeLinearGradient(shape) {\n const start = shape.getStrokeLinearGradientStartPoint(), end = shape.getStrokeLinearGradientEndPoint(), colorStops = shape.getStrokeLinearGradientColorStops(), grd = this.createLinearGradient(start.x, start.y, end.x, end.y);\n if (colorStops) {\n for (var n = 0; n < colorStops.length; n += 2) {\n grd.addColorStop(colorStops[n], colorStops[n + 1]);\n }\n this.setAttr('strokeStyle', grd);\n }\n }\n _stroke(shape) {\n var dash = shape.dash(), strokeScaleEnabled = shape.getStrokeScaleEnabled();\n if (shape.hasStroke()) {\n if (!strokeScaleEnabled) {\n this.save();\n var pixelRatio = this.getCanvas().getPixelRatio();\n this.setTransform(pixelRatio, 0, 0, pixelRatio, 0, 0);\n }\n this._applyLineCap(shape);\n if (dash && shape.dashEnabled()) {\n this.setLineDash(dash);\n this.setAttr('lineDashOffset', shape.dashOffset());\n }\n this.setAttr('lineWidth', shape.strokeWidth());\n if (!shape.getShadowForStrokeEnabled()) {\n this.setAttr('shadowColor', 'rgba(0,0,0,0)');\n }\n var hasLinearGradient = shape.getStrokeLinearGradientColorStops();\n if (hasLinearGradient) {\n this._strokeLinearGradient(shape);\n }\n else {\n this.setAttr('strokeStyle', shape.stroke());\n }\n shape._strokeFunc(this);\n if (!strokeScaleEnabled) {\n this.restore();\n }\n }\n }\n _applyShadow(shape) {\n var _a, _b, _c;\n var color = (_a = shape.getShadowRGBA()) !== null && _a !== void 0 ? _a : 'black', blur = (_b = shape.getShadowBlur()) !== null && _b !== void 0 ? _b : 5, offset = (_c = shape.getShadowOffset()) !== null && _c !== void 0 ? _c : {\n x: 0,\n y: 0,\n }, scale = shape.getAbsoluteScale(), ratio = this.canvas.getPixelRatio(), scaleX = scale.x * ratio, scaleY = scale.y * ratio;\n this.setAttr('shadowColor', color);\n this.setAttr('shadowBlur', blur * Math.min(Math.abs(scaleX), Math.abs(scaleY)));\n this.setAttr('shadowOffsetX', offset.x * scaleX);\n this.setAttr('shadowOffsetY', offset.y * scaleY);\n }\n}\nexports.SceneContext = SceneContext;\nclass HitContext extends Context {\n constructor(canvas) {\n super(canvas);\n this._context = canvas._canvas.getContext('2d', {\n willReadFrequently: true,\n });\n }\n _fill(shape) {\n this.save();\n this.setAttr('fillStyle', shape.colorKey);\n shape._fillFuncHit(this);\n this.restore();\n }\n strokeShape(shape) {\n if (shape.hasHitStroke()) {\n this._stroke(shape);\n }\n }\n _stroke(shape) {\n if (shape.hasHitStroke()) {\n const strokeScaleEnabled = shape.getStrokeScaleEnabled();\n if (!strokeScaleEnabled) {\n this.save();\n var pixelRatio = this.getCanvas().getPixelRatio();\n this.setTransform(pixelRatio, 0, 0, pixelRatio, 0, 0);\n }\n this._applyLineCap(shape);\n var hitStrokeWidth = shape.hitStrokeWidth();\n var strokeWidth = hitStrokeWidth === 'auto' ? shape.strokeWidth() : hitStrokeWidth;\n this.setAttr('lineWidth', strokeWidth);\n this.setAttr('strokeStyle', shape.colorKey);\n shape._strokeFuncHit(this);\n if (!strokeScaleEnabled) {\n this.restore();\n }\n }\n }\n}\nexports.HitContext = HitContext;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.HitCanvas = exports.SceneCanvas = exports.Canvas = void 0;\nconst Util_1 = require(\"./Util\");\nconst Context_1 = require(\"./Context\");\nconst Global_1 = require(\"./Global\");\nconst Factory_1 = require(\"./Factory\");\nconst Validators_1 = require(\"./Validators\");\nvar _pixelRatio;\nfunction getDevicePixelRatio() {\n if (_pixelRatio) {\n return _pixelRatio;\n }\n var canvas = Util_1.Util.createCanvasElement();\n var context = canvas.getContext('2d');\n _pixelRatio = (function () {\n var devicePixelRatio = Global_1.Konva._global.devicePixelRatio || 1, backingStoreRatio = context.webkitBackingStorePixelRatio ||\n context.mozBackingStorePixelRatio ||\n context.msBackingStorePixelRatio ||\n context.oBackingStorePixelRatio ||\n context.backingStorePixelRatio ||\n 1;\n return devicePixelRatio / backingStoreRatio;\n })();\n Util_1.Util.releaseCanvas(canvas);\n return _pixelRatio;\n}\nclass Canvas {\n constructor(config) {\n this.pixelRatio = 1;\n this.width = 0;\n this.height = 0;\n this.isCache = false;\n var conf = config || {};\n var pixelRatio = conf.pixelRatio || Global_1.Konva.pixelRatio || getDevicePixelRatio();\n this.pixelRatio = pixelRatio;\n this._canvas = Util_1.Util.createCanvasElement();\n this._canvas.style.padding = '0';\n this._canvas.style.margin = '0';\n this._canvas.style.border = '0';\n this._canvas.style.background = 'transparent';\n this._canvas.style.position = 'absolute';\n this._canvas.style.top = '0';\n this._canvas.style.left = '0';\n }\n getContext() {\n return this.context;\n }\n getPixelRatio() {\n return this.pixelRatio;\n }\n setPixelRatio(pixelRatio) {\n var previousRatio = this.pixelRatio;\n this.pixelRatio = pixelRatio;\n this.setSize(this.getWidth() / previousRatio, this.getHeight() / previousRatio);\n }\n setWidth(width) {\n this.width = this._canvas.width = width * this.pixelRatio;\n this._canvas.style.width = width + 'px';\n var pixelRatio = this.pixelRatio, _context = this.getContext()._context;\n _context.scale(pixelRatio, pixelRatio);\n }\n setHeight(height) {\n this.height = this._canvas.height = height * this.pixelRatio;\n this._canvas.style.height = height + 'px';\n var pixelRatio = this.pixelRatio, _context = this.getContext()._context;\n _context.scale(pixelRatio, pixelRatio);\n }\n getWidth() {\n return this.width;\n }\n getHeight() {\n return this.height;\n }\n setSize(width, height) {\n this.setWidth(width || 0);\n this.setHeight(height || 0);\n }\n toDataURL(mimeType, quality) {\n try {\n return this._canvas.toDataURL(mimeType, quality);\n }\n catch (e) {\n try {\n return this._canvas.toDataURL();\n }\n catch (err) {\n Util_1.Util.error('Unable to get data URL. ' +\n err.message +\n ' For more info read https://konvajs.org/docs/posts/Tainted_Canvas.html.');\n return '';\n }\n }\n }\n}\nexports.Canvas = Canvas;\nFactory_1.Factory.addGetterSetter(Canvas, 'pixelRatio', undefined, (0, Validators_1.getNumberValidator)());\nclass SceneCanvas extends Canvas {\n constructor(config = { width: 0, height: 0, willReadFrequently: false }) {\n super(config);\n this.context = new Context_1.SceneContext(this, {\n willReadFrequently: config.willReadFrequently,\n });\n this.setSize(config.width, config.height);\n }\n}\nexports.SceneCanvas = SceneCanvas;\nclass HitCanvas extends Canvas {\n constructor(config = { width: 0, height: 0 }) {\n super(config);\n this.hitCanvas = true;\n this.context = new Context_1.HitContext(this);\n this.setSize(config.width, config.height);\n }\n}\nexports.HitCanvas = HitCanvas;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.DD = void 0;\nconst Global_1 = require(\"./Global\");\nconst Util_1 = require(\"./Util\");\nexports.DD = {\n get isDragging() {\n var flag = false;\n exports.DD._dragElements.forEach((elem) => {\n if (elem.dragStatus === 'dragging') {\n flag = true;\n }\n });\n return flag;\n },\n justDragged: false,\n get node() {\n var node;\n exports.DD._dragElements.forEach((elem) => {\n node = elem.node;\n });\n return node;\n },\n _dragElements: new Map(),\n _drag(evt) {\n const nodesToFireEvents = [];\n exports.DD._dragElements.forEach((elem, key) => {\n const { node } = elem;\n const stage = node.getStage();\n stage.setPointersPositions(evt);\n if (elem.pointerId === undefined) {\n elem.pointerId = Util_1.Util._getFirstPointerId(evt);\n }\n const pos = stage._changedPointerPositions.find((pos) => pos.id === elem.pointerId);\n if (!pos) {\n return;\n }\n if (elem.dragStatus !== 'dragging') {\n var dragDistance = node.dragDistance();\n var distance = Math.max(Math.abs(pos.x - elem.startPointerPos.x), Math.abs(pos.y - elem.startPointerPos.y));\n if (distance < dragDistance) {\n return;\n }\n node.startDrag({ evt });\n if (!node.isDragging()) {\n return;\n }\n }\n node._setDragPosition(evt, elem);\n nodesToFireEvents.push(node);\n });\n nodesToFireEvents.forEach((node) => {\n node.fire('dragmove', {\n type: 'dragmove',\n target: node,\n evt: evt,\n }, true);\n });\n },\n _endDragBefore(evt) {\n const drawNodes = [];\n exports.DD._dragElements.forEach((elem) => {\n const { node } = elem;\n const stage = node.getStage();\n if (evt) {\n stage.setPointersPositions(evt);\n }\n const pos = stage._changedPointerPositions.find((pos) => pos.id === elem.pointerId);\n if (!pos) {\n return;\n }\n if (elem.dragStatus === 'dragging' || elem.dragStatus === 'stopped') {\n exports.DD.justDragged = true;\n Global_1.Konva._mouseListenClick = false;\n Global_1.Konva._touchListenClick = false;\n Global_1.Konva._pointerListenClick = false;\n elem.dragStatus = 'stopped';\n }\n const drawNode = elem.node.getLayer() ||\n (elem.node instanceof Global_1.Konva['Stage'] && elem.node);\n if (drawNode && drawNodes.indexOf(drawNode) === -1) {\n drawNodes.push(drawNode);\n }\n });\n drawNodes.forEach((drawNode) => {\n drawNode.draw();\n });\n },\n _endDragAfter(evt) {\n exports.DD._dragElements.forEach((elem, key) => {\n if (elem.dragStatus === 'stopped') {\n elem.node.fire('dragend', {\n type: 'dragend',\n target: elem.node,\n evt: evt,\n }, true);\n }\n if (elem.dragStatus !== 'dragging') {\n exports.DD._dragElements.delete(key);\n }\n });\n },\n};\nif (Global_1.Konva.isBrowser) {\n window.addEventListener('mouseup', exports.DD._endDragBefore, true);\n window.addEventListener('touchend', exports.DD._endDragBefore, true);\n window.addEventListener('mousemove', exports.DD._drag);\n window.addEventListener('touchmove', exports.DD._drag);\n window.addEventListener('mouseup', exports.DD._endDragAfter, false);\n window.addEventListener('touchend', exports.DD._endDragAfter, false);\n}\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Node = void 0;\nconst Util_1 = require(\"./Util\");\nconst Factory_1 = require(\"./Factory\");\nconst Canvas_1 = require(\"./Canvas\");\nconst Global_1 = require(\"./Global\");\nconst DragAndDrop_1 = require(\"./DragAndDrop\");\nconst Validators_1 = require(\"./Validators\");\nvar ABSOLUTE_OPACITY = 'absoluteOpacity', ALL_LISTENERS = 'allEventListeners', ABSOLUTE_TRANSFORM = 'absoluteTransform', ABSOLUTE_SCALE = 'absoluteScale', CANVAS = 'canvas', CHANGE = 'Change', CHILDREN = 'children', KONVA = 'konva', LISTENING = 'listening', MOUSEENTER = 'mouseenter', MOUSELEAVE = 'mouseleave', NAME = 'name', SET = 'set', SHAPE = 'Shape', SPACE = ' ', STAGE = 'stage', TRANSFORM = 'transform', UPPER_STAGE = 'Stage', VISIBLE = 'visible', TRANSFORM_CHANGE_STR = [\n 'xChange.konva',\n 'yChange.konva',\n 'scaleXChange.konva',\n 'scaleYChange.konva',\n 'skewXChange.konva',\n 'skewYChange.konva',\n 'rotationChange.konva',\n 'offsetXChange.konva',\n 'offsetYChange.konva',\n 'transformsEnabledChange.konva',\n].join(SPACE);\nlet idCounter = 1;\nclass Node {\n constructor(config) {\n this._id = idCounter++;\n this.eventListeners = {};\n this.attrs = {};\n this.index = 0;\n this._allEventListeners = null;\n this.parent = null;\n this._cache = new Map();\n this._attachedDepsListeners = new Map();\n this._lastPos = null;\n this._batchingTransformChange = false;\n this._needClearTransformCache = false;\n this._filterUpToDate = false;\n this._isUnderCache = false;\n this._dragEventId = null;\n this._shouldFireChangeEvents = false;\n this.setAttrs(config);\n this._shouldFireChangeEvents = true;\n }\n hasChildren() {\n return false;\n }\n _clearCache(attr) {\n if ((attr === TRANSFORM || attr === ABSOLUTE_TRANSFORM) &&\n this._cache.get(attr)) {\n this._cache.get(attr).dirty = true;\n }\n else if (attr) {\n this._cache.delete(attr);\n }\n else {\n this._cache.clear();\n }\n }\n _getCache(attr, privateGetter) {\n var cache = this._cache.get(attr);\n var isTransform = attr === TRANSFORM || attr === ABSOLUTE_TRANSFORM;\n var invalid = cache === undefined || (isTransform && cache.dirty === true);\n if (invalid) {\n cache = privateGetter.call(this);\n this._cache.set(attr, cache);\n }\n return cache;\n }\n _calculate(name, deps, getter) {\n if (!this._attachedDepsListeners.get(name)) {\n const depsString = deps.map((dep) => dep + 'Change.konva').join(SPACE);\n this.on(depsString, () => {\n this._clearCache(name);\n });\n this._attachedDepsListeners.set(name, true);\n }\n return this._getCache(name, getter);\n }\n _getCanvasCache() {\n return this._cache.get(CANVAS);\n }\n _clearSelfAndDescendantCache(attr) {\n this._clearCache(attr);\n if (attr === ABSOLUTE_TRANSFORM) {\n this.fire('absoluteTransformChange');\n }\n }\n clearCache() {\n if (this._cache.has(CANVAS)) {\n const { scene, filter, hit } = this._cache.get(CANVAS);\n Util_1.Util.releaseCanvas(scene, filter, hit);\n this._cache.delete(CANVAS);\n }\n this._clearSelfAndDescendantCache();\n this._requestDraw();\n return this;\n }\n cache(config) {\n var conf = config || {};\n var rect = {};\n if (conf.x === undefined ||\n conf.y === undefined ||\n conf.width === undefined ||\n conf.height === undefined) {\n rect = this.getClientRect({\n skipTransform: true,\n relativeTo: this.getParent() || undefined,\n });\n }\n var width = Math.ceil(conf.width || rect.width), height = Math.ceil(conf.height || rect.height), pixelRatio = conf.pixelRatio, x = conf.x === undefined ? Math.floor(rect.x) : conf.x, y = conf.y === undefined ? Math.floor(rect.y) : conf.y, offset = conf.offset || 0, drawBorder = conf.drawBorder || false, hitCanvasPixelRatio = conf.hitCanvasPixelRatio || 1;\n if (!width || !height) {\n Util_1.Util.error('Can not cache the node. Width or height of the node equals 0. Caching is skipped.');\n return;\n }\n const extraPaddingX = Math.abs(Math.round(rect.x) - x) > 0.5 ? 1 : 0;\n const extraPaddingY = Math.abs(Math.round(rect.y) - y) > 0.5 ? 1 : 0;\n width += offset * 2 + extraPaddingX;\n height += offset * 2 + extraPaddingY;\n x -= offset;\n y -= offset;\n var cachedSceneCanvas = new Canvas_1.SceneCanvas({\n pixelRatio: pixelRatio,\n width: width,\n height: height,\n }), cachedFilterCanvas = new Canvas_1.SceneCanvas({\n pixelRatio: pixelRatio,\n width: 0,\n height: 0,\n willReadFrequently: true,\n }), cachedHitCanvas = new Canvas_1.HitCanvas({\n pixelRatio: hitCanvasPixelRatio,\n width: width,\n height: height,\n }), sceneContext = cachedSceneCanvas.getContext(), hitContext = cachedHitCanvas.getContext();\n cachedHitCanvas.isCache = true;\n cachedSceneCanvas.isCache = true;\n this._cache.delete(CANVAS);\n this._filterUpToDate = false;\n if (conf.imageSmoothingEnabled === false) {\n cachedSceneCanvas.getContext()._context.imageSmoothingEnabled = false;\n cachedFilterCanvas.getContext()._context.imageSmoothingEnabled = false;\n }\n sceneContext.save();\n hitContext.save();\n sceneContext.translate(-x, -y);\n hitContext.translate(-x, -y);\n this._isUnderCache = true;\n this._clearSelfAndDescendantCache(ABSOLUTE_OPACITY);\n this._clearSelfAndDescendantCache(ABSOLUTE_SCALE);\n this.drawScene(cachedSceneCanvas, this);\n this.drawHit(cachedHitCanvas, this);\n this._isUnderCache = false;\n sceneContext.restore();\n hitContext.restore();\n if (drawBorder) {\n sceneContext.save();\n sceneContext.beginPath();\n sceneContext.rect(0, 0, width, height);\n sceneContext.closePath();\n sceneContext.setAttr('strokeStyle', 'red');\n sceneContext.setAttr('lineWidth', 5);\n sceneContext.stroke();\n sceneContext.restore();\n }\n this._cache.set(CANVAS, {\n scene: cachedSceneCanvas,\n filter: cachedFilterCanvas,\n hit: cachedHitCanvas,\n x: x,\n y: y,\n });\n this._requestDraw();\n return this;\n }\n isCached() {\n return this._cache.has(CANVAS);\n }\n getClientRect(config) {\n throw new Error('abstract \"getClientRect\" method call');\n }\n _transformedRect(rect, top) {\n var points = [\n { x: rect.x, y: rect.y },\n { x: rect.x + rect.width, y: rect.y },\n { x: rect.x + rect.width, y: rect.y + rect.height },\n { x: rect.x, y: rect.y + rect.height },\n ];\n var minX = Infinity, minY = Infinity, maxX = -Infinity, maxY = -Infinity;\n var trans = this.getAbsoluteTransform(top);\n points.forEach(function (point) {\n var transformed = trans.point(point);\n if (minX === undefined) {\n minX = maxX = transformed.x;\n minY = maxY = transformed.y;\n }\n minX = Math.min(minX, transformed.x);\n minY = Math.min(minY, transformed.y);\n maxX = Math.max(maxX, transformed.x);\n maxY = Math.max(maxY, transformed.y);\n });\n return {\n x: minX,\n y: minY,\n width: maxX - minX,\n height: maxY - minY,\n };\n }\n _drawCachedSceneCanvas(context) {\n context.save();\n context._applyOpacity(this);\n context._applyGlobalCompositeOperation(this);\n const canvasCache = this._getCanvasCache();\n context.translate(canvasCache.x, canvasCache.y);\n var cacheCanvas = this._getCachedSceneCanvas();\n var ratio = cacheCanvas.pixelRatio;\n context.drawImage(cacheCanvas._canvas, 0, 0, cacheCanvas.width / ratio, cacheCanvas.height / ratio);\n context.restore();\n }\n _drawCachedHitCanvas(context) {\n var canvasCache = this._getCanvasCache(), hitCanvas = canvasCache.hit;\n context.save();\n context.translate(canvasCache.x, canvasCache.y);\n context.drawImage(hitCanvas._canvas, 0, 0, hitCanvas.width / hitCanvas.pixelRatio, hitCanvas.height / hitCanvas.pixelRatio);\n context.restore();\n }\n _getCachedSceneCanvas() {\n var filters = this.filters(), cachedCanvas = this._getCanvasCache(), sceneCanvas = cachedCanvas.scene, filterCanvas = cachedCanvas.filter, filterContext = filterCanvas.getContext(), len, imageData, n, filter;\n if (filters) {\n if (!this._filterUpToDate) {\n var ratio = sceneCanvas.pixelRatio;\n filterCanvas.setSize(sceneCanvas.width / sceneCanvas.pixelRatio, sceneCanvas.height / sceneCanvas.pixelRatio);\n try {\n len = filters.length;\n filterContext.clear();\n filterContext.drawImage(sceneCanvas._canvas, 0, 0, sceneCanvas.getWidth() / ratio, sceneCanvas.getHeight() / ratio);\n imageData = filterContext.getImageData(0, 0, filterCanvas.getWidth(), filterCanvas.getHeight());\n for (n = 0; n < len; n++) {\n filter = filters[n];\n if (typeof filter !== 'function') {\n Util_1.Util.error('Filter should be type of function, but got ' +\n typeof filter +\n ' instead. Please check correct filters');\n continue;\n }\n filter.call(this, imageData);\n filterContext.putImageData(imageData, 0, 0);\n }\n }\n catch (e) {\n Util_1.Util.error('Unable to apply filter. ' +\n e.message +\n ' This post my help you https://konvajs.org/docs/posts/Tainted_Canvas.html.');\n }\n this._filterUpToDate = true;\n }\n return filterCanvas;\n }\n return sceneCanvas;\n }\n on(evtStr, handler) {\n this._cache && this._cache.delete(ALL_LISTENERS);\n if (arguments.length === 3) {\n return this._delegate.apply(this, arguments);\n }\n var events = evtStr.split(SPACE), len = events.length, n, event, parts, baseEvent, name;\n for (n = 0; n < len; n++) {\n event = events[n];\n parts = event.split('.');\n baseEvent = parts[0];\n name = parts[1] || '';\n if (!this.eventListeners[baseEvent]) {\n this.eventListeners[baseEvent] = [];\n }\n this.eventListeners[baseEvent].push({\n name: name,\n handler: handler,\n });\n }\n return this;\n }\n off(evtStr, callback) {\n var events = (evtStr || '').split(SPACE), len = events.length, n, t, event, parts, baseEvent, name;\n this._cache && this._cache.delete(ALL_LISTENERS);\n if (!evtStr) {\n for (t in this.eventListeners) {\n this._off(t);\n }\n }\n for (n = 0; n < len; n++) {\n event = events[n];\n parts = event.split('.');\n baseEvent = parts[0];\n name = parts[1];\n if (baseEvent) {\n if (this.eventListeners[baseEvent]) {\n this._off(baseEvent, name, callback);\n }\n }\n else {\n for (t in this.eventListeners) {\n this._off(t, name, callback);\n }\n }\n }\n return this;\n }\n dispatchEvent(evt) {\n var e = {\n target: this,\n type: evt.type,\n evt: evt,\n };\n this.fire(evt.type, e);\n return this;\n }\n addEventListener(type, handler) {\n this.on(type, function (evt) {\n handler.call(this, evt.evt);\n });\n return this;\n }\n removeEventListener(type) {\n this.off(type);\n return this;\n }\n _delegate(event, selector, handler) {\n var stopNode = this;\n this.on(event, function (evt) {\n var targets = evt.target.findAncestors(selector, true, stopNode);\n for (var i = 0; i < targets.length; i++) {\n evt = Util_1.Util.cloneObject(evt);\n evt.currentTarget = targets[i];\n handler.call(targets[i], evt);\n }\n });\n }\n remove() {\n if (this.isDragging()) {\n this.stopDrag();\n }\n DragAndDrop_1.DD._dragElements.delete(this._id);\n this._remove();\n return this;\n }\n _clearCaches() {\n this._clearSelfAndDescendantCache(ABSOLUTE_TRANSFORM);\n this._clearSelfAndDescendantCache(ABSOLUTE_OPACITY);\n this._clearSelfAndDescendantCache(ABSOLUTE_SCALE);\n this._clearSelfAndDescendantCache(STAGE);\n this._clearSelfAndDescendantCache(VISIBLE);\n this._clearSelfAndDescendantCache(LISTENING);\n }\n _remove() {\n this._clearCaches();\n var parent = this.getParent();\n if (parent && parent.children) {\n parent.children.splice(this.index, 1);\n parent._setChildrenIndices();\n this.parent = null;\n }\n }\n destroy() {\n this.remove();\n this.clearCache();\n return this;\n }\n getAttr(attr) {\n var method = 'get' + Util_1.Util._capitalize(attr);\n if (Util_1.Util._isFunction(this[method])) {\n return this[method]();\n }\n return this.attrs[attr];\n }\n getAncestors() {\n var parent = this.getParent(), ancestors = [];\n while (parent) {\n ancestors.push(parent);\n parent = parent.getParent();\n }\n return ancestors;\n }\n getAttrs() {\n return (this.attrs || {});\n }\n setAttrs(config) {\n this._batchTransformChanges(() => {\n var key, method;\n if (!config) {\n return this;\n }\n for (key in config) {\n if (key === CHILDREN) {\n continue;\n }\n method = SET + Util_1.Util._capitalize(key);\n if (Util_1.Util._isFunction(this[method])) {\n this[method](config[key]);\n }\n else {\n this._setAttr(key, config[key]);\n }\n }\n });\n return this;\n }\n isListening() {\n return this._getCache(LISTENING, this._isListening);\n }\n _isListening(relativeTo) {\n const listening = this.listening();\n if (!listening) {\n return false;\n }\n const parent = this.getParent();\n if (parent && parent !== relativeTo && this !== relativeTo) {\n return parent._isListening(relativeTo);\n }\n else {\n return true;\n }\n }\n isVisible() {\n return this._getCache(VISIBLE, this._isVisible);\n }\n _isVisible(relativeTo) {\n const visible = this.visible();\n if (!visible) {\n return false;\n }\n const parent = this.getParent();\n if (parent && parent !== relativeTo && this !== relativeTo) {\n return parent._isVisible(relativeTo);\n }\n else {\n return true;\n }\n }\n shouldDrawHit(top, skipDragCheck = false) {\n if (top) {\n return this._isVisible(top) && this._isListening(top);\n }\n var layer = this.getLayer();\n var layerUnderDrag = false;\n DragAndDrop_1.DD._dragElements.forEach((elem) => {\n if (elem.dragStatus !== 'dragging') {\n return;\n }\n else if (elem.node.nodeType === 'Stage') {\n layerUnderDrag = true;\n }\n else if (elem.node.getLayer() === layer) {\n layerUnderDrag = true;\n }\n });\n var dragSkip = !skipDragCheck &&\n !Global_1.Konva.hitOnDragEnabled &&\n (layerUnderDrag || Global_1.Konva.isTransforming());\n return this.isListening() && this.isVisible() && !dragSkip;\n }\n show() {\n this.visible(true);\n return this;\n }\n hide() {\n this.visible(false);\n return this;\n }\n getZIndex() {\n return this.index || 0;\n }\n getAbsoluteZIndex() {\n var depth = this.getDepth(), that = this, index = 0, nodes, len, n, child;\n function addChildren(children) {\n nodes = [];\n len = children.length;\n for (n = 0; n < len; n++) {\n child = children[n];\n index++;\n if (child.nodeType !== SHAPE) {\n nodes = nodes.concat(child.getChildren().slice());\n }\n if (child._id === that._id) {\n n = len;\n }\n }\n if (nodes.length > 0 && nodes[0].getDepth() <= depth) {\n addChildren(nodes);\n }\n }\n const stage = this.getStage();\n if (that.nodeType !== UPPER_STAGE && stage) {\n addChildren(stage.getChildren());\n }\n return index;\n }\n getDepth() {\n var depth = 0, parent = this.parent;\n while (parent) {\n depth++;\n parent = parent.parent;\n }\n return depth;\n }\n _batchTransformChanges(func) {\n this._batchingTransformChange = true;\n func();\n this._batchingTransformChange = false;\n if (this._needClearTransformCache) {\n this._clearCache(TRANSFORM);\n this._clearSelfAndDescendantCache(ABSOLUTE_TRANSFORM);\n }\n this._needClearTransformCache = false;\n }\n setPosition(pos) {\n this._batchTransformChanges(() => {\n this.x(pos.x);\n this.y(pos.y);\n });\n return this;\n }\n getPosition() {\n return {\n x: this.x(),\n y: this.y(),\n };\n }\n getRelativePointerPosition() {\n const stage = this.getStage();\n if (!stage) {\n return null;\n }\n var pos = stage.getPointerPosition();\n if (!pos) {\n return null;\n }\n var transform = this.getAbsoluteTransform().copy();\n transform.invert();\n return transform.point(pos);\n }\n getAbsolutePosition(top) {\n let haveCachedParent = false;\n let parent = this.parent;\n while (parent) {\n if (parent.isCached()) {\n haveCachedParent = true;\n break;\n }\n parent = parent.parent;\n }\n if (haveCachedParent && !top) {\n top = true;\n }\n var absoluteMatrix = this.getAbsoluteTransform(top).getMatrix(), absoluteTransform = new Util_1.Transform(), offset = this.offset();\n absoluteTransform.m = absoluteMatrix.slice();\n absoluteTransform.translate(offset.x, offset.y);\n return absoluteTransform.getTranslation();\n }\n setAbsolutePosition(pos) {\n const { x, y, ...origTrans } = this._clearTransform();\n this.attrs.x = x;\n this.attrs.y = y;\n this._clearCache(TRANSFORM);\n var it = this._getAbsoluteTransform().copy();\n it.invert();\n it.translate(pos.x, pos.y);\n pos = {\n x: this.attrs.x + it.getTranslation().x,\n y: this.attrs.y + it.getTranslation().y,\n };\n this._setTransform(origTrans);\n this.setPosition({ x: pos.x, y: pos.y });\n this._clearCache(TRANSFORM);\n this._clearSelfAndDescendantCache(ABSOLUTE_TRANSFORM);\n return this;\n }\n _setTransform(trans) {\n var key;\n for (key in trans) {\n this.attrs[key] = trans[key];\n }\n }\n _clearTransform() {\n var trans = {\n x: this.x(),\n y: this.y(),\n rotation: this.rotation(),\n scaleX: this.scaleX(),\n scaleY: this.scaleY(),\n offsetX: this.offsetX(),\n offsetY: this.offsetY(),\n skewX: this.skewX(),\n skewY: this.skewY(),\n };\n this.attrs.x = 0;\n this.attrs.y = 0;\n this.attrs.rotation = 0;\n this.attrs.scaleX = 1;\n this.attrs.scaleY = 1;\n this.attrs.offsetX = 0;\n this.attrs.offsetY = 0;\n this.attrs.skewX = 0;\n this.attrs.skewY = 0;\n return trans;\n }\n move(change) {\n var changeX = change.x, changeY = change.y, x = this.x(), y = this.y();\n if (changeX !== undefined) {\n x += changeX;\n }\n if (changeY !== undefined) {\n y += changeY;\n }\n this.setPosition({ x: x, y: y });\n return this;\n }\n _eachAncestorReverse(func, top) {\n var family = [], parent = this.getParent(), len, n;\n if (top && top._id === this._id) {\n return;\n }\n family.unshift(this);\n while (parent && (!top || parent._id !== top._id)) {\n family.unshift(parent);\n parent = parent.parent;\n }\n len = family.length;\n for (n = 0; n < len; n++) {\n func(family[n]);\n }\n }\n rotate(theta) {\n this.rotation(this.rotation() + theta);\n return this;\n }\n moveToTop() {\n if (!this.parent) {\n Util_1.Util.warn('Node has no parent. moveToTop function is ignored.');\n return false;\n }\n var index = this.index, len = this.parent.getChildren().length;\n if (index < len - 1) {\n this.parent.children.splice(index, 1);\n this.parent.children.push(this);\n this.parent._setChildrenIndices();\n return true;\n }\n return false;\n }\n moveUp() {\n if (!this.parent) {\n Util_1.Util.warn('Node has no parent. moveUp function is ignored.');\n return false;\n }\n var index = this.index, len = this.parent.getChildren().length;\n if (index < len - 1) {\n this.parent.children.splice(index, 1);\n this.parent.children.splice(index + 1, 0, this);\n this.parent._setChildrenIndices();\n return true;\n }\n return false;\n }\n moveDown() {\n if (!this.parent) {\n Util_1.Util.warn('Node has no parent. moveDown function is ignored.');\n return false;\n }\n var index = this.index;\n if (index > 0) {\n this.parent.children.splice(index, 1);\n this.parent.children.splice(index - 1, 0, this);\n this.parent._setChildrenIndices();\n return true;\n }\n return false;\n }\n moveToBottom() {\n if (!this.parent) {\n Util_1.Util.warn('Node has no parent. moveToBottom function is ignored.');\n return false;\n }\n var index = this.index;\n if (index > 0) {\n this.parent.children.splice(index, 1);\n this.parent.children.unshift(this);\n this.parent._setChildrenIndices();\n return true;\n }\n return false;\n }\n setZIndex(zIndex) {\n if (!this.parent) {\n Util_1.Util.warn('Node has no parent. zIndex parameter is ignored.');\n return this;\n }\n if (zIndex < 0 || zIndex >= this.parent.children.length) {\n Util_1.Util.warn('Unexpected value ' +\n zIndex +\n ' for zIndex property. zIndex is just index of a node in children of its parent. Expected value is from 0 to ' +\n (this.parent.children.length - 1) +\n '.');\n }\n var index = this.index;\n this.parent.children.splice(index, 1);\n this.parent.children.splice(zIndex, 0, this);\n this.parent._setChildrenIndices();\n return this;\n }\n getAbsoluteOpacity() {\n return this._getCache(ABSOLUTE_OPACITY, this._getAbsoluteOpacity);\n }\n _getAbsoluteOpacity() {\n var absOpacity = this.opacity();\n var parent = this.getParent();\n if (parent && !parent._isUnderCache) {\n absOpacity *= parent.getAbsoluteOpacity();\n }\n return absOpacity;\n }\n moveTo(newContainer) {\n if (this.getParent() !== newContainer) {\n this._remove();\n newContainer.add(this);\n }\n return this;\n }\n toObject() {\n var attrs = this.getAttrs(), key, val, getter, defaultValue, nonPlainObject;\n const obj = {\n attrs: {},\n className: this.getClassName(),\n };\n for (key in attrs) {\n val = attrs[key];\n nonPlainObject =\n Util_1.Util.isObject(val) && !Util_1.Util._isPlainObject(val) && !Util_1.Util._isArray(val);\n if (nonPlainObject) {\n continue;\n }\n getter = typeof this[key] === 'function' && this[key];\n delete attrs[key];\n defaultValue = getter ? getter.call(this) : null;\n attrs[key] = val;\n if (defaultValue !== val) {\n obj.attrs[key] = val;\n }\n }\n return Util_1.Util._prepareToStringify(obj);\n }\n toJSON() {\n return JSON.stringify(this.toObject());\n }\n getParent() {\n return this.parent;\n }\n findAncestors(selector, includeSelf, stopNode) {\n var res = [];\n if (includeSelf && this._isMatch(selector)) {\n res.push(this);\n }\n var ancestor = this.parent;\n while (ancestor) {\n if (ancestor === stopNode) {\n return res;\n }\n if (ancestor._isMatch(selector)) {\n res.push(ancestor);\n }\n ancestor = ancestor.parent;\n }\n return res;\n }\n isAncestorOf(node) {\n return false;\n }\n findAncestor(selector, includeSelf, stopNode) {\n return this.findAncestors(selector, includeSelf, stopNode)[0];\n }\n _isMatch(selector) {\n if (!selector) {\n return false;\n }\n if (typeof selector === 'function') {\n return selector(this);\n }\n var selectorArr = selector.replace(/ /g, '').split(','), len = selectorArr.length, n, sel;\n for (n = 0; n < len; n++) {\n sel = selectorArr[n];\n if (!Util_1.Util.isValidSelector(sel)) {\n Util_1.Util.warn('Selector \"' +\n sel +\n '\" is invalid. Allowed selectors examples are \"#foo\", \".bar\" or \"Group\".');\n Util_1.Util.warn('If you have a custom shape with such className, please change it to start with upper letter like \"Triangle\".');\n Util_1.Util.warn('Konva is awesome, right?');\n }\n if (sel.charAt(0) === '#') {\n if (this.id() === sel.slice(1)) {\n return true;\n }\n }\n else if (sel.charAt(0) === '.') {\n if (this.hasName(sel.slice(1))) {\n return true;\n }\n }\n else if (this.className === sel || this.nodeType === sel) {\n return true;\n }\n }\n return false;\n }\n getLayer() {\n var parent = this.getParent();\n return parent ? parent.getLayer() : null;\n }\n getStage() {\n return this._getCache(STAGE, this._getStage);\n }\n _getStage() {\n var parent = this.getParent();\n if (parent) {\n return parent.getStage();\n }\n else {\n return null;\n }\n }\n fire(eventType, evt = {}, bubble) {\n evt.target = evt.target || this;\n if (bubble) {\n this._fireAndBubble(eventType, evt);\n }\n else {\n this._fire(eventType, evt);\n }\n return this;\n }\n getAbsoluteTransform(top) {\n if (top) {\n return this._getAbsoluteTransform(top);\n }\n else {\n return this._getCache(ABSOLUTE_TRANSFORM, this._getAbsoluteTransform);\n }\n }\n _getAbsoluteTransform(top) {\n var at;\n if (top) {\n at = new Util_1.Transform();\n this._eachAncestorReverse(function (node) {\n var transformsEnabled = node.transformsEnabled();\n if (transformsEnabled === 'all') {\n at.multiply(node.getTransform());\n }\n else if (transformsEnabled === 'position') {\n at.translate(node.x() - node.offsetX(), node.y() - node.offsetY());\n }\n }, top);\n return at;\n }\n else {\n at = this._cache.get(ABSOLUTE_TRANSFORM) || new Util_1.Transform();\n if (this.parent) {\n this.parent.getAbsoluteTransform().copyInto(at);\n }\n else {\n at.reset();\n }\n var transformsEnabled = this.transformsEnabled();\n if (transformsEnabled === 'all') {\n at.multiply(this.getTransform());\n }\n else if (transformsEnabled === 'position') {\n const x = this.attrs.x || 0;\n const y = this.attrs.y || 0;\n const offsetX = this.attrs.offsetX || 0;\n const offsetY = this.attrs.offsetY || 0;\n at.translate(x - offsetX, y - offsetY);\n }\n at.dirty = false;\n return at;\n }\n }\n getAbsoluteScale(top) {\n var parent = this;\n while (parent) {\n if (parent._isUnderCache) {\n top = parent;\n }\n parent = parent.getParent();\n }\n const transform = this.getAbsoluteTransform(top);\n const attrs = transform.decompose();\n return {\n x: attrs.scaleX,\n y: attrs.scaleY,\n };\n }\n getAbsoluteRotation() {\n return this.getAbsoluteTransform().decompose().rotation;\n }\n getTransform() {\n return this._getCache(TRANSFORM, this._getTransform);\n }\n _getTransform() {\n var _a, _b;\n var m = this._cache.get(TRANSFORM) || new Util_1.Transform();\n m.reset();\n var x = this.x(), y = this.y(), rotation = Global_1.Konva.getAngle(this.rotation()), scaleX = (_a = this.attrs.scaleX) !== null && _a !== void 0 ? _a : 1, scaleY = (_b = this.attrs.scaleY) !== null && _b !== void 0 ? _b : 1, skewX = this.attrs.skewX || 0, skewY = this.attrs.skewY || 0, offsetX = this.attrs.offsetX || 0, offsetY = this.attrs.offsetY || 0;\n if (x !== 0 || y !== 0) {\n m.translate(x, y);\n }\n if (rotation !== 0) {\n m.rotate(rotation);\n }\n if (skewX !== 0 || skewY !== 0) {\n m.skew(skewX, skewY);\n }\n if (scaleX !== 1 || scaleY !== 1) {\n m.scale(scaleX, scaleY);\n }\n if (offsetX !== 0 || offsetY !== 0) {\n m.translate(-1 * offsetX, -1 * offsetY);\n }\n m.dirty = false;\n return m;\n }\n clone(obj) {\n var attrs = Util_1.Util.cloneObject(this.attrs), key, allListeners, len, n, listener;\n for (key in obj) {\n attrs[key] = obj[key];\n }\n var node = new this.constructor(attrs);\n for (key in this.eventListeners) {\n allListeners = this.eventListeners[key];\n len = allListeners.length;\n for (n = 0; n < len; n++) {\n listener = allListeners[n];\n if (listener.name.indexOf(KONVA) < 0) {\n if (!node.eventListeners[key]) {\n node.eventListeners[key] = [];\n }\n node.eventListeners[key].push(listener);\n }\n }\n }\n return node;\n }\n _toKonvaCanvas(config) {\n config = config || {};\n var box = this.getClientRect();\n var stage = this.getStage(), x = config.x !== undefined ? config.x : Math.floor(box.x), y = config.y !== undefined ? config.y : Math.floor(box.y), pixelRatio = config.pixelRatio || 1, canvas = new Canvas_1.SceneCanvas({\n width: config.width || Math.ceil(box.width) || (stage ? stage.width() : 0),\n height: config.height ||\n Math.ceil(box.height) ||\n (stage ? stage.height() : 0),\n pixelRatio: pixelRatio,\n }), context = canvas.getContext();\n const bufferCanvas = new Canvas_1.SceneCanvas({\n width: canvas.width / canvas.pixelRatio + Math.abs(x),\n height: canvas.height / canvas.pixelRatio + Math.abs(y),\n pixelRatio: canvas.pixelRatio,\n });\n if (config.imageSmoothingEnabled === false) {\n context._context.imageSmoothingEnabled = false;\n }\n context.save();\n if (x || y) {\n context.translate(-1 * x, -1 * y);\n }\n this.drawScene(canvas, undefined, bufferCanvas);\n context.restore();\n return canvas;\n }\n toCanvas(config) {\n return this._toKonvaCanvas(config)._canvas;\n }\n toDataURL(config) {\n config = config || {};\n var mimeType = config.mimeType || null, quality = config.quality || null;\n var url = this._toKonvaCanvas(config).toDataURL(mimeType, quality);\n if (config.callback) {\n config.callback(url);\n }\n return url;\n }\n toImage(config) {\n return new Promise((resolve, reject) => {\n try {\n const callback = config === null || config === void 0 ? void 0 : config.callback;\n if (callback)\n delete config.callback;\n Util_1.Util._urlToImage(this.toDataURL(config), function (img) {\n resolve(img);\n callback === null || callback === void 0 ? void 0 : callback(img);\n });\n }\n catch (err) {\n reject(err);\n }\n });\n }\n toBlob(config) {\n return new Promise((resolve, reject) => {\n try {\n const callback = config === null || config === void 0 ? void 0 : config.callback;\n if (callback)\n delete config.callback;\n this.toCanvas(config).toBlob((blob) => {\n resolve(blob);\n callback === null || callback === void 0 ? void 0 : callback(blob);\n }, config === null || config === void 0 ? void 0 : config.mimeType, config === null || config === void 0 ? void 0 : config.quality);\n }\n catch (err) {\n reject(err);\n }\n });\n }\n setSize(size) {\n this.width(size.width);\n this.height(size.height);\n return this;\n }\n getSize() {\n return {\n width: this.width(),\n height: this.height(),\n };\n }\n getClassName() {\n return this.className || this.nodeType;\n }\n getType() {\n return this.nodeType;\n }\n getDragDistance() {\n if (this.attrs.dragDistance !== undefined) {\n return this.attrs.dragDistance;\n }\n else if (this.parent) {\n return this.parent.getDragDistance();\n }\n else {\n return Global_1.Konva.dragDistance;\n }\n }\n _off(type, name, callback) {\n var evtListeners = this.eventListeners[type], i, evtName, handler;\n for (i = 0; i < evtListeners.length; i++) {\n evtName = evtListeners[i].name;\n handler = evtListeners[i].handler;\n if ((evtName !== 'konva' || name === 'konva') &&\n (!name || evtName === name) &&\n (!callback || callback === handler)) {\n evtListeners.splice(i, 1);\n if (evtListeners.length === 0) {\n delete this.eventListeners[type];\n break;\n }\n i--;\n }\n }\n }\n _fireChangeEvent(attr, oldVal, newVal) {\n this._fire(attr + CHANGE, {\n oldVal: oldVal,\n newVal: newVal,\n });\n }\n addName(name) {\n if (!this.hasName(name)) {\n var oldName = this.name();\n var newName = oldName ? oldName + ' ' + name : name;\n this.name(newName);\n }\n return this;\n }\n hasName(name) {\n if (!name) {\n return false;\n }\n const fullName = this.name();\n if (!fullName) {\n return false;\n }\n var names = (fullName || '').split(/\\s/g);\n return names.indexOf(name) !== -1;\n }\n removeName(name) {\n var names = (this.name() || '').split(/\\s/g);\n var index = names.indexOf(name);\n if (index !== -1) {\n names.splice(index, 1);\n this.name(names.join(' '));\n }\n return this;\n }\n setAttr(attr, val) {\n var func = this[SET + Util_1.Util._capitalize(attr)];\n if (Util_1.Util._isFunction(func)) {\n func.call(this, val);\n }\n else {\n this._setAttr(attr, val);\n }\n return this;\n }\n _requestDraw() {\n if (Global_1.Konva.autoDrawEnabled) {\n const drawNode = this.getLayer() || this.getStage();\n drawNode === null || drawNode === void 0 ? void 0 : drawNode.batchDraw();\n }\n }\n _setAttr(key, val) {\n var oldVal = this.attrs[key];\n if (oldVal === val && !Util_1.Util.isObject(val)) {\n return;\n }\n if (val === undefined || val === null) {\n delete this.attrs[key];\n }\n else {\n this.attrs[key] = val;\n }\n if (this._shouldFireChangeEvents) {\n this._fireChangeEvent(key, oldVal, val);\n }\n this._requestDraw();\n }\n _setComponentAttr(key, component, val) {\n var oldVal;\n if (val !== undefined) {\n oldVal = this.attrs[key];\n if (!oldVal) {\n this.attrs[key] = this.getAttr(key);\n }\n this.attrs[key][component] = val;\n this._fireChangeEvent(key, oldVal, val);\n }\n }\n _fireAndBubble(eventType, evt, compareShape) {\n if (evt && this.nodeType === SHAPE) {\n evt.target = this;\n }\n var shouldStop = (eventType === MOUSEENTER || eventType === MOUSELEAVE) &&\n ((compareShape &&\n (this === compareShape ||\n (this.isAncestorOf && this.isAncestorOf(compareShape)))) ||\n (this.nodeType === 'Stage' && !compareShape));\n if (!shouldStop) {\n this._fire(eventType, evt);\n var stopBubble = (eventType === MOUSEENTER || eventType === MOUSELEAVE) &&\n compareShape &&\n compareShape.isAncestorOf &&\n compareShape.isAncestorOf(this) &&\n !compareShape.isAncestorOf(this.parent);\n if (((evt && !evt.cancelBubble) || !evt) &&\n this.parent &&\n this.parent.isListening() &&\n !stopBubble) {\n if (compareShape && compareShape.parent) {\n this._fireAndBubble.call(this.parent, eventType, evt, compareShape);\n }\n else {\n this._fireAndBubble.call(this.parent, eventType, evt);\n }\n }\n }\n }\n _getProtoListeners(eventType) {\n var _a, _b, _c;\n const allListeners = (_a = this._cache.get(ALL_LISTENERS)) !== null && _a !== void 0 ? _a : {};\n let events = allListeners === null || allListeners === void 0 ? void 0 : allListeners[eventType];\n if (events === undefined) {\n events = [];\n let obj = Object.getPrototypeOf(this);\n while (obj) {\n const hierarchyEvents = (_c = (_b = obj.eventListeners) === null || _b === void 0 ? void 0 : _b[eventType]) !== null && _c !== void 0 ? _c : [];\n events.push(...hierarchyEvents);\n obj = Object.getPrototypeOf(obj);\n }\n allListeners[eventType] = events;\n this._cache.set(ALL_LISTENERS, allListeners);\n }\n return events;\n }\n _fire(eventType, evt) {\n evt = evt || {};\n evt.currentTarget = this;\n evt.type = eventType;\n const topListeners = this._getProtoListeners(eventType);\n if (topListeners) {\n for (var i = 0; i < topListeners.length; i++) {\n topListeners[i].handler.call(this, evt);\n }\n }\n const selfListeners = this.eventListeners[eventType];\n if (selfListeners) {\n for (var i = 0; i < selfListeners.length; i++) {\n selfListeners[i].handler.call(this, evt);\n }\n }\n }\n draw() {\n this.drawScene();\n this.drawHit();\n return this;\n }\n _createDragElement(evt) {\n var pointerId = evt ? evt.pointerId : undefined;\n var stage = this.getStage();\n var ap = this.getAbsolutePosition();\n if (!stage) {\n return;\n }\n var pos = stage._getPointerById(pointerId) ||\n stage._changedPointerPositions[0] ||\n ap;\n DragAndDrop_1.DD._dragElements.set(this._id, {\n node: this,\n startPointerPos: pos,\n offset: {\n x: pos.x - ap.x,\n y: pos.y - ap.y,\n },\n dragStatus: 'ready',\n pointerId,\n });\n }\n startDrag(evt, bubbleEvent = true) {\n if (!DragAndDrop_1.DD._dragElements.has(this._id)) {\n this._createDragElement(evt);\n }\n const elem = DragAndDrop_1.DD._dragElements.get(this._id);\n elem.dragStatus = 'dragging';\n this.fire('dragstart', {\n type: 'dragstart',\n target: this,\n evt: evt && evt.evt,\n }, bubbleEvent);\n }\n _setDragPosition(evt, elem) {\n const pos = this.getStage()._getPointerById(elem.pointerId);\n if (!pos) {\n return;\n }\n var newNodePos = {\n x: pos.x - elem.offset.x,\n y: pos.y - elem.offset.y,\n };\n var dbf = this.dragBoundFunc();\n if (dbf !== undefined) {\n const bounded = dbf.call(this, newNodePos, evt);\n if (!bounded) {\n Util_1.Util.warn('dragBoundFunc did not return any value. That is unexpected behavior. You must return new absolute position from dragBoundFunc.');\n }\n else {\n newNodePos = bounded;\n }\n }\n if (!this._lastPos ||\n this._lastPos.x !== newNodePos.x ||\n this._lastPos.y !== newNodePos.y) {\n this.setAbsolutePosition(newNodePos);\n this._requestDraw();\n }\n this._lastPos = newNodePos;\n }\n stopDrag(evt) {\n const elem = DragAndDrop_1.DD._dragElements.get(this._id);\n if (elem) {\n elem.dragStatus = 'stopped';\n }\n DragAndDrop_1.DD._endDragBefore(evt);\n DragAndDrop_1.DD._endDragAfter(evt);\n }\n setDraggable(draggable) {\n this._setAttr('draggable', draggable);\n this._dragChange();\n }\n isDragging() {\n const elem = DragAndDrop_1.DD._dragElements.get(this._id);\n return elem ? elem.dragStatus === 'dragging' : false;\n }\n _listenDrag() {\n this._dragCleanup();\n this.on('mousedown.konva touchstart.konva', function (evt) {\n var shouldCheckButton = evt.evt['button'] !== undefined;\n var canDrag = !shouldCheckButton || Global_1.Konva.dragButtons.indexOf(evt.evt['button']) >= 0;\n if (!canDrag) {\n return;\n }\n if (this.isDragging()) {\n return;\n }\n var hasDraggingChild = false;\n DragAndDrop_1.DD._dragElements.forEach((elem) => {\n if (this.isAncestorOf(elem.node)) {\n hasDraggingChild = true;\n }\n });\n if (!hasDraggingChild) {\n this._createDragElement(evt);\n }\n });\n }\n _dragChange() {\n if (this.attrs.draggable) {\n this._listenDrag();\n }\n else {\n this._dragCleanup();\n var stage = this.getStage();\n if (!stage) {\n return;\n }\n const dragElement = DragAndDrop_1.DD._dragElements.get(this._id);\n const isDragging = dragElement && dragElement.dragStatus === 'dragging';\n const isReady = dragElement && dragElement.dragStatus === 'ready';\n if (isDragging) {\n this.stopDrag();\n }\n else if (isReady) {\n DragAndDrop_1.DD._dragElements.delete(this._id);\n }\n }\n }\n _dragCleanup() {\n this.off('mousedown.konva');\n this.off('touchstart.konva');\n }\n isClientRectOnScreen(margin = { x: 0, y: 0 }) {\n const stage = this.getStage();\n if (!stage) {\n return false;\n }\n const screenRect = {\n x: -margin.x,\n y: -margin.y,\n width: stage.width() + 2 * margin.x,\n height: stage.height() + 2 * margin.y,\n };\n return Util_1.Util.haveIntersection(screenRect, this.getClientRect());\n }\n static create(data, container) {\n if (Util_1.Util._isString(data)) {\n data = JSON.parse(data);\n }\n return this._createNode(data, container);\n }\n static _createNode(obj, container) {\n var className = Node.prototype.getClassName.call(obj), children = obj.children, no, len, n;\n if (container) {\n obj.attrs.container = container;\n }\n if (!Global_1.Konva[className]) {\n Util_1.Util.warn('Can not find a node with class name \"' +\n className +\n '\". Fallback to \"Shape\".');\n className = 'Shape';\n }\n const Class = Global_1.Konva[className];\n no = new Class(obj.attrs);\n if (children) {\n len = children.length;\n for (n = 0; n < len; n++) {\n no.add(Node._createNode(children[n]));\n }\n }\n return no;\n }\n}\nexports.Node = Node;\nNode.prototype.nodeType = 'Node';\nNode.prototype._attrsAffectingSize = [];\nNode.prototype.eventListeners = {};\nNode.prototype.on.call(Node.prototype, TRANSFORM_CHANGE_STR, function () {\n if (this._batchingTransformChange) {\n this._needClearTransformCache = true;\n return;\n }\n this._clearCache(TRANSFORM);\n this._clearSelfAndDescendantCache(ABSOLUTE_TRANSFORM);\n});\nNode.prototype.on.call(Node.prototype, 'visibleChange.konva', function () {\n this._clearSelfAndDescendantCache(VISIBLE);\n});\nNode.prototype.on.call(Node.prototype, 'listeningChange.konva', function () {\n this._clearSelfAndDescendantCache(LISTENING);\n});\nNode.prototype.on.call(Node.prototype, 'opacityChange.konva', function () {\n this._clearSelfAndDescendantCache(ABSOLUTE_OPACITY);\n});\nconst addGetterSetter = Factory_1.Factory.addGetterSetter;\naddGetterSetter(Node, 'zIndex');\naddGetterSetter(Node, 'absolutePosition');\naddGetterSetter(Node, 'position');\naddGetterSetter(Node, 'x', 0, (0, Validators_1.getNumberValidator)());\naddGetterSetter(Node, 'y', 0, (0, Validators_1.getNumberValidator)());\naddGetterSetter(Node, 'globalCompositeOperation', 'source-over', (0, Validators_1.getStringValidator)());\naddGetterSetter(Node, 'opacity', 1, (0, Validators_1.getNumberValidator)());\naddGetterSetter(Node, 'name', '', (0, Validators_1.getStringValidator)());\naddGetterSetter(Node, 'id', '', (0, Validators_1.getStringValidator)());\naddGetterSetter(Node, 'rotation', 0, (0, Validators_1.getNumberValidator)());\nFactory_1.Factory.addComponentsGetterSetter(Node, 'scale', ['x', 'y']);\naddGetterSetter(Node, 'scaleX', 1, (0, Validators_1.getNumberValidator)());\naddGetterSetter(Node, 'scaleY', 1, (0, Validators_1.getNumberValidator)());\nFactory_1.Factory.addComponentsGetterSetter(Node, 'skew', ['x', 'y']);\naddGetterSetter(Node, 'skewX', 0, (0, Validators_1.getNumberValidator)());\naddGetterSetter(Node, 'skewY', 0, (0, Validators_1.getNumberValidator)());\nFactory_1.Factory.addComponentsGetterSetter(Node, 'offset', ['x', 'y']);\naddGetterSetter(Node, 'offsetX', 0, (0, Validators_1.getNumberValidator)());\naddGetterSetter(Node, 'offsetY', 0, (0, Validators_1.getNumberValidator)());\naddGetterSetter(Node, 'dragDistance', null, (0, Validators_1.getNumberValidator)());\naddGetterSetter(Node, 'width', 0, (0, Validators_1.getNumberValidator)());\naddGetterSetter(Node, 'height', 0, (0, Validators_1.getNumberValidator)());\naddGetterSetter(Node, 'listening', true, (0, Validators_1.getBooleanValidator)());\naddGetterSetter(Node, 'preventDefault', true, (0, Validators_1.getBooleanValidator)());\naddGetterSetter(Node, 'filters', null, function (val) {\n this._filterUpToDate = false;\n return val;\n});\naddGetterSetter(Node, 'visible', true, (0, Validators_1.getBooleanValidator)());\naddGetterSetter(Node, 'transformsEnabled', 'all', (0, Validators_1.getStringValidator)());\naddGetterSetter(Node, 'size');\naddGetterSetter(Node, 'dragBoundFunc');\naddGetterSetter(Node, 'draggable', false, (0, Validators_1.getBooleanValidator)());\nFactory_1.Factory.backCompat(Node, {\n rotateDeg: 'rotate',\n setRotationDeg: 'setRotation',\n getRotationDeg: 'getRotation',\n});\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Container = void 0;\nconst Factory_1 = require(\"./Factory\");\nconst Node_1 = require(\"./Node\");\nconst Validators_1 = require(\"./Validators\");\nclass Container extends Node_1.Node {\n constructor() {\n super(...arguments);\n this.children = [];\n }\n getChildren(filterFunc) {\n if (!filterFunc) {\n return this.children || [];\n }\n const children = this.children || [];\n var results = [];\n children.forEach(function (child) {\n if (filterFunc(child)) {\n results.push(child);\n }\n });\n return results;\n }\n hasChildren() {\n return this.getChildren().length > 0;\n }\n removeChildren() {\n this.getChildren().forEach((child) => {\n child.parent = null;\n child.index = 0;\n child.remove();\n });\n this.children = [];\n this._requestDraw();\n return this;\n }\n destroyChildren() {\n this.getChildren().forEach((child) => {\n child.parent = null;\n child.index = 0;\n child.destroy();\n });\n this.children = [];\n this._requestDraw();\n return this;\n }\n add(...children) {\n if (children.length === 0) {\n return this;\n }\n if (children.length > 1) {\n for (var i = 0; i < children.length; i++) {\n this.add(children[i]);\n }\n return this;\n }\n const child = children[0];\n if (child.getParent()) {\n child.moveTo(this);\n return this;\n }\n this._validateAdd(child);\n child.index = this.getChildren().length;\n child.parent = this;\n child._clearCaches();\n this.getChildren().push(child);\n this._fire('add', {\n child: child,\n });\n this._requestDraw();\n return this;\n }\n destroy() {\n if (this.hasChildren()) {\n this.destroyChildren();\n }\n super.destroy();\n return this;\n }\n find(selector) {\n return this._generalFind(selector, false);\n }\n findOne(selector) {\n var result = this._generalFind(selector, true);\n return result.length > 0 ? result[0] : undefined;\n }\n _generalFind(selector, findOne) {\n var retArr = [];\n this._descendants((node) => {\n const valid = node._isMatch(selector);\n if (valid) {\n retArr.push(node);\n }\n if (valid && findOne) {\n return true;\n }\n return false;\n });\n return retArr;\n }\n _descendants(fn) {\n let shouldStop = false;\n const children = this.getChildren();\n for (const child of children) {\n shouldStop = fn(child);\n if (shouldStop) {\n return true;\n }\n if (!child.hasChildren()) {\n continue;\n }\n shouldStop = child._descendants(fn);\n if (shouldStop) {\n return true;\n }\n }\n return false;\n }\n toObject() {\n var obj = Node_1.Node.prototype.toObject.call(this);\n obj.children = [];\n this.getChildren().forEach((child) => {\n obj.children.push(child.toObject());\n });\n return obj;\n }\n isAncestorOf(node) {\n var parent = node.getParent();\n while (parent) {\n if (parent._id === this._id) {\n return true;\n }\n parent = parent.getParent();\n }\n return false;\n }\n clone(obj) {\n var node = Node_1.Node.prototype.clone.call(this, obj);\n this.getChildren().forEach(function (no) {\n node.add(no.clone());\n });\n return node;\n }\n getAllIntersections(pos) {\n var arr = [];\n this.find('Shape').forEach((shape) => {\n if (shape.isVisible() && shape.intersects(pos)) {\n arr.push(shape);\n }\n });\n return arr;\n }\n _clearSelfAndDescendantCache(attr) {\n var _a;\n super._clearSelfAndDescendantCache(attr);\n if (this.isCached()) {\n return;\n }\n (_a = this.children) === null || _a === void 0 ? void 0 : _a.forEach(function (node) {\n node._clearSelfAndDescendantCache(attr);\n });\n }\n _setChildrenIndices() {\n var _a;\n (_a = this.children) === null || _a === void 0 ? void 0 : _a.forEach(function (child, n) {\n child.index = n;\n });\n this._requestDraw();\n }\n drawScene(can, top, bufferCanvas) {\n var layer = this.getLayer(), canvas = can || (layer && layer.getCanvas()), context = canvas && canvas.getContext(), cachedCanvas = this._getCanvasCache(), cachedSceneCanvas = cachedCanvas && cachedCanvas.scene;\n var caching = canvas && canvas.isCache;\n if (!this.isVisible() && !caching) {\n return this;\n }\n if (cachedSceneCanvas) {\n context.save();\n var m = this.getAbsoluteTransform(top).getMatrix();\n context.transform(m[0], m[1], m[2], m[3], m[4], m[5]);\n this._drawCachedSceneCanvas(context);\n context.restore();\n }\n else {\n this._drawChildren('drawScene', canvas, top, bufferCanvas);\n }\n return this;\n }\n drawHit(can, top) {\n if (!this.shouldDrawHit(top)) {\n return this;\n }\n var layer = this.getLayer(), canvas = can || (layer && layer.hitCanvas), context = canvas && canvas.getContext(), cachedCanvas = this._getCanvasCache(), cachedHitCanvas = cachedCanvas && cachedCanvas.hit;\n if (cachedHitCanvas) {\n context.save();\n var m = this.getAbsoluteTransform(top).getMatrix();\n context.transform(m[0], m[1], m[2], m[3], m[4], m[5]);\n this._drawCachedHitCanvas(context);\n context.restore();\n }\n else {\n this._drawChildren('drawHit', canvas, top);\n }\n return this;\n }\n _drawChildren(drawMethod, canvas, top, bufferCanvas) {\n var _a;\n var context = canvas && canvas.getContext(), clipWidth = this.clipWidth(), clipHeight = this.clipHeight(), clipFunc = this.clipFunc(), hasClip = (typeof clipWidth === 'number' && typeof clipHeight === 'number') ||\n clipFunc;\n const selfCache = top === this;\n if (hasClip) {\n context.save();\n var transform = this.getAbsoluteTransform(top);\n var m = transform.getMatrix();\n context.transform(m[0], m[1], m[2], m[3], m[4], m[5]);\n context.beginPath();\n let clipArgs;\n if (clipFunc) {\n clipArgs = clipFunc.call(this, context, this);\n }\n else {\n var clipX = this.clipX();\n var clipY = this.clipY();\n context.rect(clipX || 0, clipY || 0, clipWidth, clipHeight);\n }\n context.clip.apply(context, clipArgs);\n m = transform.copy().invert().getMatrix();\n context.transform(m[0], m[1], m[2], m[3], m[4], m[5]);\n }\n var hasComposition = !selfCache &&\n this.globalCompositeOperation() !== 'source-over' &&\n drawMethod === 'drawScene';\n if (hasComposition) {\n context.save();\n context._applyGlobalCompositeOperation(this);\n }\n (_a = this.children) === null || _a === void 0 ? void 0 : _a.forEach(function (child) {\n child[drawMethod](canvas, top, bufferCanvas);\n });\n if (hasComposition) {\n context.restore();\n }\n if (hasClip) {\n context.restore();\n }\n }\n getClientRect(config = {}) {\n var _a;\n var skipTransform = config.skipTransform;\n var relativeTo = config.relativeTo;\n var minX, minY, maxX, maxY;\n var selfRect = {\n x: Infinity,\n y: Infinity,\n width: 0,\n height: 0,\n };\n var that = this;\n (_a = this.children) === null || _a === void 0 ? void 0 : _a.forEach(function (child) {\n if (!child.visible()) {\n return;\n }\n var rect = child.getClientRect({\n relativeTo: that,\n skipShadow: config.skipShadow,\n skipStroke: config.skipStroke,\n });\n if (rect.width === 0 && rect.height === 0) {\n return;\n }\n if (minX === undefined) {\n minX = rect.x;\n minY = rect.y;\n maxX = rect.x + rect.width;\n maxY = rect.y + rect.height;\n }\n else {\n minX = Math.min(minX, rect.x);\n minY = Math.min(minY, rect.y);\n maxX = Math.max(maxX, rect.x + rect.width);\n maxY = Math.max(maxY, rect.y + rect.height);\n }\n });\n var shapes = this.find('Shape');\n var hasVisible = false;\n for (var i = 0; i < shapes.length; i++) {\n var shape = shapes[i];\n if (shape._isVisible(this)) {\n hasVisible = true;\n break;\n }\n }\n if (hasVisible && minX !== undefined) {\n selfRect = {\n x: minX,\n y: minY,\n width: maxX - minX,\n height: maxY - minY,\n };\n }\n else {\n selfRect = {\n x: 0,\n y: 0,\n width: 0,\n height: 0,\n };\n }\n if (!skipTransform) {\n return this._transformedRect(selfRect, relativeTo);\n }\n return selfRect;\n }\n}\nexports.Container = Container;\nFactory_1.Factory.addComponentsGetterSetter(Container, 'clip', [\n 'x',\n 'y',\n 'width',\n 'height',\n]);\nFactory_1.Factory.addGetterSetter(Container, 'clipX', undefined, (0, Validators_1.getNumberValidator)());\nFactory_1.Factory.addGetterSetter(Container, 'clipY', undefined, (0, Validators_1.getNumberValidator)());\nFactory_1.Factory.addGetterSetter(Container, 'clipWidth', undefined, (0, Validators_1.getNumberValidator)());\nFactory_1.Factory.addGetterSetter(Container, 'clipHeight', undefined, (0, Validators_1.getNumberValidator)());\nFactory_1.Factory.addGetterSetter(Container, 'clipFunc');\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.releaseCapture = exports.setPointerCapture = exports.hasPointerCapture = exports.createEvent = exports.getCapturedShape = void 0;\nconst Global_1 = require(\"./Global\");\nconst Captures = new Map();\nconst SUPPORT_POINTER_EVENTS = Global_1.Konva._global['PointerEvent'] !== undefined;\nfunction getCapturedShape(pointerId) {\n return Captures.get(pointerId);\n}\nexports.getCapturedShape = getCapturedShape;\nfunction createEvent(evt) {\n return {\n evt,\n pointerId: evt.pointerId,\n };\n}\nexports.createEvent = createEvent;\nfunction hasPointerCapture(pointerId, shape) {\n return Captures.get(pointerId) === shape;\n}\nexports.hasPointerCapture = hasPointerCapture;\nfunction setPointerCapture(pointerId, shape) {\n releaseCapture(pointerId);\n const stage = shape.getStage();\n if (!stage)\n return;\n Captures.set(pointerId, shape);\n if (SUPPORT_POINTER_EVENTS) {\n shape._fire('gotpointercapture', createEvent(new PointerEvent('gotpointercapture')));\n }\n}\nexports.setPointerCapture = setPointerCapture;\nfunction releaseCapture(pointerId, target) {\n const shape = Captures.get(pointerId);\n if (!shape)\n return;\n const stage = shape.getStage();\n if (stage && stage.content) {\n }\n Captures.delete(pointerId);\n if (SUPPORT_POINTER_EVENTS) {\n shape._fire('lostpointercapture', createEvent(new PointerEvent('lostpointercapture')));\n }\n}\nexports.releaseCapture = releaseCapture;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Stage = exports.stages = void 0;\nconst Util_1 = require(\"./Util\");\nconst Factory_1 = require(\"./Factory\");\nconst Container_1 = require(\"./Container\");\nconst Global_1 = require(\"./Global\");\nconst Canvas_1 = require(\"./Canvas\");\nconst DragAndDrop_1 = require(\"./DragAndDrop\");\nconst Global_2 = require(\"./Global\");\nconst PointerEvents = require(\"./PointerEvents\");\nvar STAGE = 'Stage', STRING = 'string', PX = 'px', MOUSEOUT = 'mouseout', MOUSELEAVE = 'mouseleave', MOUSEOVER = 'mouseover', MOUSEENTER = 'mouseenter', MOUSEMOVE = 'mousemove', MOUSEDOWN = 'mousedown', MOUSEUP = 'mouseup', POINTERMOVE = 'pointermove', POINTERDOWN = 'pointerdown', POINTERUP = 'pointerup', POINTERCANCEL = 'pointercancel', LOSTPOINTERCAPTURE = 'lostpointercapture', POINTEROUT = 'pointerout', POINTERLEAVE = 'pointerleave', POINTEROVER = 'pointerover', POINTERENTER = 'pointerenter', CONTEXTMENU = 'contextmenu', TOUCHSTART = 'touchstart', TOUCHEND = 'touchend', TOUCHMOVE = 'touchmove', TOUCHCANCEL = 'touchcancel', WHEEL = 'wheel', MAX_LAYERS_NUMBER = 5, EVENTS = [\n [MOUSEENTER, '_pointerenter'],\n [MOUSEDOWN, '_pointerdown'],\n [MOUSEMOVE, '_pointermove'],\n [MOUSEUP, '_pointerup'],\n [MOUSELEAVE, '_pointerleave'],\n [TOUCHSTART, '_pointerdown'],\n [TOUCHMOVE, '_pointermove'],\n [TOUCHEND, '_pointerup'],\n [TOUCHCANCEL, '_pointercancel'],\n [MOUSEOVER, '_pointerover'],\n [WHEEL, '_wheel'],\n [CONTEXTMENU, '_contextmenu'],\n [POINTERDOWN, '_pointerdown'],\n [POINTERMOVE, '_pointermove'],\n [POINTERUP, '_pointerup'],\n [POINTERCANCEL, '_pointercancel'],\n [LOSTPOINTERCAPTURE, '_lostpointercapture'],\n];\nconst EVENTS_MAP = {\n mouse: {\n [POINTEROUT]: MOUSEOUT,\n [POINTERLEAVE]: MOUSELEAVE,\n [POINTEROVER]: MOUSEOVER,\n [POINTERENTER]: MOUSEENTER,\n [POINTERMOVE]: MOUSEMOVE,\n [POINTERDOWN]: MOUSEDOWN,\n [POINTERUP]: MOUSEUP,\n [POINTERCANCEL]: 'mousecancel',\n pointerclick: 'click',\n pointerdblclick: 'dblclick',\n },\n touch: {\n [POINTEROUT]: 'touchout',\n [POINTERLEAVE]: 'touchleave',\n [POINTEROVER]: 'touchover',\n [POINTERENTER]: 'touchenter',\n [POINTERMOVE]: TOUCHMOVE,\n [POINTERDOWN]: TOUCHSTART,\n [POINTERUP]: TOUCHEND,\n [POINTERCANCEL]: TOUCHCANCEL,\n pointerclick: 'tap',\n pointerdblclick: 'dbltap',\n },\n pointer: {\n [POINTEROUT]: POINTEROUT,\n [POINTERLEAVE]: POINTERLEAVE,\n [POINTEROVER]: POINTEROVER,\n [POINTERENTER]: POINTERENTER,\n [POINTERMOVE]: POINTERMOVE,\n [POINTERDOWN]: POINTERDOWN,\n [POINTERUP]: POINTERUP,\n [POINTERCANCEL]: POINTERCANCEL,\n pointerclick: 'pointerclick',\n pointerdblclick: 'pointerdblclick',\n },\n};\nconst getEventType = (type) => {\n if (type.indexOf('pointer') >= 0) {\n return 'pointer';\n }\n if (type.indexOf('touch') >= 0) {\n return 'touch';\n }\n return 'mouse';\n};\nconst getEventsMap = (eventType) => {\n const type = getEventType(eventType);\n if (type === 'pointer') {\n return Global_1.Konva.pointerEventsEnabled && EVENTS_MAP.pointer;\n }\n if (type === 'touch') {\n return EVENTS_MAP.touch;\n }\n if (type === 'mouse') {\n return EVENTS_MAP.mouse;\n }\n};\nfunction checkNoClip(attrs = {}) {\n if (attrs.clipFunc || attrs.clipWidth || attrs.clipHeight) {\n Util_1.Util.warn('Stage does not support clipping. Please use clip for Layers or Groups.');\n }\n return attrs;\n}\nconst NO_POINTERS_MESSAGE = `Pointer position is missing and not registered by the stage. Looks like it is outside of the stage container. You can set it manually from event: stage.setPointersPositions(event);`;\nexports.stages = [];\nclass Stage extends Container_1.Container {\n constructor(config) {\n super(checkNoClip(config));\n this._pointerPositions = [];\n this._changedPointerPositions = [];\n this._buildDOM();\n this._bindContentEvents();\n exports.stages.push(this);\n this.on('widthChange.konva heightChange.konva', this._resizeDOM);\n this.on('visibleChange.konva', this._checkVisibility);\n this.on('clipWidthChange.konva clipHeightChange.konva clipFuncChange.konva', () => {\n checkNoClip(this.attrs);\n });\n this._checkVisibility();\n }\n _validateAdd(child) {\n const isLayer = child.getType() === 'Layer';\n const isFastLayer = child.getType() === 'FastLayer';\n const valid = isLayer || isFastLayer;\n if (!valid) {\n Util_1.Util.throw('You may only add layers to the stage.');\n }\n }\n _checkVisibility() {\n if (!this.content) {\n return;\n }\n const style = this.visible() ? '' : 'none';\n this.content.style.display = style;\n }\n setContainer(container) {\n if (typeof container === STRING) {\n if (container.charAt(0) === '.') {\n var className = container.slice(1);\n container = document.getElementsByClassName(className)[0];\n }\n else {\n var id;\n if (container.charAt(0) !== '#') {\n id = container;\n }\n else {\n id = container.slice(1);\n }\n container = document.getElementById(id);\n }\n if (!container) {\n throw 'Can not find container in document with id ' + id;\n }\n }\n this._setAttr('container', container);\n if (this.content) {\n if (this.content.parentElement) {\n this.content.parentElement.removeChild(this.content);\n }\n container.appendChild(this.content);\n }\n return this;\n }\n shouldDrawHit() {\n return true;\n }\n clear() {\n var layers = this.children, len = layers.length, n;\n for (n = 0; n < len; n++) {\n layers[n].clear();\n }\n return this;\n }\n clone(obj) {\n if (!obj) {\n obj = {};\n }\n obj.container =\n typeof document !== 'undefined' && document.createElement('div');\n return Container_1.Container.prototype.clone.call(this, obj);\n }\n destroy() {\n super.destroy();\n var content = this.content;\n if (content && Util_1.Util._isInDocument(content)) {\n this.container().removeChild(content);\n }\n var index = exports.stages.indexOf(this);\n if (index > -1) {\n exports.stages.splice(index, 1);\n }\n Util_1.Util.releaseCanvas(this.bufferCanvas._canvas, this.bufferHitCanvas._canvas);\n return this;\n }\n getPointerPosition() {\n const pos = this._pointerPositions[0] || this._changedPointerPositions[0];\n if (!pos) {\n Util_1.Util.warn(NO_POINTERS_MESSAGE);\n return null;\n }\n return {\n x: pos.x,\n y: pos.y,\n };\n }\n _getPointerById(id) {\n return this._pointerPositions.find((p) => p.id === id);\n }\n getPointersPositions() {\n return this._pointerPositions;\n }\n getStage() {\n return this;\n }\n getContent() {\n return this.content;\n }\n _toKonvaCanvas(config) {\n config = config || {};\n config.x = config.x || 0;\n config.y = config.y || 0;\n config.width = config.width || this.width();\n config.height = config.height || this.height();\n var canvas = new Canvas_1.SceneCanvas({\n width: config.width,\n height: config.height,\n pixelRatio: config.pixelRatio || 1,\n });\n var _context = canvas.getContext()._context;\n var layers = this.children;\n if (config.x || config.y) {\n _context.translate(-1 * config.x, -1 * config.y);\n }\n layers.forEach(function (layer) {\n if (!layer.isVisible()) {\n return;\n }\n var layerCanvas = layer._toKonvaCanvas(config);\n _context.drawImage(layerCanvas._canvas, config.x, config.y, layerCanvas.getWidth() / layerCanvas.getPixelRatio(), layerCanvas.getHeight() / layerCanvas.getPixelRatio());\n });\n return canvas;\n }\n getIntersection(pos) {\n if (!pos) {\n return null;\n }\n var layers = this.children, len = layers.length, end = len - 1, n;\n for (n = end; n >= 0; n--) {\n const shape = layers[n].getIntersection(pos);\n if (shape) {\n return shape;\n }\n }\n return null;\n }\n _resizeDOM() {\n var width = this.width();\n var height = this.height();\n if (this.content) {\n this.content.style.width = width + PX;\n this.content.style.height = height + PX;\n }\n this.bufferCanvas.setSize(width, height);\n this.bufferHitCanvas.setSize(width, height);\n this.children.forEach((layer) => {\n layer.setSize({ width, height });\n layer.draw();\n });\n }\n add(layer, ...rest) {\n if (arguments.length > 1) {\n for (var i = 0; i < arguments.length; i++) {\n this.add(arguments[i]);\n }\n return this;\n }\n super.add(layer);\n var length = this.children.length;\n if (length > MAX_LAYERS_NUMBER) {\n Util_1.Util.warn('The stage has ' +\n length +\n ' layers. Recommended maximum number of layers is 3-5. Adding more layers into the stage may drop the performance. Rethink your tree structure, you can use Konva.Group.');\n }\n layer.setSize({ width: this.width(), height: this.height() });\n layer.draw();\n if (Global_1.Konva.isBrowser) {\n this.content.appendChild(layer.canvas._canvas);\n }\n return this;\n }\n getParent() {\n return null;\n }\n getLayer() {\n return null;\n }\n hasPointerCapture(pointerId) {\n return PointerEvents.hasPointerCapture(pointerId, this);\n }\n setPointerCapture(pointerId) {\n PointerEvents.setPointerCapture(pointerId, this);\n }\n releaseCapture(pointerId) {\n PointerEvents.releaseCapture(pointerId, this);\n }\n getLayers() {\n return this.children;\n }\n _bindContentEvents() {\n if (!Global_1.Konva.isBrowser) {\n return;\n }\n EVENTS.forEach(([event, methodName]) => {\n this.content.addEventListener(event, (evt) => {\n this[methodName](evt);\n }, { passive: false });\n });\n }\n _pointerenter(evt) {\n this.setPointersPositions(evt);\n const events = getEventsMap(evt.type);\n if (events) {\n this._fire(events.pointerenter, {\n evt: evt,\n target: this,\n currentTarget: this,\n });\n }\n }\n _pointerover(evt) {\n this.setPointersPositions(evt);\n const events = getEventsMap(evt.type);\n if (events) {\n this._fire(events.pointerover, {\n evt: evt,\n target: this,\n currentTarget: this,\n });\n }\n }\n _getTargetShape(evenType) {\n let shape = this[evenType + 'targetShape'];\n if (shape && !shape.getStage()) {\n shape = null;\n }\n return shape;\n }\n _pointerleave(evt) {\n const events = getEventsMap(evt.type);\n const eventType = getEventType(evt.type);\n if (!events) {\n return;\n }\n this.setPointersPositions(evt);\n var targetShape = this._getTargetShape(eventType);\n var eventsEnabled = !(Global_1.Konva.isDragging() || Global_1.Konva.isTransforming()) || Global_1.Konva.hitOnDragEnabled;\n if (targetShape && eventsEnabled) {\n targetShape._fireAndBubble(events.pointerout, { evt: evt });\n targetShape._fireAndBubble(events.pointerleave, { evt: evt });\n this._fire(events.pointerleave, {\n evt: evt,\n target: this,\n currentTarget: this,\n });\n this[eventType + 'targetShape'] = null;\n }\n else if (eventsEnabled) {\n this._fire(events.pointerleave, {\n evt: evt,\n target: this,\n currentTarget: this,\n });\n this._fire(events.pointerout, {\n evt: evt,\n target: this,\n currentTarget: this,\n });\n }\n this.pointerPos = null;\n this._pointerPositions = [];\n }\n _pointerdown(evt) {\n const events = getEventsMap(evt.type);\n const eventType = getEventType(evt.type);\n if (!events) {\n return;\n }\n this.setPointersPositions(evt);\n var triggeredOnShape = false;\n this._changedPointerPositions.forEach((pos) => {\n var shape = this.getIntersection(pos);\n DragAndDrop_1.DD.justDragged = false;\n Global_1.Konva['_' + eventType + 'ListenClick'] = true;\n if (!shape || !shape.isListening()) {\n return;\n }\n if (Global_1.Konva.capturePointerEventsEnabled) {\n shape.setPointerCapture(pos.id);\n }\n this[eventType + 'ClickStartShape'] = shape;\n shape._fireAndBubble(events.pointerdown, {\n evt: evt,\n pointerId: pos.id,\n });\n triggeredOnShape = true;\n const isTouch = evt.type.indexOf('touch') >= 0;\n if (shape.preventDefault() && evt.cancelable && isTouch) {\n evt.preventDefault();\n }\n });\n if (!triggeredOnShape) {\n this._fire(events.pointerdown, {\n evt: evt,\n target: this,\n currentTarget: this,\n pointerId: this._pointerPositions[0].id,\n });\n }\n }\n _pointermove(evt) {\n const events = getEventsMap(evt.type);\n const eventType = getEventType(evt.type);\n if (!events) {\n return;\n }\n if (Global_1.Konva.isDragging() && DragAndDrop_1.DD.node.preventDefault() && evt.cancelable) {\n evt.preventDefault();\n }\n this.setPointersPositions(evt);\n var eventsEnabled = !(Global_1.Konva.isDragging() || Global_1.Konva.isTransforming()) || Global_1.Konva.hitOnDragEnabled;\n if (!eventsEnabled) {\n return;\n }\n var processedShapesIds = {};\n let triggeredOnShape = false;\n var targetShape = this._getTargetShape(eventType);\n this._changedPointerPositions.forEach((pos) => {\n const shape = (PointerEvents.getCapturedShape(pos.id) ||\n this.getIntersection(pos));\n const pointerId = pos.id;\n const event = { evt: evt, pointerId };\n var differentTarget = targetShape !== shape;\n if (differentTarget && targetShape) {\n targetShape._fireAndBubble(events.pointerout, { ...event }, shape);\n targetShape._fireAndBubble(events.pointerleave, { ...event }, shape);\n }\n if (shape) {\n if (processedShapesIds[shape._id]) {\n return;\n }\n processedShapesIds[shape._id] = true;\n }\n if (shape && shape.isListening()) {\n triggeredOnShape = true;\n if (differentTarget) {\n shape._fireAndBubble(events.pointerover, { ...event }, targetShape);\n shape._fireAndBubble(events.pointerenter, { ...event }, targetShape);\n this[eventType + 'targetShape'] = shape;\n }\n shape._fireAndBubble(events.pointermove, { ...event });\n }\n else {\n if (targetShape) {\n this._fire(events.pointerover, {\n evt: evt,\n target: this,\n currentTarget: this,\n pointerId,\n });\n this[eventType + 'targetShape'] = null;\n }\n }\n });\n if (!triggeredOnShape) {\n this._fire(events.pointermove, {\n evt: evt,\n target: this,\n currentTarget: this,\n pointerId: this._changedPointerPositions[0].id,\n });\n }\n }\n _pointerup(evt) {\n const events = getEventsMap(evt.type);\n const eventType = getEventType(evt.type);\n if (!events) {\n return;\n }\n this.setPointersPositions(evt);\n const clickStartShape = this[eventType + 'ClickStartShape'];\n const clickEndShape = this[eventType + 'ClickEndShape'];\n var processedShapesIds = {};\n let triggeredOnShape = false;\n this._changedPointerPositions.forEach((pos) => {\n const shape = (PointerEvents.getCapturedShape(pos.id) ||\n this.getIntersection(pos));\n if (shape) {\n shape.releaseCapture(pos.id);\n if (processedShapesIds[shape._id]) {\n return;\n }\n processedShapesIds[shape._id] = true;\n }\n const pointerId = pos.id;\n const event = { evt: evt, pointerId };\n let fireDblClick = false;\n if (Global_1.Konva['_' + eventType + 'InDblClickWindow']) {\n fireDblClick = true;\n clearTimeout(this[eventType + 'DblTimeout']);\n }\n else if (!DragAndDrop_1.DD.justDragged) {\n Global_1.Konva['_' + eventType + 'InDblClickWindow'] = true;\n clearTimeout(this[eventType + 'DblTimeout']);\n }\n this[eventType + 'DblTimeout'] = setTimeout(function () {\n Global_1.Konva['_' + eventType + 'InDblClickWindow'] = false;\n }, Global_1.Konva.dblClickWindow);\n if (shape && shape.isListening()) {\n triggeredOnShape = true;\n this[eventType + 'ClickEndShape'] = shape;\n shape._fireAndBubble(events.pointerup, { ...event });\n if (Global_1.Konva['_' + eventType + 'ListenClick'] &&\n clickStartShape &&\n clickStartShape === shape) {\n shape._fireAndBubble(events.pointerclick, { ...event });\n if (fireDblClick && clickEndShape && clickEndShape === shape) {\n shape._fireAndBubble(events.pointerdblclick, { ...event });\n }\n }\n }\n else {\n this[eventType + 'ClickEndShape'] = null;\n if (Global_1.Konva['_' + eventType + 'ListenClick']) {\n this._fire(events.pointerclick, {\n evt: evt,\n target: this,\n currentTarget: this,\n pointerId,\n });\n }\n if (fireDblClick) {\n this._fire(events.pointerdblclick, {\n evt: evt,\n target: this,\n currentTarget: this,\n pointerId,\n });\n }\n }\n });\n if (!triggeredOnShape) {\n this._fire(events.pointerup, {\n evt: evt,\n target: this,\n currentTarget: this,\n pointerId: this._changedPointerPositions[0].id,\n });\n }\n Global_1.Konva['_' + eventType + 'ListenClick'] = false;\n if (evt.cancelable && eventType !== 'touch') {\n evt.preventDefault();\n }\n }\n _contextmenu(evt) {\n this.setPointersPositions(evt);\n var shape = this.getIntersection(this.getPointerPosition());\n if (shape && shape.isListening()) {\n shape._fireAndBubble(CONTEXTMENU, { evt: evt });\n }\n else {\n this._fire(CONTEXTMENU, {\n evt: evt,\n target: this,\n currentTarget: this,\n });\n }\n }\n _wheel(evt) {\n this.setPointersPositions(evt);\n var shape = this.getIntersection(this.getPointerPosition());\n if (shape && shape.isListening()) {\n shape._fireAndBubble(WHEEL, { evt: evt });\n }\n else {\n this._fire(WHEEL, {\n evt: evt,\n target: this,\n currentTarget: this,\n });\n }\n }\n _pointercancel(evt) {\n this.setPointersPositions(evt);\n const shape = PointerEvents.getCapturedShape(evt.pointerId) ||\n this.getIntersection(this.getPointerPosition());\n if (shape) {\n shape._fireAndBubble(POINTERUP, PointerEvents.createEvent(evt));\n }\n PointerEvents.releaseCapture(evt.pointerId);\n }\n _lostpointercapture(evt) {\n PointerEvents.releaseCapture(evt.pointerId);\n }\n setPointersPositions(evt) {\n var contentPosition = this._getContentPosition(), x = null, y = null;\n evt = evt ? evt : window.event;\n if (evt.touches !== undefined) {\n this._pointerPositions = [];\n this._changedPointerPositions = [];\n Array.prototype.forEach.call(evt.touches, (touch) => {\n this._pointerPositions.push({\n id: touch.identifier,\n x: (touch.clientX - contentPosition.left) / contentPosition.scaleX,\n y: (touch.clientY - contentPosition.top) / contentPosition.scaleY,\n });\n });\n Array.prototype.forEach.call(evt.changedTouches || evt.touches, (touch) => {\n this._changedPointerPositions.push({\n id: touch.identifier,\n x: (touch.clientX - contentPosition.left) / contentPosition.scaleX,\n y: (touch.clientY - contentPosition.top) / contentPosition.scaleY,\n });\n });\n }\n else {\n x = (evt.clientX - contentPosition.left) / contentPosition.scaleX;\n y = (evt.clientY - contentPosition.top) / contentPosition.scaleY;\n this.pointerPos = {\n x: x,\n y: y,\n };\n this._pointerPositions = [{ x, y, id: Util_1.Util._getFirstPointerId(evt) }];\n this._changedPointerPositions = [\n { x, y, id: Util_1.Util._getFirstPointerId(evt) },\n ];\n }\n }\n _setPointerPosition(evt) {\n Util_1.Util.warn('Method _setPointerPosition is deprecated. Use \"stage.setPointersPositions(event)\" instead.');\n this.setPointersPositions(evt);\n }\n _getContentPosition() {\n if (!this.content || !this.content.getBoundingClientRect) {\n return {\n top: 0,\n left: 0,\n scaleX: 1,\n scaleY: 1,\n };\n }\n var rect = this.content.getBoundingClientRect();\n return {\n top: rect.top,\n left: rect.left,\n scaleX: rect.width / this.content.clientWidth || 1,\n scaleY: rect.height / this.content.clientHeight || 1,\n };\n }\n _buildDOM() {\n this.bufferCanvas = new Canvas_1.SceneCanvas({\n width: this.width(),\n height: this.height(),\n });\n this.bufferHitCanvas = new Canvas_1.HitCanvas({\n pixelRatio: 1,\n width: this.width(),\n height: this.height(),\n });\n if (!Global_1.Konva.isBrowser) {\n return;\n }\n var container = this.container();\n if (!container) {\n throw 'Stage has no container. A container is required.';\n }\n container.innerHTML = '';\n this.content = document.createElement('div');\n this.content.style.position = 'relative';\n this.content.style.userSelect = 'none';\n this.content.className = 'konvajs-content';\n this.content.setAttribute('role', 'presentation');\n container.appendChild(this.content);\n this._resizeDOM();\n }\n cache() {\n Util_1.Util.warn('Cache function is not allowed for stage. You may use cache only for layers, groups and shapes.');\n return this;\n }\n clearCache() {\n return this;\n }\n batchDraw() {\n this.getChildren().forEach(function (layer) {\n layer.batchDraw();\n });\n return this;\n }\n}\nexports.Stage = Stage;\nStage.prototype.nodeType = STAGE;\n(0, Global_2._registerNode)(Stage);\nFactory_1.Factory.addGetterSetter(Stage, 'container');\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Shape = exports.shapes = void 0;\nconst Global_1 = require(\"./Global\");\nconst Util_1 = require(\"./Util\");\nconst Factory_1 = require(\"./Factory\");\nconst Node_1 = require(\"./Node\");\nconst Validators_1 = require(\"./Validators\");\nconst Global_2 = require(\"./Global\");\nconst PointerEvents = require(\"./PointerEvents\");\nvar HAS_SHADOW = 'hasShadow';\nvar SHADOW_RGBA = 'shadowRGBA';\nvar patternImage = 'patternImage';\nvar linearGradient = 'linearGradient';\nvar radialGradient = 'radialGradient';\nlet dummyContext;\nfunction getDummyContext() {\n if (dummyContext) {\n return dummyContext;\n }\n dummyContext = Util_1.Util.createCanvasElement().getContext('2d');\n return dummyContext;\n}\nexports.shapes = {};\nfunction _fillFunc(context) {\n const fillRule = this.attrs.fillRule;\n if (fillRule) {\n context.fill(fillRule);\n }\n else {\n context.fill();\n }\n}\nfunction _strokeFunc(context) {\n context.stroke();\n}\nfunction _fillFuncHit(context) {\n context.fill();\n}\nfunction _strokeFuncHit(context) {\n context.stroke();\n}\nfunction _clearHasShadowCache() {\n this._clearCache(HAS_SHADOW);\n}\nfunction _clearGetShadowRGBACache() {\n this._clearCache(SHADOW_RGBA);\n}\nfunction _clearFillPatternCache() {\n this._clearCache(patternImage);\n}\nfunction _clearLinearGradientCache() {\n this._clearCache(linearGradient);\n}\nfunction _clearRadialGradientCache() {\n this._clearCache(radialGradient);\n}\nclass Shape extends Node_1.Node {\n constructor(config) {\n super(config);\n let key;\n while (true) {\n key = Util_1.Util.getRandomColor();\n if (key && !(key in exports.shapes)) {\n break;\n }\n }\n this.colorKey = key;\n exports.shapes[key] = this;\n }\n getContext() {\n Util_1.Util.warn('shape.getContext() method is deprecated. Please do not use it.');\n return this.getLayer().getContext();\n }\n getCanvas() {\n Util_1.Util.warn('shape.getCanvas() method is deprecated. Please do not use it.');\n return this.getLayer().getCanvas();\n }\n getSceneFunc() {\n return this.attrs.sceneFunc || this['_sceneFunc'];\n }\n getHitFunc() {\n return this.attrs.hitFunc || this['_hitFunc'];\n }\n hasShadow() {\n return this._getCache(HAS_SHADOW, this._hasShadow);\n }\n _hasShadow() {\n return (this.shadowEnabled() &&\n this.shadowOpacity() !== 0 &&\n !!(this.shadowColor() ||\n this.shadowBlur() ||\n this.shadowOffsetX() ||\n this.shadowOffsetY()));\n }\n _getFillPattern() {\n return this._getCache(patternImage, this.__getFillPattern);\n }\n __getFillPattern() {\n if (this.fillPatternImage()) {\n var ctx = getDummyContext();\n const pattern = ctx.createPattern(this.fillPatternImage(), this.fillPatternRepeat() || 'repeat');\n if (pattern && pattern.setTransform) {\n const tr = new Util_1.Transform();\n tr.translate(this.fillPatternX(), this.fillPatternY());\n tr.rotate(Global_1.Konva.getAngle(this.fillPatternRotation()));\n tr.scale(this.fillPatternScaleX(), this.fillPatternScaleY());\n tr.translate(-1 * this.fillPatternOffsetX(), -1 * this.fillPatternOffsetY());\n const m = tr.getMatrix();\n const matrix = typeof DOMMatrix === 'undefined'\n ? {\n a: m[0],\n b: m[1],\n c: m[2],\n d: m[3],\n e: m[4],\n f: m[5],\n }\n : new DOMMatrix(m);\n pattern.setTransform(matrix);\n }\n return pattern;\n }\n }\n _getLinearGradient() {\n return this._getCache(linearGradient, this.__getLinearGradient);\n }\n __getLinearGradient() {\n var colorStops = this.fillLinearGradientColorStops();\n if (colorStops) {\n var ctx = getDummyContext();\n var start = this.fillLinearGradientStartPoint();\n var end = this.fillLinearGradientEndPoint();\n var grd = ctx.createLinearGradient(start.x, start.y, end.x, end.y);\n for (var n = 0; n < colorStops.length; n += 2) {\n grd.addColorStop(colorStops[n], colorStops[n + 1]);\n }\n return grd;\n }\n }\n _getRadialGradient() {\n return this._getCache(radialGradient, this.__getRadialGradient);\n }\n __getRadialGradient() {\n var colorStops = this.fillRadialGradientColorStops();\n if (colorStops) {\n var ctx = getDummyContext();\n var start = this.fillRadialGradientStartPoint();\n var end = this.fillRadialGradientEndPoint();\n var grd = ctx.createRadialGradient(start.x, start.y, this.fillRadialGradientStartRadius(), end.x, end.y, this.fillRadialGradientEndRadius());\n for (var n = 0; n < colorStops.length; n += 2) {\n grd.addColorStop(colorStops[n], colorStops[n + 1]);\n }\n return grd;\n }\n }\n getShadowRGBA() {\n return this._getCache(SHADOW_RGBA, this._getShadowRGBA);\n }\n _getShadowRGBA() {\n if (!this.hasShadow()) {\n return;\n }\n var rgba = Util_1.Util.colorToRGBA(this.shadowColor());\n if (rgba) {\n return ('rgba(' +\n rgba.r +\n ',' +\n rgba.g +\n ',' +\n rgba.b +\n ',' +\n rgba.a * (this.shadowOpacity() || 1) +\n ')');\n }\n }\n hasFill() {\n return this._calculate('hasFill', [\n 'fillEnabled',\n 'fill',\n 'fillPatternImage',\n 'fillLinearGradientColorStops',\n 'fillRadialGradientColorStops',\n ], () => {\n return (this.fillEnabled() &&\n !!(this.fill() ||\n this.fillPatternImage() ||\n this.fillLinearGradientColorStops() ||\n this.fillRadialGradientColorStops()));\n });\n }\n hasStroke() {\n return this._calculate('hasStroke', [\n 'strokeEnabled',\n 'strokeWidth',\n 'stroke',\n 'strokeLinearGradientColorStops',\n ], () => {\n return (this.strokeEnabled() &&\n this.strokeWidth() &&\n !!(this.stroke() || this.strokeLinearGradientColorStops()));\n });\n }\n hasHitStroke() {\n const width = this.hitStrokeWidth();\n if (width === 'auto') {\n return this.hasStroke();\n }\n return this.strokeEnabled() && !!width;\n }\n intersects(point) {\n var stage = this.getStage();\n if (!stage) {\n return false;\n }\n const bufferHitCanvas = stage.bufferHitCanvas;\n bufferHitCanvas.getContext().clear();\n this.drawHit(bufferHitCanvas, undefined, true);\n const p = bufferHitCanvas.context.getImageData(Math.round(point.x), Math.round(point.y), 1, 1).data;\n return p[3] > 0;\n }\n destroy() {\n Node_1.Node.prototype.destroy.call(this);\n delete exports.shapes[this.colorKey];\n delete this.colorKey;\n return this;\n }\n _useBufferCanvas(forceFill) {\n var _a;\n const perfectDrawEnabled = (_a = this.attrs.perfectDrawEnabled) !== null && _a !== void 0 ? _a : true;\n if (!perfectDrawEnabled) {\n return false;\n }\n const hasFill = forceFill || this.hasFill();\n const hasStroke = this.hasStroke();\n const isTransparent = this.getAbsoluteOpacity() !== 1;\n if (hasFill && hasStroke && isTransparent) {\n return true;\n }\n const hasShadow = this.hasShadow();\n const strokeForShadow = this.shadowForStrokeEnabled();\n if (hasFill && hasStroke && hasShadow && strokeForShadow) {\n return true;\n }\n return false;\n }\n setStrokeHitEnabled(val) {\n Util_1.Util.warn('strokeHitEnabled property is deprecated. Please use hitStrokeWidth instead.');\n if (val) {\n this.hitStrokeWidth('auto');\n }\n else {\n this.hitStrokeWidth(0);\n }\n }\n getStrokeHitEnabled() {\n if (this.hitStrokeWidth() === 0) {\n return false;\n }\n else {\n return true;\n }\n }\n getSelfRect() {\n var size = this.size();\n return {\n x: this._centroid ? -size.width / 2 : 0,\n y: this._centroid ? -size.height / 2 : 0,\n width: size.width,\n height: size.height,\n };\n }\n getClientRect(config = {}) {\n const skipTransform = config.skipTransform;\n const relativeTo = config.relativeTo;\n const fillRect = this.getSelfRect();\n const applyStroke = !config.skipStroke && this.hasStroke();\n const strokeWidth = (applyStroke && this.strokeWidth()) || 0;\n const fillAndStrokeWidth = fillRect.width + strokeWidth;\n const fillAndStrokeHeight = fillRect.height + strokeWidth;\n const applyShadow = !config.skipShadow && this.hasShadow();\n const shadowOffsetX = applyShadow ? this.shadowOffsetX() : 0;\n const shadowOffsetY = applyShadow ? this.shadowOffsetY() : 0;\n const preWidth = fillAndStrokeWidth + Math.abs(shadowOffsetX);\n const preHeight = fillAndStrokeHeight + Math.abs(shadowOffsetY);\n const blurRadius = (applyShadow && this.shadowBlur()) || 0;\n const width = preWidth + blurRadius * 2;\n const height = preHeight + blurRadius * 2;\n const rect = {\n width: width,\n height: height,\n x: -(strokeWidth / 2 + blurRadius) +\n Math.min(shadowOffsetX, 0) +\n fillRect.x,\n y: -(strokeWidth / 2 + blurRadius) +\n Math.min(shadowOffsetY, 0) +\n fillRect.y,\n };\n if (!skipTransform) {\n return this._transformedRect(rect, relativeTo);\n }\n return rect;\n }\n drawScene(can, top, bufferCanvas) {\n var layer = this.getLayer();\n var canvas = can || layer.getCanvas(), context = canvas.getContext(), cachedCanvas = this._getCanvasCache(), drawFunc = this.getSceneFunc(), hasShadow = this.hasShadow(), stage, bufferContext;\n var skipBuffer = canvas.isCache;\n var cachingSelf = top === this;\n if (!this.isVisible() && !cachingSelf) {\n return this;\n }\n if (cachedCanvas) {\n context.save();\n var m = this.getAbsoluteTransform(top).getMatrix();\n context.transform(m[0], m[1], m[2], m[3], m[4], m[5]);\n this._drawCachedSceneCanvas(context);\n context.restore();\n return this;\n }\n if (!drawFunc) {\n return this;\n }\n context.save();\n if (this._useBufferCanvas() && !skipBuffer) {\n stage = this.getStage();\n const bc = bufferCanvas || stage.bufferCanvas;\n bufferContext = bc.getContext();\n bufferContext.clear();\n bufferContext.save();\n bufferContext._applyLineJoin(this);\n var o = this.getAbsoluteTransform(top).getMatrix();\n bufferContext.transform(o[0], o[1], o[2], o[3], o[4], o[5]);\n drawFunc.call(this, bufferContext, this);\n bufferContext.restore();\n var ratio = bc.pixelRatio;\n if (hasShadow) {\n context._applyShadow(this);\n }\n context._applyOpacity(this);\n context._applyGlobalCompositeOperation(this);\n context.drawImage(bc._canvas, 0, 0, bc.width / ratio, bc.height / ratio);\n }\n else {\n context._applyLineJoin(this);\n if (!cachingSelf) {\n var o = this.getAbsoluteTransform(top).getMatrix();\n context.transform(o[0], o[1], o[2], o[3], o[4], o[5]);\n context._applyOpacity(this);\n context._applyGlobalCompositeOperation(this);\n }\n if (hasShadow) {\n context._applyShadow(this);\n }\n drawFunc.call(this, context, this);\n }\n context.restore();\n return this;\n }\n drawHit(can, top, skipDragCheck = false) {\n if (!this.shouldDrawHit(top, skipDragCheck)) {\n return this;\n }\n var layer = this.getLayer(), canvas = can || layer.hitCanvas, context = canvas && canvas.getContext(), drawFunc = this.hitFunc() || this.sceneFunc(), cachedCanvas = this._getCanvasCache(), cachedHitCanvas = cachedCanvas && cachedCanvas.hit;\n if (!this.colorKey) {\n Util_1.Util.warn('Looks like your canvas has a destroyed shape in it. Do not reuse shape after you destroyed it. If you want to reuse shape you should call remove() instead of destroy()');\n }\n if (cachedHitCanvas) {\n context.save();\n var m = this.getAbsoluteTransform(top).getMatrix();\n context.transform(m[0], m[1], m[2], m[3], m[4], m[5]);\n this._drawCachedHitCanvas(context);\n context.restore();\n return this;\n }\n if (!drawFunc) {\n return this;\n }\n context.save();\n context._applyLineJoin(this);\n const selfCache = this === top;\n if (!selfCache) {\n var o = this.getAbsoluteTransform(top).getMatrix();\n context.transform(o[0], o[1], o[2], o[3], o[4], o[5]);\n }\n drawFunc.call(this, context, this);\n context.restore();\n return this;\n }\n drawHitFromCache(alphaThreshold = 0) {\n var cachedCanvas = this._getCanvasCache(), sceneCanvas = this._getCachedSceneCanvas(), hitCanvas = cachedCanvas.hit, hitContext = hitCanvas.getContext(), hitWidth = hitCanvas.getWidth(), hitHeight = hitCanvas.getHeight(), hitImageData, hitData, len, rgbColorKey, i, alpha;\n hitContext.clear();\n hitContext.drawImage(sceneCanvas._canvas, 0, 0, hitWidth, hitHeight);\n try {\n hitImageData = hitContext.getImageData(0, 0, hitWidth, hitHeight);\n hitData = hitImageData.data;\n len = hitData.length;\n rgbColorKey = Util_1.Util._hexToRgb(this.colorKey);\n for (i = 0; i < len; i += 4) {\n alpha = hitData[i + 3];\n if (alpha > alphaThreshold) {\n hitData[i] = rgbColorKey.r;\n hitData[i + 1] = rgbColorKey.g;\n hitData[i + 2] = rgbColorKey.b;\n hitData[i + 3] = 255;\n }\n else {\n hitData[i + 3] = 0;\n }\n }\n hitContext.putImageData(hitImageData, 0, 0);\n }\n catch (e) {\n Util_1.Util.error('Unable to draw hit graph from cached scene canvas. ' + e.message);\n }\n return this;\n }\n hasPointerCapture(pointerId) {\n return PointerEvents.hasPointerCapture(pointerId, this);\n }\n setPointerCapture(pointerId) {\n PointerEvents.setPointerCapture(pointerId, this);\n }\n releaseCapture(pointerId) {\n PointerEvents.releaseCapture(pointerId, this);\n }\n}\nexports.Shape = Shape;\nShape.prototype._fillFunc = _fillFunc;\nShape.prototype._strokeFunc = _strokeFunc;\nShape.prototype._fillFuncHit = _fillFuncHit;\nShape.prototype._strokeFuncHit = _strokeFuncHit;\nShape.prototype._centroid = false;\nShape.prototype.nodeType = 'Shape';\n(0, Global_2._registerNode)(Shape);\nShape.prototype.eventListeners = {};\nShape.prototype.on.call(Shape.prototype, 'shadowColorChange.konva shadowBlurChange.konva shadowOffsetChange.konva shadowOpacityChange.konva shadowEnabledChange.konva', _clearHasShadowCache);\nShape.prototype.on.call(Shape.prototype, 'shadowColorChange.konva shadowOpacityChange.konva shadowEnabledChange.konva', _clearGetShadowRGBACache);\nShape.prototype.on.call(Shape.prototype, 'fillPriorityChange.konva fillPatternImageChange.konva fillPatternRepeatChange.konva fillPatternScaleXChange.konva fillPatternScaleYChange.konva fillPatternOffsetXChange.konva fillPatternOffsetYChange.konva fillPatternXChange.konva fillPatternYChange.konva fillPatternRotationChange.konva', _clearFillPatternCache);\nShape.prototype.on.call(Shape.prototype, 'fillPriorityChange.konva fillLinearGradientColorStopsChange.konva fillLinearGradientStartPointXChange.konva fillLinearGradientStartPointYChange.konva fillLinearGradientEndPointXChange.konva fillLinearGradientEndPointYChange.konva', _clearLinearGradientCache);\nShape.prototype.on.call(Shape.prototype, 'fillPriorityChange.konva fillRadialGradientColorStopsChange.konva fillRadialGradientStartPointXChange.konva fillRadialGradientStartPointYChange.konva fillRadialGradientEndPointXChange.konva fillRadialGradientEndPointYChange.konva fillRadialGradientStartRadiusChange.konva fillRadialGradientEndRadiusChange.konva', _clearRadialGradientCache);\nFactory_1.Factory.addGetterSetter(Shape, 'stroke', undefined, (0, Validators_1.getStringOrGradientValidator)());\nFactory_1.Factory.addGetterSetter(Shape, 'strokeWidth', 2, (0, Validators_1.getNumberValidator)());\nFactory_1.Factory.addGetterSetter(Shape, 'fillAfterStrokeEnabled', false);\nFactory_1.Factory.addGetterSetter(Shape, 'hitStrokeWidth', 'auto', (0, Validators_1.getNumberOrAutoValidator)());\nFactory_1.Factory.addGetterSetter(Shape, 'strokeHitEnabled', true, (0, Validators_1.getBooleanValidator)());\nFactory_1.Factory.addGetterSetter(Shape, 'perfectDrawEnabled', true, (0, Validators_1.getBooleanValidator)());\nFactory_1.Factory.addGetterSetter(Shape, 'shadowForStrokeEnabled', true, (0, Validators_1.getBooleanValidator)());\nFactory_1.Factory.addGetterSetter(Shape, 'lineJoin');\nFactory_1.Factory.addGetterSetter(Shape, 'lineCap');\nFactory_1.Factory.addGetterSetter(Shape, 'sceneFunc');\nFactory_1.Factory.addGetterSetter(Shape, 'hitFunc');\nFactory_1.Factory.addGetterSetter(Shape, 'dash');\nFactory_1.Factory.addGetterSetter(Shape, 'dashOffset', 0, (0, Validators_1.getNumberValidator)());\nFactory_1.Factory.addGetterSetter(Shape, 'shadowColor', undefined, (0, Validators_1.getStringValidator)());\nFactory_1.Factory.addGetterSetter(Shape, 'shadowBlur', 0, (0, Validators_1.getNumberValidator)());\nFactory_1.Factory.addGetterSetter(Shape, 'shadowOpacity', 1, (0, Validators_1.getNumberValidator)());\nFactory_1.Factory.addComponentsGetterSetter(Shape, 'shadowOffset', ['x', 'y']);\nFactory_1.Factory.addGetterSetter(Shape, 'shadowOffsetX', 0, (0, Validators_1.getNumberValidator)());\nFactory_1.Factory.addGetterSetter(Shape, 'shadowOffsetY', 0, (0, Validators_1.getNumberValidator)());\nFactory_1.Factory.addGetterSetter(Shape, 'fillPatternImage');\nFactory_1.Factory.addGetterSetter(Shape, 'fill', undefined, (0, Validators_1.getStringOrGradientValidator)());\nFactory_1.Factory.addGetterSetter(Shape, 'fillPatternX', 0, (0, Validators_1.getNumberValidator)());\nFactory_1.Factory.addGetterSetter(Shape, 'fillPatternY', 0, (0, Validators_1.getNumberValidator)());\nFactory_1.Factory.addGetterSetter(Shape, 'fillLinearGradientColorStops');\nFactory_1.Factory.addGetterSetter(Shape, 'strokeLinearGradientColorStops');\nFactory_1.Factory.addGetterSetter(Shape, 'fillRadialGradientStartRadius', 0);\nFactory_1.Factory.addGetterSetter(Shape, 'fillRadialGradientEndRadius', 0);\nFactory_1.Factory.addGetterSetter(Shape, 'fillRadialGradientColorStops');\nFactory_1.Factory.addGetterSetter(Shape, 'fillPatternRepeat', 'repeat');\nFactory_1.Factory.addGetterSetter(Shape, 'fillEnabled', true);\nFactory_1.Factory.addGetterSetter(Shape, 'strokeEnabled', true);\nFactory_1.Factory.addGetterSetter(Shape, 'shadowEnabled', true);\nFactory_1.Factory.addGetterSetter(Shape, 'dashEnabled', true);\nFactory_1.Factory.addGetterSetter(Shape, 'strokeScaleEnabled', true);\nFactory_1.Factory.addGetterSetter(Shape, 'fillPriority', 'color');\nFactory_1.Factory.addComponentsGetterSetter(Shape, 'fillPatternOffset', ['x', 'y']);\nFactory_1.Factory.addGetterSetter(Shape, 'fillPatternOffsetX', 0, (0, Validators_1.getNumberValidator)());\nFactory_1.Factory.addGetterSetter(Shape, 'fillPatternOffsetY', 0, (0, Validators_1.getNumberValidator)());\nFactory_1.Factory.addComponentsGetterSetter(Shape, 'fillPatternScale', ['x', 'y']);\nFactory_1.Factory.addGetterSetter(Shape, 'fillPatternScaleX', 1, (0, Validators_1.getNumberValidator)());\nFactory_1.Factory.addGetterSetter(Shape, 'fillPatternScaleY', 1, (0, Validators_1.getNumberValidator)());\nFactory_1.Factory.addComponentsGetterSetter(Shape, 'fillLinearGradientStartPoint', [\n 'x',\n 'y',\n]);\nFactory_1.Factory.addComponentsGetterSetter(Shape, 'strokeLinearGradientStartPoint', [\n 'x',\n 'y',\n]);\nFactory_1.Factory.addGetterSetter(Shape, 'fillLinearGradientStartPointX', 0);\nFactory_1.Factory.addGetterSetter(Shape, 'strokeLinearGradientStartPointX', 0);\nFactory_1.Factory.addGetterSetter(Shape, 'fillLinearGradientStartPointY', 0);\nFactory_1.Factory.addGetterSetter(Shape, 'strokeLinearGradientStartPointY', 0);\nFactory_1.Factory.addComponentsGetterSetter(Shape, 'fillLinearGradientEndPoint', [\n 'x',\n 'y',\n]);\nFactory_1.Factory.addComponentsGetterSetter(Shape, 'strokeLinearGradientEndPoint', [\n 'x',\n 'y',\n]);\nFactory_1.Factory.addGetterSetter(Shape, 'fillLinearGradientEndPointX', 0);\nFactory_1.Factory.addGetterSetter(Shape, 'strokeLinearGradientEndPointX', 0);\nFactory_1.Factory.addGetterSetter(Shape, 'fillLinearGradientEndPointY', 0);\nFactory_1.Factory.addGetterSetter(Shape, 'strokeLinearGradientEndPointY', 0);\nFactory_1.Factory.addComponentsGetterSetter(Shape, 'fillRadialGradientStartPoint', [\n 'x',\n 'y',\n]);\nFactory_1.Factory.addGetterSetter(Shape, 'fillRadialGradientStartPointX', 0);\nFactory_1.Factory.addGetterSetter(Shape, 'fillRadialGradientStartPointY', 0);\nFactory_1.Factory.addComponentsGetterSetter(Shape, 'fillRadialGradientEndPoint', [\n 'x',\n 'y',\n]);\nFactory_1.Factory.addGetterSetter(Shape, 'fillRadialGradientEndPointX', 0);\nFactory_1.Factory.addGetterSetter(Shape, 'fillRadialGradientEndPointY', 0);\nFactory_1.Factory.addGetterSetter(Shape, 'fillPatternRotation', 0);\nFactory_1.Factory.addGetterSetter(Shape, 'fillRule', undefined, (0, Validators_1.getStringValidator)());\nFactory_1.Factory.backCompat(Shape, {\n dashArray: 'dash',\n getDashArray: 'getDash',\n setDashArray: 'getDash',\n drawFunc: 'sceneFunc',\n getDrawFunc: 'getSceneFunc',\n setDrawFunc: 'setSceneFunc',\n drawHitFunc: 'hitFunc',\n getDrawHitFunc: 'getHitFunc',\n setDrawHitFunc: 'setHitFunc',\n});\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Layer = void 0;\nconst Util_1 = require(\"./Util\");\nconst Container_1 = require(\"./Container\");\nconst Node_1 = require(\"./Node\");\nconst Factory_1 = require(\"./Factory\");\nconst Canvas_1 = require(\"./Canvas\");\nconst Validators_1 = require(\"./Validators\");\nconst Shape_1 = require(\"./Shape\");\nconst Global_1 = require(\"./Global\");\nvar HASH = '#', BEFORE_DRAW = 'beforeDraw', DRAW = 'draw', INTERSECTION_OFFSETS = [\n { x: 0, y: 0 },\n { x: -1, y: -1 },\n { x: 1, y: -1 },\n { x: 1, y: 1 },\n { x: -1, y: 1 },\n], INTERSECTION_OFFSETS_LEN = INTERSECTION_OFFSETS.length;\nclass Layer extends Container_1.Container {\n constructor(config) {\n super(config);\n this.canvas = new Canvas_1.SceneCanvas();\n this.hitCanvas = new Canvas_1.HitCanvas({\n pixelRatio: 1,\n });\n this._waitingForDraw = false;\n this.on('visibleChange.konva', this._checkVisibility);\n this._checkVisibility();\n this.on('imageSmoothingEnabledChange.konva', this._setSmoothEnabled);\n this._setSmoothEnabled();\n }\n createPNGStream() {\n const c = this.canvas._canvas;\n return c.createPNGStream();\n }\n getCanvas() {\n return this.canvas;\n }\n getNativeCanvasElement() {\n return this.canvas._canvas;\n }\n getHitCanvas() {\n return this.hitCanvas;\n }\n getContext() {\n return this.getCanvas().getContext();\n }\n clear(bounds) {\n this.getContext().clear(bounds);\n this.getHitCanvas().getContext().clear(bounds);\n return this;\n }\n setZIndex(index) {\n super.setZIndex(index);\n var stage = this.getStage();\n if (stage && stage.content) {\n stage.content.removeChild(this.getNativeCanvasElement());\n if (index < stage.children.length - 1) {\n stage.content.insertBefore(this.getNativeCanvasElement(), stage.children[index + 1].getCanvas()._canvas);\n }\n else {\n stage.content.appendChild(this.getNativeCanvasElement());\n }\n }\n return this;\n }\n moveToTop() {\n Node_1.Node.prototype.moveToTop.call(this);\n var stage = this.getStage();\n if (stage && stage.content) {\n stage.content.removeChild(this.getNativeCanvasElement());\n stage.content.appendChild(this.getNativeCanvasElement());\n }\n return true;\n }\n moveUp() {\n var moved = Node_1.Node.prototype.moveUp.call(this);\n if (!moved) {\n return false;\n }\n var stage = this.getStage();\n if (!stage || !stage.content) {\n return false;\n }\n stage.content.removeChild(this.getNativeCanvasElement());\n if (this.index < stage.children.length - 1) {\n stage.content.insertBefore(this.getNativeCanvasElement(), stage.children[this.index + 1].getCanvas()._canvas);\n }\n else {\n stage.content.appendChild(this.getNativeCanvasElement());\n }\n return true;\n }\n moveDown() {\n if (Node_1.Node.prototype.moveDown.call(this)) {\n var stage = this.getStage();\n if (stage) {\n var children = stage.children;\n if (stage.content) {\n stage.content.removeChild(this.getNativeCanvasElement());\n stage.content.insertBefore(this.getNativeCanvasElement(), children[this.index + 1].getCanvas()._canvas);\n }\n }\n return true;\n }\n return false;\n }\n moveToBottom() {\n if (Node_1.Node.prototype.moveToBottom.call(this)) {\n var stage = this.getStage();\n if (stage) {\n var children = stage.children;\n if (stage.content) {\n stage.content.removeChild(this.getNativeCanvasElement());\n stage.content.insertBefore(this.getNativeCanvasElement(), children[1].getCanvas()._canvas);\n }\n }\n return true;\n }\n return false;\n }\n getLayer() {\n return this;\n }\n remove() {\n var _canvas = this.getNativeCanvasElement();\n Node_1.Node.prototype.remove.call(this);\n if (_canvas && _canvas.parentNode && Util_1.Util._isInDocument(_canvas)) {\n _canvas.parentNode.removeChild(_canvas);\n }\n return this;\n }\n getStage() {\n return this.parent;\n }\n setSize({ width, height }) {\n this.canvas.setSize(width, height);\n this.hitCanvas.setSize(width, height);\n this._setSmoothEnabled();\n return this;\n }\n _validateAdd(child) {\n var type = child.getType();\n if (type !== 'Group' && type !== 'Shape') {\n Util_1.Util.throw('You may only add groups and shapes to a layer.');\n }\n }\n _toKonvaCanvas(config) {\n config = config || {};\n config.width = config.width || this.getWidth();\n config.height = config.height || this.getHeight();\n config.x = config.x !== undefined ? config.x : this.x();\n config.y = config.y !== undefined ? config.y : this.y();\n return Node_1.Node.prototype._toKonvaCanvas.call(this, config);\n }\n _checkVisibility() {\n const visible = this.visible();\n if (visible) {\n this.canvas._canvas.style.display = 'block';\n }\n else {\n this.canvas._canvas.style.display = 'none';\n }\n }\n _setSmoothEnabled() {\n this.getContext()._context.imageSmoothingEnabled =\n this.imageSmoothingEnabled();\n }\n getWidth() {\n if (this.parent) {\n return this.parent.width();\n }\n }\n setWidth() {\n Util_1.Util.warn('Can not change width of layer. Use \"stage.width(value)\" function instead.');\n }\n getHeight() {\n if (this.parent) {\n return this.parent.height();\n }\n }\n setHeight() {\n Util_1.Util.warn('Can not change height of layer. Use \"stage.height(value)\" function instead.');\n }\n batchDraw() {\n if (!this._waitingForDraw) {\n this._waitingForDraw = true;\n Util_1.Util.requestAnimFrame(() => {\n this.draw();\n this._waitingForDraw = false;\n });\n }\n return this;\n }\n getIntersection(pos) {\n if (!this.isListening() || !this.isVisible()) {\n return null;\n }\n var spiralSearchDistance = 1;\n var continueSearch = false;\n while (true) {\n for (let i = 0; i < INTERSECTION_OFFSETS_LEN; i++) {\n const intersectionOffset = INTERSECTION_OFFSETS[i];\n const obj = this._getIntersection({\n x: pos.x + intersectionOffset.x * spiralSearchDistance,\n y: pos.y + intersectionOffset.y * spiralSearchDistance,\n });\n const shape = obj.shape;\n if (shape) {\n return shape;\n }\n continueSearch = !!obj.antialiased;\n if (!obj.antialiased) {\n break;\n }\n }\n if (continueSearch) {\n spiralSearchDistance += 1;\n }\n else {\n return null;\n }\n }\n }\n _getIntersection(pos) {\n const ratio = this.hitCanvas.pixelRatio;\n const p = this.hitCanvas.context.getImageData(Math.round(pos.x * ratio), Math.round(pos.y * ratio), 1, 1).data;\n const p3 = p[3];\n if (p3 === 255) {\n const colorKey = Util_1.Util._rgbToHex(p[0], p[1], p[2]);\n const shape = Shape_1.shapes[HASH + colorKey];\n if (shape) {\n return {\n shape: shape,\n };\n }\n return {\n antialiased: true,\n };\n }\n else if (p3 > 0) {\n return {\n antialiased: true,\n };\n }\n return {};\n }\n drawScene(can, top) {\n var layer = this.getLayer(), canvas = can || (layer && layer.getCanvas());\n this._fire(BEFORE_DRAW, {\n node: this,\n });\n if (this.clearBeforeDraw()) {\n canvas.getContext().clear();\n }\n Container_1.Container.prototype.drawScene.call(this, canvas, top);\n this._fire(DRAW, {\n node: this,\n });\n return this;\n }\n drawHit(can, top) {\n var layer = this.getLayer(), canvas = can || (layer && layer.hitCanvas);\n if (layer && layer.clearBeforeDraw()) {\n layer.getHitCanvas().getContext().clear();\n }\n Container_1.Container.prototype.drawHit.call(this, canvas, top);\n return this;\n }\n enableHitGraph() {\n this.hitGraphEnabled(true);\n return this;\n }\n disableHitGraph() {\n this.hitGraphEnabled(false);\n return this;\n }\n setHitGraphEnabled(val) {\n Util_1.Util.warn('hitGraphEnabled method is deprecated. Please use layer.listening() instead.');\n this.listening(val);\n }\n getHitGraphEnabled(val) {\n Util_1.Util.warn('hitGraphEnabled method is deprecated. Please use layer.listening() instead.');\n return this.listening();\n }\n toggleHitCanvas() {\n if (!this.parent || !this.parent['content']) {\n return;\n }\n var parent = this.parent;\n var added = !!this.hitCanvas._canvas.parentNode;\n if (added) {\n parent.content.removeChild(this.hitCanvas._canvas);\n }\n else {\n parent.content.appendChild(this.hitCanvas._canvas);\n }\n }\n destroy() {\n Util_1.Util.releaseCanvas(this.getNativeCanvasElement(), this.getHitCanvas()._canvas);\n return super.destroy();\n }\n}\nexports.Layer = Layer;\nLayer.prototype.nodeType = 'Layer';\n(0, Global_1._registerNode)(Layer);\nFactory_1.Factory.addGetterSetter(Layer, 'imageSmoothingEnabled', true);\nFactory_1.Factory.addGetterSetter(Layer, 'clearBeforeDraw', true);\nFactory_1.Factory.addGetterSetter(Layer, 'hitGraphEnabled', true, (0, Validators_1.getBooleanValidator)());\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.FastLayer = void 0;\nconst Util_1 = require(\"./Util\");\nconst Layer_1 = require(\"./Layer\");\nconst Global_1 = require(\"./Global\");\nclass FastLayer extends Layer_1.Layer {\n constructor(attrs) {\n super(attrs);\n this.listening(false);\n Util_1.Util.warn('Konva.Fast layer is deprecated. Please use \"new Konva.Layer({ listening: false })\" instead.');\n }\n}\nexports.FastLayer = FastLayer;\nFastLayer.prototype.nodeType = 'FastLayer';\n(0, Global_1._registerNode)(FastLayer);\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Group = void 0;\nconst Util_1 = require(\"./Util\");\nconst Container_1 = require(\"./Container\");\nconst Global_1 = require(\"./Global\");\nclass Group extends Container_1.Container {\n _validateAdd(child) {\n var type = child.getType();\n if (type !== 'Group' && type !== 'Shape') {\n Util_1.Util.throw('You may only add groups and shapes to groups.');\n }\n }\n}\nexports.Group = Group;\nGroup.prototype.nodeType = 'Group';\n(0, Global_1._registerNode)(Group);\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Animation = void 0;\nconst Global_1 = require(\"./Global\");\nconst Util_1 = require(\"./Util\");\nconst now = (function () {\n if (Global_1.glob.performance && Global_1.glob.performance.now) {\n return function () {\n return Global_1.glob.performance.now();\n };\n }\n return function () {\n return new Date().getTime();\n };\n})();\nclass Animation {\n constructor(func, layers) {\n this.id = Animation.animIdCounter++;\n this.frame = {\n time: 0,\n timeDiff: 0,\n lastTime: now(),\n frameRate: 0,\n };\n this.func = func;\n this.setLayers(layers);\n }\n setLayers(layers) {\n let lays = [];\n if (layers) {\n lays = Array.isArray(layers) ? layers : [layers];\n }\n this.layers = lays;\n return this;\n }\n getLayers() {\n return this.layers;\n }\n addLayer(layer) {\n const layers = this.layers;\n const len = layers.length;\n for (let n = 0; n < len; n++) {\n if (layers[n]._id === layer._id) {\n return false;\n }\n }\n this.layers.push(layer);\n return true;\n }\n isRunning() {\n const a = Animation;\n const animations = a.animations;\n const len = animations.length;\n for (let n = 0; n < len; n++) {\n if (animations[n].id === this.id) {\n return true;\n }\n }\n return false;\n }\n start() {\n this.stop();\n this.frame.timeDiff = 0;\n this.frame.lastTime = now();\n Animation._addAnimation(this);\n return this;\n }\n stop() {\n Animation._removeAnimation(this);\n return this;\n }\n _updateFrameObject(time) {\n this.frame.timeDiff = time - this.frame.lastTime;\n this.frame.lastTime = time;\n this.frame.time += this.frame.timeDiff;\n this.frame.frameRate = 1000 / this.frame.timeDiff;\n }\n static _addAnimation(anim) {\n this.animations.push(anim);\n this._handleAnimation();\n }\n static _removeAnimation(anim) {\n const id = anim.id;\n const animations = this.animations;\n const len = animations.length;\n for (let n = 0; n < len; n++) {\n if (animations[n].id === id) {\n this.animations.splice(n, 1);\n break;\n }\n }\n }\n static _runFrames() {\n const layerHash = {};\n const animations = this.animations;\n for (let n = 0; n < animations.length; n++) {\n const anim = animations[n];\n const layers = anim.layers;\n const func = anim.func;\n anim._updateFrameObject(now());\n const layersLen = layers.length;\n let needRedraw;\n if (func) {\n needRedraw = func.call(anim, anim.frame) !== false;\n }\n else {\n needRedraw = true;\n }\n if (!needRedraw) {\n continue;\n }\n for (let i = 0; i < layersLen; i++) {\n const layer = layers[i];\n if (layer._id !== undefined) {\n layerHash[layer._id] = layer;\n }\n }\n }\n for (let key in layerHash) {\n if (!layerHash.hasOwnProperty(key)) {\n continue;\n }\n layerHash[key].batchDraw();\n }\n }\n static _animationLoop() {\n const Anim = Animation;\n if (Anim.animations.length) {\n Anim._runFrames();\n Util_1.Util.requestAnimFrame(Anim._animationLoop);\n }\n else {\n Anim.animRunning = false;\n }\n }\n static _handleAnimation() {\n if (!this.animRunning) {\n this.animRunning = true;\n Util_1.Util.requestAnimFrame(this._animationLoop);\n }\n }\n}\nexports.Animation = Animation;\nAnimation.animations = [];\nAnimation.animIdCounter = 0;\nAnimation.animRunning = false;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Easings = exports.Tween = void 0;\nconst Util_1 = require(\"./Util\");\nconst Animation_1 = require(\"./Animation\");\nconst Node_1 = require(\"./Node\");\nconst Global_1 = require(\"./Global\");\nvar blacklist = {\n node: 1,\n duration: 1,\n easing: 1,\n onFinish: 1,\n yoyo: 1,\n}, PAUSED = 1, PLAYING = 2, REVERSING = 3, idCounter = 0, colorAttrs = ['fill', 'stroke', 'shadowColor'];\nclass TweenEngine {\n constructor(prop, propFunc, func, begin, finish, duration, yoyo) {\n this.prop = prop;\n this.propFunc = propFunc;\n this.begin = begin;\n this._pos = begin;\n this.duration = duration;\n this._change = 0;\n this.prevPos = 0;\n this.yoyo = yoyo;\n this._time = 0;\n this._position = 0;\n this._startTime = 0;\n this._finish = 0;\n this.func = func;\n this._change = finish - this.begin;\n this.pause();\n }\n fire(str) {\n var handler = this[str];\n if (handler) {\n handler();\n }\n }\n setTime(t) {\n if (t > this.duration) {\n if (this.yoyo) {\n this._time = this.duration;\n this.reverse();\n }\n else {\n this.finish();\n }\n }\n else if (t < 0) {\n if (this.yoyo) {\n this._time = 0;\n this.play();\n }\n else {\n this.reset();\n }\n }\n else {\n this._time = t;\n this.update();\n }\n }\n getTime() {\n return this._time;\n }\n setPosition(p) {\n this.prevPos = this._pos;\n this.propFunc(p);\n this._pos = p;\n }\n getPosition(t) {\n if (t === undefined) {\n t = this._time;\n }\n return this.func(t, this.begin, this._change, this.duration);\n }\n play() {\n this.state = PLAYING;\n this._startTime = this.getTimer() - this._time;\n this.onEnterFrame();\n this.fire('onPlay');\n }\n reverse() {\n this.state = REVERSING;\n this._time = this.duration - this._time;\n this._startTime = this.getTimer() - this._time;\n this.onEnterFrame();\n this.fire('onReverse');\n }\n seek(t) {\n this.pause();\n this._time = t;\n this.update();\n this.fire('onSeek');\n }\n reset() {\n this.pause();\n this._time = 0;\n this.update();\n this.fire('onReset');\n }\n finish() {\n this.pause();\n this._time = this.duration;\n this.update();\n this.fire('onFinish');\n }\n update() {\n this.setPosition(this.getPosition(this._time));\n this.fire('onUpdate');\n }\n onEnterFrame() {\n var t = this.getTimer() - this._startTime;\n if (this.state === PLAYING) {\n this.setTime(t);\n }\n else if (this.state === REVERSING) {\n this.setTime(this.duration - t);\n }\n }\n pause() {\n this.state = PAUSED;\n this.fire('onPause');\n }\n getTimer() {\n return new Date().getTime();\n }\n}\nclass Tween {\n constructor(config) {\n var that = this, node = config.node, nodeId = node._id, duration, easing = config.easing || exports.Easings.Linear, yoyo = !!config.yoyo, key;\n if (typeof config.duration === 'undefined') {\n duration = 0.3;\n }\n else if (config.duration === 0) {\n duration = 0.001;\n }\n else {\n duration = config.duration;\n }\n this.node = node;\n this._id = idCounter++;\n var layers = node.getLayer() ||\n (node instanceof Global_1.Konva['Stage'] ? node.getLayers() : null);\n if (!layers) {\n Util_1.Util.error('Tween constructor have `node` that is not in a layer. Please add node into layer first.');\n }\n this.anim = new Animation_1.Animation(function () {\n that.tween.onEnterFrame();\n }, layers);\n this.tween = new TweenEngine(key, function (i) {\n that._tweenFunc(i);\n }, easing, 0, 1, duration * 1000, yoyo);\n this._addListeners();\n if (!Tween.attrs[nodeId]) {\n Tween.attrs[nodeId] = {};\n }\n if (!Tween.attrs[nodeId][this._id]) {\n Tween.attrs[nodeId][this._id] = {};\n }\n if (!Tween.tweens[nodeId]) {\n Tween.tweens[nodeId] = {};\n }\n for (key in config) {\n if (blacklist[key] === undefined) {\n this._addAttr(key, config[key]);\n }\n }\n this.reset();\n this.onFinish = config.onFinish;\n this.onReset = config.onReset;\n this.onUpdate = config.onUpdate;\n }\n _addAttr(key, end) {\n var node = this.node, nodeId = node._id, start, diff, tweenId, n, len, trueEnd, trueStart, endRGBA;\n tweenId = Tween.tweens[nodeId][key];\n if (tweenId) {\n delete Tween.attrs[nodeId][tweenId][key];\n }\n start = node.getAttr(key);\n if (Util_1.Util._isArray(end)) {\n diff = [];\n len = Math.max(end.length, start.length);\n if (key === 'points' && end.length !== start.length) {\n if (end.length > start.length) {\n trueStart = start;\n start = Util_1.Util._prepareArrayForTween(start, end, node.closed());\n }\n else {\n trueEnd = end;\n end = Util_1.Util._prepareArrayForTween(end, start, node.closed());\n }\n }\n if (key.indexOf('fill') === 0) {\n for (n = 0; n < len; n++) {\n if (n % 2 === 0) {\n diff.push(end[n] - start[n]);\n }\n else {\n var startRGBA = Util_1.Util.colorToRGBA(start[n]);\n endRGBA = Util_1.Util.colorToRGBA(end[n]);\n start[n] = startRGBA;\n diff.push({\n r: endRGBA.r - startRGBA.r,\n g: endRGBA.g - startRGBA.g,\n b: endRGBA.b - startRGBA.b,\n a: endRGBA.a - startRGBA.a,\n });\n }\n }\n }\n else {\n for (n = 0; n < len; n++) {\n diff.push(end[n] - start[n]);\n }\n }\n }\n else if (colorAttrs.indexOf(key) !== -1) {\n start = Util_1.Util.colorToRGBA(start);\n endRGBA = Util_1.Util.colorToRGBA(end);\n diff = {\n r: endRGBA.r - start.r,\n g: endRGBA.g - start.g,\n b: endRGBA.b - start.b,\n a: endRGBA.a - start.a,\n };\n }\n else {\n diff = end - start;\n }\n Tween.attrs[nodeId][this._id][key] = {\n start: start,\n diff: diff,\n end: end,\n trueEnd: trueEnd,\n trueStart: trueStart,\n };\n Tween.tweens[nodeId][key] = this._id;\n }\n _tweenFunc(i) {\n var node = this.node, attrs = Tween.attrs[node._id][this._id], key, attr, start, diff, newVal, n, len, end;\n for (key in attrs) {\n attr = attrs[key];\n start = attr.start;\n diff = attr.diff;\n end = attr.end;\n if (Util_1.Util._isArray(start)) {\n newVal = [];\n len = Math.max(start.length, end.length);\n if (key.indexOf('fill') === 0) {\n for (n = 0; n < len; n++) {\n if (n % 2 === 0) {\n newVal.push((start[n] || 0) + diff[n] * i);\n }\n else {\n newVal.push('rgba(' +\n Math.round(start[n].r + diff[n].r * i) +\n ',' +\n Math.round(start[n].g + diff[n].g * i) +\n ',' +\n Math.round(start[n].b + diff[n].b * i) +\n ',' +\n (start[n].a + diff[n].a * i) +\n ')');\n }\n }\n }\n else {\n for (n = 0; n < len; n++) {\n newVal.push((start[n] || 0) + diff[n] * i);\n }\n }\n }\n else if (colorAttrs.indexOf(key) !== -1) {\n newVal =\n 'rgba(' +\n Math.round(start.r + diff.r * i) +\n ',' +\n Math.round(start.g + diff.g * i) +\n ',' +\n Math.round(start.b + diff.b * i) +\n ',' +\n (start.a + diff.a * i) +\n ')';\n }\n else {\n newVal = start + diff * i;\n }\n node.setAttr(key, newVal);\n }\n }\n _addListeners() {\n this.tween.onPlay = () => {\n this.anim.start();\n };\n this.tween.onReverse = () => {\n this.anim.start();\n };\n this.tween.onPause = () => {\n this.anim.stop();\n };\n this.tween.onFinish = () => {\n var node = this.node;\n var attrs = Tween.attrs[node._id][this._id];\n if (attrs.points && attrs.points.trueEnd) {\n node.setAttr('points', attrs.points.trueEnd);\n }\n if (this.onFinish) {\n this.onFinish.call(this);\n }\n };\n this.tween.onReset = () => {\n var node = this.node;\n var attrs = Tween.attrs[node._id][this._id];\n if (attrs.points && attrs.points.trueStart) {\n node.points(attrs.points.trueStart);\n }\n if (this.onReset) {\n this.onReset();\n }\n };\n this.tween.onUpdate = () => {\n if (this.onUpdate) {\n this.onUpdate.call(this);\n }\n };\n }\n play() {\n this.tween.play();\n return this;\n }\n reverse() {\n this.tween.reverse();\n return this;\n }\n reset() {\n this.tween.reset();\n return this;\n }\n seek(t) {\n this.tween.seek(t * 1000);\n return this;\n }\n pause() {\n this.tween.pause();\n return this;\n }\n finish() {\n this.tween.finish();\n return this;\n }\n destroy() {\n var nodeId = this.node._id, thisId = this._id, attrs = Tween.tweens[nodeId], key;\n this.pause();\n for (key in attrs) {\n delete Tween.tweens[nodeId][key];\n }\n delete Tween.attrs[nodeId][thisId];\n }\n}\nexports.Tween = Tween;\nTween.attrs = {};\nTween.tweens = {};\nNode_1.Node.prototype.to = function (params) {\n var onFinish = params.onFinish;\n params.node = this;\n params.onFinish = function () {\n this.destroy();\n if (onFinish) {\n onFinish();\n }\n };\n var tween = new Tween(params);\n tween.play();\n};\nexports.Easings = {\n BackEaseIn(t, b, c, d) {\n var s = 1.70158;\n return c * (t /= d) * t * ((s + 1) * t - s) + b;\n },\n BackEaseOut(t, b, c, d) {\n var s = 1.70158;\n return c * ((t = t / d - 1) * t * ((s + 1) * t + s) + 1) + b;\n },\n BackEaseInOut(t, b, c, d) {\n var s = 1.70158;\n if ((t /= d / 2) < 1) {\n return (c / 2) * (t * t * (((s *= 1.525) + 1) * t - s)) + b;\n }\n return (c / 2) * ((t -= 2) * t * (((s *= 1.525) + 1) * t + s) + 2) + b;\n },\n ElasticEaseIn(t, b, c, d, a, p) {\n var s = 0;\n if (t === 0) {\n return b;\n }\n if ((t /= d) === 1) {\n return b + c;\n }\n if (!p) {\n p = d * 0.3;\n }\n if (!a || a < Math.abs(c)) {\n a = c;\n s = p / 4;\n }\n else {\n s = (p / (2 * Math.PI)) * Math.asin(c / a);\n }\n return (-(a *\n Math.pow(2, 10 * (t -= 1)) *\n Math.sin(((t * d - s) * (2 * Math.PI)) / p)) + b);\n },\n ElasticEaseOut(t, b, c, d, a, p) {\n var s = 0;\n if (t === 0) {\n return b;\n }\n if ((t /= d) === 1) {\n return b + c;\n }\n if (!p) {\n p = d * 0.3;\n }\n if (!a || a < Math.abs(c)) {\n a = c;\n s = p / 4;\n }\n else {\n s = (p / (2 * Math.PI)) * Math.asin(c / a);\n }\n return (a * Math.pow(2, -10 * t) * Math.sin(((t * d - s) * (2 * Math.PI)) / p) +\n c +\n b);\n },\n ElasticEaseInOut(t, b, c, d, a, p) {\n var s = 0;\n if (t === 0) {\n return b;\n }\n if ((t /= d / 2) === 2) {\n return b + c;\n }\n if (!p) {\n p = d * (0.3 * 1.5);\n }\n if (!a || a < Math.abs(c)) {\n a = c;\n s = p / 4;\n }\n else {\n s = (p / (2 * Math.PI)) * Math.asin(c / a);\n }\n if (t < 1) {\n return (-0.5 *\n (a *\n Math.pow(2, 10 * (t -= 1)) *\n Math.sin(((t * d - s) * (2 * Math.PI)) / p)) +\n b);\n }\n return (a *\n Math.pow(2, -10 * (t -= 1)) *\n Math.sin(((t * d - s) * (2 * Math.PI)) / p) *\n 0.5 +\n c +\n b);\n },\n BounceEaseOut(t, b, c, d) {\n if ((t /= d) < 1 / 2.75) {\n return c * (7.5625 * t * t) + b;\n }\n else if (t < 2 / 2.75) {\n return c * (7.5625 * (t -= 1.5 / 2.75) * t + 0.75) + b;\n }\n else if (t < 2.5 / 2.75) {\n return c * (7.5625 * (t -= 2.25 / 2.75) * t + 0.9375) + b;\n }\n else {\n return c * (7.5625 * (t -= 2.625 / 2.75) * t + 0.984375) + b;\n }\n },\n BounceEaseIn(t, b, c, d) {\n return c - exports.Easings.BounceEaseOut(d - t, 0, c, d) + b;\n },\n BounceEaseInOut(t, b, c, d) {\n if (t < d / 2) {\n return exports.Easings.BounceEaseIn(t * 2, 0, c, d) * 0.5 + b;\n }\n else {\n return exports.Easings.BounceEaseOut(t * 2 - d, 0, c, d) * 0.5 + c * 0.5 + b;\n }\n },\n EaseIn(t, b, c, d) {\n return c * (t /= d) * t + b;\n },\n EaseOut(t, b, c, d) {\n return -c * (t /= d) * (t - 2) + b;\n },\n EaseInOut(t, b, c, d) {\n if ((t /= d / 2) < 1) {\n return (c / 2) * t * t + b;\n }\n return (-c / 2) * (--t * (t - 2) - 1) + b;\n },\n StrongEaseIn(t, b, c, d) {\n return c * (t /= d) * t * t * t * t + b;\n },\n StrongEaseOut(t, b, c, d) {\n return c * ((t = t / d - 1) * t * t * t * t + 1) + b;\n },\n StrongEaseInOut(t, b, c, d) {\n if ((t /= d / 2) < 1) {\n return (c / 2) * t * t * t * t * t + b;\n }\n return (c / 2) * ((t -= 2) * t * t * t * t + 2) + b;\n },\n Linear(t, b, c, d) {\n return (c * t) / d + b;\n },\n};\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Konva = void 0;\nconst Global_1 = require(\"./Global\");\nconst Util_1 = require(\"./Util\");\nconst Node_1 = require(\"./Node\");\nconst Container_1 = require(\"./Container\");\nconst Stage_1 = require(\"./Stage\");\nconst Layer_1 = require(\"./Layer\");\nconst FastLayer_1 = require(\"./FastLayer\");\nconst Group_1 = require(\"./Group\");\nconst DragAndDrop_1 = require(\"./DragAndDrop\");\nconst Shape_1 = require(\"./Shape\");\nconst Animation_1 = require(\"./Animation\");\nconst Tween_1 = require(\"./Tween\");\nconst Context_1 = require(\"./Context\");\nconst Canvas_1 = require(\"./Canvas\");\nexports.Konva = Util_1.Util._assign(Global_1.Konva, {\n Util: Util_1.Util,\n Transform: Util_1.Transform,\n Node: Node_1.Node,\n Container: Container_1.Container,\n Stage: Stage_1.Stage,\n stages: Stage_1.stages,\n Layer: Layer_1.Layer,\n FastLayer: FastLayer_1.FastLayer,\n Group: Group_1.Group,\n DD: DragAndDrop_1.DD,\n Shape: Shape_1.Shape,\n shapes: Shape_1.shapes,\n Animation: Animation_1.Animation,\n Tween: Tween_1.Tween,\n Easings: Tween_1.Easings,\n Context: Context_1.Context,\n Canvas: Canvas_1.Canvas,\n});\nexports.default = exports.Konva;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Arc = void 0;\nconst Factory_1 = require(\"../Factory\");\nconst Shape_1 = require(\"../Shape\");\nconst Global_1 = require(\"../Global\");\nconst Validators_1 = require(\"../Validators\");\nconst Global_2 = require(\"../Global\");\nclass Arc extends Shape_1.Shape {\n _sceneFunc(context) {\n var angle = Global_1.Konva.getAngle(this.angle()), clockwise = this.clockwise();\n context.beginPath();\n context.arc(0, 0, this.outerRadius(), 0, angle, clockwise);\n context.arc(0, 0, this.innerRadius(), angle, 0, !clockwise);\n context.closePath();\n context.fillStrokeShape(this);\n }\n getWidth() {\n return this.outerRadius() * 2;\n }\n getHeight() {\n return this.outerRadius() * 2;\n }\n setWidth(width) {\n this.outerRadius(width / 2);\n }\n setHeight(height) {\n this.outerRadius(height / 2);\n }\n getSelfRect() {\n const innerRadius = this.innerRadius();\n const outerRadius = this.outerRadius();\n const clockwise = this.clockwise();\n const angle = Global_1.Konva.getAngle(clockwise ? 360 - this.angle() : this.angle());\n const boundLeftRatio = Math.cos(Math.min(angle, Math.PI));\n const boundRightRatio = 1;\n const boundTopRatio = Math.sin(Math.min(Math.max(Math.PI, angle), (3 * Math.PI) / 2));\n const boundBottomRatio = Math.sin(Math.min(angle, Math.PI / 2));\n const boundLeft = boundLeftRatio * (boundLeftRatio > 0 ? innerRadius : outerRadius);\n const boundRight = boundRightRatio * (boundRightRatio > 0 ? outerRadius : innerRadius);\n const boundTop = boundTopRatio * (boundTopRatio > 0 ? innerRadius : outerRadius);\n const boundBottom = boundBottomRatio * (boundBottomRatio > 0 ? outerRadius : innerRadius);\n return {\n x: boundLeft,\n y: clockwise ? -1 * boundBottom : boundTop,\n width: boundRight - boundLeft,\n height: boundBottom - boundTop,\n };\n }\n}\nexports.Arc = Arc;\nArc.prototype._centroid = true;\nArc.prototype.className = 'Arc';\nArc.prototype._attrsAffectingSize = ['innerRadius', 'outerRadius'];\n(0, Global_2._registerNode)(Arc);\nFactory_1.Factory.addGetterSetter(Arc, 'innerRadius', 0, (0, Validators_1.getNumberValidator)());\nFactory_1.Factory.addGetterSetter(Arc, 'outerRadius', 0, (0, Validators_1.getNumberValidator)());\nFactory_1.Factory.addGetterSetter(Arc, 'angle', 0, (0, Validators_1.getNumberValidator)());\nFactory_1.Factory.addGetterSetter(Arc, 'clockwise', false, (0, Validators_1.getBooleanValidator)());\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Line = void 0;\nconst Factory_1 = require(\"../Factory\");\nconst Shape_1 = require(\"../Shape\");\nconst Validators_1 = require(\"../Validators\");\nconst Global_1 = require(\"../Global\");\nfunction getControlPoints(x0, y0, x1, y1, x2, y2, t) {\n var d01 = Math.sqrt(Math.pow(x1 - x0, 2) + Math.pow(y1 - y0, 2)), d12 = Math.sqrt(Math.pow(x2 - x1, 2) + Math.pow(y2 - y1, 2)), fa = (t * d01) / (d01 + d12), fb = (t * d12) / (d01 + d12), p1x = x1 - fa * (x2 - x0), p1y = y1 - fa * (y2 - y0), p2x = x1 + fb * (x2 - x0), p2y = y1 + fb * (y2 - y0);\n return [p1x, p1y, p2x, p2y];\n}\nfunction expandPoints(p, tension) {\n var len = p.length, allPoints = [], n, cp;\n for (n = 2; n < len - 2; n += 2) {\n cp = getControlPoints(p[n - 2], p[n - 1], p[n], p[n + 1], p[n + 2], p[n + 3], tension);\n if (isNaN(cp[0])) {\n continue;\n }\n allPoints.push(cp[0]);\n allPoints.push(cp[1]);\n allPoints.push(p[n]);\n allPoints.push(p[n + 1]);\n allPoints.push(cp[2]);\n allPoints.push(cp[3]);\n }\n return allPoints;\n}\nclass Line extends Shape_1.Shape {\n constructor(config) {\n super(config);\n this.on('pointsChange.konva tensionChange.konva closedChange.konva bezierChange.konva', function () {\n this._clearCache('tensionPoints');\n });\n }\n _sceneFunc(context) {\n var points = this.points(), length = points.length, tension = this.tension(), closed = this.closed(), bezier = this.bezier(), tp, len, n;\n if (!length) {\n return;\n }\n context.beginPath();\n context.moveTo(points[0], points[1]);\n if (tension !== 0 && length > 4) {\n tp = this.getTensionPoints();\n len = tp.length;\n n = closed ? 0 : 4;\n if (!closed) {\n context.quadraticCurveTo(tp[0], tp[1], tp[2], tp[3]);\n }\n while (n < len - 2) {\n context.bezierCurveTo(tp[n++], tp[n++], tp[n++], tp[n++], tp[n++], tp[n++]);\n }\n if (!closed) {\n context.quadraticCurveTo(tp[len - 2], tp[len - 1], points[length - 2], points[length - 1]);\n }\n }\n else if (bezier) {\n n = 2;\n while (n < length) {\n context.bezierCurveTo(points[n++], points[n++], points[n++], points[n++], points[n++], points[n++]);\n }\n }\n else {\n for (n = 2; n < length; n += 2) {\n context.lineTo(points[n], points[n + 1]);\n }\n }\n if (closed) {\n context.closePath();\n context.fillStrokeShape(this);\n }\n else {\n context.strokeShape(this);\n }\n }\n getTensionPoints() {\n return this._getCache('tensionPoints', this._getTensionPoints);\n }\n _getTensionPoints() {\n if (this.closed()) {\n return this._getTensionPointsClosed();\n }\n else {\n return expandPoints(this.points(), this.tension());\n }\n }\n _getTensionPointsClosed() {\n var p = this.points(), len = p.length, tension = this.tension(), firstControlPoints = getControlPoints(p[len - 2], p[len - 1], p[0], p[1], p[2], p[3], tension), lastControlPoints = getControlPoints(p[len - 4], p[len - 3], p[len - 2], p[len - 1], p[0], p[1], tension), middle = expandPoints(p, tension), tp = [firstControlPoints[2], firstControlPoints[3]]\n .concat(middle)\n .concat([\n lastControlPoints[0],\n lastControlPoints[1],\n p[len - 2],\n p[len - 1],\n lastControlPoints[2],\n lastControlPoints[3],\n firstControlPoints[0],\n firstControlPoints[1],\n p[0],\n p[1],\n ]);\n return tp;\n }\n getWidth() {\n return this.getSelfRect().width;\n }\n getHeight() {\n return this.getSelfRect().height;\n }\n getSelfRect() {\n var points = this.points();\n if (points.length < 4) {\n return {\n x: points[0] || 0,\n y: points[1] || 0,\n width: 0,\n height: 0,\n };\n }\n if (this.tension() !== 0) {\n points = [\n points[0],\n points[1],\n ...this._getTensionPoints(),\n points[points.length - 2],\n points[points.length - 1],\n ];\n }\n else {\n points = this.points();\n }\n var minX = points[0];\n var maxX = points[0];\n var minY = points[1];\n var maxY = points[1];\n var x, y;\n for (var i = 0; i < points.length / 2; i++) {\n x = points[i * 2];\n y = points[i * 2 + 1];\n minX = Math.min(minX, x);\n maxX = Math.max(maxX, x);\n minY = Math.min(minY, y);\n maxY = Math.max(maxY, y);\n }\n return {\n x: minX,\n y: minY,\n width: maxX - minX,\n height: maxY - minY,\n };\n }\n}\nexports.Line = Line;\nLine.prototype.className = 'Line';\nLine.prototype._attrsAffectingSize = ['points', 'bezier', 'tension'];\n(0, Global_1._registerNode)(Line);\nFactory_1.Factory.addGetterSetter(Line, 'closed', false);\nFactory_1.Factory.addGetterSetter(Line, 'bezier', false);\nFactory_1.Factory.addGetterSetter(Line, 'tension', 0, (0, Validators_1.getNumberValidator)());\nFactory_1.Factory.addGetterSetter(Line, 'points', [], (0, Validators_1.getNumberArrayValidator)());\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.t2length = exports.getQuadraticArcLength = exports.getCubicArcLength = exports.binomialCoefficients = exports.cValues = exports.tValues = void 0;\nexports.tValues = [\n [],\n [],\n [\n -0.5773502691896257645091487805019574556476,\n 0.5773502691896257645091487805019574556476,\n ],\n [\n 0, -0.7745966692414833770358530799564799221665,\n 0.7745966692414833770358530799564799221665,\n ],\n [\n -0.3399810435848562648026657591032446872005,\n 0.3399810435848562648026657591032446872005,\n -0.8611363115940525752239464888928095050957,\n 0.8611363115940525752239464888928095050957,\n ],\n [\n 0, -0.5384693101056830910363144207002088049672,\n 0.5384693101056830910363144207002088049672,\n -0.9061798459386639927976268782993929651256,\n 0.9061798459386639927976268782993929651256,\n ],\n [\n 0.6612093864662645136613995950199053470064,\n -0.6612093864662645136613995950199053470064,\n -0.2386191860831969086305017216807119354186,\n 0.2386191860831969086305017216807119354186,\n -0.9324695142031520278123015544939946091347,\n 0.9324695142031520278123015544939946091347,\n ],\n [\n 0, 0.4058451513773971669066064120769614633473,\n -0.4058451513773971669066064120769614633473,\n -0.7415311855993944398638647732807884070741,\n 0.7415311855993944398638647732807884070741,\n -0.9491079123427585245261896840478512624007,\n 0.9491079123427585245261896840478512624007,\n ],\n [\n -0.1834346424956498049394761423601839806667,\n 0.1834346424956498049394761423601839806667,\n -0.5255324099163289858177390491892463490419,\n 0.5255324099163289858177390491892463490419,\n -0.7966664774136267395915539364758304368371,\n 0.7966664774136267395915539364758304368371,\n -0.9602898564975362316835608685694729904282,\n 0.9602898564975362316835608685694729904282,\n ],\n [\n 0, -0.8360311073266357942994297880697348765441,\n 0.8360311073266357942994297880697348765441,\n -0.9681602395076260898355762029036728700494,\n 0.9681602395076260898355762029036728700494,\n -0.3242534234038089290385380146433366085719,\n 0.3242534234038089290385380146433366085719,\n -0.6133714327005903973087020393414741847857,\n 0.6133714327005903973087020393414741847857,\n ],\n [\n -0.1488743389816312108848260011297199846175,\n 0.1488743389816312108848260011297199846175,\n -0.4333953941292471907992659431657841622,\n 0.4333953941292471907992659431657841622,\n -0.6794095682990244062343273651148735757692,\n 0.6794095682990244062343273651148735757692,\n -0.8650633666889845107320966884234930485275,\n 0.8650633666889845107320966884234930485275,\n -0.9739065285171717200779640120844520534282,\n 0.9739065285171717200779640120844520534282,\n ],\n [\n 0, -0.2695431559523449723315319854008615246796,\n 0.2695431559523449723315319854008615246796,\n -0.5190961292068118159257256694586095544802,\n 0.5190961292068118159257256694586095544802,\n -0.7301520055740493240934162520311534580496,\n 0.7301520055740493240934162520311534580496,\n -0.8870625997680952990751577693039272666316,\n 0.8870625997680952990751577693039272666316,\n -0.9782286581460569928039380011228573907714,\n 0.9782286581460569928039380011228573907714,\n ],\n [\n -0.1252334085114689154724413694638531299833,\n 0.1252334085114689154724413694638531299833,\n -0.3678314989981801937526915366437175612563,\n 0.3678314989981801937526915366437175612563,\n -0.587317954286617447296702418940534280369,\n 0.587317954286617447296702418940534280369,\n -0.7699026741943046870368938332128180759849,\n 0.7699026741943046870368938332128180759849,\n -0.9041172563704748566784658661190961925375,\n 0.9041172563704748566784658661190961925375,\n -0.9815606342467192506905490901492808229601,\n 0.9815606342467192506905490901492808229601,\n ],\n [\n 0, -0.2304583159551347940655281210979888352115,\n 0.2304583159551347940655281210979888352115,\n -0.4484927510364468528779128521276398678019,\n 0.4484927510364468528779128521276398678019,\n -0.6423493394403402206439846069955156500716,\n 0.6423493394403402206439846069955156500716,\n -0.8015780907333099127942064895828598903056,\n 0.8015780907333099127942064895828598903056,\n -0.9175983992229779652065478365007195123904,\n 0.9175983992229779652065478365007195123904,\n -0.9841830547185881494728294488071096110649,\n 0.9841830547185881494728294488071096110649,\n ],\n [\n -0.1080549487073436620662446502198347476119,\n 0.1080549487073436620662446502198347476119,\n -0.3191123689278897604356718241684754668342,\n 0.3191123689278897604356718241684754668342,\n -0.5152486363581540919652907185511886623088,\n 0.5152486363581540919652907185511886623088,\n -0.6872929048116854701480198030193341375384,\n 0.6872929048116854701480198030193341375384,\n -0.8272013150697649931897947426503949610397,\n 0.8272013150697649931897947426503949610397,\n -0.928434883663573517336391139377874264477,\n 0.928434883663573517336391139377874264477,\n -0.986283808696812338841597266704052801676,\n 0.986283808696812338841597266704052801676,\n ],\n [\n 0, -0.2011940939974345223006283033945962078128,\n 0.2011940939974345223006283033945962078128,\n -0.3941513470775633698972073709810454683627,\n 0.3941513470775633698972073709810454683627,\n -0.5709721726085388475372267372539106412383,\n 0.5709721726085388475372267372539106412383,\n -0.7244177313601700474161860546139380096308,\n 0.7244177313601700474161860546139380096308,\n -0.8482065834104272162006483207742168513662,\n 0.8482065834104272162006483207742168513662,\n -0.9372733924007059043077589477102094712439,\n 0.9372733924007059043077589477102094712439,\n -0.9879925180204854284895657185866125811469,\n 0.9879925180204854284895657185866125811469,\n ],\n [\n -0.0950125098376374401853193354249580631303,\n 0.0950125098376374401853193354249580631303,\n -0.281603550779258913230460501460496106486,\n 0.281603550779258913230460501460496106486,\n -0.45801677765722738634241944298357757354,\n 0.45801677765722738634241944298357757354,\n -0.6178762444026437484466717640487910189918,\n 0.6178762444026437484466717640487910189918,\n -0.7554044083550030338951011948474422683538,\n 0.7554044083550030338951011948474422683538,\n -0.8656312023878317438804678977123931323873,\n 0.8656312023878317438804678977123931323873,\n -0.9445750230732325760779884155346083450911,\n 0.9445750230732325760779884155346083450911,\n -0.9894009349916499325961541734503326274262,\n 0.9894009349916499325961541734503326274262,\n ],\n [\n 0, -0.1784841814958478558506774936540655574754,\n 0.1784841814958478558506774936540655574754,\n -0.3512317634538763152971855170953460050405,\n 0.3512317634538763152971855170953460050405,\n -0.5126905370864769678862465686295518745829,\n 0.5126905370864769678862465686295518745829,\n -0.6576711592166907658503022166430023351478,\n 0.6576711592166907658503022166430023351478,\n -0.7815140038968014069252300555204760502239,\n 0.7815140038968014069252300555204760502239,\n -0.8802391537269859021229556944881556926234,\n 0.8802391537269859021229556944881556926234,\n -0.9506755217687677612227169578958030214433,\n 0.9506755217687677612227169578958030214433,\n -0.9905754753144173356754340199406652765077,\n 0.9905754753144173356754340199406652765077,\n ],\n [\n -0.0847750130417353012422618529357838117333,\n 0.0847750130417353012422618529357838117333,\n -0.2518862256915055095889728548779112301628,\n 0.2518862256915055095889728548779112301628,\n -0.4117511614628426460359317938330516370789,\n 0.4117511614628426460359317938330516370789,\n -0.5597708310739475346078715485253291369276,\n 0.5597708310739475346078715485253291369276,\n -0.6916870430603532078748910812888483894522,\n 0.6916870430603532078748910812888483894522,\n -0.8037049589725231156824174550145907971032,\n 0.8037049589725231156824174550145907971032,\n -0.8926024664975557392060605911271455154078,\n 0.8926024664975557392060605911271455154078,\n -0.9558239495713977551811958929297763099728,\n 0.9558239495713977551811958929297763099728,\n -0.9915651684209309467300160047061507702525,\n 0.9915651684209309467300160047061507702525,\n ],\n [\n 0, -0.1603586456402253758680961157407435495048,\n 0.1603586456402253758680961157407435495048,\n -0.3165640999636298319901173288498449178922,\n 0.3165640999636298319901173288498449178922,\n -0.4645707413759609457172671481041023679762,\n 0.4645707413759609457172671481041023679762,\n -0.6005453046616810234696381649462392798683,\n 0.6005453046616810234696381649462392798683,\n -0.7209661773352293786170958608237816296571,\n 0.7209661773352293786170958608237816296571,\n -0.8227146565371428249789224867127139017745,\n 0.8227146565371428249789224867127139017745,\n -0.9031559036148179016426609285323124878093,\n 0.9031559036148179016426609285323124878093,\n -0.960208152134830030852778840687651526615,\n 0.960208152134830030852778840687651526615,\n -0.9924068438435844031890176702532604935893,\n 0.9924068438435844031890176702532604935893,\n ],\n [\n -0.0765265211334973337546404093988382110047,\n 0.0765265211334973337546404093988382110047,\n -0.227785851141645078080496195368574624743,\n 0.227785851141645078080496195368574624743,\n -0.3737060887154195606725481770249272373957,\n 0.3737060887154195606725481770249272373957,\n -0.5108670019508270980043640509552509984254,\n 0.5108670019508270980043640509552509984254,\n -0.6360536807265150254528366962262859367433,\n 0.6360536807265150254528366962262859367433,\n -0.7463319064601507926143050703556415903107,\n 0.7463319064601507926143050703556415903107,\n -0.8391169718222188233945290617015206853296,\n 0.8391169718222188233945290617015206853296,\n -0.9122344282513259058677524412032981130491,\n 0.9122344282513259058677524412032981130491,\n -0.963971927277913791267666131197277221912,\n 0.963971927277913791267666131197277221912,\n -0.9931285991850949247861223884713202782226,\n 0.9931285991850949247861223884713202782226,\n ],\n [\n 0, -0.1455618541608950909370309823386863301163,\n 0.1455618541608950909370309823386863301163,\n -0.288021316802401096600792516064600319909,\n 0.288021316802401096600792516064600319909,\n -0.4243421202074387835736688885437880520964,\n 0.4243421202074387835736688885437880520964,\n -0.551618835887219807059018796724313286622,\n 0.551618835887219807059018796724313286622,\n -0.667138804197412319305966669990339162597,\n 0.667138804197412319305966669990339162597,\n -0.7684399634756779086158778513062280348209,\n 0.7684399634756779086158778513062280348209,\n -0.8533633645833172836472506385875676702761,\n 0.8533633645833172836472506385875676702761,\n -0.9200993341504008287901871337149688941591,\n 0.9200993341504008287901871337149688941591,\n -0.9672268385663062943166222149076951614246,\n 0.9672268385663062943166222149076951614246,\n -0.9937521706203895002602420359379409291933,\n 0.9937521706203895002602420359379409291933,\n ],\n [\n -0.0697392733197222212138417961186280818222,\n 0.0697392733197222212138417961186280818222,\n -0.2078604266882212854788465339195457342156,\n 0.2078604266882212854788465339195457342156,\n -0.3419358208920842251581474204273796195591,\n 0.3419358208920842251581474204273796195591,\n -0.4693558379867570264063307109664063460953,\n 0.4693558379867570264063307109664063460953,\n -0.5876404035069115929588769276386473488776,\n 0.5876404035069115929588769276386473488776,\n -0.6944872631866827800506898357622567712673,\n 0.6944872631866827800506898357622567712673,\n -0.7878168059792081620042779554083515213881,\n 0.7878168059792081620042779554083515213881,\n -0.8658125777203001365364256370193787290847,\n 0.8658125777203001365364256370193787290847,\n -0.9269567721871740005206929392590531966353,\n 0.9269567721871740005206929392590531966353,\n -0.9700604978354287271239509867652687108059,\n 0.9700604978354287271239509867652687108059,\n -0.994294585482399292073031421161298980393,\n 0.994294585482399292073031421161298980393,\n ],\n [\n 0, -0.1332568242984661109317426822417661370104,\n 0.1332568242984661109317426822417661370104,\n -0.264135680970344930533869538283309602979,\n 0.264135680970344930533869538283309602979,\n -0.390301038030290831421488872880605458578,\n 0.390301038030290831421488872880605458578,\n -0.5095014778460075496897930478668464305448,\n 0.5095014778460075496897930478668464305448,\n -0.6196098757636461563850973116495956533871,\n 0.6196098757636461563850973116495956533871,\n -0.7186613631319501944616244837486188483299,\n 0.7186613631319501944616244837486188483299,\n -0.8048884016188398921511184069967785579414,\n 0.8048884016188398921511184069967785579414,\n -0.8767523582704416673781568859341456716389,\n 0.8767523582704416673781568859341456716389,\n -0.9329710868260161023491969890384229782357,\n 0.9329710868260161023491969890384229782357,\n -0.9725424712181152319560240768207773751816,\n 0.9725424712181152319560240768207773751816,\n -0.9947693349975521235239257154455743605736,\n 0.9947693349975521235239257154455743605736,\n ],\n [\n -0.0640568928626056260850430826247450385909,\n 0.0640568928626056260850430826247450385909,\n -0.1911188674736163091586398207570696318404,\n 0.1911188674736163091586398207570696318404,\n -0.3150426796961633743867932913198102407864,\n 0.3150426796961633743867932913198102407864,\n -0.4337935076260451384870842319133497124524,\n 0.4337935076260451384870842319133497124524,\n -0.5454214713888395356583756172183723700107,\n 0.5454214713888395356583756172183723700107,\n -0.6480936519369755692524957869107476266696,\n 0.6480936519369755692524957869107476266696,\n -0.7401241915785543642438281030999784255232,\n 0.7401241915785543642438281030999784255232,\n -0.8200019859739029219539498726697452080761,\n 0.8200019859739029219539498726697452080761,\n -0.8864155270044010342131543419821967550873,\n 0.8864155270044010342131543419821967550873,\n -0.9382745520027327585236490017087214496548,\n 0.9382745520027327585236490017087214496548,\n -0.9747285559713094981983919930081690617411,\n 0.9747285559713094981983919930081690617411,\n -0.9951872199970213601799974097007368118745,\n 0.9951872199970213601799974097007368118745,\n ],\n];\nexports.cValues = [\n [],\n [],\n [1.0, 1.0],\n [\n 0.8888888888888888888888888888888888888888,\n 0.5555555555555555555555555555555555555555,\n 0.5555555555555555555555555555555555555555,\n ],\n [\n 0.6521451548625461426269360507780005927646,\n 0.6521451548625461426269360507780005927646,\n 0.3478548451374538573730639492219994072353,\n 0.3478548451374538573730639492219994072353,\n ],\n [\n 0.5688888888888888888888888888888888888888,\n 0.4786286704993664680412915148356381929122,\n 0.4786286704993664680412915148356381929122,\n 0.2369268850561890875142640407199173626432,\n 0.2369268850561890875142640407199173626432,\n ],\n [\n 0.3607615730481386075698335138377161116615,\n 0.3607615730481386075698335138377161116615,\n 0.4679139345726910473898703439895509948116,\n 0.4679139345726910473898703439895509948116,\n 0.1713244923791703450402961421727328935268,\n 0.1713244923791703450402961421727328935268,\n ],\n [\n 0.4179591836734693877551020408163265306122,\n 0.3818300505051189449503697754889751338783,\n 0.3818300505051189449503697754889751338783,\n 0.2797053914892766679014677714237795824869,\n 0.2797053914892766679014677714237795824869,\n 0.1294849661688696932706114326790820183285,\n 0.1294849661688696932706114326790820183285,\n ],\n [\n 0.3626837833783619829651504492771956121941,\n 0.3626837833783619829651504492771956121941,\n 0.3137066458778872873379622019866013132603,\n 0.3137066458778872873379622019866013132603,\n 0.2223810344533744705443559944262408844301,\n 0.2223810344533744705443559944262408844301,\n 0.1012285362903762591525313543099621901153,\n 0.1012285362903762591525313543099621901153,\n ],\n [\n 0.3302393550012597631645250692869740488788,\n 0.1806481606948574040584720312429128095143,\n 0.1806481606948574040584720312429128095143,\n 0.0812743883615744119718921581105236506756,\n 0.0812743883615744119718921581105236506756,\n 0.3123470770400028400686304065844436655987,\n 0.3123470770400028400686304065844436655987,\n 0.2606106964029354623187428694186328497718,\n 0.2606106964029354623187428694186328497718,\n ],\n [\n 0.295524224714752870173892994651338329421,\n 0.295524224714752870173892994651338329421,\n 0.2692667193099963550912269215694693528597,\n 0.2692667193099963550912269215694693528597,\n 0.2190863625159820439955349342281631924587,\n 0.2190863625159820439955349342281631924587,\n 0.1494513491505805931457763396576973324025,\n 0.1494513491505805931457763396576973324025,\n 0.0666713443086881375935688098933317928578,\n 0.0666713443086881375935688098933317928578,\n ],\n [\n 0.272925086777900630714483528336342189156,\n 0.2628045445102466621806888698905091953727,\n 0.2628045445102466621806888698905091953727,\n 0.2331937645919904799185237048431751394317,\n 0.2331937645919904799185237048431751394317,\n 0.1862902109277342514260976414316558916912,\n 0.1862902109277342514260976414316558916912,\n 0.1255803694649046246346942992239401001976,\n 0.1255803694649046246346942992239401001976,\n 0.0556685671161736664827537204425485787285,\n 0.0556685671161736664827537204425485787285,\n ],\n [\n 0.2491470458134027850005624360429512108304,\n 0.2491470458134027850005624360429512108304,\n 0.2334925365383548087608498989248780562594,\n 0.2334925365383548087608498989248780562594,\n 0.2031674267230659217490644558097983765065,\n 0.2031674267230659217490644558097983765065,\n 0.160078328543346226334652529543359071872,\n 0.160078328543346226334652529543359071872,\n 0.1069393259953184309602547181939962242145,\n 0.1069393259953184309602547181939962242145,\n 0.047175336386511827194615961485017060317,\n 0.047175336386511827194615961485017060317,\n ],\n [\n 0.2325515532308739101945895152688359481566,\n 0.2262831802628972384120901860397766184347,\n 0.2262831802628972384120901860397766184347,\n 0.2078160475368885023125232193060527633865,\n 0.2078160475368885023125232193060527633865,\n 0.1781459807619457382800466919960979955128,\n 0.1781459807619457382800466919960979955128,\n 0.1388735102197872384636017768688714676218,\n 0.1388735102197872384636017768688714676218,\n 0.0921214998377284479144217759537971209236,\n 0.0921214998377284479144217759537971209236,\n 0.0404840047653158795200215922009860600419,\n 0.0404840047653158795200215922009860600419,\n ],\n [\n 0.2152638534631577901958764433162600352749,\n 0.2152638534631577901958764433162600352749,\n 0.2051984637212956039659240656612180557103,\n 0.2051984637212956039659240656612180557103,\n 0.1855383974779378137417165901251570362489,\n 0.1855383974779378137417165901251570362489,\n 0.1572031671581935345696019386238421566056,\n 0.1572031671581935345696019386238421566056,\n 0.1215185706879031846894148090724766259566,\n 0.1215185706879031846894148090724766259566,\n 0.0801580871597602098056332770628543095836,\n 0.0801580871597602098056332770628543095836,\n 0.0351194603317518630318328761381917806197,\n 0.0351194603317518630318328761381917806197,\n ],\n [\n 0.2025782419255612728806201999675193148386,\n 0.1984314853271115764561183264438393248186,\n 0.1984314853271115764561183264438393248186,\n 0.1861610000155622110268005618664228245062,\n 0.1861610000155622110268005618664228245062,\n 0.1662692058169939335532008604812088111309,\n 0.1662692058169939335532008604812088111309,\n 0.1395706779261543144478047945110283225208,\n 0.1395706779261543144478047945110283225208,\n 0.1071592204671719350118695466858693034155,\n 0.1071592204671719350118695466858693034155,\n 0.0703660474881081247092674164506673384667,\n 0.0703660474881081247092674164506673384667,\n 0.0307532419961172683546283935772044177217,\n 0.0307532419961172683546283935772044177217,\n ],\n [\n 0.1894506104550684962853967232082831051469,\n 0.1894506104550684962853967232082831051469,\n 0.1826034150449235888667636679692199393835,\n 0.1826034150449235888667636679692199393835,\n 0.1691565193950025381893120790303599622116,\n 0.1691565193950025381893120790303599622116,\n 0.1495959888165767320815017305474785489704,\n 0.1495959888165767320815017305474785489704,\n 0.1246289712555338720524762821920164201448,\n 0.1246289712555338720524762821920164201448,\n 0.0951585116824927848099251076022462263552,\n 0.0951585116824927848099251076022462263552,\n 0.0622535239386478928628438369943776942749,\n 0.0622535239386478928628438369943776942749,\n 0.0271524594117540948517805724560181035122,\n 0.0271524594117540948517805724560181035122,\n ],\n [\n 0.1794464703562065254582656442618856214487,\n 0.1765627053669926463252709901131972391509,\n 0.1765627053669926463252709901131972391509,\n 0.1680041021564500445099706637883231550211,\n 0.1680041021564500445099706637883231550211,\n 0.1540457610768102880814315948019586119404,\n 0.1540457610768102880814315948019586119404,\n 0.1351363684685254732863199817023501973721,\n 0.1351363684685254732863199817023501973721,\n 0.1118838471934039710947883856263559267358,\n 0.1118838471934039710947883856263559267358,\n 0.0850361483171791808835353701910620738504,\n 0.0850361483171791808835353701910620738504,\n 0.0554595293739872011294401653582446605128,\n 0.0554595293739872011294401653582446605128,\n 0.0241483028685479319601100262875653246916,\n 0.0241483028685479319601100262875653246916,\n ],\n [\n 0.1691423829631435918406564701349866103341,\n 0.1691423829631435918406564701349866103341,\n 0.1642764837458327229860537764659275904123,\n 0.1642764837458327229860537764659275904123,\n 0.1546846751262652449254180038363747721932,\n 0.1546846751262652449254180038363747721932,\n 0.1406429146706506512047313037519472280955,\n 0.1406429146706506512047313037519472280955,\n 0.1225552067114784601845191268002015552281,\n 0.1225552067114784601845191268002015552281,\n 0.1009420441062871655628139849248346070628,\n 0.1009420441062871655628139849248346070628,\n 0.0764257302548890565291296776166365256053,\n 0.0764257302548890565291296776166365256053,\n 0.0497145488949697964533349462026386416808,\n 0.0497145488949697964533349462026386416808,\n 0.0216160135264833103133427102664524693876,\n 0.0216160135264833103133427102664524693876,\n ],\n [\n 0.1610544498487836959791636253209167350399,\n 0.1589688433939543476499564394650472016787,\n 0.1589688433939543476499564394650472016787,\n 0.152766042065859666778855400897662998461,\n 0.152766042065859666778855400897662998461,\n 0.1426067021736066117757461094419029724756,\n 0.1426067021736066117757461094419029724756,\n 0.1287539625393362276755157848568771170558,\n 0.1287539625393362276755157848568771170558,\n 0.1115666455473339947160239016817659974813,\n 0.1115666455473339947160239016817659974813,\n 0.0914900216224499994644620941238396526609,\n 0.0914900216224499994644620941238396526609,\n 0.0690445427376412265807082580060130449618,\n 0.0690445427376412265807082580060130449618,\n 0.0448142267656996003328381574019942119517,\n 0.0448142267656996003328381574019942119517,\n 0.0194617882297264770363120414644384357529,\n 0.0194617882297264770363120414644384357529,\n ],\n [\n 0.1527533871307258506980843319550975934919,\n 0.1527533871307258506980843319550975934919,\n 0.1491729864726037467878287370019694366926,\n 0.1491729864726037467878287370019694366926,\n 0.1420961093183820513292983250671649330345,\n 0.1420961093183820513292983250671649330345,\n 0.1316886384491766268984944997481631349161,\n 0.1316886384491766268984944997481631349161,\n 0.118194531961518417312377377711382287005,\n 0.118194531961518417312377377711382287005,\n 0.1019301198172404350367501354803498761666,\n 0.1019301198172404350367501354803498761666,\n 0.0832767415767047487247581432220462061001,\n 0.0832767415767047487247581432220462061001,\n 0.0626720483341090635695065351870416063516,\n 0.0626720483341090635695065351870416063516,\n 0.040601429800386941331039952274932109879,\n 0.040601429800386941331039952274932109879,\n 0.0176140071391521183118619623518528163621,\n 0.0176140071391521183118619623518528163621,\n ],\n [\n 0.1460811336496904271919851476833711882448,\n 0.1445244039899700590638271665537525436099,\n 0.1445244039899700590638271665537525436099,\n 0.1398873947910731547221334238675831108927,\n 0.1398873947910731547221334238675831108927,\n 0.132268938633337461781052574496775604329,\n 0.132268938633337461781052574496775604329,\n 0.1218314160537285341953671771257335983563,\n 0.1218314160537285341953671771257335983563,\n 0.1087972991671483776634745780701056420336,\n 0.1087972991671483776634745780701056420336,\n 0.0934444234560338615532897411139320884835,\n 0.0934444234560338615532897411139320884835,\n 0.0761001136283793020170516533001831792261,\n 0.0761001136283793020170516533001831792261,\n 0.0571344254268572082836358264724479574912,\n 0.0571344254268572082836358264724479574912,\n 0.0369537897708524937999506682993296661889,\n 0.0369537897708524937999506682993296661889,\n 0.0160172282577743333242246168584710152658,\n 0.0160172282577743333242246168584710152658,\n ],\n [\n 0.1392518728556319933754102483418099578739,\n 0.1392518728556319933754102483418099578739,\n 0.1365414983460151713525738312315173965863,\n 0.1365414983460151713525738312315173965863,\n 0.1311735047870623707329649925303074458757,\n 0.1311735047870623707329649925303074458757,\n 0.1232523768105124242855609861548144719594,\n 0.1232523768105124242855609861548144719594,\n 0.1129322960805392183934006074217843191142,\n 0.1129322960805392183934006074217843191142,\n 0.1004141444428809649320788378305362823508,\n 0.1004141444428809649320788378305362823508,\n 0.0859416062170677274144436813727028661891,\n 0.0859416062170677274144436813727028661891,\n 0.0697964684245204880949614189302176573987,\n 0.0697964684245204880949614189302176573987,\n 0.0522933351526832859403120512732112561121,\n 0.0522933351526832859403120512732112561121,\n 0.0337749015848141547933022468659129013491,\n 0.0337749015848141547933022468659129013491,\n 0.0146279952982722006849910980471854451902,\n 0.0146279952982722006849910980471854451902,\n ],\n [\n 0.1336545721861061753514571105458443385831,\n 0.132462039404696617371642464703316925805,\n 0.132462039404696617371642464703316925805,\n 0.1289057221880821499785953393997936532597,\n 0.1289057221880821499785953393997936532597,\n 0.1230490843067295304675784006720096548158,\n 0.1230490843067295304675784006720096548158,\n 0.1149966402224113649416435129339613014914,\n 0.1149966402224113649416435129339613014914,\n 0.1048920914645414100740861850147438548584,\n 0.1048920914645414100740861850147438548584,\n 0.0929157660600351474770186173697646486034,\n 0.0929157660600351474770186173697646486034,\n 0.0792814117767189549228925247420432269137,\n 0.0792814117767189549228925247420432269137,\n 0.0642324214085258521271696151589109980391,\n 0.0642324214085258521271696151589109980391,\n 0.0480376717310846685716410716320339965612,\n 0.0480376717310846685716410716320339965612,\n 0.0309880058569794443106942196418845053837,\n 0.0309880058569794443106942196418845053837,\n 0.0134118594871417720813094934586150649766,\n 0.0134118594871417720813094934586150649766,\n ],\n [\n 0.1279381953467521569740561652246953718517,\n 0.1279381953467521569740561652246953718517,\n 0.1258374563468282961213753825111836887264,\n 0.1258374563468282961213753825111836887264,\n 0.121670472927803391204463153476262425607,\n 0.121670472927803391204463153476262425607,\n 0.1155056680537256013533444839067835598622,\n 0.1155056680537256013533444839067835598622,\n 0.1074442701159656347825773424466062227946,\n 0.1074442701159656347825773424466062227946,\n 0.0976186521041138882698806644642471544279,\n 0.0976186521041138882698806644642471544279,\n 0.086190161531953275917185202983742667185,\n 0.086190161531953275917185202983742667185,\n 0.0733464814110803057340336152531165181193,\n 0.0733464814110803057340336152531165181193,\n 0.0592985849154367807463677585001085845412,\n 0.0592985849154367807463677585001085845412,\n 0.0442774388174198061686027482113382288593,\n 0.0442774388174198061686027482113382288593,\n 0.0285313886289336631813078159518782864491,\n 0.0285313886289336631813078159518782864491,\n 0.0123412297999871995468056670700372915759,\n 0.0123412297999871995468056670700372915759,\n ],\n];\nexports.binomialCoefficients = [[1], [1, 1], [1, 2, 1], [1, 3, 3, 1]];\nconst getCubicArcLength = (xs, ys, t) => {\n let z;\n let sum;\n let correctedT;\n const n = 20;\n z = t / 2;\n sum = 0;\n for (let i = 0; i < n; i++) {\n correctedT = z * exports.tValues[n][i] + z;\n sum += exports.cValues[n][i] * BFunc(xs, ys, correctedT);\n }\n return z * sum;\n};\nexports.getCubicArcLength = getCubicArcLength;\nconst getQuadraticArcLength = (xs, ys, t) => {\n if (t === undefined) {\n t = 1;\n }\n const ax = xs[0] - 2 * xs[1] + xs[2];\n const ay = ys[0] - 2 * ys[1] + ys[2];\n const bx = 2 * xs[1] - 2 * xs[0];\n const by = 2 * ys[1] - 2 * ys[0];\n const A = 4 * (ax * ax + ay * ay);\n const B = 4 * (ax * bx + ay * by);\n const C = bx * bx + by * by;\n if (A === 0) {\n return (t * Math.sqrt(Math.pow(xs[2] - xs[0], 2) + Math.pow(ys[2] - ys[0], 2)));\n }\n const b = B / (2 * A);\n const c = C / A;\n const u = t + b;\n const k = c - b * b;\n const uuk = u * u + k > 0 ? Math.sqrt(u * u + k) : 0;\n const bbk = b * b + k > 0 ? Math.sqrt(b * b + k) : 0;\n const term = b + Math.sqrt(b * b + k) !== 0\n ? k * Math.log(Math.abs((u + uuk) / (b + bbk)))\n : 0;\n return (Math.sqrt(A) / 2) * (u * uuk - b * bbk + term);\n};\nexports.getQuadraticArcLength = getQuadraticArcLength;\nfunction BFunc(xs, ys, t) {\n const xbase = getDerivative(1, t, xs);\n const ybase = getDerivative(1, t, ys);\n const combined = xbase * xbase + ybase * ybase;\n return Math.sqrt(combined);\n}\nconst getDerivative = (derivative, t, vs) => {\n const n = vs.length - 1;\n let _vs;\n let value;\n if (n === 0) {\n return 0;\n }\n if (derivative === 0) {\n value = 0;\n for (let k = 0; k <= n; k++) {\n value +=\n exports.binomialCoefficients[n][k] *\n Math.pow(1 - t, n - k) *\n Math.pow(t, k) *\n vs[k];\n }\n return value;\n }\n else {\n _vs = new Array(n);\n for (let k = 0; k < n; k++) {\n _vs[k] = n * (vs[k + 1] - vs[k]);\n }\n return getDerivative(derivative - 1, t, _vs);\n }\n};\nconst t2length = (length, totalLength, func) => {\n let error = 1;\n let t = length / totalLength;\n let step = (length - func(t)) / totalLength;\n let numIterations = 0;\n while (error > 0.001) {\n const increasedTLength = func(t + step);\n const increasedTError = Math.abs(length - increasedTLength) / totalLength;\n if (increasedTError < error) {\n error = increasedTError;\n t += step;\n }\n else {\n const decreasedTLength = func(t - step);\n const decreasedTError = Math.abs(length - decreasedTLength) / totalLength;\n if (decreasedTError < error) {\n error = decreasedTError;\n t -= step;\n }\n else {\n step /= 2;\n }\n }\n numIterations++;\n if (numIterations > 500) {\n break;\n }\n }\n return t;\n};\nexports.t2length = t2length;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Path = void 0;\nconst Factory_1 = require(\"../Factory\");\nconst Shape_1 = require(\"../Shape\");\nconst Global_1 = require(\"../Global\");\nconst BezierFunctions_1 = require(\"../BezierFunctions\");\nclass Path extends Shape_1.Shape {\n constructor(config) {\n super(config);\n this.dataArray = [];\n this.pathLength = 0;\n this._readDataAttribute();\n this.on('dataChange.konva', function () {\n this._readDataAttribute();\n });\n }\n _readDataAttribute() {\n this.dataArray = Path.parsePathData(this.data());\n this.pathLength = Path.getPathLength(this.dataArray);\n }\n _sceneFunc(context) {\n var ca = this.dataArray;\n context.beginPath();\n var isClosed = false;\n for (var n = 0; n < ca.length; n++) {\n var c = ca[n].command;\n var p = ca[n].points;\n switch (c) {\n case 'L':\n context.lineTo(p[0], p[1]);\n break;\n case 'M':\n context.moveTo(p[0], p[1]);\n break;\n case 'C':\n context.bezierCurveTo(p[0], p[1], p[2], p[3], p[4], p[5]);\n break;\n case 'Q':\n context.quadraticCurveTo(p[0], p[1], p[2], p[3]);\n break;\n case 'A':\n var cx = p[0], cy = p[1], rx = p[2], ry = p[3], theta = p[4], dTheta = p[5], psi = p[6], fs = p[7];\n var r = rx > ry ? rx : ry;\n var scaleX = rx > ry ? 1 : rx / ry;\n var scaleY = rx > ry ? ry / rx : 1;\n context.translate(cx, cy);\n context.rotate(psi);\n context.scale(scaleX, scaleY);\n context.arc(0, 0, r, theta, theta + dTheta, 1 - fs);\n context.scale(1 / scaleX, 1 / scaleY);\n context.rotate(-psi);\n context.translate(-cx, -cy);\n break;\n case 'z':\n isClosed = true;\n context.closePath();\n break;\n }\n }\n if (!isClosed && !this.hasFill()) {\n context.strokeShape(this);\n }\n else {\n context.fillStrokeShape(this);\n }\n }\n getSelfRect() {\n var points = [];\n this.dataArray.forEach(function (data) {\n if (data.command === 'A') {\n var start = data.points[4];\n var dTheta = data.points[5];\n var end = data.points[4] + dTheta;\n var inc = Math.PI / 180.0;\n if (Math.abs(start - end) < inc) {\n inc = Math.abs(start - end);\n }\n if (dTheta < 0) {\n for (let t = start - inc; t > end; t -= inc) {\n const point = Path.getPointOnEllipticalArc(data.points[0], data.points[1], data.points[2], data.points[3], t, 0);\n points.push(point.x, point.y);\n }\n }\n else {\n for (let t = start + inc; t < end; t += inc) {\n const point = Path.getPointOnEllipticalArc(data.points[0], data.points[1], data.points[2], data.points[3], t, 0);\n points.push(point.x, point.y);\n }\n }\n }\n else if (data.command === 'C') {\n for (let t = 0.0; t <= 1; t += 0.01) {\n const point = Path.getPointOnCubicBezier(t, data.start.x, data.start.y, data.points[0], data.points[1], data.points[2], data.points[3], data.points[4], data.points[5]);\n points.push(point.x, point.y);\n }\n }\n else {\n points = points.concat(data.points);\n }\n });\n var minX = points[0];\n var maxX = points[0];\n var minY = points[1];\n var maxY = points[1];\n var x, y;\n for (var i = 0; i < points.length / 2; i++) {\n x = points[i * 2];\n y = points[i * 2 + 1];\n if (!isNaN(x)) {\n minX = Math.min(minX, x);\n maxX = Math.max(maxX, x);\n }\n if (!isNaN(y)) {\n minY = Math.min(minY, y);\n maxY = Math.max(maxY, y);\n }\n }\n return {\n x: minX,\n y: minY,\n width: maxX - minX,\n height: maxY - minY,\n };\n }\n getLength() {\n return this.pathLength;\n }\n getPointAtLength(length) {\n return Path.getPointAtLengthOfDataArray(length, this.dataArray);\n }\n static getLineLength(x1, y1, x2, y2) {\n return Math.sqrt((x2 - x1) * (x2 - x1) + (y2 - y1) * (y2 - y1));\n }\n static getPathLength(dataArray) {\n let pathLength = 0;\n for (var i = 0; i < dataArray.length; ++i) {\n pathLength += dataArray[i].pathLength;\n }\n return pathLength;\n }\n static getPointAtLengthOfDataArray(length, dataArray) {\n var point, i = 0, ii = dataArray.length;\n if (!ii) {\n return null;\n }\n while (i < ii && length > dataArray[i].pathLength) {\n length -= dataArray[i].pathLength;\n ++i;\n }\n if (i === ii) {\n point = dataArray[i - 1].points.slice(-2);\n return {\n x: point[0],\n y: point[1],\n };\n }\n if (length < 0.01) {\n point = dataArray[i].points.slice(0, 2);\n return {\n x: point[0],\n y: point[1],\n };\n }\n var cp = dataArray[i];\n var p = cp.points;\n switch (cp.command) {\n case 'L':\n return Path.getPointOnLine(length, cp.start.x, cp.start.y, p[0], p[1]);\n case 'C':\n return Path.getPointOnCubicBezier((0, BezierFunctions_1.t2length)(length, Path.getPathLength(dataArray), (i) => {\n return (0, BezierFunctions_1.getCubicArcLength)([cp.start.x, p[0], p[2], p[4]], [cp.start.y, p[1], p[3], p[5]], i);\n }), cp.start.x, cp.start.y, p[0], p[1], p[2], p[3], p[4], p[5]);\n case 'Q':\n return Path.getPointOnQuadraticBezier((0, BezierFunctions_1.t2length)(length, Path.getPathLength(dataArray), (i) => {\n return (0, BezierFunctions_1.getQuadraticArcLength)([cp.start.x, p[0], p[2]], [cp.start.y, p[1], p[3]], i);\n }), cp.start.x, cp.start.y, p[0], p[1], p[2], p[3]);\n case 'A':\n var cx = p[0], cy = p[1], rx = p[2], ry = p[3], theta = p[4], dTheta = p[5], psi = p[6];\n theta += (dTheta * length) / cp.pathLength;\n return Path.getPointOnEllipticalArc(cx, cy, rx, ry, theta, psi);\n }\n return null;\n }\n static getPointOnLine(dist, P1x, P1y, P2x, P2y, fromX, fromY) {\n if (fromX === undefined) {\n fromX = P1x;\n }\n if (fromY === undefined) {\n fromY = P1y;\n }\n var m = (P2y - P1y) / (P2x - P1x + 0.00000001);\n var run = Math.sqrt((dist * dist) / (1 + m * m));\n if (P2x < P1x) {\n run *= -1;\n }\n var rise = m * run;\n var pt;\n if (P2x === P1x) {\n pt = {\n x: fromX,\n y: fromY + rise,\n };\n }\n else if ((fromY - P1y) / (fromX - P1x + 0.00000001) === m) {\n pt = {\n x: fromX + run,\n y: fromY + rise,\n };\n }\n else {\n var ix, iy;\n var len = this.getLineLength(P1x, P1y, P2x, P2y);\n var u = (fromX - P1x) * (P2x - P1x) + (fromY - P1y) * (P2y - P1y);\n u = u / (len * len);\n ix = P1x + u * (P2x - P1x);\n iy = P1y + u * (P2y - P1y);\n var pRise = this.getLineLength(fromX, fromY, ix, iy);\n var pRun = Math.sqrt(dist * dist - pRise * pRise);\n run = Math.sqrt((pRun * pRun) / (1 + m * m));\n if (P2x < P1x) {\n run *= -1;\n }\n rise = m * run;\n pt = {\n x: ix + run,\n y: iy + rise,\n };\n }\n return pt;\n }\n static getPointOnCubicBezier(pct, P1x, P1y, P2x, P2y, P3x, P3y, P4x, P4y) {\n function CB1(t) {\n return t * t * t;\n }\n function CB2(t) {\n return 3 * t * t * (1 - t);\n }\n function CB3(t) {\n return 3 * t * (1 - t) * (1 - t);\n }\n function CB4(t) {\n return (1 - t) * (1 - t) * (1 - t);\n }\n var x = P4x * CB1(pct) + P3x * CB2(pct) + P2x * CB3(pct) + P1x * CB4(pct);\n var y = P4y * CB1(pct) + P3y * CB2(pct) + P2y * CB3(pct) + P1y * CB4(pct);\n return {\n x: x,\n y: y,\n };\n }\n static getPointOnQuadraticBezier(pct, P1x, P1y, P2x, P2y, P3x, P3y) {\n function QB1(t) {\n return t * t;\n }\n function QB2(t) {\n return 2 * t * (1 - t);\n }\n function QB3(t) {\n return (1 - t) * (1 - t);\n }\n var x = P3x * QB1(pct) + P2x * QB2(pct) + P1x * QB3(pct);\n var y = P3y * QB1(pct) + P2y * QB2(pct) + P1y * QB3(pct);\n return {\n x: x,\n y: y,\n };\n }\n static getPointOnEllipticalArc(cx, cy, rx, ry, theta, psi) {\n var cosPsi = Math.cos(psi), sinPsi = Math.sin(psi);\n var pt = {\n x: rx * Math.cos(theta),\n y: ry * Math.sin(theta),\n };\n return {\n x: cx + (pt.x * cosPsi - pt.y * sinPsi),\n y: cy + (pt.x * sinPsi + pt.y * cosPsi),\n };\n }\n static parsePathData(data) {\n if (!data) {\n return [];\n }\n var cs = data;\n var cc = [\n 'm',\n 'M',\n 'l',\n 'L',\n 'v',\n 'V',\n 'h',\n 'H',\n 'z',\n 'Z',\n 'c',\n 'C',\n 'q',\n 'Q',\n 't',\n 'T',\n 's',\n 'S',\n 'a',\n 'A',\n ];\n cs = cs.replace(new RegExp(' ', 'g'), ',');\n for (var n = 0; n < cc.length; n++) {\n cs = cs.replace(new RegExp(cc[n], 'g'), '|' + cc[n]);\n }\n var arr = cs.split('|');\n var ca = [];\n var coords = [];\n var cpx = 0;\n var cpy = 0;\n var re = /([-+]?((\\d+\\.\\d+)|((\\d+)|(\\.\\d+)))(?:e[-+]?\\d+)?)/gi;\n var match;\n for (n = 1; n < arr.length; n++) {\n var str = arr[n];\n var c = str.charAt(0);\n str = str.slice(1);\n coords.length = 0;\n while ((match = re.exec(str))) {\n coords.push(match[0]);\n }\n var p = [];\n for (var j = 0, jlen = coords.length; j < jlen; j++) {\n if (coords[j] === '00') {\n p.push(0, 0);\n continue;\n }\n var parsed = parseFloat(coords[j]);\n if (!isNaN(parsed)) {\n p.push(parsed);\n }\n else {\n p.push(0);\n }\n }\n while (p.length > 0) {\n if (isNaN(p[0])) {\n break;\n }\n var cmd = '';\n var points = [];\n var startX = cpx, startY = cpy;\n var prevCmd, ctlPtx, ctlPty;\n var rx, ry, psi, fa, fs, x1, y1;\n switch (c) {\n case 'l':\n cpx += p.shift();\n cpy += p.shift();\n cmd = 'L';\n points.push(cpx, cpy);\n break;\n case 'L':\n cpx = p.shift();\n cpy = p.shift();\n points.push(cpx, cpy);\n break;\n case 'm':\n var dx = p.shift();\n var dy = p.shift();\n cpx += dx;\n cpy += dy;\n cmd = 'M';\n if (ca.length > 2 && ca[ca.length - 1].command === 'z') {\n for (var idx = ca.length - 2; idx >= 0; idx--) {\n if (ca[idx].command === 'M') {\n cpx = ca[idx].points[0] + dx;\n cpy = ca[idx].points[1] + dy;\n break;\n }\n }\n }\n points.push(cpx, cpy);\n c = 'l';\n break;\n case 'M':\n cpx = p.shift();\n cpy = p.shift();\n cmd = 'M';\n points.push(cpx, cpy);\n c = 'L';\n break;\n case 'h':\n cpx += p.shift();\n cmd = 'L';\n points.push(cpx, cpy);\n break;\n case 'H':\n cpx = p.shift();\n cmd = 'L';\n points.push(cpx, cpy);\n break;\n case 'v':\n cpy += p.shift();\n cmd = 'L';\n points.push(cpx, cpy);\n break;\n case 'V':\n cpy = p.shift();\n cmd = 'L';\n points.push(cpx, cpy);\n break;\n case 'C':\n points.push(p.shift(), p.shift(), p.shift(), p.shift());\n cpx = p.shift();\n cpy = p.shift();\n points.push(cpx, cpy);\n break;\n case 'c':\n points.push(cpx + p.shift(), cpy + p.shift(), cpx + p.shift(), cpy + p.shift());\n cpx += p.shift();\n cpy += p.shift();\n cmd = 'C';\n points.push(cpx, cpy);\n break;\n case 'S':\n ctlPtx = cpx;\n ctlPty = cpy;\n prevCmd = ca[ca.length - 1];\n if (prevCmd.command === 'C') {\n ctlPtx = cpx + (cpx - prevCmd.points[2]);\n ctlPty = cpy + (cpy - prevCmd.points[3]);\n }\n points.push(ctlPtx, ctlPty, p.shift(), p.shift());\n cpx = p.shift();\n cpy = p.shift();\n cmd = 'C';\n points.push(cpx, cpy);\n break;\n case 's':\n ctlPtx = cpx;\n ctlPty = cpy;\n prevCmd = ca[ca.length - 1];\n if (prevCmd.command === 'C') {\n ctlPtx = cpx + (cpx - prevCmd.points[2]);\n ctlPty = cpy + (cpy - prevCmd.points[3]);\n }\n points.push(ctlPtx, ctlPty, cpx + p.shift(), cpy + p.shift());\n cpx += p.shift();\n cpy += p.shift();\n cmd = 'C';\n points.push(cpx, cpy);\n break;\n case 'Q':\n points.push(p.shift(), p.shift());\n cpx = p.shift();\n cpy = p.shift();\n points.push(cpx, cpy);\n break;\n case 'q':\n points.push(cpx + p.shift(), cpy + p.shift());\n cpx += p.shift();\n cpy += p.shift();\n cmd = 'Q';\n points.push(cpx, cpy);\n break;\n case 'T':\n ctlPtx = cpx;\n ctlPty = cpy;\n prevCmd = ca[ca.length - 1];\n if (prevCmd.command === 'Q') {\n ctlPtx = cpx + (cpx - prevCmd.points[0]);\n ctlPty = cpy + (cpy - prevCmd.points[1]);\n }\n cpx = p.shift();\n cpy = p.shift();\n cmd = 'Q';\n points.push(ctlPtx, ctlPty, cpx, cpy);\n break;\n case 't':\n ctlPtx = cpx;\n ctlPty = cpy;\n prevCmd = ca[ca.length - 1];\n if (prevCmd.command === 'Q') {\n ctlPtx = cpx + (cpx - prevCmd.points[0]);\n ctlPty = cpy + (cpy - prevCmd.points[1]);\n }\n cpx += p.shift();\n cpy += p.shift();\n cmd = 'Q';\n points.push(ctlPtx, ctlPty, cpx, cpy);\n break;\n case 'A':\n rx = p.shift();\n ry = p.shift();\n psi = p.shift();\n fa = p.shift();\n fs = p.shift();\n x1 = cpx;\n y1 = cpy;\n cpx = p.shift();\n cpy = p.shift();\n cmd = 'A';\n points = this.convertEndpointToCenterParameterization(x1, y1, cpx, cpy, fa, fs, rx, ry, psi);\n break;\n case 'a':\n rx = p.shift();\n ry = p.shift();\n psi = p.shift();\n fa = p.shift();\n fs = p.shift();\n x1 = cpx;\n y1 = cpy;\n cpx += p.shift();\n cpy += p.shift();\n cmd = 'A';\n points = this.convertEndpointToCenterParameterization(x1, y1, cpx, cpy, fa, fs, rx, ry, psi);\n break;\n }\n ca.push({\n command: cmd || c,\n points: points,\n start: {\n x: startX,\n y: startY,\n },\n pathLength: this.calcLength(startX, startY, cmd || c, points),\n });\n }\n if (c === 'z' || c === 'Z') {\n ca.push({\n command: 'z',\n points: [],\n start: undefined,\n pathLength: 0,\n });\n }\n }\n return ca;\n }\n static calcLength(x, y, cmd, points) {\n var len, p1, p2, t;\n var path = Path;\n switch (cmd) {\n case 'L':\n return path.getLineLength(x, y, points[0], points[1]);\n case 'C':\n return (0, BezierFunctions_1.getCubicArcLength)([x, points[0], points[2], points[4]], [y, points[1], points[3], points[5]], 1);\n case 'Q':\n return (0, BezierFunctions_1.getQuadraticArcLength)([x, points[0], points[2]], [y, points[1], points[3]], 1);\n case 'A':\n len = 0.0;\n var start = points[4];\n var dTheta = points[5];\n var end = points[4] + dTheta;\n var inc = Math.PI / 180.0;\n if (Math.abs(start - end) < inc) {\n inc = Math.abs(start - end);\n }\n p1 = path.getPointOnEllipticalArc(points[0], points[1], points[2], points[3], start, 0);\n if (dTheta < 0) {\n for (t = start - inc; t > end; t -= inc) {\n p2 = path.getPointOnEllipticalArc(points[0], points[1], points[2], points[3], t, 0);\n len += path.getLineLength(p1.x, p1.y, p2.x, p2.y);\n p1 = p2;\n }\n }\n else {\n for (t = start + inc; t < end; t += inc) {\n p2 = path.getPointOnEllipticalArc(points[0], points[1], points[2], points[3], t, 0);\n len += path.getLineLength(p1.x, p1.y, p2.x, p2.y);\n p1 = p2;\n }\n }\n p2 = path.getPointOnEllipticalArc(points[0], points[1], points[2], points[3], end, 0);\n len += path.getLineLength(p1.x, p1.y, p2.x, p2.y);\n return len;\n }\n return 0;\n }\n static convertEndpointToCenterParameterization(x1, y1, x2, y2, fa, fs, rx, ry, psiDeg) {\n var psi = psiDeg * (Math.PI / 180.0);\n var xp = (Math.cos(psi) * (x1 - x2)) / 2.0 + (Math.sin(psi) * (y1 - y2)) / 2.0;\n var yp = (-1 * Math.sin(psi) * (x1 - x2)) / 2.0 +\n (Math.cos(psi) * (y1 - y2)) / 2.0;\n var lambda = (xp * xp) / (rx * rx) + (yp * yp) / (ry * ry);\n if (lambda > 1) {\n rx *= Math.sqrt(lambda);\n ry *= Math.sqrt(lambda);\n }\n var f = Math.sqrt((rx * rx * (ry * ry) - rx * rx * (yp * yp) - ry * ry * (xp * xp)) /\n (rx * rx * (yp * yp) + ry * ry * (xp * xp)));\n if (fa === fs) {\n f *= -1;\n }\n if (isNaN(f)) {\n f = 0;\n }\n var cxp = (f * rx * yp) / ry;\n var cyp = (f * -ry * xp) / rx;\n var cx = (x1 + x2) / 2.0 + Math.cos(psi) * cxp - Math.sin(psi) * cyp;\n var cy = (y1 + y2) / 2.0 + Math.sin(psi) * cxp + Math.cos(psi) * cyp;\n var vMag = function (v) {\n return Math.sqrt(v[0] * v[0] + v[1] * v[1]);\n };\n var vRatio = function (u, v) {\n return (u[0] * v[0] + u[1] * v[1]) / (vMag(u) * vMag(v));\n };\n var vAngle = function (u, v) {\n return (u[0] * v[1] < u[1] * v[0] ? -1 : 1) * Math.acos(vRatio(u, v));\n };\n var theta = vAngle([1, 0], [(xp - cxp) / rx, (yp - cyp) / ry]);\n var u = [(xp - cxp) / rx, (yp - cyp) / ry];\n var v = [(-1 * xp - cxp) / rx, (-1 * yp - cyp) / ry];\n var dTheta = vAngle(u, v);\n if (vRatio(u, v) <= -1) {\n dTheta = Math.PI;\n }\n if (vRatio(u, v) >= 1) {\n dTheta = 0;\n }\n if (fs === 0 && dTheta > 0) {\n dTheta = dTheta - 2 * Math.PI;\n }\n if (fs === 1 && dTheta < 0) {\n dTheta = dTheta + 2 * Math.PI;\n }\n return [cx, cy, rx, ry, theta, dTheta, psi, fs];\n }\n}\nexports.Path = Path;\nPath.prototype.className = 'Path';\nPath.prototype._attrsAffectingSize = ['data'];\n(0, Global_1._registerNode)(Path);\nFactory_1.Factory.addGetterSetter(Path, 'data');\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Arrow = void 0;\nconst Factory_1 = require(\"../Factory\");\nconst Line_1 = require(\"./Line\");\nconst Validators_1 = require(\"../Validators\");\nconst Global_1 = require(\"../Global\");\nconst Path_1 = require(\"./Path\");\nclass Arrow extends Line_1.Line {\n _sceneFunc(ctx) {\n super._sceneFunc(ctx);\n var PI2 = Math.PI * 2;\n var points = this.points();\n var tp = points;\n var fromTension = this.tension() !== 0 && points.length > 4;\n if (fromTension) {\n tp = this.getTensionPoints();\n }\n var length = this.pointerLength();\n var n = points.length;\n var dx, dy;\n if (fromTension) {\n const lp = [\n tp[tp.length - 4],\n tp[tp.length - 3],\n tp[tp.length - 2],\n tp[tp.length - 1],\n points[n - 2],\n points[n - 1],\n ];\n const lastLength = Path_1.Path.calcLength(tp[tp.length - 4], tp[tp.length - 3], 'C', lp);\n const previous = Path_1.Path.getPointOnQuadraticBezier(Math.min(1, 1 - length / lastLength), lp[0], lp[1], lp[2], lp[3], lp[4], lp[5]);\n dx = points[n - 2] - previous.x;\n dy = points[n - 1] - previous.y;\n }\n else {\n dx = points[n - 2] - points[n - 4];\n dy = points[n - 1] - points[n - 3];\n }\n var radians = (Math.atan2(dy, dx) + PI2) % PI2;\n var width = this.pointerWidth();\n if (this.pointerAtEnding()) {\n ctx.save();\n ctx.beginPath();\n ctx.translate(points[n - 2], points[n - 1]);\n ctx.rotate(radians);\n ctx.moveTo(0, 0);\n ctx.lineTo(-length, width / 2);\n ctx.lineTo(-length, -width / 2);\n ctx.closePath();\n ctx.restore();\n this.__fillStroke(ctx);\n }\n if (this.pointerAtBeginning()) {\n ctx.save();\n ctx.beginPath();\n ctx.translate(points[0], points[1]);\n if (fromTension) {\n dx = (tp[0] + tp[2]) / 2 - points[0];\n dy = (tp[1] + tp[3]) / 2 - points[1];\n }\n else {\n dx = points[2] - points[0];\n dy = points[3] - points[1];\n }\n ctx.rotate((Math.atan2(-dy, -dx) + PI2) % PI2);\n ctx.moveTo(0, 0);\n ctx.lineTo(-length, width / 2);\n ctx.lineTo(-length, -width / 2);\n ctx.closePath();\n ctx.restore();\n this.__fillStroke(ctx);\n }\n }\n __fillStroke(ctx) {\n var isDashEnabled = this.dashEnabled();\n if (isDashEnabled) {\n this.attrs.dashEnabled = false;\n ctx.setLineDash([]);\n }\n ctx.fillStrokeShape(this);\n if (isDashEnabled) {\n this.attrs.dashEnabled = true;\n }\n }\n getSelfRect() {\n const lineRect = super.getSelfRect();\n const offset = this.pointerWidth() / 2;\n return {\n x: lineRect.x - offset,\n y: lineRect.y - offset,\n width: lineRect.width + offset * 2,\n height: lineRect.height + offset * 2,\n };\n }\n}\nexports.Arrow = Arrow;\nArrow.prototype.className = 'Arrow';\n(0, Global_1._registerNode)(Arrow);\nFactory_1.Factory.addGetterSetter(Arrow, 'pointerLength', 10, (0, Validators_1.getNumberValidator)());\nFactory_1.Factory.addGetterSetter(Arrow, 'pointerWidth', 10, (0, Validators_1.getNumberValidator)());\nFactory_1.Factory.addGetterSetter(Arrow, 'pointerAtBeginning', false);\nFactory_1.Factory.addGetterSetter(Arrow, 'pointerAtEnding', true);\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Circle = void 0;\nconst Factory_1 = require(\"../Factory\");\nconst Shape_1 = require(\"../Shape\");\nconst Validators_1 = require(\"../Validators\");\nconst Global_1 = require(\"../Global\");\nclass Circle extends Shape_1.Shape {\n _sceneFunc(context) {\n context.beginPath();\n context.arc(0, 0, this.attrs.radius || 0, 0, Math.PI * 2, false);\n context.closePath();\n context.fillStrokeShape(this);\n }\n getWidth() {\n return this.radius() * 2;\n }\n getHeight() {\n return this.radius() * 2;\n }\n setWidth(width) {\n if (this.radius() !== width / 2) {\n this.radius(width / 2);\n }\n }\n setHeight(height) {\n if (this.radius() !== height / 2) {\n this.radius(height / 2);\n }\n }\n}\nexports.Circle = Circle;\nCircle.prototype._centroid = true;\nCircle.prototype.className = 'Circle';\nCircle.prototype._attrsAffectingSize = ['radius'];\n(0, Global_1._registerNode)(Circle);\nFactory_1.Factory.addGetterSetter(Circle, 'radius', 0, (0, Validators_1.getNumberValidator)());\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Ellipse = void 0;\nconst Factory_1 = require(\"../Factory\");\nconst Shape_1 = require(\"../Shape\");\nconst Validators_1 = require(\"../Validators\");\nconst Global_1 = require(\"../Global\");\nclass Ellipse extends Shape_1.Shape {\n _sceneFunc(context) {\n var rx = this.radiusX(), ry = this.radiusY();\n context.beginPath();\n context.save();\n if (rx !== ry) {\n context.scale(1, ry / rx);\n }\n context.arc(0, 0, rx, 0, Math.PI * 2, false);\n context.restore();\n context.closePath();\n context.fillStrokeShape(this);\n }\n getWidth() {\n return this.radiusX() * 2;\n }\n getHeight() {\n return this.radiusY() * 2;\n }\n setWidth(width) {\n this.radiusX(width / 2);\n }\n setHeight(height) {\n this.radiusY(height / 2);\n }\n}\nexports.Ellipse = Ellipse;\nEllipse.prototype.className = 'Ellipse';\nEllipse.prototype._centroid = true;\nEllipse.prototype._attrsAffectingSize = ['radiusX', 'radiusY'];\n(0, Global_1._registerNode)(Ellipse);\nFactory_1.Factory.addComponentsGetterSetter(Ellipse, 'radius', ['x', 'y']);\nFactory_1.Factory.addGetterSetter(Ellipse, 'radiusX', 0, (0, Validators_1.getNumberValidator)());\nFactory_1.Factory.addGetterSetter(Ellipse, 'radiusY', 0, (0, Validators_1.getNumberValidator)());\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Image = void 0;\nconst Util_1 = require(\"../Util\");\nconst Factory_1 = require(\"../Factory\");\nconst Shape_1 = require(\"../Shape\");\nconst Global_1 = require(\"../Global\");\nconst Validators_1 = require(\"../Validators\");\nclass Image extends Shape_1.Shape {\n constructor(attrs) {\n super(attrs);\n this.on('imageChange.konva', () => {\n this._setImageLoad();\n });\n this._setImageLoad();\n }\n _setImageLoad() {\n const image = this.image();\n if (image && image.complete) {\n return;\n }\n if (image && image.readyState === 4) {\n return;\n }\n if (image && image['addEventListener']) {\n image['addEventListener']('load', () => {\n this._requestDraw();\n });\n }\n }\n _useBufferCanvas() {\n return super._useBufferCanvas(true);\n }\n _sceneFunc(context) {\n const width = this.getWidth();\n const height = this.getHeight();\n const cornerRadius = this.cornerRadius();\n const image = this.attrs.image;\n let params;\n if (image) {\n const cropWidth = this.attrs.cropWidth;\n const cropHeight = this.attrs.cropHeight;\n if (cropWidth && cropHeight) {\n params = [\n image,\n this.cropX(),\n this.cropY(),\n cropWidth,\n cropHeight,\n 0,\n 0,\n width,\n height,\n ];\n }\n else {\n params = [image, 0, 0, width, height];\n }\n }\n if (this.hasFill() || this.hasStroke() || cornerRadius) {\n context.beginPath();\n cornerRadius\n ? Util_1.Util.drawRoundedRectPath(context, width, height, cornerRadius)\n : context.rect(0, 0, width, height);\n context.closePath();\n context.fillStrokeShape(this);\n }\n if (image) {\n if (cornerRadius) {\n context.clip();\n }\n context.drawImage.apply(context, params);\n }\n }\n _hitFunc(context) {\n var width = this.width(), height = this.height(), cornerRadius = this.cornerRadius();\n context.beginPath();\n if (!cornerRadius) {\n context.rect(0, 0, width, height);\n }\n else {\n Util_1.Util.drawRoundedRectPath(context, width, height, cornerRadius);\n }\n context.closePath();\n context.fillStrokeShape(this);\n }\n getWidth() {\n var _a, _b;\n return (_a = this.attrs.width) !== null && _a !== void 0 ? _a : (_b = this.image()) === null || _b === void 0 ? void 0 : _b.width;\n }\n getHeight() {\n var _a, _b;\n return (_a = this.attrs.height) !== null && _a !== void 0 ? _a : (_b = this.image()) === null || _b === void 0 ? void 0 : _b.height;\n }\n static fromURL(url, callback, onError = null) {\n var img = Util_1.Util.createImageElement();\n img.onload = function () {\n var image = new Image({\n image: img,\n });\n callback(image);\n };\n img.onerror = onError;\n img.crossOrigin = 'Anonymous';\n img.src = url;\n }\n}\nexports.Image = Image;\nImage.prototype.className = 'Image';\n(0, Global_1._registerNode)(Image);\nFactory_1.Factory.addGetterSetter(Image, 'cornerRadius', 0, (0, Validators_1.getNumberOrArrayOfNumbersValidator)(4));\nFactory_1.Factory.addGetterSetter(Image, 'image');\nFactory_1.Factory.addComponentsGetterSetter(Image, 'crop', ['x', 'y', 'width', 'height']);\nFactory_1.Factory.addGetterSetter(Image, 'cropX', 0, (0, Validators_1.getNumberValidator)());\nFactory_1.Factory.addGetterSetter(Image, 'cropY', 0, (0, Validators_1.getNumberValidator)());\nFactory_1.Factory.addGetterSetter(Image, 'cropWidth', 0, (0, Validators_1.getNumberValidator)());\nFactory_1.Factory.addGetterSetter(Image, 'cropHeight', 0, (0, Validators_1.getNumberValidator)());\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Tag = exports.Label = void 0;\nconst Factory_1 = require(\"../Factory\");\nconst Shape_1 = require(\"../Shape\");\nconst Group_1 = require(\"../Group\");\nconst Validators_1 = require(\"../Validators\");\nconst Global_1 = require(\"../Global\");\nvar ATTR_CHANGE_LIST = [\n 'fontFamily',\n 'fontSize',\n 'fontStyle',\n 'padding',\n 'lineHeight',\n 'text',\n 'width',\n 'height',\n 'pointerDirection',\n 'pointerWidth',\n 'pointerHeight',\n], CHANGE_KONVA = 'Change.konva', NONE = 'none', UP = 'up', RIGHT = 'right', DOWN = 'down', LEFT = 'left', attrChangeListLen = ATTR_CHANGE_LIST.length;\nclass Label extends Group_1.Group {\n constructor(config) {\n super(config);\n this.on('add.konva', function (evt) {\n this._addListeners(evt.child);\n this._sync();\n });\n }\n getText() {\n return this.find('Text')[0];\n }\n getTag() {\n return this.find('Tag')[0];\n }\n _addListeners(text) {\n var that = this, n;\n var func = function () {\n that._sync();\n };\n for (n = 0; n < attrChangeListLen; n++) {\n text.on(ATTR_CHANGE_LIST[n] + CHANGE_KONVA, func);\n }\n }\n getWidth() {\n return this.getText().width();\n }\n getHeight() {\n return this.getText().height();\n }\n _sync() {\n var text = this.getText(), tag = this.getTag(), width, height, pointerDirection, pointerWidth, x, y, pointerHeight;\n if (text && tag) {\n width = text.width();\n height = text.height();\n pointerDirection = tag.pointerDirection();\n pointerWidth = tag.pointerWidth();\n pointerHeight = tag.pointerHeight();\n x = 0;\n y = 0;\n switch (pointerDirection) {\n case UP:\n x = width / 2;\n y = -1 * pointerHeight;\n break;\n case RIGHT:\n x = width + pointerWidth;\n y = height / 2;\n break;\n case DOWN:\n x = width / 2;\n y = height + pointerHeight;\n break;\n case LEFT:\n x = -1 * pointerWidth;\n y = height / 2;\n break;\n }\n tag.setAttrs({\n x: -1 * x,\n y: -1 * y,\n width: width,\n height: height,\n });\n text.setAttrs({\n x: -1 * x,\n y: -1 * y,\n });\n }\n }\n}\nexports.Label = Label;\nLabel.prototype.className = 'Label';\n(0, Global_1._registerNode)(Label);\nclass Tag extends Shape_1.Shape {\n _sceneFunc(context) {\n var width = this.width(), height = this.height(), pointerDirection = this.pointerDirection(), pointerWidth = this.pointerWidth(), pointerHeight = this.pointerHeight(), cornerRadius = this.cornerRadius();\n let topLeft = 0;\n let topRight = 0;\n let bottomLeft = 0;\n let bottomRight = 0;\n if (typeof cornerRadius === 'number') {\n topLeft =\n topRight =\n bottomLeft =\n bottomRight =\n Math.min(cornerRadius, width / 2, height / 2);\n }\n else {\n topLeft = Math.min(cornerRadius[0] || 0, width / 2, height / 2);\n topRight = Math.min(cornerRadius[1] || 0, width / 2, height / 2);\n bottomRight = Math.min(cornerRadius[2] || 0, width / 2, height / 2);\n bottomLeft = Math.min(cornerRadius[3] || 0, width / 2, height / 2);\n }\n context.beginPath();\n context.moveTo(topLeft, 0);\n if (pointerDirection === UP) {\n context.lineTo((width - pointerWidth) / 2, 0);\n context.lineTo(width / 2, -1 * pointerHeight);\n context.lineTo((width + pointerWidth) / 2, 0);\n }\n context.lineTo(width - topRight, 0);\n context.arc(width - topRight, topRight, topRight, (Math.PI * 3) / 2, 0, false);\n if (pointerDirection === RIGHT) {\n context.lineTo(width, (height - pointerHeight) / 2);\n context.lineTo(width + pointerWidth, height / 2);\n context.lineTo(width, (height + pointerHeight) / 2);\n }\n context.lineTo(width, height - bottomRight);\n context.arc(width - bottomRight, height - bottomRight, bottomRight, 0, Math.PI / 2, false);\n if (pointerDirection === DOWN) {\n context.lineTo((width + pointerWidth) / 2, height);\n context.lineTo(width / 2, height + pointerHeight);\n context.lineTo((width - pointerWidth) / 2, height);\n }\n context.lineTo(bottomLeft, height);\n context.arc(bottomLeft, height - bottomLeft, bottomLeft, Math.PI / 2, Math.PI, false);\n if (pointerDirection === LEFT) {\n context.lineTo(0, (height + pointerHeight) / 2);\n context.lineTo(-1 * pointerWidth, height / 2);\n context.lineTo(0, (height - pointerHeight) / 2);\n }\n context.lineTo(0, topLeft);\n context.arc(topLeft, topLeft, topLeft, Math.PI, (Math.PI * 3) / 2, false);\n context.closePath();\n context.fillStrokeShape(this);\n }\n getSelfRect() {\n var x = 0, y = 0, pointerWidth = this.pointerWidth(), pointerHeight = this.pointerHeight(), direction = this.pointerDirection(), width = this.width(), height = this.height();\n if (direction === UP) {\n y -= pointerHeight;\n height += pointerHeight;\n }\n else if (direction === DOWN) {\n height += pointerHeight;\n }\n else if (direction === LEFT) {\n x -= pointerWidth * 1.5;\n width += pointerWidth;\n }\n else if (direction === RIGHT) {\n width += pointerWidth * 1.5;\n }\n return {\n x: x,\n y: y,\n width: width,\n height: height,\n };\n }\n}\nexports.Tag = Tag;\nTag.prototype.className = 'Tag';\n(0, Global_1._registerNode)(Tag);\nFactory_1.Factory.addGetterSetter(Tag, 'pointerDirection', NONE);\nFactory_1.Factory.addGetterSetter(Tag, 'pointerWidth', 0, (0, Validators_1.getNumberValidator)());\nFactory_1.Factory.addGetterSetter(Tag, 'pointerHeight', 0, (0, Validators_1.getNumberValidator)());\nFactory_1.Factory.addGetterSetter(Tag, 'cornerRadius', 0, (0, Validators_1.getNumberOrArrayOfNumbersValidator)(4));\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Rect = void 0;\nconst Factory_1 = require(\"../Factory\");\nconst Shape_1 = require(\"../Shape\");\nconst Global_1 = require(\"../Global\");\nconst Util_1 = require(\"../Util\");\nconst Validators_1 = require(\"../Validators\");\nclass Rect extends Shape_1.Shape {\n _sceneFunc(context) {\n var cornerRadius = this.cornerRadius(), width = this.width(), height = this.height();\n context.beginPath();\n if (!cornerRadius) {\n context.rect(0, 0, width, height);\n }\n else {\n Util_1.Util.drawRoundedRectPath(context, width, height, cornerRadius);\n }\n context.closePath();\n context.fillStrokeShape(this);\n }\n}\nexports.Rect = Rect;\nRect.prototype.className = 'Rect';\n(0, Global_1._registerNode)(Rect);\nFactory_1.Factory.addGetterSetter(Rect, 'cornerRadius', 0, (0, Validators_1.getNumberOrArrayOfNumbersValidator)(4));\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.RegularPolygon = void 0;\nconst Factory_1 = require(\"../Factory\");\nconst Shape_1 = require(\"../Shape\");\nconst Validators_1 = require(\"../Validators\");\nconst Global_1 = require(\"../Global\");\nclass RegularPolygon extends Shape_1.Shape {\n _sceneFunc(context) {\n const points = this._getPoints();\n context.beginPath();\n context.moveTo(points[0].x, points[0].y);\n for (var n = 1; n < points.length; n++) {\n context.lineTo(points[n].x, points[n].y);\n }\n context.closePath();\n context.fillStrokeShape(this);\n }\n _getPoints() {\n const sides = this.attrs.sides;\n const radius = this.attrs.radius || 0;\n const points = [];\n for (var n = 0; n < sides; n++) {\n points.push({\n x: radius * Math.sin((n * 2 * Math.PI) / sides),\n y: -1 * radius * Math.cos((n * 2 * Math.PI) / sides),\n });\n }\n return points;\n }\n getSelfRect() {\n const points = this._getPoints();\n var minX = points[0].x;\n var maxX = points[0].y;\n var minY = points[0].x;\n var maxY = points[0].y;\n points.forEach((point) => {\n minX = Math.min(minX, point.x);\n maxX = Math.max(maxX, point.x);\n minY = Math.min(minY, point.y);\n maxY = Math.max(maxY, point.y);\n });\n return {\n x: minX,\n y: minY,\n width: maxX - minX,\n height: maxY - minY,\n };\n }\n getWidth() {\n return this.radius() * 2;\n }\n getHeight() {\n return this.radius() * 2;\n }\n setWidth(width) {\n this.radius(width / 2);\n }\n setHeight(height) {\n this.radius(height / 2);\n }\n}\nexports.RegularPolygon = RegularPolygon;\nRegularPolygon.prototype.className = 'RegularPolygon';\nRegularPolygon.prototype._centroid = true;\nRegularPolygon.prototype._attrsAffectingSize = ['radius'];\n(0, Global_1._registerNode)(RegularPolygon);\nFactory_1.Factory.addGetterSetter(RegularPolygon, 'radius', 0, (0, Validators_1.getNumberValidator)());\nFactory_1.Factory.addGetterSetter(RegularPolygon, 'sides', 0, (0, Validators_1.getNumberValidator)());\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Ring = void 0;\nconst Factory_1 = require(\"../Factory\");\nconst Shape_1 = require(\"../Shape\");\nconst Validators_1 = require(\"../Validators\");\nconst Global_1 = require(\"../Global\");\nvar PIx2 = Math.PI * 2;\nclass Ring extends Shape_1.Shape {\n _sceneFunc(context) {\n context.beginPath();\n context.arc(0, 0, this.innerRadius(), 0, PIx2, false);\n context.moveTo(this.outerRadius(), 0);\n context.arc(0, 0, this.outerRadius(), PIx2, 0, true);\n context.closePath();\n context.fillStrokeShape(this);\n }\n getWidth() {\n return this.outerRadius() * 2;\n }\n getHeight() {\n return this.outerRadius() * 2;\n }\n setWidth(width) {\n this.outerRadius(width / 2);\n }\n setHeight(height) {\n this.outerRadius(height / 2);\n }\n}\nexports.Ring = Ring;\nRing.prototype.className = 'Ring';\nRing.prototype._centroid = true;\nRing.prototype._attrsAffectingSize = ['innerRadius', 'outerRadius'];\n(0, Global_1._registerNode)(Ring);\nFactory_1.Factory.addGetterSetter(Ring, 'innerRadius', 0, (0, Validators_1.getNumberValidator)());\nFactory_1.Factory.addGetterSetter(Ring, 'outerRadius', 0, (0, Validators_1.getNumberValidator)());\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Sprite = void 0;\nconst Factory_1 = require(\"../Factory\");\nconst Shape_1 = require(\"../Shape\");\nconst Animation_1 = require(\"../Animation\");\nconst Validators_1 = require(\"../Validators\");\nconst Global_1 = require(\"../Global\");\nclass Sprite extends Shape_1.Shape {\n constructor(config) {\n super(config);\n this._updated = true;\n this.anim = new Animation_1.Animation(() => {\n var updated = this._updated;\n this._updated = false;\n return updated;\n });\n this.on('animationChange.konva', function () {\n this.frameIndex(0);\n });\n this.on('frameIndexChange.konva', function () {\n this._updated = true;\n });\n this.on('frameRateChange.konva', function () {\n if (!this.anim.isRunning()) {\n return;\n }\n clearInterval(this.interval);\n this._setInterval();\n });\n }\n _sceneFunc(context) {\n var anim = this.animation(), index = this.frameIndex(), ix4 = index * 4, set = this.animations()[anim], offsets = this.frameOffsets(), x = set[ix4 + 0], y = set[ix4 + 1], width = set[ix4 + 2], height = set[ix4 + 3], image = this.image();\n if (this.hasFill() || this.hasStroke()) {\n context.beginPath();\n context.rect(0, 0, width, height);\n context.closePath();\n context.fillStrokeShape(this);\n }\n if (image) {\n if (offsets) {\n var offset = offsets[anim], ix2 = index * 2;\n context.drawImage(image, x, y, width, height, offset[ix2 + 0], offset[ix2 + 1], width, height);\n }\n else {\n context.drawImage(image, x, y, width, height, 0, 0, width, height);\n }\n }\n }\n _hitFunc(context) {\n var anim = this.animation(), index = this.frameIndex(), ix4 = index * 4, set = this.animations()[anim], offsets = this.frameOffsets(), width = set[ix4 + 2], height = set[ix4 + 3];\n context.beginPath();\n if (offsets) {\n var offset = offsets[anim];\n var ix2 = index * 2;\n context.rect(offset[ix2 + 0], offset[ix2 + 1], width, height);\n }\n else {\n context.rect(0, 0, width, height);\n }\n context.closePath();\n context.fillShape(this);\n }\n _useBufferCanvas() {\n return super._useBufferCanvas(true);\n }\n _setInterval() {\n var that = this;\n this.interval = setInterval(function () {\n that._updateIndex();\n }, 1000 / this.frameRate());\n }\n start() {\n if (this.isRunning()) {\n return;\n }\n var layer = this.getLayer();\n this.anim.setLayers(layer);\n this._setInterval();\n this.anim.start();\n }\n stop() {\n this.anim.stop();\n clearInterval(this.interval);\n }\n isRunning() {\n return this.anim.isRunning();\n }\n _updateIndex() {\n var index = this.frameIndex(), animation = this.animation(), animations = this.animations(), anim = animations[animation], len = anim.length / 4;\n if (index < len - 1) {\n this.frameIndex(index + 1);\n }\n else {\n this.frameIndex(0);\n }\n }\n}\nexports.Sprite = Sprite;\nSprite.prototype.className = 'Sprite';\n(0, Global_1._registerNode)(Sprite);\nFactory_1.Factory.addGetterSetter(Sprite, 'animation');\nFactory_1.Factory.addGetterSetter(Sprite, 'animations');\nFactory_1.Factory.addGetterSetter(Sprite, 'frameOffsets');\nFactory_1.Factory.addGetterSetter(Sprite, 'image');\nFactory_1.Factory.addGetterSetter(Sprite, 'frameIndex', 0, (0, Validators_1.getNumberValidator)());\nFactory_1.Factory.addGetterSetter(Sprite, 'frameRate', 17, (0, Validators_1.getNumberValidator)());\nFactory_1.Factory.backCompat(Sprite, {\n index: 'frameIndex',\n getIndex: 'getFrameIndex',\n setIndex: 'setFrameIndex',\n});\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Star = void 0;\nconst Factory_1 = require(\"../Factory\");\nconst Shape_1 = require(\"../Shape\");\nconst Validators_1 = require(\"../Validators\");\nconst Global_1 = require(\"../Global\");\nclass Star extends Shape_1.Shape {\n _sceneFunc(context) {\n var innerRadius = this.innerRadius(), outerRadius = this.outerRadius(), numPoints = this.numPoints();\n context.beginPath();\n context.moveTo(0, 0 - outerRadius);\n for (var n = 1; n < numPoints * 2; n++) {\n var radius = n % 2 === 0 ? outerRadius : innerRadius;\n var x = radius * Math.sin((n * Math.PI) / numPoints);\n var y = -1 * radius * Math.cos((n * Math.PI) / numPoints);\n context.lineTo(x, y);\n }\n context.closePath();\n context.fillStrokeShape(this);\n }\n getWidth() {\n return this.outerRadius() * 2;\n }\n getHeight() {\n return this.outerRadius() * 2;\n }\n setWidth(width) {\n this.outerRadius(width / 2);\n }\n setHeight(height) {\n this.outerRadius(height / 2);\n }\n}\nexports.Star = Star;\nStar.prototype.className = 'Star';\nStar.prototype._centroid = true;\nStar.prototype._attrsAffectingSize = ['innerRadius', 'outerRadius'];\n(0, Global_1._registerNode)(Star);\nFactory_1.Factory.addGetterSetter(Star, 'numPoints', 5, (0, Validators_1.getNumberValidator)());\nFactory_1.Factory.addGetterSetter(Star, 'innerRadius', 0, (0, Validators_1.getNumberValidator)());\nFactory_1.Factory.addGetterSetter(Star, 'outerRadius', 0, (0, Validators_1.getNumberValidator)());\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Text = exports.stringToArray = void 0;\nconst Util_1 = require(\"../Util\");\nconst Factory_1 = require(\"../Factory\");\nconst Shape_1 = require(\"../Shape\");\nconst Validators_1 = require(\"../Validators\");\nconst Global_1 = require(\"../Global\");\nfunction stringToArray(string) {\n return Array.from(string);\n}\nexports.stringToArray = stringToArray;\nvar AUTO = 'auto', CENTER = 'center', INHERIT = 'inherit', JUSTIFY = 'justify', CHANGE_KONVA = 'Change.konva', CONTEXT_2D = '2d', DASH = '-', LEFT = 'left', LTR = 'ltr', TEXT = 'text', TEXT_UPPER = 'Text', TOP = 'top', BOTTOM = 'bottom', MIDDLE = 'middle', NORMAL = 'normal', PX_SPACE = 'px ', SPACE = ' ', RIGHT = 'right', RTL = 'rtl', WORD = 'word', CHAR = 'char', NONE = 'none', ELLIPSIS = '…', ATTR_CHANGE_LIST = [\n 'direction',\n 'fontFamily',\n 'fontSize',\n 'fontStyle',\n 'fontVariant',\n 'padding',\n 'align',\n 'verticalAlign',\n 'lineHeight',\n 'text',\n 'width',\n 'height',\n 'wrap',\n 'ellipsis',\n 'letterSpacing',\n], attrChangeListLen = ATTR_CHANGE_LIST.length;\nfunction normalizeFontFamily(fontFamily) {\n return fontFamily\n .split(',')\n .map((family) => {\n family = family.trim();\n const hasSpace = family.indexOf(' ') >= 0;\n const hasQuotes = family.indexOf('\"') >= 0 || family.indexOf(\"'\") >= 0;\n if (hasSpace && !hasQuotes) {\n family = `\"${family}\"`;\n }\n return family;\n })\n .join(', ');\n}\nvar dummyContext;\nfunction getDummyContext() {\n if (dummyContext) {\n return dummyContext;\n }\n dummyContext = Util_1.Util.createCanvasElement().getContext(CONTEXT_2D);\n return dummyContext;\n}\nfunction _fillFunc(context) {\n context.fillText(this._partialText, this._partialTextX, this._partialTextY);\n}\nfunction _strokeFunc(context) {\n context.setAttr('miterLimit', 2);\n context.strokeText(this._partialText, this._partialTextX, this._partialTextY);\n}\nfunction checkDefaultFill(config) {\n config = config || {};\n if (!config.fillLinearGradientColorStops &&\n !config.fillRadialGradientColorStops &&\n !config.fillPatternImage) {\n config.fill = config.fill || 'black';\n }\n return config;\n}\nclass Text extends Shape_1.Shape {\n constructor(config) {\n super(checkDefaultFill(config));\n this._partialTextX = 0;\n this._partialTextY = 0;\n for (var n = 0; n < attrChangeListLen; n++) {\n this.on(ATTR_CHANGE_LIST[n] + CHANGE_KONVA, this._setTextData);\n }\n this._setTextData();\n }\n _sceneFunc(context) {\n var textArr = this.textArr, textArrLen = textArr.length;\n if (!this.text()) {\n return;\n }\n var padding = this.padding(), fontSize = this.fontSize(), lineHeightPx = this.lineHeight() * fontSize, verticalAlign = this.verticalAlign(), direction = this.direction(), alignY = 0, align = this.align(), totalWidth = this.getWidth(), letterSpacing = this.letterSpacing(), fill = this.fill(), textDecoration = this.textDecoration(), shouldUnderline = textDecoration.indexOf('underline') !== -1, shouldLineThrough = textDecoration.indexOf('line-through') !== -1, n;\n direction = direction === INHERIT ? context.direction : direction;\n var translateY = 0;\n var translateY = lineHeightPx / 2;\n var lineTranslateX = 0;\n var lineTranslateY = 0;\n if (direction === RTL) {\n context.setAttr('direction', direction);\n }\n context.setAttr('font', this._getContextFont());\n context.setAttr('textBaseline', MIDDLE);\n context.setAttr('textAlign', LEFT);\n if (verticalAlign === MIDDLE) {\n alignY = (this.getHeight() - textArrLen * lineHeightPx - padding * 2) / 2;\n }\n else if (verticalAlign === BOTTOM) {\n alignY = this.getHeight() - textArrLen * lineHeightPx - padding * 2;\n }\n context.translate(padding, alignY + padding);\n for (n = 0; n < textArrLen; n++) {\n var lineTranslateX = 0;\n var lineTranslateY = 0;\n var obj = textArr[n], text = obj.text, width = obj.width, lastLine = obj.lastInParagraph, spacesNumber, oneWord, lineWidth;\n context.save();\n if (align === RIGHT) {\n lineTranslateX += totalWidth - width - padding * 2;\n }\n else if (align === CENTER) {\n lineTranslateX += (totalWidth - width - padding * 2) / 2;\n }\n if (shouldUnderline) {\n context.save();\n context.beginPath();\n context.moveTo(lineTranslateX, translateY + lineTranslateY + Math.round(fontSize / 2));\n spacesNumber = text.split(' ').length - 1;\n oneWord = spacesNumber === 0;\n lineWidth =\n align === JUSTIFY && !lastLine ? totalWidth - padding * 2 : width;\n context.lineTo(lineTranslateX + Math.round(lineWidth), translateY + lineTranslateY + Math.round(fontSize / 2));\n context.lineWidth = fontSize / 15;\n const gradient = this._getLinearGradient();\n context.strokeStyle = gradient || fill;\n context.stroke();\n context.restore();\n }\n if (shouldLineThrough) {\n context.save();\n context.beginPath();\n context.moveTo(lineTranslateX, translateY + lineTranslateY);\n spacesNumber = text.split(' ').length - 1;\n oneWord = spacesNumber === 0;\n lineWidth =\n align === JUSTIFY && lastLine && !oneWord\n ? totalWidth - padding * 2\n : width;\n context.lineTo(lineTranslateX + Math.round(lineWidth), translateY + lineTranslateY);\n context.lineWidth = fontSize / 15;\n const gradient = this._getLinearGradient();\n context.strokeStyle = gradient || fill;\n context.stroke();\n context.restore();\n }\n if (direction !== RTL && (letterSpacing !== 0 || align === JUSTIFY)) {\n spacesNumber = text.split(' ').length - 1;\n var array = stringToArray(text);\n for (var li = 0; li < array.length; li++) {\n var letter = array[li];\n if (letter === ' ' && !lastLine && align === JUSTIFY) {\n lineTranslateX += (totalWidth - padding * 2 - width) / spacesNumber;\n }\n this._partialTextX = lineTranslateX;\n this._partialTextY = translateY + lineTranslateY;\n this._partialText = letter;\n context.fillStrokeShape(this);\n lineTranslateX += this.measureSize(letter).width + letterSpacing;\n }\n }\n else {\n if (letterSpacing !== 0) {\n context.setAttr('letterSpacing', `${letterSpacing}px`);\n }\n this._partialTextX = lineTranslateX;\n this._partialTextY = translateY + lineTranslateY;\n this._partialText = text;\n context.fillStrokeShape(this);\n }\n context.restore();\n if (textArrLen > 1) {\n translateY += lineHeightPx;\n }\n }\n }\n _hitFunc(context) {\n var width = this.getWidth(), height = this.getHeight();\n context.beginPath();\n context.rect(0, 0, width, height);\n context.closePath();\n context.fillStrokeShape(this);\n }\n setText(text) {\n var str = Util_1.Util._isString(text)\n ? text\n : text === null || text === undefined\n ? ''\n : text + '';\n this._setAttr(TEXT, str);\n return this;\n }\n getWidth() {\n var isAuto = this.attrs.width === AUTO || this.attrs.width === undefined;\n return isAuto ? this.getTextWidth() + this.padding() * 2 : this.attrs.width;\n }\n getHeight() {\n var isAuto = this.attrs.height === AUTO || this.attrs.height === undefined;\n return isAuto\n ? this.fontSize() * this.textArr.length * this.lineHeight() +\n this.padding() * 2\n : this.attrs.height;\n }\n getTextWidth() {\n return this.textWidth;\n }\n getTextHeight() {\n Util_1.Util.warn('text.getTextHeight() method is deprecated. Use text.height() - for full height and text.fontSize() - for one line height.');\n return this.textHeight;\n }\n measureSize(text) {\n var _context = getDummyContext(), fontSize = this.fontSize(), metrics;\n _context.save();\n _context.font = this._getContextFont();\n metrics = _context.measureText(text);\n _context.restore();\n return {\n width: metrics.width,\n height: fontSize,\n };\n }\n _getContextFont() {\n return (this.fontStyle() +\n SPACE +\n this.fontVariant() +\n SPACE +\n (this.fontSize() + PX_SPACE) +\n normalizeFontFamily(this.fontFamily()));\n }\n _addTextLine(line) {\n const align = this.align();\n if (align === JUSTIFY) {\n line = line.trim();\n }\n var width = this._getTextWidth(line);\n return this.textArr.push({\n text: line,\n width: width,\n lastInParagraph: false,\n });\n }\n _getTextWidth(text) {\n var letterSpacing = this.letterSpacing();\n var length = text.length;\n return (getDummyContext().measureText(text).width +\n (length ? letterSpacing * (length - 1) : 0));\n }\n _setTextData() {\n var lines = this.text().split('\\n'), fontSize = +this.fontSize(), textWidth = 0, lineHeightPx = this.lineHeight() * fontSize, width = this.attrs.width, height = this.attrs.height, fixedWidth = width !== AUTO && width !== undefined, fixedHeight = height !== AUTO && height !== undefined, padding = this.padding(), maxWidth = width - padding * 2, maxHeightPx = height - padding * 2, currentHeightPx = 0, wrap = this.wrap(), shouldWrap = wrap !== NONE, wrapAtWord = wrap !== CHAR && shouldWrap, shouldAddEllipsis = this.ellipsis();\n this.textArr = [];\n getDummyContext().font = this._getContextFont();\n var additionalWidth = shouldAddEllipsis ? this._getTextWidth(ELLIPSIS) : 0;\n for (var i = 0, max = lines.length; i < max; ++i) {\n var line = lines[i];\n var lineWidth = this._getTextWidth(line);\n if (fixedWidth && lineWidth > maxWidth) {\n while (line.length > 0) {\n var low = 0, high = line.length, match = '', matchWidth = 0;\n while (low < high) {\n var mid = (low + high) >>> 1, substr = line.slice(0, mid + 1), substrWidth = this._getTextWidth(substr) + additionalWidth;\n if (substrWidth <= maxWidth) {\n low = mid + 1;\n match = substr;\n matchWidth = substrWidth;\n }\n else {\n high = mid;\n }\n }\n if (match) {\n if (wrapAtWord) {\n var wrapIndex;\n var nextChar = line[match.length];\n var nextIsSpaceOrDash = nextChar === SPACE || nextChar === DASH;\n if (nextIsSpaceOrDash && matchWidth <= maxWidth) {\n wrapIndex = match.length;\n }\n else {\n wrapIndex =\n Math.max(match.lastIndexOf(SPACE), match.lastIndexOf(DASH)) +\n 1;\n }\n if (wrapIndex > 0) {\n low = wrapIndex;\n match = match.slice(0, low);\n matchWidth = this._getTextWidth(match);\n }\n }\n match = match.trimRight();\n this._addTextLine(match);\n textWidth = Math.max(textWidth, matchWidth);\n currentHeightPx += lineHeightPx;\n var shouldHandleEllipsis = this._shouldHandleEllipsis(currentHeightPx);\n if (shouldHandleEllipsis) {\n this._tryToAddEllipsisToLastLine();\n break;\n }\n line = line.slice(low);\n line = line.trimLeft();\n if (line.length > 0) {\n lineWidth = this._getTextWidth(line);\n if (lineWidth <= maxWidth) {\n this._addTextLine(line);\n currentHeightPx += lineHeightPx;\n textWidth = Math.max(textWidth, lineWidth);\n break;\n }\n }\n }\n else {\n break;\n }\n }\n }\n else {\n this._addTextLine(line);\n currentHeightPx += lineHeightPx;\n textWidth = Math.max(textWidth, lineWidth);\n if (this._shouldHandleEllipsis(currentHeightPx) && i < max - 1) {\n this._tryToAddEllipsisToLastLine();\n }\n }\n if (this.textArr[this.textArr.length - 1]) {\n this.textArr[this.textArr.length - 1].lastInParagraph = true;\n }\n if (fixedHeight && currentHeightPx + lineHeightPx > maxHeightPx) {\n break;\n }\n }\n this.textHeight = fontSize;\n this.textWidth = textWidth;\n }\n _shouldHandleEllipsis(currentHeightPx) {\n var fontSize = +this.fontSize(), lineHeightPx = this.lineHeight() * fontSize, height = this.attrs.height, fixedHeight = height !== AUTO && height !== undefined, padding = this.padding(), maxHeightPx = height - padding * 2, wrap = this.wrap(), shouldWrap = wrap !== NONE;\n return (!shouldWrap ||\n (fixedHeight && currentHeightPx + lineHeightPx > maxHeightPx));\n }\n _tryToAddEllipsisToLastLine() {\n var width = this.attrs.width, fixedWidth = width !== AUTO && width !== undefined, padding = this.padding(), maxWidth = width - padding * 2, shouldAddEllipsis = this.ellipsis();\n var lastLine = this.textArr[this.textArr.length - 1];\n if (!lastLine || !shouldAddEllipsis) {\n return;\n }\n if (fixedWidth) {\n var haveSpace = this._getTextWidth(lastLine.text + ELLIPSIS) < maxWidth;\n if (!haveSpace) {\n lastLine.text = lastLine.text.slice(0, lastLine.text.length - 3);\n }\n }\n this.textArr.splice(this.textArr.length - 1, 1);\n this._addTextLine(lastLine.text + ELLIPSIS);\n }\n getStrokeScaleEnabled() {\n return true;\n }\n _useBufferCanvas() {\n const hasLine = this.textDecoration().indexOf('underline') !== -1 ||\n this.textDecoration().indexOf('line-through') !== -1;\n const hasShadow = this.hasShadow();\n if (hasLine && hasShadow) {\n return true;\n }\n return super._useBufferCanvas();\n }\n}\nexports.Text = Text;\nText.prototype._fillFunc = _fillFunc;\nText.prototype._strokeFunc = _strokeFunc;\nText.prototype.className = TEXT_UPPER;\nText.prototype._attrsAffectingSize = [\n 'text',\n 'fontSize',\n 'padding',\n 'wrap',\n 'lineHeight',\n 'letterSpacing',\n];\n(0, Global_1._registerNode)(Text);\nFactory_1.Factory.overWriteSetter(Text, 'width', (0, Validators_1.getNumberOrAutoValidator)());\nFactory_1.Factory.overWriteSetter(Text, 'height', (0, Validators_1.getNumberOrAutoValidator)());\nFactory_1.Factory.addGetterSetter(Text, 'direction', INHERIT);\nFactory_1.Factory.addGetterSetter(Text, 'fontFamily', 'Arial');\nFactory_1.Factory.addGetterSetter(Text, 'fontSize', 12, (0, Validators_1.getNumberValidator)());\nFactory_1.Factory.addGetterSetter(Text, 'fontStyle', NORMAL);\nFactory_1.Factory.addGetterSetter(Text, 'fontVariant', NORMAL);\nFactory_1.Factory.addGetterSetter(Text, 'padding', 0, (0, Validators_1.getNumberValidator)());\nFactory_1.Factory.addGetterSetter(Text, 'align', LEFT);\nFactory_1.Factory.addGetterSetter(Text, 'verticalAlign', TOP);\nFactory_1.Factory.addGetterSetter(Text, 'lineHeight', 1, (0, Validators_1.getNumberValidator)());\nFactory_1.Factory.addGetterSetter(Text, 'wrap', WORD);\nFactory_1.Factory.addGetterSetter(Text, 'ellipsis', false, (0, Validators_1.getBooleanValidator)());\nFactory_1.Factory.addGetterSetter(Text, 'letterSpacing', 0, (0, Validators_1.getNumberValidator)());\nFactory_1.Factory.addGetterSetter(Text, 'text', '', (0, Validators_1.getStringValidator)());\nFactory_1.Factory.addGetterSetter(Text, 'textDecoration', '');\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.TextPath = void 0;\nconst Util_1 = require(\"../Util\");\nconst Factory_1 = require(\"../Factory\");\nconst Shape_1 = require(\"../Shape\");\nconst Path_1 = require(\"./Path\");\nconst Text_1 = require(\"./Text\");\nconst Validators_1 = require(\"../Validators\");\nconst Global_1 = require(\"../Global\");\nvar EMPTY_STRING = '', NORMAL = 'normal';\nfunction _fillFunc(context) {\n context.fillText(this.partialText, 0, 0);\n}\nfunction _strokeFunc(context) {\n context.strokeText(this.partialText, 0, 0);\n}\nclass TextPath extends Shape_1.Shape {\n constructor(config) {\n super(config);\n this.dummyCanvas = Util_1.Util.createCanvasElement();\n this.dataArray = [];\n this._readDataAttribute();\n this.on('dataChange.konva', function () {\n this._readDataAttribute();\n this._setTextData();\n });\n this.on('textChange.konva alignChange.konva letterSpacingChange.konva kerningFuncChange.konva fontSizeChange.konva fontFamilyChange.konva', this._setTextData);\n this._setTextData();\n }\n _getTextPathLength() {\n return Path_1.Path.getPathLength(this.dataArray);\n }\n _getPointAtLength(length) {\n if (!this.attrs.data) {\n return null;\n }\n const totalLength = this.pathLength;\n if (length - 1 > totalLength) {\n return null;\n }\n return Path_1.Path.getPointAtLengthOfDataArray(length, this.dataArray);\n }\n _readDataAttribute() {\n this.dataArray = Path_1.Path.parsePathData(this.attrs.data);\n this.pathLength = this._getTextPathLength();\n }\n _sceneFunc(context) {\n context.setAttr('font', this._getContextFont());\n context.setAttr('textBaseline', this.textBaseline());\n context.setAttr('textAlign', 'left');\n context.save();\n var textDecoration = this.textDecoration();\n var fill = this.fill();\n var fontSize = this.fontSize();\n var glyphInfo = this.glyphInfo;\n if (textDecoration === 'underline') {\n context.beginPath();\n }\n for (var i = 0; i < glyphInfo.length; i++) {\n context.save();\n var p0 = glyphInfo[i].p0;\n context.translate(p0.x, p0.y);\n context.rotate(glyphInfo[i].rotation);\n this.partialText = glyphInfo[i].text;\n context.fillStrokeShape(this);\n if (textDecoration === 'underline') {\n if (i === 0) {\n context.moveTo(0, fontSize / 2 + 1);\n }\n context.lineTo(fontSize, fontSize / 2 + 1);\n }\n context.restore();\n }\n if (textDecoration === 'underline') {\n context.strokeStyle = fill;\n context.lineWidth = fontSize / 20;\n context.stroke();\n }\n context.restore();\n }\n _hitFunc(context) {\n context.beginPath();\n var glyphInfo = this.glyphInfo;\n if (glyphInfo.length >= 1) {\n var p0 = glyphInfo[0].p0;\n context.moveTo(p0.x, p0.y);\n }\n for (var i = 0; i < glyphInfo.length; i++) {\n var p1 = glyphInfo[i].p1;\n context.lineTo(p1.x, p1.y);\n }\n context.setAttr('lineWidth', this.fontSize());\n context.setAttr('strokeStyle', this.colorKey);\n context.stroke();\n }\n getTextWidth() {\n return this.textWidth;\n }\n getTextHeight() {\n Util_1.Util.warn('text.getTextHeight() method is deprecated. Use text.height() - for full height and text.fontSize() - for one line height.');\n return this.textHeight;\n }\n setText(text) {\n return Text_1.Text.prototype.setText.call(this, text);\n }\n _getContextFont() {\n return Text_1.Text.prototype._getContextFont.call(this);\n }\n _getTextSize(text) {\n var dummyCanvas = this.dummyCanvas;\n var _context = dummyCanvas.getContext('2d');\n _context.save();\n _context.font = this._getContextFont();\n var metrics = _context.measureText(text);\n _context.restore();\n return {\n width: metrics.width,\n height: parseInt(`${this.fontSize()}`, 10),\n };\n }\n _setTextData() {\n const { width, height } = this._getTextSize(this.attrs.text);\n this.textWidth = width;\n this.textHeight = height;\n this.glyphInfo = [];\n if (!this.attrs.data) {\n return null;\n }\n const letterSpacing = this.letterSpacing();\n const align = this.align();\n const kerningFunc = this.kerningFunc();\n const textWidth = Math.max(this.textWidth + ((this.attrs.text || '').length - 1) * letterSpacing, 0);\n let offset = 0;\n if (align === 'center') {\n offset = Math.max(0, this.pathLength / 2 - textWidth / 2);\n }\n if (align === 'right') {\n offset = Math.max(0, this.pathLength - textWidth);\n }\n const charArr = (0, Text_1.stringToArray)(this.text());\n let offsetToGlyph = offset;\n for (var i = 0; i < charArr.length; i++) {\n const charStartPoint = this._getPointAtLength(offsetToGlyph);\n if (!charStartPoint)\n return;\n let glyphWidth = this._getTextSize(charArr[i]).width + letterSpacing;\n if (charArr[i] === ' ' && align === 'justify') {\n const numberOfSpaces = this.text().split(' ').length - 1;\n glyphWidth += (this.pathLength - textWidth) / numberOfSpaces;\n }\n const charEndPoint = this._getPointAtLength(offsetToGlyph + glyphWidth);\n if (!charEndPoint)\n return;\n const width = Path_1.Path.getLineLength(charStartPoint.x, charStartPoint.y, charEndPoint.x, charEndPoint.y);\n let kern = 0;\n if (kerningFunc) {\n try {\n kern = kerningFunc(charArr[i - 1], charArr[i]) * this.fontSize();\n }\n catch (e) {\n kern = 0;\n }\n }\n charStartPoint.x += kern;\n charEndPoint.x += kern;\n this.textWidth += kern;\n const midpoint = Path_1.Path.getPointOnLine(kern + width / 2.0, charStartPoint.x, charStartPoint.y, charEndPoint.x, charEndPoint.y);\n const rotation = Math.atan2(charEndPoint.y - charStartPoint.y, charEndPoint.x - charStartPoint.x);\n this.glyphInfo.push({\n transposeX: midpoint.x,\n transposeY: midpoint.y,\n text: charArr[i],\n rotation: rotation,\n p0: charStartPoint,\n p1: charEndPoint,\n });\n offsetToGlyph += glyphWidth;\n }\n }\n getSelfRect() {\n if (!this.glyphInfo.length) {\n return {\n x: 0,\n y: 0,\n width: 0,\n height: 0,\n };\n }\n var points = [];\n this.glyphInfo.forEach(function (info) {\n points.push(info.p0.x);\n points.push(info.p0.y);\n points.push(info.p1.x);\n points.push(info.p1.y);\n });\n var minX = points[0] || 0;\n var maxX = points[0] || 0;\n var minY = points[1] || 0;\n var maxY = points[1] || 0;\n var x, y;\n for (var i = 0; i < points.length / 2; i++) {\n x = points[i * 2];\n y = points[i * 2 + 1];\n minX = Math.min(minX, x);\n maxX = Math.max(maxX, x);\n minY = Math.min(minY, y);\n maxY = Math.max(maxY, y);\n }\n var fontSize = this.fontSize();\n return {\n x: minX - fontSize / 2,\n y: minY - fontSize / 2,\n width: maxX - minX + fontSize,\n height: maxY - minY + fontSize,\n };\n }\n destroy() {\n Util_1.Util.releaseCanvas(this.dummyCanvas);\n return super.destroy();\n }\n}\nexports.TextPath = TextPath;\nTextPath.prototype._fillFunc = _fillFunc;\nTextPath.prototype._strokeFunc = _strokeFunc;\nTextPath.prototype._fillFuncHit = _fillFunc;\nTextPath.prototype._strokeFuncHit = _strokeFunc;\nTextPath.prototype.className = 'TextPath';\nTextPath.prototype._attrsAffectingSize = ['text', 'fontSize', 'data'];\n(0, Global_1._registerNode)(TextPath);\nFactory_1.Factory.addGetterSetter(TextPath, 'data');\nFactory_1.Factory.addGetterSetter(TextPath, 'fontFamily', 'Arial');\nFactory_1.Factory.addGetterSetter(TextPath, 'fontSize', 12, (0, Validators_1.getNumberValidator)());\nFactory_1.Factory.addGetterSetter(TextPath, 'fontStyle', NORMAL);\nFactory_1.Factory.addGetterSetter(TextPath, 'align', 'left');\nFactory_1.Factory.addGetterSetter(TextPath, 'letterSpacing', 0, (0, Validators_1.getNumberValidator)());\nFactory_1.Factory.addGetterSetter(TextPath, 'textBaseline', 'middle');\nFactory_1.Factory.addGetterSetter(TextPath, 'fontVariant', NORMAL);\nFactory_1.Factory.addGetterSetter(TextPath, 'text', EMPTY_STRING);\nFactory_1.Factory.addGetterSetter(TextPath, 'textDecoration', null);\nFactory_1.Factory.addGetterSetter(TextPath, 'kerningFunc', null);\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Transformer = void 0;\nconst Util_1 = require(\"../Util\");\nconst Factory_1 = require(\"../Factory\");\nconst Node_1 = require(\"../Node\");\nconst Shape_1 = require(\"../Shape\");\nconst Rect_1 = require(\"./Rect\");\nconst Group_1 = require(\"../Group\");\nconst Global_1 = require(\"../Global\");\nconst Validators_1 = require(\"../Validators\");\nconst Global_2 = require(\"../Global\");\nvar EVENTS_NAME = 'tr-konva';\nvar ATTR_CHANGE_LIST = [\n 'resizeEnabledChange',\n 'rotateAnchorOffsetChange',\n 'rotateEnabledChange',\n 'enabledAnchorsChange',\n 'anchorSizeChange',\n 'borderEnabledChange',\n 'borderStrokeChange',\n 'borderStrokeWidthChange',\n 'borderDashChange',\n 'anchorStrokeChange',\n 'anchorStrokeWidthChange',\n 'anchorFillChange',\n 'anchorCornerRadiusChange',\n 'ignoreStrokeChange',\n 'anchorStyleFuncChange',\n]\n .map((e) => e + `.${EVENTS_NAME}`)\n .join(' ');\nvar NODES_RECT = 'nodesRect';\nvar TRANSFORM_CHANGE_STR = [\n 'widthChange',\n 'heightChange',\n 'scaleXChange',\n 'scaleYChange',\n 'skewXChange',\n 'skewYChange',\n 'rotationChange',\n 'offsetXChange',\n 'offsetYChange',\n 'transformsEnabledChange',\n 'strokeWidthChange',\n];\nvar ANGLES = {\n 'top-left': -45,\n 'top-center': 0,\n 'top-right': 45,\n 'middle-right': -90,\n 'middle-left': 90,\n 'bottom-left': -135,\n 'bottom-center': 180,\n 'bottom-right': 135,\n};\nconst TOUCH_DEVICE = 'ontouchstart' in Global_1.Konva._global;\nfunction getCursor(anchorName, rad, rotateCursor) {\n if (anchorName === 'rotater') {\n return rotateCursor;\n }\n rad += Util_1.Util.degToRad(ANGLES[anchorName] || 0);\n var angle = ((Util_1.Util.radToDeg(rad) % 360) + 360) % 360;\n if (Util_1.Util._inRange(angle, 315 + 22.5, 360) || Util_1.Util._inRange(angle, 0, 22.5)) {\n return 'ns-resize';\n }\n else if (Util_1.Util._inRange(angle, 45 - 22.5, 45 + 22.5)) {\n return 'nesw-resize';\n }\n else if (Util_1.Util._inRange(angle, 90 - 22.5, 90 + 22.5)) {\n return 'ew-resize';\n }\n else if (Util_1.Util._inRange(angle, 135 - 22.5, 135 + 22.5)) {\n return 'nwse-resize';\n }\n else if (Util_1.Util._inRange(angle, 180 - 22.5, 180 + 22.5)) {\n return 'ns-resize';\n }\n else if (Util_1.Util._inRange(angle, 225 - 22.5, 225 + 22.5)) {\n return 'nesw-resize';\n }\n else if (Util_1.Util._inRange(angle, 270 - 22.5, 270 + 22.5)) {\n return 'ew-resize';\n }\n else if (Util_1.Util._inRange(angle, 315 - 22.5, 315 + 22.5)) {\n return 'nwse-resize';\n }\n else {\n Util_1.Util.error('Transformer has unknown angle for cursor detection: ' + angle);\n return 'pointer';\n }\n}\nvar ANCHORS_NAMES = [\n 'top-left',\n 'top-center',\n 'top-right',\n 'middle-right',\n 'middle-left',\n 'bottom-left',\n 'bottom-center',\n 'bottom-right',\n];\nvar MAX_SAFE_INTEGER = 100000000;\nfunction getCenter(shape) {\n return {\n x: shape.x +\n (shape.width / 2) * Math.cos(shape.rotation) +\n (shape.height / 2) * Math.sin(-shape.rotation),\n y: shape.y +\n (shape.height / 2) * Math.cos(shape.rotation) +\n (shape.width / 2) * Math.sin(shape.rotation),\n };\n}\nfunction rotateAroundPoint(shape, angleRad, point) {\n const x = point.x +\n (shape.x - point.x) * Math.cos(angleRad) -\n (shape.y - point.y) * Math.sin(angleRad);\n const y = point.y +\n (shape.x - point.x) * Math.sin(angleRad) +\n (shape.y - point.y) * Math.cos(angleRad);\n return {\n ...shape,\n rotation: shape.rotation + angleRad,\n x,\n y,\n };\n}\nfunction rotateAroundCenter(shape, deltaRad) {\n const center = getCenter(shape);\n return rotateAroundPoint(shape, deltaRad, center);\n}\nfunction getSnap(snaps, newRotationRad, tol) {\n let snapped = newRotationRad;\n for (let i = 0; i < snaps.length; i++) {\n const angle = Global_1.Konva.getAngle(snaps[i]);\n const absDiff = Math.abs(angle - newRotationRad) % (Math.PI * 2);\n const dif = Math.min(absDiff, Math.PI * 2 - absDiff);\n if (dif < tol) {\n snapped = angle;\n }\n }\n return snapped;\n}\nlet activeTransformersCount = 0;\nclass Transformer extends Group_1.Group {\n constructor(config) {\n super(config);\n this._movingAnchorName = null;\n this._transforming = false;\n this._createElements();\n this._handleMouseMove = this._handleMouseMove.bind(this);\n this._handleMouseUp = this._handleMouseUp.bind(this);\n this.update = this.update.bind(this);\n this.on(ATTR_CHANGE_LIST, this.update);\n if (this.getNode()) {\n this.update();\n }\n }\n attachTo(node) {\n this.setNode(node);\n return this;\n }\n setNode(node) {\n Util_1.Util.warn('tr.setNode(shape), tr.node(shape) and tr.attachTo(shape) methods are deprecated. Please use tr.nodes(nodesArray) instead.');\n return this.setNodes([node]);\n }\n getNode() {\n return this._nodes && this._nodes[0];\n }\n _getEventNamespace() {\n return EVENTS_NAME + this._id;\n }\n setNodes(nodes = []) {\n if (this._nodes && this._nodes.length) {\n this.detach();\n }\n const filteredNodes = nodes.filter((node) => {\n if (node.isAncestorOf(this)) {\n Util_1.Util.error('Konva.Transformer cannot be an a child of the node you are trying to attach');\n return false;\n }\n return true;\n });\n this._nodes = nodes = filteredNodes;\n if (nodes.length === 1 && this.useSingleNodeRotation()) {\n this.rotation(nodes[0].getAbsoluteRotation());\n }\n else {\n this.rotation(0);\n }\n this._nodes.forEach((node) => {\n const onChange = () => {\n if (this.nodes().length === 1 && this.useSingleNodeRotation()) {\n this.rotation(this.nodes()[0].getAbsoluteRotation());\n }\n this._resetTransformCache();\n if (!this._transforming && !this.isDragging()) {\n this.update();\n }\n };\n const additionalEvents = node._attrsAffectingSize\n .map((prop) => prop + 'Change.' + this._getEventNamespace())\n .join(' ');\n node.on(additionalEvents, onChange);\n node.on(TRANSFORM_CHANGE_STR.map((e) => e + `.${this._getEventNamespace()}`).join(' '), onChange);\n node.on(`absoluteTransformChange.${this._getEventNamespace()}`, onChange);\n this._proxyDrag(node);\n });\n this._resetTransformCache();\n var elementsCreated = !!this.findOne('.top-left');\n if (elementsCreated) {\n this.update();\n }\n return this;\n }\n _proxyDrag(node) {\n let lastPos;\n node.on(`dragstart.${this._getEventNamespace()}`, (e) => {\n lastPos = node.getAbsolutePosition();\n if (!this.isDragging() && node !== this.findOne('.back')) {\n this.startDrag(e, false);\n }\n });\n node.on(`dragmove.${this._getEventNamespace()}`, (e) => {\n if (!lastPos) {\n return;\n }\n const abs = node.getAbsolutePosition();\n const dx = abs.x - lastPos.x;\n const dy = abs.y - lastPos.y;\n this.nodes().forEach((otherNode) => {\n if (otherNode === node) {\n return;\n }\n if (otherNode.isDragging()) {\n return;\n }\n const otherAbs = otherNode.getAbsolutePosition();\n otherNode.setAbsolutePosition({\n x: otherAbs.x + dx,\n y: otherAbs.y + dy,\n });\n otherNode.startDrag(e);\n });\n lastPos = null;\n });\n }\n getNodes() {\n return this._nodes || [];\n }\n getActiveAnchor() {\n return this._movingAnchorName;\n }\n detach() {\n if (this._nodes) {\n this._nodes.forEach((node) => {\n node.off('.' + this._getEventNamespace());\n });\n }\n this._nodes = [];\n this._resetTransformCache();\n }\n _resetTransformCache() {\n this._clearCache(NODES_RECT);\n this._clearCache('transform');\n this._clearSelfAndDescendantCache('absoluteTransform');\n }\n _getNodeRect() {\n return this._getCache(NODES_RECT, this.__getNodeRect);\n }\n __getNodeShape(node, rot = this.rotation(), relative) {\n var rect = node.getClientRect({\n skipTransform: true,\n skipShadow: true,\n skipStroke: this.ignoreStroke(),\n });\n var absScale = node.getAbsoluteScale(relative);\n var absPos = node.getAbsolutePosition(relative);\n var dx = rect.x * absScale.x - node.offsetX() * absScale.x;\n var dy = rect.y * absScale.y - node.offsetY() * absScale.y;\n const rotation = (Global_1.Konva.getAngle(node.getAbsoluteRotation()) + Math.PI * 2) %\n (Math.PI * 2);\n const box = {\n x: absPos.x + dx * Math.cos(rotation) + dy * Math.sin(-rotation),\n y: absPos.y + dy * Math.cos(rotation) + dx * Math.sin(rotation),\n width: rect.width * absScale.x,\n height: rect.height * absScale.y,\n rotation: rotation,\n };\n return rotateAroundPoint(box, -Global_1.Konva.getAngle(rot), {\n x: 0,\n y: 0,\n });\n }\n __getNodeRect() {\n var node = this.getNode();\n if (!node) {\n return {\n x: -MAX_SAFE_INTEGER,\n y: -MAX_SAFE_INTEGER,\n width: 0,\n height: 0,\n rotation: 0,\n };\n }\n const totalPoints = [];\n this.nodes().map((node) => {\n const box = node.getClientRect({\n skipTransform: true,\n skipShadow: true,\n skipStroke: this.ignoreStroke(),\n });\n var points = [\n { x: box.x, y: box.y },\n { x: box.x + box.width, y: box.y },\n { x: box.x + box.width, y: box.y + box.height },\n { x: box.x, y: box.y + box.height },\n ];\n var trans = node.getAbsoluteTransform();\n points.forEach(function (point) {\n var transformed = trans.point(point);\n totalPoints.push(transformed);\n });\n });\n const tr = new Util_1.Transform();\n tr.rotate(-Global_1.Konva.getAngle(this.rotation()));\n var minX = Infinity, minY = Infinity, maxX = -Infinity, maxY = -Infinity;\n totalPoints.forEach(function (point) {\n var transformed = tr.point(point);\n if (minX === undefined) {\n minX = maxX = transformed.x;\n minY = maxY = transformed.y;\n }\n minX = Math.min(minX, transformed.x);\n minY = Math.min(minY, transformed.y);\n maxX = Math.max(maxX, transformed.x);\n maxY = Math.max(maxY, transformed.y);\n });\n tr.invert();\n const p = tr.point({ x: minX, y: minY });\n return {\n x: p.x,\n y: p.y,\n width: maxX - minX,\n height: maxY - minY,\n rotation: Global_1.Konva.getAngle(this.rotation()),\n };\n }\n getX() {\n return this._getNodeRect().x;\n }\n getY() {\n return this._getNodeRect().y;\n }\n getWidth() {\n return this._getNodeRect().width;\n }\n getHeight() {\n return this._getNodeRect().height;\n }\n _createElements() {\n this._createBack();\n ANCHORS_NAMES.forEach((name) => {\n this._createAnchor(name);\n });\n this._createAnchor('rotater');\n }\n _createAnchor(name) {\n var anchor = new Rect_1.Rect({\n stroke: 'rgb(0, 161, 255)',\n fill: 'white',\n strokeWidth: 1,\n name: name + ' _anchor',\n dragDistance: 0,\n draggable: true,\n hitStrokeWidth: TOUCH_DEVICE ? 10 : 'auto',\n });\n var self = this;\n anchor.on('mousedown touchstart', function (e) {\n self._handleMouseDown(e);\n });\n anchor.on('dragstart', (e) => {\n anchor.stopDrag();\n e.cancelBubble = true;\n });\n anchor.on('dragend', (e) => {\n e.cancelBubble = true;\n });\n anchor.on('mouseenter', () => {\n var rad = Global_1.Konva.getAngle(this.rotation());\n var rotateCursor = this.rotateAnchorCursor();\n var cursor = getCursor(name, rad, rotateCursor);\n anchor.getStage().content &&\n (anchor.getStage().content.style.cursor = cursor);\n this._cursorChange = true;\n });\n anchor.on('mouseout', () => {\n anchor.getStage().content &&\n (anchor.getStage().content.style.cursor = '');\n this._cursorChange = false;\n });\n this.add(anchor);\n }\n _createBack() {\n var back = new Shape_1.Shape({\n name: 'back',\n width: 0,\n height: 0,\n draggable: true,\n sceneFunc(ctx, shape) {\n var tr = shape.getParent();\n var padding = tr.padding();\n ctx.beginPath();\n ctx.rect(-padding, -padding, shape.width() + padding * 2, shape.height() + padding * 2);\n ctx.moveTo(shape.width() / 2, -padding);\n if (tr.rotateEnabled() && tr.rotateLineVisible()) {\n ctx.lineTo(shape.width() / 2, -tr.rotateAnchorOffset() * Util_1.Util._sign(shape.height()) - padding);\n }\n ctx.fillStrokeShape(shape);\n },\n hitFunc: (ctx, shape) => {\n if (!this.shouldOverdrawWholeArea()) {\n return;\n }\n var padding = this.padding();\n ctx.beginPath();\n ctx.rect(-padding, -padding, shape.width() + padding * 2, shape.height() + padding * 2);\n ctx.fillStrokeShape(shape);\n },\n });\n this.add(back);\n this._proxyDrag(back);\n back.on('dragstart', (e) => {\n e.cancelBubble = true;\n });\n back.on('dragmove', (e) => {\n e.cancelBubble = true;\n });\n back.on('dragend', (e) => {\n e.cancelBubble = true;\n });\n this.on('dragmove', (e) => {\n this.update();\n });\n }\n _handleMouseDown(e) {\n this._movingAnchorName = e.target.name().split(' ')[0];\n var attrs = this._getNodeRect();\n var width = attrs.width;\n var height = attrs.height;\n var hypotenuse = Math.sqrt(Math.pow(width, 2) + Math.pow(height, 2));\n this.sin = Math.abs(height / hypotenuse);\n this.cos = Math.abs(width / hypotenuse);\n if (typeof window !== 'undefined') {\n window.addEventListener('mousemove', this._handleMouseMove);\n window.addEventListener('touchmove', this._handleMouseMove);\n window.addEventListener('mouseup', this._handleMouseUp, true);\n window.addEventListener('touchend', this._handleMouseUp, true);\n }\n this._transforming = true;\n var ap = e.target.getAbsolutePosition();\n var pos = e.target.getStage().getPointerPosition();\n this._anchorDragOffset = {\n x: pos.x - ap.x,\n y: pos.y - ap.y,\n };\n activeTransformersCount++;\n this._fire('transformstart', { evt: e.evt, target: this.getNode() });\n this._nodes.forEach((target) => {\n target._fire('transformstart', { evt: e.evt, target });\n });\n }\n _handleMouseMove(e) {\n var x, y, newHypotenuse;\n var anchorNode = this.findOne('.' + this._movingAnchorName);\n var stage = anchorNode.getStage();\n stage.setPointersPositions(e);\n const pp = stage.getPointerPosition();\n let newNodePos = {\n x: pp.x - this._anchorDragOffset.x,\n y: pp.y - this._anchorDragOffset.y,\n };\n const oldAbs = anchorNode.getAbsolutePosition();\n if (this.anchorDragBoundFunc()) {\n newNodePos = this.anchorDragBoundFunc()(oldAbs, newNodePos, e);\n }\n anchorNode.setAbsolutePosition(newNodePos);\n const newAbs = anchorNode.getAbsolutePosition();\n if (oldAbs.x === newAbs.x && oldAbs.y === newAbs.y) {\n return;\n }\n if (this._movingAnchorName === 'rotater') {\n var attrs = this._getNodeRect();\n x = anchorNode.x() - attrs.width / 2;\n y = -anchorNode.y() + attrs.height / 2;\n let delta = Math.atan2(-y, x) + Math.PI / 2;\n if (attrs.height < 0) {\n delta -= Math.PI;\n }\n var oldRotation = Global_1.Konva.getAngle(this.rotation());\n const newRotation = oldRotation + delta;\n const tol = Global_1.Konva.getAngle(this.rotationSnapTolerance());\n const snappedRot = getSnap(this.rotationSnaps(), newRotation, tol);\n const diff = snappedRot - attrs.rotation;\n const shape = rotateAroundCenter(attrs, diff);\n this._fitNodesInto(shape, e);\n return;\n }\n var shiftBehavior = this.shiftBehavior();\n var keepProportion;\n if (shiftBehavior === 'inverted') {\n keepProportion = this.keepRatio() && !e.shiftKey;\n }\n else if (shiftBehavior === 'none') {\n keepProportion = this.keepRatio();\n }\n else {\n keepProportion = this.keepRatio() || e.shiftKey;\n }\n var centeredScaling = this.centeredScaling() || e.altKey;\n if (this._movingAnchorName === 'top-left') {\n if (keepProportion) {\n var comparePoint = centeredScaling\n ? {\n x: this.width() / 2,\n y: this.height() / 2,\n }\n : {\n x: this.findOne('.bottom-right').x(),\n y: this.findOne('.bottom-right').y(),\n };\n newHypotenuse = Math.sqrt(Math.pow(comparePoint.x - anchorNode.x(), 2) +\n Math.pow(comparePoint.y - anchorNode.y(), 2));\n var reverseX = this.findOne('.top-left').x() > comparePoint.x ? -1 : 1;\n var reverseY = this.findOne('.top-left').y() > comparePoint.y ? -1 : 1;\n x = newHypotenuse * this.cos * reverseX;\n y = newHypotenuse * this.sin * reverseY;\n this.findOne('.top-left').x(comparePoint.x - x);\n this.findOne('.top-left').y(comparePoint.y - y);\n }\n }\n else if (this._movingAnchorName === 'top-center') {\n this.findOne('.top-left').y(anchorNode.y());\n }\n else if (this._movingAnchorName === 'top-right') {\n if (keepProportion) {\n var comparePoint = centeredScaling\n ? {\n x: this.width() / 2,\n y: this.height() / 2,\n }\n : {\n x: this.findOne('.bottom-left').x(),\n y: this.findOne('.bottom-left').y(),\n };\n newHypotenuse = Math.sqrt(Math.pow(anchorNode.x() - comparePoint.x, 2) +\n Math.pow(comparePoint.y - anchorNode.y(), 2));\n var reverseX = this.findOne('.top-right').x() < comparePoint.x ? -1 : 1;\n var reverseY = this.findOne('.top-right').y() > comparePoint.y ? -1 : 1;\n x = newHypotenuse * this.cos * reverseX;\n y = newHypotenuse * this.sin * reverseY;\n this.findOne('.top-right').x(comparePoint.x + x);\n this.findOne('.top-right').y(comparePoint.y - y);\n }\n var pos = anchorNode.position();\n this.findOne('.top-left').y(pos.y);\n this.findOne('.bottom-right').x(pos.x);\n }\n else if (this._movingAnchorName === 'middle-left') {\n this.findOne('.top-left').x(anchorNode.x());\n }\n else if (this._movingAnchorName === 'middle-right') {\n this.findOne('.bottom-right').x(anchorNode.x());\n }\n else if (this._movingAnchorName === 'bottom-left') {\n if (keepProportion) {\n var comparePoint = centeredScaling\n ? {\n x: this.width() / 2,\n y: this.height() / 2,\n }\n : {\n x: this.findOne('.top-right').x(),\n y: this.findOne('.top-right').y(),\n };\n newHypotenuse = Math.sqrt(Math.pow(comparePoint.x - anchorNode.x(), 2) +\n Math.pow(anchorNode.y() - comparePoint.y, 2));\n var reverseX = comparePoint.x < anchorNode.x() ? -1 : 1;\n var reverseY = anchorNode.y() < comparePoint.y ? -1 : 1;\n x = newHypotenuse * this.cos * reverseX;\n y = newHypotenuse * this.sin * reverseY;\n anchorNode.x(comparePoint.x - x);\n anchorNode.y(comparePoint.y + y);\n }\n pos = anchorNode.position();\n this.findOne('.top-left').x(pos.x);\n this.findOne('.bottom-right').y(pos.y);\n }\n else if (this._movingAnchorName === 'bottom-center') {\n this.findOne('.bottom-right').y(anchorNode.y());\n }\n else if (this._movingAnchorName === 'bottom-right') {\n if (keepProportion) {\n var comparePoint = centeredScaling\n ? {\n x: this.width() / 2,\n y: this.height() / 2,\n }\n : {\n x: this.findOne('.top-left').x(),\n y: this.findOne('.top-left').y(),\n };\n newHypotenuse = Math.sqrt(Math.pow(anchorNode.x() - comparePoint.x, 2) +\n Math.pow(anchorNode.y() - comparePoint.y, 2));\n var reverseX = this.findOne('.bottom-right').x() < comparePoint.x ? -1 : 1;\n var reverseY = this.findOne('.bottom-right').y() < comparePoint.y ? -1 : 1;\n x = newHypotenuse * this.cos * reverseX;\n y = newHypotenuse * this.sin * reverseY;\n this.findOne('.bottom-right').x(comparePoint.x + x);\n this.findOne('.bottom-right').y(comparePoint.y + y);\n }\n }\n else {\n console.error(new Error('Wrong position argument of selection resizer: ' +\n this._movingAnchorName));\n }\n var centeredScaling = this.centeredScaling() || e.altKey;\n if (centeredScaling) {\n var topLeft = this.findOne('.top-left');\n var bottomRight = this.findOne('.bottom-right');\n var topOffsetX = topLeft.x();\n var topOffsetY = topLeft.y();\n var bottomOffsetX = this.getWidth() - bottomRight.x();\n var bottomOffsetY = this.getHeight() - bottomRight.y();\n bottomRight.move({\n x: -topOffsetX,\n y: -topOffsetY,\n });\n topLeft.move({\n x: bottomOffsetX,\n y: bottomOffsetY,\n });\n }\n var absPos = this.findOne('.top-left').getAbsolutePosition();\n x = absPos.x;\n y = absPos.y;\n var width = this.findOne('.bottom-right').x() - this.findOne('.top-left').x();\n var height = this.findOne('.bottom-right').y() - this.findOne('.top-left').y();\n this._fitNodesInto({\n x: x,\n y: y,\n width: width,\n height: height,\n rotation: Global_1.Konva.getAngle(this.rotation()),\n }, e);\n }\n _handleMouseUp(e) {\n this._removeEvents(e);\n }\n getAbsoluteTransform() {\n return this.getTransform();\n }\n _removeEvents(e) {\n var _a;\n if (this._transforming) {\n this._transforming = false;\n if (typeof window !== 'undefined') {\n window.removeEventListener('mousemove', this._handleMouseMove);\n window.removeEventListener('touchmove', this._handleMouseMove);\n window.removeEventListener('mouseup', this._handleMouseUp, true);\n window.removeEventListener('touchend', this._handleMouseUp, true);\n }\n var node = this.getNode();\n activeTransformersCount--;\n this._fire('transformend', { evt: e, target: node });\n (_a = this.getLayer()) === null || _a === void 0 ? void 0 : _a.batchDraw();\n if (node) {\n this._nodes.forEach((target) => {\n var _a;\n target._fire('transformend', { evt: e, target });\n (_a = target.getLayer()) === null || _a === void 0 ? void 0 : _a.batchDraw();\n });\n }\n this._movingAnchorName = null;\n }\n }\n _fitNodesInto(newAttrs, evt) {\n var oldAttrs = this._getNodeRect();\n const minSize = 1;\n if (Util_1.Util._inRange(newAttrs.width, -this.padding() * 2 - minSize, minSize)) {\n this.update();\n return;\n }\n if (Util_1.Util._inRange(newAttrs.height, -this.padding() * 2 - minSize, minSize)) {\n this.update();\n return;\n }\n var t = new Util_1.Transform();\n t.rotate(Global_1.Konva.getAngle(this.rotation()));\n if (this._movingAnchorName &&\n newAttrs.width < 0 &&\n this._movingAnchorName.indexOf('left') >= 0) {\n const offset = t.point({\n x: -this.padding() * 2,\n y: 0,\n });\n newAttrs.x += offset.x;\n newAttrs.y += offset.y;\n newAttrs.width += this.padding() * 2;\n this._movingAnchorName = this._movingAnchorName.replace('left', 'right');\n this._anchorDragOffset.x -= offset.x;\n this._anchorDragOffset.y -= offset.y;\n }\n else if (this._movingAnchorName &&\n newAttrs.width < 0 &&\n this._movingAnchorName.indexOf('right') >= 0) {\n const offset = t.point({\n x: this.padding() * 2,\n y: 0,\n });\n this._movingAnchorName = this._movingAnchorName.replace('right', 'left');\n this._anchorDragOffset.x -= offset.x;\n this._anchorDragOffset.y -= offset.y;\n newAttrs.width += this.padding() * 2;\n }\n if (this._movingAnchorName &&\n newAttrs.height < 0 &&\n this._movingAnchorName.indexOf('top') >= 0) {\n const offset = t.point({\n x: 0,\n y: -this.padding() * 2,\n });\n newAttrs.x += offset.x;\n newAttrs.y += offset.y;\n this._movingAnchorName = this._movingAnchorName.replace('top', 'bottom');\n this._anchorDragOffset.x -= offset.x;\n this._anchorDragOffset.y -= offset.y;\n newAttrs.height += this.padding() * 2;\n }\n else if (this._movingAnchorName &&\n newAttrs.height < 0 &&\n this._movingAnchorName.indexOf('bottom') >= 0) {\n const offset = t.point({\n x: 0,\n y: this.padding() * 2,\n });\n this._movingAnchorName = this._movingAnchorName.replace('bottom', 'top');\n this._anchorDragOffset.x -= offset.x;\n this._anchorDragOffset.y -= offset.y;\n newAttrs.height += this.padding() * 2;\n }\n if (this.boundBoxFunc()) {\n const bounded = this.boundBoxFunc()(oldAttrs, newAttrs);\n if (bounded) {\n newAttrs = bounded;\n }\n else {\n Util_1.Util.warn('boundBoxFunc returned falsy. You should return new bound rect from it!');\n }\n }\n const baseSize = 10000000;\n const oldTr = new Util_1.Transform();\n oldTr.translate(oldAttrs.x, oldAttrs.y);\n oldTr.rotate(oldAttrs.rotation);\n oldTr.scale(oldAttrs.width / baseSize, oldAttrs.height / baseSize);\n const newTr = new Util_1.Transform();\n const newScaleX = newAttrs.width / baseSize;\n const newScaleY = newAttrs.height / baseSize;\n if (this.flipEnabled() === false) {\n newTr.translate(newAttrs.x, newAttrs.y);\n newTr.rotate(newAttrs.rotation);\n newTr.translate(newAttrs.width < 0 ? newAttrs.width : 0, newAttrs.height < 0 ? newAttrs.height : 0);\n newTr.scale(Math.abs(newScaleX), Math.abs(newScaleY));\n }\n else {\n newTr.translate(newAttrs.x, newAttrs.y);\n newTr.rotate(newAttrs.rotation);\n newTr.scale(newScaleX, newScaleY);\n }\n const delta = newTr.multiply(oldTr.invert());\n this._nodes.forEach((node) => {\n var _a;\n const parentTransform = node.getParent().getAbsoluteTransform();\n const localTransform = node.getTransform().copy();\n localTransform.translate(node.offsetX(), node.offsetY());\n const newLocalTransform = new Util_1.Transform();\n newLocalTransform\n .multiply(parentTransform.copy().invert())\n .multiply(delta)\n .multiply(parentTransform)\n .multiply(localTransform);\n const attrs = newLocalTransform.decompose();\n node.setAttrs(attrs);\n (_a = node.getLayer()) === null || _a === void 0 ? void 0 : _a.batchDraw();\n });\n this.rotation(Util_1.Util._getRotation(newAttrs.rotation));\n this._nodes.forEach((node) => {\n this._fire('transform', { evt: evt, target: node });\n node._fire('transform', { evt: evt, target: node });\n });\n this._resetTransformCache();\n this.update();\n this.getLayer().batchDraw();\n }\n forceUpdate() {\n this._resetTransformCache();\n this.update();\n }\n _batchChangeChild(selector, attrs) {\n const anchor = this.findOne(selector);\n anchor.setAttrs(attrs);\n }\n update() {\n var _a;\n var attrs = this._getNodeRect();\n this.rotation(Util_1.Util._getRotation(attrs.rotation));\n var width = attrs.width;\n var height = attrs.height;\n var enabledAnchors = this.enabledAnchors();\n var resizeEnabled = this.resizeEnabled();\n var padding = this.padding();\n var anchorSize = this.anchorSize();\n const anchors = this.find('._anchor');\n anchors.forEach((node) => {\n node.setAttrs({\n width: anchorSize,\n height: anchorSize,\n offsetX: anchorSize / 2,\n offsetY: anchorSize / 2,\n stroke: this.anchorStroke(),\n strokeWidth: this.anchorStrokeWidth(),\n fill: this.anchorFill(),\n cornerRadius: this.anchorCornerRadius(),\n });\n });\n this._batchChangeChild('.top-left', {\n x: 0,\n y: 0,\n offsetX: anchorSize / 2 + padding,\n offsetY: anchorSize / 2 + padding,\n visible: resizeEnabled && enabledAnchors.indexOf('top-left') >= 0,\n });\n this._batchChangeChild('.top-center', {\n x: width / 2,\n y: 0,\n offsetY: anchorSize / 2 + padding,\n visible: resizeEnabled && enabledAnchors.indexOf('top-center') >= 0,\n });\n this._batchChangeChild('.top-right', {\n x: width,\n y: 0,\n offsetX: anchorSize / 2 - padding,\n offsetY: anchorSize / 2 + padding,\n visible: resizeEnabled && enabledAnchors.indexOf('top-right') >= 0,\n });\n this._batchChangeChild('.middle-left', {\n x: 0,\n y: height / 2,\n offsetX: anchorSize / 2 + padding,\n visible: resizeEnabled && enabledAnchors.indexOf('middle-left') >= 0,\n });\n this._batchChangeChild('.middle-right', {\n x: width,\n y: height / 2,\n offsetX: anchorSize / 2 - padding,\n visible: resizeEnabled && enabledAnchors.indexOf('middle-right') >= 0,\n });\n this._batchChangeChild('.bottom-left', {\n x: 0,\n y: height,\n offsetX: anchorSize / 2 + padding,\n offsetY: anchorSize / 2 - padding,\n visible: resizeEnabled && enabledAnchors.indexOf('bottom-left') >= 0,\n });\n this._batchChangeChild('.bottom-center', {\n x: width / 2,\n y: height,\n offsetY: anchorSize / 2 - padding,\n visible: resizeEnabled && enabledAnchors.indexOf('bottom-center') >= 0,\n });\n this._batchChangeChild('.bottom-right', {\n x: width,\n y: height,\n offsetX: anchorSize / 2 - padding,\n offsetY: anchorSize / 2 - padding,\n visible: resizeEnabled && enabledAnchors.indexOf('bottom-right') >= 0,\n });\n this._batchChangeChild('.rotater', {\n x: width / 2,\n y: -this.rotateAnchorOffset() * Util_1.Util._sign(height) - padding,\n visible: this.rotateEnabled(),\n });\n this._batchChangeChild('.back', {\n width: width,\n height: height,\n visible: this.borderEnabled(),\n stroke: this.borderStroke(),\n strokeWidth: this.borderStrokeWidth(),\n dash: this.borderDash(),\n x: 0,\n y: 0,\n });\n const styleFunc = this.anchorStyleFunc();\n if (styleFunc) {\n anchors.forEach((node) => {\n styleFunc(node);\n });\n }\n (_a = this.getLayer()) === null || _a === void 0 ? void 0 : _a.batchDraw();\n }\n isTransforming() {\n return this._transforming;\n }\n stopTransform() {\n if (this._transforming) {\n this._removeEvents();\n var anchorNode = this.findOne('.' + this._movingAnchorName);\n if (anchorNode) {\n anchorNode.stopDrag();\n }\n }\n }\n destroy() {\n if (this.getStage() && this._cursorChange) {\n this.getStage().content && (this.getStage().content.style.cursor = '');\n }\n Group_1.Group.prototype.destroy.call(this);\n this.detach();\n this._removeEvents();\n return this;\n }\n toObject() {\n return Node_1.Node.prototype.toObject.call(this);\n }\n clone(obj) {\n var node = Node_1.Node.prototype.clone.call(this, obj);\n return node;\n }\n getClientRect() {\n if (this.nodes().length > 0) {\n return super.getClientRect();\n }\n else {\n return { x: 0, y: 0, width: 0, height: 0 };\n }\n }\n}\nexports.Transformer = Transformer;\nTransformer.isTransforming = () => {\n return activeTransformersCount > 0;\n};\nfunction validateAnchors(val) {\n if (!(val instanceof Array)) {\n Util_1.Util.warn('enabledAnchors value should be an array');\n }\n if (val instanceof Array) {\n val.forEach(function (name) {\n if (ANCHORS_NAMES.indexOf(name) === -1) {\n Util_1.Util.warn('Unknown anchor name: ' +\n name +\n '. Available names are: ' +\n ANCHORS_NAMES.join(', '));\n }\n });\n }\n return val || [];\n}\nTransformer.prototype.className = 'Transformer';\n(0, Global_2._registerNode)(Transformer);\nFactory_1.Factory.addGetterSetter(Transformer, 'enabledAnchors', ANCHORS_NAMES, validateAnchors);\nFactory_1.Factory.addGetterSetter(Transformer, 'flipEnabled', true, (0, Validators_1.getBooleanValidator)());\nFactory_1.Factory.addGetterSetter(Transformer, 'resizeEnabled', true);\nFactory_1.Factory.addGetterSetter(Transformer, 'anchorSize', 10, (0, Validators_1.getNumberValidator)());\nFactory_1.Factory.addGetterSetter(Transformer, 'rotateEnabled', true);\nFactory_1.Factory.addGetterSetter(Transformer, 'rotateLineVisible', true);\nFactory_1.Factory.addGetterSetter(Transformer, 'rotationSnaps', []);\nFactory_1.Factory.addGetterSetter(Transformer, 'rotateAnchorOffset', 50, (0, Validators_1.getNumberValidator)());\nFactory_1.Factory.addGetterSetter(Transformer, 'rotateAnchorCursor', 'crosshair');\nFactory_1.Factory.addGetterSetter(Transformer, 'rotationSnapTolerance', 5, (0, Validators_1.getNumberValidator)());\nFactory_1.Factory.addGetterSetter(Transformer, 'borderEnabled', true);\nFactory_1.Factory.addGetterSetter(Transformer, 'anchorStroke', 'rgb(0, 161, 255)');\nFactory_1.Factory.addGetterSetter(Transformer, 'anchorStrokeWidth', 1, (0, Validators_1.getNumberValidator)());\nFactory_1.Factory.addGetterSetter(Transformer, 'anchorFill', 'white');\nFactory_1.Factory.addGetterSetter(Transformer, 'anchorCornerRadius', 0, (0, Validators_1.getNumberValidator)());\nFactory_1.Factory.addGetterSetter(Transformer, 'borderStroke', 'rgb(0, 161, 255)');\nFactory_1.Factory.addGetterSetter(Transformer, 'borderStrokeWidth', 1, (0, Validators_1.getNumberValidator)());\nFactory_1.Factory.addGetterSetter(Transformer, 'borderDash');\nFactory_1.Factory.addGetterSetter(Transformer, 'keepRatio', true);\nFactory_1.Factory.addGetterSetter(Transformer, 'shiftBehavior', 'default');\nFactory_1.Factory.addGetterSetter(Transformer, 'centeredScaling', false);\nFactory_1.Factory.addGetterSetter(Transformer, 'ignoreStroke', false);\nFactory_1.Factory.addGetterSetter(Transformer, 'padding', 0, (0, Validators_1.getNumberValidator)());\nFactory_1.Factory.addGetterSetter(Transformer, 'node');\nFactory_1.Factory.addGetterSetter(Transformer, 'nodes');\nFactory_1.Factory.addGetterSetter(Transformer, 'boundBoxFunc');\nFactory_1.Factory.addGetterSetter(Transformer, 'anchorDragBoundFunc');\nFactory_1.Factory.addGetterSetter(Transformer, 'anchorStyleFunc');\nFactory_1.Factory.addGetterSetter(Transformer, 'shouldOverdrawWholeArea', false);\nFactory_1.Factory.addGetterSetter(Transformer, 'useSingleNodeRotation', true);\nFactory_1.Factory.backCompat(Transformer, {\n lineEnabled: 'borderEnabled',\n rotateHandlerOffset: 'rotateAnchorOffset',\n enabledHandlers: 'enabledAnchors',\n});\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Wedge = void 0;\nconst Factory_1 = require(\"../Factory\");\nconst Shape_1 = require(\"../Shape\");\nconst Global_1 = require(\"../Global\");\nconst Validators_1 = require(\"../Validators\");\nconst Global_2 = require(\"../Global\");\nclass Wedge extends Shape_1.Shape {\n _sceneFunc(context) {\n context.beginPath();\n context.arc(0, 0, this.radius(), 0, Global_1.Konva.getAngle(this.angle()), this.clockwise());\n context.lineTo(0, 0);\n context.closePath();\n context.fillStrokeShape(this);\n }\n getWidth() {\n return this.radius() * 2;\n }\n getHeight() {\n return this.radius() * 2;\n }\n setWidth(width) {\n this.radius(width / 2);\n }\n setHeight(height) {\n this.radius(height / 2);\n }\n}\nexports.Wedge = Wedge;\nWedge.prototype.className = 'Wedge';\nWedge.prototype._centroid = true;\nWedge.prototype._attrsAffectingSize = ['radius'];\n(0, Global_2._registerNode)(Wedge);\nFactory_1.Factory.addGetterSetter(Wedge, 'radius', 0, (0, Validators_1.getNumberValidator)());\nFactory_1.Factory.addGetterSetter(Wedge, 'angle', 0, (0, Validators_1.getNumberValidator)());\nFactory_1.Factory.addGetterSetter(Wedge, 'clockwise', false);\nFactory_1.Factory.backCompat(Wedge, {\n angleDeg: 'angle',\n getAngleDeg: 'getAngle',\n setAngleDeg: 'setAngle',\n});\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Blur = void 0;\nconst Factory_1 = require(\"../Factory\");\nconst Node_1 = require(\"../Node\");\nconst Validators_1 = require(\"../Validators\");\nfunction BlurStack() {\n this.r = 0;\n this.g = 0;\n this.b = 0;\n this.a = 0;\n this.next = null;\n}\nvar mul_table = [\n 512, 512, 456, 512, 328, 456, 335, 512, 405, 328, 271, 456, 388, 335, 292,\n 512, 454, 405, 364, 328, 298, 271, 496, 456, 420, 388, 360, 335, 312, 292,\n 273, 512, 482, 454, 428, 405, 383, 364, 345, 328, 312, 298, 284, 271, 259,\n 496, 475, 456, 437, 420, 404, 388, 374, 360, 347, 335, 323, 312, 302, 292,\n 282, 273, 265, 512, 497, 482, 468, 454, 441, 428, 417, 405, 394, 383, 373,\n 364, 354, 345, 337, 328, 320, 312, 305, 298, 291, 284, 278, 271, 265, 259,\n 507, 496, 485, 475, 465, 456, 446, 437, 428, 420, 412, 404, 396, 388, 381,\n 374, 367, 360, 354, 347, 341, 335, 329, 323, 318, 312, 307, 302, 297, 292,\n 287, 282, 278, 273, 269, 265, 261, 512, 505, 497, 489, 482, 475, 468, 461,\n 454, 447, 441, 435, 428, 422, 417, 411, 405, 399, 394, 389, 383, 378, 373,\n 368, 364, 359, 354, 350, 345, 341, 337, 332, 328, 324, 320, 316, 312, 309,\n 305, 301, 298, 294, 291, 287, 284, 281, 278, 274, 271, 268, 265, 262, 259,\n 257, 507, 501, 496, 491, 485, 480, 475, 470, 465, 460, 456, 451, 446, 442,\n 437, 433, 428, 424, 420, 416, 412, 408, 404, 400, 396, 392, 388, 385, 381,\n 377, 374, 370, 367, 363, 360, 357, 354, 350, 347, 344, 341, 338, 335, 332,\n 329, 326, 323, 320, 318, 315, 312, 310, 307, 304, 302, 299, 297, 294, 292,\n 289, 287, 285, 282, 280, 278, 275, 273, 271, 269, 267, 265, 263, 261, 259,\n];\nvar shg_table = [\n 9, 11, 12, 13, 13, 14, 14, 15, 15, 15, 15, 16, 16, 16, 16, 17, 17, 17, 17, 17,\n 17, 17, 18, 18, 18, 18, 18, 18, 18, 18, 18, 19, 19, 19, 19, 19, 19, 19, 19,\n 19, 19, 19, 19, 19, 19, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,\n 20, 20, 20, 20, 20, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21,\n 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 22, 22, 22, 22, 22, 22,\n 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22,\n 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 23, 23, 23, 23, 23, 23, 23,\n 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23,\n 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23,\n 23, 23, 23, 23, 23, 23, 23, 23, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24,\n 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24,\n 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24,\n 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24,\n 24, 24, 24, 24, 24, 24, 24,\n];\nfunction filterGaussBlurRGBA(imageData, radius) {\n var pixels = imageData.data, width = imageData.width, height = imageData.height;\n var x, y, i, p, yp, yi, yw, r_sum, g_sum, b_sum, a_sum, r_out_sum, g_out_sum, b_out_sum, a_out_sum, r_in_sum, g_in_sum, b_in_sum, a_in_sum, pr, pg, pb, pa, rbs;\n var div = radius + radius + 1, widthMinus1 = width - 1, heightMinus1 = height - 1, radiusPlus1 = radius + 1, sumFactor = (radiusPlus1 * (radiusPlus1 + 1)) / 2, stackStart = new BlurStack(), stackEnd = null, stack = stackStart, stackIn = null, stackOut = null, mul_sum = mul_table[radius], shg_sum = shg_table[radius];\n for (i = 1; i < div; i++) {\n stack = stack.next = new BlurStack();\n if (i === radiusPlus1) {\n stackEnd = stack;\n }\n }\n stack.next = stackStart;\n yw = yi = 0;\n for (y = 0; y < height; y++) {\n r_in_sum =\n g_in_sum =\n b_in_sum =\n a_in_sum =\n r_sum =\n g_sum =\n b_sum =\n a_sum =\n 0;\n r_out_sum = radiusPlus1 * (pr = pixels[yi]);\n g_out_sum = radiusPlus1 * (pg = pixels[yi + 1]);\n b_out_sum = radiusPlus1 * (pb = pixels[yi + 2]);\n a_out_sum = radiusPlus1 * (pa = pixels[yi + 3]);\n r_sum += sumFactor * pr;\n g_sum += sumFactor * pg;\n b_sum += sumFactor * pb;\n a_sum += sumFactor * pa;\n stack = stackStart;\n for (i = 0; i < radiusPlus1; i++) {\n stack.r = pr;\n stack.g = pg;\n stack.b = pb;\n stack.a = pa;\n stack = stack.next;\n }\n for (i = 1; i < radiusPlus1; i++) {\n p = yi + ((widthMinus1 < i ? widthMinus1 : i) << 2);\n r_sum += (stack.r = pr = pixels[p]) * (rbs = radiusPlus1 - i);\n g_sum += (stack.g = pg = pixels[p + 1]) * rbs;\n b_sum += (stack.b = pb = pixels[p + 2]) * rbs;\n a_sum += (stack.a = pa = pixels[p + 3]) * rbs;\n r_in_sum += pr;\n g_in_sum += pg;\n b_in_sum += pb;\n a_in_sum += pa;\n stack = stack.next;\n }\n stackIn = stackStart;\n stackOut = stackEnd;\n for (x = 0; x < width; x++) {\n pixels[yi + 3] = pa = (a_sum * mul_sum) >> shg_sum;\n if (pa !== 0) {\n pa = 255 / pa;\n pixels[yi] = ((r_sum * mul_sum) >> shg_sum) * pa;\n pixels[yi + 1] = ((g_sum * mul_sum) >> shg_sum) * pa;\n pixels[yi + 2] = ((b_sum * mul_sum) >> shg_sum) * pa;\n }\n else {\n pixels[yi] = pixels[yi + 1] = pixels[yi + 2] = 0;\n }\n r_sum -= r_out_sum;\n g_sum -= g_out_sum;\n b_sum -= b_out_sum;\n a_sum -= a_out_sum;\n r_out_sum -= stackIn.r;\n g_out_sum -= stackIn.g;\n b_out_sum -= stackIn.b;\n a_out_sum -= stackIn.a;\n p = (yw + ((p = x + radius + 1) < widthMinus1 ? p : widthMinus1)) << 2;\n r_in_sum += stackIn.r = pixels[p];\n g_in_sum += stackIn.g = pixels[p + 1];\n b_in_sum += stackIn.b = pixels[p + 2];\n a_in_sum += stackIn.a = pixels[p + 3];\n r_sum += r_in_sum;\n g_sum += g_in_sum;\n b_sum += b_in_sum;\n a_sum += a_in_sum;\n stackIn = stackIn.next;\n r_out_sum += pr = stackOut.r;\n g_out_sum += pg = stackOut.g;\n b_out_sum += pb = stackOut.b;\n a_out_sum += pa = stackOut.a;\n r_in_sum -= pr;\n g_in_sum -= pg;\n b_in_sum -= pb;\n a_in_sum -= pa;\n stackOut = stackOut.next;\n yi += 4;\n }\n yw += width;\n }\n for (x = 0; x < width; x++) {\n g_in_sum =\n b_in_sum =\n a_in_sum =\n r_in_sum =\n g_sum =\n b_sum =\n a_sum =\n r_sum =\n 0;\n yi = x << 2;\n r_out_sum = radiusPlus1 * (pr = pixels[yi]);\n g_out_sum = radiusPlus1 * (pg = pixels[yi + 1]);\n b_out_sum = radiusPlus1 * (pb = pixels[yi + 2]);\n a_out_sum = radiusPlus1 * (pa = pixels[yi + 3]);\n r_sum += sumFactor * pr;\n g_sum += sumFactor * pg;\n b_sum += sumFactor * pb;\n a_sum += sumFactor * pa;\n stack = stackStart;\n for (i = 0; i < radiusPlus1; i++) {\n stack.r = pr;\n stack.g = pg;\n stack.b = pb;\n stack.a = pa;\n stack = stack.next;\n }\n yp = width;\n for (i = 1; i <= radius; i++) {\n yi = (yp + x) << 2;\n r_sum += (stack.r = pr = pixels[yi]) * (rbs = radiusPlus1 - i);\n g_sum += (stack.g = pg = pixels[yi + 1]) * rbs;\n b_sum += (stack.b = pb = pixels[yi + 2]) * rbs;\n a_sum += (stack.a = pa = pixels[yi + 3]) * rbs;\n r_in_sum += pr;\n g_in_sum += pg;\n b_in_sum += pb;\n a_in_sum += pa;\n stack = stack.next;\n if (i < heightMinus1) {\n yp += width;\n }\n }\n yi = x;\n stackIn = stackStart;\n stackOut = stackEnd;\n for (y = 0; y < height; y++) {\n p = yi << 2;\n pixels[p + 3] = pa = (a_sum * mul_sum) >> shg_sum;\n if (pa > 0) {\n pa = 255 / pa;\n pixels[p] = ((r_sum * mul_sum) >> shg_sum) * pa;\n pixels[p + 1] = ((g_sum * mul_sum) >> shg_sum) * pa;\n pixels[p + 2] = ((b_sum * mul_sum) >> shg_sum) * pa;\n }\n else {\n pixels[p] = pixels[p + 1] = pixels[p + 2] = 0;\n }\n r_sum -= r_out_sum;\n g_sum -= g_out_sum;\n b_sum -= b_out_sum;\n a_sum -= a_out_sum;\n r_out_sum -= stackIn.r;\n g_out_sum -= stackIn.g;\n b_out_sum -= stackIn.b;\n a_out_sum -= stackIn.a;\n p =\n (x +\n ((p = y + radiusPlus1) < heightMinus1 ? p : heightMinus1) * width) <<\n 2;\n r_sum += r_in_sum += stackIn.r = pixels[p];\n g_sum += g_in_sum += stackIn.g = pixels[p + 1];\n b_sum += b_in_sum += stackIn.b = pixels[p + 2];\n a_sum += a_in_sum += stackIn.a = pixels[p + 3];\n stackIn = stackIn.next;\n r_out_sum += pr = stackOut.r;\n g_out_sum += pg = stackOut.g;\n b_out_sum += pb = stackOut.b;\n a_out_sum += pa = stackOut.a;\n r_in_sum -= pr;\n g_in_sum -= pg;\n b_in_sum -= pb;\n a_in_sum -= pa;\n stackOut = stackOut.next;\n yi += width;\n }\n }\n}\nconst Blur = function Blur(imageData) {\n var radius = Math.round(this.blurRadius());\n if (radius > 0) {\n filterGaussBlurRGBA(imageData, radius);\n }\n};\nexports.Blur = Blur;\nFactory_1.Factory.addGetterSetter(Node_1.Node, 'blurRadius', 0, (0, Validators_1.getNumberValidator)(), Factory_1.Factory.afterSetFilter);\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Brighten = void 0;\nconst Factory_1 = require(\"../Factory\");\nconst Node_1 = require(\"../Node\");\nconst Validators_1 = require(\"../Validators\");\nconst Brighten = function (imageData) {\n var brightness = this.brightness() * 255, data = imageData.data, len = data.length, i;\n for (i = 0; i < len; i += 4) {\n data[i] += brightness;\n data[i + 1] += brightness;\n data[i + 2] += brightness;\n }\n};\nexports.Brighten = Brighten;\nFactory_1.Factory.addGetterSetter(Node_1.Node, 'brightness', 0, (0, Validators_1.getNumberValidator)(), Factory_1.Factory.afterSetFilter);\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Contrast = void 0;\nconst Factory_1 = require(\"../Factory\");\nconst Node_1 = require(\"../Node\");\nconst Validators_1 = require(\"../Validators\");\nconst Contrast = function (imageData) {\n var adjust = Math.pow((this.contrast() + 100) / 100, 2);\n var data = imageData.data, nPixels = data.length, red = 150, green = 150, blue = 150, i;\n for (i = 0; i < nPixels; i += 4) {\n red = data[i];\n green = data[i + 1];\n blue = data[i + 2];\n red /= 255;\n red -= 0.5;\n red *= adjust;\n red += 0.5;\n red *= 255;\n green /= 255;\n green -= 0.5;\n green *= adjust;\n green += 0.5;\n green *= 255;\n blue /= 255;\n blue -= 0.5;\n blue *= adjust;\n blue += 0.5;\n blue *= 255;\n red = red < 0 ? 0 : red > 255 ? 255 : red;\n green = green < 0 ? 0 : green > 255 ? 255 : green;\n blue = blue < 0 ? 0 : blue > 255 ? 255 : blue;\n data[i] = red;\n data[i + 1] = green;\n data[i + 2] = blue;\n }\n};\nexports.Contrast = Contrast;\nFactory_1.Factory.addGetterSetter(Node_1.Node, 'contrast', 0, (0, Validators_1.getNumberValidator)(), Factory_1.Factory.afterSetFilter);\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Emboss = void 0;\nconst Factory_1 = require(\"../Factory\");\nconst Node_1 = require(\"../Node\");\nconst Util_1 = require(\"../Util\");\nconst Validators_1 = require(\"../Validators\");\nconst Emboss = function (imageData) {\n var strength = this.embossStrength() * 10, greyLevel = this.embossWhiteLevel() * 255, direction = this.embossDirection(), blend = this.embossBlend(), dirY = 0, dirX = 0, data = imageData.data, w = imageData.width, h = imageData.height, w4 = w * 4, y = h;\n switch (direction) {\n case 'top-left':\n dirY = -1;\n dirX = -1;\n break;\n case 'top':\n dirY = -1;\n dirX = 0;\n break;\n case 'top-right':\n dirY = -1;\n dirX = 1;\n break;\n case 'right':\n dirY = 0;\n dirX = 1;\n break;\n case 'bottom-right':\n dirY = 1;\n dirX = 1;\n break;\n case 'bottom':\n dirY = 1;\n dirX = 0;\n break;\n case 'bottom-left':\n dirY = 1;\n dirX = -1;\n break;\n case 'left':\n dirY = 0;\n dirX = -1;\n break;\n default:\n Util_1.Util.error('Unknown emboss direction: ' + direction);\n }\n do {\n var offsetY = (y - 1) * w4;\n var otherY = dirY;\n if (y + otherY < 1) {\n otherY = 0;\n }\n if (y + otherY > h) {\n otherY = 0;\n }\n var offsetYOther = (y - 1 + otherY) * w * 4;\n var x = w;\n do {\n var offset = offsetY + (x - 1) * 4;\n var otherX = dirX;\n if (x + otherX < 1) {\n otherX = 0;\n }\n if (x + otherX > w) {\n otherX = 0;\n }\n var offsetOther = offsetYOther + (x - 1 + otherX) * 4;\n var dR = data[offset] - data[offsetOther];\n var dG = data[offset + 1] - data[offsetOther + 1];\n var dB = data[offset + 2] - data[offsetOther + 2];\n var dif = dR;\n var absDif = dif > 0 ? dif : -dif;\n var absG = dG > 0 ? dG : -dG;\n var absB = dB > 0 ? dB : -dB;\n if (absG > absDif) {\n dif = dG;\n }\n if (absB > absDif) {\n dif = dB;\n }\n dif *= strength;\n if (blend) {\n var r = data[offset] + dif;\n var g = data[offset + 1] + dif;\n var b = data[offset + 2] + dif;\n data[offset] = r > 255 ? 255 : r < 0 ? 0 : r;\n data[offset + 1] = g > 255 ? 255 : g < 0 ? 0 : g;\n data[offset + 2] = b > 255 ? 255 : b < 0 ? 0 : b;\n }\n else {\n var grey = greyLevel - dif;\n if (grey < 0) {\n grey = 0;\n }\n else if (grey > 255) {\n grey = 255;\n }\n data[offset] = data[offset + 1] = data[offset + 2] = grey;\n }\n } while (--x);\n } while (--y);\n};\nexports.Emboss = Emboss;\nFactory_1.Factory.addGetterSetter(Node_1.Node, 'embossStrength', 0.5, (0, Validators_1.getNumberValidator)(), Factory_1.Factory.afterSetFilter);\nFactory_1.Factory.addGetterSetter(Node_1.Node, 'embossWhiteLevel', 0.5, (0, Validators_1.getNumberValidator)(), Factory_1.Factory.afterSetFilter);\nFactory_1.Factory.addGetterSetter(Node_1.Node, 'embossDirection', 'top-left', null, Factory_1.Factory.afterSetFilter);\nFactory_1.Factory.addGetterSetter(Node_1.Node, 'embossBlend', false, null, Factory_1.Factory.afterSetFilter);\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Enhance = void 0;\nconst Factory_1 = require(\"../Factory\");\nconst Node_1 = require(\"../Node\");\nconst Validators_1 = require(\"../Validators\");\nfunction remap(fromValue, fromMin, fromMax, toMin, toMax) {\n var fromRange = fromMax - fromMin, toRange = toMax - toMin, toValue;\n if (fromRange === 0) {\n return toMin + toRange / 2;\n }\n if (toRange === 0) {\n return toMin;\n }\n toValue = (fromValue - fromMin) / fromRange;\n toValue = toRange * toValue + toMin;\n return toValue;\n}\nconst Enhance = function (imageData) {\n var data = imageData.data, nSubPixels = data.length, rMin = data[0], rMax = rMin, r, gMin = data[1], gMax = gMin, g, bMin = data[2], bMax = bMin, b, i;\n var enhanceAmount = this.enhance();\n if (enhanceAmount === 0) {\n return;\n }\n for (i = 0; i < nSubPixels; i += 4) {\n r = data[i + 0];\n if (r < rMin) {\n rMin = r;\n }\n else if (r > rMax) {\n rMax = r;\n }\n g = data[i + 1];\n if (g < gMin) {\n gMin = g;\n }\n else if (g > gMax) {\n gMax = g;\n }\n b = data[i + 2];\n if (b < bMin) {\n bMin = b;\n }\n else if (b > bMax) {\n bMax = b;\n }\n }\n if (rMax === rMin) {\n rMax = 255;\n rMin = 0;\n }\n if (gMax === gMin) {\n gMax = 255;\n gMin = 0;\n }\n if (bMax === bMin) {\n bMax = 255;\n bMin = 0;\n }\n var rMid, rGoalMax, rGoalMin, gMid, gGoalMax, gGoalMin, bMid, bGoalMax, bGoalMin;\n if (enhanceAmount > 0) {\n rGoalMax = rMax + enhanceAmount * (255 - rMax);\n rGoalMin = rMin - enhanceAmount * (rMin - 0);\n gGoalMax = gMax + enhanceAmount * (255 - gMax);\n gGoalMin = gMin - enhanceAmount * (gMin - 0);\n bGoalMax = bMax + enhanceAmount * (255 - bMax);\n bGoalMin = bMin - enhanceAmount * (bMin - 0);\n }\n else {\n rMid = (rMax + rMin) * 0.5;\n rGoalMax = rMax + enhanceAmount * (rMax - rMid);\n rGoalMin = rMin + enhanceAmount * (rMin - rMid);\n gMid = (gMax + gMin) * 0.5;\n gGoalMax = gMax + enhanceAmount * (gMax - gMid);\n gGoalMin = gMin + enhanceAmount * (gMin - gMid);\n bMid = (bMax + bMin) * 0.5;\n bGoalMax = bMax + enhanceAmount * (bMax - bMid);\n bGoalMin = bMin + enhanceAmount * (bMin - bMid);\n }\n for (i = 0; i < nSubPixels; i += 4) {\n data[i + 0] = remap(data[i + 0], rMin, rMax, rGoalMin, rGoalMax);\n data[i + 1] = remap(data[i + 1], gMin, gMax, gGoalMin, gGoalMax);\n data[i + 2] = remap(data[i + 2], bMin, bMax, bGoalMin, bGoalMax);\n }\n};\nexports.Enhance = Enhance;\nFactory_1.Factory.addGetterSetter(Node_1.Node, 'enhance', 0, (0, Validators_1.getNumberValidator)(), Factory_1.Factory.afterSetFilter);\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Grayscale = void 0;\nconst Grayscale = function (imageData) {\n var data = imageData.data, len = data.length, i, brightness;\n for (i = 0; i < len; i += 4) {\n brightness = 0.34 * data[i] + 0.5 * data[i + 1] + 0.16 * data[i + 2];\n data[i] = brightness;\n data[i + 1] = brightness;\n data[i + 2] = brightness;\n }\n};\nexports.Grayscale = Grayscale;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.HSL = void 0;\nconst Factory_1 = require(\"../Factory\");\nconst Node_1 = require(\"../Node\");\nconst Validators_1 = require(\"../Validators\");\nFactory_1.Factory.addGetterSetter(Node_1.Node, 'hue', 0, (0, Validators_1.getNumberValidator)(), Factory_1.Factory.afterSetFilter);\nFactory_1.Factory.addGetterSetter(Node_1.Node, 'saturation', 0, (0, Validators_1.getNumberValidator)(), Factory_1.Factory.afterSetFilter);\nFactory_1.Factory.addGetterSetter(Node_1.Node, 'luminance', 0, (0, Validators_1.getNumberValidator)(), Factory_1.Factory.afterSetFilter);\nconst HSL = function (imageData) {\n var data = imageData.data, nPixels = data.length, v = 1, s = Math.pow(2, this.saturation()), h = Math.abs(this.hue() + 360) % 360, l = this.luminance() * 127, i;\n var vsu = v * s * Math.cos((h * Math.PI) / 180), vsw = v * s * Math.sin((h * Math.PI) / 180);\n var rr = 0.299 * v + 0.701 * vsu + 0.167 * vsw, rg = 0.587 * v - 0.587 * vsu + 0.33 * vsw, rb = 0.114 * v - 0.114 * vsu - 0.497 * vsw;\n var gr = 0.299 * v - 0.299 * vsu - 0.328 * vsw, gg = 0.587 * v + 0.413 * vsu + 0.035 * vsw, gb = 0.114 * v - 0.114 * vsu + 0.293 * vsw;\n var br = 0.299 * v - 0.3 * vsu + 1.25 * vsw, bg = 0.587 * v - 0.586 * vsu - 1.05 * vsw, bb = 0.114 * v + 0.886 * vsu - 0.2 * vsw;\n var r, g, b, a;\n for (i = 0; i < nPixels; i += 4) {\n r = data[i + 0];\n g = data[i + 1];\n b = data[i + 2];\n a = data[i + 3];\n data[i + 0] = rr * r + rg * g + rb * b + l;\n data[i + 1] = gr * r + gg * g + gb * b + l;\n data[i + 2] = br * r + bg * g + bb * b + l;\n data[i + 3] = a;\n }\n};\nexports.HSL = HSL;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.HSV = void 0;\nconst Factory_1 = require(\"../Factory\");\nconst Node_1 = require(\"../Node\");\nconst Validators_1 = require(\"../Validators\");\nconst HSV = function (imageData) {\n var data = imageData.data, nPixels = data.length, v = Math.pow(2, this.value()), s = Math.pow(2, this.saturation()), h = Math.abs(this.hue() + 360) % 360, i;\n var vsu = v * s * Math.cos((h * Math.PI) / 180), vsw = v * s * Math.sin((h * Math.PI) / 180);\n var rr = 0.299 * v + 0.701 * vsu + 0.167 * vsw, rg = 0.587 * v - 0.587 * vsu + 0.33 * vsw, rb = 0.114 * v - 0.114 * vsu - 0.497 * vsw;\n var gr = 0.299 * v - 0.299 * vsu - 0.328 * vsw, gg = 0.587 * v + 0.413 * vsu + 0.035 * vsw, gb = 0.114 * v - 0.114 * vsu + 0.293 * vsw;\n var br = 0.299 * v - 0.3 * vsu + 1.25 * vsw, bg = 0.587 * v - 0.586 * vsu - 1.05 * vsw, bb = 0.114 * v + 0.886 * vsu - 0.2 * vsw;\n var r, g, b, a;\n for (i = 0; i < nPixels; i += 4) {\n r = data[i + 0];\n g = data[i + 1];\n b = data[i + 2];\n a = data[i + 3];\n data[i + 0] = rr * r + rg * g + rb * b;\n data[i + 1] = gr * r + gg * g + gb * b;\n data[i + 2] = br * r + bg * g + bb * b;\n data[i + 3] = a;\n }\n};\nexports.HSV = HSV;\nFactory_1.Factory.addGetterSetter(Node_1.Node, 'hue', 0, (0, Validators_1.getNumberValidator)(), Factory_1.Factory.afterSetFilter);\nFactory_1.Factory.addGetterSetter(Node_1.Node, 'saturation', 0, (0, Validators_1.getNumberValidator)(), Factory_1.Factory.afterSetFilter);\nFactory_1.Factory.addGetterSetter(Node_1.Node, 'value', 0, (0, Validators_1.getNumberValidator)(), Factory_1.Factory.afterSetFilter);\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Invert = void 0;\nconst Invert = function (imageData) {\n var data = imageData.data, len = data.length, i;\n for (i = 0; i < len; i += 4) {\n data[i] = 255 - data[i];\n data[i + 1] = 255 - data[i + 1];\n data[i + 2] = 255 - data[i + 2];\n }\n};\nexports.Invert = Invert;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Kaleidoscope = void 0;\nconst Factory_1 = require(\"../Factory\");\nconst Node_1 = require(\"../Node\");\nconst Util_1 = require(\"../Util\");\nconst Validators_1 = require(\"../Validators\");\nvar ToPolar = function (src, dst, opt) {\n var srcPixels = src.data, dstPixels = dst.data, xSize = src.width, ySize = src.height, xMid = opt.polarCenterX || xSize / 2, yMid = opt.polarCenterY || ySize / 2, i, x, y, r = 0, g = 0, b = 0, a = 0;\n var rad, rMax = Math.sqrt(xMid * xMid + yMid * yMid);\n x = xSize - xMid;\n y = ySize - yMid;\n rad = Math.sqrt(x * x + y * y);\n rMax = rad > rMax ? rad : rMax;\n var rSize = ySize, tSize = xSize, radius, theta;\n var conversion = ((360 / tSize) * Math.PI) / 180, sin, cos;\n for (theta = 0; theta < tSize; theta += 1) {\n sin = Math.sin(theta * conversion);\n cos = Math.cos(theta * conversion);\n for (radius = 0; radius < rSize; radius += 1) {\n x = Math.floor(xMid + ((rMax * radius) / rSize) * cos);\n y = Math.floor(yMid + ((rMax * radius) / rSize) * sin);\n i = (y * xSize + x) * 4;\n r = srcPixels[i + 0];\n g = srcPixels[i + 1];\n b = srcPixels[i + 2];\n a = srcPixels[i + 3];\n i = (theta + radius * xSize) * 4;\n dstPixels[i + 0] = r;\n dstPixels[i + 1] = g;\n dstPixels[i + 2] = b;\n dstPixels[i + 3] = a;\n }\n }\n};\nvar FromPolar = function (src, dst, opt) {\n var srcPixels = src.data, dstPixels = dst.data, xSize = src.width, ySize = src.height, xMid = opt.polarCenterX || xSize / 2, yMid = opt.polarCenterY || ySize / 2, i, x, y, dx, dy, r = 0, g = 0, b = 0, a = 0;\n var rad, rMax = Math.sqrt(xMid * xMid + yMid * yMid);\n x = xSize - xMid;\n y = ySize - yMid;\n rad = Math.sqrt(x * x + y * y);\n rMax = rad > rMax ? rad : rMax;\n var rSize = ySize, tSize = xSize, radius, theta, phaseShift = opt.polarRotation || 0;\n var x1, y1;\n for (x = 0; x < xSize; x += 1) {\n for (y = 0; y < ySize; y += 1) {\n dx = x - xMid;\n dy = y - yMid;\n radius = (Math.sqrt(dx * dx + dy * dy) * rSize) / rMax;\n theta = ((Math.atan2(dy, dx) * 180) / Math.PI + 360 + phaseShift) % 360;\n theta = (theta * tSize) / 360;\n x1 = Math.floor(theta);\n y1 = Math.floor(radius);\n i = (y1 * xSize + x1) * 4;\n r = srcPixels[i + 0];\n g = srcPixels[i + 1];\n b = srcPixels[i + 2];\n a = srcPixels[i + 3];\n i = (y * xSize + x) * 4;\n dstPixels[i + 0] = r;\n dstPixels[i + 1] = g;\n dstPixels[i + 2] = b;\n dstPixels[i + 3] = a;\n }\n }\n};\nconst Kaleidoscope = function (imageData) {\n var xSize = imageData.width, ySize = imageData.height;\n var x, y, xoff, i, r, g, b, a, srcPos, dstPos;\n var power = Math.round(this.kaleidoscopePower());\n var angle = Math.round(this.kaleidoscopeAngle());\n var offset = Math.floor((xSize * (angle % 360)) / 360);\n if (power < 1) {\n return;\n }\n var tempCanvas = Util_1.Util.createCanvasElement();\n tempCanvas.width = xSize;\n tempCanvas.height = ySize;\n var scratchData = tempCanvas\n .getContext('2d')\n .getImageData(0, 0, xSize, ySize);\n Util_1.Util.releaseCanvas(tempCanvas);\n ToPolar(imageData, scratchData, {\n polarCenterX: xSize / 2,\n polarCenterY: ySize / 2,\n });\n var minSectionSize = xSize / Math.pow(2, power);\n while (minSectionSize <= 8) {\n minSectionSize = minSectionSize * 2;\n power -= 1;\n }\n minSectionSize = Math.ceil(minSectionSize);\n var sectionSize = minSectionSize;\n var xStart = 0, xEnd = sectionSize, xDelta = 1;\n if (offset + minSectionSize > xSize) {\n xStart = sectionSize;\n xEnd = 0;\n xDelta = -1;\n }\n for (y = 0; y < ySize; y += 1) {\n for (x = xStart; x !== xEnd; x += xDelta) {\n xoff = Math.round(x + offset) % xSize;\n srcPos = (xSize * y + xoff) * 4;\n r = scratchData.data[srcPos + 0];\n g = scratchData.data[srcPos + 1];\n b = scratchData.data[srcPos + 2];\n a = scratchData.data[srcPos + 3];\n dstPos = (xSize * y + x) * 4;\n scratchData.data[dstPos + 0] = r;\n scratchData.data[dstPos + 1] = g;\n scratchData.data[dstPos + 2] = b;\n scratchData.data[dstPos + 3] = a;\n }\n }\n for (y = 0; y < ySize; y += 1) {\n sectionSize = Math.floor(minSectionSize);\n for (i = 0; i < power; i += 1) {\n for (x = 0; x < sectionSize + 1; x += 1) {\n srcPos = (xSize * y + x) * 4;\n r = scratchData.data[srcPos + 0];\n g = scratchData.data[srcPos + 1];\n b = scratchData.data[srcPos + 2];\n a = scratchData.data[srcPos + 3];\n dstPos = (xSize * y + sectionSize * 2 - x - 1) * 4;\n scratchData.data[dstPos + 0] = r;\n scratchData.data[dstPos + 1] = g;\n scratchData.data[dstPos + 2] = b;\n scratchData.data[dstPos + 3] = a;\n }\n sectionSize *= 2;\n }\n }\n FromPolar(scratchData, imageData, { polarRotation: 0 });\n};\nexports.Kaleidoscope = Kaleidoscope;\nFactory_1.Factory.addGetterSetter(Node_1.Node, 'kaleidoscopePower', 2, (0, Validators_1.getNumberValidator)(), Factory_1.Factory.afterSetFilter);\nFactory_1.Factory.addGetterSetter(Node_1.Node, 'kaleidoscopeAngle', 0, (0, Validators_1.getNumberValidator)(), Factory_1.Factory.afterSetFilter);\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Mask = void 0;\nconst Factory_1 = require(\"../Factory\");\nconst Node_1 = require(\"../Node\");\nconst Validators_1 = require(\"../Validators\");\nfunction pixelAt(idata, x, y) {\n var idx = (y * idata.width + x) * 4;\n var d = [];\n d.push(idata.data[idx++], idata.data[idx++], idata.data[idx++], idata.data[idx++]);\n return d;\n}\nfunction rgbDistance(p1, p2) {\n return Math.sqrt(Math.pow(p1[0] - p2[0], 2) +\n Math.pow(p1[1] - p2[1], 2) +\n Math.pow(p1[2] - p2[2], 2));\n}\nfunction rgbMean(pTab) {\n var m = [0, 0, 0];\n for (var i = 0; i < pTab.length; i++) {\n m[0] += pTab[i][0];\n m[1] += pTab[i][1];\n m[2] += pTab[i][2];\n }\n m[0] /= pTab.length;\n m[1] /= pTab.length;\n m[2] /= pTab.length;\n return m;\n}\nfunction backgroundMask(idata, threshold) {\n var rgbv_no = pixelAt(idata, 0, 0);\n var rgbv_ne = pixelAt(idata, idata.width - 1, 0);\n var rgbv_so = pixelAt(idata, 0, idata.height - 1);\n var rgbv_se = pixelAt(idata, idata.width - 1, idata.height - 1);\n var thres = threshold || 10;\n if (rgbDistance(rgbv_no, rgbv_ne) < thres &&\n rgbDistance(rgbv_ne, rgbv_se) < thres &&\n rgbDistance(rgbv_se, rgbv_so) < thres &&\n rgbDistance(rgbv_so, rgbv_no) < thres) {\n var mean = rgbMean([rgbv_ne, rgbv_no, rgbv_se, rgbv_so]);\n var mask = [];\n for (var i = 0; i < idata.width * idata.height; i++) {\n var d = rgbDistance(mean, [\n idata.data[i * 4],\n idata.data[i * 4 + 1],\n idata.data[i * 4 + 2],\n ]);\n mask[i] = d < thres ? 0 : 255;\n }\n return mask;\n }\n}\nfunction applyMask(idata, mask) {\n for (var i = 0; i < idata.width * idata.height; i++) {\n idata.data[4 * i + 3] = mask[i];\n }\n}\nfunction erodeMask(mask, sw, sh) {\n var weights = [1, 1, 1, 1, 0, 1, 1, 1, 1];\n var side = Math.round(Math.sqrt(weights.length));\n var halfSide = Math.floor(side / 2);\n var maskResult = [];\n for (var y = 0; y < sh; y++) {\n for (var x = 0; x < sw; x++) {\n var so = y * sw + x;\n var a = 0;\n for (var cy = 0; cy < side; cy++) {\n for (var cx = 0; cx < side; cx++) {\n var scy = y + cy - halfSide;\n var scx = x + cx - halfSide;\n if (scy >= 0 && scy < sh && scx >= 0 && scx < sw) {\n var srcOff = scy * sw + scx;\n var wt = weights[cy * side + cx];\n a += mask[srcOff] * wt;\n }\n }\n }\n maskResult[so] = a === 255 * 8 ? 255 : 0;\n }\n }\n return maskResult;\n}\nfunction dilateMask(mask, sw, sh) {\n var weights = [1, 1, 1, 1, 1, 1, 1, 1, 1];\n var side = Math.round(Math.sqrt(weights.length));\n var halfSide = Math.floor(side / 2);\n var maskResult = [];\n for (var y = 0; y < sh; y++) {\n for (var x = 0; x < sw; x++) {\n var so = y * sw + x;\n var a = 0;\n for (var cy = 0; cy < side; cy++) {\n for (var cx = 0; cx < side; cx++) {\n var scy = y + cy - halfSide;\n var scx = x + cx - halfSide;\n if (scy >= 0 && scy < sh && scx >= 0 && scx < sw) {\n var srcOff = scy * sw + scx;\n var wt = weights[cy * side + cx];\n a += mask[srcOff] * wt;\n }\n }\n }\n maskResult[so] = a >= 255 * 4 ? 255 : 0;\n }\n }\n return maskResult;\n}\nfunction smoothEdgeMask(mask, sw, sh) {\n var weights = [1 / 9, 1 / 9, 1 / 9, 1 / 9, 1 / 9, 1 / 9, 1 / 9, 1 / 9, 1 / 9];\n var side = Math.round(Math.sqrt(weights.length));\n var halfSide = Math.floor(side / 2);\n var maskResult = [];\n for (var y = 0; y < sh; y++) {\n for (var x = 0; x < sw; x++) {\n var so = y * sw + x;\n var a = 0;\n for (var cy = 0; cy < side; cy++) {\n for (var cx = 0; cx < side; cx++) {\n var scy = y + cy - halfSide;\n var scx = x + cx - halfSide;\n if (scy >= 0 && scy < sh && scx >= 0 && scx < sw) {\n var srcOff = scy * sw + scx;\n var wt = weights[cy * side + cx];\n a += mask[srcOff] * wt;\n }\n }\n }\n maskResult[so] = a;\n }\n }\n return maskResult;\n}\nconst Mask = function (imageData) {\n var threshold = this.threshold(), mask = backgroundMask(imageData, threshold);\n if (mask) {\n mask = erodeMask(mask, imageData.width, imageData.height);\n mask = dilateMask(mask, imageData.width, imageData.height);\n mask = smoothEdgeMask(mask, imageData.width, imageData.height);\n applyMask(imageData, mask);\n }\n return imageData;\n};\nexports.Mask = Mask;\nFactory_1.Factory.addGetterSetter(Node_1.Node, 'threshold', 0, (0, Validators_1.getNumberValidator)(), Factory_1.Factory.afterSetFilter);\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Noise = void 0;\nconst Factory_1 = require(\"../Factory\");\nconst Node_1 = require(\"../Node\");\nconst Validators_1 = require(\"../Validators\");\nconst Noise = function (imageData) {\n var amount = this.noise() * 255, data = imageData.data, nPixels = data.length, half = amount / 2, i;\n for (i = 0; i < nPixels; i += 4) {\n data[i + 0] += half - 2 * half * Math.random();\n data[i + 1] += half - 2 * half * Math.random();\n data[i + 2] += half - 2 * half * Math.random();\n }\n};\nexports.Noise = Noise;\nFactory_1.Factory.addGetterSetter(Node_1.Node, 'noise', 0.2, (0, Validators_1.getNumberValidator)(), Factory_1.Factory.afterSetFilter);\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Pixelate = void 0;\nconst Factory_1 = require(\"../Factory\");\nconst Util_1 = require(\"../Util\");\nconst Node_1 = require(\"../Node\");\nconst Validators_1 = require(\"../Validators\");\nconst Pixelate = function (imageData) {\n var pixelSize = Math.ceil(this.pixelSize()), width = imageData.width, height = imageData.height, x, y, i, red, green, blue, alpha, nBinsX = Math.ceil(width / pixelSize), nBinsY = Math.ceil(height / pixelSize), xBinStart, xBinEnd, yBinStart, yBinEnd, xBin, yBin, pixelsInBin, data = imageData.data;\n if (pixelSize <= 0) {\n Util_1.Util.error('pixelSize value can not be <= 0');\n return;\n }\n for (xBin = 0; xBin < nBinsX; xBin += 1) {\n for (yBin = 0; yBin < nBinsY; yBin += 1) {\n red = 0;\n green = 0;\n blue = 0;\n alpha = 0;\n xBinStart = xBin * pixelSize;\n xBinEnd = xBinStart + pixelSize;\n yBinStart = yBin * pixelSize;\n yBinEnd = yBinStart + pixelSize;\n pixelsInBin = 0;\n for (x = xBinStart; x < xBinEnd; x += 1) {\n if (x >= width) {\n continue;\n }\n for (y = yBinStart; y < yBinEnd; y += 1) {\n if (y >= height) {\n continue;\n }\n i = (width * y + x) * 4;\n red += data[i + 0];\n green += data[i + 1];\n blue += data[i + 2];\n alpha += data[i + 3];\n pixelsInBin += 1;\n }\n }\n red = red / pixelsInBin;\n green = green / pixelsInBin;\n blue = blue / pixelsInBin;\n alpha = alpha / pixelsInBin;\n for (x = xBinStart; x < xBinEnd; x += 1) {\n if (x >= width) {\n continue;\n }\n for (y = yBinStart; y < yBinEnd; y += 1) {\n if (y >= height) {\n continue;\n }\n i = (width * y + x) * 4;\n data[i + 0] = red;\n data[i + 1] = green;\n data[i + 2] = blue;\n data[i + 3] = alpha;\n }\n }\n }\n }\n};\nexports.Pixelate = Pixelate;\nFactory_1.Factory.addGetterSetter(Node_1.Node, 'pixelSize', 8, (0, Validators_1.getNumberValidator)(), Factory_1.Factory.afterSetFilter);\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Posterize = void 0;\nconst Factory_1 = require(\"../Factory\");\nconst Node_1 = require(\"../Node\");\nconst Validators_1 = require(\"../Validators\");\nconst Posterize = function (imageData) {\n var levels = Math.round(this.levels() * 254) + 1, data = imageData.data, len = data.length, scale = 255 / levels, i;\n for (i = 0; i < len; i += 1) {\n data[i] = Math.floor(data[i] / scale) * scale;\n }\n};\nexports.Posterize = Posterize;\nFactory_1.Factory.addGetterSetter(Node_1.Node, 'levels', 0.5, (0, Validators_1.getNumberValidator)(), Factory_1.Factory.afterSetFilter);\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.RGB = void 0;\nconst Factory_1 = require(\"../Factory\");\nconst Node_1 = require(\"../Node\");\nconst Validators_1 = require(\"../Validators\");\nconst RGB = function (imageData) {\n var data = imageData.data, nPixels = data.length, red = this.red(), green = this.green(), blue = this.blue(), i, brightness;\n for (i = 0; i < nPixels; i += 4) {\n brightness =\n (0.34 * data[i] + 0.5 * data[i + 1] + 0.16 * data[i + 2]) / 255;\n data[i] = brightness * red;\n data[i + 1] = brightness * green;\n data[i + 2] = brightness * blue;\n data[i + 3] = data[i + 3];\n }\n};\nexports.RGB = RGB;\nFactory_1.Factory.addGetterSetter(Node_1.Node, 'red', 0, function (val) {\n this._filterUpToDate = false;\n if (val > 255) {\n return 255;\n }\n else if (val < 0) {\n return 0;\n }\n else {\n return Math.round(val);\n }\n});\nFactory_1.Factory.addGetterSetter(Node_1.Node, 'green', 0, function (val) {\n this._filterUpToDate = false;\n if (val > 255) {\n return 255;\n }\n else if (val < 0) {\n return 0;\n }\n else {\n return Math.round(val);\n }\n});\nFactory_1.Factory.addGetterSetter(Node_1.Node, 'blue', 0, Validators_1.RGBComponent, Factory_1.Factory.afterSetFilter);\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.RGBA = void 0;\nconst Factory_1 = require(\"../Factory\");\nconst Node_1 = require(\"../Node\");\nconst Validators_1 = require(\"../Validators\");\nconst RGBA = function (imageData) {\n var data = imageData.data, nPixels = data.length, red = this.red(), green = this.green(), blue = this.blue(), alpha = this.alpha(), i, ia;\n for (i = 0; i < nPixels; i += 4) {\n ia = 1 - alpha;\n data[i] = red * alpha + data[i] * ia;\n data[i + 1] = green * alpha + data[i + 1] * ia;\n data[i + 2] = blue * alpha + data[i + 2] * ia;\n }\n};\nexports.RGBA = RGBA;\nFactory_1.Factory.addGetterSetter(Node_1.Node, 'red', 0, function (val) {\n this._filterUpToDate = false;\n if (val > 255) {\n return 255;\n }\n else if (val < 0) {\n return 0;\n }\n else {\n return Math.round(val);\n }\n});\nFactory_1.Factory.addGetterSetter(Node_1.Node, 'green', 0, function (val) {\n this._filterUpToDate = false;\n if (val > 255) {\n return 255;\n }\n else if (val < 0) {\n return 0;\n }\n else {\n return Math.round(val);\n }\n});\nFactory_1.Factory.addGetterSetter(Node_1.Node, 'blue', 0, Validators_1.RGBComponent, Factory_1.Factory.afterSetFilter);\nFactory_1.Factory.addGetterSetter(Node_1.Node, 'alpha', 1, function (val) {\n this._filterUpToDate = false;\n if (val > 1) {\n return 1;\n }\n else if (val < 0) {\n return 0;\n }\n else {\n return val;\n }\n});\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Sepia = void 0;\nconst Sepia = function (imageData) {\n var data = imageData.data, nPixels = data.length, i, r, g, b;\n for (i = 0; i < nPixels; i += 4) {\n r = data[i + 0];\n g = data[i + 1];\n b = data[i + 2];\n data[i + 0] = Math.min(255, r * 0.393 + g * 0.769 + b * 0.189);\n data[i + 1] = Math.min(255, r * 0.349 + g * 0.686 + b * 0.168);\n data[i + 2] = Math.min(255, r * 0.272 + g * 0.534 + b * 0.131);\n }\n};\nexports.Sepia = Sepia;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Solarize = void 0;\nconst Solarize = function (imageData) {\n var data = imageData.data, w = imageData.width, h = imageData.height, w4 = w * 4, y = h;\n do {\n var offsetY = (y - 1) * w4;\n var x = w;\n do {\n var offset = offsetY + (x - 1) * 4;\n var r = data[offset];\n var g = data[offset + 1];\n var b = data[offset + 2];\n if (r > 127) {\n r = 255 - r;\n }\n if (g > 127) {\n g = 255 - g;\n }\n if (b > 127) {\n b = 255 - b;\n }\n data[offset] = r;\n data[offset + 1] = g;\n data[offset + 2] = b;\n } while (--x);\n } while (--y);\n};\nexports.Solarize = Solarize;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Threshold = void 0;\nconst Factory_1 = require(\"../Factory\");\nconst Node_1 = require(\"../Node\");\nconst Validators_1 = require(\"../Validators\");\nconst Threshold = function (imageData) {\n var level = this.threshold() * 255, data = imageData.data, len = data.length, i;\n for (i = 0; i < len; i += 1) {\n data[i] = data[i] < level ? 0 : 255;\n }\n};\nexports.Threshold = Threshold;\nFactory_1.Factory.addGetterSetter(Node_1.Node, 'threshold', 0.5, (0, Validators_1.getNumberValidator)(), Factory_1.Factory.afterSetFilter);\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Konva = void 0;\nconst _CoreInternals_1 = require(\"./_CoreInternals\");\nconst Arc_1 = require(\"./shapes/Arc\");\nconst Arrow_1 = require(\"./shapes/Arrow\");\nconst Circle_1 = require(\"./shapes/Circle\");\nconst Ellipse_1 = require(\"./shapes/Ellipse\");\nconst Image_1 = require(\"./shapes/Image\");\nconst Label_1 = require(\"./shapes/Label\");\nconst Line_1 = require(\"./shapes/Line\");\nconst Path_1 = require(\"./shapes/Path\");\nconst Rect_1 = require(\"./shapes/Rect\");\nconst RegularPolygon_1 = require(\"./shapes/RegularPolygon\");\nconst Ring_1 = require(\"./shapes/Ring\");\nconst Sprite_1 = require(\"./shapes/Sprite\");\nconst Star_1 = require(\"./shapes/Star\");\nconst Text_1 = require(\"./shapes/Text\");\nconst TextPath_1 = require(\"./shapes/TextPath\");\nconst Transformer_1 = require(\"./shapes/Transformer\");\nconst Wedge_1 = require(\"./shapes/Wedge\");\nconst Blur_1 = require(\"./filters/Blur\");\nconst Brighten_1 = require(\"./filters/Brighten\");\nconst Contrast_1 = require(\"./filters/Contrast\");\nconst Emboss_1 = require(\"./filters/Emboss\");\nconst Enhance_1 = require(\"./filters/Enhance\");\nconst Grayscale_1 = require(\"./filters/Grayscale\");\nconst HSL_1 = require(\"./filters/HSL\");\nconst HSV_1 = require(\"./filters/HSV\");\nconst Invert_1 = require(\"./filters/Invert\");\nconst Kaleidoscope_1 = require(\"./filters/Kaleidoscope\");\nconst Mask_1 = require(\"./filters/Mask\");\nconst Noise_1 = require(\"./filters/Noise\");\nconst Pixelate_1 = require(\"./filters/Pixelate\");\nconst Posterize_1 = require(\"./filters/Posterize\");\nconst RGB_1 = require(\"./filters/RGB\");\nconst RGBA_1 = require(\"./filters/RGBA\");\nconst Sepia_1 = require(\"./filters/Sepia\");\nconst Solarize_1 = require(\"./filters/Solarize\");\nconst Threshold_1 = require(\"./filters/Threshold\");\nexports.Konva = _CoreInternals_1.Konva.Util._assign(_CoreInternals_1.Konva, {\n Arc: Arc_1.Arc,\n Arrow: Arrow_1.Arrow,\n Circle: Circle_1.Circle,\n Ellipse: Ellipse_1.Ellipse,\n Image: Image_1.Image,\n Label: Label_1.Label,\n Tag: Label_1.Tag,\n Line: Line_1.Line,\n Path: Path_1.Path,\n Rect: Rect_1.Rect,\n RegularPolygon: RegularPolygon_1.RegularPolygon,\n Ring: Ring_1.Ring,\n Sprite: Sprite_1.Sprite,\n Star: Star_1.Star,\n Text: Text_1.Text,\n TextPath: TextPath_1.TextPath,\n Transformer: Transformer_1.Transformer,\n Wedge: Wedge_1.Wedge,\n Filters: {\n Blur: Blur_1.Blur,\n Brighten: Brighten_1.Brighten,\n Contrast: Contrast_1.Contrast,\n Emboss: Emboss_1.Emboss,\n Enhance: Enhance_1.Enhance,\n Grayscale: Grayscale_1.Grayscale,\n HSL: HSL_1.HSL,\n HSV: HSV_1.HSV,\n Invert: Invert_1.Invert,\n Kaleidoscope: Kaleidoscope_1.Kaleidoscope,\n Mask: Mask_1.Mask,\n Noise: Noise_1.Noise,\n Pixelate: Pixelate_1.Pixelate,\n Posterize: Posterize_1.Posterize,\n RGB: RGB_1.RGB,\n RGBA: RGBA_1.RGBA,\n Sepia: Sepia_1.Sepia,\n Solarize: Solarize_1.Solarize,\n Threshold: Threshold_1.Threshold,\n },\n});\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst _FullInternals_1 = require(\"./_FullInternals\");\nmodule.exports = _FullInternals_1.Konva;\n","import _slicedToArray from\"@babel/runtime/helpers/slicedToArray\";function _createForOfIteratorHelper(a,b){var c=\"undefined\"!=typeof Symbol&&a[Symbol.iterator]||a[\"@@iterator\"];if(!c){if(Array.isArray(a)||(c=_unsupportedIterableToArray(a))||b&&a&&\"number\"==typeof a.length){c&&(a=c);var d=0,e=function(){};return{s:e,n:function n(){return d>=a.length?{done:!0}:{done:!1,value:a[d++]}},e:function e(a){throw a},f: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.\")}var f,g=!0,h=!1;return{s:function s(){c=c.call(a)},n:function n(){var a=c.next();return g=a.done,a},e:function e(a){h=!0,f=a},f:function f(){try{g||null==c[\"return\"]||c[\"return\"]()}finally{if(h)throw f}}}}function _unsupportedIterableToArray(a,b){if(a){if(\"string\"==typeof a)return _arrayLikeToArray(a,b);var c=Object.prototype.toString.call(a).slice(8,-1);return\"Object\"===c&&a.constructor&&(c=a.constructor.name),\"Map\"===c||\"Set\"===c?Array.from(a):\"Arguments\"===c||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(c)?_arrayLikeToArray(a,b):void 0}}function _arrayLikeToArray(a,b){(null==b||b>a.length)&&(b=a.length);for(var c=0,d=Array(b);cc?-1:c,c=~~(255*c),[b[0]+c,b[1]+c,b[2]+c]}},contrast:function contrast(a){return function(b){var c=a;c*=255;var d=259*(c+255)/(255*(259-c));return[d*(b[0]-128)+128,d*(b[1]-128)+128,d*(b[2]-128)+128]}},saturation:function saturation(a){return function(c){var d=a;d=-1>d?-1:d;var e=c[0],f=c[1],g=c[2],b=.2989*e+.587*f+.114*g;return[-b*d+e*(1+d),-b*d+f*(1+d),-b*d+g*(1+d)]}},grayscale:function grayscale(){return function(a){var c=a[0],d=a[1],e=a[2];return[,,,].fill(.2126*c+.7152*d+.0722*e)}},sepia:function sepia(a){return function(c){var d=c[0],e=c[1],f=c[2];return[d*(1-.607*a)+.769*e*a+.189*f*a,.349*d*a+e*(1-.314*a)+.168*f*a,.272*d*a+.534*e*a+f*(1-.869*a)]}},adjustRGB:function adjustRGB(a){return function(b){return[b[0]*a[0],b[1]*a[1],b[2]*a[2]]}},colorFilter:function colorFilter(a){return function(c){var d=c[0],e=c[1],f=c[2],b=a[3];return[d-(d-a[0])*b,e-(e-a[1])*b,f-(f-a[2])*b]}}};export default BaseFilters;","import BaseFilters from\"./BaseFilters\";function BlackAndWhite(a){BaseFilters.apply(a,function(a){var b=(a[0]+a[1]+a[2])/3>100,c=b?255:0;return[c,c,c]})}BlackAndWhite.filterName=\"BlackAndWhite\";export default BlackAndWhite;","import BaseFilters from\"./BaseFilters\";var BRIGHTNESS_CONST=.1,CONTRAST_CONST=.1,SATURATION_CONST=.15;function Clarendon(a){BaseFilters.apply(a,BaseFilters.brightness(BRIGHTNESS_CONST),BaseFilters.contrast(CONTRAST_CONST),BaseFilters.saturation(SATURATION_CONST))}Clarendon.filterName=\"Clarendon\";export default Clarendon;","import BaseFilters from\"./BaseFilters\";var SEPIA_CONST=.04,CONTRAST_CONST=-.15;function Gingham(a){BaseFilters.apply(a,BaseFilters.sepia(SEPIA_CONST),BaseFilters.contrast(CONTRAST_CONST))}Gingham.filterName=\"Gingham\";export default Gingham;","import BaseFilters from\"./BaseFilters\";var BRIGHTNESS_CONST=.1;function Moon(a){BaseFilters.apply(a,BaseFilters.grayscale(),BaseFilters.brightness(BRIGHTNESS_CONST));var b=a.data,c=b.length}Moon.filterName=\"Moon\";export default Moon;","import BaseFilters from\"./BaseFilters\";var BRIGHTNESS_CONST=.08,ADJUST_RGB_CONST=[1,1.03,1.05],SATURATION_CONST=.12;function Lark(a){BaseFilters.apply(a,BaseFilters.brightness(BRIGHTNESS_CONST),BaseFilters.adjustRGB(ADJUST_RGB_CONST),BaseFilters.saturation(SATURATION_CONST))}Lark.filterName=\"Lark\";export default Lark;","import BaseFilters from\"./BaseFilters\";var SEPIA_CONST=.4,BRIGHTNESS_CONST=.13,CONTRAST_CONST=-.05;function Reyes(a){BaseFilters.apply(a,BaseFilters.sepia(SEPIA_CONST),BaseFilters.brightness(BRIGHTNESS_CONST),BaseFilters.contrast(CONTRAST_CONST))}Reyes.filterName=\"Reyes\";export default Reyes;","import BaseFilters from\"./BaseFilters\";var ADJUST_RGB_CONST=[1.01,1.04,1],SATURATION_CONST=.3;function Juno(a){BaseFilters.apply(a,BaseFilters.adjustRGB(ADJUST_RGB_CONST),BaseFilters.saturation(SATURATION_CONST))}Juno.filterName=\"Juno\";export default Juno;","import BaseFilters from\"./BaseFilters\";var BRIGHTNESS_CONST=.1,SATURATION_CONST=-.5;function Slumber(a){BaseFilters.apply(a,BaseFilters.brightness(BRIGHTNESS_CONST),BaseFilters.saturation(SATURATION_CONST))}Slumber.filterName=\"Slumber\";export default Slumber;","import BaseFilters from\"./BaseFilters\";var ADJUST_RGB_CONST=[1.04,1,1.02],SATURATION_CONST=-.05;function Crema(a){BaseFilters.apply(a,BaseFilters.adjustRGB(ADJUST_RGB_CONST),BaseFilters.saturation(SATURATION_CONST))}Crema.filterName=\"Crema\";export default Crema;","import BaseFilters from\"./BaseFilters\";var BRIGHTNESS_CONST=.05,SATURATION_CONST=-.03;function Ludwig(a){BaseFilters.apply(a,BaseFilters.brightness(BRIGHTNESS_CONST),BaseFilters.saturation(SATURATION_CONST))}Ludwig.filterName=\"Ludwig\";export default Ludwig;","import BaseFilters from\"./BaseFilters\";var COLOR_FILTER_CONST=[228,130,225,.13],SATURATION_CONST=-.2;function Aden(a){BaseFilters.apply(a,BaseFilters.colorFilter(COLOR_FILTER_CONST),BaseFilters.saturation(SATURATION_CONST))}Aden.filterName=\"Aden\";export default Aden;","import BaseFilters from\"./BaseFilters\";var ADJUST_RGB_CONST=[1.05,1.1,1];function Perpetua(a){BaseFilters.apply(a,BaseFilters.adjustRGB(ADJUST_RGB_CONST))}Perpetua.filterName=\"Perpetua\";export default Perpetua;","import BaseFilters from\"./BaseFilters\";var SATURATION_CONST=.3,BRIGHTNESS_CONST=.15;function Amaro(a){BaseFilters.apply(a,BaseFilters.saturation(SATURATION_CONST),BaseFilters.brightness(BRIGHTNESS_CONST))}Amaro.filterName=\"Amaro\";export default Amaro;","import BaseFilters from\"./BaseFilters\";var COLOR_FILTER_CONST=[230,115,108,.05],SATURATION_CONST=.15;function Mayfair(a){BaseFilters.apply(a,BaseFilters.colorFilter(COLOR_FILTER_CONST),BaseFilters.saturation(SATURATION_CONST))}Mayfair.filterName=\"Mayfair\";export default Mayfair;","import BaseFilters from\"./BaseFilters\";var COLOR_FILTER_CONST=[255,170,0,.1],BRIGHTNESS_CONST=.09,SATURATION_CONST=.1;function Rise(a){BaseFilters.apply(a,BaseFilters.colorFilter(COLOR_FILTER_CONST),BaseFilters.brightness(BRIGHTNESS_CONST),BaseFilters.saturation(SATURATION_CONST))}Rise.filterName=\"Rise\";export default Rise;","import BaseFilters from\"./BaseFilters\";var ADJUST_RGB_CONST=[1,1,1.25],CONTRAST_CONST=.1,BRIGHTNESS_CONST=.15;function Hudson(a){BaseFilters.apply(a,BaseFilters.adjustRGB(ADJUST_RGB_CONST),BaseFilters.contrast(CONTRAST_CONST),BaseFilters.brightness(BRIGHTNESS_CONST))}Hudson.filterName=\"Hudson\";export default Hudson;","import BaseFilters from\"./BaseFilters\";var COLOR_FILTER_CONST=[255,225,80,.08],SATURATION_CONST=.1,CONTRAST_CONST=.05;function Valencia(a){BaseFilters.apply(a,BaseFilters.colorFilter(COLOR_FILTER_CONST),BaseFilters.saturation(SATURATION_CONST),BaseFilters.contrast(CONTRAST_CONST))}Valencia.filterName=\"Valencia\";export default Valencia;","import BaseFilters from\"./BaseFilters\";var COLOR_FILTER_CONST=[255,255,0,.07],SATURATION_CONST=.2,CONTRAST_CONST=.15;function XPro2(a){BaseFilters.apply(a,BaseFilters.colorFilter(COLOR_FILTER_CONST),BaseFilters.saturation(SATURATION_CONST),BaseFilters.contrast(CONTRAST_CONST))}XPro2.filterName=\"XPro2\";export default XPro2;","import BaseFilters from\"./BaseFilters\";var CONTRAST_CONST=-.15,SATURATION_CONST=.1;function Sierra(a){BaseFilters.apply(a,BaseFilters.contrast(CONTRAST_CONST),BaseFilters.saturation(SATURATION_CONST))}Sierra.filterName=\"Sierra\";export default Sierra;","import BaseFilters from\"./BaseFilters\";var COLOR_FILTER_CONST=[100,28,210,.03],BRIGHTNESS_CONST=.1;function Willow(a){BaseFilters.apply(a,BaseFilters.grayscale(),BaseFilters.colorFilter(COLOR_FILTER_CONST),BaseFilters.brightness(BRIGHTNESS_CONST))}Willow.filterName=\"Willow\";export default Willow;","import BaseFilters from\"./BaseFilters\";var CONTRAST_CONST=.15,SATURATION_CONST=.2;function LoFi(a){BaseFilters.apply(a,BaseFilters.contrast(CONTRAST_CONST),BaseFilters.saturation(SATURATION_CONST))}LoFi.filterName=\"LoFi\";export default LoFi;","import BaseFilters from\"./BaseFilters\";var CONTRAST_CONST=.1,SATURATION_CONST=.15;function Hefe(a){BaseFilters.apply(a,BaseFilters.contrast(CONTRAST_CONST),BaseFilters.saturation(SATURATION_CONST))}Hefe.filterName=\"Hefe\";export default Hefe;","import BaseFilters from\"./BaseFilters\";var COLOR_FILTER_CONST=[220,115,188,.12],CONTRAST_CONST=-.05;function Nashville(a){BaseFilters.apply(a,BaseFilters.colorFilter(COLOR_FILTER_CONST),BaseFilters.contrast(CONTRAST_CONST))}Nashville.filterName=\"Nashville\";export default Nashville;","import BaseFilters from\"./BaseFilters\";var BRIGHTNESS_CONST=.1,SEPIA_CONST=.3;function Stinson(a){BaseFilters.apply(a,BaseFilters.brightness(BRIGHTNESS_CONST),BaseFilters.sepia(SEPIA_CONST))}Stinson.filterName=\"Stinson\";export default Stinson;","import BaseFilters from\"./BaseFilters\";var COLOR_FILTER_CONST=[255,225,0,.05],BRIGHTNESS_CONST=.06,CONTRAST_CONST=.06;function Vesper(a){BaseFilters.apply(a,BaseFilters.colorFilter(COLOR_FILTER_CONST),BaseFilters.brightness(BRIGHTNESS_CONST),BaseFilters.contrast(CONTRAST_CONST))}Vesper.filterName=\"Vesper\";export default Vesper;","import BaseFilters from\"./BaseFilters\";var COLOR_FILTER_CONST=[255,165,40,.2];function Earlybird(a){BaseFilters.apply(a,BaseFilters.colorFilter(COLOR_FILTER_CONST))}Earlybird.filterName=\"Earlybird\";export default Earlybird;","import BaseFilters from\"./BaseFilters\";var CONTRAST_CONST=.2,COLOR_FILTER_CONST=[140,10,185,.1];function Brannan(a){BaseFilters.apply(a,BaseFilters.contrast(CONTRAST_CONST),BaseFilters.colorFilter(COLOR_FILTER_CONST))}Brannan.filterName=\"Brannan\";export default Brannan;","import BaseFilters from\"./BaseFilters\";var BRIGHTNESS_CONST=-.1,SATURATION_CONST=-.1;function Sutro(a){BaseFilters.apply(a,BaseFilters.brightness(BRIGHTNESS_CONST),BaseFilters.saturation(SATURATION_CONST))}Sutro.filterName=\"Sutro\";export default Sutro;","import BaseFilters from\"./BaseFilters\";var SEPIA_CONST=.1,COLOR_FILTER_CONST=[255,145,0,.2];function Toaster(a){BaseFilters.apply(a,BaseFilters.sepia(SEPIA_CONST),BaseFilters.colorFilter(COLOR_FILTER_CONST))}Toaster.filterName=\"Toaster\";export default Toaster;","import BaseFilters from\"./BaseFilters\";var BRIGHTNESS_CONST=.1,COLOR_FILTER_CONST=[255,255,0,.2];function Walden(a){BaseFilters.apply(a,BaseFilters.brightness(BRIGHTNESS_CONST),BaseFilters.colorFilter(COLOR_FILTER_CONST))}Walden.filterName=\"Walden\";export default Walden;","import BaseFilters from\"./BaseFilters\";var COLOR_FILTER_CONST=[255,25,0,.15],BRIGHTNESS_CONST=.1;function NinteenSeventySeven(a){BaseFilters.apply(a,BaseFilters.colorFilter(COLOR_FILTER_CONST),BaseFilters.brightness(BRIGHTNESS_CONST))}NinteenSeventySeven.filterName=\"NinteenSeventySeven\";export default NinteenSeventySeven;","import BaseFilters from\"./BaseFilters\";var COLOR_FILTER_CONST=[255,140,0,.1],ADJUST_RGB_CONST=[1.15,1.05,1],SATURATION_CONST=.35;function Kelvin(a){BaseFilters.apply(a,BaseFilters.colorFilter(COLOR_FILTER_CONST),BaseFilters.adjustRGB(ADJUST_RGB_CONST),BaseFilters.saturation(SATURATION_CONST))}Kelvin.filterName=\"Kelvin\";export default Kelvin;","import BaseFilters from\"./BaseFilters\";var COLOR_FILTER_CONST=[225,240,0,.1],SATURATION_CONST=.25,CONTRAST_CONST=.05;function Maven(a){BaseFilters.apply(a,BaseFilters.colorFilter(COLOR_FILTER_CONST),BaseFilters.saturation(SATURATION_CONST),BaseFilters.contrast(CONTRAST_CONST))}Maven.filterName=\"Maven\";export default Maven;","import BaseFilters from\"./BaseFilters\";var SEPIA_CONST=.06,BRIGHTNESS_CONST=.1;function Ginza(a){BaseFilters.apply(a,BaseFilters.sepia(SEPIA_CONST),BaseFilters.brightness(BRIGHTNESS_CONST))}Ginza.filterName=\"Ginza\";export default Ginza;","import BaseFilters from\"./BaseFilters\";var SATURATION_CONST=.35,BRIGHTNESS_CONST=.1;function Skyline(a){BaseFilters.apply(a,BaseFilters.saturation(SATURATION_CONST),BaseFilters.brightness(BRIGHTNESS_CONST))}Skyline.filterName=\"Skyline\";export default Skyline;","import BaseFilters from\"./BaseFilters\";var CONTRAST_CONST=.15,BRIGHTNESS_CONST=.1;function Dogpatch(a){BaseFilters.apply(a,BaseFilters.contrast(CONTRAST_CONST),BaseFilters.brightness(BRIGHTNESS_CONST))}Dogpatch.filterName=\"Dogpatch\";export default Dogpatch;","import BaseFilters from\"./BaseFilters\";var COLOR_FILTER_CONST=[25,240,252,.05],SEPIA_CONST=.3;function Brooklyn(a){BaseFilters.apply(a,BaseFilters.colorFilter(COLOR_FILTER_CONST),BaseFilters.sepia(SEPIA_CONST))}Brooklyn.filterName=\"Brooklyn\";export default Brooklyn;","import BaseFilters from\"./BaseFilters\";var COLOR_FILTER_CONST=[208,208,86,.2],CONTRAST_CONST=.15;function Helena(a){BaseFilters.apply(a,BaseFilters.colorFilter(COLOR_FILTER_CONST),BaseFilters.contrast(CONTRAST_CONST))}Helena.filterName=\"Helena\";export default Helena;","import BaseFilters from\"./BaseFilters\";var COLOR_FILTER_CONST=[255,160,25,.1],BRIGHTNESS_CONST=.1;function Ashby(a){BaseFilters.apply(a,BaseFilters.colorFilter(COLOR_FILTER_CONST),BaseFilters.brightness(BRIGHTNESS_CONST))}Ashby.filterName=\"Ashby\";export default Ashby;","import BaseFilters from\"./BaseFilters\";var COLOR_FILTER_CONST=[255,50,80,.12],CONTRAST_CONST=.05;function Charmes(a){BaseFilters.apply(a,BaseFilters.colorFilter(COLOR_FILTER_CONST),BaseFilters.contrast(CONTRAST_CONST))}Charmes.filterName=\"Charmes\";export default Charmes;","import Konva from\"konva\";import*as CustomFilters from\"../custom/filters\";var filterStrToClass=function(a){return a?CustomFilters[a]||Konva.Filters[a]:null};export default filterStrToClass;","import Konva from\"konva\";import{Factory as KonvaFactory}from\"konva/lib/Factory\";import{getNumberValidator as konvaGetNumberValidator}from\"konva/lib/Validators\";function Warmth(a){for(var b=this.warmth(),c=a.data,d=c.length,e=0;e=b?255:0,c[e+1]=c[e+1]>=b?255:0,c[e+2]=c[e+2]>=b?255:0)}CustomThreshold.finetuneName=\"CustomThreshold\";export default CustomThreshold;KonvaFactory.addGetterSetter(Konva.Image,\"threshold\",0,konvaGetNumberValidator,KonvaFactory.afterSetFilter);","import Konva from\"konva\";import*as CustomFinetunes from\"../custom/finetunes\";var finetunesStrsToClasses=function(a){return Array.isArray(a)&&0d.status)b(d.response);else{var a;console.warn(\"Error in sending translation key to backend \".concat(null===(a=d.response)||void 0===a?void 0:a.hint,\", \").concat(d.status)),c()}},d.onerror=function(){var a;console.warn(\"Error in sending translation key to backend \".concat(null===(a=d.response)||void 0===a?void 0:a.hint,\", \").concat(d.status)),c()};d.open(\"POST\",\"https://neo.wordplex.io/api/import/request-translations?grid_uuid=\".concat(TRANSLATIONS_GRID_UUID)),d.send(JSON.stringify({grid_uuid:TRANSLATIONS_GRID_UUID,translations_requests:a}))})};export var getBackendTranslations=function(){var a=0f.status){(f.response||[]).forEach(function(a){backendTranslations[e]=_objectSpread(_objectSpread({},backendTranslations[e]),{},_defineProperty({},a.translation_key,a.translations[e]))});var a=[];Object.keys(defaultTranslations).forEach(function(b){var c;b&&!(null!==(c=backendTranslations[e])&&void 0!==c&&c[b])&&a.push({key:b,lang:e,default:defaultTranslations[b]})}),0d,l=0>e;switch(b){case TOOLS_IDS.RECT:c?(h.width=Math.sqrt(i*i+j*j),h.height=h.width,h.x-=k?h.width-i:0,h.y-=l?h.height-j:0):(h.width=i,h.height=j);break;case TOOLS_IDS.ELLIPSE:c?(h.radiusX=Math.sqrt(i*i+j*j)/2,h.radiusY=h.radiusX,h.x-=k?2*h.radiusX-i:0,h.y-=l?2*h.radiusY-j:0):(h.radiusX=i/2,h.radiusY=j/2),h.offsetX=-h.radiusX,h.offsetY=-h.radiusY;break;case TOOLS_IDS.POLYGON:h.radius=(i+j)/2,h.x-=k?2*h.radius-i:0,h.y-=l?2*h.radius-j:0,h.offsetX=-h.radius,h.offsetY=-h.radius;break;case TOOLS_IDS.LINE:case TOOLS_IDS.ARROW:h.x=f,h.y=g,h.points=[0,0],c?h.points.push(i>=j?d:0,j>i?e:0):h.points=[0,0,d,e];break;default:h.width=i,h.height=j}return h};export default getNewAnnotationPreview;","import _objectWithoutProperties from\"@babel/runtime/helpers/objectWithoutProperties\";import _defineProperty from\"@babel/runtime/helpers/defineProperty\";var _excluded=[\"id\",\"x\",\"y\",\"points\"],_excluded2=[\"startedX\",\"startedY\",\"offsetX\",\"offsetY\",\"width\",\"height\"];function ownKeys(a,b){var c=Object.keys(a);if(Object.getOwnPropertySymbols){var d=Object.getOwnPropertySymbols(a);b&&(d=d.filter(function(b){return Object.getOwnPropertyDescriptor(a,b).enumerable})),c.push.apply(c,d)}return c}function _objectSpread(a){for(var b,c=1;c=MIN_PIXELS&&latestAnnotationProps.height>=MIN_PIXELS||latestAnnotationProps.radiusX>=MIN_PIXELS&&latestAnnotationProps.radiusY>=MIN_PIXELS||null!==(c=latestAnnotationProps.points)&&void 0!==c&&c[2]||null!==(e=latestAnnotationProps.points)&&void 0!==e&&e[3]||latestAnnotationProps.radius>=MIN_PIXELS)){var f=latestAnnotationProps,g=f.startedX,h=f.startedY,i=f.offsetX,o=f.offsetY,p=f.width,q=f.height,r=_objectWithoutProperties(f,_excluded2);NO_WIDTH_HEIGHT_ANNOTATIONS.includes(b.name)||(r.width=p,r.height=q),d(r,!0)}shownAnnotationPreview=null,textAnnotationWrappedRect=null,latestAnnotationProps=null,a.setAttrs({isDrawing:!1}),a.off(\"mousemove touchmove\",l),a.off(\"mouseleave touchcancel\",m),document.removeEventListener(\"mouseup\",n,eventsOptions),document.removeEventListener(\"touchend\",n,eventsOptions),document.removeEventListener(\"mouseleave\",n,eventsOptions),document.removeEventListener(\"touchcancel\",n,eventsOptions),document.removeEventListener(\"mousemove\",j,eventsOptions),document.removeEventListener(\"touchmove\",j,eventsOptions),pointerDown.isOutOfCanvas=!1},o=function handlePointerDown(b){var d;if(b.evt.preventDefault(),!(b.target.attrs.draggable||1<(null===(d=b.evt.touches)||void 0===d?void 0:d.length))){k();var e=getPointerOffsetPositionBoundedToObject(c,f());pointerDown.startedX=e.offsetX,pointerDown.startedY=e.offsetY,pointerDown.isOutOfCanvas=!1,a.on(\"mousemove touchmove\",l),a.on(\"mouseleave touchcancel\",m),document.addEventListener(\"mouseup\",n,eventsOptions),document.addEventListener(\"touchend\",n,eventsOptions),document.addEventListener(\"mouseleave\",n,eventsOptions),document.addEventListener(\"touchcancel\",n,eventsOptions)}};return a.on(\"mousedown touchstart\",o),function(){k(),a.off(\"mousedown touchstart\",o)}};export default previewThenCallAnnotationAdding;","import{useCallback}from\"react\";import debounce from\"../utils/debounce\";var useDebouncedCallback=function(a,b){var c=2=e?0:function getTopOffset(){return 0>e&&-90=e&&-90<=e?0:function getLeftOffset(){return 90>>32-b},cvtHex=function(a){var b,c,d=\"\";for(b=7;0<=b;b--)c=15&a>>>4*b,d+=c.toString(16);return d},Utf8Encode=function(a){for(var b,d=a.replace(/\\r\\n/g,\"\\n\"),e=\"\",f=0;fb?e+=String.fromCharCode(b):127b?(e+=String.fromCharCode(192|b>>6),e+=String.fromCharCode(128|63&b)):(e+=String.fromCharCode(224|b>>12),e+=String.fromCharCode(128|63&b>>6),e+=String.fromCharCode(128|63&b));return e},sha1=function(a){var b,c,d,e,f,g,h,k,l,m=a,n=Array(80),o=1732584193,p=4023233417,q=2562383102,r=271733878,s=3285377520;m=Utf8Encode(m);var t=m.length,u=[];for(c=0;c>>29),u.push(4294967295&t<<3),b=0;bc;c++)n[c]=u[b+c];for(c=16;79>=c;c++)n[c]=rotateLeft(n[c-3]^n[c-8]^n[c-14]^n[c-16],1);for(e=o,f=p,g=q,h=r,k=s,c=0;19>=c;c++)l=4294967295&rotateLeft(e,5)+(f&g|~f&h)+k+n[c]+1518500249,k=h,h=g,g=rotateLeft(f,30),f=e,e=l;for(c=20;39>=c;c++)l=4294967295&rotateLeft(e,5)+(f^g^h)+k+n[c]+1859775393,k=h,h=g,g=rotateLeft(f,30),f=e,e=l;for(c=40;59>=c;c++)l=4294967295&rotateLeft(e,5)+(f&g|f&h|g&h)+k+n[c]+2400959708,k=h,h=g,g=rotateLeft(f,30),f=e,e=l;for(c=60;79>=c;c++)l=4294967295&rotateLeft(e,5)+(f^g^h)+k+n[c]+3395469782,k=h,h=g,g=rotateLeft(f,30),f=e,e=l;o=4294967295&o+e,p=4294967295&p+f,q=4294967295&q+g,r=4294967295&r+h,s=4294967295&s+k}return l=cvtHex(o)+cvtHex(p)+cvtHex(q)+cvtHex(r)+cvtHex(s),l.toLowerCase()};export default sha1;","import _slicedToArray from\"@babel/runtime/helpers/slicedToArray\";import sha1 from\"./sha1\";var encodeBase64=function(a){return btoa(a).replace(/=*$/g,\"\")},getSha1=function(a,b){return sha1(a).slice(0,b)},getSealingParams=function(a,b,c,d){var e=encodeBase64(a),f=getSha1(b+e+c,d);return[f?\"ci_seal=\".concat(f):\"\",e?\"ci_eqs=\".concat(e):\"\"].filter(function(a){return a}).join(\"&\")},getImageSealingParams=function(a,b,c){var d=b||{},e=d.salt,f=d.charCount,g=d.includeParams,h=void 0===g?[]:g,i=!h||0===(null===h||void 0===h?void 0:h.length),j=\"\",k=\"\",l=[],m=[];return a.split(\"&\").forEach(function(a){var b=a.split(\"=\"),c=_slicedToArray(b,1),d=c[0];-1<(null===h||void 0===h?void 0:h.indexOf(d))||i?l.push(a):m.push(a)}),0o?e*k/p:f*m/q),2);return\"\".concat(t,\"&wat_opacity=\").concat(i,\"&wat_scale=\").concat(A,\"p\").concat(z?\"&wat_url=\".concat(encodeURIComponent(z)):\"\")};export var finetuneNameToParamInfo={Brighten:{cloudimage:{name:\"bright\",min:-100,max:100},internal:{propName:\"brightness\",min:-1,max:1}},Contrast:{cloudimage:{name:\"contrast\",min:-100,max:100},internal:{propName:\"contrast\",min:-100,max:100}},Blur:{cloudimage:{name:\"blur\",min:0,max:100},internal:{propName:\"blurRadius\",min:0,max:100}}};var generateFinetuneQuery=function(a){var b=1 input{border:0px;clip:rect(0px,0px,0px,0px);height:100%;margin:-1px;overflow:hidden;padding:0px;position:absolute;white-space:nowrap;width:100%;direction:ltr;}&::before{position:absolute;content:'';border-radius:inherit;width:100%;height:100%;box-shadow:0px 3px 1px -2px rgb(0 0 0 / 20%),0px 2px 2px 0px rgb(0 0 0 / 14%),0px 1px 5px 0px rgb(0 0 0 / 12%);}&::after{position:absolute;content:'';border-radius:50%;width:42px;height:42px;top:50%;left:50%;transform:translate(-50%,-50%);}\"]);\nvar LabelTooltip = /*#__PURE__*/styled.span.attrs({\n className: generateClassNames(baseClassName, 'label')\n}).withConfig({\n componentId: \"sc-jjink6-4\"\n})(function (_ref2) {\n var theme = _ref2.theme,\n _ref2$open = _ref2.open,\n open = _ref2$open === void 0 ? false : _ref2$open,\n _ref2$disabled = _ref2.disabled,\n disabled = _ref2$disabled === void 0 ? false : _ref2$disabled;\n return css([\"display:flex;align-items:center;justify-content:center;padding:6px 6px;border-radius:2px;position:absolute;top:-10px;font-size:10px;z-index:1;white-space:nowrap;transition:transform 150ms cubic-bezier(0.4,0,0.2,1) 0ms;transform-origin:bottom center;transform:\", \";background-color:\", \";color:#fff;cursor:pointer;transition:all 100ms ease-out;&::before{position:absolute;content:'';background-color:inherit;width:8px;height:8px;bottom:0px;left:50%;transform:translate(-50%,50%) rotate(45deg);}\"], open ? 'translateY(-100%) scale(1)' : 'translateY(-100%) scale(0)', disabled ? theme.palette[PC.AccentPrimaryDisabled] : theme.palette[PC.LinkStateless]);\n});\nvar SliderAnnotation = /*#__PURE__*/styled.div.attrs({\n className: generateClassNames(baseClassName, 'annotation')\n}).withConfig({\n componentId: \"sc-jjink6-5\"\n})(function (_ref3) {\n var theme = _ref3.theme;\n return css([\"display:flex;justify-content:space-between;margin-top:12px;color:\", \";\"], theme.palette[PC.TextSecondary]);\n});\nvar Styled = applyDisplayNames({\n Slider: Slider,\n Rail: Rail,\n Track: Track,\n Thumb: Thumb,\n SliderAnnotation: SliderAnnotation,\n LabelTooltip: LabelTooltip\n});\nexport default Styled;","import _extends from \"@babel/runtime/helpers/extends\";\nimport _defineProperty from \"@babel/runtime/helpers/defineProperty\";\nimport _slicedToArray from \"@babel/runtime/helpers/slicedToArray\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/objectWithoutProperties\";\nvar _excluded = [\"defaultValue\", \"disabled\", \"disableSwap\", \"hideTrack\", \"hideAnnotation\", \"value\", \"min\", \"max\", \"onChange\", \"onMouseDown\", \"onMouseUp\", \"step\", \"labelTooltip\", \"annotation\", \"components\", \"componentsProps\"];\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\n/* eslint-disable no-use-before-define */\n\nimport React, { useEffect, useRef, useState, useCallback } from 'react';\nimport PT from 'prop-types';\nimport { intrinsicComponent, objectValues, asc, valueToPercent, percentToValue, roundValueToStep, setValueIndex, findClosest, ownerDocument, clamp, trackFinger, focusThumb, axisProps, useForkRef } from '../../utils/functions';\nimport useControlled from '../../hooks/use-controlled';\nimport useEventCallback from '../../hooks/use-event-callback';\nimport { LabelTooltip } from './types';\nimport Styled from './slider.styles';\nvar INTENTIONAL_DRAG_COUNT_THRESHOLD = 2;\nvar dataIndex = 'data-index';\nvar Slider = intrinsicComponent(function (_ref,\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nref) {\n var defaultValue = _ref.defaultValue,\n _ref$disabled = _ref.disabled,\n disabled = _ref$disabled === void 0 ? false : _ref$disabled,\n _ref$disableSwap = _ref.disableSwap,\n disableSwap = _ref$disableSwap === void 0 ? false : _ref$disableSwap,\n _ref$hideTrack = _ref.hideTrack,\n hideTrack = _ref$hideTrack === void 0 ? false : _ref$hideTrack,\n _ref$hideAnnotation = _ref.hideAnnotation,\n hideAnnotation = _ref$hideAnnotation === void 0 ? false : _ref$hideAnnotation,\n valueProp = _ref.value,\n _ref$min = _ref.min,\n min = _ref$min === void 0 ? 0 : _ref$min,\n _ref$max = _ref.max,\n max = _ref$max === void 0 ? 100 : _ref$max,\n onChange = _ref.onChange,\n onMouseDown = _ref.onMouseDown,\n onMouseUp = _ref.onMouseUp,\n _ref$step = _ref.step,\n step = _ref$step === void 0 ? 1 : _ref$step,\n _ref$labelTooltip = _ref.labelTooltip,\n labelTooltip = _ref$labelTooltip === void 0 ? LabelTooltip.Off : _ref$labelTooltip,\n _ref$annotation = _ref.annotation,\n annotation = _ref$annotation === void 0 ? '' : _ref$annotation,\n _ref$components = _ref.components,\n components = _ref$components === void 0 ? {} : _ref$components,\n _ref$componentsProps = _ref.componentsProps,\n componentsProps = _ref$componentsProps === void 0 ? {} : _ref$componentsProps,\n rest = _objectWithoutProperties(_ref, _excluded);\n var _useState = useState(-1),\n _useState2 = _slicedToArray(_useState, 2),\n active = _useState2[0],\n setActive = _useState2[1];\n var _useState3 = useState(-1),\n _useState4 = _slicedToArray(_useState3, 2),\n open = _useState4[0],\n setOpen = _useState4[1];\n var _useState5 = useState(false),\n _useState6 = _slicedToArray(_useState5, 2),\n dragging = _useState6[0],\n setDragging = _useState6[1];\n var moveCount = useRef(0);\n var previousIndex = useRef(0);\n var touchId = useRef();\n var sliderRef = useRef(null);\n var handleRef = useForkRef(ref, sliderRef);\n var _useControlled = useControlled({\n controlled: valueProp,\n \"default\": defaultValue !== null && defaultValue !== void 0 ? defaultValue : min\n }),\n _useControlled2 = _slicedToArray(_useControlled, 2),\n valueDerived = _useControlled2[0],\n setValueState = _useControlled2[1];\n var axis = 'horizontal';\n var range = Array.isArray(valueDerived);\n var values = range ? valueDerived.slice().sort(asc) : [valueDerived];\n var getFingerNewValue = function getFingerNewValue(_ref2) {\n var finger = _ref2.finger,\n _ref2$move = _ref2.move,\n move = _ref2$move === void 0 ? false : _ref2$move,\n values2 = _ref2.values;\n var slider = sliderRef.current;\n if (slider) {\n var _slider$getBoundingCl = slider.getBoundingClientRect(),\n width = _slider$getBoundingCl.width,\n height = _slider$getBoundingCl.height,\n bottom = _slider$getBoundingCl.bottom,\n left = _slider$getBoundingCl.left;\n var percent;\n if (axis.indexOf('vertical') === 0) {\n percent = (bottom - finger.y) / height;\n } else {\n percent = (finger.x - left) / width;\n }\n if (axis.includes('-reverse')) {\n percent = 1 - percent;\n }\n var newValue;\n newValue = percentToValue(percent, min, max);\n if (step) {\n newValue = roundValueToStep(newValue, step, min);\n }\n newValue = clamp(newValue, min, max);\n var activeIndex = 0;\n if (range) {\n if (!move) {\n activeIndex = findClosest(values2, newValue);\n } else {\n activeIndex = previousIndex.current;\n }\n if (disableSwap) {\n newValue = clamp(newValue, values2[activeIndex - 1] || -Infinity, values2[activeIndex + 1] || Infinity);\n }\n var previousValue = newValue;\n newValue = setValueIndex({\n values: values2,\n newValue: newValue,\n index: activeIndex\n });\n if (!(disableSwap && move) && Array.isArray(newValue)) {\n activeIndex = newValue.indexOf(previousValue);\n previousIndex.current = activeIndex;\n }\n }\n return {\n newValue: newValue,\n activeIndex: activeIndex\n };\n }\n return null;\n };\n var handleChange = function handleChange(event, value, thumbIndex) {\n if (onChange) {\n onChange(event, value, thumbIndex);\n }\n };\n var handleHiddenInputChange = function handleHiddenInputChange(event) {\n var index = Number(event.currentTarget.getAttribute(dataIndex));\n var newValue = event.target.valueAsNumber;\n if (range) {\n if (disableSwap) {\n newValue = clamp(newValue, values[index - 1] || -Infinity, values[index + 1] || Infinity);\n }\n var previousValue = newValue;\n newValue = setValueIndex({\n values: values,\n newValue: newValue,\n index: index\n });\n var activeIndex = index;\n if (!disableSwap) {\n activeIndex = newValue.indexOf(previousValue);\n }\n focusThumb({\n sliderRef: sliderRef,\n activeIndex: activeIndex\n });\n }\n setValueState(newValue);\n handleChange(event, newValue, index);\n if (onMouseUp) {\n onMouseUp(event);\n }\n };\n var handleTouchMove = useEventCallback(function (nativeEvent) {\n var finger = trackFinger(nativeEvent, touchId);\n if (!finger) {\n return;\n }\n moveCount.current += 1;\n if (nativeEvent.type === 'mousemove' && nativeEvent.buttons === 0) {\n handleTouchEnd(nativeEvent);\n return;\n }\n var _ref3 = getFingerNewValue({\n finger: finger,\n move: true,\n values: values\n }),\n newValue = _ref3.newValue,\n activeIndex = _ref3.activeIndex;\n focusThumb({\n sliderRef: sliderRef,\n activeIndex: activeIndex,\n setActive: setActive\n });\n setValueState(newValue);\n if (!dragging && moveCount.current > INTENTIONAL_DRAG_COUNT_THRESHOLD) {\n setDragging(true);\n }\n handleChange(nativeEvent, newValue, activeIndex);\n });\n var handleTouchEnd = useEventCallback(function (nativeEvent) {\n var finger = trackFinger(nativeEvent, touchId);\n setDragging(false);\n if (!finger) {\n return;\n }\n setActive(-1);\n if (nativeEvent.type === 'touchend') {\n setOpen(-1);\n }\n if (onMouseUp) {\n onMouseUp(nativeEvent);\n }\n touchId.current = undefined;\n stopListening();\n });\n var handleTouchStart = useEventCallback(function (nativeEvent) {\n var touch = nativeEvent.changedTouches[0];\n if (touch != null) {\n touchId.current = touch.identifier;\n }\n var finger = trackFinger(nativeEvent, touchId);\n var _ref4 = getFingerNewValue({\n finger: finger,\n values: values\n }),\n newValue = _ref4.newValue,\n activeIndex = _ref4.activeIndex;\n focusThumb({\n sliderRef: sliderRef,\n activeIndex: activeIndex,\n setActive: setActive\n });\n setValueState(newValue);\n handleChange(nativeEvent, newValue, activeIndex);\n moveCount.current = 0;\n var doc = ownerDocument(sliderRef.current);\n doc.addEventListener('touchmove', handleTouchMove);\n doc.addEventListener('touchend', handleTouchEnd);\n });\n var handleMouseOver = useEventCallback(function (event) {\n var index = Number(event.currentTarget.getAttribute(dataIndex));\n setOpen(index);\n });\n var handleMouseLeave = useEventCallback(function () {\n setOpen(-1);\n });\n var handleMouseDown = useEventCallback(function (event) {\n if (!disabled) {\n if (onMouseDown) {\n onMouseDown(event);\n }\n if (event.button !== 0) {\n return;\n }\n\n // Avoid text selection\n event.preventDefault();\n var finger = trackFinger(event, touchId);\n var _ref5 = getFingerNewValue({\n finger: finger,\n values: values\n }),\n newValue = _ref5.newValue,\n activeIndex = _ref5.activeIndex;\n focusThumb({\n sliderRef: sliderRef,\n activeIndex: activeIndex,\n setActive: setActive\n });\n setValueState(newValue);\n handleChange(event, newValue, activeIndex);\n moveCount.current = 0;\n var doc = ownerDocument(sliderRef.current);\n doc.addEventListener('mousemove', handleTouchMove);\n doc.addEventListener('mouseup', handleTouchEnd);\n } else {\n // Avoid text selection\n event.preventDefault();\n }\n });\n var stopListening = useCallback(function () {\n var doc = ownerDocument(sliderRef.current);\n doc.removeEventListener('mousemove', handleTouchMove);\n doc.removeEventListener('mouseup', handleTouchEnd);\n doc.removeEventListener('touchmove', handleTouchMove);\n doc.removeEventListener('touchend', handleTouchEnd);\n }, [handleTouchEnd, handleTouchMove]);\n useEffect(function () {\n var slider = sliderRef.current;\n if (slider) {\n return function () {\n stopListening();\n };\n }\n }, [stopListening, handleTouchStart]);\n useEffect(function () {\n if (disabled) {\n stopListening();\n }\n }, [disabled, stopListening]);\n if (disabled && active !== -1) {\n setActive(-1);\n }\n var trackOffset = valueToPercent(range ? values[0] : min, min, max);\n var trackLeap = valueToPercent(values[values.length - 1], min, max) - trackOffset;\n var trackStyle = _objectSpread(_objectSpread({}, axisProps[axis].offset(trackOffset)), axisProps[axis].leap(trackLeap));\n var railProps = componentsProps.rail;\n var Rail = typeof components.Rail === 'function' ? /*#__PURE__*/React.createElement(components.Rail, _extends({}, railProps, {\n style: _objectSpread({}, railProps === null || railProps === void 0 ? void 0 : railProps.style)\n })) : /*#__PURE__*/React.createElement(Styled.Rail, _extends({}, railProps, {\n style: _objectSpread({}, railProps === null || railProps === void 0 ? void 0 : railProps.style)\n }));\n var trackProps = componentsProps.track;\n var Track = !hideTrack && (typeof components.Track === 'function' ? /*#__PURE__*/React.createElement(components.Track, _extends({}, trackProps, {\n style: _objectSpread(_objectSpread({}, trackStyle), trackProps === null || trackProps === void 0 ? void 0 : trackProps.style)\n })) : /*#__PURE__*/React.createElement(Styled.Track, _extends({}, trackProps, {\n style: _objectSpread(_objectSpread({}, trackStyle), trackProps === null || trackProps === void 0 ? void 0 : trackProps.style)\n })));\n var thumbProps = componentsProps.thumb;\n var Thumb = components.Thumb || Styled.Thumb;\n var LabelTooltipComponent = components.LabelTooltip || Styled.LabelTooltip;\n var labelTooltipProps = componentsProps.labelTooltip;\n var annotationText = annotation ? \" \".concat(annotation) : '';\n return /*#__PURE__*/React.createElement(Styled.Slider, _extends({\n ref: handleRef,\n disabled: disabled,\n onTouchStart: handleTouchStart,\n onMouseDown: handleMouseDown\n }, rest), Rail, Track, values.map(function (value, index) {\n var percent = valueToPercent(value, min, max);\n var style = axisProps[axis].offset(percent);\n return /*#__PURE__*/React.createElement(React.Fragment, {\n key: index\n }, /*#__PURE__*/React.createElement(Thumb, _extends({\n \"data-index\": index,\n onMouseOver: handleMouseOver,\n onMouseLeave: handleMouseLeave\n }, thumbProps, {\n style: _objectSpread(_objectSpread({}, style), {}, {\n pointerEvents: disableSwap && active !== index ? 'none' : undefined\n }, thumbProps === null || thumbProps === void 0 ? void 0 : thumbProps.style)\n }), /*#__PURE__*/React.createElement(\"input\", {\n \"data-index\": index,\n type: \"range\",\n min: min,\n max: max,\n value: values[index],\n step: step,\n disabled: disabled,\n onChange: handleHiddenInputChange\n }), /*#__PURE__*/React.createElement(LabelTooltipComponent, {\n open: (open === index || active === index || labelTooltip === 'on') && labelTooltip !== 'off',\n disabled: disabled,\n style: _objectSpread({}, labelTooltipProps === null || labelTooltipProps === void 0 ? void 0 : labelTooltipProps.style)\n }, values[index], annotationText)));\n }), !hideAnnotation && /*#__PURE__*/React.createElement(Styled.SliderAnnotation, null, /*#__PURE__*/React.createElement(\"span\", null, min, annotationText), /*#__PURE__*/React.createElement(\"span\", null, max, annotationText)));\n});\nSlider.defaultProps = {\n annotation: 'MB',\n min: 0,\n max: 100,\n step: 1,\n labelTooltip: LabelTooltip.Off\n};\nSlider.propTypes = {\n defaultValue: PT.oneOfType([PT.array, PT.number]),\n value: PT.oneOfType([PT.array, PT.number]),\n min: PT.number,\n max: PT.number,\n onChange: PT.func,\n onMouseDown: PT.func,\n onMouseUp: PT.func,\n step: PT.number,\n annotation: PT.string,\n disabled: PT.bool,\n disableSwap: PT.bool,\n hideTrack: PT.bool,\n hideAnnotation: PT.bool,\n labelTooltip: PT.oneOf(objectValues(LabelTooltip)),\n components: PT.shape({\n Rail: PT.elementType,\n Track: PT.elementType,\n Thumb: PT.elementType,\n LabelTooltip: PT.elementType\n }),\n componentsProps: PT.object\n};\nexport default Slider;","import styled from\"styled-components\";import Slider from\"@scaleflex/ui/core/slider\";import{Color as PC}from\"@scaleflex/ui/utils/types/palette\";var StyledSlider=styled(Slider).withConfig({componentId:\"sc-1wort0h-0\"})([\"width:\",\";max-width:\",\";user-select:none;padding:0;margin-bottom:\",\";.SfxSlider-thumb{background-color:\",\";}.SfxSlider-Track{height:2px;color:\",\";}.SfxSlider-rail{height:2px;background-color:\",\";}\"],function(a){var b=a.width;return b||\"104px\"},function(a){var b=a.width;return b||\"104px\"},function(a){var b=a.noMargin;return b?\"\":\"16px\"},function(a){var b=a.theme.palette;return b[PC.AccentStateless]},function(a){var b=a.theme.palette;return b[PC.AccentStateless]},function(a){var b=a.theme.palette;return b[PC.BordersItem]});export{StyledSlider};","import _extends from\"@babel/runtime/helpers/extends\";import _objectWithoutProperties from\"@babel/runtime/helpers/objectWithoutProperties\";var _excluded=[\"onChange\"];import React from\"react\";import{StyledSlider}from\"./Slider.styled\";var Slider=function(a){var b=a.onChange,c=_objectWithoutProperties(a,_excluded);return React.createElement(StyledSlider,_extends({annotation:\"\",onChange:function onChange(a,c){return b?b(c):void 0},hideAnnotation:!0,labelTooltip:\"auto\"},c))};export default Slider;","import PT from 'prop-types';\nexport var iconPropTypes = {\n size: PT.number,\n width: PT.oneOfType([PT.string, PT.number]),\n height: PT.oneOfType([PT.string, PT.number]),\n color: PT.string,\n color2: PT.string,\n stroke: PT.string,\n stroke2: PT.string,\n viewBox: PT.string\n};","import _extends from \"@babel/runtime/helpers/extends\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/objectWithoutProperties\";\nvar _excluded = [\"color\", \"size\"];\nimport React from 'react';\nimport { intrinsicComponent } from './utils/functions';\nexport var ArrowBottom = intrinsicComponent(function (_ref, ref) {\n var _ref$color = _ref.color,\n color = _ref$color === void 0 ? 'currentColor' : _ref$color,\n _ref$size = _ref.size,\n size = _ref$size === void 0 ? 14 : _ref$size,\n rest = _objectWithoutProperties(_ref, _excluded);\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n ref: ref,\n width: size,\n height: size,\n viewBox: \"0 0 11 12\",\n fill: \"none\",\n xmlns: \"http://www.w3.org/2000/svg\"\n }, rest), /*#__PURE__*/React.createElement(\"path\", {\n fillRule: \"evenodd\",\n clipRule: \"evenodd\",\n d: \"M10.8468 3.13984C11.0457 3.33138 11.0517 3.64791 10.8602 3.84682L6.04534 8.84682C5.95332 8.94238 5.82709 8.99746 5.69445 8.99991C5.5618 9.00237 5.43362 8.95201 5.33812 8.85992L0.152931 3.85992C-0.0458479 3.66824 -0.0516033 3.35171 0.140078 3.15293C0.331758 2.95415 0.648288 2.9484 0.847067 3.14008L5.67208 7.79277L10.1398 3.15318C10.3314 2.95427 10.6479 2.9483 10.8468 3.13984Z\",\n fill: color\n }));\n});\nexport default ArrowBottom;","import _defineProperty from \"@babel/runtime/helpers/defineProperty\";\nimport { css } from 'styled-components';\n// import type { WithTheme } from '../../theme/entity';\n// import { Color as PaletteColor } from '../../utils/types/palette';\nimport { Position } from '../../utils/types';\nexport var typeArrowTickMixin = _defineProperty(_defineProperty(_defineProperty(_defineProperty({}, Position.Right, css([\"svg{transform:rotate(-90deg);transition:transform 150ms ease-out;}\"])), Position.Left, css([\"svg{transform:rotate(90deg);transition:transform 150ms ease-out;}\"])), Position.Top, css([\"svg{transform:rotate(180deg);transition:transform 150ms ease-out;}\"])), Position.Bottom, css([\"svg{transform:rotate(0);transition:transform 150ms ease-out;}\"]));","import styled, { css } from 'styled-components';\nimport { generateClassNames, applyDisplayNames } from '../../utils/functions';\nimport { typeArrowTickMixin } from './arrow-tick.mixin';\nimport { Position } from '../../utils/types';\nvar baseClassName = 'ArrowTick';\nvar ArrowTick = /*#__PURE__*/styled.span.attrs({\n className: generateClassNames(baseClassName, 'root')\n}).withConfig({\n componentId: \"sc-tlypde-0\"\n})(function (_ref) {\n var _ref$type = _ref.type,\n type = _ref$type === void 0 ? Position.Right : _ref$type;\n return css([\"display:inline-flex;\", \"\"], typeArrowTickMixin[type]);\n});\nvar Styled = applyDisplayNames({\n ArrowTick: ArrowTick\n});\nexport default Styled;","import _extends from \"@babel/runtime/helpers/extends\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/objectWithoutProperties\";\nvar _excluded = [\"IconProps\"];\nimport React from 'react';\nimport PT from 'prop-types';\nimport ArrowBottom from '@scaleflex/icons/arrow-bottom';\nimport { iconPropTypes } from '@scaleflex/icons/icon.prop-types';\nimport { intrinsicComponent, objectValues } from '../../utils/functions';\nimport { Position } from '../../utils/types';\nimport Styled from './arrow-tick.styles';\nvar ArrowTick = intrinsicComponent(function (_ref, ref) {\n var IconPropsData = _ref.IconProps,\n rest = _objectWithoutProperties(_ref, _excluded);\n return /*#__PURE__*/React.createElement(Styled.ArrowTick, _extends({}, rest, {\n ref: ref\n }), /*#__PURE__*/React.createElement(ArrowBottom, IconPropsData));\n});\nArrowTick.defaultProps = {\n type: Position.Right\n};\nArrowTick.propTypes = {\n type: PT.oneOf(objectValues(Position)),\n IconProps: PT.exact(iconPropTypes)\n};\nexport default ArrowTick;","import styled, { css } from 'styled-components';\nimport { generateClassNames, applyDisplayNames } from '../../utils/functions';\nimport { Color as PColor } from '../../utils/types/palette';\nimport { FontVariant } from '../../utils/types/typography';\nvar baseClassName = 'AccordionHeader';\nvar Icon = /*#__PURE__*/styled.span.attrs({\n className: generateClassNames(baseClassName, 'icon')\n}).withConfig({\n componentId: \"sc-1dtjsgt-0\"\n})(function () {\n return css([\"display:inline-flex;padding-left:8px;\"]);\n});\nvar Label = /*#__PURE__*/styled.span.attrs({\n className: generateClassNames(baseClassName, 'label')\n}).withConfig({\n componentId: \"sc-1dtjsgt-1\"\n})(function (_ref) {\n var theme = _ref.theme;\n return css([\"\", \"\"], theme.typography.font[FontVariant.ButtonSm]);\n});\nvar Header = /*#__PURE__*/styled.div.attrs({\n className: generateClassNames(baseClassName, 'root')\n}).withConfig({\n componentId: \"sc-1dtjsgt-2\"\n})(function (_ref2) {\n var theme = _ref2.theme,\n fullWidth = _ref2.fullWidth;\n return css([\"display:inline-flex;align-items:center;justify-content:space-between;box-sizing:border-box;cursor:pointer;width:\", \";color:\", \";user-select:none;\"], fullWidth ? '100%' : 'auto', theme.palette[PColor.LinkPrimary]);\n});\nvar Wrapper = /*#__PURE__*/styled.div.attrs({\n className: generateClassNames(baseClassName, 'wrapper')\n}).withConfig({\n componentId: \"sc-1dtjsgt-3\"\n})(function (_ref3) {\n var theme = _ref3.theme;\n return css([\"color:\", \";\"], theme.palette[PColor.LinkPrimary]);\n});\nvar Styled = applyDisplayNames({\n Header: Header,\n Wrapper: Wrapper,\n Icon: Icon,\n Label: Label\n});\nexport default Styled;","import _extends from \"@babel/runtime/helpers/extends\";\nimport _defineProperty from \"@babel/runtime/helpers/defineProperty\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/objectWithoutProperties\";\nvar _excluded = [\"expanded\", \"label\", \"onChange\", \"onClick\", \"onContextMenu\", \"hideIcon\", \"fullWidth\", \"iconProps\"];\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nimport React from 'react';\nimport PT from 'prop-types';\nimport { iconPropTypes } from '@scaleflex/icons/icon.prop-types';\nimport { intrinsicComponent } from '../../utils/functions';\nimport ArrowTick from '../arrow-tick';\nimport { Position as ArrowTickType } from '../../utils/types';\nimport Styled from './accordion-header.styles';\nvar AccordionHeader = intrinsicComponent(function (_ref, ref) {\n var expanded = _ref.expanded,\n label = _ref.label,\n onChange = _ref.onChange,\n _onClick = _ref.onClick,\n onContextMenu = _ref.onContextMenu,\n hideIcon = _ref.hideIcon,\n fullWidth = _ref.fullWidth,\n iconPropsData = _ref.iconProps,\n rest = _objectWithoutProperties(_ref, _excluded);\n return /*#__PURE__*/React.createElement(Styled.Header, _extends({\n ref: ref,\n onClick: function onClick(event) {\n if (typeof onChange === 'function') {\n onChange(!expanded);\n }\n if (typeof _onClick === 'function') {\n _onClick(event);\n }\n },\n fullWidth: fullWidth\n }, rest), /*#__PURE__*/React.createElement(Styled.Label, {\n onContextMenu: onContextMenu\n }, label), !hideIcon && /*#__PURE__*/React.createElement(Styled.Icon, {\n onContextMenu: onContextMenu\n }, /*#__PURE__*/React.createElement(ArrowTick, {\n type: expanded ? ArrowTickType.Top : ArrowTickType.Bottom,\n IconProps: _objectSpread({\n size: 11\n }, iconPropsData)\n })));\n});\nAccordionHeader.defaultProps = {\n expanded: false,\n hideIcon: false,\n fullWidth: false\n};\nAccordionHeader.propTypes = {\n label: PT.node.isRequired,\n expanded: PT.bool,\n hideIcon: PT.bool,\n fullWidth: PT.bool,\n onChange: PT.func,\n iconProps: PT.exact(iconPropTypes)\n};\nexport default AccordionHeader;","import styled from 'styled-components';\nimport { generateClassNames, applyDisplayNames } from '../../utils/functions';\nvar baseClassName = 'AccordionDetails';\nvar AccordionDetails = /*#__PURE__*/styled.div.attrs({\n className: generateClassNames(baseClassName, 'root')\n}).withConfig({\n componentId: \"sc-1wr6wpr-0\"\n})([\"margin:16px 0;\"]);\nvar Styled = applyDisplayNames({\n AccordionDetails: AccordionDetails\n});\nexport default Styled;","import _extends from \"@babel/runtime/helpers/extends\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/objectWithoutProperties\";\nvar _excluded = [\"expanded\", \"children\"];\nimport React from 'react';\nimport PT from 'prop-types';\nimport { intrinsicComponent } from '../../utils/functions';\nimport Styled from './accordion-details.styles';\nvar AccordionDetails = intrinsicComponent(function (_ref, ref) {\n var expanded = _ref.expanded,\n children = _ref.children,\n rest = _objectWithoutProperties(_ref, _excluded);\n return /*#__PURE__*/React.createElement(React.Fragment, null, expanded && /*#__PURE__*/React.createElement(Styled.AccordionDetails, _extends({\n ref: ref\n }, rest), children));\n});\nAccordionDetails.defaultProps = {\n expanded: false\n};\nAccordionDetails.propTypes = {\n expanded: PT.bool\n};\nexport default AccordionDetails;","import styled from 'styled-components';\nimport { generateClassNames, applyDisplayNames } from '../../utils/functions';\nvar baseClassName = 'Accordion';\nvar Accordion = /*#__PURE__*/styled.div.attrs({\n className: generateClassNames(baseClassName, 'root')\n}).withConfig({\n componentId: \"sc-1g4tz7s-0\"\n})([\"\"]);\nvar Styled = applyDisplayNames({\n Accordion: Accordion\n});\nexport default Styled;","import _extends from \"@babel/runtime/helpers/extends\";\nimport _defineProperty from \"@babel/runtime/helpers/defineProperty\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/objectWithoutProperties\";\nvar _excluded = [\"label\", \"expanded\", \"children\", \"detailStyle\", \"headerStyle\", \"fullWidth\", \"iconProps\", \"onClick\", \"onChange\", \"onContextMenu\", \"hideIcon\"];\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nimport React from 'react';\nimport PT from 'prop-types';\nimport { iconPropTypes } from '@scaleflex/icons/icon.prop-types';\nimport { intrinsicComponent } from '../../utils/functions';\nimport AccordionHeader from '../accordion-header';\nimport AccordionDetails from '../accordion-details';\nimport Styled from './accordion.styles';\nvar Accordion = intrinsicComponent(function (_ref, ref) {\n var label = _ref.label,\n expanded = _ref.expanded,\n children = _ref.children,\n detailStyle = _ref.detailStyle,\n headerStyle = _ref.headerStyle,\n fullWidth = _ref.fullWidth,\n iconPropsData = _ref.iconProps,\n _onClick = _ref.onClick,\n onChange = _ref.onChange,\n onContextMenu = _ref.onContextMenu,\n hideIcon = _ref.hideIcon,\n rest = _objectWithoutProperties(_ref, _excluded);\n return /*#__PURE__*/React.createElement(Styled.Accordion, _extends({\n ref: ref\n }, rest), /*#__PURE__*/React.createElement(AccordionHeader, {\n label: label,\n expanded: expanded,\n style: _objectSpread({}, headerStyle),\n hideIcon: hideIcon,\n onClick: function onClick(event) {\n if (typeof onChange === 'function') {\n onChange(!expanded, event);\n }\n if (typeof _onClick === 'function') {\n _onClick(event);\n }\n },\n onContextMenu: onContextMenu,\n iconProps: iconPropsData,\n fullWidth: fullWidth\n }), /*#__PURE__*/React.createElement(AccordionDetails, {\n expanded: expanded,\n style: _objectSpread({}, detailStyle)\n }, children));\n});\nAccordion.defaultProps = {\n expanded: false,\n hideIcon: false\n};\nAccordion.propTypes = {\n label: PT.node.isRequired,\n expanded: PT.bool,\n detailStyle: PT.object,\n headerStyle: PT.object,\n onChange: PT.func,\n onContextMenu: PT.func,\n hideIcon: PT.bool,\n fullWidth: PT.bool,\n iconProps: PT.exact(iconPropTypes)\n};\nexport default Accordion;","import _extends from \"@babel/runtime/helpers/extends\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/objectWithoutProperties\";\nvar _excluded = [\"stroke\", \"size\"];\nimport React from 'react';\nimport { intrinsicComponent } from './utils/functions';\nexport var Arrow = intrinsicComponent(function (_ref, ref) {\n var _ref$stroke = _ref.stroke,\n stroke = _ref$stroke === void 0 ? 'currentColor' : _ref$stroke,\n _ref$size = _ref.size,\n size = _ref$size === void 0 ? 10 : _ref$size,\n rest = _objectWithoutProperties(_ref, _excluded);\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n ref: ref,\n width: size * (51 / 56),\n height: size,\n viewBox: \"0 0 51 56\",\n fill: \"none\",\n xmlns: \"http://www.w3.org/2000/svg\"\n }, rest), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M12.2754 3L37.2754 27.0741L12.2754 53\",\n stroke: stroke,\n strokeWidth: \"5\",\n strokeLinecap: \"round\",\n strokeLinejoin: \"round\"\n }));\n});\nexport default Arrow;","import _extends from \"@babel/runtime/helpers/extends\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/objectWithoutProperties\";\nvar _excluded = [\"color\", \"size\"];\nimport React from 'react';\nimport { intrinsicComponent } from './utils/functions';\nexport var Tick = intrinsicComponent(function (_ref, ref) {\n var _ref$color = _ref.color,\n color = _ref$color === void 0 ? 'currentColor' : _ref$color,\n _ref$size = _ref.size,\n size = _ref$size === void 0 ? 14 : _ref$size,\n rest = _objectWithoutProperties(_ref, _excluded);\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n ref: ref,\n width: size,\n height: size,\n viewBox: \"0 0 14 14\",\n fill: \"none\",\n xmlns: \"http://www.w3.org/2000/svg\"\n }, rest), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M12.9783 2.30184C12.7972 2.12074 12.586 2 12.3143 2C12.0728 2 11.8314 2.09055 11.6503 2.30184L4.73816 9.84779L2.29327 7.34254C2.11217 7.16143 1.8707 7.07088 1.62923 7.07088C1.38776 7.07088 1.14629 7.19162 0.995367 7.37272C0.663345 7.76511 0.663345 8.36879 1.02555 8.73099L4.13448 11.9003C4.31559 12.0814 4.52687 12.1719 4.76835 12.1719C5.00982 12.1719 5.25129 12.0814 5.43239 11.8701L12.9783 3.62993C13.3406 3.2979 13.3406 2.66404 12.9783 2.30184Z\",\n fill: color\n }));\n});\nexport default Tick;","import _extends from \"@babel/runtime/helpers/extends\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/objectWithoutProperties\";\nvar _excluded = [\"color\", \"size\"];\nimport React from 'react';\nimport { intrinsicComponent } from './utils/functions';\nexport var CopyOutline = intrinsicComponent(function (_ref, ref) {\n var _ref$color = _ref.color,\n color = _ref$color === void 0 ? 'currentColor' : _ref$color,\n _ref$size = _ref.size,\n size = _ref$size === void 0 ? 14 : _ref$size,\n rest = _objectWithoutProperties(_ref, _excluded);\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n ref: ref,\n width: size,\n height: size,\n viewBox: \"0 0 16 16\",\n fill: \"none\",\n xmlns: \"http://www.w3.org/2000/svg\"\n }, rest), /*#__PURE__*/React.createElement(\"path\", {\n fillRule: \"evenodd\",\n clipRule: \"evenodd\",\n d: \"M2.33984 12.111V2.04761C2.33984 1.49532 2.78756 1.04761 3.33984 1.04761H10.8182C11.3705 1.04761 11.8182 1.49532 11.8182 2.04761V12.111C11.8182 12.6633 11.3705 13.111 10.8182 13.111H3.33984C2.78756 13.111 2.33984 12.6633 2.33984 12.111ZM3.33984 12.111V2.04761L10.8182 2.04761L10.8182 12.111L3.33984 12.111Z\",\n fill: color\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M13.66 4.97388C13.66 4.69774 13.4361 4.47388 13.16 4.47388C12.8838 4.47388 12.66 4.69774 12.66 4.97388V13.9523H5.40491C5.12876 13.9523 4.90491 14.1761 4.90491 14.4523C4.90491 14.7284 5.12876 14.9523 5.40491 14.9523H13.16C13.4361 14.9523 13.66 14.7284 13.66 14.4523V4.97388Z\",\n fill: color\n }));\n});\nexport default CopyOutline;","import _extends from \"@babel/runtime/helpers/extends\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/objectWithoutProperties\";\nvar _excluded = [\"color\", \"size\"];\nimport React from 'react';\nimport { intrinsicComponent } from './utils/functions';\nexport var EyeOpen = intrinsicComponent(function (_ref, ref) {\n var _ref$color = _ref.color,\n color = _ref$color === void 0 ? 'currentColor' : _ref$color,\n _ref$size = _ref.size,\n size = _ref$size === void 0 ? 14 : _ref$size,\n rest = _objectWithoutProperties(_ref, _excluded);\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n ref: ref,\n width: size,\n height: size,\n viewBox: \"0 0 50 32\",\n fill: \"none\",\n xmlns: \"http://www.w3.org/2000/svg\"\n }, rest), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M25 31.625C8.64336 31.625 0.533984 17.3656 0.196875 16.759C-0.065625 16.2867 -0.065625 15.7129 0.196875 15.2406C0.533984 14.6344 8.64336 0.375 25 0.375C41.3566 0.375 49.466 14.6344 49.8031 15.241C50.0656 15.7133 50.0656 16.2871 49.8031 16.7594C49.466 17.3656 41.3566 31.625 25 31.625ZM3.40117 15.9977C5.25977 18.8145 12.557 28.5 25 28.5C37.4824 28.5 44.7473 18.8223 46.5988 16.0023C44.7402 13.1855 37.443 3.5 25 3.5C12.5176 3.5 5.25273 13.1777 3.40117 15.9977ZM25 25.375C19.8305 25.375 15.625 21.1695 15.625 16C15.625 10.8305 19.8305 6.625 25 6.625C30.1695 6.625 34.375 10.8305 34.375 16C34.375 21.1695 30.1695 25.375 25 25.375ZM25 9.75C21.5539 9.75 18.75 12.5539 18.75 16C18.75 19.4461 21.5539 22.25 25 22.25C28.4461 22.25 31.25 19.4461 31.25 16C31.25 12.5539 28.4461 9.75 25 9.75Z\",\n fill: color\n }));\n});\nexport default EyeOpen;","import _extends from \"@babel/runtime/helpers/extends\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/objectWithoutProperties\";\nvar _excluded = [\"color\", \"size\"];\nimport React from 'react';\nimport { intrinsicComponent } from './utils/functions';\nexport var EyeClosed = intrinsicComponent(function (_ref, ref) {\n var _ref$color = _ref.color,\n color = _ref$color === void 0 ? 'currentColor' : _ref$color,\n _ref$size = _ref.size,\n size = _ref$size === void 0 ? 14 : _ref$size,\n rest = _objectWithoutProperties(_ref, _excluded);\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n ref: ref,\n width: size,\n height: size,\n viewBox: \"0 0 44 44\",\n fill: \"none\",\n xmlns: \"http://www.w3.org/2000/svg\"\n }, rest), /*#__PURE__*/React.createElement(\"path\", {\n fillRule: \"evenodd\",\n clipRule: \"evenodd\",\n d: \"M36.2553 6.05501C36.5966 5.71376 37.1514 5.71376 37.4926 6.05501C37.8339 6.39626 37.8339 6.95103 37.4926 7.29228L32.3765 12.4084C38.3601 15.8067 42.6046 20.7607 42.7917 20.9825C43.0682 21.3097 43.0699 21.7874 42.7936 22.113C42.3893 22.5908 32.7818 33.7978 22.0001 33.7978C18.9909 33.7978 15.9678 33.1203 13.0065 31.7785L7.74272 37.0423C7.57292 37.2121 7.34897 37.2978 7.12495 37.2978C6.90092 37.2978 6.67698 37.212 6.50545 37.0423C6.1642 36.701 6.1642 36.1462 6.50545 35.805L17.0426 25.2678C17.0453 25.265 17.0481 25.2622 17.0509 25.2595C17.0531 25.2573 17.0553 25.2551 17.0575 25.2529L25.7063 16.6041C25.7081 16.6023 25.7098 16.6005 25.7116 16.5987C25.7134 16.5969 25.7152 16.5952 25.717 16.5934L30.2895 12.0208C30.3028 12.0067 30.3164 11.9931 30.3304 11.9799L36.2553 6.05501ZM31.0895 13.6954L27.5301 17.2548C28.4835 18.476 28.9998 19.9721 28.9998 21.5478C28.9998 25.4083 25.8603 28.5478 21.9999 28.5478C20.4242 28.5478 18.9281 28.0314 17.7069 27.078L14.3353 30.4497C16.8728 31.5113 19.445 32.0478 22 32.0478C30.6537 32.0478 38.863 23.8071 40.9489 21.5478C39.6267 20.1195 35.855 16.3016 31.0895 13.6954ZM18.9574 25.8276C19.8392 26.458 20.8929 26.7977 21.9999 26.7977C24.8943 26.7977 27.2499 24.4422 27.2499 21.5477C27.2499 20.4409 26.9092 19.3873 26.2793 18.5056L18.9574 25.8276Z\",\n fill: color\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M27.7418 10.3057C25.7504 9.63545 23.8184 9.29773 22.0001 9.29773C11.2183 9.29773 1.61084 20.5047 1.20659 20.9825C0.951064 21.2835 0.930064 21.721 1.15762 22.0482C1.27837 22.2215 4.17111 26.3287 9.18485 29.659C9.33358 29.7587 9.49985 29.806 9.66785 29.806C9.94963 29.806 10.2279 29.6695 10.3959 29.4122C10.6636 29.0115 10.5534 28.4672 10.1509 28.2012C6.46889 25.753 3.94889 22.7973 3.00561 21.595C5.01989 19.4075 13.2834 11.0478 22.0001 11.0478C23.6293 11.0478 25.3741 11.3558 27.1835 11.963C27.642 12.1275 28.139 11.8738 28.2913 11.4135C28.4453 10.955 28.2003 10.4598 27.7418 10.3057Z\",\n fill: color\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M23.2197 14.6685C22.8224 14.5985 22.4164 14.5477 22 14.5477C18.1395 14.5477 15 17.6872 15 21.5477C15 21.9642 15.0508 22.3702 15.1225 22.7674C15.1977 23.1909 15.567 23.4902 15.9817 23.4902C16.0325 23.4902 16.0832 23.4867 16.1357 23.4762C16.6099 23.3922 16.9285 22.9371 16.8445 22.4629C16.7902 22.1654 16.75 21.8627 16.75 21.5477C16.75 18.6532 19.1055 16.2977 22 16.2977C22.315 16.2977 22.6177 16.338 22.9152 16.3905C23.3807 16.485 23.8444 16.1559 23.9284 15.6817C24.0124 15.2075 23.694 14.7525 23.2197 14.6685Z\",\n fill: color\n }));\n});\nexport default EyeClosed;","import { lightPalette } from '../../theme/roots/palette';\nimport { Color } from '../../utils/types/palette';\nexport var getInputBackgroundColor = function getInputBackgroundColor(readOnly, disabled) {\n if (readOnly || disabled) {\n return lightPalette[Color.BackgroundHover];\n }\n return lightPalette[Color.BackgroundStateless];\n};\nexport var getInputTextColor = function getInputTextColor(readOnly, disabled) {\n if (readOnly) {\n return lightPalette[Color.AccentPrimaryHover];\n }\n if (disabled) {\n return lightPalette[Color.TextPlaceholder];\n }\n return lightPalette[Color.TextPrimary];\n};\nexport var getInputBorderColor = function getInputBorderColor(readOnly, disabled) {\n if (readOnly) {\n return lightPalette[Color.BordersItem];\n }\n if (disabled) {\n return lightPalette[Color.BordersSecondary];\n }\n return lightPalette[Color.BorderPrimaryStateless];\n};\nexport var handleCopyIcon = function handleCopyIcon(value, setShowCopyMessage) {\n navigator.clipboard.writeText(value);\n setShowCopyMessage(true);\n};","export var Type = {\n Text: 'text',\n Password: 'password'\n};","import styled, { css } from 'styled-components';\nimport { generateClassNames, applyDisplayNames } from '../../utils/functions';\nimport { FontVariant as FV } from '../../utils/types/typography';\nimport { Color as PColor } from '../../utils/types/palette';\nimport { BorderRadiusSize as BRSize } from '../../utils/types/shape';\nimport { sizeInputMixin, fontSizeInputMixin, errorMixin } from './input.mixin';\nimport { InputSize } from '../../utils/types';\nimport { getInputBackgroundColor, getInputTextColor, getInputBorderColor } from './input.utils';\nvar baseClassName = 'Input';\nvar Icon = /*#__PURE__*/styled.span.attrs({\n className: generateClassNames(baseClassName, 'Icon')\n}).withConfig({\n componentId: \"sc-150k0cz-0\"\n})(function (_ref) {\n var iconClickStart = _ref.iconClickStart,\n iconClickEnd = _ref.iconClickEnd,\n disabled = _ref.disabled,\n readOnly = _ref.readOnly,\n iconType = _ref.iconType,\n palette = _ref.theme.palette;\n return css([\"display:flex;color:\", \";cursor:\", \";flex-shrink:0;\", \"\"], palette[PColor.IconsPrimary], (iconClickStart || iconClickEnd) && !disabled && !readOnly ? 'pointer' : 'default', iconType === 'end' && css([\"color:\", \";\"], palette[PColor.IconsSecondary]));\n});\nvar CopyIcon = /*#__PURE__*/styled.span.attrs({\n className: generateClassNames(baseClassName, 'CopyIcon')\n}).withConfig({\n componentId: \"sc-150k0cz-1\"\n})(function (_ref2) {\n var palette = _ref2.theme.palette;\n return css([\"display:flex;color:\", \";cursor:pointer;\"], palette[PColor.IconsSecondary]);\n});\nvar PasswordIcon = /*#__PURE__*/styled(CopyIcon).attrs({\n className: generateClassNames(baseClassName, 'PasswordIcon')\n}).withConfig({\n componentId: \"sc-150k0cz-2\"\n})([\"\"]);\nvar Container = /*#__PURE__*/styled.div.attrs({\n className: generateClassNames(baseClassName, 'Container')\n}).withConfig({\n componentId: \"sc-150k0cz-3\"\n})(function () {\n return css([\"display:block;color:inherit;font-size:inherit;width:100%;min-width:0;margin:0;padding:0;border:0;background-color:transparent;outline:none;\"]);\n});\nvar Base = /*#__PURE__*/styled.input.attrs({\n className: generateClassNames(baseClassName, 'Base')\n}).withConfig({\n componentId: \"sc-150k0cz-4\"\n})(function (_ref3) {\n var palette = _ref3.theme.palette,\n _ref3$isEllipsis = _ref3.isEllipsis,\n isEllipsis = _ref3$isEllipsis === void 0 ? false : _ref3$isEllipsis;\n return css([\"display:block;color:inherit;width:100%;min-width:fit-content;margin:0;padding:0;border:0;background-color:transparent;outline:none;\", \" &::placeholder{color:\", \";}\"], isEllipsis && css([\"text-overflow:ellipsis;\"]), palette[PColor.TextPlaceholder]);\n});\nvar Input = /*#__PURE__*/styled.div.attrs({\n className: generateClassNames(baseClassName, 'root')\n}).withConfig({\n componentId: \"sc-150k0cz-5\"\n})(function (_ref4) {\n var _ref4$size = _ref4.size,\n size = _ref4$size === void 0 ? InputSize.Md : _ref4$size,\n _ref4$error = _ref4.error,\n error = _ref4$error === void 0 ? false : _ref4$error,\n _ref4$fullWidth = _ref4.fullWidth,\n fullWidth = _ref4$fullWidth === void 0 ? false : _ref4$fullWidth,\n _ref4$readOnly = _ref4.readOnly,\n readOnly = _ref4$readOnly === void 0 ? false : _ref4$readOnly,\n _ref4$disabled = _ref4.disabled,\n disabled = _ref4$disabled === void 0 ? false : _ref4$disabled,\n _ref4$isHovering = _ref4.isHovering,\n isHovering = _ref4$isHovering === void 0 ? false : _ref4$isHovering,\n _ref4$isSelectedItems = _ref4.isSelectedItems,\n isSelectedItems = _ref4$isSelectedItems === void 0 ? false : _ref4$isSelectedItems,\n theme = _ref4.theme;\n return css([\"position:relative;display:inline-flex;align-items:center;box-sizing:border-box;column-gap:8px;cursor:text;transition:all 100ms ease-out;width:\", \";pointer-events:\", \";background-color:\", \";border-radius:\", \";border:1px solid \", \";color:\", \";\", \" \", \";\", \"{\", \"}\", \" \", \" &:hover{color:\", \";}\", \"\"], fullWidth ? '100%' : '300px', disabled ? 'none' : 'auto', getInputBackgroundColor(readOnly, disabled), theme.shape.borderRadius[BRSize.Md], getInputBorderColor(readOnly, disabled), disabled ? theme.palette[PColor.TextPlaceholder] : theme.palette[PColor.TextPrimary], sizeInputMixin[size], isSelectedItems && \"\\n height: fit-content;\\n\\n \".concat(Base, \" {\\n max-width: fit-content;\\n min-width: 20px;\\n flex-grow: 1;\\n width: 40px;\\n }\\n \"), Base, fontSizeInputMixin[size], !readOnly && !disabled && css([\"&:focus-within{background-color:\", \"!important;border:1px solid \", \";&:hover{border:1px solid \", \";\", \"{color:\", \";}}}\", \" &:hover{background-color:\", \";border:1px solid \", \";\", \"{color:\", \";}}\"], theme.palette[PColor.BackgroundSecondary], theme.palette[PColor.AccentStateless], theme.palette[PColor.AccentStateless], Icon, theme.palette[PColor.IconsPrimary], isHovering && css([\"\", \"{color:\", \";}\"], Icon, theme.palette[PColor.IconsPrimaryHover]), theme.palette[PColor.BackgroundStateless], theme.palette[PColor.BordersPrimaryHover], Icon, theme.palette[PColor.IconsPrimaryHover]), disabled && css([\"\", \"{color:\", \";}\"], Icon, theme.palette[PColor.IconsMuted]), getInputTextColor(readOnly, disabled), error && errorMixin);\n});\nvar ClearIcon = /*#__PURE__*/styled.span.attrs({\n className: generateClassNames(baseClassName, 'ClearIcon')\n}).withConfig({\n componentId: \"sc-150k0cz-6\"\n})(function (_ref5) {\n var palette = _ref5.theme.palette;\n return css([\"display:flex;cursor:pointer;color:\", \";\"], palette[PColor.IconsPrimary]);\n});\nvar NotificationBox = /*#__PURE__*/styled.div.attrs({\n className: generateClassNames(baseClassName, 'NotificationBox')\n}).withConfig({\n componentId: \"sc-150k0cz-7\"\n})(function (_ref6) {\n var _ref6$size = _ref6.size,\n size = _ref6$size === void 0 ? InputSize.Md : _ref6$size,\n _ref6$isTextarea = _ref6.isTextarea,\n isTextarea = _ref6$isTextarea === void 0 ? false : _ref6$isTextarea,\n palette = _ref6.theme.palette;\n return css([\"display:flex;position:absolute;align-items:center;max-height:34px;right:0px;padding:8px 12px;gap:6px;bottom:\", \";box-shadow:0px 2px 6px \", \";background-color:\", \";border-radius:4px;align-items:center;\", \"\"], size === InputSize.Md ? '45px' : '35px', palette[PColor.LargeShadow], palette[PColor.BackgroundStateless], isTextarea && \"\\n bottom: \".concat(size === InputSize.Md ? 27 : 22, \"px;\\n right: \").concat(size === InputSize.Md ? 16 : 12, \"px;\\n \"));\n});\nvar NotificationIcon = /*#__PURE__*/styled.span.attrs({\n className: generateClassNames(baseClassName, 'NotificationIcon')\n}).withConfig({\n componentId: \"sc-150k0cz-8\"\n})(function (_ref7) {\n var palette = _ref7.theme.palette;\n return css([\"display:flex;color:\", \";\"], palette[PColor.IconsPrimary]);\n});\nvar NotificationText = /*#__PURE__*/styled.span.attrs({\n className: generateClassNames(baseClassName, 'NotificationText')\n}).withConfig({\n componentId: \"sc-150k0cz-9\"\n})(function (_ref8) {\n var _ref8$theme = _ref8.theme,\n palette = _ref8$theme.palette,\n font = _ref8$theme.typography.font;\n return css([\"display:flex;white-space:nowrap;\", \";color:\", \";\"], font[FV.TextSmall], palette[PColor.TextPrimary]);\n});\nvar FieldWrapper = /*#__PURE__*/styled.div.attrs({\n className: generateClassNames(baseClassName, 'fieldWrapper')\n}).withConfig({\n componentId: \"sc-150k0cz-10\"\n})(function (_ref9) {\n var isSelectedItems = _ref9.isSelectedItems;\n return css([\"width:100%;height:100%;display:inline-flex;flex-wrap:wrap;gap:8px;max-height:120px;\", \";::-webkit-scrollbar{display:none;}\"], isSelectedItems && \"\\n overflow-y: auto;\\n \");\n});\nvar Styled = applyDisplayNames({\n Input: Input,\n Container: Container,\n Base: Base,\n Icon: Icon,\n CopyIcon: CopyIcon,\n PasswordIcon: PasswordIcon,\n ClearIcon: ClearIcon,\n NotificationBox: NotificationBox,\n NotificationIcon: NotificationIcon,\n NotificationText: NotificationText,\n FieldWrapper: FieldWrapper\n});\nexport default Styled;","import _extends from \"@babel/runtime/helpers/extends\";\nimport _slicedToArray from \"@babel/runtime/helpers/slicedToArray\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/objectWithoutProperties\";\nvar _excluded = [\"inputType\", \"children\", \"iconStart\", \"iconEnd\", \"iconChange\", \"clearIcon\", \"iconClickStart\", \"iconClickEnd\", \"clearIconClick\", \"size\", \"className\", \"style\", \"fullWidth\", \"readOnly\", \"disabled\", \"hideCopyIcon\", \"focusOnMount\", \"focusOnClick\", \"isEllipsis\", \"copyTextMessage\", \"copySuccessIcon\", \"error\", \"renderTags\", \"showPlaceholder\"];\nimport React, { useState, useRef, useEffect } from 'react';\nimport PT from 'prop-types';\nimport CopyOutline from '@scaleflex/icons/copy-outline';\nimport EyeOpen from '@scaleflex/icons/eye-open';\nimport EyeClosed from '@scaleflex/icons/eye-closed';\nimport { intrinsicComponent, objectValues } from '../../utils/functions';\nimport { InputSize } from '../../utils/types';\nimport { handleCopyIcon } from './input.utils';\nimport { Type } from './types';\nimport Styled from './input.styles';\nvar getIconSize = function getIconSize(sizeName, iconType) {\n switch (sizeName) {\n case InputSize.Md:\n return iconType === 'start' ? 15 : 14;\n case InputSize.Sm:\n default:\n return iconType === 'start' ? 13 : 10;\n }\n};\nvar getPasswordIconSize = function getPasswordIconSize(sizeName) {\n switch (sizeName) {\n case InputSize.Md:\n return 16;\n case InputSize.Sm:\n default:\n return 14;\n }\n};\nvar Input = intrinsicComponent(function (_ref, ref) {\n var _rest$selectedItems;\n var inputType = _ref.inputType,\n children = _ref.children,\n iconStart = _ref.iconStart,\n iconEnd = _ref.iconEnd,\n iconChange = _ref.iconChange,\n clearIcon = _ref.clearIcon,\n iconClickStart = _ref.iconClickStart,\n iconClickEnd = _ref.iconClickEnd,\n clearIconClick = _ref.clearIconClick,\n _ref$size = _ref.size,\n size = _ref$size === void 0 ? InputSize.Md : _ref$size,\n className = _ref.className,\n style = _ref.style,\n fullWidth = _ref.fullWidth,\n readOnly = _ref.readOnly,\n disabled = _ref.disabled,\n _ref$hideCopyIcon = _ref.hideCopyIcon,\n hideCopyIcon = _ref$hideCopyIcon === void 0 ? false : _ref$hideCopyIcon,\n _ref$focusOnMount = _ref.focusOnMount,\n focusOnMount = _ref$focusOnMount === void 0 ? false : _ref$focusOnMount,\n _ref$focusOnClick = _ref.focusOnClick,\n focusOnClick = _ref$focusOnClick === void 0 ? true : _ref$focusOnClick,\n _ref$isEllipsis = _ref.isEllipsis,\n isEllipsis = _ref$isEllipsis === void 0 ? false : _ref$isEllipsis,\n copyTextMessage = _ref.copyTextMessage,\n copySuccessIcon = _ref.copySuccessIcon,\n error = _ref.error,\n renderTags = _ref.renderTags,\n showPlaceholder = _ref.showPlaceholder,\n rest = _objectWithoutProperties(_ref, _excluded);\n var _useState = useState(false),\n _useState2 = _slicedToArray(_useState, 2),\n isHovering = _useState2[0],\n setIsHovering = _useState2[1];\n var _useState3 = useState(false),\n _useState4 = _slicedToArray(_useState3, 2),\n showCopyMessage = _useState4[0],\n setShowCopyMessage = _useState4[1];\n var _useState5 = useState(false),\n _useState6 = _slicedToArray(_useState5, 2),\n isVisible = _useState6[0],\n setIsVisible = _useState6[1];\n var inputRef = useRef(null);\n var isSelectedItems = (_rest$selectedItems = rest.selectedItems) === null || _rest$selectedItems === void 0 ? void 0 : _rest$selectedItems.length;\n var placeholder = rest.value || isSelectedItems ? '' : rest.placeholder;\n var showCopyIcon = isHovering && readOnly && rest.value.length > 0 && !hideCopyIcon;\n var handleFocus = function handleFocus() {\n var _inputRef$current;\n if (disabled || readOnly) return;\n showPlaceholder === null || showPlaceholder === void 0 || showPlaceholder(false);\n (_inputRef$current = inputRef.current) === null || _inputRef$current === void 0 || _inputRef$current.focus();\n };\n useEffect(function () {\n if (focusOnMount) {\n handleFocus();\n }\n }, []);\n useEffect(function () {\n setTimeout(function () {\n return setShowCopyMessage(false);\n }, 2000);\n }, [showCopyMessage]);\n var handleEntering = function handleEntering() {\n setTimeout(function () {\n setIsHovering(true);\n }, 150);\n };\n var handleLeaving = function handleLeaving() {\n setTimeout(function () {\n setIsHovering(false);\n }, 200);\n };\n var handleIconClick = function handleIconClick(event, type) {\n if (disabled || readOnly) return;\n if (focusOnClick) {\n handleFocus();\n }\n if (type === 'start') {\n if (iconClickStart) {\n iconClickStart(event);\n }\n } else if (type === 'end') {\n if (iconClickEnd) {\n iconClickEnd(event);\n }\n } else if (clearIconClick) {\n clearIconClick(event);\n }\n };\n var renderIcon = function renderIcon(_icon, type) {\n return _icon ? /*#__PURE__*/React.createElement(Styled.Icon, {\n onClick: function onClick(event) {\n return handleIconClick(event, type);\n },\n iconClickStart: iconClickStart,\n iconClickEnd: iconClickEnd,\n iconType: type,\n disabled: disabled,\n readOnly: readOnly\n }, typeof _icon === 'function' ? _icon({\n size: getIconSize(size, type)\n }) : _icon) : undefined;\n };\n var renderClearIcon = function renderClearIcon() {\n return disabled || readOnly || !clearIcon ? undefined : /*#__PURE__*/React.createElement(Styled.ClearIcon, {\n onClick: function onClick(event) {\n return handleIconClick(event, 'clear');\n }\n }, typeof clearIcon === 'function' ? clearIcon({\n size: getIconSize(size, 'clear')\n }) : clearIcon);\n };\n var renderCopyIcon = function renderCopyIcon(icon) {\n return showCopyIcon ? /*#__PURE__*/React.createElement(Styled.CopyIcon, {\n onClick: function onClick() {\n return handleCopyIcon(rest.value, setShowCopyMessage);\n }\n }, typeof icon === 'function' ? icon() : icon) : undefined;\n };\n var toggleVisibility = function toggleVisibility(event) {\n event.stopPropagation();\n setIsVisible(!isVisible);\n };\n var renderPasswordIcon = function renderPasswordIcon() {\n return /*#__PURE__*/React.createElement(Styled.PasswordIcon, {\n onClick: function onClick(event) {\n return toggleVisibility(event);\n }\n }, isVisible ? /*#__PURE__*/React.createElement(EyeClosed, {\n size: getPasswordIconSize(size)\n }) : /*#__PURE__*/React.createElement(EyeOpen, {\n size: getPasswordIconSize(size)\n }));\n };\n var getInputType = function getInputType() {\n if (!inputType && rest !== null && rest !== void 0 && rest.type) {\n return rest === null || rest === void 0 ? void 0 : rest.type;\n }\n if (inputType === Type.Password && !isVisible) {\n return Type.Password;\n }\n return Type.Text;\n };\n var renderField = function renderField() {\n return /*#__PURE__*/React.createElement(Styled.FieldWrapper, {\n isSelectedItems: Boolean(isSelectedItems)\n }, renderTags && renderTags(), /*#__PURE__*/React.createElement(Styled.Base, _extends({}, rest, {\n placeholder: placeholder,\n ref: inputRef,\n readOnly: Boolean(readOnly),\n type: getInputType(),\n isEllipsis: isEllipsis\n })));\n };\n var renderCopyText = function renderCopyText() {\n return /*#__PURE__*/React.createElement(Styled.NotificationBox, {\n size: size\n }, /*#__PURE__*/React.createElement(Styled.NotificationIcon, null, copySuccessIcon), /*#__PURE__*/React.createElement(Styled.NotificationText, null, copyTextMessage));\n };\n return /*#__PURE__*/React.createElement(Styled.Input, {\n onClick: focusOnClick ? handleFocus : undefined,\n ref: ref,\n size: size,\n onMouseEnter: handleEntering,\n onMouseLeave: handleLeaving,\n className: className,\n style: style,\n readOnly: readOnly,\n disabled: disabled,\n fullWidth: Boolean(fullWidth),\n error: error,\n clearIcon: clearIcon,\n isHovering: rest.isHovering,\n isSelectedItems: Boolean(isSelectedItems)\n }, renderIcon(iconStart, 'start'), renderField(), renderCopyIcon( /*#__PURE__*/React.createElement(CopyOutline, {\n size: getIconSize(size, 'copy')\n })), showCopyMessage && renderCopyText(), renderClearIcon(), inputType === Type.Password && renderPasswordIcon(), renderIcon(iconEnd, 'end'), renderIcon(iconChange, ''), children && /*#__PURE__*/React.createElement(React.Fragment, null, children));\n});\nexport var defaultProps = {\n size: InputSize.Md,\n error: false,\n fullWidth: false,\n readOnly: false,\n disabled: false,\n copyTextMessage: 'Copied!'\n};\nInput.defaultProps = defaultProps;\nexport var propTypes = {\n size: PT.oneOf(objectValues(InputSize)),\n iconStart: PT.oneOfType([PT.node, PT.func]),\n iconEnd: PT.oneOfType([PT.node, PT.func]),\n iconChange: PT.oneOfType([PT.node, PT.func]),\n copySuccessIcon: PT.oneOfType([PT.node, PT.func]),\n clearIcon: PT.oneOfType([PT.node, PT.func]),\n error: PT.bool,\n fullWidth: PT.bool,\n value: PT.any,\n readOnly: PT.bool,\n disabled: PT.bool,\n iconClickStart: PT.func,\n showPlaceholder: PT.func,\n iconClickEnd: PT.func,\n clearIconClick: PT.func,\n focusOnMount: PT.bool,\n focusOnClick: PT.bool,\n copyTextMessage: PT.string,\n inputType: PT.string,\n renderTags: PT.func\n};\nInput.propTypes = propTypes;\nexport default Input;","export var top = 'top';\nexport var bottom = 'bottom';\nexport var right = 'right';\nexport var left = 'left';\nexport var auto = 'auto';\nexport var basePlacements = [top, bottom, right, left];\nexport var start = 'start';\nexport var end = 'end';\nexport var clippingParents = 'clippingParents';\nexport var viewport = 'viewport';\nexport var popper = 'popper';\nexport var reference = 'reference';\nexport var variationPlacements = /*#__PURE__*/basePlacements.reduce(function (acc, placement) {\n return acc.concat([placement + \"-\" + start, placement + \"-\" + end]);\n}, []);\nexport var placements = /*#__PURE__*/[].concat(basePlacements, [auto]).reduce(function (acc, placement) {\n return acc.concat([placement, placement + \"-\" + start, placement + \"-\" + end]);\n}, []); // modifiers that need to read the DOM\n\nexport var beforeRead = 'beforeRead';\nexport var read = 'read';\nexport var afterRead = 'afterRead'; // pure-logic modifiers\n\nexport var beforeMain = 'beforeMain';\nexport var main = 'main';\nexport var afterMain = 'afterMain'; // modifier with the purpose to write to the DOM (or write into a framework state)\n\nexport var beforeWrite = 'beforeWrite';\nexport var write = 'write';\nexport var afterWrite = 'afterWrite';\nexport var modifierPhases = [beforeRead, read, afterRead, beforeMain, main, afterMain, beforeWrite, write, afterWrite];","export default function getNodeName(element) {\n return element ? (element.nodeName || '').toLowerCase() : null;\n}","export default function getWindow(node) {\n if (node == null) {\n return window;\n }\n\n if (node.toString() !== '[object Window]') {\n var ownerDocument = node.ownerDocument;\n return ownerDocument ? ownerDocument.defaultView || window : window;\n }\n\n return node;\n}","import getWindow from \"./getWindow.js\";\n\nfunction isElement(node) {\n var OwnElement = getWindow(node).Element;\n return node instanceof OwnElement || node instanceof Element;\n}\n\nfunction isHTMLElement(node) {\n var OwnElement = getWindow(node).HTMLElement;\n return node instanceof OwnElement || node instanceof HTMLElement;\n}\n\nfunction isShadowRoot(node) {\n // IE 11 has no ShadowRoot\n if (typeof ShadowRoot === 'undefined') {\n return false;\n }\n\n var OwnElement = getWindow(node).ShadowRoot;\n return node instanceof OwnElement || node instanceof ShadowRoot;\n}\n\nexport { isElement, isHTMLElement, isShadowRoot };","import getNodeName from \"../dom-utils/getNodeName.js\";\nimport { isHTMLElement } from \"../dom-utils/instanceOf.js\"; // This modifier takes the styles prepared by the `computeStyles` modifier\n// and applies them to the HTMLElements such as popper and arrow\n\nfunction applyStyles(_ref) {\n var state = _ref.state;\n Object.keys(state.elements).forEach(function (name) {\n var style = state.styles[name] || {};\n var attributes = state.attributes[name] || {};\n var element = state.elements[name]; // arrow is optional + virtual elements\n\n if (!isHTMLElement(element) || !getNodeName(element)) {\n return;\n } // Flow doesn't support to extend this property, but it's the most\n // effective way to apply styles to an HTMLElement\n // $FlowFixMe[cannot-write]\n\n\n Object.assign(element.style, style);\n Object.keys(attributes).forEach(function (name) {\n var value = attributes[name];\n\n if (value === false) {\n element.removeAttribute(name);\n } else {\n element.setAttribute(name, value === true ? '' : value);\n }\n });\n });\n}\n\nfunction effect(_ref2) {\n var state = _ref2.state;\n var initialStyles = {\n popper: {\n position: state.options.strategy,\n left: '0',\n top: '0',\n margin: '0'\n },\n arrow: {\n position: 'absolute'\n },\n reference: {}\n };\n Object.assign(state.elements.popper.style, initialStyles.popper);\n state.styles = initialStyles;\n\n if (state.elements.arrow) {\n Object.assign(state.elements.arrow.style, initialStyles.arrow);\n }\n\n return function () {\n Object.keys(state.elements).forEach(function (name) {\n var element = state.elements[name];\n var attributes = state.attributes[name] || {};\n var styleProperties = Object.keys(state.styles.hasOwnProperty(name) ? state.styles[name] : initialStyles[name]); // Set all values to an empty string to unset them\n\n var style = styleProperties.reduce(function (style, property) {\n style[property] = '';\n return style;\n }, {}); // arrow is optional + virtual elements\n\n if (!isHTMLElement(element) || !getNodeName(element)) {\n return;\n }\n\n Object.assign(element.style, style);\n Object.keys(attributes).forEach(function (attribute) {\n element.removeAttribute(attribute);\n });\n });\n };\n} // eslint-disable-next-line import/no-unused-modules\n\n\nexport default {\n name: 'applyStyles',\n enabled: true,\n phase: 'write',\n fn: applyStyles,\n effect: effect,\n requires: ['computeStyles']\n};","import { auto } from \"../enums.js\";\nexport default function getBasePlacement(placement) {\n return placement.split('-')[0];\n}","export var max = Math.max;\nexport var min = Math.min;\nexport var round = Math.round;","export default function getUAString() {\n var uaData = navigator.userAgentData;\n\n if (uaData != null && uaData.brands && Array.isArray(uaData.brands)) {\n return uaData.brands.map(function (item) {\n return item.brand + \"/\" + item.version;\n }).join(' ');\n }\n\n return navigator.userAgent;\n}","import getUAString from \"../utils/userAgent.js\";\nexport default function isLayoutViewport() {\n return !/^((?!chrome|android).)*safari/i.test(getUAString());\n}","import { isElement, isHTMLElement } from \"./instanceOf.js\";\nimport { round } from \"../utils/math.js\";\nimport getWindow from \"./getWindow.js\";\nimport isLayoutViewport from \"./isLayoutViewport.js\";\nexport default function getBoundingClientRect(element, includeScale, isFixedStrategy) {\n if (includeScale === void 0) {\n includeScale = false;\n }\n\n if (isFixedStrategy === void 0) {\n isFixedStrategy = false;\n }\n\n var clientRect = element.getBoundingClientRect();\n var scaleX = 1;\n var scaleY = 1;\n\n if (includeScale && isHTMLElement(element)) {\n scaleX = element.offsetWidth > 0 ? round(clientRect.width) / element.offsetWidth || 1 : 1;\n scaleY = element.offsetHeight > 0 ? round(clientRect.height) / element.offsetHeight || 1 : 1;\n }\n\n var _ref = isElement(element) ? getWindow(element) : window,\n visualViewport = _ref.visualViewport;\n\n var addVisualOffsets = !isLayoutViewport() && isFixedStrategy;\n var x = (clientRect.left + (addVisualOffsets && visualViewport ? visualViewport.offsetLeft : 0)) / scaleX;\n var y = (clientRect.top + (addVisualOffsets && visualViewport ? visualViewport.offsetTop : 0)) / scaleY;\n var width = clientRect.width / scaleX;\n var height = clientRect.height / scaleY;\n return {\n width: width,\n height: height,\n top: y,\n right: x + width,\n bottom: y + height,\n left: x,\n x: x,\n y: y\n };\n}","import getBoundingClientRect from \"./getBoundingClientRect.js\"; // Returns the layout rect of an element relative to its offsetParent. Layout\n// means it doesn't take into account transforms.\n\nexport default function getLayoutRect(element) {\n var clientRect = getBoundingClientRect(element); // Use the clientRect sizes if it's not been transformed.\n // Fixes https://github.com/popperjs/popper-core/issues/1223\n\n var width = element.offsetWidth;\n var height = element.offsetHeight;\n\n if (Math.abs(clientRect.width - width) <= 1) {\n width = clientRect.width;\n }\n\n if (Math.abs(clientRect.height - height) <= 1) {\n height = clientRect.height;\n }\n\n return {\n x: element.offsetLeft,\n y: element.offsetTop,\n width: width,\n height: height\n };\n}","import { isShadowRoot } from \"./instanceOf.js\";\nexport default function contains(parent, child) {\n var rootNode = child.getRootNode && child.getRootNode(); // First, attempt with faster native method\n\n if (parent.contains(child)) {\n return true;\n } // then fallback to custom implementation with Shadow DOM support\n else if (rootNode && isShadowRoot(rootNode)) {\n var next = child;\n\n do {\n if (next && parent.isSameNode(next)) {\n return true;\n } // $FlowFixMe[prop-missing]: need a better way to handle this...\n\n\n next = next.parentNode || next.host;\n } while (next);\n } // Give up, the result is false\n\n\n return false;\n}","import getWindow from \"./getWindow.js\";\nexport default function getComputedStyle(element) {\n return getWindow(element).getComputedStyle(element);\n}","import getNodeName from \"./getNodeName.js\";\nexport default function isTableElement(element) {\n return ['table', 'td', 'th'].indexOf(getNodeName(element)) >= 0;\n}","import { isElement } from \"./instanceOf.js\";\nexport default function getDocumentElement(element) {\n // $FlowFixMe[incompatible-return]: assume body is always available\n return ((isElement(element) ? element.ownerDocument : // $FlowFixMe[prop-missing]\n element.document) || window.document).documentElement;\n}","import getNodeName from \"./getNodeName.js\";\nimport getDocumentElement from \"./getDocumentElement.js\";\nimport { isShadowRoot } from \"./instanceOf.js\";\nexport default function getParentNode(element) {\n if (getNodeName(element) === 'html') {\n return element;\n }\n\n return (// this is a quicker (but less type safe) way to save quite some bytes from the bundle\n // $FlowFixMe[incompatible-return]\n // $FlowFixMe[prop-missing]\n element.assignedSlot || // step into the shadow DOM of the parent of a slotted node\n element.parentNode || ( // DOM Element detected\n isShadowRoot(element) ? element.host : null) || // ShadowRoot detected\n // $FlowFixMe[incompatible-call]: HTMLElement is a Node\n getDocumentElement(element) // fallback\n\n );\n}","import getWindow from \"./getWindow.js\";\nimport getNodeName from \"./getNodeName.js\";\nimport getComputedStyle from \"./getComputedStyle.js\";\nimport { isHTMLElement, isShadowRoot } from \"./instanceOf.js\";\nimport isTableElement from \"./isTableElement.js\";\nimport getParentNode from \"./getParentNode.js\";\nimport getUAString from \"../utils/userAgent.js\";\n\nfunction getTrueOffsetParent(element) {\n if (!isHTMLElement(element) || // https://github.com/popperjs/popper-core/issues/837\n getComputedStyle(element).position === 'fixed') {\n return null;\n }\n\n return element.offsetParent;\n} // `.offsetParent` reports `null` for fixed elements, while absolute elements\n// return the containing block\n\n\nfunction getContainingBlock(element) {\n var isFirefox = /firefox/i.test(getUAString());\n var isIE = /Trident/i.test(getUAString());\n\n if (isIE && isHTMLElement(element)) {\n // In IE 9, 10 and 11 fixed elements containing block is always established by the viewport\n var elementCss = getComputedStyle(element);\n\n if (elementCss.position === 'fixed') {\n return null;\n }\n }\n\n var currentNode = getParentNode(element);\n\n if (isShadowRoot(currentNode)) {\n currentNode = currentNode.host;\n }\n\n while (isHTMLElement(currentNode) && ['html', 'body'].indexOf(getNodeName(currentNode)) < 0) {\n var css = getComputedStyle(currentNode); // This is non-exhaustive but covers the most common CSS properties that\n // create a containing block.\n // https://developer.mozilla.org/en-US/docs/Web/CSS/Containing_block#identifying_the_containing_block\n\n if (css.transform !== 'none' || css.perspective !== 'none' || css.contain === 'paint' || ['transform', 'perspective'].indexOf(css.willChange) !== -1 || isFirefox && css.willChange === 'filter' || isFirefox && css.filter && css.filter !== 'none') {\n return currentNode;\n } else {\n currentNode = currentNode.parentNode;\n }\n }\n\n return null;\n} // Gets the closest ancestor positioned element. Handles some edge cases,\n// such as table ancestors and cross browser bugs.\n\n\nexport default function getOffsetParent(element) {\n var window = getWindow(element);\n var offsetParent = getTrueOffsetParent(element);\n\n while (offsetParent && isTableElement(offsetParent) && getComputedStyle(offsetParent).position === 'static') {\n offsetParent = getTrueOffsetParent(offsetParent);\n }\n\n if (offsetParent && (getNodeName(offsetParent) === 'html' || getNodeName(offsetParent) === 'body' && getComputedStyle(offsetParent).position === 'static')) {\n return window;\n }\n\n return offsetParent || getContainingBlock(element) || window;\n}","export default function getMainAxisFromPlacement(placement) {\n return ['top', 'bottom'].indexOf(placement) >= 0 ? 'x' : 'y';\n}","import { max as mathMax, min as mathMin } from \"./math.js\";\nexport function within(min, value, max) {\n return mathMax(min, mathMin(value, max));\n}\nexport function withinMaxClamp(min, value, max) {\n var v = within(min, value, max);\n return v > max ? max : v;\n}","export default function getFreshSideObject() {\n return {\n top: 0,\n right: 0,\n bottom: 0,\n left: 0\n };\n}","import getFreshSideObject from \"./getFreshSideObject.js\";\nexport default function mergePaddingObject(paddingObject) {\n return Object.assign({}, getFreshSideObject(), paddingObject);\n}","export default function expandToHashMap(value, keys) {\n return keys.reduce(function (hashMap, key) {\n hashMap[key] = value;\n return hashMap;\n }, {});\n}","import getBasePlacement from \"../utils/getBasePlacement.js\";\nimport getLayoutRect from \"../dom-utils/getLayoutRect.js\";\nimport contains from \"../dom-utils/contains.js\";\nimport getOffsetParent from \"../dom-utils/getOffsetParent.js\";\nimport getMainAxisFromPlacement from \"../utils/getMainAxisFromPlacement.js\";\nimport { within } from \"../utils/within.js\";\nimport mergePaddingObject from \"../utils/mergePaddingObject.js\";\nimport expandToHashMap from \"../utils/expandToHashMap.js\";\nimport { left, right, basePlacements, top, bottom } from \"../enums.js\"; // eslint-disable-next-line import/no-unused-modules\n\nvar toPaddingObject = function toPaddingObject(padding, state) {\n padding = typeof padding === 'function' ? padding(Object.assign({}, state.rects, {\n placement: state.placement\n })) : padding;\n return mergePaddingObject(typeof padding !== 'number' ? padding : expandToHashMap(padding, basePlacements));\n};\n\nfunction arrow(_ref) {\n var _state$modifiersData$;\n\n var state = _ref.state,\n name = _ref.name,\n options = _ref.options;\n var arrowElement = state.elements.arrow;\n var popperOffsets = state.modifiersData.popperOffsets;\n var basePlacement = getBasePlacement(state.placement);\n var axis = getMainAxisFromPlacement(basePlacement);\n var isVertical = [left, right].indexOf(basePlacement) >= 0;\n var len = isVertical ? 'height' : 'width';\n\n if (!arrowElement || !popperOffsets) {\n return;\n }\n\n var paddingObject = toPaddingObject(options.padding, state);\n var arrowRect = getLayoutRect(arrowElement);\n var minProp = axis === 'y' ? top : left;\n var maxProp = axis === 'y' ? bottom : right;\n var endDiff = state.rects.reference[len] + state.rects.reference[axis] - popperOffsets[axis] - state.rects.popper[len];\n var startDiff = popperOffsets[axis] - state.rects.reference[axis];\n var arrowOffsetParent = getOffsetParent(arrowElement);\n var clientSize = arrowOffsetParent ? axis === 'y' ? arrowOffsetParent.clientHeight || 0 : arrowOffsetParent.clientWidth || 0 : 0;\n var centerToReference = endDiff / 2 - startDiff / 2; // Make sure the arrow doesn't overflow the popper if the center point is\n // outside of the popper bounds\n\n var min = paddingObject[minProp];\n var max = clientSize - arrowRect[len] - paddingObject[maxProp];\n var center = clientSize / 2 - arrowRect[len] / 2 + centerToReference;\n var offset = within(min, center, max); // Prevents breaking syntax highlighting...\n\n var axisProp = axis;\n state.modifiersData[name] = (_state$modifiersData$ = {}, _state$modifiersData$[axisProp] = offset, _state$modifiersData$.centerOffset = offset - center, _state$modifiersData$);\n}\n\nfunction effect(_ref2) {\n var state = _ref2.state,\n options = _ref2.options;\n var _options$element = options.element,\n arrowElement = _options$element === void 0 ? '[data-popper-arrow]' : _options$element;\n\n if (arrowElement == null) {\n return;\n } // CSS selector\n\n\n if (typeof arrowElement === 'string') {\n arrowElement = state.elements.popper.querySelector(arrowElement);\n\n if (!arrowElement) {\n return;\n }\n }\n\n if (!contains(state.elements.popper, arrowElement)) {\n return;\n }\n\n state.elements.arrow = arrowElement;\n} // eslint-disable-next-line import/no-unused-modules\n\n\nexport default {\n name: 'arrow',\n enabled: true,\n phase: 'main',\n fn: arrow,\n effect: effect,\n requires: ['popperOffsets'],\n requiresIfExists: ['preventOverflow']\n};","export default function getVariation(placement) {\n return placement.split('-')[1];\n}","import { top, left, right, bottom, end } from \"../enums.js\";\nimport getOffsetParent from \"../dom-utils/getOffsetParent.js\";\nimport getWindow from \"../dom-utils/getWindow.js\";\nimport getDocumentElement from \"../dom-utils/getDocumentElement.js\";\nimport getComputedStyle from \"../dom-utils/getComputedStyle.js\";\nimport getBasePlacement from \"../utils/getBasePlacement.js\";\nimport getVariation from \"../utils/getVariation.js\";\nimport { round } from \"../utils/math.js\"; // eslint-disable-next-line import/no-unused-modules\n\nvar unsetSides = {\n top: 'auto',\n right: 'auto',\n bottom: 'auto',\n left: 'auto'\n}; // Round the offsets to the nearest suitable subpixel based on the DPR.\n// Zooming can change the DPR, but it seems to report a value that will\n// cleanly divide the values into the appropriate subpixels.\n\nfunction roundOffsetsByDPR(_ref, win) {\n var x = _ref.x,\n y = _ref.y;\n var dpr = win.devicePixelRatio || 1;\n return {\n x: round(x * dpr) / dpr || 0,\n y: round(y * dpr) / dpr || 0\n };\n}\n\nexport function mapToStyles(_ref2) {\n var _Object$assign2;\n\n var popper = _ref2.popper,\n popperRect = _ref2.popperRect,\n placement = _ref2.placement,\n variation = _ref2.variation,\n offsets = _ref2.offsets,\n position = _ref2.position,\n gpuAcceleration = _ref2.gpuAcceleration,\n adaptive = _ref2.adaptive,\n roundOffsets = _ref2.roundOffsets,\n isFixed = _ref2.isFixed;\n var _offsets$x = offsets.x,\n x = _offsets$x === void 0 ? 0 : _offsets$x,\n _offsets$y = offsets.y,\n y = _offsets$y === void 0 ? 0 : _offsets$y;\n\n var _ref3 = typeof roundOffsets === 'function' ? roundOffsets({\n x: x,\n y: y\n }) : {\n x: x,\n y: y\n };\n\n x = _ref3.x;\n y = _ref3.y;\n var hasX = offsets.hasOwnProperty('x');\n var hasY = offsets.hasOwnProperty('y');\n var sideX = left;\n var sideY = top;\n var win = window;\n\n if (adaptive) {\n var offsetParent = getOffsetParent(popper);\n var heightProp = 'clientHeight';\n var widthProp = 'clientWidth';\n\n if (offsetParent === getWindow(popper)) {\n offsetParent = getDocumentElement(popper);\n\n if (getComputedStyle(offsetParent).position !== 'static' && position === 'absolute') {\n heightProp = 'scrollHeight';\n widthProp = 'scrollWidth';\n }\n } // $FlowFixMe[incompatible-cast]: force type refinement, we compare offsetParent with window above, but Flow doesn't detect it\n\n\n offsetParent = offsetParent;\n\n if (placement === top || (placement === left || placement === right) && variation === end) {\n sideY = bottom;\n var offsetY = isFixed && offsetParent === win && win.visualViewport ? win.visualViewport.height : // $FlowFixMe[prop-missing]\n offsetParent[heightProp];\n y -= offsetY - popperRect.height;\n y *= gpuAcceleration ? 1 : -1;\n }\n\n if (placement === left || (placement === top || placement === bottom) && variation === end) {\n sideX = right;\n var offsetX = isFixed && offsetParent === win && win.visualViewport ? win.visualViewport.width : // $FlowFixMe[prop-missing]\n offsetParent[widthProp];\n x -= offsetX - popperRect.width;\n x *= gpuAcceleration ? 1 : -1;\n }\n }\n\n var commonStyles = Object.assign({\n position: position\n }, adaptive && unsetSides);\n\n var _ref4 = roundOffsets === true ? roundOffsetsByDPR({\n x: x,\n y: y\n }, getWindow(popper)) : {\n x: x,\n y: y\n };\n\n x = _ref4.x;\n y = _ref4.y;\n\n if (gpuAcceleration) {\n var _Object$assign;\n\n return Object.assign({}, commonStyles, (_Object$assign = {}, _Object$assign[sideY] = hasY ? '0' : '', _Object$assign[sideX] = hasX ? '0' : '', _Object$assign.transform = (win.devicePixelRatio || 1) <= 1 ? \"translate(\" + x + \"px, \" + y + \"px)\" : \"translate3d(\" + x + \"px, \" + y + \"px, 0)\", _Object$assign));\n }\n\n return Object.assign({}, commonStyles, (_Object$assign2 = {}, _Object$assign2[sideY] = hasY ? y + \"px\" : '', _Object$assign2[sideX] = hasX ? x + \"px\" : '', _Object$assign2.transform = '', _Object$assign2));\n}\n\nfunction computeStyles(_ref5) {\n var state = _ref5.state,\n options = _ref5.options;\n var _options$gpuAccelerat = options.gpuAcceleration,\n gpuAcceleration = _options$gpuAccelerat === void 0 ? true : _options$gpuAccelerat,\n _options$adaptive = options.adaptive,\n adaptive = _options$adaptive === void 0 ? true : _options$adaptive,\n _options$roundOffsets = options.roundOffsets,\n roundOffsets = _options$roundOffsets === void 0 ? true : _options$roundOffsets;\n var commonStyles = {\n placement: getBasePlacement(state.placement),\n variation: getVariation(state.placement),\n popper: state.elements.popper,\n popperRect: state.rects.popper,\n gpuAcceleration: gpuAcceleration,\n isFixed: state.options.strategy === 'fixed'\n };\n\n if (state.modifiersData.popperOffsets != null) {\n state.styles.popper = Object.assign({}, state.styles.popper, mapToStyles(Object.assign({}, commonStyles, {\n offsets: state.modifiersData.popperOffsets,\n position: state.options.strategy,\n adaptive: adaptive,\n roundOffsets: roundOffsets\n })));\n }\n\n if (state.modifiersData.arrow != null) {\n state.styles.arrow = Object.assign({}, state.styles.arrow, mapToStyles(Object.assign({}, commonStyles, {\n offsets: state.modifiersData.arrow,\n position: 'absolute',\n adaptive: false,\n roundOffsets: roundOffsets\n })));\n }\n\n state.attributes.popper = Object.assign({}, state.attributes.popper, {\n 'data-popper-placement': state.placement\n });\n} // eslint-disable-next-line import/no-unused-modules\n\n\nexport default {\n name: 'computeStyles',\n enabled: true,\n phase: 'beforeWrite',\n fn: computeStyles,\n data: {}\n};","import getWindow from \"../dom-utils/getWindow.js\"; // eslint-disable-next-line import/no-unused-modules\n\nvar passive = {\n passive: true\n};\n\nfunction effect(_ref) {\n var state = _ref.state,\n instance = _ref.instance,\n options = _ref.options;\n var _options$scroll = options.scroll,\n scroll = _options$scroll === void 0 ? true : _options$scroll,\n _options$resize = options.resize,\n resize = _options$resize === void 0 ? true : _options$resize;\n var window = getWindow(state.elements.popper);\n var scrollParents = [].concat(state.scrollParents.reference, state.scrollParents.popper);\n\n if (scroll) {\n scrollParents.forEach(function (scrollParent) {\n scrollParent.addEventListener('scroll', instance.update, passive);\n });\n }\n\n if (resize) {\n window.addEventListener('resize', instance.update, passive);\n }\n\n return function () {\n if (scroll) {\n scrollParents.forEach(function (scrollParent) {\n scrollParent.removeEventListener('scroll', instance.update, passive);\n });\n }\n\n if (resize) {\n window.removeEventListener('resize', instance.update, passive);\n }\n };\n} // eslint-disable-next-line import/no-unused-modules\n\n\nexport default {\n name: 'eventListeners',\n enabled: true,\n phase: 'write',\n fn: function fn() {},\n effect: effect,\n data: {}\n};","var hash = {\n left: 'right',\n right: 'left',\n bottom: 'top',\n top: 'bottom'\n};\nexport default function getOppositePlacement(placement) {\n return placement.replace(/left|right|bottom|top/g, function (matched) {\n return hash[matched];\n });\n}","var hash = {\n start: 'end',\n end: 'start'\n};\nexport default function getOppositeVariationPlacement(placement) {\n return placement.replace(/start|end/g, function (matched) {\n return hash[matched];\n });\n}","import getWindow from \"./getWindow.js\";\nexport default function getWindowScroll(node) {\n var win = getWindow(node);\n var scrollLeft = win.pageXOffset;\n var scrollTop = win.pageYOffset;\n return {\n scrollLeft: scrollLeft,\n scrollTop: scrollTop\n };\n}","import getBoundingClientRect from \"./getBoundingClientRect.js\";\nimport getDocumentElement from \"./getDocumentElement.js\";\nimport getWindowScroll from \"./getWindowScroll.js\";\nexport default function getWindowScrollBarX(element) {\n // If has a CSS width greater than the viewport, then this will be\n // incorrect for RTL.\n // Popper 1 is broken in this case and never had a bug report so let's assume\n // it's not an issue. I don't think anyone ever specifies width on \n // anyway.\n // Browsers where the left scrollbar doesn't cause an issue report `0` for\n // this (e.g. Edge 2019, IE11, Safari)\n return getBoundingClientRect(getDocumentElement(element)).left + getWindowScroll(element).scrollLeft;\n}","import getWindow from \"./getWindow.js\";\nimport getDocumentElement from \"./getDocumentElement.js\";\nimport getWindowScrollBarX from \"./getWindowScrollBarX.js\";\nimport isLayoutViewport from \"./isLayoutViewport.js\";\nexport default function getViewportRect(element, strategy) {\n var win = getWindow(element);\n var html = getDocumentElement(element);\n var visualViewport = win.visualViewport;\n var width = html.clientWidth;\n var height = html.clientHeight;\n var x = 0;\n var y = 0;\n\n if (visualViewport) {\n width = visualViewport.width;\n height = visualViewport.height;\n var layoutViewport = isLayoutViewport();\n\n if (layoutViewport || !layoutViewport && strategy === 'fixed') {\n x = visualViewport.offsetLeft;\n y = visualViewport.offsetTop;\n }\n }\n\n return {\n width: width,\n height: height,\n x: x + getWindowScrollBarX(element),\n y: y\n };\n}","import getDocumentElement from \"./getDocumentElement.js\";\nimport getComputedStyle from \"./getComputedStyle.js\";\nimport getWindowScrollBarX from \"./getWindowScrollBarX.js\";\nimport getWindowScroll from \"./getWindowScroll.js\";\nimport { max } from \"../utils/math.js\"; // Gets the entire size of the scrollable document area, even extending outside\n// of the `` and `` rect bounds if horizontally scrollable\n\nexport default function getDocumentRect(element) {\n var _element$ownerDocumen;\n\n var html = getDocumentElement(element);\n var winScroll = getWindowScroll(element);\n var body = (_element$ownerDocumen = element.ownerDocument) == null ? void 0 : _element$ownerDocumen.body;\n var width = max(html.scrollWidth, html.clientWidth, body ? body.scrollWidth : 0, body ? body.clientWidth : 0);\n var height = max(html.scrollHeight, html.clientHeight, body ? body.scrollHeight : 0, body ? body.clientHeight : 0);\n var x = -winScroll.scrollLeft + getWindowScrollBarX(element);\n var y = -winScroll.scrollTop;\n\n if (getComputedStyle(body || html).direction === 'rtl') {\n x += max(html.clientWidth, body ? body.clientWidth : 0) - width;\n }\n\n return {\n width: width,\n height: height,\n x: x,\n y: y\n };\n}","import getComputedStyle from \"./getComputedStyle.js\";\nexport default function isScrollParent(element) {\n // Firefox wants us to check `-x` and `-y` variations as well\n var _getComputedStyle = getComputedStyle(element),\n overflow = _getComputedStyle.overflow,\n overflowX = _getComputedStyle.overflowX,\n overflowY = _getComputedStyle.overflowY;\n\n return /auto|scroll|overlay|hidden/.test(overflow + overflowY + overflowX);\n}","import getParentNode from \"./getParentNode.js\";\nimport isScrollParent from \"./isScrollParent.js\";\nimport getNodeName from \"./getNodeName.js\";\nimport { isHTMLElement } from \"./instanceOf.js\";\nexport default function getScrollParent(node) {\n if (['html', 'body', '#document'].indexOf(getNodeName(node)) >= 0) {\n // $FlowFixMe[incompatible-return]: assume body is always available\n return node.ownerDocument.body;\n }\n\n if (isHTMLElement(node) && isScrollParent(node)) {\n return node;\n }\n\n return getScrollParent(getParentNode(node));\n}","import getScrollParent from \"./getScrollParent.js\";\nimport getParentNode from \"./getParentNode.js\";\nimport getWindow from \"./getWindow.js\";\nimport isScrollParent from \"./isScrollParent.js\";\n/*\ngiven a DOM element, return the list of all scroll parents, up the list of ancesors\nuntil we get to the top window object. This list is what we attach scroll listeners\nto, because if any of these parent elements scroll, we'll need to re-calculate the\nreference element's position.\n*/\n\nexport default function listScrollParents(element, list) {\n var _element$ownerDocumen;\n\n if (list === void 0) {\n list = [];\n }\n\n var scrollParent = getScrollParent(element);\n var isBody = scrollParent === ((_element$ownerDocumen = element.ownerDocument) == null ? void 0 : _element$ownerDocumen.body);\n var win = getWindow(scrollParent);\n var target = isBody ? [win].concat(win.visualViewport || [], isScrollParent(scrollParent) ? scrollParent : []) : scrollParent;\n var updatedList = list.concat(target);\n return isBody ? updatedList : // $FlowFixMe[incompatible-call]: isBody tells us target will be an HTMLElement here\n updatedList.concat(listScrollParents(getParentNode(target)));\n}","export default function rectToClientRect(rect) {\n return Object.assign({}, rect, {\n left: rect.x,\n top: rect.y,\n right: rect.x + rect.width,\n bottom: rect.y + rect.height\n });\n}","import { viewport } from \"../enums.js\";\nimport getViewportRect from \"./getViewportRect.js\";\nimport getDocumentRect from \"./getDocumentRect.js\";\nimport listScrollParents from \"./listScrollParents.js\";\nimport getOffsetParent from \"./getOffsetParent.js\";\nimport getDocumentElement from \"./getDocumentElement.js\";\nimport getComputedStyle from \"./getComputedStyle.js\";\nimport { isElement, isHTMLElement } from \"./instanceOf.js\";\nimport getBoundingClientRect from \"./getBoundingClientRect.js\";\nimport getParentNode from \"./getParentNode.js\";\nimport contains from \"./contains.js\";\nimport getNodeName from \"./getNodeName.js\";\nimport rectToClientRect from \"../utils/rectToClientRect.js\";\nimport { max, min } from \"../utils/math.js\";\n\nfunction getInnerBoundingClientRect(element, strategy) {\n var rect = getBoundingClientRect(element, false, strategy === 'fixed');\n rect.top = rect.top + element.clientTop;\n rect.left = rect.left + element.clientLeft;\n rect.bottom = rect.top + element.clientHeight;\n rect.right = rect.left + element.clientWidth;\n rect.width = element.clientWidth;\n rect.height = element.clientHeight;\n rect.x = rect.left;\n rect.y = rect.top;\n return rect;\n}\n\nfunction getClientRectFromMixedType(element, clippingParent, strategy) {\n return clippingParent === viewport ? rectToClientRect(getViewportRect(element, strategy)) : isElement(clippingParent) ? getInnerBoundingClientRect(clippingParent, strategy) : rectToClientRect(getDocumentRect(getDocumentElement(element)));\n} // A \"clipping parent\" is an overflowable container with the characteristic of\n// clipping (or hiding) overflowing elements with a position different from\n// `initial`\n\n\nfunction getClippingParents(element) {\n var clippingParents = listScrollParents(getParentNode(element));\n var canEscapeClipping = ['absolute', 'fixed'].indexOf(getComputedStyle(element).position) >= 0;\n var clipperElement = canEscapeClipping && isHTMLElement(element) ? getOffsetParent(element) : element;\n\n if (!isElement(clipperElement)) {\n return [];\n } // $FlowFixMe[incompatible-return]: https://github.com/facebook/flow/issues/1414\n\n\n return clippingParents.filter(function (clippingParent) {\n return isElement(clippingParent) && contains(clippingParent, clipperElement) && getNodeName(clippingParent) !== 'body';\n });\n} // Gets the maximum area that the element is visible in due to any number of\n// clipping parents\n\n\nexport default function getClippingRect(element, boundary, rootBoundary, strategy) {\n var mainClippingParents = boundary === 'clippingParents' ? getClippingParents(element) : [].concat(boundary);\n var clippingParents = [].concat(mainClippingParents, [rootBoundary]);\n var firstClippingParent = clippingParents[0];\n var clippingRect = clippingParents.reduce(function (accRect, clippingParent) {\n var rect = getClientRectFromMixedType(element, clippingParent, strategy);\n accRect.top = max(rect.top, accRect.top);\n accRect.right = min(rect.right, accRect.right);\n accRect.bottom = min(rect.bottom, accRect.bottom);\n accRect.left = max(rect.left, accRect.left);\n return accRect;\n }, getClientRectFromMixedType(element, firstClippingParent, strategy));\n clippingRect.width = clippingRect.right - clippingRect.left;\n clippingRect.height = clippingRect.bottom - clippingRect.top;\n clippingRect.x = clippingRect.left;\n clippingRect.y = clippingRect.top;\n return clippingRect;\n}","import getBasePlacement from \"./getBasePlacement.js\";\nimport getVariation from \"./getVariation.js\";\nimport getMainAxisFromPlacement from \"./getMainAxisFromPlacement.js\";\nimport { top, right, bottom, left, start, end } from \"../enums.js\";\nexport default function computeOffsets(_ref) {\n var reference = _ref.reference,\n element = _ref.element,\n placement = _ref.placement;\n var basePlacement = placement ? getBasePlacement(placement) : null;\n var variation = placement ? getVariation(placement) : null;\n var commonX = reference.x + reference.width / 2 - element.width / 2;\n var commonY = reference.y + reference.height / 2 - element.height / 2;\n var offsets;\n\n switch (basePlacement) {\n case top:\n offsets = {\n x: commonX,\n y: reference.y - element.height\n };\n break;\n\n case bottom:\n offsets = {\n x: commonX,\n y: reference.y + reference.height\n };\n break;\n\n case right:\n offsets = {\n x: reference.x + reference.width,\n y: commonY\n };\n break;\n\n case left:\n offsets = {\n x: reference.x - element.width,\n y: commonY\n };\n break;\n\n default:\n offsets = {\n x: reference.x,\n y: reference.y\n };\n }\n\n var mainAxis = basePlacement ? getMainAxisFromPlacement(basePlacement) : null;\n\n if (mainAxis != null) {\n var len = mainAxis === 'y' ? 'height' : 'width';\n\n switch (variation) {\n case start:\n offsets[mainAxis] = offsets[mainAxis] - (reference[len] / 2 - element[len] / 2);\n break;\n\n case end:\n offsets[mainAxis] = offsets[mainAxis] + (reference[len] / 2 - element[len] / 2);\n break;\n\n default:\n }\n }\n\n return offsets;\n}","import getClippingRect from \"../dom-utils/getClippingRect.js\";\nimport getDocumentElement from \"../dom-utils/getDocumentElement.js\";\nimport getBoundingClientRect from \"../dom-utils/getBoundingClientRect.js\";\nimport computeOffsets from \"./computeOffsets.js\";\nimport rectToClientRect from \"./rectToClientRect.js\";\nimport { clippingParents, reference, popper, bottom, top, right, basePlacements, viewport } from \"../enums.js\";\nimport { isElement } from \"../dom-utils/instanceOf.js\";\nimport mergePaddingObject from \"./mergePaddingObject.js\";\nimport expandToHashMap from \"./expandToHashMap.js\"; // eslint-disable-next-line import/no-unused-modules\n\nexport default function detectOverflow(state, options) {\n if (options === void 0) {\n options = {};\n }\n\n var _options = options,\n _options$placement = _options.placement,\n placement = _options$placement === void 0 ? state.placement : _options$placement,\n _options$strategy = _options.strategy,\n strategy = _options$strategy === void 0 ? state.strategy : _options$strategy,\n _options$boundary = _options.boundary,\n boundary = _options$boundary === void 0 ? clippingParents : _options$boundary,\n _options$rootBoundary = _options.rootBoundary,\n rootBoundary = _options$rootBoundary === void 0 ? viewport : _options$rootBoundary,\n _options$elementConte = _options.elementContext,\n elementContext = _options$elementConte === void 0 ? popper : _options$elementConte,\n _options$altBoundary = _options.altBoundary,\n altBoundary = _options$altBoundary === void 0 ? false : _options$altBoundary,\n _options$padding = _options.padding,\n padding = _options$padding === void 0 ? 0 : _options$padding;\n var paddingObject = mergePaddingObject(typeof padding !== 'number' ? padding : expandToHashMap(padding, basePlacements));\n var altContext = elementContext === popper ? reference : popper;\n var popperRect = state.rects.popper;\n var element = state.elements[altBoundary ? altContext : elementContext];\n var clippingClientRect = getClippingRect(isElement(element) ? element : element.contextElement || getDocumentElement(state.elements.popper), boundary, rootBoundary, strategy);\n var referenceClientRect = getBoundingClientRect(state.elements.reference);\n var popperOffsets = computeOffsets({\n reference: referenceClientRect,\n element: popperRect,\n strategy: 'absolute',\n placement: placement\n });\n var popperClientRect = rectToClientRect(Object.assign({}, popperRect, popperOffsets));\n var elementClientRect = elementContext === popper ? popperClientRect : referenceClientRect; // positive = overflowing the clipping rect\n // 0 or negative = within the clipping rect\n\n var overflowOffsets = {\n top: clippingClientRect.top - elementClientRect.top + paddingObject.top,\n bottom: elementClientRect.bottom - clippingClientRect.bottom + paddingObject.bottom,\n left: clippingClientRect.left - elementClientRect.left + paddingObject.left,\n right: elementClientRect.right - clippingClientRect.right + paddingObject.right\n };\n var offsetData = state.modifiersData.offset; // Offsets can be applied only to the popper element\n\n if (elementContext === popper && offsetData) {\n var offset = offsetData[placement];\n Object.keys(overflowOffsets).forEach(function (key) {\n var multiply = [right, bottom].indexOf(key) >= 0 ? 1 : -1;\n var axis = [top, bottom].indexOf(key) >= 0 ? 'y' : 'x';\n overflowOffsets[key] += offset[axis] * multiply;\n });\n }\n\n return overflowOffsets;\n}","import getVariation from \"./getVariation.js\";\nimport { variationPlacements, basePlacements, placements as allPlacements } from \"../enums.js\";\nimport detectOverflow from \"./detectOverflow.js\";\nimport getBasePlacement from \"./getBasePlacement.js\";\nexport default function computeAutoPlacement(state, options) {\n if (options === void 0) {\n options = {};\n }\n\n var _options = options,\n placement = _options.placement,\n boundary = _options.boundary,\n rootBoundary = _options.rootBoundary,\n padding = _options.padding,\n flipVariations = _options.flipVariations,\n _options$allowedAutoP = _options.allowedAutoPlacements,\n allowedAutoPlacements = _options$allowedAutoP === void 0 ? allPlacements : _options$allowedAutoP;\n var variation = getVariation(placement);\n var placements = variation ? flipVariations ? variationPlacements : variationPlacements.filter(function (placement) {\n return getVariation(placement) === variation;\n }) : basePlacements;\n var allowedPlacements = placements.filter(function (placement) {\n return allowedAutoPlacements.indexOf(placement) >= 0;\n });\n\n if (allowedPlacements.length === 0) {\n allowedPlacements = placements;\n } // $FlowFixMe[incompatible-type]: Flow seems to have problems with two array unions...\n\n\n var overflows = allowedPlacements.reduce(function (acc, placement) {\n acc[placement] = detectOverflow(state, {\n placement: placement,\n boundary: boundary,\n rootBoundary: rootBoundary,\n padding: padding\n })[getBasePlacement(placement)];\n return acc;\n }, {});\n return Object.keys(overflows).sort(function (a, b) {\n return overflows[a] - overflows[b];\n });\n}","import getOppositePlacement from \"../utils/getOppositePlacement.js\";\nimport getBasePlacement from \"../utils/getBasePlacement.js\";\nimport getOppositeVariationPlacement from \"../utils/getOppositeVariationPlacement.js\";\nimport detectOverflow from \"../utils/detectOverflow.js\";\nimport computeAutoPlacement from \"../utils/computeAutoPlacement.js\";\nimport { bottom, top, start, right, left, auto } from \"../enums.js\";\nimport getVariation from \"../utils/getVariation.js\"; // eslint-disable-next-line import/no-unused-modules\n\nfunction getExpandedFallbackPlacements(placement) {\n if (getBasePlacement(placement) === auto) {\n return [];\n }\n\n var oppositePlacement = getOppositePlacement(placement);\n return [getOppositeVariationPlacement(placement), oppositePlacement, getOppositeVariationPlacement(oppositePlacement)];\n}\n\nfunction flip(_ref) {\n var state = _ref.state,\n options = _ref.options,\n name = _ref.name;\n\n if (state.modifiersData[name]._skip) {\n return;\n }\n\n var _options$mainAxis = options.mainAxis,\n checkMainAxis = _options$mainAxis === void 0 ? true : _options$mainAxis,\n _options$altAxis = options.altAxis,\n checkAltAxis = _options$altAxis === void 0 ? true : _options$altAxis,\n specifiedFallbackPlacements = options.fallbackPlacements,\n padding = options.padding,\n boundary = options.boundary,\n rootBoundary = options.rootBoundary,\n altBoundary = options.altBoundary,\n _options$flipVariatio = options.flipVariations,\n flipVariations = _options$flipVariatio === void 0 ? true : _options$flipVariatio,\n allowedAutoPlacements = options.allowedAutoPlacements;\n var preferredPlacement = state.options.placement;\n var basePlacement = getBasePlacement(preferredPlacement);\n var isBasePlacement = basePlacement === preferredPlacement;\n var fallbackPlacements = specifiedFallbackPlacements || (isBasePlacement || !flipVariations ? [getOppositePlacement(preferredPlacement)] : getExpandedFallbackPlacements(preferredPlacement));\n var placements = [preferredPlacement].concat(fallbackPlacements).reduce(function (acc, placement) {\n return acc.concat(getBasePlacement(placement) === auto ? computeAutoPlacement(state, {\n placement: placement,\n boundary: boundary,\n rootBoundary: rootBoundary,\n padding: padding,\n flipVariations: flipVariations,\n allowedAutoPlacements: allowedAutoPlacements\n }) : placement);\n }, []);\n var referenceRect = state.rects.reference;\n var popperRect = state.rects.popper;\n var checksMap = new Map();\n var makeFallbackChecks = true;\n var firstFittingPlacement = placements[0];\n\n for (var i = 0; i < placements.length; i++) {\n var placement = placements[i];\n\n var _basePlacement = getBasePlacement(placement);\n\n var isStartVariation = getVariation(placement) === start;\n var isVertical = [top, bottom].indexOf(_basePlacement) >= 0;\n var len = isVertical ? 'width' : 'height';\n var overflow = detectOverflow(state, {\n placement: placement,\n boundary: boundary,\n rootBoundary: rootBoundary,\n altBoundary: altBoundary,\n padding: padding\n });\n var mainVariationSide = isVertical ? isStartVariation ? right : left : isStartVariation ? bottom : top;\n\n if (referenceRect[len] > popperRect[len]) {\n mainVariationSide = getOppositePlacement(mainVariationSide);\n }\n\n var altVariationSide = getOppositePlacement(mainVariationSide);\n var checks = [];\n\n if (checkMainAxis) {\n checks.push(overflow[_basePlacement] <= 0);\n }\n\n if (checkAltAxis) {\n checks.push(overflow[mainVariationSide] <= 0, overflow[altVariationSide] <= 0);\n }\n\n if (checks.every(function (check) {\n return check;\n })) {\n firstFittingPlacement = placement;\n makeFallbackChecks = false;\n break;\n }\n\n checksMap.set(placement, checks);\n }\n\n if (makeFallbackChecks) {\n // `2` may be desired in some cases – research later\n var numberOfChecks = flipVariations ? 3 : 1;\n\n var _loop = function _loop(_i) {\n var fittingPlacement = placements.find(function (placement) {\n var checks = checksMap.get(placement);\n\n if (checks) {\n return checks.slice(0, _i).every(function (check) {\n return check;\n });\n }\n });\n\n if (fittingPlacement) {\n firstFittingPlacement = fittingPlacement;\n return \"break\";\n }\n };\n\n for (var _i = numberOfChecks; _i > 0; _i--) {\n var _ret = _loop(_i);\n\n if (_ret === \"break\") break;\n }\n }\n\n if (state.placement !== firstFittingPlacement) {\n state.modifiersData[name]._skip = true;\n state.placement = firstFittingPlacement;\n state.reset = true;\n }\n} // eslint-disable-next-line import/no-unused-modules\n\n\nexport default {\n name: 'flip',\n enabled: true,\n phase: 'main',\n fn: flip,\n requiresIfExists: ['offset'],\n data: {\n _skip: false\n }\n};","import { top, bottom, left, right } from \"../enums.js\";\nimport detectOverflow from \"../utils/detectOverflow.js\";\n\nfunction getSideOffsets(overflow, rect, preventedOffsets) {\n if (preventedOffsets === void 0) {\n preventedOffsets = {\n x: 0,\n y: 0\n };\n }\n\n return {\n top: overflow.top - rect.height - preventedOffsets.y,\n right: overflow.right - rect.width + preventedOffsets.x,\n bottom: overflow.bottom - rect.height + preventedOffsets.y,\n left: overflow.left - rect.width - preventedOffsets.x\n };\n}\n\nfunction isAnySideFullyClipped(overflow) {\n return [top, right, bottom, left].some(function (side) {\n return overflow[side] >= 0;\n });\n}\n\nfunction hide(_ref) {\n var state = _ref.state,\n name = _ref.name;\n var referenceRect = state.rects.reference;\n var popperRect = state.rects.popper;\n var preventedOffsets = state.modifiersData.preventOverflow;\n var referenceOverflow = detectOverflow(state, {\n elementContext: 'reference'\n });\n var popperAltOverflow = detectOverflow(state, {\n altBoundary: true\n });\n var referenceClippingOffsets = getSideOffsets(referenceOverflow, referenceRect);\n var popperEscapeOffsets = getSideOffsets(popperAltOverflow, popperRect, preventedOffsets);\n var isReferenceHidden = isAnySideFullyClipped(referenceClippingOffsets);\n var hasPopperEscaped = isAnySideFullyClipped(popperEscapeOffsets);\n state.modifiersData[name] = {\n referenceClippingOffsets: referenceClippingOffsets,\n popperEscapeOffsets: popperEscapeOffsets,\n isReferenceHidden: isReferenceHidden,\n hasPopperEscaped: hasPopperEscaped\n };\n state.attributes.popper = Object.assign({}, state.attributes.popper, {\n 'data-popper-reference-hidden': isReferenceHidden,\n 'data-popper-escaped': hasPopperEscaped\n });\n} // eslint-disable-next-line import/no-unused-modules\n\n\nexport default {\n name: 'hide',\n enabled: true,\n phase: 'main',\n requiresIfExists: ['preventOverflow'],\n fn: hide\n};","import getBasePlacement from \"../utils/getBasePlacement.js\";\nimport { top, left, right, placements } from \"../enums.js\"; // eslint-disable-next-line import/no-unused-modules\n\nexport function distanceAndSkiddingToXY(placement, rects, offset) {\n var basePlacement = getBasePlacement(placement);\n var invertDistance = [left, top].indexOf(basePlacement) >= 0 ? -1 : 1;\n\n var _ref = typeof offset === 'function' ? offset(Object.assign({}, rects, {\n placement: placement\n })) : offset,\n skidding = _ref[0],\n distance = _ref[1];\n\n skidding = skidding || 0;\n distance = (distance || 0) * invertDistance;\n return [left, right].indexOf(basePlacement) >= 0 ? {\n x: distance,\n y: skidding\n } : {\n x: skidding,\n y: distance\n };\n}\n\nfunction offset(_ref2) {\n var state = _ref2.state,\n options = _ref2.options,\n name = _ref2.name;\n var _options$offset = options.offset,\n offset = _options$offset === void 0 ? [0, 0] : _options$offset;\n var data = placements.reduce(function (acc, placement) {\n acc[placement] = distanceAndSkiddingToXY(placement, state.rects, offset);\n return acc;\n }, {});\n var _data$state$placement = data[state.placement],\n x = _data$state$placement.x,\n y = _data$state$placement.y;\n\n if (state.modifiersData.popperOffsets != null) {\n state.modifiersData.popperOffsets.x += x;\n state.modifiersData.popperOffsets.y += y;\n }\n\n state.modifiersData[name] = data;\n} // eslint-disable-next-line import/no-unused-modules\n\n\nexport default {\n name: 'offset',\n enabled: true,\n phase: 'main',\n requires: ['popperOffsets'],\n fn: offset\n};","import computeOffsets from \"../utils/computeOffsets.js\";\n\nfunction popperOffsets(_ref) {\n var state = _ref.state,\n name = _ref.name;\n // Offsets are the actual position the popper needs to have to be\n // properly positioned near its reference element\n // This is the most basic placement, and will be adjusted by\n // the modifiers in the next step\n state.modifiersData[name] = computeOffsets({\n reference: state.rects.reference,\n element: state.rects.popper,\n strategy: 'absolute',\n placement: state.placement\n });\n} // eslint-disable-next-line import/no-unused-modules\n\n\nexport default {\n name: 'popperOffsets',\n enabled: true,\n phase: 'read',\n fn: popperOffsets,\n data: {}\n};","export default function getAltAxis(axis) {\n return axis === 'x' ? 'y' : 'x';\n}","import { top, left, right, bottom, start } from \"../enums.js\";\nimport getBasePlacement from \"../utils/getBasePlacement.js\";\nimport getMainAxisFromPlacement from \"../utils/getMainAxisFromPlacement.js\";\nimport getAltAxis from \"../utils/getAltAxis.js\";\nimport { within, withinMaxClamp } from \"../utils/within.js\";\nimport getLayoutRect from \"../dom-utils/getLayoutRect.js\";\nimport getOffsetParent from \"../dom-utils/getOffsetParent.js\";\nimport detectOverflow from \"../utils/detectOverflow.js\";\nimport getVariation from \"../utils/getVariation.js\";\nimport getFreshSideObject from \"../utils/getFreshSideObject.js\";\nimport { min as mathMin, max as mathMax } from \"../utils/math.js\";\n\nfunction preventOverflow(_ref) {\n var state = _ref.state,\n options = _ref.options,\n name = _ref.name;\n var _options$mainAxis = options.mainAxis,\n checkMainAxis = _options$mainAxis === void 0 ? true : _options$mainAxis,\n _options$altAxis = options.altAxis,\n checkAltAxis = _options$altAxis === void 0 ? false : _options$altAxis,\n boundary = options.boundary,\n rootBoundary = options.rootBoundary,\n altBoundary = options.altBoundary,\n padding = options.padding,\n _options$tether = options.tether,\n tether = _options$tether === void 0 ? true : _options$tether,\n _options$tetherOffset = options.tetherOffset,\n tetherOffset = _options$tetherOffset === void 0 ? 0 : _options$tetherOffset;\n var overflow = detectOverflow(state, {\n boundary: boundary,\n rootBoundary: rootBoundary,\n padding: padding,\n altBoundary: altBoundary\n });\n var basePlacement = getBasePlacement(state.placement);\n var variation = getVariation(state.placement);\n var isBasePlacement = !variation;\n var mainAxis = getMainAxisFromPlacement(basePlacement);\n var altAxis = getAltAxis(mainAxis);\n var popperOffsets = state.modifiersData.popperOffsets;\n var referenceRect = state.rects.reference;\n var popperRect = state.rects.popper;\n var tetherOffsetValue = typeof tetherOffset === 'function' ? tetherOffset(Object.assign({}, state.rects, {\n placement: state.placement\n })) : tetherOffset;\n var normalizedTetherOffsetValue = typeof tetherOffsetValue === 'number' ? {\n mainAxis: tetherOffsetValue,\n altAxis: tetherOffsetValue\n } : Object.assign({\n mainAxis: 0,\n altAxis: 0\n }, tetherOffsetValue);\n var offsetModifierState = state.modifiersData.offset ? state.modifiersData.offset[state.placement] : null;\n var data = {\n x: 0,\n y: 0\n };\n\n if (!popperOffsets) {\n return;\n }\n\n if (checkMainAxis) {\n var _offsetModifierState$;\n\n var mainSide = mainAxis === 'y' ? top : left;\n var altSide = mainAxis === 'y' ? bottom : right;\n var len = mainAxis === 'y' ? 'height' : 'width';\n var offset = popperOffsets[mainAxis];\n var min = offset + overflow[mainSide];\n var max = offset - overflow[altSide];\n var additive = tether ? -popperRect[len] / 2 : 0;\n var minLen = variation === start ? referenceRect[len] : popperRect[len];\n var maxLen = variation === start ? -popperRect[len] : -referenceRect[len]; // We need to include the arrow in the calculation so the arrow doesn't go\n // outside the reference bounds\n\n var arrowElement = state.elements.arrow;\n var arrowRect = tether && arrowElement ? getLayoutRect(arrowElement) : {\n width: 0,\n height: 0\n };\n var arrowPaddingObject = state.modifiersData['arrow#persistent'] ? state.modifiersData['arrow#persistent'].padding : getFreshSideObject();\n var arrowPaddingMin = arrowPaddingObject[mainSide];\n var arrowPaddingMax = arrowPaddingObject[altSide]; // If the reference length is smaller than the arrow length, we don't want\n // to include its full size in the calculation. If the reference is small\n // and near the edge of a boundary, the popper can overflow even if the\n // reference is not overflowing as well (e.g. virtual elements with no\n // width or height)\n\n var arrowLen = within(0, referenceRect[len], arrowRect[len]);\n var minOffset = isBasePlacement ? referenceRect[len] / 2 - additive - arrowLen - arrowPaddingMin - normalizedTetherOffsetValue.mainAxis : minLen - arrowLen - arrowPaddingMin - normalizedTetherOffsetValue.mainAxis;\n var maxOffset = isBasePlacement ? -referenceRect[len] / 2 + additive + arrowLen + arrowPaddingMax + normalizedTetherOffsetValue.mainAxis : maxLen + arrowLen + arrowPaddingMax + normalizedTetherOffsetValue.mainAxis;\n var arrowOffsetParent = state.elements.arrow && getOffsetParent(state.elements.arrow);\n var clientOffset = arrowOffsetParent ? mainAxis === 'y' ? arrowOffsetParent.clientTop || 0 : arrowOffsetParent.clientLeft || 0 : 0;\n var offsetModifierValue = (_offsetModifierState$ = offsetModifierState == null ? void 0 : offsetModifierState[mainAxis]) != null ? _offsetModifierState$ : 0;\n var tetherMin = offset + minOffset - offsetModifierValue - clientOffset;\n var tetherMax = offset + maxOffset - offsetModifierValue;\n var preventedOffset = within(tether ? mathMin(min, tetherMin) : min, offset, tether ? mathMax(max, tetherMax) : max);\n popperOffsets[mainAxis] = preventedOffset;\n data[mainAxis] = preventedOffset - offset;\n }\n\n if (checkAltAxis) {\n var _offsetModifierState$2;\n\n var _mainSide = mainAxis === 'x' ? top : left;\n\n var _altSide = mainAxis === 'x' ? bottom : right;\n\n var _offset = popperOffsets[altAxis];\n\n var _len = altAxis === 'y' ? 'height' : 'width';\n\n var _min = _offset + overflow[_mainSide];\n\n var _max = _offset - overflow[_altSide];\n\n var isOriginSide = [top, left].indexOf(basePlacement) !== -1;\n\n var _offsetModifierValue = (_offsetModifierState$2 = offsetModifierState == null ? void 0 : offsetModifierState[altAxis]) != null ? _offsetModifierState$2 : 0;\n\n var _tetherMin = isOriginSide ? _min : _offset - referenceRect[_len] - popperRect[_len] - _offsetModifierValue + normalizedTetherOffsetValue.altAxis;\n\n var _tetherMax = isOriginSide ? _offset + referenceRect[_len] + popperRect[_len] - _offsetModifierValue - normalizedTetherOffsetValue.altAxis : _max;\n\n var _preventedOffset = tether && isOriginSide ? withinMaxClamp(_tetherMin, _offset, _tetherMax) : within(tether ? _tetherMin : _min, _offset, tether ? _tetherMax : _max);\n\n popperOffsets[altAxis] = _preventedOffset;\n data[altAxis] = _preventedOffset - _offset;\n }\n\n state.modifiersData[name] = data;\n} // eslint-disable-next-line import/no-unused-modules\n\n\nexport default {\n name: 'preventOverflow',\n enabled: true,\n phase: 'main',\n fn: preventOverflow,\n requiresIfExists: ['offset']\n};","export default function getHTMLElementScroll(element) {\n return {\n scrollLeft: element.scrollLeft,\n scrollTop: element.scrollTop\n };\n}","import getWindowScroll from \"./getWindowScroll.js\";\nimport getWindow from \"./getWindow.js\";\nimport { isHTMLElement } from \"./instanceOf.js\";\nimport getHTMLElementScroll from \"./getHTMLElementScroll.js\";\nexport default function getNodeScroll(node) {\n if (node === getWindow(node) || !isHTMLElement(node)) {\n return getWindowScroll(node);\n } else {\n return getHTMLElementScroll(node);\n }\n}","import getBoundingClientRect from \"./getBoundingClientRect.js\";\nimport getNodeScroll from \"./getNodeScroll.js\";\nimport getNodeName from \"./getNodeName.js\";\nimport { isHTMLElement } from \"./instanceOf.js\";\nimport getWindowScrollBarX from \"./getWindowScrollBarX.js\";\nimport getDocumentElement from \"./getDocumentElement.js\";\nimport isScrollParent from \"./isScrollParent.js\";\nimport { round } from \"../utils/math.js\";\n\nfunction isElementScaled(element) {\n var rect = element.getBoundingClientRect();\n var scaleX = round(rect.width) / element.offsetWidth || 1;\n var scaleY = round(rect.height) / element.offsetHeight || 1;\n return scaleX !== 1 || scaleY !== 1;\n} // Returns the composite rect of an element relative to its offsetParent.\n// Composite means it takes into account transforms as well as layout.\n\n\nexport default function getCompositeRect(elementOrVirtualElement, offsetParent, isFixed) {\n if (isFixed === void 0) {\n isFixed = false;\n }\n\n var isOffsetParentAnElement = isHTMLElement(offsetParent);\n var offsetParentIsScaled = isHTMLElement(offsetParent) && isElementScaled(offsetParent);\n var documentElement = getDocumentElement(offsetParent);\n var rect = getBoundingClientRect(elementOrVirtualElement, offsetParentIsScaled, isFixed);\n var scroll = {\n scrollLeft: 0,\n scrollTop: 0\n };\n var offsets = {\n x: 0,\n y: 0\n };\n\n if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) {\n if (getNodeName(offsetParent) !== 'body' || // https://github.com/popperjs/popper-core/issues/1078\n isScrollParent(documentElement)) {\n scroll = getNodeScroll(offsetParent);\n }\n\n if (isHTMLElement(offsetParent)) {\n offsets = getBoundingClientRect(offsetParent, true);\n offsets.x += offsetParent.clientLeft;\n offsets.y += offsetParent.clientTop;\n } else if (documentElement) {\n offsets.x = getWindowScrollBarX(documentElement);\n }\n }\n\n return {\n x: rect.left + scroll.scrollLeft - offsets.x,\n y: rect.top + scroll.scrollTop - offsets.y,\n width: rect.width,\n height: rect.height\n };\n}","import { modifierPhases } from \"../enums.js\"; // source: https://stackoverflow.com/questions/49875255\n\nfunction order(modifiers) {\n var map = new Map();\n var visited = new Set();\n var result = [];\n modifiers.forEach(function (modifier) {\n map.set(modifier.name, modifier);\n }); // On visiting object, check for its dependencies and visit them recursively\n\n function sort(modifier) {\n visited.add(modifier.name);\n var requires = [].concat(modifier.requires || [], modifier.requiresIfExists || []);\n requires.forEach(function (dep) {\n if (!visited.has(dep)) {\n var depModifier = map.get(dep);\n\n if (depModifier) {\n sort(depModifier);\n }\n }\n });\n result.push(modifier);\n }\n\n modifiers.forEach(function (modifier) {\n if (!visited.has(modifier.name)) {\n // check for visited object\n sort(modifier);\n }\n });\n return result;\n}\n\nexport default function orderModifiers(modifiers) {\n // order based on dependencies\n var orderedModifiers = order(modifiers); // order based on phase\n\n return modifierPhases.reduce(function (acc, phase) {\n return acc.concat(orderedModifiers.filter(function (modifier) {\n return modifier.phase === phase;\n }));\n }, []);\n}","export default function debounce(fn) {\n var pending;\n return function () {\n if (!pending) {\n pending = new Promise(function (resolve) {\n Promise.resolve().then(function () {\n pending = undefined;\n resolve(fn());\n });\n });\n }\n\n return pending;\n };\n}","export default function mergeByName(modifiers) {\n var merged = modifiers.reduce(function (merged, current) {\n var existing = merged[current.name];\n merged[current.name] = existing ? Object.assign({}, existing, current, {\n options: Object.assign({}, existing.options, current.options),\n data: Object.assign({}, existing.data, current.data)\n }) : current;\n return merged;\n }, {}); // IE11 does not support Object.values\n\n return Object.keys(merged).map(function (key) {\n return merged[key];\n });\n}","import getCompositeRect from \"./dom-utils/getCompositeRect.js\";\nimport getLayoutRect from \"./dom-utils/getLayoutRect.js\";\nimport listScrollParents from \"./dom-utils/listScrollParents.js\";\nimport getOffsetParent from \"./dom-utils/getOffsetParent.js\";\nimport orderModifiers from \"./utils/orderModifiers.js\";\nimport debounce from \"./utils/debounce.js\";\nimport mergeByName from \"./utils/mergeByName.js\";\nimport detectOverflow from \"./utils/detectOverflow.js\";\nimport { isElement } from \"./dom-utils/instanceOf.js\";\nvar DEFAULT_OPTIONS = {\n placement: 'bottom',\n modifiers: [],\n strategy: 'absolute'\n};\n\nfunction areValidElements() {\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n return !args.some(function (element) {\n return !(element && typeof element.getBoundingClientRect === 'function');\n });\n}\n\nexport function popperGenerator(generatorOptions) {\n if (generatorOptions === void 0) {\n generatorOptions = {};\n }\n\n var _generatorOptions = generatorOptions,\n _generatorOptions$def = _generatorOptions.defaultModifiers,\n defaultModifiers = _generatorOptions$def === void 0 ? [] : _generatorOptions$def,\n _generatorOptions$def2 = _generatorOptions.defaultOptions,\n defaultOptions = _generatorOptions$def2 === void 0 ? DEFAULT_OPTIONS : _generatorOptions$def2;\n return function createPopper(reference, popper, options) {\n if (options === void 0) {\n options = defaultOptions;\n }\n\n var state = {\n placement: 'bottom',\n orderedModifiers: [],\n options: Object.assign({}, DEFAULT_OPTIONS, defaultOptions),\n modifiersData: {},\n elements: {\n reference: reference,\n popper: popper\n },\n attributes: {},\n styles: {}\n };\n var effectCleanupFns = [];\n var isDestroyed = false;\n var instance = {\n state: state,\n setOptions: function setOptions(setOptionsAction) {\n var options = typeof setOptionsAction === 'function' ? setOptionsAction(state.options) : setOptionsAction;\n cleanupModifierEffects();\n state.options = Object.assign({}, defaultOptions, state.options, options);\n state.scrollParents = {\n reference: isElement(reference) ? listScrollParents(reference) : reference.contextElement ? listScrollParents(reference.contextElement) : [],\n popper: listScrollParents(popper)\n }; // Orders the modifiers based on their dependencies and `phase`\n // properties\n\n var orderedModifiers = orderModifiers(mergeByName([].concat(defaultModifiers, state.options.modifiers))); // Strip out disabled modifiers\n\n state.orderedModifiers = orderedModifiers.filter(function (m) {\n return m.enabled;\n });\n runModifierEffects();\n return instance.update();\n },\n // Sync update – it will always be executed, even if not necessary. This\n // is useful for low frequency updates where sync behavior simplifies the\n // logic.\n // For high frequency updates (e.g. `resize` and `scroll` events), always\n // prefer the async Popper#update method\n forceUpdate: function forceUpdate() {\n if (isDestroyed) {\n return;\n }\n\n var _state$elements = state.elements,\n reference = _state$elements.reference,\n popper = _state$elements.popper; // Don't proceed if `reference` or `popper` are not valid elements\n // anymore\n\n if (!areValidElements(reference, popper)) {\n return;\n } // Store the reference and popper rects to be read by modifiers\n\n\n state.rects = {\n reference: getCompositeRect(reference, getOffsetParent(popper), state.options.strategy === 'fixed'),\n popper: getLayoutRect(popper)\n }; // Modifiers have the ability to reset the current update cycle. The\n // most common use case for this is the `flip` modifier changing the\n // placement, which then needs to re-run all the modifiers, because the\n // logic was previously ran for the previous placement and is therefore\n // stale/incorrect\n\n state.reset = false;\n state.placement = state.options.placement; // On each update cycle, the `modifiersData` property for each modifier\n // is filled with the initial data specified by the modifier. This means\n // it doesn't persist and is fresh on each update.\n // To ensure persistent data, use `${name}#persistent`\n\n state.orderedModifiers.forEach(function (modifier) {\n return state.modifiersData[modifier.name] = Object.assign({}, modifier.data);\n });\n\n for (var index = 0; index < state.orderedModifiers.length; index++) {\n if (state.reset === true) {\n state.reset = false;\n index = -1;\n continue;\n }\n\n var _state$orderedModifie = state.orderedModifiers[index],\n fn = _state$orderedModifie.fn,\n _state$orderedModifie2 = _state$orderedModifie.options,\n _options = _state$orderedModifie2 === void 0 ? {} : _state$orderedModifie2,\n name = _state$orderedModifie.name;\n\n if (typeof fn === 'function') {\n state = fn({\n state: state,\n options: _options,\n name: name,\n instance: instance\n }) || state;\n }\n }\n },\n // Async and optimistically optimized update – it will not be executed if\n // not necessary (debounced to run at most once-per-tick)\n update: debounce(function () {\n return new Promise(function (resolve) {\n instance.forceUpdate();\n resolve(state);\n });\n }),\n destroy: function destroy() {\n cleanupModifierEffects();\n isDestroyed = true;\n }\n };\n\n if (!areValidElements(reference, popper)) {\n return instance;\n }\n\n instance.setOptions(options).then(function (state) {\n if (!isDestroyed && options.onFirstUpdate) {\n options.onFirstUpdate(state);\n }\n }); // Modifiers have the ability to execute arbitrary code before the first\n // update cycle runs. They will be executed in the same order as the update\n // cycle. This is useful when a modifier adds some persistent data that\n // other modifiers need to use, but the modifier is run after the dependent\n // one.\n\n function runModifierEffects() {\n state.orderedModifiers.forEach(function (_ref) {\n var name = _ref.name,\n _ref$options = _ref.options,\n options = _ref$options === void 0 ? {} : _ref$options,\n effect = _ref.effect;\n\n if (typeof effect === 'function') {\n var cleanupFn = effect({\n state: state,\n name: name,\n instance: instance,\n options: options\n });\n\n var noopFn = function noopFn() {};\n\n effectCleanupFns.push(cleanupFn || noopFn);\n }\n });\n }\n\n function cleanupModifierEffects() {\n effectCleanupFns.forEach(function (fn) {\n return fn();\n });\n effectCleanupFns = [];\n }\n\n return instance;\n };\n}\nexport var createPopper = /*#__PURE__*/popperGenerator(); // eslint-disable-next-line import/no-unused-modules\n\nexport { detectOverflow };","import { popperGenerator, detectOverflow } from \"./createPopper.js\";\nimport eventListeners from \"./modifiers/eventListeners.js\";\nimport popperOffsets from \"./modifiers/popperOffsets.js\";\nimport computeStyles from \"./modifiers/computeStyles.js\";\nimport applyStyles from \"./modifiers/applyStyles.js\";\nimport offset from \"./modifiers/offset.js\";\nimport flip from \"./modifiers/flip.js\";\nimport preventOverflow from \"./modifiers/preventOverflow.js\";\nimport arrow from \"./modifiers/arrow.js\";\nimport hide from \"./modifiers/hide.js\";\nvar defaultModifiers = [eventListeners, popperOffsets, computeStyles, applyStyles, offset, flip, preventOverflow, arrow, hide];\nvar createPopper = /*#__PURE__*/popperGenerator({\n defaultModifiers: defaultModifiers\n}); // eslint-disable-next-line import/no-unused-modules\n\nexport { createPopper, popperGenerator, defaultModifiers, detectOverflow }; // eslint-disable-next-line import/no-unused-modules\n\nexport { createPopper as createPopperLite } from \"./popper-lite.js\"; // eslint-disable-next-line import/no-unused-modules\n\nexport * from \"./modifiers/index.js\";","import { useRef, useEffect } from 'react';\n/**\r\n * Creates DOM element to be used as React root.\r\n */\nfunction createRootElement(id) {\n var rootContainer = document.createElement('div');\n rootContainer.setAttribute('id', id);\n return rootContainer;\n}\n\n/**\r\n * Appends element as last child of body.\r\n */\nfunction addRootElement(rootElem) {\n document.body.append(rootElem);\n}\n\n/**\r\n * Hook to create a React Portal.\r\n * Automatically handles creating and tearing-down the root elements (no SRR\r\n * makes this trivial), so there is no need to ensure the parent target already\r\n * exists.\r\n * @example\r\n * const target = usePortal(id, [id]);\r\n * return createPortal(children, target);\r\n * @param {String} id The id of the target container, e.g 'modal' or 'spotlight'\r\n * @returns {HTMLElement} The DOM node to use as the Portal target.\r\n */\nfunction usePortal(id) {\n var rootElemRef = useRef(null);\n useEffect(function () {\n // Look for existing target dom element to append to\n var existingParent = document.querySelector(\"#\".concat(id));\n // Parent is either a new root or the existing dom element\n var parentElem = existingParent || createRootElement(id);\n\n // If there is no existing DOM element, add a new one.\n if (!existingParent) {\n addRootElement(parentElem);\n }\n\n // Add the detached element to the parent\n if (rootElemRef.current) {\n parentElem.append(rootElemRef.current);\n }\n return function removeElement() {\n if (rootElemRef.current) {\n rootElemRef.current.remove();\n }\n if (parentElem.childNodes.length === -1) {\n parentElem.remove();\n }\n };\n }, []);\n\n /**\r\n * It's important we evaluate this lazily:\r\n * - We need first render to contain the DOM element, so it shouldn't happen\r\n * in useEffect. We would normally put this in the constructor().\r\n * - We can't do 'const rootElemRef = useRef(document.createElement('div))',\r\n * since this will run every single render (that's a lot).\r\n * - We want the ref to consistently point to the same DOM element and only\r\n * ever run once.\r\n * @link https://reactjs.org/docs/hooks-faq.html#how-to-create-expensive-objects-lazily\r\n */\n function getRootElem() {\n if (!rootElemRef.current) {\n rootElemRef.current = document.createElement('div');\n }\n return rootElemRef.current;\n }\n return getRootElem();\n}\nexport default usePortal;\nexport { usePortal };","export var Position = {\n AutoStart: 'auto-start',\n Auto: 'auto',\n AutoEnd: 'auto-end',\n TopStart: 'top-start',\n Top: 'top',\n TopEnd: 'top-end',\n BottomStart: 'bottom-start',\n Bottom: 'bottom',\n BottomEnd: 'bottom-end',\n LeftStart: 'left-start',\n Left: 'left',\n LeftEnd: 'left-end',\n RightStart: 'right-start',\n Right: 'right',\n RightEnd: 'right-end'\n};","export var Strategy = {\n Absloute: 'absolute',\n Fixed: 'fixed'\n};","import _defineProperty from \"@babel/runtime/helpers/defineProperty\";\nvar _PopperMixin;\nimport { css } from 'styled-components';\nimport { Position } from './types';\nexport var PopperMixin = (_PopperMixin = {}, _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_PopperMixin, Position.Auto, css([\"top:0px;bottom:0px;left:0px;right:0px;\"])), Position.AutoEnd, css([\"top:0px;bottom:0px;left:0px;right:0px;\"])), Position.AutoStart, css([\"top:0px;bottom:0px;left:0px;right:0px;\"])), Position.Right, css([\"left:-4px;\"])), Position.RightEnd, css([\"left:-4px;\"])), Position.RightStart, css([\"left:-4px;\"])), Position.Left, css([\"right:-4px;\"])), Position.LeftEnd, css([\"right:-4px;\"])), Position.LeftStart, css([\"right:-4px;\"])), Position.Top, css([\"bottom:-4px;\"])), _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_PopperMixin, Position.TopEnd, css([\"bottom:-4px;\"])), Position.TopStart, css([\"bottom:-4px;\"])), Position.Bottom, css([\"top:-4px;\"])), Position.BottomEnd, css([\"top:-4px;\"])), Position.BottomStart, css([\"top:-4px;\"])));","import styled, { css } from 'styled-components';\nimport { generateClassNames, applyDisplayNames } from '../../utils/functions';\nimport { Color as PColor } from '../../utils/types/palette';\nimport { PopperMixin } from './popper.mixin';\nimport { Position } from './types';\nvar baseClassName = 'Popper';\nvar Popper = /*#__PURE__*/styled.div.attrs({\n className: generateClassNames(baseClassName, 'root')\n}).withConfig({\n componentId: \"sc-1373tsp-0\"\n})([\"\"]);\nvar PopperWrapper = /*#__PURE__*/styled.div.attrs({\n className: generateClassNames(baseClassName, 'wrapper')\n}).withConfig({\n componentId: \"sc-1373tsp-1\"\n})(function (_ref) {\n var zIndex = _ref.zIndex;\n return css([\"position:relative;z-index:\", \";\"], zIndex);\n});\nvar Arrow = /*#__PURE__*/styled.div.attrs({\n className: generateClassNames(baseClassName, 'arrow')\n}).withConfig({\n componentId: \"sc-1373tsp-2\"\n})(function (_ref2) {\n var _ref2$warning = _ref2.warning,\n warning = _ref2$warning === void 0 ? false : _ref2$warning,\n _ref2$position = _ref2.position,\n position = _ref2$position === void 0 ? Position.Right : _ref2$position,\n theme = _ref2.theme;\n return css([\"width:8px;height:8px;position:absolute;&::before{content:'';background:\", \";width:8px;height:8px;transform:rotate(45deg);position:absolute;top:0;left:0;z-index:-1;}\", \"\"], warning ? theme.palette[PColor.BackgroundOrange] : theme.palette[PColor.BackgroundGrey], PopperMixin[position]);\n});\nvar Overlay = /*#__PURE__*/styled.div.attrs({\n className: generateClassNames(baseClassName, 'Overlay')\n}).withConfig({\n componentId: \"sc-1373tsp-3\"\n})(function () {\n return css([\"position:fixed;right:0;bottom:0;top:0;left:0;background-color:transparent;\"]);\n});\nvar Styled = applyDisplayNames({\n Popper: Popper,\n Overlay: Overlay,\n Arrow: Arrow,\n PopperWrapper: PopperWrapper\n});\nexport default Styled;","import _extends from \"@babel/runtime/helpers/extends\";\nimport _defineProperty from \"@babel/runtime/helpers/defineProperty\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/objectWithoutProperties\";\nvar _excluded = [\"anchorEl\", \"children\", \"open\", \"warning\", \"position\", \"arrow\", \"popperOptions\", \"onClick\", \"overlay\", \"zIndex\", \"enableUnderlayingEvent\", \"wrapperStyles\"];\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nimport React, { useRef, useEffect } from 'react';\nimport { createPortal } from 'react-dom';\nimport PT from 'prop-types';\nimport { createPopper } from '@popperjs/core';\nimport usePortal from '../../hooks/use-portal';\nimport { intrinsicComponent, generateClassNames, useForkRef, objectValues } from '../../utils/functions';\nimport { Position, Strategy } from './types';\nimport Styled from './popper.styles';\nvar Popper = intrinsicComponent(function (_ref, ref) {\n var anchorEl = _ref.anchorEl,\n children = _ref.children,\n open = _ref.open,\n _ref$warning = _ref.warning,\n warning = _ref$warning === void 0 ? false : _ref$warning,\n _ref$position = _ref.position,\n initialPlacement = _ref$position === void 0 ? 'bottom' : _ref$position,\n _ref$arrow = _ref.arrow,\n arrow = _ref$arrow === void 0 ? false : _ref$arrow,\n popperOptions = _ref.popperOptions,\n onClick = _ref.onClick,\n _ref$overlay = _ref.overlay,\n overlay = _ref$overlay === void 0 ? false : _ref$overlay,\n _ref$zIndex = _ref.zIndex,\n zIndex = _ref$zIndex === void 0 ? 1300 : _ref$zIndex,\n enableUnderlayingEvent = _ref.enableUnderlayingEvent,\n _ref$wrapperStyles = _ref.wrapperStyles,\n wrapperStyles = _ref$wrapperStyles === void 0 ? {} : _ref$wrapperStyles,\n rest = _objectWithoutProperties(_ref, _excluded);\n var target = usePortal(generateClassNames('Popper'));\n var popperRef = useRef(null);\n var handlePopperRef = useForkRef(popperRef, ref);\n useEffect(function () {\n if (!anchorEl || !open || popperRef.current === null) {\n return undefined;\n }\n var defaultModifiers = [{\n name: 'arrow',\n options: {\n element: '[data-popper-arrow]'\n }\n }, {\n name: 'offset',\n options: {\n offset: [0, 10]\n }\n }];\n var popperModifiers = arrow ? defaultModifiers : [];\n if (popperOptions && popperOptions.modifiers != null) {\n popperModifiers = popperModifiers.concat(popperOptions.modifiers);\n }\n var popper = createPopper(anchorEl, popperRef.current, _objectSpread(_objectSpread({\n placement: initialPlacement\n }, popperOptions), {}, {\n modifiers: popperModifiers\n }));\n handlePopperRef.current = popper;\n return function () {\n popper.destroy();\n handlePopperRef.current = null;\n };\n }, [anchorEl, open, popperOptions, initialPlacement, arrow]);\n var passEventToUnderlayingEvent = function passEventToUnderlayingEvent(event) {\n setTimeout(function () {\n if (event.clientX && event.clientY) {\n var elem = document.elementFromPoint(event.clientX, event.clientY);\n if (elem) {\n elem.dispatchEvent(event.nativeEvent);\n }\n }\n }, 0);\n };\n var handleOnClicking = function handleOnClicking(event) {\n event.persist();\n event.preventDefault();\n event.stopPropagation();\n if (onClick) {\n onClick(event);\n }\n if (enableUnderlayingEvent) {\n passEventToUnderlayingEvent(event);\n }\n };\n var renderOverlay = function renderOverlay() {\n return /*#__PURE__*/React.createElement(Styled.Overlay, {\n onClick: handleOnClicking,\n onContextMenu: handleOnClicking\n });\n };\n if (!open) {\n return /*#__PURE__*/React.createElement(\"div\", {\n hidden: true,\n ref: handlePopperRef\n });\n }\n var render = function render() {\n var _handlePopperRef$stat;\n return /*#__PURE__*/React.createElement(Styled.PopperWrapper, {\n zIndex: zIndex,\n style: _objectSpread({}, wrapperStyles)\n }, overlay && renderOverlay(), /*#__PURE__*/React.createElement(Styled.Popper, _extends({\n ref: handlePopperRef\n }, rest), children, arrow && /*#__PURE__*/React.createElement(Styled.Arrow, {\n warning: warning,\n \"data-popper-arrow\": true,\n position: (handlePopperRef === null || handlePopperRef === void 0 || (_handlePopperRef$stat = handlePopperRef.state) === null || _handlePopperRef$stat === void 0 ? void 0 : _handlePopperRef$stat.placement) || initialPlacement\n })));\n };\n return /*#__PURE__*/createPortal(render(), target);\n});\nPopper.defaultProps = {};\nexport var propTypes = {\n anchorEl: PT.oneOfType([PT.instanceOf(Element), PT.object]),\n popperOptions: PT.shape({\n modifiers: PT.arrayOf(PT.shape({\n data: PT.object,\n effect: PT.func,\n enabled: PT.bool,\n fn: PT.func,\n name: PT.any.isRequired,\n options: PT.object,\n phase: PT.oneOf(['afterMain', 'afterRead', 'afterWrite', 'beforeMain', 'beforeRead', 'beforeWrite', 'main', 'read', 'write']),\n requires: PT.arrayOf(PT.string),\n requiresIfExists: PT.arrayOf(PT.string)\n })),\n onFirstUpdate: PT.func,\n placement: PT.oneOf(objectValues(Position)),\n strategy: PT.oneOf(objectValues(Strategy))\n }),\n overlay: PT.bool,\n warning: PT.bool,\n arrow: PT.bool,\n zIndex: PT.number,\n enableUnderlayingEvent: PT.bool,\n wrapperStyles: PT.object\n};\nPopper.propTypes = propTypes;\nexport default Popper;","import styled, { css, keyframes } from 'styled-components';\nimport { generateClassNames, applyDisplayNames, scrollBar } from '../../utils/functions';\nimport { Color as PColor } from '../../utils/types/palette';\nimport { BorderRadiusSize as BRSize } from '../../utils/types/shape';\nvar baseClassName = 'Menu';\nvar Overlay = /*#__PURE__*/styled.div.attrs({\n className: generateClassNames(baseClassName, 'Overlay')\n}).withConfig({\n componentId: \"sc-10okxhw-0\"\n})(function () {\n return css([\"position:fixed;right:0;bottom:0;top:0;left:0;background-color:transparent;z-index:-1;\"]);\n});\nvar opacityKeyframes = /*#__PURE__*/keyframes([\"from{opacity:0;}to{opacity:1;}\"]);\nvar transformKeyframes = /*#__PURE__*/keyframes([\"from{transform:scale(0.97);margin-top:0px;}to{transform:scale(1);margin-top:4px;}\"]);\nvar fadeInAnimation = /*#__PURE__*/css([\"animation:\", \" 250ms 0ms cubic-bezier(0.4,0,0.2,1),\", \" 250ms cubic-bezier(0.4,0,0.2,1);\"], opacityKeyframes, transformKeyframes);\nvar Menu = /*#__PURE__*/styled.div.attrs({\n className: generateClassNames(baseClassName, 'root')\n}).withConfig({\n componentId: \"sc-10okxhw-1\"\n})(function (_ref) {\n var rect = _ref.rect,\n theme = _ref.theme,\n scroll = _ref.scroll,\n _ref$maxHeight = _ref.maxHeight,\n maxHeight = _ref$maxHeight === void 0 ? '' : _ref$maxHeight;\n return css([\"min-width:\", \"px;width:195px;min-height:16px;overflow-x:hidden;overflow-y:auto;transition:opacity 250ms cubic-bezier(0.4,0,0,1),transform 250ms cubic-bezier(0.4,0,0,1),margin-top 250ms cubic-bezier(0.4,0,0,1);outline:0;box-shadow:0 2px 4px \", \";border-radius:\", \";\", \" \", \" margin-top:4px;\", \"\"], rect.width, theme.palette[PColor.MediumShadow], theme.shape.borderRadius[BRSize.Md], scroll && scrollBar, maxHeight && css([\"max-height:\", \";\"], Number.isNaN(+maxHeight) ? maxHeight : \"\".concat(maxHeight, \"px\")), fadeInAnimation);\n});\nvar Styled = applyDisplayNames({\n Menu: Menu,\n Overlay: Overlay\n});\nexport default Styled;","import _extends from \"@babel/runtime/helpers/extends\";\nimport _defineProperty from \"@babel/runtime/helpers/defineProperty\";\nimport _slicedToArray from \"@babel/runtime/helpers/slicedToArray\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/objectWithoutProperties\";\nvar _excluded = [\"id\", \"children\", \"open\", \"fullWidth\", \"anchorElPosition\", \"anchorEl\", \"onClose\", \"containerProps\", \"alignCenter\", \"maxHeight\", \"position\", \"popperOptions\", \"enableOverlay\", \"zIndex\", \"hideScroll\", \"scroll\", \"enableUnderlayingEvent\", \"popperWrapperStyles\"];\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nimport React, { useState, useEffect, useCallback, useRef } from 'react';\nimport PT from 'prop-types';\nimport { intrinsicComponent, objectValues } from '../../utils/functions';\nimport { propTypes as popperPropTypes } from '../popper/popper.component';\nimport { Position } from '../popper/types';\nimport Popper from '../popper';\nimport Styled from './menu.styles';\nvar Menu = intrinsicComponent(function (_ref, ref) {\n var id = _ref.id,\n children = _ref.children,\n open = _ref.open,\n fullWidth = _ref.fullWidth,\n anchorElPosition = _ref.anchorElPosition,\n anchorEl = _ref.anchorEl,\n onClose = _ref.onClose,\n containerProps = _ref.containerProps,\n alignCenter = _ref.alignCenter,\n maxHeight = _ref.maxHeight,\n position = _ref.position,\n popperOptions = _ref.popperOptions,\n _ref$enableOverlay = _ref.enableOverlay,\n enableOverlay = _ref$enableOverlay === void 0 ? true : _ref$enableOverlay,\n zIndex = _ref.zIndex,\n _ref$hideScroll = _ref.hideScroll,\n hideScroll = _ref$hideScroll === void 0 ? true : _ref$hideScroll,\n _ref$scroll = _ref.scroll,\n scroll = _ref$scroll === void 0 ? true : _ref$scroll,\n _ref$enableUnderlayin = _ref.enableUnderlayingEvent,\n enableUnderlayingEvent = _ref$enableUnderlayin === void 0 ? false : _ref$enableUnderlayin,\n _ref$popperWrapperSty = _ref.popperWrapperStyles,\n popperWrapperStyles = _ref$popperWrapperSty === void 0 ? {} : _ref$popperWrapperSty,\n rest = _objectWithoutProperties(_ref, _excluded);\n var _useState = useState(null),\n _useState2 = _slicedToArray(_useState, 2),\n timeout = _useState2[0],\n setTimeoutState = _useState2[1];\n var _useState3 = useState(new DOMRect()),\n _useState4 = _slicedToArray(_useState3, 2),\n rect = _useState4[0],\n setRect = _useState4[1];\n var menuRef = useRef(null);\n var updateRect = useCallback(function () {\n var _anchorEl$getBounding;\n var defaultPosition = _objectSpread({\n top: 0,\n left: 0,\n height: 0,\n width: 0\n }, anchorElPosition || {});\n var defaultRect = new DOMRect(defaultPosition.left, defaultPosition.top, defaultPosition.width, defaultPosition.height);\n setRect((_anchorEl$getBounding = anchorEl === null || anchorEl === void 0 ? void 0 : anchorEl.getBoundingClientRect()) !== null && _anchorEl$getBounding !== void 0 ? _anchorEl$getBounding : defaultRect);\n }, [open, timeout, anchorEl]);\n var handleWindowSizeChanged = useCallback(function () {\n if (open) {\n if (timeout) {\n clearTimeout(timeout);\n }\n setTimeoutState(setTimeout(updateRect, 300));\n }\n }, [open, timeout]);\n useEffect(function () {\n window.addEventListener('resize', handleWindowSizeChanged);\n return function () {\n window.removeEventListener('resize', handleWindowSizeChanged);\n };\n }, [handleWindowSizeChanged]);\n useEffect(function () {\n updateRect();\n }, [anchorElPosition, updateRect]);\n useEffect(function () {\n if (hideScroll) {\n if (open) {\n document.body.classList.add('Menu-open');\n updateRect();\n } else {\n document.body.classList.remove('Menu-open');\n }\n return function () {\n document.body.classList.remove('Menu-open');\n };\n }\n }, [open, updateRect]);\n var handleClose = function handleClose(event) {\n if (typeof onClose === 'function') {\n onClose(event);\n }\n };\n return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Popper, {\n ref: menuRef,\n position: position || 'bottom-start',\n open: Boolean(anchorEl),\n anchorEl: anchorEl,\n overlay: Boolean(enableOverlay),\n onClick: handleClose,\n popperOptions: popperOptions,\n zIndex: zIndex,\n enableUnderlayingEvent: enableUnderlayingEvent,\n wrapperStyles: popperWrapperStyles\n }, /*#__PURE__*/React.createElement(Styled.Menu, _extends({}, containerProps, {\n alignCenter: Boolean(alignCenter),\n scroll: scroll,\n rect: rect\n }, rest, {\n ref: ref,\n maxHeight: maxHeight\n }), children)));\n});\nexport var defaultProps = {\n open: false,\n containerProps: {},\n maxHeight: 250,\n position: Position.BottomStart,\n enableOverlay: true,\n hideScroll: true,\n scroll: true\n};\nMenu.defaultProps = defaultProps;\nexport var propTypes = {\n anchorElPosition: PT.shape({\n left: PT.number,\n right: PT.number,\n top: PT.number,\n bottom: PT.number\n }),\n anchorEl: PT.instanceOf(Element),\n open: PT.bool,\n fullWidth: PT.bool,\n onClose: PT.func,\n id: PT.string,\n containerProps: PT.object,\n alignCenter: PT.bool,\n maxHeight: PT.oneOfType([PT.string, PT.number]),\n popperOptions: popperPropTypes.popperOptions,\n position: PT.oneOf(objectValues(Position)),\n enableOverlay: PT.bool,\n zIndex: PT.number,\n hideScroll: PT.bool,\n scroll: PT.bool,\n enableUnderlayingEvent: PT.bool,\n popperWrapperStyles: PT.object,\n style: PT.object\n};\nMenu.propTypes = propTypes;\nexport default Menu;","export var Size = {\n Sm: 'sm',\n Md: 'md'\n};","import _defineProperty from \"@babel/runtime/helpers/defineProperty\";\nimport { css } from 'styled-components';\n// import type { With } from '../../utils/types';\n\n// import { Color as PaletteColor } from '../../utils/types/palette';\nimport { FontVariant as FV } from '../../utils/types/typography';\nimport { Size } from './types';\nexport var sizeMenuItemMixin = _defineProperty(_defineProperty({}, Size.Sm, function (_ref) {\n var font = _ref.theme.typography.font;\n return css([\"padding:8px 16px;min-height:32px;\", \"\"], font[FV.LabelMedium]);\n}), Size.Md, function (_ref2) {\n var font = _ref2.theme.typography.font;\n return css([\"padding:11px 16px;min-height:40px;\", \"\"], font[FV.LabelLarge]);\n});","import styled, { css } from 'styled-components';\nimport { generateClassNames, applyDisplayNames } from '../../utils/functions';\nimport { Color as PColor } from '../../utils/types/palette';\n// import { BorderRadiusSize as BRSize } from '../../utils/types/shape';\n\nimport { sizeMenuItemMixin } from './menu-item.mixin';\nimport { Size } from './types';\nvar baseClassName = 'MenuItem';\nvar Icon = /*#__PURE__*/styled.span.attrs({\n className: generateClassNames(baseClassName, 'Icon')\n}).withConfig({\n componentId: \"sc-rrzye0-0\"\n})(function (_ref) {\n var palette = _ref.theme.palette,\n disabled = _ref.disabled;\n return css([\"flex-shrink:0;margin-right:10px;color:\", \";\"], disabled ? palette[PColor.TextPlaceholder] : palette[PColor.IconsPrimary]);\n});\nvar Actions = /*#__PURE__*/styled(Icon).attrs({\n className: generateClassNames(baseClassName, 'Actions')\n}).withConfig({\n componentId: \"sc-rrzye0-1\"\n})(function () {\n return css([\"margin-right:0px;margin-left:16px;\"]);\n});\nvar Label = /*#__PURE__*/styled.span.attrs({\n className: generateClassNames(baseClassName, 'Label')\n}).withConfig({\n componentId: \"sc-rrzye0-2\"\n})([\"align-items:center;column-gap:4px;flex-grow:1;\"]);\nvar MenuItemWrapper = /*#__PURE__*/styled.div.attrs({\n className: generateClassNames(baseClassName, 'wrapper')\n}).withConfig({\n componentId: \"sc-rrzye0-3\"\n})(function (_ref2) {\n var _ref2$divider = _ref2.divider,\n divider = _ref2$divider === void 0 ? false : _ref2$divider,\n _ref2$noOptionsText = _ref2.noOptionsText,\n noOptionsText = _ref2$noOptionsText === void 0 ? false : _ref2$noOptionsText,\n _ref2$disabled = _ref2.disabled,\n disabled = _ref2$disabled === void 0 ? false : _ref2$disabled,\n theme = _ref2.theme;\n return css([\"\", \" \", \"\"], divider && css([\"width:100%;height:1px;background:\", \";box-sizing:border-box;\"], theme.palette[PColor.BordersSecondary]), (noOptionsText || disabled) && css([\"color:\", \";\"], theme.palette[PColor.ButtonDisabledText]));\n});\nvar MenuItem = /*#__PURE__*/styled.div.attrs({\n className: generateClassNames(baseClassName, 'root')\n}).withConfig({\n componentId: \"sc-rrzye0-4\"\n})(function (_ref3) {\n var _ref3$size = _ref3.size,\n size = _ref3$size === void 0 ? Size.Sm : _ref3$size,\n active = _ref3.active,\n theme = _ref3.theme,\n _ref3$disableHover = _ref3.disableHover,\n disableHover = _ref3$disableHover === void 0 ? false : _ref3$disableHover,\n noOptionsText = _ref3.noOptionsText,\n disabled = _ref3.disabled;\n return css([\"display:flex;justify-content:space-between;flex-direction:row;align-items:center;width:100%;background:\", \";color:\", \";cursor:pointer;box-sizing:border-box;transition:all 100ms ease-out;\", \" &:focus-within,&:focus,&:hover{\", \";\", \"}\", \"\"], theme.palette[active ? PColor.BackgroundActive : PColor.BackgroundSecondary], theme.palette[PColor.TextPrimary], sizeMenuItemMixin[size], !disableHover && \"background-color: \".concat(theme.palette[PColor.BackgroundHover]), (noOptionsText || disabled) && css([\"cursor:default;background-color:white;\"]), (noOptionsText || disabled) && css([\"& > svg{path{fill:\", \";}}color:\", \";\"], theme.palette[PColor.ButtonDisabledText], theme.palette[PColor.ButtonDisabledText]));\n});\nvar MenuPrefix = /*#__PURE__*/styled.div.attrs({\n className: generateClassNames(baseClassName, 'prefix')\n}).withConfig({\n componentId: \"sc-rrzye0-5\"\n})(function () {\n return css([\"display:flex;\"]);\n});\nvar MenuContent = /*#__PURE__*/styled.div.attrs({\n className: generateClassNames(baseClassName, 'content')\n}).withConfig({\n componentId: \"sc-rrzye0-6\"\n})(function () {\n return css([\"flex-grow:1;line-height:16px;\"]);\n});\nvar MenuSuffix = /*#__PURE__*/styled.div.attrs({\n className: generateClassNames(baseClassName, 'suffix')\n}).withConfig({\n componentId: \"sc-rrzye0-7\"\n})(function () {\n return css([\"display:flex;margin-left:8px;\"]);\n});\nvar Styled = applyDisplayNames({\n MenuItemWrapper: MenuItemWrapper,\n MenuItem: MenuItem,\n MenuPrefix: MenuPrefix,\n MenuContent: MenuContent,\n MenuSuffix: MenuSuffix,\n Label: Label,\n Icon: Icon,\n Actions: Actions\n});\nexport default Styled;","import _defineProperty from \"@babel/runtime/helpers/defineProperty\";\nimport _extends from \"@babel/runtime/helpers/extends\";\nimport _slicedToArray from \"@babel/runtime/helpers/slicedToArray\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/objectWithoutProperties\";\nvar _excluded = [\"list\", \"depth\", \"children\", \"disableHover\", \"noOptionsText\", \"disabled\", \"enableScrollIntoView\"];\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nimport React, { useRef, useEffect } from 'react';\nimport Arrow from '@scaleflex/icons/arrow';\nimport PT from 'prop-types';\nimport { intrinsicComponent, objectValues } from '../../utils/functions';\nimport Menu from '../menu';\nimport { Size } from './types';\nimport Styled from './menu-item.styles';\nvar MenuItem = intrinsicComponent(function (_ref, ref) {\n var list = _ref.list,\n _ref$depth = _ref.depth,\n depth = _ref$depth === void 0 ? 0 : _ref$depth,\n children = _ref.children,\n disableHover = _ref.disableHover,\n noOptionsText = _ref.noOptionsText,\n disabled = _ref.disabled,\n enableScrollIntoView = _ref.enableScrollIntoView,\n props = _objectWithoutProperties(_ref, _excluded);\n var menuItemRef = useRef(null);\n var _React$useState = React.useState(null),\n _React$useState2 = _slicedToArray(_React$useState, 2),\n anchorEl = _React$useState2[0],\n setAnchorEl = _React$useState2[1];\n var _React$useState3 = React.useState([]),\n _React$useState4 = _slicedToArray(_React$useState3, 2),\n selectedIds = _React$useState4[0],\n setSelectedIds = _React$useState4[1];\n var handleOpenMenu = function handleOpenMenu(event) {\n setAnchorEl(event.currentTarget);\n };\n var handleScroll = function handleScroll() {\n var _menuItemRef$current;\n (_menuItemRef$current = menuItemRef.current) === null || _menuItemRef$current === void 0 || _menuItemRef$current.scrollIntoView({\n behavior: 'auto',\n block: 'nearest'\n });\n };\n useEffect(function () {\n if (props.active && enableScrollIntoView) {\n handleScroll();\n }\n }, [props.active]);\n var handleSelectedId = function handleSelectedId(ev, selected, depthLevel) {\n var updatedArray = selectedIds.slice(0);\n updatedArray[depthLevel] = selected;\n setSelectedIds(updatedArray);\n handleOpenMenu(ev);\n };\n var handleCloseSubMenu = function handleCloseSubMenu(depthLevel) {\n var updatedArray = selectedIds.slice(0);\n updatedArray[depthLevel] = '';\n setSelectedIds(updatedArray);\n setAnchorEl(null);\n };\n var renderItems = function renderItems(options) {\n var depthLevel = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;\n return options.map(function (option) {\n var hasOptions = option.subList && option.subList.length > 0;\n var subMenu;\n if (selectedIds[depthLevel] === option.key && hasOptions) {\n var newDepthLevel = depthLevel + 1;\n subMenu = /*#__PURE__*/React.createElement(Menu, _extends({\n key: option.key,\n position: \"right\",\n open: Boolean(anchorEl),\n anchorEl: anchorEl,\n enableOverlay: false\n }, option.subMenuProps), /*#__PURE__*/React.createElement(MenuItem, _extends({\n list: option.subList,\n depth: newDepthLevel\n }, props)));\n }\n if (option.content === 'divider') {\n return /*#__PURE__*/React.createElement(Styled.MenuItemWrapper, {\n divider: true,\n key: option.key\n });\n }\n return /*#__PURE__*/React.createElement(Styled.MenuItemWrapper, _extends({\n disabled: false,\n key: option.key,\n onMouseLeave: function onMouseLeave() {\n return handleCloseSubMenu(depthLevel);\n }\n }, props), /*#__PURE__*/React.createElement(Styled.MenuItem, _extends({}, props, {\n className: option.className,\n ref: ref,\n active: Boolean(option.active),\n onClick: option.onClick ? function (event) {\n return option.onClick(_objectSpread({\n event: event\n }, props));\n } : undefined,\n onMouseEnter: function onMouseEnter(ev) {\n return handleSelectedId(ev, option.key, depthLevel);\n },\n disableHover: disableHover || option.disableHover\n }), option.prefix && /*#__PURE__*/React.createElement(Styled.MenuPrefix, null, typeof option.prefix === 'function' ? option.prefix(props) : option.prefix), option.content && /*#__PURE__*/React.createElement(Styled.MenuContent, null, typeof option.content === 'function' ? option.content(props) : option.content), (option.suffix || option.subList) && /*#__PURE__*/React.createElement(Styled.MenuSuffix, null, typeof option.suffix === 'function' ? option.suffix(props) : option.suffix, option.subList && /*#__PURE__*/React.createElement(Arrow, {\n size: 10,\n color: \"#768A9F\"\n }))), subMenu);\n });\n };\n if (!list) {\n if (props.value === 'divider') {\n return /*#__PURE__*/React.createElement(Styled.MenuItemWrapper, {\n divider: true,\n key: props.value\n });\n }\n return /*#__PURE__*/React.createElement(Styled.MenuItemWrapper, {\n noOptionsText: Boolean(noOptionsText),\n disabled: Boolean(disabled)\n }, /*#__PURE__*/React.createElement(Styled.MenuItem, _extends({}, props, {\n ref: menuItemRef,\n disableHover: disableHover,\n noOptionsText: noOptionsText,\n disabled: disabled\n }), children));\n }\n return /*#__PURE__*/React.createElement(React.Fragment, null, renderItems(list, depth));\n});\nMenuItem.displayName = 'MenuItem';\nexport var defaultProps = {\n size: Size.Sm,\n active: false\n};\nMenuItem.defaultProps = defaultProps;\nMenuItem.propTypes = {\n size: PT.oneOf(objectValues(Size)),\n children: PT.oneOfType([PT.node, PT.func]),\n active: PT.bool,\n value: PT.oneOfType([PT.string, PT.number, PT.bool, PT.oneOf([null])]),\n depth: PT.number,\n disableHover: PT.bool,\n noOptionsText: PT.bool,\n disabled: PT.bool,\n enableScrollIntoView: PT.bool\n};\nexport default MenuItem;\n// list: PT.arrayOf(\n// PT.shape({\n// key: PT.string.isRequired,\n// content: PT.oneOfType([PT.string, PT.node]).isRequired,\n// prefix: PT.oneOfType([PT.string, PT.node]),\n// subList: PT.arrayOf(PT.object),\n// suffix: PT.oneOfType([PT.string, PT.node]),\n// onClick: PT.func,\n// disabled: PT.bool,\n// })\n// ),","import _extends from \"@babel/runtime/helpers/extends\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/objectWithoutProperties\";\nvar _excluded = [\"children\", \"disabled\", \"size\"];\nimport React from 'react';\nimport PT from 'prop-types';\nimport { intrinsicComponent, objectValues } from '../../utils/functions';\nimport { Size } from './types';\nimport Styled from './menu-item.styles';\nvar getIconSize = function getIconSize(sizeName) {\n switch (sizeName) {\n case Size.Md:\n return 16;\n case Size.Sm:\n default:\n return 14;\n }\n};\nvar MenuItemIcon = intrinsicComponent(function (_ref, ref) {\n var children = _ref.children,\n disabled = _ref.disabled,\n _ref$size = _ref.size,\n size = _ref$size === void 0 ? Size.Md : _ref$size,\n rest = _objectWithoutProperties(_ref, _excluded);\n return /*#__PURE__*/React.createElement(Styled.Icon, _extends({\n disabled: disabled\n }, rest, {\n ref: ref\n }), children && typeof children === 'function' ? children({\n size: getIconSize(size)\n }) : children);\n});\nMenuItemIcon.defaultProps = {\n size: Size.Md\n};\nMenuItemIcon.propTypes = {\n size: PT.oneOf(objectValues(Size)),\n children: PT.oneOfType([PT.node, PT.func]).isRequired,\n disabled: PT.bool\n};\nexport default MenuItemIcon;","import _extends from \"@babel/runtime/helpers/extends\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/objectWithoutProperties\";\nvar _excluded = [\"children\"];\nimport React from 'react';\nimport { intrinsicComponent } from '../../utils/functions';\nimport Styled from './menu-item.styles';\nvar MenuItemLabel = intrinsicComponent(function (_ref, ref) {\n var children = _ref.children,\n rest = _objectWithoutProperties(_ref, _excluded);\n return /*#__PURE__*/React.createElement(Styled.Label, _extends({}, rest, {\n ref: ref\n }), children);\n});\nMenuItemLabel.displayName = 'MenuItemLabel';\nexport default MenuItemLabel;","import _extends from \"@babel/runtime/helpers/extends\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/objectWithoutProperties\";\nvar _excluded = [\"children\"];\nimport React from 'react';\nimport PT from 'prop-types';\nimport { intrinsicComponent, objectValues } from '../../utils/functions';\nimport { Size } from './types';\nimport Styled from './menu-item.styles';\nvar MenuItemActions = intrinsicComponent(function (_ref, ref) {\n var children = _ref.children,\n rest = _objectWithoutProperties(_ref, _excluded);\n return /*#__PURE__*/React.createElement(Styled.Actions, _extends({}, rest, {\n ref: ref\n }), children && typeof children === 'function' ? children({\n size: rest.size\n }) : children);\n});\nMenuItemActions.displayName = 'MenuItemActions';\nMenuItemActions.defaultProps = {\n size: Size.Md\n};\nMenuItemActions.propTypes = {\n size: PT.oneOf(objectValues(Size)),\n children: PT.oneOfType([PT.node, PT.func]).isRequired\n};\nexport default MenuItemActions;","import _extends from \"@babel/runtime/helpers/extends\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/objectWithoutProperties\";\nvar _excluded = [\"color\", \"size\"];\nimport React from 'react';\nimport { intrinsicComponent } from './utils/functions';\nexport var CrossOutline = intrinsicComponent(function (_ref, ref) {\n var _ref$color = _ref.color,\n color = _ref$color === void 0 ? 'currentColor' : _ref$color,\n _ref$size = _ref.size,\n size = _ref$size === void 0 ? 14 : _ref$size,\n rest = _objectWithoutProperties(_ref, _excluded);\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n ref: ref,\n width: size,\n height: size,\n viewBox: \"0 0 44 44\",\n fill: \"none\",\n xmlns: \"http://www.w3.org/2000/svg\"\n }, rest), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M43.3196 40.0403C44.2253 40.9461 44.2253 42.4146 43.3196 43.3204C42.4138 44.2262 40.9453 44.2262 40.0396 43.3204L21.9997 25.2802L3.95952 43.3207C3.05376 44.2264 1.58525 44.2264 0.679494 43.3207C-0.226258 42.4149 -0.226258 40.9464 0.679495 40.0406L18.7197 22.0001L0.679313 3.95941C-0.226437 3.05364 -0.226439 1.5851 0.679314 0.679328C1.58507 -0.226442 3.05358 -0.226443 3.95934 0.679328L21.9997 18.72L40.0398 0.679604C40.9455 -0.226163 42.414 -0.226165 43.3198 0.679605C44.2255 1.58537 44.2255 3.05392 43.3198 3.95969L25.2797 22.0001L43.3196 40.0403Z\",\n fill: color\n }));\n});\nexport default CrossOutline;","import _defineProperty from \"@babel/runtime/helpers/defineProperty\";\nimport { css } from 'styled-components';\nimport { FontVariant as FV } from '../../utils/types/typography';\nimport { InputSize } from '../../utils/types';\nexport var sizeHintMixin = _defineProperty(_defineProperty({}, InputSize.Sm, function (_ref) {\n var font = _ref.theme.typography.font;\n return css(font[FV.LabelExtraSmallUp]);\n}), InputSize.Md, function (_ref2) {\n var font = _ref2.theme.typography.font;\n return css(font[FV.LabelSmall]);\n});","import styled, { css } from 'styled-components';\nimport { generateClassNames, applyDisplayNames } from '../../utils/functions';\nimport { InputSize } from '../../utils/types';\nimport { Color as PColor } from '../../utils/types/palette';\nimport { sizeHintMixin } from './form-hint.mixin';\nvar baseClassName = 'FormHint';\nvar FormHint = /*#__PURE__*/styled.span.attrs({\n className: generateClassNames(baseClassName, 'root')\n}).withConfig({\n componentId: \"sc-1vu99sv-0\"\n})(function (_ref) {\n var _ref$size = _ref.size,\n size = _ref$size === void 0 ? InputSize.Md : _ref$size,\n _ref$error = _ref.error,\n error = _ref$error === void 0 ? false : _ref$error,\n _ref$disabled = _ref.disabled,\n disabled = _ref$disabled === void 0 ? false : _ref$disabled,\n theme = _ref.theme;\n return css([\"display:flex;align-items:center;color:\", \";\", \" \", \"\"], error ? theme.palette[PColor.Error] : theme.palette[PColor.TextSecondary], disabled && css([\"color:\", \";\"], theme.palette[PColor.ButtonDisabledText]), sizeHintMixin[size]);\n});\nvar Styled = applyDisplayNames({\n FormHint: FormHint\n});\nexport default Styled;","import _extends from \"@babel/runtime/helpers/extends\";\nimport React from 'react';\nimport PT from 'prop-types';\nimport { intrinsicComponent, objectValues } from '../../utils/functions';\nimport { InputSize } from '../../utils/types';\nimport Styled from './form-hint.styles';\nvar FormHint = intrinsicComponent(function (props, ref) {\n return /*#__PURE__*/React.createElement(Styled.FormHint, _extends({\n ref: ref\n }, props));\n});\nFormHint.defaultProps = {\n error: false\n};\nFormHint.propTypes = {\n error: PT.bool,\n size: PT.oneOf(objectValues(InputSize))\n};\nexport default FormHint;","import _defineProperty from \"@babel/runtime/helpers/defineProperty\";\nimport { css } from 'styled-components';\nimport { Color as PaletteColor } from '../../utils/types/palette';\nimport { BadgeColor } from '../../utils/types';\nexport var colorBadgeMixin = _defineProperty(_defineProperty(_defineProperty({}, BadgeColor.Primary, function (_ref) {\n var palette = _ref.theme.palette;\n return css([\"background-color:\", \";color:\", \";\"], palette[PaletteColor.AccentPrimary], palette[PaletteColor.ButtonPrimaryText]);\n}), BadgeColor.White, function (_ref2) {\n var palette = _ref2.theme.palette;\n return css([\"background-color:\", \";color:\", \";\"], palette[PaletteColor.ButtonPrimaryText], palette[PaletteColor.AccentPrimary]);\n}), BadgeColor.Secondary, function (_ref3) {\n var palette = _ref3.theme.palette;\n return css([\"background-color:\", \";color:\", \";\"], palette[PaletteColor.Accent_1_2_Opacity], palette[PaletteColor.TextPrimary]);\n});","import styled, { css } from 'styled-components';\nimport { generateClassNames, applyDisplayNames } from '../../utils/functions';\nimport { colorBadgeMixin } from './badge.mixin';\nvar baseClassName = 'Badge';\nvar defaultSize = 20;\nvar BadgeRoot = /*#__PURE__*/styled.span.attrs({\n className: generateClassNames(baseClassName, 'root')\n}).withConfig({\n componentId: \"sc-1rfm40m-0\"\n})([\"position:relative;display:inline-flex;flex-shrink:0;vertical-align:middle;\"]);\nvar Badge = /*#__PURE__*/styled.span.attrs({\n className: generateClassNames(baseClassName)\n}).withConfig({\n componentId: \"sc-1rfm40m-1\"\n})(function (_ref) {\n var size = _ref.size,\n _ref$color = _ref.color,\n color = _ref$color === void 0 ? 'secondary' : _ref$color,\n fontSize = _ref.fontSize,\n _ref$padding = _ref.padding,\n padding = _ref$padding === void 0 ? '0 6px' : _ref$padding,\n inline = _ref.inline;\n return css([\"\", \" display:flex;flex-wrap:wrap;flex-direction:row;justify-content:center;align-items:center;align-content:center;height:\", \"px;min-width:\", \"px;line-height:1;padding:\", \";font-size:\", \";box-sizing:border-box;transition:transform 225ms cubic-bezier(0.4,0,0.2,1) 0ms;border-radius:\", \"px;z-index:1;\", \"\"], inline ? '' : 'position: absolute;', size || defaultSize, size || defaultSize, typeof padding === 'number' ? \"\".concat(padding, \"px\") : padding, typeof fontSize === 'number' ? \"\".concat(fontSize, \"px\") : fontSize, (size || defaultSize) / 2, colorBadgeMixin[color]);\n});\nvar Styled = applyDisplayNames({\n BadgeRoot: BadgeRoot,\n Badge: Badge\n});\nexport default Styled;","import _objectWithoutProperties from \"@babel/runtime/helpers/objectWithoutProperties\";\nvar _excluded = [\"badgeContent\"];\nimport React from 'react';\nimport PT from 'prop-types';\nimport { intrinsicComponent, objectValues } from '../../utils/functions';\nimport { BadgeColor } from '../../utils/types';\nimport Styled from './badge.styles';\nvar Badge = intrinsicComponent(function (_ref, ref) {\n var badgeContent = _ref.badgeContent,\n rest = _objectWithoutProperties(_ref, _excluded);\n return /*#__PURE__*/React.createElement(Styled.BadgeRoot, {\n ref: ref\n }, /*#__PURE__*/React.createElement(Styled.Badge, rest, badgeContent));\n});\nBadge.defaultProps = {\n color: BadgeColor.Secondary,\n inline: false\n};\nBadge.propTypes = {\n color: PT.oneOf(objectValues(BadgeColor)),\n badgeContent: PT.node,\n size: PT.oneOfType([PT.number]),\n fontSize: PT.oneOfType([PT.number, PT.string]),\n padding: PT.oneOfType([PT.number, PT.string]),\n inline: PT.bool\n};\nexport default Badge;","import _extends from \"@babel/runtime/helpers/extends\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/objectWithoutProperties\";\nvar _excluded = [\"color\", \"size\"];\nimport React from 'react';\nimport { intrinsicComponent } from './utils/functions';\nexport var Spinner = intrinsicComponent(function (_ref, ref) {\n var _ref$color = _ref.color,\n color = _ref$color === void 0 ? 'currentColor' : _ref$color,\n _ref$size = _ref.size,\n size = _ref$size === void 0 ? 28 : _ref$size,\n rest = _objectWithoutProperties(_ref, _excluded);\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n ref: ref,\n width: size,\n height: size,\n viewBox: \"0 0 50 50\",\n fill: \"none\",\n xmlns: \"http://www.w3.org/2000/svg\"\n }, rest), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M41.3465 44.355C33.5656 50.7844 22.9687 51.6268 14.3708 47.3665L17.8949 44.4545C24.754 47.117 32.7424 46.1093 38.709 41.1792C44.6755 36.249 47.1546 28.6071 45.8085 21.3893L49.3325 18.4773C51.9291 27.6967 49.1274 37.9256 41.3465 44.355Z\",\n fill: color\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M36.1749 2.63356L32.6509 5.54555C25.821 2.91828 17.838 3.86187 11.8366 8.82088C5.87009 13.7511 3.42028 21.4282 4.7372 28.6107L1.21311 31.5227C-1.38344 22.3034 1.45314 12.0456 9.19916 5.64502C16.9801 -0.784402 27.5768 -1.62682 36.1749 2.63356Z\",\n fill: color\n }));\n});\nexport default Spinner;","import _extends from \"@babel/runtime/helpers/extends\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/objectWithoutProperties\";\nvar _excluded = [\"color\", \"size\"];\nimport React from 'react';\nimport { intrinsicComponent } from './utils/functions';\nexport var TwoArrowsRight = intrinsicComponent(function (_ref, ref) {\n var _ref$color = _ref.color,\n color = _ref$color === void 0 ? 'currentColor' : _ref$color,\n _ref$size = _ref.size,\n size = _ref$size === void 0 ? 14 : _ref$size,\n rest = _objectWithoutProperties(_ref, _excluded);\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n ref: ref,\n width: size,\n height: size,\n viewBox: \"0 0 12 12\",\n fill: \"none\",\n xmlns: \"http://www.w3.org/2000/svg\"\n }, rest), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M5.74299 0.152553C5.95998 -0.056404 6.30528 -0.0498885 6.51424 0.167105C6.7232 0.384099 6.71668 0.7294 6.49969 0.938357L1.43832 5.81227L6.51398 11.0759C6.72309 11.2928 6.71681 11.6381 6.49996 11.8472C6.28311 12.0563 5.9378 12.05 5.7287 11.8332L0.274151 6.1766C0.17369 6.07242 0.118752 5.93258 0.121433 5.78788C0.124113 5.64317 0.184193 5.50547 0.288444 5.40508L5.74299 0.152553Z\",\n fill: color\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M10.9549 0.152554C11.1719 -0.0564031 11.5172 -0.0498876 11.7262 0.167106C11.9351 0.3841 11.9286 0.729401 11.7116 0.938357L6.65023 5.81227L11.7259 11.0759C11.935 11.2928 11.9287 11.6381 11.7119 11.8472C11.495 12.0563 11.1497 12.05 10.9406 11.8332L5.48606 6.1766C5.3856 6.07242 5.33067 5.93258 5.33335 5.78788C5.33603 5.64317 5.39611 5.50547 5.50036 5.40508L10.9549 0.152554Z\",\n fill: color\n }));\n});\nexport default TwoArrowsRight;","import _extends from \"@babel/runtime/helpers/extends\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/objectWithoutProperties\";\nvar _excluded = [\"color\", \"size\"];\nimport React from 'react';\nimport { intrinsicComponent } from './utils/functions';\nexport var TwoArrowsLeft = intrinsicComponent(function (_ref, ref) {\n var _ref$color = _ref.color,\n color = _ref$color === void 0 ? 'currentColor' : _ref$color,\n _ref$size = _ref.size,\n size = _ref$size === void 0 ? 14 : _ref$size,\n rest = _objectWithoutProperties(_ref, _excluded);\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n ref: ref,\n width: size,\n height: size,\n viewBox: \"0 0 12 12\",\n fill: \"none\",\n xmlns: \"http://www.w3.org/2000/svg\"\n }, rest), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M6.25714 11.8474C6.04014 12.0564 5.69484 12.0499 5.48588 11.8329C5.27693 11.6159 5.28344 11.2706 5.50043 11.0616L10.5618 6.18773L5.48614 0.924074C5.27704 0.707224 5.28331 0.361919 5.50016 0.152813C5.71701 -0.0562931 6.06232 -0.0500145 6.27143 0.166835L11.726 5.8234C11.8264 5.92758 11.8814 6.06742 11.8787 6.21212C11.876 6.35683 11.8159 6.49453 11.7117 6.59492L6.25714 11.8474Z\",\n fill: color\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M1.04522 11.8474C0.828227 12.0564 0.482925 12.0499 0.273969 11.8329C0.065012 11.6159 0.0715275 11.2706 0.288521 11.0616L5.34989 6.18773L0.274227 0.924074C0.0651226 0.707224 0.0714006 0.361919 0.28825 0.152813C0.5051 -0.0562931 0.850407 -0.0500145 1.05951 0.166835L6.51406 5.8234C6.61452 5.92758 6.66946 6.06742 6.66678 6.21212C6.6641 6.35683 6.60402 6.49453 6.49977 6.59492L1.04522 11.8474Z\",\n fill: color\n }));\n});\nexport default TwoArrowsLeft;","export var ButtonType = {\n Default: 'default',\n Sidebar: 'sidebar'\n};","export var SideBar = {\n Left: 'left',\n Right: 'right'\n};","import { ButtonSize } from '../../utils/types';\nexport var getIconSize = function getIconSize(sizeName) {\n switch (sizeName) {\n case ButtonSize.Lg:\n return 18;\n case ButtonSize.Md:\n return 16;\n case ButtonSize.Sm:\n return 14;\n case ButtonSize.Xs:\n return 12;\n default:\n return 16;\n }\n};\nexport var getSideBarIconSize = function getSideBarIconSize(sizeName) {\n switch (sizeName) {\n case ButtonSize.Lg:\n return 12;\n case ButtonSize.Md:\n return 11;\n case ButtonSize.Sm:\n return 10;\n default:\n return 11;\n }\n};","import _defineProperty from \"@babel/runtime/helpers/defineProperty\";\nvar _colorButtonMixin;\nimport { css } from 'styled-components';\nimport StyledBadge from '../badge/badge.styles';\nimport { Color as PaletteColor } from '../../utils/types/palette';\nimport { FontVariant } from '../../utils/types/typography';\nimport { ButtonSize, ButtonColor } from '../../utils/types';\nexport var colorButtonMixin = (_colorButtonMixin = {}, _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_colorButtonMixin, ButtonColor.Primary, function (_ref) {\n var palette = _ref.theme.palette,\n active = _ref.active;\n return css([\"background-color:\", \";color:\", \";\", \"{color:\", \";background:transparent;}&:hover{background-color:\", \";}&:active{background-color:\", \";}\", \" &:disabled{color:\", \";background:\", \";cursor:default;\", \"{color:\", \";background:transparent;}}\"], palette[PaletteColor.AccentStateless], palette[PaletteColor.ButtonPrimaryText], StyledBadge.Badge, palette[PaletteColor.ButtonPrimaryText], palette[PaletteColor.AccentPrimaryHover], palette[PaletteColor.AccentPrimaryActive], active && css([\"background-color:\", \";&:hover,&:focus{background-color:\", \";}\"], palette[PaletteColor.AccentPrimaryActive], palette[PaletteColor.AccentPrimaryActive]), palette[PaletteColor.BordersDisabled], palette[PaletteColor.Accent_1_2_Opacity], StyledBadge.Badge, palette[PaletteColor.BordersDisabled]);\n}), ButtonColor.Secondary, function (_ref2) {\n var palette = _ref2.theme.palette,\n active = _ref2.active;\n return css([\"background-color:\", \";color:\", \";border:1px solid \", \";\", \"{color:\", \";background:transparent;}&:hover{color:\", \";background-color:\", \";\", \"{color:\", \";}}&:focus{color:\", \";background-color:\", \";border:1px solid \", \";\", \"{color:\", \";}}&:active{color:\", \";background-color:\", \";\", \"{color:\", \";}}\", \" &:disabled{color:\", \";background:\", \";border:none;cursor:default;\", \"{color:\", \";}}\"], palette[PaletteColor.BackgroundStateless], palette[PaletteColor.AccentStateless], palette[PaletteColor.AccentStateless], StyledBadge.Badge, palette[PaletteColor.AccentStateless], palette[PaletteColor.ButtonPrimaryText], palette[PaletteColor.AccentPrimaryHover], StyledBadge.Badge, palette[PaletteColor.ButtonPrimaryText], palette[PaletteColor.AccentPrimaryActive], palette[PaletteColor.Accent_1_2_Opacity], palette[PaletteColor.AccentPrimaryActive], StyledBadge.Badge, palette[PaletteColor.AccentPrimaryActive], palette[PaletteColor.ButtonPrimaryText], palette[PaletteColor.AccentPrimaryActive], StyledBadge.Badge, palette[PaletteColor.ButtonPrimaryText], active && css([\"color:\", \";background-color:\", \";\", \"{color:\", \";}&:hover,&:focus{color:\", \";background-color:\", \";\", \"{color:\", \";}}\"], palette[PaletteColor.ButtonPrimaryText], palette[PaletteColor.AccentPrimaryActive], StyledBadge.Badge, palette[PaletteColor.ButtonPrimaryText], palette[PaletteColor.ButtonPrimaryText], palette[PaletteColor.AccentPrimaryActive], StyledBadge.Badge, palette[PaletteColor.ButtonPrimaryText]), palette[PaletteColor.BordersDisabled], palette[PaletteColor.Accent_1_2_Opacity], StyledBadge.Badge, palette[PaletteColor.BordersDisabled]);\n}), ButtonColor.Basic, function (_ref3) {\n var palette = _ref3.theme.palette,\n active = _ref3.active;\n return css([\"background-color:transparent;border:1px solid \", \";color:\", \";\", \"{background-color:transparent;color:\", \";}&:hover{background-color:\", \";color:\", \";\", \"{color:\", \";}}&:active{background-color:\", \";color:\", \";\", \"{color:\", \";}}\", \" &:disabled{background-color:\", \";color:\", \";cursor:default;border:none;\", \"{color:\", \";}}\"], palette[PaletteColor.BordersButton], palette[PaletteColor.LinkStateless], StyledBadge.Badge, palette[PaletteColor.LinkStateless], palette[PaletteColor.BackgroundHover], palette[PaletteColor.LinkHover], StyledBadge.Badge, palette[PaletteColor.LinkHover], palette[PaletteColor.BackgroundActive], palette[PaletteColor.LinkHover], StyledBadge.Badge, palette[PaletteColor.LinkHover], active && css([\"background-color:\", \";color:\", \";\", \"{color:\", \";}&:hover,&:focus{background-color:\", \";color:\", \";}\"], palette[PaletteColor.BackgroundActive], palette[PaletteColor.LinkHover], StyledBadge.Badge, palette[PaletteColor.LinkHover], palette[PaletteColor.BackgroundActive], palette[PaletteColor.LinkHover]), palette[PaletteColor.Accent_1_2_Opacity], palette[PaletteColor.BordersDisabled], StyledBadge.Badge, palette[PaletteColor.BordersDisabled]);\n}), ButtonColor.LinkPrimary, function (_ref4) {\n var palette = _ref4.theme.palette,\n active = _ref4.active;\n return css([\"color:\", \";background-color:transparent;padding:0px !important;&:hover{background-color:transparent;color:\", \";}&:active{color:\", \";}\", \" &:disabled{background-color:transparent;color:\", \";cursor:default;}\"], palette[PaletteColor.AccentStateless], palette[PaletteColor.AccentPrimaryHover], palette[PaletteColor.AccentPrimaryActive], active && css([\"color:\", \";&:hover,&:focus{color:\", \";\"], palette[PaletteColor.AccentPrimaryActive], palette[PaletteColor.AccentPrimaryActive]), palette[PaletteColor.BordersDisabled]);\n}), ButtonColor.LinkSecondary, function (_ref5) {\n var palette = _ref5.theme.palette,\n active = _ref5.active;\n return css([\"color:\", \";background-color:transparent;padding:0px !important;&:hover{background-color:transparent;color:\", \";}&:active{color:\", \";}\", \" &:disabled{background-color:transparent;color:\", \";cursor:default;}\"], palette[PaletteColor.LinkStateless], palette[PaletteColor.AccentPrimaryHover], palette[PaletteColor.AccentPrimaryActive], active && css([\"color:\", \";&:hover,&:focus{color:\", \";}\"], palette[PaletteColor.AccentPrimaryActive], palette[PaletteColor.AccentPrimaryActive]), palette[PaletteColor.BordersDisabled]);\n}), ButtonColor.LinkBasicPrimary, function (_ref6) {\n var palette = _ref6.theme.palette,\n active = _ref6.active;\n return css([\"color:\", \";background-color:transparent;padding:0px !important;&:hover{background-color:transparent;color:\", \";}&:active{color:\", \";}\", \" &:disabled{background-color:transparent;color:\", \";cursor:default;}\"], palette[PaletteColor.AccentStateless], palette[PaletteColor.AccentPrimaryHover], palette[PaletteColor.AccentPrimaryActive], active && css([\"color:\", \";&:hover,&:focus{color:\", \";}\"], palette[PaletteColor.AccentPrimaryActive], palette[PaletteColor.AccentPrimaryActive]), palette[PaletteColor.BordersDisabled]);\n}), ButtonColor.LinkBasicSecondary, function (_ref7) {\n var palette = _ref7.theme.palette,\n active = _ref7.active;\n return css([\"color:\", \";background-color:transparent;padding:0px !important;&:hover{background-color:transparent;color:\", \";}&:active{color:\", \";}\", \" &:disabled{background-color:transparent;color:\", \";cursor:default;}\"], palette[PaletteColor.LinkStateless], palette[PaletteColor.AccentPrimaryHover], palette[PaletteColor.AccentPrimaryActive], active && css([\"color:\", \";&:hover,&:focus{color:\", \";}\"], palette[PaletteColor.AccentPrimaryActive], palette[PaletteColor.AccentPrimaryActive]), palette[PaletteColor.BordersDisabled]);\n}), ButtonColor.ErrorPrimary, function (_ref8) {\n var palette = _ref8.theme.palette,\n active = _ref8.active;\n return css([\"background-color:\", \";color:\", \";\", \"{color:\", \";background:transparent;}&:hover{background-color:\", \";}&:active{background-color:\", \";}\", \" &:disabled{background-color:\", \";color:\", \";cursor:default;\", \"{color:\", \";background:transparent;}}\"], palette[PaletteColor.Error], palette[PaletteColor.ButtonPrimaryText], StyledBadge.Badge, palette[PaletteColor.ButtonPrimaryText], palette[PaletteColor.ErrorHover], palette[PaletteColor.ErrorActive], active && css([\"background-color:\", \";&:hover,&:focus{background-color:\", \";}\"], palette[PaletteColor.ErrorActive], palette[PaletteColor.ErrorActive]), palette[PaletteColor.Accent_1_2_Opacity], palette[PaletteColor.BordersDisabled], StyledBadge.Badge, palette[PaletteColor.BordersDisabled]);\n}), ButtonColor.ErrorSecondary, function (_ref9) {\n var palette = _ref9.theme.palette,\n active = _ref9.active;\n return css([\"background-color:\", \";color:\", \";border:1px solid \", \";\", \"{color:\", \";background-color:transparent;}&:hover{background-color:\", \";color:\", \";border:none;\", \"{color:\", \";}}&:active{background-color:\", \";color:\", \";border:none;}\", \" &:disabled{color:\", \";background:\", \";border:none;cursor:default;\", \"{color:\", \";}}\"], palette[PaletteColor.BackgroundStateless], palette[PaletteColor.LinkStateless], palette[PaletteColor.BordersButton], StyledBadge.Badge, palette[PaletteColor.LinkStateless], palette[PaletteColor.ErrorHover], palette[PaletteColor.ButtonPrimaryText], StyledBadge.Badge, palette[PaletteColor.ButtonPrimaryText], palette[PaletteColor.ErrorActive], palette[PaletteColor.ButtonPrimaryText], active && css([\"background-color:\", \";color:\", \";border:none;&:hover,&:focus{background-color:\", \";}\"], palette[PaletteColor.ErrorActive], palette[PaletteColor.ButtonPrimaryText], palette[PaletteColor.ErrorActive]), palette[PaletteColor.BordersDisabled], palette[PaletteColor.Accent_1_2_Opacity], StyledBadge.Badge, palette[PaletteColor.BordersDisabled]);\n}), ButtonColor.ErrorBasic, function (_ref10) {\n var palette = _ref10.theme.palette,\n active = _ref10.active;\n return css([\"color:\", \";background-color:transparent;&:hover{color:\", \";}&:active{color:\", \";}\", \" &:disabled{color:\", \";cursor:default;}\"], palette[PaletteColor.LinkStateless], palette[PaletteColor.ErrorHover], palette[PaletteColor.ErrorActive], active && css([\"color:\", \";&:hover,&:focus{color:\", \";}\"], palette[PaletteColor.ErrorActive], palette[PaletteColor.ErrorActive]), palette[PaletteColor.BordersDisabled]);\n}), _defineProperty(_defineProperty(_defineProperty(_colorButtonMixin, ButtonColor.WarningPrimary, function (_ref11) {\n var palette = _ref11.theme.palette,\n active = _ref11.active;\n return css([\"background-color:\", \";color:\", \";\", \"{color:\", \";background:transparent;}&:hover{background-color:\", \";}&:active{background-color:\", \";}\", \" &:disabled{background-color:\", \";color:\", \";cursor:default;\", \"{color:\", \";background:transparent;}}\"], palette[PaletteColor.Warning], palette[PaletteColor.ButtonPrimaryText], StyledBadge.Badge, palette[PaletteColor.ButtonPrimaryText], palette[PaletteColor.WarningHover], palette[PaletteColor.WarningActive], active && css([\"background-color:\", \";&:hover,&:focus{background-color:\", \";}\"], palette[PaletteColor.WarningActive], palette[PaletteColor.WarningActive]), palette[PaletteColor.Accent_1_2_Opacity], palette[PaletteColor.BordersDisabled], StyledBadge.Badge, palette[PaletteColor.BordersDisabled]);\n}), ButtonColor.WarningSecondary, function (_ref12) {\n var palette = _ref12.theme.palette,\n active = _ref12.active;\n return css([\"background-color:\", \";color:\", \";border:1px solid \", \";\", \"{color:\", \";background-color:transparent;}&:hover{background-color:\", \";color:\", \";border:none;\", \"{color:\", \";}}&:active{background-color:\", \";color:\", \";border:none;}\", \" &:disabled{color:\", \";background:\", \";border:none;cursor:default;\", \"{color:\", \";}}\"], palette[PaletteColor.BackgroundStateless], palette[PaletteColor.LinkStateless], palette[PaletteColor.BordersButton], StyledBadge.Badge, palette[PaletteColor.LinkStateless], palette[PaletteColor.WarningHover], palette[PaletteColor.ButtonPrimaryText], StyledBadge.Badge, palette[PaletteColor.ButtonPrimaryText], palette[PaletteColor.WarningActive], palette[PaletteColor.ButtonPrimaryText], active && css([\"background-color:\", \";color:\", \";border:none;\", \"{color:\", \";background-color:transparent;}&:hover,&:focus{background-color:\", \";}\"], palette[PaletteColor.WarningActive], palette[PaletteColor.ButtonPrimaryText], StyledBadge.Badge, palette[PaletteColor.ButtonPrimaryText], palette[PaletteColor.WarningActive]), palette[PaletteColor.BordersDisabled], palette[PaletteColor.Accent_1_2_Opacity], StyledBadge.Badge, palette[PaletteColor.BordersDisabled]);\n}), ButtonColor.WarningBasic, function (_ref13) {\n var palette = _ref13.theme.palette,\n active = _ref13.active;\n return css([\"color:\", \";background-color:transparent;&:hover{color:\", \";}&:active{color:\", \";}\", \" &:disabled{color:\", \";cursor:default;}\"], palette[PaletteColor.LinkStateless], palette[PaletteColor.WarningHover], palette[PaletteColor.WarningActive], active && css([\"color:\", \";&:hover,&:focus{color:\", \";}\"], palette[PaletteColor.WarningActive], palette[PaletteColor.WarningActive]), palette[PaletteColor.BordersDisabled]);\n}));\nexport var sizeButtonMixin = _defineProperty(_defineProperty(_defineProperty(_defineProperty({}, ButtonSize.Xs, css([\"padding:5px 10px;\"])), ButtonSize.Sm, css([\"padding:8px 12px;\"])), ButtonSize.Md, css([\"padding:11px 16px;\"])), ButtonSize.Lg, css([\"padding:14px 24px;\"]));\nexport var sizeSecondaryButtonMixin = _defineProperty(_defineProperty(_defineProperty(_defineProperty({}, ButtonSize.Xs, css([\"padding:4px 10px;\"])), ButtonSize.Sm, css([\"padding:7px 12px;\"])), ButtonSize.Md, css([\"padding:10px 16px;\"])), ButtonSize.Lg, css([\"padding:13px 24px;\"]));\nexport var sizeSidebarMixin = _defineProperty(_defineProperty(_defineProperty(_defineProperty({}, ButtonSize.Xs, css([\"padding:5px 10px;\"])), ButtonSize.Sm, css([\"padding:8px 12px;\"])), ButtonSize.Md, css([\"padding:11px 14px;\"])), ButtonSize.Lg, css([\"padding:14px 16px;\"]));\nexport var sizeSidebarDividerMixin = _defineProperty(_defineProperty(_defineProperty(_defineProperty({}, ButtonSize.Xs, css([\"height:14px;\"])), ButtonSize.Sm, css([\"height:16px;\"])), ButtonSize.Md, css([\"height:18px;\"])), ButtonSize.Lg, css([\"height:20px;\"]));\nexport var paddingIconLabelMixin = _defineProperty(_defineProperty(_defineProperty(_defineProperty({}, ButtonSize.Xs, css([\"margin-right:5px;\"])), ButtonSize.Sm, css([\"margin-right:6px;\"])), ButtonSize.Md, css([\"margin-right:7px;\"])), ButtonSize.Lg, css([\"margin-right:8px;\"]));\nexport var sizeButtonLabelMixin = _defineProperty(_defineProperty(_defineProperty(_defineProperty({}, ButtonSize.Xs, function (_ref14) {\n var font = _ref14.theme.typography.font;\n return css(font[FontVariant.ButtonSm]);\n}), ButtonSize.Sm, function (_ref15) {\n var font = _ref15.theme.typography.font;\n return css(font[FontVariant.ButtonMd]);\n}), ButtonSize.Md, function (_ref16) {\n var font = _ref16.theme.typography.font;\n return css(font[FontVariant.ButtonLg]);\n}), ButtonSize.Lg, function (_ref17) {\n var font = _ref17.theme.typography.font;\n return css(font[FontVariant.ButtonLgUp]);\n});","import styled, { css } from 'styled-components';\nimport { generateClassNames, applyDisplayNames } from '../../utils/functions';\nimport { BorderRadiusSize as BRSize } from '../../utils/types/shape';\nimport { colorButtonMixin, sizeButtonMixin, sizeButtonLabelMixin, sizeSidebarMixin, sizeSidebarDividerMixin, paddingIconLabelMixin, sizeSecondaryButtonMixin } from './button.mixin';\nimport { Color as PaletteColor } from '../../utils/types/palette';\nimport { ButtonSize, ButtonColor } from '../../utils/types';\nimport { ButtonType, SideBar } from './types';\nvar baseClassName = 'Button';\nvar Label = /*#__PURE__*/styled.span.attrs({\n className: generateClassNames(baseClassName, 'Label')\n}).withConfig({\n componentId: \"sc-lxwit0-0\"\n})([\"display:flex;\"]);\nvar Badge = /*#__PURE__*/styled.span.attrs({\n className: generateClassNames(baseClassName, 'Badge')\n}).withConfig({\n componentId: \"sc-lxwit0-1\"\n})([\"display:flex;margin-left:5px;\"]);\nvar Wrapper = /*#__PURE__*/styled.span.attrs({\n className: generateClassNames(baseClassName, 'Body')\n}).withConfig({\n componentId: \"sc-lxwit0-2\"\n})(function () {\n return css([\"display:flex;align-items:center;\"]);\n});\nvar Button = /*#__PURE__*/styled.button.attrs({\n className: generateClassNames(baseClassName, 'root')\n}).withConfig({\n componentId: \"sc-lxwit0-3\"\n})(function (_ref) {\n var _ref$color = _ref.color,\n color = _ref$color === void 0 ? ButtonColor.Secondary : _ref$color,\n _ref$size = _ref.size,\n size = _ref$size === void 0 ? ButtonSize.Md : _ref$size,\n buttonType = _ref.buttonType,\n active = _ref.active,\n theme = _ref.theme;\n return css([\"display:inline-flex;flex-shrink:0;flex-direction:row;align-items:center;justify-content:center;border-radius:\", \";transition:all 100ms ease-out;border:0;cursor:pointer;outline:none;\", \" \", \" \", \" \", \"{\", \" \", \"}\", \"{\", \"}\", \"\"], theme.shape.borderRadius[BRSize.Md], buttonType !== ButtonType.Sidebar && colorButtonMixin[color], buttonType === ButtonType.Sidebar ? sizeSidebarMixin[size] : sizeButtonMixin[size], color === ButtonColor.Secondary && sizeSecondaryButtonMixin[size], Label, sizeButtonLabelMixin[size], (color === ButtonColor.LinkBasicPrimary || color === ButtonColor.LinkBasicSecondary) && \"font-weight: 400\", Badge, sizeButtonLabelMixin[size], buttonType === ButtonType.Sidebar && css([\"background-color:\", \";color:\", \";border:1px solid \", \";\", \" \", \" &:disabled{color:\", \";background:\", \";border:none;cursor:default;}\"], theme.palette[PaletteColor.ButtonPrimaryText], theme.palette[PaletteColor.LinkStateless], theme.palette[PaletteColor.BordersButton], !active && css([\"&:hover{color:\", \";background-color:\", \";border:none;}&:active{color:\", \";background-color:\", \";border:none;}\"], theme.palette[PaletteColor.ButtonPrimaryText], theme.palette[PaletteColor.AccentPrimaryHover], theme.palette[PaletteColor.ButtonPrimaryText], theme.palette[PaletteColor.AccentPrimaryActive]), active && css([\"background-color:\", \";color:\", \";border:1px solid \", \";\"], theme.palette[PaletteColor.Accent_1_2_Opacity], theme.palette[PaletteColor.AccentPrimaryActive], theme.palette[PaletteColor.AccentPrimaryActive]), theme.palette[PaletteColor.BordersDisabled], theme.palette[PaletteColor.AccentPrimaryDisabled]));\n});\nvar StartIcon = /*#__PURE__*/styled.span.attrs({\n className: generateClassNames(baseClassName, 'StartIcon')\n}).withConfig({\n componentId: \"sc-lxwit0-4\"\n})(function (_ref2) {\n var $loading = _ref2.$loading,\n _ref2$size = _ref2.size,\n size = _ref2$size === void 0 ? ButtonSize.Md : _ref2$size;\n return css([\"display:flex;svg{animation:\", \";}\", \"\"], $loading ? 'spinner 1.2s linear infinite' : '1.2s', paddingIconLabelMixin[size]);\n});\nvar SideArrows = /*#__PURE__*/styled.span.attrs({\n className: generateClassNames(baseClassName, 'SideBar')\n}).withConfig({\n componentId: \"sc-lxwit0-5\"\n})(function (_ref3) {\n var sideBarType = _ref3.sideBarType;\n return css([\"display:flex;\", \":12px;\"], \"margin-\".concat(sideBarType === SideBar.Left ? 'right' : 'left'));\n});\nvar Divider = /*#__PURE__*/styled.span.attrs({\n className: generateClassNames(baseClassName, 'Divider')\n}).withConfig({\n componentId: \"sc-lxwit0-6\"\n})(function (_ref4) {\n var sideBarType = _ref4.sideBarType,\n _ref4$size = _ref4.size,\n size = _ref4$size === void 0 ? ButtonSize.Md : _ref4$size;\n return css([\"border-left-style:solid;border-width:1px;\", \" \", \":12px;\"], sizeSidebarDividerMixin[size], \"margin-\".concat(sideBarType === SideBar.Left ? 'right' : 'left'));\n});\nvar EndIcon = /*#__PURE__*/styled.span.attrs({\n className: generateClassNames(baseClassName, 'EndIcon')\n}).withConfig({\n componentId: \"sc-lxwit0-7\"\n})([\"display:flex;margin-left:6px;\"]);\nvar Styled = applyDisplayNames({\n Button: Button,\n Wrapper: Wrapper,\n Label: Label,\n SideArrows: SideArrows,\n Divider: Divider,\n StartIcon: StartIcon,\n EndIcon: EndIcon,\n Badge: Badge\n});\nexport default Styled;","import _extends from \"@babel/runtime/helpers/extends\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/objectWithoutProperties\";\nvar _excluded = [\"children\", \"startIcon\", \"endIcon\", \"badge\", \"color\", \"active\", \"buttonType\", \"sideBarType\", \"size\", \"loading\", \"disabled\"];\nimport React from 'react';\nimport PT from 'prop-types';\nimport SpinnerIcon from '@scaleflex/icons/spinner';\nimport TwoArrowsRight from '@scaleflex/icons/two-arrows-right';\nimport TwoArrowsLeft from '@scaleflex/icons/two-arrows-left';\nimport { intrinsicComponent, objectValues } from '../../utils/functions';\nimport Badge from '../badge';\nimport { ButtonSize, ButtonColor } from '../../utils/types';\nimport { ButtonType, SideBar } from './types';\nimport { getIconSize, getSideBarIconSize } from './button.utils';\nimport Styled from './button.styles';\nvar Button = intrinsicComponent(function (_ref, ref) {\n var children = _ref.children,\n startIcon = _ref.startIcon,\n endIcon = _ref.endIcon,\n badge = _ref.badge,\n color = _ref.color,\n active = _ref.active,\n buttonType = _ref.buttonType,\n _ref$sideBarType = _ref.sideBarType,\n sideBarType = _ref$sideBarType === void 0 ? SideBar.Left : _ref$sideBarType,\n size = _ref.size,\n loading = _ref.loading,\n disabled = _ref.disabled,\n rest = _objectWithoutProperties(_ref, _excluded);\n var getSideBarArrows = function getSideBarArrows(props) {\n switch (sideBarType) {\n case SideBar.Right:\n return active ? /*#__PURE__*/React.createElement(TwoArrowsLeft, props) : /*#__PURE__*/React.createElement(TwoArrowsRight, props);\n case SideBar.Left:\n return active ? /*#__PURE__*/React.createElement(TwoArrowsRight, props) : /*#__PURE__*/React.createElement(TwoArrowsLeft, props);\n default:\n }\n };\n var getSideBarSection = function getSideBarSection() {\n var sideBarSection = [/*#__PURE__*/React.createElement(Styled.SideArrows, {\n key: \"arrows\",\n sideBarType: sideBarType\n }, getSideBarArrows({\n size: getSideBarIconSize(size)\n }))];\n var divider = /*#__PURE__*/React.createElement(Styled.Divider, {\n key: \"divider\",\n size: size,\n sideBarType: sideBarType\n });\n if (sideBarType === SideBar.Right) {\n sideBarSection.unshift(divider);\n } else {\n sideBarSection.push(divider);\n }\n return buttonType === ButtonType.Sidebar && sideBarSection;\n };\n return /*#__PURE__*/React.createElement(Styled.Button, _extends({\n type: \"button\",\n buttonType: buttonType\n }, rest, {\n disabled: loading || disabled,\n sideBarType: sideBarType,\n color: color,\n active: active,\n size: size,\n ref: ref\n }), sideBarType === SideBar.Left && getSideBarSection(), /*#__PURE__*/React.createElement(Styled.Wrapper, null, startIcon && /*#__PURE__*/React.createElement(Styled.StartIcon, {\n $loading: loading,\n size: size\n }, typeof startIcon === 'function' ? loading ? /*#__PURE__*/React.createElement(SpinnerIcon, {\n size: getIconSize(size)\n }) : startIcon({\n size: getIconSize(size)\n }) :\n // eslint-disable-next-line unicorn/no-nested-ternary\n loading ? /*#__PURE__*/React.createElement(SpinnerIcon, {\n size: getIconSize(size)\n }) : startIcon), loading && !startIcon && /*#__PURE__*/React.createElement(Styled.StartIcon, {\n $loading: loading\n }, /*#__PURE__*/React.createElement(SpinnerIcon, {\n size: getIconSize(size)\n })), /*#__PURE__*/React.createElement(Styled.Label, null, children), endIcon && /*#__PURE__*/React.createElement(Styled.EndIcon, null, typeof endIcon === 'function' ? endIcon({\n size: getIconSize(size)\n }) : endIcon)), sideBarType === SideBar.Right && getSideBarSection(), badge && /*#__PURE__*/React.createElement(Styled.Badge, null, /*#__PURE__*/React.createElement(Badge, {\n inline: true,\n size: 14,\n padding: \"0 1px\",\n badgeContent: badge,\n color: color === ButtonColor.Primary ? 'white' : 'secondary'\n })));\n});\nButton.defaultProps = {\n size: ButtonSize.Md,\n color: ButtonColor.Secondary,\n buttonType: ButtonType.Default,\n active: false\n};\nButton.propTypes = {\n size: PT.oneOf(objectValues(ButtonSize)),\n color: PT.oneOf(objectValues(ButtonColor)),\n buttonType: PT.oneOf(objectValues(ButtonType)),\n sideBarType: PT.oneOf(objectValues(SideBar)),\n startIcon: PT.oneOfType([PT.node, PT.func]),\n endIcon: PT.oneOfType([PT.node, PT.func]),\n badge: PT.node,\n active: PT.bool,\n loading: PT.bool,\n disabled: PT.bool\n};\nexport default Button;","import _extends from \"@babel/runtime/helpers/extends\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/objectWithoutProperties\";\nvar _excluded = [\"color\", \"size\"];\nimport React from 'react';\nimport { intrinsicComponent } from './utils/functions';\nexport var Image2 = intrinsicComponent(function (_ref, ref) {\n var _ref$color = _ref.color,\n color = _ref$color === void 0 ? 'currentColor' : _ref$color,\n _ref$size = _ref.size,\n size = _ref$size === void 0 ? 14 : _ref$size,\n rest = _objectWithoutProperties(_ref, _excluded);\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n ref: ref,\n width: size,\n height: size,\n viewBox: \"0 0 42 42\",\n fill: \"none\",\n xmlns: \"http://www.w3.org/2000/svg\"\n }, rest), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M0.483002 4.49014V37.5097C0.483002 38.5725 0.90519 39.5917 1.65669 40.3432C2.40819 41.0947 3.42745 41.5169 4.49023 41.5169H37.5098C38.5726 41.5169 39.5918 41.0947 40.3433 40.3432C41.0948 39.5917 41.517 38.5725 41.517 37.5097V4.49014C41.517 3.42735 41.0948 2.4081 40.3433 1.6566C39.5918 0.905099 38.5726 0.48291 37.5098 0.48291H4.49023C3.42745 0.48291 2.40819 0.905099 1.65669 1.6566C0.90519 2.4081 0.483002 3.42735 0.483002 4.49014ZM38.9272 5.87776V31.3044L26.3817 19.5446L21.8068 22.3356L14.8048 15.3337L3.07279 23.0543V6.06233C3.07279 5.2695 3.38775 4.50913 3.94836 3.94851C4.50898 3.38789 5.26935 3.07294 6.06218 3.07294H36.1222C36.8661 3.07294 37.5795 3.36844 38.1055 3.89444C38.6316 4.42044 38.9272 5.13385 38.9272 5.87776Z\",\n fill: color\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M30.4602 15.6943C33.066 15.6943 35.1784 13.5819 35.1784 10.976C35.1784 8.37021 33.066 6.25777 30.4602 6.25777C27.8543 6.25777 25.7419 8.37021 25.7419 10.976C25.7419 13.5819 27.8543 15.6943 30.4602 15.6943Z\",\n fill: color\n }));\n});\nexport default Image2;","import _extends from \"@babel/runtime/helpers/extends\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/objectWithoutProperties\";\nvar _excluded = [\"color\", \"size\"];\nimport React from 'react';\nimport { intrinsicComponent } from './utils/functions';\nexport var Undo = intrinsicComponent(function (_ref, ref) {\n var _ref$color = _ref.color,\n color = _ref$color === void 0 ? 'currentColor' : _ref$color,\n _ref$size = _ref.size,\n size = _ref$size === void 0 ? 14 : _ref$size,\n rest = _objectWithoutProperties(_ref, _excluded);\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n ref: ref,\n width: size,\n height: size,\n viewBox: \"0 0 40 50\",\n fill: \"none\",\n xmlns: \"http://www.w3.org/2000/svg\"\n }, rest), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M39.5112 31.2036C39.5112 41.568 31.0785 50 20.7148 50H14.0613C12.9587 50 12.0652 49.1066 12.0652 48.004V47.3386C12.0652 46.2359 12.9586 45.3425 14.0613 45.3425H20.7148C28.5107 45.3425 34.8537 38.9995 34.8537 31.2036C34.8537 23.4078 28.5107 17.0648 20.7148 17.0648H8.4394L16.8935 25.5189C17.8015 26.4266 17.8015 27.9042 16.8935 28.8119C16.0124 29.6923 14.479 29.691 13.5999 28.8119L1.17111 16.3828C0.731285 15.943 0.488892 15.3581 0.488892 14.7359C0.488892 14.1142 0.731285 13.529 1.17111 13.0894L13.6006 0.65976C14.4797 -0.220001 16.0144 -0.220001 16.8936 0.65976C17.8016 1.56722 17.8016 3.04511 16.8936 3.95246L8.43951 12.4072H20.7148C31.0785 12.4072 39.5112 20.8395 39.5112 31.2036Z\",\n fill: color\n }));\n});\nexport default Undo;","import _extends from \"@babel/runtime/helpers/extends\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/objectWithoutProperties\";\nvar _excluded = [\"color\", \"size\"];\nimport React from 'react';\nimport { intrinsicComponent } from './utils/functions';\nexport var Redo = intrinsicComponent(function (_ref, ref) {\n var _ref$color = _ref.color,\n color = _ref$color === void 0 ? 'currentColor' : _ref$color,\n _ref$size = _ref.size,\n size = _ref$size === void 0 ? 14 : _ref$size,\n rest = _objectWithoutProperties(_ref, _excluded);\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n ref: ref,\n width: size,\n height: size,\n viewBox: \"0 0 40 50\",\n fill: \"none\",\n xmlns: \"http://www.w3.org/2000/svg\"\n }, rest), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M0.98 31.2037C0.98 41.568 9.41216 50 19.7752 50H26.4284C27.5309 50 28.4244 49.1066 28.4244 48.004V47.3386C28.4244 46.2359 27.531 45.3425 26.4284 45.3425H19.7752C11.9798 45.3425 5.6372 38.9995 5.6372 31.2037C5.6372 23.4079 11.9798 17.0648 19.7752 17.0648H32.05L23.5964 25.5189C22.6884 26.4266 22.6884 27.9043 23.5964 28.812C24.4774 29.6924 26.0107 29.6911 26.8897 28.812L39.3178 16.3828C39.7576 15.943 40 15.3582 40 14.736C40 14.1142 39.7576 13.5291 39.3178 13.0895L26.8891 0.659821C26.01 -0.21994 24.4754 -0.21994 23.5962 0.659821C22.6883 1.56728 22.6883 3.04517 23.5962 3.95252L32.0498 12.4073H19.7752C9.41216 12.4073 0.98 20.8396 0.98 31.2037Z\",\n fill: color\n }));\n});\nexport default Redo;","import _extends from \"@babel/runtime/helpers/extends\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/objectWithoutProperties\";\nvar _excluded = [\"color\", \"size\"];\nimport React from 'react';\nimport { intrinsicComponent } from './utils/functions';\nexport var Line = intrinsicComponent(function (_ref, ref) {\n var _ref$color = _ref.color,\n color = _ref$color === void 0 ? 'currentColor' : _ref$color,\n _ref$size = _ref.size,\n size = _ref$size === void 0 ? 14 : _ref$size,\n rest = _objectWithoutProperties(_ref, _excluded);\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n ref: ref,\n width: size,\n height: size,\n viewBox: \"0 0 50 50\",\n fill: \"none\",\n xmlns: \"http://www.w3.org/2000/svg\"\n }, rest), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M40.1901 7.27549L7.59689 39.8687C6.83412 40.6315 6.83412 41.8681 7.59689 42.6308C8.35965 43.3936 9.59626 43.3936 10.359 42.6308L42.9522 10.0376C43.715 9.27486 43.715 8.03825 42.9522 7.27549C42.1895 6.51272 40.9529 6.51272 40.1901 7.27549Z\",\n fill: color\n }));\n});\nexport default Line;","import _extends from \"@babel/runtime/helpers/extends\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/objectWithoutProperties\";\nvar _excluded = [\"color\", \"size\"];\nimport React from 'react';\nimport { intrinsicComponent } from './utils/functions';\nexport var ImageFilters = intrinsicComponent(function (_ref, ref) {\n var _ref$color = _ref.color,\n color = _ref$color === void 0 ? 'currentColor' : _ref$color,\n _ref$size = _ref.size,\n size = _ref$size === void 0 ? 14 : _ref$size,\n rest = _objectWithoutProperties(_ref, _excluded);\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n ref: ref,\n width: size,\n height: size,\n viewBox: \"0 0 50 50\",\n fill: \"none\",\n xmlns: \"http://www.w3.org/2000/svg\"\n }, rest), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M41.2229 16.7653C41.3215 12.426 39.7436 8.284 36.6864 5.02956C33.6292 1.77513 29.4872 -2.09808e-05 25.0493 -2.09808e-05C20.6114 -2.09808e-05 16.3708 1.77513 13.3136 5.02956C10.2564 8.18538 8.6785 12.3274 8.77712 16.7653C3.45168 19.5266 0 25.1479 0 31.1637C0 37.2781 3.25444 42.6035 8.57988 45.4635C11.0454 46.7455 13.7081 47.4359 16.2722 47.4359C19.3294 47.4359 22.288 46.5483 24.9507 44.8718C29.9803 48.1262 36.0947 48.3234 41.4201 45.4635C46.7456 42.6035 50 37.2781 50 31.1637C50 25.0493 46.6469 19.5266 41.2229 16.7653ZM22.7811 43.0966C18.6391 45.3649 13.7081 45.3649 9.56607 42.998C5.22682 40.5325 2.66272 36.1933 2.66272 31.1637C2.66272 26.43 5.12821 22.0907 9.1716 19.6252C10.1578 24.359 13.3136 28.501 17.6529 30.6706C17.4556 35.4043 19.3294 39.8422 22.7811 43.0966ZM32.1499 27.8106C31.4596 24.5562 29.783 21.499 27.3176 19.2307C30.6706 17.357 34.8126 17.0611 38.4615 18.3432C37.7712 22.2879 35.503 25.7396 32.1499 27.8106ZM20.6114 28.1065C21.3018 25.2465 22.8797 22.6824 25.0493 20.8087C27.5148 22.8797 29.1913 25.8382 29.6844 28.9941C26.7258 30.0789 23.4714 30.0789 20.4142 28.9941C20.4142 28.6982 20.5128 28.4023 20.6114 28.1065ZM25.0493 17.4556C23.57 16.4694 21.8935 15.7791 20.1183 15.3846C19.428 15.1874 18.6391 15.6805 18.5404 16.3708C18.4418 16.7653 18.5404 17.0611 18.7377 17.357C18.9349 17.6528 19.2308 17.8501 19.5266 17.9487C20.7101 18.2446 21.7949 18.639 22.7811 19.2307C20.3156 21.499 18.6391 24.4576 17.9487 27.8106C14.5957 25.7396 12.2288 22.2879 11.6371 18.3432C11.9329 18.2446 12.1302 18.1459 12.426 18.0473C12.7219 17.9487 13.0178 17.7515 13.215 17.357C13.4122 17.0611 13.4122 16.6666 13.3136 16.3708C13.1164 15.6805 12.3274 15.286 11.6371 15.4832C11.5385 15.4832 11.5385 15.4832 11.4398 15.5818C11.8343 8.48124 17.7515 2.6627 25.0493 2.6627C32.3471 2.6627 38.2643 8.38262 38.6588 15.5818C34.0237 14.2012 28.9941 14.8915 25.0493 17.4556ZM29.783 31.7554C29.5858 35.5029 27.9093 39.0532 25.0493 41.5187C22.1893 39.0532 20.4142 35.6016 20.3156 31.7554C23.3728 32.7416 26.7258 32.7416 29.783 31.7554ZM32.4458 30.6706C36.785 28.4023 39.8422 24.359 40.927 19.6252C44.9704 22.0907 47.4359 26.43 47.4359 31.1637C47.4359 36.0947 44.8718 40.5325 40.5325 42.998C36.3905 45.3649 31.4596 45.3649 27.3176 43.0966C30.7692 39.8422 32.643 35.4043 32.4458 30.6706Z\",\n fill: color\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M15.5819 14.8915C14.9901 14.9901 14.497 15.5818 14.497 16.1735C14.497 16.8639 15.0888 17.5542 15.8777 17.5542C16.6667 17.5542 17.2584 16.9625 17.2584 16.1735C17.2584 15.7791 17.0611 15.3846 16.7653 15.1874C16.3708 14.9901 15.9763 14.8915 15.5819 14.8915Z\",\n fill: color\n }));\n});\nexport default ImageFilters;","import _extends from \"@babel/runtime/helpers/extends\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/objectWithoutProperties\";\nvar _excluded = [\"color\", \"size\"];\nimport React from 'react';\nimport { intrinsicComponent } from './utils/functions';\nexport var Crop = intrinsicComponent(function (_ref, ref) {\n var _ref$color = _ref.color,\n color = _ref$color === void 0 ? 'currentColor' : _ref$color,\n _ref$size = _ref.size,\n size = _ref$size === void 0 ? 14 : _ref$size,\n rest = _objectWithoutProperties(_ref, _excluded);\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n ref: ref,\n width: size,\n height: size,\n viewBox: \"0 0 50 50\",\n fill: \"none\",\n xmlns: \"http://www.w3.org/2000/svg\"\n }, rest), /*#__PURE__*/React.createElement(\"path\", {\n fillRule: \"evenodd\",\n clipRule: \"evenodd\",\n d: \"M5 2.00049C3.34315 2.00049 2 3.34364 2 5.00049V16.7505H5.5V5.50049H16.75V2.00049H5ZM45 2.00049H33.25V5.50049H44.5V16.7505H48V5.00049C48 3.34363 46.6569 2.00049 45 2.00049ZM5.5 33.2505H2V45.0005C2 46.6573 3.34315 48.0005 5 48.0005H16.75V44.5005H5.5V33.2505ZM48 33.2505H44.5V44.5005H33.25V48.0005H45C46.6569 48.0005 48 46.6573 48 45.0005V33.2505Z\",\n fill: color\n }));\n});\nexport default Crop;","import _extends from \"@babel/runtime/helpers/extends\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/objectWithoutProperties\";\nvar _excluded = [\"color\", \"size\"];\nimport React from 'react';\nimport { intrinsicComponent } from './utils/functions';\nexport var CropLandscape = intrinsicComponent(function (_ref, ref) {\n var _ref$color = _ref.color,\n color = _ref$color === void 0 ? 'currentColor' : _ref$color,\n _ref$size = _ref.size,\n size = _ref$size === void 0 ? 14 : _ref$size,\n rest = _objectWithoutProperties(_ref, _excluded);\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n ref: ref,\n width: size,\n height: size,\n viewBox: \"0 0 53 37\",\n fill: \"none\",\n xmlns: \"http://www.w3.org/2000/svg\"\n }, rest), /*#__PURE__*/React.createElement(\"path\", {\n fillRule: \"evenodd\",\n clipRule: \"evenodd\",\n d: \"M4.11841 3.93799V32.063H47.8684V3.93799H4.11841ZM3.49341 0.812988C2.1127 0.812988 0.993408 1.91229 0.993408 3.26835V32.7326C0.993408 34.0887 2.1127 35.188 3.49341 35.188H48.4934C49.8741 35.188 50.9934 34.0887 50.9934 32.7326V3.26835C50.9934 1.91229 49.8741 0.812988 48.4934 0.812988H3.49341Z\",\n fill: color\n }));\n});\nexport default CropLandscape;","import _extends from \"@babel/runtime/helpers/extends\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/objectWithoutProperties\";\nvar _excluded = [\"color\", \"size\"];\nimport React from 'react';\nimport { intrinsicComponent } from './utils/functions';\nexport var Resize = intrinsicComponent(function (_ref, ref) {\n var _ref$color = _ref.color,\n color = _ref$color === void 0 ? 'currentColor' : _ref$color,\n _ref$size = _ref.size,\n size = _ref$size === void 0 ? 14 : _ref$size,\n rest = _objectWithoutProperties(_ref, _excluded);\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n ref: ref,\n width: size,\n height: size,\n viewBox: \"0 0 50 50\",\n fill: \"none\",\n xmlns: \"http://www.w3.org/2000/svg\"\n }, rest), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M0.5 0.5H3V2.375H2.375V3H0.5V0.5Z\",\n fill: color\n }), /*#__PURE__*/React.createElement(\"path\", {\n fillRule: \"evenodd\",\n clipRule: \"evenodd\",\n d: \"M0.5 21.125H3V21.2693H24.7308V43H24.875V45.5L0.5 45.5001V21.125ZM22.2308 43L3 43.0001V23.7693H22.2308V43Z\",\n fill: color\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M43 45.5H45.5V43H43.625V43.625H43V45.5Z\",\n fill: color\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M45.5 3V0.5H43V2.375H43.625V3H45.5Z\",\n fill: color\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M6.125 0.5V3H9.875V0.5H6.125Z\",\n fill: color\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M13.625 0.5V3H17.375V0.5H13.625Z\",\n fill: color\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M21.125 0.5V3H24.875V0.5H21.125Z\",\n fill: color\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M28.625 0.5V3H32.375V0.5H28.625Z\",\n fill: color\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M36.125 0.5V3H39.875V0.5H36.125Z\",\n fill: color\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M45.5 6.125H43V9.875H45.5V6.125Z\",\n fill: color\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M45.5 13.625H43V17.375H45.5V13.625Z\",\n fill: color\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M45.5 21.125H43V24.875H45.5V21.125Z\",\n fill: color\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M45.5 28.625H43V32.375H45.5V28.625Z\",\n fill: color\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M45.5 36.125H43V39.875H45.5V36.125Z\",\n fill: color\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M39.875 45.5V43H36.125V45.5H39.875Z\",\n fill: color\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M32.375 45.5V43H28.625V45.5H32.375Z\",\n fill: color\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M0.5 17.375H3V13.625H0.5V17.375Z\",\n fill: color\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M0.5 9.875H3V6.125H0.5V9.875Z\",\n fill: color\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M35.1391 9.23718L26.3209 17.8619C25.8274 18.3446 25.8186 19.136 26.3013 19.6295C26.784 20.1231 27.5754 20.1319 28.069 19.6492L37.1012 10.815V16.9907C37.1012 17.681 37.6609 18.2407 38.3512 18.2407C39.0416 18.2407 39.6012 17.681 39.6012 16.9907V7.98718C39.6012 7.29683 39.0416 6.73718 38.3512 6.73718L29.3477 6.73718C28.6574 6.73718 28.0977 7.29683 28.0977 7.98718C28.0977 8.67754 28.6574 9.23718 29.3477 9.23718L35.1391 9.23718Z\",\n fill: color\n }));\n});\nexport default Resize;","import _extends from \"@babel/runtime/helpers/extends\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/objectWithoutProperties\";\nvar _excluded = [\"color\", \"size\"];\nimport React from 'react';\nimport { intrinsicComponent } from './utils/functions';\nexport var Watermark = intrinsicComponent(function (_ref, ref) {\n var _ref$color = _ref.color,\n color = _ref$color === void 0 ? 'currentColor' : _ref$color,\n _ref$size = _ref.size,\n size = _ref$size === void 0 ? 14 : _ref$size,\n rest = _objectWithoutProperties(_ref, _excluded);\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n ref: ref,\n width: size,\n height: size,\n viewBox: \"0 0 50 50\",\n fill: \"none\",\n xmlns: \"http://www.w3.org/2000/svg\"\n }, rest), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M42.1323 0.500031H2.73399C1.42693 0.500031 0.399963 1.527 0.399963 2.83406V43.166C0.399963 44.4731 1.42693 45.5 2.73399 45.5H42.1323C43.4394 45.5 44.4664 44.4731 44.4664 43.166V2.83406C44.4664 1.527 43.4394 0.500031 42.1323 0.500031ZM41.6655 3.30086V25.8942L36.624 21.693C36.1572 21.2262 35.4103 21.2262 34.8502 21.5996L28.595 26.2677L15.5244 11.2365C15.3377 10.9565 14.9643 10.7697 14.5908 10.7697C14.2174 10.7697 13.8439 10.9565 13.5639 11.1432L3.20079 21.693V3.30086H41.6655ZM3.20079 42.6992V39.8984C4.22776 40.3652 5.72154 40.832 7.58876 40.832C9.36262 40.832 10.483 40.2718 11.3232 39.805C12.0701 39.4316 12.5369 39.1515 13.3771 39.2448C14.3108 39.3382 14.8709 39.5249 15.4311 39.805C16.2713 40.0851 17.2049 40.4585 18.9788 40.4585V38.3112C17.6717 38.3112 17.0182 38.0312 16.178 37.7511C15.5244 37.471 14.6842 37.1909 13.5639 37.0975C12.0701 36.9108 11.1365 37.471 10.2962 37.8444C9.54934 38.2179 8.80245 38.5913 7.4954 38.5913C5.06801 38.5913 3.6676 37.7511 3.10743 37.2843V35.0436C4.1344 35.5104 5.62818 35.9772 7.4954 35.9772C9.26926 35.9772 10.3896 35.417 11.2298 34.9502C11.9767 34.5768 12.4435 34.2967 13.2838 34.3901C14.2174 34.4834 14.7776 34.6702 15.3377 34.9502C16.178 35.2303 17.1116 35.6038 18.8854 35.6038V33.4565C17.5784 33.4565 16.9249 33.1764 16.0846 32.8963C15.4311 32.6162 14.5908 32.3361 13.4705 32.2428C11.9767 32.056 11.0431 32.6162 10.2029 32.9897C9.45598 33.3631 8.70909 33.7365 7.40204 33.7365C4.97465 33.7365 3.57424 32.8963 3.01407 32.4295V30.1888C4.04104 30.6556 5.53482 31.1224 7.40204 31.1224C9.1759 31.1224 10.2962 30.5623 11.1365 30.0955C11.8834 29.722 12.3502 29.4419 13.1904 29.5353C14.124 29.6287 14.6842 29.8154 15.2444 30.0955C16.0846 30.3755 17.0182 30.749 18.7921 30.749V28.6017C17.485 28.6017 16.8315 28.3216 15.9912 28.0415C15.3377 27.7614 14.4975 27.4814 13.3771 27.388C11.8834 27.2013 10.9498 27.7614 10.1095 28.1349C9.36262 28.5083 8.61573 28.8818 7.30868 28.8818C4.88129 28.8818 3.48088 28.0415 2.92071 27.5747V25.7075L14.124 14.2241L27.1012 29.0685C27.568 29.6287 28.4083 29.722 28.9684 29.2552L35.4103 24.4004L41.3854 29.4419V42.6058H3.20079V42.6992Z\",\n fill: color\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M32.7029 15.7179C35.4103 15.7179 37.651 13.4772 37.651 10.7697C37.651 8.06227 35.4103 5.82161 32.7029 5.82161C29.9954 5.82161 27.7547 8.06227 27.7547 10.7697C27.7547 13.4772 29.9954 15.7179 32.7029 15.7179ZM32.7029 8.15563C34.1966 8.15563 35.317 9.36933 35.317 10.7697C35.317 12.1702 34.1033 13.3838 32.7029 13.3838C31.3025 13.3838 30.0888 12.1702 30.0888 10.7697C30.0888 9.36933 31.2091 8.15563 32.7029 8.15563Z\",\n fill: color\n }));\n});\nexport default Watermark;","import _extends from \"@babel/runtime/helpers/extends\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/objectWithoutProperties\";\nvar _excluded = [\"color\", \"size\"];\nimport React from 'react';\nimport { intrinsicComponent } from './utils/functions';\nexport var Images = intrinsicComponent(function (_ref, ref) {\n var _ref$color = _ref.color,\n color = _ref$color === void 0 ? 'currentColor' : _ref$color,\n _ref$size = _ref.size,\n size = _ref$size === void 0 ? 14 : _ref$size,\n rest = _objectWithoutProperties(_ref, _excluded);\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n ref: ref,\n width: size,\n height: size,\n viewBox: \"0 0 50 50\",\n fill: \"none\",\n xmlns: \"http://www.w3.org/2000/svg\"\n }, rest), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M43.4164 5.98527H1.06762C0.533808 5.98527 0 6.53674 0 7.08821V49C0 49.7353 0.533808 50.1029 1.06762 50.1029H43.4164C44.1281 50.1029 44.484 49.7353 44.484 49V7.08821C44.484 6.53674 44.1281 5.98527 43.4164 5.98527ZM35.7651 13.1544C37.9004 13.1544 39.5 15.0809 39.5 17.1029C39.5 19.3088 37.7224 20.6029 35.7651 20.6029C33.8078 20.6029 32 19.125 32 17.1029C31.8221 14.897 33.6299 13.1544 35.7651 13.1544ZM1.9573 45.875C2.13523 45.6912 14.2349 30.9853 16.548 27.8603C16.726 27.4926 17.2598 27.4926 17.4377 27.8603L29.7153 43.4853L35.0534 37.4191C35.4093 37.0514 35.7651 37.2353 35.9431 37.4191L42.5267 45.875H1.9573Z\",\n fill: color\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M48.9164 -3.8147e-06H6.74555C6.03381 -3.8147e-06 5.5 0.367643 5.5 1.10294V4.29294H7.5V2.20588H47.6892V39H46.2473V44.1176H48.9164C49.6281 44.1176 49.984 43.75 49.984 43.0147V1.10294C49.984 0.367643 49.6281 -3.8147e-06 48.9164 -3.8147e-06Z\",\n fill: color\n }));\n});\nexport default Images;","import _extends from \"@babel/runtime/helpers/extends\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/objectWithoutProperties\";\nvar _excluded = [\"color\", \"size\"];\nimport React from 'react';\nimport { intrinsicComponent } from './utils/functions';\nexport var Reset = intrinsicComponent(function (_ref, ref) {\n var _ref$color = _ref.color,\n color = _ref$color === void 0 ? 'currentColor' : _ref$color,\n _ref$size = _ref.size,\n size = _ref$size === void 0 ? 14 : _ref$size,\n rest = _objectWithoutProperties(_ref, _excluded);\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n ref: ref,\n width: size,\n height: size,\n viewBox: \"0 0 52 52\",\n fill: \"none\",\n xmlns: \"http://www.w3.org/2000/svg\"\n }, rest), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M25 0C38.8071 0 50 11.1929 50 25C50 38.807 38.8071 50 25 50C14.111 50 4.854 43.0397 1.42326 33.333C0.963005 32.0312 1.6455 30.603 2.94725 30.143C4.249 29.6828 5.67725 30.365 6.1375 31.667C8.88425 39.4382 16.2957 45 25 45C36.0457 45 45 36.0457 45 25C45 13.9543 36.0457 5 25 5C21.121 5 17.8345 6.40292 14.7095 8.6015C12.6078 10.0803 10.663 11.8526 8.6895 13.75H16.25C17.6308 13.75 18.75 14.8693 18.75 16.25C18.75 17.6307 17.6308 18.75 16.25 18.75H2.5C1.11926 18.75 0 17.6307 0 16.25V2.5C0 1.1193 1.11926 0 2.5 0C3.88075 0 5 1.1193 5 2.5V10.3593C7.12075 8.31457 9.38601 6.23342 11.8325 4.51222C15.5128 1.9229 19.7882 0 25 0Z\",\n fill: color\n }));\n});\nexport default Reset;","import _extends from \"@babel/runtime/helpers/extends\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/objectWithoutProperties\";\nvar _excluded = [\"color\", \"size\"];\nimport React from 'react';\nimport { intrinsicComponent } from './utils/functions';\nexport var Text = intrinsicComponent(function (_ref, ref) {\n var _ref$color = _ref.color,\n color = _ref$color === void 0 ? 'currentColor' : _ref$color,\n _ref$size = _ref.size,\n size = _ref$size === void 0 ? 14 : _ref$size,\n rest = _objectWithoutProperties(_ref, _excluded);\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n ref: ref,\n width: size,\n height: size,\n viewBox: \"0 0 50 50\",\n fill: \"none\",\n xmlns: \"http://www.w3.org/2000/svg\"\n }, rest), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M39.4229 8.89453L39.7891 16.6582H38.8613C38.6823 15.291 38.4382 14.3145 38.1289 13.7285C37.6243 12.7845 36.9489 12.0928 36.1025 11.6533C35.2725 11.1976 34.1738 10.9697 32.8066 10.9697H28.1436V36.2627C28.1436 38.2972 28.3633 39.5667 28.8027 40.0713C29.4212 40.7549 30.3734 41.0967 31.6592 41.0967H32.8066V42H18.7686V41.0967H19.9404C21.3402 41.0967 22.333 40.6735 22.9189 39.8271C23.277 39.3063 23.4561 38.1182 23.4561 36.2627V10.9697H19.4766C17.9303 10.9697 16.8317 11.0837 16.1807 11.3115C15.3343 11.6208 14.61 12.2148 14.0078 13.0938C13.4056 13.9727 13.0475 15.1608 12.9336 16.6582H12.0059L12.3965 8.89453H39.4229Z\",\n fill: color\n }));\n});\nexport default Text;","import _extends from \"@babel/runtime/helpers/extends\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/objectWithoutProperties\";\nvar _excluded = [\"color\", \"size\"];\nimport React from 'react';\nimport { intrinsicComponent } from './utils/functions';\nexport var TextAlignLeft = intrinsicComponent(function (_ref, ref) {\n var _ref$color = _ref.color,\n color = _ref$color === void 0 ? 'currentColor' : _ref$color,\n _ref$size = _ref.size,\n size = _ref$size === void 0 ? 14 : _ref$size,\n rest = _objectWithoutProperties(_ref, _excluded);\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n ref: ref,\n width: size,\n height: size,\n viewBox: \"0 0 45 29\",\n fill: \"none\",\n xmlns: \"http://www.w3.org/2000/svg\"\n }, rest), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M0 1.89502C0 1.20466 0.559644 0.64502 1.25 0.64502H28.75C29.4404 0.64502 30 1.20466 30 1.89502C30 2.58538 29.4404 3.14502 28.75 3.14502H1.25C0.559645 3.14502 0 2.58538 0 1.89502Z\",\n fill: color\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M0 14.395C0 13.7047 0.559644 13.145 1.25 13.145H43.75C44.4404 13.145 45 13.7047 45 14.395C45 15.0854 44.4404 15.645 43.75 15.645H1.25C0.559645 15.645 0 15.0854 0 14.395Z\",\n fill: color\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M1.25 25.645C0.559644 25.645 0 26.2047 0 26.895C0 27.5854 0.559645 28.145 1.25 28.145H28.75C29.4404 28.145 30 27.5854 30 26.895C30 26.2047 29.4404 25.645 28.75 25.645H1.25Z\",\n fill: color\n }));\n});\nexport default TextAlignLeft;","import _extends from \"@babel/runtime/helpers/extends\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/objectWithoutProperties\";\nvar _excluded = [\"color\", \"size\"];\nimport React from 'react';\nimport { intrinsicComponent } from './utils/functions';\nexport var TextAlignCenter = intrinsicComponent(function (_ref, ref) {\n var _ref$color = _ref.color,\n color = _ref$color === void 0 ? 'currentColor' : _ref$color,\n _ref$size = _ref.size,\n size = _ref$size === void 0 ? 14 : _ref$size,\n rest = _objectWithoutProperties(_ref, _excluded);\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n ref: ref,\n width: size,\n height: size,\n viewBox: \"0 0 46 28\",\n fill: \"none\",\n xmlns: \"http://www.w3.org/2000/svg\"\n }, rest), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M38 1.50049C38 0.810132 37.4404 0.250488 36.75 0.250488H9.25C8.55964 0.250488 8 0.810132 8 1.50049C8 2.19084 8.55964 2.75049 9.25 2.75049H36.75C37.4404 2.75049 38 2.19084 38 1.50049Z\",\n fill: color\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M45.5 14.0005C45.5 13.3101 44.9404 12.7505 44.25 12.7505H1.75C1.05964 12.7505 0.5 13.3101 0.5 14.0005C0.5 14.6908 1.05964 15.2505 1.75 15.2505H44.25C44.9404 15.2505 45.5 14.6908 45.5 14.0005Z\",\n fill: color\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M36.75 25.2505C37.4404 25.2505 38 25.8101 38 26.5005C38 27.1908 37.4404 27.7505 36.75 27.7505H9.25C8.55964 27.7505 8 27.1908 8 26.5005C8 25.8101 8.55964 25.2505 9.25 25.2505H36.75Z\",\n fill: color\n }));\n});\nexport default TextAlignCenter;","import _extends from \"@babel/runtime/helpers/extends\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/objectWithoutProperties\";\nvar _excluded = [\"color\", \"size\"];\nimport React from 'react';\nimport { intrinsicComponent } from './utils/functions';\nexport var RotationLeft = intrinsicComponent(function (_ref, ref) {\n var _ref$color = _ref.color,\n color = _ref$color === void 0 ? 'currentColor' : _ref$color,\n _ref$size = _ref.size,\n size = _ref$size === void 0 ? 14 : _ref$size,\n rest = _objectWithoutProperties(_ref, _excluded);\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n ref: ref,\n width: size,\n height: size,\n viewBox: \"0 0 45 43\",\n fill: \"none\",\n xmlns: \"http://www.w3.org/2000/svg\"\n }, rest), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M2.66027 14.6997L3.59752 14.4437L3.09232 3.93218C3.05918 3.24262 2.47331 2.71049 1.78375 2.74363C1.09419 2.77677 0.562061 3.36263 0.595202 4.05219L1.16041 15.8123C1.19355 16.5018 1.77942 17.034 2.46898 17.0008L14.2291 16.4356C14.9186 16.4025 15.4508 15.8166 15.4176 15.1271C15.3845 14.4375 14.7986 13.9054 14.1091 13.9385L5.48447 14.353C8.23224 7.41077 15.0052 2.50049 22.925 2.50049C33.2802 2.50049 41.6748 10.8951 41.6748 21.2503C41.6748 22.4035 41.5706 23.5324 41.3713 24.6281L43.7968 25.261C44.0449 23.9622 44.1748 22.6214 44.1748 21.2503C44.1748 9.51435 34.6609 0.000488281 22.925 0.000488281C15.0467 0.000488281 8.16974 4.28779 4.50001 10.6566L2.66027 14.6997Z\",\n fill: color\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M9.88491 34.708L8.27773 36.6309C8.82614 37.1539 9.40248 37.6479 10.0043 38.1103L11.5276 36.128C10.9528 35.6863 10.4043 35.2121 9.88491 34.708Z\",\n fill: color\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M12.3142 39.6567C13.9038 40.5764 15.6235 41.2961 17.439 41.7814L18.0846 39.3662C16.4846 38.9385 14.9685 38.3041 13.5662 37.4928L12.3142 39.6567Z\",\n fill: color\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M20.1654 42.3209C21.0738 42.4394 22.0002 42.5005 22.9408 42.5005C23.8815 42.5005 24.8079 42.4394 25.7162 42.3209L25.3929 39.8419C24.5915 39.9465 23.7731 40.0005 22.9408 40.0005C22.1086 40.0005 21.2902 39.9465 20.4888 39.8419L20.1654 42.3209Z\",\n fill: color\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M28.4427 41.7814C30.2582 41.2961 31.9779 40.5764 33.5674 39.6567L32.3154 37.4928C30.9132 38.3041 29.397 38.9385 27.7971 39.3662L28.4427 41.7814Z\",\n fill: color\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M35.8774 38.1103C37.3494 36.9791 38.6692 35.6594 39.8004 34.1873L37.8181 32.664C36.8193 33.9638 35.6538 35.1292 34.354 36.128L35.8774 38.1103Z\",\n fill: color\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M41.3468 31.8773C42.2665 30.2878 42.9862 28.5681 43.4715 26.7526L41.0563 26.107C40.6286 27.707 39.9942 29.2231 39.1829 30.6253L41.3468 31.8773Z\",\n fill: color\n }));\n});\nexport default RotationLeft;","import _extends from \"@babel/runtime/helpers/extends\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/objectWithoutProperties\";\nvar _excluded = [\"color\", \"size\"];\nimport React from 'react';\nimport { intrinsicComponent } from './utils/functions';\nexport var RotationRight = intrinsicComponent(function (_ref, ref) {\n var _ref$color = _ref.color,\n color = _ref$color === void 0 ? 'currentColor' : _ref$color,\n _ref$size = _ref.size,\n size = _ref$size === void 0 ? 14 : _ref$size,\n rest = _objectWithoutProperties(_ref, _excluded);\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n ref: ref,\n width: size,\n height: size,\n viewBox: \"0 0 50 50\",\n fill: \"none\",\n xmlns: \"http://www.w3.org/2000/svg\"\n }, rest), /*#__PURE__*/React.createElement(\"g\", {\n clipPath: \"url(#clip0)\"\n }, /*#__PURE__*/React.createElement(\"path\", {\n d: \"M50.2753 26.8064H24.4689L36.5656 14.7096C32.735 11.0806 28.7027 9.66933 23.6624 9.66933C13.3802 9.66933 6.32372 15.3145 3.50118 25.5967L0.275391 24.7903C3.50118 13.0968 11.9689 6.44355 23.6625 6.44355C29.7109 6.44355 34.348 8.25806 38.9851 12.2903L50.2754 1L50.2753 26.8064Z\",\n fill: color\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M34.5495 46.3628L33.1382 44.3467C33.743 43.9435 34.3479 43.3386 34.9527 42.9355L36.5656 44.75C35.9608 45.1532 35.3559 45.758 34.5495 46.3628Z\",\n fill: color\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M27.2913 49.387C26.6865 49.5886 26.0817 49.5886 25.4768 49.7903L25.0736 47.3709C26.4848 47.1693 27.8962 46.7661 29.3074 46.3628L30.1139 48.5806C29.1058 48.9838 28.2994 49.1854 27.2913 49.387ZM20.4365 49.9919C18.8235 49.7903 17.2107 49.5886 15.5978 48.9838L16.4042 46.766C17.8155 47.1693 19.2268 47.5724 20.6381 47.5724L20.4365 49.9919ZM11.1623 46.9677C9.75104 46.1612 8.33971 45.1532 7.13003 43.9435L8.74296 42.129C9.75104 43.137 10.9607 43.9435 12.372 44.7499L11.1623 46.9677ZM3.90425 40.3144C2.89617 38.9032 2.08974 37.2903 1.6865 35.879L3.90425 35.0726C4.50909 36.4838 5.11393 37.6935 5.92036 38.9032L3.90425 40.3144Z\",\n fill: color\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M3.2996 30.0322L0.880241 30.2338C0.678647 29.2257 0.678647 28.4193 0.678647 27.4112H3.09801C3.09801 28.4193 3.2996 29.2258 3.2996 30.0322Z\",\n fill: color\n })), /*#__PURE__*/React.createElement(\"defs\", null, /*#__PURE__*/React.createElement(\"rect\", {\n width: \"50\",\n height: \"50\",\n fill: \"white\",\n transform: \"translate(0.275391)\"\n })));\n});\nexport default RotationRight;","import _extends from \"@babel/runtime/helpers/extends\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/objectWithoutProperties\";\nvar _excluded = [\"color\", \"size\"];\nimport React from 'react';\nimport { intrinsicComponent } from './utils/functions';\nexport var LockOutline = intrinsicComponent(function (_ref, ref) {\n var _ref$color = _ref.color,\n color = _ref$color === void 0 ? 'currentColor' : _ref$color,\n _ref$size = _ref.size,\n size = _ref$size === void 0 ? 14 : _ref$size,\n rest = _objectWithoutProperties(_ref, _excluded);\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n ref: ref,\n width: size,\n height: size,\n viewBox: \"0 0 51 51\",\n fill: \"none\",\n xmlns: \"http://www.w3.org/2000/svg\"\n }, rest), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M40.5 20H38V12.5C38 5.6 32.4 0 25.5 0C18.6 0 13 5.6 13 12.5V20H10.5C9.1 20 8 21.1 8 22.5V47.5C8 48.9 9.1 50 10.5 50H40.5C41.9 50 43 48.9 43 47.5V22.5C43 21.1 41.9 20 40.5 20ZM15.5 12.5C15.5 7 20 2.5 25.5 2.5C31 2.5 35.5 7 35.5 12.5V20H15.5V12.5ZM40.5 47.5H10.5V22.5H40.5V47.5Z\",\n fill: color\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M24.3 37.3V41.3H26.8V37.3C28.3 36.8 29.3 35.4 29.3 33.8C29.3 31.7 27.6 30 25.5 30C23.4 30 21.7 31.7 21.7 33.8C21.8 35.4 22.8 36.8 24.3 37.3ZM25.5 32.5C26.2 32.5 26.8 33.1 26.8 33.8C26.8 34.5 26.2 35.1 25.5 35.1C24.8 35.1 24.2 34.5 24.2 33.8C24.3 33.1 24.8 32.5 25.5 32.5Z\",\n fill: color\n }));\n});\nexport default LockOutline;","import _extends from \"@babel/runtime/helpers/extends\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/objectWithoutProperties\";\nvar _excluded = [\"color\", \"size\"];\nimport React from 'react';\nimport { intrinsicComponent } from './utils/functions';\nexport var UnlockOutline = intrinsicComponent(function (_ref, ref) {\n var _ref$color = _ref.color,\n color = _ref$color === void 0 ? 'currentColor' : _ref$color,\n _ref$size = _ref.size,\n size = _ref$size === void 0 ? 14 : _ref$size,\n rest = _objectWithoutProperties(_ref, _excluded);\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n ref: ref,\n width: size,\n height: size,\n viewBox: \"0 0 52 52\",\n fill: \"none\",\n xmlns: \"http://www.w3.org/2000/svg\"\n }, rest), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M36.2754 7.5C34.2754 3.1 29.8754 0 24.7754 0C17.8754 0 12.2754 5.6 12.2754 12.5V20H9.77539C8.37539 20 7.27539 21.1 7.27539 22.5V47.5C7.27539 48.9 8.37539 50 9.77539 50H39.7754C41.1754 50 42.2754 48.9 42.2754 47.5V22.5C42.2754 21.1 41.1754 20 39.7754 20H14.7754V12.5C14.7754 7 19.2754 2.5 24.7754 2.5C28.4754 2.5 31.7754 4.5 33.4754 7.6L36.2754 7.5ZM39.7754 47.5H9.77539V22.5H39.7754V47.5Z\",\n fill: color\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M24.7754 30C22.6754 30 20.9754 31.7 20.9754 33.7C20.9754 35.3 21.9754 36.7 23.4754 37.2V41.2H25.9754V37.2C27.4754 36.7 28.4754 35.3 28.4754 33.7C28.5754 31.7 26.8754 30 24.7754 30ZM24.7754 35C24.0754 35 23.4754 34.4 23.4754 33.7C23.4754 33 24.0754 32.4 24.7754 32.4C25.4754 32.4 25.9754 33 25.9754 33.7C25.9754 34.4 25.4754 35 24.7754 35Z\",\n fill: color\n }));\n});\nexport default UnlockOutline;","import _extends from \"@babel/runtime/helpers/extends\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/objectWithoutProperties\";\nvar _excluded = [\"color\", \"size\"];\nimport React from 'react';\nimport { intrinsicComponent } from './utils/functions';\nexport var Point = intrinsicComponent(function (_ref, ref) {\n var _ref$color = _ref.color,\n color = _ref$color === void 0 ? 'currentColor' : _ref$color,\n _ref$size = _ref.size,\n size = _ref$size === void 0 ? 14 : _ref$size,\n rest = _objectWithoutProperties(_ref, _excluded);\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n ref: ref,\n width: size,\n height: size,\n viewBox: \"0 0 50 50\",\n fill: \"none\",\n xmlns: \"http://www.w3.org/2000/svg\"\n }, rest), /*#__PURE__*/React.createElement(\"circle\", {\n cx: \"25\",\n cy: \"25\",\n r: \"8.33333\",\n fill: color\n }));\n});\nexport default Point;","import _extends from \"@babel/runtime/helpers/extends\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/objectWithoutProperties\";\nvar _excluded = [\"color\", \"size\"];\nimport React from 'react';\nimport { intrinsicComponent } from './utils/functions';\nexport var About = intrinsicComponent(function (_ref, ref) {\n var _ref$color = _ref.color,\n color = _ref$color === void 0 ? 'currentColor' : _ref$color,\n _ref$size = _ref.size,\n size = _ref$size === void 0 ? 14 : _ref$size,\n rest = _objectWithoutProperties(_ref, _excluded);\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n ref: ref,\n width: size,\n height: size,\n viewBox: \"0 0 50 50\",\n fill: \"none\",\n xmlns: \"http://www.w3.org/2000/svg\"\n }, rest), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M42.6793 7.32203C32.916 -2.44013 17.0863 -2.44122 7.32197 7.32203C-2.44128 17.0853 -2.4402 32.915 7.32197 42.6793C17.0852 52.4404 32.9149 52.4415 42.6793 42.6793C52.4414 32.915 52.4403 17.0864 42.6793 7.32203ZM28.2605 35.8705C28.2605 37.6716 26.8007 39.1314 24.9995 39.1314C23.1984 39.1314 21.7386 37.6716 21.7386 35.8705V22.8267C21.7386 21.0256 23.1984 19.5658 24.9995 19.5658C26.8007 19.5658 28.2605 21.0256 28.2605 22.8267V35.8705ZM24.9419 17.2527C23.0636 17.2527 21.8114 15.9222 21.8506 14.2798C21.8114 12.558 23.0636 11.2678 24.98 11.2678C26.8974 11.2678 28.1105 12.5591 28.1507 14.2798C28.1496 15.9222 26.8985 17.2527 24.9419 17.2527Z\",\n fill: color\n }));\n});\nexport default About;","import _extends from \"@babel/runtime/helpers/extends\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/objectWithoutProperties\";\nvar _excluded = [\"color\", \"size\"];\nimport React from 'react';\nimport { intrinsicComponent } from './utils/functions';\nexport var Warning = intrinsicComponent(function (_ref, ref) {\n var _ref$color = _ref.color,\n color = _ref$color === void 0 ? 'currentColor' : _ref$color,\n _ref$size = _ref.size,\n size = _ref$size === void 0 ? 14 : _ref$size,\n rest = _objectWithoutProperties(_ref, _excluded);\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n ref: ref,\n width: size,\n height: size,\n viewBox: \"0 0 50 50\",\n fill: \"none\",\n xmlns: \"http://www.w3.org/2000/svg\"\n }, rest), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M48.9856 38.314L31.3034 3.80423C29.9688 1.42247 27.6118 0 24.9985 0C22.3852 0 20.0282 1.42247 18.6936 3.80423C18.6836 3.82245 18.6751 3.84067 18.665 3.8589L1.04158 38.2594C-0.321602 40.6914 -0.347383 43.612 0.971367 46.0713C2.29314 48.5321 4.67439 50 7.345 50H42.5544C45.225 50 47.7041 48.5321 49.0258 46.0713C50.3445 43.6121 50.3188 40.6913 48.9856 38.314ZM22.0659 15.8013C22.0659 14.0842 23.3789 12.6924 24.9985 12.6924C26.6182 12.6924 27.9311 14.0843 27.9311 15.8013V28.2372C27.9311 29.9541 26.6181 31.3462 24.9985 31.3462C23.3789 31.3462 22.0659 29.954 22.0659 28.2372V15.8013ZM24.9985 43.7821C22.5728 43.7821 20.5995 41.6902 20.5995 39.1186C20.5995 36.5471 22.5727 34.4552 24.9985 34.4552C27.4242 34.4552 29.3974 36.5471 29.3974 39.1186C29.3975 41.6901 27.4243 43.7821 24.9985 43.7821Z\",\n fill: color\n }));\n});\nexport default Warning;","import _extends from \"@babel/runtime/helpers/extends\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/objectWithoutProperties\";\nvar _excluded = [\"color\", \"size\"];\nimport React from 'react';\nimport { intrinsicComponent } from './utils/functions';\nexport var InfoOutline = intrinsicComponent(function (_ref, ref) {\n var _ref$color = _ref.color,\n color = _ref$color === void 0 ? 'currentColor' : _ref$color,\n _ref$size = _ref.size,\n size = _ref$size === void 0 ? 14 : _ref$size,\n rest = _objectWithoutProperties(_ref, _excluded);\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n ref: ref,\n width: size,\n height: size,\n viewBox: \"0 0 50 50\",\n fill: \"none\",\n xmlns: \"http://www.w3.org/2000/svg\"\n }, rest), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M25 50C11.2033 50 0 38.7967 0 25C0 11.2033 11.2033 0 25 0C38.7967 0 50 11.2033 50 25C50 38.7967 38.6929 50 25 50ZM25 3.52697C13.1743 3.52697 3.63071 13.1743 3.63071 24.8963C3.63071 36.6183 13.278 46.2656 25 46.2656C36.8257 46.2656 46.3693 36.6183 46.3693 24.8963C46.3693 13.1743 36.8257 3.52697 25 3.52697Z\",\n fill: color\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M28.3755 13.125C28.3755 11.3992 26.9765 10 25.2505 10C23.5245 10 22.1255 11.3992 22.1255 13.125C22.1255 14.8516 23.5245 16.25 25.2505 16.25C26.9765 16.25 28.3755 14.8516 28.3755 13.125Z\",\n fill: color\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M20.563 38.5H29.938C30.8009 38.5 31.5005 37.8012 31.5005 36.9375C31.5005 36.0746 30.8009 35.375 29.938 35.375H28.3755V20.9375C28.3755 20.0746 27.6759 19.375 26.813 19.375H20.563C19.7001 19.375 19.0005 20.0746 19.0005 20.9375C19.0005 21.8012 19.7001 22.5 20.563 22.5H22.1255V35.375H20.563C19.7001 35.375 19.0005 36.0746 19.0005 36.9375C19.0005 37.8012 19.7001 38.5 20.563 38.5Z\",\n fill: color\n }));\n});\nexport default InfoOutline;","import _extends from \"@babel/runtime/helpers/extends\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/objectWithoutProperties\";\nvar _excluded = [\"color\", \"size\"];\nimport React from 'react';\nimport { intrinsicComponent } from './utils/functions';\nexport var ImageOutline = intrinsicComponent(function (_ref, ref) {\n var _ref$color = _ref.color,\n color = _ref$color === void 0 ? 'currentColor' : _ref$color,\n _ref$size = _ref.size,\n size = _ref$size === void 0 ? 14 : _ref$size,\n rest = _objectWithoutProperties(_ref, _excluded);\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n ref: ref,\n width: size,\n height: size,\n viewBox: \"0 0 50 50\",\n fill: \"none\",\n xmlns: \"http://www.w3.org/2000/svg\"\n }, rest), /*#__PURE__*/React.createElement(\"path\", {\n fillRule: \"evenodd\",\n clipRule: \"evenodd\",\n d: \"M31.3032 17.8662C34.0646 17.8662 36.3032 15.6276 36.3032 12.8662C36.3032 10.1048 34.0646 7.86618 31.3032 7.86618C28.5418 7.86618 26.3032 10.1048 26.3032 12.8662C26.3032 15.6276 28.5418 17.8662 31.3032 17.8662ZM31.3032 15.3662C32.6839 15.3662 33.8032 14.2469 33.8032 12.8662C33.8032 11.4855 32.6839 10.3662 31.3032 10.3662C29.9225 10.3662 28.8032 11.4855 28.8032 12.8662C28.8032 14.2469 29.9225 15.3662 31.3032 15.3662Z\",\n fill: color\n }), /*#__PURE__*/React.createElement(\"path\", {\n fillRule: \"evenodd\",\n clipRule: \"evenodd\",\n d: \"M15.9372 15.1063C16.3967 15.0794 16.8338 15.3071 17.075 15.6991L25.0831 28.7141L29.8357 24.4289C30.0935 24.1966 30.4362 24.0818 30.7819 24.1121C31.1276 24.1424 31.4452 24.3151 31.6586 24.5887L40.2822 35.6497C40.5759 36.0264 40.6292 36.5376 40.4196 36.9668C40.21 37.396 39.7741 37.6683 39.2964 37.6683H6.70331C6.2766 37.6683 5.87937 37.4506 5.64974 37.091C5.42011 36.7313 5.38981 36.2794 5.56937 35.8923L14.8765 15.8282C15.0702 15.4106 15.4777 15.1333 15.9372 15.1063ZM16.1652 18.991L8.66108 35.1683H36.7368L30.5126 27.1848L25.6422 31.5761C25.3666 31.8246 24.9947 31.9378 24.6274 31.885C24.26 31.8322 23.9351 31.6189 23.7406 31.3027L16.1652 18.991Z\",\n fill: color\n }), /*#__PURE__*/React.createElement(\"path\", {\n fillRule: \"evenodd\",\n clipRule: \"evenodd\",\n d: \"M0.5 3C0.5 1.61929 1.61929 0.5 3 0.5H43C44.3807 0.5 45.5 1.61929 45.5 3V43C45.5 44.3807 44.3807 45.5 43 45.5H3C1.61929 45.5 0.5 44.3807 0.5 43V3ZM3 3H43V43H3V3Z\",\n fill: color\n }));\n});\nexport default ImageOutline;","import _extends from \"@babel/runtime/helpers/extends\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/objectWithoutProperties\";\nvar _excluded = [\"color\", \"size\"];\nimport React from 'react';\nimport { intrinsicComponent } from './utils/functions';\nexport var Custom = intrinsicComponent(function (_ref, ref) {\n var _ref$color = _ref.color,\n color = _ref$color === void 0 ? 'currentColor' : _ref$color,\n _ref$size = _ref.size,\n size = _ref$size === void 0 ? 14 : _ref$size,\n rest = _objectWithoutProperties(_ref, _excluded);\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n ref: ref,\n width: size,\n height: size,\n viewBox: \"0 0 50 50\",\n fill: \"none\",\n xmlns: \"http://www.w3.org/2000/svg\"\n }, rest), /*#__PURE__*/React.createElement(\"path\", {\n fillRule: \"evenodd\",\n clipRule: \"evenodd\",\n d: \"M0.562515 0.562512H3.68752V2.90626H2.90627V3.68751H0.562515V0.562512ZM0.562515 44.3125V47.4375H3.68752V45.0938H2.90627V44.3125H0.562515ZM44.3125 47.4375H47.4375V44.3125H45.0938V45.0938H44.3125V47.4375ZM47.4375 3.68751V0.562512H44.3125V2.90626H45.0938V3.68751H47.4375ZM7.59376 0.562512V3.68751H12.2813V0.562512H7.59376ZM16.9688 0.562512V3.68751H21.6563V0.562512H16.9688ZM26.3438 0.562512V3.68751H31.0313V0.562512H26.3438ZM35.7188 0.562512V3.68751H40.4063V0.562512H35.7188ZM47.4375 7.59376H44.3125V12.2813H47.4375V7.59376ZM47.4375 16.9688H44.3125V21.6563H47.4375V16.9688ZM47.4375 26.3438H44.3125V31.0313H47.4375V26.3438ZM47.4375 35.7188H44.3125V40.4063H47.4375V35.7188ZM40.4063 47.4375V44.3125H35.7188V47.4375H40.4063ZM31.0313 47.4375V44.3125H26.3438V47.4375H31.0313ZM21.6563 47.4375V44.3125H16.9688V47.4375H21.6563ZM12.2813 47.4375V44.3125H7.59377V47.4375H12.2813ZM0.562515 40.4063H3.68752V35.7188H0.562515V40.4063ZM0.562515 31.0313H3.68752V26.3438H0.562515V31.0313ZM0.562515 21.6563H3.68752V16.9688H0.562515V21.6563ZM0.562515 12.2813H3.68752V7.59376H0.562515V12.2813Z\",\n fill: color\n }));\n});\nexport default Custom;","import _extends from \"@babel/runtime/helpers/extends\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/objectWithoutProperties\";\nvar _excluded = [\"color\", \"size\"];\nimport React from 'react';\nimport { intrinsicComponent } from './utils/functions';\nexport var FlipY = intrinsicComponent(function (_ref, ref) {\n var _ref$color = _ref.color,\n color = _ref$color === void 0 ? 'currentColor' : _ref$color,\n _ref$size = _ref.size,\n size = _ref$size === void 0 ? 14 : _ref$size,\n rest = _objectWithoutProperties(_ref, _excluded);\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n ref: ref,\n width: size,\n height: size,\n viewBox: \"0 0 50 50\",\n fill: \"none\",\n xmlns: \"http://www.w3.org/2000/svg\"\n }, rest), /*#__PURE__*/React.createElement(\"path\", {\n fillRule: \"evenodd\",\n clipRule: \"evenodd\",\n d: \"M37.5001 24.0625C38.2086 24.0625 38.8284 23.5858 39.0102 22.901C39.1921 22.2162 38.8904 21.4948 38.2753 21.1433L3.27531 1.14333C2.79171 0.866989 2.19757 0.868973 1.71583 1.14854C1.23409 1.4281 0.937592 1.94298 0.937592 2.49996V22.5C0.937592 23.3629 1.63715 24.0625 2.50009 24.0625L37.5001 24.0625ZM4.06259 20.9375L4.06259 5.19243L31.6164 20.9375L4.06259 20.9375Z\",\n fill: color\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M38.2753 28.8566C38.8904 28.5051 39.1921 27.7837 39.0102 27.0989C38.8284 26.4142 38.2086 25.9375 37.5001 25.9375H35.3126V26.9504L34.5374 27.3933L35.3126 28.75V29.0625H35.4912L36.0878 30.1066L38.2753 28.8566Z\",\n fill: color\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M27.3378 35.1066L31.7128 32.6066L30.1624 29.8933L25.7874 32.3933L27.3378 35.1066Z\",\n fill: color\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M30.9376 25.9375H26.5626L26.5626 29.0625H30.9376L30.9376 25.9375Z\",\n fill: color\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M18.5878 40.1066L22.9628 37.6066L21.4124 34.8933L17.0374 37.3933L18.5878 40.1066Z\",\n fill: color\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M22.1876 25.9375H17.8126V29.0625H22.1876V25.9375Z\",\n fill: color\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M9.83781 45.1066L14.2128 42.6066L12.6624 39.8933L8.28738 42.3933L9.83781 45.1066Z\",\n fill: color\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M13.4376 25.9375H9.0626V29.0625H13.4376V25.9375Z\",\n fill: color\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M3.27531 48.8566L5.46281 47.6066L4.06259 45.1562V45H3.97331L3.91238 44.8933L3.72578 45H0.937592V47.5C0.937592 48.0569 1.23409 48.5718 1.71583 48.8514C2.19758 49.1309 2.79171 49.1329 3.27531 48.8566Z\",\n fill: color\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M4.6876 25.9375L2.50009 25.9375C1.63715 25.9375 0.937592 26.637 0.937592 27.5V30H4.06259V29.0625H4.6876V25.9375Z\",\n fill: color\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M0.937592 35V40L4.06259 40V35H0.937592Z\",\n fill: color\n }));\n});\nexport default FlipY;","import _extends from \"@babel/runtime/helpers/extends\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/objectWithoutProperties\";\nvar _excluded = [\"color\", \"size\"];\nimport React from 'react';\nimport { intrinsicComponent } from './utils/functions';\nexport var FlipX = intrinsicComponent(function (_ref, ref) {\n var _ref$color = _ref.color,\n color = _ref$color === void 0 ? 'currentColor' : _ref$color,\n _ref$size = _ref.size,\n size = _ref$size === void 0 ? 14 : _ref$size,\n rest = _objectWithoutProperties(_ref, _excluded);\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n ref: ref,\n width: size,\n height: size,\n viewBox: \"0 0 50 50\",\n fill: \"none\",\n xmlns: \"http://www.w3.org/2000/svg\"\n }, rest), /*#__PURE__*/React.createElement(\"path\", {\n fillRule: \"evenodd\",\n clipRule: \"evenodd\",\n d: \"M24.0625 1.93758C24.0625 1.22909 23.5858 0.609274 22.901 0.427427C22.2163 0.245581 21.4949 0.547225 21.1434 1.16237L1.14337 39.2874C0.867028 39.771 0.869012 40.3651 1.14858 40.8468C1.42814 41.3286 1.94302 41.6251 2.5 41.6251H22.5C23.3629 41.6251 24.0625 40.9255 24.0625 40.0626V1.93758ZM20.9375 38.5001H5.19247L20.9375 7.82128V38.5001Z\",\n fill: color\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M28.8566 1.16237C28.5051 0.547225 27.7837 0.245581 27.099 0.427428C26.4142 0.609274 25.9375 1.22909 25.9375 1.93758V4.12508H26.9504L27.3934 4.9003L28.75 4.12508H29.0625V3.94651L30.1066 3.34986L28.8566 1.16237Z\",\n fill: color\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M35.1066 12.0999L32.6066 7.72486L29.8934 9.2753L32.3934 13.6503L35.1066 12.0999Z\",\n fill: color\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M25.9375 8.50008V12.8751H29.0625V8.50008H25.9375Z\",\n fill: color\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M40.1066 23.9749L37.6066 19.5999L34.8934 21.1503L37.3934 25.5253L40.1066 23.9749Z\",\n fill: color\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M25.9375 20.3751V24.7501H29.0625V20.3751H25.9375Z\",\n fill: color\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M45.1066 32.7249L42.6066 28.3499L39.8934 29.9003L42.3934 34.2753L45.1066 32.7249Z\",\n fill: color\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M25.9375 29.1251V33.5001H29.0625V29.1251H25.9375Z\",\n fill: color\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M48.8566 39.2874L47.6066 37.0999L45.1562 38.5001H45V38.5894L44.8934 38.6503L45 38.8369V41.6251H47.5C48.057 41.6251 48.5719 41.3286 48.8514 40.8468C49.131 40.3651 49.133 39.771 48.8566 39.2874Z\",\n fill: color\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M25.9375 37.8751V40.0626C25.9375 40.9255 26.6371 41.6251 27.5 41.6251H30V38.5001H29.0625V37.8751H25.9375Z\",\n fill: color\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M35 41.6251H40V38.5001H35V41.6251Z\",\n fill: color\n }));\n});\nexport default FlipX;","import _extends from \"@babel/runtime/helpers/extends\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/objectWithoutProperties\";\nvar _excluded = [\"color\", \"size\"];\nimport React from 'react';\nimport { intrinsicComponent } from './utils/functions';\nexport var Ellipse = intrinsicComponent(function (_ref, ref) {\n var _ref$color = _ref.color,\n color = _ref$color === void 0 ? 'currentColor' : _ref$color,\n _ref$size = _ref.size,\n size = _ref$size === void 0 ? 14 : _ref$size,\n rest = _objectWithoutProperties(_ref, _excluded);\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n ref: ref,\n width: size,\n height: size,\n viewBox: \"0 0 52 52\",\n fill: \"none\",\n xmlns: \"http://www.w3.org/2000/svg\"\n }, rest), /*#__PURE__*/React.createElement(\"path\", {\n fillRule: \"evenodd\",\n clipRule: \"evenodd\",\n d: \"M25.2047 46.875C37.2859 46.875 47.0797 37.0812 47.0797 25C47.0797 12.9188 37.2859 3.125 25.2047 3.125C13.1235 3.125 3.32968 12.9188 3.32968 25C3.32968 37.0812 13.1235 46.875 25.2047 46.875ZM25.2047 50C39.0118 50 50.2047 38.8071 50.2047 25C50.2047 11.1929 39.0118 0 25.2047 0C11.3976 0 0.204681 11.1929 0.204681 25C0.204681 38.8071 11.3976 50 25.2047 50Z\",\n fill: color\n }));\n});\nexport default Ellipse;","import _extends from \"@babel/runtime/helpers/extends\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/objectWithoutProperties\";\nvar _excluded = [\"color\", \"size\"];\nimport React from 'react';\nimport { intrinsicComponent } from './utils/functions';\nexport var Landscape = intrinsicComponent(function (_ref, ref) {\n var _ref$color = _ref.color,\n color = _ref$color === void 0 ? 'currentColor' : _ref$color,\n _ref$size = _ref.size,\n size = _ref$size === void 0 ? 14 : _ref$size,\n rest = _objectWithoutProperties(_ref, _excluded);\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n ref: ref,\n width: size,\n height: size,\n viewBox: \"0 0 51 36\",\n fill: \"none\",\n xmlns: \"http://www.w3.org/2000/svg\"\n }, rest), /*#__PURE__*/React.createElement(\"path\", {\n fillRule: \"evenodd\",\n clipRule: \"evenodd\",\n d: \"M4.11841 3.93805V32.063H47.8684V3.93805H4.11841ZM3.49341 0.813049C2.1127 0.813049 0.993408 1.91235 0.993408 3.26841V32.7327C0.993408 34.0887 2.1127 35.188 3.49341 35.188H48.4934C49.8741 35.188 50.9934 34.0887 50.9934 32.7327V3.26841C50.9934 1.91235 49.8741 0.813049 48.4934 0.813049H3.49341Z\",\n fill: color\n }));\n});\nexport default Landscape;","import _extends from \"@babel/runtime/helpers/extends\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/objectWithoutProperties\";\nvar _excluded = [\"color\", \"size\"];\nimport React from 'react';\nimport { intrinsicComponent } from './utils/functions';\nexport var Stroke = intrinsicComponent(function (_ref, ref) {\n var _ref$color = _ref.color,\n color = _ref$color === void 0 ? 'currentColor' : _ref$color,\n _ref$size = _ref.size,\n size = _ref$size === void 0 ? 14 : _ref$size,\n rest = _objectWithoutProperties(_ref, _excluded);\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n ref: ref,\n width: size,\n height: size,\n viewBox: \"0 0 50 50\",\n fill: \"none\",\n xmlns: \"http://www.w3.org/2000/svg\"\n }, rest), /*#__PURE__*/React.createElement(\"path\", {\n fillRule: \"evenodd\",\n clipRule: \"evenodd\",\n d: \"M5.50015 7.9997C5.50015 6.61898 6.61944 5.49969 8.00015 5.49969H38.0002C39.3809 5.49969 40.5002 6.61898 40.5002 7.99969V37.9997C40.5002 39.3804 39.3809 40.4997 38.0002 40.4997H8.00015C6.61944 40.4997 5.50015 39.3804 5.50015 37.9997V7.9997ZM8.00015 7.99969H38.0002V37.9997H8.00015V7.99969Z\",\n fill: color\n }), /*#__PURE__*/React.createElement(\"path\", {\n fillRule: \"evenodd\",\n clipRule: \"evenodd\",\n d: \"M0.5 3C0.5 1.61929 1.61929 0.5 3 0.5H43C44.3807 0.5 45.5 1.61929 45.5 3V43C45.5 44.3807 44.3807 45.5 43 45.5H3C1.61929 45.5 0.5 44.3807 0.5 43V3ZM3 3H43V43H3V3Z\",\n fill: color\n }));\n});\nexport default Stroke;","import _extends from \"@babel/runtime/helpers/extends\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/objectWithoutProperties\";\nvar _excluded = [\"color\", \"size\"];\nimport React from 'react';\nimport { intrinsicComponent } from './utils/functions';\nexport var Transparency = intrinsicComponent(function (_ref, ref) {\n var _ref$color = _ref.color,\n color = _ref$color === void 0 ? 'currentColor' : _ref$color,\n _ref$size = _ref.size,\n size = _ref$size === void 0 ? 14 : _ref$size,\n rest = _objectWithoutProperties(_ref, _excluded);\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n ref: ref,\n width: size,\n height: size,\n viewBox: \"0 0 50 50\",\n fill: \"none\",\n xmlns: \"http://www.w3.org/2000/svg\"\n }, rest), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M0.166672 0.166664H8.50001V8.5H0.166672V0.166664Z\",\n fill: color\n }), /*#__PURE__*/React.createElement(\"path\", {\n fillRule: \"evenodd\",\n clipRule: \"evenodd\",\n d: \"M16.8333 8.5H8.50001V16.8333H0.166672V25.1667H8.50001V33.5H0.166672V41.8333H8.50001V33.5H16.8333V41.8333H25.1667V33.5H33.5V41.8333H41.8333V33.5H33.5V25.1667H41.8333V16.8333H33.5V8.5H41.8333V0.166664H33.5V8.5H25.1667V0.166664H16.8333V8.5ZM16.8333 16.8333V8.5H25.1667V16.8333H16.8333ZM16.8333 25.1667V33.5H25.1667V25.1667H33.5V16.8333H25.1667V25.1667H16.8333ZM16.8333 25.1667H8.50001V16.8333H16.8333V25.1667Z\",\n fill: color\n }));\n});\nexport default Transparency;","import _extends from \"@babel/runtime/helpers/extends\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/objectWithoutProperties\";\nvar _excluded = [\"color\", \"size\"];\nimport React from 'react';\nimport { intrinsicComponent } from './utils/functions';\nexport var Shadow = intrinsicComponent(function (_ref, ref) {\n var _ref$color = _ref.color,\n color = _ref$color === void 0 ? 'currentColor' : _ref$color,\n _ref$size = _ref.size,\n size = _ref$size === void 0 ? 14 : _ref$size,\n rest = _objectWithoutProperties(_ref, _excluded);\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n ref: ref,\n width: size,\n height: size,\n viewBox: \"0 0 50 50\",\n fill: \"none\",\n xmlns: \"http://www.w3.org/2000/svg\"\n }, rest), /*#__PURE__*/React.createElement(\"path\", {\n fillRule: \"evenodd\",\n clipRule: \"evenodd\",\n d: \"M2.95831 0.458374C1.5776 0.458374 0.458313 1.57766 0.458313 2.95837V35.4584C0.458313 36.8391 1.5776 37.9584 2.95831 37.9584H7.54167V43.7917C7.54167 45.8627 9.2206 47.5417 11.2917 47.5417H43.7917C45.8627 47.5417 47.5417 45.8627 47.5417 43.7917V11.2917C47.5417 9.22059 45.8627 7.54166 43.7917 7.54166H37.9583V2.95837C37.9583 1.57766 36.839 0.458374 35.4583 0.458374H2.95831ZM35.4583 2.95837H2.95831L2.95831 35.4584H35.4583V2.95837ZM15.7267 37.9584L10.0417 43.746V37.9584H15.7267ZM11.5135 45.0417L18.4712 37.9584H28.5529L21.4696 45.0417H11.5135ZM24.4159 45.0417H34.2932L45.0417 34.1339V24.0207L37.9583 31.3242V35.4584C37.9583 36.8391 36.839 37.9584 35.4583 37.9584H31.4912C31.4689 37.9859 31.445 38.0126 31.4194 38.0382L24.4159 45.0417ZM45.0417 21.3515L37.9583 28.655V18.9107L45.0417 11.8338V21.3515ZM37.0311 45.0417H43.7917C44.482 45.0417 45.0417 44.482 45.0417 43.7917V36.9124L37.0311 45.0417ZM43.8844 10.045C43.8538 10.0428 43.8229 10.0417 43.7917 10.0417H37.9583V15.9657L43.8844 10.045Z\",\n fill: color\n }));\n});\nexport default Shadow;","import _extends from \"@babel/runtime/helpers/extends\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/objectWithoutProperties\";\nvar _excluded = [\"color\", \"size\"];\nimport React from 'react';\nimport { intrinsicComponent } from './utils/functions';\nexport var RadiusCorner = intrinsicComponent(function (_ref, ref) {\n var _ref$color = _ref.color,\n color = _ref$color === void 0 ? 'currentColor' : _ref$color,\n _ref$size = _ref.size,\n size = _ref$size === void 0 ? 14 : _ref$size,\n rest = _objectWithoutProperties(_ref, _excluded);\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n ref: ref,\n width: size,\n height: size,\n viewBox: \"0 0 50 50\",\n fill: \"none\",\n xmlns: \"http://www.w3.org/2000/svg\"\n }, rest), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M3 3H23V0.5H3C1.61929 0.5 0.5 1.61929 0.5 3V43C0.5 44.3807 1.61929 45.5 3 45.5H43C44.3807 45.5 45.5 44.3807 45.5 43V23H43V43H3V3Z\",\n fill: color\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M45.5 7.25076H43V5.50076C43 5.15718 42.9321 4.83576 42.8113 4.54446L45.1206 3.58682C45.3651 4.17636 45.5 4.82281 45.5 5.50076V7.25076Z\",\n fill: color\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M24.75 0.500763V3.00076H28.25V0.500763H24.75Z\",\n fill: color\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M31.75 0.500763V3.00076H35.25V0.500763H31.75Z\",\n fill: color\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M38.75 0.500763V3.00076H40.5C40.8436 3.00076 41.165 3.06868 41.4563 3.18948L42.414 0.880166C41.8244 0.635694 41.178 0.500763 40.5 0.500763H38.75Z\",\n fill: color\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M45.5 10.7508H43V14.2508H45.5V10.7508Z\",\n fill: color\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M45.5 17.7508H43V21.2508H45.5V17.7508Z\",\n fill: color\n }));\n});\nexport default RadiusCorner;","import _extends from \"@babel/runtime/helpers/extends\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/objectWithoutProperties\";\nvar _excluded = [\"color\", \"size\"];\nimport React from 'react';\nimport { intrinsicComponent } from './utils/functions';\nexport var Position = intrinsicComponent(function (_ref, ref) {\n var _ref$color = _ref.color,\n color = _ref$color === void 0 ? 'currentColor' : _ref$color,\n _ref$size = _ref.size,\n size = _ref$size === void 0 ? 14 : _ref$size,\n rest = _objectWithoutProperties(_ref, _excluded);\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n ref: ref,\n width: size,\n height: size,\n viewBox: \"0 0 50 50\",\n fill: \"none\",\n xmlns: \"http://www.w3.org/2000/svg\"\n }, rest), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M9.25008 9.24878H11.7501V10.9675H10.9688V11.7488H9.25008V9.24878Z\",\n fill: color\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M9.25008 34.2488V36.7488H11.7501V35.03H10.9688V34.2488H9.25008Z\",\n fill: color\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M34.2501 36.7488H36.7501V34.2488H35.0313V35.03H34.2501V36.7488Z\",\n fill: color\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M36.7501 11.7488V9.24878H34.2501V10.9675H35.0313V11.7488H36.7501Z\",\n fill: color\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M14.4063 9.24878V11.7488H17.8438V9.24878H14.4063Z\",\n fill: color\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M21.2813 9.24878V11.7488H24.7188V9.24878H21.2813Z\",\n fill: color\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M28.1563 9.24878V11.7488H31.5938V9.24878H28.1563Z\",\n fill: color\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M36.7501 14.405H34.2501V17.8425H36.7501V14.405Z\",\n fill: color\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M36.7501 21.28H34.2501V24.7175H36.7501V21.28Z\",\n fill: color\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M36.7501 28.155H34.2501V31.5925H36.7501V28.155Z\",\n fill: color\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M31.5938 36.7488V34.2488H28.1563V36.7488H31.5938Z\",\n fill: color\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M24.7188 36.7488V34.2488H21.2813V36.7488H24.7188Z\",\n fill: color\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M17.8438 36.7488V34.2488H14.4063V36.7488H17.8438Z\",\n fill: color\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M9.25008 31.5925H11.7501V28.155H9.25008V31.5925Z\",\n fill: color\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M9.25008 24.7175H11.7501V21.28H9.25008V24.7175Z\",\n fill: color\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M9.25008 17.8425H11.7501V14.405H9.25008V17.8425Z\",\n fill: color\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M23.0002 26.7497C25.0712 26.7497 26.7502 25.0708 26.7502 22.9997C26.7502 20.9286 25.0712 19.2497 23.0002 19.2497C20.9291 19.2497 19.2502 20.9286 19.2502 22.9997C19.2502 25.0708 20.9291 26.7497 23.0002 26.7497Z\",\n fill: color\n }), /*#__PURE__*/React.createElement(\"path\", {\n fillRule: \"evenodd\",\n clipRule: \"evenodd\",\n d: \"M3 0.5C1.61929 0.5 0.5 1.61929 0.5 3V43C0.5 44.3807 1.61929 45.5 3 45.5H43C44.3807 45.5 45.5 44.3807 45.5 43V3C45.5 1.61929 44.3807 0.5 43 0.5H3ZM43 3H3V43H43V3Z\",\n fill: color\n }));\n});\nexport default Position;","import _extends from \"@babel/runtime/helpers/extends\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/objectWithoutProperties\";\nvar _excluded = [\"color\", \"size\"];\nimport React from 'react';\nimport { intrinsicComponent } from './utils/functions';\nexport var Spacing = intrinsicComponent(function (_ref, ref) {\n var _ref$color = _ref.color,\n color = _ref$color === void 0 ? 'currentColor' : _ref$color,\n _ref$size = _ref.size,\n size = _ref$size === void 0 ? 14 : _ref$size,\n rest = _objectWithoutProperties(_ref, _excluded);\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n ref: ref,\n width: size,\n height: size,\n viewBox: \"0 0 50 50\",\n fill: \"none\",\n xmlns: \"http://www.w3.org/2000/svg\"\n }, rest), /*#__PURE__*/React.createElement(\"path\", {\n fillRule: \"evenodd\",\n clipRule: \"evenodd\",\n d: \"M4.29986 0.991788C4.78802 0.503633 5.57947 0.503633 6.06763 0.991788L9.367 4.29116C9.85516 4.77932 9.85516 5.57077 9.367 6.05893C8.87885 6.54708 8.08739 6.54708 7.59924 6.05893L6.43374 4.89344V34.0829L7.59924 32.9174C8.08739 32.4293 8.87885 32.4293 9.367 32.9174C9.85516 33.4056 9.85516 34.197 9.367 34.6852L6.06763 37.9846C5.8332 38.219 5.51524 38.3507 5.18371 38.3507C4.85217 38.3507 4.53422 38.219 4.29981 37.9845L1.00084 34.6851C0.512712 34.1969 0.512761 33.4055 1.00095 32.9174C1.48913 32.4292 2.28059 32.4293 2.76871 32.9175L3.93374 34.0827V4.89344L2.76825 6.05893C2.2801 6.54708 1.48864 6.54708 1.00049 6.05893C0.51233 5.57077 0.51233 4.77932 1.00049 4.29116L4.29986 0.991788ZM13.1588 8.34109V1.49725H46.3156V8.34102H43.398V7.19776C43.398 5.54595 42.0562 4.20442 40.4047 4.20442H31.8516V26.0992C31.8516 28.1387 33.5088 29.7957 35.5481 29.7957H36.5137V32.4599H23.01V29.7957H23.9756C26.0151 29.7957 27.6721 28.1387 27.6721 26.0992V4.20448H19.0697C17.418 4.20448 16.0763 5.54604 16.0763 7.19783V8.34109H13.1588ZM46.9995 39.7088C47.4877 39.2207 47.4877 38.4292 46.9995 37.9411L43.7001 34.6417C43.212 34.1535 42.4205 34.1535 41.9324 34.6417C41.4442 35.1298 41.4442 35.9213 41.9324 36.4095L43.0979 37.5749L15.0832 37.5749L16.2484 36.4099C16.7366 35.9218 16.7366 35.1303 16.2485 34.6421C15.7604 34.154 14.9689 34.1539 14.4807 34.642L11.1814 37.941C10.9469 38.1754 10.8152 38.4934 10.8152 38.8249C10.8152 39.1564 10.9469 39.4744 11.1813 39.7088L14.4807 43.0082C14.9688 43.4964 15.7603 43.4964 16.2485 43.0082C16.7366 42.5201 16.7366 41.7286 16.2485 41.2404L15.083 40.0749L43.0979 40.0749L41.9324 41.2404C41.4442 41.7286 41.4442 42.5201 41.9324 43.0082C42.4205 43.4964 43.212 43.4964 43.7001 43.0082L46.9995 39.7088Z\",\n fill: color\n }));\n});\nexport default Spacing;","import _extends from \"@babel/runtime/helpers/extends\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/objectWithoutProperties\";\nvar _excluded = [\"color\", \"size\"];\nimport React from 'react';\nimport { intrinsicComponent } from './utils/functions';\nexport var Padding = intrinsicComponent(function (_ref, ref) {\n var _ref$color = _ref.color,\n color = _ref$color === void 0 ? 'currentColor' : _ref$color,\n _ref$size = _ref.size,\n size = _ref$size === void 0 ? 14 : _ref$size,\n rest = _objectWithoutProperties(_ref, _excluded);\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n ref: ref,\n width: size,\n height: size,\n viewBox: \"0 0 50 50\",\n fill: \"none\",\n xmlns: \"http://www.w3.org/2000/svg\"\n }, rest), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M13.8334 9.19949C13.8334 8.50914 14.3931 7.94949 15.0834 7.94949H31.3334C32.0238 7.94949 32.5834 8.50914 32.5834 9.19949C32.5834 9.88985 32.0238 10.4495 31.3334 10.4495H15.0834C14.3931 10.4495 13.8334 9.88985 13.8334 9.19949Z\",\n fill: color\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M15.0834 35.5496C14.3931 35.5496 13.8334 36.1092 13.8334 36.7996C13.8334 37.4899 14.3931 38.0496 15.0834 38.0496H31.3334C32.0238 38.0496 32.5834 37.4899 32.5834 36.7996C32.5834 36.1092 32.0238 35.5496 31.3334 35.5496H15.0834Z\",\n fill: color\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M36.8001 13.4163C37.4905 13.4163 38.0501 13.9759 38.0501 14.6663V30.9163C38.0501 31.6066 37.4905 32.1663 36.8001 32.1663C36.1098 32.1663 35.5501 31.6066 35.5501 30.9163V14.6663C35.5501 13.9759 36.1098 13.4163 36.8001 13.4163Z\",\n fill: color\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M10.45 14.6663C10.45 13.9759 9.89038 13.4163 9.20003 13.4163C8.50967 13.4163 7.95003 13.9759 7.95003 14.6663L7.95003 30.9163C7.95003 31.6066 8.50967 32.1663 9.20003 32.1663C9.89038 32.1663 10.45 31.6066 10.45 30.9163L10.45 14.6663Z\",\n fill: color\n }), /*#__PURE__*/React.createElement(\"path\", {\n fillRule: \"evenodd\",\n clipRule: \"evenodd\",\n d: \"M3 0.5C1.61929 0.5 0.5 1.61929 0.5 3V43C0.5 44.3807 1.61929 45.5 3 45.5H43C44.3807 45.5 45.5 44.3807 45.5 43V3C45.5 1.61929 44.3807 0.5 43 0.5H3ZM43 3H3V43H43V3Z\",\n fill: color\n }));\n});\nexport default Padding;","import _extends from \"@babel/runtime/helpers/extends\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/objectWithoutProperties\";\nvar _excluded = [\"color\", \"size\"];\nimport React from 'react';\nimport { intrinsicComponent } from './utils/functions';\nexport var Polygon = intrinsicComponent(function (_ref, ref) {\n var _ref$color = _ref.color,\n color = _ref$color === void 0 ? 'currentColor' : _ref$color,\n _ref$size = _ref.size,\n size = _ref$size === void 0 ? 14 : _ref$size,\n rest = _objectWithoutProperties(_ref, _excluded);\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n ref: ref,\n width: size,\n height: size,\n viewBox: \"0 0 50 50\",\n fill: \"none\",\n xmlns: \"http://www.w3.org/2000/svg\"\n }, rest), /*#__PURE__*/React.createElement(\"path\", {\n fillRule: \"evenodd\",\n clipRule: \"evenodd\",\n d: \"M44.103 18.4866L24.0002 3.8811L3.89749 18.4866L11.5761 42.1188H36.4244L44.103 18.4866ZM25.8371 1.35293C24.7418 0.557164 23.2587 0.557162 22.1634 1.35292L2.06066 15.9584C0.96539 16.7542 0.507082 18.1647 0.925439 19.4523L8.604 43.0845C9.02236 44.372 10.2222 45.2438 11.5761 45.2438H36.4244C37.7782 45.2438 38.9781 44.372 39.3965 43.0845L47.075 19.4523C47.4934 18.1647 47.0351 16.7542 45.9398 15.9584L25.8371 1.35293Z\",\n fill: color\n }));\n});\nexport default Polygon;","import _extends from \"@babel/runtime/helpers/extends\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/objectWithoutProperties\";\nvar _excluded = [\"color\", \"size\"];\nimport React from 'react';\nimport { intrinsicComponent } from './utils/functions';\nexport var PolygonSides = intrinsicComponent(function (_ref, ref) {\n var _ref$color = _ref.color,\n color = _ref$color === void 0 ? 'currentColor' : _ref$color,\n _ref$size = _ref.size,\n size = _ref$size === void 0 ? 14 : _ref$size,\n rest = _objectWithoutProperties(_ref, _excluded);\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n ref: ref,\n width: size,\n height: size,\n viewBox: \"0 0 50 48\",\n fill: \"none\",\n xmlns: \"http://www.w3.org/2000/svg\"\n }, rest), /*#__PURE__*/React.createElement(\"path\", {\n fillRule: \"evenodd\",\n clipRule: \"evenodd\",\n d: \"M23.0078 29.9669H25.835L24.7803 35.9727H27.4609L28.5156 29.9669H32.2363V27.4473H28.9551L29.6875 23.2872H33.3496V20.7383H30.1416L31.2109 14.6446H28.5303L27.4609 20.7383H24.6191L25.6885 14.6446H23.0225L21.9531 20.7383H18.1006V23.2872H21.499L20.7666 27.4473H17.002V29.9669H20.3271L19.2725 35.9727H21.9531L23.0078 29.9669ZM26.2744 27.4473H23.4473L24.165 23.2872H27.0068L26.2744 27.4473Z\",\n fill: color\n }), /*#__PURE__*/React.createElement(\"path\", {\n fillRule: \"evenodd\",\n clipRule: \"evenodd\",\n d: \"M23.5448 0.821208C24.421 0.184598 25.6075 0.184597 26.4837 0.821207L48.4803 16.8026C49.3565 17.4392 49.7231 18.5677 49.3885 19.5977L40.9865 45.4562C40.6518 46.4862 39.692 47.1836 38.6089 47.1836H11.4197C10.3366 47.1836 9.37672 46.4862 9.04204 45.4562L0.640107 19.5977C0.305422 18.5677 0.672067 17.4392 1.54829 16.8026L23.5448 0.821208ZM25.0143 2.84375L47.0108 18.8252L38.6089 44.6836H11.4197L3.01775 18.8252L25.0143 2.84375Z\",\n fill: color\n }));\n});\nexport default PolygonSides;","import _extends from \"@babel/runtime/helpers/extends\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/objectWithoutProperties\";\nvar _excluded = [\"color\", \"size\"];\nimport React from 'react';\nimport { intrinsicComponent } from './utils/functions';\nexport var ArrowRight = intrinsicComponent(function (_ref, ref) {\n var _ref$color = _ref.color,\n color = _ref$color === void 0 ? 'currentColor' : _ref$color,\n _ref$size = _ref.size,\n size = _ref$size === void 0 ? 14 : _ref$size,\n rest = _objectWithoutProperties(_ref, _excluded);\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n ref: ref,\n width: size,\n height: size,\n viewBox: \"0 0 46 30\",\n fill: \"none\",\n xmlns: \"http://www.w3.org/2000/svg\"\n }, rest), /*#__PURE__*/React.createElement(\"path\", {\n fillRule: \"evenodd\",\n clipRule: \"evenodd\",\n d: \"M45.5 15.0005C45.5 15.7079 45.2003 16.3822 44.6753 16.8562L30.8291 29.3562C29.8042 30.2814 28.2234 30.2006 27.2982 29.1758C26.373 28.1509 26.4537 26.57 27.4786 25.6448L36.5 17.5005L3 17.5005C1.61928 17.5005 0.499999 16.3812 0.499999 15.0005C0.499999 13.6198 1.61929 12.5005 3 12.5005L36.5 12.5005L27.4786 4.35618C26.4537 3.43096 26.373 1.85011 27.2982 0.82525C28.2234 -0.199608 29.8042 -0.280382 30.8291 0.644837L44.6753 13.1448C45.2003 13.6189 45.5 14.2931 45.5 15.0005Z\",\n fill: color\n }));\n});\nexport default ArrowRight;","import _extends from \"@babel/runtime/helpers/extends\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/objectWithoutProperties\";\nvar _excluded = [\"color\", \"size\"];\nimport React from 'react';\nimport { intrinsicComponent } from './utils/functions';\nexport var FontItalic = intrinsicComponent(function (_ref, ref) {\n var _ref$color = _ref.color,\n color = _ref$color === void 0 ? 'currentColor' : _ref$color,\n _ref$size = _ref.size,\n size = _ref$size === void 0 ? 14 : _ref$size,\n rest = _objectWithoutProperties(_ref, _excluded);\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n ref: ref,\n width: size,\n height: size,\n viewBox: \"0 0 50 50\",\n fill: \"none\",\n xmlns: \"http://www.w3.org/2000/svg\"\n }, rest), /*#__PURE__*/React.createElement(\"path\", {\n fillRule: \"evenodd\",\n clipRule: \"evenodd\",\n d: \"M19 48L26.9931 2H31.2019L23.2087 48H19Z\",\n fill: color\n }));\n});\nexport default FontItalic;","import _extends from \"@babel/runtime/helpers/extends\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/objectWithoutProperties\";\nvar _excluded = [\"color\", \"size\"];\nimport React from 'react';\nimport { intrinsicComponent } from './utils/functions';\nexport var FontBold = intrinsicComponent(function (_ref, ref) {\n var _ref$color = _ref.color,\n color = _ref$color === void 0 ? 'currentColor' : _ref$color,\n _ref$size = _ref.size,\n size = _ref$size === void 0 ? 14 : _ref$size,\n rest = _objectWithoutProperties(_ref, _excluded);\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n ref: ref,\n width: size,\n height: size,\n viewBox: \"0 0 14 18\",\n fill: \"none\",\n xmlns: \"http://www.w3.org/2000/svg\"\n }, rest), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M0.214966 17.4813V0.518677H6.61123C8.82693 0.518677 10.5075 0.914783 11.653 1.70699C12.7985 2.49144 13.3712 3.64481 13.3712 5.16709C13.3712 5.99814 13.1413 6.7321 12.6814 7.36898C12.2216 7.99809 11.5819 8.46021 10.7625 8.75535C11.699 8.97282 12.4348 9.41164 12.9699 10.0718C13.5133 10.732 13.7851 11.5397 13.7851 12.4951C13.7851 14.1261 13.2249 15.361 12.1045 16.1998C10.9841 17.0386 9.38713 17.4658 7.31357 17.4813H0.214966ZM3.97748 10.0951V14.6736H7.20069C8.08697 14.6736 8.77677 14.4795 9.27007 14.0911C9.77174 13.695 10.0226 13.1513 10.0226 12.4601C10.0226 10.9067 9.1572 10.1184 7.42644 10.0951H3.97748ZM3.97748 7.62528H6.76173C8.65971 7.59421 9.6087 6.89132 9.6087 5.5166C9.6087 4.74769 9.36623 4.19625 8.88128 3.86228C8.4047 3.52054 7.64801 3.34967 6.61123 3.34967H3.97748V7.62528Z\",\n fill: color\n }));\n});\nexport default FontBold;","import _extends from \"@babel/runtime/helpers/extends\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/objectWithoutProperties\";\nvar _excluded = [\"color\", \"size\"];\nimport React from 'react';\nimport { intrinsicComponent } from './utils/functions';\nexport var UploadOutline = intrinsicComponent(function (_ref, ref) {\n var _ref$color = _ref.color,\n color = _ref$color === void 0 ? 'currentColor' : _ref$color,\n _ref$size = _ref.size,\n size = _ref$size === void 0 ? 14 : _ref$size,\n rest = _objectWithoutProperties(_ref, _excluded);\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n ref: ref,\n width: size,\n height: size,\n viewBox: \"0 0 50 50\",\n fill: \"none\",\n xmlns: \"http://www.w3.org/2000/svg\"\n }, rest), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M17.5911 1.54582C16.7075 0.680052 15.2937 0.680014 14.4101 1.54573L4.05296 11.6925C3.15635 12.5709 3.14159 14.0098 4.01999 14.9064C4.89839 15.8031 6.33733 15.8178 7.23394 14.9394L13.7278 8.57741V30.4419C13.7278 31.6971 14.7454 32.7147 16.0006 32.7147C17.2558 32.7147 18.2733 31.6971 18.2733 30.4419V8.57782L24.766 14.9393C25.6625 15.8178 27.1015 15.8031 27.9799 14.9065C28.8584 14.01 28.8437 12.571 27.9471 11.6926L17.5911 1.54582Z\",\n fill: color\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M2.78827 36.5543C1.53308 36.5543 0.515541 37.5719 0.515541 38.827C0.515541 40.0822 1.53308 41.0998 2.78827 41.0998H29.1519C30.4071 41.0998 31.4246 40.0822 31.4246 38.827C31.4246 37.5719 30.4071 36.5543 29.1519 36.5543H2.78827Z\",\n fill: color\n }));\n});\nexport default UploadOutline;","import _extends from \"@babel/runtime/helpers/extends\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/objectWithoutProperties\";\nvar _excluded = [\"color\", \"size\"];\nimport React from 'react';\nimport { intrinsicComponent } from './utils/functions';\nexport var ArrowLeftOutline = intrinsicComponent(function (_ref, ref) {\n var _ref$color = _ref.color,\n color = _ref$color === void 0 ? 'currentColor' : _ref$color,\n _ref$size = _ref.size,\n size = _ref$size === void 0 ? 14 : _ref$size,\n rest = _objectWithoutProperties(_ref, _excluded);\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n ref: ref,\n width: size,\n height: size,\n viewBox: \"0 0 28 50\",\n fill: \"none\",\n xmlns: \"http://www.w3.org/2000/svg\"\n }, rest), /*#__PURE__*/React.createElement(\"path\", {\n fillRule: \"evenodd\",\n clipRule: \"evenodd\",\n d: \"M26.907 0.71085C25.7493 -0.292553 23.9445 -0.224769 22.8758 0.862251L0.931376 23.1837C-0.0773525 24.2097 -0.0773525 25.7913 0.931376 26.8173L22.8758 49.1388C23.9445 50.2258 25.7493 50.2936 26.907 49.2902C28.0647 48.2868 28.1369 46.5921 27.0683 45.5051L6.90997 25.0005L27.0683 4.49589C28.1369 3.40888 28.0647 1.71425 26.907 0.71085Z\",\n fill: color\n }));\n});\nexport default ArrowLeftOutline;","import _extends from \"@babel/runtime/helpers/extends\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/objectWithoutProperties\";\nvar _excluded = [\"color\", \"size\"];\nimport React from 'react';\nimport { intrinsicComponent } from './utils/functions';\nexport var ArrowRightOutline = intrinsicComponent(function (_ref, ref) {\n var _ref$color = _ref.color,\n color = _ref$color === void 0 ? 'currentColor' : _ref$color,\n _ref$size = _ref.size,\n size = _ref$size === void 0 ? 14 : _ref$size,\n rest = _objectWithoutProperties(_ref, _excluded);\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n ref: ref,\n width: size,\n height: size,\n viewBox: \"0 0 28 50\",\n fill: \"none\",\n xmlns: \"http://www.w3.org/2000/svg\"\n }, rest), /*#__PURE__*/React.createElement(\"path\", {\n fillRule: \"evenodd\",\n clipRule: \"evenodd\",\n d: \"M1.09286 0.71085C2.25057 -0.292553 4.05541 -0.224769 5.12407 0.862251L27.0685 23.1837C28.0772 24.2097 28.0772 25.7913 27.0685 26.8173L5.12407 49.1388C4.05541 50.2258 2.25057 50.2936 1.09286 49.2902C-0.0648579 48.2868 -0.137051 46.5921 0.93161 45.5051L21.0899 25.0005L0.93161 4.49589C-0.137051 3.40888 -0.0648579 1.71425 1.09286 0.71085Z\",\n fill: color\n }));\n});\nexport default ArrowRightOutline;","import _extends from \"@babel/runtime/helpers/extends\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/objectWithoutProperties\";\nvar _excluded = [\"color\", \"size\"];\nimport React from 'react';\nimport { intrinsicComponent } from './utils/functions';\nexport var PlusOutline = intrinsicComponent(function (_ref, ref) {\n var _ref$color = _ref.color,\n color = _ref$color === void 0 ? 'currentColor' : _ref$color,\n _ref$size = _ref.size,\n size = _ref$size === void 0 ? 14 : _ref$size,\n rest = _objectWithoutProperties(_ref, _excluded);\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n ref: ref,\n width: size,\n height: size,\n viewBox: \"0 0 38 38\",\n fill: \"none\",\n xmlns: \"http://www.w3.org/2000/svg\"\n }, rest), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M16.9167 21.0838L16.9167 35.6672C16.9167 36.8177 17.8494 37.7505 19 37.7505C20.1506 37.7505 21.0833 36.8177 21.0833 35.6672L21.0833 21.0838H35.6667C36.8173 21.0838 37.75 20.1511 37.75 19.0005C37.75 17.8499 36.8173 16.9172 35.6667 16.9172L21.0833 16.9172L21.0833 2.33382C21.0833 1.18323 20.1506 0.250488 19 0.250488C17.8494 0.250488 16.9167 1.18323 16.9167 2.33382L16.9167 16.9172H2.33333C1.18274 16.9172 0.25 17.8499 0.25 19.0005C0.25 20.1511 1.18274 21.0838 2.33333 21.0838H16.9167Z\",\n fill: color\n }));\n});\nexport default PlusOutline;","import _extends from \"@babel/runtime/helpers/extends\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/objectWithoutProperties\";\nvar _excluded = [\"color\", \"size\"];\nimport React from 'react';\nimport { intrinsicComponent } from './utils/functions';\nexport var ArrowTool = intrinsicComponent(function (_ref, ref) {\n var _ref$color = _ref.color,\n color = _ref$color === void 0 ? 'currentColor' : _ref$color,\n _ref$size = _ref.size,\n size = _ref$size === void 0 ? 14 : _ref$size,\n rest = _objectWithoutProperties(_ref, _excluded);\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n ref: ref,\n width: size,\n height: size,\n viewBox: \"0 0 50 50\",\n fill: \"none\",\n xmlns: \"http://www.w3.org/2000/svg\"\n }, rest), /*#__PURE__*/React.createElement(\"path\", {\n fillRule: \"evenodd\",\n clipRule: \"evenodd\",\n d: \"M1.04757 38.9503C0.437373 38.3401 0.437373 37.3508 1.04757 36.7406L33.9229 3.86697L23.8354 3.33584C22.9736 3.29047 22.3118 2.5551 22.3572 1.69335C22.4026 0.831601 23.138 0.169794 23.9997 0.215167L37.5909 0.930759C38.3892 0.972794 39.027 1.61063 39.0691 2.40894L39.7846 16.0001C39.83 16.8619 39.1682 17.5972 38.3065 17.6426C37.4447 17.688 36.7093 17.0262 36.664 16.1644L36.1328 6.07651L3.25728 38.9503C2.64708 39.5605 1.65776 39.5605 1.04757 38.9503Z\",\n fill: color\n }));\n});\nexport default ArrowTool;","import _extends from \"@babel/runtime/helpers/extends\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/objectWithoutProperties\";\nvar _excluded = [\"color\", \"size\"];\nimport React from 'react';\nimport { intrinsicComponent } from './utils/functions';\nexport var Compare = intrinsicComponent(function (_ref, ref) {\n var _ref$color = _ref.color,\n color = _ref$color === void 0 ? 'currentColor' : _ref$color,\n _ref$size = _ref.size,\n size = _ref$size === void 0 ? 14 : _ref$size,\n rest = _objectWithoutProperties(_ref, _excluded);\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n ref: ref,\n width: size,\n height: size,\n viewBox: \"0 0 52 52\",\n fill: \"none\",\n xmlns: \"http://www.w3.org/2000/svg\"\n }, rest), /*#__PURE__*/React.createElement(\"path\", {\n fillRule: \"evenodd\",\n clipRule: \"evenodd\",\n d: \"M27.1607 4.16667V2.08333C27.1607 0.93274 26.2279 0 25.0773 0C23.9267 0 22.994 0.932741 22.994 2.08333V4.16667H4.244C1.94281 4.16667 0.0773315 6.03215 0.0773315 8.33333V41.6667C0.0773315 43.9679 1.94281 45.8333 4.244 45.8333H22.994V47.9167C22.994 49.0673 23.9267 50 25.0773 50C26.2279 50 27.1607 49.0673 27.1607 47.9167V45.8333H45.9107C48.2118 45.8333 50.0773 43.9678 50.0773 41.6667V8.33333C50.0773 6.03215 48.2119 4.16667 45.9107 4.16667H27.1607ZM22.994 8.33333H4.244L4.244 41.6667H22.994V8.33333ZM27.1607 41.6667V8.33333H45.9107V41.6667H27.1607Z\",\n fill: color\n }));\n});\nexport default Compare;","import _extends from \"@babel/runtime/helpers/extends\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/objectWithoutProperties\";\nvar _excluded = [\"color\", \"size\"];\nimport React from 'react';\nimport { intrinsicComponent } from './utils/functions';\nexport var MinusOutline = intrinsicComponent(function (_ref, ref) {\n var _ref$color = _ref.color,\n color = _ref$color === void 0 ? 'currentColor' : _ref$color,\n _ref$size = _ref.size,\n size = _ref$size === void 0 ? 14 : _ref$size,\n rest = _objectWithoutProperties(_ref, _excluded);\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n ref: ref,\n width: size,\n height: size,\n viewBox: \"0 0 38 6\",\n fill: \"none\",\n xmlns: \"http://www.w3.org/2000/svg\"\n }, rest), /*#__PURE__*/React.createElement(\"path\", {\n fillRule: \"evenodd\",\n clipRule: \"evenodd\",\n d: \"M35.835 5.0769L2.16498 5.0769C1.00277 5.0769 0.0606079 4.14726 0.0606079 3.00048C0.060608 1.85371 1.00277 0.924072 2.16498 0.924072L35.835 0.924074C36.9972 0.924074 37.9394 1.85372 37.9394 3.00049C37.9394 4.14726 36.9972 5.0769 35.835 5.0769Z\",\n fill: color\n }));\n});\nexport default MinusOutline;","import _extends from \"@babel/runtime/helpers/extends\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/objectWithoutProperties\";\nvar _excluded = [\"color\", \"size\"];\nimport React from 'react';\nimport { intrinsicComponent } from './utils/functions';\nexport var Temprature = intrinsicComponent(function (_ref, ref) {\n var _ref$color = _ref.color,\n color = _ref$color === void 0 ? 'currentColor' : _ref$color,\n _ref$size = _ref.size,\n size = _ref$size === void 0 ? 14 : _ref$size,\n rest = _objectWithoutProperties(_ref, _excluded);\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n ref: ref,\n width: size,\n height: size,\n viewBox: \"0 0 50 50\",\n fill: \"none\",\n xmlns: \"http://www.w3.org/2000/svg\"\n }, rest), /*#__PURE__*/React.createElement(\"path\", {\n fillRule: \"evenodd\",\n clipRule: \"evenodd\",\n d: \"M9.48799 3.125H17.0311L17.0311 24.4063C17.0311 26.6148 18.1889 28.4084 19.5429 29.5401C21.7011 31.3438 23.0656 34.0456 23.0656 37.069C23.0656 42.4847 18.6753 46.875 13.2595 46.875C7.84382 46.875 3.45351 42.4847 3.45351 37.069C3.45351 34.0456 4.81799 31.3438 6.97617 29.5401C8.33021 28.4084 9.48799 26.6148 9.48799 24.4063V3.125ZM20.1561 3.125C20.1561 1.39911 18.757 0 17.0311 0H9.48799C7.7621 0 6.36299 1.39911 6.36299 3.125V24.4063C6.36299 25.4785 5.79482 26.4547 4.97216 27.1423C2.13398 29.5143 0.328506 33.0808 0.328506 37.069C0.328506 44.2106 6.11793 50 13.2595 50C20.4012 50 26.1906 44.2106 26.1906 37.069C26.1906 33.0808 24.3851 29.5143 21.5469 27.1423C20.7243 26.4547 20.1561 25.4785 20.1561 24.4063V3.125ZM35.6715 1.25C35.6715 0.559645 35.1119 0 34.4215 0H28.1715C27.4812 0 26.9215 0.559644 26.9215 1.25C26.9215 1.94036 27.4812 2.5 28.1715 2.5L34.4215 2.5C35.1119 2.5 35.6715 1.94036 35.6715 1.25ZM35.6715 8.24951C35.6715 7.55916 35.1119 6.99951 34.4215 6.99951H28.1715C27.4812 6.99951 26.9215 7.55916 26.9215 8.24951C26.9215 8.93987 27.4812 9.49951 28.1715 9.49951H34.4215C35.1119 9.49951 35.6715 8.93987 35.6715 8.24951ZM34.4215 13.999C35.1119 13.999 35.6715 14.5587 35.6715 15.249C35.6715 15.9394 35.1119 16.499 34.4215 16.499H28.1715C27.4812 16.499 26.9215 15.9394 26.9215 15.249C26.9215 14.5587 27.4812 13.999 28.1715 13.999H34.4215ZM13.2594 43.7501C16.366 43.7501 18.8844 41.2317 18.8844 38.1251C18.8844 35.4037 16.9519 33.1337 14.3844 32.6126V10.3662C14.3844 9.67582 13.8247 9.11617 13.1344 9.11617C12.444 9.11617 11.8844 9.67582 11.8844 10.3662V32.6694C9.44245 33.2829 7.63441 35.4928 7.63441 38.1251C7.63441 41.2317 10.1528 43.7501 13.2594 43.7501Z\",\n fill: color\n }));\n});\nexport default Temprature;","import _extends from \"@babel/runtime/helpers/extends\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/objectWithoutProperties\";\nvar _excluded = [\"color\", \"size\"];\nimport React from 'react';\nimport { intrinsicComponent } from './utils/functions';\nexport var Contrast = intrinsicComponent(function (_ref, ref) {\n var _ref$color = _ref.color,\n color = _ref$color === void 0 ? 'currentColor' : _ref$color,\n _ref$size = _ref.size,\n size = _ref$size === void 0 ? 14 : _ref$size,\n rest = _objectWithoutProperties(_ref, _excluded);\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n ref: ref,\n width: size,\n height: size,\n viewBox: \"0 0 50 50\",\n fill: \"none\",\n xmlns: \"http://www.w3.org/2000/svg\"\n }, rest), /*#__PURE__*/React.createElement(\"path\", {\n fillRule: \"evenodd\",\n clipRule: \"evenodd\",\n d: \"M20.4376 40.6858V38.5625V4.18746V3.31418C10.8133 4.10816 3.25006 12.1708 3.25006 22C3.25006 31.8292 10.8133 39.8918 20.4376 40.6858ZM40.7501 22C40.7501 31.8292 33.1868 39.8918 23.5626 40.6858V38.5625V4.18746V3.31418C33.1868 4.10816 40.7501 12.1708 40.7501 22ZM43.8751 22C43.8751 34.0812 34.0813 43.875 22.0001 43.875C9.91883 43.875 0.125061 34.0812 0.125061 22C0.125061 9.91877 9.91883 0.125 22.0001 0.125C34.0813 0.125 43.8751 9.91877 43.8751 22Z\",\n fill: color\n }));\n});\nexport default Contrast;","import _extends from \"@babel/runtime/helpers/extends\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/objectWithoutProperties\";\nvar _excluded = [\"color\", \"size\"];\nimport React from 'react';\nimport { intrinsicComponent } from './utils/functions';\nexport var FineTune = intrinsicComponent(function (_ref, ref) {\n var _ref$color = _ref.color,\n color = _ref$color === void 0 ? 'currentColor' : _ref$color,\n _ref$size = _ref.size,\n size = _ref$size === void 0 ? 14 : _ref$size,\n rest = _objectWithoutProperties(_ref, _excluded);\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n ref: ref,\n width: size,\n height: size,\n viewBox: \"0 0 50 50\",\n fill: \"none\",\n xmlns: \"http://www.w3.org/2000/svg\"\n }, rest), /*#__PURE__*/React.createElement(\"path\", {\n fillRule: \"evenodd\",\n clipRule: \"evenodd\",\n d: \"M16.3679 7.50003C15.7995 10.005 13.5592 11.875 10.8823 11.875C8.20528 11.875 5.96506 10.005 5.39665 7.50003H1.5448C0.854444 7.50003 0.2948 6.94039 0.2948 6.25003C0.2948 5.55967 0.854444 5.00003 1.5448 5.00003H5.39665C5.96506 2.49504 8.20528 0.625031 10.8823 0.625031C13.5592 0.625031 15.7995 2.49504 16.3679 5.00003H48.4557C49.1461 5.00003 49.7057 5.55967 49.7057 6.25003C49.7057 6.94039 49.1461 7.50003 48.4557 7.50003H16.3679ZM14.0073 6.25003C14.0073 7.97592 12.6082 9.37503 10.8823 9.37503C9.15637 9.37503 7.75726 7.97592 7.75726 6.25003C7.75726 4.52414 9.15637 3.12503 10.8823 3.12503C12.6082 3.12503 14.0073 4.52414 14.0073 6.25003Z\",\n fill: color\n }), /*#__PURE__*/React.createElement(\"path\", {\n fillRule: \"evenodd\",\n clipRule: \"evenodd\",\n d: \"M34.5715 27.625C37.2485 27.625 39.4887 25.755 40.0571 23.25H48.4554C49.1458 23.25 49.7054 22.6904 49.7054 22C49.7054 21.3096 49.1458 20.75 48.4554 20.75H40.0571C39.4887 18.245 37.2485 16.375 34.5715 16.375C31.8946 16.375 29.6543 18.245 29.0859 20.75H1.5448C0.854444 20.75 0.2948 21.3096 0.2948 22C0.2948 22.6904 0.854444 23.25 1.5448 23.25H29.0859C29.6543 25.755 31.8946 27.625 34.5715 27.625ZM34.5715 25.125C36.2974 25.125 37.6965 23.7259 37.6965 22C37.6965 20.2741 36.2974 18.875 34.5715 18.875C32.8456 18.875 31.4465 20.2741 31.4465 22C31.4465 23.7259 32.8456 25.125 34.5715 25.125Z\",\n fill: color\n }), /*#__PURE__*/React.createElement(\"path\", {\n fillRule: \"evenodd\",\n clipRule: \"evenodd\",\n d: \"M22.7702 39C22.2018 41.505 19.9615 43.375 17.2845 43.375C14.6076 43.375 12.3673 41.505 11.7989 39H1.5448C0.854444 39 0.2948 38.4403 0.2948 37.75C0.2948 37.0596 0.854444 36.5 1.5448 36.5H11.7989C12.3673 33.995 14.6076 32.125 17.2845 32.125C19.9615 32.125 22.2018 33.995 22.7702 36.5H48.4554C49.1458 36.5 49.7054 37.0596 49.7054 37.75C49.7054 38.4403 49.1458 39 48.4554 39H22.7702ZM20.4095 37.75C20.4095 39.4759 19.0104 40.875 17.2845 40.875C15.5587 40.875 14.1595 39.4759 14.1595 37.75C14.1595 36.0241 15.5587 34.625 17.2845 34.625C19.0104 34.625 20.4095 36.0241 20.4095 37.75Z\",\n fill: color\n }));\n});\nexport default FineTune;","import _extends from \"@babel/runtime/helpers/extends\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/objectWithoutProperties\";\nvar _excluded = [\"color\", \"size\"];\nimport React from 'react';\nimport { intrinsicComponent } from './utils/functions';\nexport var Saturation = intrinsicComponent(function (_ref, ref) {\n var _ref$color = _ref.color,\n color = _ref$color === void 0 ? 'currentColor' : _ref$color,\n _ref$size = _ref.size,\n size = _ref$size === void 0 ? 14 : _ref$size,\n rest = _objectWithoutProperties(_ref, _excluded);\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n ref: ref,\n width: size,\n height: size,\n viewBox: \"0 0 50 50\",\n fill: \"none\",\n xmlns: \"http://www.w3.org/2000/svg\"\n }, rest), /*#__PURE__*/React.createElement(\"path\", {\n fillRule: \"evenodd\",\n clipRule: \"evenodd\",\n d: \"M37.2341 37.6984H37.5121V37.4237C41.4447 33.4687 43.875 28.0182 43.875 22C43.875 15.9819 41.4447 10.5314 37.5121 6.57632V6.30045H37.2328C33.2942 2.47819 27.9219 0.125031 22 0.125031C9.91877 0.125031 0.125 9.9188 0.125 22C0.125 34.0813 9.91877 43.875 22 43.875C24.718 43.875 27.3203 43.3793 29.7213 42.4733H30.5303V42.1494C33.0389 41.0861 35.308 39.5679 37.2341 37.6984ZM20.4257 3.31519C10.807 4.1148 3.25 12.1749 3.25 22C3.25 31.8252 10.807 39.8853 20.4257 40.6849V3.31519ZM34.3871 36.0759C33.221 37.1029 31.9263 37.9873 30.5303 38.7017V5.29836C31.9263 6.01281 33.221 6.89715 34.3871 7.92411V36.0759ZM37.5121 11.4641C39.5556 14.4669 40.75 18.094 40.75 22C40.75 25.9061 39.5556 29.5332 37.5121 32.536V11.4641ZM23.5507 40.6868C24.8796 40.578 26.1693 40.3307 27.4053 39.9592V4.04089C26.1693 3.66941 24.8796 3.42203 23.5507 3.31324V40.6868Z\",\n fill: color\n }));\n});\nexport default Saturation;","import _extends from \"@babel/runtime/helpers/extends\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/objectWithoutProperties\";\nvar _excluded = [\"color\", \"size\"];\nimport React from 'react';\nimport { intrinsicComponent } from './utils/functions';\nexport var Annotate = intrinsicComponent(function (_ref, ref) {\n var _ref$color = _ref.color,\n color = _ref$color === void 0 ? 'currentColor' : _ref$color,\n _ref$size = _ref.size,\n size = _ref$size === void 0 ? 14 : _ref$size,\n rest = _objectWithoutProperties(_ref, _excluded);\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n ref: ref,\n width: size,\n height: size,\n viewBox: \"0 0 50 50\",\n fill: \"none\",\n xmlns: \"http://www.w3.org/2000/svg\"\n }, rest), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M46.1442 31.379C45.4585 31.379 44.8974 31.9429 44.8974 32.6321V43.7349C44.8974 45.8025 43.2267 47.4817 41.157 47.4943H6.22156C4.16433 47.4943 2.49361 45.8151 2.48114 43.7349V11.1283C2.48114 9.06067 4.15186 7.38147 6.22156 7.36894H17.2807C17.9665 7.36894 18.5275 6.80503 18.5275 6.1158C18.5275 5.42658 17.9665 4.86267 17.2807 4.86267H6.22156C2.79284 4.8752 0 7.66969 0 11.1283V43.7349C0 47.1935 2.79284 50.0005 6.22156 50.0005H41.157C44.5982 50.0005 47.3786 47.1935 47.3786 43.7474V32.6321C47.391 31.9429 46.83 31.379 46.1442 31.379Z\",\n fill: color\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M46.8923 1.65462C44.698 -0.55089 41.157 -0.55089 38.9627 1.65462L16.7571 23.9729C16.6075 24.1233 16.4953 24.3113 16.4329 24.5243L13.5154 35.1258C13.3907 35.5644 13.5154 36.0281 13.8396 36.3413C14.1513 36.6546 14.6251 36.7799 15.049 36.6672L25.5969 33.7348C25.8089 33.6722 25.9959 33.5719 26.1455 33.409L48.3636 11.0782C50.5455 8.87267 50.5455 5.31377 48.3636 3.10826L46.8923 1.65462ZM19.4751 24.7875L37.6535 6.51678L43.5135 12.4065L25.3351 30.6897L19.4751 24.7875ZM18.3031 27.1559L22.9911 31.8677L16.5077 33.6722L18.3031 27.1559ZM46.5931 9.31127L45.2715 10.6396L39.4115 4.74986L40.7331 3.42154C41.9425 2.206 43.9249 2.206 45.1343 3.42154L46.5931 4.88771C47.815 6.11578 47.815 8.09573 46.5931 9.31127Z\",\n fill: color\n }));\n});\nexport default Annotate;","import _extends from \"@babel/runtime/helpers/extends\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/objectWithoutProperties\";\nvar _excluded = [\"color\", \"size\"];\nimport React from 'react';\nimport { intrinsicComponent } from './utils/functions';\nexport var Blur = intrinsicComponent(function (_ref, ref) {\n var _ref$color = _ref.color,\n color = _ref$color === void 0 ? 'currentColor' : _ref$color,\n _ref$size = _ref.size,\n size = _ref$size === void 0 ? 14 : _ref$size,\n rest = _objectWithoutProperties(_ref, _excluded);\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n ref: ref,\n width: size,\n height: size,\n viewBox: \"0 0 50 50\",\n fill: \"none\",\n xmlns: \"http://www.w3.org/2000/svg\"\n }, rest), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M18.3626 41.293C17.5103 41.4285 16.7096 40.8474 16.5742 39.9952C16.4387 39.143 17.0198 38.3423 17.872 38.2068C18.2902 38.1403 18.6988 38.0456 19.0958 37.9246C21.9368 37.059 24.1957 34.8468 25.1254 32.0335C25.2671 31.6049 25.378 31.1621 25.4555 30.7076C25.6005 29.857 26.4076 29.2849 27.2583 29.4299C28.109 29.5749 28.681 30.3821 28.536 31.2327C28.432 31.8429 28.283 32.4379 28.0926 33.0142C26.8449 36.7893 23.8206 39.7519 20.0065 40.914C19.4728 41.0766 18.9239 41.2038 18.3626 41.293Z\",\n fill: color\n }), /*#__PURE__*/React.createElement(\"path\", {\n fillRule: \"evenodd\",\n clipRule: \"evenodd\",\n d: \"M33.9356 31.0645C33.9356 23.9644 24.1764 8.59028 19.4747 1.59549C18.2785 -0.184172 15.7216 -0.184172 14.5254 1.59548C9.82374 8.59028 0.0645752 23.9644 0.0645752 31.0645C0.0645752 40.4177 7.64685 48 17.0001 48C26.3533 48 33.9356 40.4177 33.9356 31.0645ZM30.8106 31.0645C30.8106 29.8836 30.375 28.0316 29.4236 25.578C28.5 23.1959 27.1988 20.5159 25.7187 17.7756C22.8106 12.3913 19.3287 6.98743 17.0001 3.51586C14.6715 6.98743 11.1895 12.3913 8.28145 17.7756C6.80135 20.5159 5.50017 23.1959 4.57655 25.578C3.62517 28.0316 3.18958 29.8836 3.18958 31.0645C3.18958 38.6918 9.37274 44.875 17.0001 44.875C24.6274 44.875 30.8106 38.6918 30.8106 31.0645Z\",\n fill: color\n }));\n});\nexport default Blur;","import _extends from \"@babel/runtime/helpers/extends\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/objectWithoutProperties\";\nvar _excluded = [\"color\", \"size\"];\nimport React from 'react';\nimport { intrinsicComponent } from './utils/functions';\nexport var PinOutline = intrinsicComponent(function (_ref, ref) {\n var _ref$color = _ref.color,\n color = _ref$color === void 0 ? 'currentColor' : _ref$color,\n _ref$size = _ref.size,\n size = _ref$size === void 0 ? 14 : _ref$size,\n rest = _objectWithoutProperties(_ref, _excluded);\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n ref: ref,\n width: size,\n height: size,\n viewBox: \"0 0 50 50\",\n fill: \"none\",\n xmlns: \"http://www.w3.org/2000/svg\"\n }, rest), /*#__PURE__*/React.createElement(\"path\", {\n fillRule: \"evenodd\",\n clipRule: \"evenodd\",\n d: \"M43.0081 15.2287L36.7869 17.6214L28.935 29.9601C30.5809 33.9266 30.3662 38.0903 27.1408 41.3158L26.5656 41.8909C25.9554 42.5011 24.9661 42.5011 24.3559 41.8909L14.4122 31.9472L2.99211 43.3673C2.38192 43.9775 1.3926 43.9775 0.782403 43.3673C0.17221 42.7571 0.172211 41.7678 0.782403 41.1576L12.2025 29.7375L2.25883 19.7938C1.64864 19.1836 1.64864 18.1943 2.25883 17.5841L2.50512 17.3378C5.73058 14.1123 10.2231 13.5688 14.1897 15.2147L26.5283 7.36283L28.9211 1.14165C29.327 0.0863053 30.6847 -0.201832 31.4843 0.597706L43.552 12.6655C44.3516 13.465 44.0634 14.8228 43.0081 15.2287ZM29.0752 9.44618L30.9747 4.50752L39.6422 13.1751L34.7035 15.0745L25.4251 29.655L26.0486 31.1577C27.234 34.0146 27.0773 36.5309 25.4342 38.5498L5.64209 18.7576C7.75439 17.2384 10.4304 17.0382 12.992 18.1011L14.4948 18.7246L29.0752 9.44618Z\",\n fill: color\n }));\n});\nexport default PinOutline;","import _extends from \"@babel/runtime/helpers/extends\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/objectWithoutProperties\";\nvar _excluded = [\"color\", \"size\"];\nimport React from 'react';\nimport { intrinsicComponent } from './utils/functions';\nexport var Duplicate = intrinsicComponent(function (_ref, ref) {\n var _ref$color = _ref.color,\n color = _ref$color === void 0 ? 'currentColor' : _ref$color,\n _ref$size = _ref.size,\n size = _ref$size === void 0 ? 14 : _ref$size,\n rest = _objectWithoutProperties(_ref, _excluded);\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n ref: ref,\n width: size,\n height: size,\n viewBox: \"0 0 50 50\",\n fill: \"none\",\n xmlns: \"http://www.w3.org/2000/svg\"\n }, rest), /*#__PURE__*/React.createElement(\"path\", {\n fillRule: \"evenodd\",\n clipRule: \"evenodd\",\n d: \"M0.312012 34.847V3.39883C0.312012 1.67294 1.71112 0.273834 3.43701 0.273834H26.807C28.5329 0.273834 29.932 1.67294 29.932 3.39883V34.847C29.932 36.5729 28.5329 37.972 26.807 37.972H3.43701C1.71112 37.972 0.312012 36.5729 0.312012 34.847ZM3.43701 34.847V3.39883L26.807 3.39883L26.807 34.847L3.43701 34.847Z\",\n fill: color\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M35.6874 12.5434C35.6874 11.6805 34.9878 10.9809 34.1249 10.9809C33.2619 10.9809 32.5624 11.6805 32.5624 12.5434V40.6009H9.89033C9.02739 40.6009 8.32783 41.3005 8.32783 42.1634C8.32783 43.0263 9.02739 43.7259 9.89033 43.7259H34.1249C34.9878 43.7259 35.6874 43.0263 35.6874 42.1634V12.5434Z\",\n fill: color\n }));\n});\nexport default Duplicate;","import _extends from \"@babel/runtime/helpers/extends\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/objectWithoutProperties\";\nvar _excluded = [\"color\", \"size\"];\nimport React from 'react';\nimport { intrinsicComponent } from './utils/functions';\nexport var DeleteOutline = intrinsicComponent(function (_ref, ref) {\n var _ref$color = _ref.color,\n color = _ref$color === void 0 ? 'currentColor' : _ref$color,\n _ref$size = _ref.size,\n size = _ref$size === void 0 ? 14 : _ref$size,\n rest = _objectWithoutProperties(_ref, _excluded);\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n ref: ref,\n width: size,\n height: size,\n viewBox: \"0 0 50 50\",\n fill: \"none\",\n xmlns: \"http://www.w3.org/2000/svg\"\n }, rest), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M15.75 17.3125C15.75 16.4496 16.4496 15.75 17.3125 15.75C18.1754 15.75 18.875 16.4496 18.875 17.3125L18.875 32.9375C18.875 33.8005 18.1754 34.5 17.3125 34.5C16.4496 34.5 15.75 33.8005 15.75 32.9375L15.75 17.3125Z\",\n fill: color\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M26.6875 15.75C25.8246 15.75 25.125 16.4496 25.125 17.3125L25.125 32.9375C25.125 33.8005 25.8246 34.5 26.6875 34.5C27.5504 34.5 28.25 33.8005 28.25 32.9375V17.3125C28.25 16.4496 27.5504 15.75 26.6875 15.75Z\",\n fill: color\n }), /*#__PURE__*/React.createElement(\"path\", {\n fillRule: \"evenodd\",\n clipRule: \"evenodd\",\n d: \"M12.625 6.37503V3.25003C12.625 1.52414 14.0241 0.125031 15.75 0.125031H28.25C29.9759 0.125031 31.375 1.52414 31.375 3.25003V6.37503H42.3125C43.1754 6.37503 43.875 7.07459 43.875 7.93753C43.875 8.80048 43.1754 9.50003 42.3125 9.50003H39.1875V40.75C39.1875 42.4759 37.7884 43.875 36.0625 43.875H7.9375C6.21161 43.875 4.8125 42.4759 4.8125 40.75V9.50003L1.6875 9.50003C0.824554 9.50003 0.125 8.80048 0.125 7.93753C0.125 7.07459 0.824555 6.37503 1.6875 6.37503H12.625ZM15.75 3.25003H28.25V6.37503H15.75V3.25003ZM7.9375 9.50003L7.9375 40.75H36.0625V9.50003H7.9375Z\",\n fill: color\n }));\n});\nexport default DeleteOutline;","import _extends from \"@babel/runtime/helpers/extends\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/objectWithoutProperties\";\nvar _excluded = [\"color\", \"size\"];\nimport React from 'react';\nimport { intrinsicComponent } from './utils/functions';\nexport var CropFrame = intrinsicComponent(function (_ref, ref) {\n var _ref$color = _ref.color,\n color = _ref$color === void 0 ? 'currentColor' : _ref$color,\n _ref$size = _ref.size,\n size = _ref$size === void 0 ? 14 : _ref$size,\n rest = _objectWithoutProperties(_ref, _excluded);\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n ref: ref,\n width: size,\n height: size,\n viewBox: \"0 0 50 50\",\n fill: \"none\",\n xmlns: \"http://www.w3.org/2000/svg\"\n }, rest), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M43 3H31.75V0.5H43C44.3807 0.5 45.5 1.61929 45.5 3V14.25H43V3Z\",\n fill: color\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M3 14.25V3H14.25V0.5H3C1.61929 0.5 0.5 1.61929 0.5 3V14.25H3Z\",\n fill: color\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M0.5 31.75V43C0.5 44.3807 1.61929 45.5 3 45.5H14.25V43H3V31.75H0.5Z\",\n fill: color\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M43 31.75H45.5V43C45.5 44.3807 44.3807 45.5 43 45.5H31.75V43H43V31.75Z\",\n fill: color\n }));\n});\nexport default CropFrame;","import _extends from \"@babel/runtime/helpers/extends\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/objectWithoutProperties\";\nvar _excluded = [\"color\", \"size\"];\nimport React from 'react';\nimport { intrinsicComponent } from './utils/functions';\nexport var Portrait = intrinsicComponent(function (_ref, ref) {\n var _ref$color = _ref.color,\n color = _ref$color === void 0 ? 'currentColor' : _ref$color,\n _ref$size = _ref.size,\n size = _ref$size === void 0 ? 14 : _ref$size,\n rest = _objectWithoutProperties(_ref, _excluded);\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n ref: ref,\n width: size,\n height: size,\n viewBox: \"0 0 36 52\",\n fill: \"none\",\n xmlns: \"http://www.w3.org/2000/svg\"\n }, rest), /*#__PURE__*/React.createElement(\"path\", {\n fillRule: \"evenodd\",\n clipRule: \"evenodd\",\n d: \"M32.0559 46.8755L32.0559 3.12555L3.93091 3.12555L3.93091 46.8755H32.0559ZM35.1809 3.12555C35.1809 1.39966 33.7818 0.000549316 32.0559 0.000549316H3.93091C2.20502 0.000549316 0.805908 1.39966 0.805908 3.12555V46.8755C0.805908 48.6014 2.20502 50.0005 3.93091 50.0005H32.0559C33.7818 50.0005 35.1809 48.6014 35.1809 46.8755L35.1809 3.12555Z\",\n fill: color\n }));\n});\nexport default Portrait;","import _extends from \"@babel/runtime/helpers/extends\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/objectWithoutProperties\";\nvar _excluded = [\"color\", \"size\"];\nimport React from 'react';\nimport { intrinsicComponent } from './utils/functions';\nexport var WarningOutline = intrinsicComponent(function (_ref, ref) {\n var _ref$color = _ref.color,\n color = _ref$color === void 0 ? 'currentColor' : _ref$color,\n _ref$size = _ref.size,\n size = _ref$size === void 0 ? 14 : _ref$size,\n rest = _objectWithoutProperties(_ref, _excluded);\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n ref: ref,\n width: size,\n height: size,\n viewBox: \"0 0 50 50\",\n fill: \"none\",\n xmlns: \"http://www.w3.org/2000/svg\"\n }, rest), /*#__PURE__*/React.createElement(\"path\", {\n fillRule: \"evenodd\",\n clipRule: \"evenodd\",\n d: \"M45.961 39.0119L28.2837 7.27185C27.5934 6.17538 26.3971 5.5 24.9981 5.5C23.5956 5.5 22.3967 6.17887 21.7073 7.28034L4.06571 38.9613L4.03009 39.0197C3.33595 40.159 3.32316 41.4697 3.9939 42.6216C4.67405 43.786 5.89 44.5 7.34459 44.5H42.554C44.0596 44.5 45.3464 43.7436 46.0016 42.6231C46.6817 41.4564 46.652 40.1455 45.9968 39.0706L45.961 39.0119ZM49.0254 44.3856C47.7038 46.6495 45.2246 48 42.554 48H7.34459C4.67398 48 2.29272 46.6495 0.970942 44.3856C-0.347811 42.1231 -0.322029 39.4361 1.04116 37.1987L18.6646 5.55018C18.6697 5.5418 18.6743 5.53342 18.6789 5.52504C18.6836 5.51666 18.6882 5.50828 18.6932 5.49989C20.0278 3.30867 22.3849 2 24.9981 2C27.6114 2 29.9685 3.30867 31.303 5.49989L48.9853 37.2489C50.3185 39.436 50.3442 42.1232 49.0254 44.3856Z\",\n fill: color\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M22.0001 16C22.0001 14.3431 23.3433 13 25.0001 13C26.657 13 28.0001 14.3431 28.0001 16V28C28.0001 29.6569 26.657 31 25.0001 31C23.3433 31 22.0001 29.6569 22.0001 28V16Z\",\n fill: color\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M28.0001 37C28.0001 38.6569 26.657 40 25.0001 40C23.3433 40 22.0001 38.6569 22.0001 37C22.0001 35.3431 23.3433 34 25.0001 34C26.657 34 28.0001 35.3431 28.0001 37Z\",\n fill: color\n }));\n});\nexport default WarningOutline;","import _extends from \"@babel/runtime/helpers/extends\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/objectWithoutProperties\";\nvar _excluded = [\"color\", \"size\"];\nimport React from 'react';\nimport { intrinsicComponent } from './utils/functions';\nexport var Success = intrinsicComponent(function (_ref, ref) {\n var _ref$color = _ref.color,\n color = _ref$color === void 0 ? 'currentColor' : _ref$color,\n _ref$size = _ref.size,\n size = _ref$size === void 0 ? 14 : _ref$size,\n rest = _objectWithoutProperties(_ref, _excluded);\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n ref: ref,\n width: size,\n height: size,\n viewBox: \"0 0 21 21\",\n fill: \"none\",\n xmlns: \"http://www.w3.org/2000/svg\"\n }, rest), /*#__PURE__*/React.createElement(\"path\", {\n fillRule: \"evenodd\",\n clipRule: \"evenodd\",\n d: \"M20.5 10.5001C20.5 16.023 16.0228 20.5001 10.5 20.5001C4.97714 20.5001 0.5 16.023 0.5 10.5001C0.5 4.97727 4.97714 0.500122 10.5 0.500122C16.0228 0.500122 20.5 4.97727 20.5 10.5001ZM7.88239 9.56904C8.00439 9.62145 8.11473 9.69763 8.20698 9.79314L9.49998 11.0861L12.793 7.79314C12.8852 7.69763 12.9956 7.62145 13.1176 7.56904C13.2396 7.51663 13.3708 7.48905 13.5036 7.48789C13.6363 7.48674 13.768 7.51204 13.8909 7.56232C14.0138 7.6126 14.1255 7.68686 14.2194 7.78075C14.3133 7.87464 14.3875 7.98629 14.4378 8.10919C14.4881 8.23208 14.5134 8.36376 14.5122 8.49654C14.5111 8.62932 14.4835 8.76054 14.4311 8.88255C14.3787 9.00455 14.3025 9.1149 14.207 9.20714L10.207 13.2071C10.0194 13.3946 9.76514 13.4999 9.49998 13.4999C9.23482 13.4999 8.98051 13.3946 8.79298 13.2071L6.79298 11.2071C6.69747 11.1149 6.62129 11.0046 6.56888 10.8825C6.51647 10.7605 6.48889 10.6293 6.48773 10.4965C6.48658 10.3638 6.51188 10.2321 6.56216 10.1092C6.61244 9.98629 6.6867 9.87464 6.78059 9.78075C6.87448 9.68686 6.98613 9.6126 7.10903 9.56232C7.23193 9.51204 7.3636 9.48674 7.49638 9.48789C7.62916 9.48905 7.76038 9.51663 7.88239 9.56904Z\",\n fill: color\n }));\n});\nexport default Success;","import _extends from \"@babel/runtime/helpers/extends\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/objectWithoutProperties\";\nvar _excluded = [\"color\", \"size\"];\nimport React from 'react';\nimport { intrinsicComponent } from './utils/functions';\nexport var Error = intrinsicComponent(function (_ref, ref) {\n var _ref$color = _ref.color,\n color = _ref$color === void 0 ? 'currentColor' : _ref$color,\n _ref$size = _ref.size,\n size = _ref$size === void 0 ? 14 : _ref$size,\n rest = _objectWithoutProperties(_ref, _excluded);\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n ref: ref,\n width: size,\n height: size,\n viewBox: \"0 0 21 21\",\n fill: \"none\",\n xmlns: \"http://www.w3.org/2000/svg\"\n }, rest), /*#__PURE__*/React.createElement(\"path\", {\n fillRule: \"evenodd\",\n clipRule: \"evenodd\",\n d: \"M10.5 20.5001C16.0228 20.5001 20.5 16.023 20.5 10.5001C20.5 4.97727 16.0228 0.500122 10.5 0.500122C4.97715 0.500122 0.5 4.97727 0.5 10.5001C0.5 16.023 4.97715 20.5001 10.5 20.5001ZM15.4375 7.0912L11.8155 10.7132L15.4638 14.309C15.6213 14.4665 15.7 14.6503 15.7 14.8865C15.7 15.1227 15.6213 15.3064 15.4638 15.4639C15.3063 15.6214 15.1226 15.7001 14.8864 15.7001C14.6501 15.7001 14.4664 15.6214 14.3089 15.4639L10.6869 11.8419L7.06483 15.4639C6.77612 15.7789 6.25118 15.7789 5.93622 15.4639C5.77874 15.3064 5.7 15.0964 5.7 14.8865C5.7 14.6765 5.77874 14.4928 5.93622 14.3353L9.55827 10.7132L5.93622 7.0912C5.77874 6.93372 5.7 6.72374 5.7 6.51377C5.7 6.3038 5.77874 6.12007 5.93622 5.96259C6.25118 5.64763 6.74987 5.64763 7.06483 5.96259L10.6869 9.58464L14.3089 5.93634C14.5976 5.62138 15.1226 5.62138 15.4375 5.93634C15.595 6.09382 15.6738 6.27755 15.6738 6.51377C15.6738 6.74999 15.595 6.93372 15.4375 7.0912Z\",\n fill: color\n }));\n});\nexport default Error;","import _extends from \"@babel/runtime/helpers/extends\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/objectWithoutProperties\";\nvar _excluded = [\"color\", \"size\"];\nimport React from 'react';\nimport { intrinsicComponent } from './utils/functions';\nexport var ErrorOutline = intrinsicComponent(function (_ref, ref) {\n var _ref$color = _ref.color,\n color = _ref$color === void 0 ? 'currentColor' : _ref$color,\n _ref$size = _ref.size,\n size = _ref$size === void 0 ? 14 : _ref$size,\n rest = _objectWithoutProperties(_ref, _excluded);\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n ref: ref,\n width: size,\n height: size,\n viewBox: \"0 0 52 52\",\n fill: \"none\",\n xmlns: \"http://www.w3.org/2000/svg\"\n }, rest), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M37.3438 16.4782L28.2887 25.5333L37.4095 34.5228C37.8032 34.9165 38 35.3758 38 35.9664C38 36.5569 37.8032 37.0162 37.4095 37.4099C37.0158 37.8036 36.5564 38.0005 35.9659 38.0005C35.3753 38.0005 34.916 37.8036 34.5223 37.4099L25.4672 28.3548L16.4121 37.4099C15.6903 38.1973 14.378 38.1973 13.5906 37.4099C13.1969 37.0162 13 36.4913 13 35.9664C13 35.4414 13.1969 34.9821 13.5906 34.5884L22.6457 25.5333L13.5906 16.4782C13.1969 16.0845 13 15.5595 13 15.0346C13 14.5097 13.1969 14.0504 13.5906 13.6567C14.378 12.8693 15.6247 12.8693 16.4121 13.6567L25.4672 22.7118L34.5223 13.591C35.2441 12.8036 36.5564 12.8036 37.3438 13.591C37.7375 13.9847 37.9344 14.4441 37.9344 15.0346C37.9344 15.6252 37.7375 16.0845 37.3438 16.4782Z\",\n fill: color\n }), /*#__PURE__*/React.createElement(\"path\", {\n fillRule: \"evenodd\",\n clipRule: \"evenodd\",\n d: \"M-0.000488281 25.0005C-0.000488281 38.7972 11.2028 50.0005 24.9995 50.0005C38.6925 50.0005 49.9995 38.7972 49.9995 25.0005C49.9995 11.2038 38.7962 0.000488281 24.9995 0.000488281C11.2028 0.000488281 -0.000488281 11.2038 -0.000488281 25.0005ZM3.63022 24.8968C3.63022 13.1748 13.1738 3.52746 24.9995 3.52746C36.8252 3.52746 46.3688 13.1748 46.3688 24.8968C46.3688 36.6187 36.8252 46.266 24.9995 46.266C13.2775 46.266 3.63022 36.6187 3.63022 24.8968Z\",\n fill: color\n }));\n});\nexport default ErrorOutline;","import _extends from \"@babel/runtime/helpers/extends\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/objectWithoutProperties\";\nvar _excluded = [\"color\", \"size\"];\nimport React from 'react';\nimport { intrinsicComponent } from './utils/functions';\nexport var Loading = intrinsicComponent(function (_ref, ref) {\n var _ref$color = _ref.color,\n color = _ref$color === void 0 ? 'currentColor' : _ref$color,\n _ref$size = _ref.size,\n size = _ref$size === void 0 ? 14 : _ref$size,\n rest = _objectWithoutProperties(_ref, _excluded);\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n ref: ref,\n width: size,\n height: size,\n viewBox: \"0 0 50 50\",\n fill: \"none\",\n xmlns: \"http://www.w3.org/2000/svg\"\n }, rest), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M29.9338 5.26853C27.8524 4.75154 25.7006 4.56814 23.5381 4.72351C22.4874 4.799 21.4379 4.95535 20.4183 5.18855L19.3724 0.636496C20.6245 0.350265 21.9128 0.158175 23.2017 0.065597C25.8579 -0.125223 28.5034 0.100753 31.0653 0.737277L29.9338 5.26853Z\",\n fill: color\n }), /*#__PURE__*/React.createElement(\"path\", {\n opacity: \"0.9\",\n d: \"M40.6131 11.9278C38.5498 9.48098 35.9044 7.52805 32.963 6.2805L34.7952 1.98303C38.4106 3.51633 41.6615 5.91575 44.1962 8.922L40.6131 11.9278Z\",\n fill: color\n }), /*#__PURE__*/React.createElement(\"path\", {\n opacity: \"0.8\",\n d: \"M45.3329 23.5739L45.3303 23.5392C45.097 20.3085 44.1359 17.275 42.4734 14.5227L46.4838 12.1129C48.5302 15.501 49.7133 19.2325 50 23.2036L45.3329 23.5739Z\",\n fill: color\n }), /*#__PURE__*/React.createElement(\"path\", {\n opacity: \"0.7\",\n d: \"M46.2688 38.2308L42.2981 35.7565C43.9958 33.0458 45.0372 29.9357 45.3095 26.7618L49.9744 27.1604C49.639 31.0674 48.3577 34.8958 46.2688 38.2308Z\",\n fill: color\n }), /*#__PURE__*/React.createElement(\"path\", {\n opacity: \"0.6\",\n d: \"M34.4209 48.1735L32.6626 43.8456C35.6192 42.6505 38.2938 40.7405 40.3975 38.3222L43.9338 41.3828C41.3483 44.3551 38.0588 46.7033 34.4209 48.1735V48.1735Z\",\n fill: color\n }), /*#__PURE__*/React.createElement(\"path\", {\n opacity: \"0.5\",\n d: \"M26.8033 49.9345C24.1593 50.1242 21.5262 49.9011 18.9766 49.2716L20.1013 44.7386C22.1729 45.25 24.3148 45.4309 26.4673 45.2766C27.5283 45.2004 28.5879 45.0416 29.6165 44.8049L30.6697 49.3551C29.4061 49.6459 28.1052 49.841 26.8033 49.9345V49.9345Z\",\n fill: color\n }), /*#__PURE__*/React.createElement(\"path\", {\n opacity: \"0.4\",\n d: \"M15.2449 48.0311C11.6272 46.5033 8.37276 44.1086 5.83362 41.1063L9.412 38.0952C11.479 40.5388 14.1272 42.4877 17.0704 43.7306L15.2449 48.0311Z\",\n fill: color\n }), /*#__PURE__*/React.createElement(\"path\", {\n opacity: \"0.3\",\n d: \"M3.54069 37.9198C1.48217 34.5223 0.292537 30.78 0.00479729 26.7959L0 26.7274L4.66972 26.3918L4.67579 26.478C4.90861 29.7017 5.87511 32.7443 7.54751 35.504L3.54069 37.9198Z\",\n fill: color\n }), /*#__PURE__*/React.createElement(\"path\", {\n opacity: \"0.2\",\n d: \"M4.69761 23.2075L0.0335693 22.802C0.374666 18.8955 1.66191 15.0691 3.75587 11.7373L7.72274 14.2175C6.02088 16.9257 4.97478 20.0344 4.69761 23.2075V23.2075Z\",\n fill: color\n }));\n});\nexport default Loading;","import _extends from \"@babel/runtime/helpers/extends\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/objectWithoutProperties\";\nvar _excluded = [\"color\", \"color2\", \"size\"];\nimport React from 'react';\nimport { intrinsicComponent } from './utils/functions';\nexport var ColorPicker = intrinsicComponent(function (_ref, ref) {\n var _ref$color = _ref.color,\n color = _ref$color === void 0 ? 'currentColor' : _ref$color,\n _ref$color2 = _ref.color2,\n color2 = _ref$color2 === void 0 ? '#F8FAFB' : _ref$color2,\n _ref$size = _ref.size,\n size = _ref$size === void 0 ? 14 : _ref$size,\n rest = _objectWithoutProperties(_ref, _excluded);\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n ref: ref,\n width: size,\n height: size,\n viewBox: \"0 0 42 42\",\n fill: \"none\",\n xmlns: \"http://www.w3.org/2000/svg\"\n }, rest), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M42.0001 6.11477C42.0001 4.48089 41.3639 2.94468 40.2086 1.78931C37.8238 -0.595528 33.9433 -0.595878 31.5582 1.78931L25.666 7.68191L22.9908 5.00654C22.5351 4.5509 21.7965 4.5509 21.3407 5.00654L17.8405 8.50695C17.3849 8.96259 17.3849 9.70141 17.8405 10.1572L20.5157 12.8325L3.63971 29.7097C3.5116 29.8378 3.41511 29.9939 3.35783 30.1658L2.27826 33.4048L1.30626 34.3769C-0.435198 36.1186 -0.435314 38.9525 1.30626 40.6943C3.04783 42.436 5.88157 42.4359 7.62314 40.6943L8.59514 39.7223L11.834 38.6426C12.0058 38.5853 12.1619 38.4888 12.29 38.3607L29.1661 21.4835L31.8413 24.1588C32.297 24.6145 33.0357 24.6145 33.4914 24.1588L36.9916 20.6584C37.4472 20.2028 37.4472 19.464 36.9916 19.0082L34.3164 16.3328L40.2086 10.4402C41.3639 9.28486 42.0001 7.74876 42.0001 6.11477ZM20.5157 26.8341H9.81507L22.1658 14.4826L27.516 19.8333L20.5157 26.8341ZM32.6663 21.6836L20.3156 9.332L22.1657 7.48168L34.5163 19.8333L32.6663 21.6836ZM38.5585 8.79014L32.6663 14.6827L27.316 9.332L33.2081 3.4394C34.6833 1.96421 37.0835 1.96409 38.5584 3.4394C40.0263 4.84774 40.0261 7.3818 38.5585 8.79014Z\",\n fill: color\n }));\n});\nexport default ColorPicker;","import _extends from \"@babel/runtime/helpers/extends\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/objectWithoutProperties\";\nvar _excluded = [\"color\", \"size\"];\nimport React from 'react';\nimport { intrinsicComponent } from './utils/functions';\nexport var Menu = intrinsicComponent(function (_ref, ref) {\n var _ref$color = _ref.color,\n color = _ref$color === void 0 ? 'currentColor' : _ref$color,\n _ref$size = _ref.size,\n size = _ref$size === void 0 ? 14 : _ref$size,\n rest = _objectWithoutProperties(_ref, _excluded);\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n ref: ref,\n width: size,\n height: size,\n viewBox: \"0 0 50 50\",\n fill: \"none\",\n xmlns: \"http://www.w3.org/2000/svg\"\n }, rest), /*#__PURE__*/React.createElement(\"path\", {\n fillRule: \"evenodd\",\n clipRule: \"evenodd\",\n d: \"M0 7.75049C0 6.92206 0.671573 6.25049 1.5 6.25049H48.5C49.3284 6.25049 50 6.92206 50 7.75049V9.43806C50 10.2665 49.3284 10.9381 48.5 10.9381H1.5C0.671571 10.9381 0 10.2665 0 9.43806V7.75049ZM0 24.1567C0 23.3283 0.671573 22.6567 1.5 22.6567H48.5C49.3284 22.6567 50 23.3283 50 24.1567V25.8443C50 26.6727 49.3284 27.3443 48.5 27.3443H1.5C0.671571 27.3443 0 26.6727 0 25.8443V24.1567ZM1.5 39.0629C0.671573 39.0629 0 39.7345 0 40.5629V42.2505C0 43.0789 0.671571 43.7505 1.5 43.7505H48.5C49.3284 43.7505 50 43.0789 50 42.2505V40.5629C50 39.7345 49.3284 39.0629 48.5 39.0629H1.5Z\",\n fill: color\n }));\n});\nexport default Menu;","import _extends from \"@babel/runtime/helpers/extends\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/objectWithoutProperties\";\nvar _excluded = [\"color\", \"size\"];\nimport React from 'react';\nimport { intrinsicComponent } from './utils/functions';\nexport var MoveDownOutline = intrinsicComponent(function (_ref, ref) {\n var _ref$color = _ref.color,\n color = _ref$color === void 0 ? 'currentColor' : _ref$color,\n _ref$size = _ref.size,\n size = _ref$size === void 0 ? 14 : _ref$size,\n rest = _objectWithoutProperties(_ref, _excluded);\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n ref: ref,\n width: size,\n height: size,\n viewBox: \"0 0 46 26\",\n fill: \"none\",\n xmlns: \"http://www.w3.org/2000/svg\"\n }, rest), /*#__PURE__*/React.createElement(\"path\", {\n fillRule: \"evenodd\",\n clipRule: \"evenodd\",\n d: \"M1.23229 1.23267C2.20863 0.256387 3.79154 0.256434 4.76782 1.23277L22.9989 19.465L41.2323 1.23267C42.2086 0.256387 43.7915 0.256434 44.7678 1.23277C45.7441 2.20911 45.7441 3.79203 44.7677 4.76831L24.7665 24.7683C24.2977 25.2371 23.6618 25.5005 22.9987 25.5005C22.3357 25.5005 21.6998 25.2371 21.231 24.7682L1.23218 4.7682C0.255899 3.79186 0.255946 2.20895 1.23229 1.23267Z\",\n fill: color\n }));\n});\nexport default MoveDownOutline;","import _extends from \"@babel/runtime/helpers/extends\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/objectWithoutProperties\";\nvar _excluded = [\"color\", \"size\"];\nimport React from 'react';\nimport { intrinsicComponent } from './utils/functions';\nexport var MoveUpOutline = intrinsicComponent(function (_ref, ref) {\n var _ref$color = _ref.color,\n color = _ref$color === void 0 ? 'currentColor' : _ref$color,\n _ref$size = _ref.size,\n size = _ref$size === void 0 ? 14 : _ref$size,\n rest = _objectWithoutProperties(_ref, _excluded);\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n ref: ref,\n width: size,\n height: size,\n viewBox: \"0 0 46 26\",\n fill: \"none\",\n xmlns: \"http://www.w3.org/2000/svg\"\n }, rest), /*#__PURE__*/React.createElement(\"path\", {\n fillRule: \"evenodd\",\n clipRule: \"evenodd\",\n d: \"M21.2326 1.23271C22.2089 0.256404 23.7918 0.256417 24.7681 1.23274L44.7678 21.2327C45.7441 22.2091 45.7441 23.792 44.7678 24.7683C43.7914 25.7446 42.2085 25.7446 41.2322 24.7682L23.0003 6.53602L4.76775 24.7683C3.79143 25.7446 2.20852 25.7446 1.23222 24.7682C0.255916 23.7919 0.255928 22.209 1.23225 21.2327L21.2326 1.23271Z\",\n fill: color\n }));\n});\nexport default MoveUpOutline;","import _extends from \"@babel/runtime/helpers/extends\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/objectWithoutProperties\";\nvar _excluded = [\"color\", \"size\"];\nimport React from 'react';\nimport { intrinsicComponent } from './utils/functions';\nexport var ArrowSidebarLeftOutline = intrinsicComponent(function (_ref, ref) {\n var _ref$color = _ref.color,\n color = _ref$color === void 0 ? 'currentColor' : _ref$color,\n _ref$size = _ref.size,\n size = _ref$size === void 0 ? 14 : _ref$size,\n rest = _objectWithoutProperties(_ref, _excluded);\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n ref: ref,\n width: size,\n height: size,\n viewBox: \"0 0 50 50\",\n fill: \"none\",\n xmlns: \"http://www.w3.org/2000/svg\"\n }, rest), /*#__PURE__*/React.createElement(\"path\", {\n fillRule: \"evenodd\",\n clipRule: \"evenodd\",\n d: \"M25 47.5006C37.4264 47.5006 47.5 37.427 47.5 25.0006C47.5 12.5742 37.4264 2.50061 25 2.50061C12.5736 2.50061 2.5 12.5742 2.5 25.0006C2.5 37.427 12.5736 47.5006 25 47.5006ZM25 50.0006C38.8071 50.0006 50 38.8077 50 25.0006C50 11.1935 38.8071 0.000610352 25 0.000610352C11.1929 0.000610352 0 11.1935 0 25.0006C0 38.8077 11.1929 50.0006 25 50.0006Z\",\n fill: color\n }), /*#__PURE__*/React.createElement(\"path\", {\n fillRule: \"evenodd\",\n clipRule: \"evenodd\",\n d: \"M27.7355 35.1357C27.1751 35.7705 26.2217 35.7926 25.6359 35.1773L17.3026 26.423C17.0301 26.1368 16.8819 25.755 16.8752 25.3647C16.8686 24.9745 17.0037 24.5881 17.2652 24.2923L25.5985 14.8647C26.1593 14.2302 27.1128 14.2089 27.6981 14.8247C28.2539 15.4093 28.2679 16.3516 27.7348 16.9546L20.36 25.2978L27.6974 33.0057C28.2536 33.59 28.2681 34.5323 27.7355 35.1357ZM26.6695 34.3756C26.7058 34.3748 26.753 34.3599 26.7984 34.3085C26.9042 34.1886 26.8989 33.9798 26.792 33.8676L19.0594 25.7444C18.8357 25.5095 18.829 25.1425 19.0438 24.8995L26.7983 16.1268C26.9041 16.007 26.899 15.7983 26.7921 15.6859C26.7464 15.6377 26.7001 15.6249 26.6639 15.6256C26.6276 15.6263 26.5805 15.6412 26.5351 15.6926L18.2017 25.1202C18.1562 25.1717 18.1235 25.2514 18.1251 25.3435C18.1266 25.4356 18.1619 25.5128 18.208 25.5612L26.5413 34.3154C26.5871 34.3635 26.6334 34.3763 26.6695 34.3756Z\",\n fill: color\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M26.7984 34.3085C26.753 34.3599 26.7058 34.3748 26.6695 34.3756C26.6334 34.3763 26.5871 34.3635 26.5413 34.3154L18.208 25.5612C18.1619 25.5128 18.1266 25.4356 18.1251 25.3435C18.1235 25.2514 18.1562 25.1717 18.2017 25.1202L26.5351 15.6926C26.5805 15.6412 26.6276 15.6263 26.6639 15.6256C26.7001 15.6249 26.7464 15.6377 26.7921 15.6859C26.899 15.7983 26.9041 16.007 26.7983 16.1268L19.0438 24.8995C18.829 25.1425 18.8357 25.5095 19.0594 25.7444L26.792 33.8676C26.8989 33.9798 26.9042 34.1886 26.7984 34.3085Z\",\n fill: color\n }));\n});\nexport default ArrowSidebarLeftOutline;","import _extends from \"@babel/runtime/helpers/extends\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/objectWithoutProperties\";\nvar _excluded = [\"color\", \"size\"];\nimport React from 'react';\nimport { intrinsicComponent } from './utils/functions';\nexport var ArrowSidebarRightOutline = intrinsicComponent(function (_ref, ref) {\n var _ref$color = _ref.color,\n color = _ref$color === void 0 ? 'currentColor' : _ref$color,\n _ref$size = _ref.size,\n size = _ref$size === void 0 ? 14 : _ref$size,\n rest = _objectWithoutProperties(_ref, _excluded);\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n ref: ref,\n width: size,\n height: size,\n viewBox: \"0 0 50 50\",\n fill: \"none\",\n xmlns: \"http://www.w3.org/2000/svg\"\n }, rest), /*#__PURE__*/React.createElement(\"path\", {\n fillRule: \"evenodd\",\n clipRule: \"evenodd\",\n d: \"M25 47.5006C37.4264 47.5006 47.5 37.427 47.5 25.0006C47.5 12.5742 37.4264 2.50061 25 2.50061C12.5736 2.50061 2.5 12.5742 2.5 25.0006C2.5 37.427 12.5736 47.5006 25 47.5006ZM25 50.0006C38.8071 50.0006 50 38.8077 50 25.0006C50 11.1935 38.8071 0.000610352 25 0.000610352C11.1929 0.000610352 0 11.1935 0 25.0006C0 38.8077 11.1929 50.0006 25 50.0006Z\",\n fill: color\n }), /*#__PURE__*/React.createElement(\"path\", {\n fillRule: \"evenodd\",\n clipRule: \"evenodd\",\n d: \"M22.2645 14.8655C22.8249 14.2307 23.7783 14.2086 24.3641 14.8239L32.6974 23.5781C32.9699 23.8644 33.1181 24.2461 33.1248 24.6364C33.1314 25.0267 32.9963 25.4131 32.7348 25.7089L24.4015 35.1365C23.8406 35.7709 22.8872 35.7923 22.3019 35.1765C21.7461 34.5919 21.7321 33.6496 22.2652 33.0465L29.6399 24.7034L22.3026 16.9954C21.7464 16.4112 21.7319 15.4689 22.2645 14.8655ZM23.3305 15.6256C23.2942 15.6264 23.247 15.6413 23.2016 15.6927C23.0958 15.8126 23.1011 16.0214 23.208 16.1336L30.9406 24.2568C31.1643 24.4917 31.171 24.8586 30.9562 25.1016L23.2017 33.8744C23.0959 33.9942 23.101 34.2029 23.2079 34.3153C23.2536 34.3634 23.2999 34.3763 23.3361 34.3756C23.3724 34.3748 23.4195 34.36 23.4649 34.3086L31.7983 24.881C31.8438 24.8295 31.8765 24.7497 31.8749 24.6577C31.8734 24.5656 31.838 24.4883 31.792 24.44L23.4587 15.6858C23.4129 15.6377 23.3666 15.6249 23.3305 15.6256Z\",\n fill: color\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M23.2016 15.6927C23.247 15.6413 23.2942 15.6264 23.3305 15.6256C23.3666 15.6249 23.4129 15.6377 23.4587 15.6858L31.792 24.44C31.838 24.4883 31.8734 24.5656 31.8749 24.6577C31.8765 24.7497 31.8438 24.8295 31.7983 24.881L23.4649 34.3086C23.4195 34.36 23.3724 34.3748 23.3361 34.3756C23.2999 34.3763 23.2536 34.3634 23.2079 34.3153C23.101 34.2029 23.0959 33.9942 23.2017 33.8744L30.9562 25.1016C31.171 24.8586 31.1643 24.4917 30.9406 24.2568L23.208 16.1336C23.1011 16.0214 23.0958 15.8126 23.2016 15.6927Z\",\n fill: color\n }));\n});\nexport default ArrowSidebarRightOutline;","import _extends from \"@babel/runtime/helpers/extends\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/objectWithoutProperties\";\nvar _excluded = [\"color\", \"size\"];\nimport React from 'react';\nimport { intrinsicComponent } from './utils/functions';\nexport var Annotation = intrinsicComponent(function (_ref, ref) {\n var _ref$color = _ref.color,\n color = _ref$color === void 0 ? 'currentColor' : _ref$color,\n _ref$size = _ref.size,\n size = _ref$size === void 0 ? 14 : _ref$size,\n rest = _objectWithoutProperties(_ref, _excluded);\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n ref: ref,\n width: size,\n height: size,\n viewBox: \"0 0 50 50\",\n fill: \"none\",\n xmlns: \"http://www.w3.org/2000/svg\"\n }, rest), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M48.5577 38.9423H34.8557C31.8069 38.9423 29.327 41.4224 29.327 44.4712C29.327 45.9293 28.1406 47.1157 26.6827 47.1157H5.52902C4.07066 47.1157 2.88467 45.9293 2.88467 44.4712V42.5459C2.88467 41.0886 4.07028 39.9025 5.5275 39.9018L9.33952 39.8999C9.34067 39.8999 9.34219 39.8995 9.34334 39.8995C9.38683 39.8995 9.43031 39.8968 9.47418 39.893C9.49211 39.8915 9.50966 39.8884 9.52759 39.8861C9.54628 39.8835 9.56535 39.8819 9.58405 39.8789L19.7636 38.1229C19.7689 38.1217 19.7739 38.1206 19.7788 38.1195C19.7948 38.1164 19.8105 38.113 19.8261 38.1095C19.8517 38.1038 19.8769 38.0981 19.9017 38.0908C19.9192 38.0863 19.9368 38.0809 19.9543 38.0756C19.9776 38.068 20.0008 38.0599 20.0241 38.0512C20.0409 38.0447 20.0581 38.039 20.0748 38.0321C20.1107 38.0168 20.1458 38.0008 20.1805 37.9829C20.1942 37.9756 20.208 37.9672 20.2217 37.9596C20.2461 37.9459 20.2702 37.9321 20.2938 37.9169C20.3083 37.9077 20.3228 37.8978 20.3373 37.8879C20.3602 37.8719 20.3831 37.8551 20.4052 37.8375C20.417 37.8284 20.4292 37.8192 20.4411 37.8093C20.4746 37.7815 20.5074 37.7525 20.5383 37.7212L46.2479 12.0109C48.3097 9.94895 48.3097 6.59377 46.2479 4.53146L43.2632 1.54708C41.2014 -0.515234 37.846 -0.514853 35.7841 1.54708L10.075 27.2574C10.0437 27.2883 10.0147 27.3215 9.9865 27.355C9.97696 27.3665 9.9678 27.3783 9.95865 27.3901C9.9411 27.4127 9.92432 27.4355 9.90829 27.4588C9.89838 27.4729 9.88846 27.4874 9.8793 27.5019C9.86443 27.5252 9.85069 27.5488 9.83734 27.5729C9.82857 27.5885 9.81941 27.6042 9.81102 27.6198C9.79424 27.653 9.77898 27.6862 9.76448 27.7205C9.75723 27.7377 9.75113 27.7556 9.74426 27.7732C9.73625 27.7953 9.72824 27.8178 9.72099 27.8403C9.71527 27.8586 9.70993 27.8769 9.70497 27.8952C9.69849 27.9189 9.69276 27.9429 9.68742 27.9673C9.68361 27.9841 9.67979 28.0009 9.67674 28.0177C9.6756 28.0226 9.67445 28.0272 9.67369 28.0318L8.12378 37.0158L5.52597 37.017C2.47879 37.0185 0 39.4989 0 42.5459V44.4712C0 47.5201 2.48032 50.0005 5.52902 50.0005H26.6827C29.7314 50.0005 32.2117 47.5201 32.2117 44.4712C32.2117 43.0132 33.3977 41.8267 34.8557 41.8267H48.5577C49.3542 41.8267 50 41.1813 50 40.3847C50 39.5878 49.3542 38.9423 48.5577 38.9423ZM12.043 31.2653L16.5306 35.7531L11.1076 36.6885L12.043 31.2653ZM33.5567 7.85382L35.7288 10.026L15.3065 30.4493L13.1344 28.2771L33.5567 7.85382ZM19.5183 34.6613L17.3462 32.4891L37.7689 12.0658L39.941 14.238L19.5183 34.6613ZM37.8239 3.58651C38.7611 2.64958 40.2859 2.64958 41.2235 3.58651L44.2078 6.57126C45.145 7.50858 45.145 9.03376 44.2078 9.97108L41.9804 12.1986L35.5965 5.81401L37.8239 3.58651Z\",\n fill: color\n }));\n});\nexport default Annotation;","import _extends from \"@babel/runtime/helpers/extends\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/objectWithoutProperties\";\nvar _excluded = [\"color\", \"size\"];\nimport React from 'react';\nimport { intrinsicComponent } from './utils/functions';\nexport var Rotate90 = intrinsicComponent(function (_ref, ref) {\n var _ref$color = _ref.color,\n color = _ref$color === void 0 ? 'currentColor' : _ref$color,\n _ref$size = _ref.size,\n size = _ref$size === void 0 ? 14 : _ref$size,\n rest = _objectWithoutProperties(_ref, _excluded);\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n ref: ref,\n width: size,\n height: size,\n viewBox: \"0 0 52 42\",\n fill: \"none\",\n xmlns: \"http://www.w3.org/2000/svg\"\n }, rest), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M46.4326 40.0282C46.1217 40.5666 45.6098 40.9595 45.0093 41.1204C44.4088 41.2813 43.7691 41.197 43.2307 40.8862C42.6923 40.5754 42.2995 40.0634 42.1386 39.463C41.9777 38.8625 42.0619 38.2227 42.3727 37.6843C45.2819 32.6454 46.0703 26.6571 44.5644 21.0369C43.0584 15.4167 39.3816 10.6249 34.3426 7.71563C25.1427 2.4043 13.7736 4.38306 6.93632 12.1744L14.5457 12.0831H14.5744C15.196 12.0795 15.7937 12.3229 16.2358 12.7599C16.678 13.1969 16.9284 13.7916 16.9321 14.4133C16.9357 15.0349 16.6923 15.6326 16.2553 16.0747C15.8183 16.5169 15.2236 16.7673 14.6019 16.771L2.37222 16.9175H2.34409C2.03391 16.9175 1.72681 16.856 1.44059 16.7364C1.15437 16.6169 0.894721 16.4417 0.676697 16.2211C0.458674 16.0004 0.28661 15.7387 0.170478 15.4511C0.0543471 15.1635 -0.00354164 14.8557 0.000167612 14.5455L0.147346 2.31591C0.151046 2.00811 0.215338 1.70404 0.336549 1.42108C0.457761 1.13812 0.633519 0.881802 0.853788 0.666765C1.07406 0.451728 1.33453 0.282182 1.62032 0.167807C1.90611 0.0534328 2.21164 -0.00353076 2.51944 0.000169355C2.82725 0.00386947 3.13132 0.0681609 3.41428 0.189372C3.69724 0.310584 3.95356 0.486342 4.16859 0.706611C4.38363 0.926881 4.55318 1.18735 4.66755 1.47314C4.78193 1.75894 4.83889 2.06446 4.83519 2.37227L4.77171 7.65586C9.37537 3.16334 15.4496 0.489016 21.8718 0.127065C28.2941 -0.234886 34.6303 1.74001 39.7096 5.6868C44.7889 9.63359 48.2679 15.2855 49.5038 21.5981C50.7397 27.9107 49.6485 34.4574 46.4326 40.0282Z\",\n fill: color\n }), /*#__PURE__*/React.createElement(\"path\", {\n fillRule: \"evenodd\",\n clipRule: \"evenodd\",\n d: \"M25 28C26.6569 28 28 26.6569 28 25C28 23.3431 26.6569 22 25 22C23.3431 22 22 23.3431 22 25C22 26.6569 23.3431 28 25 28ZM25 32C28.866 32 32 28.866 32 25C32 21.134 28.866 18 25 18C21.134 18 18 21.134 18 25C18 28.866 21.134 32 25 32Z\",\n fill: color\n }));\n});\nexport default Rotate90;","function _objectDestructuringEmpty(t) {\n if (null == t) throw new TypeError(\"Cannot destructure \" + t);\n}\nexport { _objectDestructuringEmpty as default };","export var Size = {\n Xs: 'xs',\n Sm: 'sm',\n Md: 'md',\n Lg: 'lg'\n};","import _defineProperty from \"@babel/runtime/helpers/defineProperty\";\nimport styled, { css } from 'styled-components';\nimport { generateClassNames, applyDisplayNames } from '../../utils/functions';\nimport { Color as PaletteColor } from '../../utils/types/palette';\nimport { Size } from './types';\nvar baseClassName = 'CrossButton';\nvar crossButtonPaddingMixin = _defineProperty(_defineProperty(_defineProperty(_defineProperty({}, Size.Xs, css([\"padding:5px;height:20px;\"])), Size.Sm, css([\"padding:6px;height:24px;\"])), Size.Md, css([\"padding:9px;\"])), Size.Lg, css([\"padding:12px;\"]));\nvar CrossButton = /*#__PURE__*/styled.button.attrs({\n className: generateClassNames(baseClassName, 'root')\n}).withConfig({\n componentId: \"sc-ygfku-0\"\n})(function (_ref) {\n var _ref$size = _ref.size,\n size = _ref$size === void 0 ? Size.Lg : _ref$size,\n theme = _ref.theme;\n return css([\"display:flex;justify-content:center;align-items:center;cursor:pointer;border-radius:4px;\", \" color:\", \";background:transparent;border:none;transition:all 100ms ease-out;&:hover{color:\", \";background:\", \";}&:active{color:\", \";background:\", \";}\"], crossButtonPaddingMixin[size], theme.palette[PaletteColor.IconsSecondary], theme.palette[PaletteColor.IconsPrimary], theme.palette[PaletteColor.BackgroundHover], theme.palette[PaletteColor.IconsPrimaryHover], theme.palette[PaletteColor.BackgroundActive]);\n});\nvar Styled = applyDisplayNames({\n CrossButton: CrossButton\n});\nexport default Styled;","import _objectDestructuringEmpty from \"@babel/runtime/helpers/objectDestructuringEmpty\";\nimport _extends from \"@babel/runtime/helpers/extends\";\nimport React from 'react';\nimport PT from 'prop-types';\nimport CrossOutline from '@scaleflex/icons/cross-outline';\nimport { intrinsicComponent, objectValues } from '../../utils/functions';\nimport { Size } from './types';\nimport Styled from './cross-button.styles';\nvar getIconSize = function getIconSize(sizeName) {\n switch (sizeName) {\n case Size.Lg:\n return 16;\n case Size.Xs:\n return 10;\n case Size.Sm:\n default:\n return 12;\n }\n};\nvar CrossButton = intrinsicComponent(function (_ref, ref) {\n var rest = _extends({}, (_objectDestructuringEmpty(_ref), _ref));\n return /*#__PURE__*/React.createElement(Styled.CrossButton, _extends({}, rest, {\n ref: ref\n }), /*#__PURE__*/React.createElement(CrossOutline, {\n size: getIconSize(rest.size)\n }));\n});\nCrossButton.defaultProps = {\n size: Size.Lg\n};\nCrossButton.propTypes = {\n size: PT.oneOf(objectValues(Size))\n};\nexport default CrossButton;","import styled, { css } from 'styled-components';\nimport { generateClassNames, applyDisplayNames } from '../../utils/functions';\nimport { Color as PColor } from '../../utils/types/palette';\n// import { BorderRadiusSize as BRSize } from '../../utils/types/shape';\nimport InputStyled from '../input/input.styles';\nimport { fontSizeInputMixin } from '../input/input.mixin';\nimport { Size } from '../menu-item/types';\nimport CrossButton from '../cross-button/cross-button.component';\nvar baseClassName = 'Select';\nvar Icon = /*#__PURE__*/styled.span.attrs({\n className: generateClassNames(baseClassName, 'Icon')\n}).withConfig({\n componentId: \"sc-mfrapg-0\"\n})(function (_ref) {\n var palette = _ref.theme.palette,\n size = _ref.size;\n return css([\"display:flex;flex-shrink:0;color:\", \";padding:\", \";\"], palette[PColor.IconsPrimary], size === Size.Md ? '2.5px' : '2px');\n});\nvar TickIcon = /*#__PURE__*/styled.span.attrs({\n className: generateClassNames(baseClassName, 'tickIcon')\n}).withConfig({\n componentId: \"sc-mfrapg-1\"\n})(function (_ref2) {\n var palette = _ref2.theme.palette;\n return css([\"color:\", \";\"], palette[PColor.AccentStateless]);\n});\nvar Container = /*#__PURE__*/styled.div.attrs({\n className: generateClassNames(baseClassName, 'Container')\n}).withConfig({\n componentId: \"sc-mfrapg-2\"\n})(function (_ref3) {\n var _ref3$fullWidth = _ref3.fullWidth,\n fullWidth = _ref3$fullWidth === void 0 ? false : _ref3$fullWidth;\n return css([\"position:relative;display:inline-flex;\", \"\"], fullWidth ? 'width: 100%' : '');\n});\nvar StyledCrossButton = /*#__PURE__*/styled(CrossButton).attrs({\n className: generateClassNames(baseClassName, 'CrossButton')\n}).withConfig({\n componentId: \"sc-mfrapg-3\"\n})(function () {\n return css([\"display:none;margin-right:6px;\"]);\n});\nvar Select = /*#__PURE__*/styled(InputStyled.Input).attrs({\n className: generateClassNames(baseClassName, 'root')\n}).withConfig({\n componentId: \"sc-mfrapg-4\"\n})(function (_ref4) {\n var palette = _ref4.theme.palette,\n disabled = _ref4.disabled,\n readOnly = _ref4.readOnly,\n _ref4$size = _ref4.size,\n size = _ref4$size === void 0 ? 'sm' : _ref4$size,\n isValueExists = _ref4.isValueExists;\n return css([\"cursor:\", \";user-select:none;gap:0px;background:\", \";\", \" \", \";\"], disabled || readOnly ? 'default' : 'pointer', disabled ? palette[PColor.BackgroundHover] : palette[PColor.BackgroundStateless], isValueExists && \"\\n &:hover {\\n \".concat(StyledCrossButton, \" {\\n display: flex;\\n }\\n }\\n \"), fontSizeInputMixin[size]);\n});\nvar Label = /*#__PURE__*/styled.label.attrs({\n className: generateClassNames(baseClassName, 'Label')\n}).withConfig({\n componentId: \"sc-mfrapg-5\"\n})(function (_ref5) {\n var hideEllipsis = _ref5.hideEllipsis,\n _ref5$size = _ref5.size,\n size = _ref5$size === void 0 ? Size.Md : _ref5$size;\n return \"\\n flex-grow: 1;\\n margin-right: \".concat(size === Size.Md ? 8 : 12, \"px;\\n\\n \").concat(!hideEllipsis && css([\"white-space:nowrap;text-overflow:ellipsis;overflow:hidden;\"]), \"\\n \");\n});\nvar Placeholder = /*#__PURE__*/styled.span.attrs({\n className: generateClassNames(baseClassName, 'Placeholder')\n}).withConfig({\n componentId: \"sc-mfrapg-6\"\n})(function (_ref6) {\n var palette = _ref6.theme.palette,\n size = _ref6.size;\n return css([\"width:100%;color:\", \";margin-right:\", \"px;\"], palette[PColor.TextPlaceholder], size === Size.Md ? 16 : 12);\n});\nvar Input = /*#__PURE__*/styled.input.attrs({\n className: generateClassNames(baseClassName, 'Input'),\n 'aria-hidden': 'true',\n tabindex: '-1'\n}).withConfig({\n componentId: \"sc-mfrapg-7\"\n})([\"left:0;width:100%;bottom:0;opacity:0;position:absolute;pointer-events:none;box-sizing:border-box;\"]);\nvar Styled = applyDisplayNames({\n Container: Container,\n Select: Select,\n Label: Label,\n Icon: Icon,\n TickIcon: TickIcon,\n Input: Input,\n Placeholder: Placeholder,\n StyledCrossButton: StyledCrossButton\n});\nexport default Styled;","import _defineProperty from \"@babel/runtime/helpers/defineProperty\";\nimport _typeof from \"@babel/runtime/helpers/typeof\";\nimport _toConsumableArray from \"@babel/runtime/helpers/toConsumableArray\";\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nimport React from 'react';\nimport { Tick } from '@scaleflex/icons/tick';\nimport { MenuItemActions, MenuItemLabel } from '../menu-item';\nimport { InputSize } from '../../utils/types';\nimport Styled from './select.styles';\nexport var getIconSize = function getIconSize(size) {\n switch (size) {\n case InputSize.Md:\n return 16;\n case InputSize.Sm:\n default:\n return 14;\n }\n};\nexport var renderIcon = function renderIcon(_icon, size) {\n return _icon ? /*#__PURE__*/React.createElement(Styled.Icon, null, typeof _icon === 'function' ? _icon({\n size: getIconSize(size)\n }) : _icon) : undefined;\n};\nvar generateChildren = function generateChildren(children) {\n var isActive = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;\n var size = arguments.length > 2 ? arguments[2] : undefined;\n var hideMenuItemsActions = arguments.length > 3 ? arguments[3] : undefined;\n var miChildren = /*#__PURE__*/React.createElement(MenuItemLabel, null, children);\n if (isActive && children) {\n var miActions = /*#__PURE__*/React.createElement(MenuItemActions, null, /*#__PURE__*/React.createElement(Styled.TickIcon, null, /*#__PURE__*/React.createElement(Tick, {\n size: getIconSize(size)\n })));\n if (React.Children.count(children) === 1) {\n return /*#__PURE__*/React.createElement(React.Fragment, null, miChildren, !hideMenuItemsActions && miActions);\n }\n if (React.Children.count(children) > 1 && !React.Children.toArray(children).some(function (child) {\n var _child$type;\n return (child === null || child === void 0 || (_child$type = child.type) === null || _child$type === void 0 ? void 0 : _child$type.displayName) === 'MenuItemActions';\n })) {\n return /*#__PURE__*/React.createElement(React.Fragment, null, children, miActions);\n }\n }\n return miChildren;\n};\nexport var renderOption = function renderOption(menuItem, _ref) {\n var _type, _props, _props2, _props3;\n var value = _ref.value,\n _ref$multiple = _ref.multiple,\n multiple = _ref$multiple === void 0 ? false : _ref$multiple,\n _ref$size = _ref.size,\n size = _ref$size === void 0 ? InputSize.Md : _ref$size,\n _ref$hideMenuItemsAct = _ref.hideMenuItemsActions,\n hideMenuItemsActions = _ref$hideMenuItemsAct === void 0 ? false : _ref$hideMenuItemsAct,\n onClose = _ref.onClose,\n onChange = _ref.onChange;\n if (! /*#__PURE__*/React.isValidElement(menuItem)) {\n return menuItem;\n }\n if (((_type = menuItem.type) === null || _type === void 0 ? void 0 : _type.displayName) !== 'MenuItem') {\n return /*#__PURE__*/React.cloneElement(menuItem);\n }\n var menuItemValue = menuItem === null || menuItem === void 0 || (_props = menuItem.props) === null || _props === void 0 ? void 0 : _props.value;\n var valueArr = multiple ? Array.isArray(value) ? value : [] : [value];\n var active = valueArr.length > 0 && valueArr.includes(menuItemValue);\n var isDisabledMenuItem = menuItem === null || menuItem === void 0 || (_props2 = menuItem.props) === null || _props2 === void 0 ? void 0 : _props2.disabled;\n return /*#__PURE__*/React.cloneElement(menuItem, {\n active: active,\n size: size,\n children: generateChildren(menuItem === null || menuItem === void 0 || (_props3 = menuItem.props) === null || _props3 === void 0 ? void 0 : _props3.children, active, size, hideMenuItemsActions),\n onClick: function onClick() {\n var _menuItemValue$toStri;\n if (!multiple && typeof onClose === 'function') {\n onClose();\n }\n if (typeof onChange === 'function' && !isDisabledMenuItem && !!(menuItemValue !== null && menuItemValue !== void 0 && (_menuItemValue$toStri = menuItemValue.toString()) !== null && _menuItemValue$toStri !== void 0 && _menuItemValue$toStri.length)) {\n var newValue = menuItemValue;\n if (multiple) {\n newValue = _toConsumableArray(Array.isArray(value) ? value : []);\n var index = newValue.indexOf(menuItemValue);\n if (index > -1) {\n newValue.splice(index, 1);\n } else {\n newValue.push(menuItemValue);\n }\n }\n onChange(newValue);\n }\n }\n });\n};\nvar getOptionValue = function getOptionValue(option) {\n var children = option.props ? option.props.children : option;\n if (Array.isArray(children)) return children.map(function (child) {\n return getOptionValue(child);\n }).join(' ');\n if (_typeof(children) === 'object') return getOptionValue(children.props.children);\n return children;\n};\nvar renderOptionValue = function renderOptionValue(option, showSelectionKey) {\n if (option && option.children) {\n var child = showSelectionKey ? option.value : option.children;\n while (typeof child !== 'string') {\n if (Array.isArray(child)) {\n child = getOptionValue(child[1]);\n } else {\n child = getOptionValue(child);\n }\n }\n return child;\n }\n};\nexport var renderValue = function renderValue(_ref2) {\n var value = _ref2.value,\n _ref2$multiple = _ref2.multiple,\n multiple = _ref2$multiple === void 0 ? false : _ref2$multiple,\n children = _ref2.children,\n _ref2$showSelectionKe = _ref2.showSelectionKey,\n showSelectionKey = _ref2$showSelectionKe === void 0 ? false : _ref2$showSelectionKe;\n var optionsProps = [];\n React.Children.forEach(children, function (child) {\n if ( /*#__PURE__*/React.isValidElement(child)) {\n var _type2 = child === null || child === void 0 ? void 0 : child.type,\n displayName = _type2.displayName;\n if (displayName === 'MenuItem' && Boolean(child.props)) {\n optionsProps.push(_objectSpread({}, child.props));\n }\n }\n });\n var activeOptions = multiple ? optionsProps.filter(function (itemProps) {\n return Array.isArray(value) && value.includes(itemProps.value);\n }) : [optionsProps.find(function (itemProps) {\n return itemProps.value === value;\n })];\n if (activeOptions.length > 0) {\n return activeOptions.map(function (option) {\n return renderOptionValue(option, showSelectionKey);\n }).join(', ');\n }\n return Array.isArray(value) ? value.join(', ') : value;\n};","import _extends from \"@babel/runtime/helpers/extends\";\nimport _slicedToArray from \"@babel/runtime/helpers/slicedToArray\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/objectWithoutProperties\";\nvar _excluded = [\"children\", \"size\", \"error\", \"multiple\", \"onChange\", \"value\", \"fullWidth\", \"selectProps\", \"MenuProps\", \"readOnly\", \"disabled\", \"scroll\", \"placeholder\", \"showSelectionKey\", \"hideMenuItemsActions\", \"showClearIcon\", \"renderLabel\", \"onRequestClose\", \"hideEllipsis\"];\nimport React, { useState } from 'react';\nimport PT from 'prop-types';\nimport { intrinsicComponent, objectValues } from '../../utils/functions';\nimport ArrowTick from '../arrow-tick';\nimport Menu from '../menu';\nimport { propTypes as menuPropTypes } from '../menu/menu.component';\nimport { renderValue, renderOption } from './select.utils';\nimport { InputSize } from '../../utils/types';\nimport Styled from './select.styles';\nimport { Size } from '../cross-button/types';\nvar Select = intrinsicComponent(function (_ref, ref) {\n var _value$toString;\n var children = _ref.children,\n size = _ref.size,\n error = _ref.error,\n multiple = _ref.multiple,\n onChange = _ref.onChange,\n value = _ref.value,\n fullWidth = _ref.fullWidth,\n selectProps = _ref.selectProps,\n MenuProps = _ref.MenuProps,\n readOnly = _ref.readOnly,\n disabled = _ref.disabled,\n _ref$scroll = _ref.scroll,\n scroll = _ref$scroll === void 0 ? true : _ref$scroll,\n placeholder = _ref.placeholder,\n showSelectionKey = _ref.showSelectionKey,\n hideMenuItemsActions = _ref.hideMenuItemsActions,\n showClearIcon = _ref.showClearIcon,\n renderLabel = _ref.renderLabel,\n onRequestClose = _ref.onRequestClose,\n _ref$hideEllipsis = _ref.hideEllipsis,\n hideEllipsis = _ref$hideEllipsis === void 0 ? false : _ref$hideEllipsis,\n rest = _objectWithoutProperties(_ref, _excluded);\n var _useState = useState(undefined),\n _useState2 = _slicedToArray(_useState, 2),\n anchorEl = _useState2[0],\n setAnchorEl = _useState2[1];\n var open = Boolean(anchorEl);\n var handleClick = function handleClick(event) {\n return setAnchorEl(event.currentTarget);\n };\n var isValueExists = Array.isArray(value) ? !!value.length : !!(value !== null && value !== void 0 && (_value$toString = value.toString()) !== null && _value$toString !== void 0 && _value$toString.length);\n var handleClose = function handleClose() {\n if (onRequestClose) {\n onRequestClose();\n }\n setAnchorEl(undefined);\n };\n var handleClearSelection = function handleClearSelection(event) {\n event.stopPropagation();\n if (typeof onChange === 'function') {\n onChange('');\n }\n };\n return /*#__PURE__*/React.createElement(Styled.Container, {\n ref: ref,\n fullWidth: Boolean(fullWidth)\n }, /*#__PURE__*/React.createElement(Styled.Select, _extends({}, rest, {\n disabled: disabled,\n size: size,\n error: error,\n fullWidth: Boolean(fullWidth),\n readOnly: readOnly,\n showSelectionKey: showSelectionKey,\n isValueExists: isValueExists,\n onClick: readOnly || disabled ? undefined : handleClick\n }), isValueExists && /*#__PURE__*/React.createElement(Styled.Label, {\n hideEllipsis: hideEllipsis,\n size: size\n }, typeof renderLabel === 'function' ? renderLabel(value) : renderValue({\n value: value,\n multiple: multiple,\n children: children,\n showSelectionKey: showSelectionKey\n })), !isValueExists && /*#__PURE__*/React.createElement(Styled.Placeholder, {\n size: size\n }, placeholder), !readOnly && showClearIcon && /*#__PURE__*/React.createElement(Styled.StyledCrossButton, {\n size: size === Size.Md ? Size.Sm : Size.Xs,\n onClick: handleClearSelection\n }), /*#__PURE__*/React.createElement(Styled.Icon, {\n size: size\n }, /*#__PURE__*/React.createElement(ArrowTick, {\n type: open ? 'top' : 'bottom',\n IconProps: {\n size: size === Size.Md ? 11 : 10\n }\n })), /*#__PURE__*/React.createElement(Styled.Input, selectProps)), /*#__PURE__*/React.createElement(Menu, _extends({\n onClose: handleClose,\n scroll: scroll,\n open: open,\n anchorEl: anchorEl\n }, MenuProps), React.Children.map(children, function (child) {\n return renderOption(child, {\n value: value,\n multiple: multiple,\n size: size,\n hideMenuItemsActions: hideMenuItemsActions,\n onClose: handleClose,\n onChange: readOnly || disabled ? undefined : onChange\n });\n })));\n});\nexport var defaultProps = {\n size: InputSize.Md,\n error: false,\n multiple: false,\n fullWidth: false,\n readOnly: false,\n disabled: false,\n showClearIcon: false,\n scroll: true,\n hideMenuItemsActions: false\n};\nSelect.defaultProps = defaultProps;\nexport var simpleValuePropTypes = PT.oneOfType([PT.string, PT.number, PT.oneOf([null])]);\nexport var propTypes = {\n size: PT.oneOf(objectValues(InputSize)),\n error: PT.bool,\n multiple: PT.bool,\n fullWidth: PT.bool,\n children: PT.oneOfType([PT.element, PT.arrayOf(PT.element)]),\n value: PT.oneOfType([PT.string, PT.number, PT.bool, PT.oneOf([null]), PT.arrayOf(simpleValuePropTypes)]),\n onChange: PT.func,\n MenuProps: PT.exact(menuPropTypes),\n // eslint-disable-next-line react/forbid-prop-types\n selectProps: PT.object,\n readOnly: PT.bool,\n disabled: PT.bool,\n showClearIcon: PT.bool,\n hideMenuItemsActions: PT.bool,\n showSelectionKey: PT.bool,\n scroll: PT.bool,\n renderLabel: PT.func,\n onRequestClose: PT.func,\n hideEllipsis: PT.bool\n};\nSelect.propTypes = propTypes;\nexport default Select;","function useDrag(onMove, onStart, onEnd) {\n var onDragging = function onDragging(e) {\n if (typeof onMove === 'function') {\n var _e$touches;\n onMove(((_e$touches = e.touches) === null || _e$touches === void 0 ? void 0 : _e$touches[0]) || e);\n }\n };\n var disableSliding = function disableSliding(e) {\n document.removeEventListener('mousemove', onDragging);\n document.removeEventListener('mouseup', disableSliding);\n document.removeEventListener('mouseleave', disableSliding);\n document.removeEventListener('touchmove', onDragging);\n document.removeEventListener('touchend', disableSliding);\n document.removeEventListener('touchcancel', disableSliding);\n if (typeof onEnd === 'function') {\n var _e$touches2;\n onEnd(((_e$touches2 = e.touches) === null || _e$touches2 === void 0 ? void 0 : _e$touches2[0]) || e);\n }\n };\n var enableDrag = function enableDrag(e) {\n document.addEventListener('mousemove', onDragging);\n document.addEventListener('mouseup', disableSliding);\n document.addEventListener('mouseleave', disableSliding);\n document.addEventListener('touchmove', onDragging);\n document.addEventListener('touchend', disableSliding);\n document.addEventListener('touchcancel', disableSliding);\n if (typeof onStart === 'function') {\n var _e$touches3;\n onStart(((_e$touches3 = e.touches) === null || _e$touches3 === void 0 ? void 0 : _e$touches3[0]) || e);\n }\n };\n return {\n onMouseDown: enableDrag,\n onTouchStart: enableDrag\n };\n}\nexport default useDrag;","import _defineProperty from \"@babel/runtime/helpers/defineProperty\";\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nimport styled, { css } from 'styled-components';\nimport { generateClassNames, applyDisplayNames } from '../../utils/functions';\nimport { Color as PColor } from '../../utils/types/palette';\nvar baseClassName = 'ColorPicker';\nvar colorItemClassName = 'ColorItem';\n\n// const ColorPicker = styled.div.attrs({\n// className: generateClassNames(baseClassName, 'root'),\n// })`\n// display: flex;\n// flex-direction: column;\n// align-items: center;\n// `;\n\nvar ColorPickerWrapper = /*#__PURE__*/styled.div.attrs({\n className: generateClassNames(baseClassName, 'root')\n}).withConfig({\n componentId: \"sc-qj4xo5-0\"\n})([\"background-color:\", \";box-shadow:0px 1px 2px rgba(78,77,77,0.15);border-radius:2px;padding:12px;max-width:300px;\"], function (_ref) {\n var theme = _ref.theme;\n return theme.palette[PColor.BackgroundSecondary];\n});\nvar ColorPickerIcon = /*#__PURE__*/styled.div.attrs({\n className: generateClassNames(baseClassName, 'icon')\n}).withConfig({\n componentId: \"sc-qj4xo5-1\"\n})([\"display:flex;justify-content:space-between;align-items:center;cursor:pointer;\"]);\nvar RangePickerWrapper = /*#__PURE__*/styled.div.attrs({\n className: generateClassNames(baseClassName, 'range-picker')\n}).withConfig({\n componentId: \"sc-qj4xo5-2\"\n})(function (_ref2) {\n var color = _ref2.color;\n return css([\"position:relative;border-radius:2px;width:100%;height:180px;user-select:none;cursor:crosshair;background-color:\", \";\"], color);\n});\nvar WhiteGradient = /*#__PURE__*/styled.div.attrs({\n className: generateClassNames(baseClassName, 'white-gradient')\n}).withConfig({\n componentId: \"sc-qj4xo5-3\"\n})([\"background:linear-gradient(to right,white 0%,rgba(255,255,255,0) 100%);z-index:0;position:absolute;width:100%;height:100%;border-radius:2px;user-select:none;pointer-events:none;top:-1px;\"]);\nvar BlackGradient = /*#__PURE__*/styled.div.attrs({\n className: generateClassNames(baseClassName, 'black-gradient')\n}).withConfig({\n componentId: \"sc-qj4xo5-4\"\n})([\"background:linear-gradient(to bottom,rgba(0,0,0,0) 0%,black 100%);z-index:1;position:absolute;width:100%;height:100%;border-radius:2px;user-select:none;pointer-events:none;\"]);\nvar ColorPointer = /*#__PURE__*/styled.span.attrs(function (_ref3) {\n var _ref3$left = _ref3.left,\n left = _ref3$left === void 0 ? 0 : _ref3$left,\n _ref3$top = _ref3.top,\n top = _ref3$top === void 0 ? 0 : _ref3$top,\n _ref3$considerTopWidt = _ref3.considerTopWidth,\n considerTopWidth = _ref3$considerTopWidt === void 0 ? false : _ref3$considerTopWidt,\n style = _ref3.style;\n return {\n className: generateClassNames(baseClassName, 'pointer'),\n style: _objectSpread({\n left: left - 7,\n // 7\n top: top - (considerTopWidth ? 7 : 0)\n }, style)\n };\n}).withConfig({\n componentId: \"sc-qj4xo5-5\"\n})(function (_ref4) {\n var theme = _ref4.theme,\n pointerColor = _ref4.pointerColor;\n return css([\"display:inline-block;box-sizing:border-box;width:15px;height:15px;border-radius:20px;box-shadow:0px 1px 2px rgba(78,77,77,0.15);border:2px solid \", \";background-color:\", \";position:absolute;cursor:pointer;z-index:11;user-select:none;outline:none;\"], theme.palette[PColor.BackgroundSecondary], pointerColor);\n});\nvar BarWrapper = /*#__PURE__*/styled.div.attrs({\n className: generateClassNames(baseClassName, 'bar-wrapper')\n}).withConfig({\n componentId: \"sc-qj4xo5-6\"\n})([\"margin-top:8px;position:relative;width:100%;height:12px;\"]);\nvar Bar = /*#__PURE__*/styled.table.attrs({\n className: generateClassNames(baseClassName, 'bar')\n}).withConfig({\n componentId: \"sc-qj4xo5-7\"\n})([\"border-radius:4px;width:100%;height:8px;border-collapse:collapse;\"]);\nvar BarColorStop = /*#__PURE__*/styled.td.attrs(function (_ref5) {\n var $color = _ref5.$color;\n return {\n className: generateClassNames(baseClassName, 'stop'),\n style: {\n backgroundColor: $color\n }\n };\n}).withConfig({\n componentId: \"sc-qj4xo5-8\"\n})([\"padding:0;user-select:none;pointer-events:none;&:first-child{width:4px;border-top-left-radius:4px;border-bottom-left-radius:4px;}&:last-child{width:4px;border-top-right-radius:4px;border-bottom-right-radius:4px;}\"]);\nvar ColorPickerAction = /*#__PURE__*/styled.div.attrs({\n className: generateClassNames(baseClassName, 'action')\n}).withConfig({\n componentId: \"sc-qj4xo5-9\"\n})([\"display:flex;justify-content:space-between;align-items:center;gap:12px;margin-bottom:12px;\"]);\nvar ColorItemWrapper = /*#__PURE__*/styled.label.attrs({\n className: generateClassNames(colorItemClassName, 'label')\n}).withConfig({\n componentId: \"sc-qj4xo5-10\"\n})(function (_ref6) {\n var theme = _ref6.theme,\n size = _ref6.size,\n color = _ref6.color,\n stroke = _ref6.stroke,\n value = _ref6.value;\n return css([\"border-radius:2px;border:\", \";box-sizing:border-box;width:\", \"px;height:\", \"px;background-color:\", \";user-select:none;display:flex;align-items:center;justify-content:center;cursor:pointer;transition:all 300ms;margin-bottom:8px;background:\", \";input{display:none;}\"], \"1px solid \".concat(stroke), size, size, color, value === 'rgba(0,0,0,0)' && \"repeating-conic-gradient(\".concat(theme.palette[PColor.LinkPrimary], \" 0% 25%, transparent 0% 50%) 50% / 8px 8px\"));\n});\nvar ColorItemsContainer = /*#__PURE__*/styled.div.withConfig({\n componentId: \"sc-qj4xo5-11\"\n})([\"display:flex;flex-wrap:wrap;align-content:space-between;margin-top:14px;margin-left:12px;& > .item{margin-right:8px;display:flex;justify-content:center;}\"]);\nvar Select = /*#__PURE__*/styled.div.attrs({\n className: generateClassNames(baseClassName, 'select')\n}).withConfig({\n componentId: \"sc-qj4xo5-12\"\n})(function (_ref7) {\n var value = _ref7.value;\n return css([\"width:\", \";\"], value === 'rgb' ? '25%' : '35%');\n});\nvar SelectWrapper = /*#__PURE__*/styled.div.withConfig({\n componentId: \"sc-qj4xo5-13\"\n})({\n display: 'flex',\n alignItems: 'center',\n gap: '12px'\n});\nvar Styled = applyDisplayNames({\n ColorPickerWrapper: ColorPickerWrapper,\n RangePickerWrapper: RangePickerWrapper,\n WhiteGradient: WhiteGradient,\n BlackGradient: BlackGradient,\n ColorPointer: ColorPointer,\n BarWrapper: BarWrapper,\n Bar: Bar,\n BarColorStop: BarColorStop,\n ColorPickerAction: ColorPickerAction,\n ColorPickerIcon: ColorPickerIcon,\n ColorItemsContainer: ColorItemsContainer,\n ColorItemWrapper: ColorItemWrapper,\n Select: Select,\n SelectWrapper: SelectWrapper\n});\nexport default Styled;","import React, { useMemo } from 'react';\nimport PT from 'prop-types';\nimport Tick from '@scaleflex/icons/tick';\nimport { intrinsicComponent } from '../../utils/functions';\nimport Styled from './color-picker.styles';\nvar ColorItem = intrinsicComponent(function (_ref, ref) {\n var value = _ref.value,\n onChange = _ref.onChange,\n checked = _ref.checked,\n _ref$size = _ref.size,\n size = _ref$size === void 0 ? 24 : _ref$size;\n var checkIconColor = useMemo(function () {\n if (value === '#ffffff' || value === 'rgba(0,0,0,0)') {\n return 'black';\n }\n return 'white';\n }, [value]);\n return /*#__PURE__*/React.createElement(Styled.ColorItemWrapper, {\n ref: ref,\n color: value,\n size: size,\n stroke: value === 'rgba(0,0,0,0)' ? '#a8a8a8' : '#E9EEF2',\n value: value\n }, /*#__PURE__*/React.createElement(\"input\", {\n type: \"radio\",\n value: value,\n checked: checked,\n onChange: onChange\n }), checked && /*#__PURE__*/React.createElement(Tick, {\n color: checkIconColor\n }));\n});\nColorItem.defaultProps = {};\nColorItem.propTypes = {\n value: PT.string.isRequired,\n checked: PT.bool,\n onChange: PT.func.isRequired,\n size: PT.number\n};\nexport default ColorItem;","import _extends from \"@babel/runtime/helpers/extends\";\nimport _defineProperty from \"@babel/runtime/helpers/defineProperty\";\nimport _toConsumableArray from \"@babel/runtime/helpers/toConsumableArray\";\nimport _slicedToArray from \"@babel/runtime/helpers/slicedToArray\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/objectWithoutProperties\";\nvar _excluded = [\"defaultColor\", \"onChange\", \"pinnedColors\", \"showTransparentColor\", \"hidePinIcon\", \"containerProps\"];\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nimport React, { useState, useMemo, useEffect } from 'react';\nimport PT from 'prop-types';\nimport { PinOutline, DeleteOutline } from '@scaleflex/icons';\nimport Select from '../select';\nimport MenuItem from '../menu-item';\nimport Input from '../input';\nimport useDrag from '../../hooks/use-drag';\nimport { intrinsicComponent, colorToHsl, hexToRgb, hslToHex, hslToHsv, hsvToHsl, restrictNumber, mapNumber, colorToHex, getElemDocumentCoords, rgbToHex, validateHex, rgbStringToArray } from '../../utils/functions';\nimport Styled from './color-picker.styles';\nimport ColorItem from './color-item.component';\nvar transparentColor = ['rgba(0,0,0,0)'];\nvar transparentColorHex = '#00000000';\nvar colorsHuesCount = 360;\nvar ColorPicker = intrinsicComponent(function (_ref, ref) {\n var _ref$defaultColor = _ref.defaultColor,\n defaultColor = _ref$defaultColor === void 0 ? '#000000' : _ref$defaultColor,\n onChange = _ref.onChange,\n _ref$pinnedColors = _ref.pinnedColors,\n pinnedColors = _ref$pinnedColors === void 0 ? [] : _ref$pinnedColors,\n _ref$showTransparentC = _ref.showTransparentColor,\n showTransparentColor = _ref$showTransparentC === void 0 ? false : _ref$showTransparentC,\n _ref$hidePinIcon = _ref.hidePinIcon,\n hidePinIcon = _ref$hidePinIcon === void 0 ? false : _ref$hidePinIcon,\n containerProps = _ref.containerProps,\n rest = _objectWithoutProperties(_ref, _excluded);\n var showedColors = showTransparentColor ? transparentColor.concat(pinnedColors) : pinnedColors;\n var isTransparentColor = function isTransparentColor(color) {\n return color === transparentColorHex || color === transparentColor[0];\n };\n var _useState = useState({\n color: '#ff0000',\n pointerLeft: 0\n }),\n _useState2 = _slicedToArray(_useState, 2),\n bar = _useState2[0],\n setBar = _useState2[1];\n var _useState3 = useState({\n color: isTransparentColor(defaultColor) ? '#00000000' : colorToHex(defaultColor) || '#000000',\n pointer: {\n left: 0,\n top: 0\n }\n }),\n _useState4 = _slicedToArray(_useState3, 2),\n rangePicker = _useState4[0],\n setRangePicker = _useState4[1];\n var _useState5 = useState(showedColors),\n _useState6 = _slicedToArray(_useState5, 2),\n localPinnedColors = _useState6[0],\n setLocalPinnedColors = _useState6[1];\n var _useState7 = useState('hex'),\n _useState8 = _slicedToArray(_useState7, 2),\n inputType = _useState8[0],\n setInputType = _useState8[1];\n var _useState9 = useState([]),\n _useState10 = _slicedToArray(_useState9, 2),\n rgbColorValue = _useState10[0],\n setRgbColorValue = _useState10[1];\n var _useState11 = useState(colorToHex(rangePicker.color)),\n _useState12 = _slicedToArray(_useState11, 2),\n hexInputValue = _useState12[0],\n setHexInputValue = _useState12[1];\n var _useState13 = useState(null),\n _useState14 = _slicedToArray(_useState13, 2),\n barRef = _useState14[0],\n setBarRef = _useState14[1];\n var _useState15 = useState(null),\n _useState16 = _slicedToArray(_useState15, 2),\n rangePickerRef = _useState16[0],\n setRangePickerRef = _useState16[1];\n var isColorChecked = function isColorChecked(checkedColor) {\n if (checkedColor === transparentColor[0] && rangePicker.color === transparentColorHex) {\n return true;\n }\n return checkedColor === rangePicker.color;\n };\n var filterTransparentColor = function filterTransparentColor(colors) {\n return colors.filter(function (item) {\n return item !== 'rgba(0,0,0,0)';\n });\n };\n var getRgbColor = function getRgbColor(color) {\n return isTransparentColor(color) ? transparentColor[0] : \"rgb(\".concat(hexToRgb(color).join(', '), \")\");\n };\n var handlePinnedColors = function handlePinnedColors(hexColor, type) {\n if (type === 'add') {\n var newLocalPinnedColors = [].concat(_toConsumableArray(localPinnedColors), [hexColor]);\n setLocalPinnedColors(newLocalPinnedColors);\n if (typeof onChange === 'function') {\n onChange(rangePicker.color, getRgbColor(hexColor), filterTransparentColor(newLocalPinnedColors));\n }\n } else {\n var _newLocalPinnedColors = localPinnedColors.filter(function (item) {\n return item !== rangePicker.color;\n });\n setLocalPinnedColors(_newLocalPinnedColors);\n if (typeof onChange === 'function') {\n onChange(rangePicker.color, getRgbColor(hexColor), filterTransparentColor(_newLocalPinnedColors));\n }\n }\n };\n var changeBarPosByColor = function changeBarPosByColor(color) {\n if (barRef !== null) {\n var _ref2 = getElemDocumentCoords(barRef),\n left = _ref2.left;\n var _colorToHsl = colorToHsl(color || rangePicker.color),\n _colorToHsl2 = _slicedToArray(_colorToHsl, 1),\n h = _colorToHsl2[0];\n var targetColorElem = barRef.querySelector(\"[data-hue='\".concat(h, \"']\"));\n if (targetColorElem !== null) {\n var targetColorRgb = targetColorElem.style.backgroundColor || bar.color;\n setBar({\n color: targetColorRgb,\n pointerLeft: getElemDocumentCoords(targetColorElem).left - left || bar.pointerLeft\n });\n }\n }\n };\n var handleRgbInput = function handleRgbInput(value, index) {\n if (value > 255 || Number.isNaN(value)) {\n return;\n }\n var rgbArr = rgbColorValue;\n rgbArr[index] = value;\n var newHexColor = rgbToHex.apply(void 0, _toConsumableArray(rgbArr));\n setRgbColorValue(_toConsumableArray(rgbArr));\n if (validateHex(newHexColor)) {\n setRangePicker(_objectSpread(_objectSpread({}, rangePicker), {}, {\n color: newHexColor\n }));\n changeBarPosByColor(newHexColor);\n }\n };\n var updateRgb = function updateRgb(color) {\n if (color.includes('rgb')) {\n setRgbColorValue(rgbStringToArray(color));\n } else {\n setRgbColorValue(hexToRgb(color));\n }\n };\n var getHexColor = function getHexColor(color) {\n return isTransparentColor(color) ? transparentColorHex : color;\n };\n var changeRangePickerPointerPosByColor = function changeRangePickerPointerPosByColor(color) {\n if (rangePickerRef !== null) {\n var _ref3 = getElemDocumentCoords(rangePickerRef),\n width = _ref3.width,\n height = _ref3.height;\n var colorHsl = colorToHsl(color);\n var colorHsv = hslToHsv(colorHsl[0], colorHsl[1] / 100, colorHsl[2] / 100);\n var left = mapNumber(colorHsv[1], 0, 100, 0, width);\n var top = height - mapNumber(colorHsv[2], 0, 100, 0, height);\n setRangePicker({\n color: getHexColor(color),\n pointer: {\n left: left,\n top: top\n }\n });\n changeBarPosByColor(color);\n updateRgb(color);\n if (typeof onChange === 'function') {\n onChange(getHexColor(color), getRgbColor(color), filterTransparentColor(localPinnedColors));\n }\n }\n };\n var changeRangePickerColorByPosition = function changeRangePickerColorByPosition(left, top, barColor) {\n if (rangePickerRef !== null) {\n var _ref4 = getElemDocumentCoords(rangePickerRef),\n width = _ref4.width,\n height = _ref4.height;\n var _colorToHsl3 = colorToHsl(barColor),\n _colorToHsl4 = _slicedToArray(_colorToHsl3, 1),\n barColorHue = _colorToHsl4[0];\n var restrictedLeft = restrictNumber(left, 0, width) || 0;\n var restrictedTop = restrictNumber(top, 0, height) || 0;\n var hsl = hsvToHsl(barColorHue, restrictedLeft / width, (height - restrictedTop) / height);\n var hexColor = hslToHex(hsl[0], hsl[1], hsl[2]);\n setRangePicker({\n color: hexColor,\n pointer: {\n left: restrictedLeft,\n top: restrictedTop\n }\n });\n if (typeof onChange === 'function') {\n onChange(hexColor, \"rgb(\".concat(hexToRgb(hexColor).join(', '), \")\"), filterTransparentColor(localPinnedColors));\n }\n }\n };\n var changeBarColorByPosition = function changeBarColorByPosition(pointerLeft) {\n var barElem = barRef;\n if (barElem !== null) {\n var _ref5 = getElemDocumentCoords(barElem),\n width = _ref5.width;\n var mappedPointerLeft = restrictNumber(Math.round(mapNumber(pointerLeft, 0, width, 0, colorsHuesCount)), 0, colorsHuesCount);\n var targetColorElem = barElem.querySelector(\"[data-hue='\".concat(mappedPointerLeft, \"']\"));\n var targetColorRgb = targetColorElem.style.backgroundColor;\n setBar({\n color: targetColorRgb,\n pointerLeft: restrictNumber(pointerLeft, 0, width)\n });\n return targetColorRgb;\n }\n return bar.color;\n };\n var updateBarColor = function updateBarColor(e) {\n var barElem = barRef;\n if (barElem !== null) {\n var _e$touches;\n var _ref6 = getElemDocumentCoords(barElem),\n left = _ref6.left;\n var pointerEvent = ((_e$touches = e.touches) === null || _e$touches === void 0 ? void 0 : _e$touches[0]) || e;\n var barColor = changeBarColorByPosition(pointerEvent.pageX - left);\n changeRangePickerColorByPosition(rangePicker.pointer.left, rangePicker.pointer.top, barColor);\n }\n };\n var updateRangePickerColor = function updateRangePickerColor(e) {\n var rangePickerElem = rangePickerRef;\n if (rangePickerElem !== null) {\n var _ref7 = getElemDocumentCoords(rangePickerElem),\n left = _ref7.left,\n top = _ref7.top,\n height = _ref7.height,\n width = _ref7.width;\n var pointerLeft = e ? restrictNumber(e.pageX - left, 0, width) : rangePicker.pointer.left || 0;\n var pointerTop = e ? restrictNumber(e.pageY - top, 0, height) : rangePicker.pointer.left || 0;\n changeRangePickerColorByPosition(pointerLeft, pointerTop, bar.color);\n }\n };\n var moveBarPointerByArrows = function moveBarPointerByArrows(e) {\n if (e.key !== 'ArrowLeft' && e.key !== 'ArrowRight') {\n return;\n }\n changeBarColorByPosition(bar.pointerLeft + (e.key === 'ArrowLeft' ? -1 : 1));\n };\n var moveRangePickerPointerByArrows = function moveRangePickerPointerByArrows(e) {\n var currentDirection = 0;\n if (e.key === 'ArrowLeft' || e.key === 'ArrowUp') {\n currentDirection = -1;\n } else if (e.key === 'ArrowRight' || e.key === 'ArrowDown') {\n currentDirection = 1;\n }\n if (currentDirection) {\n changeRangePickerColorByPosition((rangePicker.pointer.left || 0) + (['ArrowLeft', 'ArrowRight'].includes(e.key) ? currentDirection : 0), (rangePicker.pointer.top || 0) + (['ArrowUp', 'ArrowDown'].includes(e.key) ? currentDirection : 0), bar.color);\n }\n };\n var validateHexAndUpdate = function validateHexAndUpdate(color) {\n var testHex = validateHex(color);\n if (testHex) {\n changeRangePickerPointerPosByColor(color);\n }\n setHexInputValue(color);\n };\n useEffect(function () {\n changeBarPosByColor(rangePicker.color);\n changeRangePickerPointerPosByColor(rangePicker.color);\n }, [barRef]);\n useEffect(function () {\n setHexInputValue(rangePicker.color);\n updateRgb(rangePicker.color);\n }, [rangePicker.color]);\n var barColors = useMemo(function () {\n return _toConsumableArray(new Array(colorsHuesCount + 1)).map(function (_, h) {\n return /*#__PURE__*/React.createElement(Styled.BarColorStop, {\n key: h,\n $color: \"hsl(\".concat(h, \", 100%, 50%)\"),\n \"data-hue\": h\n });\n });\n }, []);\n var barPointSliding = useDrag(updateBarColor, updateBarColor, null);\n var rangePickerPointSliding = useDrag(updateRangePickerColor, updateRangePickerColor, null);\n return /*#__PURE__*/React.createElement(Styled.ColorPickerWrapper, _extends({\n ref: ref\n }, rest), /*#__PURE__*/React.createElement(Styled.ColorPickerAction, null, /*#__PURE__*/React.createElement(Styled.SelectWrapper, null, /*#__PURE__*/React.createElement(Styled.Select, {\n value: inputType\n }, /*#__PURE__*/React.createElement(Select, {\n size: \"sm\",\n value: inputType,\n MenuProps: _objectSpread({\n zIndex: 11112\n }, containerProps),\n onChange: function onChange(ev) {\n return setInputType(ev);\n },\n fullWidth: true,\n hideEllipsis: true\n }, /*#__PURE__*/React.createElement(MenuItem, {\n value: \"hex\"\n }, \"Hex\"), /*#__PURE__*/React.createElement(MenuItem, {\n value: \"rgb\"\n }, \"RGB\"))), inputType === 'hex' ? /*#__PURE__*/React.createElement(Input, {\n size: \"sm\",\n error: !/^#([\\da-f]{3}){1,2}$/i.test(rangePicker.color),\n value: hexInputValue,\n onChange: function onChange(e) {\n return validateHexAndUpdate(e.target.value);\n },\n style: {\n width: '45%'\n }\n }) : rgbColorValue.map(function (rgb, index) {\n return /*#__PURE__*/React.createElement(Input, {\n key: index,\n size: \"sm\",\n value: rgb,\n onChange: function onChange(e) {\n var _e$target;\n return handleRgbInput(Number((_e$target = e.target) === null || _e$target === void 0 ? void 0 : _e$target.value), index);\n },\n style: {\n width: '20%'\n }\n });\n })), rangePicker.color !== transparentColorHex && !hidePinIcon && /*#__PURE__*/React.createElement(Styled.ColorPickerIcon, {\n onClick: function onClick() {\n return localPinnedColors.some(function (checkedColor) {\n return isColorChecked(checkedColor);\n }) ? handlePinnedColors(rangePicker.color, 'delete') : handlePinnedColors(rangePicker.color, 'add');\n }\n }, localPinnedColors.some(function (checkedColor) {\n return isColorChecked(checkedColor);\n }) ? /*#__PURE__*/React.createElement(DeleteOutline, null) : /*#__PURE__*/React.createElement(PinOutline, null))), /*#__PURE__*/React.createElement(Styled.RangePickerWrapper, _extends({\n ref: setRangePickerRef,\n color: bar.color\n }, rangePickerPointSliding), /*#__PURE__*/React.createElement(Styled.WhiteGradient, null), /*#__PURE__*/React.createElement(Styled.BlackGradient, null), /*#__PURE__*/React.createElement(Styled.ColorPointer, {\n tabIndex: -1,\n left: rangePicker.pointer.left || 0,\n top: rangePicker.pointer.top || 0,\n onKeyDown: moveRangePickerPointerByArrows,\n pointerColor: hexInputValue,\n considerTopWidth: true\n })), /*#__PURE__*/React.createElement(Styled.BarWrapper, barPointSliding, /*#__PURE__*/React.createElement(Styled.Bar, {\n ref: setBarRef\n }, /*#__PURE__*/React.createElement(\"tbody\", null, /*#__PURE__*/React.createElement(\"tr\", null, barColors))), /*#__PURE__*/React.createElement(Styled.ColorPointer, {\n tabIndex: -1,\n left: bar.pointerLeft,\n onKeyDown: moveBarPointerByArrows,\n considerTopWidth: false,\n pointerColor: hexInputValue,\n style: {\n top: -3\n }\n })), /*#__PURE__*/React.createElement(Styled.ColorItemsContainer, null, localPinnedColors.map(function (color) {\n return /*#__PURE__*/React.createElement(\"div\", {\n className: \"item\",\n key: color\n }, /*#__PURE__*/React.createElement(ColorItem, {\n value: color,\n checked: isColorChecked(color),\n onChange: function onChange(ev) {\n return changeRangePickerPointerPosByColor(ev.target.value);\n }\n }));\n })));\n});\nColorPicker.defaultProps = {\n defaultColor: '#000000',\n pinnedColors: [],\n showTransparentColor: false,\n hidePinIcon: false\n};\nColorPicker.propTypes = {\n defaultColor: PT.string,\n onChange: PT.func,\n pinnedColors: PT.array,\n showTransparentColor: PT.bool,\n hidePinIcon: PT.bool\n};\nexport default ColorPicker;","import _defineProperty from \"@babel/runtime/helpers/defineProperty\";\nimport { css } from 'styled-components';\nimport { Color as PaletteColor } from '../../utils/types/palette';\nimport { ButtonSize, IconButtonColor } from '../../utils/types';\nexport var colorButtonMixin = _defineProperty(_defineProperty(_defineProperty({}, IconButtonColor.Primary, function (_ref) {\n var palette = _ref.theme.palette,\n active = _ref.active;\n return css([\"background-color:\", \";color:\", \";&:hover{background-color:\", \";}&:focus{background-color:\", \";}&:active{background-color:\", \";}\", \" &:disabled{color:\", \";background:\", \";cursor:default;}\"], palette[PaletteColor.AccentStateless], palette[PaletteColor.IconsInvert], palette[PaletteColor.AccentPrimaryHover], palette[PaletteColor.AccentPrimaryActive], palette[PaletteColor.AccentPrimaryActive], active && css([\"background-color:\", \";&:hover,&:focus{background-color:\", \";}\"], palette[PaletteColor.AccentPrimaryActive], palette[PaletteColor.AccentPrimaryActive]), palette[PaletteColor.BordersDisabled], palette[PaletteColor.Accent_1_2_Opacity]);\n}), IconButtonColor.Secondary, function (_ref2) {\n var palette = _ref2.theme.palette,\n active = _ref2.active;\n return css([\"background-color:\", \";color:\", \";border:1px solid \", \";&:hover{color:\", \";background-color:\", \";}&:focus{background-color:\", \";color:\", \";border:1px solid \", \";}&:active{color:\", \";background-color:\", \";}\", \" &:disabled{color:\", \";background:\", \";border:none;cursor:default;}\"], palette[PaletteColor.BackgroundStateless], palette[PaletteColor.AccentStateless], palette[PaletteColor.AccentStateless], palette[PaletteColor.IconsInvert], palette[PaletteColor.AccentPrimaryHover], palette[PaletteColor.Accent_1_2_Opacity], palette[PaletteColor.AccentPrimaryActive], palette[PaletteColor.AccentPrimaryActive], palette[PaletteColor.IconsInvert], palette[PaletteColor.AccentPrimaryActive], active && css([\"color:\", \";background-color:\", \";&:hover,&:focus{color:\", \";background-color:\", \";}\"], palette[PaletteColor.IconsInvert], palette[PaletteColor.AccentPrimaryActive], palette[PaletteColor.IconsInvert], palette[PaletteColor.AccentPrimaryActive]), palette[PaletteColor.BordersDisabled], palette[PaletteColor.Accent_1_2_Opacity]);\n}), IconButtonColor.Basic, function (_ref3) {\n var palette = _ref3.theme.palette,\n active = _ref3.active;\n return css([\"background-color:transparent;color:\", \";border:none;&:hover{background-color:\", \";color:\", \";}&:focus{background-color:\", \";color:\", \";}&:active{background-color:\", \";color:\", \";}\", \" &:disabled{background-color:transparent;color:\", \";cursor:default;}\"], palette[PaletteColor.IconsPrimary], palette[PaletteColor.BackgroundHover], palette[PaletteColor.IconsPrimaryHover], palette[PaletteColor.BackgroundActive], palette[PaletteColor.LinkActive], palette[PaletteColor.BackgroundActive], palette[PaletteColor.LinkActive], active && css([\"background-color:\", \";color:\", \";&:hover,&:focus{background-color:\", \";color:\", \";}\"], palette[PaletteColor.BackgroundActive], palette[PaletteColor.LinkActive], palette[PaletteColor.BackgroundActive], palette[PaletteColor.LinkActive]), palette[PaletteColor.BordersDisabled]);\n});\nexport var squarePaddingMixin = _defineProperty(_defineProperty(_defineProperty(_defineProperty({}, ButtonSize.Xs, css([\"padding:6px;\"])), ButtonSize.Sm, css([\"padding:9px;\"])), ButtonSize.Md, css([\"padding:12px;\"])), ButtonSize.Lg, css([\"padding:11px;\"]));","import styled, { css } from 'styled-components';\nimport { generateClassNames, applyDisplayNames } from '../../utils/functions';\nimport ButtonStyled from '../button/button.styles';\nimport { colorButtonMixin, squarePaddingMixin } from './icon-button.mixin';\nimport { ButtonSize, IconButtonColor } from '../../utils/types';\nvar baseClassName = 'IconButton';\nvar IconButton = /*#__PURE__*/styled(ButtonStyled.Button).attrs({\n className: generateClassNames(baseClassName, 'root')\n}).withConfig({\n componentId: \"sc-10edh45-0\"\n})(function (_ref) {\n var _ref$color = _ref.color,\n color = _ref$color === void 0 ? IconButtonColor.Secondary : _ref$color,\n _ref$size = _ref.size,\n size = _ref$size === void 0 ? ButtonSize.Md : _ref$size;\n return css([\"\", \" \", \"\"], squarePaddingMixin[size], colorButtonMixin[color]);\n});\nvar Styled = applyDisplayNames({\n IconButton: IconButton\n});\nexport default Styled;","import _extends from \"@babel/runtime/helpers/extends\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/objectWithoutProperties\";\nvar _excluded = [\"children\"];\nimport React from 'react';\nimport PT from 'prop-types';\nimport { intrinsicComponent, objectValues } from '../../utils/functions';\nimport { getIconSize } from '../button/button.utils';\nimport { ButtonSize, IconButtonColor } from '../../utils/types';\nimport Styled from './icon-button.styles';\nvar IconButton = intrinsicComponent(function (_ref, ref) {\n var children = _ref.children,\n rest = _objectWithoutProperties(_ref, _excluded);\n return /*#__PURE__*/React.createElement(Styled.IconButton, _extends({}, rest, {\n ref: ref\n }), children && (typeof children === 'function' ? children({\n size: getIconSize(rest.size)\n }) : children));\n});\nIconButton.defaultProps = {\n size: ButtonSize.Md,\n color: IconButtonColor.Secondary,\n active: false\n};\nIconButton.propTypes = {\n children: PT.oneOfType([PT.node, PT.func]).isRequired,\n size: PT.oneOf(objectValues(ButtonSize)),\n color: PT.oneOf(objectValues(IconButtonColor)),\n disabled: PT.bool,\n active: PT.bool\n};\nexport default IconButton;","export var onClickByMouseDown = function onClickByMouseDown(event, callback) {\n event.preventDefault();\n if (event.button !== 0) {\n return;\n }\n if (callback) {\n callback(event);\n }\n};","import _defineProperty from \"@babel/runtime/helpers/defineProperty\";\nimport { css } from 'styled-components';\nimport { InputSize } from '../../utils/types';\nimport { Color as PaletteColor } from '../../utils/types/palette';\nimport { FontVariant as FV } from '../../utils/types/typography';\nexport var errorMixin = function errorMixin(_ref) {\n var palette = _ref.theme.palette;\n return css([\"background:\", \" !important;border:1px solid \", \" !important;\"], palette[PaletteColor.BackgroundSecondary], palette[PaletteColor.Error]);\n};\nexport var heightTextAreaMixin = _defineProperty(_defineProperty({}, InputSize.Sm, function () {\n return css([\"height:136px;\"]);\n}), InputSize.Md, function () {\n return css([\"height:152px;\"]);\n});\nexport var sizeTextAreaMixin = _defineProperty(_defineProperty({}, InputSize.Sm, function (_ref2) {\n var font = _ref2.theme.typography.font;\n return css([\"padding:8px 12px;\", \"\"], font[FV.InputMd]);\n}), InputSize.Md, function (_ref3) {\n var font = _ref3.theme.typography.font;\n return css([\"padding:8px 16px;\", \"\"], font[FV.InputLg]);\n});","import styled, { css } from 'styled-components';\nimport { generateClassNames, applyDisplayNames } from '../../utils/functions';\nimport { InputSize } from '../../utils/types';\nimport { Color as PColor } from '../../utils/types/palette';\nimport { BorderRadiusSize as BRSize } from '../../utils/types/shape';\nimport { errorMixin, sizeTextAreaMixin, heightTextAreaMixin } from './textarea.mixin';\nimport { getInputBackgroundColor, getInputTextColor, getInputBorderColor } from '../input/input.utils';\nvar baseClassName = 'Textarea';\nvar Textarea = /*#__PURE__*/styled.div.attrs({\n className: generateClassNames(baseClassName, 'root')\n}).withConfig({\n componentId: \"sc-1usif6k-0\"\n})(function (_ref) {\n var _ref$size = _ref.size,\n size = _ref$size === void 0 ? InputSize.Md : _ref$size,\n _ref$error = _ref.error,\n error = _ref$error === void 0 ? false : _ref$error,\n _ref$fullWidth = _ref.fullWidth,\n fullWidth = _ref$fullWidth === void 0 ? false : _ref$fullWidth,\n _ref$readOnly = _ref.readOnly,\n readOnly = _ref$readOnly === void 0 ? false : _ref$readOnly,\n _ref$disabled = _ref.disabled,\n disabled = _ref$disabled === void 0 ? false : _ref$disabled,\n _ref$autoSize = _ref.autoSize,\n autoSize = _ref$autoSize === void 0 ? false : _ref$autoSize,\n theme = _ref.theme;\n return css([\"position:relative;display:inline-flex;flex-direction:column;align-items:flex-end;justify-content:space-between;cursor:text;box-sizing:border-box;transition:all 100ms ease-out;width:\", \";pointer-events:\", \";background-color:\", \";border-radius:\", \";border:1px solid \", \";color:\", \";\", \" \", \" &:hover{color:\", \";}\", \" \", \"\"], fullWidth ? '100%' : '300px', disabled ? 'none' : 'auto', getInputBackgroundColor(readOnly, disabled), theme.shape.borderRadius[BRSize.Md], getInputBorderColor(readOnly, disabled), disabled ? theme.palette[PColor.TextPlaceholder] : theme.palette[PColor.TextPrimary], heightTextAreaMixin[size], !readOnly && !disabled && css([\"&:focus-within{background-color:\", \"!important;border:1px solid \", \";&:hover{border:1px solid \", \";}}&:hover{background-color:\", \";border:1px solid \", \";}\"], theme.palette[PColor.BackgroundSecondary], theme.palette[PColor.AccentStateless], theme.palette[PColor.AccentStateless], theme.palette[PColor.BackgroundStateless], theme.palette[PColor.BordersPrimaryHover]), getInputTextColor(readOnly, disabled), error && errorMixin, autoSize && css([\"width:auto;height:auto;\"]));\n});\nvar Base = /*#__PURE__*/styled.textarea.attrs({\n className: generateClassNames(baseClassName, 'Base')\n}).withConfig({\n componentId: \"sc-1usif6k-1\"\n})(function (_ref2) {\n var palette = _ref2.theme.palette,\n _ref2$readOnly = _ref2.readOnly,\n readOnly = _ref2$readOnly === void 0 ? false : _ref2$readOnly,\n _ref2$size = _ref2.size,\n size = _ref2$size === void 0 ? InputSize.Md : _ref2$size;\n return css([\"display:block;width:100%;height:100%;color:inherit;outline:none;resize:none;min-width:0;margin:0;padding:0;border:0;background-color:transparent;outline:none;font-size:inherit;line-height:inherit;color:inherit;font-weight:inherit;font-family:inherit;box-sizing:border-box;flex:1;\", \" \", \";&::placeholder{color:\", \";}::-webkit-scrollbar{width:12px;}::-webkit-scrollbar-track{width:8px;}::-webkit-scrollbar-thumb{background:\", \";border-radius:8px;border:4px solid \", \";}\"], readOnly && \"padding-bottom: 0px;\", sizeTextAreaMixin[size], palette[PColor.TextPlaceholder], palette[PColor.BorderPrimaryStateless], palette[PColor.BackgroundStateless]);\n});\nvar ActionsButtonsWrapper = /*#__PURE__*/styled.div.attrs({\n className: generateClassNames(baseClassName, 'ActionsButtonsWrapper')\n}).withConfig({\n componentId: \"sc-1usif6k-2\"\n})(function (_ref3) {\n var _ref3$size = _ref3.size,\n size = _ref3$size === void 0 ? InputSize.Md : _ref3$size;\n return css([\"display:flex;align-items:center;width:100%;column-gap:12px;box-sizing:border-box;\", \";.SfxButton-Label{font-weight:500;}\"], sizeTextAreaMixin[size]);\n});\nvar CopyIcon = /*#__PURE__*/styled.span.attrs({\n className: generateClassNames(baseClassName, 'CopyIcon')\n}).withConfig({\n componentId: \"sc-1usif6k-3\"\n})(function (_ref4) {\n var palette = _ref4.theme.palette;\n return css([\"cursor:pointer;color:\", \";margin-left:auto;\"], palette[PColor.IconsPrimary]);\n});\nvar Styled = applyDisplayNames({\n Textarea: Textarea,\n CopyIcon: CopyIcon,\n Base: Base,\n ActionsButtonsWrapper: ActionsButtonsWrapper\n});\nexport default Styled;","import _extends from \"@babel/runtime/helpers/extends\";\nimport _defineProperty from \"@babel/runtime/helpers/defineProperty\";\nimport _slicedToArray from \"@babel/runtime/helpers/slicedToArray\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/objectWithoutProperties\";\nvar _excluded = [\"fullWidth\", \"size\", \"value\", \"readOnly\", \"disabled\", \"error\", \"cols\", \"rows\", \"copyTextMessage\", \"copySuccessIcon\", \"showActionButton\", \"showClearButton\", \"showCopyIcon\", \"disableActionButton\", \"isActionButtonLoading\", \"actionButtonLabel\", \"clearAllButtonLabel\", \"onClickActionButton\", \"onClear\", \"onChange\"];\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nimport React, { useState, useEffect, useRef } from 'react';\nimport PT from 'prop-types';\nimport CopyOutline from '@scaleflex/icons/copy-outline';\nimport { onClickByMouseDown } from '../../utils/functions/on-click-by-mouse-down';\nimport { intrinsicComponent, objectValues, useForkRef } from '../../utils/functions';\nimport { InputSize } from '../../utils/types';\nimport { handleCopyIcon } from '../input/input.utils';\nimport { getIconSize } from '../button/button.utils';\nimport InputStyled from '../input/input.styles';\nimport { Size } from '../menu-item/types';\nimport Button from '../button';\nimport Styled from './textarea.styles';\nvar Textarea = intrinsicComponent(function (_ref, ref) {\n var _inputRef$current;\n var fullWidth = _ref.fullWidth,\n size = _ref.size,\n value = _ref.value,\n readOnly = _ref.readOnly,\n disabled = _ref.disabled,\n error = _ref.error,\n cols = _ref.cols,\n rows = _ref.rows,\n _ref$copyTextMessage = _ref.copyTextMessage,\n copyTextMessage = _ref$copyTextMessage === void 0 ? '' : _ref$copyTextMessage,\n copySuccessIcon = _ref.copySuccessIcon,\n _ref$showActionButton = _ref.showActionButton,\n showActionButton = _ref$showActionButton === void 0 ? false : _ref$showActionButton,\n _ref$showClearButton = _ref.showClearButton,\n showClearButton = _ref$showClearButton === void 0 ? false : _ref$showClearButton,\n _ref$showCopyIcon = _ref.showCopyIcon,\n showCopyIcon = _ref$showCopyIcon === void 0 ? false : _ref$showCopyIcon,\n _ref$disableActionBut = _ref.disableActionButton,\n disableActionButton = _ref$disableActionBut === void 0 ? false : _ref$disableActionBut,\n _ref$isActionButtonLo = _ref.isActionButtonLoading,\n isActionButtonLoading = _ref$isActionButtonLo === void 0 ? false : _ref$isActionButtonLo,\n actionButtonLabel = _ref.actionButtonLabel,\n clearAllButtonLabel = _ref.clearAllButtonLabel,\n onClickActionButton = _ref.onClickActionButton,\n onClear = _ref.onClear,\n onChange = _ref.onChange,\n rest = _objectWithoutProperties(_ref, _excluded);\n var inputRef = useRef(null);\n var textareaRef = useForkRef(inputRef, ref);\n var _useState = useState(false),\n _useState2 = _slicedToArray(_useState, 2),\n isHovering = _useState2[0],\n setIsHovering = _useState2[1];\n var _useState3 = useState({}),\n _useState4 = _slicedToArray(_useState3, 2),\n overflowStyles = _useState4[0],\n setOverflowStyles = _useState4[1];\n var _useState5 = useState(false),\n _useState6 = _slicedToArray(_useState5, 2),\n showCopyMessage = _useState6[0],\n setShowCopyMessage = _useState6[1];\n var _useState7 = useState(value),\n _useState8 = _slicedToArray(_useState7, 2),\n inputValue = _useState8[0],\n setInputValue = _useState8[1];\n var actionButtonHandler = function actionButtonHandler(event) {\n if (onClickActionButton) {\n onClickActionButton(event);\n }\n };\n var clearAllHandler = function clearAllHandler(event) {\n setInputValue('');\n if (onClear) {\n onClear(event);\n }\n };\n var onChangeHandler = function onChangeHandler(event) {\n setInputValue(event.target.value);\n if (onChange) {\n onChange(event);\n }\n };\n var copyIconHandler = function copyIconHandler() {\n if (showCopyIcon) {\n handleCopyIcon(inputValue, setShowCopyMessage);\n }\n };\n useEffect(function () {\n var current = inputRef.current;\n if (current && current.scrollHeight > current.clientHeight) {\n setOverflowStyles({\n paddingRight: size === Size.Md ? '4px' : '0px'\n });\n }\n }, [(_inputRef$current = inputRef.current) === null || _inputRef$current === void 0 ? void 0 : _inputRef$current.scrollHeight, size]);\n useEffect(function () {\n setTimeout(function () {\n return setShowCopyMessage(false);\n }, 2000);\n }, [showCopyMessage]);\n useEffect(function () {\n setInputValue(value);\n }, [value]);\n var handleEntering = function handleEntering() {\n setTimeout(function () {\n setIsHovering(true);\n }, 150);\n };\n var handleLeaving = function handleLeaving() {\n setTimeout(function () {\n setIsHovering(false);\n }, 200);\n };\n var renderCopyText = function renderCopyText() {\n return /*#__PURE__*/React.createElement(InputStyled.NotificationBox, {\n size: size,\n isTextarea: true\n }, /*#__PURE__*/React.createElement(InputStyled.NotificationIcon, null, copySuccessIcon), /*#__PURE__*/React.createElement(InputStyled.NotificationText, null, copyTextMessage));\n };\n return /*#__PURE__*/React.createElement(Styled.Textarea, {\n size: size,\n value: inputValue,\n onMouseEnter: handleEntering,\n onMouseLeave: handleLeaving,\n readOnly: readOnly,\n disabled: disabled,\n fullWidth: Boolean(fullWidth),\n error: error,\n autoSize: Boolean(cols) || Boolean(rows)\n }, /*#__PURE__*/React.createElement(Styled.Base, _extends({}, rest, {\n value: inputValue,\n ref: textareaRef,\n size: size,\n onChange: onChangeHandler,\n readOnly: readOnly,\n disabled: disabled,\n style: _objectSpread({}, overflowStyles)\n })), (showActionButton || showClearButton || showCopyIcon) && /*#__PURE__*/React.createElement(Styled.ActionsButtonsWrapper, {\n size: size\n }, showActionButton && /*#__PURE__*/React.createElement(Button, {\n color: \"link-primary\",\n size: \"sm\",\n disabled: disableActionButton,\n loading: isActionButtonLoading,\n onMouseDown: function onMouseDown(event) {\n return onClickByMouseDown(event, actionButtonHandler);\n }\n }, actionButtonLabel), showClearButton && /*#__PURE__*/React.createElement(Button, {\n color: \"link-secondary\",\n size: \"sm\",\n onMouseDown: function onMouseDown(event) {\n return onClickByMouseDown(event, clearAllHandler);\n }\n }, clearAllButtonLabel), showCopyIcon && /*#__PURE__*/React.createElement(Styled.CopyIcon, {\n showCopyIcon: isHovering && inputValue.length > 0,\n size: size,\n onMouseDown: function onMouseDown(event) {\n return onClickByMouseDown(event, copyIconHandler);\n }\n }, /*#__PURE__*/React.createElement(CopyOutline, {\n size: getIconSize(size)\n }), showCopyMessage && renderCopyText())));\n});\nTextarea.defaultProps = {\n size: InputSize.Md,\n error: false,\n fullWidth: false,\n readOnly: false,\n disabled: false,\n disableActionButton: false,\n isActionButtonLoading: false,\n actionButtonLabel: 'Action',\n clearAllButtonLabel: 'Clear all'\n};\nexport var propTypes = {\n error: PT.bool,\n readOnly: PT.bool,\n disabled: PT.bool,\n fullWidth: PT.bool,\n disableActionButton: PT.bool,\n isActionButtonLoading: PT.bool,\n value: PT.any,\n size: PT.oneOf(objectValues(InputSize)),\n copySuccessIcon: PT.oneOfType([PT.node, PT.func]),\n copyTextMessage: PT.string,\n cols: PT.number,\n rows: PT.number,\n showActionButton: PT.bool,\n showClearButton: PT.bool,\n showCopyIcon: PT.bool,\n actionButtonLabel: PT.string,\n clearAllButtonLabel: PT.string,\n onClickActionButton: PT.func,\n onClear: PT.func\n};\nTextarea.propTypes = propTypes;\nexport default Textarea;","export var Type = {\n Input: 'input',\n Textarea: 'textarea'\n};","import styled from 'styled-components';\nimport { generateClassNames, applyDisplayNames } from '../../utils/functions';\nimport StyledLabel from '../label/label.styles';\nimport StyledFormHint from '../form-hint/form-hint.styles';\nvar baseClassName = 'InputGroup';\nvar InputGroup = /*#__PURE__*/styled.div.attrs({\n className: generateClassNames(baseClassName, 'root')\n}).withConfig({\n componentId: \"sc-zhtjwh-0\"\n})([\"\", \"{margin-top:4px;}\", \"{margin-bottom:4px;}\"], StyledFormHint.FormHint, StyledLabel.Label);\nvar Styled = applyDisplayNames({\n InputGroup: InputGroup\n});\nexport default Styled;","import _defineProperty from \"@babel/runtime/helpers/defineProperty\";\nimport _extends from \"@babel/runtime/helpers/extends\";\nimport _typeof from \"@babel/runtime/helpers/typeof\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/objectWithoutProperties\";\nvar _excluded = [\"children\", \"type\", \"error\", \"label\", \"hint\", \"LabelProps\", \"InputProps\", \"inputProps\", \"inputRef\", \"TextareaProps\", \"readOnly\", \"disabled\", \"size\", \"value\"];\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nimport React from 'react';\nimport PT from 'prop-types';\nimport { intrinsicComponent, objectValues } from '../../utils/functions';\nimport Label from '../label';\nimport { propTypes as labelPropTypes } from '../label/label.component';\nimport Input from '../input';\nimport { propTypes as inputPropTypes } from '../input/input.component';\nimport { InputSize } from '../../utils/types';\nimport Textarea from '../textarea';\nimport { propTypes as textareaPropTypes } from '../textarea/textarea.component';\nimport FormHint from '../form-hint';\nimport { Type } from './types';\nimport Styled from './input-group.styles';\nvar InputGroup = intrinsicComponent(function (_ref, ref) {\n var children = _ref.children,\n type = _ref.type,\n error = _ref.error,\n label = _ref.label,\n hint = _ref.hint,\n LabelPropsData = _ref.LabelProps,\n InputPropsData = _ref.InputProps,\n inputProps = _ref.inputProps,\n inputRef = _ref.inputRef,\n TextareaPropsData = _ref.TextareaProps,\n readOnly = _ref.readOnly,\n disabled = _ref.disabled,\n size = _ref.size,\n value = _ref.value,\n rest = _objectWithoutProperties(_ref, _excluded);\n var renderLabel = function renderLabel() {\n if (label) {\n if (typeof label === 'function') {\n return label({\n error: error\n });\n }\n if (_typeof(label) === 'object') {\n return label;\n }\n return /*#__PURE__*/React.createElement(Label, _extends({\n size: size,\n error: error,\n disabled: disabled\n }, LabelPropsData || {}), label);\n }\n return null;\n };\n var renderField = function renderField() {\n var fieldProps = _objectSpread({\n value: value,\n readOnly: readOnly,\n disabled: disabled,\n size: size,\n error: error\n }, rest);\n if (type === Type.Input) {\n return /*#__PURE__*/React.createElement(Input, _extends({}, fieldProps, InputPropsData || {}, inputProps, {\n ref: (inputRef === null || inputRef === void 0 ? void 0 : inputRef.ref) || inputRef,\n readOnly: readOnly,\n disabled: disabled\n }));\n }\n if (type === Type.Textarea) {\n return /*#__PURE__*/React.createElement(Textarea, _extends({}, fieldProps, TextareaPropsData || {}));\n }\n return null;\n };\n var renderHint = function renderHint() {\n if (hint) {\n if (typeof hint === 'function') {\n return hint({\n error: error\n });\n }\n if (_typeof(hint) === 'object') {\n return hint;\n }\n return /*#__PURE__*/React.createElement(FormHint, {\n size: size,\n error: error,\n disabled: disabled\n }, hint);\n }\n return null;\n };\n return /*#__PURE__*/React.createElement(Styled.InputGroup, {\n ref: ref\n }, renderLabel(), renderField(), renderHint());\n});\nInputGroup.defaultProps = {\n type: Type.Input,\n error: false,\n readOnly: false\n};\nInputGroup.propTypes = {\n type: PT.oneOf(objectValues(Type)),\n size: PT.oneOf(objectValues(InputSize)),\n label: PT.node,\n hint: PT.node,\n error: PT.bool,\n value: PT.any,\n LabelProps: PT.exact(labelPropTypes),\n InputProps: PT.exact(inputPropTypes),\n inputProps: PT.object,\n inputRef: PT.oneOfType([PT.func, PT.object]),\n TextareaProps: PT.exact(textareaPropTypes),\n readOnly: PT.bool,\n disabled: PT.bool\n};\nexport default InputGroup;","export var Size = {\n Xs: 'xs',\n Sm: 'sm',\n Md: 'md',\n Lg: 'lg',\n Xl: 'xl'\n};","import * as React from 'react';\nvar ModalMenuContext = /*#__PURE__*/React.createContext({\n modalOpened: false\n});\nif (process.env.NODE_ENV !== 'production') {\n ModalMenuContext.displayName = 'ModalMenuContext';\n}\nexport default ModalMenuContext;","import _defineProperty from \"@babel/runtime/helpers/defineProperty\";\nimport { css } from 'styled-components';\nimport { Size } from './types';\nexport var modalSizeMixin = _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({}, Size.Xs, css([\"max-width:300px;\"])), Size.Sm, css([\"max-width:600px;\"])), Size.Md, css([\"max-width:960px;\"])), Size.Lg, css([\"max-width:1280px;\"])), Size.Xl, css([\"max-width:1920px;\"]));","import styled, { css } from 'styled-components';\nimport { generateClassNames, applyDisplayNames } from '../../utils/functions';\nimport { Color as PColor } from '../../utils/types/palette';\nimport { BorderRadiusSize as BRSize } from '../../utils/types/shape';\nimport { modalSizeMixin } from './modal.mixin';\nimport { Size } from './types';\nvar baseClassName = 'Modal';\nvar Wrapper = /*#__PURE__*/styled.div.attrs({\n className: generateClassNames(baseClassName, 'Wrapper')\n}).withConfig({\n componentId: \"sc-80m07l-0\"\n})(function (_ref) {\n var open = _ref.open;\n return css([\"position:fixed;right:0px;bottom:0px;top:0px;left:0px;z-index:1200;visibility:\", \";\"], open ? 'visible' : 'hidden');\n});\nvar Overlay = /*#__PURE__*/styled.div.attrs({\n className: generateClassNames(baseClassName, 'Overlay')\n}).withConfig({\n componentId: \"sc-80m07l-1\"\n})(function (_ref2) {\n var open = _ref2.open;\n return css([\"position:fixed;right:0px;bottom:0px;top:0px;left:0px;background-color:rgba(0,0,0,0.5);z-index:-1;transition:opacity 251ms cubic-bezier(0.4,0,0.2,1) 0ms;opacity:\", \";\"], open ? '1' : '0');\n});\nvar Container = /*#__PURE__*/styled.div.attrs({\n className: generateClassNames(baseClassName, 'Container')\n}).withConfig({\n componentId: \"sc-80m07l-2\"\n})(function (_ref3) {\n var theme = _ref3.theme,\n _ref3$open = _ref3.open,\n open = _ref3$open === void 0 ? false : _ref3$open,\n _ref3$fullWidth = _ref3.fullWidth,\n fullWidth = _ref3$fullWidth === void 0 ? false : _ref3$fullWidth,\n _ref3$maxWidth = _ref3.maxWidth,\n maxWidth = _ref3$maxWidth === void 0 ? Size.Sm : _ref3$maxWidth;\n return css([\"position:absolute;overflow-x:hidden;overflow-y:auto;transition:opacity 251ms cubic-bezier(0.4,0,0.2,1) 0ms,transform 167ms cubic-bezier(0.4,0,0.2,1) 0ms;outline:0;border-radius:\", \";background-color:\", \";box-shadow:0px 2px 4px \", \";visibility:\", \";opacity:\", \";display:flex;max-height:calc(100% - 64px);flex-direction:column;\", \" \", \" top:50%;left:50%;transform:translate(-50%,-50%);\"], theme.shape.borderRadius[BRSize.Lg], theme.palette[PColor.BackgroundSecondary], theme.palette[PColor.LightShadow], open ? 'visible' : 'hidden', open ? '1' : '0', fullWidth && css([\"width:calc(100% - 64px);\"]), modalSizeMixin[maxWidth]);\n});\nvar Modal = /*#__PURE__*/styled.div.attrs({\n className: generateClassNames(baseClassName, 'root')\n}).withConfig({\n componentId: \"sc-80m07l-3\"\n})(function () {\n return css([\"position:relative;padding-top:8px;padding-bottom:8px;margin:0;padding:0;outline:0;display:flex;flex-direction:column;\"]);\n});\nvar Styled = applyDisplayNames({\n Modal: Modal,\n Wrapper: Wrapper,\n Overlay: Overlay,\n Container: Container\n});\nexport default Styled;","import _extends from \"@babel/runtime/helpers/extends\";\nimport _defineProperty from \"@babel/runtime/helpers/defineProperty\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/objectWithoutProperties\";\nvar _excluded = [\"children\", \"open\", \"onClose\", \"maxWidth\", \"fullWidth\", \"modalStyles\", \"hideOverlay\", \"disableOverlayClick\"];\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nimport React, { useEffect, isValidElement } from 'react';\nimport { createPortal } from 'react-dom';\nimport PT from 'prop-types';\nimport { intrinsicComponent, objectValues } from '../../utils/functions';\nimport { Size } from './types';\nimport ModalMenuContext from './modal-menu-context';\nimport Styled from './modal.styles';\nvar isValidSingleFragmentChildren = function isValidSingleFragmentChildren(children) {\n return children && /*#__PURE__*/isValidElement(children) && React.Children.count(children) === 1 && children.type === React.Fragment;\n};\nvar Modal = intrinsicComponent(function (_ref, ref) {\n var _children = _ref.children,\n open = _ref.open,\n onClose = _ref.onClose,\n maxWidth = _ref.maxWidth,\n fullWidth = _ref.fullWidth,\n modalStyles = _ref.modalStyles,\n hideOverlay = _ref.hideOverlay,\n disableOverlayClick = _ref.disableOverlayClick,\n rest = _objectWithoutProperties(_ref, _excluded);\n var children = isValidSingleFragmentChildren(_children) ? _children.props.children : _children;\n\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n var target = document.querySelector('body');\n useEffect(function () {\n if (open) {\n document.body.classList.add('Modal-open');\n } else {\n document.body.classList.remove('Modal-open');\n }\n return function () {\n document.body.classList.remove('Modal-open');\n };\n }, [open]);\n var handleClose = function handleClose() {\n if (typeof onClose === 'function') {\n onClose();\n }\n };\n useEffect(function () {\n var keyListener = function keyListener(ev) {\n if (ev.key === 'Escape') {\n handleClose();\n }\n };\n document.addEventListener('keydown', keyListener);\n return function () {\n return document.removeEventListener('keydown', keyListener);\n };\n });\n var render = function render() {\n return /*#__PURE__*/React.createElement(ModalMenuContext.Provider, {\n value: {\n modalOpened: Boolean(open)\n }\n }, /*#__PURE__*/React.createElement(Styled.Wrapper, {\n style: _objectSpread({}, modalStyles),\n open: Boolean(open),\n ref: ref\n }, !hideOverlay && /*#__PURE__*/React.createElement(Styled.Overlay, {\n onClick: function onClick() {\n return disableOverlayClick ? null : handleClose();\n },\n open: Boolean(open)\n }), /*#__PURE__*/React.createElement(Styled.Container, _extends({}, rest, {\n maxWidth: maxWidth,\n fullWidth: fullWidth,\n open: Boolean(open)\n }), /*#__PURE__*/React.createElement(Styled.Modal, null, React.Children.map(children, function (child) {\n if ( /*#__PURE__*/isValidElement(child) && child.type.displayName === 'ModalTitle') {\n return /*#__PURE__*/React.cloneElement(child, _objectSpread({\n onClose: handleClose\n }, child.props || {}));\n }\n return child;\n })))));\n };\n return /*#__PURE__*/createPortal(render(), target);\n});\nexport var defaultProps = {\n open: false,\n fullWidth: false,\n disableOverlayClick: false,\n hideOverlay: false,\n maxWidth: Size.Xs\n};\nModal.defaultProps = defaultProps;\nexport var propTypes = {\n onClose: PT.func,\n modalStyles: PT.object,\n disableOverlayClick: PT.bool,\n hideOverlay: PT.bool,\n children: PT.node.isRequired,\n maxWidth: PT.oneOf(objectValues(Size)),\n open: PT.bool,\n fullWidth: PT.bool\n};\nModal.propTypes = propTypes;\nexport default Modal;","export var Align = {\n Left: 'left',\n Center: 'center',\n Right: 'right'\n};","import styled, { css } from 'styled-components';\nimport { generateClassNames, applyDisplayNames } from '../../utils/functions';\nimport { Align } from './types';\nvar baseClassName = 'ModalActions';\nvar ModalActions = /*#__PURE__*/styled.div.attrs({\n className: generateClassNames(baseClassName, 'root')\n}).withConfig({\n componentId: \"sc-1wg6u00-0\"\n})(function (_ref) {\n var _ref$align = _ref.align,\n align = _ref$align === void 0 ? Align.Center : _ref$align;\n return css([\"position:relative;display:flex;align-items:center;padding:24px;justify-content:\", \";gap:12px;\"], align === Align.Right ? 'flex-end' : align);\n});\nvar Styled = applyDisplayNames({\n ModalActions: ModalActions\n});\nexport default Styled;","import _extends from \"@babel/runtime/helpers/extends\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/objectWithoutProperties\";\nvar _excluded = [\"children\"];\nimport React from 'react';\nimport PT from 'prop-types';\nimport { intrinsicComponent, objectValues } from '../../utils/functions';\nimport Styled from './modal-actions.styles';\nimport { Align } from './types';\nvar ModalActions = intrinsicComponent(function (_ref, ref) {\n var children = _ref.children,\n rest = _objectWithoutProperties(_ref, _excluded);\n return /*#__PURE__*/React.createElement(Styled.ModalActions, _extends({}, rest, {\n ref: ref\n }), children);\n});\nModalActions.defaultProps = {\n align: Align.Center\n};\nModalActions.propTypes = {\n children: PT.node.isRequired,\n align: PT.oneOf(objectValues(Align))\n};\nModalActions.displayName = 'ModalActions';\nexport default ModalActions;","import styled, { css } from 'styled-components';\nimport { generateClassNames, applyDisplayNames } from '../../utils/functions';\nvar baseClassName = 'ModalContent';\nvar ModalContent = /*#__PURE__*/styled.div.attrs({\n className: generateClassNames(baseClassName, 'root')\n}).withConfig({\n componentId: \"sc-1ng1w0v-0\"\n})(function () {\n return css([\"position:relative;padding:12px 24px 0px;\"]);\n});\nvar Styled = applyDisplayNames({\n ModalContent: ModalContent\n});\nexport default Styled;","import _extends from \"@babel/runtime/helpers/extends\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/objectWithoutProperties\";\nvar _excluded = [\"children\"];\nimport React from 'react';\nimport PT from 'prop-types';\nimport { intrinsicComponent } from '../../utils/functions';\nimport Styled from './modal-content.styles';\nvar ModalContent = intrinsicComponent(function (_ref, ref) {\n var children = _ref.children,\n rest = _objectWithoutProperties(_ref, _excluded);\n return /*#__PURE__*/React.createElement(Styled.ModalContent, _extends({}, rest, {\n ref: ref\n }), children);\n});\nModalContent.defaultProps = {};\nModalContent.propTypes = {\n children: PT.node.isRequired\n};\nModalContent.displayName = 'ModalContent';\nexport default ModalContent;","export var Variant = {\n Default: 'default',\n WithIcon: 'with-icon'\n};","import styled, { css } from 'styled-components';\nimport { generateClassNames, applyDisplayNames } from '../../utils/functions';\nimport { Color as PColor } from '../../utils/types/palette';\nimport { BorderRadiusSize as BRSize } from '../../utils/types/shape';\nimport { Variant } from './types';\nvar baseClassName = 'ModalTitle';\nvar Icon = /*#__PURE__*/styled.div.attrs({\n className: generateClassNames(baseClassName, 'Icon')\n}).withConfig({\n componentId: \"sc-l3tf49-0\"\n})(function (_ref) {\n var palette = _ref.theme.palette;\n return css([\"display:flex;margin-bottom:8px;padding:14.5px;border-radius:50%;background:\", \";color:\", \";\"], palette[PColor.Accent_1_2_Opacity], palette[PColor.AccentStateless]);\n});\nvar LabelPrimary = /*#__PURE__*/styled.div.attrs({\n className: generateClassNames(baseClassName, 'LabelPrimary')\n}).withConfig({\n componentId: \"sc-l3tf49-1\"\n})(function (_ref2) {\n var _ref2$variant = _ref2.variant,\n variant = _ref2$variant === void 0 ? Variant.Default : _ref2$variant;\n return css([\"font-size:18px;line-height:27px;font-weight:\", \";\"], variant === Variant.Default ? 400 : 500);\n});\nvar LabelSecondary = /*#__PURE__*/styled.div.attrs({\n className: generateClassNames(baseClassName, 'LabelSecondary')\n}).withConfig({\n componentId: \"sc-l3tf49-2\"\n})([\"font-size:12px;line-height:14px;margin-top:4px;\"]);\nvar Close = /*#__PURE__*/styled.div.attrs({\n className: generateClassNames(baseClassName, 'Close')\n}).withConfig({\n componentId: \"sc-l3tf49-3\"\n})(function (_ref3) {\n var _ref3$variant = _ref3.variant,\n variant = _ref3$variant === void 0 ? Variant.Default : _ref3$variant,\n palette = _ref3.theme.palette;\n return css([\"position:absolute;display:flex;top:\", \"px;right:\", \"px;color:\", \";&:hover{color:\", \";}cursor:pointer;\"], variant === Variant.WithIcon ? 2 : 8, variant === Variant.WithIcon ? 2 : 8, palette[PColor.IconsSecondary], palette[PColor.AccentPrimary]);\n});\nvar ModalTitle = /*#__PURE__*/styled.div.attrs({\n className: generateClassNames(baseClassName, 'root')\n}).withConfig({\n componentId: \"sc-l3tf49-4\"\n})(function (_ref4) {\n var _ref4$variant = _ref4.variant,\n variant = _ref4$variant === void 0 ? Variant.Default : _ref4$variant,\n _ref4$theme = _ref4.theme,\n palette = _ref4$theme.palette,\n borderRadius = _ref4$theme.shape.borderRadius;\n return css([\"position:relative;color:\", \";border-radius:\", \" \", \" 0px 0px;\", \" \", \" \", \"\"], palette[PColor.TextPrimary], borderRadius[BRSize.Md], borderRadius[BRSize.Md], function () {\n var paddingY = variant === Variant.WithIcon ? 26 : 14;\n var paddingX = variant === Variant.WithIcon ? 12 : 14;\n var paddingLeft = 18;\n var paddingRight = variant === Variant.WithIcon ? paddingLeft : 40;\n return css([\"padding:\", \"px \", \"px \", \"px \", \"px;\"], paddingY, paddingRight, paddingX, paddingLeft);\n }, variant === Variant.Default && css([\"background:\", \";border-bottom:1px solid \", \";\"], palette[PColor.BackgroundPrimary], palette[PColor.BordersSecondary]), variant === Variant.WithIcon && css([\"display:flex;align-items:center;flex-direction:column;\"]));\n});\nvar Styled = applyDisplayNames({\n ModalTitle: ModalTitle,\n LabelPrimary: LabelPrimary,\n LabelSecondary: LabelSecondary,\n Close: Close,\n Icon: Icon\n});\nexport default Styled;","import _extends from \"@babel/runtime/helpers/extends\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/objectWithoutProperties\";\nvar _excluded = [\"secondary\", \"onClose\", \"primaryLabelStyles\"];\nimport React from 'react';\nimport PT from 'prop-types';\nimport { intrinsicComponent, objectValues } from '../../utils/functions';\nimport CrossButton from '../cross-button';\nimport Styled from './modal-title.styles';\nimport { Variant } from './types';\nvar ModalTitle = intrinsicComponent(function (_ref, ref) {\n var secondary = _ref.secondary,\n onClose = _ref.onClose,\n primaryLabelStyles = _ref.primaryLabelStyles,\n rest = _objectWithoutProperties(_ref, _excluded);\n return /*#__PURE__*/React.createElement(Styled.ModalTitle, _extends({}, rest, {\n ref: ref\n }), rest.icon && /*#__PURE__*/React.createElement(Styled.Icon, {\n iconShadow: Boolean(rest.iconShadow)\n }, rest.icon), /*#__PURE__*/React.createElement(Styled.LabelPrimary, {\n variant: rest.variant,\n style: primaryLabelStyles\n }, rest.primary), rest.variant === Variant.WithIcon && secondary && /*#__PURE__*/React.createElement(Styled.LabelSecondary, null, secondary), /*#__PURE__*/React.createElement(Styled.Close, {\n variant: rest.variant\n }, /*#__PURE__*/React.createElement(CrossButton, {\n size: \"lg\",\n onClick: onClose\n })));\n});\nModalTitle.defaultProps = {\n iconShadow: true,\n variant: Variant.Default\n};\nModalTitle.propTypes = {\n primary: PT.node.isRequired,\n secondary: PT.node,\n icon: PT.node,\n iconShadow: PT.bool,\n onClose: PT.func,\n primaryLabelStyles: PT.object,\n variant: PT.oneOf(objectValues(Variant))\n};\nModalTitle.displayName = 'ModalTitle';\nexport default ModalTitle;","export var Status = {\n Success: 'success',\n Info: 'info',\n Error: 'error',\n Warning: 'warning'\n};","import styled, { css } from 'styled-components';\nimport { generateClassNames, applyDisplayNames } from '../../utils/functions';\nvar baseClassName = 'PopupStatus';\nvar PopupStatus = /*#__PURE__*/styled.span.attrs({\n className: generateClassNames(baseClassName, 'root')\n}).withConfig({\n componentId: \"sc-qash56-0\"\n})(function () {\n return css([\"display:flex;\"]);\n});\nvar Styled = applyDisplayNames({\n PopupStatus: PopupStatus\n});\nexport default Styled;","import _extends from \"@babel/runtime/helpers/extends\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/objectWithoutProperties\";\nvar _excluded = [\"status\", \"notificationBackground\"];\nimport React from 'react';\nimport PT from 'prop-types';\nimport { Success, About, Error, Warning, InfoOutline, WarningOutline, ErrorOutline } from '@scaleflex/icons';\nimport { lightPalette } from '@scaleflex/ui/theme/roots/palette';\nimport { Color } from '@scaleflex/ui/utils/types/palette';\nimport { intrinsicComponent, objectValues } from '../../utils/functions';\nimport { Status } from './types';\nimport Styled from './popup-status.styles';\nvar getPopupStatusIcon = function getPopupStatusIcon(status, notificationBackground) {\n switch (status) {\n case Status.Warning:\n return notificationBackground ? /*#__PURE__*/React.createElement(Warning, {\n color: lightPalette[Color.Warning],\n size: 20\n }) : /*#__PURE__*/React.createElement(WarningOutline, {\n color: lightPalette[Color.Warning],\n size: 12\n });\n case Status.Error:\n return notificationBackground ? /*#__PURE__*/React.createElement(Error, {\n color: lightPalette[Color.Error],\n size: 20\n }) : /*#__PURE__*/React.createElement(ErrorOutline, {\n color: lightPalette[Color.Error],\n size: 12\n });\n case Status.Info:\n return notificationBackground ? /*#__PURE__*/React.createElement(About, {\n color: lightPalette[Color.Info],\n size: 20\n }) : /*#__PURE__*/React.createElement(InfoOutline, {\n color: lightPalette[Color.Info],\n size: 12\n });\n case Status.Success:\n default:\n return /*#__PURE__*/React.createElement(Success, {\n color: lightPalette[Color.Success],\n size: 20\n });\n }\n};\nvar PopupStatus = intrinsicComponent(function (_ref, ref) {\n var status = _ref.status,\n _ref$notificationBack = _ref.notificationBackground,\n notificationBackground = _ref$notificationBack === void 0 ? true : _ref$notificationBack,\n rest = _objectWithoutProperties(_ref, _excluded);\n return /*#__PURE__*/React.createElement(Styled.PopupStatus, _extends({\n status: status\n }, rest, {\n ref: ref\n }), getPopupStatusIcon(status, notificationBackground));\n});\nexport var defaultProps = {\n status: Status.Success\n};\nPopupStatus.defaultProps = defaultProps;\nexport var propTypes = {\n status: PT.oneOf(objectValues(Status))\n};\nPopupStatus.propTypes = propTypes;\nexport default PopupStatus;","import _defineProperty from \"@babel/runtime/helpers/defineProperty\";\nimport { css } from 'styled-components';\nimport { Color as PaletteColor } from '@scaleflex/ui/utils/types/palette';\nimport { Status } from '../popup-status/types';\nexport var popupContentMixin = _defineProperty(_defineProperty(_defineProperty(_defineProperty({}, Status.Success, function (_ref) {\n var palette = _ref.theme.palette;\n return css([\"background-color:\", \";\"], palette[PaletteColor.BackgroundGreen]);\n}), Status.Info, function (_ref2) {\n var palette = _ref2.theme.palette;\n return css([\"background-color:\", \";\"], palette[PaletteColor.BackgroundBlue]);\n}), Status.Error, function (_ref3) {\n var palette = _ref3.theme.palette;\n return css([\"background-color:\", \";\"], palette[PaletteColor.BackgroundRed]);\n}), Status.Warning, function (_ref4) {\n var palette = _ref4.theme.palette;\n return css([\"background-color:\", \";\"], palette[PaletteColor.BackgroundOrange]);\n});","import styled, { css } from 'styled-components';\nimport { generateClassNames, applyDisplayNames } from '../../utils/functions';\nimport { Color as PColor } from '../../utils/types/palette';\nimport { FontVariant } from '../../utils/types/typography';\nimport { popupContentMixin } from './popup-content.mixin';\nvar baseClassName = 'PopupContent';\nvar LabelWrapper = /*#__PURE__*/styled.span.attrs({\n className: generateClassNames(baseClassName, 'LabelWrapper')\n}).withConfig({\n componentId: \"sc-njbmnt-0\"\n})(function (_ref) {\n var palette = _ref.theme.palette;\n return css([\"display:flex;flex-grow:1;margin-left:44px;margin-right:28px;padding:16px;padding-right:0;overflow:hidden;background:\", \";\"], palette[PColor.ButtonPrimaryText]);\n});\nvar Label = /*#__PURE__*/styled.span.attrs({\n className: generateClassNames(baseClassName, 'Label')\n}).withConfig({\n componentId: \"sc-njbmnt-1\"\n})(function (_ref2) {\n var _ref2$theme = _ref2.theme,\n palette = _ref2$theme.palette,\n font = _ref2$theme.typography.font;\n return css([\"max-width:100%;overflow:hidden;text-overflow:ellipsis;color:\", \";\", \"\"], palette[PColor.TextPrimary], font[FontVariant.TextSmallUp]);\n});\nvar PopupContent = /*#__PURE__*/styled.div.attrs({\n className: generateClassNames(baseClassName, 'PopupContent')\n}).withConfig({\n componentId: \"sc-njbmnt-2\"\n})(function (_ref3) {\n var theme = _ref3.theme;\n return css([\"position:relative;display:flex;align-items:center;width:360px;border-radius:4px;box-shadow:0px 2px 6px \", \";\"], theme.palette[PColor.LargeShadow]);\n});\nvar CloseWrapper = /*#__PURE__*/styled.div.attrs({\n className: generateClassNames(baseClassName, 'PopupContent')\n}).withConfig({\n componentId: \"sc-njbmnt-3\"\n})(function (_ref4) {\n var theme = _ref4.theme;\n return css([\"position:absolute;top:0;right:0;display:flex;justify-content:center;align-items:flex-start;box-sizing:border-box;padding:2px;height:fit-content;cursor:pointer;background:\", \";border-radius:0 4px 4px 0;height:100%;\"], theme.palette[PColor.BackgroundStateless]);\n});\nvar PopupStatus = /*#__PURE__*/styled.div.attrs({\n className: generateClassNames(baseClassName, 'PopupStatus')\n}).withConfig({\n componentId: \"sc-njbmnt-4\"\n})(function (_ref5) {\n var _ref5$status = _ref5.status,\n status = _ref5$status === void 0 ? 'success' : _ref5$status;\n return css([\"position:absolute;display:flex;left:0;z-index:1;height:100%;min-width:44px;align-items:center;justify-content:center;box-sizing:border-box;border-radius:4px 0 0 4px;\", \"\"], popupContentMixin[status]);\n});\nvar Styled = applyDisplayNames({\n PopupContent: PopupContent,\n PopupStatus: PopupStatus,\n LabelWrapper: LabelWrapper,\n CloseWrapper: CloseWrapper,\n Label: Label\n});\nexport default Styled;","import _defineProperty from \"@babel/runtime/helpers/defineProperty\";\nimport _extends from \"@babel/runtime/helpers/extends\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/objectWithoutProperties\";\nvar _excluded = [\"onClose\", \"message\", \"status\"];\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nimport React from 'react';\nimport PT from 'prop-types';\nimport { intrinsicComponent } from '../../utils/functions';\nimport PopupStatus from '../popup-status';\nimport CrossButton from '../cross-button/cross-button.component';\nimport { defaultProps as popupStatusDefaultProps, propTypes as popupStatusPropTypes } from '../popup-status/popup-status.component';\nimport Styled from './popup-content.styles';\nvar PopupContent = intrinsicComponent(function (_ref, ref) {\n var onClose = _ref.onClose,\n message = _ref.message,\n status = _ref.status,\n rest = _objectWithoutProperties(_ref, _excluded);\n return /*#__PURE__*/React.createElement(Styled.PopupContent, _extends({}, rest, {\n ref: ref\n }), /*#__PURE__*/React.createElement(Styled.PopupStatus, _extends({\n status: status,\n message: message\n }, rest), /*#__PURE__*/React.createElement(PopupStatus, {\n status: status\n })), /*#__PURE__*/React.createElement(Styled.LabelWrapper, null, /*#__PURE__*/React.createElement(Styled.Label, null, message)), /*#__PURE__*/React.createElement(Styled.CloseWrapper, null, /*#__PURE__*/React.createElement(CrossButton, {\n size: \"sm\",\n onClick: onClose\n })));\n});\nexport var defaultProps = _objectSpread({}, popupStatusDefaultProps);\nPopupContent.defaultProps = defaultProps;\nexport var propTypes = _objectSpread(_objectSpread({}, popupStatusPropTypes), {}, {\n message: PT.node.isRequired,\n onClose: PT.func\n});\nPopupContent.propTypes = propTypes;\nexport default PopupContent;","export var Horizontal = {\n Center: 'center',\n Left: 'left',\n Right: 'right'\n};","export var Vertical = {\n Top: 'top',\n Bottom: 'bottom'\n};","import _defineProperty from \"@babel/runtime/helpers/defineProperty\";\nimport { css } from 'styled-components';\n// import type { WithTheme } from '../../theme/entity';\n// import { Color as PaletteColor } from '../../utils/types/palette';\nimport { Horizontal, Vertical } from './types';\nexport var positionHorizontalMixin = _defineProperty(_defineProperty(_defineProperty({}, Horizontal.Left, css([\"left:25px;right:auto;\"])), Horizontal.Center, css([\"left:50%;right:auto;transform:translateX(-50%);\"])), Horizontal.Right, css([\"left:auto;right:25px;\"]));\nexport var positionVerticalMixin = _defineProperty(_defineProperty({}, Vertical.Top, css([\"top:25px;bottom:auto;\"])), Vertical.Bottom, css([\"top:auto;bottom:25px;\"]));\n\n// export const errorMixin = ({ theme: { palette } }: WithTheme) => css`\n// background: ${palette[PaletteColor.BackgroundSecondary]} !important;\n// border: 1px solid ${palette[PaletteColor.Error]} !important;\n// `;","import styled, { css } from 'styled-components';\nimport { generateClassNames, applyDisplayNames } from '../../utils/functions';\n// import type { WithTheme } from '../../theme/entity';\n// import { Color as PColor } from '../../utils/types/palette';\n// import { FontVariant } from '../../utils/types/typography';\n// import { BorderRadiusSize as BRSize } from '../../utils/types/shape';\n\nimport { positionHorizontalMixin, positionVerticalMixin } from './popup.mixin';\nimport { Horizontal, Vertical } from './types';\nvar baseClassName = 'Popup';\nvar Popup = /*#__PURE__*/styled.div.attrs({\n className: generateClassNames(baseClassName, 'root')\n}).withConfig({\n componentId: \"sc-jmtjri-0\"\n})(function (_ref) {\n var anchorOrigin = _ref.anchorOrigin;\n return css([\"position:fixed;display:flex;align-items:center;justify-content:center;z-index:1400;\", \" \", \"\"], positionHorizontalMixin[(anchorOrigin === null || anchorOrigin === void 0 ? void 0 : anchorOrigin.horizontal) || Horizontal.Left], positionVerticalMixin[(anchorOrigin === null || anchorOrigin === void 0 ? void 0 : anchorOrigin.vertical) || Vertical.Bottom]);\n});\nvar Styled = applyDisplayNames({\n Popup: Popup\n});\nexport default Styled;","import _defineProperty from \"@babel/runtime/helpers/defineProperty\";\nimport _extends from \"@babel/runtime/helpers/extends\";\nimport _slicedToArray from \"@babel/runtime/helpers/slicedToArray\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/objectWithoutProperties\";\nvar _excluded = [\"autoHideDuration\", \"anchorOrigin\", \"open\", \"onClose\"];\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nimport React, { useEffect, useState } from 'react';\nimport { createPortal } from 'react-dom';\nimport PT from 'prop-types';\nimport { intrinsicComponent, objectValues, generateClassNames } from '../../utils/functions';\nimport usePortal from '../../hooks/use-portal';\nimport PopupContent, { defaultProps as cDefaultProps, propTypes as cPropTypes } from '../popup-content/popup-content.component';\nimport { Horizontal, Vertical } from './types';\nimport Styled from './popup.styles';\nvar Popup = intrinsicComponent(function (props, ref) {\n var autoHideDuration = props.autoHideDuration,\n anchorOrigin = props.anchorOrigin,\n open = props.open,\n onClose = props.onClose,\n rest = _objectWithoutProperties(props, _excluded);\n var target = usePortal(generateClassNames('Popup'));\n var _useState = useState(autoHideDuration),\n _useState2 = _slicedToArray(_useState, 2),\n hoverHideDuration = _useState2[0],\n setHoverHideDuration = _useState2[1];\n var _useState3 = useState(false),\n _useState4 = _slicedToArray(_useState3, 2),\n isHovering = _useState4[0],\n setIsHovering = _useState4[1];\n var handleMouseLeave = function handleMouseLeave() {\n setIsHovering(false);\n setHoverHideDuration(1000);\n };\n useEffect(function () {\n if (open) setHoverHideDuration(autoHideDuration);\n }, [open]);\n useEffect(function () {\n var timeout = null;\n if (open && !isHovering && hoverHideDuration && typeof onClose === 'function') {\n timeout = setTimeout(onClose, hoverHideDuration);\n }\n return function () {\n if (timeout) {\n clearTimeout(timeout);\n }\n };\n }, [hoverHideDuration, isHovering, open, onClose]);\n var render = function render() {\n if (!open) {\n return null;\n }\n return /*#__PURE__*/React.createElement(Styled.Popup, _extends({\n onMouseEnter: function onMouseEnter() {\n return setIsHovering(true);\n },\n onMouseLeave: handleMouseLeave\n }, props), /*#__PURE__*/React.createElement(PopupContent, _extends({\n onClose: onClose\n }, rest, {\n ref: ref\n })));\n };\n return /*#__PURE__*/createPortal(render(), target);\n});\nPopup.defaultProps = _objectSpread(_objectSpread({}, cDefaultProps), {}, {\n open: false,\n autoHideDuration: 5000,\n anchorOrigin: {\n vertical: Vertical.Bottom,\n horizontal: Horizontal.Left\n }\n});\nPopup.propTypes = _objectSpread(_objectSpread({}, cPropTypes), {}, {\n anchorOrigin: PT.exact({\n vertical: PT.oneOf(objectValues(Vertical)),\n horizontal: PT.oneOf(objectValues(Horizontal))\n }),\n open: PT.bool,\n autoHideDuration: PT.number,\n onClose: PT.func\n});\nexport default Popup;","import styled, { css } from 'styled-components';\nimport { generateClassNames, applyDisplayNames } from '../../utils/functions';\nimport { Color as PC } from '../../utils/types/palette';\nvar baseClassName = 'RotationSlider';\nvar RotationSliderList = /*#__PURE__*/styled.ul.attrs({\n className: generateClassNames(baseClassName, 'list')\n}).withConfig({\n componentId: \"sc-1xuruq0-0\"\n})([\"display:flex;align-items:center;position:relative;padding:0;width:100%;list-style:none;\"]);\nvar RotationSliderBigDot = /*#__PURE__*/styled.li.attrs({\n className: generateClassNames(baseClassName, 'big-dot')\n}).withConfig({\n componentId: \"sc-1xuruq0-1\"\n})(function (_ref) {\n var palette = _ref.theme.palette;\n return css([\"width:8px;height:8px;border-radius:50%;background-color:\", \";cursor:pointer;\"], palette[PC.LinkPrimary]);\n});\nvar RotationSliderSmallDotWrapper = /*#__PURE__*/styled.div.attrs({\n className: generateClassNames(baseClassName, 'small-dot-wrapper')\n}).withConfig({\n componentId: \"sc-1xuruq0-2\"\n})([\"padding:2px;\"]);\nvar RotationSliderSmallDot = /*#__PURE__*/styled.li.attrs({\n className: generateClassNames(baseClassName, 'small-dot')\n}).withConfig({\n componentId: \"sc-1xuruq0-3\"\n})(function (_ref2) {\n var palette = _ref2.theme.palette;\n return css([\"width:2px;height:2px;border-radius:50%;background-color:\", \";cursor:pointer;\"], palette[PC.LinkPrimary]);\n});\nvar RotationSliderControl = /*#__PURE__*/styled.span.attrs({\n className: generateClassNames(baseClassName, 'control')\n}).withConfig({\n componentId: \"sc-1xuruq0-4\"\n})(function (_ref3) {\n var palette = _ref3.theme.palette;\n return css([\"display:flex;justify-content:center;align-items:center;position:absolute;height:18px;width:2px;transform:translate(-50%,-50%);top:50%;background-color:\", \";& > input{border:0px;clip:rect(0px,0px,0px,0px);height:100%;margin:-1px;overflow:hidden;padding:0px;position:absolute;white-space:nowrap;width:100%;direction:ltr;}&::before{position:absolute;content:'';border-radius:inherit;width:100%;height:100%;box-shadow:0px 3px 1px -2px rgb(0 0 0 / 20%),0px 2px 2px 0px rgb(0 0 0 / 14%),0px 1px 5px 0px rgb(0 0 0 / 12%);}&::after{position:absolute;content:'';border-radius:50%;width:42px;height:42px;top:50%;left:50%;transform:translate(-50%,-50%);}\"], palette[PC.LinkActive]);\n});\nvar RotationSliderMark = /*#__PURE__*/styled.div.attrs({\n className: generateClassNames(baseClassName, 'mark')\n}).withConfig({\n componentId: \"sc-1xuruq0-5\"\n})([\"padding:4px;\"]);\nvar RotationSliderMarkText = /*#__PURE__*/styled.span.attrs({\n className: generateClassNames(baseClassName, 'mark-text')\n}).withConfig({\n componentId: \"sc-1xuruq0-6\"\n})(function (_ref4) {\n var palette = _ref4.theme.palette;\n return css([\"position:absolute;top:20px;font-size:14px;transform:translateX(-10%);color:\", \";\"], palette[PC.TextPrimary]);\n});\nvar Styled = applyDisplayNames({\n RotationSliderList: RotationSliderList,\n RotationSliderBigDot: RotationSliderBigDot,\n RotationSliderSmallDotWrapper: RotationSliderSmallDotWrapper,\n RotationSliderSmallDot: RotationSliderSmallDot,\n RotationSliderControl: RotationSliderControl,\n RotationSliderMark: RotationSliderMark,\n RotationSliderMarkText: RotationSliderMarkText\n});\nexport default Styled;","import _extends from \"@babel/runtime/helpers/extends\";\nimport _defineProperty from \"@babel/runtime/helpers/defineProperty\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/objectWithoutProperties\";\nvar _excluded = [\"min\", \"max\", \"angle\", \"onChange\", \"onMouseDown\", \"onMouseUp\", \"step\", \"labelTooltipOptions\", \"annotation\", \"hideMarkText\", \"showCurrentMarkText\", \"value\", \"railProps\", \"trackProps\", \"thumbProps\", \"labelTooltipProps\", \"markStyles\", \"markTextStyles\"];\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nimport React from 'react';\nimport PT from 'prop-types';\nimport { intrinsicComponent, objectValues } from '../../utils/functions';\nimport Slider from '../slider';\nimport { LabelTooltip } from '../slider/types';\nimport Styled from './rotation-slider.styles';\nvar RotationSlider = intrinsicComponent(function (_ref, ref) {\n var _ref$min = _ref.min,\n min = _ref$min === void 0 ? 0 : _ref$min,\n _ref$max = _ref.max,\n max = _ref$max === void 0 ? 100 : _ref$max,\n _ref$angle = _ref.angle,\n angle = _ref$angle === void 0 ? 10 : _ref$angle,\n onChange = _ref.onChange,\n onMouseDown = _ref.onMouseDown,\n onMouseUp = _ref.onMouseUp,\n _ref$step = _ref.step,\n step = _ref$step === void 0 ? 1 : _ref$step,\n _ref$labelTooltipOpti = _ref.labelTooltipOptions,\n labelTooltipOptions = _ref$labelTooltipOpti === void 0 ? LabelTooltip.Off : _ref$labelTooltipOpti,\n _ref$annotation = _ref.annotation,\n annotation = _ref$annotation === void 0 ? '°' : _ref$annotation,\n _ref$hideMarkText = _ref.hideMarkText,\n hideMarkText = _ref$hideMarkText === void 0 ? false : _ref$hideMarkText,\n _ref$showCurrentMarkT = _ref.showCurrentMarkText,\n showCurrentMarkText = _ref$showCurrentMarkT === void 0 ? false : _ref$showCurrentMarkT,\n value = _ref.value,\n _ref$railProps = _ref.railProps,\n railProps = _ref$railProps === void 0 ? {} : _ref$railProps,\n _ref$trackProps = _ref.trackProps,\n trackProps = _ref$trackProps === void 0 ? {} : _ref$trackProps,\n _ref$thumbProps = _ref.thumbProps,\n thumbProps = _ref$thumbProps === void 0 ? {} : _ref$thumbProps,\n _ref$labelTooltipProp = _ref.labelTooltipProps,\n labelTooltipProps = _ref$labelTooltipProp === void 0 ? {} : _ref$labelTooltipProp,\n _ref$markStyles = _ref.markStyles,\n markStyles = _ref$markStyles === void 0 ? {} : _ref$markStyles,\n _ref$markTextStyles = _ref.markTextStyles,\n markTextStyles = _ref$markTextStyles === void 0 ? {} : _ref$markTextStyles,\n rest = _objectWithoutProperties(_ref, _excluded);\n var handleChange = function handleChange(event, newValue) {\n if (onChange) {\n onChange(event, newValue);\n }\n };\n var getValue = function getValue() {\n if (value || value === 0) {\n if (value > max) {\n return max;\n }\n if (value < min) {\n return min;\n }\n return value;\n }\n return min;\n };\n var showMarkText = function showMarkText(index) {\n if (hideMarkText) return false;\n if (!showCurrentMarkText) return true;\n return getValue() === index;\n };\n var renderBar = function renderBar() {\n var barDom = [];\n var barDiv;\n for (var i = min; i <= max; i += step) {\n barDiv = [];\n if (i % angle === 0 || i === max) {\n barDiv = /*#__PURE__*/React.createElement(Styled.RotationSliderMark, {\n key: i,\n style: _objectSpread({}, markStyles)\n }, showMarkText(i) && /*#__PURE__*/React.createElement(Styled.RotationSliderMarkText, {\n style: _objectSpread({}, markTextStyles)\n }, i === min + 1 ? max : i, /*#__PURE__*/React.createElement(\"sup\", null, annotation)), /*#__PURE__*/React.createElement(Styled.RotationSliderBigDot, null));\n } else if (i % 10 === 0) {\n barDiv = /*#__PURE__*/React.createElement(Styled.RotationSliderSmallDotWrapper, {\n key: i\n }, /*#__PURE__*/React.createElement(Styled.RotationSliderSmallDot, null));\n }\n if (!Array.isArray(barDiv)) {\n barDom.push(barDiv);\n }\n }\n return barDom;\n };\n return /*#__PURE__*/React.createElement(Slider, _extends({\n min: min,\n max: max,\n step: step,\n value: getValue(),\n hideTrack: true,\n hideAnnotation: true,\n annotation: annotation,\n onChange: handleChange,\n labelTooltip: labelTooltipOptions,\n ref: ref,\n components: {\n Rail: function Rail(props, style) {\n return /*#__PURE__*/React.createElement(Styled.RotationSliderList, _extends({}, props, {\n styles: _objectSpread({}, style)\n }), renderBar());\n },\n Thumb: Styled.RotationSliderControl\n },\n componentsProps: {\n rail: _objectSpread(_objectSpread({}, railProps), {}, {\n style: _objectSpread({}, railProps.style)\n }),\n track: _objectSpread(_objectSpread({}, trackProps), {}, {\n style: _objectSpread({}, trackProps.style)\n }),\n thumb: _objectSpread(_objectSpread({}, thumbProps), {}, {\n style: _objectSpread({\n top: '15%'\n }, thumbProps.style)\n }),\n labelTooltip: _objectSpread(_objectSpread({}, labelTooltipProps), {}, {\n style: _objectSpread({}, labelTooltipProps.style)\n })\n }\n }, rest, {\n defaultValue: Number(rest.defaultValue),\n style: _objectSpread({\n width: 'auto',\n height: 'auto'\n }, rest.style)\n }));\n});\nRotationSlider.defaultProps = {\n annotation: '°',\n min: 0,\n max: 100,\n step: 1,\n labelTooltipOptions: LabelTooltip.Off\n};\nRotationSlider.propTypes = {\n value: PT.oneOfType([PT.array, PT.number]),\n min: PT.number,\n max: PT.number,\n angle: PT.number,\n onChange: PT.func,\n onMouseDown: PT.func,\n onMouseUp: PT.func,\n step: PT.number,\n annotation: PT.string,\n hideMarkText: PT.bool,\n showCurrentMarkText: PT.bool,\n railProps: PT.object,\n trackProps: PT.object,\n thumbProps: PT.object,\n labelTooltipProps: PT.object,\n markStyles: PT.object,\n markTextStyles: PT.object,\n labelTooltipOptions: PT.oneOf(objectValues(LabelTooltip))\n};\nexport default RotationSlider;","import styled from 'styled-components';\nimport { generateClassNames, applyDisplayNames } from '../../utils/functions';\n// import type { With } from '../../utils/types';\n// import type { WithTheme } from '../../theme/entity';\n// import { Color as PColor } from '../../utils/types/palette';\n// import type { SelectGroupProps } from './select-group.props';\nimport StyledInputGroup from '../input-group/input-group.styles';\nvar baseClassName = 'SelectGroup';\nvar SelectGroup = /*#__PURE__*/styled(StyledInputGroup.InputGroup).attrs({\n className: generateClassNames(baseClassName, 'root')\n}).withConfig({\n componentId: \"sc-1uvutwe-0\"\n})([\"\"]);\nvar Styled = applyDisplayNames({\n SelectGroup: SelectGroup\n});\nexport default Styled;","import _defineProperty from \"@babel/runtime/helpers/defineProperty\";\nimport _extends from \"@babel/runtime/helpers/extends\";\nimport _typeof from \"@babel/runtime/helpers/typeof\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/objectWithoutProperties\";\nvar _excluded = [\"children\", \"size\", \"error\", \"label\", \"placeholder\", \"hint\", \"LabelProps\", \"SelectProps\", \"selectProps\", \"scroll\", \"fullWidth\", \"showSelectionKey\", \"value\", \"multiple\", \"hideMenuItemsActions\", \"onChange\", \"readOnly\", \"disabled\", \"showClearIcon\"];\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nimport React from 'react';\nimport PT from 'prop-types';\nimport { InputSize } from '../../utils/types';\nimport { intrinsicComponent, objectValues } from '../../utils/functions';\nimport Label from '../label';\nimport { propTypes as labelPropTypes } from '../label/label.component';\nimport Select from '../select';\nimport { propTypes as selectPropTypes } from '../select/select.component';\nimport FormHint from '../form-hint';\nimport Styled from './select-group.styles';\nvar SelectGroup = intrinsicComponent(function (_ref, ref) {\n var children = _ref.children,\n size = _ref.size,\n error = _ref.error,\n label = _ref.label,\n placeholder = _ref.placeholder,\n hint = _ref.hint,\n LabelPropsData = _ref.LabelProps,\n SelectPropsData = _ref.SelectProps,\n selectProps = _ref.selectProps,\n _ref$scroll = _ref.scroll,\n scroll = _ref$scroll === void 0 ? true : _ref$scroll,\n fullWidth = _ref.fullWidth,\n showSelectionKey = _ref.showSelectionKey,\n value = _ref.value,\n multiple = _ref.multiple,\n hideMenuItemsActions = _ref.hideMenuItemsActions,\n onChange = _ref.onChange,\n readOnly = _ref.readOnly,\n disabled = _ref.disabled,\n showClearIcon = _ref.showClearIcon,\n rest = _objectWithoutProperties(_ref, _excluded);\n var renderLabel = function renderLabel() {\n if (label) {\n if (typeof label === 'function') {\n return label({\n error: error\n });\n }\n if (_typeof(label) === 'object') {\n return label;\n }\n return /*#__PURE__*/React.createElement(Label, _extends({\n error: error\n }, LabelPropsData || {}), label);\n }\n return null;\n };\n var renderHint = function renderHint() {\n if (hint) {\n if (typeof hint === 'function') {\n return hint({\n error: error\n });\n }\n if (_typeof(hint) === 'object') {\n return hint;\n }\n return /*#__PURE__*/React.createElement(FormHint, {\n error: error\n }, hint);\n }\n return null;\n };\n return /*#__PURE__*/React.createElement(Styled.SelectGroup, _extends({}, rest, {\n ref: ref\n }), renderLabel(), /*#__PURE__*/React.createElement(Select, _extends({\n error: error,\n value: value,\n size: size,\n scroll: scroll,\n onChange: onChange,\n multiple: multiple,\n fullWidth: Boolean(fullWidth)\n }, SelectPropsData || {}, {\n selectProps: selectProps,\n readOnly: readOnly,\n disabled: disabled,\n placeholder: placeholder,\n showSelectionKey: showSelectionKey,\n hideMenuItemsActions: hideMenuItemsActions,\n showClearIcon: showClearIcon\n }), children), renderHint());\n});\nSelectGroup.defaultProps = {\n error: false,\n fullWidth: false,\n readOnly: false,\n disabled: false,\n scroll: true,\n hideMenuItemsActions: false\n};\nvar size = selectPropTypes.size,\n restSelectPropTypes = _objectWithoutProperties(selectPropTypes, [\"size\"]);\nSelectGroup.propTypes = _objectSpread(_objectSpread({}, restSelectPropTypes), {}, {\n // Extends from SelectProps: multiple, error, children, value, onChange\n fullWidth: PT.bool,\n size: PT.oneOf(objectValues(InputSize)),\n label: PT.node,\n hint: PT.node,\n LabelProps: PT.exact(labelPropTypes),\n SelectProps: PT.exact(selectPropTypes),\n selectProps: PT.object,\n readOnly: PT.bool,\n scroll: PT.bool,\n showSelectionKey: PT.bool,\n disabled: PT.bool\n});\nexport default SelectGroup;","import styled, { css } from 'styled-components';\nimport { generateClassNames, applyDisplayNames } from '../../utils/functions';\nimport { Color as PColor } from '../../utils/types/palette';\nvar baseClassName = 'Backdrop';\nvar Backdrop = /*#__PURE__*/styled.div.attrs({\n className: generateClassNames(baseClassName, 'root')\n}).withConfig({\n componentId: \"sc-txa5a-0\"\n})(function (_ref) {\n var palette = _ref.theme.palette;\n return css([\"position:fixed;display:flex;align-items:center;justify-content:center;inset:0px;background-color:\", \";transition:opacity 251ms cubic-bezier(0.4,0,0.2,1) 0ms;opacity:1;z-index:-1;\"], palette[PColor.Extra_0_3_Overlay]);\n});\nvar Styled = applyDisplayNames({\n Backdrop: Backdrop\n});\nexport default Styled;","import _objectDestructuringEmpty from \"@babel/runtime/helpers/objectDestructuringEmpty\";\nimport _extends from \"@babel/runtime/helpers/extends\";\nimport React from 'react';\nimport { intrinsicComponent } from '../../utils/functions';\nimport Styled from './backdrop.styles';\nvar Backdrop = intrinsicComponent(function (_ref, ref) {\n var rest = _extends({}, (_objectDestructuringEmpty(_ref), _ref));\n return /*#__PURE__*/React.createElement(Styled.Backdrop, _extends({}, rest, {\n ref: ref\n }));\n});\nBackdrop.defaultProps = {};\nBackdrop.propTypes = {};\nexport default Backdrop;","import styled, { css } from 'styled-components';\nimport { generateClassNames, applyDisplayNames, scrollBar } from '../../utils/functions';\nimport { Color as PColor } from '../../utils/types/palette';\nimport { Shadows as PShadows } from '../../utils/types/shadows';\nimport { FontVariant as FV } from '../../utils/types/typography/font-variant';\nimport Accordion from '../accordion/accordion.component';\nimport AccordionHeaderStyled from '../accordion-header/accordion-header.styles';\nimport AccordionDetailsStyled from '../accordion-details/accordion-details.styles';\nvar baseClassName = 'Drawer';\nvar TemporaryDrawer = /*#__PURE__*/styled.div.attrs({\n className: generateClassNames(baseClassName, 'temporary')\n}).withConfig({\n componentId: \"sc-1riasfx-0\"\n})(function (_ref) {\n var open = _ref.open;\n return css([\"position:absolute;inset:0px;z-index:1200;visibility:\", \";\"], !open && 'hidden');\n});\nvar PersistentDrawer = /*#__PURE__*/styled.div.attrs({\n className: generateClassNames(baseClassName, 'persistent')\n}).withConfig({\n componentId: \"sc-1riasfx-1\"\n})([\"\"]);\nvar Drawer = /*#__PURE__*/styled.div.attrs({\n className: generateClassNames(baseClassName, 'root')\n}).withConfig({\n componentId: \"sc-1riasfx-2\"\n})(function (_ref2) {\n var open = _ref2.open,\n isCollapsed = _ref2.isCollapsed,\n _ref2$top = _ref2.top,\n top = _ref2$top === void 0 ? 0 : _ref2$top,\n _ref2$theme = _ref2.theme,\n palette = _ref2$theme.palette,\n shadows = _ref2$theme.shadows,\n breakpoints = _ref2$theme.breakpoints;\n return css([\"display:flex;flex-direction:column;flex:1 0 auto;background-color:\", \";box-shadow:\", \";overflow-y:overlay;overflow-x:hidden;transform:\", \";visibility:\", \";transition:200ms;height:calc(100% - \", \"px);\", \"{margin-top:0px;height:100%;}\", \" &{margin-top:0px;height:100%;}box-sizing:border-box;width:\", \";\", \"\"], palette[PColor.BackgroundStateless], shadows[PShadows.LeftPanelMd], open ? 'none' : 'translateX(-100%)', !open && 'hidden', top, breakpoints.down('md'), breakpoints.classes.sm, isCollapsed ? '68px' : '302px', scrollBar);\n});\nvar Header = /*#__PURE__*/styled.div.attrs({\n className: generateClassNames(baseClassName, 'header')\n}).withConfig({\n componentId: \"sc-1riasfx-3\"\n})(function (_ref3) {\n var isCollapsed = _ref3.isCollapsed;\n return css([\"display:\", \";justify-content:flex-start;align-items:center;position:relative;text-decoration:none;width:100%;box-sizing:border-box;text-align:left;margin-top:12px;transition:background-color 100ms ease-out;\"], isCollapsed ? 'none' : 'flex');\n});\nvar Body = /*#__PURE__*/styled.div.attrs({\n className: generateClassNames(baseClassName, 'body')\n}).withConfig({\n componentId: \"sc-1riasfx-4\"\n})([\"flex:1 1 auto;.SfxAccordionDetails-root{margin:0;}\"]);\nvar Footer = /*#__PURE__*/styled.div.attrs({\n className: generateClassNames(baseClassName, 'footer')\n}).withConfig({\n componentId: \"sc-1riasfx-5\"\n})(function (_ref4) {\n var isCollapsed = _ref4.isCollapsed;\n return css([\"display:flex;flex-direction:column;width:100%;padding:\", \";\"], isCollapsed ? '0px' : '0px 8px');\n});\nvar List = /*#__PURE__*/styled.ul.attrs({\n className: generateClassNames(baseClassName, 'list')\n}).withConfig({\n componentId: \"sc-1riasfx-6\"\n})(function () {\n return css([\"list-style:none;margin:12px 0;padding:0;position:relative;\"]);\n});\nvar Item = /*#__PURE__*/styled.li.attrs({\n className: generateClassNames(baseClassName, 'item')\n}).withConfig({\n componentId: \"sc-1riasfx-7\"\n})(function (_ref5) {\n var palette = _ref5.theme.palette,\n isCollapsed = _ref5.isCollapsed,\n selected = _ref5.selected;\n return css([\"display:\", \";justify-content:flex-start;align-items:center;position:relative;text-decoration:none;width:100%;box-sizing:border-box;text-align:left;padding:13px 16px;transition:background-color 100ms ease-out;margin-bottom:4px;cursor:pointer;&:hover{background-color:\", \";& > *{color:\", \";}}\", \"\"], isCollapsed ? 'none' : 'flex', palette[PColor.BackgroundActive], palette[PColor.AccentStateless], selected && css([\"background-color:\", \";& > *{color:\", \" !important;}\"], palette[PColor.BackgroundActive], palette[PColor.AccentStateless]));\n});\nvar ItemText = /*#__PURE__*/styled.div.attrs({\n className: generateClassNames(baseClassName, 'text')\n}).withConfig({\n componentId: \"sc-1riasfx-8\"\n})(function (_ref6) {\n var _ref6$theme = _ref6.theme,\n palette = _ref6$theme.palette,\n font = _ref6$theme.typography.font,\n fontKey = _ref6.font,\n isCollapsed = _ref6.isCollapsed;\n return css([\"flex:1 1 auto;color:\", \";\", \";transition:color 100ms ease-out;display:\", \";user-select:none;\"], palette[PColor.TextPrimary], font[fontKey || FV.LabelLarge], isCollapsed && 'none');\n});\nvar Icon = /*#__PURE__*/styled.div.attrs({\n className: generateClassNames(baseClassName, 'icon')\n}).withConfig({\n componentId: \"sc-1riasfx-9\"\n})(function (_ref7) {\n var palette = _ref7.theme.palette,\n isCollapsed = _ref7.isCollapsed;\n return css([\"display:flex;flex-shrink:0;color:\", \";margin-right:\", \";transition:color 100ms ease-out;\"], palette[PColor.IconsPrimary], isCollapsed ? '0px' : '12px');\n});\nvar ItemButton = /*#__PURE__*/styled.div.attrs({\n className: generateClassNames(baseClassName, 'item-button')\n}).withConfig({\n componentId: \"sc-1riasfx-10\"\n})(function (_ref8) {\n var palette = _ref8.theme.palette,\n isCollapsed = _ref8.isCollapsed,\n selected = _ref8.selected;\n return css([\"display:flex;justify-content:\", \";align-items:center;border-radius:4px;box-sizing:border-box;text-align:left;padding:\", \";width:\", \";margin-bottom:8px;margin:\", \";transition:background-color 150ms cubic-bezier(0.4,0,0.2,1) 0ms;cursor:pointer;&:hover{background-color:\", \";& > *{color:\", \";}}\", \"\"], isCollapsed ? 'center' : 'flex-start', isCollapsed ? '12px 0px' : '13px 16px', isCollapsed && '56px', isCollapsed && '8px auto', palette[PColor.BackgroundActive], palette[PColor.AccentStateless], selected && css([\"background-color:\", \";& > *{color:\", \";}\"], palette[PColor.BackgroundActive], palette[PColor.AccentStateless]));\n});\nvar CollapsedButton = /*#__PURE__*/styled(ItemButton).attrs({\n className: generateClassNames(baseClassName, 'item-button')\n}).withConfig({\n componentId: \"sc-1riasfx-11\"\n})(function (_ref9) {\n var isCollapsed = _ref9.isCollapsed;\n return css([\"\", \"\"], !isCollapsed && css([\"padding:13px 16px;\"]));\n});\nvar DrawerAccordion = /*#__PURE__*/styled(Accordion).attrs({\n className: generateClassNames(baseClassName, 'accordion')\n}).withConfig({\n componentId: \"sc-1riasfx-12\"\n})(function (_ref10) {\n var _ref10$theme = _ref10.theme,\n palette = _ref10$theme.palette,\n font = _ref10$theme.typography.font,\n selected = _ref10.selected;\n return css([\"\", \"{padding:13px 16px;transition:background-color 100ms ease-out;\", \"{\", \";color:\", \";}&:hover{background-color:\", \";& > *{color:\", \";}}\", \"}\", \"{padding:0px 16px;}\"], AccordionHeaderStyled.Header, AccordionHeaderStyled.Label, font[FV.LabelLargeEmphasis], palette[PColor.TextPrimary], palette[PColor.BackgroundActive], palette[PColor.AccentStateless], selected && css([\"\", \"{color:\", \";}\"], AccordionHeaderStyled.Label, palette[PColor.AccentStateless]), AccordionDetailsStyled.AccordionDetails);\n});\nvar Styled = applyDisplayNames({\n TemporaryDrawer: TemporaryDrawer,\n PersistentDrawer: PersistentDrawer,\n Drawer: Drawer,\n Header: Header,\n Body: Body,\n Footer: Footer,\n List: List,\n Item: Item,\n ItemButton: ItemButton,\n Icon: Icon,\n ItemText: ItemText,\n DrawerAccordion: DrawerAccordion,\n CollapsedButton: CollapsedButton\n});\nexport default Styled;","import { createContext } from 'react';\nvar DrawerContext = /*#__PURE__*/createContext({\n isCollapsed: false,\n size: 20\n});\nif (process.env.NODE_ENV !== 'production') {\n DrawerContext.displayName = 'DrawerContext';\n}\nexport default DrawerContext;","import _extends from \"@babel/runtime/helpers/extends\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/objectWithoutProperties\";\nvar _excluded = [\"children\", \"font\"];\nimport React, { useContext } from 'react';\nimport PT from 'prop-types';\nimport { intrinsicComponent, objectValues } from '../../utils/functions';\nimport { FontVariant } from '../../utils/types/typography/font-variant';\nimport Styled from './drawer.styles';\nimport DrawerContext from './drawer.context';\nvar DrawerItemText = intrinsicComponent(function (_ref, ref) {\n var children = _ref.children,\n font = _ref.font,\n rest = _objectWithoutProperties(_ref, _excluded);\n var _useContext = useContext(DrawerContext),\n isCollapsed = _useContext.isCollapsed;\n return /*#__PURE__*/React.createElement(Styled.ItemText, _extends({\n font: font,\n isCollapsed: isCollapsed\n }, rest, {\n ref: ref\n }), children);\n});\nDrawerItemText.defaultProps = {};\nDrawerItemText.propTypes = {\n font: PT.oneOf(objectValues(FontVariant))\n};\nexport default DrawerItemText;","import _extends from \"@babel/runtime/helpers/extends\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/objectWithoutProperties\";\nvar _excluded = [\"children\", \"size\"];\nimport React, { useContext } from 'react';\nimport PT from 'prop-types';\nimport { intrinsicComponent } from '../../utils/functions';\nimport Styled from './drawer.styles';\nimport DrawerContext from './drawer.context';\nvar DrawerItemIcon = intrinsicComponent(function (_ref, ref) {\n var children = _ref.children,\n iconSize = _ref.size,\n rest = _objectWithoutProperties(_ref, _excluded);\n var _useContext = useContext(DrawerContext),\n isCollapsed = _useContext.isCollapsed,\n size = _useContext.size;\n return /*#__PURE__*/React.createElement(Styled.Icon, _extends({}, rest, {\n isCollapsed: isCollapsed,\n ref: ref\n }), children && typeof children === 'function' ? children({\n size: size || iconSize\n }) : children);\n});\nDrawerItemIcon.defaultProps = {\n size: 20\n};\nDrawerItemIcon.propTypes = {\n size: PT.number,\n children: PT.oneOfType([PT.node, PT.func]).isRequired\n};\nexport default DrawerItemIcon;","export var Variant = {\n Auto: 'auto',\n Temporary: 'temporary',\n Persistent: 'persistent'\n};","import _defineProperty from \"@babel/runtime/helpers/defineProperty\";\nimport _extends from \"@babel/runtime/helpers/extends\";\nimport _slicedToArray from \"@babel/runtime/helpers/slicedToArray\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/objectWithoutProperties\";\nvar _excluded = [\"children\", \"open\", \"iconsSize\", \"collapsed\", \"top\", \"hideBackdrop\", \"disablePortal\", \"collapseButtonLabel\", \"persistentDrawerStyles\", \"temproryDrawerStyles\", \"variant\", \"onClose\", \"onCollapse\", \"onCollapseClick\"];\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nimport React, { useState, useEffect, useMemo, useRef } from 'react';\nimport { createPortal } from 'react-dom';\nimport PT from 'prop-types';\nimport ArrowSidebarLeftOutline from '@scaleflex/icons/arrow-sidebar-left-outline';\nimport ArrowSidebarRightOutline from '@scaleflex/icons/arrow-sidebar-right-outline';\nimport { intrinsicComponent, objectValues } from '../../utils/functions';\nimport { useMediaQuery, useTheme } from '../../theme/hooks';\nimport DrawerItemText from './drawer-item-text-component';\nimport DrawerItemIcon from './drawer-item-icon.component';\nimport DrawerContext from './drawer.context';\nimport Backdrop from '../backdrop';\nimport Styled from './drawer.styles';\nimport { Variant } from './types';\nvar Drawer = intrinsicComponent(function (_ref, ref) {\n var children = _ref.children,\n open = _ref.open,\n _ref$iconsSize = _ref.iconsSize,\n iconsSize = _ref$iconsSize === void 0 ? 20 : _ref$iconsSize,\n _ref$collapsed = _ref.collapsed,\n collapsed = _ref$collapsed === void 0 ? false : _ref$collapsed,\n top = _ref.top,\n hideBackdrop = _ref.hideBackdrop,\n disablePortal = _ref.disablePortal,\n _ref$collapseButtonLa = _ref.collapseButtonLabel,\n collapseButtonLabel = _ref$collapseButtonLa === void 0 ? 'Collapse menu' : _ref$collapseButtonLa,\n _ref$persistentDrawer = _ref.persistentDrawerStyles,\n persistentDrawerStyles = _ref$persistentDrawer === void 0 ? {} : _ref$persistentDrawer,\n _ref$temproryDrawerSt = _ref.temproryDrawerStyles,\n temproryDrawerStyles = _ref$temproryDrawerSt === void 0 ? {} : _ref$temproryDrawerSt,\n _ref$variant = _ref.variant,\n variant = _ref$variant === void 0 ? Variant.Auto : _ref$variant,\n onClose = _ref.onClose,\n onCollapse = _ref.onCollapse,\n onCollapseClick = _ref.onCollapseClick,\n rest = _objectWithoutProperties(_ref, _excluded);\n var theme = useTheme();\n var matchDownXl = useMediaQuery(theme.breakpoints.down('xl'));\n var _useState = useState(collapsed),\n _useState2 = _slicedToArray(_useState, 2),\n isCollapsed = _useState2[0],\n setIsCollapsed = _useState2[1];\n var temproryDrawerRef = useRef(null);\n var DrawerIconsSize = useMemo(function () {\n return iconsSize;\n }, [iconsSize]);\n var target = document.querySelector('body');\n useEffect(function () {\n setIsCollapsed(collapsed);\n }, [collapsed]);\n useEffect(function () {\n if (onCollapse) {\n onCollapse(isCollapsed);\n }\n }, [isCollapsed]);\n var handleCollapse = function handleCollapse() {\n var newCollpaseState = !isCollapsed;\n setIsCollapsed(newCollpaseState);\n if (onCollapseClick) {\n onCollapseClick(newCollpaseState);\n }\n };\n var handleClose = function handleClose() {\n if (typeof onClose === 'function') {\n onClose();\n }\n };\n var keyListener = function keyListener(ev) {\n var isTemporaryDrawer = false;\n if (temproryDrawerRef !== null && temproryDrawerRef !== void 0 && temproryDrawerRef.current) {\n var _temproryDrawerRef$cu;\n isTemporaryDrawer = (temproryDrawerRef === null || temproryDrawerRef === void 0 || (_temproryDrawerRef$cu = temproryDrawerRef.current) === null || _temproryDrawerRef$cu === void 0 ? void 0 : _temproryDrawerRef$cu.offsetWidth) > 0;\n }\n if (ev.key === 'Escape' && isTemporaryDrawer) {\n handleClose();\n }\n };\n useEffect(function () {\n document.addEventListener('keydown', keyListener);\n return function () {\n return document.removeEventListener('keydown', keyListener);\n };\n }, []);\n var renderDrawer = function renderDrawer(showCollapsedButton) {\n return /*#__PURE__*/React.createElement(Styled.Drawer, _extends({\n open: open,\n top: top\n }, rest, {\n isCollapsed: showCollapsedButton ? isCollapsed : false,\n ref: ref\n }), children, showCollapsedButton && /*#__PURE__*/React.createElement(Styled.CollapsedButton, {\n onClick: handleCollapse,\n isCollapsed: isCollapsed\n }, /*#__PURE__*/React.createElement(DrawerItemIcon, null, isCollapsed ? function (props) {\n return /*#__PURE__*/React.createElement(ArrowSidebarRightOutline, _extends({}, props, {\n size: iconsSize\n }));\n } : function (props) {\n return /*#__PURE__*/React.createElement(ArrowSidebarLeftOutline, _extends({}, props, {\n size: iconsSize\n }));\n }), /*#__PURE__*/React.createElement(DrawerItemText, null, collapseButtonLabel)));\n };\n var renderBackdrop = function renderBackdrop() {\n return !hideBackdrop && open ? /*#__PURE__*/React.createElement(Backdrop, {\n onClick: onClose\n }) : null;\n };\n var temporaryDrawer = function temporaryDrawer() {\n return disablePortal ? /*#__PURE__*/React.createElement(Styled.TemporaryDrawer, {\n ref: temproryDrawerRef,\n style: _objectSpread({}, temproryDrawerStyles),\n open: open\n }, renderBackdrop(), renderDrawer(false)) : ( /*#__PURE__*/createPortal( /*#__PURE__*/React.createElement(Styled.TemporaryDrawer, {\n ref: temproryDrawerRef,\n style: _objectSpread({}, temproryDrawerStyles),\n open: open\n }, renderBackdrop(), renderDrawer(false)), target));\n };\n var persistentDrawer = function persistentDrawer() {\n return /*#__PURE__*/React.createElement(Styled.PersistentDrawer, {\n style: _objectSpread({}, persistentDrawerStyles)\n }, renderDrawer(true));\n };\n var getDrawerVariant = function getDrawerVariant() {\n switch (variant) {\n case Variant.Auto:\n return matchDownXl ? temporaryDrawer() : persistentDrawer();\n case Variant.Temporary:\n return temporaryDrawer();\n case Variant.Persistent:\n return persistentDrawer();\n default:\n return matchDownXl ? temporaryDrawer() : persistentDrawer();\n }\n };\n return /*#__PURE__*/React.createElement(DrawerContext.Provider, {\n value: {\n isCollapsed: !matchDownXl ? isCollapsed : false,\n size: DrawerIconsSize\n }\n }, getDrawerVariant());\n});\nexport var defaultProps = {\n open: false,\n hideBackdrop: false,\n iconsSize: 20,\n variant: Variant.Auto\n};\nDrawer.defaultProps = defaultProps;\nexport var propTypes = {\n onClose: PT.func.isRequired,\n onCollapse: PT.func,\n onCollapseClick: PT.func,\n children: PT.node.isRequired,\n top: PT.number,\n iconsSize: PT.number,\n open: PT.bool,\n hideBackdrop: PT.bool,\n collapsed: PT.bool,\n disablePortal: PT.bool,\n collapseButtonLabel: PT.string,\n persistentDrawerStyles: PT.object,\n temproryDrawerStyles: PT.object,\n variant: PT.oneOf(objectValues(Variant))\n};\nDrawer.propTypes = propTypes;\nexport default Drawer;","import _extends from \"@babel/runtime/helpers/extends\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/objectWithoutProperties\";\nvar _excluded = [\"children\"];\nimport React, { useContext } from 'react';\nimport { intrinsicComponent } from '../../utils/functions';\nimport DrawerContext from './drawer.context';\nimport Styled from './drawer.styles';\nvar DrawerHeader = intrinsicComponent(function (_ref, ref) {\n var children = _ref.children,\n rest = _objectWithoutProperties(_ref, _excluded);\n var _useContext = useContext(DrawerContext),\n isCollapsed = _useContext.isCollapsed;\n return /*#__PURE__*/React.createElement(Styled.Header, _extends({}, rest, {\n isCollapsed: isCollapsed,\n ref: ref\n }), children);\n});\nDrawerHeader.defaultProps = {};\nDrawerHeader.propTypes = {};\nexport default DrawerHeader;","import _extends from \"@babel/runtime/helpers/extends\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/objectWithoutProperties\";\nvar _excluded = [\"children\"];\nimport React from 'react';\nimport { intrinsicComponent } from '../../utils/functions';\nimport Styled from './drawer.styles';\nvar DrawerBody = intrinsicComponent(function (_ref, ref) {\n var children = _ref.children,\n rest = _objectWithoutProperties(_ref, _excluded);\n return /*#__PURE__*/React.createElement(Styled.Body, _extends({}, rest, {\n ref: ref\n }), children);\n});\nDrawerBody.defaultProps = {};\nDrawerBody.propTypes = {};\nexport default DrawerBody;","import _extends from \"@babel/runtime/helpers/extends\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/objectWithoutProperties\";\nvar _excluded = [\"children\"];\nimport React from 'react';\nimport { intrinsicComponent } from '../../utils/functions';\nimport Styled from './drawer.styles';\nvar DrawerList = intrinsicComponent(function (_ref, ref) {\n var children = _ref.children,\n rest = _objectWithoutProperties(_ref, _excluded);\n return /*#__PURE__*/React.createElement(Styled.List, _extends({}, rest, {\n ref: ref\n }), children);\n});\nDrawerList.defaultProps = {};\nDrawerList.propTypes = {};\nexport default DrawerList;","import _extends from \"@babel/runtime/helpers/extends\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/objectWithoutProperties\";\nvar _excluded = [\"children\", \"selected\"];\nimport React, { useContext } from 'react';\nimport PT from 'prop-types';\nimport { intrinsicComponent } from '../../utils/functions';\nimport DrawerContext from './drawer.context';\nimport Styled from './drawer.styles';\nvar DrawerItem = intrinsicComponent(function (_ref, ref) {\n var children = _ref.children,\n selected = _ref.selected,\n rest = _objectWithoutProperties(_ref, _excluded);\n var _useContext = useContext(DrawerContext),\n isCollapsed = _useContext.isCollapsed;\n return /*#__PURE__*/React.createElement(Styled.Item, _extends({\n selected: selected,\n isCollapsed: isCollapsed\n }, rest, {\n ref: ref\n }), children);\n});\nDrawerItem.defaultProps = {\n selected: false\n};\nDrawerItem.propTypes = {\n selected: PT.bool\n};\nexport default DrawerItem;","import{Input,Label}from\"@scaleflex/ui/core\";import styled from\"styled-components\";import{FontVariant as FV}from\"@scaleflex/ui/utils/types/typography\";var StyledHSVOptions=styled.div.withConfig({componentId:\"sc-1rfxjvn-0\"})([\"display:flex;width:100%;justify-content:space-between;gap:10px;.SfxSlider-root{min-width:100px;}\",\"\"],function(a){var b=a.isPhoneScreen;return b&&\"\\n flex-direction: column;\\n\\n .SfxSlider-root {\\n min-width: 230px;\\n }\\n \"}),StyledSliderContainer=styled.div.withConfig({componentId:\"sc-1rfxjvn-1\"})([\"display:flex;flex-direction:column;\"]),StyledSliderLabel=styled(Label).withConfig({componentId:\"sc-1rfxjvn-2\"})([\"\",\";\"],function(a){var b=a.theme;return b.typography.font[FV.LabelExtraSmallUp]}),StyledSliderWrapper=styled.div.withConfig({componentId:\"sc-1rfxjvn-3\"})([\"display:flex;align-items:center;\"]),StyledSliderInput=styled(Input).withConfig({componentId:\"sc-1rfxjvn-4\"})([\"display:inline-block;width:40px;height:28px;padding:6px 2px;margin-left:10px;border:none;.SfxInput-Base{text-align:center;width:100%;min-width:100%;max-width:100%;}\"]);export{StyledHSVOptions,StyledSliderContainer,StyledSliderLabel,StyledSliderWrapper,StyledSliderInput};","import _slicedToArray from\"@babel/runtime/helpers/slicedToArray\";import React from\"react\";import Konva from\"konva\";import{useFinetune}from\"../../../hooks\";import restrictNumber from\"../../../utils/restrictNumber\";import Slider from\"../../common/Slider\";import{StyledSliderContainer,StyledSliderInput,StyledSliderLabel,StyledSliderWrapper}from\"../tools.styled\";var MIN_VALUE=-1,DEFAULT_VALUE={brightness:0},MAX_VALUE=1,sliderStyle={width:150,padding:0,margin:0},BrightnessOptions=function(a){var b,c,d=a.t,e=useFinetune(Konva.Filters.Brighten,DEFAULT_VALUE),f=_slicedToArray(e,2),g=f[0],h=f[1],i=function(a){h({brightness:restrictNumber(a,MIN_VALUE,MAX_VALUE)})};return React.createElement(StyledSliderContainer,{className:\"FIE_brightness-option-wrapper\"},React.createElement(StyledSliderLabel,{className:\"FIE_brightness-option-label\"},d(\"brightness\")),React.createElement(StyledSliderWrapper,null,React.createElement(Slider,{className:\"FIE_brightness-option\",min:MIN_VALUE,step:.05,max:MAX_VALUE,width:\"124px\",value:null!==(b=g.brightness)&&void 0!==b?b:DEFAULT_VALUE.brightness,onChange:i,style:sliderStyle}),React.createElement(StyledSliderInput,{value:null!==(c=g.brightness)&&void 0!==c?c:DEFAULT_VALUE.brightness,onChange:function onChange(a){var b=a.target.value;return i(b)}})))};export default BrightnessOptions;","import{DEFAULT_ZOOM_FACTOR}from\"./constants\";var getZoomFitFactor=function(a,b){return Math.min(a.width/b.width,a.height/b.height)||DEFAULT_ZOOM_FACTOR};export default getZoomFitFactor;","import Custom from\"@scaleflex/icons/custom\";import Ellipse from\"@scaleflex/icons/ellipse\";import Landscape from\"@scaleflex/icons/landscape\";import Portrait from\"@scaleflex/icons/portrait\";import ImageOutline from\"@scaleflex/icons/image-outline\";import{CUSTOM_CROP,ELLIPSE_CROP,ORIGINAL_CROP}from\"../../../utils/constants\";import toPrecisedFloat from\"../../../utils/toPrecisedFloat\";export var DEFAULT_CROP_PRESETS=[{titleKey:\"custom\",ratio:CUSTOM_CROP,icon:Custom,hide:function hide(){var a=0n.width||d.height>n.height?getZoomFitFactor(n,d):DEFAULT_ZOOM_FACTOR}})),c()};return React.createElement(React.Fragment,null,React.createElement(StyledToolsBarItemButtonWrapper,null,React.createElement(StyledToolsBarItemButtonLabel,{className:\"FIE_crop-tool-label FIE_selected-crop-preset-label\",isPhoneScreen:r},g(l||\"cropTool\")),React.createElement(StyledOpenMenuButton,{className:\"FIE_crop-presets-opener-button\",color:\"link-secondary\",size:\"lg\"},b?React.createElement(MoveUpOutline,{size:10}):React.createElement(MoveDownOutline,{size:10}))),React.createElement(Menu,{className:\"FIE_crop-presets-menu\",anchorEl:b,enableOverlay:!0,onClose:c,open:!!b,position:\"top\",popperOptions:{modifiers:[{name:\"offset\",options:{offset:[0,4]}}]},maxHeight:\"100%\"},React.createElement(StyledMenu,null,s.map(function renderPreset(a){var b=a.titleKey,c=a.descriptionKey,d=a.ratio,e=a.width,f=a.height,h=a.groups,i=a.icon,j=a.disableManualResize,l=a.noEffect;return h?React.createElement(CropPresetGroupsList,{key:b,titleKey:b,groups:h,Icon:i,theme:p,onItemSelect:t,t:g,disableManualResize:j}):React.createElement(CropPresetItem,{key:d,ratio:null!==d&&void 0!==d?d:toPrecisedFloat(e/f),titleKey:b,t:g,description:g(c),Icon:i,isActive:(k||ORIGINAL_CROP)===(null!==d&&void 0!==d?d:toPrecisedFloat(e/f))&&!m,theme:p,width:e,height:f,onClick:t,disableManualResize:j,noEffect:l})}))))};CropPresetsOption.defaultProps={anchorEl:null};export default CropPresetsOption;","import _slicedToArray from\"@babel/runtime/helpers/slicedToArray\";import React,{useState}from\"react\";import{Crop as CropIcon}from\"@scaleflex/icons/crop\";import{useStore}from\"../../../hooks\";import ToolsBarItemButton from\"../../ToolsBar/ToolsBarItemButton\";import{TOOLS_IDS}from\"../../../utils/constants\";import{StyledToolsBarItemButtonLabel}from\"../../ToolsBar/ToolsBar.styled\";import CropPresetsOption from\"./CropPresetsOption\";var Crop=function(a){var b=a.selectTool,c=a.isSelected,d=useStore(),e=d.config,f=d.t,g=useState(),h=_slicedToArray(g,2),i=h[0],j=h[1];return React.createElement(ToolsBarItemButton,{className:\"FIE_crop-tool\",id:TOOLS_IDS.CROP,Icon:CropIcon,onClick:function selectToolAndShowPresets(a,c){b(a),j(c.currentTarget)},isSelected:c},e[TOOLS_IDS.CROP].noPresets?React.createElement(StyledToolsBarItemButtonLabel,{className:\"FIE_crop-tool-label\"},f(\"cropTool\")):React.createElement(CropPresetsOption,{anchorEl:i,onClose:function closeCropPresets(){j(null)}}))};Crop.defaultProps={isSelected:!1};export default Crop;","import React,{useCallback,useMemo}from\"react\";import{FlipX as FlipXIcon}from\"@scaleflex/icons/flip-x\";import ToolsBarItemButton from\"../../ToolsBar/ToolsBarItemButton\";import{FLIP_DIRECTIONS,TOOLS_IDS}from\"../../../utils/constants\";import{TOGGLE_FLIP}from\"../../../actions\";import{usePhoneScreen,useStore}from\"../../../hooks\";var xFlipReverseSideStyle={transform:\"scaleX(-1)\"},FlipX=function(a){var b=a.selectTool,c=a.isSelected,d=a.t,e=useStore(),f=e.dispatch,g=e.adjustments.isFlippedX,h=usePhoneScreen(320),i=useMemo(function(){return{reverseLabelOfCurrXFlipDir:g?d(\"unFlipX\"):d(\"flipX\"),reverseIconOfCurrXFlipDir:function(){return React.createElement(FlipXIcon,{size:h?20:16,style:g?xFlipReverseSideStyle:void 0})}}},[g]),j=i.reverseLabelOfCurrXFlipDir,k=i.reverseIconOfCurrXFlipDir,l=useCallback(function(){f({type:TOGGLE_FLIP,payload:{direction:FLIP_DIRECTIONS.X}})},[]),m=useCallback(function(a){b(a),l()},[]);return React.createElement(ToolsBarItemButton,{className:\"FIE_flip-x-tool-button\",id:TOOLS_IDS.FLIP_X,label:j,Icon:k,onClick:m,isSelected:c})};FlipX.defaultProps={isSelected:!1};export default FlipX;","import React,{useCallback,useMemo}from\"react\";import{FlipY as FlipYIcon}from\"@scaleflex/icons/flip-y\";import ToolsBarItemButton from\"../../ToolsBar/ToolsBarItemButton\";import{FLIP_DIRECTIONS,TOOLS_IDS}from\"../../../utils/constants\";import{TOGGLE_FLIP}from\"../../../actions\";import{usePhoneScreen,useStore}from\"../../../hooks\";var xFlipReverseSideStyle={transform:\"scaleY(-1)\"},FlipY=function(a){var b=a.selectTool,c=a.isSelected,d=a.t,e=useStore(),f=e.dispatch,g=e.adjustments.isFlippedY,h=usePhoneScreen(320),i=useMemo(function(){return{reverseLabelOfCurrXFlipDir:g?d(\"unFlipY\"):d(\"flipY\"),reverseIconOfCurrXFlipDir:function(){return React.createElement(FlipYIcon,{size:h?20:16,style:g?xFlipReverseSideStyle:void 0})}}},[g]),j=i.reverseLabelOfCurrXFlipDir,k=i.reverseIconOfCurrXFlipDir,l=useCallback(function(){f({type:TOGGLE_FLIP,payload:{direction:FLIP_DIRECTIONS.Y}})},[]),m=useCallback(function(a){b(a),l()},[]);return React.createElement(ToolsBarItemButton,{className:\"FIE_flip-y-tool-button\",id:TOOLS_IDS.FLIP_Y,label:j,Icon:k,onClick:m,isSelected:c})};FlipY.defaultProps={isSelected:!1};export default FlipY;","import React from\"react\";import{RotationLeft as RotateIcon}from\"@scaleflex/icons/rotation-left\";import ToolsBarItemButton from\"../../ToolsBar/ToolsBarItemButton\";import{TOOLS_IDS}from\"../../../utils/constants\";var RotateButton=function(a){var b=a.selectTool,c=a.isSelected,d=a.t;return React.createElement(ToolsBarItemButton,{className:\"FIE_rotate-tool-button\",id:TOOLS_IDS.ROTATE,label:d(\"rotateTool\"),Icon:RotateIcon,onClick:b,isSelected:c})};RotateButton.defaultProps={isSelected:!1};export default RotateButton;","import styled from\"styled-components\";import{IconButton,RotationSlider}from\"@scaleflex/ui/core\";import{Color as PC}from\"@scaleflex/ui/utils/types/palette\";var StyledRotationOptions=styled.div.withConfig({componentId:\"sc-wbx58r-0\"})([\"display:flex;align-items:center;gap:16px;\"]),StyledRotationSlider=styled(RotationSlider).withConfig({componentId:\"sc-wbx58r-1\"})([\".SfxRotationSlider-control{width:1px;height:10px;background-color:\",\";&:before{box-shadow:unset;}}.SfxRotationSlider-mark,.SfxRotationSlider-small-dot-wrapper{padding:0;.SfxRotationSlider-mark-text{top:10px;}.SfxRotationSlider-big-dot{width:4px;height:4px;}.SfxRotationSlider-small-dot{width:1px;height:1px;}}.SfxRotationSlider-list{gap:4px;}\"],function(a){var b=a.theme.palette;return b[PC.IconsSecondary]}),StyledRotateButton=styled(IconButton).withConfig({componentId:\"sc-wbx58r-2\"})([\"\"]);export{StyledRotationOptions,StyledRotationSlider,StyledRotateButton};","import React from\"react\";import RotationLeft from\"@scaleflex/icons/rotation-left\";import RotationRight from\"@scaleflex/icons/rotation-right\";import{Rotate90}from\"@scaleflex/icons\";import{useDebouncedCallback,usePhoneScreen,useStore}from\"../../../hooks\";import{CHANGE_ROTATION,SET_RESIZE}from\"../../../actions\";import restrictNumber from\"../../../utils/restrictNumber\";import getSizeAfterRotation from\"../../../utils/getSizeAfterRotation\";import{TOOLS_IDS}from\"../../../utils/constants\";import ToolsBarItemButton from\"../../ToolsBar/ToolsBarItemButton\";import{StyledRotationOptions,StyledRotationSlider,StyledRotateButton}from\"./Rotate.styled\";var RotateOptions=function(){var a=useStore(),b=a.dispatch,c=a.adjustments.rotation,d=void 0===c?0:c,e=a.resize,f=void 0===e?{}:e,g=a.config,h=g[TOOLS_IDS.ROTATE],i=usePhoneScreen(),j=useDebouncedCallback(function(a,c){var d=restrictNumber(c,-180,180);if(b({type:CHANGE_ROTATION,payload:{rotation:d}}),f.width&&f.height){var e=getSizeAfterRotation(f.width,f.height,d);b({type:SET_RESIZE,payload:{width:e.width,height:e.height}})}},20);return\"buttons\"===h.componentType?React.createElement(React.Fragment,null,React.createElement(ToolsBarItemButton,{className:\"FIE_rotate_button_left\",id:TOOLS_IDS.IMAGE,label:\"-\".concat(h.angle,\"\\xB0\"),Icon:RotationLeft,onClick:function changeRotationButtonNegative(a){var b=d-h.angle;j(a,b)}}),React.createElement(ToolsBarItemButton,{className:\"FIE_rotate_button_right\",id:TOOLS_IDS.IMAGE,label:\"+\".concat(h.angle,\"\\xB0\"),Icon:RotationRight,onClick:function changeRotationButtonPositive(a){var b=d+h.angle;j(a,b)}})):React.createElement(StyledRotationOptions,null,React.createElement(StyledRotationSlider,{className:\"FIE_rotate-slider\",showCurrentMarkText:!0,min:-180,max:180,step:i?h.angle/3:1,value:d,angle:h.angle||90,onChange:j}),React.createElement(StyledRotateButton,{size:\"sm\",color:\"basic\",onClick:function onClick(a){return j(a,d+90)}},React.createElement(Rotate90,{width:15})))};export default RotateOptions;","import React from\"react\";import{Contrast as ContrastIcon}from\"@scaleflex/icons/contrast\";import ToolsBarItemButton from\"../../ToolsBar/ToolsBarItemButton\";import{TOOLS_IDS}from\"../../../utils/constants\";var Contrast=function(a){var b=a.selectTool,c=a.isSelected,d=a.t;return React.createElement(ToolsBarItemButton,{className:\"FIE_contrast-tool-button\",id:TOOLS_IDS.CONTRAST,label:d(\"contrastTool\"),Icon:ContrastIcon,onClick:b,isSelected:c})};Contrast.defaultProps={isSelected:!1};export default Contrast;","import _slicedToArray from\"@babel/runtime/helpers/slicedToArray\";import React from\"react\";import Konva from\"konva\";import{useFinetune}from\"../../../hooks\";import restrictNumber from\"../../../utils/restrictNumber\";import Slider from\"../../common/Slider\";import{StyledSliderContainer,StyledSliderInput,StyledSliderLabel,StyledSliderWrapper}from\"../tools.styled\";var MIN_VALUE=-100,DEFAULT_VALUE={contrast:0},MAX_VALUE=100,sliderStyle={width:150,padding:0,margin:0},ContrastOptions=function(a){var b,c,d=a.t,e=useFinetune(Konva.Filters.Contrast,DEFAULT_VALUE),f=_slicedToArray(e,2),g=f[0],h=f[1],i=function(a){h({contrast:restrictNumber(a,MIN_VALUE,MAX_VALUE)})};return React.createElement(StyledSliderContainer,{className:\"FIE_contrast-option-wrapper\"},React.createElement(StyledSliderLabel,{className:\"FIE_contrast-option-label\"},d(\"contrastTool\")),React.createElement(StyledSliderWrapper,null,React.createElement(Slider,{className:\"FIE_contrast-option\",min:MIN_VALUE,max:MAX_VALUE,width:\"124px\",value:null!==(b=g.contrast)&&void 0!==b?b:DEFAULT_VALUE.contrast,onChange:i,style:sliderStyle}),React.createElement(StyledSliderInput,{value:null!==(c=g.contrast)&&void 0!==c?c:DEFAULT_VALUE.contrast,onChange:function onChange(a){var b=a.target.value;return i(b)}})))};export default ContrastOptions;","import React from\"react\";import{Saturation as SaturationIcon}from\"@scaleflex/icons/saturation\";import ToolsBarItemButton from\"../../ToolsBar/ToolsBarItemButton\";import{TOOLS_IDS}from\"../../../utils/constants\";var HSV=function(a){var b=a.selectTool,c=a.isSelected,d=a.t;return React.createElement(ToolsBarItemButton,{className:\"FIE_hsv-tool-button\",id:TOOLS_IDS.HSV,label:d(\"hsvTool\"),Icon:SaturationIcon,onClick:b,isSelected:c})};HSV.defaultProps={isSelected:!1};export default HSV;","import _defineProperty from\"@babel/runtime/helpers/defineProperty\";import _slicedToArray from\"@babel/runtime/helpers/slicedToArray\";import React from\"react\";import Konva from\"konva\";import{useFinetune,usePhoneScreen}from\"../../../hooks\";import Slider from\"../../common/Slider\";import{StyledHSVOptions,StyledSliderContainer,StyledSliderLabel,StyledSliderInput,StyledSliderWrapper}from\"../tools.styled\";var DEFAULT_VALUE={hue:0,saturation:0,value:0},MAX_VALUE={hue:259,saturation:10,value:2},sliderStyle={padding:0,margin:0},isPhoneScreen=usePhoneScreen(),HSVOptions=function(a){var b,c,d,e,f,g,h=a.t,i=useFinetune(Konva.Filters.HSV,DEFAULT_VALUE),j=_slicedToArray(i,2),k=j[0],l=j[1],m=function(a,b){l(_defineProperty({},a,b>MAX_VALUE[a]?MAX_VALUE[a]:+b))};return React.createElement(StyledHSVOptions,{isPhoneScreen:isPhoneScreen},React.createElement(StyledSliderContainer,{className:\"FIE_hue-option-wrapper\"},React.createElement(StyledSliderLabel,{className:\"FIE_hue-option-label\"},h(\"hue\")),React.createElement(StyledSliderWrapper,null,React.createElement(Slider,{className:\"FIE_hue-option\",min:0,step:1,max:259,value:null!==(b=k.hue)&&void 0!==b?b:DEFAULT_VALUE.hue,onChange:function onChange(a){return m(\"hue\",a)},style:sliderStyle}),React.createElement(StyledSliderInput,{value:null!==(c=k.hue)&&void 0!==c?c:DEFAULT_VALUE.hue,onChange:function onChange(a){var b=a.target.value;return m(\"hue\",b)}}))),React.createElement(StyledSliderContainer,{className:\"FIE_saturation-option-wrapper\"},React.createElement(StyledSliderLabel,{className:\"FIE_saturation-option-label\"},h(\"saturation\")),React.createElement(StyledSliderWrapper,null,React.createElement(Slider,{className:\"FIE_saturation-option\",min:-2,step:.5,max:10,value:null!==(d=k.saturation)&&void 0!==d?d:DEFAULT_VALUE.saturation,onChange:function onChange(a){return m(\"saturation\",a)},style:sliderStyle}),React.createElement(StyledSliderInput,{value:null!==(e=k.saturation)&&void 0!==e?e:DEFAULT_VALUE.saturation,onChange:function onChange(a){var b=a.target.value;return m(\"saturation\",b)}}))),React.createElement(StyledSliderContainer,{className:\"FIE_value-option-wrapper\"},React.createElement(StyledSliderLabel,{className:\"FIE_value-option-label\"},h(\"value\")),React.createElement(StyledSliderWrapper,null,React.createElement(Slider,{className:\"FIE_value-option\",min:-2,step:.1,max:2,value:null!==(f=k.value)&&void 0!==f?f:DEFAULT_VALUE.value,onChange:function onChange(a){return m(\"value\",a)},style:sliderStyle}),React.createElement(StyledSliderInput,{value:null!==(g=k.value)&&void 0!==g?g:DEFAULT_VALUE.value,onChange:function onChange(a){var b=a.target.value;return m(\"value\",b)}}))))};export default HSVOptions;","import React from\"react\";import{Blur as BlurIcon}from\"@scaleflex/icons/blur\";import ToolsBarItemButton from\"../../ToolsBar/ToolsBarItemButton\";import{TOOLS_IDS}from\"../../../utils/constants\";var Blur=function(a){var b=a.selectTool,c=a.isSelected,d=a.t;return React.createElement(ToolsBarItemButton,{className:\"FIE_blur-tool-button\",id:TOOLS_IDS.BLUR,label:d(\"blurTool\"),Icon:BlurIcon,onClick:b,isSelected:c})};Blur.defaultProps={isSelected:!1};export default Blur;","import _slicedToArray from\"@babel/runtime/helpers/slicedToArray\";import React from\"react\";import Konva from\"konva\";import{useFinetune}from\"../../../hooks\";import restrictNumber from\"../../../utils/restrictNumber\";import Slider from\"../../common/Slider\";import{StyledSliderContainer,StyledSliderInput,StyledSliderLabel,StyledSliderWrapper}from\"../tools.styled\";var MIN_VALUE=0,DEFAULT_VALUE={blurRadius:0},MAX_VALUE=100,sliderStyle={width:150,padding:0,margin:0},BlurOptions=function(a){var b,c,d=a.t,e=useFinetune(Konva.Filters.Blur,DEFAULT_VALUE),f=_slicedToArray(e,2),g=f[0],h=f[1],i=function(a){h({blurRadius:restrictNumber(a,MIN_VALUE,MAX_VALUE)})};return React.createElement(StyledSliderContainer,{className:\"FIE_blur-option-wrapper\"},React.createElement(StyledSliderLabel,{className:\"FIE_blur-option-label\"},d(\"blur\")),React.createElement(StyledSliderWrapper,null,React.createElement(Slider,{className:\"FIE_blur-option\",min:MIN_VALUE,max:MAX_VALUE,width:\"124px\",value:null!==(b=g.blurRadius)&&void 0!==b?b:DEFAULT_VALUE.blurRadius,onChange:i,style:sliderStyle}),React.createElement(StyledSliderInput,{value:null!==(c=g.blurRadius)&&void 0!==c?c:DEFAULT_VALUE.blurRadius,onChange:function onChange(a){var b=a.target.value;return i(b)}})))};export default BlurOptions;","import React from\"react\";import{Temprature as WarmthIcon}from\"@scaleflex/icons/tempreture\";import ToolsBarItemButton from\"../../ToolsBar/ToolsBarItemButton\";import{TOOLS_IDS}from\"../../../utils/constants\";var Warmth=function(a){var b=a.selectTool,c=a.isSelected,d=a.t;return React.createElement(ToolsBarItemButton,{className:\"FIE_warmth-tool-button\",id:TOOLS_IDS.WARMTH,label:d(\"warmthTool\"),Icon:WarmthIcon,onClick:b,isSelected:c})};Warmth.defaultProps={isSelected:!1};export default Warmth;","import _slicedToArray from\"@babel/runtime/helpers/slicedToArray\";import React from\"react\";import{useFinetune}from\"../../../hooks\";import restrictNumber from\"../../../utils/restrictNumber\";import{Warmth as CustomWarmth}from\"../../../custom/finetunes\";import Slider from\"../../common/Slider\";import{StyledSliderContainer,StyledSliderInput,StyledSliderLabel,StyledSliderWrapper}from\"../tools.styled\";var MIN_VALUE=0,DEFAULT_VALUE={warmth:0},MAX_VALUE=200,sliderStyle={width:150,padding:0,margin:0},WarmthOptions=function(a){var b,c,d=a.t,e=useFinetune(CustomWarmth,DEFAULT_VALUE),f=_slicedToArray(e,2),g=f[0],h=f[1],i=function(a){h({warmth:restrictNumber(a,MIN_VALUE,MAX_VALUE)})};return React.createElement(StyledSliderContainer,{className:\"FIE_warmth-option-wrapper\"},React.createElement(StyledSliderLabel,{className:\"FIE_warmth-option-label\"},d(\"warmthTool\")),React.createElement(StyledSliderWrapper,null,React.createElement(Slider,{className:\"FIE_warmth-option\",min:MIN_VALUE,max:MAX_VALUE,width:\"124px\",value:null!==(b=g.warmth)&&void 0!==b?b:DEFAULT_VALUE.warmth,onChange:i,style:sliderStyle}),React.createElement(StyledSliderInput,{value:null!==(c=g.warmth)&&void 0!==c?c:DEFAULT_VALUE.warmth,onChange:function onChange(a){var b=a.target.value;return i(b)}})))};export default WarmthOptions;","import styled,{css}from\"styled-components\";import{Color as PC}from\"@scaleflex/ui/utils/types/palette\";var StyledCarouselWrapper=styled.div.withConfig({componentId:\"sc-1nr0bka-0\"})([\"max-width:680px;min-width:150px;position:relative;overflow:hidden;touch-action:pan-y pinch-zoom;\"]),StyledCarousel=styled.ul.withConfig({componentId:\"sc-1nr0bka-1\"})([\"padding:0;margin:0;white-space:nowrap;overflow:hidden;\"]),StyledCarouselItem=styled.li.withConfig({componentId:\"sc-1nr0bka-2\"})([\"padding:4px;display:inline-block;list-style-type:none;user-select:none;\"]),arrowsCommonStyles=css([\"position:absolute;top:0;height:100%;width:60px;cursor:pointer;display:flex;align-items:center;justify-content:center;z-index:1;svg{color:\",\";}\"],function(a){var b=a.theme.palette;return b[PC.IconsSecondary]}),StyledPrevArrowWrapper=styled.div.withConfig({componentId:\"sc-1nr0bka-3\"})([\"\",\" left:0;justify-content:flex-start;background:linear-gradient( 90deg,#ffffff 1.56%,rgba(255,255,255,0.89) 52.4%,rgba(255,255,255,0.532165) 76.04%,rgba(255,255,255,0) 100% );\"],arrowsCommonStyles),StyledNextArrowWrapper=styled.div.withConfig({componentId:\"sc-1nr0bka-4\"})([\"\",\" right:0;justify-content:flex-end;background:linear-gradient( 270deg,#ffffff 1.56%,rgba(255,255,255,0.89) 52.4%,rgba(255,255,255,0.532165) 76.04%,rgba(255,255,255,0) 100% );\"],arrowsCommonStyles);export{StyledCarouselWrapper,StyledCarousel,StyledCarouselItem,StyledPrevArrowWrapper,StyledNextArrowWrapper};","import _slicedToArray from\"@babel/runtime/helpers/slicedToArray\";import React,{Children,useRef,useState,useEffect}from\"react\";import{ArrowLeftOutline,ArrowRightOutline}from\"@scaleflex/icons\";import{useResizeObserver}from\"../../../hooks\";import debounce from\"../../../utils/debounce\";import getScrollOffset from\"../../../utils/getScrollOffset\";import{StyledCarouselWrapper,StyledCarousel,StyledCarouselItem,StyledNextArrowWrapper,StyledPrevArrowWrapper}from\"./Carousel.styled\";var Carousel=function(a){var b=a.children,c=a.style,d=a.className,f=useRef(!1),g=useRef(),h=useResizeObserver(),i=_slicedToArray(h,1),j=i[0],k=useState(!1),l=_slicedToArray(k,2),m=l[0],n=l[1],o=useState(!1),p=_slicedToArray(o,2),q=p[0],r=p[1],s=Children.toArray(b),t=function(){if(g.current){var a=g.current,b=a.scrollWidth,c=a.offsetWidth,d=a.scrollLeft,e=Math.round(b-c),f=Math.round(e-d);n(0j,l=k?MAX_FILTER_PREVIEW_WIDTH:MAX_FILTER_PREVIEW_HEIGHT*j,m=k?MAX_FILTER_PREVIEW_WIDTH/j:MAX_FILTER_PREVIEW_HEIGHT;return React.createElement(StyledFilterItem,{className:\"FIE_filters-item\",onClick:h,\"aria-selected\":e},React.createElement(FilterItemPreview,{className:\"FIE_filters-item-preview\",width:MAX_FILTER_PREVIEW_WIDTH,height:MAX_FILTER_PREVIEW_HEIGHT},React.createElement(Layer,{onTap:h},React.createElement(Image,{image:f,filters:c?[c]:[],width:l,height:m,x:-(l-MAX_FILTER_PREVIEW_WIDTH)/2,y:-(m-MAX_FILTER_PREVIEW_HEIGHT)/2,ref:g}))),React.createElement(FilterItemLabel,{className:\"FIE_filters-item-label\"},b))};FilterItem.defaultProps={filterFn:void 0};export default memo(FilterItem);","import Konva from\"konva\";import*as CustomKonvaFilters from\"../../../custom/filters\";var konvaFilters=Konva.Filters;export var AVAILABLE_FILTERS=[{label:\"Original\",filterFn:null},{label:\"Invert\",filterFn:konvaFilters.Invert},{label:\"Black & White\",filterFn:CustomKonvaFilters.BlackAndWhite},{label:\"Sepia\",filterFn:konvaFilters.Sepia},{label:\"Solarize\",filterFn:konvaFilters.Solarize},{label:\"Clarendon\",filterFn:CustomKonvaFilters.Clarendon},{label:\"Gingham\",filterFn:CustomKonvaFilters.Gingham},{label:\"Moon\",filterFn:CustomKonvaFilters.Moon},{label:\"Lark\",filterFn:CustomKonvaFilters.Lark},{label:\"Reyes\",filterFn:CustomKonvaFilters.Reyes},{label:\"Juno\",filterFn:CustomKonvaFilters.Juno},{label:\"Slumber\",filterFn:CustomKonvaFilters.Slumber},{label:\"Crema\",filterFn:CustomKonvaFilters.Crema},{label:\"Ludwig\",filterFn:CustomKonvaFilters.Ludwig},{label:\"Aden\",filterFn:CustomKonvaFilters.Aden},{label:\"Perpetua\",filterFn:CustomKonvaFilters.Perpetua},{label:\"Amaro\",filterFn:CustomKonvaFilters.Amaro},{label:\"Mayfair\",filterFn:CustomKonvaFilters.Mayfair},{label:\"Rise\",filterFn:CustomKonvaFilters.Rise},{label:\"Hudson\",filterFn:CustomKonvaFilters.Hudson},{label:\"Valencia\",filterFn:CustomKonvaFilters.Valencia},{label:\"X-Pro II\",filterFn:CustomKonvaFilters.XPro2},{label:\"Sierra\",filterFn:CustomKonvaFilters.Sierra},{label:\"Willow\",filterFn:CustomKonvaFilters.Willow},{label:\"Lo-Fi\",filterFn:CustomKonvaFilters.LoFi},{label:\"Inkwell\",filterFn:konvaFilters.Grayscale},{label:\"Hefe\",filterFn:CustomKonvaFilters.Hefe},{label:\"Nashville\",filterFn:CustomKonvaFilters.Nashville},{label:\"Stinson\",filterFn:CustomKonvaFilters.Stinson},{label:\"Vesper\",filterFn:CustomKonvaFilters.Vesper},{label:\"Earlybird\",filterFn:CustomKonvaFilters.Earlybird},{label:\"Brannan\",filterFn:CustomKonvaFilters.Brannan},{label:\"Sutro\",filterFn:CustomKonvaFilters.Sutro},{label:\"Toaster\",filterFn:CustomKonvaFilters.Toaster},{label:\"Walden\",filterFn:CustomKonvaFilters.Walden},{label:\"1977\",filterFn:CustomKonvaFilters.NinteenSeventySeven},{label:\"Kelvin\",filterFn:CustomKonvaFilters.Kelvin},{label:\"Maven\",filterFn:CustomKonvaFilters.Maven},{label:\"Ginza\",filterFn:CustomKonvaFilters.Ginza},{label:\"Skyline\",filterFn:CustomKonvaFilters.Skyline},{label:\"Dogpatch\",filterFn:CustomKonvaFilters.Dogpatch},{label:\"Brooklyn\",filterFn:CustomKonvaFilters.Brooklyn},{label:\"Helena\",filterFn:CustomKonvaFilters.Helena},{label:\"Ashby\",filterFn:CustomKonvaFilters.Ashby},{label:\"Charmes\",filterFn:CustomKonvaFilters.Charmes}];","import _slicedToArray from\"@babel/runtime/helpers/slicedToArray\";import React from\"react\";import{useFilter,useStore}from\"../../../hooks\";import Carousel from\"../../common/Carousel\";import FilterItem from\"./FilterItem\";import{AVAILABLE_FILTERS}from\"./Filters.constants\";var style={maxWidth:\"100%\",width:\"100%\"},Filters=function(){var a=useStore(),b=a.originalImage,c=useFilter(),d=_slicedToArray(c,2),e=d[0],f=d[1];return React.createElement(Carousel,{className:\"FIE_filters\",style:style},AVAILABLE_FILTERS.map(function(a){return React.createElement(FilterItem,{key:a.label,filterLabel:a.label,filterFn:a.filterFn,applyFilter:f,isActive:e===a.filterFn,image:b})}))};export default Filters;","import React from\"react\";import{Text as TextIcon}from\"@scaleflex/icons/text\";import ToolsBarItemButton from\"../../ToolsBar/ToolsBarItemButton\";import{TOOLS_IDS}from\"../../../utils/constants\";var TextButton=function(a){var b=a.selectTool,c=a.isSelected,d=a.t;return React.createElement(ToolsBarItemButton,{className:\"FIE_text-tool-button\",id:TOOLS_IDS.TEXT,label:d(\"textTool\"),Icon:TextIcon,onClick:b,isSelected:c})};TextButton.defaultProps={isSelected:!1};export default TextButton;","import styled from\"styled-components\";import Label from\"@scaleflex/ui/core/label\";import{Color as PC}from\"@scaleflex/ui/utils/types/palette\";var StyledOptions=styled.div.withConfig({componentId:\"sc-qvjmv1-0\"})([\"display:flex;align-items:center;justify-content:center;padding:8px 16px;margin-top:4px;gap:8px;flex-wrap:wrap;\",\" svg{color:\",\";}\"],function(a){var b=a.isPhoneScreen;return b&&\"\\n max-width: 315px;\\n padding: 0;\\n \"},function(a){var b=a.theme.palette;return b[PC.IconsPrimary]}),StyledOptionsWrapper=styled.div.withConfig({componentId:\"sc-qvjmv1-1\"})([\"display:flex;flex-wrap:wrap;margin-left:-4px;gap:4px;.FIE_annotation-option-triggerer{padding:6px;}\"]),StyledOptionPopupContent=styled.div.withConfig({componentId:\"sc-qvjmv1-2\"})([\"background:\",\";border-radius:4px;display:flex;flex-direction:column;padding:8px 12px;overflow:visible;\",\" \",\" *{font-family:'Roboto',sans-serif;}\"],function(a){var b=a.theme;return b.palette[\"bg-secondary\"]},function(a){var b=a.position;return b&&\"\\n display: grid;\\n grid-template-columns: repeat(4, auto);\\n padding: 0;\\n margin-top: 8px;\\n box-shadow: 0px 1px 2px \".concat(function(a){var b=a.theme;return b.palette[\"light-shadow\"]},\";\\n \")},function(a){var b=a.disablePadding;return b&&\"\\n padding: 0;\\n \"}),StyledSpacedOptionFields=styled.div.withConfig({componentId:\"sc-qvjmv1-3\"})([\"display:flex;align-items:center;gap:12px;\",\"\"],function(a){var b=a.preventFlex;return b&&\"\\n display: block;\\n\\n label {\\n margin-bottom: 8px;\\n }\\n \"}),StyledTwoColumnsContainer=styled.div.withConfig({componentId:\"sc-qvjmv1-4\"})([\"display:flex;align-items:center;justify-content:space-between;\"]),StyledColumn=styled.div.withConfig({componentId:\"sc-qvjmv1-5\"})([\"&:not(:first-child){margin-left:12px;}\"]),StyledIconWrapper=styled.div.withConfig({componentId:\"sc-qvjmv1-6\"})(function(a){var b=a.theme,c=a.addThinBorder,d=a.secondaryIconColor,e=a.active,f=a.watermarkTool;return\"\\n cursor: pointer;\\n padding: \".concat(f?\"6px\":\"8px 12px\",\";\\n border-radius: 2px;\\n display: flex;\\n justify-content: center;\\n align-items: center;\\n gap: 6px;\\n\\n svg {\\n vertical-align: middle;\\n margin: 0 auto;\\n }\\n\\n \").concat(c?\"border: 0.5px solid \".concat(b.palette[\"borders-secondary\"],\";\\n padding: 8px 8px;\"):\"\",\";\\n color: \").concat(d?b.palette[PC.IconsSecondary]:\"\",\";\\n\\n \").concat(e&&\"\\n border-radius: 4px;\\n border-color: \".concat(b.palette[PC.AccentStateless],\";\\n background-color: \").concat(b.palette[PC.BackgroundActive],\";\\n\\n * {\\n color: \").concat(b.palette[PC.AccentStateless],\";\\n }\\n \"),\"\\n\\n :hover {\\n background: \").concat(b.palette[\"bg-primary-active\"],\";\\n }\\n \")}),StyledIconLabel=styled(Label).withConfig({componentId:\"sc-qvjmv1-7\"})([\"color:\",\";\"],function(a){var b=a.theme.palette;return b[PC.TextPrimary]});export{StyledTwoColumnsContainer,StyledColumn,StyledIconWrapper,StyledSpacedOptionFields,StyledOptions,StyledOptionsWrapper,StyledOptionPopupContent,StyledIconLabel};","import React from\"react\";import restrictNumber from\"../../../utils/restrictNumber\";import{Label}from\"@scaleflex/ui/core\";import{StyledSpacedOptionFields,StyledIconLabel,StyledOptionPopupContent}from\"./AnnotationOptions.styled\";import Slider from\"../Slider\";var MIN_PERCENTANGE=0,MAX_PERCENTANGE=1,OpacityField=function(a){var b=a.annotation,c=a.updateAnnotation,d=a.t,e=b.opacity,f=Math.round(100*e);return React.createElement(StyledOptionPopupContent,{disablePadding:!0},React.createElement(Label,null,d(\"transparency\")),React.createElement(StyledSpacedOptionFields,null,React.createElement(Slider,{annotation:\"%\",onChange:function changeOpacity(a){c({opacity:restrictNumber(a/100,MIN_PERCENTANGE,MAX_PERCENTANGE)})},value:f,noMargin:!0}),React.createElement(StyledIconLabel,null,\"\".concat(f,\"%\"))))};export default OpacityField;","import{Modal,ModalActions as SfxModalActions}from\"@scaleflex/ui/core\";import styled from\"styled-components\";import{Color as PC}from\"@scaleflex/ui/utils/types/palette\";var ColorPickerModal=styled(Modal).withConfig({componentId:\"sc-7tf41j-0\"})([\"max-width:350px;\"]),ColorPickerWrap=styled.div.withConfig({componentId:\"sc-7tf41j-1\"})([\".SfxColorPicker-root{max-width:100%;padding:0;box-shadow:none;border:none;\",\"}.SfxColorPicker-action{display:flex;gap:12px;.SfxColorPicker-select{width:100px;}.SfxInput-root{width:190px !important;}}.SfxColorPicker-icon{color:\",\";}.SfxColorPicker-range-picker,.SfxColorPicker-bar-wrapper{width:100%;}\"],function(a){var b=a.hideModalTitle;return b&&\"padding-top: 12px;\"},function(a){var b=a.theme.palette;return b[PC.IconsPrimary]}),ModalActions=styled(SfxModalActions).withConfig({componentId:\"sc-7tf41j-2\"})([\"gap:12px;padding:24px;.SfxButton-root{flex:1;margin:0;height:40px;}\"]),Styled={ColorPickerModal:ColorPickerModal,ColorPickerWrap:ColorPickerWrap,ModalActions:ModalActions};export default Styled;","import React from\"react\";import{Button,ColorPicker,ModalContent,ModalTitle}from\"@scaleflex/ui/core\";import ColorPickerIcon from\"@scaleflex/icons/color-picker\";import{useStore}from\"../../../hooks\";import Styled from\"./ColorPickerModal.styled\";var modalStyles={zIndex:1301},ColorPickerModal=function(a){var b=a.hideModalTitle,c=a.defaultColor,d=void 0===c?\"\":c,e=a.onChange,f=a.open,g=a.pinnedColors,h=a.onClose,i=a.onApply,j=useStore(),k=j.t;return f?React.createElement(Styled.ColorPickerModal,{onClose:h,open:f,fullWidth:!0,modalStyles:modalStyles},!b&&React.createElement(ModalTitle,{onClose:h,primary:k(\"colorPickerModalTitleLabel\",\"Pick color\"),icon:React.createElement(ColorPickerIcon,{size:29}),iconShadow:!0,variant:\"with-icon\"}),React.createElement(ModalContent,null,React.createElement(Styled.ColorPickerWrap,{hideModalTitle:b},React.createElement(ColorPicker,{onChange:e,pinnedColors:g,defaultColor:d,showTransparentColor:!0}))),React.createElement(Styled.ModalActions,null,React.createElement(Button,{color:\"basic\",onClick:h},k(\"cancel\")),React.createElement(Button,{color:\"primary\",onClick:i},k(\"apply\")))):null};ColorPickerModal.defaultProps={defaultColor:\"\",pinnedColors:[],onChange:function onChange(){},open:!1,hideModalTitle:!1,onClose:function onClose(){},onApply:function onApply(){}};export default ColorPickerModal;","import styled from\"styled-components\";import{Color as PC}from\"@scaleflex/ui/utils/types/palette\";var StyledPickerTrigger=styled.div.attrs(function(a){var b=a.$color;return{style:{background:\"rgba(0,0,0,0)\"===b?\"repeating-conic-gradient(#5d6d7e 0% 25%, transparent 0% 50%) 50% / 8px 8px\":b}}}).withConfig({componentId:\"sc-zmv0gj-0\"})([\"background:\",\";border-radius:4px;width:32px;height:32px;border:1px solid \",\";cursor:pointer;box-sizing:border-box;\"],function(a){var b=a.theme;return b.palette[\"icons-primary\"]},function(a){var b=a.theme;return b.palette[PC.BorderPrimaryStateless]});export{StyledPickerTrigger};","import _defineProperty from\"@babel/runtime/helpers/defineProperty\";import _slicedToArray from\"@babel/runtime/helpers/slicedToArray\";import React,{useEffect,useRef,useState}from\"react\";import{useStore}from\"../../../hooks\";import{SET_LATEST_COLOR}from\"../../../actions\";import ColorPickerModal from\"../ColorPickerModal\";import{StyledPickerTrigger}from\"./ColorInput.styled\";var pinnedColorsKey=\"FIE_pinnedColors\",ColorInput=function(a){var b,c=a.onChange,d=a.color,e=a.colorFor,f=useStore(),g=f.selectionsIds,h=void 0===g?[]:g,i=f.config.annotationsCommon,j=void 0===i?{}:i,k=f.dispatch,l=f.latestColors,m=void 0===l?{}:l,n=m[e],o=useState(),p=_slicedToArray(o,2),q=p[0],r=p[1],s=useState(function(){return n||d||j.fill}),t=_slicedToArray(s,2),u=t[0],v=t[1],w=useState(null!==(b=window)&&void 0!==b&&b.localStorage?JSON.parse(localStorage.getItem(pinnedColorsKey)||\"[]\"):[]),x=_slicedToArray(w,2),y=x[0],z=x[1],A=useRef(u),B=function(a){var b;if(null!==(b=window)&&void 0!==b&&b.localStorage){var c=window.localStorage.getItem(pinnedColorsKey);if(JSON.stringify(a)!==c){var d=a.slice(-9);window.localStorage.setItem(pinnedColorsKey,JSON.stringify(d)),z(d)}}},C=function(a){r(q?null:a.currentTarget)};return useEffect(function(){var a=0===h.length&&n||d;v(a),c(a)},[d,h]),React.createElement(React.Fragment,null,React.createElement(StyledPickerTrigger,{className:\"FIE_color-picker-triggerer\",onClick:C,$color:u,onChange:c}),React.createElement(ColorPickerModal,{hideModalTitle:!0,onChange:function changeColor(a,b,d){v(b),c(b),B(d),n!==b&&k({type:SET_LATEST_COLOR,payload:{latestColors:_defineProperty({},e,b)}})},defaultColor:u,pinnedColors:y,open:!!q,onClose:function closePicker(a){c(A.current||u),C(a)},onApply:C}))};ColorInput.defaultProps={color:void 0};export default ColorInput;","import React from\"react\";import restrictNumber from\"../../../utils/restrictNumber\";import ColorInput from\"../ColorInput\";import{StyledSpacedOptionFields}from\"./AnnotationOptions.styled\";import Slider from\"../Slider\";var MIN_PERCENTANGE=0,MAX_PERCENTANGE=100,StrokeFields=function(a){var b=a.annotation,c=a.updateAnnotation,d=b.stroke,e=b.strokeWidth;return React.createElement(StyledSpacedOptionFields,null,React.createElement(Slider,{annotation:\"px\",onChange:function changeStrokeWidth(a){c({strokeWidth:restrictNumber(a,MIN_PERCENTANGE,MAX_PERCENTANGE)})},value:e,noMargin:!0}),React.createElement(ColorInput,{color:d,onChange:function changeStrokeColor(a){c({stroke:a})},colorFor:\"stroke\"}))};export default StrokeFields;","import _defineProperty from\"@babel/runtime/helpers/defineProperty\";import React from\"react\";import Label from\"@scaleflex/ui/core/label\";import restrictNumber from\"../../../utils/restrictNumber\";import ColorInput from\"../ColorInput\";import{StyledTwoColumnsContainer,StyledColumn,StyledSpacedOptionFields}from\"./AnnotationOptions.styled\";import Slider from\"../Slider\";var ShadowFields=function(a){var b=a.annotation,c=a.updateAnnotation,d=a.t,e=b.shadowOffsetX,f=b.shadowOffsetY,g=b.shadowBlur,h=b.shadowColor,i=b.shadowOpacity,j=function(a,b){var d=2parseFloat(k))){var m=Math.min(10*h.width,10*h.height),o=getSizeAfterRotation(h.width,h.height,n),p=_defineProperty({},f,k?restrictNumber(k,0,m):k),q=\"height\"===f,r=q?\"width\":\"height\",s=null!==(d=c.ratioUnlocked)&&void 0!==d?d:i.ratioUnlocked;if(!s){var t=o.width/o.height;p[r]=q?Math.round(p[f]*t):Math.round(p[f]/t)}if(p[f]!==i[f]||p[r]!==i[r]){if(\"function\"==typeof b)return void b(p);g({type:SET_RESIZE,payload:p});var u=l.width&&l.height&&l||j,v=_objectSpread(_objectSpread({},i),p);g({type:ZOOM_CANVAS,payload:{factor:v.width&&v.height?getZoomFitFactor(u,v):DEFAULT_ZOOM_FACTOR,isAbsoluteZoom:!0}})}}},r=\"undefined\"==typeof i.width&&\"undefined\"==typeof i.height||h.width===i.width&&h.height===i.height,s=getProperDimensions((c.width||c.height)&&c||i,l,j,h,n),t=i.manualChangeDisabled,u=\"undefined\"!=typeof i.width&&!i.width,v=\"undefined\"!=typeof i.height&&!i.height;return React.createElement(StyledResizeWrapper,{className:\"FIE_resize-tool-options\",alignment:e},React.createElement(StyledResizeInput,{className:\"FIE_resize-width-option\",value:u?\"\":s.width,name:\"width\",onChange:t?void 0:q,inputMode:\"numeric\",title:p(\"resizeWidthTitle\"),label:p(\"width\"),inputProps:{type:\"number\"},size:\"sm\",iconEnd:\"px\",placeholder:\"Width\",disabled:t}),React.createElement(StyledRatioLockIcon,{className:\"FIE_resize-ratio-locker\",title:p(\"toggleRatioLockTitle\"),onClick:t?void 0:function toggleRatioLock(){return\"function\"==typeof b?void b({ratioUnlocked:!c.ratioUnlocked}):void g({type:SET_RESIZE,payload:{ratioUnlocked:!i.ratioUnlocked}})},color:\"basic\",size:\"sm\",disabled:t},c.ratioUnlocked||i.ratioUnlocked?React.createElement(UnlockOutline,{size:16,color:o.palette.success}):React.createElement(LockOutline,{size:16,color:o.palette.error})),React.createElement(StyledResizeInput,{className:\"FIE_resize-height-option\",value:v?\"\":s.height,name:\"height\",onChange:t?void 0:q,inputMode:\"numeric\",title:p(\"resizeHeightTitle\"),label:p(\"height\"),inputProps:{type:\"number\"},size:\"sm\",iconEnd:\"px\",placeholder:\"Height\",disabled:t}),!d&&React.createElement(StyledResetButton,{className:\"FIE_resize-reset-button\",size:\"sm\",color:\"basic\",onClick:r||t?void 0:function resetResize(){g({type:SET_RESIZE,payload:{width:void 0,height:void 0,ratioUnlocked:!1}});var a=l.width&&l.height&&l||j;g({type:ZOOM_CANVAS,payload:{factor:getZoomFitFactor(a,a)}})},disabled:r||t},React.createElement(Reset,null)))};Resize.defaultProps={onChange:void 0,currentSize:{},hideResetButton:!1,alignment:\"center\"};export default Resize;","import styled from\"styled-components\";var StyledWatermarkWrapper=styled.div.withConfig({componentId:\"sc-fvaj5j-0\"})([\"display:flex;align-items:center;justify-content:center;flex-wrap:wrap;gap:8px;overflow:hidden;\",\";\"],function(a){var b=a.noWrap;return b?\"flex-wrap: nowrap;\":\"\"}),StyledControlsWrapper=styled.div.withConfig({componentId:\"sc-fvaj5j-1\"})([\"margin-bottom:8px;\"]),StyledWatermarkGalleryItem=styled.div.withConfig({componentId:\"sc-fvaj5j-2\"})(function(a){var b=a.theme;return\"\\n padding: 6px 4px;\\n border: 1px solid \".concat(b.palette[\"borders-secondary\"],\";\\n width: fit-content;\\n height: 32px;\\n border-radius: 2px;\\n overflow: hidden;\\n cursor: pointer;\\n border-radius: 4px;\\n\\n :hover {\\n background: \").concat(b.palette[\"bg-primary-active\"],\";\\n }\\n\\n &[aria-selected='true'] {\\n background: \").concat(b.palette[\"bg-primary-active\"],\";\\n border-color: \").concat(b.palette[\"accent-primary-active\"],\";\\n }\\n\\n img {\\n max-width: 100%;\\n max-height: 100%;\\n }\\n \")});export{StyledWatermarkWrapper,StyledControlsWrapper,StyledWatermarkGalleryItem};","import React,{useMemo}from\"react\";import{useStore}from\"../../../hooks\";import{TOOLS_IDS,WATERMARK_ANNOTATION_ID}from\"../../../utils/constants\";import Carousel from\"../../common/Carousel\";import{SET_FEEDBACK}from\"../../../actions\";import{StyledWatermarkGalleryItem}from\"./Watermark.styled\";var WatermarksGallery=function(a){var b=a.addImgWatermark,c=a.loadAndSetWatermarkImg,d=a.style,e=useStore(),f=e.config,g=e.annotations,h=e.dispatch,i=e.t,j=useMemo(function(){var a;return null===(a=(g[WATERMARK_ANNOTATION_ID]||{}).image)||void 0===a?void 0:a.src},[g[WATERMARK_ANNOTATION_ID]]),k=function(a){var c=a.currentTarget.children[0];if(c.complete){if(!c.naturalWidth)return void h({type:SET_FEEDBACK,payload:{feedback:{message:i(\"mutualizedFailedToLoadImg\"),duration:2e3}}});b(c)}},l=f[TOOLS_IDS.WATERMARK]||{},m=l.gallery,n=void 0===m?[]:m;return 0===n.length?null:React.createElement(Carousel,{className:\"FIE_watermark-gallery\",style:d},n.map(function(a){var b=(null===a||void 0===a?void 0:a.url)||a,d=(null===a||void 0===a?void 0:a.previewUrl)||b;return React.createElement(StyledWatermarkGalleryItem,{className:\"FIE_watermark-selected-item\",onClick:function onClick(a){return b===d?k(a):c(b)},key:b,\"aria-selected\":b===j},React.createElement(\"img\",{src:d,alt:\"Failed to load.\",crossOrigin:\"Anonymous\",draggable:!1}))}))};WatermarksGallery.defaultProps={style:void 0};export default WatermarksGallery;","import _slicedToArray from\"@babel/runtime/helpers/slicedToArray\";import React,{useState}from\"react\";import Menu from\"@scaleflex/ui/core/menu\";import Padding from\"@scaleflex/icons/padding\";import restrictNumber from\"../../../utils/restrictNumber\";import{StyledSpacedOptionFields,StyledIconWrapper,StyledOptionPopupContent,StyledIconLabel}from\"../../common/AnnotationOptions/AnnotationOptions.styled\";import Slider from\"../../common/Slider\";import{Label}from\"@scaleflex/ui/core\";var WatermarkPadding=function(a){var b=a.watermark,c=a.saveWatermark,d=a.t,e=useState(null),f=_slicedToArray(e,2),g=f[0],h=f[1],i=b.padding||0;return React.createElement(React.Fragment,null,React.createElement(StyledIconWrapper,{className:\"FIE_watermark-padding-triggerer\",title:d(\"padding\"),onClick:function openOptionPopup(a){h(a.currentTarget)},active:g},React.createElement(Padding,{size:20})),React.createElement(Menu,{className:\"FIE_watermark-padding-popup\",anchorEl:g,open:!!g,onClose:function closeOptionPopup(){h(null)},position:\"top\"},React.createElement(StyledOptionPopupContent,null,React.createElement(Label,null,d(\"padding\")),React.createElement(StyledSpacedOptionFields,null,React.createElement(Slider,{annotation:\"px\",onChange:function updatePadding(a){c({padding:restrictNumber(a,0,100)})},value:i,noMargin:!0}),React.createElement(StyledIconLabel,null,\"\".concat(i,\"px\"))))))};export default WatermarkPadding;","import _defineProperty from\"@babel/runtime/helpers/defineProperty\";import _slicedToArray from\"@babel/runtime/helpers/slicedToArray\";function ownKeys(a,b){var c=Object.keys(a);if(Object.getOwnPropertySymbols){var d=Object.getOwnPropertySymbols(a);b&&(d=d.filter(function(b){return Object.getOwnPropertyDescriptor(a,b).enumerable})),c.push.apply(c,d)}return c}function _objectSpread(a){for(var b,c=1;cr?s*w/c:r*w/b,g=_objectSpread(_objectSpread(_objectSpread({},e.annotationsCommon),e[TOOLS_IDS.IMAGE]),{},{scaleX:d,scaleY:d,padding:1,image:a,width:b,height:c,x:t+r/2-b*d/2,y:u+s/2-c*d/2,id:WATERMARK_ANNOTATION_ID,name:TOOLS_IDS.IMAGE,replaceCurrent:!0});f({type:SET_ANNOTATION,payload:g})},y=function(a){f({type:SET_ANNOTATION,payload:_objectSpread(_objectSpread({},\"function\"==typeof a?a(q):a),{},{id:WATERMARK_ANNOTATION_ID})})},z=function(a){f({type:SET_FEEDBACK,payload:{feedback:{message:a,status:FEEDBACK_STATUSES.WARNING}}})},A=function(a,b){if(a){n(!0);var c=new Image;c.onload=function(){x(c),b&&URL.revokeObjectURL(a),n(!1)},c.onerror=function(){z(g(\"mutualizedFailedToLoadImg\")),b&&URL.revokeObjectURL(a),n(!1)},c.src=a}};useEffect(function(){q&&(f({type:CLEAR_ANNOTATIONS_SELECTIONS}),f({type:SELECT_ANNOTATION,payload:{annotationId:\"watermark\"}}))},[q]),useEffect(function(){q&&(0===d.length||d[0].id!==WATERMARK_ANNOTATION_ID)&&f({type:SELECT_ANNOTATION,payload:{annotationId:\"watermark\"}})},[d]);var B=[(!e.useCloudimage||\"function\"==typeof p.onUploadWatermarkImgClick)&&{key:\"upload-watermark\",label:g(\"uploadWatermark\"),icon:UploadOutline,onClick:function handleUploadWatermarkClick(){if(\"function\"==typeof p.onUploadWatermarkImgClick){var a=p.onUploadWatermarkImgClick(A);return void(a instanceof Promise&&a.then(function(){var a=0b.factor,f={x:(a.x-b.x||0)/b.factor,y:(a.y-b.y||0)/b.factor},g={x:a.x-f.x*a.factor,y:a.y-f.y*a.factor};if(e&&1===b.factor||(g.x=Math.min(0,Math.max(g.x,c*(1-b.factor))),g.y=Math.min(0,Math.max(g.y,d*(1-b.factor)))),1>a.factor){var h=c-c*a.factor,i=d-d*a.factor;g.x+=h/2,g.y+=i/2}return _objectSpread(_objectSpread({},g),{},{factor:a.factor})};export default calculateZoomData;","import _defineProperty from\"@babel/runtime/helpers/defineProperty\";import _objectWithoutProperties from\"@babel/runtime/helpers/objectWithoutProperties\";var _excluded=[\"preparedDimensions\"];function ownKeys(a,b){var c=Object.keys(a);if(Object.getOwnPropertySymbols){var d=Object.getOwnPropertySymbols(a);b&&(d=d.filter(function(b){return Object.getOwnPropertyDescriptor(a,b).enumerable})),c.push.apply(c,d)}return c}function _objectSpread(a){for(var b,c=1;cf.x+f.width&&(g.width=f.x+f.width-g.x),g.y+g.height>f.y+f.height&&(g.height=f.y+f.height-g.y),\"number\"==typeof d&&!compareRatios(g.width/g.height,d)){var h=g.height*d,i=g.width/d;toPrecisedFloat(g.y+i)<=f.y+f.height?g.height=i:g.width=h}if((e.minWidth&&g.width<=e.minWidth||e.maxWidth&&g.width>=e.maxWidth)&&(g.width=restrictNumber(g.width,e.minWidth,e.maxWidth),g.x=a.x,g.y=a.y,\"number\"==typeof d&&(g.height=g.width/d)),(e.minHeight&&b.height<=e.minHeight||e.maxHeight&&b.height>=e.maxHeight)&&(g.height=restrictNumber(g.height,e.minHeight,e.maxHeight),g.x=a.x,g.y=a.y,\"number\"==typeof d&&(g.width=g.height*d)),\"string\"==typeof e.lockCropAreaAt){var j=getPositionByPlaceLabel(e.lockCropAreaAt,f,g),k=j.x,l=j.y;g.x=k,g.y=l}return g};","import _extends from\"@babel/runtime/helpers/extends\";import _defineProperty from\"@babel/runtime/helpers/defineProperty\";function ownKeys(a,b){var c=Object.keys(a);if(Object.getOwnPropertySymbols){var d=Object.getOwnPropertySymbols(a);b&&(d=d.filter(function(b){return Object.getOwnPropertyDescriptor(a,b).enumerable})),c.push.apply(c,d)}return c}function _objectSpread(a){for(var b,c=1;c=n.width&&j.height>=n.height;n.width&&n.height&&(df.scaledBy?f.scaledBy:1,J=_objectSpread(_objectSpread({},f),{},{width:f.width/I,height:f.height/I});F=boundResizing(J,_objectSpread(_objectSpread({},J),{},{x:0,y:0}),_objectSpread(_objectSpread({},J),{},{abstractX:0,abstractY:0}),!(A||B)&&C(),v)}else F=j;var K=F,L=K.x,M=void 0===L?0:L,x=K.y,N=void 0===x?0:x,y=K.width,O=K.height,P={x:k?f.width-M-y:M,y:l?f.height-N-O:N,ref:q,fill:\"#FFFFFF\",scaleX:1,scaleY:1,globalCompositeOperation:\"destination-out\",onDragEnd:w?void 0:H,onDragMove:w?void 0:function limitDragging(a){var b=a.target;b.setAttrs(boundDragging(b.attrs,t.current))},onTransformEnd:w?void 0:H,draggable:!w};return React.createElement(React.Fragment,null,React.createElement(Image,{image:e,x:k?f.width:0,y:l?f.height:0,width:f.width,height:f.height,filters:[Konva.Filters.Blur,Konva.Filters.Brighten],blurRadius:10,brightness:-.3,scaleX:k?-1:1,scaleY:l?-1:1,ref:s}),B?React.createElement(Ellipse,_extends({},P,{radiusX:y/2,radiusY:O/2,offset:{x:-y/2,y:-O/2}})):React.createElement(Rect,_extends({},P,{width:j.noEffect?0:y,height:j.noEffect?0:O})),j.noEffect&&React.createElement(TextNode,{name:\"Text\",id:\"no-preview-text-node\",text:p(\"cropItemNoEffect\"),x:f.width/2-noEffectTextDimensions.width/2,y:f.height/2-noEffectTextDimensions.height/2,fontSize:20,fill:\"#ffffff\",stroke:\"#ff0000\",strokeWidth:.2,shadowColor:\"#ff0000\",shadowBlur:10,annotationEvents:{},align:\"center\",width:noEffectTextDimensions.width,height:noEffectTextDimensions.height}),React.createElement(Transformer,{centeredScaling:!1,flipEnabled:!1,rotateEnabled:!1,nodes:q.current?[q.current]:[],anchorSize:14,anchorCornerRadius:7,enabledAnchors:G,ignoreStroke:!1,anchorStroke:c.palette[\"accent-primary\"],anchorFill:c.palette[\"access-primary\"],anchorStrokeWidth:2,borderStroke:c.palette[\"accent-primary\"],borderStrokeWidth:2,borderDash:[4],keepRatio:!A||!B,ref:r,boundBoxFunc:function boundBoxFunc(a,b){return boundResizing(a,b,t.current,!(A||B)&&C(),v)}}))};export default CropTransformer;","import React,{useMemo}from\"react\";import{Transformer}from\"react-konva\";import{NODES_TRANSFORMER_ID,POINTER_ICONS,TOOLS_IDS}from\"../../../utils/constants\";import{useStore}from\"../../../hooks\";import{CHANGE_POINTER_ICON,ENABLE_TEXT_CONTENT_EDIT}from\"../../../actions\";var NodesTransformer=function(){var a,b=useStore(),c=b.selectionsIds,d=void 0===c?[]:c,e=b.theme,f=b.designLayer,g=b.dispatch,h=b.config.useCloudimage,i=useMemo(function(){return null!==f&&void 0!==f&&f.findOne?d.map(function(a){return f.findOne(\"#\".concat(a))}).filter(Boolean):[]},[d]),j=function(){1===i.length&&i[0].name()===TOOLS_IDS.TEXT&&g({type:ENABLE_TEXT_CONTENT_EDIT,payload:{textIdOfEditableContent:i[0].id()}})},k=h?[\"top-left\",\"bottom-left\",\"top-right\",\"bottom-right\"]:void 0;return React.createElement(Transformer,{id:NODES_TRANSFORMER_ID,centeredScaling:!1,rotationSnaps:[0,45,90,135,180,225,270,315],nodes:i,rotateAnchorOffset:30,anchorSize:14,anchorCornerRadius:7,padding:1===i.length?null!==(a=i[0].attrs.padding)&&void 0!==a?a:1:1,ignoreStroke:!1,anchorStroke:e.palette[\"accent-primary\"],anchorFill:e.palette[\"access-primary\"],anchorStrokeWidth:2,borderStroke:e.palette[\"accent-primary\"],borderStrokeWidth:2,borderDash:[4],rotateEnabled:!h,onMouseOver:function changePointerIconToMove(){g({type:CHANGE_POINTER_ICON,payload:{pointerCssIcon:POINTER_ICONS.MOVE}})},onMouseLeave:function changePointerIconToDraw(){g({type:CHANGE_POINTER_ICON,payload:{pointerCssIcon:POINTER_ICONS.DRAW}})},onDblClick:j,onDblTap:j,enabledAnchors:k,flipEnabled:!h,shouldOverdrawWholeArea:!0})};export default NodesTransformer;","import React from\"react\";import{Layer}from\"react-konva\";import{useStore}from\"../../../hooks\";import{TOOLS_IDS,TRANSFORMERS_LAYER_ID}from\"../../../utils/constants\";import CropTransformer from\"./CropTransformer\";import NodesTransformer from\"./NodesTransformer\";var TransformersLayer=function(){var a=useStore(),b=a.toolId,c=a.shownImageDimensions;return React.createElement(Layer,{id:TRANSFORMERS_LAYER_ID,x:c.abstractX||0,y:c.abstractY||0},React.createElement(NodesTransformer,null),b===TOOLS_IDS.CROP&&React.createElement(CropTransformer,null))};export default TransformersLayer;","import styled from\"styled-components\";var StyledNodeControls=styled.div.withConfig({componentId:\"sc-1tst9ex-0\"})(function(a){var b=a.theme,c=a.top,d=a.left;return\"\\n position: absolute;\\n z-index: 1;\\n background: \".concat(b.palette[\"bg-secondary\"],\";\\n border-radius: 2px;\\n display: flex;\\n align-items: center;\\n justify-content: center;\\n box-shadow: 0px 1px 2px \").concat(b.palette[\"light-shadow\"],\";\\n top: \").concat((c||0)+8,\"px;\\n left: \").concat((d||0)+4,\"px;\\n transform: translateX(-50%);\\n height: 32px;\\n\")});export{StyledNodeControls};","import _slicedToArray from\"@babel/runtime/helpers/slicedToArray\";import React,{useEffect,useMemo,useState}from\"react\";import IconButton from\"@scaleflex/ui/core/icon-button\";import DeleteOutline from\"@scaleflex/icons/delete-outline\";import Duplicate from\"@scaleflex/icons/duplicate\";import{useStore}from\"../../hooks\";import{DUPLICATE_ANNOTATIONS,REMOVE_ANNOTATIONS}from\"../../actions\";import{NODES_TRANSFORMER_ID,WATERMARK_ANNOTATION_ID}from\"../../utils/constants\";import debounce from\"../../utils/debounce\";import{StyledNodeControls}from\"./NodeControls.styled\";var NodeControls=function(){var a=useStore(),b=a.selectionsIds,c=void 0===b?[]:b,d=a.designLayer,e=a.annotations,f=a.dispatch,g=useState({left:0,top:0}),h=_slicedToArray(g,2),i=h[0],j=h[1],k=useMemo(function(){var a;return null===d||void 0===d||null===(a=d.getStage())||void 0===a?void 0:a.findOne(\"#\".concat(NODES_TRANSFORMER_ID))},[d]),l=c.length,m=debounce(function(){k&&j({left:(k.x()+k.width()/2)*k.scaleX(),top:(k.y()+k.height())*k.scaleY()})},0);if(useEffect(function(){m()},[c,k,e]),0===l||!k)return null;return React.createElement(StyledNodeControls,{className:\"FIE_annotation-controls-overlay\",left:i.left,top:i.top},c[0]!==WATERMARK_ANNOTATION_ID&&React.createElement(IconButton,{color:\"basic\",size:\"sm\",onClick:function duplicateSelectedNodes(){f({type:DUPLICATE_ANNOTATIONS,payload:{annotationsIds:c}})}},React.createElement(Duplicate,null)),React.createElement(IconButton,{color:\"basic\",size:\"sm\",onClick:function removeSelectedNodes(){f({type:REMOVE_ANNOTATIONS,payload:{annotationsIds:c}})}},React.createElement(DeleteOutline,null)))};export default NodeControls;","import _defineProperty from\"@babel/runtime/helpers/defineProperty\";function ownKeys(a,b){var c=Object.keys(a);if(Object.getOwnPropertySymbols){var d=Object.getOwnPropertySymbols(a);b&&(d=d.filter(function(b){return Object.getOwnPropertyDescriptor(a,b).enumerable})),c.push.apply(c,d)}return c}function _objectSpread(a){for(var b,c=1;ct),w=_slicedToArray(v,2),x=w[0],y=w[1],z=useMemo(function(){return{cursor:g===POINTER_ICONS.DEFAULT&&h===TABS_IDS.ANNOTATE?POINTER_ICONS.DRAW:g}},[h,g]),A=function(a){f({type:ZOOM_CANVAS,payload:a})},B=useCallback(function(a){var b,c;a.evt.preventDefault(),null===(b=(c=a.currentTarget).container)||void 0===b||b.call(c).focus(),a.target instanceof Konva.Stage&&0t&&u&&(a.preventDefault(),y(!0),f({type:CHANGE_POINTER_ICON,payload:{pointerCssIcon:POINTER_ICONS.DRAG}}))},E=function(a){\"Space\"===a.code&&(a.preventDefault(),C())},F=function(){c.current&&c.current.container().focus()};useEffect(function(){f({type:CHANGE_POINTER_ICON,payload:{pointerCssIcon:POINTER_ICONS[x?\"DRAG\":\"DEFAULT\"]}})},[x]),useEffect(function(){y(h!==TABS_IDS.ANNOTATE&&h!==TABS_IDS.WATERMARK&&p.factor>t);var a;return c.current&&(a=c.current.container(),a.addEventListener(\"mouseenter\",F),a.addEventListener(\"keydown\",D),a.addEventListener(\"keyup\",E)),function(){a&&(a.removeEventListener(\"mouseenter\",F),a.removeEventListener(\"keydown\",D),a.removeEventListener(\"keyup\",E))}},[h,p.factor,t]);var G=l*(u&&p.factor||t);return React.createElement(StyledCanvasNode,{className:\"FIE_canvas-node\",tabIndex:-1,ref:c,width:j,height:k,scaleX:G,scaleY:G,x:u&&p.x||null,y:u&&p.y||null,zoomFactor:u&&p.factor||t,onWheel:u?function handleZoom(a){a.evt.preventDefault();var b=(p.factor||t)+a.evt.deltaY*-ZOOM_DELTA_TO_SCALE_CONVERT_FACTOR,c=a.currentTarget.getPointerPosition();A(_objectSpread(_objectSpread({},c),{},{factor:b}))}:void 0,onTap:B,onClick:B,onTouchMove:u?function(a){return zoomOnTouchesMove(a,A)}:void 0,onDragStart:function preventDraggingIfMultiTouches(a){var b;1<(null===(b=a.evt.touches)||void 0===b?void 0:b.length)&&y(!1)},onTouchEnd:u?function endTouchesZoomingEnablePanning(){endTouchesZooming(C)}:void 0,dragBoundFunc:function dragBoundFunc(a){var b=Math.min(0,Math.max(a.x,j*(1-p.factor))),c=Math.min(0,Math.max(a.y,k*(1-p.factor)));return{x:b,y:c}},draggable:u&&x,onDragEnd:function handleCanvasDragEnd(a){a.currentTarget.draggable()&&\"stage\"===a.target.nodeType.toLowerCase()&&u&&x&&A({factor:p.factor,x:a.target.x(),y:a.target.y(),preparedDimensions:!0})},style:z},b)};export default memo(CanvasNode);","import _slicedToArray from\"@babel/runtime/helpers/slicedToArray\";import React,{useCallback,useEffect,useRef}from\"react\";import{DesignLayer,TransformersLayer}from\"../Layers\";import{AppProviderOverridenValue}from\"../../context\";import{SET_CANVAS_SIZE}from\"../../actions\";import{useResizeObserver,useStore}from\"../../hooks\";import NodeControls from\"../NodeControls\";import CanvasNode from\"./CanvasNode\";import{CanvasContainer,StyledOrignalImage}from\"./MainCanvas.styled\";var MainCanvas=function(){var a=useResizeObserver(),b=_slicedToArray(a,1),c=b[0],d=useStore(),e=useRef(null),f=useCallback(function(a){var b=a.width,c=a.height;d.dispatch({type:SET_CANVAS_SIZE,payload:{canvasWidth:b,canvasHeight:c}})},[]);return useEffect(function(){c(e.current,f)},[]),React.createElement(CanvasContainer,{className:\"FIE_canvas-container\",ref:e},!d.textIdOfEditableContent&&React.createElement(NodeControls,null),d.isShowOriginalImage&&React.createElement(StyledOrignalImage,{className:\"FIE_original-image-compare\",src:d.originalImage.src}),React.createElement(CanvasNode,null,React.createElement(AppProviderOverridenValue,{overridingValue:d},React.createElement(DesignLayer,null),React.createElement(TransformersLayer,null))))};export default MainCanvas;","import styled from\"styled-components\";import{Color as PC}from\"@scaleflex/ui/utils/types/palette\";var StyledSeparator=styled.div.withConfig({componentId:\"sc-etsyb6-0\"})([\"display:inline-block;height:\",\";width:\",\";border-radius:1px;background:\",\";\"],function(a){return a.height},function(a){return a.width},function(a){var b=a.theme.palette;return b[PC.BordersSecondary]});export{StyledSeparator};","import React from\"react\";import{StyledSeparator}from\"./Separator.styled\";var Separator=function(a){var b=a.height,c=a.width;return React.createElement(StyledSeparator,{height:b,width:c})};Separator.defaultProps={height:\"24px\",width:\"1px\"};export default Separator;","import styled from\"styled-components\";import Button from\"@scaleflex/ui/core/button\";import IconButton from\"@scaleflex/ui/core/icon-button\";import Label from\"@scaleflex/ui/core/label\";import{CrossButton,InputGroup,SelectGroup}from\"@scaleflex/ui/core\";import{Color as PC}from\"@scaleflex/ui/utils/types/palette\";import{FontVariant as FV}from\"@scaleflex/ui/utils/types/typography\";var StyledTopbar=styled.div.withConfig({componentId:\"sc-21g986-0\"})([\"padding:16px;box-sizing:border-box;position:relative;width:100%;display:flex;flex-wrap:wrap;gap:16px;align-items:center;justify-content:space-between;border-bottom:1px solid \",\";[data-phone='true'] &{padding:6px 6px 4px 6px;\",\"}\"],function(a){var b=a.theme.palette;return b[PC.BordersSecondary]},function(a){var b=a.isPhoneScreen;return b&&\"\\n padding: 12px 12px 0px;\\n gap: 12px;\\n \"}),StyledMainButtonsWrapper=styled.div.withConfig({componentId:\"sc-21g986-1\"})([\"display:flex;align-items:center;order:1;\"]),StyledControlButtonsWrapper=styled.div.withConfig({componentId:\"sc-21g986-2\"})([\"display:flex;align-items:center;order:3;gap:4px;\"]),StyledHistoryButton=styled(IconButton).withConfig({componentId:\"sc-21g986-3\"})([\"margin:\",\";svg{color:\",\";}\"],function(a){var b=a.margin;return null!==b&&void 0!==b?b:\"0 4px\"},function(a){var b=a.theme.palette,c=a.disabled;return c?b[PC.IconsMuted]:b[PC.IconsPrimary]}),StyledZoomingWrapper=styled.div.withConfig({componentId:\"sc-21g986-4\"})([\"display:flex;align-items:center;gap:2px;\"]),StyledDimensionsLabel=styled(Label).withConfig({componentId:\"sc-21g986-5\"})([\"flex-shrink:0;color:\",\";\",\";\"],function(a){var b=a.theme.palette;return b[PC.TextPlaceholder]},function(a){var b=a.theme.typography;return b.font[FV.LabelMedium]}),StyledSmallButton=styled(IconButton).withConfig({componentId:\"sc-21g986-6\"})([\"padding:8px;svg{color:\",\";}\"],function(a){var b=a.theme.palette,c=a.showBackButton;return c?b[PC.IconsPrimary]:b[PC.IconsMuted]}),StyledFlexCenterAlignedContainer=styled.div.withConfig({componentId:\"sc-21g986-7\"})([\"width:\",\";height:32px;display:block;width:100%;order:4;\",\";@media (min-width:761px){display:flex;align-items:center;justify-content:center;width:fit-content;order:2;}\"],function(a){var b=a.showBackButton;return b?\"318px\":\"384px\"},function(a){var b=a.reverseDirection;return b?\"flex-direction: row-reverse\":\"\"}),StyledZoomPercentageLabel=styled(Label).withConfig({componentId:\"sc-21g986-8\"})([\"cursor:pointer;color:\",\";\",\";\"],function(a){var b=a.theme.palette;return b[PC.TextPrimary]},function(a){var b=a.theme.typography;return b.font[FV.InputMd]}),StyledBackButtonLabel=styled.span.withConfig({componentId:\"sc-21g986-9\"})([\"\",\";\"],function(a){var b=a.theme.typography;return b.font[FV.ButtonMdEmphasis]}),StyledCloseButton=styled(CrossButton).withConfig({componentId:\"sc-21g986-10\"})([\"padding:8px;z-index:111;\"]),StyledSaveButton=styled(Button).withConfig({componentId:\"sc-21g986-11\"})([\"padding:4px 12px;\"]),StyledFileNameInput=styled(InputGroup).withConfig({componentId:\"sc-21g986-12\"})([\"\"]),StyledFileExtensionSelect=styled(SelectGroup).withConfig({componentId:\"sc-21g986-13\"})([\"margin-top:16px;\"]),StyledQualityWrapper=styled.div.withConfig({componentId:\"sc-21g986-14\"})([\"width:100%;margin-top:16px;\"]),StyledResizeOnSave=styled.div.withConfig({componentId:\"sc-21g986-15\"})([\"margin-top:16px;width:100%;\"]),StyledResizeOnSaveLabel=styled(Label).withConfig({componentId:\"sc-21g986-16\"})([\"margin-bottom:4px;\"]),StyledHistoryButtons=styled.div.withConfig({componentId:\"sc-21g986-17\"})([\"display:flex;gap:6px;\"]),StyledImageOptionsButtons=styled.div.withConfig({componentId:\"sc-21g986-18\"})([\"display:flex;gap:12px;justify-content:\",\";\"],function(a){var b=a.isPhoneScreen;return b?\"space-between\":\"center\"}),StyledMenuIconButton=styled(IconButton).withConfig({componentId:\"sc-21g986-19\"})([\"@media (min-width:761px){display:none;}\"]),StyledDimensionsButtons=styled.div.withConfig({componentId:\"sc-21g986-20\"})([\"display:flex;gap:12px;align-items:center;\"]);export{StyledTopbar,StyledFlexCenterAlignedContainer,StyledHistoryButton,StyledZoomingWrapper,StyledSmallButton,StyledZoomPercentageLabel,StyledBackButtonLabel,StyledCloseButton,StyledSaveButton,StyledFileNameInput,StyledFileExtensionSelect,StyledQualityWrapper,StyledResizeOnSave,StyledDimensionsLabel,StyledMainButtonsWrapper,StyledControlButtonsWrapper,StyledHistoryButtons,StyledImageOptionsButtons,StyledMenuIconButton,StyledDimensionsButtons,StyledResizeOnSaveLabel};","import styled,{css}from\"styled-components\";import modalTitle from\"@scaleflex/ui/core/modal-title\";import{Modal,ModalActions}from\"@scaleflex/ui/core\";import{Color as PC}from\"@scaleflex/ui/utils/types/palette\";import{FontVariant as FV}from\"@scaleflex/ui/utils/types/typography\";var StyledModal=styled(Modal).withConfig({componentId:\"sc-kpjpf5-0\"})([\"width:\",\";max-width:unset;\"],function(a){var b=a.width;return b||\"300px\"}),StyledModalTitle=styled(modalTitle).withConfig({componentId:\"sc-kpjpf5-1\"})(function(a){var b=a.theme,c=a.isWarning;return css([\"padding-bottom:0;.SfxModalTitle-Icon{background-color:\",\";}.SfxModalTitle-LabelPrimary{margin-bottom:24px;\",\";}.SfxModalTitle-LabelSecondary{\",\";text-align:center;}\"],c&&b.palette[PC.Orange_0_1_Overlay],b.typography.font[FV.TitleH3],b.typography.font[FV.TextLarge])}),StyledModalActions=styled(ModalActions).withConfig({componentId:\"sc-kpjpf5-2\"})([\"gap:12px;padding:24px;.SfxButton-root{flex:1;margin:0;height:40px;}\"]);export{StyledModal,StyledModalTitle,StyledModalActions};","import React from\"react\";import{Button,ModalContent}from\"@scaleflex/ui/core\";import{StyledModal,StyledModalTitle,StyledModalActions}from\"./Modal.styled\";var Modal=function(a){var b=a.title,c=a.hint,d=a.Icon,f=a.onDone,g=a.onCancel,h=a.doneLabel,i=a.cancelLabel,j=a.isOpened,k=a.doneButtonStyle,l=a.doneButtonColor,m=void 0===l?\"basic\":l,n=a.cancelButtonColor,o=void 0===n?\"basic\":n,p=a.children,q=a.areButtonsDisabled,r=a.zIndex,s=a.className,t=a.width,u=a.isWarning;return React.createElement(StyledModal,{className:s,open:j,onClose:g,style:{zIndex:r},onKeyUp:function onKeyUp(a){\"Enter\"===a.key&&f(a)},width:t},React.createElement(StyledModalTitle,{icon:React.createElement(d,{size:25}),iconShadow:!0,isWarning:u,onClose:g,primary:b,secondary:c,variant:\"with-icon\"}),p&&React.createElement(ModalContent,null,p),React.createElement(StyledModalActions,{align:\"center\"},React.createElement(Button,{color:o,onClick:g,size:\"md\",disabled:q},i),React.createElement(Button,{color:m,onClick:f,size:\"md\",warning:u,style:k,disabled:q},h)))};Modal.defaultProps={hint:\"\",isOpened:!1,doneLabel:\"Yes\",cancelLabel:\"No\",doneButtonStyle:void 0,doneButtonColor:\"basic\",cancelButtonColor:\"basic\",children:void 0,areButtonsDisabled:!1,zIndex:void 0,className:void 0,width:\"\",isWarning:!1};export default Modal;","import _slicedToArray from\"@babel/runtime/helpers/slicedToArray\";import React,{useState,useCallback}from\"react\";import{Warning}from\"@scaleflex/icons\";import{useStore}from\"../../hooks\";import{RESET}from\"../../actions\";import Modal from\"../common/Modal\";import{CLOSING_REASONS}from\"../../utils/constants\";var ConfirmationModal=function(a){var b=a.children,c=a.isReset,d=useStore(),e=d.t,f=d.theme,g=d.config,h=d.dispatch,i=d.isResetted,j=d.haveNotSavedChanges,k=d.config.onClose,l=useState(!1),m=_slicedToArray(l,2),n=m[0],o=m[1];if(\"function\"!=typeof k&&!c)return React.createElement(\"span\",null);var p=function(){o(!1)},q=useCallback(function(){h({type:RESET,payload:{config:g}}),p()},[g]),r=function(){c||(k(CLOSING_REASONS.CLOSE_BUTTON,j),q())};return React.createElement(React.Fragment,null,React.cloneElement(b,{onClick:!(void 0!==i)||i?r:function openModal(){o(!0)}}),n&&React.createElement(Modal,{title:c?e(\"warning\"):e(\"discardChanges\"),hint:c?e(\"changesLoseWarningHint\"):e(\"discardChangesWarningHint\"),isOpened:n,onCancel:p,onDone:c?q:r,Icon:function WarningIcon(){return React.createElement(Warning,{color:f.palette.warning,size:25})},doneLabel:e(\"confirm\"),doneButtonColor:\"warning-primary\",cancelLabel:e(\"cancel\"),width:\"400px\",isWarning:!0}))};ConfirmationModal.defaultProps={isReset:!1};export default ConfirmationModal;","import React from\"react\";import CrossOutline from\"@scaleflex/icons/cross-outline\";import{useStore}from\"../../hooks\";import Separator from\"../common/Separator\";import{StyledCloseButton}from\"./Topbar.styled\";import ConfirmationModal from\"./ConfirmationModal\";var CloseButton=function(){var a=useStore(),b=a.config.onClose;return\"function\"==typeof b?React.createElement(React.Fragment,null,React.createElement(Separator,null),React.createElement(ConfirmationModal,null,React.createElement(StyledCloseButton,{className:\"FIE_topbar-close-button\",color:\"basic\",size:\"md\"},React.createElement(CrossOutline,null)))):null};export default CloseButton;","import{DEFAULT_SAVE_QUALITY}from\"./constants\";var getDefaultSaveQuality=function(a){return 0>=a||1 svg:not([color]){color:\",\"}:disabled,[aria-disabled=\\\"true\\\"]{cursor:not-allowed;}&::-webkit-scrollbar{width:4px;height:4px;}&::-webkit-scrollbar-track{background:rgba(203,211,218,0.35);}&::-webkit-scrollbar-thumb{background:rgba(203,211,218,1);border-radius:10px;}}\"],ROOT_CONTAINER_CLASS_NAME,ROOT_CONTAINER_CLASS_NAME,function(a){var b=a.theme;return b.palette[\"icons-primary\"]});export{FontsFaces,OverrideDefaultStyles};","import React,{useEffect,memo}from\"react\";import ThemeProvider from\"@scaleflex/ui/theme\";import App from\"../App\";import{AppProvider}from\"../../context\";import defaultConfig from\"../../context/defaultConfig\";import deepMerge from\"../../utils/deepMerge\";import assignFinetuneNamesToKonva from\"../../utils/assignFinetuneNamesToKonva\";import{FontsFaces,OverrideDefaultStyles}from\"./globalStyles\";var AssemblyPoint=function(a){var b=a.source,c=a.useCloudimage,d=a.cloudimage;if(!b||\"string\"!=typeof b&&!(b instanceof HTMLImageElement))throw new Error(\"`source` property is required either a string of image url or a HTMLImageElement for the image that will be edited.\");if(c){var e,f;if(null!==d&&void 0!==d&&null!==(e=d.imageSealing)&&void 0!==e&&e.enable&&!(null!==d&&void 0!==d&&null!==(f=d.imageSealing)&&void 0!==f&&f.salt))throw new Error(\"`salt` property of imageSealing object is required in cloudimage mode as long as `imageSealing` is enabled.\")}useEffect(function(){assignFinetuneNamesToKonva()},[]);var g=deepMerge(defaultConfig,a);return React.createElement(React.StrictMode,null,React.createElement(ThemeProvider,{theme:g.theme},React.createElement(FontsFaces,null),React.createElement(OverrideDefaultStyles,null),React.createElement(AppProvider,{config:g},React.createElement(App,null))))};AssemblyPoint.defaultProps={useCloudimage:!1,cloudimage:{}};export default memo(AssemblyPoint);","import _typeof from\"@babel/runtime/helpers/typeof\";import _classCallCheck from\"@babel/runtime/helpers/classCallCheck\";import _createClass from\"@babel/runtime/helpers/createClass\";import _defineProperty from\"@babel/runtime/helpers/defineProperty\";function ownKeys(a,b){var c=Object.keys(a);if(Object.getOwnPropertySymbols){var d=Object.getOwnPropertySymbols(a);b&&(d=d.filter(function(b){return Object.getOwnPropertyDescriptor(a,b).enumerable})),c.push.apply(c,d)}return c}function _objectSpread(a){for(var b,c=1;carguments.length?b:c;throw new TypeError(\"Private element is not present on this object\")}import{createElement}from\"react\";import{createRoot}from\"react-dom/client\";import AssemblyPoint,{TOOLS,TABS}from\"react-filerobot-image-editor\";import deepMerge from\"react-filerobot-image-editor/lib/utils/deepMerge\";var _root=new WeakMap,_getCurrentImgDataFnRef=new WeakMap,_updateStateFnRef=new WeakMap,FilerobotImageEditor=function(){function a(b){var c=1 d(n, \"\", e), g = (n) => \"/remote.php/\" + n, U = (n, e) => {\n var o;\n return ((o = e == null ? void 0 : e.baseURL) != null ? o : w()) + g(n);\n}, v = (n, e, o) => {\n var c;\n const i = Object.assign({\n ocsVersion: 2\n }, o || {}).ocsVersion === 1 ? 1 : 2;\n return ((c = o == null ? void 0 : o.baseURL) != null ? c : w()) + \"/ocs/v\" + i + \".php\" + u(n, e, o);\n}, u = (n, e, o) => {\n const c = Object.assign({\n escape: !0\n }, o || {}), r = function(i, s) {\n return s = s || {}, i.replace(\n /{([^{}]*)}/g,\n function(l, t) {\n const a = s[t];\n return c.escape ? encodeURIComponent(typeof a == \"string\" || typeof a == \"number\" ? a.toString() : l) : typeof a == \"string\" || typeof a == \"number\" ? a.toString() : l;\n }\n );\n };\n return n.charAt(0) !== \"/\" && (n = \"/\" + n), r(n, e || {});\n}, _ = (n, e, o) => {\n var c, r, i;\n const s = Object.assign({\n noRewrite: !1\n }, o || {}), l = (c = o == null ? void 0 : o.baseURL) != null ? c : f();\n return ((i = (r = window == null ? void 0 : window.OC) == null ? void 0 : r.config) == null ? void 0 : i.modRewriteWorking) === !0 && !s.noRewrite ? l + u(n, e, o) : l + \"/index.php\" + u(n, e, o);\n}, h = (n, e) => e.includes(\".\") ? d(n, \"img\", e) : d(n, \"img\", \"\".concat(e, \".svg\")), d = (n, e, o) => {\n var c, r, i;\n const s = (i = (r = (c = window == null ? void 0 : window.OC) == null ? void 0 : c.coreApps) == null ? void 0 : r.includes(n)) != null ? i : !1, l = o.slice(-3) === \"php\";\n let t = f();\n return l && !s ? (t += \"/index.php/apps/\".concat(n), e && (t += \"/\".concat(encodeURI(e))), o !== \"index.php\" && (t += \"/\".concat(o))) : !l && !s ? (t = b(n), e && (t += \"/\".concat(e, \"/\")), t.at(-1) !== \"/\" && (t += \"/\"), t += o) : ((n === \"settings\" || n === \"core\" || n === \"search\") && e === \"ajax\" && (t += \"/index.php\"), n && (t += \"/\".concat(n)), e && (t += \"/\".concat(e)), t += \"/\".concat(o)), t;\n}, w = () => window.location.protocol + \"//\" + window.location.host + f();\nfunction f() {\n let n = window._oc_webroot;\n if (typeof n > \"u\") {\n n = location.pathname;\n const e = n.indexOf(\"/index.php/\");\n if (e !== -1)\n n = n.slice(0, e);\n else {\n const o = n.indexOf(\"/\", 1);\n n = n.slice(0, o > 0 ? o : void 0);\n }\n }\n return n;\n}\nfunction b(n) {\n var e, o;\n return (o = ((e = window._oc_appswebroots) != null ? e : {})[n]) != null ? o : \"\";\n}\nexport {\n d as generateFilePath,\n v as generateOcsUrl,\n U as generateRemoteUrl,\n _ as generateUrl,\n b as getAppRootUrl,\n w as getBaseUrl,\n f as getRootUrl,\n h as imagePath,\n R as linkTo\n};\n","/*! @license DOMPurify 3.1.6 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.1.6/LICENSE */\n\nconst {\n entries,\n setPrototypeOf,\n isFrozen,\n getPrototypeOf,\n getOwnPropertyDescriptor\n} = Object;\nlet {\n freeze,\n seal,\n create\n} = Object; // eslint-disable-line import/no-mutable-exports\nlet {\n apply,\n construct\n} = typeof Reflect !== 'undefined' && Reflect;\nif (!freeze) {\n freeze = function freeze(x) {\n return x;\n };\n}\nif (!seal) {\n seal = function seal(x) {\n return x;\n };\n}\nif (!apply) {\n apply = function apply(fun, thisValue, args) {\n return fun.apply(thisValue, args);\n };\n}\nif (!construct) {\n construct = function construct(Func, args) {\n return new Func(...args);\n };\n}\nconst arrayForEach = unapply(Array.prototype.forEach);\nconst arrayPop = unapply(Array.prototype.pop);\nconst arrayPush = unapply(Array.prototype.push);\nconst stringToLowerCase = unapply(String.prototype.toLowerCase);\nconst stringToString = unapply(String.prototype.toString);\nconst stringMatch = unapply(String.prototype.match);\nconst stringReplace = unapply(String.prototype.replace);\nconst stringIndexOf = unapply(String.prototype.indexOf);\nconst stringTrim = unapply(String.prototype.trim);\nconst objectHasOwnProperty = unapply(Object.prototype.hasOwnProperty);\nconst regExpTest = unapply(RegExp.prototype.test);\nconst typeErrorCreate = unconstruct(TypeError);\n\n/**\n * Creates a new function that calls the given function with a specified thisArg and arguments.\n *\n * @param {Function} func - The function to be wrapped and called.\n * @returns {Function} A new function that calls the given function with a specified thisArg and arguments.\n */\nfunction unapply(func) {\n return function (thisArg) {\n for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n args[_key - 1] = arguments[_key];\n }\n return apply(func, thisArg, args);\n };\n}\n\n/**\n * Creates a new function that constructs an instance of the given constructor function with the provided arguments.\n *\n * @param {Function} func - The constructor function to be wrapped and called.\n * @returns {Function} A new function that constructs an instance of the given constructor function with the provided arguments.\n */\nfunction unconstruct(func) {\n return function () {\n for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {\n args[_key2] = arguments[_key2];\n }\n return construct(func, args);\n };\n}\n\n/**\n * Add properties to a lookup table\n *\n * @param {Object} set - The set to which elements will be added.\n * @param {Array} array - The array containing elements to be added to the set.\n * @param {Function} transformCaseFunc - An optional function to transform the case of each element before adding to the set.\n * @returns {Object} The modified set with added elements.\n */\nfunction addToSet(set, array) {\n let transformCaseFunc = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : stringToLowerCase;\n if (setPrototypeOf) {\n // Make 'in' and truthy checks like Boolean(set.constructor)\n // independent of any properties defined on Object.prototype.\n // Prevent prototype setters from intercepting set as a this value.\n setPrototypeOf(set, null);\n }\n let l = array.length;\n while (l--) {\n let element = array[l];\n if (typeof element === 'string') {\n const lcElement = transformCaseFunc(element);\n if (lcElement !== element) {\n // Config presets (e.g. tags.js, attrs.js) are immutable.\n if (!isFrozen(array)) {\n array[l] = lcElement;\n }\n element = lcElement;\n }\n }\n set[element] = true;\n }\n return set;\n}\n\n/**\n * Clean up an array to harden against CSPP\n *\n * @param {Array} array - The array to be cleaned.\n * @returns {Array} The cleaned version of the array\n */\nfunction cleanArray(array) {\n for (let index = 0; index < array.length; index++) {\n const isPropertyExist = objectHasOwnProperty(array, index);\n if (!isPropertyExist) {\n array[index] = null;\n }\n }\n return array;\n}\n\n/**\n * Shallow clone an object\n *\n * @param {Object} object - The object to be cloned.\n * @returns {Object} A new object that copies the original.\n */\nfunction clone(object) {\n const newObject = create(null);\n for (const [property, value] of entries(object)) {\n const isPropertyExist = objectHasOwnProperty(object, property);\n if (isPropertyExist) {\n if (Array.isArray(value)) {\n newObject[property] = cleanArray(value);\n } else if (value && typeof value === 'object' && value.constructor === Object) {\n newObject[property] = clone(value);\n } else {\n newObject[property] = value;\n }\n }\n }\n return newObject;\n}\n\n/**\n * This method automatically checks if the prop is function or getter and behaves accordingly.\n *\n * @param {Object} object - The object to look up the getter function in its prototype chain.\n * @param {String} prop - The property name for which to find the getter function.\n * @returns {Function} The getter function found in the prototype chain or a fallback function.\n */\nfunction lookupGetter(object, prop) {\n while (object !== null) {\n const desc = getOwnPropertyDescriptor(object, prop);\n if (desc) {\n if (desc.get) {\n return unapply(desc.get);\n }\n if (typeof desc.value === 'function') {\n return unapply(desc.value);\n }\n }\n object = getPrototypeOf(object);\n }\n function fallbackValue() {\n return null;\n }\n return fallbackValue;\n}\n\nconst html$1 = freeze(['a', 'abbr', 'acronym', 'address', 'area', 'article', 'aside', 'audio', 'b', 'bdi', 'bdo', 'big', 'blink', 'blockquote', 'body', 'br', 'button', 'canvas', 'caption', 'center', 'cite', 'code', 'col', 'colgroup', 'content', 'data', 'datalist', 'dd', 'decorator', 'del', 'details', 'dfn', 'dialog', 'dir', 'div', 'dl', 'dt', 'element', 'em', 'fieldset', 'figcaption', 'figure', 'font', 'footer', 'form', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'head', 'header', 'hgroup', 'hr', 'html', 'i', 'img', 'input', 'ins', 'kbd', 'label', 'legend', 'li', 'main', 'map', 'mark', 'marquee', 'menu', 'menuitem', 'meter', 'nav', 'nobr', 'ol', 'optgroup', 'option', 'output', 'p', 'picture', 'pre', 'progress', 'q', 'rp', 'rt', 'ruby', 's', 'samp', 'section', 'select', 'shadow', 'small', 'source', 'spacer', 'span', 'strike', 'strong', 'style', 'sub', 'summary', 'sup', 'table', 'tbody', 'td', 'template', 'textarea', 'tfoot', 'th', 'thead', 'time', 'tr', 'track', 'tt', 'u', 'ul', 'var', 'video', 'wbr']);\n\n// SVG\nconst svg$1 = freeze(['svg', 'a', 'altglyph', 'altglyphdef', 'altglyphitem', 'animatecolor', 'animatemotion', 'animatetransform', 'circle', 'clippath', 'defs', 'desc', 'ellipse', 'filter', 'font', 'g', 'glyph', 'glyphref', 'hkern', 'image', 'line', 'lineargradient', 'marker', 'mask', 'metadata', 'mpath', 'path', 'pattern', 'polygon', 'polyline', 'radialgradient', 'rect', 'stop', 'style', 'switch', 'symbol', 'text', 'textpath', 'title', 'tref', 'tspan', 'view', 'vkern']);\nconst svgFilters = freeze(['feBlend', 'feColorMatrix', 'feComponentTransfer', 'feComposite', 'feConvolveMatrix', 'feDiffuseLighting', 'feDisplacementMap', 'feDistantLight', 'feDropShadow', 'feFlood', 'feFuncA', 'feFuncB', 'feFuncG', 'feFuncR', 'feGaussianBlur', 'feImage', 'feMerge', 'feMergeNode', 'feMorphology', 'feOffset', 'fePointLight', 'feSpecularLighting', 'feSpotLight', 'feTile', 'feTurbulence']);\n\n// List of SVG elements that are disallowed by default.\n// We still need to know them so that we can do namespace\n// checks properly in case one wants to add them to\n// allow-list.\nconst svgDisallowed = freeze(['animate', 'color-profile', 'cursor', 'discard', 'font-face', 'font-face-format', 'font-face-name', 'font-face-src', 'font-face-uri', 'foreignobject', 'hatch', 'hatchpath', 'mesh', 'meshgradient', 'meshpatch', 'meshrow', 'missing-glyph', 'script', 'set', 'solidcolor', 'unknown', 'use']);\nconst mathMl$1 = freeze(['math', 'menclose', 'merror', 'mfenced', 'mfrac', 'mglyph', 'mi', 'mlabeledtr', 'mmultiscripts', 'mn', 'mo', 'mover', 'mpadded', 'mphantom', 'mroot', 'mrow', 'ms', 'mspace', 'msqrt', 'mstyle', 'msub', 'msup', 'msubsup', 'mtable', 'mtd', 'mtext', 'mtr', 'munder', 'munderover', 'mprescripts']);\n\n// Similarly to SVG, we want to know all MathML elements,\n// even those that we disallow by default.\nconst mathMlDisallowed = freeze(['maction', 'maligngroup', 'malignmark', 'mlongdiv', 'mscarries', 'mscarry', 'msgroup', 'mstack', 'msline', 'msrow', 'semantics', 'annotation', 'annotation-xml', 'mprescripts', 'none']);\nconst text = freeze(['#text']);\n\nconst html = freeze(['accept', 'action', 'align', 'alt', 'autocapitalize', 'autocomplete', 'autopictureinpicture', 'autoplay', 'background', 'bgcolor', 'border', 'capture', 'cellpadding', 'cellspacing', 'checked', 'cite', 'class', 'clear', 'color', 'cols', 'colspan', 'controls', 'controlslist', 'coords', 'crossorigin', 'datetime', 'decoding', 'default', 'dir', 'disabled', 'disablepictureinpicture', 'disableremoteplayback', 'download', 'draggable', 'enctype', 'enterkeyhint', 'face', 'for', 'headers', 'height', 'hidden', 'high', 'href', 'hreflang', 'id', 'inputmode', 'integrity', 'ismap', 'kind', 'label', 'lang', 'list', 'loading', 'loop', 'low', 'max', 'maxlength', 'media', 'method', 'min', 'minlength', 'multiple', 'muted', 'name', 'nonce', 'noshade', 'novalidate', 'nowrap', 'open', 'optimum', 'pattern', 'placeholder', 'playsinline', 'popover', 'popovertarget', 'popovertargetaction', 'poster', 'preload', 'pubdate', 'radiogroup', 'readonly', 'rel', 'required', 'rev', 'reversed', 'role', 'rows', 'rowspan', 'spellcheck', 'scope', 'selected', 'shape', 'size', 'sizes', 'span', 'srclang', 'start', 'src', 'srcset', 'step', 'style', 'summary', 'tabindex', 'title', 'translate', 'type', 'usemap', 'valign', 'value', 'width', 'wrap', 'xmlns', 'slot']);\nconst svg = freeze(['accent-height', 'accumulate', 'additive', 'alignment-baseline', 'ascent', 'attributename', 'attributetype', 'azimuth', 'basefrequency', 'baseline-shift', 'begin', 'bias', 'by', 'class', 'clip', 'clippathunits', 'clip-path', 'clip-rule', 'color', 'color-interpolation', 'color-interpolation-filters', 'color-profile', 'color-rendering', 'cx', 'cy', 'd', 'dx', 'dy', 'diffuseconstant', 'direction', 'display', 'divisor', 'dur', 'edgemode', 'elevation', 'end', 'fill', 'fill-opacity', 'fill-rule', 'filter', 'filterunits', 'flood-color', 'flood-opacity', 'font-family', 'font-size', 'font-size-adjust', 'font-stretch', 'font-style', 'font-variant', 'font-weight', 'fx', 'fy', 'g1', 'g2', 'glyph-name', 'glyphref', 'gradientunits', 'gradienttransform', 'height', 'href', 'id', 'image-rendering', 'in', 'in2', 'k', 'k1', 'k2', 'k3', 'k4', 'kerning', 'keypoints', 'keysplines', 'keytimes', 'lang', 'lengthadjust', 'letter-spacing', 'kernelmatrix', 'kernelunitlength', 'lighting-color', 'local', 'marker-end', 'marker-mid', 'marker-start', 'markerheight', 'markerunits', 'markerwidth', 'maskcontentunits', 'maskunits', 'max', 'mask', 'media', 'method', 'mode', 'min', 'name', 'numoctaves', 'offset', 'operator', 'opacity', 'order', 'orient', 'orientation', 'origin', 'overflow', 'paint-order', 'path', 'pathlength', 'patterncontentunits', 'patterntransform', 'patternunits', 'points', 'preservealpha', 'preserveaspectratio', 'primitiveunits', 'r', 'rx', 'ry', 'radius', 'refx', 'refy', 'repeatcount', 'repeatdur', 'restart', 'result', 'rotate', 'scale', 'seed', 'shape-rendering', 'specularconstant', 'specularexponent', 'spreadmethod', 'startoffset', 'stddeviation', 'stitchtiles', 'stop-color', 'stop-opacity', 'stroke-dasharray', 'stroke-dashoffset', 'stroke-linecap', 'stroke-linejoin', 'stroke-miterlimit', 'stroke-opacity', 'stroke', 'stroke-width', 'style', 'surfacescale', 'systemlanguage', 'tabindex', 'targetx', 'targety', 'transform', 'transform-origin', 'text-anchor', 'text-decoration', 'text-rendering', 'textlength', 'type', 'u1', 'u2', 'unicode', 'values', 'viewbox', 'visibility', 'version', 'vert-adv-y', 'vert-origin-x', 'vert-origin-y', 'width', 'word-spacing', 'wrap', 'writing-mode', 'xchannelselector', 'ychannelselector', 'x', 'x1', 'x2', 'xmlns', 'y', 'y1', 'y2', 'z', 'zoomandpan']);\nconst mathMl = freeze(['accent', 'accentunder', 'align', 'bevelled', 'close', 'columnsalign', 'columnlines', 'columnspan', 'denomalign', 'depth', 'dir', 'display', 'displaystyle', 'encoding', 'fence', 'frame', 'height', 'href', 'id', 'largeop', 'length', 'linethickness', 'lspace', 'lquote', 'mathbackground', 'mathcolor', 'mathsize', 'mathvariant', 'maxsize', 'minsize', 'movablelimits', 'notation', 'numalign', 'open', 'rowalign', 'rowlines', 'rowspacing', 'rowspan', 'rspace', 'rquote', 'scriptlevel', 'scriptminsize', 'scriptsizemultiplier', 'selection', 'separator', 'separators', 'stretchy', 'subscriptshift', 'supscriptshift', 'symmetric', 'voffset', 'width', 'xmlns']);\nconst xml = freeze(['xlink:href', 'xml:id', 'xlink:title', 'xml:space', 'xmlns:xlink']);\n\n// eslint-disable-next-line unicorn/better-regex\nconst MUSTACHE_EXPR = seal(/\\{\\{[\\w\\W]*|[\\w\\W]*\\}\\}/gm); // Specify template detection regex for SAFE_FOR_TEMPLATES mode\nconst ERB_EXPR = seal(/<%[\\w\\W]*|[\\w\\W]*%>/gm);\nconst TMPLIT_EXPR = seal(/\\${[\\w\\W]*}/gm);\nconst DATA_ATTR = seal(/^data-[\\-\\w.\\u00B7-\\uFFFF]/); // eslint-disable-line no-useless-escape\nconst ARIA_ATTR = seal(/^aria-[\\-\\w]+$/); // eslint-disable-line no-useless-escape\nconst IS_ALLOWED_URI = seal(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.\\-]+(?:[^a-z+.\\-:]|$))/i // eslint-disable-line no-useless-escape\n);\nconst IS_SCRIPT_OR_DATA = seal(/^(?:\\w+script|data):/i);\nconst ATTR_WHITESPACE = seal(/[\\u0000-\\u0020\\u00A0\\u1680\\u180E\\u2000-\\u2029\\u205F\\u3000]/g // eslint-disable-line no-control-regex\n);\nconst DOCTYPE_NAME = seal(/^html$/i);\nconst CUSTOM_ELEMENT = seal(/^[a-z][.\\w]*(-[.\\w]+)+$/i);\n\nvar EXPRESSIONS = /*#__PURE__*/Object.freeze({\n __proto__: null,\n MUSTACHE_EXPR: MUSTACHE_EXPR,\n ERB_EXPR: ERB_EXPR,\n TMPLIT_EXPR: TMPLIT_EXPR,\n DATA_ATTR: DATA_ATTR,\n ARIA_ATTR: ARIA_ATTR,\n IS_ALLOWED_URI: IS_ALLOWED_URI,\n IS_SCRIPT_OR_DATA: IS_SCRIPT_OR_DATA,\n ATTR_WHITESPACE: ATTR_WHITESPACE,\n DOCTYPE_NAME: DOCTYPE_NAME,\n CUSTOM_ELEMENT: CUSTOM_ELEMENT\n});\n\n// https://developer.mozilla.org/en-US/docs/Web/API/Node/nodeType\nconst NODE_TYPE = {\n element: 1,\n attribute: 2,\n text: 3,\n cdataSection: 4,\n entityReference: 5,\n // Deprecated\n entityNode: 6,\n // Deprecated\n progressingInstruction: 7,\n comment: 8,\n document: 9,\n documentType: 10,\n documentFragment: 11,\n notation: 12 // Deprecated\n};\nconst getGlobal = function getGlobal() {\n return typeof window === 'undefined' ? null : window;\n};\n\n/**\n * Creates a no-op policy for internal use only.\n * Don't export this function outside this module!\n * @param {TrustedTypePolicyFactory} trustedTypes The policy factory.\n * @param {HTMLScriptElement} purifyHostElement The Script element used to load DOMPurify (to determine policy name suffix).\n * @return {TrustedTypePolicy} The policy created (or null, if Trusted Types\n * are not supported or creating the policy failed).\n */\nconst _createTrustedTypesPolicy = function _createTrustedTypesPolicy(trustedTypes, purifyHostElement) {\n if (typeof trustedTypes !== 'object' || typeof trustedTypes.createPolicy !== 'function') {\n return null;\n }\n\n // Allow the callers to control the unique policy name\n // by adding a data-tt-policy-suffix to the script element with the DOMPurify.\n // Policy creation with duplicate names throws in Trusted Types.\n let suffix = null;\n const ATTR_NAME = 'data-tt-policy-suffix';\n if (purifyHostElement && purifyHostElement.hasAttribute(ATTR_NAME)) {\n suffix = purifyHostElement.getAttribute(ATTR_NAME);\n }\n const policyName = 'dompurify' + (suffix ? '#' + suffix : '');\n try {\n return trustedTypes.createPolicy(policyName, {\n createHTML(html) {\n return html;\n },\n createScriptURL(scriptUrl) {\n return scriptUrl;\n }\n });\n } catch (_) {\n // Policy creation failed (most likely another DOMPurify script has\n // already run). Skip creating the policy, as this will only cause errors\n // if TT are enforced.\n console.warn('TrustedTypes policy ' + policyName + ' could not be created.');\n return null;\n }\n};\nfunction createDOMPurify() {\n let window = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : getGlobal();\n const DOMPurify = root => createDOMPurify(root);\n\n /**\n * Version label, exposed for easier checks\n * if DOMPurify is up to date or not\n */\n DOMPurify.version = '3.1.6';\n\n /**\n * Array of elements that DOMPurify removed during sanitation.\n * Empty if nothing was removed.\n */\n DOMPurify.removed = [];\n if (!window || !window.document || window.document.nodeType !== NODE_TYPE.document) {\n // Not running in a browser, provide a factory function\n // so that you can pass your own Window\n DOMPurify.isSupported = false;\n return DOMPurify;\n }\n let {\n document\n } = window;\n const originalDocument = document;\n const currentScript = originalDocument.currentScript;\n const {\n DocumentFragment,\n HTMLTemplateElement,\n Node,\n Element,\n NodeFilter,\n NamedNodeMap = window.NamedNodeMap || window.MozNamedAttrMap,\n HTMLFormElement,\n DOMParser,\n trustedTypes\n } = window;\n const ElementPrototype = Element.prototype;\n const cloneNode = lookupGetter(ElementPrototype, 'cloneNode');\n const remove = lookupGetter(ElementPrototype, 'remove');\n const getNextSibling = lookupGetter(ElementPrototype, 'nextSibling');\n const getChildNodes = lookupGetter(ElementPrototype, 'childNodes');\n const getParentNode = lookupGetter(ElementPrototype, 'parentNode');\n\n // As per issue #47, the web-components registry is inherited by a\n // new document created via createHTMLDocument. As per the spec\n // (http://w3c.github.io/webcomponents/spec/custom/#creating-and-passing-registries)\n // a new empty registry is used when creating a template contents owner\n // document, so we use that as our parent document to ensure nothing\n // is inherited.\n if (typeof HTMLTemplateElement === 'function') {\n const template = document.createElement('template');\n if (template.content && template.content.ownerDocument) {\n document = template.content.ownerDocument;\n }\n }\n let trustedTypesPolicy;\n let emptyHTML = '';\n const {\n implementation,\n createNodeIterator,\n createDocumentFragment,\n getElementsByTagName\n } = document;\n const {\n importNode\n } = originalDocument;\n let hooks = {};\n\n /**\n * Expose whether this browser supports running the full DOMPurify.\n */\n DOMPurify.isSupported = typeof entries === 'function' && typeof getParentNode === 'function' && implementation && implementation.createHTMLDocument !== undefined;\n const {\n MUSTACHE_EXPR,\n ERB_EXPR,\n TMPLIT_EXPR,\n DATA_ATTR,\n ARIA_ATTR,\n IS_SCRIPT_OR_DATA,\n ATTR_WHITESPACE,\n CUSTOM_ELEMENT\n } = EXPRESSIONS;\n let {\n IS_ALLOWED_URI: IS_ALLOWED_URI$1\n } = EXPRESSIONS;\n\n /**\n * We consider the elements and attributes below to be safe. Ideally\n * don't add any new ones but feel free to remove unwanted ones.\n */\n\n /* allowed element names */\n let ALLOWED_TAGS = null;\n const DEFAULT_ALLOWED_TAGS = addToSet({}, [...html$1, ...svg$1, ...svgFilters, ...mathMl$1, ...text]);\n\n /* Allowed attribute names */\n let ALLOWED_ATTR = null;\n const DEFAULT_ALLOWED_ATTR = addToSet({}, [...html, ...svg, ...mathMl, ...xml]);\n\n /*\n * Configure how DOMPUrify should handle custom elements and their attributes as well as customized built-in elements.\n * @property {RegExp|Function|null} tagNameCheck one of [null, regexPattern, predicate]. Default: `null` (disallow any custom elements)\n * @property {RegExp|Function|null} attributeNameCheck one of [null, regexPattern, predicate]. Default: `null` (disallow any attributes not on the allow list)\n * @property {boolean} allowCustomizedBuiltInElements allow custom elements derived from built-ins if they pass CUSTOM_ELEMENT_HANDLING.tagNameCheck. Default: `false`.\n */\n let CUSTOM_ELEMENT_HANDLING = Object.seal(create(null, {\n tagNameCheck: {\n writable: true,\n configurable: false,\n enumerable: true,\n value: null\n },\n attributeNameCheck: {\n writable: true,\n configurable: false,\n enumerable: true,\n value: null\n },\n allowCustomizedBuiltInElements: {\n writable: true,\n configurable: false,\n enumerable: true,\n value: false\n }\n }));\n\n /* Explicitly forbidden tags (overrides ALLOWED_TAGS/ADD_TAGS) */\n let FORBID_TAGS = null;\n\n /* Explicitly forbidden attributes (overrides ALLOWED_ATTR/ADD_ATTR) */\n let FORBID_ATTR = null;\n\n /* Decide if ARIA attributes are okay */\n let ALLOW_ARIA_ATTR = true;\n\n /* Decide if custom data attributes are okay */\n let ALLOW_DATA_ATTR = true;\n\n /* Decide if unknown protocols are okay */\n let ALLOW_UNKNOWN_PROTOCOLS = false;\n\n /* Decide if self-closing tags in attributes are allowed.\n * Usually removed due to a mXSS issue in jQuery 3.0 */\n let ALLOW_SELF_CLOSE_IN_ATTR = true;\n\n /* Output should be safe for common template engines.\n * This means, DOMPurify removes data attributes, mustaches and ERB\n */\n let SAFE_FOR_TEMPLATES = false;\n\n /* Output should be safe even for XML used within HTML and alike.\n * This means, DOMPurify removes comments when containing risky content.\n */\n let SAFE_FOR_XML = true;\n\n /* Decide if document with ... should be returned */\n let WHOLE_DOCUMENT = false;\n\n /* Track whether config is already set on this instance of DOMPurify. */\n let SET_CONFIG = false;\n\n /* Decide if all elements (e.g. style, script) must be children of\n * document.body. By default, browsers might move them to document.head */\n let FORCE_BODY = false;\n\n /* Decide if a DOM `HTMLBodyElement` should be returned, instead of a html\n * string (or a TrustedHTML object if Trusted Types are supported).\n * If `WHOLE_DOCUMENT` is enabled a `HTMLHtmlElement` will be returned instead\n */\n let RETURN_DOM = false;\n\n /* Decide if a DOM `DocumentFragment` should be returned, instead of a html\n * string (or a TrustedHTML object if Trusted Types are supported) */\n let RETURN_DOM_FRAGMENT = false;\n\n /* Try to return a Trusted Type object instead of a string, return a string in\n * case Trusted Types are not supported */\n let RETURN_TRUSTED_TYPE = false;\n\n /* Output should be free from DOM clobbering attacks?\n * This sanitizes markups named with colliding, clobberable built-in DOM APIs.\n */\n let SANITIZE_DOM = true;\n\n /* Achieve full DOM Clobbering protection by isolating the namespace of named\n * properties and JS variables, mitigating attacks that abuse the HTML/DOM spec rules.\n *\n * HTML/DOM spec rules that enable DOM Clobbering:\n * - Named Access on Window (§7.3.3)\n * - DOM Tree Accessors (§3.1.5)\n * - Form Element Parent-Child Relations (§4.10.3)\n * - Iframe srcdoc / Nested WindowProxies (§4.8.5)\n * - HTMLCollection (§4.2.10.2)\n *\n * Namespace isolation is implemented by prefixing `id` and `name` attributes\n * with a constant string, i.e., `user-content-`\n */\n let SANITIZE_NAMED_PROPS = false;\n const SANITIZE_NAMED_PROPS_PREFIX = 'user-content-';\n\n /* Keep element content when removing element? */\n let KEEP_CONTENT = true;\n\n /* If a `Node` is passed to sanitize(), then performs sanitization in-place instead\n * of importing it into a new Document and returning a sanitized copy */\n let IN_PLACE = false;\n\n /* Allow usage of profiles like html, svg and mathMl */\n let USE_PROFILES = {};\n\n /* Tags to ignore content of when KEEP_CONTENT is true */\n let FORBID_CONTENTS = null;\n const DEFAULT_FORBID_CONTENTS = addToSet({}, ['annotation-xml', 'audio', 'colgroup', 'desc', 'foreignobject', 'head', 'iframe', 'math', 'mi', 'mn', 'mo', 'ms', 'mtext', 'noembed', 'noframes', 'noscript', 'plaintext', 'script', 'style', 'svg', 'template', 'thead', 'title', 'video', 'xmp']);\n\n /* Tags that are safe for data: URIs */\n let DATA_URI_TAGS = null;\n const DEFAULT_DATA_URI_TAGS = addToSet({}, ['audio', 'video', 'img', 'source', 'image', 'track']);\n\n /* Attributes safe for values like \"javascript:\" */\n let URI_SAFE_ATTRIBUTES = null;\n const DEFAULT_URI_SAFE_ATTRIBUTES = addToSet({}, ['alt', 'class', 'for', 'id', 'label', 'name', 'pattern', 'placeholder', 'role', 'summary', 'title', 'value', 'style', 'xmlns']);\n const MATHML_NAMESPACE = 'http://www.w3.org/1998/Math/MathML';\n const SVG_NAMESPACE = 'http://www.w3.org/2000/svg';\n const HTML_NAMESPACE = 'http://www.w3.org/1999/xhtml';\n /* Document namespace */\n let NAMESPACE = HTML_NAMESPACE;\n let IS_EMPTY_INPUT = false;\n\n /* Allowed XHTML+XML namespaces */\n let ALLOWED_NAMESPACES = null;\n const DEFAULT_ALLOWED_NAMESPACES = addToSet({}, [MATHML_NAMESPACE, SVG_NAMESPACE, HTML_NAMESPACE], stringToString);\n\n /* Parsing of strict XHTML documents */\n let PARSER_MEDIA_TYPE = null;\n const SUPPORTED_PARSER_MEDIA_TYPES = ['application/xhtml+xml', 'text/html'];\n const DEFAULT_PARSER_MEDIA_TYPE = 'text/html';\n let transformCaseFunc = null;\n\n /* Keep a reference to config to pass to hooks */\n let CONFIG = null;\n\n /* Ideally, do not touch anything below this line */\n /* ______________________________________________ */\n\n const formElement = document.createElement('form');\n const isRegexOrFunction = function isRegexOrFunction(testValue) {\n return testValue instanceof RegExp || testValue instanceof Function;\n };\n\n /**\n * _parseConfig\n *\n * @param {Object} cfg optional config literal\n */\n // eslint-disable-next-line complexity\n const _parseConfig = function _parseConfig() {\n let cfg = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n if (CONFIG && CONFIG === cfg) {\n return;\n }\n\n /* Shield configuration object from tampering */\n if (!cfg || typeof cfg !== 'object') {\n cfg = {};\n }\n\n /* Shield configuration object from prototype pollution */\n cfg = clone(cfg);\n PARSER_MEDIA_TYPE =\n // eslint-disable-next-line unicorn/prefer-includes\n SUPPORTED_PARSER_MEDIA_TYPES.indexOf(cfg.PARSER_MEDIA_TYPE) === -1 ? DEFAULT_PARSER_MEDIA_TYPE : cfg.PARSER_MEDIA_TYPE;\n\n // HTML tags and attributes are not case-sensitive, converting to lowercase. Keeping XHTML as is.\n transformCaseFunc = PARSER_MEDIA_TYPE === 'application/xhtml+xml' ? stringToString : stringToLowerCase;\n\n /* Set configuration parameters */\n ALLOWED_TAGS = objectHasOwnProperty(cfg, 'ALLOWED_TAGS') ? addToSet({}, cfg.ALLOWED_TAGS, transformCaseFunc) : DEFAULT_ALLOWED_TAGS;\n ALLOWED_ATTR = objectHasOwnProperty(cfg, 'ALLOWED_ATTR') ? addToSet({}, cfg.ALLOWED_ATTR, transformCaseFunc) : DEFAULT_ALLOWED_ATTR;\n ALLOWED_NAMESPACES = objectHasOwnProperty(cfg, 'ALLOWED_NAMESPACES') ? addToSet({}, cfg.ALLOWED_NAMESPACES, stringToString) : DEFAULT_ALLOWED_NAMESPACES;\n URI_SAFE_ATTRIBUTES = objectHasOwnProperty(cfg, 'ADD_URI_SAFE_ATTR') ? addToSet(clone(DEFAULT_URI_SAFE_ATTRIBUTES),\n // eslint-disable-line indent\n cfg.ADD_URI_SAFE_ATTR,\n // eslint-disable-line indent\n transformCaseFunc // eslint-disable-line indent\n ) // eslint-disable-line indent\n : DEFAULT_URI_SAFE_ATTRIBUTES;\n DATA_URI_TAGS = objectHasOwnProperty(cfg, 'ADD_DATA_URI_TAGS') ? addToSet(clone(DEFAULT_DATA_URI_TAGS),\n // eslint-disable-line indent\n cfg.ADD_DATA_URI_TAGS,\n // eslint-disable-line indent\n transformCaseFunc // eslint-disable-line indent\n ) // eslint-disable-line indent\n : DEFAULT_DATA_URI_TAGS;\n FORBID_CONTENTS = objectHasOwnProperty(cfg, 'FORBID_CONTENTS') ? addToSet({}, cfg.FORBID_CONTENTS, transformCaseFunc) : DEFAULT_FORBID_CONTENTS;\n FORBID_TAGS = objectHasOwnProperty(cfg, 'FORBID_TAGS') ? addToSet({}, cfg.FORBID_TAGS, transformCaseFunc) : {};\n FORBID_ATTR = objectHasOwnProperty(cfg, 'FORBID_ATTR') ? addToSet({}, cfg.FORBID_ATTR, transformCaseFunc) : {};\n USE_PROFILES = objectHasOwnProperty(cfg, 'USE_PROFILES') ? cfg.USE_PROFILES : false;\n ALLOW_ARIA_ATTR = cfg.ALLOW_ARIA_ATTR !== false; // Default true\n ALLOW_DATA_ATTR = cfg.ALLOW_DATA_ATTR !== false; // Default true\n ALLOW_UNKNOWN_PROTOCOLS = cfg.ALLOW_UNKNOWN_PROTOCOLS || false; // Default false\n ALLOW_SELF_CLOSE_IN_ATTR = cfg.ALLOW_SELF_CLOSE_IN_ATTR !== false; // Default true\n SAFE_FOR_TEMPLATES = cfg.SAFE_FOR_TEMPLATES || false; // Default false\n SAFE_FOR_XML = cfg.SAFE_FOR_XML !== false; // Default true\n WHOLE_DOCUMENT = cfg.WHOLE_DOCUMENT || false; // Default false\n RETURN_DOM = cfg.RETURN_DOM || false; // Default false\n RETURN_DOM_FRAGMENT = cfg.RETURN_DOM_FRAGMENT || false; // Default false\n RETURN_TRUSTED_TYPE = cfg.RETURN_TRUSTED_TYPE || false; // Default false\n FORCE_BODY = cfg.FORCE_BODY || false; // Default false\n SANITIZE_DOM = cfg.SANITIZE_DOM !== false; // Default true\n SANITIZE_NAMED_PROPS = cfg.SANITIZE_NAMED_PROPS || false; // Default false\n KEEP_CONTENT = cfg.KEEP_CONTENT !== false; // Default true\n IN_PLACE = cfg.IN_PLACE || false; // Default false\n IS_ALLOWED_URI$1 = cfg.ALLOWED_URI_REGEXP || IS_ALLOWED_URI;\n NAMESPACE = cfg.NAMESPACE || HTML_NAMESPACE;\n CUSTOM_ELEMENT_HANDLING = cfg.CUSTOM_ELEMENT_HANDLING || {};\n if (cfg.CUSTOM_ELEMENT_HANDLING && isRegexOrFunction(cfg.CUSTOM_ELEMENT_HANDLING.tagNameCheck)) {\n CUSTOM_ELEMENT_HANDLING.tagNameCheck = cfg.CUSTOM_ELEMENT_HANDLING.tagNameCheck;\n }\n if (cfg.CUSTOM_ELEMENT_HANDLING && isRegexOrFunction(cfg.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)) {\n CUSTOM_ELEMENT_HANDLING.attributeNameCheck = cfg.CUSTOM_ELEMENT_HANDLING.attributeNameCheck;\n }\n if (cfg.CUSTOM_ELEMENT_HANDLING && typeof cfg.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements === 'boolean') {\n CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements = cfg.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements;\n }\n if (SAFE_FOR_TEMPLATES) {\n ALLOW_DATA_ATTR = false;\n }\n if (RETURN_DOM_FRAGMENT) {\n RETURN_DOM = true;\n }\n\n /* Parse profile info */\n if (USE_PROFILES) {\n ALLOWED_TAGS = addToSet({}, text);\n ALLOWED_ATTR = [];\n if (USE_PROFILES.html === true) {\n addToSet(ALLOWED_TAGS, html$1);\n addToSet(ALLOWED_ATTR, html);\n }\n if (USE_PROFILES.svg === true) {\n addToSet(ALLOWED_TAGS, svg$1);\n addToSet(ALLOWED_ATTR, svg);\n addToSet(ALLOWED_ATTR, xml);\n }\n if (USE_PROFILES.svgFilters === true) {\n addToSet(ALLOWED_TAGS, svgFilters);\n addToSet(ALLOWED_ATTR, svg);\n addToSet(ALLOWED_ATTR, xml);\n }\n if (USE_PROFILES.mathMl === true) {\n addToSet(ALLOWED_TAGS, mathMl$1);\n addToSet(ALLOWED_ATTR, mathMl);\n addToSet(ALLOWED_ATTR, xml);\n }\n }\n\n /* Merge configuration parameters */\n if (cfg.ADD_TAGS) {\n if (ALLOWED_TAGS === DEFAULT_ALLOWED_TAGS) {\n ALLOWED_TAGS = clone(ALLOWED_TAGS);\n }\n addToSet(ALLOWED_TAGS, cfg.ADD_TAGS, transformCaseFunc);\n }\n if (cfg.ADD_ATTR) {\n if (ALLOWED_ATTR === DEFAULT_ALLOWED_ATTR) {\n ALLOWED_ATTR = clone(ALLOWED_ATTR);\n }\n addToSet(ALLOWED_ATTR, cfg.ADD_ATTR, transformCaseFunc);\n }\n if (cfg.ADD_URI_SAFE_ATTR) {\n addToSet(URI_SAFE_ATTRIBUTES, cfg.ADD_URI_SAFE_ATTR, transformCaseFunc);\n }\n if (cfg.FORBID_CONTENTS) {\n if (FORBID_CONTENTS === DEFAULT_FORBID_CONTENTS) {\n FORBID_CONTENTS = clone(FORBID_CONTENTS);\n }\n addToSet(FORBID_CONTENTS, cfg.FORBID_CONTENTS, transformCaseFunc);\n }\n\n /* Add #text in case KEEP_CONTENT is set to true */\n if (KEEP_CONTENT) {\n ALLOWED_TAGS['#text'] = true;\n }\n\n /* Add html, head and body to ALLOWED_TAGS in case WHOLE_DOCUMENT is true */\n if (WHOLE_DOCUMENT) {\n addToSet(ALLOWED_TAGS, ['html', 'head', 'body']);\n }\n\n /* Add tbody to ALLOWED_TAGS in case tables are permitted, see #286, #365 */\n if (ALLOWED_TAGS.table) {\n addToSet(ALLOWED_TAGS, ['tbody']);\n delete FORBID_TAGS.tbody;\n }\n if (cfg.TRUSTED_TYPES_POLICY) {\n if (typeof cfg.TRUSTED_TYPES_POLICY.createHTML !== 'function') {\n throw typeErrorCreate('TRUSTED_TYPES_POLICY configuration option must provide a \"createHTML\" hook.');\n }\n if (typeof cfg.TRUSTED_TYPES_POLICY.createScriptURL !== 'function') {\n throw typeErrorCreate('TRUSTED_TYPES_POLICY configuration option must provide a \"createScriptURL\" hook.');\n }\n\n // Overwrite existing TrustedTypes policy.\n trustedTypesPolicy = cfg.TRUSTED_TYPES_POLICY;\n\n // Sign local variables required by `sanitize`.\n emptyHTML = trustedTypesPolicy.createHTML('');\n } else {\n // Uninitialized policy, attempt to initialize the internal dompurify policy.\n if (trustedTypesPolicy === undefined) {\n trustedTypesPolicy = _createTrustedTypesPolicy(trustedTypes, currentScript);\n }\n\n // If creating the internal policy succeeded sign internal variables.\n if (trustedTypesPolicy !== null && typeof emptyHTML === 'string') {\n emptyHTML = trustedTypesPolicy.createHTML('');\n }\n }\n\n // Prevent further manipulation of configuration.\n // Not available in IE8, Safari 5, etc.\n if (freeze) {\n freeze(cfg);\n }\n CONFIG = cfg;\n };\n const MATHML_TEXT_INTEGRATION_POINTS = addToSet({}, ['mi', 'mo', 'mn', 'ms', 'mtext']);\n const HTML_INTEGRATION_POINTS = addToSet({}, ['foreignobject', 'annotation-xml']);\n\n // Certain elements are allowed in both SVG and HTML\n // namespace. We need to specify them explicitly\n // so that they don't get erroneously deleted from\n // HTML namespace.\n const COMMON_SVG_AND_HTML_ELEMENTS = addToSet({}, ['title', 'style', 'font', 'a', 'script']);\n\n /* Keep track of all possible SVG and MathML tags\n * so that we can perform the namespace checks\n * correctly. */\n const ALL_SVG_TAGS = addToSet({}, [...svg$1, ...svgFilters, ...svgDisallowed]);\n const ALL_MATHML_TAGS = addToSet({}, [...mathMl$1, ...mathMlDisallowed]);\n\n /**\n * @param {Element} element a DOM element whose namespace is being checked\n * @returns {boolean} Return false if the element has a\n * namespace that a spec-compliant parser would never\n * return. Return true otherwise.\n */\n const _checkValidNamespace = function _checkValidNamespace(element) {\n let parent = getParentNode(element);\n\n // In JSDOM, if we're inside shadow DOM, then parentNode\n // can be null. We just simulate parent in this case.\n if (!parent || !parent.tagName) {\n parent = {\n namespaceURI: NAMESPACE,\n tagName: 'template'\n };\n }\n const tagName = stringToLowerCase(element.tagName);\n const parentTagName = stringToLowerCase(parent.tagName);\n if (!ALLOWED_NAMESPACES[element.namespaceURI]) {\n return false;\n }\n if (element.namespaceURI === SVG_NAMESPACE) {\n // The only way to switch from HTML namespace to SVG\n // is via . If it happens via any other tag, then\n // it should be killed.\n if (parent.namespaceURI === HTML_NAMESPACE) {\n return tagName === 'svg';\n }\n\n // The only way to switch from MathML to SVG is via`\n // svg if parent is either or MathML\n // text integration points.\n if (parent.namespaceURI === MATHML_NAMESPACE) {\n return tagName === 'svg' && (parentTagName === 'annotation-xml' || MATHML_TEXT_INTEGRATION_POINTS[parentTagName]);\n }\n\n // We only allow elements that are defined in SVG\n // spec. All others are disallowed in SVG namespace.\n return Boolean(ALL_SVG_TAGS[tagName]);\n }\n if (element.namespaceURI === MATHML_NAMESPACE) {\n // The only way to switch from HTML namespace to MathML\n // is via . If it happens via any other tag, then\n // it should be killed.\n if (parent.namespaceURI === HTML_NAMESPACE) {\n return tagName === 'math';\n }\n\n // The only way to switch from SVG to MathML is via\n // and HTML integration points\n if (parent.namespaceURI === SVG_NAMESPACE) {\n return tagName === 'math' && HTML_INTEGRATION_POINTS[parentTagName];\n }\n\n // We only allow elements that are defined in MathML\n // spec. All others are disallowed in MathML namespace.\n return Boolean(ALL_MATHML_TAGS[tagName]);\n }\n if (element.namespaceURI === HTML_NAMESPACE) {\n // The only way to switch from SVG to HTML is via\n // HTML integration points, and from MathML to HTML\n // is via MathML text integration points\n if (parent.namespaceURI === SVG_NAMESPACE && !HTML_INTEGRATION_POINTS[parentTagName]) {\n return false;\n }\n if (parent.namespaceURI === MATHML_NAMESPACE && !MATHML_TEXT_INTEGRATION_POINTS[parentTagName]) {\n return false;\n }\n\n // We disallow tags that are specific for MathML\n // or SVG and should never appear in HTML namespace\n return !ALL_MATHML_TAGS[tagName] && (COMMON_SVG_AND_HTML_ELEMENTS[tagName] || !ALL_SVG_TAGS[tagName]);\n }\n\n // For XHTML and XML documents that support custom namespaces\n if (PARSER_MEDIA_TYPE === 'application/xhtml+xml' && ALLOWED_NAMESPACES[element.namespaceURI]) {\n return true;\n }\n\n // The code should never reach this place (this means\n // that the element somehow got namespace that is not\n // HTML, SVG, MathML or allowed via ALLOWED_NAMESPACES).\n // Return false just in case.\n return false;\n };\n\n /**\n * _forceRemove\n *\n * @param {Node} node a DOM node\n */\n const _forceRemove = function _forceRemove(node) {\n arrayPush(DOMPurify.removed, {\n element: node\n });\n try {\n // eslint-disable-next-line unicorn/prefer-dom-node-remove\n getParentNode(node).removeChild(node);\n } catch (_) {\n remove(node);\n }\n };\n\n /**\n * _removeAttribute\n *\n * @param {String} name an Attribute name\n * @param {Node} node a DOM node\n */\n const _removeAttribute = function _removeAttribute(name, node) {\n try {\n arrayPush(DOMPurify.removed, {\n attribute: node.getAttributeNode(name),\n from: node\n });\n } catch (_) {\n arrayPush(DOMPurify.removed, {\n attribute: null,\n from: node\n });\n }\n node.removeAttribute(name);\n\n // We void attribute values for unremovable \"is\"\" attributes\n if (name === 'is' && !ALLOWED_ATTR[name]) {\n if (RETURN_DOM || RETURN_DOM_FRAGMENT) {\n try {\n _forceRemove(node);\n } catch (_) {}\n } else {\n try {\n node.setAttribute(name, '');\n } catch (_) {}\n }\n }\n };\n\n /**\n * _initDocument\n *\n * @param {String} dirty a string of dirty markup\n * @return {Document} a DOM, filled with the dirty markup\n */\n const _initDocument = function _initDocument(dirty) {\n /* Create a HTML document */\n let doc = null;\n let leadingWhitespace = null;\n if (FORCE_BODY) {\n dirty = '' + dirty;\n } else {\n /* If FORCE_BODY isn't used, leading whitespace needs to be preserved manually */\n const matches = stringMatch(dirty, /^[\\r\\n\\t ]+/);\n leadingWhitespace = matches && matches[0];\n }\n if (PARSER_MEDIA_TYPE === 'application/xhtml+xml' && NAMESPACE === HTML_NAMESPACE) {\n // Root of XHTML doc must contain xmlns declaration (see https://www.w3.org/TR/xhtml1/normative.html#strict)\n dirty = '' + dirty + '';\n }\n const dirtyPayload = trustedTypesPolicy ? trustedTypesPolicy.createHTML(dirty) : dirty;\n /*\n * Use the DOMParser API by default, fallback later if needs be\n * DOMParser not work for svg when has multiple root element.\n */\n if (NAMESPACE === HTML_NAMESPACE) {\n try {\n doc = new DOMParser().parseFromString(dirtyPayload, PARSER_MEDIA_TYPE);\n } catch (_) {}\n }\n\n /* Use createHTMLDocument in case DOMParser is not available */\n if (!doc || !doc.documentElement) {\n doc = implementation.createDocument(NAMESPACE, 'template', null);\n try {\n doc.documentElement.innerHTML = IS_EMPTY_INPUT ? emptyHTML : dirtyPayload;\n } catch (_) {\n // Syntax error if dirtyPayload is invalid xml\n }\n }\n const body = doc.body || doc.documentElement;\n if (dirty && leadingWhitespace) {\n body.insertBefore(document.createTextNode(leadingWhitespace), body.childNodes[0] || null);\n }\n\n /* Work on whole document or just its body */\n if (NAMESPACE === HTML_NAMESPACE) {\n return getElementsByTagName.call(doc, WHOLE_DOCUMENT ? 'html' : 'body')[0];\n }\n return WHOLE_DOCUMENT ? doc.documentElement : body;\n };\n\n /**\n * Creates a NodeIterator object that you can use to traverse filtered lists of nodes or elements in a document.\n *\n * @param {Node} root The root element or node to start traversing on.\n * @return {NodeIterator} The created NodeIterator\n */\n const _createNodeIterator = function _createNodeIterator(root) {\n return createNodeIterator.call(root.ownerDocument || root, root,\n // eslint-disable-next-line no-bitwise\n NodeFilter.SHOW_ELEMENT | NodeFilter.SHOW_COMMENT | NodeFilter.SHOW_TEXT | NodeFilter.SHOW_PROCESSING_INSTRUCTION | NodeFilter.SHOW_CDATA_SECTION, null);\n };\n\n /**\n * _isClobbered\n *\n * @param {Node} elm element to check for clobbering attacks\n * @return {Boolean} true if clobbered, false if safe\n */\n const _isClobbered = function _isClobbered(elm) {\n return elm instanceof HTMLFormElement && (typeof elm.nodeName !== 'string' || typeof elm.textContent !== 'string' || typeof elm.removeChild !== 'function' || !(elm.attributes instanceof NamedNodeMap) || typeof elm.removeAttribute !== 'function' || typeof elm.setAttribute !== 'function' || typeof elm.namespaceURI !== 'string' || typeof elm.insertBefore !== 'function' || typeof elm.hasChildNodes !== 'function');\n };\n\n /**\n * Checks whether the given object is a DOM node.\n *\n * @param {Node} object object to check whether it's a DOM node\n * @return {Boolean} true is object is a DOM node\n */\n const _isNode = function _isNode(object) {\n return typeof Node === 'function' && object instanceof Node;\n };\n\n /**\n * _executeHook\n * Execute user configurable hooks\n *\n * @param {String} entryPoint Name of the hook's entry point\n * @param {Node} currentNode node to work on with the hook\n * @param {Object} data additional hook parameters\n */\n const _executeHook = function _executeHook(entryPoint, currentNode, data) {\n if (!hooks[entryPoint]) {\n return;\n }\n arrayForEach(hooks[entryPoint], hook => {\n hook.call(DOMPurify, currentNode, data, CONFIG);\n });\n };\n\n /**\n * _sanitizeElements\n *\n * @protect nodeName\n * @protect textContent\n * @protect removeChild\n *\n * @param {Node} currentNode to check for permission to exist\n * @return {Boolean} true if node was killed, false if left alive\n */\n const _sanitizeElements = function _sanitizeElements(currentNode) {\n let content = null;\n\n /* Execute a hook if present */\n _executeHook('beforeSanitizeElements', currentNode, null);\n\n /* Check if element is clobbered or can clobber */\n if (_isClobbered(currentNode)) {\n _forceRemove(currentNode);\n return true;\n }\n\n /* Now let's check the element's type and name */\n const tagName = transformCaseFunc(currentNode.nodeName);\n\n /* Execute a hook if present */\n _executeHook('uponSanitizeElement', currentNode, {\n tagName,\n allowedTags: ALLOWED_TAGS\n });\n\n /* Detect mXSS attempts abusing namespace confusion */\n if (currentNode.hasChildNodes() && !_isNode(currentNode.firstElementChild) && regExpTest(/<[/\\w]/g, currentNode.innerHTML) && regExpTest(/<[/\\w]/g, currentNode.textContent)) {\n _forceRemove(currentNode);\n return true;\n }\n\n /* Remove any occurrence of processing instructions */\n if (currentNode.nodeType === NODE_TYPE.progressingInstruction) {\n _forceRemove(currentNode);\n return true;\n }\n\n /* Remove any kind of possibly harmful comments */\n if (SAFE_FOR_XML && currentNode.nodeType === NODE_TYPE.comment && regExpTest(/<[/\\w]/g, currentNode.data)) {\n _forceRemove(currentNode);\n return true;\n }\n\n /* Remove element if anything forbids its presence */\n if (!ALLOWED_TAGS[tagName] || FORBID_TAGS[tagName]) {\n /* Check if we have a custom element to handle */\n if (!FORBID_TAGS[tagName] && _isBasicCustomElement(tagName)) {\n if (CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof RegExp && regExpTest(CUSTOM_ELEMENT_HANDLING.tagNameCheck, tagName)) {\n return false;\n }\n if (CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof Function && CUSTOM_ELEMENT_HANDLING.tagNameCheck(tagName)) {\n return false;\n }\n }\n\n /* Keep content except for bad-listed elements */\n if (KEEP_CONTENT && !FORBID_CONTENTS[tagName]) {\n const parentNode = getParentNode(currentNode) || currentNode.parentNode;\n const childNodes = getChildNodes(currentNode) || currentNode.childNodes;\n if (childNodes && parentNode) {\n const childCount = childNodes.length;\n for (let i = childCount - 1; i >= 0; --i) {\n const childClone = cloneNode(childNodes[i], true);\n childClone.__removalCount = (currentNode.__removalCount || 0) + 1;\n parentNode.insertBefore(childClone, getNextSibling(currentNode));\n }\n }\n }\n _forceRemove(currentNode);\n return true;\n }\n\n /* Check whether element has a valid namespace */\n if (currentNode instanceof Element && !_checkValidNamespace(currentNode)) {\n _forceRemove(currentNode);\n return true;\n }\n\n /* Make sure that older browsers don't get fallback-tag mXSS */\n if ((tagName === 'noscript' || tagName === 'noembed' || tagName === 'noframes') && regExpTest(/<\\/no(script|embed|frames)/i, currentNode.innerHTML)) {\n _forceRemove(currentNode);\n return true;\n }\n\n /* Sanitize element content to be template-safe */\n if (SAFE_FOR_TEMPLATES && currentNode.nodeType === NODE_TYPE.text) {\n /* Get the element's text content */\n content = currentNode.textContent;\n arrayForEach([MUSTACHE_EXPR, ERB_EXPR, TMPLIT_EXPR], expr => {\n content = stringReplace(content, expr, ' ');\n });\n if (currentNode.textContent !== content) {\n arrayPush(DOMPurify.removed, {\n element: currentNode.cloneNode()\n });\n currentNode.textContent = content;\n }\n }\n\n /* Execute a hook if present */\n _executeHook('afterSanitizeElements', currentNode, null);\n return false;\n };\n\n /**\n * _isValidAttribute\n *\n * @param {string} lcTag Lowercase tag name of containing element.\n * @param {string} lcName Lowercase attribute name.\n * @param {string} value Attribute value.\n * @return {Boolean} Returns true if `value` is valid, otherwise false.\n */\n // eslint-disable-next-line complexity\n const _isValidAttribute = function _isValidAttribute(lcTag, lcName, value) {\n /* Make sure attribute cannot clobber */\n if (SANITIZE_DOM && (lcName === 'id' || lcName === 'name') && (value in document || value in formElement)) {\n return false;\n }\n\n /* Allow valid data-* attributes: At least one character after \"-\"\n (https://html.spec.whatwg.org/multipage/dom.html#embedding-custom-non-visible-data-with-the-data-*-attributes)\n XML-compatible (https://html.spec.whatwg.org/multipage/infrastructure.html#xml-compatible and http://www.w3.org/TR/xml/#d0e804)\n We don't need to check the value; it's always URI safe. */\n if (ALLOW_DATA_ATTR && !FORBID_ATTR[lcName] && regExpTest(DATA_ATTR, lcName)) ; else if (ALLOW_ARIA_ATTR && regExpTest(ARIA_ATTR, lcName)) ; else if (!ALLOWED_ATTR[lcName] || FORBID_ATTR[lcName]) {\n if (\n // First condition does a very basic check if a) it's basically a valid custom element tagname AND\n // b) if the tagName passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.tagNameCheck\n // and c) if the attribute name passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.attributeNameCheck\n _isBasicCustomElement(lcTag) && (CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof RegExp && regExpTest(CUSTOM_ELEMENT_HANDLING.tagNameCheck, lcTag) || CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof Function && CUSTOM_ELEMENT_HANDLING.tagNameCheck(lcTag)) && (CUSTOM_ELEMENT_HANDLING.attributeNameCheck instanceof RegExp && regExpTest(CUSTOM_ELEMENT_HANDLING.attributeNameCheck, lcName) || CUSTOM_ELEMENT_HANDLING.attributeNameCheck instanceof Function && CUSTOM_ELEMENT_HANDLING.attributeNameCheck(lcName)) ||\n // Alternative, second condition checks if it's an `is`-attribute, AND\n // the value passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.tagNameCheck\n lcName === 'is' && CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements && (CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof RegExp && regExpTest(CUSTOM_ELEMENT_HANDLING.tagNameCheck, value) || CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof Function && CUSTOM_ELEMENT_HANDLING.tagNameCheck(value))) ; else {\n return false;\n }\n /* Check value is safe. First, is attr inert? If so, is safe */\n } else if (URI_SAFE_ATTRIBUTES[lcName]) ; else if (regExpTest(IS_ALLOWED_URI$1, stringReplace(value, ATTR_WHITESPACE, ''))) ; else if ((lcName === 'src' || lcName === 'xlink:href' || lcName === 'href') && lcTag !== 'script' && stringIndexOf(value, 'data:') === 0 && DATA_URI_TAGS[lcTag]) ; else if (ALLOW_UNKNOWN_PROTOCOLS && !regExpTest(IS_SCRIPT_OR_DATA, stringReplace(value, ATTR_WHITESPACE, ''))) ; else if (value) {\n return false;\n } else ;\n return true;\n };\n\n /**\n * _isBasicCustomElement\n * checks if at least one dash is included in tagName, and it's not the first char\n * for more sophisticated checking see https://github.com/sindresorhus/validate-element-name\n *\n * @param {string} tagName name of the tag of the node to sanitize\n * @returns {boolean} Returns true if the tag name meets the basic criteria for a custom element, otherwise false.\n */\n const _isBasicCustomElement = function _isBasicCustomElement(tagName) {\n return tagName !== 'annotation-xml' && stringMatch(tagName, CUSTOM_ELEMENT);\n };\n\n /**\n * _sanitizeAttributes\n *\n * @protect attributes\n * @protect nodeName\n * @protect removeAttribute\n * @protect setAttribute\n *\n * @param {Node} currentNode to sanitize\n */\n const _sanitizeAttributes = function _sanitizeAttributes(currentNode) {\n /* Execute a hook if present */\n _executeHook('beforeSanitizeAttributes', currentNode, null);\n const {\n attributes\n } = currentNode;\n\n /* Check if we have attributes; if not we might have a text node */\n if (!attributes) {\n return;\n }\n const hookEvent = {\n attrName: '',\n attrValue: '',\n keepAttr: true,\n allowedAttributes: ALLOWED_ATTR\n };\n let l = attributes.length;\n\n /* Go backwards over all attributes; safely remove bad ones */\n while (l--) {\n const attr = attributes[l];\n const {\n name,\n namespaceURI,\n value: attrValue\n } = attr;\n const lcName = transformCaseFunc(name);\n let value = name === 'value' ? attrValue : stringTrim(attrValue);\n\n /* Execute a hook if present */\n hookEvent.attrName = lcName;\n hookEvent.attrValue = value;\n hookEvent.keepAttr = true;\n hookEvent.forceKeepAttr = undefined; // Allows developers to see this is a property they can set\n _executeHook('uponSanitizeAttribute', currentNode, hookEvent);\n value = hookEvent.attrValue;\n\n /* Work around a security issue with comments inside attributes */\n if (SAFE_FOR_XML && regExpTest(/((--!?|])>)|<\\/(style|title)/i, value)) {\n _removeAttribute(name, currentNode);\n continue;\n }\n\n /* Did the hooks approve of the attribute? */\n if (hookEvent.forceKeepAttr) {\n continue;\n }\n\n /* Remove attribute */\n _removeAttribute(name, currentNode);\n\n /* Did the hooks approve of the attribute? */\n if (!hookEvent.keepAttr) {\n continue;\n }\n\n /* Work around a security issue in jQuery 3.0 */\n if (!ALLOW_SELF_CLOSE_IN_ATTR && regExpTest(/\\/>/i, value)) {\n _removeAttribute(name, currentNode);\n continue;\n }\n\n /* Sanitize attribute content to be template-safe */\n if (SAFE_FOR_TEMPLATES) {\n arrayForEach([MUSTACHE_EXPR, ERB_EXPR, TMPLIT_EXPR], expr => {\n value = stringReplace(value, expr, ' ');\n });\n }\n\n /* Is `value` valid for this attribute? */\n const lcTag = transformCaseFunc(currentNode.nodeName);\n if (!_isValidAttribute(lcTag, lcName, value)) {\n continue;\n }\n\n /* Full DOM Clobbering protection via namespace isolation,\n * Prefix id and name attributes with `user-content-`\n */\n if (SANITIZE_NAMED_PROPS && (lcName === 'id' || lcName === 'name')) {\n // Remove the attribute with this value\n _removeAttribute(name, currentNode);\n\n // Prefix the value and later re-create the attribute with the sanitized value\n value = SANITIZE_NAMED_PROPS_PREFIX + value;\n }\n\n /* Handle attributes that require Trusted Types */\n if (trustedTypesPolicy && typeof trustedTypes === 'object' && typeof trustedTypes.getAttributeType === 'function') {\n if (namespaceURI) ; else {\n switch (trustedTypes.getAttributeType(lcTag, lcName)) {\n case 'TrustedHTML':\n {\n value = trustedTypesPolicy.createHTML(value);\n break;\n }\n case 'TrustedScriptURL':\n {\n value = trustedTypesPolicy.createScriptURL(value);\n break;\n }\n }\n }\n }\n\n /* Handle invalid data-* attribute set by try-catching it */\n try {\n if (namespaceURI) {\n currentNode.setAttributeNS(namespaceURI, name, value);\n } else {\n /* Fallback to setAttribute() for browser-unrecognized namespaces e.g. \"x-schema\". */\n currentNode.setAttribute(name, value);\n }\n if (_isClobbered(currentNode)) {\n _forceRemove(currentNode);\n } else {\n arrayPop(DOMPurify.removed);\n }\n } catch (_) {}\n }\n\n /* Execute a hook if present */\n _executeHook('afterSanitizeAttributes', currentNode, null);\n };\n\n /**\n * _sanitizeShadowDOM\n *\n * @param {DocumentFragment} fragment to iterate over recursively\n */\n const _sanitizeShadowDOM = function _sanitizeShadowDOM(fragment) {\n let shadowNode = null;\n const shadowIterator = _createNodeIterator(fragment);\n\n /* Execute a hook if present */\n _executeHook('beforeSanitizeShadowDOM', fragment, null);\n while (shadowNode = shadowIterator.nextNode()) {\n /* Execute a hook if present */\n _executeHook('uponSanitizeShadowNode', shadowNode, null);\n\n /* Sanitize tags and elements */\n if (_sanitizeElements(shadowNode)) {\n continue;\n }\n\n /* Deep shadow DOM detected */\n if (shadowNode.content instanceof DocumentFragment) {\n _sanitizeShadowDOM(shadowNode.content);\n }\n\n /* Check attributes, sanitize if necessary */\n _sanitizeAttributes(shadowNode);\n }\n\n /* Execute a hook if present */\n _executeHook('afterSanitizeShadowDOM', fragment, null);\n };\n\n /**\n * Sanitize\n * Public method providing core sanitation functionality\n *\n * @param {String|Node} dirty string or DOM node\n * @param {Object} cfg object\n */\n // eslint-disable-next-line complexity\n DOMPurify.sanitize = function (dirty) {\n let cfg = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n let body = null;\n let importedNode = null;\n let currentNode = null;\n let returnNode = null;\n /* Make sure we have a string to sanitize.\n DO NOT return early, as this will return the wrong type if\n the user has requested a DOM object rather than a string */\n IS_EMPTY_INPUT = !dirty;\n if (IS_EMPTY_INPUT) {\n dirty = '';\n }\n\n /* Stringify, in case dirty is an object */\n if (typeof dirty !== 'string' && !_isNode(dirty)) {\n if (typeof dirty.toString === 'function') {\n dirty = dirty.toString();\n if (typeof dirty !== 'string') {\n throw typeErrorCreate('dirty is not a string, aborting');\n }\n } else {\n throw typeErrorCreate('toString is not a function');\n }\n }\n\n /* Return dirty HTML if DOMPurify cannot run */\n if (!DOMPurify.isSupported) {\n return dirty;\n }\n\n /* Assign config vars */\n if (!SET_CONFIG) {\n _parseConfig(cfg);\n }\n\n /* Clean up removed elements */\n DOMPurify.removed = [];\n\n /* Check if dirty is correctly typed for IN_PLACE */\n if (typeof dirty === 'string') {\n IN_PLACE = false;\n }\n if (IN_PLACE) {\n /* Do some early pre-sanitization to avoid unsafe root nodes */\n if (dirty.nodeName) {\n const tagName = transformCaseFunc(dirty.nodeName);\n if (!ALLOWED_TAGS[tagName] || FORBID_TAGS[tagName]) {\n throw typeErrorCreate('root node is forbidden and cannot be sanitized in-place');\n }\n }\n } else if (dirty instanceof Node) {\n /* If dirty is a DOM element, append to an empty document to avoid\n elements being stripped by the parser */\n body = _initDocument('');\n importedNode = body.ownerDocument.importNode(dirty, true);\n if (importedNode.nodeType === NODE_TYPE.element && importedNode.nodeName === 'BODY') {\n /* Node is already a body, use as is */\n body = importedNode;\n } else if (importedNode.nodeName === 'HTML') {\n body = importedNode;\n } else {\n // eslint-disable-next-line unicorn/prefer-dom-node-append\n body.appendChild(importedNode);\n }\n } else {\n /* Exit directly if we have nothing to do */\n if (!RETURN_DOM && !SAFE_FOR_TEMPLATES && !WHOLE_DOCUMENT &&\n // eslint-disable-next-line unicorn/prefer-includes\n dirty.indexOf('<') === -1) {\n return trustedTypesPolicy && RETURN_TRUSTED_TYPE ? trustedTypesPolicy.createHTML(dirty) : dirty;\n }\n\n /* Initialize the document to work on */\n body = _initDocument(dirty);\n\n /* Check we have a DOM node from the data */\n if (!body) {\n return RETURN_DOM ? null : RETURN_TRUSTED_TYPE ? emptyHTML : '';\n }\n }\n\n /* Remove first element node (ours) if FORCE_BODY is set */\n if (body && FORCE_BODY) {\n _forceRemove(body.firstChild);\n }\n\n /* Get node iterator */\n const nodeIterator = _createNodeIterator(IN_PLACE ? dirty : body);\n\n /* Now start iterating over the created document */\n while (currentNode = nodeIterator.nextNode()) {\n /* Sanitize tags and elements */\n if (_sanitizeElements(currentNode)) {\n continue;\n }\n\n /* Shadow DOM detected, sanitize it */\n if (currentNode.content instanceof DocumentFragment) {\n _sanitizeShadowDOM(currentNode.content);\n }\n\n /* Check attributes, sanitize if necessary */\n _sanitizeAttributes(currentNode);\n }\n\n /* If we sanitized `dirty` in-place, return it. */\n if (IN_PLACE) {\n return dirty;\n }\n\n /* Return sanitized string or DOM */\n if (RETURN_DOM) {\n if (RETURN_DOM_FRAGMENT) {\n returnNode = createDocumentFragment.call(body.ownerDocument);\n while (body.firstChild) {\n // eslint-disable-next-line unicorn/prefer-dom-node-append\n returnNode.appendChild(body.firstChild);\n }\n } else {\n returnNode = body;\n }\n if (ALLOWED_ATTR.shadowroot || ALLOWED_ATTR.shadowrootmode) {\n /*\n AdoptNode() is not used because internal state is not reset\n (e.g. the past names map of a HTMLFormElement), this is safe\n in theory but we would rather not risk another attack vector.\n The state that is cloned by importNode() is explicitly defined\n by the specs.\n */\n returnNode = importNode.call(originalDocument, returnNode, true);\n }\n return returnNode;\n }\n let serializedHTML = WHOLE_DOCUMENT ? body.outerHTML : body.innerHTML;\n\n /* Serialize doctype if allowed */\n if (WHOLE_DOCUMENT && ALLOWED_TAGS['!doctype'] && body.ownerDocument && body.ownerDocument.doctype && body.ownerDocument.doctype.name && regExpTest(DOCTYPE_NAME, body.ownerDocument.doctype.name)) {\n serializedHTML = '\\n' + serializedHTML;\n }\n\n /* Sanitize final string template-safe */\n if (SAFE_FOR_TEMPLATES) {\n arrayForEach([MUSTACHE_EXPR, ERB_EXPR, TMPLIT_EXPR], expr => {\n serializedHTML = stringReplace(serializedHTML, expr, ' ');\n });\n }\n return trustedTypesPolicy && RETURN_TRUSTED_TYPE ? trustedTypesPolicy.createHTML(serializedHTML) : serializedHTML;\n };\n\n /**\n * Public method to set the configuration once\n * setConfig\n *\n * @param {Object} cfg configuration object\n */\n DOMPurify.setConfig = function () {\n let cfg = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n _parseConfig(cfg);\n SET_CONFIG = true;\n };\n\n /**\n * Public method to remove the configuration\n * clearConfig\n *\n */\n DOMPurify.clearConfig = function () {\n CONFIG = null;\n SET_CONFIG = false;\n };\n\n /**\n * Public method to check if an attribute value is valid.\n * Uses last set config, if any. Otherwise, uses config defaults.\n * isValidAttribute\n *\n * @param {String} tag Tag name of containing element.\n * @param {String} attr Attribute name.\n * @param {String} value Attribute value.\n * @return {Boolean} Returns true if `value` is valid. Otherwise, returns false.\n */\n DOMPurify.isValidAttribute = function (tag, attr, value) {\n /* Initialize shared config vars if necessary. */\n if (!CONFIG) {\n _parseConfig({});\n }\n const lcTag = transformCaseFunc(tag);\n const lcName = transformCaseFunc(attr);\n return _isValidAttribute(lcTag, lcName, value);\n };\n\n /**\n * AddHook\n * Public method to add DOMPurify hooks\n *\n * @param {String} entryPoint entry point for the hook to add\n * @param {Function} hookFunction function to execute\n */\n DOMPurify.addHook = function (entryPoint, hookFunction) {\n if (typeof hookFunction !== 'function') {\n return;\n }\n hooks[entryPoint] = hooks[entryPoint] || [];\n arrayPush(hooks[entryPoint], hookFunction);\n };\n\n /**\n * RemoveHook\n * Public method to remove a DOMPurify hook at a given entryPoint\n * (pops it from the stack of hooks if more are present)\n *\n * @param {String} entryPoint entry point for the hook to remove\n * @return {Function} removed(popped) hook\n */\n DOMPurify.removeHook = function (entryPoint) {\n if (hooks[entryPoint]) {\n return arrayPop(hooks[entryPoint]);\n }\n };\n\n /**\n * RemoveHooks\n * Public method to remove all DOMPurify hooks at a given entryPoint\n *\n * @param {String} entryPoint entry point for the hooks to remove\n */\n DOMPurify.removeHooks = function (entryPoint) {\n if (hooks[entryPoint]) {\n hooks[entryPoint] = [];\n }\n };\n\n /**\n * RemoveAllHooks\n * Public method to remove all DOMPurify hooks\n */\n DOMPurify.removeAllHooks = function () {\n hooks = {};\n };\n return DOMPurify;\n}\nvar purify = createDOMPurify();\n\nexport { purify as default };\n//# sourceMappingURL=purify.es.mjs.map\n","/*!\n * escape-html\n * Copyright(c) 2012-2013 TJ Holowaychuk\n * Copyright(c) 2015 Andreas Lubbe\n * Copyright(c) 2015 Tiancheng \"Timothy\" Gu\n * MIT Licensed\n */\n\n'use strict';\n\n/**\n * Module variables.\n * @private\n */\n\nvar matchHtmlRegExp = /[\"'&<>]/;\n\n/**\n * Module exports.\n * @public\n */\n\nmodule.exports = escapeHtml;\n\n/**\n * Escape special characters in the given string of html.\n *\n * @param {string} string The string to escape for inserting into HTML\n * @return {string}\n * @public\n */\n\nfunction escapeHtml(string) {\n var str = '' + string;\n var match = matchHtmlRegExp.exec(str);\n\n if (!match) {\n return str;\n }\n\n var escape;\n var html = '';\n var index = 0;\n var lastIndex = 0;\n\n for (index = match.index; index < str.length; index++) {\n switch (str.charCodeAt(index)) {\n case 34: // \"\n escape = '"';\n break;\n case 38: // &\n escape = '&';\n break;\n case 39: // '\n escape = ''';\n break;\n case 60: // <\n escape = '<';\n break;\n case 62: // >\n escape = '>';\n break;\n default:\n continue;\n }\n\n if (lastIndex !== index) {\n html += str.substring(lastIndex, index);\n }\n\n lastIndex = index + 1;\n html += escape;\n }\n\n return lastIndex !== index\n ? html + str.substring(lastIndex, index)\n : html;\n}\n","import { g as getLocale, a as getLanguage } from \"./chunks/locale-BQFSYg2g.mjs\";\nimport { b, i } from \"./chunks/locale-BQFSYg2g.mjs\";\nimport { generateFilePath } from \"@nextcloud/router\";\nimport DOMPurify from \"dompurify\";\nimport escapeHTML from \"escape-html\";\nfunction getFirstDay() {\n if (typeof window.firstDay === \"undefined\") {\n console.warn(\"No firstDay found\");\n return 1;\n }\n return window.firstDay;\n}\nfunction getDayNames() {\n if (typeof window.dayNames === \"undefined\") {\n console.warn(\"No dayNames found\");\n return [\n \"Sunday\",\n \"Monday\",\n \"Tuesday\",\n \"Wednesday\",\n \"Thursday\",\n \"Friday\",\n \"Saturday\"\n ];\n }\n return window.dayNames;\n}\nfunction getDayNamesShort() {\n if (typeof window.dayNamesShort === \"undefined\") {\n console.warn(\"No dayNamesShort found\");\n return [\"Sun.\", \"Mon.\", \"Tue.\", \"Wed.\", \"Thu.\", \"Fri.\", \"Sat.\"];\n }\n return window.dayNamesShort;\n}\nfunction getDayNamesMin() {\n if (typeof window.dayNamesMin === \"undefined\") {\n console.warn(\"No dayNamesMin found\");\n return [\"Su\", \"Mo\", \"Tu\", \"We\", \"Th\", \"Fr\", \"Sa\"];\n }\n return window.dayNamesMin;\n}\nfunction getMonthNames() {\n if (typeof window.monthNames === \"undefined\") {\n console.warn(\"No monthNames found\");\n return [\n \"January\",\n \"February\",\n \"March\",\n \"April\",\n \"May\",\n \"June\",\n \"July\",\n \"August\",\n \"September\",\n \"October\",\n \"November\",\n \"December\"\n ];\n }\n return window.monthNames;\n}\nfunction getMonthNamesShort() {\n if (typeof window.monthNamesShort === \"undefined\") {\n console.warn(\"No monthNamesShort found\");\n return [\n \"Jan.\",\n \"Feb.\",\n \"Mar.\",\n \"Apr.\",\n \"May.\",\n \"Jun.\",\n \"Jul.\",\n \"Aug.\",\n \"Sep.\",\n \"Oct.\",\n \"Nov.\",\n \"Dec.\"\n ];\n }\n return window.monthNamesShort;\n}\nfunction hasAppTranslations(appId) {\n var _a, _b;\n return ((_a = window._oc_l10n_registry_translations) == null ? void 0 : _a[appId]) !== void 0 && ((_b = window._oc_l10n_registry_plural_functions) == null ? void 0 : _b[appId]) !== void 0;\n}\nfunction registerAppTranslations(appId, translations, pluralFunction) {\n var _a;\n window._oc_l10n_registry_translations = Object.assign(\n window._oc_l10n_registry_translations || {},\n {\n [appId]: Object.assign(((_a = window._oc_l10n_registry_translations) == null ? void 0 : _a[appId]) || {}, translations)\n }\n );\n window._oc_l10n_registry_plural_functions = Object.assign(\n window._oc_l10n_registry_plural_functions || {},\n {\n [appId]: pluralFunction\n }\n );\n}\nfunction unregisterAppTranslations(appId) {\n var _a, _b;\n (_a = window._oc_l10n_registry_translations) == null ? true : delete _a[appId];\n (_b = window._oc_l10n_registry_plural_functions) == null ? true : delete _b[appId];\n}\nfunction getAppTranslations(appId) {\n var _a, _b, _c, _d;\n return {\n translations: (_b = (_a = window._oc_l10n_registry_translations) == null ? void 0 : _a[appId]) != null ? _b : {},\n pluralFunction: (_d = (_c = window._oc_l10n_registry_plural_functions) == null ? void 0 : _c[appId]) != null ? _d : (number) => number\n };\n}\nfunction translate(app, text, vars, number, options) {\n const allOptions = {\n // defaults\n escape: true,\n sanitize: true,\n // overwrite with user config\n ...options || {}\n };\n const identity = (value) => value;\n const optSanitize = allOptions.sanitize ? DOMPurify.sanitize : identity;\n const optEscape = allOptions.escape ? escapeHTML : identity;\n const isValidReplacement = (value) => typeof value === \"string\" || typeof value === \"number\";\n const _build = (text2, vars2, number2) => {\n return text2.replace(/%n/g, \"\" + number2).replace(/{([^{}]*)}/g, (match, key) => {\n if (vars2 === void 0 || !(key in vars2)) {\n return optEscape(match);\n }\n const replacement = vars2[key];\n if (isValidReplacement(replacement)) {\n return optEscape(\"\".concat(replacement));\n } else if (typeof replacement === \"object\" && isValidReplacement(replacement.value)) {\n const escape = replacement.escape !== false ? escapeHTML : identity;\n return escape(\"\".concat(replacement.value));\n } else {\n return optEscape(match);\n }\n });\n };\n const bundle = getAppTranslations(app);\n let translation = bundle.translations[text] || text;\n translation = Array.isArray(translation) ? translation[0] : translation;\n if (typeof vars === \"object\" || number !== void 0) {\n return optSanitize(_build(\n translation,\n vars,\n number\n ));\n } else {\n return optSanitize(translation);\n }\n}\nfunction translatePlural(app, textSingular, textPlural, number, vars, options) {\n const identifier = \"_\" + textSingular + \"_::_\" + textPlural + \"_\";\n const bundle = getAppTranslations(app);\n const value = bundle.translations[identifier];\n if (typeof value !== \"undefined\") {\n const translation = value;\n if (Array.isArray(translation)) {\n const plural = bundle.pluralFunction(number);\n return translate(app, translation[plural], vars, number, options);\n }\n }\n if (number === 1) {\n return translate(app, textSingular, vars, number, options);\n } else {\n return translate(app, textPlural, vars, number, options);\n }\n}\nfunction loadTranslations(appName, callback) {\n if (hasAppTranslations(appName) || getLocale() === \"en\") {\n return Promise.resolve().then(callback);\n }\n const url = generateFilePath(appName, \"l10n\", getLocale() + \".json\");\n const promise = new Promise((resolve, reject) => {\n const request = new XMLHttpRequest();\n request.open(\"GET\", url, true);\n request.onerror = () => {\n reject(new Error(request.statusText || \"Network error\"));\n };\n request.onload = () => {\n if (request.status >= 200 && request.status < 300) {\n try {\n const bundle = JSON.parse(request.responseText);\n if (typeof bundle.translations === \"object\")\n resolve(bundle);\n } catch (error) {\n }\n reject(new Error(\"Invalid content of translation bundle\"));\n } else {\n reject(new Error(request.statusText));\n }\n };\n request.send();\n });\n return promise.then((result) => {\n register(appName, result.translations);\n return result;\n }).then(callback);\n}\nfunction register(appName, bundle) {\n registerAppTranslations(appName, bundle, getPlural);\n}\nfunction unregister(appName) {\n return unregisterAppTranslations(appName);\n}\nfunction getPlural(number) {\n let language = getLanguage();\n if (language === \"pt-BR\") {\n language = \"xbr\";\n }\n if (language.length > 3) {\n language = language.substring(0, language.lastIndexOf(\"-\"));\n }\n switch (language) {\n case \"az\":\n case \"bo\":\n case \"dz\":\n case \"id\":\n case \"ja\":\n case \"jv\":\n case \"ka\":\n case \"km\":\n case \"kn\":\n case \"ko\":\n case \"ms\":\n case \"th\":\n case \"tr\":\n case \"vi\":\n case \"zh\":\n return 0;\n case \"af\":\n case \"bn\":\n case \"bg\":\n case \"ca\":\n case \"da\":\n case \"de\":\n case \"el\":\n case \"en\":\n case \"eo\":\n case \"es\":\n case \"et\":\n case \"eu\":\n case \"fa\":\n case \"fi\":\n case \"fo\":\n case \"fur\":\n case \"fy\":\n case \"gl\":\n case \"gu\":\n case \"ha\":\n case \"he\":\n case \"hu\":\n case \"is\":\n case \"it\":\n case \"ku\":\n case \"lb\":\n case \"ml\":\n case \"mn\":\n case \"mr\":\n case \"nah\":\n case \"nb\":\n case \"ne\":\n case \"nl\":\n case \"nn\":\n case \"no\":\n case \"oc\":\n case \"om\":\n case \"or\":\n case \"pa\":\n case \"pap\":\n case \"ps\":\n case \"pt\":\n case \"so\":\n case \"sq\":\n case \"sv\":\n case \"sw\":\n case \"ta\":\n case \"te\":\n case \"tk\":\n case \"ur\":\n case \"zu\":\n return number === 1 ? 0 : 1;\n case \"am\":\n case \"bh\":\n case \"fil\":\n case \"fr\":\n case \"gun\":\n case \"hi\":\n case \"hy\":\n case \"ln\":\n case \"mg\":\n case \"nso\":\n case \"xbr\":\n case \"ti\":\n case \"wa\":\n return number === 0 || number === 1 ? 0 : 1;\n case \"be\":\n case \"bs\":\n case \"hr\":\n case \"ru\":\n case \"sh\":\n case \"sr\":\n case \"uk\":\n return number % 10 === 1 && number % 100 !== 11 ? 0 : number % 10 >= 2 && number % 10 <= 4 && (number % 100 < 10 || number % 100 >= 20) ? 1 : 2;\n case \"cs\":\n case \"sk\":\n return number === 1 ? 0 : number >= 2 && number <= 4 ? 1 : 2;\n case \"ga\":\n return number === 1 ? 0 : number === 2 ? 1 : 2;\n case \"lt\":\n return number % 10 === 1 && number % 100 !== 11 ? 0 : number % 10 >= 2 && (number % 100 < 10 || number % 100 >= 20) ? 1 : 2;\n case \"sl\":\n return number % 100 === 1 ? 0 : number % 100 === 2 ? 1 : number % 100 === 3 || number % 100 === 4 ? 2 : 3;\n case \"mk\":\n return number % 10 === 1 ? 0 : 1;\n case \"mt\":\n return number === 1 ? 0 : number === 0 || number % 100 > 1 && number % 100 < 11 ? 1 : number % 100 > 10 && number % 100 < 20 ? 2 : 3;\n case \"lv\":\n return number === 0 ? 0 : number % 10 === 1 && number % 100 !== 11 ? 1 : 2;\n case \"pl\":\n return number === 1 ? 0 : number % 10 >= 2 && number % 10 <= 4 && (number % 100 < 12 || number % 100 > 14) ? 1 : 2;\n case \"cy\":\n return number === 1 ? 0 : number === 2 ? 1 : number === 8 || number === 11 ? 2 : 3;\n case \"ro\":\n return number === 1 ? 0 : number === 0 || number % 100 > 0 && number % 100 < 20 ? 1 : 2;\n case \"ar\":\n return number === 0 ? 0 : number === 1 ? 1 : number === 2 ? 2 : number % 100 >= 3 && number % 100 <= 10 ? 3 : number % 100 >= 11 && number % 100 <= 99 ? 4 : 5;\n default:\n return 0;\n }\n}\nexport {\n b as getCanonicalLocale,\n getDayNames,\n getDayNamesMin,\n getDayNamesShort,\n getFirstDay,\n getLanguage,\n getLocale,\n getMonthNames,\n getMonthNamesShort,\n getPlural,\n i as isRTL,\n loadTranslations,\n translatePlural as n,\n register,\n translate as t,\n translate,\n translatePlural,\n unregister\n};\n","const global = globalThis || void 0 || self;\n\nexport { global as default, global };\n//# sourceMappingURL=index.js.map\n","/*!\n * Vue.js v2.7.16\n * (c) 2014-2023 Evan You\n * Released under the MIT License.\n */\nvar emptyObject = Object.freeze({});\nvar isArray = Array.isArray;\n// These helpers produce better VM code in JS engines due to their\n// explicitness and function inlining.\nfunction isUndef(v) {\n return v === undefined || v === null;\n}\nfunction isDef(v) {\n return v !== undefined && v !== null;\n}\nfunction isTrue(v) {\n return v === true;\n}\nfunction isFalse(v) {\n return v === false;\n}\n/**\n * Check if value is primitive.\n */\nfunction isPrimitive(value) {\n return (typeof value === 'string' ||\n typeof value === 'number' ||\n // $flow-disable-line\n typeof value === 'symbol' ||\n typeof value === 'boolean');\n}\nfunction isFunction(value) {\n return typeof value === 'function';\n}\n/**\n * Quick object check - this is primarily used to tell\n * objects from primitive values when we know the value\n * is a JSON-compliant type.\n */\nfunction isObject(obj) {\n return obj !== null && typeof obj === 'object';\n}\n/**\n * Get the raw type string of a value, e.g., [object Object].\n */\nvar _toString = Object.prototype.toString;\nfunction toRawType(value) {\n return _toString.call(value).slice(8, -1);\n}\n/**\n * Strict object type check. Only returns true\n * for plain JavaScript objects.\n */\nfunction isPlainObject(obj) {\n return _toString.call(obj) === '[object Object]';\n}\nfunction isRegExp(v) {\n return _toString.call(v) === '[object RegExp]';\n}\n/**\n * Check if val is a valid array index.\n */\nfunction isValidArrayIndex(val) {\n var n = parseFloat(String(val));\n return n >= 0 && Math.floor(n) === n && isFinite(val);\n}\nfunction isPromise(val) {\n return (isDef(val) &&\n typeof val.then === 'function' &&\n typeof val.catch === 'function');\n}\n/**\n * Convert a value to a string that is actually rendered.\n */\nfunction toString(val) {\n return val == null\n ? ''\n : Array.isArray(val) || (isPlainObject(val) && val.toString === _toString)\n ? JSON.stringify(val, replacer, 2)\n : String(val);\n}\nfunction replacer(_key, val) {\n // avoid circular deps from v3\n if (val && val.__v_isRef) {\n return val.value;\n }\n return val;\n}\n/**\n * Convert an input value to a number for persistence.\n * If the conversion fails, return original string.\n */\nfunction toNumber(val) {\n var n = parseFloat(val);\n return isNaN(n) ? val : n;\n}\n/**\n * Make a map and return a function for checking if a key\n * is in that map.\n */\nfunction makeMap(str, expectsLowerCase) {\n var map = Object.create(null);\n var list = str.split(',');\n for (var i = 0; i < list.length; i++) {\n map[list[i]] = true;\n }\n return expectsLowerCase ? function (val) { return map[val.toLowerCase()]; } : function (val) { return map[val]; };\n}\n/**\n * Check if a tag is a built-in tag.\n */\nvar isBuiltInTag = makeMap('slot,component', true);\n/**\n * Check if an attribute is a reserved attribute.\n */\nvar isReservedAttribute = makeMap('key,ref,slot,slot-scope,is');\n/**\n * Remove an item from an array.\n */\nfunction remove$2(arr, item) {\n var len = arr.length;\n if (len) {\n // fast path for the only / last item\n if (item === arr[len - 1]) {\n arr.length = len - 1;\n return;\n }\n var index = arr.indexOf(item);\n if (index > -1) {\n return arr.splice(index, 1);\n }\n }\n}\n/**\n * Check whether an object has the property.\n */\nvar hasOwnProperty = Object.prototype.hasOwnProperty;\nfunction hasOwn(obj, key) {\n return hasOwnProperty.call(obj, key);\n}\n/**\n * Create a cached version of a pure function.\n */\nfunction cached(fn) {\n var cache = Object.create(null);\n return function cachedFn(str) {\n var hit = cache[str];\n return hit || (cache[str] = fn(str));\n };\n}\n/**\n * Camelize a hyphen-delimited string.\n */\nvar camelizeRE = /-(\\w)/g;\nvar camelize = cached(function (str) {\n return str.replace(camelizeRE, function (_, c) { return (c ? c.toUpperCase() : ''); });\n});\n/**\n * Capitalize a string.\n */\nvar capitalize = cached(function (str) {\n return str.charAt(0).toUpperCase() + str.slice(1);\n});\n/**\n * Hyphenate a camelCase string.\n */\nvar hyphenateRE = /\\B([A-Z])/g;\nvar hyphenate = cached(function (str) {\n return str.replace(hyphenateRE, '-$1').toLowerCase();\n});\n/**\n * Simple bind polyfill for environments that do not support it,\n * e.g., PhantomJS 1.x. Technically, we don't need this anymore\n * since native bind is now performant enough in most browsers.\n * But removing it would mean breaking code that was able to run in\n * PhantomJS 1.x, so this must be kept for backward compatibility.\n */\n/* istanbul ignore next */\nfunction polyfillBind(fn, ctx) {\n function boundFn(a) {\n var l = arguments.length;\n return l\n ? l > 1\n ? fn.apply(ctx, arguments)\n : fn.call(ctx, a)\n : fn.call(ctx);\n }\n boundFn._length = fn.length;\n return boundFn;\n}\nfunction nativeBind(fn, ctx) {\n return fn.bind(ctx);\n}\n// @ts-expect-error bind cannot be `undefined`\nvar bind = Function.prototype.bind ? nativeBind : polyfillBind;\n/**\n * Convert an Array-like object to a real Array.\n */\nfunction toArray(list, start) {\n start = start || 0;\n var i = list.length - start;\n var ret = new Array(i);\n while (i--) {\n ret[i] = list[i + start];\n }\n return ret;\n}\n/**\n * Mix properties into target object.\n */\nfunction extend(to, _from) {\n for (var key in _from) {\n to[key] = _from[key];\n }\n return to;\n}\n/**\n * Merge an Array of Objects into a single Object.\n */\nfunction toObject(arr) {\n var res = {};\n for (var i = 0; i < arr.length; i++) {\n if (arr[i]) {\n extend(res, arr[i]);\n }\n }\n return res;\n}\n/* eslint-disable no-unused-vars */\n/**\n * Perform no operation.\n * Stubbing args to make Flow happy without leaving useless transpiled code\n * with ...rest (https://flow.org/blog/2017/05/07/Strict-Function-Call-Arity/).\n */\nfunction noop(a, b, c) { }\n/**\n * Always return false.\n */\nvar no = function (a, b, c) { return false; };\n/* eslint-enable no-unused-vars */\n/**\n * Return the same value.\n */\nvar identity = function (_) { return _; };\n/**\n * Check if two values are loosely equal - that is,\n * if they are plain objects, do they have the same shape?\n */\nfunction looseEqual(a, b) {\n if (a === b)\n return true;\n var isObjectA = isObject(a);\n var isObjectB = isObject(b);\n if (isObjectA && isObjectB) {\n try {\n var isArrayA = Array.isArray(a);\n var isArrayB = Array.isArray(b);\n if (isArrayA && isArrayB) {\n return (a.length === b.length &&\n a.every(function (e, i) {\n return looseEqual(e, b[i]);\n }));\n }\n else if (a instanceof Date && b instanceof Date) {\n return a.getTime() === b.getTime();\n }\n else if (!isArrayA && !isArrayB) {\n var keysA = Object.keys(a);\n var keysB = Object.keys(b);\n return (keysA.length === keysB.length &&\n keysA.every(function (key) {\n return looseEqual(a[key], b[key]);\n }));\n }\n else {\n /* istanbul ignore next */\n return false;\n }\n }\n catch (e) {\n /* istanbul ignore next */\n return false;\n }\n }\n else if (!isObjectA && !isObjectB) {\n return String(a) === String(b);\n }\n else {\n return false;\n }\n}\n/**\n * Return the first index at which a loosely equal value can be\n * found in the array (if value is a plain object, the array must\n * contain an object of the same shape), or -1 if it is not present.\n */\nfunction looseIndexOf(arr, val) {\n for (var i = 0; i < arr.length; i++) {\n if (looseEqual(arr[i], val))\n return i;\n }\n return -1;\n}\n/**\n * Ensure a function is called only once.\n */\nfunction once(fn) {\n var called = false;\n return function () {\n if (!called) {\n called = true;\n fn.apply(this, arguments);\n }\n };\n}\n// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is#polyfill\nfunction hasChanged(x, y) {\n if (x === y) {\n return x === 0 && 1 / x !== 1 / y;\n }\n else {\n return x === x || y === y;\n }\n}\n\nvar SSR_ATTR = 'data-server-rendered';\nvar ASSET_TYPES = ['component', 'directive', 'filter'];\nvar LIFECYCLE_HOOKS = [\n 'beforeCreate',\n 'created',\n 'beforeMount',\n 'mounted',\n 'beforeUpdate',\n 'updated',\n 'beforeDestroy',\n 'destroyed',\n 'activated',\n 'deactivated',\n 'errorCaptured',\n 'serverPrefetch',\n 'renderTracked',\n 'renderTriggered'\n];\n\nvar config = {\n /**\n * Option merge strategies (used in core/util/options)\n */\n // $flow-disable-line\n optionMergeStrategies: Object.create(null),\n /**\n * Whether to suppress warnings.\n */\n silent: false,\n /**\n * Show production mode tip message on boot?\n */\n productionTip: process.env.NODE_ENV !== 'production',\n /**\n * Whether to enable devtools\n */\n devtools: process.env.NODE_ENV !== 'production',\n /**\n * Whether to record perf\n */\n performance: false,\n /**\n * Error handler for watcher errors\n */\n errorHandler: null,\n /**\n * Warn handler for watcher warns\n */\n warnHandler: null,\n /**\n * Ignore certain custom elements\n */\n ignoredElements: [],\n /**\n * Custom user key aliases for v-on\n */\n // $flow-disable-line\n keyCodes: Object.create(null),\n /**\n * Check if a tag is reserved so that it cannot be registered as a\n * component. This is platform-dependent and may be overwritten.\n */\n isReservedTag: no,\n /**\n * Check if an attribute is reserved so that it cannot be used as a component\n * prop. This is platform-dependent and may be overwritten.\n */\n isReservedAttr: no,\n /**\n * Check if a tag is an unknown element.\n * Platform-dependent.\n */\n isUnknownElement: no,\n /**\n * Get the namespace of an element\n */\n getTagNamespace: noop,\n /**\n * Parse the real tag name for the specific platform.\n */\n parsePlatformTagName: identity,\n /**\n * Check if an attribute must be bound using property, e.g. value\n * Platform-dependent.\n */\n mustUseProp: no,\n /**\n * Perform updates asynchronously. Intended to be used by Vue Test Utils\n * This will significantly reduce performance if set to false.\n */\n async: true,\n /**\n * Exposed for legacy reasons\n */\n _lifecycleHooks: LIFECYCLE_HOOKS\n};\n\n/**\n * unicode letters used for parsing html tags, component names and property paths.\n * using https://www.w3.org/TR/html53/semantics-scripting.html#potentialcustomelementname\n * skipping \\u10000-\\uEFFFF due to it freezing up PhantomJS\n */\nvar unicodeRegExp = /a-zA-Z\\u00B7\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u203F-\\u2040\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD/;\n/**\n * Check if a string starts with $ or _\n */\nfunction isReserved(str) {\n var c = (str + '').charCodeAt(0);\n return c === 0x24 || c === 0x5f;\n}\n/**\n * Define a property.\n */\nfunction def(obj, key, val, enumerable) {\n Object.defineProperty(obj, key, {\n value: val,\n enumerable: !!enumerable,\n writable: true,\n configurable: true\n });\n}\n/**\n * Parse simple path.\n */\nvar bailRE = new RegExp(\"[^\".concat(unicodeRegExp.source, \".$_\\\\d]\"));\nfunction parsePath(path) {\n if (bailRE.test(path)) {\n return;\n }\n var segments = path.split('.');\n return function (obj) {\n for (var i = 0; i < segments.length; i++) {\n if (!obj)\n return;\n obj = obj[segments[i]];\n }\n return obj;\n };\n}\n\n// can we use __proto__?\nvar hasProto = '__proto__' in {};\n// Browser environment sniffing\nvar inBrowser = typeof window !== 'undefined';\nvar UA = inBrowser && window.navigator.userAgent.toLowerCase();\nvar isIE = UA && /msie|trident/.test(UA);\nvar isIE9 = UA && UA.indexOf('msie 9.0') > 0;\nvar isEdge = UA && UA.indexOf('edge/') > 0;\nUA && UA.indexOf('android') > 0;\nvar isIOS = UA && /iphone|ipad|ipod|ios/.test(UA);\nUA && /chrome\\/\\d+/.test(UA) && !isEdge;\nUA && /phantomjs/.test(UA);\nvar isFF = UA && UA.match(/firefox\\/(\\d+)/);\n// Firefox has a \"watch\" function on Object.prototype...\n// @ts-expect-error firebox support\nvar nativeWatch = {}.watch;\nvar supportsPassive = false;\nif (inBrowser) {\n try {\n var opts = {};\n Object.defineProperty(opts, 'passive', {\n get: function () {\n /* istanbul ignore next */\n supportsPassive = true;\n }\n }); // https://github.com/facebook/flow/issues/285\n window.addEventListener('test-passive', null, opts);\n }\n catch (e) { }\n}\n// this needs to be lazy-evaled because vue may be required before\n// vue-server-renderer can set VUE_ENV\nvar _isServer;\nvar isServerRendering = function () {\n if (_isServer === undefined) {\n /* istanbul ignore if */\n if (!inBrowser && typeof global !== 'undefined') {\n // detect presence of vue-server-renderer and avoid\n // Webpack shimming the process\n _isServer =\n global['process'] && global['process'].env.VUE_ENV === 'server';\n }\n else {\n _isServer = false;\n }\n }\n return _isServer;\n};\n// detect devtools\nvar devtools = inBrowser && window.__VUE_DEVTOOLS_GLOBAL_HOOK__;\n/* istanbul ignore next */\nfunction isNative(Ctor) {\n return typeof Ctor === 'function' && /native code/.test(Ctor.toString());\n}\nvar hasSymbol = typeof Symbol !== 'undefined' &&\n isNative(Symbol) &&\n typeof Reflect !== 'undefined' &&\n isNative(Reflect.ownKeys);\nvar _Set; // $flow-disable-line\n/* istanbul ignore if */ if (typeof Set !== 'undefined' && isNative(Set)) {\n // use native Set when available.\n _Set = Set;\n}\nelse {\n // a non-standard Set polyfill that only works with primitive keys.\n _Set = /** @class */ (function () {\n function Set() {\n this.set = Object.create(null);\n }\n Set.prototype.has = function (key) {\n return this.set[key] === true;\n };\n Set.prototype.add = function (key) {\n this.set[key] = true;\n };\n Set.prototype.clear = function () {\n this.set = Object.create(null);\n };\n return Set;\n }());\n}\n\nvar currentInstance = null;\n/**\n * This is exposed for compatibility with v3 (e.g. some functions in VueUse\n * relies on it). Do not use this internally, just use `currentInstance`.\n *\n * @internal this function needs manual type declaration because it relies\n * on previously manually authored types from Vue 2\n */\nfunction getCurrentInstance() {\n return currentInstance && { proxy: currentInstance };\n}\n/**\n * @internal\n */\nfunction setCurrentInstance(vm) {\n if (vm === void 0) { vm = null; }\n if (!vm)\n currentInstance && currentInstance._scope.off();\n currentInstance = vm;\n vm && vm._scope.on();\n}\n\n/**\n * @internal\n */\nvar VNode = /** @class */ (function () {\n function VNode(tag, data, children, text, elm, context, componentOptions, asyncFactory) {\n this.tag = tag;\n this.data = data;\n this.children = children;\n this.text = text;\n this.elm = elm;\n this.ns = undefined;\n this.context = context;\n this.fnContext = undefined;\n this.fnOptions = undefined;\n this.fnScopeId = undefined;\n this.key = data && data.key;\n this.componentOptions = componentOptions;\n this.componentInstance = undefined;\n this.parent = undefined;\n this.raw = false;\n this.isStatic = false;\n this.isRootInsert = true;\n this.isComment = false;\n this.isCloned = false;\n this.isOnce = false;\n this.asyncFactory = asyncFactory;\n this.asyncMeta = undefined;\n this.isAsyncPlaceholder = false;\n }\n Object.defineProperty(VNode.prototype, \"child\", {\n // DEPRECATED: alias for componentInstance for backwards compat.\n /* istanbul ignore next */\n get: function () {\n return this.componentInstance;\n },\n enumerable: false,\n configurable: true\n });\n return VNode;\n}());\nvar createEmptyVNode = function (text) {\n if (text === void 0) { text = ''; }\n var node = new VNode();\n node.text = text;\n node.isComment = true;\n return node;\n};\nfunction createTextVNode(val) {\n return new VNode(undefined, undefined, undefined, String(val));\n}\n// optimized shallow clone\n// used for static nodes and slot nodes because they may be reused across\n// multiple renders, cloning them avoids errors when DOM manipulations rely\n// on their elm reference.\nfunction cloneVNode(vnode) {\n var cloned = new VNode(vnode.tag, vnode.data, \n // #7975\n // clone children array to avoid mutating original in case of cloning\n // a child.\n vnode.children && vnode.children.slice(), vnode.text, vnode.elm, vnode.context, vnode.componentOptions, vnode.asyncFactory);\n cloned.ns = vnode.ns;\n cloned.isStatic = vnode.isStatic;\n cloned.key = vnode.key;\n cloned.isComment = vnode.isComment;\n cloned.fnContext = vnode.fnContext;\n cloned.fnOptions = vnode.fnOptions;\n cloned.fnScopeId = vnode.fnScopeId;\n cloned.asyncMeta = vnode.asyncMeta;\n cloned.isCloned = true;\n return cloned;\n}\n\n/******************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n\r\nvar __assign = function() {\r\n __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n };\r\n return __assign.apply(this, arguments);\r\n};\r\n\r\ntypeof SuppressedError === \"function\" ? SuppressedError : function (error, suppressed, message) {\r\n var e = new Error(message);\r\n return e.name = \"SuppressedError\", e.error = error, e.suppressed = suppressed, e;\r\n};\n\nvar uid$2 = 0;\nvar pendingCleanupDeps = [];\nvar cleanupDeps = function () {\n for (var i = 0; i < pendingCleanupDeps.length; i++) {\n var dep = pendingCleanupDeps[i];\n dep.subs = dep.subs.filter(function (s) { return s; });\n dep._pending = false;\n }\n pendingCleanupDeps.length = 0;\n};\n/**\n * A dep is an observable that can have multiple\n * directives subscribing to it.\n * @internal\n */\nvar Dep = /** @class */ (function () {\n function Dep() {\n // pending subs cleanup\n this._pending = false;\n this.id = uid$2++;\n this.subs = [];\n }\n Dep.prototype.addSub = function (sub) {\n this.subs.push(sub);\n };\n Dep.prototype.removeSub = function (sub) {\n // #12696 deps with massive amount of subscribers are extremely slow to\n // clean up in Chromium\n // to workaround this, we unset the sub for now, and clear them on\n // next scheduler flush.\n this.subs[this.subs.indexOf(sub)] = null;\n if (!this._pending) {\n this._pending = true;\n pendingCleanupDeps.push(this);\n }\n };\n Dep.prototype.depend = function (info) {\n if (Dep.target) {\n Dep.target.addDep(this);\n if (process.env.NODE_ENV !== 'production' && info && Dep.target.onTrack) {\n Dep.target.onTrack(__assign({ effect: Dep.target }, info));\n }\n }\n };\n Dep.prototype.notify = function (info) {\n // stabilize the subscriber list first\n var subs = this.subs.filter(function (s) { return s; });\n if (process.env.NODE_ENV !== 'production' && !config.async) {\n // subs aren't sorted in scheduler if not running async\n // we need to sort them now to make sure they fire in correct\n // order\n subs.sort(function (a, b) { return a.id - b.id; });\n }\n for (var i = 0, l = subs.length; i < l; i++) {\n var sub = subs[i];\n if (process.env.NODE_ENV !== 'production' && info) {\n sub.onTrigger &&\n sub.onTrigger(__assign({ effect: subs[i] }, info));\n }\n sub.update();\n }\n };\n return Dep;\n}());\n// The current target watcher being evaluated.\n// This is globally unique because only one watcher\n// can be evaluated at a time.\nDep.target = null;\nvar targetStack = [];\nfunction pushTarget(target) {\n targetStack.push(target);\n Dep.target = target;\n}\nfunction popTarget() {\n targetStack.pop();\n Dep.target = targetStack[targetStack.length - 1];\n}\n\n/*\n * not type checking this file because flow doesn't play well with\n * dynamically accessing methods on Array prototype\n */\nvar arrayProto = Array.prototype;\nvar arrayMethods = Object.create(arrayProto);\nvar methodsToPatch = [\n 'push',\n 'pop',\n 'shift',\n 'unshift',\n 'splice',\n 'sort',\n 'reverse'\n];\n/**\n * Intercept mutating methods and emit events\n */\nmethodsToPatch.forEach(function (method) {\n // cache original method\n var original = arrayProto[method];\n def(arrayMethods, method, function mutator() {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n var result = original.apply(this, args);\n var ob = this.__ob__;\n var inserted;\n switch (method) {\n case 'push':\n case 'unshift':\n inserted = args;\n break;\n case 'splice':\n inserted = args.slice(2);\n break;\n }\n if (inserted)\n ob.observeArray(inserted);\n // notify change\n if (process.env.NODE_ENV !== 'production') {\n ob.dep.notify({\n type: \"array mutation\" /* TriggerOpTypes.ARRAY_MUTATION */,\n target: this,\n key: method\n });\n }\n else {\n ob.dep.notify();\n }\n return result;\n });\n});\n\nvar arrayKeys = Object.getOwnPropertyNames(arrayMethods);\nvar NO_INITIAL_VALUE = {};\n/**\n * In some cases we may want to disable observation inside a component's\n * update computation.\n */\nvar shouldObserve = true;\nfunction toggleObserving(value) {\n shouldObserve = value;\n}\n// ssr mock dep\nvar mockDep = {\n notify: noop,\n depend: noop,\n addSub: noop,\n removeSub: noop\n};\n/**\n * Observer class that is attached to each observed\n * object. Once attached, the observer converts the target\n * object's property keys into getter/setters that\n * collect dependencies and dispatch updates.\n */\nvar Observer = /** @class */ (function () {\n function Observer(value, shallow, mock) {\n if (shallow === void 0) { shallow = false; }\n if (mock === void 0) { mock = false; }\n this.value = value;\n this.shallow = shallow;\n this.mock = mock;\n // this.value = value\n this.dep = mock ? mockDep : new Dep();\n this.vmCount = 0;\n def(value, '__ob__', this);\n if (isArray(value)) {\n if (!mock) {\n if (hasProto) {\n value.__proto__ = arrayMethods;\n /* eslint-enable no-proto */\n }\n else {\n for (var i = 0, l = arrayKeys.length; i < l; i++) {\n var key = arrayKeys[i];\n def(value, key, arrayMethods[key]);\n }\n }\n }\n if (!shallow) {\n this.observeArray(value);\n }\n }\n else {\n /**\n * Walk through all properties and convert them into\n * getter/setters. This method should only be called when\n * value type is Object.\n */\n var keys = Object.keys(value);\n for (var i = 0; i < keys.length; i++) {\n var key = keys[i];\n defineReactive(value, key, NO_INITIAL_VALUE, undefined, shallow, mock);\n }\n }\n }\n /**\n * Observe a list of Array items.\n */\n Observer.prototype.observeArray = function (value) {\n for (var i = 0, l = value.length; i < l; i++) {\n observe(value[i], false, this.mock);\n }\n };\n return Observer;\n}());\n// helpers\n/**\n * Attempt to create an observer instance for a value,\n * returns the new observer if successfully observed,\n * or the existing observer if the value already has one.\n */\nfunction observe(value, shallow, ssrMockReactivity) {\n if (value && hasOwn(value, '__ob__') && value.__ob__ instanceof Observer) {\n return value.__ob__;\n }\n if (shouldObserve &&\n (ssrMockReactivity || !isServerRendering()) &&\n (isArray(value) || isPlainObject(value)) &&\n Object.isExtensible(value) &&\n !value.__v_skip /* ReactiveFlags.SKIP */ &&\n !isRef(value) &&\n !(value instanceof VNode)) {\n return new Observer(value, shallow, ssrMockReactivity);\n }\n}\n/**\n * Define a reactive property on an Object.\n */\nfunction defineReactive(obj, key, val, customSetter, shallow, mock, observeEvenIfShallow) {\n if (observeEvenIfShallow === void 0) { observeEvenIfShallow = false; }\n var dep = new Dep();\n var property = Object.getOwnPropertyDescriptor(obj, key);\n if (property && property.configurable === false) {\n return;\n }\n // cater for pre-defined getter/setters\n var getter = property && property.get;\n var setter = property && property.set;\n if ((!getter || setter) &&\n (val === NO_INITIAL_VALUE || arguments.length === 2)) {\n val = obj[key];\n }\n var childOb = shallow ? val && val.__ob__ : observe(val, false, mock);\n Object.defineProperty(obj, key, {\n enumerable: true,\n configurable: true,\n get: function reactiveGetter() {\n var value = getter ? getter.call(obj) : val;\n if (Dep.target) {\n if (process.env.NODE_ENV !== 'production') {\n dep.depend({\n target: obj,\n type: \"get\" /* TrackOpTypes.GET */,\n key: key\n });\n }\n else {\n dep.depend();\n }\n if (childOb) {\n childOb.dep.depend();\n if (isArray(value)) {\n dependArray(value);\n }\n }\n }\n return isRef(value) && !shallow ? value.value : value;\n },\n set: function reactiveSetter(newVal) {\n var value = getter ? getter.call(obj) : val;\n if (!hasChanged(value, newVal)) {\n return;\n }\n if (process.env.NODE_ENV !== 'production' && customSetter) {\n customSetter();\n }\n if (setter) {\n setter.call(obj, newVal);\n }\n else if (getter) {\n // #7981: for accessor properties without setter\n return;\n }\n else if (!shallow && isRef(value) && !isRef(newVal)) {\n value.value = newVal;\n return;\n }\n else {\n val = newVal;\n }\n childOb = shallow ? newVal && newVal.__ob__ : observe(newVal, false, mock);\n if (process.env.NODE_ENV !== 'production') {\n dep.notify({\n type: \"set\" /* TriggerOpTypes.SET */,\n target: obj,\n key: key,\n newValue: newVal,\n oldValue: value\n });\n }\n else {\n dep.notify();\n }\n }\n });\n return dep;\n}\nfunction set(target, key, val) {\n if (process.env.NODE_ENV !== 'production' && (isUndef(target) || isPrimitive(target))) {\n warn(\"Cannot set reactive property on undefined, null, or primitive value: \".concat(target));\n }\n if (isReadonly(target)) {\n process.env.NODE_ENV !== 'production' && warn(\"Set operation on key \\\"\".concat(key, \"\\\" failed: target is readonly.\"));\n return;\n }\n var ob = target.__ob__;\n if (isArray(target) && isValidArrayIndex(key)) {\n target.length = Math.max(target.length, key);\n target.splice(key, 1, val);\n // when mocking for SSR, array methods are not hijacked\n if (ob && !ob.shallow && ob.mock) {\n observe(val, false, true);\n }\n return val;\n }\n if (key in target && !(key in Object.prototype)) {\n target[key] = val;\n return val;\n }\n if (target._isVue || (ob && ob.vmCount)) {\n process.env.NODE_ENV !== 'production' &&\n warn('Avoid adding reactive properties to a Vue instance or its root $data ' +\n 'at runtime - declare it upfront in the data option.');\n return val;\n }\n if (!ob) {\n target[key] = val;\n return val;\n }\n defineReactive(ob.value, key, val, undefined, ob.shallow, ob.mock);\n if (process.env.NODE_ENV !== 'production') {\n ob.dep.notify({\n type: \"add\" /* TriggerOpTypes.ADD */,\n target: target,\n key: key,\n newValue: val,\n oldValue: undefined\n });\n }\n else {\n ob.dep.notify();\n }\n return val;\n}\nfunction del(target, key) {\n if (process.env.NODE_ENV !== 'production' && (isUndef(target) || isPrimitive(target))) {\n warn(\"Cannot delete reactive property on undefined, null, or primitive value: \".concat(target));\n }\n if (isArray(target) && isValidArrayIndex(key)) {\n target.splice(key, 1);\n return;\n }\n var ob = target.__ob__;\n if (target._isVue || (ob && ob.vmCount)) {\n process.env.NODE_ENV !== 'production' &&\n warn('Avoid deleting properties on a Vue instance or its root $data ' +\n '- just set it to null.');\n return;\n }\n if (isReadonly(target)) {\n process.env.NODE_ENV !== 'production' &&\n warn(\"Delete operation on key \\\"\".concat(key, \"\\\" failed: target is readonly.\"));\n return;\n }\n if (!hasOwn(target, key)) {\n return;\n }\n delete target[key];\n if (!ob) {\n return;\n }\n if (process.env.NODE_ENV !== 'production') {\n ob.dep.notify({\n type: \"delete\" /* TriggerOpTypes.DELETE */,\n target: target,\n key: key\n });\n }\n else {\n ob.dep.notify();\n }\n}\n/**\n * Collect dependencies on array elements when the array is touched, since\n * we cannot intercept array element access like property getters.\n */\nfunction dependArray(value) {\n for (var e = void 0, i = 0, l = value.length; i < l; i++) {\n e = value[i];\n if (e && e.__ob__) {\n e.__ob__.dep.depend();\n }\n if (isArray(e)) {\n dependArray(e);\n }\n }\n}\n\nfunction reactive(target) {\n makeReactive(target, false);\n return target;\n}\n/**\n * Return a shallowly-reactive copy of the original object, where only the root\n * level properties are reactive. It also does not auto-unwrap refs (even at the\n * root level).\n */\nfunction shallowReactive(target) {\n makeReactive(target, true);\n def(target, \"__v_isShallow\" /* ReactiveFlags.IS_SHALLOW */, true);\n return target;\n}\nfunction makeReactive(target, shallow) {\n // if trying to observe a readonly proxy, return the readonly version.\n if (!isReadonly(target)) {\n if (process.env.NODE_ENV !== 'production') {\n if (isArray(target)) {\n warn(\"Avoid using Array as root value for \".concat(shallow ? \"shallowReactive()\" : \"reactive()\", \" as it cannot be tracked in watch() or watchEffect(). Use \").concat(shallow ? \"shallowRef()\" : \"ref()\", \" instead. This is a Vue-2-only limitation.\"));\n }\n var existingOb = target && target.__ob__;\n if (existingOb && existingOb.shallow !== shallow) {\n warn(\"Target is already a \".concat(existingOb.shallow ? \"\" : \"non-\", \"shallow reactive object, and cannot be converted to \").concat(shallow ? \"\" : \"non-\", \"shallow.\"));\n }\n }\n var ob = observe(target, shallow, isServerRendering() /* ssr mock reactivity */);\n if (process.env.NODE_ENV !== 'production' && !ob) {\n if (target == null || isPrimitive(target)) {\n warn(\"value cannot be made reactive: \".concat(String(target)));\n }\n if (isCollectionType(target)) {\n warn(\"Vue 2 does not support reactive collection types such as Map or Set.\");\n }\n }\n }\n}\nfunction isReactive(value) {\n if (isReadonly(value)) {\n return isReactive(value[\"__v_raw\" /* ReactiveFlags.RAW */]);\n }\n return !!(value && value.__ob__);\n}\nfunction isShallow(value) {\n return !!(value && value.__v_isShallow);\n}\nfunction isReadonly(value) {\n return !!(value && value.__v_isReadonly);\n}\nfunction isProxy(value) {\n return isReactive(value) || isReadonly(value);\n}\nfunction toRaw(observed) {\n var raw = observed && observed[\"__v_raw\" /* ReactiveFlags.RAW */];\n return raw ? toRaw(raw) : observed;\n}\nfunction markRaw(value) {\n // non-extensible objects won't be observed anyway\n if (Object.isExtensible(value)) {\n def(value, \"__v_skip\" /* ReactiveFlags.SKIP */, true);\n }\n return value;\n}\n/**\n * @internal\n */\nfunction isCollectionType(value) {\n var type = toRawType(value);\n return (type === 'Map' || type === 'WeakMap' || type === 'Set' || type === 'WeakSet');\n}\n\n/**\n * @internal\n */\nvar RefFlag = \"__v_isRef\";\nfunction isRef(r) {\n return !!(r && r.__v_isRef === true);\n}\nfunction ref$1(value) {\n return createRef(value, false);\n}\nfunction shallowRef(value) {\n return createRef(value, true);\n}\nfunction createRef(rawValue, shallow) {\n if (isRef(rawValue)) {\n return rawValue;\n }\n var ref = {};\n def(ref, RefFlag, true);\n def(ref, \"__v_isShallow\" /* ReactiveFlags.IS_SHALLOW */, shallow);\n def(ref, 'dep', defineReactive(ref, 'value', rawValue, null, shallow, isServerRendering()));\n return ref;\n}\nfunction triggerRef(ref) {\n if (process.env.NODE_ENV !== 'production' && !ref.dep) {\n warn(\"received object is not a triggerable ref.\");\n }\n if (process.env.NODE_ENV !== 'production') {\n ref.dep &&\n ref.dep.notify({\n type: \"set\" /* TriggerOpTypes.SET */,\n target: ref,\n key: 'value'\n });\n }\n else {\n ref.dep && ref.dep.notify();\n }\n}\nfunction unref(ref) {\n return isRef(ref) ? ref.value : ref;\n}\nfunction proxyRefs(objectWithRefs) {\n if (isReactive(objectWithRefs)) {\n return objectWithRefs;\n }\n var proxy = {};\n var keys = Object.keys(objectWithRefs);\n for (var i = 0; i < keys.length; i++) {\n proxyWithRefUnwrap(proxy, objectWithRefs, keys[i]);\n }\n return proxy;\n}\nfunction proxyWithRefUnwrap(target, source, key) {\n Object.defineProperty(target, key, {\n enumerable: true,\n configurable: true,\n get: function () {\n var val = source[key];\n if (isRef(val)) {\n return val.value;\n }\n else {\n var ob = val && val.__ob__;\n if (ob)\n ob.dep.depend();\n return val;\n }\n },\n set: function (value) {\n var oldValue = source[key];\n if (isRef(oldValue) && !isRef(value)) {\n oldValue.value = value;\n }\n else {\n source[key] = value;\n }\n }\n });\n}\nfunction customRef(factory) {\n var dep = new Dep();\n var _a = factory(function () {\n if (process.env.NODE_ENV !== 'production') {\n dep.depend({\n target: ref,\n type: \"get\" /* TrackOpTypes.GET */,\n key: 'value'\n });\n }\n else {\n dep.depend();\n }\n }, function () {\n if (process.env.NODE_ENV !== 'production') {\n dep.notify({\n target: ref,\n type: \"set\" /* TriggerOpTypes.SET */,\n key: 'value'\n });\n }\n else {\n dep.notify();\n }\n }), get = _a.get, set = _a.set;\n var ref = {\n get value() {\n return get();\n },\n set value(newVal) {\n set(newVal);\n }\n };\n def(ref, RefFlag, true);\n return ref;\n}\nfunction toRefs(object) {\n if (process.env.NODE_ENV !== 'production' && !isReactive(object)) {\n warn(\"toRefs() expects a reactive object but received a plain one.\");\n }\n var ret = isArray(object) ? new Array(object.length) : {};\n for (var key in object) {\n ret[key] = toRef(object, key);\n }\n return ret;\n}\nfunction toRef(object, key, defaultValue) {\n var val = object[key];\n if (isRef(val)) {\n return val;\n }\n var ref = {\n get value() {\n var val = object[key];\n return val === undefined ? defaultValue : val;\n },\n set value(newVal) {\n object[key] = newVal;\n }\n };\n def(ref, RefFlag, true);\n return ref;\n}\n\nvar rawToReadonlyFlag = \"__v_rawToReadonly\";\nvar rawToShallowReadonlyFlag = \"__v_rawToShallowReadonly\";\nfunction readonly(target) {\n return createReadonly(target, false);\n}\nfunction createReadonly(target, shallow) {\n if (!isPlainObject(target)) {\n if (process.env.NODE_ENV !== 'production') {\n if (isArray(target)) {\n warn(\"Vue 2 does not support readonly arrays.\");\n }\n else if (isCollectionType(target)) {\n warn(\"Vue 2 does not support readonly collection types such as Map or Set.\");\n }\n else {\n warn(\"value cannot be made readonly: \".concat(typeof target));\n }\n }\n return target;\n }\n if (process.env.NODE_ENV !== 'production' && !Object.isExtensible(target)) {\n warn(\"Vue 2 does not support creating readonly proxy for non-extensible object.\");\n }\n // already a readonly object\n if (isReadonly(target)) {\n return target;\n }\n // already has a readonly proxy\n var existingFlag = shallow ? rawToShallowReadonlyFlag : rawToReadonlyFlag;\n var existingProxy = target[existingFlag];\n if (existingProxy) {\n return existingProxy;\n }\n var proxy = Object.create(Object.getPrototypeOf(target));\n def(target, existingFlag, proxy);\n def(proxy, \"__v_isReadonly\" /* ReactiveFlags.IS_READONLY */, true);\n def(proxy, \"__v_raw\" /* ReactiveFlags.RAW */, target);\n if (isRef(target)) {\n def(proxy, RefFlag, true);\n }\n if (shallow || isShallow(target)) {\n def(proxy, \"__v_isShallow\" /* ReactiveFlags.IS_SHALLOW */, true);\n }\n var keys = Object.keys(target);\n for (var i = 0; i < keys.length; i++) {\n defineReadonlyProperty(proxy, target, keys[i], shallow);\n }\n return proxy;\n}\nfunction defineReadonlyProperty(proxy, target, key, shallow) {\n Object.defineProperty(proxy, key, {\n enumerable: true,\n configurable: true,\n get: function () {\n var val = target[key];\n return shallow || !isPlainObject(val) ? val : readonly(val);\n },\n set: function () {\n process.env.NODE_ENV !== 'production' &&\n warn(\"Set operation on key \\\"\".concat(key, \"\\\" failed: target is readonly.\"));\n }\n });\n}\n/**\n * Returns a reactive-copy of the original object, where only the root level\n * properties are readonly, and does NOT unwrap refs nor recursively convert\n * returned properties.\n * This is used for creating the props proxy object for stateful components.\n */\nfunction shallowReadonly(target) {\n return createReadonly(target, true);\n}\n\nfunction computed(getterOrOptions, debugOptions) {\n var getter;\n var setter;\n var onlyGetter = isFunction(getterOrOptions);\n if (onlyGetter) {\n getter = getterOrOptions;\n setter = process.env.NODE_ENV !== 'production'\n ? function () {\n warn('Write operation failed: computed value is readonly');\n }\n : noop;\n }\n else {\n getter = getterOrOptions.get;\n setter = getterOrOptions.set;\n }\n var watcher = isServerRendering()\n ? null\n : new Watcher(currentInstance, getter, noop, { lazy: true });\n if (process.env.NODE_ENV !== 'production' && watcher && debugOptions) {\n watcher.onTrack = debugOptions.onTrack;\n watcher.onTrigger = debugOptions.onTrigger;\n }\n var ref = {\n // some libs rely on the presence effect for checking computed refs\n // from normal refs, but the implementation doesn't matter\n effect: watcher,\n get value() {\n if (watcher) {\n if (watcher.dirty) {\n watcher.evaluate();\n }\n if (Dep.target) {\n if (process.env.NODE_ENV !== 'production' && Dep.target.onTrack) {\n Dep.target.onTrack({\n effect: Dep.target,\n target: ref,\n type: \"get\" /* TrackOpTypes.GET */,\n key: 'value'\n });\n }\n watcher.depend();\n }\n return watcher.value;\n }\n else {\n return getter();\n }\n },\n set value(newVal) {\n setter(newVal);\n }\n };\n def(ref, RefFlag, true);\n def(ref, \"__v_isReadonly\" /* ReactiveFlags.IS_READONLY */, onlyGetter);\n return ref;\n}\n\nvar WATCHER = \"watcher\";\nvar WATCHER_CB = \"\".concat(WATCHER, \" callback\");\nvar WATCHER_GETTER = \"\".concat(WATCHER, \" getter\");\nvar WATCHER_CLEANUP = \"\".concat(WATCHER, \" cleanup\");\n// Simple effect.\nfunction watchEffect(effect, options) {\n return doWatch(effect, null, options);\n}\nfunction watchPostEffect(effect, options) {\n return doWatch(effect, null, (process.env.NODE_ENV !== 'production'\n ? __assign(__assign({}, options), { flush: 'post' }) : { flush: 'post' }));\n}\nfunction watchSyncEffect(effect, options) {\n return doWatch(effect, null, (process.env.NODE_ENV !== 'production'\n ? __assign(__assign({}, options), { flush: 'sync' }) : { flush: 'sync' }));\n}\n// initial value for watchers to trigger on undefined initial values\nvar INITIAL_WATCHER_VALUE = {};\n// implementation\nfunction watch(source, cb, options) {\n if (process.env.NODE_ENV !== 'production' && typeof cb !== 'function') {\n warn(\"`watch(fn, options?)` signature has been moved to a separate API. \" +\n \"Use `watchEffect(fn, options?)` instead. `watch` now only \" +\n \"supports `watch(source, cb, options?) signature.\");\n }\n return doWatch(source, cb, options);\n}\nfunction doWatch(source, cb, _a) {\n var _b = _a === void 0 ? emptyObject : _a, immediate = _b.immediate, deep = _b.deep, _c = _b.flush, flush = _c === void 0 ? 'pre' : _c, onTrack = _b.onTrack, onTrigger = _b.onTrigger;\n if (process.env.NODE_ENV !== 'production' && !cb) {\n if (immediate !== undefined) {\n warn(\"watch() \\\"immediate\\\" option is only respected when using the \" +\n \"watch(source, callback, options?) signature.\");\n }\n if (deep !== undefined) {\n warn(\"watch() \\\"deep\\\" option is only respected when using the \" +\n \"watch(source, callback, options?) signature.\");\n }\n }\n var warnInvalidSource = function (s) {\n warn(\"Invalid watch source: \".concat(s, \". A watch source can only be a getter/effect \") +\n \"function, a ref, a reactive object, or an array of these types.\");\n };\n var instance = currentInstance;\n var call = function (fn, type, args) {\n if (args === void 0) { args = null; }\n var res = invokeWithErrorHandling(fn, null, args, instance, type);\n if (deep && res && res.__ob__)\n res.__ob__.dep.depend();\n return res;\n };\n var getter;\n var forceTrigger = false;\n var isMultiSource = false;\n if (isRef(source)) {\n getter = function () { return source.value; };\n forceTrigger = isShallow(source);\n }\n else if (isReactive(source)) {\n getter = function () {\n source.__ob__.dep.depend();\n return source;\n };\n deep = true;\n }\n else if (isArray(source)) {\n isMultiSource = true;\n forceTrigger = source.some(function (s) { return isReactive(s) || isShallow(s); });\n getter = function () {\n return source.map(function (s) {\n if (isRef(s)) {\n return s.value;\n }\n else if (isReactive(s)) {\n s.__ob__.dep.depend();\n return traverse(s);\n }\n else if (isFunction(s)) {\n return call(s, WATCHER_GETTER);\n }\n else {\n process.env.NODE_ENV !== 'production' && warnInvalidSource(s);\n }\n });\n };\n }\n else if (isFunction(source)) {\n if (cb) {\n // getter with cb\n getter = function () { return call(source, WATCHER_GETTER); };\n }\n else {\n // no cb -> simple effect\n getter = function () {\n if (instance && instance._isDestroyed) {\n return;\n }\n if (cleanup) {\n cleanup();\n }\n return call(source, WATCHER, [onCleanup]);\n };\n }\n }\n else {\n getter = noop;\n process.env.NODE_ENV !== 'production' && warnInvalidSource(source);\n }\n if (cb && deep) {\n var baseGetter_1 = getter;\n getter = function () { return traverse(baseGetter_1()); };\n }\n var cleanup;\n var onCleanup = function (fn) {\n cleanup = watcher.onStop = function () {\n call(fn, WATCHER_CLEANUP);\n };\n };\n // in SSR there is no need to setup an actual effect, and it should be noop\n // unless it's eager\n if (isServerRendering()) {\n // we will also not call the invalidate callback (+ runner is not set up)\n onCleanup = noop;\n if (!cb) {\n getter();\n }\n else if (immediate) {\n call(cb, WATCHER_CB, [\n getter(),\n isMultiSource ? [] : undefined,\n onCleanup\n ]);\n }\n return noop;\n }\n var watcher = new Watcher(currentInstance, getter, noop, {\n lazy: true\n });\n watcher.noRecurse = !cb;\n var oldValue = isMultiSource ? [] : INITIAL_WATCHER_VALUE;\n // overwrite default run\n watcher.run = function () {\n if (!watcher.active) {\n return;\n }\n if (cb) {\n // watch(source, cb)\n var newValue = watcher.get();\n if (deep ||\n forceTrigger ||\n (isMultiSource\n ? newValue.some(function (v, i) {\n return hasChanged(v, oldValue[i]);\n })\n : hasChanged(newValue, oldValue))) {\n // cleanup before running cb again\n if (cleanup) {\n cleanup();\n }\n call(cb, WATCHER_CB, [\n newValue,\n // pass undefined as the old value when it's changed for the first time\n oldValue === INITIAL_WATCHER_VALUE ? undefined : oldValue,\n onCleanup\n ]);\n oldValue = newValue;\n }\n }\n else {\n // watchEffect\n watcher.get();\n }\n };\n if (flush === 'sync') {\n watcher.update = watcher.run;\n }\n else if (flush === 'post') {\n watcher.post = true;\n watcher.update = function () { return queueWatcher(watcher); };\n }\n else {\n // pre\n watcher.update = function () {\n if (instance && instance === currentInstance && !instance._isMounted) {\n // pre-watcher triggered before\n var buffer = instance._preWatchers || (instance._preWatchers = []);\n if (buffer.indexOf(watcher) < 0)\n buffer.push(watcher);\n }\n else {\n queueWatcher(watcher);\n }\n };\n }\n if (process.env.NODE_ENV !== 'production') {\n watcher.onTrack = onTrack;\n watcher.onTrigger = onTrigger;\n }\n // initial run\n if (cb) {\n if (immediate) {\n watcher.run();\n }\n else {\n oldValue = watcher.get();\n }\n }\n else if (flush === 'post' && instance) {\n instance.$once('hook:mounted', function () { return watcher.get(); });\n }\n else {\n watcher.get();\n }\n return function () {\n watcher.teardown();\n };\n}\n\nvar activeEffectScope;\nvar EffectScope = /** @class */ (function () {\n function EffectScope(detached) {\n if (detached === void 0) { detached = false; }\n this.detached = detached;\n /**\n * @internal\n */\n this.active = true;\n /**\n * @internal\n */\n this.effects = [];\n /**\n * @internal\n */\n this.cleanups = [];\n this.parent = activeEffectScope;\n if (!detached && activeEffectScope) {\n this.index =\n (activeEffectScope.scopes || (activeEffectScope.scopes = [])).push(this) - 1;\n }\n }\n EffectScope.prototype.run = function (fn) {\n if (this.active) {\n var currentEffectScope = activeEffectScope;\n try {\n activeEffectScope = this;\n return fn();\n }\n finally {\n activeEffectScope = currentEffectScope;\n }\n }\n else if (process.env.NODE_ENV !== 'production') {\n warn(\"cannot run an inactive effect scope.\");\n }\n };\n /**\n * This should only be called on non-detached scopes\n * @internal\n */\n EffectScope.prototype.on = function () {\n activeEffectScope = this;\n };\n /**\n * This should only be called on non-detached scopes\n * @internal\n */\n EffectScope.prototype.off = function () {\n activeEffectScope = this.parent;\n };\n EffectScope.prototype.stop = function (fromParent) {\n if (this.active) {\n var i = void 0, l = void 0;\n for (i = 0, l = this.effects.length; i < l; i++) {\n this.effects[i].teardown();\n }\n for (i = 0, l = this.cleanups.length; i < l; i++) {\n this.cleanups[i]();\n }\n if (this.scopes) {\n for (i = 0, l = this.scopes.length; i < l; i++) {\n this.scopes[i].stop(true);\n }\n }\n // nested scope, dereference from parent to avoid memory leaks\n if (!this.detached && this.parent && !fromParent) {\n // optimized O(1) removal\n var last = this.parent.scopes.pop();\n if (last && last !== this) {\n this.parent.scopes[this.index] = last;\n last.index = this.index;\n }\n }\n this.parent = undefined;\n this.active = false;\n }\n };\n return EffectScope;\n}());\nfunction effectScope(detached) {\n return new EffectScope(detached);\n}\n/**\n * @internal\n */\nfunction recordEffectScope(effect, scope) {\n if (scope === void 0) { scope = activeEffectScope; }\n if (scope && scope.active) {\n scope.effects.push(effect);\n }\n}\nfunction getCurrentScope() {\n return activeEffectScope;\n}\nfunction onScopeDispose(fn) {\n if (activeEffectScope) {\n activeEffectScope.cleanups.push(fn);\n }\n else if (process.env.NODE_ENV !== 'production') {\n warn(\"onScopeDispose() is called when there is no active effect scope\" +\n \" to be associated with.\");\n }\n}\n\nfunction provide(key, value) {\n if (!currentInstance) {\n if (process.env.NODE_ENV !== 'production') {\n warn(\"provide() can only be used inside setup().\");\n }\n }\n else {\n // TS doesn't allow symbol as index type\n resolveProvided(currentInstance)[key] = value;\n }\n}\nfunction resolveProvided(vm) {\n // by default an instance inherits its parent's provides object\n // but when it needs to provide values of its own, it creates its\n // own provides object using parent provides object as prototype.\n // this way in `inject` we can simply look up injections from direct\n // parent and let the prototype chain do the work.\n var existing = vm._provided;\n var parentProvides = vm.$parent && vm.$parent._provided;\n if (parentProvides === existing) {\n return (vm._provided = Object.create(parentProvides));\n }\n else {\n return existing;\n }\n}\nfunction inject(key, defaultValue, treatDefaultAsFactory) {\n if (treatDefaultAsFactory === void 0) { treatDefaultAsFactory = false; }\n // fallback to `currentRenderingInstance` so that this can be called in\n // a functional component\n var instance = currentInstance;\n if (instance) {\n // #2400\n // to support `app.use` plugins,\n // fallback to appContext's `provides` if the instance is at root\n var provides = instance.$parent && instance.$parent._provided;\n if (provides && key in provides) {\n // TS doesn't allow symbol as index type\n return provides[key];\n }\n else if (arguments.length > 1) {\n return treatDefaultAsFactory && isFunction(defaultValue)\n ? defaultValue.call(instance)\n : defaultValue;\n }\n else if (process.env.NODE_ENV !== 'production') {\n warn(\"injection \\\"\".concat(String(key), \"\\\" not found.\"));\n }\n }\n else if (process.env.NODE_ENV !== 'production') {\n warn(\"inject() can only be used inside setup() or functional components.\");\n }\n}\n\nvar normalizeEvent = cached(function (name) {\n var passive = name.charAt(0) === '&';\n name = passive ? name.slice(1) : name;\n var once = name.charAt(0) === '~'; // Prefixed last, checked first\n name = once ? name.slice(1) : name;\n var capture = name.charAt(0) === '!';\n name = capture ? name.slice(1) : name;\n return {\n name: name,\n once: once,\n capture: capture,\n passive: passive\n };\n});\nfunction createFnInvoker(fns, vm) {\n function invoker() {\n var fns = invoker.fns;\n if (isArray(fns)) {\n var cloned = fns.slice();\n for (var i = 0; i < cloned.length; i++) {\n invokeWithErrorHandling(cloned[i], null, arguments, vm, \"v-on handler\");\n }\n }\n else {\n // return handler return value for single handlers\n return invokeWithErrorHandling(fns, null, arguments, vm, \"v-on handler\");\n }\n }\n invoker.fns = fns;\n return invoker;\n}\nfunction updateListeners(on, oldOn, add, remove, createOnceHandler, vm) {\n var name, cur, old, event;\n for (name in on) {\n cur = on[name];\n old = oldOn[name];\n event = normalizeEvent(name);\n if (isUndef(cur)) {\n process.env.NODE_ENV !== 'production' &&\n warn(\"Invalid handler for event \\\"\".concat(event.name, \"\\\": got \") + String(cur), vm);\n }\n else if (isUndef(old)) {\n if (isUndef(cur.fns)) {\n cur = on[name] = createFnInvoker(cur, vm);\n }\n if (isTrue(event.once)) {\n cur = on[name] = createOnceHandler(event.name, cur, event.capture);\n }\n add(event.name, cur, event.capture, event.passive, event.params);\n }\n else if (cur !== old) {\n old.fns = cur;\n on[name] = old;\n }\n }\n for (name in oldOn) {\n if (isUndef(on[name])) {\n event = normalizeEvent(name);\n remove(event.name, oldOn[name], event.capture);\n }\n }\n}\n\nfunction mergeVNodeHook(def, hookKey, hook) {\n if (def instanceof VNode) {\n def = def.data.hook || (def.data.hook = {});\n }\n var invoker;\n var oldHook = def[hookKey];\n function wrappedHook() {\n hook.apply(this, arguments);\n // important: remove merged hook to ensure it's called only once\n // and prevent memory leak\n remove$2(invoker.fns, wrappedHook);\n }\n if (isUndef(oldHook)) {\n // no existing hook\n invoker = createFnInvoker([wrappedHook]);\n }\n else {\n /* istanbul ignore if */\n if (isDef(oldHook.fns) && isTrue(oldHook.merged)) {\n // already a merged invoker\n invoker = oldHook;\n invoker.fns.push(wrappedHook);\n }\n else {\n // existing plain hook\n invoker = createFnInvoker([oldHook, wrappedHook]);\n }\n }\n invoker.merged = true;\n def[hookKey] = invoker;\n}\n\nfunction extractPropsFromVNodeData(data, Ctor, tag) {\n // we are only extracting raw values here.\n // validation and default values are handled in the child\n // component itself.\n var propOptions = Ctor.options.props;\n if (isUndef(propOptions)) {\n return;\n }\n var res = {};\n var attrs = data.attrs, props = data.props;\n if (isDef(attrs) || isDef(props)) {\n for (var key in propOptions) {\n var altKey = hyphenate(key);\n if (process.env.NODE_ENV !== 'production') {\n var keyInLowerCase = key.toLowerCase();\n if (key !== keyInLowerCase && attrs && hasOwn(attrs, keyInLowerCase)) {\n tip(\"Prop \\\"\".concat(keyInLowerCase, \"\\\" is passed to component \") +\n \"\".concat(formatComponentName(\n // @ts-expect-error tag is string\n tag || Ctor), \", but the declared prop name is\") +\n \" \\\"\".concat(key, \"\\\". \") +\n \"Note that HTML attributes are case-insensitive and camelCased \" +\n \"props need to use their kebab-case equivalents when using in-DOM \" +\n \"templates. You should probably use \\\"\".concat(altKey, \"\\\" instead of \\\"\").concat(key, \"\\\".\"));\n }\n }\n checkProp(res, props, key, altKey, true) ||\n checkProp(res, attrs, key, altKey, false);\n }\n }\n return res;\n}\nfunction checkProp(res, hash, key, altKey, preserve) {\n if (isDef(hash)) {\n if (hasOwn(hash, key)) {\n res[key] = hash[key];\n if (!preserve) {\n delete hash[key];\n }\n return true;\n }\n else if (hasOwn(hash, altKey)) {\n res[key] = hash[altKey];\n if (!preserve) {\n delete hash[altKey];\n }\n return true;\n }\n }\n return false;\n}\n\n// The template compiler attempts to minimize the need for normalization by\n// statically analyzing the template at compile time.\n//\n// For plain HTML markup, normalization can be completely skipped because the\n// generated render function is guaranteed to return Array. There are\n// two cases where extra normalization is needed:\n// 1. When the children contains components - because a functional component\n// may return an Array instead of a single root. In this case, just a simple\n// normalization is needed - if any child is an Array, we flatten the whole\n// thing with Array.prototype.concat. It is guaranteed to be only 1-level deep\n// because functional components already normalize their own children.\nfunction simpleNormalizeChildren(children) {\n for (var i = 0; i < children.length; i++) {\n if (isArray(children[i])) {\n return Array.prototype.concat.apply([], children);\n }\n }\n return children;\n}\n// 2. When the children contains constructs that always generated nested Arrays,\n// e.g.