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BlI,KAAKmI,MAAM,GACV,CAAE1B,SAAS,IAEdjB,IAAI7D,EAAIvC,GACNY,KAAKoG,kBAAkBzE,GAAMvC,EAC7BY,KAAKqG,MACP,CAEA8B,OACM1J,OAAO2J,KAAKpI,KAAKoG,mBAAmBiC,OAAS,IAC/CrI,KAAKwB,SAAS8G,KAAKC,UAAU,CAAC,mCAAsC,IAAIvI,KAAKoG,sBAC7EpG,KAAKoG,kBAAoB,CAAC,EAE9B,EAGFjF,OAAOgE,yBAA2BhE,OAAOgE,0BAA4B,IAAIA,C","sources":["webpack://HtmlGeneric/webpack/bootstrap","webpack://HtmlGeneric/webpack/runtime/compat get default export","webpack://HtmlGeneric/webpack/runtime/define property getters","webpack://HtmlGeneric/webpack/runtime/hasOwnProperty shorthand","webpack://HtmlGeneric/webpack/runtime/make namespace object","webpack://HtmlGeneric/external var \"React\"","webpack://HtmlGeneric/./utils/runByFeature.js","webpack://HtmlGeneric/./utils/ScriptLoader.js","webpack://HtmlGeneric/./HtmlGeneric.duc.js","webpack://HtmlGeneric/../debounce.js","webpack://HtmlGeneric/../throttle.js"],"sourcesContent":["// The require scope\nvar __webpack_require__ = {};\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","const __WEBPACK_NAMESPACE_OBJECT__ = React;","const run = func => func ? func() : null\n\nexport const runByFeature = (features, options) => {\n if (features) {\n const func = Object.entries(options).find(([key, value]) => features[key] ? value : null);\n return func ? run(func[1]) : run(options['otherwise'])\n }\n return run(options['otherwise'])\n}\n","export default class ScriptLoader {\n constructor (options) {\n const { src, global, protocol = document.location.protocol } = options\n this.src = src\n this.global = global\n this.protocol = protocol\n this.isLoaded = false\n this.loaded = false\n }\n\n loadScript () {\n return new Promise((resolve, reject) => {\n // Create script element and set attributes\n const script = document.createElement('script')\n script.type = 'text/javascript'\n script.async = true\n script.src = this.src.includes('http') ? this.src : `${this.protocol}//${this.src}`\n\n // Append the script to the DOM\n const el = document.getElementsByTagName('script')[0]\n if(el) {\n el.parentNode.insertBefore(script, el)\n\n // Resolve the promise once the script is loaded\n script.addEventListener('load', () => {\n this.isLoaded = true\n resolve(script)\n })\n\n // Catch any errors while loading the script\n script.addEventListener('error', () => {\n reject(new Error(`${this.src} failed to load.`))\n })\n }\n })\n }\n\n load () {\n return new Promise(async (resolve, reject) => {\n if (!this.isLoaded) {\n try {\n await this.loadScript()\n resolve(window[this.global])\n } catch (e) {\n console.log(e)\n reject(e)\n }\n } else {\n resolve(window[this.global])\n }\n })\n }\n}\n","import React, { useState, useRef, useEffect } from 'react';\nimport { debounce } from 'throttle-debounce'\nimport { runByFeature } from './utils/runByFeature'\n\nimport Loader from './utils/ScriptLoader';\nimport './styles/htmlHeneric.scss';\n\nconst hasJQuery = () => !!window.$\nconst checkTypeAndConvert = (value, type) => value && (type === 'number') ? value && isNaN(Number(value)) ? -1 : Number(value) : value\n\nconst HtmlGeneric = ({value, options, onChange, schema, onBlur, id, features}) => {\n const [currentValue, setValue] = useState(value || '')\n const container = useRef(null)\n const changeTimeout = useRef(null)\n const parser = new DOMParser()\n const { custom : { objectText, callbackFunctionName }} = options\n const type = ((schema.minimum) || (schema.maximum))\n ? 'number'\n : schema.type\n ? schema.type\n : 'string'\n\n useEffect(() => {\n const run = async () => {\n window.DialValues = window.DialValues || {}\n window.DialValues[id] = value\n if (!window.getDialValue) {\n window.getDialValue = (id, original) => original.replaceAll('#DIAL_VALUE#', window.DialValues[id])\n }\n\n if (objectText) {\n const dom = parser.parseFromString(objectText, 'text/html')\n const scripts = dom.querySelectorAll('script')\n const stylesheetLinks = dom.querySelectorAll('link[rel=\"stylesheet\"]');\n const internalStyles = dom.querySelectorAll('style');\n\n if(!hasJQuery()) {\n const loader = new Loader({\n src: 'https://code.jquery.com/jquery-3.6.0.min.js',\n global: 'body'\n })\n\n await loader.load()\n }\n\n for (let script of scripts) {\n if (script.src) {\n const loader = new Loader({\n src: script.src,\n global: 'body'\n })\n await loader.load()\n } else {\n const cloned = document.createElement('script')\n cloned.type = script.type\n cloned.innerHTML = script.innerHTML\n .replaceAll('#DIAL_DISPLAY_NAME#', schema.title)\n .replace(/([`'\"])(\\s|.)*?(\\1)/gm, ((match, p1) => match.replaceAll('#DIAL_VALUE#', `${p1} + getDialValue('${id}', '#DIAL_VALUE#') + ${p1}`)))\n document.body.appendChild(cloned)\n }\n script.remove()\n }\n\n for (let style of internalStyles) {\n const clonedStyle = document.createElement('style')\n clonedStyle.innerHTML = style.innerHTML\n document.head.appendChild(clonedStyle);\n style.remove()\n }\n\n for (let link of stylesheetLinks) {\n const clonedLink = document.createElement('link')\n clonedLink.href = link.href\n clonedLink.rel = link.rel\n document.head.appendChild(clonedLink);\n link.remove()\n }\n\n if (container && container.current) {\n container.current.innerHTML = dom.body.innerHTML\n .replace(/#DIAL_DISPLAY_NAME#/gm, schema.title)\n .replace(/(<.*?\\s+[\\w]+=\".*)(#DIAL_VALUE#)(.*\")/gm, `$1${currentValue}$3 data-xmpie-value=\"${currentValue}\"`)\n .replace(/<(\\w+)(.*?>)(\\s*(#DIAL_VALUE#)\\s*)(<\\/\\1>)/gm, `<$1 data-xmpie-value=\"${currentValue}\" $2${currentValue}$5`)\n .replace(/#DIAL_VALUE#/gm, `${currentValue}`)\n }\n }\n }\n run()\n window[callbackFunctionName] = (pValue) => {\n const valueByType = checkTypeAndConvert(pValue, type)\n runByFeature(features, {\n newTimezoneModel: () => {\n if (features.newHTMLGenericChangeValue) {\n window.GenericHtmlQueueExecutor.registerOnChange((value) => {\n clearTimeout(changeTimeout.current)\n changeTimeout.current = setTimeout(() => {\n window.triggerFormPropertyChange(id, value)\n }, 750)\n })\n window.GenericHtmlQueueExecutor.add(id, valueByType)\n } else {\n window.GenericHtmlQueueExecutor.registerOnChange((value) => {\n onChange(value)\n })\n window.GenericHtmlQueueExecutor.add(id, valueByType)\n }\n },\n newHTMLGenericChangeValue: () => {\n clearTimeout(changeTimeout.current)\n changeTimeout.current = setTimeout(() => {\n window.triggerFormPropertyChange(id, valueByType)\n }, 750)\n },\n otherwise: () => onChange(valueByType)\n })\n setValue(valueByType)\n }\n return () => {\n window.DialValues && delete window.DialValues[id]\n delete window[callbackFunctionName]\n window.GenericHtmlQueueExecutor = new GenericHtmlQueueExecutor()\n }\n },[])\n\n useEffect(() => {\n const newValue = value || ''\n window.DialValues = window.DialValues || {}\n window.DialValues[id] = newValue\n\n container.current.querySelectorAll('[data-xmpie-value]').forEach((e) => {\n if (e.nodeName === 'INPUT') {\n e.value = newValue\n } else {\n e.innerHTML = newValue\n }\n })\n }, [value])\n\n return (\n