File: /var/www/html/demo.sumarbc.com.py/mod/hvp/amd/build/embed.min.js.map
{"version":3,"file":"embed.min.js","sources":["../src/embed.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 <http://www.gnu.org/licenses/>.\n/* eslint-disable no-undef, no-console, no-unused-vars, max-len */\ndefine(['jquery', 'mod_hvp/communicator'], function($, H5PEmbedCommunicator) {\n\n // Wait for instances to be initialize.\n $(document).ready(function() {\n $('.h5p-iframe').ready(function() {\n initEmbedCommunicator = function() {\n var resizeDelay;\n var instance = H5P.instances[0];\n var parentIsFriendly = false;\n\n // Handle that the resizer is loaded after the iframe.\n H5PEmbedCommunicator.on('ready', function() {\n H5PEmbedCommunicator.send('hello');\n });\n\n // Handle hello message from our parent window.\n H5PEmbedCommunicator.on('hello', function() {\n // Initial setup/handshake is done.\n parentIsFriendly = true;\n\n // Hide scrollbars for correct size.\n iFrame.contentDocument.body.style.overflow = 'hidden';\n\n document.body.classList.add('h5p-resizing');\n\n // Content need to be resized to fit the new iframe size.\n H5P.trigger(instance, 'resize');\n });\n\n // When resize has been prepared tell parent window to resize.\n H5PEmbedCommunicator.on('resizePrepared', function() {\n H5PEmbedCommunicator.send('resize', {\n scrollHeight: iFrame.contentDocument.body.scrollHeight\n });\n });\n\n H5PEmbedCommunicator.on('resize', function() {\n H5P.trigger(instance, 'resize');\n });\n\n H5P.on(instance, 'resize', function() {\n if (H5P.isFullscreen) {\n return; // Skip iframe resize.\n }\n\n // Use a delay to make sure iframe is resized to the correct size.\n clearTimeout(resizeDelay);\n resizeDelay = setTimeout(function() {\n // Only resize if the iframe can be resized.\n if (parentIsFriendly) {\n H5PEmbedCommunicator.send('prepareResize',\n {\n scrollHeight: iFrame.contentDocument.body.scrollHeight,\n clientHeight: iFrame.contentDocument.body.clientHeight\n }\n );\n } else {\n H5PEmbedCommunicator.send('hello');\n }\n }, 0);\n });\n\n // Trigger initial resize for instance.\n H5P.trigger(instance, 'resize');\n };\n var iFrame = document.querySelector('.h5p-iframe');\n var H5P = iFrame.contentWindow.H5P;\n // Check for H5P instances.\n if (!H5P || !H5P.instances || !H5P.instances[0]) {\n console.warn(\"H5P embed.js: ACK! Embedded H5P.instances[0] in lowest iframe is not set up yet. Waiting for 'initialized' event\");\n window.H5P.externalDispatcher.on('initialized', function(event) {\n console.log(\"H5P embed.js: 'initialized' event received\");\n H5P = iFrame.contentWindow.H5P;\n initEmbedCommunicator();\n });\n } else {\n initEmbedCommunicator();\n }\n });\n });\n\n});"],"names":["define","$","H5PEmbedCommunicator","document","ready","initEmbedCommunicator","resizeDelay","instance","H5P","instances","parentIsFriendly","on","send","iFrame","contentDocument","body","style","overflow","classList","add","trigger","scrollHeight","isFullscreen","clearTimeout","setTimeout","clientHeight","querySelector","contentWindow","console","warn","window","externalDispatcher","event","log"],"mappings":"AAeAA,uBAAO,CAAC,SAAU,yBAAyB,SAASC,EAAGC,sBAGnDD,EAAEE,UAAUC,OAAM,WACdH,EAAE,eAAeG,OAAM,WACnBC,sBAAwB,eAChBC,YACAC,SAAWC,IAAIC,UAAU,GACzBC,kBAAmB,EAGvBR,qBAAqBS,GAAG,SAAS,WAC7BT,qBAAqBU,KAAK,YAI9BV,qBAAqBS,GAAG,SAAS,WAE7BD,kBAAmB,EAGnBG,OAAOC,gBAAgBC,KAAKC,MAAMC,SAAW,SAE7Cd,SAASY,KAAKG,UAAUC,IAAI,gBAG5BX,IAAIY,QAAQb,SAAU,aAI1BL,qBAAqBS,GAAG,kBAAkB,WACtCT,qBAAqBU,KAAK,SAAU,CAChCS,aAAcR,OAAOC,gBAAgBC,KAAKM,kBAIlDnB,qBAAqBS,GAAG,UAAU,WAC9BH,IAAIY,QAAQb,SAAU,aAG1BC,IAAIG,GAAGJ,SAAU,UAAU,WACnBC,IAAIc,eAKRC,aAAajB,aACbA,YAAckB,YAAW,WAEjBd,iBACAR,qBAAqBU,KAAK,gBACtB,CACIS,aAAcR,OAAOC,gBAAgBC,KAAKM,aAC1CI,aAAcZ,OAAOC,gBAAgBC,KAAKU,eAIlDvB,qBAAqBU,KAAK,WAE/B,OAIPJ,IAAIY,QAAQb,SAAU,eAEtBM,OAASV,SAASuB,cAAc,eAChClB,IAAMK,OAAOc,cAAcnB,IAE1BA,KAAQA,IAAIC,WAAcD,IAAIC,UAAU,GAQzCJ,yBAPAuB,QAAQC,KAAK,oHACbC,OAAOtB,IAAIuB,mBAAmBpB,GAAG,eAAe,SAASqB,OACrDJ,QAAQK,IAAI,8CACZzB,IAAMK,OAAOc,cAAcnB,IAC3BH"}