{"version":3,"sources":["../controller/DeliveryTool/launchQueue.js","../controller/routes.js","module-create.js"],"names":[],"mappings":"AAmBA,MAAA,CAAA,yDAAA,CAAA,CACA,QADA,CAEA,QAFA,CAGA,cAHA,CAIA,cAJA,CAAA,CAKA,SAAA,CAAA,CAAA,MAAA,CAAA,OAAA,CAAA,OAAA,CAAA,CACA,aAEA,GAAA,CAAA,cAAA,CAAA,CACA,gBAAA,CAAA,EADA,CAAA,CAOA,MAAA,CACA,KADA,iBACA,oBACA,MAAA,CAAA,MAAA,EADA,sCACA,cADA,CACA,cADA,gCACA,EADA,kCAEA,CAAA,CAAA,QAAA,CAAA,cAAA,CAAA,cAAA,CAFA,CAEA,gBAFA,YAEA,gBAFA,CAEA,gBAFA,YAEA,gBAFA,CAEA,MAFA,YAEA,MAFA,CAIA,OAAA,CAAA,CACA,MAAA,CAAA,iBAAA,CACA,GAAA,CAAA,KAAA,CAAA,KAAA,KAAA,EAAA,CAEA,OAAA,CAAA,CACA,GAAA,CAAA,gBADA,CAEA,MAAA,CAAA,KAFA,CAGA,QAAA,CAAA,MAHA,CAIA,OAAA,GAJA,CAAA,CAAA,CAMA,IANA,CAMA,cAAA,IAAA,CAAA,MAAA,MAAA,MAAA,CACA,CAAA,EAAA,MADA,EAEA,KAAA,CAAA,MAAA,EAFA,CAGA,MAAA,CAAA,QAAA,CAAA,MAHA,EAKA,KAAA,CAAA,OAAA,EAEA,CAbA,EAcA,KAdA,CAcA,UAAA,CACA,KAAA,CAAA,OAAA,EACA,CAhBA,CAiBA,CArBA,CAsBA,QAAA,CAAA,GAAA,CAAA,gBAtBA,CAuBA,SAAA,GAvBA,CAAA,CAyBA,CA9BA,CAgCA,CA/CA,C,CCnBA,MAAA,CAAA,uCAAA,CAAA,CACA,aAAA,CACA,QAAA,CACA,YAAA,qCADA,CADA,CADA,CAAA,C,CCCA,MAAA,CAAA,uDAAA,CAAA,UAAA,CAAA,CAAA,C","sourcesContent":["/**\n * This program is free software; you can redistribute it and/or\n * modify it under the terms of the GNU General Public License\n * as published by the Free Software Foundation; under version 2\n * of the License (non-upgradable).\n *\n * This program 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 this program; if not, write to the Free Software\n * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.\n *\n * Copyright (c) 2017 (original work) Open Assessment Technologies SA;\n *\n */\n\ndefine('ltiDeliveryProvider/controller/DeliveryTool/launchQueue',[\n 'lodash',\n 'module',\n 'core/polling',\n 'core/request',\n], function (_, module, polling, request) {\n 'use strict';\n\n const _defaultConfig = {\n relaunchInterval: 30,\n };\n\n /**\n * @exports\n */\n return {\n start() {\n const { relaunchConfig = {} } = module.config();\n const { capacityCheckUrl, relaunchInterval, runUrl } = _.defaults(relaunchConfig, _defaultConfig);\n\n polling({\n action: function () {\n const async = this.async();\n\n request({\n url: capacityCheckUrl,\n method: 'GET',\n dataType: 'json',\n noToken: true,\n })\n .then(({ status }) => {\n if (status == 1) {\n async.reject();\n window.location = runUrl;\n } else {\n async.resolve();\n }\n })\n .catch(() => {\n async.resolve();\n });\n },\n interval: relaunchInterval * 1000,\n autoStart: true,\n });\n }\n };\n});\n\n","define('ltiDeliveryProvider/controller/routes',{\n 'DeliveryTool' : {\n 'actions' : {\n 'launchQueue' : 'controller/DeliveryTool/launchQueue'\n }\n }\n});\n\n","\ndefine(\"ltiDeliveryProvider/loader/ltiDeliveryProvider.bundle\", function(){});\n"]}