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gB,eAAeb,EAASY,EAAK,CAAEE,YAAY,EAAMC,IAAKJ,EAAWC,IAG3E,ECPArB,EAAoBC,EAAI,SAASwB,EAAKC,GAAQ,OAAOpB,OAAOqB,UAAUC,eAAeC,KAAKJ,EAAKC,EAAO,ECAtG1B,EAAoB8B,EAAI,kB,iCCKxBC,EAAAA,M","sources":["webpack://app/../usr/local/bundle/gems/decidim-budgets-0.27.4/app/packs/src/decidim/budgets/exit_handler.js","webpack://app/../usr/local/bundle/gems/decidim-budgets-0.27.4/app/packs/images/ sync ^\\.\\/.*$","webpack://app/webpack/bootstrap","webpack://app/webpack/runtime/compat get default export","webpack://app/webpack/runtime/define property getters","webpack://app/webpack/runtime/hasOwnProperty shorthand","webpack://app/webpack/runtime/publicPath","webpack://app/../usr/local/bundle/gems/decidim-budgets-0.27.4/app/packs/entrypoints/decidim_budgets.js"],"sourcesContent":["const currentAllocationZero = () => {\n const $budgetSummary = $(\".budget-summary__progressbox\");\n return parseInt($budgetSummary.attr(\"data-current-allocation\"), 10) === 0;\n}\n\nconst isSafeUrl = (exitUrl) => {\n if (!exitUrl) {\n return false\n }\n\n const safeUrls = [\n $(\".budget-summary\").attr(\"data-safe-url\").split(\"?\")[0],\n `${location.pathname}#`,\n `${location.href}#`,\n \"#\"\n ];\n\n let safe = false;\n safeUrls.forEach((url) => {\n if (exitUrl.startsWith(url)) {\n safe = true\n }\n });\n\n return safe;\n}\n\nconst allowExitFrom = ($el) => {\n if (currentAllocationZero()) {\n return true\n } else if ($el.attr(\"target\") === \"_blank\") {\n return true;\n } else if ($el.parents(\"#loginModal\").length > 0) {\n return true;\n } else if ($el.parents(\"#authorizationModal\").length > 0) {\n return true;\n } else if ($el.attr(\"id\") === \"exit-notification-link\") {\n return true;\n } else if ($el.parents(\".voting-wrapper\").length > 0) {\n return true;\n } else if (isSafeUrl($el.attr(\"href\"))) {\n return true\n }\n\n return false;\n}\n\n$(() => {\n const $exitNotification = $(\"#exit-notification\");\n const $exitLink = $(\"#exit-notification-link\");\n const defaultExitUrl = $exitLink.attr(\"href\");\n const defaultExitLinkText = $exitLink.text();\n let exitLinkText = defaultExitLinkText;\n\n if ($exitNotification.length < 1) {\n // Do not apply when not inside the voting pipeline\n return;\n }\n\n const openExitNotification = (url, method = null) => {\n if (method && method !== \"get\") {\n $exitLink.attr(\"data-method\", method);\n } else {\n $exitLink.removeAttr(\"data-method\");\n }\n\n $exitLink.attr(\"href\", url);\n $exitLink.html(exitLinkText);\n $exitNotification.foundation(\"open\");\n };\n\n $(document).on(\"click\", \"a\", (event) => {\n exitLinkText = defaultExitLinkText;\n\n const $link = $(event.currentTarget);\n if (!allowExitFrom($link)) {\n event.preventDefault();\n openExitNotification($link.attr(\"href\"), $link.data(\"method\"));\n }\n });\n // Custom handling for the header sign out so that it won't trigger the\n // logout form submit and so that it changes the exit link text. This does\n // not trigger the document link click listener because it has the\n // data-method attribute to trigger a form submit event.\n $(\".header a.sign-out-link\").on(\"click\", (event) => {\n event.preventDefault();\n event.stopPropagation();\n\n const $link = $(event.currentTarget);\n exitLinkText = $link.text();\n openExitNotification($link.attr(\"href\"), $link.data(\"method\"));\n });\n // Custom handling for the exit link which needs to change the exit link\n // text to the default text as this is not handled by the document click\n // listener.\n $(\"a[data-open='exit-notification']\").on(\"click\", () => {\n exitLinkText = defaultExitLinkText;\n openExitNotification(defaultExitUrl);\n });\n});\n","var map = {\n\t\"./decidim/budgets/decidim_budgets.svg\": 77978\n};\n\n\nfunction webpackContext(req) {\n\tvar id = webpackContextResolve(req);\n\treturn __webpack_require__(id);\n}\nfunction webpackContextResolve(req) {\n\tif(!__webpack_require__.o(map, req)) {\n\t\tvar e = new Error(\"Cannot find module '\" + req + \"'\");\n\t\te.code = 'MODULE_NOT_FOUND';\n\t\tthrow e;\n\t}\n\treturn map[req];\n}\nwebpackContext.keys = function webpackContextKeys() {\n\treturn Object.keys(map);\n};\nwebpackContext.resolve = webpackContextResolve;\nmodule.exports = webpackContext;\nwebpackContext.id = 62449;","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = function(module) {\n\tvar getter = module && module.__esModule ?\n\t\tfunction() { return module['default']; } :\n\t\tfunction() { return module; };\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = function(exports, definition) {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); }","__webpack_require__.p = \"/decidim-packs/\";","import \"src/decidim/budgets/projects\"\nimport \"src/decidim/budgets/progressFixed\"\nimport \"src/decidim/budgets/exit_handler\"\n\n// Images\nrequire.context(\"../images\", true)\n"],"names":["allowExitFrom","$el","$budgetSummary","$","parseInt","attr","parents","length","exitUrl","safeUrls","split","location","pathname","href","safe","forEach","url","startsWith","isSafeUrl","$exitNotification","$exitLink","defaultExitUrl","defaultExitLinkText","text","exitLinkText","openExitNotification","method","removeAttr","html","foundation","document","on","event","$link","currentTarget","preventDefault","data","stopPropagation","map","webpackContext","req","id","webpackContextResolve","__webpack_require__","o","e","Error","code","keys","Object","resolve","module","exports","__webpack_module_cache__","moduleId","cachedModule","undefined","__webpack_modules__","n","getter","__esModule","d","a","definition","key","defineProperty","enumerable","get","obj","prop","prototype","hasOwnProperty","call","p","require"],"sourceRoot":""}