{"version":3,"sources":["globals.js"],"names":["addHelpTextToField","field","a","b","c","wrapper","jquery","is","find","after","class","on","this","toggleClass","append","window","K","translate","form","getTranslationContext","attr","ajaxSetup","xhrFields","withCredentials","$","jQuery","moment","require","bundle","config","fields","text","callback","checkbox","radio","dropdown","date","datetime","time","attachment","ready","section","length","css","click","toggle"],"mappings":"qJAAA,gDA6BA,SAASA,EAAmBC,EAAOC,EAAGC,EAAGC,GACvC,IAAIC,EAAUC,IAAOL,EAAMI,WACvBA,EAAQE,GAAG,mDACbF,EAAQG,KAAK,gBAAgBC,MAC3BH,IAAO,QAAS,CACdI,MAAO,oCAENC,GAAG,SAAS,WACXL,IAAOM,MAAMC,YAAY,oBAE1BC,OACCC,OAAOC,EAAEC,UACPhB,EAAMiB,OAAOC,wBACbd,EAAQe,KAAK,qBA7BzBd,IAAOe,UAAU,CACfC,UAAW,CACTC,iBAAiB,KAIrBR,OAAOS,EAAIlB,IACXS,OAAOU,OAASnB,IAChBS,OAAOW,OAASA,IAChBC,EAAQ,KA2BRZ,OAAOa,OAASb,OAAOa,QAAU,GACjCb,OAAOa,OAAOC,OAASd,OAAOa,OAAOC,QAAU,GAG/Cd,OAAOa,OAAOC,OAAOC,OAAS,CAC5BC,KAAM,CACJC,SAAU,SAAS/B,GACjBD,EAAmBC,KAGvBgC,SAAU,CACRD,SAAU,SAAS/B,GACjBD,EAAmBC,KAGvBiC,MAAO,CACLF,SAAU,SAAS/B,GACjBD,EAAmBC,KAGvBkC,SAAU,CACRH,SAAU,SAAS/B,GACjBD,EAAmBC,KAGvBmC,KAAM,CACJJ,SAAU,SAAS/B,GACjBD,EAAmBC,KAGvBoC,SAAU,CACRL,SAAU,SAAS/B,GACjBD,EAAmBC,KAGvBqC,KAAM,CACJN,SAAU,SAAS/B,GACjBD,EAAmBC,KAGvBsC,WAAY,CACVP,SAAU,SAAS/B,GACjBD,EAAmBC,MAMzBc,OAAOa,OAAOC,OAAOW,MAAQ,SAAStB,GACpC,IAAIuB,EAAUnC,IAAOY,EAAKV,KAAK,gCAC3BiC,EAAQC,OAAS,GACnBD,EACGjC,KAAK,kBACLmC,IAAI,SAAU,WACd7B,OAAO,0DACP8B,OAAM,WACLtC,IAAOM,MACJJ,KAAK,UACLK,YAAY,gCACf4B,EAAQjC,KAAK,wBAAwBqC","file":"static/js/3.269424eb.chunk.js","sourcesContent":["// Below is an example of exposing a library globally so that it can be used in\n// the content of a Kinetic Core form. The library itself will determine\n// somewhat how this happens, for example some like the one shown below return\n// something that you have to manually add to 'window'. Some libraries might add\n// themselves to the window when loaded or some might decorate something else,\n// like a jQuery plugin.\n// Note that the example below shows jquery but jquery is not currently\n// configured as a dependency so for this code to work jquery needs to be added\n// as a dependency and installed.\n\nimport jquery from 'jquery';\nimport moment from 'moment';\n\njquery.ajaxSetup({\n xhrFields: {\n withCredentials: true,\n },\n});\n\nwindow.$ = jquery;\nwindow.jQuery = jquery;\nwindow.moment = moment;\nrequire('./controls/rich.editor.js');\n\n/**\n * Kinetic form customizations\n ******************************************************************************/\n\n// Helper function to add help text to fields based on a render attribute\nfunction addHelpTextToField(field, a, b, c) {\n var wrapper = jquery(field.wrapper());\n if (wrapper.is('[data-help-text]:not(:has(.help-text-wrapper))')) {\n wrapper.find('.field-label').after(\n jquery('
', {\n class: 'help-text-wrapper text-truncate',\n })\n .on('click', function() {\n jquery(this).toggleClass('text-truncate');\n })\n .append(\n window.K.translate(\n field.form().getTranslationContext(),\n wrapper.attr('data-help-text'),\n ),\n ),\n );\n }\n}\n\nwindow.bundle = window.bundle || {};\nwindow.bundle.config = window.bundle.config || {};\n\n// Customization of form fields\nwindow.bundle.config.fields = {\n text: {\n callback: function(field) {\n addHelpTextToField(field);\n },\n },\n checkbox: {\n callback: function(field) {\n addHelpTextToField(field);\n },\n },\n radio: {\n callback: function(field) {\n addHelpTextToField(field);\n },\n },\n dropdown: {\n callback: function(field) {\n addHelpTextToField(field);\n },\n },\n date: {\n callback: function(field) {\n addHelpTextToField(field);\n },\n },\n datetime: {\n callback: function(field) {\n addHelpTextToField(field);\n },\n },\n time: {\n callback: function(field) {\n addHelpTextToField(field);\n },\n },\n attachment: {\n callback: function(field) {\n addHelpTextToField(field);\n },\n },\n};\n\n// Add functionality for detailed information toggle\nwindow.bundle.config.ready = function(form) {\n var section = jquery(form.find('#detailedInformationSection'));\n if (section.length > 0) {\n section\n .find('.section-title')\n .css('cursor', 'pointer')\n .append('
')\n .click(function() {\n jquery(this)\n .find('#caret')\n .toggleClass('fa-caret-right fa-caret-down');\n section.find('#detailedInformation').toggle();\n });\n }\n};\n"],"sourceRoot":""}