{"version":3,"file":"js/3132-f29f932d1449501b49bd.chunk.js","mappings":"kIAoBAA,KAAO,KACL,IAAIC,EAAWD,IAAO,wCACtBC,EAASC,GAAG,SAAUC,IACpBA,EAAIC,iBAnBR,SAAqBC,GACnBL,IAAO,kBAAmBK,GAAeC,SAAS,UAAUC,YAAY,UACxEP,IAAO,oBAAqBK,GAAeC,SAAS,UAAUC,YAAY,UACtEP,IAAO,WAAYK,GAAeG,SAAS,WAC7CR,IAAO,WAAYK,GAAeI,IAAI,UAAW,QAAQF,YAAY,UAEvEP,IAAO,WAAYK,GAAeK,WACpC,CAcIC,CADoBR,EAAIS,OAAOC,QAAQ,wBACb,IAG5B,IAAIC,EAAYd,IAAO,0CACvBc,EAAUZ,GAAG,SAAUC,IACrBA,EAAIC,iBAjBR,SAAqBC,GACnBL,IAAO,WAAYK,GAAeU,QAAQ,UAAU,KAClDf,IAAO,kBAAmBK,GAAeE,YAAY,UAAUD,SAAS,UACxEN,IAAO,oBAAqBK,GAAeC,SAAS,UAAUC,YAAY,SAAS,GAEvF,CAcIS,CADoBb,EAAIS,OAAOC,QAAQ,wBACb,IAG5B,MAAMI,EAA4B,WAC5BjB,IAAOkB,QAAQC,SAlCK,MAoCtBnB,IAAO,iCAAiCoB,OAAOd,SAAS,UACxDL,EAASK,SAAS,UAClBQ,EAAUR,SAAS,UAEvB,EACAY,OAAOG,iBAAiB,SAAUJ,GAClCjB,IAAOkB,QAAQhB,GAAG,UAAU,KAC1BgB,OAAOI,oBAAoB,SAAUL,EAA0B,GAC/D,G","sources":["webpack://agra/./app/javascript/phoenix/collapsible-actions.js"],"sourcesContent":["import jQuery from 'jquery'\n\nconst MIN_SCREEN_WIDTH_SM = 768\n\nfunction showActions(parentElement) {\n jQuery('.expand-actions', parentElement).addClass('d-none').removeClass('d-flex')\n jQuery('.collapse-actions', parentElement).addClass('d-flex').removeClass('d-none')\n if (jQuery('.actions', parentElement).hasClass('d-none')) {\n jQuery('.actions', parentElement).css('display', 'none').removeClass('d-none')\n }\n jQuery('.actions', parentElement).slideDown()\n}\n\nfunction hideActions(parentElement) {\n jQuery('.actions', parentElement).slideUp('normal', () => {\n jQuery('.expand-actions', parentElement).removeClass('d-none').addClass('d-flex')\n jQuery('.collapse-actions', parentElement).addClass('d-none').removeClass('d-flex')\n })\n}\n\njQuery(() => {\n let expander = jQuery('.collapsable-actions .expand-actions')\n expander.on('click', (evt) => {\n evt.preventDefault()\n let parentElement = evt.target.closest('.collapsable-actions')\n showActions(parentElement)\n })\n\n let collapser = jQuery('.collapsable-actions .collapse-actions')\n collapser.on('click', (evt) => {\n evt.preventDefault()\n let parentElement = evt.target.closest('.collapsable-actions')\n hideActions(parentElement)\n })\n\n const showActionsForNonXsScreen = function() {\n if (jQuery(window).width() >= MIN_SCREEN_WIDTH_SM) {\n // We're not on an xs screen, so show the actions and reset the xs-only expand/collapse controls\n jQuery('.collapsable-actions .actions').show().addClass('d-none')\n expander.addClass('d-flex')\n collapser.addClass('d-none')\n }\n }\n window.addEventListener('resize', showActionsForNonXsScreen)\n jQuery(window).on('unload', () => {\n window.removeEventListener('resize', showActionsForNonXsScreen)\n })\n})\n"],"names":["jQuery","expander","on","evt","preventDefault","parentElement","addClass","removeClass","hasClass","css","slideDown","showActions","target","closest","collapser","slideUp","hideActions","showActionsForNonXsScreen","window","width","show","addEventListener","removeEventListener"],"sourceRoot":""}