{"version":3,"file":"loader.min.js","sources":["https:\/\/falms.fa.gov.sa\/theme\/boost\/amd\/src\/loader.js"],"sourcesContent":["\/\/ This file is part of Moodle - http:\/\/moodle.org\/\n\/\/\n\/\/ Moodle is free software: you can redistribute it and\/or modify\n\/\/ it under the terms of the GNU General Public License as published by\n\/\/ the Free Software Foundation, either version 3 of the License, or\n\/\/ (at your option) any later version.\n\/\/\n\/\/ Moodle is distributed in the hope that it will be useful,\n\/\/ but WITHOUT ANY WARRANTY; without even the implied warranty of\n\/\/ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n\/\/ GNU General Public License for more details.\n\/\/\n\/\/ You should have received a copy of the GNU General Public License\n\/\/ along with Moodle. If not, see .\n\n\/**\n * Template renderer for Moodle. Load and render Moodle templates with Mustache.\n *\n * @module theme_boost\/loader\n * @copyright 2015 Damyon Wiese \n * @license http:\/\/www.gnu.org\/copyleft\/gpl.html GNU GPL v3 or later\n * @since 2.9\n *\/\n\nimport $ from 'jquery';\nimport * as Aria from '.\/aria';\nimport Bootstrap from '.\/index';\nimport Pending from 'core\/pending';\nimport {DefaultWhitelist} from '.\/bootstrap\/tools\/sanitizer';\nimport setupBootstrapPendingChecks from '.\/pending';\n\n\/**\n * Rember the last visited tabs.\n *\/\nconst rememberTabs = () => {\n $('a[data-toggle=\"tab\"]').on('shown.bs.tab', function(e) {\n var hash = $(e.target).attr('href');\n if (history.replaceState) {\n history.replaceState(null, null, hash);\n } else {\n location.hash = hash;\n }\n });\n const hash = window.location.hash;\n if (hash) {\n const tab = document.querySelector('[role=\"tablist\"] [href=\"' + hash + '\"]');\n if (tab) {\n tab.click();\n }\n }\n};\n\n\/**\n * Enable all popovers\n *\n *\/\nconst enablePopovers = () => {\n $('body').popover({\n container: 'body',\n selector: '[data-toggle=\"popover\"]',\n trigger: 'focus',\n whitelist: Object.assign(DefaultWhitelist, {\n table: [],\n thead: [],\n tbody: [],\n tr: [],\n th: [],\n td: [],\n }),\n });\n\n document.addEventListener('keydown', e => {\n if (e.key === 'Escape' && e.target.closest('[data-toggle=\"popover\"]')) {\n $(e.target).popover('hide');\n }\n });\n};\n\n\/**\n * Enable tooltips\n *\n *\/\nconst enableTooltips = () => {\n $('body').tooltip({\n container: 'body',\n selector: '[data-toggle=\"tooltip\"]',\n });\n};\n\nconst pendingPromise = new Pending('theme_boost\/loader:init');\n\n\/\/ Add pending promise event listeners to relevant Bootstrap custom events.\nsetupBootstrapPendingChecks();\n\n\/\/ Setup Aria helpers for Bootstrap features.\nAria.init();\n\n\/\/ Remember the last visited tabs.\nrememberTabs();\n\n\/\/ Enable all popovers.\nenablePopovers();\n\n\/\/ Enable all tooltips.\nenableTooltips();\n\n\/\/ Disables flipping the dropdowns up or dynamically repositioning them along the Y-axis (based on the viewport)\n\/\/ to prevent the dropdowns getting hidden behind the navbar or them covering the trigger element.\n$.fn.dropdown.Constructor.Default.popperConfig = {\n modifiers: {\n flip: {\n enabled: false,\n },\n storeTopPosition: {\n enabled: true,\n \/\/ eslint-disable-next-line no-unused-vars\n fn(data, options) {\n data.storedTop = data.offsets.popper.top;\n return data;\n },\n order: 299\n },\n restoreTopPosition: {\n enabled: true,\n \/\/ eslint-disable-next-line no-unused-vars\n fn(data, options) {\n data.offsets.popper.top = data.storedTop;\n return data;\n },\n order: 301\n }\n },\n};\n\npendingPromise.resolve();\n\nexport {\n Bootstrap,\n};\n"],"names":["_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","_interopRequireDefault","obj","__esModule","default","_jquery","Aria","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","_interopRequireWildcard","_index","_pending","_pending2","pendingPromise","Pending","setupBootstrapPendingChecks","init","rememberTabs","$","on","e","hash","target","attr","history","replaceState","location","window","tab","document","querySelector","click","popover","container","selector","trigger","whitelist","assign","DefaultWhitelist","table","thead","tbody","tr","th","td","addEventListener","closest","tooltip","fn","dropdown","Constructor","Default","popperConfig","modifiers","flip","enabled","storeTopPosition","data","options","storedTop","offsets","popper","top","order","restoreTopPosition","resolve"],"mappings":"mMA6BoD,SAAAA,yBAAAC,mCAAAC,wBAAAC,sBAAAD,QAAAE,qBAAAF,eAAAF,kCAAAC,oBAAAA,YAAAG,iBAAAD,oBAAAF,aAAA,SAAAI,uBAAAC,YAAAA,KAAAA,IAAAC,WAAAD,KAAAE,QAAAF;;;;;;;;+JALpDG,QAAAJ,uBAAAI,SACAC,KAIoD,SAAAJ,IAAAL,iBAAAA,aAAAK,KAAAA,IAAAC,kBAAAD,cAAAA,sBAAAA,wBAAAA,WAAAE,QAAAF,SAAAK,MAAAX,yBAAAC,gBAAAU,OAAAA,MAAAC,IAAAN,YAAAK,MAAAE,IAAAP,SAAAQ,UAAAC,sBAAAC,OAAAC,gBAAAD,OAAAE,iCAAAC,OAAAb,mBAAAa,KAAAH,OAAAI,UAAAC,eAAAC,KAAAhB,IAAAa,UAAAI,KAAAR,sBAAAC,OAAAE,yBAAAZ,IAAAa,UAAAI,OAAAA,KAAAV,KAAAU,KAAAC,KAAAR,OAAAC,eAAAH,OAAAK,IAAAI,MAAAT,OAAAK,KAAAb,IAAAa,KAAAL,OAAAN,QAAAF,IAAAK,OAAAA,MAAAa,IAAAlB,IAAAQ,eAAAA,OAJpDW,CAAAf,MACAgB,OAAArB,uBAAAqB,QACAC,SAAAtB,uBAAAsB,UAEAC,UAAAvB,uBAAAuB,WAKA,MAuDMC,eAAiB,IAAIC,iBAAQ,4BAGnC,EAAAC,qBAGArB,KAAKsB,OA7DgBC,OACjB,EAAAC,iBAAE,wBAAwBC,GAAG,gBAAgB,SAASC,GAClD,IAAIC,MAAO,EAAAH,iBAAEE,EAAEE,QAAQC,KAAK,QACxBC,QAAQC,aACRD,QAAQC,aAAa,KAAM,KAAMJ,MAEjCK,SAASL,KAAOA,QAGxB,MAAMA,KAAOM,OAAOD,SAASL,KAC7B,GAAIA,KAAM,CACN,MAAMO,IAAMC,S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