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ACxHO,SAAAA,GAEEC,EAAEC,MAAMC,KAAK,CACXC,KAAM,OACNC,SAAU,OACVC,IAAKC,OAAOC,yCAAyC,CAAET,qBAAsBN,KAEjF,EAEAgB,YAAAA,GACE,EAGFC,QAAAA,CAASC,GAEHjB,GAAUA,EAASkB,KAAK,KAAMD,EACpC,GACA,C,2DCnBJ,IAAIE,EAAQ,KAEZlB,EAAAA,QAASC,cAAcC,OAAO,qBAAsB,CAClDG,SAAAA,GAEE,GAD2Bc,SAASC,eAAe,uBAC3B,CACtB,MAAMC,EAAeF,SAASG,cAAc,qBAC5CJ,EAAQC,SAASI,KAAKC,YAAYH,EACpC,CACF,EAEAP,YAAAA,GACgB,OAAVI,GAAgBA,EAAMO,QAC5B,EAEAV,QAAAA,CAASC,GACP,MAAMU,EAAqBP,SAASC,eAAe,uBACnD,GAAIM,EAAoB,CACtB,MAAMC,EAASC,OAAOF,EAAmBG,aAAa,0BAChDC,EAAcF,OAAOF,EAAmBG,aAAa,yBACpCb,EAAKe,gBAAkBD,IAAiC,UAAhBd,EAAKgB,QAAsBhB,EAAKiB,UAAYN,GAA4B,SAAhBX,EAAKgB,QAAqBhB,EAAKiB,UAAYN,KAGhKD,EAAmBQ,aAAa,wBAAyB,IAEzDC,YAAW,KACTjB,EAAMkB,cAAc,IAAIC,YAAY,QAAQ,GAC3C,KAEP,CACF,G,uBC7BF,MAAMC,EAAW3C,EAAAA,OACjB2C,EAASlD,OAAOQ,QAAQ0C,E,mGCAxB,MAAMzC,EAAYA,CAAC0C,EAAWxC,KAC5BC,EAAAA,QAASC,cAAcC,OAAO,CAAEC,QAAS,yBAA0BqC,WAAYD,GAAa,CAC1FlC,SAAAA,GACE,EAGFS,YAAAA,GACE,EAGFC,QAAAA,CAASC,GAEHjB,GAAUA,EAASkB,KAAK,KAAMD,EACpC,GACA,C","sources":["webpack://hnry-rails/./app/javascript/channels/ sync ^\\.\\/.*$","webpack://hnry-rails/./app/javascript/channels/ sync _channel\\.js$","webpack://hnry-rails/./app/javascript/admin_channels/consumer.js","webpack://hnry-rails/./app/javascript/channels.js","webpack://hnry-rails/./app/javascript/channels/ato_prefill_channel.js","webpack://hnry-rails/./app/javascript/channels/impersonate_channel.js","webpack://hnry-rails/./app/javascript/channels/index.js","webpack://hnry-rails/./app/javascript/channels/receipt_scanning_channel.js"],"sourcesContent":["var map = {\n\t\"./\": 4222,\n\t\"./ato_prefill_channel\": 56919,\n\t\"./ato_prefill_channel.js\": 56919,\n\t\"./impersonate_channel\": 45251,\n\t\"./impersonate_channel.js\": 45251,\n\t\"./index\": 4222,\n\t\"./index.js\": 4222,\n\t\"./receipt_scanning_channel\": 63164,\n\t\"./receipt_scanning_channel.js\": 63164\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 = 9080;","var map = {\n\t\"./ato_prefill_channel.js\": 56919,\n\t\"./impersonate_channel.js\": 45251,\n\t\"./receipt_scanning_channel.js\": 63164,\n\t\"channels/ato_prefill_channel.js\": 56919,\n\t\"channels/impersonate_channel.js\": 45251,\n\t\"channels/receipt_scanning_channel.js\": 63164\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 = 63760;","// Action Cable provides the framework to deal with WebSockets in Rails.\n// You can generate new channels where WebSocket features live using the `bin/rails generate channel` command.\n\nimport { createConsumer } from \"@rails/actioncable\";\n\nexport default createConsumer();\n","const importAll = (r) => r.keys().forEach(r);\nimportAll(require.context(\"./channels\", true));\n","import consumer from \"../admin_channels/consumer\";\n\nconst subscribe = (filingObligationId, callback) => {\n consumer.subscriptions.create({ channel: \"AtoFilingObligationPrefillChannel\", filing_obligation_id: filingObligationId }, {\n connected() {\n // Called when the subscription is ready for use on the server\n $.rails.ajax({\n type: \"POST\",\n dataType: \"json\",\n url: Routes.filing_obligation_prefill_summaries_path({ filing_obligation_id: filingObligationId }),\n });\n },\n\n disconnected() {\n // Called when the subscription has been terminated by the server\n },\n\n received(data) {\n // Called when there's incoming data on the websocket for this channel\n if (callback) callback.call(null, data);\n },\n });\n};\n\nexport { subscribe };\n","import consumer from \"../admin_channels/consumer\";\n\nlet modal = null;\n\nconsumer.subscriptions.create(\"ImpersonateChannel\", {\n connected() {\n const impersonateDetails = document.getElementById(\"impersonate-details\");\n if (impersonateDetails) {\n const modalElement = document.createElement(\"impersonate-modal\");\n modal = document.body.appendChild(modalElement);\n };\n },\n\n disconnected() {\n if (modal !== null) modal.remove();\n },\n\n received(data) {\n const impersonateDetails = document.getElementById(\"impersonate-details\");\n if (impersonateDetails) {\n const userId = Number(impersonateDetails.getAttribute(\"data-impersonating-id\"));\n const adminUserId = Number(impersonateDetails.getAttribute(\"data-impersonator-id\"));\n const sessionExpired = data.admin_user_id === adminUserId && ((data.action === \"start\" && data.user_id !== userId) || (data.action === \"stop\" && data.user_id === userId));\n\n if (sessionExpired) {\n impersonateDetails.setAttribute(\"data-impersonating-id\", \"\"); // block any double or re-impersonate attempts\n // Slight timeout so we don't flash the modal while the user is waiting for admin to load.\n setTimeout(() => {\n modal.dispatchEvent(new CustomEvent(\"open\"));\n }, 2000);\n }\n }\n },\n});\n","// Load all the channels within this directory and all subdirectories.\n// Channel files must be named *_channel.js.\n\nconst channels = require.context(\".\", true, /_channel\\.js$/);\nchannels.keys().forEach(channels);\n","import consumer from \"../admin_channels/consumer\";\n\nlet callback;\n\nconst subscribe = (expenseId, callback) => {\n consumer.subscriptions.create({ channel: \"ReceiptScanningChannel\", expense_id: expenseId }, {\n connected() {\n // Called when the subscription is ready for use on the server\n },\n\n disconnected() {\n // Called when the subscription has been terminated by the server\n },\n\n received(data) {\n // Called when there's incoming data on the websocket for this channel\n if (callback) callback.call(null, data);\n },\n });\n};\n\nexport { subscribe };\n"],"names":["map","webpackContext","req","id","webpackContextResolve","__webpack_require__","o","e","Error","code","keys","Object","resolve","module","exports","createConsumer","r","require","forEach","subscribe","filingObligationId","callback","consumer","subscriptions","create","channel","filing_obligation_id","connected","$","rails","ajax","type","dataType","url","Routes","filing_obligation_prefill_summaries_path","disconnected","received","data","call","modal","document","getElementById","modalElement","createElement","body","appendChild","remove","impersonateDetails","userId","Number","getAttribute","adminUserId","admin_user_id","action","user_id","setAttribute","setTimeout","dispatchEvent","CustomEvent","channels","expenseId","expense_id"],"sourceRoot":""}