{"version":3,"sources":["webpack:///./src/feature/rehab-form/rehab-form.js"],"names":["RehabForm","element","el","settings","parseSettings","removeOptions","this","getAttribute","JSON","parse","$form","jQuery","optionsToDelete","options","length","find","each","index","item","$item","inArray","val","remove","BaseFeature"],"mappings":"yhDAGO,IAAMA,EAAb,a,kOAAA,U,MAAA,OACC,WAAYC,GAAS,a,4FAAA,UACpB,cAAMA,IAEDC,GAAKD,EACV,EAAKE,SAAW,EAAKC,gBAErB,EAAKC,gBANe,EADtB,O,EAAA,G,EAAA,4BAUC,WACC,IAAMF,EAAWG,KAAKJ,GAAGK,aAAa,iBACtC,OAAOC,KAAKC,MAAMN,KAZpB,2BAgBC,WACC,IAAMO,EAAQC,IAAOL,KAAKJ,IACpBU,EAAkBN,KAAKH,SAASU,QAElCD,EAAgBE,OAAS,GAC5BJ,EAAMK,KAAK,mBAAmBC,MAAK,SAACC,EAAOC,GAC1C,IAAMC,EAAQR,IAAOO,IACiC,IAAlDP,IAAOS,QAAQD,EAAME,MAAOT,IAC/BO,EAAMG,iB,2BAxBX,G,MAA+BC,GA+BhBvB","file":"50-0ba402a0.pkg.js","sourcesContent":["import jQuery from 'jquery';\r\nimport BaseFeature from '../../foundation/base/base';\r\n\r\nexport class RehabForm extends BaseFeature {\r\n\tconstructor(element) {\r\n\t\tsuper(element);\r\n\r\n\t\tthis.el = element;\r\n\t\tthis.settings = this.parseSettings();\r\n\r\n\t\tthis.removeOptions();\r\n\t}\r\n\r\n\tparseSettings() {\r\n\t\tconst settings = this.el.getAttribute('data-settings');\r\n\t\treturn JSON.parse(settings);\r\n\t}\r\n\r\n\t// In step 1 we remove spcific option values if any of these are disabled in Sitecore\r\n\tremoveOptions() {\r\n\t\tconst $form = jQuery(this.el);\r\n\t\tconst optionsToDelete = this.settings.options;\r\n\r\n\t\tif (optionsToDelete.length > 0) {\r\n\t\t\t$form.find('select > option').each((index, item) => {\r\n\t\t\t\tconst $item = jQuery(item);\r\n\t\t\t\tif (jQuery.inArray($item.val(), optionsToDelete) !== -1) {\r\n\t\t\t\t\t$item.remove();\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}\r\n\t}\r\n}\r\n\r\nexport default RehabForm;\r\n"],"sourceRoot":""}