{"version":3,"sources":["webpack:///./src/views/pages/PlantDetail/PlantScenes/SceneWizard/SceneWizardStep1/SceneWizardStep1.vue?597c","webpack:///./src/views/pages/PlantDetail/PlantScenes/SceneWizard/SceneWizardStep1/SceneWizardStep1.ts","webpack:///./src/views/pages/PlantDetail/PlantScenes/SceneWizard/SceneWizardStep1/SceneWizardStep1.vue","webpack:///./src/views/pages/PlantDetail/PlantScenes/SceneWizard/SceneWizardStep.ts","webpack:///./node_modules/lodash.debounce/index.js"],"names":["_hoisted_1","class","_hoisted_2","_hoisted_3","_hoisted_4","for","_hoisted_5","render","_ctx","_cache","$props","$setup","$data","$options","_component_InputText","$t","id","type","isValidName","disabled","isDefaultScene","scene","modelValue","name","$event","invalidNameReason","this","isEditMode","initialName","computeSceneName","verifyValidityOfName","flushCache","prefetchFlatEntities","plantId","SCENE","$store","dispatch","validName","isValidEntityTypeName","suggestNextValidEntityName","eType","suggestedName","$emit","trim","length","SceneWizardStep","watch","__exports__","SceneWizardStepEnum","$route","params","props","Object","computed","emits","FUNC_ERROR_TEXT","NAN","symbolTag","reTrim","reIsBadHex","reIsBinary","reIsOctal","freeParseInt","parseInt","freeGlobal","global","freeSelf","self","root","Function","objectProto","prototype","objectToString","toString","nativeMax","Math","max","nativeMin","min","now","Date","debounce","func","wait","options","lastArgs","lastThis","maxWait","result","timerId","lastCallTime","lastInvokeTime","leading","maxing","trailing","TypeError","invokeFunc","time","args","thisArg","undefined","apply","leadingEdge","setTimeout","timerExpired","remainingWait","timeSinceLastCall","timeSinceLastInvoke","shouldInvoke","trailingEdge","cancel","clearTimeout","flush","debounced","isInvoking","arguments","toNumber","isObject","value","isObjectLike","isSymbol","call","other","valueOf","replace","isBinary","test","slice","module","exports"],"mappings":"mJAEMA,EAAa,CAAEC,MAAO,OACtBC,EAAa,CAAED,MAAO,6BACtBE,EAAa,CAAEF,MAAO,WACtBG,EAAa,CACjBH,MAAO,gBACPI,IAAK,QAEDC,EAAa,CACjBD,IAAK,OACLJ,MAA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AAW,EAAI,GAC3ClE,EAAWmE,KAAKR,GAAS9D,GAAO8D,EAGvCU,EAAOC,QAAUhD,I","file":"js/chunk-07d6f150.07cb82ba.js","sourcesContent":["import { toDisplayString as _toDisplayString, createVNode as _createVNode, resolveComponent as _resolveComponent, openBlock as _openBlock, createBlock as _createBlock } from \"vue\"\n\nconst _hoisted_1 = { class: \"row\" }\nconst _hoisted_2 = { class: \"form-custom col-lg-6 mt-5\" }\nconst _hoisted_3 = { class: \"p-field\" }\nconst _hoisted_4 = {\n class: \"p-field-label\",\n for: \"name\"\n}\nconst _hoisted_5 = {\n for: \"name\",\n class: \"fs-13 label-error\"\n}\n\nexport function render(_ctx: any,_cache: any,$props: any,$setup: any,$data: any,$options: any) {\n const _component_InputText = _resolveComponent(\"InputText\")\n\n return (_openBlock(), _createBlock(\"div\", _hoisted_1, [\n _createVNode(\"div\", _hoisted_2, [\n _createVNode(\"div\", _hoisted_3, [\n _createVNode(\"label\", _hoisted_4, _toDisplayString(_ctx.$t(\"AppResource.Name\")), 1),\n _createVNode(_component_InputText, {\n id: \"name\",\n type: \"text\",\n class: [\"w-100\", { 'input-error': !_ctx.isValidName }],\n disabled: _ctx.isDefaultScene(_ctx.scene),\n modelValue: _ctx.scene.name,\n \"onUpdate:modelValue\": _cache[1] || (_cache[1] = ($event: any) => (_ctx.scene.name = $event))\n }, null, 8, [\"class\", \"disabled\", \"modelValue\"]),\n _createVNode(\"label\", _hoisted_5, _toDisplayString(_ctx.invalidNameReason), 1)\n ])\n ])\n ]))\n}","import { Options } from 'vue-class-component';\nimport SceneWizardStep from '../SceneWizardStep';\nimport {\n isDefaultScene,\n NAME_VALIDATION_DEBOUNCE_TIME,\n} from '@/core/utils/utils';\nimport debounce from 'lodash.debounce';\nimport { NamingService } from '@/core/services/naming.service';\nimport { SET_APP_LOADING } from '@/core/store/action-types';\nimport { PlantEntityType } from '@/../client-generator/generated-clients/configurations';\n\n@Options({\n name: 'SceneWizardStep1',\n watch: {\n 'scene.name': function () {\n this.verifyValidityOfName();\n },\n },\n})\nexport default class SceneWizardStep1 extends SceneWizardStep {\n isValidName = true;\n initialName!: string;\n invalidNameReason: string = '';\n\n isDefaultScene = isDefaultScene;\n\n async mounted() {\n if (this.isEditMode()) {\n this.initialName = this.scene.name ?? '';\n } else {\n this.computeSceneName();\n }\n\n this.verifyValidityOfName = debounce(\n this.verifyValidityOfName,\n NAME_VALIDATION_DEBOUNCE_TIME\n );\n\n NamingService.flushCache();\n await NamingService.prefetchFlatEntities(\n this.plantId,\n PlantEntityType.SCENE\n );\n }\n\n private async verifyValidityOfName() {\n this.$store.dispatch(SET_APP_LOADING, true);\n const validName = NamingService.isValidEntityTypeName(this.scene.name);\n if (this.initialName !== this.scene.name && !validName) {\n const suggestedName = await NamingService.suggestNextValidEntityName({\n plantId: this.plantId,\n eType: PlantEntityType.SCENE,\n });\n this.isValidName = validName;\n this.invalidNameReason = this.$t(\n `uniqueNaming.validationErrorWithSuggestion`,\n { suggestedName }\n );\n this.$emit('next-enabled', false);\n } else {\n this.isValidName = true;\n this.invalidNameReason = '';\n this.$emit('next-enabled', true);\n }\n this.$store.dispatch(SET_APP_LOADING, false);\n }\n\n private isEditMode(): boolean {\n return !!this.scene.id && !!this.scene.id.trim().length;\n }\n\n private async computeSceneName() {\n this.$store.dispatch(SET_APP_LOADING, true);\n this.scene.name = await NamingService.suggestNextValidEntityName({\n plantId: this.plantId,\n eType: PlantEntityType.SCENE,\n });\n this.$store.dispatch(SET_APP_LOADING, false);\n }\n}\n","import { render } from \"./SceneWizardStep1.vue?vue&type=template&id=97f71578&ts=true\"\nimport script from \"./SceneWizardStep1.ts?vue&type=script&lang=ts\"\nexport * from \"./SceneWizardStep1.ts?vue&type=script&lang=ts\"\n\nimport exportComponent from \"/home/vsts/work/1/s/Frontend/node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['render',render]])\n\nexport default __exports__","import { SceneDTO } from 'client-generator/generated-clients/plants';\nimport { Vue, Options } from 'vue-class-component';\nimport { PropType } from 'vue';\nimport { mapState } from 'vuex';\n\nexport enum SceneWizardStepEnum {\n STEP_ACTION,\n STEP_TRIGGER,\n STEP_CONDITION,\n}\n\n@Options({\n name: 'SceneWizardStep',\n props: {\n scene: {\n type: Object as PropType,\n },\n },\n computed: {\n ...mapState(['selectedPlantId']),\n },\n emits: ['next-enabled'],\n})\nexport default class SceneWizardStep extends Vue {\n plantId = -1;\n scene!: SceneDTO;\n selectedPlantId!: number;\n SceneWizardStepEnum = SceneWizardStepEnum;\n\n created() {\n this.plantId = +this.$route.params.plantId;\n }\n\n get componentName() {\n return this.$options.name;\n }\n}\n","/**\n * lodash (Custom Build) \n * Build: `lodash modularize exports=\"npm\" -o ./`\n * Copyright jQuery 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 `TypeError` message for \"Functions\" methods. */\nvar FUNC_ERROR_TEXT = 'Expected a function';\n\n/** Used as references for various `Number` constants. */\nvar NAN = 0 / 0;\n\n/** `Object#toString` result references. */\nvar symbolTag = '[object Symbol]';\n\n/** Used to match leading and trailing whitespace. */\nvar reTrim = /^\\s+|\\s+$/g;\n\n/** Used to detect bad signed hexadecimal string values. */\nvar reIsBadHex = /^[-+]0x[0-9a-f]+$/i;\n\n/** Used to detect binary string values. */\nvar reIsBinary = /^0b[01]+$/i;\n\n/** Used to detect octal string values. */\nvar reIsOctal = /^0o[0-7]+$/i;\n\n/** Built-in method references without a dependency on `root`. */\nvar freeParseInt = parseInt;\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/** Used for built-in method references. */\nvar objectProto = Object.prototype;\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 objectToString = objectProto.toString;\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeMax = Math.max,\n nativeMin = Math.min;\n\n/**\n * Gets the timestamp of the number of milliseconds that have elapsed since\n * the Unix epoch (1 January 1970 00:00:00 UTC).\n *\n * @static\n * @memberOf _\n * @since 2.4.0\n * @category Date\n * @returns {number} Returns the timestamp.\n * @example\n *\n * _.defer(function(stamp) {\n * console.log(_.now() - stamp);\n * }, _.now());\n * // => Logs the number of milliseconds it took for the deferred invocation.\n */\nvar now = function() {\n return root.Date.now();\n};\n\n/**\n * Creates a debounced function that delays invoking `func` until after `wait`\n * milliseconds have elapsed since the last time the debounced function was\n * invoked. The debounced function comes with a `cancel` method to cancel\n * delayed `func` invocations and a `flush` method to immediately invoke them.\n * Provide `options` to indicate whether `func` should be invoked on the\n * leading and/or trailing edge of the `wait` timeout. The `func` is invoked\n * with the last arguments provided to the debounced function. Subsequent\n * calls to the debounced function return the result of the last `func`\n * invocation.\n *\n * **Note:** If `leading` and `trailing` options are `true`, `func` is\n * invoked on the trailing edge of the timeout only if the debounced function\n * is invoked more than once during the `wait` timeout.\n *\n * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred\n * until to the next tick, similar to `setTimeout` with a timeout of `0`.\n *\n * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)\n * for details over the differences between `_.debounce` and `_.throttle`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Function\n * @param {Function} func The function to debounce.\n * @param {number} [wait=0] The number of milliseconds to delay.\n * @param {Object} [options={}] The options object.\n * @param {boolean} [options.leading=false]\n * Specify invoking on the leading edge of the timeout.\n * @param {number} [options.maxWait]\n * The maximum time `func` is allowed to be delayed before it's invoked.\n * @param {boolean} [options.trailing=true]\n * Specify invoking on the trailing edge of the timeout.\n * @returns {Function} Returns the new debounced function.\n * @example\n *\n * // Avoid costly calculations while the window size is in flux.\n * jQuery(window).on('resize', _.debounce(calculateLayout, 150));\n *\n * // Invoke `sendMail` when clicked, debouncing subsequent calls.\n * jQuery(element).on('click', _.debounce(sendMail, 300, {\n * 'leading': true,\n * 'trailing': false\n * }));\n *\n * // Ensure `batchLog` is invoked once after 1 second of debounced calls.\n * var debounced = _.debounce(batchLog, 250, { 'maxWait': 1000 });\n * var source = new EventSource('/stream');\n * jQuery(source).on('message', debounced);\n *\n * // Cancel the trailing debounced invocation.\n * jQuery(window).on('popstate', debounced.cancel);\n */\nfunction debounce(func, wait, options) {\n var lastArgs,\n lastThis,\n maxWait,\n result,\n timerId,\n lastCallTime,\n lastInvokeTime = 0,\n leading = false,\n maxing = false,\n trailing = true;\n\n if (typeof func != 'function') {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n wait = toNumber(wait) || 0;\n if (isObject(options)) {\n leading = !!options.leading;\n maxing = 'maxWait' in options;\n maxWait = maxing ? nativeMax(toNumber(options.maxWait) || 0, wait) : maxWait;\n trailing = 'trailing' in options ? !!options.trailing : trailing;\n }\n\n function invokeFunc(time) {\n var args = lastArgs,\n thisArg = lastThis;\n\n lastArgs = lastThis = undefined;\n lastInvokeTime = time;\n result = func.apply(thisArg, args);\n return result;\n }\n\n function leadingEdge(time) {\n // Reset any `maxWait` timer.\n lastInvokeTime = time;\n // Start the timer for the trailing edge.\n timerId = setTimeout(timerExpired, wait);\n // Invoke the leading edge.\n return leading ? invokeFunc(time) : result;\n }\n\n function remainingWait(time) {\n var timeSinceLastCall = time - lastCallTime,\n timeSinceLastInvoke = time - lastInvokeTime,\n result = wait - timeSinceLastCall;\n\n return maxing ? nativeMin(result, maxWait - timeSinceLastInvoke) : result;\n }\n\n function shouldInvoke(time) {\n var timeSinceLastCall = time - lastCallTime,\n timeSinceLastInvoke = time - lastInvokeTime;\n\n // Either this is the first call, activity has stopped and we're at the\n // trailing edge, the system time has gone backwards and we're treating\n // it as the trailing edge, or we've hit the `maxWait` limit.\n return (lastCallTime === undefined || (timeSinceLastCall >= wait) ||\n (timeSinceLastCall < 0) || (maxing && timeSinceLastInvoke >= maxWait));\n }\n\n function timerExpired() {\n var time = now();\n if (shouldInvoke(time)) {\n return trailingEdge(time);\n }\n // Restart the timer.\n timerId = setTimeout(timerExpired, remainingWait(time));\n }\n\n function trailingEdge(time) {\n timerId = undefined;\n\n // Only invoke if we have `lastArgs` which means `func` has been\n // debounced at least once.\n if (trailing && lastArgs) {\n return invokeFunc(time);\n }\n lastArgs = lastThis = undefined;\n return result;\n }\n\n function cancel() {\n if (timerId !== undefined) {\n clearTimeout(timerId);\n }\n lastInvokeTime = 0;\n lastArgs = lastCallTime = lastThis = timerId = undefined;\n }\n\n function flush() {\n return timerId === undefined ? result : trailingEdge(now());\n }\n\n function debounced() {\n var time = now(),\n isInvoking = shouldInvoke(time);\n\n lastArgs = arguments;\n lastThis = this;\n lastCallTime = time;\n\n if (isInvoking) {\n if (timerId === undefined) {\n return leadingEdge(lastCallTime);\n }\n if (maxing) {\n // Handle invocations in a tight loop.\n timerId = setTimeout(timerExpired, wait);\n return invokeFunc(lastCallTime);\n }\n }\n if (timerId === undefined) {\n timerId = setTimeout(timerExpired, wait);\n }\n return result;\n }\n debounced.cancel = cancel;\n debounced.flush = flush;\n return debounced;\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 && (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 && typeof value == 'object';\n}\n\n/**\n * Checks if `value` is classified as a `Symbol` primitive or 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 a symbol, else `false`.\n * @example\n *\n * _.isSymbol(Symbol.iterator);\n * // => true\n *\n * _.isSymbol('abc');\n * // => false\n */\nfunction isSymbol(value) {\n return typeof value == 'symbol' ||\n (isObjectLike(value) && objectToString.call(value) == symbolTag);\n}\n\n/**\n * Converts `value` to a number.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to process.\n * @returns {number} Returns the number.\n * @example\n *\n * _.toNumber(3.2);\n * // => 3.2\n *\n * _.toNumber(Number.MIN_VALUE);\n * // => 5e-324\n *\n * _.toNumber(Infinity);\n * // => Infinity\n *\n * _.toNumber('3.2');\n * // => 3.2\n */\nfunction toNumber(value) {\n if (typeof value == 'number') {\n return value;\n }\n if (isSymbol(value)) {\n return NAN;\n }\n if (isObject(value)) {\n var other = typeof value.valueOf == 'function' ? value.valueOf() : value;\n value = isObject(other) ? (other + '') : other;\n }\n if (typeof value != 'string') {\n return value === 0 ? value : +value;\n }\n value = value.replace(reTrim, '');\n var isBinary = reIsBinary.test(value);\n return (isBinary || reIsOctal.test(value))\n ? freeParseInt(value.slice(2), isBinary ? 2 : 8)\n : (reIsBadHex.test(value) ? NAN : +value);\n}\n\nmodule.exports = debounce;\n"],"sourceRoot":""}