{"version":3,"names":["prefix","createStaticStyleClassObject","styleClasses","newClassObject","forEach","k","newKey","isStyleClassScPrefixed","styleClass","includes","pfx","input","isNoValidClassString","undefined","split","newClass","length","oldKeys","Object","keys","value"],"sources":["src/utils/style-class-prefix-helper.ts"],"sourcesContent":["const prefix = \"eonui-\";\n\n/*\nConverts an array of strings to an Object where Array Indexes are the Keys\nand each value will be true\nSo If you pass an array with static css classes it will return an Object that can be passed to jsx syntax.\n**/\nconst createStaticStyleClassObject = (styleClasses: string[]) => {\n const newClassObject = {};\n styleClasses.forEach((k) => {\n const newKey = isStyleClassScPrefixed(k) ? k : prefix + k;\n newClassObject[newKey] = true;\n });\n return newClassObject;\n};\n\n/**\n Checks if a className is already prefixed with sc-eon-ui.\n */\nconst isStyleClassScPrefixed = (styleClass: string) => {\n return styleClass.includes(\"sc-eon-ui\", 0);\n};\n\n/**\n This helper function adds a prefix to each key of a Class Object or\n*/\nconst pfx = (input) => {\n /**\n Check for a valid css className\n */\n const isNoValidClassString = input === undefined || input === \"\" || input === null;\n if (isNoValidClassString) {\n return null;\n }\n switch (typeof input) {\n /**\n If the input is a string and contains only a single className it will prefix and return the single ClassName.\n If the input is a string and contains multiple space separated css classes, it will delegate to\n createStaticStyleClassObject function to create a ClassObject of it.\n */\n case \"string\": {\n const styleClasses = input.split(\" \");\n const newClass = isStyleClassScPrefixed(styleClasses[0]) ? styleClasses[0] : prefix + styleClasses[0];\n return styleClasses.length > 1 ? createStaticStyleClassObject(styleClasses) : newClass;\n }\n /**\n If the input is already an Object with ClassNames it will simply prefix each key of that ClassObject and keep the values.\n */\n case \"object\": {\n const newClassObject = {};\n const oldKeys = Object.keys(input);\n oldKeys.forEach((k) => {\n /**\n Needed to extend every CSS ClassName in ClassName Objects where the key is an array off ClassNames.\n e.g