{"version":3,"sources":["webpack:///webpack/universalModuleDefinition?5ca6**","webpack:///vam.js","webpack:///webpack/bootstrap d2e6d101cbf3a7438b3b?3a5c**","webpack:///./src/index.js?9552*","webpack:///./src/check-dependencies.js?a335*","webpack:///./src/constants.js?a228*","webpack:///./package.json?70ff*","webpack:///./src/dfp-pixel.js?e7e0*","webpack:///./src/application.js?6b89*","webpack:///./src/mixins/evented.js?eb2a*","webpack:///./src/mixins/deferred.js?4cae*","webpack:///./src/publicidad.js?c0c1*","webpack:///./src/header-bidding/provider-manager.js?0c90*","webpack:///./src/header-bidding/providers/amazon.js?ae69*","webpack:///./src/utils.js?2ff8*","webpack:///./src/header-bidding/providers/prebid.js?1595*","webpack:///./src/header-bidding/config-manager.js?531b*"],"names":["root","factory","exports","module","define","amd","this","modules","__webpack_require__","moduleId","installedModules","id","loaded","call","m","c","p","_interopRequireDefault","obj","__esModule","default","_legacyInit","window","Vocento","Publicidad","prototype","init","jQuery","configGDPMedio","configGDP","_init","printAds","datos","esJSON","arguments","length","undefined","_publicidad2","getOasSitepage","apply","getSizesGoogle","getValueUser","_initialized","Error","_printAds","_application2","on","event","context$","configGDPMedioReload","configGDPReload","data","params","JSON","parse","$","each","Object","defineProperty","value","VERSION","_package","_package2","_constants","_application","_publicidad","_utils","_window","document","ready","config","lookup","CONFIG_NAMESPACE","media","options","version","_typeof","Symbol","iterator","constructor","Cookies","RSVP","special","inview","NEW_SUFFIX","OLD_PREFIX","AMAZON_CONFIG","DEFAULT_AMAZON_LOAD_TIMEOUT","AMAZON_URL","DEFAULT_PREBID_LOAD_TIMEOUT","PREBID_URL","HEADER_BIDDING_READY","NOMBRE_FORMATO_JSON","JSON_GDP2_2","JSON_GDP2_1","JSON_GDP2_0","VAM_CSS_URL","MCRYPT_KEY","MCRYPT_URL","RIJNDAEL_URL","CAPTURADOR_WS","DEFAULTS","SLOT_INACTIVE","SLOT_VIEWABLE","SLOT_EMPTY","SLOT_RENDERED","POSITION_FLUID","ALTOS_MINIMOS_DISPOSITIVOS","TIMEOUT_POSICIONES_ESTANDAR","GPT_TIMEOUT","GPT_READY","GPT_ID_VOCENTO","EDITIONS_NAMESPACE","DEFAULT_LOG_TEMPLATE","SHOW_LOGS","PROMISES_PROPERTY","NAMESPACE","ENV_PREFIX_PRE","location","search","indexOf","mobile","tablet","desktop","hideNoAds","refresh","responsive","ENV_PREFIX_DES","url","defaultUrl","prefix","hostname","pubID","adServer","name","description","main","scripts","test","start","prebid","build","contributors","license","devDependencies","babel-core","babel-eslint","babel-loader","babel-polyfill","babel-preset-es2015","chai","chalk","css-loader","eslint","eslint-config-airbnb-base","eslint-plugin-import","extract-text-webpack-plugin","html-webpack-plugin","json-loader","mocha","mocha-loader","mocha-phantomjs","style-loader","webpack","webpack-shell-plugin","dependencies","prebid.js","jquery-inview","js-cookie","rsvp","_ord","Math","random","_onVocUserReady","gigyaux","getUserType","UserTypes","ANONYMOUS","append","Voonto","when","VOCUSER_DATA","then","userData","gender","age","responseGetUserInfo","user","_onVocUserData","gigya_event","profile","Genders","FEM","MAS","freeze","VOCUSER_READY","gigyaUX","_extend","source","_this","keys","forEach","key","_evented","_evented2","_deferred","_deferred2","app","getInstance","Evented","preventExtensions","_window$$","one","_window$$2","off","_window$$3","trigger","_console","_window$$4","console","log","concat","Array","slice","_createGlobal","namespace","nso","split","prop","_slicedToArray","sliceIterator","arr","i","_arr","_n","_d","_e","_s","_i","next","done","push","err","isArray","TypeError","DEFAULT_TIMEOUT","_defers","_hasOwnProperty","hasOwnProperty","Deferred","whenUntil","promiseNS","time","Promise","resolve","reject","setTimeout","owner","global","_promiseNS$split","_promiseNS$split2","promise","defer","promised","_promiseNS$split3","_promiseNS$split4","_classCallCheck","instance","Constructor","_getTipoDispositivo","cTipoDispositivo","esResponsive","screen_width","parseInt","top","innerWidth","clave","valor","resolucionMaxima","resolucionMinima","maximo","minimo","cTempTipo","replace","toLowerCase","tipoDispositivo","_getParameterByName","paramName","href","regex","RegExp","results","exec","decodeURIComponent","_loadjscssfile","filename","required","filetype","fileref","createElement","setAttribute","xhrObj","XMLHttpRequest","open","send","text","responseText","getElementsByTagName","appendChild","_processConfigGDPMedio","_configManager2","processConfig","_deviceType","_dynamicId","_createClass","defineProperties","target","props","descriptor","enumerable","configurable","writable","protoProps","staticProps","_providerManager","_providerManager2","_configManager","prioritizedPositions","prevEncryptedCode","prevUnencryptedCode","capturadorDataPreview","checkConfigFromURL","medio","getMedio","listaEstandardDelayed","gpt_inicializado","listaPosicionesInsertadas","listaIdsInsertados","tipoPagina","getTipoPagina","tipoFormatoJSON","getTipoFormatoJSON","activo","showWarn","showLog","valueUserType","esMedioResponsive","isResponsiveMedia","notDisplayedSlots","cargaLibreriaGPT","googletag","cmd","pubads","collapseEmptyDivs","enableKrux","Krux","vocento","segments","setTargeting","singleRequest","enableSingleRequest","syncRendering","enableSyncRendering","enableServices","comprobamosExcepciones","hayPriorizadas","listaPriorizadas","listaArrayPriorizadas","completadasPriorizadas","hayRetrasadas","eval","listaRetrasadas","targetings","getTargetingsConfig","addEventListener","ev","div_id","slot","getSlotElementId","position","getTargeting","container$","paramsSlot","isEmpty","infoSlot","infoSlotRender","post_callback","post_event","index","inArray","splice","esPriorizada","displayDelayed","pintaPriorizadas","xpath","idAds","offset","extend","serverType","getServerType","outOfPage","defineSlot","getDefineSlotParam","pre_callback","pre_event","oas","tags","existePosEnConfigGDPMedio","getIdDiv","attr","getResponsiveParam","scriptText","legacyCmvkey","size_dc","targetingsTags","hideText","targetingText","tag","cadenaTipoDispositivo","decryptedURL","decryptURL","pattern","esValida","targetingsURL","targetingsURL_decoded","targetingsURL_trozos","clave_y_valor","trozo_clave","trozo_valor","e","topics","getTopics","enableTpag","objetoMapping","sizeMapping","defineSizeMapping","getSizeMapping","definicion","script","getNombreSlot","getClavePosicionInsertada","idDiv","display","oasSitepage","legacyAdUnit","trim","contieneMacroEdicion","cadenaEdicion","getEdition","startsWith","endsWith","OAS","adunit","add_size_p","responsive_p","viewportSize","responsive_ad","j","singleSize","userType","valueUser","arrayUsers","suscriptor","trial","registrado","anonimo","dispositivo","size","dimensiones","posiciones","tipo","tiposPublicidad","getTipoPaginaABC","getTipoPaginaMujerhoy","getTipoPaginaPortalesLocales","reVideosAntiguos","reVideos","esVideo","pathname","reGaleriasAntiguos2","reGaleriasAntiguos","reGalerias","esGaleria","reGraficos","esGrafico","reNoticiasAntiguos","reNoticias","esNoticia","reVideosOld","reVideosBlogs","reGaleriasOld","reGaleriasBlogs","reNoticiasBlogs","reNoticiasRecetas","reNoticiasOld","reGraficosOld","reVideochats","esVideochat","configGDPAux","excepciones","match","unix","round","Date","fechaini","fecha_in","fechafin","fecha_fin","targetingsMedio","targetingsPagina","lista","adsId","dynamicId","sonPosicionesPriorizadas","pintaListaPosiciones","listaPositions","posCuyoDivExiste","isActive","normalizaParams","stringify","showError","setTargetings","tieneParamResponsive","createResponsive","dispositivos","anchoMinimo","anchoMaximo","dimension","encontrado","valorAncho","existe","hide","forceActivePosition","tipoDispositivoAux","desactivadoen","programaciones","objProgramaciones","objProgramacion","programacion","fechaActual","encontrada","fechaInicioProgramacion","fechaFinProgramacion","isInView","getAdGoogle","preview","capturadorExistsPreview","capturadorSetPreview","priorized","retrasada","esRetrasada","pintarRetrasada","getAdMeta","esPosPriorizada","eventParams","getEventsPosition","tParams","hasPreevent","pintarPosicionRefresh","positionEvents","legacyCode","hbPrebid","hbAmazon","capturadorGetPreviewData","priorizadas","retrasadas","decodeURI","gads","async","type","useSSL","protocol","src","node","parentNode","insertBefore","editions","current","isSlotRendered","width","height","empty","dim","arrayObj","show","addClass","html","infoSlotFormateaDimensiones","isLocalPosition","infoSlotRenderSlots","infoSlotRenderTopics","infoSlotRenderOAS","numSlots","numTopics","numOas","max","resultado","arrayDimensiones","aux","listaDimensionesNoRepetidas","Set","resolucion","substring","add","forzarEnableTopics","enableTopics","voc_top","includes","legacyPreview","ajax","success","result","previewJSON","div","creatividad","previewUrl","iv","mcrypt","Decrypt","atob","_loadActivesGateways","_gatewaysAdded","GATEWAYS","gateway","NAME","getLoadPromise","_amazon","_amazon2","_prebid","_prebid2","_gatewaysPromises","all","catch","reason","_loadLibrary","load","REASONS","ERROR_LOAD_LIBRARY","_setConfig","apstag","error","ERROR_INIT_CONFIG","_fetchBid","bidConfig","slots","timeout","fetchBids","bids","TIMEOUT_REACHED_FETCH_BIDS","adserverRequestResponse","a9","a","q","r","_Q","setDisplayBids","targetingKeys","TIMEOUT_REACHED_GLOBAL","_ref","_ref2","reduce","that","o","shift","_scripts","onload","onerror","head","_console2","warn","_console3","UserType","REGISTERED","SUBSCRIBER","TRIAL","_vocUid","get","_cookie","__VOONTO__","paywall","pwUserType","pop","uid","headerBidding","biddersConfig","pbjsConfig","debug","enableSendAllBids","priceGranularity","buckets","precision","min","increment","pbjs","bidderSettings","_fetchBiddersSettings","setConfig","getConfig","adUnits","que","addAdUnits","requestBids","bidsBackHandler","biddersResponse","bidderName","bidCpmAdjustment","bidCpm","bid","percent","bidderCode","getAdserverTargeting","setTargetingForGPTAsync","_processPrebidConfig","device","property","newConfig","map","code","_processAmazonConfig","_this2","slotID","slotName","_getAmazonSlotName","_tipoDispositivo"],"mappings":"CAAA,SAAAA,EAAAC,GACA,gBAAAC,UAAA,gBAAAC,QACAA,OAAAD,QAAAD,IACA,kBAAAG,gBAAAC,IACAD,UAAAH,GACA,gBAAAC,SACAA,QAAA,WAAAD,IAEAD,EAAA,WAAAC,KACCK,KAAA,WACD,MCAgB,UAAUC,GCN1B,QAAAC,GAAAC,GAGA,GAAAC,EAAAD,GACA,MAAAC,GAAAD,GAAAP,OAGA,IAAAC,GAAAO,EAAAD,IACAP,WACAS,GAAAF,EACAG,QAAA,EAUA,OANAL,GAAAE,GAAAI,KAAAV,EAAAD,QAAAC,IAAAD,QAAAM,GAGAL,EAAAS,QAAA,EAGAT,EAAAD,QAvBA,GAAAQ,KAqCA,OATAF,GAAAM,EAAAP,EAGAC,EAAAO,EAAAL,EAGAF,EAAAQ,EAAA,GAGAR,EAA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B1Z","file":"vam.js","sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"AdsManager\"] = factory();\n\telse\n\t\troot[\"AdsManager\"] = factory();\n})(this, function() {\nreturn \n\n\n// WEBPACK FOOTER //\n// webpack/universalModuleDefinition","(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"AdsManager\"] = factory();\n\telse\n\t\troot[\"AdsManager\"] = factory();\n})(this, function() {\nreturn /******/ (function(modules) { // webpackBootstrap\n/******/ \t// The module cache\n/******/ \tvar installedModules = {};\n/******/\n/******/ \t// The require function\n/******/ \tfunction __webpack_require__(moduleId) {\n/******/\n/******/ \t\t// Check if module is in cache\n/******/ \t\tif(installedModules[moduleId])\n/******/ \t\t\treturn installedModules[moduleId].exports;\n/******/\n/******/ \t\t// Create a new module (and put it into the cache)\n/******/ \t\tvar module = installedModules[moduleId] = {\n/******/ \t\t\texports: {},\n/******/ \t\t\tid: moduleId,\n/******/ \t\t\tloaded: false\n/******/ \t\t};\n/******/\n/******/ \t\t// Execute the module function\n/******/ \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n/******/\n/******/ \t\t// Flag the module as loaded\n/******/ \t\tmodule.loaded = true;\n/******/\n/******/ \t\t// Return the exports of the module\n/******/ \t\treturn module.exports;\n/******/ \t}\n/******/\n/******/\n/******/ \t// expose the modules object (__webpack_modules__)\n/******/ \t__webpack_require__.m = modules;\n/******/\n/******/ \t// expose the module cache\n/******/ \t__webpack_require__.c = installedModules;\n/******/\n/******/ \t// __webpack_public_path__\n/******/ \t__webpack_require__.p = \"\";\n/******/\n/******/ \t// Load entry module and return exports\n/******/ \treturn __webpack_require__(0);\n/******/ })\n/************************************************************************/\n/******/ ([\n/* 0 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\tmodule.exports = __webpack_require__(10);\n\n\n/***/ }),\n/* 1 */,\n/* 2 */,\n/* 3 */,\n/* 4 */,\n/* 5 */,\n/* 6 */,\n/* 7 */,\n/* 8 */,\n/* 9 */,\n/* 10 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\texports.VERSION = undefined;\n\t\n\t__webpack_require__(11);\n\t\n\t__webpack_require__(14);\n\t\n\tvar _package = __webpack_require__(13);\n\t\n\tvar _package2 = _interopRequireDefault(_package);\n\t\n\tvar _constants = __webpack_require__(12);\n\t\n\tvar _application = __webpack_require__(15);\n\t\n\tvar _application2 = _interopRequireDefault(_application);\n\t\n\tvar _publicidad = __webpack_require__(18);\n\t\n\tvar _publicidad2 = _interopRequireDefault(_publicidad);\n\t\n\tvar _utils = __webpack_require__(21);\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\t\n\tvar _window = window,\n\t $ = _window.$;\n\t\n\tvar _initialized = false;\n\t\n\t_legacyInit();\n\t$(document).ready(function () {\n\t var config = (0, _utils.lookup)(_constants.CONFIG_NAMESPACE);\n\t _init(config.media, config.options);\n\t});\n\t\n\tvar VERSION = exports.VERSION = _package2.default.version;\n\t\n\t/* Private */\n\t\n\tfunction _legacyInit() {\n\t window.Vocento = window.Vocento || {};\n\t window.Vocento.Publicidad = function () {};\n\t window.Vocento.Publicidad.prototype.init = function (jQuery, configGDPMedio, configGDP) {\n\t _init(configGDPMedio, configGDP);\n\t };\n\t window.Vocento.Publicidad.prototype.printAds = function (datos) {\n\t var esJSON = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;\n\t\n\t return _publicidad2.default.printAds(datos, esJSON);\n\t };\n\t window.Vocento.Publicidad.prototype.getOasSitepage = function () {\n\t return _publicidad2.default.getOasSitepage.apply(_publicidad2.default, arguments);\n\t };\n\t window.Vocento.Publicidad.prototype.getSizesGoogle = function () {\n\t return _publicidad2.default.getSizesGoogle.apply(_publicidad2.default, arguments);\n\t };\n\t window.Vocento.Publicidad.prototype.getValueUser = function () {\n\t return _publicidad2.default.getValueUser.apply(_publicidad2.default, arguments);\n\t };\n\t}\n\t\n\tfunction _init(configGDPMedio, configGDP) {\n\t if (_initialized) {\n\t return;\n\t }\n\t\n\t if (!configGDPMedio || !configGDP) {\n\t throw Error('[Ads Manager] missing configuration');\n\t }\n\t\n\t _initialized = true;\n\t _publicidad2.default.init(configGDPMedio, configGDP);\n\t _printAds();\n\t\n\t _application2.default.on('voonto:reload', function (event, context$, configGDPMedioReload, configGDPReload) {\n\t _publicidad2.default.init(configGDPMedioReload, configGDPReload, context$);\n\t _printAds(context$);\n\t });\n\t _application2.default.on('vam:refresh', function (event, data) {\n\t // NOTE: refresh the ads position received on 'data' parameter\n\t var params = typeof data === 'string' ? JSON.parse(data) : data;\n\t _publicidad2.default.printAds(params);\n\t });\n\t}\n\t\n\tfunction _printAds(context$) {\n\t $('[data-voc-vam]', context$).each(function () {\n\t _publicidad2.default.printAds($(this));\n\t });\n\t}\n\n/***/ }),\n/* 11 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tvar _typeof = typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; };\n\t\n\tvar _constants = __webpack_require__(12);\n\t\n\t// NOTE: jQuery checking\n\tif (!('$' in window) || typeof window.$ !== 'function') {\n\t throw Error(_constants.DEFAULT_LOG_TEMPLATE + ' missing jQuery library on page');\n\t}\n\t\n\t// NOTE: Cookies checking\n\tif (!('Cookies' in window) || typeof window.Cookies !== 'function') {\n\t throw Error(_constants.DEFAULT_LOG_TEMPLATE + ' missing Cookies library on page');\n\t}\n\t\n\t// NOTE: RSVP checking\n\tif (!('RSVP' in window) || _typeof(window.RSVP) !== 'object') {\n\t throw Error(_constants.DEFAULT_LOG_TEMPLATE + ' missing RSVP library on page');\n\t}\n\t\n\t// NOTE: InView jQuery Plugin checking\n\tif (!('event' in window.$) || !('special' in window.$.event) || !('inview' in window.$.event.special) || _typeof(window.$.event.special.inview) !== 'object') {\n\t throw Error(_constants.DEFAULT_LOG_TEMPLATE + ' missing InView jQuery plugin on page');\n\t}\n\n/***/ }),\n/* 12 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\texports.NEW_SUFFIX = exports.OLD_PREFIX = exports.AMAZON_CONFIG = exports.DEFAULT_AMAZON_LOAD_TIMEOUT = exports.AMAZON_URL = exports.DEFAULT_PREBID_LOAD_TIMEOUT = exports.PREBID_URL = exports.HEADER_BIDDING_READY = exports.NOMBRE_FORMATO_JSON = exports.JSON_GDP2_2 = exports.JSON_GDP2_1 = exports.JSON_GDP2_0 = exports.VAM_CSS_URL = exports.MCRYPT_KEY = exports.MCRYPT_URL = exports.RIJNDAEL_URL = exports.CAPTURADOR_WS = exports.DEFAULTS = exports.SLOT_INACTIVE = exports.SLOT_VIEWABLE = exports.SLOT_EMPTY = exports.SLOT_RENDERED = exports.POSITION_FLUID = exports.ALTOS_MINIMOS_DISPOSITIVOS = exports.TIMEOUT_POSICIONES_ESTANDAR = exports.GPT_TIMEOUT = exports.GPT_READY = exports.GPT_ID_VOCENTO = exports.EDITIONS_NAMESPACE = exports.CONFIG_NAMESPACE = exports.DEFAULT_LOG_TEMPLATE = exports.SHOW_LOGS = exports.PROMISES_PROPERTY = exports.NAMESPACE = undefined;\n\t\n\tvar _package = __webpack_require__(13);\n\t\n\tvar _package2 = _interopRequireDefault(_package);\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\t\n\tvar NAMESPACE = exports.NAMESPACE = 'vocento';\n\tvar PROMISES_PROPERTY = exports.PROMISES_PROPERTY = '__PROMISES__';\n\tvar SHOW_LOGS = exports.SHOW_LOGS = document.location.search.indexOf('vam_debug=1') > -1 || document.location.search.indexOf('gdp_debug=1') > -1;\n\tvar DEFAULT_LOG_TEMPLATE = exports.DEFAULT_LOG_TEMPLATE = '[Ads Manager]';\n\tvar CONFIG_NAMESPACE = exports.CONFIG_NAMESPACE = 'vocento.config.vam';\n\tvar EDITIONS_NAMESPACE = exports.EDITIONS_NAMESPACE = 'vocento.site.editions';\n\tvar GPT_ID_VOCENTO = exports.GPT_ID_VOCENTO = '4900';\n\tvar GPT_READY = exports.GPT_READY = 'vam:gpt:ready';\n\tvar GPT_TIMEOUT = exports.GPT_TIMEOUT = 2000;\n\tvar TIMEOUT_POSICIONES_ESTANDAR = exports.TIMEOUT_POSICIONES_ESTANDAR = 3000;\n\tvar ALTOS_MINIMOS_DISPOSITIVOS = exports.ALTOS_MINIMOS_DISPOSITIVOS = {\n\t mobile: 0,\n\t tablet: 200,\n\t desktop: 300\n\t};\n\tvar POSITION_FLUID = exports.POSITION_FLUID = \"'fluid'\";\n\tvar SLOT_RENDERED = exports.SLOT_RENDERED = 'vam:slotrendered';\n\tvar SLOT_EMPTY = exports.SLOT_EMPTY = 'vam:isempty';\n\tvar SLOT_VIEWABLE = exports.SLOT_VIEWABLE = 'vam:viewable';\n\tvar SLOT_INACTIVE = exports.SLOT_INACTIVE = 'vam:inactive';\n\tvar DEFAULTS = exports.DEFAULTS = {\n\t hideNoAds: true,\n\t refresh: false,\n\t responsive: false\n\t};\n\tvar CAPTURADOR_WS = exports.CAPTURADOR_WS = '//publi.cmvocento.com/capturador/preview';\n\tvar RIJNDAEL_URL = exports.RIJNDAEL_URL = '//netssl.vocento.com/cmvocento/js/rijndael.js';\n\tvar MCRYPT_URL = exports.MCRYPT_URL = '//netssl.vocento.com/cmvocento/js/mcrypt.js';\n\tvar MCRYPT_KEY = exports.MCRYPT_KEY = 'acsNdl09acs72AEdacsNdl09acs72AEd';\n\tvar VAM_CSS_URL = exports.VAM_CSS_URL = '//netssl.vocento.com/cmvocento/css/vam.css';\n\tvar JSON_GDP2_0 = exports.JSON_GDP2_0 = 0;\n\tvar JSON_GDP2_1 = exports.JSON_GDP2_1 = 1;\n\tvar JSON_GDP2_2 = exports.JSON_GDP2_2 = 2;\n\tvar NOMBRE_FORMATO_JSON = exports.NOMBRE_FORMATO_JSON = ['GDP2.0', 'GDP2.1', 'GDP2.2+'];\n\t\n\t/* header bidding */\n\tvar HEADER_BIDDING_READY = exports.HEADER_BIDDING_READY = 'vam:headerbidding:ready';\n\tvar ENV_PREFIX_PRE = 'pre-';\n\tvar ENV_PREFIX_DES = 'des-';\n\tvar PREBID_URL = exports.PREBID_URL = function IIFE() {\n\t var url, defaultUrl, prefix;\n\t\n\t defaultUrl = 'prebid.js';\n\t if (document.location.hostname === 'localhost') return defaultUrl;\n\t\n\t url = 'static.vocento.com/vam/' + _package2.default.version + '/' + defaultUrl;\n\t prefix = (document.location.hostname.indexOf(ENV_PREFIX_PRE) === 0 ? ENV_PREFIX_PRE : null) || (document.location.hostname.indexOf(ENV_PREFIX_DES) === 0 ? ENV_PREFIX_DES : '');\n\t\n\t return '//' + prefix + url;\n\t}();\n\tvar DEFAULT_PREBID_LOAD_TIMEOUT = exports.DEFAULT_PREBID_LOAD_TIMEOUT = 7000;\n\tvar AMAZON_URL = exports.AMAZON_URL = '//c.amazon-adsystem.com/aax2/apstag.js';\n\tvar DEFAULT_AMAZON_LOAD_TIMEOUT = exports.DEFAULT_AMAZON_LOAD_TIMEOUT = 7000;\n\tvar AMAZON_CONFIG = exports.AMAZON_CONFIG = {\n\t pubID: '3470', // Amazon publisher ID\n\t adServer: 'googletag' // AdServer type that contains apstag line-items\n\t};\n\t\n\t/* legacy */\n\tvar OLD_PREFIX = exports.OLD_PREFIX = 'publi_';\n\tvar NEW_SUFFIX = exports.NEW_SUFFIX = '-id';\n\n/***/ }),\n/* 13 */\n/***/ (function(module, exports) {\n\n\tmodule.exports = {\n\t\t\"name\": \"vam\",\n\t\t\"version\": \"3.6.9-0\",\n\t\t\"description\": \"\",\n\t\t\"main\": \"src/index.js\",\n\t\t\"scripts\": {\n\t\t\t\"test\": \"./node_modules/.bin/webpack && ./node_modules/.bin/mocha-phantomjs dist/spec/index.html --reporter xunit --file test-results.xml\",\n\t\t\t\"start\": \"webpack-dev-server --content-base dist/\",\n\t\t\t\"prebid\": \"cd ./node_modules/prebid.js && npm install && \\\"./node_modules/.bin/gulp\\\" build --modules=../../src/header-bidding/prebid-modules.json && cp build/dist/prebid.js ../../dist & cd ../..\",\n\t\t\t\"build\": \"./node_modules/.bin/webpack\"\n\t\t},\n\t\t\"contributors\": [\n\t\t\t\"Jose Manuel Ortega \",\n\t\t\t\"Ernesto V. \",\n\t\t\t\"Iván Pérez \"\n\t\t],\n\t\t\"license\": \"SEE LICENSE IN LICENSE.md\",\n\t\t\"devDependencies\": {\n\t\t\t\"babel-core\": \"^6.17.0\",\n\t\t\t\"babel-eslint\": \"^8.0.1\",\n\t\t\t\"babel-loader\": \"^6.2.5\",\n\t\t\t\"babel-polyfill\": \"^6.16.0\",\n\t\t\t\"babel-preset-es2015\": \"^6.16.0\",\n\t\t\t\"chai\": \"^3.5.0\",\n\t\t\t\"chalk\": \"^1.1.3\",\n\t\t\t\"css-loader\": \"^0.28.4\",\n\t\t\t\"eslint\": \"^4.7.2\",\n\t\t\t\"eslint-config-airbnb-base\": \"^12.0.1\",\n\t\t\t\"eslint-plugin-import\": \"^2.7.0\",\n\t\t\t\"extract-text-webpack-plugin\": \"^1.0.1\",\n\t\t\t\"html-webpack-plugin\": \"^2.24.1\",\n\t\t\t\"json-loader\": \"^0.5.4\",\n\t\t\t\"mocha\": \"^3.1.0\",\n\t\t\t\"mocha-loader\": \"^1.0.0\",\n\t\t\t\"mocha-phantomjs\": \"^4.1.0\",\n\t\t\t\"style-loader\": \"^0.18.2\",\n\t\t\t\"webpack\": \"^1.13.3\",\n\t\t\t\"webpack-shell-plugin\": \"^0.4.3\"\n\t\t},\n\t\t\"dependencies\": {\n\t\t\t\"prebid.js\": \"^0.29.0\",\n\t\t\t\"jquery-inview\": \"^1.1.2\",\n\t\t\t\"js-cookie\": \"^2.1.4\",\n\t\t\t\"rsvp\": \"^3.5.0\"\n\t\t}\n\t};\n\n/***/ }),\n/* 14 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tvar _application = __webpack_require__(15);\n\t\n\tvar _application2 = _interopRequireDefault(_application);\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\t\n\tvar UserTypes = Object.freeze({\n\t ANONYMOUS: 'anonimo'\n\t}),\n\t Genders = Object.freeze({\n\t FEM: 'f',\n\t MAS: 'm'\n\t}),\n\t VOCUSER_READY = 'vocuser:ready',\n\t VOCUSER_DATA = 'vocuser:userdata';\n\t\n\t$(document).ready(function () {\n\t _application2.default.when(VOCUSER_READY).then(_onVocUserReady);\n\t $('body').on('vocento.gigya.products.onReady', function (event, gigyaux) {\n\t var gigyaUX;\n\t\n\t gigyaUX = gigyaux || window.gigyaUX;\n\t if (gigyaUX) {\n\t _onVocUserReady(gigyaUX);\n\t }\n\t });\n\t});\n\t\n\t/* Private */\n\t\n\tfunction _ord() {\n\t return Math.random() * 10000000000000;\n\t}\n\t\n\tfunction _onVocUserReady(gigyaux) {\n\t if (gigyaux.getUserType() === UserTypes.ANONYMOUS) {\n\t $('head').append('');\n\t } else {\n\t $('head').append('');\n\t if (typeof Voonto !== 'undefined') {\n\t _application2.default.when(VOCUSER_DATA).then(function (userData) {\n\t var gender, age;\n\t\n\t // NOTE: vocUserData promise object\n\t if (userData.responseGetUserInfo) {\n\t gender = userData.responseGetUserInfo.user && userData.responseGetUserInfo.user.gender ? userData.responseGetUserInfo.user.gender : null;\n\t age = userData.responseGetUserInfo.user && userData.responseGetUserInfo.user.age ? userData.responseGetUserInfo.user.age : null;\n\t }\n\t _onVocUserData(gender, age);\n\t });\n\t } else {\n\t $('body').on('vocento.gigya.accounts.onDataReady', function (event) {\n\t var gender, age;\n\t\n\t // NOTE: vocUserData promise object\n\t if (event.gigya_event) {\n\t gender = event.gigya_event.profile && event.gigya_event.profile.gender ? event.gigya_event.profile.gender : null;\n\t age = event.gigya_event.profile && event.gigya_event.profile.age ? event.gigya_event.profile.age : null;\n\t }\n\t _onVocUserData(gender, age);\n\t });\n\t }\n\t }\n\t}\n\t\n\tfunction _onVocUserData(gender, age) {\n\t switch (gender) {\n\t case Genders.FEM:\n\t $('head').append('');\n\t break;\n\t case Genders.MAS:\n\t $('head').append('');\n\t break;\n\t }\n\t\n\t switch (true) {\n\t case '' !== age && 17 >= age:\n\t $('head').append('');\n\t break;\n\t case 18 <= age && 24 >= age:\n\t $('head').append('');\n\t break;\n\t case 25 <= age && 34 >= age:\n\t $('head').append('');\n\t break;\n\t case 35 <= age && 44 >= age:\n\t $('head').append('');\n\t break;\n\t case 45 <= age && 54 >= age:\n\t $('head').append('');\n\t break;\n\t case '' !== age && 54 > age:\n\t $('head').append('');\n\t break;\n\t }\n\t}\n\n/***/ }),\n/* 15 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\t\n\tvar _evented = __webpack_require__(16);\n\t\n\tvar _evented2 = _interopRequireDefault(_evented);\n\t\n\tvar _deferred = __webpack_require__(17);\n\t\n\tvar _deferred2 = _interopRequireDefault(_deferred);\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\t\n\tvar app = {};\n\t\n\t_extend.call(app, _evented2.default);\n\t_extend.call(app, _deferred2.default);\n\t\n\texports.default = 'Voonto' in window ? Voonto.getInstance() : app;\n\t\n\t/* Private */\n\t\n\tfunction _extend(source) {\n\t var _this = this;\n\t\n\t Object.keys(source).forEach(function (key) {\n\t _this[key] = source[key];\n\t });\n\t\n\t return this;\n\t}\n\n/***/ }),\n/* 16 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\t\n\tvar _constants = __webpack_require__(12);\n\t\n\tvar Evented = Object.preventExtensions({\n\t on: function on() {\n\t var _window$$;\n\t\n\t (_window$$ = window.$(this)).on.apply(_window$$, arguments);\n\t },\n\t one: function one() {\n\t var _window$$2;\n\t\n\t (_window$$2 = window.$(this)).one.apply(_window$$2, arguments);\n\t },\n\t off: function off() {\n\t var _window$$3;\n\t\n\t (_window$$3 = window.$(this)).off.apply(_window$$3, arguments);\n\t },\n\t trigger: function trigger() {\n\t var _console, _window$$4;\n\t\n\t _constants.SHOW_LOGS && (_console = console).log.apply(_console, [_constants.DEFAULT_LOG_TEMPLATE, 'Evented::trigger'].concat(Array.prototype.slice.call(arguments)));\n\t (_window$$4 = window.$(this)).trigger.apply(_window$$4, arguments);\n\t }\n\t});\n\t\n\texports.default = Evented;\n\n/***/ }),\n/* 17 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\t\n\tvar _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i[\"return\"]) _i[\"return\"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError(\"Invalid attempt to destructure non-iterable instance\"); } }; }();\n\t\n\tvar _constants = __webpack_require__(12);\n\t\n\tvar _window = window,\n\t RSVP = _window.RSVP,\n\t DEFAULT_TIMEOUT = 2000,\n\t _defers = {},\n\t _hasOwnProperty = Object.prototype.hasOwnProperty;\n\t\n\t\n\tvar Deferred = Object.preventExtensions({\n\t whenUntil: function whenUntil(promiseNS) {\n\t var _this = this;\n\t\n\t var time = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : DEFAULT_TIMEOUT;\n\t\n\t _constants.SHOW_LOGS && console.log(_constants.DEFAULT_LOG_TEMPLATE, '[Deferred] whenUntil', { promiseNS: promiseNS, time: time });\n\t return new RSVP.Promise(function (resolve, reject) {\n\t setTimeout(reject, time);\n\t _this.when(promiseNS, resolve);\n\t });\n\t },\n\t when: function when(promiseNS) {\n\t var owner, name, global;\n\t\n\t _constants.SHOW_LOGS && console.log(_constants.DEFAULT_LOG_TEMPLATE, '[Deferred] when', promiseNS);\n\t\n\t if (!promiseNS) {\n\t throw Error(_constants.DEFAULT_LOG_TEMPLATE + ' [Deferred] At least 1 argument needed. 0 passed.');\n\t }\n\t\n\t var _promiseNS$split = promiseNS.split(':');\n\t\n\t var _promiseNS$split2 = _slicedToArray(_promiseNS$split, 2);\n\t\n\t owner = _promiseNS$split2[0];\n\t name = _promiseNS$split2[1];\n\t\n\t if (!owner || !name) {\n\t throw Error(_constants.DEFAULT_LOG_TEMPLATE + ' [Deferred] Illegal promise namespace name. Expected \"owner:name\".');\n\t }\n\t\n\t if (_hasOwnProperty.call(_defers, promiseNS)) {\n\t return _defers[promiseNS].promise;\n\t }\n\t\n\t global = _createGlobal(_constants.NAMESPACE + '.' + owner + '.' + _constants.PROMISES_PROPERTY);\n\t global[name] = RSVP.defer();\n\t _defers[promiseNS] = global[name];\n\t\n\t return global[name].promise;\n\t },\n\t promised: function promised(promiseNS, value) {\n\t var owner, name, global;\n\t\n\t _constants.SHOW_LOGS && console.log(_constants.DEFAULT_LOG_TEMPLATE, '[Deferred] promised', { promiseNS: promiseNS, value: value });\n\t\n\t if (!promiseNS) {\n\t throw Error(_constants.DEFAULT_LOG_TEMPLATE + ' [Deferred] At least 1 argument needed. 0 passed.');\n\t }\n\t\n\t var _promiseNS$split3 = promiseNS.split(':');\n\t\n\t var _promiseNS$split4 = _slicedToArray(_promiseNS$split3, 2);\n\t\n\t owner = _promiseNS$split4[0];\n\t name = _promiseNS$split4[1];\n\t\n\t if (!owner || !name) {\n\t throw Error(_constants.DEFAULT_LOG_TEMPLATE + ' [Deferred] Illegal promise namespace name. Expected \"owner:name\".');\n\t }\n\t\n\t if (_hasOwnProperty.call(_defers, promiseNS)) {\n\t _defers[promiseNS].resolve(value);\n\t return this;\n\t }\n\t\n\t global = _createGlobal(_constants.NAMESPACE + '.' + owner + '.' + _constants.PROMISES_PROPERTY);\n\t global[name] = RSVP.defer();\n\t global[name].resolve(value);\n\t _defers[promiseNS] = global[name];\n\t\n\t return this;\n\t }\n\t});\n\t\n\texports.default = Deferred;\n\t\n\t/* Private */\n\t\n\tfunction _createGlobal(namespace) {\n\t var nso = window;\n\t\n\t if (!namespace) {\n\t return nso;\n\t }\n\t\n\t namespace.split('.').forEach(function (prop) {\n\t nso[prop] = nso[prop] || {};\n\t nso = nso[prop];\n\t });\n\t\n\t return nso;\n\t}\n\n/***/ }),\n/* 18 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\t\n\tvar _typeof = typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; };\n\t\n\tvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\t\n\tvar _package = __webpack_require__(13);\n\t\n\tvar _providerManager = __webpack_require__(19);\n\t\n\tvar _providerManager2 = _interopRequireDefault(_providerManager);\n\t\n\tvar _application = __webpack_require__(15);\n\t\n\tvar _application2 = _interopRequireDefault(_application);\n\t\n\tvar _configManager = __webpack_require__(23);\n\t\n\tvar _configManager2 = _interopRequireDefault(_configManager);\n\t\n\tvar _utils = __webpack_require__(21);\n\t\n\tvar _constants = __webpack_require__(12);\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\t\n\tfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\t\n\tvar _dynamicId = -1,\n\t _deviceType = 'desktop';\n\t\n\tvar Publicidad = function () {\n\t function Publicidad() {\n\t _classCallCheck(this, Publicidad);\n\t }\n\t\n\t _createClass(Publicidad, [{\n\t key: 'version',\n\t\n\t\n\t /**\n\t * Version de la libreria\n\t */\n\t value: function version() {\n\t return _package.version;\n\t }\n\t\n\t /**\n\t * Funcion que busca el medio en el que nos encontramos, dentro del fichero de configuracion\n\t * @return string\n\t */\n\t\n\t }], [{\n\t key: 'init',\n\t\n\t /**\n\t *\n\t * @param {object} app - Evented object\n\t * @param {object} configGDPMedio\n\t * @param {object} configGDP\n\t * @param {context} context$\n\t */\n\t value: function init(configGDPMedio, configGDP, context$) {\n\t var prioritizedPositions;\n\t\n\t _dynamicId += 1;\n\t Publicidad.context$ = context$;\n\t // Inicializacion de variables de instancia estaticas\n\t Publicidad.configGDPMedio = configGDPMedio;\n\t Publicidad.configGDP = configGDP;\n\t Publicidad.prevEncryptedCode = '';\n\t Publicidad.prevUnencryptedCode = '';\n\t Publicidad.capturadorDataPreview = '';\n\t\n\t // Detectamos si se fuerza via URL alguna configuracion\n\t Publicidad.checkConfigFromURL();\n\t\n\t Publicidad.medio = Publicidad.getMedio();\n\t Publicidad.listaEstandardDelayed = [];\n\t Publicidad.gpt_inicializado = false;\n\t Publicidad.listaPosicionesInsertadas = {};\n\t Publicidad.listaIdsInsertados = [];\n\t _deviceType = _getTipoDispositivo();\n\t Publicidad.tipoPagina = Publicidad.getTipoPagina();\n\t Publicidad.tipoFormatoJSON = Publicidad.getTipoFormatoJSON();\n\t\n\t if (Publicidad.tipoFormatoJSON >= _constants.JSON_GDP2_2 && !Publicidad.configGDPMedio.activo) {\n\t (0, _utils.showWarn)('La publicidad ha sido desactivada en la configuracion del medio!');\n\t return;\n\t }\n\t (0, _utils.showLog)('En constructor. tipoDispositivo: ' + _deviceType + ' , tipoPagina: ' + Publicidad.tipoPagina + ' , formatoJSON: ' + _constants.NOMBRE_FORMATO_JSON[Publicidad.tipoFormatoJSON] + ' (Version ' + _package.version + ')');\n\t Publicidad.valueUserType = null;\n\t Publicidad.esMedioResponsive = Publicidad.isResponsiveMedia();\n\t Publicidad.notDisplayedSlots = [];\n\t\n\t // Cargamos las librerias de HeaderBidding y GPT lo antes posible (para no penalizar la visibilidad de la publicidad).\n\t (0, _utils.showLog)('En constructor. HeaderBidding:init');\n\t _processConfigGDPMedio.call(Publicidad);\n\t _providerManager2.default.init(Publicidad.configGDPMedio);\n\t Publicidad.cargaLibreriaGPT();\n\t\n\t // Inicializacion de la libreria GPT\n\t googletag.cmd.push(function () {\n\t googletag.pubads().collapseEmptyDivs();\n\t if (typeof Publicidad.configGDPMedio.enableKrux != \"undefined\" && Publicidad.configGDPMedio.enableKrux && typeof Krux != \"undefined\" && typeof Krux.vocento != \"undefined\" && typeof Krux.vocento.segments != \"undefined\" && typeof Krux.vocento.user != \"undefined\") {\n\t googletag.pubads().setTargeting('ksg', Krux.vocento.segments);\n\t googletag.pubads().setTargeting('kuid', Krux.vocento.user);\n\t }\n\t if (Publicidad.configGDPMedio.singleRequest) googletag.pubads().enableSingleRequest();\n\t if (Publicidad.configGDPMedio.syncRendering) googletag.pubads().enableSyncRendering();\n\t googletag.enableServices();\n\t\n\t // Disparamos el evento de GPT inicializada\n\t (0, _utils.showLog)('En constructor. Disparamos evento ' + _constants.GPT_READY);\n\t _application2.default.trigger(_constants.GPT_READY);\n\t Publicidad.gpt_inicializado = true;\n\t });\n\t\n\t // Disparamos el evento de GPT inicializado tras N segundos para liberar posibles recursos que esten bloqueados\n\t setTimeout(function () {\n\t if (!Publicidad.gpt_inicializado) {\n\t (0, _utils.showWarn)('En constructor. Disparamos evento ' + _constants.GPT_READY + ' tras timeout');\n\t _application2.default.trigger(_constants.GPT_READY);\n\t }\n\t }, _constants.GPT_TIMEOUT);\n\t\n\t // Tratamiento de excepciones\n\t Publicidad.configGDP = Publicidad.comprobamosExcepciones();\n\t\n\t // Gestion de posiciones priorizadas\n\t prioritizedPositions = (0, _utils.lookup)('priorizadas.' + _deviceType + '.listaPosiciones', Publicidad.configGDP);\n\t Publicidad.hayPriorizadas = prioritizedPositions.length || false;\n\t Publicidad.listaPriorizadas = Publicidad.hayPriorizadas ? prioritizedPositions : '';\n\t Publicidad.listaArrayPriorizadas = Publicidad.listaPriorizadas.split(',');\n\t Publicidad.hayPriorizadas && (0, _utils.showLog)('En constructor. Hay posiciones priorizadas: ' + Publicidad.listaPriorizadas);\n\t Publicidad.completadasPriorizadas = false;\n\t\n\t // Gestion de posiciones retrasadas\n\t Publicidad.hayRetrasadas = eval('Publicidad.configGDP.retrasadas.' + _deviceType) !== undefined && eval('Publicidad.configGDP.retrasadas.' + _deviceType + '.listaPosiciones') !== undefined ? true : false;\n\t Publicidad.listaRetrasadas = Publicidad.hayRetrasadas ? eval('Publicidad.configGDP.retrasadas.' + _deviceType + '.listaPosiciones') : '';\n\t if (Publicidad.hayRetrasadas) (0, _utils.showLog)('En constructor. Hay posiciones retrasadas: ' + Publicidad.listaRetrasadas);\n\t\n\t // Tratamiento de targetings\n\t Publicidad.targetings = Publicidad.getTargetingsConfig();\n\t\n\t // Gestion de eventos de pintado de publicidad\n\t googletag.cmd.push(function () {\n\t // Gestion de evento slotRenderEnded\n\t googletag.pubads().addEventListener('slotRenderEnded', function (ev) {\n\t var div_id = ev.slot.getSlotElementId();\n\t var position = ev.slot.getTargeting('pos');\n\t var container$ = $(\"#\" + div_id);\n\t var paramsSlot = container$.data(\"params\");\n\t\n\t if (ev.isEmpty) {\n\t (0, _utils.showLog)('En constructor. slotRenderEnded. La posicion ' + position + ' isEmpty');\n\t container$.trigger(_constants.SLOT_EMPTY);\n\t if (Publicidad.configGDPMedio.infoSlot) Publicidad.infoSlotRender(paramsSlot, false);\n\t } else {\n\t (0, _utils.showLog)('En constructor. slotRenderEnded. La posicion ' + position + ' ha sido pintada en el DIV ' + div_id);\n\t container$.trigger(_constants.SLOT_RENDERED);\n\t if (Publicidad.configGDPMedio.infoSlot) Publicidad.infoSlotRender(paramsSlot, true);\n\t }\n\t\n\t // Comprobacion si tiene eventos post_callback o post_event\n\t if (paramsSlot) {\n\t if (paramsSlot.post_callback) {\n\t (0, _utils.showLog)('En constructor. slotRenderEnded. La posicion ' + position + ' tiene el siguiente postCallback: ' + paramsSlot.post_callback);\n\t paramsSlot.post_callback();\n\t }\n\t\n\t if (paramsSlot.post_event) {\n\t (0, _utils.showLog)('En constructor. slotRenderEnded. La posicion ' + position + ' tiene el siguiente postEvent: ' + paramsSlot.post_event);\n\t _application2.default.trigger(paramsSlot.post_event);\n\t }\n\t }\n\t\n\t // Quitamos la posicion de la lista de posiciones priorizadas\n\t var index = $.inArray(position[0], Publicidad.listaArrayPriorizadas);\n\t if (index != -1) {\n\t Publicidad.listaArrayPriorizadas.splice(index, 1);\n\t }\n\t\n\t // Quitamos la posicion de la lista de posiciones estandar encoladas\n\t if (Publicidad.hayPriorizadas && Publicidad.listaEstandardDelayed.length > 0 && !Publicidad.esPriorizada(paramsSlot)) {\n\t index = $.inArray(position[0], Publicidad.listaEstandardDelayed);\n\t if (index != -1) {\n\t Publicidad.listaEstandardDelayed.splice(index, 1);\n\t }\n\t }\n\t\n\t // Si esta era la ultima priorizada pintamos las estandar\n\t if (!Publicidad.completadasPriorizadas && Publicidad.listaArrayPriorizadas.length === 0) {\n\t Publicidad.completadasPriorizadas = true;\n\t Publicidad.displayDelayed();\n\t }\n\t });\n\t\n\t // Gestion de evento impressionViewable\n\t googletag.pubads().addEventListener('impressionViewable', function (ev) {\n\t var div_id = ev.slot.getSlotElementId();\n\t var position = ev.slot.getTargeting('pos');\n\t var container$ = $(\"#\" + div_id);\n\t var paramsSlot = container$.data(\"params\");\n\t\n\t (0, _utils.showLog)('En constructor. impressionViewable. La posicion ' + position + ' es visible');\n\t container$.trigger(_constants.SLOT_VIEWABLE);\n\t });\n\t });\n\t\n\t // Si hay posiciones priorizadas las pintamos e invocamos el pintado de las estandar una vez pintadas estas\n\t if (Publicidad.hayPriorizadas) {\n\t Publicidad.pintaPriorizadas(Publicidad.listaPriorizadas);\n\t\n\t // Si han transcurrido N segundos y todavia no se han lanzado las posiciones estandar las forzamos\n\t setTimeout(function () {\n\t if (Publicidad.listaEstandardDelayed.length > 0) {\n\t Publicidad.completadasPriorizadas = true;\n\t Publicidad.displayDelayed();\n\t }\n\t }, _constants.TIMEOUT_POSICIONES_ESTANDAR);\n\t }\n\t\n\t return this;\n\t }\n\t\n\t /**\n\t * Normalizacion de parametros\n\t */\n\t\n\t }, {\n\t key: 'normalizaParams',\n\t value: function normalizaParams(datos) {\n\t var params, xpath, idAds, offset;\n\t\n\t params = {};\n\t // Distinguimos entre si recibimos un objeto DOM(jQuery) o bien un objeto JSON\n\t if (datos instanceof $) {\n\t $.extend(params, _constants.DEFAULTS, {\n\t position: datos.data('voc-vam-position') || null,\n\t serverType: datos.data('voc-vam-servertype') || Publicidad.getServerType(params),\n\t hideNoAds: datos.data('voc-vam-hidenoads'),\n\t outOfPage: datos.data('voc-vam-outofpage'),\n\t defineSlot: datos.data('voc-vam-defineslot') || Publicidad.getDefineSlotParam(),\n\t refresh: datos.data('voc-vam-refresh'),\n\t responsive: datos.data('voc-vam-responsive'),\n\t pre_callback: datos.data('voc-vam-precallback') || '',\n\t pre_event: datos.data('voc-vam-preevent') || '',\n\t post_callback: datos.data('voc-vam-postcallback') || '',\n\t post_event: datos.data('voc-vam-postevent') || '',\n\t oas: datos.data('voc-vam-oas') || '',\n\t tags: datos.data('voc-vam-tags')\n\t });\n\t } else {\n\t $.extend(params, _constants.DEFAULTS, {\n\t position: datos.position || null,\n\t id: datos.id || null,\n\t serverType: datos.serverType || Publicidad.getServerType(params),\n\t hideNoAds: datos.hideNoAds,\n\t outOfPage: datos.outOfPage,\n\t defineSlot: datos.defineSlot || Publicidad.getDefineSlotParam(),\n\t refresh: datos.refresh,\n\t responsive: datos.responsive,\n\t pre_callback: datos.pre_callback || '',\n\t pre_event: datos.pre_event || '',\n\t post_callback: datos.post_callback || '',\n\t post_event: datos.post_event || '',\n\t oas: datos.oas || '',\n\t tags: datos.tags\n\t });\n\t }\n\t\n\t // Si falta algun parametro obligatorio devolvemos null\n\t if (params.position === null) {\n\t (0, _utils.showWarn)('ERROR: El parametro position es obligatorio');\n\t return null;\n\t }\n\t\n\t if (!Publicidad.existePosEnConfigGDPMedio(params.position)) {\n\t (0, _utils.showWarn)('ERROR: La posicion ' + params.position + ' no existe en configGDPMedio');\n\t return null;\n\t }\n\t\n\t // Tratamiento del parametro OutOfPage\n\t if (typeof params.outOfPage !== 'boolean') {\n\t // Valor por defecto\n\t params.outOfPage = false;\n\t if (Publicidad.tipoFormatoJSON >= _constants.JSON_GDP2_2) {\n\t xpath = (0, _utils.lookup)('configGDPMedio.posicion_' + _deviceType + '.' + params.position + '.outofpage', Publicidad);\n\t params.outOfPage = typeof xpath !== 'boolean' ? false : xpath;\n\t }\n\t }\n\t\n\t // DIV que contendra la publicidad\n\t idAds = Publicidad.getIdDiv(params);\n\t if (!$('#' + idAds).length && $('[data-voc-vam-position = \\'' + params.position + '\\']', Publicidad.context$).length && typeof $('[data-voc-vam-position = \\'' + params.position + '\\']', Publicidad.context$).attr('id') === 'undefined') {\n\t $('[data-voc-vam-position = \\'' + params.position + '\\']', Publicidad.context$).attr('id', idAds);\n\t }\n\t params.id = idAds;\n\t\n\t // Lectura de targetings globales por posicion\n\t if (!params.tags) {\n\t params.tags = {};\n\t if (Publicidad.tipoFormatoJSON >= _constants.JSON_GDP2_2) {\n\t params.tags = (0, _utils.lookup)('configGDPMedio.posicion_' + _deviceType + '.' + params.position + '.targetings', Publicidad) || {};\n\t }\n\t }\n\t\n\t // Comprobamos si tiene offset por posicion\n\t offset = (0, _utils.lookup)('configGDP.posicion_' + _deviceType + '.' + params.position + '.offset', Publicidad);\n\t if (offset && (typeof offset === 'undefined' ? 'undefined' : _typeof(offset)) !== 'object') {\n\t $('#' + params.id).attr('data-offset', offset);\n\t (0, _utils.showLog)('Offset: ' + offset + ' configurado para la posici\\xF3n: ' + params.position);\n\t }\n\t\n\t // Construimos el parametro responsive en caso de que no venga relleno en la propia llamada\n\t if (!params.outOfPage && !params.responsive && Publicidad.esMedioResponsive) params.responsive = Publicidad.getResponsiveParam(params);\n\t\n\t return params;\n\t }\n\t\n\t /**\n\t * Funcion que genera el scriptText que pinta la publicidad.\n\t * @param object params\n\t * @return string\n\t */\n\t\n\t }, {\n\t key: 'defineSlot',\n\t value: function defineSlot(params) {\n\t var scriptText, legacyCmvkey;\n\t var size_dc = Publicidad.getSizesGoogle(params.position);\n\t var idAds = Publicidad.getIdDiv(params);\n\t var targetingsTags = {};\n\t\n\t // Codigo para ocultar el div si no hay publi\n\t var hideText = params.hideNoAds ? '.setCollapseEmptyDiv(true)' : '';\n\t\n\t // Codigo para anadir tags en el caso que la posicion de publi lo necesite\n\t var targetingText = '';\n\t if (params.tags) {\n\t // si llegan en la funcion ads.print\n\t targetingsTags = params.tags;\n\t }\n\t\n\t var tag;\n\t for (tag in targetingsTags) {\n\t targetingText += '.setTargeting(\"' + tag + '\", \"' + targetingsTags[tag] + '\")';\n\t }\n\t for (tag in Publicidad.targetings) {\n\t targetingText += '.setTargeting(\"' + tag + '\", \"' + Publicidad.targetings[tag] + '\")';\n\t }\n\t\n\t // Targeting con tipo de usuario de Gigya\n\t if (Publicidad.valueUserType === null) Publicidad.valueUserType = Publicidad.getValueUser((0, _utils.getUserType)());\n\t var cadenaTipoDispositivo = _deviceType == 'mobile' ? 'm' : 'w';\n\t targetingText += '.setTargeting(\\'st\\', \\'' + Publicidad.valueUserType + '\\').setTargeting(\\'stt\\', \\'' + cadenaTipoDispositivo + Publicidad.valueUserType + '\\')';\n\t\n\t // Se comprueba si se fuerza algun targeting via URL con el parametro vam_cmvkey\n\t var decryptedURL = Publicidad.decryptURL();\n\t if (typeof top.location !== 'undefined' && (top.location.href.indexOf('vam_cmvkey=') > -1 || top.location.href.indexOf('cmvkey=') > -1) || decryptedURL !== '') {\n\t legacyCmvkey = top.location.href.indexOf('vam_cmvkey=') > -1 ? 'vam_cmvkey' : 'cmvkey';\n\t var pattern = new RegExp('(\\\\?|&)' + legacyCmvkey + '=([^?&]+)');\n\t var esValida = decryptedURL !== '' ? pattern.exec(decryptedURL) : pattern.exec(top.location.href);\n\t\n\t if (esValida) {\n\t var targetingsURL = esValida[2];\n\t\n\t try {\n\t var targetingsURL_decoded = decodeURIComponent(targetingsURL);\n\t var targetingsURL_trozos = targetingsURL_decoded.split(',');\n\t\n\t for (var i = 0; i < targetingsURL_trozos.length; i++) {\n\t var clave_y_valor = targetingsURL_trozos[i].split(\"=\");\n\t\n\t var trozo_clave = clave_y_valor[0];\n\t var trozo_valor = clave_y_valor[1];\n\t targetingText += '.setTargeting(\"' + trozo_clave + '\", \"' + trozo_valor + '\")';\n\t }\n\t } catch (e) {\n\t (0, _utils.showWarn)('ERROR en defineSlot procesando ' + legacyCmvkey + ': ' + e);\n\t }\n\t }\n\t }\n\t\n\t // Incluimos los topics como targeting si asi corresponde\n\t try {\n\t var topics = Publicidad.getTopics(false);\n\t if (topics.length > 0) {\n\t targetingText += '.setTargeting(\"topics\", \"' + topics + '\")';\n\t }\n\t } catch (e) {\n\t (0, _utils.showWarn)('ERROR en defineSlot procesando enableTopics: ' + e);\n\t }\n\t\n\t // Se comprueba si enableTpag esta habilitado\n\t try {\n\t if (typeof Publicidad.configGDPMedio != \"undefined\" && typeof Publicidad.configGDPMedio.enableTpag != \"undefined\" && Publicidad.configGDPMedio.enableTpag) {\n\t targetingText += '.setTargeting(\"tpag\", \"' + Publicidad.tipoPagina + '\")';\n\t }\n\t } catch (e) {\n\t (0, _utils.showWarn)('ERROR en defineSlot procesando tpag: ' + e);\n\t }\n\t\n\t // Comprobaciones para medios responsives\n\t var objetoMapping = {};\n\t var sizeMapping = '';\n\t var defineSizeMapping = '';\n\t if (!params.outOfPage && params.responsive && $.isArray(params.responsive) && params.responsive.length > 0) {\n\t objetoMapping = Publicidad.getSizeMapping(params);\n\t sizeMapping = typeof objetoMapping !== 'undefined' && typeof objetoMapping.definicion !== 'undefined' ? objetoMapping.definicion : '';\n\t defineSizeMapping = typeof objetoMapping !== 'undefined' && typeof objetoMapping.script !== 'undefined' ? objetoMapping.script : '';\n\t }\n\t\n\t if (!params.outOfPage) {\n\t if (params.defineSlot) {\n\t scriptText = '' + sizeMapping + Publicidad.getNombreSlot(params) + ' = googletag.defineSlot(\\'' + Publicidad.getOasSitepage(params) + '\\', ' + size_dc + ', \\'' + idAds + '\\')' + defineSizeMapping + '.setTargeting(\\'pos\\',\\'' + params.position + '\\')' + targetingText + hideText + '.addService(googletag.pubads());';\n\t }\n\t } else if (params.defineSlot) {\n\t scriptText = '' + sizeMapping + Publicidad.getNombreSlot(params) + ' = googletag.defineOutOfPageSlot(\\'' + Publicidad.getOasSitepage(params) + '\\', \\'' + idAds + '\\')' + defineSizeMapping + '.setTargeting(\\'pos\\',\\'' + params.position + '\\')' + targetingText + hideText + '.addService(googletag.pubads());';\n\t }\n\t\n\t googletag.cmd.push(function () {\n\t eval(scriptText);\n\t Publicidad.notDisplayedSlots.push(params.position);\n\t (0, _utils.showLog)('En defineSlot. defineSlot: ' + scriptText);\n\t\n\t var key = Publicidad.getClavePosicionInsertada(params);\n\t Publicidad.listaPosicionesInsertadas[key] = scriptText;\n\t Publicidad.listaIdsInsertados.push(idAds);\n\t });\n\t\n\t return scriptText;\n\t }\n\t\n\t /**\n\t * Hace display de una posicion\n\t */\n\t\n\t }, {\n\t key: 'display',\n\t value: function display(params) {\n\t // Comprobamos si la posicion esta en la lista de posiciones definidas y pendientes de display\n\t var index = $.inArray(params.position, Publicidad.notDisplayedSlots);\n\t if (index != -1) {\n\t var idDiv = Publicidad.getIdDiv(params);\n\t if ($('#' + idDiv).length) {\n\t googletag.cmd.push(function () {\n\t googletag.display(idDiv);\n\t\n\t // Si singleRequest esta habilitado un unico display sirve para todas las posiciones para las que hemos hecho defineSlot previamente. En caso contrario solo quitamos la posicion concreta de la lista\n\t if (Publicidad.configGDPMedio.singleRequest) {\n\t Publicidad.notDisplayedSlots.length = 0;\n\t } else {\n\t Publicidad.notDisplayedSlots.splice(index, 1);\n\t }\n\t });\n\t } else {\n\t (0, _utils.showWarn)('En display. ERROR: El DIV con ID ' + idDiv + ' no existe');\n\t }\n\t }\n\t }\n\t\n\t /**\n\t * Funcion que obtiene el valor de oas del fichero de configuracion.\n\t * @return string\n\t */\n\t\n\t }, {\n\t key: 'getOasSitepage',\n\t value: function getOasSitepage(params) {\n\t var oasSitepage, legacyAdUnit;\n\t params = params || {};\n\t\n\t if (typeof params.oas != \"undefined\" && params.oas !== '') {\n\t oasSitepage = params.oas;\n\t } else {\n\t oasSitepage = typeof eval('Publicidad.configGDP.OAS.' + _deviceType + '.' + Publicidad.tipoPagina) != \"undefined\" ? eval('Publicidad.configGDP.OAS.' + _deviceType + '.' + Publicidad.tipoPagina) : '';\n\t }\n\t\n\t oasSitepage = oasSitepage.trim();\n\t\n\t // Comprobamos si se fuerza un adunit por defecto via URL\n\t try {\n\t var decryptedURL = Publicidad.decryptURL();\n\t if (typeof top.location !== 'undefined' && (top.location.href.indexOf('vam_adUnit=') > -1 || top.location.href.indexOf('adunit=') > -1) || decryptedURL !== '') {\n\t legacyAdUnit = top.location.href.indexOf('vam_adUnit=') > -1 ? 'vam_adUnit' : 'adunit';\n\t var pattern = new RegExp('(\\\\?|&)' + legacyAdUnit + '=([^?&]+)');\n\t var esValida = decryptedURL !== '' ? pattern.exec(decryptedURL) : pattern.exec(top.location.href);\n\t\n\t if (esValida) {\n\t oasSitepage = esValida[2].indexOf('/' + _constants.GPT_ID_VOCENTO + '/') != -1 ? esValida[2] : '/' + _constants.GPT_ID_VOCENTO + '/' + esValida[2];\n\t }\n\t }\n\t } catch (err) {}\n\t\n\t // Comprobamos si tiene alguna macro\n\t try {\n\t var _pattern = /{(\\/)?edicion(\\/)?}/;\n\t var contieneMacroEdicion = _pattern.exec(oasSitepage);\n\t if (contieneMacroEdicion) {\n\t // Lectura de la edicion del medio\n\t var cadenaEdicion = Publicidad.getEdition();\n\t\n\t if (contieneMacroEdicion[0].startsWith('{\\/') && cadenaEdicion !== '') cadenaEdicion = \"\\/\" + cadenaEdicion;\n\t if (contieneMacroEdicion[0].endsWith('\\/}') && cadenaEdicion !== '') cadenaEdicion += \"\\/\";\n\t\n\t oasSitepage = oasSitepage.replace(contieneMacroEdicion[0], cadenaEdicion);\n\t }\n\t } catch (err) {}\n\t\n\t // Guardamos el valor del adunit calculado por si no lo esta\n\t if (typeof Publicidad.configGDP.OAS.adunit === 'undefined') Publicidad.configGDP.OAS.adunit = oasSitepage;\n\t\n\t return oasSitepage;\n\t }\n\t\n\t /**\n\t * Funcion que obtiene las medidas en caso de que sea responsive.\n\t * @param object responsive\n\t * @return string sizeMapping\n\t */\n\t\n\t }, {\n\t key: 'getSizeMapping',\n\t value: function getSizeMapping(params) {\n\t var objetoMapping = {\n\t definicion: '',\n\t script: ''\n\t };\n\t\n\t // @var responsive \n\t objetoMapping.definicion = 'var mapping = googletag.sizeMapping()';\n\t var responsive = params.responsive;\n\t\n\t for (var i = 0; i < responsive.length; i++) {\n\t var add_size_p = '';\n\t // @var responsive_p Pair viewportSize, slotSize\n\t var responsive_p = responsive[i];\n\t\n\t if (responsive_p.length === 2) {\n\t // @var viewportSize \n\t var viewportSize = responsive_p[0];\n\t // @var responsive_ad \n\t var responsive_ad = responsive_p[1];\n\t if (typeof responsive_ad === 'string') {\n\t if (responsive_ad.indexOf('fluid') !== -1) {\n\t responsive_ad = _constants.POSITION_FLUID;\n\t } else {\n\t responsive_ad = Publicidad.getSizesGoogle(responsive_ad);\n\t if (typeof responsive_ad !== 'undefined' && typeof responsive_ad === 'string') responsive_ad = JSON.parse(responsive_ad);\n\t }\n\t }\n\t if ($.isArray(viewportSize) && viewportSize.length === 2 && ($.isArray(responsive_ad) || responsive_ad === _constants.POSITION_FLUID)) {\n\t add_size_p = '[' + viewportSize[0] + ',' + viewportSize[1] + '],';\n\t if (responsive_ad.length > 0 && $.isArray(responsive_ad[0])) {\n\t // @var responsive_ad \n\t add_size_p += '[';\n\t for (var j = 0; j < responsive_ad.length; j++) {\n\t // @var singleSize \n\t var singleSize = responsive_ad[j];\n\t if (singleSize.length === 2) {\n\t add_size_p += (j === 0 ? '[' : ',[') + singleSize[0] + ',' + singleSize[1] + ']';\n\t }\n\t }\n\t add_size_p += ']';\n\t } else if (responsive_ad.length === 2) {\n\t // @var responsive_ad \n\t add_size_p += '[' + responsive_ad[0] + ',' + responsive_ad[1] + ']';\n\t } else if (responsive_ad === _constants.POSITION_FLUID) {\n\t add_size_p += _constants.POSITION_FLUID;\n\t } else {\n\t add_size_p += '[]';\n\t }\n\t objetoMapping.definicion += '.addSize(' + add_size_p + ')';\n\t } else {\n\t (0, _utils.showWarn)('ERROR En getSizeMapping: Parametro responsive malformado en posicion ' + params.position + '. responsive: ' + responsive);\n\t return;\n\t }\n\t } else {\n\t (0, _utils.showWarn)('ERROR En getSizeMapping: Parametro responsive malformado en posicion ' + params.position + '. responsive: ' + responsive);\n\t return;\n\t }\n\t }\n\t\n\t objetoMapping.definicion += '.build();';\n\t objetoMapping.script = '.defineSizeMapping(mapping)';\n\t\n\t return objetoMapping;\n\t }\n\t\n\t /**\n\t * Convierte el tipo de usuario de Gigya (en formato adaptado para publicidad)\n\t */\n\t\n\t }, {\n\t key: 'getValueUser',\n\t value: function getValueUser(userType) {\n\t var valueUser = \"a\";\n\t\n\t if (typeof userType == 'undefined' || userType === null) userType = (0, _utils.getUserType)();\n\t\n\t var arrayUsers = {\n\t suscriptor: \"s\",\n\t trial: \"t\",\n\t registrado: \"r\",\n\t anonimo: \"a\"\n\t };\n\t\n\t if (userType in arrayUsers) {\n\t valueUser = arrayUsers[userType];\n\t }\n\t\n\t return valueUser;\n\t }\n\t\n\t /**\n\t * Calcula el array de dimensiones para una posicion dada. Opcionalmente se puede indicar un tipo de dispositivo (si va vacio se usa el tipo actual)\n\t * @param {string} position\n\t * @param {string} tipoDispositivo\n\t * @return object\n\t */\n\t\n\t }, {\n\t key: 'getSizesGoogle',\n\t value: function getSizesGoogle(position, dispositivo) {\n\t var size, defineSlot;\n\t\n\t dispositivo = dispositivo || _deviceType;\n\t size = '[]';\n\t if (Publicidad.tipoFormatoJSON >= _constants.JSON_GDP2_1) {\n\t if ('posicion_' + dispositivo in Publicidad.configGDPMedio && position in Publicidad.configGDPMedio['posicion_' + dispositivo] && 'dimensiones' in Publicidad.configGDPMedio['posicion_' + dispositivo][position]) {\n\t size = Publicidad.configGDPMedio['posicion_' + dispositivo][position].dimensiones;\n\t }\n\t } else if ('posiciones' in Publicidad.configGDPMedio && position in Publicidad.configGDPMedio.posiciones) {\n\t size = Publicidad.configGDPMedio.posiciones[position];\n\t }\n\t defineSlot = Publicidad.getDefineSlotParam();\n\t\n\t if (size.indexOf('[fluid]') !== -1) {\n\t size = size.replace('[fluid]', '\\'fluid\\'');\n\t\n\t if (!defineSlot) return ['fluid'];\n\t }\n\t\n\t return defineSlot ? size : JSON.parse(size);\n\t }\n\t }, {\n\t key: 'getMedio',\n\t value: function getMedio() {\n\t var medio = typeof Publicidad.configGDPMedio.medio != \"undefined\" ? Publicidad.configGDPMedio.medio : '';\n\t return medio;\n\t }\n\t\n\t /**\n\t * Devuelve la version del tipo de formato JSON\n\t */\n\t\n\t }, {\n\t key: 'getTipoFormatoJSON',\n\t value: function getTipoFormatoJSON() {\n\t var tipo = _constants.JSON_GDP2_0;\n\t\n\t if (typeof Publicidad.configGDPMedio !== \"undefined\" && typeof Publicidad.configGDPMedio.activo !== \"undefined\") {\n\t tipo = _constants.JSON_GDP2_2;\n\t } else if (typeof Publicidad.configGDPMedio !== \"undefined\" && typeof Publicidad.configGDPMedio.tiposPublicidad !== \"undefined\") {\n\t tipo = _constants.JSON_GDP2_1;\n\t }\n\t\n\t return tipo;\n\t }\n\t\n\t /**\n\t * Detectamos el tipo de pagina a partir del patron de la URL.\n\t * NOTA: Cada medio tiene sus propias reglas de URLs por lo que tiene su propia funcion para calcularlas\n\t */\n\t\n\t }, {\n\t key: 'getTipoPagina',\n\t value: function getTipoPagina() {\n\t var tipoPagina = 'portada';\n\t if (Publicidad.medio == 'abc' || Publicidad.medio == 'lavozdigital' || Publicidad.medio == 'abcdesevilla') {\n\t tipoPagina = Publicidad.getTipoPaginaABC();\n\t } else if (Publicidad.medio == 'mujerhoy') {\n\t tipoPagina = Publicidad.getTipoPaginaMujerhoy();\n\t } else {\n\t tipoPagina = Publicidad.getTipoPaginaPortalesLocales();\n\t }\n\t\n\t return tipoPagina;\n\t }\n\t\n\t /**\n\t * Calculo del tipo de pagina en funcion de la URL para los medios de ABC (ABC, Sevilla y La Voz Digital)\n\t */\n\t\n\t }, {\n\t key: 'getTipoPaginaABC',\n\t value: function getTipoPaginaABC() {\n\t var reVideosAntiguos = /\\/videos\\/(.*)?\\/\\d{6}\\/\\d{2}\\/((?!index.html).)*.html/;\n\t var reVideos = /_video.html/;\n\t var esVideo = reVideos.exec(location.pathname) || reVideosAntiguos.exec(location.pathname);\n\t if (esVideo) return 'video';\n\t\n\t var reGaleriasAntiguos2 = /\\/multimedia\\/fotos\\/(.*)?\\/((?!index.html).)*.html/;\n\t var reGaleriasAntiguos = /\\/fotos-(.*)?\\/\\d{8}\\/((?!index.html).)*.html/;\n\t var reGalerias = /_galeria.html/;\n\t var esGaleria = reGalerias.exec(location.pathname) || reGaleriasAntiguos.exec(location.pathname) || reGaleriasAntiguos2.exec(location.pathname);\n\t if (esGaleria) return 'galeria';\n\t\n\t var reGraficos = /\\/multimedia\\/(graficos\\/(.)*|infografias)\\/((?!index.html).)*.html/;\n\t var esGrafico = reGraficos.exec(location.pathname);\n\t if (esGrafico) return 'grafico';\n\t\n\t var reNoticiasAntiguos = /\\d{8}\\/(.*)?((?!index.html).)*.html/;\n\t var reNoticias = /(_noticia.html|_directo.html)/;\n\t var esNoticia = reNoticias.exec(location.pathname) || reNoticiasAntiguos.exec(location.pathname);\n\t if (esNoticia) return 'noticia';\n\t\n\t return 'portada';\n\t }\n\t\n\t /**\n\t * Calculo del tipo de pagina en funcion de la URL para Mujerhoy\n\t */\n\t\n\t }, {\n\t key: 'getTipoPaginaMujerhoy',\n\t value: function getTipoPaginaMujerhoy() {\n\t var reVideos = /-vi.html/;\n\t var reVideosOld = /\\/videos\\/(.*)?\\/\\d{6}\\/\\d{2}\\/.*-mm.html/;\n\t var reVideosBlogs = /\\/videos\\/\\d{4}\\/\\d{2}\\/\\d{2}\\/(.*).html/;\n\t var esVideo = location.hostname.indexOf('blogs.') == -1 ? reVideos.exec(location.pathname) || reVideosOld.exec(location.pathname) : reVideosBlogs.exec(location.pathname);\n\t if (esVideo) return 'video';\n\t\n\t var reGalerias = /-ga.html/;\n\t var reGaleriasOld = /^\\/galerias\\/(.*)?\\d{6}\\/\\d{2}\\/.*-mm.html/;\n\t var reGaleriasBlogs = /\\/galerias\\/\\d{4}\\/\\d{2}\\/\\d{2}\\/(.*).html/;\n\t var esGaleria = location.hostname.indexOf('blogs.') == -1 ? reGalerias.exec(location.pathname) || reGaleriasOld.exec(location.pathname) : reGaleriasBlogs.exec(location.pathname);\n\t if (esGaleria) return 'galeria';\n\t\n\t var reNoticias = /\\/\\d{6}\\/\\d{2}\\/((?!index.html).)*.html/;\n\t var reNoticiasBlogs = /\\/\\d{4}\\/\\d{2}\\/\\d{2}\\/((?!index.html).)*.html/;\n\t var reNoticiasRecetas = /\\/\\d{6}\\/((?!index.html).)*.html/;\n\t var esNoticia = false;\n\t if (location.hostname.indexOf('blogs.') != -1) esNoticia = reNoticiasBlogs.exec(location.pathname);else if (location.hostname.indexOf('recetas.') != -1) esNoticia = reNoticiasRecetas.exec(location.pathname);else esNoticia = reNoticias.exec(location.pathname);\n\t if (esNoticia) return 'noticia';\n\t\n\t return 'portada';\n\t }\n\t\n\t /**\n\t * Calculo del tipo de pagina en funcion de la URL para los Portales Locales\n\t */\n\t\n\t }, {\n\t key: 'getTipoPaginaPortalesLocales',\n\t value: function getTipoPaginaPortalesLocales() {\n\t var reVideos = /-(vi|virc|vivo)(_amp)?.html/;\n\t var reVideosOld = /^\\/videos\\/(.*)?\\/\\d{6}\\/\\d{2}\\/.*-mm.html/;\n\t var esVideo = reVideos.exec(location.pathname) || reVideosOld.exec(location.pathname);\n\t if (esVideo) return 'video';\n\t\n\t var reGalerias = /-(ga|garc|gavo|ft|ftrc|ftvo)(_amp)?.html/;\n\t var reGaleriasOld = /^\\/fotos\\/(.*)?\\d{6}\\/\\d{2}\\/.*-mm.html/;\n\t var esGaleria = reGalerias.exec(location.pathname) || reGaleriasOld.exec(location.pathname);\n\t if (esGaleria) return 'galeria';\n\t\n\t var reNoticias = /-(nt|ntrc|ntvo)(_amp)?.html/;\n\t var reNoticiasOld = /\\/\\d{6}\\/\\d{2}\\/((?!index.html).)*.html/;\n\t var esNoticia = reNoticias.exec(location.pathname) || reNoticiasOld.exec(location.pathname);\n\t if (esNoticia) return 'noticia';\n\t\n\t // NOTA: En PLs, a nivel de publicidad, contemplaremos graficos y videochats como noticias\n\t var reGraficos = /-(in|inrc|invo)(_amp)?.html/;\n\t var reGraficosOld = /^\\/graficos\\/(.*)?\\/\\d{6}\\/\\d{2}\\/.*-mm.html/;\n\t var esGrafico = reGraficos.exec(location.pathname) || reGraficosOld.exec(location.pathname);\n\t //if (esGrafico) return 'grafico';\n\t if (esGrafico) return 'noticia';\n\t\n\t var reVideochats = /\\/videochats\\/((?!index.html).)\\w+/;\n\t var esVideochat = reVideochats.exec(location.pathname);\n\t //if (esVideochat) return 'videochat';\n\t if (esVideochat) return 'noticia';\n\t\n\t return 'portada';\n\t }\n\t\n\t /**\n\t * Comprobacion de si existen excepciones para la pagina donde nos encontramos.\n\t * @return object configGDP\n\t */\n\t\n\t }, {\n\t key: 'comprobamosExcepciones',\n\t value: function comprobamosExcepciones() {\n\t var configGDPAux = Publicidad.configGDP;\n\t if (typeof Publicidad.configGDPMedio != 'undefined' && typeof Publicidad.configGDPMedio.excepciones != 'undefined' && Object.keys(Publicidad.configGDPMedio.excepciones).length > 0) {\n\t (0, _utils.showLog)('En comprobamosExcepciones. Hay excepciones configuradas');\n\t\n\t $.each(Publicidad.configGDPMedio.excepciones, function (key, value) {\n\t if (key != \"priorizadas\" && key != \"retrasadas\") {\n\t if (location.pathname == key || location.pathname.match(key)) {\n\t var unix = Math.round(new Date() / 1000);\n\t var fechaini = value.fecha_in;\n\t var fechafin = value.fecha_fin;\n\t if ((fechaini === 0 || fechaini <= unix) && (fechafin === 0 || unix <= fechafin)) {\n\t configGDPAux = value;\n\t (0, _utils.showLog)('En comprobamosExcepciones. Aplicamos la siguiente excepcion:\"' + key + '\"');\n\t }\n\t }\n\t }\n\t });\n\t }\n\t\n\t return configGDPAux;\n\t }\n\t\n\t /**\n\t * Funcion que obtiene los tag definidos en los archivos de configuración\n\t * @return object\n\t */\n\t\n\t }, {\n\t key: 'getTargetingsConfig',\n\t value: function getTargetingsConfig() {\n\t var targetingsMedio = typeof Publicidad.configGDPMedio.targetings != \"undefined\" ? Publicidad.configGDPMedio.targetings : '';\n\t var targetingsPagina = typeof Publicidad.configGDP.targetings != \"undefined\" ? Publicidad.configGDP.targetings : '';\n\t var targetings = $.extend({}, targetingsMedio, targetingsPagina);\n\t return targetings;\n\t }\n\t\n\t /**\n\t * Funcion que comprueba si una posicion esta priorizada\n\t */\n\t\n\t }, {\n\t key: 'esPriorizada',\n\t value: function esPriorizada(params) {\n\t var lista = Publicidad.listaPriorizadas.split(',');\n\t for (var i = 0; i < lista.length; i++) {\n\t if (lista[i] == params.position) {\n\t return true;\n\t }\n\t }\n\t return false;\n\t }\n\t\n\t /**\n\t * Funcion que comprueba si una posicion es retrasada\n\t */\n\t\n\t }, {\n\t key: 'esRetrasada',\n\t value: function esRetrasada(params) {\n\t var lista = Publicidad.listaRetrasadas.split(',');\n\t for (var i = 0; i < lista.length; i++) {\n\t if (lista[i] == params.position) {\n\t return true;\n\t }\n\t }\n\t return false;\n\t }\n\t\n\t /**\n\t * Lanza los printAds que se han encolado cuando hay priorizadas\n\t */\n\t\n\t }, {\n\t key: 'displayDelayed',\n\t value: function displayDelayed() {\n\t (0, _utils.showLog)('En displayDelayed.');\n\t $.each(Publicidad.listaEstandardDelayed, function (i, params) {\n\t Publicidad.printAds(params);\n\t });\n\t }\n\t\n\t /**\n\t * Generate position identifier\n\t * FUTURE: Clean this method when all MEDIAS use the new ADS strategy\n\t * @param {object} params\n\t * @return {string}\n\t */\n\t\n\t }, {\n\t key: 'getIdDiv',\n\t value: function getIdDiv(params) {\n\t var adsId, dynamicId;\n\t\n\t dynamicId = _dynamicId ? '-' + _dynamicId : '';\n\t if (params.id && typeof params.id === 'string') {\n\t adsId = params.id.indexOf(_constants.OLD_PREFIX) > -1 ? params.id : '' + _constants.OLD_PREFIX + params.id;\n\t if (!$('#' + adsId).length) {\n\t adsId = params.id.indexOf(_constants.NEW_SUFFIX) > -1 ? params.id : '' + params.id + _constants.NEW_SUFFIX + dynamicId;\n\t }\n\t } else {\n\t adsId = '' + _constants.OLD_PREFIX + params.position;\n\t if (!$('#' + adsId).length) {\n\t adsId = '' + params.position + _constants.NEW_SUFFIX + dynamicId;\n\t }\n\t }\n\t\n\t return adsId;\n\t }\n\t\n\t /**\n\t * Funcion para pintar la publicidad priorizada\n\t * @return object\n\t */\n\t\n\t }, {\n\t key: 'pintaPriorizadas',\n\t value: function pintaPriorizadas() {\n\t (0, _utils.showLog)('En pintaPriorizadas. Pintaremos las siguientes posiciones: ' + Publicidad.listaPriorizadas);\n\t var sonPosicionesPriorizadas = true;\n\t var lista = Publicidad.listaPriorizadas.split(',');\n\t Publicidad.pintaListaPosiciones(lista, sonPosicionesPriorizadas);\n\t return this;\n\t }\n\t\n\t /**\n\t * Funcion que recorre y pinta una lista de posiciones.\n\t * Si singleRequest esta habilitado las posiciones priorizadas funcionan como un Roadblock y se piden todas juntas (no llevaran eventos ni callbacks)\n\t */\n\t\n\t }, {\n\t key: 'pintaListaPosiciones',\n\t value: function pintaListaPosiciones(listaPositions, sonPosicionesPriorizadas) {\n\t if (Publicidad.configGDPMedio.singleRequest && sonPosicionesPriorizadas) {\n\t (0, _utils.showLog)('En pintaListaPosiciones. SingleRequest habilitado y hay posiciones priorizadas -> las pedimos como Roadblock');\n\t\n\t googletag.cmd.push(function () {\n\t var posCuyoDivExiste = null;\n\t\n\t for (var i = 0; i < listaPositions.length; i++) {\n\t var params = {\n\t position: listaPositions[i]\n\t };\n\t\n\t if (!Publicidad.existePosEnConfigGDPMedio(params.position)) {\n\t (0, _utils.showWarn)('ERROR: La posicion priorizada ' + params.position + ' no existe en configGDPMedio');\n\t continue;\n\t }\n\t\n\t if (!Publicidad.isActive(params)) continue;\n\t\n\t // Recuperamos los parametros del DIV en caso de que exista en la pagina\n\t var container$ = $('[data-voc-vam-position = \\'' + params.position + '\\']', Publicidad.context$);\n\t if (container$.length) {\n\t params = Publicidad.normalizaParams(container$);\n\t if (posCuyoDivExiste == null) posCuyoDivExiste = params;\n\t } else {\n\t // NOTE: find legacy DIV\n\t container$ = $('#' + Publicidad.getIdDiv(params));\n\t if (container$.length) {\n\t params = Publicidad.normalizaParams(params);\n\t if (posCuyoDivExiste == null) {\n\t posCuyoDivExiste = params;\n\t }\n\t } else {\n\t (0, _utils.showWarn)('En pintaListaPosiciones. No existe el DIV de la posicion priorizada ' + params.position);\n\t }\n\t }\n\t if ('id' in params) {\n\t (0, _utils.showLog)('En pintaListaPosiciones. Llamando a defineSlot: ' + JSON.stringify(params));\n\t Publicidad.defineSlot(params);\n\t }\n\t }\n\t\n\t if (posCuyoDivExiste == null) {\n\t (0, _utils.showError)('ERROR En pintaListaPosiciones. No existe el DIV de ninguna de las posiciones priorizadas en la pagina, por lo que no se hara el display');\n\t } else {\n\t params = posCuyoDivExiste;\n\t }\n\t\n\t // NOTE: If there is Header Bidding wait for bidders promises\n\t if (_providerManager2.default.isActive()) {\n\t (0, _utils.showLog)('pintaListaPosiciones::Waiting for HB`s promises to be solved');\n\t _application2.default.when(_constants.HEADER_BIDDING_READY).then(function () {\n\t (0, _utils.showLog)('pintaListaPosiciones::HB promises resolved');\n\t _providerManager2.default.setTargetings();\n\t (0, _utils.showLog)(params);\n\t Publicidad.display(params);\n\t });\n\t } else {\n\t (0, _utils.showLog)('En pintaListaPosiciones. Print without wait HB');\n\t Publicidad.display(params);\n\t }\n\t });\n\t } else {\n\t (0, _utils.showLog)('En pintaListaPosiciones. SingleRequest NO habilitado o NO hay posiciones priorizadas');\n\t googletag.cmd.push(function () {\n\t for (var i = 0; i < listaPositions.length; i++) {\n\t var params = {\n\t position: listaPositions[i]\n\t };\n\t\n\t if (!Publicidad.existePosEnConfigGDPMedio(params.position)) {\n\t (0, _utils.showWarn)('En pintaListaPosiciones. ERROR: La posicion priorizada ' + params.position + ' no existe en configGDPMedio');\n\t continue;\n\t }\n\t\n\t if (!Publicidad.isActive(params)) continue;\n\t\n\t // Recuperamos los paramteros del DIV en caso de que exista en la pagina\n\t var container$ = $('[data-voc-vam-position = \\'' + params.position + '\\']', Publicidad.context$);\n\t if (container$.length) {\n\t params = Publicidad.normalizaParams(container$);\n\t } else {\n\t params = Publicidad.normalizaParams(params);\n\t }\n\t\n\t Publicidad.printAds(params);\n\t }\n\t });\n\t }\n\t }\n\t\n\t /**\n\t * Funcion que obtiene el valor del defineSlot en nuestro objecto de configuracion\n\t * @return string\n\t */\n\t\n\t }, {\n\t key: 'getDefineSlotParam',\n\t value: function getDefineSlotParam() {\n\t return typeof Publicidad.configGDPMedio.defineSlot != \"undefined\" ? Publicidad.configGDPMedio.defineSlot : '';\n\t }\n\t }, {\n\t key: 'isResponsiveMedia',\n\t value: function isResponsiveMedia() {\n\t return typeof Publicidad.configGDPMedio.responsive.esResponsive != \"undefined\" ? Publicidad.configGDPMedio.responsive.esResponsive : false;\n\t }\n\t\n\t /**\n\t * Construye el parametro responsive de la posicion en caso de que sea responsive\n\t * @return object\n\t */\n\t\n\t }, {\n\t key: 'getResponsiveParam',\n\t value: function getResponsiveParam(params) {\n\t var tieneParamResponsive = params.responsive && $.isArray(params.responsive) && params.responsive.length > 0;\n\t\n\t // No sera posicion responsive\n\t if (!tieneParamResponsive && !Publicidad.esMedioResponsive) {\n\t return false;\n\t }\n\t // Tiene parametro responsive en la llamada\n\t else if (tieneParamResponsive) {\n\t return params.responsive;\n\t }\n\t // No tiene parametro responsive en la llamada pero es medio responsive por lo que creamos el parametro con resoluciones y dimensiones correspondientes\n\t else if (Publicidad.esMedioResponsive) {\n\t return Publicidad.createResponsive(params);\n\t } else {\n\t return false;\n\t }\n\t }\n\t\n\t /**\n\t * Funcion que crea el objeto responsive cuando un medio es responsive y la llamada no tiene el parametro relleno\n\t * @return object\n\t */\n\t\n\t }, {\n\t key: 'createResponsive',\n\t value: function createResponsive(params) {\n\t var resolucionMinima,\n\t resolucionMaxima,\n\t responsive = [];\n\t var size_dc;\n\t\n\t var dispositivos = Publicidad.configGDPMedio.dispositivos;\n\t for (var i = 0; i < dispositivos.length; i++) {\n\t var dispositivo = dispositivos[i];\n\t\n\t if (!Publicidad.existePosEnConfigGDPMedio(params.position, dispositivo)) break;\n\t\n\t if (typeof eval('Publicidad.configGDPMedio.responsive.resolucion' + dispositivo) !== \"undefined\") {\n\t var anchoMinimo = typeof eval('Publicidad.configGDPMedio.responsive.resolucion' + dispositivo + '.resolucionMinima') !== \"undefined\" ? eval('Publicidad.configGDPMedio.responsive.resolucion' + dispositivo + '.resolucionMinima') : '';\n\t var anchoMaximo = typeof eval('Publicidad.configGDPMedio.responsive.resolucion' + dispositivo + '.resolucionMaxima') !== \"undefined\" ? eval('Publicidad.configGDPMedio.responsive.resolucion' + dispositivo + '.resolucionMaxima') : '';\n\t\n\t if (anchoMinimo !== '' || anchoMaximo !== '') {\n\t var dimension = [parseInt(anchoMinimo) || '0', _constants.ALTOS_MINIMOS_DISPOSITIVOS[dispositivo]];\n\t\n\t var size = Publicidad.getSizesGoogle(params.position, dispositivo);\n\t try {\n\t if (size !== null && size.indexOf('fluid') !== -1) {\n\t size_dc = 'fluid';\n\t } else {\n\t size_dc = JSON.parse(size);\n\t }\n\t } catch (e) {\n\t (0, _utils.showWarn)('ERROR en createResponsive procesando la posicion ' + params.position + ': ' + e);\n\t size_dc = size;\n\t }\n\t\n\t // Insertamos el mapeo de dimensiones de manera ordenada de menor a mayor ancho\n\t var encontrado = false;\n\t for (var index = 0; index < responsive.length && !encontrado; index++) {\n\t var valorAncho = responsive[index][0][0];\n\t if (dimension[0] < valorAncho) {\n\t responsive.splice(index, 0, [dimension, size_dc]);\n\t encontrado = true;\n\t }\n\t }\n\t\n\t if (!encontrado) responsive.push([dimension, size_dc]);\n\t }\n\t }\n\t }\n\t\n\t return responsive;\n\t }\n\t\n\t /**\n\t * Devuelve el serverType de la posicion pasada como parametro\n\t */\n\t\n\t }, {\n\t key: 'getServerType',\n\t value: function getServerType(params) {\n\t var serverType = 'google';\n\t\n\t if (Publicidad.tipoFormatoJSON >= _constants.JSON_GDP2_1) {\n\t try {\n\t var xpath = 'Publicidad.configGDPMedio.posicion_' + tipoDispositivo + '[\"' + params.position + '\"]';\n\t serverType = typeof eval(xpath) !== \"undefined\" && typeof eval(xpath + '.tipo') !== \"undefined\" ? eval(xpath + '.tipo') : 'google';\n\t } catch (err) {}\n\t }\n\t\n\t return serverType;\n\t }\n\t\n\t /**\n\t * Check if position exist in media config.\n\t *\n\t * @param {string} position\n\t * @param {string} dispositivo\n\t * @returns {boolean} - TRUE if exist, FALSE otherwise\n\t */\n\t\n\t }, {\n\t key: 'existePosEnConfigGDPMedio',\n\t value: function existePosEnConfigGDPMedio(position, dispositivo) {\n\t var existe, idAds;\n\t\n\t dispositivo = dispositivo || _deviceType;\n\t existe = false;\n\t // Comprobamos que exista en la lista de posiciones de configGDPMedio\n\t if (Publicidad.tipoFormatoJSON >= _constants.JSON_GDP2_1) {\n\t if ('posicion_' + dispositivo in Publicidad.configGDPMedio && position in Publicidad.configGDPMedio['posicion_' + dispositivo]) {\n\t existe = true;\n\t }\n\t } else if ('posiciones' in Publicidad.configGDPMedio && position in Publicidad.configGDPMedio.posiciones) {\n\t existe = true;\n\t }\n\t\n\t // Si no existe la posicion ocultamos su DIV contenedor\n\t if (!existe) {\n\t idAds = Publicidad.getIdDiv({ position: position });\n\t $('#' + idAds).length && $('#' + idAds).hide();\n\t }\n\t\n\t return existe;\n\t }\n\t\n\t /**\n\t * Checkea si una posicion esta activa o desactivada\n\t * @param object params\n\t * @return boolean\n\t */\n\t\n\t }, {\n\t key: 'isActive',\n\t value: function isActive(params) {\n\t // Comprobamos si se ha forzado via URL que todas las posiciones esten activas\n\t if (typeof Publicidad.configGDPMedio !== \"undefined\" && typeof Publicidad.configGDPMedio.forceActivePosition !== \"undefined\" && Publicidad.configGDPMedio.forceActivePosition) {\n\t return true;\n\t }\n\t\n\t var container$ = $('#' + Publicidad.getIdDiv(params));\n\t\n\t //Comprobamos que se ha anadido la configuracion necesaria para el tipo de dispositivo\n\t var tipoDispositivoAux = _deviceType;\n\t\n\t if (typeof eval('Publicidad.configGDP.posicion_' + tipoDispositivoAux) !== \"undefined\" && typeof eval('Publicidad.configGDP.posicion_' + tipoDispositivoAux + '[\"' + params.position + '\"]') !== \"undefined\") {\n\t var desactivadoen = typeof eval('Publicidad.configGDP.posicion_' + tipoDispositivoAux + '[\"' + params.position + '\"].desactivadoen') !== \"undefined\" ? eval('Publicidad.configGDP.posicion_' + tipoDispositivoAux + '[\"' + params.position + '\"].desactivadoen') : '';\n\t\n\t // Comprobamos si esta activa para el tipo de pagina\n\t if (typeof desactivadoen !== 'undefined' && desactivadoen.length > 0 && desactivadoen !== '' && desactivadoen.indexOf(Publicidad.tipoPagina) !== -1) {\n\t (0, _utils.showLog)('En isActive. La posicion ' + params.position + ' no esta activa para el tipo de pagina ' + Publicidad.tipoPagina);\n\t container$.trigger(_constants.SLOT_INACTIVE);\n\t return false;\n\t }\n\t\n\t // Comprobamos si la posicion esta programada\n\t var programaciones = new Array();\n\t if (Publicidad.tipoFormatoJSON >= _constants.JSON_GDP2_1) {\n\t var objProgramaciones = eval('Publicidad.configGDP.posicion_' + tipoDispositivoAux + '[\"' + params.position + '\"].programaciones');\n\t for (var _i = 0; _i < objProgramaciones.length; _i++) {\n\t var objProgramacion = objProgramaciones[_i].programacion;\n\t var fechaini = typeof objProgramacion !== \"undefined\" ? objProgramacion.fecha_in : 0;\n\t var fechafin = typeof objProgramacion !== \"undefined\" ? objProgramacion.fecha_fin : 0;\n\t programaciones.push([fechaini, fechafin]);\n\t }\n\t } else {\n\t var _fechaini = typeof eval('Publicidad.configGDP.posicion_' + tipoDispositivoAux + '[\"' + params.position + '\"].fecha_in') !== \"undefined\" ? eval('Publicidad.configGDP.posicion_' + tipoDispositivoAux + '[\"' + params.position + '\"].fecha_in') : 0;\n\t var _fechafin = typeof eval('Publicidad.configGDP.posicion_' + tipoDispositivoAux + '[\"' + params.position + '\"].fecha_fin') !== \"undefined\" ? eval('Publicidad.configGDP.posicion_' + tipoDispositivoAux + '[\"' + params.position + '\"].fecha_fin') : 0;\n\t programaciones.push([_fechaini, _fechafin]);\n\t }\n\t\n\t // Comprobamos si la fecha actual esta comprendida dentro de alguno de los arrays de programaciones\n\t if (programaciones.length > 0) {\n\t var fechaActual = Math.round(+new Date() / 1000);\n\t var encontrada = false;\n\t for (var _i2 = 0; _i2 < programaciones.length && !encontrada; _i2++) {\n\t var fechaInicioProgramacion = programaciones[_i2][0];\n\t var fechaFinProgramacion = programaciones[_i2][1];\n\t if ((fechaInicioProgramacion == 0 || fechaActual >= fechaInicioProgramacion) && (fechaFinProgramacion == 0 || fechaActual <= fechaFinProgramacion)) {\n\t encontrada = true;\n\t }\n\t }\n\t\n\t if (!encontrada) {\n\t (0, _utils.showLog)('En isActive. La posicion ' + params.position + ' no esta activa para la hora actual');\n\t container$.trigger(_constants.SLOT_INACTIVE);\n\t return false;\n\t }\n\t }\n\t } else {\n\t (0, _utils.showLog)('En isActive. La posicion ' + params.position + ' no esta activa');\n\t container$.trigger(_constants.SLOT_INACTIVE);\n\t return false;\n\t }\n\t\n\t return true;\n\t }\n\t\n\t /**\n\t * Pinta las posiciones retrasadas una vez que llegan al viewport\n\t * @param object params [parametros del ad]\n\t */\n\t\n\t }, {\n\t key: 'pintarRetrasada',\n\t value: function pintarRetrasada(params) {\n\t var idAds = Publicidad.getIdDiv(params);\n\t\n\t $('#' + idAds).one('inview', function (event, isInView) {\n\t if (isInView) {\n\t (0, _utils.showLog)('En pintarRetrasada. Pintando retrasada');\n\t Publicidad.getAdGoogle(params, false);\n\t }\n\t });\n\t }\n\t\n\t // FUTURE: completar\n\t\n\t }, {\n\t key: 'getAdMeta',\n\t value: function getAdMeta(params) {}\n\t\n\t /**\n\t * Muestra la publicidad.\n\t * @param {Object} datos - Puede ser un DIV obtenido con jQuery con los atributos de configuracion, o bien un objeto JSON con la configuracion a aplicar\n\t *\n\t * Descripcion de parametros que puede contener el objeto JSON:\n\t * position => string. Posicion publicitaria a mostrar\n\t * id => string. ID del elemento HTML en el que se muestra\n\t * serverType => string. Servidor de publicidad a usar\n\t * hideNoAds => boolean. Oculta el elemento HTML si el adserver no ha devuelto publi\n\t * outOfPage => boolean. Determina si el slot de publicidad es outOfPage o no. Por defecto vale false\n\t * defineSlot => boolean. Indica si hay que definir o no el slot\n\t * refresh => boolean. Se pide la posicion de publicidad aunque ya se hubiera mostrado antes. Por defecto false\n\t * responsive => Array. Indicamos si una publi se debe pintar solo en una(s) determinada(s) resolucion(es)\n\t * pre_callback => function. Función javascript a la que invocar previamente\n\t * pre_event => string. evento de precondicion\n\t * post_callback => function. Función javascript a la que invocar una vez disparado el slotRendered\n\t * post_event => string. evento a disparar una vez disparado evento de slotRendered\n\t * oas => string. Si se rellena es el OAS a utilizar en la posicion de publicidad\n\t *\n\t * Objeto Responsive\n\t * El primer par de valores indica la resolucion, y en el segundo los tamanos de la posicion de publi a servir, el cual puede definirse como sigue:\n\t * - vacio: []\n\t * - single array: [ancho, alto]\n\t * - multi array: [ [ancho1, alto1], [ancho2, alto2], ... ]\n\t * - string: En cuyo caso usa la funcion ads.getSizesGoogle para obtener el array\n\t *\n\t * Ejemplo llamada:\n\t * ads.printAds({'position': 'robapaginas', 'id': 'roba2', 'responsive': [\n\t * [[0, 0], []] // Small Mobile\n\t * ,[[350, 200], [300,150]] // Mobile\n\t * ,[[750, 200], 'robapaginas'] // Tablet\n\t * ,[[1050, 300], [[300,150],[300,250]]] // Desktop\n\t * ]});\n\t */\n\t\n\t }, {\n\t key: 'printAds',\n\t value: function printAds(datos) {\n\t if (Publicidad.tipoFormatoJSON >= _constants.JSON_GDP2_2 && !Publicidad.configGDPMedio.activo) {\n\t (0, _utils.showWarn)('La publicidad ha sido desactivada en la configuracion del medio!');\n\t return;\n\t }\n\t\n\t // Normalizacion de parametros\n\t var params = Publicidad.normalizaParams(datos);\n\t\n\t if (params == null) return;\n\t\n\t // Comprobamos si la posicion esta activada\n\t var idAds = Publicidad.getIdDiv(params);\n\t if (!Publicidad.isActive(params)) {\n\t // Ocultamos el DIV contenedor de la publicidad si esta habilitada la directiva hideNoAds\n\t if ($('#' + idAds).length && typeof params.hideNoAds != 'undefined' && params.hideNoAds) $('#' + idAds).hide();\n\t\n\t return;\n\t }\n\t\n\t // Comprobamos si existe el DIV\n\t if ($('#' + idAds).length) {\n\t // Pintado de publicidad dependiendo del servidor\n\t switch (params.serverType) {\n\t case 'google':\n\t // Si estamos en modo preview comprobamos si esta posicion hay que traerla desde el SW del capturador\n\t if (Publicidad.configGDPMedio.preview && Publicidad.capturadorExistsPreview(params)) {\n\t Publicidad.capturadorSetPreview(params);\n\t return;\n\t }\n\t\n\t // Publicidades priorizadas en la carga\n\t var priorized = Publicidad.esPriorizada(params);\n\t var retrasada = Publicidad.esRetrasada(params);\n\t\n\t // Posicion priorizada\n\t if (priorized && !retrasada) {\n\t (0, _utils.showLog)('En printAds. Pintando priorizada', params);\n\t Publicidad.getAdGoogle(params, true);\n\t }\n\t // Posicion retrasada -> le anade la class inview\n\t else if (retrasada) {\n\t Publicidad.pintarRetrasada(params);\n\t }\n\t // Posicion estandar\n\t else if (!Publicidad.hayPriorizadas || Publicidad.completadasPriorizadas) {\n\t (0, _utils.showLog)('En printAds. Pintando estandar', params);\n\t Publicidad.getAdGoogle(params, false);\n\t } else {\n\t Publicidad.listaEstandardDelayed.push(params);\n\t }\n\t\n\t break;\n\t case 'admeta':\n\t Publicidad.getAdMeta(params);\n\t break;\n\t }\n\t } else {\n\t (0, _utils.showWarn)('En printAds. ERROR: El DIV con ID ' + idAds + ' no existe');\n\t }\n\t\n\t return this;\n\t }\n\t\n\t /**\n\t * Pintado de publicidad de GPT\n\t */\n\t\n\t }, {\n\t key: 'getAdGoogle',\n\t value: function getAdGoogle(params, esPosPriorizada) {\n\t if (Publicidad.tipoFormatoJSON >= _constants.JSON_GDP2_2 && !Publicidad.configGDPMedio.activo) {\n\t (0, _utils.showWarn)('En getAdGoogle. La publicidad ha sido desactivada en la configuracion del medio!');\n\t return;\n\t }\n\t\n\t googletag.cmd.push(function () {\n\t if (!Publicidad.existePosEnConfigGDPMedio(params.position)) {\n\t (0, _utils.showWarn)('En getAdGoogle. ERROR: La posicion ' + params.position + ' no existe en configGDPMedio');\n\t return null;\n\t }\n\t\n\t // Gestion de los eventos y callbacks\n\t var idDiv = Publicidad.getIdDiv(params);\n\t var eventParams = Publicidad.getEventsPosition(params);\n\t\n\t var tParams = params;\n\t tParams.pre_callback = eventParams.pre_callback;\n\t tParams.pre_event = eventParams.pre_event;\n\t\n\t tParams.post_callback = eventParams.post_callback;\n\t tParams.post_event = eventParams.post_event;\n\t $(\"#\" + idDiv).data(\"params\", tParams);\n\t\n\t var key = Publicidad.getClavePosicionInsertada(params);\n\t if (typeof Publicidad.listaPosicionesInsertadas[key] == 'undefined') {\n\t var hasPreevent = false;\n\t if (params.defineSlot) {\n\t (0, _utils.showLog)('En getAdGoogle. defineSlot', params);\n\t Publicidad.defineSlot(params);\n\t // No se trata de una posicion priorizada por lo que puede tener condicion de pre (callback o evento)\n\t if (!esPosPriorizada) {\n\t (0, _utils.showLog)('En getAdGoogle. No es priorizada', params);\n\t // Tiene precallback pero no evento\n\t if (eventParams.pre_callback && !eventParams.pre_event) {\n\t eventParams.pre_callback();\n\t }\n\t // Tiene evento de pre\n\t else if (eventParams.pre_event) {\n\t (0, _utils.showLog)('En getAdGoogle. Tiene evento pre', params);\n\t hasPreevent = true;\n\t _application2.default.one(eventParams.pre_event, params, function () {\n\t // NOTE: If there is Header Bidding wait for bidders promises\n\t if (_providerManager2.default.isActive()) {\n\t (0, _utils.showLog)('getAdGoogle::Waiting for HB`s promises to be solved');\n\t _application2.default.when(_constants.HEADER_BIDDING_READY).then(function () {\n\t (0, _utils.showLog)('getAdGoogle::HB promises resolved with preEvents');\n\t if (params.pre_callback) {\n\t params.pre_callback();\n\t }\n\t _providerManager2.default.setTargetings();\n\t (0, _utils.showLog)(params);\n\t Publicidad.display(params);\n\t });\n\t }\n\t });\n\t } else {\n\t (0, _utils.showLog)('En getAdGoogle. No tiene evento pre', params);\n\t // NOTE: If there is Header Bidding wait for bidders promises\n\t if (_providerManager2.default.isActive()) {\n\t hasPreevent = true;\n\t (0, _utils.showLog)('getAdGoogle::Waiting for HB`s promises to be solved');\n\t _application2.default.when(_constants.HEADER_BIDDING_READY).then(function () {\n\t (0, _utils.showLog)('getAdGoogle::HB promises resolved without preEvents');\n\t if (params.pre_callback) {\n\t params.pre_callback();\n\t }\n\t _providerManager2.default.setTargetings();\n\t (0, _utils.showLog)(params);\n\t Publicidad.display(params);\n\t });\n\t }\n\t }\n\t } else {\n\t // Se trata de una posicion priorizada\n\t (0, _utils.showLog)('En getAdGoogle. Es priorizada');\n\t // NOTE: If there is Header Bidding wait for bidders promises\n\t if (_providerManager2.default.isActive()) {\n\t hasPreevent = true;\n\t (0, _utils.showLog)('getAdGoogle::Waiting for HB`s promises to be solved');\n\t _application2.default.when(_constants.HEADER_BIDDING_READY).then(function () {\n\t (0, _utils.showLog)('getAdGoogle::HB promises resolved on prioritized position');\n\t _providerManager2.default.setTargetings();\n\t (0, _utils.showLog)(params);\n\t Publicidad.display(params);\n\t });\n\t }\n\t }\n\t }\n\t\n\t // No tiene evento de activacion\n\t if (!hasPreevent) {\n\t (0, _utils.showLog)('En getAdGoogle. display:Pintando');\n\t _providerManager2.default.setTargetings();\n\t Publicidad.display(params);\n\t }\n\t } else {\n\t (0, _utils.showLog)('En getAdGoogle. La posicion ' + params.position + ' ya ha sido previamente invocada. Comprobamos el valor del parametro refresh: ' + params.refresh);\n\t if (params.refresh) Publicidad.pintarPosicionRefresh(params);\n\t }\n\t });\n\t }\n\t\n\t /**\n\t * Funcion que recuperar si tiene evento pre o post callback, los parametros llegados por funcion prevalecen sobre los del CONFIG\n\t * @param object params\n\t */\n\t\n\t }, {\n\t key: 'getEventsPosition',\n\t value: function getEventsPosition(params) {\n\t var tipoDispositivoAux = _deviceType;\n\t var positionEvents = {};\n\t\n\t if (typeof eval('Publicidad.configGDP.posicion_' + tipoDispositivoAux + '[\"' + params.position + '\"]') === \"undefined\") return positionEvents;\n\t\n\t if (params.pre_callback) {\n\t positionEvents.pre_callback = params.pre_callback;\n\t } else {\n\t positionEvents.pre_callback = typeof eval('Publicidad.configGDP.posicion_' + tipoDispositivoAux + '[\"' + params.position + '\"].pre_callback') !== \"undefined\" ? eval('Publicidad.configGDP.posicion_' + tipoDispositivoAux + '[\"' + params.position + '\"].pre_callback') : '';\n\t }\n\t\n\t if (params.pre_event) {\n\t positionEvents.pre_event = params.pre_event;\n\t } else {\n\t positionEvents.pre_event = typeof eval('Publicidad.configGDP.posicion_' + tipoDispositivoAux + '[\"' + params.position + '\"].pre_event') !== \"undefined\" ? eval('Publicidad.configGDP.posicion_' + tipoDispositivoAux + '[\"' + params.position + '\"].pre_event') : '';\n\t }\n\t\n\t if (params.post_callback) {\n\t positionEvents.post_callback = params.post_callback;\n\t } else {\n\t positionEvents.post_callback = typeof eval('Publicidad.configGDP.posicion_' + tipoDispositivoAux + '[\"' + params.position + '\"].post_callback') !== \"undefined\" ? eval('Publicidad.configGDP.posicion_' + tipoDispositivoAux + '[\"' + params.position + '\"].post_callback') : '';\n\t }\n\t\n\t if (params.post_event) {\n\t positionEvents.post_event = params.post_event;\n\t } else {\n\t positionEvents.post_event = typeof eval('Publicidad.configGDP.posicion_' + tipoDispositivoAux + '[\"' + params.position + '\"].post_event') !== \"undefined\" ? eval('Publicidad.configGDP.posicion_' + tipoDispositivoAux + '[\"' + params.position + '\"].post_event') : '';\n\t }\n\t\n\t return positionEvents;\n\t }\n\t\n\t /**\n\t * Devuelve el nombre de la variable que almacenara el slot\n\t */\n\t\n\t }, {\n\t key: 'getNombreSlot',\n\t value: function getNombreSlot(params) {\n\t return 'top.slot_' + params.position.replace('-', '_');\n\t }\n\t\n\t /**\n\t * Clave unica de la posicion\n\t */\n\t\n\t }, {\n\t key: 'getClavePosicionInsertada',\n\t value: function getClavePosicionInsertada(params) {\n\t var clave = Publicidad.getNombreSlot(params) + '_' + Publicidad.getIdDiv(params);\n\t return clave;\n\t }\n\t\n\t /**\n\t * Refresh de una posicion\n\t */\n\t\n\t }, {\n\t key: 'pintarPosicionRefresh',\n\t value: function pintarPosicionRefresh(params) {\n\t (0, _utils.showLog)('En pintarPosicionRefresh. Refrescamos la posicion ' + params.position);\n\t googletag.pubads().refresh([(0, _utils.lookup)(Publicidad.getNombreSlot(params))]);\n\t }\n\t\n\t /**\n\t * Detectamos si se fuerza alguna configuracion via parametro en la URL. Parametros soportados:\n\t * vam_adUnit\n\t * vam_cmvkey\n\t * vam_debug\n\t * vam_singleRequest\n\t * vam_syncRendering\n\t * vam_enableKrux\n\t * vam_forceActivePosition\n\t * vam_infoSlot\n\t */\n\t\n\t }, {\n\t key: 'checkConfigFromURL',\n\t value: function checkConfigFromURL() {\n\t var legacyCode;\n\t if (typeof top.location === 'undefined') return;\n\t\n\t // HeaderBidding Prebid\n\t if ('hbPrebid' in Publicidad.configGDPMedio) {\n\t Publicidad.configGDPMedio.hbPrebid = top.location.href.indexOf('vam_disableHbPrebid=1') > -1 ? false : Publicidad.configGDPMedio.hbPrebid;\n\t }\n\t\n\t // HeaderBidding Amazon\n\t if ('hbAmazon' in Publicidad.configGDPMedio) {\n\t Publicidad.configGDPMedio.hbAmazon = top.location.href.indexOf('vam_disableHbAmazon=1') > -1 ? false : Publicidad.configGDPMedio.hbAmazon;\n\t }\n\t\n\t // Single Request\n\t Publicidad.configGDPMedio.singleRequest = top.location.href.indexOf('vam_enableSingleRequest=1') > -1 || top.location.href.indexOf('gdp_singleRequest=1') > -1 || Publicidad.configGDPMedio.singleRequest;\n\t\n\t // SyncRendering\n\t Publicidad.configGDPMedio.syncRendering = top.location.href.indexOf('vam_enableSyncRendering=1') > -1 || top.location.href.indexOf('gdp_syncRendering=1') > -1 || Publicidad.configGDPMedio.syncRendering;\n\t\n\t // Krux\n\t Publicidad.configGDPMedio.enableKrux = top.location.href.indexOf('vam_enableKrux=1') > -1 || top.location.href.indexOf('gdp_enableKrux=1') > -1 || Publicidad.configGDPMedio.enableKrux;\n\t\n\t // Force active position\n\t Publicidad.configGDPMedio.forceActivePosition = top.location.href.indexOf('vam_forceActivePosition=1') > -1 || top.location.href.indexOf('gdp_forceActivePosition=1') > -1;\n\t\n\t // InfoSlot\n\t Publicidad.configGDPMedio.infoSlot = top.location.href.indexOf('vam_infoSlot=1') > -1 || top.location.href.indexOf('gdp_infoSlot=1') > -1;\n\t if (Publicidad.configGDPMedio.infoSlot) {\n\t _loadjscssfile(_constants.VAM_CSS_URL, false, 'css');\n\t }\n\t\n\t // Capturador (modo preview)\n\t Publicidad.configGDPMedio.preview = top.location.href.indexOf('vam_preview') > -1 || top.location.href.indexOf('preview') > -1;\n\t if (Publicidad.configGDPMedio.preview) {\n\t (0, _utils.showLog)('En checkConfigFromURL. Detectado modo capturador. Invocamos al SW del capturador');\n\t Publicidad.capturadorDataPreview = Publicidad.capturadorGetPreviewData();\n\t\n\t // En modo capturador no pondremos priorizadas ni retrasadas\n\t Publicidad.configGDP.priorizadas = Publicidad.configGDP.retrasadas = {};\n\t }\n\t\n\t // Previsualizador\n\t if (top.location.href.indexOf('vam_code=') > -1 || top.location.href.indexOf('code=') > -1) {\n\t (0, _utils.showLog)('En checkConfigFromURL. Detectado modo previsualizador');\n\t legacyCode = top.location.href.indexOf('vam_code=') > -1 ? 'vam_code' : 'code';\n\t Publicidad.prevEncryptedCode = decodeURI(_getParameterByName(legacyCode, top.location.href));\n\t\n\t // En modo previsualizador no pondremos priorizadas ni retrasadas\n\t Publicidad.configGDP.priorizadas = Publicidad.configGDP.retrasadas = {};\n\t\n\t if (Publicidad.prevEncryptedCode !== '') {\n\t _loadjscssfile(_constants.MCRYPT_URL, true, 'js');\n\t _loadjscssfile(_constants.RIJNDAEL_URL, true, 'js');\n\t }\n\t }\n\t }\n\t\n\t /**\n\t * Carga del JS para la publicidad de Google\n\t */\n\t\n\t }, {\n\t key: 'cargaLibreriaGPT',\n\t value: function cargaLibreriaGPT() {\n\t window.googletag = window.googletag || {};\n\t googletag.cmd = googletag.cmd || [];\n\t try {\n\t if ($(\"script[src*='www.googletagservices.com/tag/js/gpt.js']\").length === 0) {\n\t (function () {\n\t var gads = document.createElement('script');\n\t gads.async = true;\n\t gads.type = 'text/javascript';\n\t var useSSL = 'https:' == document.location.protocol;\n\t gads.src = (useSSL ? 'https:' : 'http:') + '//www.googletagservices.com/tag/js/gpt.js';\n\t var node = document.getElementsByTagName('script')[0];\n\t node.parentNode.insertBefore(gads, node);\n\t })();\n\t }\n\t } catch (err) {}\n\t }\n\t\n\t /**\n\t * Obtiene la edicion desde el namespace\n\t */\n\t\n\t }, {\n\t key: 'getEdition',\n\t value: function getEdition() {\n\t var editions = (0, _utils.lookup)(_constants.EDITIONS_NAMESPACE);\n\t return editions.current || editions.main || '';\n\t }\n\t\n\t /**\n\t * INICIO: Renderizado de tablas de informacion cuando vam_infoSlot=1\n\t * --------------------------------------------------------------------------\n\t */\n\t /**\n\t * Metodo de entrada de tablas de informacion\n\t */\n\t\n\t }, {\n\t key: 'infoSlotRender',\n\t value: function infoSlotRender(params, isSlotRendered) {\n\t var idDiv = Publicidad.getIdDiv(params);\n\t var container$ = $('#' + idDiv);\n\t var width = $('#' + idDiv + ' div iframe').width();\n\t var height = $('#' + idDiv + ' div iframe').height();\n\t\n\t // Obtenemos el tamano de la publi pintada y la borramos\n\t if (isSlotRendered) {\n\t container$.empty();\n\t } else {\n\t // Si DFP devuelve isEmpty cogemos la primera dimension del array, o 150x150 si es fluid\n\t try {\n\t height = width = 150;\n\t var dim = Publicidad.getSizesGoogle(params.position);\n\t if (dim != null && dim.indexOf('fluid') == -1) {\n\t var arrayObj = JSON.parse(dim);\n\t\n\t if ($.isArray(arrayObj[0])) {\n\t width = arrayObj[0][0];\n\t height = arrayObj[0][1];\n\t } else {\n\t width = arrayObj[0];\n\t height = arrayObj[1];\n\t }\n\t }\n\t } catch (e) {}\n\t\n\t container$.show();\n\t }\n\t\n\t // Rectangulo con color azul o rojo (si es local)\n\t container$.addClass('gdp_infoSlot_rectangle').html('

' + params.position + ' ' + Publicidad.infoSlotFormateaDimensiones(params) + '

');\n\t if (Publicidad.isLocalPosition(params)) container$.addClass('gdp_infoSlot_localPosition');\n\t if (!isSlotRendered) container$.addClass('gdp_infoSlot_inactive');\n\t\n\t if (!$(\"#gdp_infoSlot_tableInfo\").length > 0) {\n\t $('body').append('
');\n\t }\n\t\n\t // Tablas de info adicional\n\t Publicidad.infoSlotRenderSlots(params);\n\t Publicidad.infoSlotRenderTopics();\n\t Publicidad.infoSlotRenderOAS(params);\n\t\n\t var numSlots = $(\"#gdp_infoSlot_tableInfo-slots\").length > 0 ? $(\"#gdp_infoSlot_tableInfo-slots tbody tr\").length : 0;\n\t var numTopics = $(\"#gdp_infoSlot_tableInfo-topics\").length > 0 ? $(\"#gdp_infoSlot_tableInfo-topics tbody tr\").length : 0;\n\t var numOas = $(\"#gdp_infoSlot_tableInfo-oas\").length > 0 ? $(\"#gdp_infoSlot_tableInfo-oas tbody tr\").length : 0;\n\t var max = Math.max(numSlots, numTopics);\n\t if (max > numSlots && $(\"#gdp_infoSlot_tableInfo-slots\").length > 0) {\n\t for (i = 0; i < max - numSlots; i++) {\n\t $(\"#gdp_infoSlot_tableInfo-slots tbody\").append(\" \");\n\t }\n\t }\n\t if (max > numTopics && $(\"#gdp_infoSlot_tableInfo-topics\").length > 0) {\n\t for (i = 0; i < max - numTopics; i++) {\n\t $(\"#gdp_infoSlot_tableInfo-topics tbody\").append(\" \");\n\t }\n\t }\n\t if (max > numOas && $(\"#gdp_infoSlot_tableInfo-oas\").length > 0) {\n\t for (i = 0; i < max - numOas; i++) {\n\t $(\"#gdp_infoSlot_tableInfo-oas tbody\").append(\" \");\n\t }\n\t }\n\t }\n\t }, {\n\t key: 'infoSlotFormateaDimensiones',\n\t value: function infoSlotFormateaDimensiones(params) {\n\t var resultado = '';\n\t var arrayDimensiones = new Array();\n\t\n\t try {\n\t var objetoMapping = {};\n\t var sizeMapping = '';\n\t\n\t if (params.outOfPage) {\n\t arrayDimensiones.push('oop');\n\t } else if (params.responsive && $.isArray(params.responsive) && params.responsive.length > 0) {\n\t objetoMapping = Publicidad.getSizeMapping(params);\n\t sizeMapping = typeof objetoMapping !== 'undefined' && typeof objetoMapping.definicion !== 'undefined' ? objetoMapping.definicion : '';\n\t var aux = sizeMapping.split('.');\n\t for (var i = 0; i < aux.length; i++) {\n\t if (aux[i].indexOf('addSize') != -1) {\n\t aux[i] = aux[i].replace(new RegExp('addSize\\\\(', 'g'), '').replace(new RegExp('\\\\)', 'g'), '');\n\t arrayDimensiones.push(aux[i]);\n\t }\n\t }\n\t } else {\n\t if (Publicidad.tipoFormatoJSON >= _constants.JSON_GDP2_1) {\n\t arrayDimensiones.push(eval('Publicidad.configGDPMedio.posicion_' + _deviceType + '[\"' + params.position + '\"].dimensiones'));\n\t } else {\n\t arrayDimensiones.push(Publicidad.configGDPMedio.posiciones[params.position]);\n\t }\n\t }\n\t\n\t if ($.isArray(arrayDimensiones)) {\n\t // Posicion OutOfPage\n\t if (params.outOfPage) {\n\t resultado += '(oop)';\n\t }\n\t // Posicion no responsive\n\t else if (!params.responsive) {\n\t var dimension = arrayDimensiones[0];\n\t dimension = dimension.replace(new RegExp(\"'fluid'\", 'g'), '\\[fluid\\]').replace(new RegExp('\\\\],\\\\[', 'g'), '_').replace(new RegExp(',', 'g'), 'x').replace(new RegExp('\\\\[', 'g'), '').replace(new RegExp('\\\\]', 'g'), '').replace(new RegExp('_', 'g'), ',');\n\t resultado += '(' + dimension + ')';\n\t }\n\t // Posicion responsive\n\t else {\n\t var listaDimensionesNoRepetidas = new Set();\n\t for (var i = 0; i < arrayDimensiones.length; i++) {\n\t var dimension = arrayDimensiones[i];\n\t dimension = dimension.replace(new RegExp(\"'fluid'\", 'g'), '\\[fluid\\]').replace(new RegExp('\\\\],\\\\[', 'g'), '_').replace(new RegExp(',', 'g'), 'x').replace(new RegExp('\\\\[', 'g'), '').replace(new RegExp('\\\\]', 'g'), '').replace(new RegExp('_', 'g'), ',');\n\t\n\t // Quitamos la resolucion\n\t var resolucion = dimension.substring(0, dimension.indexOf(','));\n\t var dimension = dimension.substring(dimension.indexOf(',') + 1);\n\t listaDimensionesNoRepetidas.add(dimension);\n\t resultado += '
' + resolucion + ': (' + dimension + ')';\n\t }\n\t\n\t // Si todas las dimensiones de responsive son la misma escribimos solo una\n\t if (listaDimensionesNoRepetidas.size == 1) resultado = '(' + dimension + ')';\n\t }\n\t }\n\t } catch (err) {}\n\t\n\t return resultado;\n\t }\n\t\n\t /**\n\t * Tabla de informacion de SLOTS\n\t */\n\t\n\t }, {\n\t key: 'infoSlotRenderSlots',\n\t value: function infoSlotRenderSlots(params) {\n\t if (!$(\"#gdp_infoSlot_tableInfo-slots\").length > 0) {\n\t $(\"#gdp_infoSlot_tableInfo\").append('
');\n\t $(\"#gdp_infoSlot_tableInfo-slots thead\").append(\"posiciones\");\n\t }\n\t $(\"#gdp_infoSlot_tableInfo-slots tbody\").append('' + params.position + '');\n\t }\n\t\n\t /**\n\t * Tabla de informacion de TOPICS\n\t * @returns {boolean}\n\t */\n\t\n\t }, {\n\t key: 'infoSlotRenderTopics',\n\t value: function infoSlotRenderTopics() {\n\t var topics = Publicidad.getTopics(true);\n\t if (topics.length > 0) {\n\t if (!$(\"#gdp_infoSlot_tableInfo-topics\").length > 0) {\n\t $(\"#gdp_infoSlot_tableInfo\").append('
');\n\t $(\"#gdp_infoSlot_tableInfo-topics thead\").append(\"topics\");\n\t\n\t for (var i = 0; i < topics.length; i++) {\n\t $(\"#gdp_infoSlot_tableInfo-topics tbody\").append('' + topics[i] + '');\n\t }\n\t }\n\t }\n\t }\n\t\n\t /**\n\t * Tabla de informacion de OAS\n\t * @returns {boolean}\n\t */\n\t\n\t }, {\n\t key: 'infoSlotRenderOAS',\n\t value: function infoSlotRenderOAS(params) {\n\t if (!$(\"#gdp_infoSlot_tableInfo-oas\").length > 0) {\n\t $(\"#gdp_infoSlot_tableInfo\").append('
');\n\t $(\"#gdp_infoSlot_tableInfo-oas thead\").append(\"oas\");\n\t $(\"#gdp_infoSlot_tableInfo-oas tbody\").append('' + Publicidad.getOasSitepage(params) + '');\n\t }\n\t }\n\t\n\t /**\n\t * Devuelve un array con los topics que contiene la pagina, en caso de que los contenga y que enableTopics este habilitado\n\t * @return array\n\t */\n\t\n\t }, {\n\t key: 'getTopics',\n\t value: function getTopics(forzarEnableTopics) {\n\t var topics = new Array();\n\t\n\t if ((typeof Publicidad.configGDPMedio !== \"undefined\" && typeof Publicidad.configGDPMedio.enableTopics !== \"undefined\" && Publicidad.configGDPMedio.enableTopics || forzarEnableTopics) && typeof voc_top != \"undefined\" && voc_top != '') {\n\t topics = voc_top.split(',');\n\t }\n\t\n\t return topics;\n\t }\n\t\n\t /**\n\t * Funcion que devuelve true si la posicion es local, false si no lo es\n\t * @return boolean\n\t */\n\t\n\t }, {\n\t key: 'isLocalPosition',\n\t value: function isLocalPosition(params) {\n\t return params.position.includes(\"_local\");\n\t }\n\t /**\n\t * FIN: Renderizado de tablas de informacion cuando vam_infoSlot=1\n\t * --------------------------------------------------------------------------\n\t */\n\t\n\t /**\n\t * INICIO: Capturador (modo preview)\n\t * --------------------------------------------------------------------------\n\t */\n\t /**\n\t * Invoca al Servicio Web del Capturador para obtener las creatividades indicadas en el parametro preview directamente desde DFP\n\t */\n\t\n\t }, {\n\t key: 'capturadorGetPreviewData',\n\t value: function capturadorGetPreviewData() {\n\t var legacyPreview, url, data;\n\t\n\t legacyPreview = top.location.href.indexOf('vam_preview') > -1 ? 'vam_preview' : 'preview';\n\t var url = _constants.CAPTURADOR_WS + \"?id=\" + _getParameterByName(legacyPreview);\n\t var data = \"\";\n\t $.ajax({\n\t type: 'POST',\n\t url: url,\n\t async: false,\n\t success: function success(result) {\n\t data = result;\n\t }\n\t });\n\t\n\t return data;\n\t }\n\t\n\t /**\n\t * Devuelve true si hay preview para la posicion indicada o false en caso contrario\n\t * @returns {boolean}\n\t */\n\t\n\t }, {\n\t key: 'capturadorExistsPreview',\n\t value: function capturadorExistsPreview(params) {\n\t return typeof Publicidad.capturadorDataPreview !== \"undefined\" && Publicidad.capturadorDataPreview[params.position];\n\t }\n\t\n\t /**\n\t * funcion que cambia la publicidad por defecto, por una que se indica\n\t */\n\t\n\t }, {\n\t key: 'capturadorSetPreview',\n\t value: function capturadorSetPreview(params) {\n\t try {\n\t var previewJSON = JSON.parse(Publicidad.capturadorDataPreview[params.position]);\n\t var preview = previewJSON[0];\n\t var idDiv = Publicidad.getIdDiv(params);\n\t var div = $('#' + idDiv);\n\t div.empty();\n\t var creatividad = '';\n\t div.html(creatividad);\n\t (0, _utils.showLog)('En capturadorSetPreview. Pintada preview para la posicion ' + params.position);\n\t } catch (err) {}\n\t }\n\t /**\n\t * FIN: Capturador (modo preview)\n\t * --------------------------------------------------------------------------\n\t */\n\t\n\t /**\n\t * INICIO: Metodos para Modo Previsualizador\n\t * --------------------------------------------------------------------------\n\t */\n\t\n\t /**\n\t * Funcion que devuelve la URL desencriptada\n\t * @returns {string}\n\t */\n\t\n\t }, {\n\t key: 'decryptURL',\n\t value: function decryptURL() {\n\t var legacyCmvkey;\n\t try {\n\t if (Publicidad.prevUnencryptedCode === '') {\n\t if (Publicidad.prevEncryptedCode !== '') {\n\t var key = _constants.MCRYPT_KEY;\n\t var iv = key;\n\t Publicidad.prevUnencryptedCode = '?' + mcrypt.Decrypt(atob(Publicidad.prevEncryptedCode), iv, key, 'rijndael-256', 'cbc');\n\t\n\t // Eliminamos caracteres especiales de la cadena\n\t Publicidad.prevUnencryptedCode = Publicidad.prevUnencryptedCode.replace(/[^A-Za-z 0-9 \\.,\\?\"\"!@#\\$%\\^&\\*\\(\\)-_=\\+;:<>\\/\\\\\\|\\}\\{\\[\\]`~]*/g, '');\n\t if (Publicidad.prevUnencryptedCode.endsWith('&vam_cmvkey=') || Publicidad.prevUnencryptedCode.endsWith('&cmvkey=')) {\n\t legacyCmvkey = Publicidad.prevUnencryptedCode.endsWith('&vam_cmvkey=') ? '&vam_cmvkey=' : '&cmvkey=';\n\t Publicidad.prevUnencryptedCode = Publicidad.prevUnencryptedCode.replace(legacyCmvkey, '');\n\t }\n\t (0, _utils.showLog)('En decryptURL. cadena desencriptada: ' + Publicidad.prevUnencryptedCode);\n\t } else {\n\t Publicidad.prevUnencryptedCode = '';\n\t }\n\t }\n\t } catch (err) {\n\t (0, _utils.showError)('ERROR En decryptURL desencriptando cadena: ' + err);\n\t Publicidad.prevUnencryptedCode = '';\n\t }\n\t\n\t return Publicidad.prevUnencryptedCode;\n\t }\n\t /**\n\t * FIN: Metodos para Modo Previsualizador\n\t * --------------------------------------------------------------------------\n\t */\n\t\n\t }]);\n\t\n\t return Publicidad;\n\t}();\n\t\n\texports.default = Publicidad;\n\t\n\t/* Private */\n\t\n\t/**\n\t * Devuelve el tipo de dispositivo en funcion del tamano de la pagina\n\t * @return string\n\t */\n\t\n\tfunction _getTipoDispositivo() {\n\t var cTipoDispositivo = 'desktop';\n\t\n\t if (!Publicidad.configGDPMedio.responsive.esResponsive) {\n\t if (Publicidad.configGDPMedio && Publicidad.configGDPMedio.tipoDispositivo) {\n\t cTipoDispositivo = Publicidad.configGDPMedio.tipoDispositivo;\n\t }\n\t } else {\n\t var screen_width = parseInt(top.window.innerWidth);\n\t\n\t $.each(Publicidad.configGDPMedio.responsive, function (clave, valor) {\n\t if (clave !== 'esResponsive' && (valor.resolucionMaxima || valor.resolucionMinima)) {\n\t var maximo = valor.resolucionMaxima ? valor.resolucionMaxima : 999999;\n\t var minimo = valor.resolucionMinima ? valor.resolucionMinima : 0;\n\t\n\t if (screen_width <= maximo && screen_width > minimo) {\n\t var cTempTipo = clave.replace(\"resolucion\", \"\").toLowerCase();\n\t cTipoDispositivo = cTempTipo;\n\t }\n\t }\n\t });\n\t }\n\t\n\t return cTipoDispositivo;\n\t}\n\t\n\t/**\n\t * Devuelve el valor de un parametro de la URL indicada\n\t * Si no se indica URL se usa la actual\n\t */\n\tfunction _getParameterByName(paramName, url) {\n\t if (!paramName) return '';\n\t\n\t url = url || top.location.href;\n\t paramName = paramName.replace(/[\\[\\]]/g, \"\\\\$&\");\n\t var regex = new RegExp(\"[?&]\" + paramName + \"(=([^&#]*)|&|#|$)\"),\n\t results = regex.exec(url);\n\t if (!results) return '';\n\t if (!results[2]) return '';\n\t return decodeURIComponent(results[2].replace(/\\+/g, \" \"));\n\t}\n\t\n\t/**\n\t * Carga de ficheros de manera sincrona mediante XMLHttpRequest\n\t */\n\tfunction _loadjscssfile(filename, required, filetype) {\n\t if (filetype == \"js\") {\n\t //if filename is a external JavaScript file\n\t if ($('script[src=\"' + filename + '\"]').length > 0) return;\n\t\n\t var fileref = document.createElement('script');\n\t fileref.setAttribute(\"type\", \"text/javascript\");\n\t } else if (filetype == \"css\") {\n\t //if filename is an external CSS file\n\t var fileref = document.createElement(\"link\");\n\t fileref.setAttribute(\"rel\", \"stylesheet\");\n\t fileref.setAttribute(\"type\", \"text/css\");\n\t }\n\t\n\t if (required) {\n\t // get some kind of XMLHttpRequest\n\t var xhrObj = new XMLHttpRequest();\n\t // open and send a synchronous request\n\t xhrObj.open('GET', filename, false);\n\t xhrObj.send();\n\t fileref.text = xhrObj.responseText;\n\t } else {\n\t if (filetype == \"js\") {\n\t fileref.setAttribute(\"src\", filename);\n\t } else if (filetype == \"css\") {\n\t fileref.setAttribute(\"href\", filename);\n\t }\n\t }\n\t\n\t if (typeof fileref != \"undefined\") document.getElementsByTagName(\"head\")[0].appendChild(fileref);\n\t}\n\t\n\t/**\n\t * Process the configGDPMedia\n\t */\n\tfunction _processConfigGDPMedio() {\n\t // NOTE: HB processing\n\t _configManager2.default.processConfig.call(this, _deviceType, _dynamicId);\n\t}\n\n/***/ }),\n/* 19 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\t\n\tvar _application = __webpack_require__(15);\n\t\n\tvar _application2 = _interopRequireDefault(_application);\n\t\n\tvar _amazon = __webpack_require__(20);\n\t\n\tvar _amazon2 = _interopRequireDefault(_amazon);\n\t\n\tvar _prebid = __webpack_require__(22);\n\t\n\tvar _prebid2 = _interopRequireDefault(_prebid);\n\t\n\tvar _utils = __webpack_require__(21);\n\t\n\tvar _constants = __webpack_require__(12);\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\t\n\tvar GATEWAYS = [_amazon2.default, _prebid2.default];\n\tvar _window = window,\n\t RSVP = _window.RSVP;\n\t\n\tvar _gatewaysPromises = [];\n\tvar _gatewaysAdded = [];\n\t\n\twindow.googletag = window.googletag || {};\n\twindow.googletag.cmd = window.googletag.cmd || [];\n\t\n\texports.default = Object.preventExtensions({\n\t /**\n\t * Get promises from gateways.\n\t * NOTE: Init method must be call before isActive method\n\t * @param {string} device - device type\n\t * @param {object} config - configGDPMedio object\n\t * @param {integer} dynamicId - dynamicId(infinite-scroll)\n\t */\n\t init: function init(config) {\n\t _gatewaysPromises = [];\n\t // NOTE: load promises of active gateways\n\t _loadActivesGateways.call(_gatewaysPromises, config);\n\t\n\t // NOTE: when all promises are resolved, rejected or timeout reached, resolve the HB-Promise\n\t return RSVP.all(_gatewaysPromises).then(function () {\n\t (0, _utils.showLog)('All gateway promises are done');\n\t _application2.default.promised(_constants.HEADER_BIDDING_READY, true);\n\t }).catch(function (reason) {\n\t (0, _utils.showError)('HBManager::init::Error in gateways', reason);\n\t _application2.default.promised(_constants.HEADER_BIDDING_READY, false);\n\t });\n\t },\n\t\n\t /**\n\t * Set targeting to DFP request\n\t */\n\t setTargetings: function setTargetings() {\n\t _gatewaysAdded.forEach(function (gateway) {\n\t gateway.setTargetings();\n\t });\n\t },\n\t\n\t /**\n\t * Check if there are gateways actives\n\t */\n\t isActive: function isActive() {\n\t return _gatewaysPromises.length;\n\t }\n\t});\n\t\n\t/* Private */\n\t\n\t/**\n\t * Load active gateways by config\n\t * @param {object} configGDPMedio\n\t */\n\t\n\tfunction _loadActivesGateways(config) {\n\t var _this = this;\n\t\n\t _gatewaysAdded = [];\n\t GATEWAYS.forEach(function (gateway) {\n\t if (gateway.isActive(config)) {\n\t (0, _utils.showLog)('HBManager::_loadActivesGateways::Add promise', gateway.NAME());\n\t _gatewaysAdded.push(gateway);\n\t _this.push(gateway.getLoadPromise(config));\n\t }\n\t });\n\t}\n\n/***/ }),\n/* 20 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\t\n\tvar _utils = __webpack_require__(21);\n\t\n\tvar _constants = __webpack_require__(12);\n\t\n\t// NOTE: function to queue the apstag calls before the library loaded(https://ams.amazon.com/webpublisher/docs/help/web-integration-documentation/integration-guide/javascript-guide/display.html)\n\t(function IIFE(a9, a) {\n\t if (a[a9]) return;function q(c, r) {\n\t a[a9]._Q.push([c, r]);\n\t }a[a9] = { init: function init() {\n\t q('i', arguments);\n\t }, fetchBids: function fetchBids() {\n\t q('f', arguments);\n\t }, setDisplayBids: function setDisplayBids() {}, targetingKeys: function targetingKeys() {\n\t return [];\n\t }, _Q: [] };\n\t})('apstag', window);\n\t// NOTE: 'apstag' is the global variable that Amazon searches for\n\twindow.apstag.adserverRequestResponse = false;\n\t\n\tvar REASONS = {\n\t ERROR_LOAD_LIBRARY: 'ERROR_LOAD_LIBRARY',\n\t TIMEOUT_REACHED_GLOBAL: 'TIMEOUT_REACHED_GLOBAL',\n\t TIMEOUT_REACHED_FETCH_BIDS: 'TIMEOUT_REACHED_FETCH_BIDS',\n\t ERROR_INIT_CONFIG: 'ERROR_INIT_CONFIG'\n\t};\n\tvar _window = window,\n\t RSVP = _window.RSVP;\n\t\n\tvar _NAME = 'AMAZON';\n\t\n\texports.default = Object.preventExtensions({\n\t NAME: function NAME() {\n\t return _NAME;\n\t },\n\t isActive: function isActive(_ref) {\n\t var hbAmazon = _ref.hbAmazon;\n\t\n\t if (hbAmazon) {\n\t (0, _utils.showLog)('Amazon::Is active');\n\t } else {\n\t (0, _utils.showLog)('Amazon::Is NOT active');\n\t }\n\t return hbAmazon;\n\t },\n\t\n\t /**\n\t * Launch amazon behaviour\n\t * @param {object} adUnits - adUnits config\n\t * @param {object} biddersConfig\n\t * @param {integer} timeout\n\t * @return {Promise}\n\t */\n\t getLoadPromise: function getLoadPromise(_ref2) {\n\t var hbAmazon = _ref2.hbAmazon;\n\t\n\t return new RSVP.Promise(function (resolve, reject) {\n\t var timeout = hbAmazon.timeout || _constants.DEFAULT_AMAZON_LOAD_TIMEOUT;\n\t _loadLibrary().then(function () {\n\t (0, _utils.showLog)('Amazon::getLoadPromise::Library loaded');\n\t return _setConfig();\n\t }).then(function () {\n\t (0, _utils.showLog)('Amazon::getLoadPromise::apstag is loaded');\n\t return _fetchBid(hbAmazon);\n\t }).then(function () {\n\t resolve(true);\n\t });\n\t\n\t setTimeout(function () {\n\t reject(REASONS.TIMEOUT_REACHED_GLOBAL);\n\t }, timeout);\n\t }).catch(function (reason) {\n\t switch (reason) {\n\t case REASONS.TIMEOUT_REACHED_GLOBAL:\n\t (0, _utils.showLog)('Amazon::getLoadPromise::TIMEOUT reached global');\n\t break;\n\t case REASONS.TIMEOUT_REACHED_FETCH_BIDS:\n\t (0, _utils.showLog)('Amazon::getLoadPromise::TIMEOUT reached in _fetchBid');\n\t break;\n\t case REASONS.ERROR_LOAD_LIBRARY:\n\t (0, _utils.showError)('Amazon::getLoadPromise::Error loading library');\n\t break;\n\t case REASONS.ERROR_INIT_CONFIG:\n\t (0, _utils.showError)('Amazon::getLoadPromise::Error on init config');\n\t break;\n\t default:\n\t (0, _utils.showError)('Amazon::getLoadPromise::Error in Amazon process', reason);\n\t }\n\t return false;\n\t });\n\t },\n\t\n\t\n\t /**\n\t * Force setTargeting\n\t */\n\t setTargetings: function setTargetings() {\n\t if (window.apstag.adserverRequestResponse) {\n\t window.googletag.cmd.push(function () {\n\t (0, _utils.showLog)('Amazon::setTargetings::Get targetings', window.apstag.targetingKeys());\n\t window.apstag.setDisplayBids();\n\t (0, _utils.showLog)('Amazon::setTargetings::Targetings added');\n\t });\n\t } else {\n\t (0, _utils.showLog)('Amazon::setTargetings::Targetings NOT added because no response from bidders');\n\t }\n\t }\n\t});\n\t\n\t/* Private */\n\t\n\t/**\n\t * Load Amazon library\n\t * @return {Promise}\n\t */\n\t\n\tfunction _loadLibrary() {\n\t (0, _utils.showLog)('Amazon::_loadLibrary::Loading library');\n\t return (0, _utils.load)(_constants.AMAZON_URL).catch(function (reason) {\n\t (0, _utils.showError)('Amazon::_loadLibrary::Error', reason);\n\t return RSVP.reject(REASONS.ERROR_LOAD_LIBRARY);\n\t });\n\t}\n\t\n\t/**\n\t * Set apstag init config\n\t */\n\tfunction _setConfig() {\n\t return new RSVP.Promise(function (resolve, reject) {\n\t // NOTE: set custom config object\n\t (0, _utils.showLog)('Amazon::_setConfig::Show Amazon config', _constants.AMAZON_CONFIG);\n\t try {\n\t window.apstag.init(_constants.AMAZON_CONFIG, function () {\n\t resolve();\n\t });\n\t } catch (error) {\n\t (0, _utils.showError)('Amazon::_setConfig::Error', error);\n\t reject(REASONS.ERROR_INIT_CONFIG);\n\t }\n\t });\n\t}\n\t\n\t/**\n\t * Add slots config and make Amazon call\n\t * @param {object} config - hbAmazon config from configGDPMedio\n\t */\n\tfunction _fetchBid(config) {\n\t var bidConfig;\n\t\n\t bidConfig = {\n\t slots: config.slots,\n\t timeout: config.timeout || _constants.DEFAULT_AMAZON_LOAD_TIMEOUT\n\t };\n\t\n\t return new RSVP.Promise(function (resolve, reject) {\n\t (0, _utils.showLog)('Amazon::_fetchBid::Add Slots', bidConfig.slots);\n\t (0, _utils.showLog)('Amazon::_fetchBid::Request Amazon');\n\t window.apstag.fetchBids(bidConfig, function (bids) {\n\t (0, _utils.showLog)('Amazon::_fetchBid::Response from Amazon', bids);\n\t // NOTE: When there are no bids returned, the bids array will be empty\n\t if (Object.keys(bids).length === 0) {\n\t reject(REASONS.TIMEOUT_REACHED_FETCH_BIDS);\n\t return;\n\t }\n\t window.apstag.adserverRequestResponse = true;\n\t resolve();\n\t });\n\t });\n\t}\n\n/***/ }),\n/* 21 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\texports.getUserType = undefined;\n\texports.lookup = lookup;\n\texports.load = load;\n\texports.showLog = showLog;\n\texports.showWarn = showWarn;\n\texports.showError = showError;\n\t\n\tvar _constants = __webpack_require__(12);\n\t\n\tvar _window = window,\n\t Cookies = _window.Cookies,\n\t RSVP = _window.RSVP,\n\t UserType = Object.freeze({\n\t ANONYMOUS: 'anonimo',\n\t REGISTERED: 'registrado',\n\t SUBSCRIBER: 'suscriptor',\n\t TRIAL: 'trial'\n\t}),\n\t _vocUid = decodeURIComponent(Cookies.get('voc_uid')),\n\t _cookie = _vocUid === 'undefined' ? {} : JSON.parse(_vocUid),\n\t _scripts = {},\n\t _hasOwnProperty = Object.prototype.hasOwnProperty;\n\t\n\t/**\n\t * Look for the namespace config\n\t * @param {string} namespace\n\t */\n\t\n\t\n\tfunction lookup() {\n\t var namespace = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : _constants.NAMESPACE;\n\t var root = arguments[1];\n\t\n\t return namespace.split('.').reduce(function (that, o) {\n\t return o in that ? that[o] : {};\n\t }, root || window);\n\t}\n\t\n\t/**\n\t * Adapted User type from Gigya for advertising segmentation\n\t *\n\t * @return {string}\n\t */\n\tvar getUserType = exports.getUserType = window.__VOONTO__ && window.__VOONTO__.getUserType ? window.__VOONTO__.getUserType : function () {\n\t var userType, paywall, pwUserType;\n\t\n\t userType = UserType.ANONYMOUS; // <'anonimo' | 'registrado' | 'trial' | 'suscriptor'>\n\t paywall = Cookies.get('voc_paywall');\n\t if (paywall) {\n\t pwUserType = paywall.split('|').pop();\n\t }\n\t\n\t if (pwUserType) {\n\t userType = pwUserType;\n\t } else if (_cookie.uid) {\n\t userType = UserType.REGISTERED;\n\t }\n\t\n\t return userType;\n\t};\n\t\n\t/**\n\t * Load file\n\t *\n\t * @param {string} url\n\t * @param {object} options\n\t */\n\tfunction load(url) {\n\t var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n\t\n\t var script, src, key;\n\t\n\t src = url;\n\t key = url.split('?').shift();\n\t if (_hasOwnProperty.call(_scripts, key)) {\n\t return RSVP.resolve(_scripts[key]);\n\t }\n\t\n\t script = document.createElement('script');\n\t script.type = 'text/javascript';\n\t script.src = src;\n\t script.async = true;\n\t if (options.text) {\n\t script.text = options.text;\n\t }\n\t\n\t return new RSVP.Promise(function (resolve, reject) {\n\t script.onload = function () {\n\t return (/*event*/resolve(script)\n\t );\n\t };\n\t script.onerror = reject;\n\t _scripts[key] = script;\n\t\n\t document.head.appendChild(script);\n\t });\n\t}\n\t\n\tfunction showLog() {\n\t var _console;\n\t\n\t _constants.SHOW_LOGS && (_console = console).log.apply(_console, [_constants.DEFAULT_LOG_TEMPLATE].concat(Array.prototype.slice.call(arguments)));\n\t}\n\t\n\tfunction showWarn() {\n\t var _console2;\n\t\n\t _constants.SHOW_LOGS && (_console2 = console).warn.apply(_console2, [_constants.DEFAULT_LOG_TEMPLATE].concat(Array.prototype.slice.call(arguments)));\n\t}\n\t\n\tfunction showError() {\n\t var _console3;\n\t\n\t _constants.SHOW_LOGS && (_console3 = console).error.apply(_console3, [_constants.DEFAULT_LOG_TEMPLATE].concat(Array.prototype.slice.call(arguments)));\n\t}\n\n/***/ }),\n/* 22 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\t\n\tvar _utils = __webpack_require__(21);\n\t\n\tvar _constants = __webpack_require__(12);\n\t\n\tvar REASONS = {\n\t ERROR_LOAD_LIBRARY: 'ERROR_LOAD_LIBRARY',\n\t TIMEOUT_REACHED_GLOBAL: 'TIMEOUT_REACHED_GLOBAL',\n\t TIMEOUT_REACHED_FETCH_BIDS: 'TIMEOUT_REACHED_FETCH_BIDS'\n\t};\n\tvar _window = window,\n\t RSVP = _window.RSVP;\n\t\n\tvar _NAME = 'PREBID';\n\t\n\t// NOTE: This is the global variable that Prebid searches for\n\twindow.pbjs = window.pbjs || {};\n\twindow.pbjs.que = window.pbjs.que || [];\n\twindow.pbjs.adserverRequestResponse = false;\n\t\n\texports.default = Object.preventExtensions({\n\t NAME: function NAME() {\n\t return _NAME;\n\t },\n\t isActive: function isActive(_ref) {\n\t var headerBidding = _ref.headerBidding;\n\t\n\t if (headerBidding) {\n\t (0, _utils.showLog)('Prebid::Is active');\n\t } else {\n\t (0, _utils.showLog)('Prebid::Is NOT active');\n\t }\n\t return headerBidding;\n\t },\n\t\n\t /**\n\t * Launch prebid behaviour\n\t * @param {object} adUnits - adUnits config\n\t * @param {object} biddersConfig\n\t * @param {integer} timeout\n\t * @return {Promise}\n\t */\n\t getLoadPromise: function getLoadPromise(_ref2) {\n\t var headerBidding = _ref2.headerBidding;\n\t\n\t return new RSVP.Promise(function (resolve, reject) {\n\t var timeout = headerBidding.timeout || _constants.DEFAULT_PREBID_LOAD_TIMEOUT;\n\t _loadLibrary().then(function () {\n\t (0, _utils.showLog)('Prebid::getLoadPromise::Library loaded');\n\t _setConfig(headerBidding);\n\t return _fetchBid(headerBidding);\n\t }).then(function () {\n\t resolve(true);\n\t });\n\t\n\t setTimeout(function () {\n\t reject(REASONS.TIMEOUT_REACHED_GLOBAL);\n\t }, timeout);\n\t }).catch(function (reason) {\n\t switch (reason) {\n\t case REASONS.TIMEOUT_REACHED_GLOBAL:\n\t (0, _utils.showLog)('Prebid::getLoadPromise::TIMEOUT reached global');\n\t break;\n\t case REASONS.TIMEOUT_REACHED_FETCH_BIDS:\n\t (0, _utils.showLog)('Prebid::getLoadPromise::TIMEOUT reached in _fetchBid');\n\t break;\n\t case REASONS.ERROR_LOAD_LIBRARY:\n\t (0, _utils.showError)('Prebid::_loadLibrary::Error loading library', reason);\n\t break;\n\t default:\n\t (0, _utils.showError)('Prebid::getLoadPromise::Error in Prebid process', reason);\n\t }\n\t return false;\n\t });\n\t },\n\t\n\t\n\t /**\n\t * Force setTargeting\n\t */\n\t setTargetings: function setTargetings() {\n\t if (window.pbjs.adserverRequestResponse) {\n\t window.googletag.cmd.push(function () {\n\t window.pbjs.que.push(function () {\n\t (0, _utils.showLog)('Prebid::setTargetings::Get targetings', window.pbjs.getAdserverTargeting());\n\t window.pbjs.setTargetingForGPTAsync();\n\t (0, _utils.showLog)('Prebid::setTargetings::Targetings added');\n\t });\n\t });\n\t } else {\n\t (0, _utils.showLog)('Prebid::setTargetings::Targetings NOT added because no response from bidders');\n\t }\n\t }\n\t});\n\t\n\t/* Private */\n\t\n\t/**\n\t * Load prebid library\n\t * @return {Promise}\n\t */\n\t\n\tfunction _loadLibrary() {\n\t (0, _utils.showLog)('Prebid::_loadLibrary::Loading library');\n\t return (0, _utils.load)(_constants.PREBID_URL).catch(function (reason) {\n\t (0, _utils.showError)('Prebid::_loadLibrary', reason);\n\t return RSVP.reject(REASONS.ERROR_LOAD_LIBRARY);\n\t });\n\t}\n\t\n\tfunction _setConfig(headerBidding) {\n\t var biddersConfig, pbjsConfig;\n\t\n\t biddersConfig = headerBidding.biddersConfig;\n\t // NOTE: set custom config object\n\t pbjsConfig = {\n\t debug: _constants.SHOW_LOGS,\n\t enableSendAllBids: headerBidding.enableSendAllBids || true,\n\t priceGranularity: {\n\t buckets: [{\n\t precision: 2, // NOTE: default is 2 if omitted - means 2.123456 rounded to 4 decimal places\n\t min: 0,\n\t max: 20,\n\t increment: 0.01\n\t }]\n\t }\n\t };\n\t\n\t (0, _utils.showLog)('Prebid::_setConfig::biddersConfig', biddersConfig);\n\t window.pbjs.bidderSettings = _fetchBiddersSettings(biddersConfig);\n\t window.pbjs.setConfig(pbjsConfig);\n\t (0, _utils.showLog)('Prebid::_setConfig::Show Prebid config', window.pbjs.getConfig());\n\t}\n\t\n\t/**\n\t * Add adUnits config and make prebid call\n\t * @param {object} config - headerBidding config from configGDPMedio\n\t */\n\tfunction _fetchBid(headerBidding) {\n\t var adUnits, timeout;\n\t\n\t adUnits = headerBidding.adUnits;\n\t timeout = headerBidding.timeout || _constants.DEFAULT_PREBID_LOAD_TIMEOUT;\n\t\n\t return new RSVP.Promise(function (resolve, reject) {\n\t window.pbjs.que.push(function () {\n\t (0, _utils.showLog)('Prebid::_fetchBid::Add adUnits', adUnits);\n\t window.pbjs.addAdUnits(adUnits);\n\t (0, _utils.showLog)('Prebid::_fetchBid::Request Prebid');\n\t window.pbjs.requestBids({\n\t timeout: timeout,\n\t bidsBackHandler: function bidsBackHandler(biddersResponse) {\n\t (0, _utils.showLog)('Prebid::_fetchBid::Response from Prebid', biddersResponse);\n\t if (Object.keys(biddersResponse).length === 0) {\n\t reject(REASONS.TIMEOUT_REACHED_FETCH_BIDS);\n\t return;\n\t }\n\t window.pbjs.adserverRequestResponse = true;\n\t resolve();\n\t }\n\t });\n\t });\n\t });\n\t}\n\t\n\t/**\n\t * Build bidders settings from config\n\t * @param {object} biddersConfig - biddersConfig from configGDPMedio.headerBidding\n\t * @return {object} bidderSettings\n\t */\n\tfunction _fetchBiddersSettings(biddersConfig) {\n\t var bidderSettings = {};\n\t\n\t Object.keys(biddersConfig).forEach(function (bidderName) {\n\t bidderSettings[bidderName] = {\n\t bidCpmAdjustment: function bidCpmAdjustment(bidCpm, bid) {\n\t var percent;\n\t\n\t percent = 1 - ('percent' in biddersConfig[bidderName] ? biddersConfig[bidderName].percent / 100 : 0);\n\t // NOTE: adjust the bid in real time before the auction takes place\n\t (0, _utils.showLog)('Prebid::_fetchBiddersSettings::bidCpmAdjustment Bidder is:', bid.bidderCode, 'with percent:', percent);\n\t // NOTE: return bidCpm * .85; Ex.: rest 15% to the gross price\n\t return bidCpm * percent;\n\t }\n\t };\n\t });\n\t\n\t return bidderSettings;\n\t}\n\n/***/ }),\n/* 23 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\t\n\tvar _constants = __webpack_require__(12);\n\t\n\tvar _utils = __webpack_require__(21);\n\t\n\texports.default = Object.preventExtensions({\n\t processConfig: function processConfig(_tipoDispositivo, _dynamicId) {\n\t this.configGDPMedio.headerBidding = _processPrebidConfig.call(this, _tipoDispositivo, _dynamicId);\n\t this.configGDPMedio.hbAmazon = _processAmazonConfig.call(this, _tipoDispositivo, _dynamicId);\n\t }\n\t});\n\t\n\t/**\n\t * Process Prebid HB config to set dynamicId\n\t * @param {string} device - device type\n\t * @param {integer} dynamicId - dynamic ID for infinite-scroll\n\t * @return {object}\n\t */\n\t\n\tfunction _processPrebidConfig(device, dynamicId) {\n\t var _this = this;\n\t\n\t var property, adUnits, newConfig;\n\t var headerBidding = this.configGDPMedio.headerBidding;\n\t\n\t\n\t if (!headerBidding) {\n\t (0, _utils.showLog)('hbConfigProcessor::_processPrebidConfig::There are not Prebid configuration');\n\t return null;\n\t }\n\t\n\t property = 'adUnits_' + device;\n\t if (!(property in headerBidding) || !headerBidding[property].length) {\n\t (0, _utils.showLog)('hbConfigProcessor::_processPrebidConfig::There are not bidders to device type', device);\n\t return null;\n\t }\n\t\n\t adUnits = dynamicId ? headerBidding[property].map(function (current, index) {\n\t this[index].code = '' + this[index].code + dynamicId;\n\t return this[index];\n\t }, headerBidding[property]) : headerBidding[property];\n\t\n\t adUnits = [];\n\t headerBidding[property].forEach(function (current) {\n\t var position;\n\t\n\t position = current.code.replace(new RegExp('(' + _constants.OLD_PREFIX + '|' + _constants.NEW_SUFFIX + ')', 'g'), '');\n\t if (!_this.existePosEnConfigGDPMedio(position)) {\n\t (0, _utils.showWarn)('hbConfigProcessor::_processPrebidConfig::Priority position ' + position + ' does not exists in configGDPMedio');\n\t return null;\n\t }\n\t if (!_this.isActive({ position: position })) return null;\n\t\n\t current.code = dynamicId ? '' + current.code + dynamicId : current.code;\n\t adUnits.push(current);\n\t });\n\t\n\t newConfig = {\n\t adUnits: adUnits,\n\t biddersConfig: headerBidding.biddersConfig,\n\t enableSendAllBids: headerBidding.enableSendAllBids,\n\t timeout: headerBidding.timeout || _constants.DEFAULT_PREBID_LOAD_TIMEOUT\n\t };\n\t\n\t return newConfig;\n\t}\n\t\n\t/**\n\t * Process Amazon HB config to set dynamicId and slotName\n\t * @param {string} device - device type\n\t * @param {integer} dynamicId - dynamic ID for infinite-scroll\n\t */\n\tfunction _processAmazonConfig(device, dynamicId) {\n\t var _this2 = this;\n\t\n\t var property, slots, newConfig;\n\t var hbAmazon = this.configGDPMedio.hbAmazon;\n\t\n\t\n\t if (!hbAmazon) {\n\t (0, _utils.showLog)('hbConfigProcessor::_processAmazonConfig::There are not Amazon configuration');\n\t return null;\n\t }\n\t\n\t property = 'slots_' + device;\n\t if (!(property in hbAmazon) || !hbAmazon[property].length) {\n\t (0, _utils.showLog)('hbConfigProcessor::_processAmazonConfig::There are not slots to device type', device);\n\t return null;\n\t }\n\t\n\t slots = [];\n\t hbAmazon[property].forEach(function (current) {\n\t var position;\n\t\n\t position = current.slotID.replace(new RegExp('(' + _constants.OLD_PREFIX + '|' + _constants.NEW_SUFFIX + ')', 'g'), '');\n\t if (!_this2.existePosEnConfigGDPMedio(position)) {\n\t (0, _utils.showWarn)('hbConfigProcessor::_processAmazonConfig::Priority position ' + position + ' does not exists in configGDPMedio');\n\t return null;\n\t }\n\t if (!_this2.isActive({ position: position })) return null;\n\t\n\t current.slotName = _getAmazonSlotName.call(_this2, position);\n\t current.slotID = dynamicId ? '' + current.slotID + dynamicId : current.slotID;\n\t slots.push(current);\n\t });\n\t\n\t newConfig = {\n\t slots: slots,\n\t timeout: hbAmazon.timeout || _constants.DEFAULT_AMAZON_LOAD_TIMEOUT\n\t };\n\t\n\t return newConfig;\n\t}\n\t\n\tfunction _getAmazonSlotName(position) {\n\t var params;\n\t\n\t var container$ = $('[data-voc-vam-position = \\'' + position + '\\']', this.context$);\n\t if (container$.length) {\n\t params = this.normalizaParams(container$);\n\t } else {\n\t params = this.normalizaParams({ position: position });\n\t }\n\t\n\t return this.getOasSitepage(params);\n\t}\n\n/***/ })\n/******/ ])\n});\n;\n\n\n// WEBPACK FOOTER //\n// vam.js"," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId])\n \t\t\treturn installedModules[moduleId].exports;\n\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\texports: {},\n \t\t\tid: moduleId,\n \t\t\tloaded: false\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.loaded = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(0);\n\n\n\n// WEBPACK FOOTER //\n// webpack/bootstrap d2e6d101cbf3a7438b3b","import './check-dependencies';\nimport './dfp-pixel';\nimport pkg from '../package.json';\nimport {\n CONFIG_NAMESPACE\n} from './constants';\nimport app from './application';\nimport Publicidad from './publicidad';\nimport {lookup} from './utils';\n\nconst {$} = window;\nvar _initialized = false;\n\n_legacyInit();\n$(document).ready(function() {\n const config = lookup(CONFIG_NAMESPACE);\n _init(config.media, config.options);\n});\n\nexport const VERSION = pkg.version;\n\n/* Private */\n\nfunction _legacyInit() {\n window.Vocento = window.Vocento || {};\n window.Vocento.Publicidad = function() {};\n window.Vocento.Publicidad.prototype.init = function(jQuery, configGDPMedio, configGDP) {\n _init(configGDPMedio, configGDP);\n };\n window.Vocento.Publicidad.prototype.printAds = function(datos, esJSON = true) {\n return Publicidad.printAds(datos, esJSON);\n };\n window.Vocento.Publicidad.prototype.getOasSitepage = function(...params) {\n return Publicidad.getOasSitepage(...params);\n };\n window.Vocento.Publicidad.prototype.getSizesGoogle = function(...params) {\n return Publicidad.getSizesGoogle(...params);\n };\n window.Vocento.Publicidad.prototype.getValueUser = function(...params) {\n return Publicidad.getValueUser(...params);\n };\n}\n\nfunction _init(configGDPMedio, configGDP) {\n if (_initialized) {return;}\n\n if (!configGDPMedio || !configGDP) {throw Error('[Ads Manager] missing configuration');}\n\n _initialized = true;\n Publicidad.init(configGDPMedio, configGDP);\n _printAds();\n\n app.on('voonto:reload', (event, context$, configGDPMedioReload, configGDPReload) => {\n Publicidad.init(configGDPMedioReload, configGDPReload, context$);\n _printAds(context$);\n });\n app.on('vam:refresh', function (event, data) { // NOTE: refresh the ads position received on 'data' parameter\n var params = typeof data === 'string' ? JSON.parse(data) : data;\n Publicidad.printAds(params);\n });\n}\n\nfunction _printAds(context$) {\n $('[data-voc-vam]', context$).each(function () {\n Publicidad.printAds($(this));\n });\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/index.js","import {DEFAULT_LOG_TEMPLATE} from './constants';\n\n// NOTE: jQuery checking\nif (!('$' in window) || typeof window.$ !== 'function') {\n throw Error(`${DEFAULT_LOG_TEMPLATE} missing jQuery library on page`);\n}\n\n// NOTE: Cookies checking\nif (!('Cookies' in window) || typeof window.Cookies !== 'function') {\n throw Error(`${DEFAULT_LOG_TEMPLATE} missing Cookies library on page`);\n}\n\n// NOTE: RSVP checking\nif (!('RSVP' in window) || typeof window.RSVP !== 'object') {\n throw Error(`${DEFAULT_LOG_TEMPLATE} missing RSVP library on page`);\n}\n\n// NOTE: InView jQuery Plugin checking\nif (!('event' in window.$) ||\n !('special' in window.$.event) ||\n !('inview' in window.$.event.special) ||\n typeof window.$.event.special.inview !== 'object'\n) {\n throw Error(`${DEFAULT_LOG_TEMPLATE} missing InView jQuery plugin on page`);\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/check-dependencies.js","import pkg from '../package.json';\n\nexport const NAMESPACE = 'vocento';\nexport const PROMISES_PROPERTY = '__PROMISES__';\nexport const SHOW_LOGS = document.location.search.indexOf('vam_debug=1') > -1 || document.location.search.indexOf('gdp_debug=1') > -1;\nexport const DEFAULT_LOG_TEMPLATE = '[Ads Manager]';\nexport const CONFIG_NAMESPACE = 'vocento.config.vam';\nexport const EDITIONS_NAMESPACE = 'vocento.site.editions';\nexport const GPT_ID_VOCENTO = '4900';\nexport const GPT_READY = 'vam:gpt:ready';\nexport const GPT_TIMEOUT = 2000;\nexport const TIMEOUT_POSICIONES_ESTANDAR = 3000;\nexport const ALTOS_MINIMOS_DISPOSITIVOS = {\n mobile: 0,\n tablet: 200,\n desktop: 300\n};\nexport const POSITION_FLUID = \"'fluid'\";\nexport const SLOT_RENDERED = 'vam:slotrendered';\nexport const SLOT_EMPTY = 'vam:isempty';\nexport const SLOT_VIEWABLE = 'vam:viewable';\nexport const SLOT_INACTIVE = 'vam:inactive';\nexport const DEFAULTS = {\n hideNoAds: true,\n refresh: false,\n responsive: false\n};\nexport const CAPTURADOR_WS = '//publi.cmvocento.com/capturador/preview';\nexport const RIJNDAEL_URL = '//netssl.vocento.com/cmvocento/js/rijndael.js';\nexport const MCRYPT_URL = '//netssl.vocento.com/cmvocento/js/mcrypt.js';\nexport const MCRYPT_KEY = 'acsNdl09acs72AEdacsNdl09acs72AEd';\nexport const VAM_CSS_URL = '//netssl.vocento.com/cmvocento/css/vam.css';\nexport const JSON_GDP2_0 = 0;\nexport const JSON_GDP2_1 = 1;\nexport const JSON_GDP2_2 = 2;\nexport const NOMBRE_FORMATO_JSON = ['GDP2.0', 'GDP2.1', 'GDP2.2+'];\n\n/* header bidding */\nexport const HEADER_BIDDING_READY = 'vam:headerbidding:ready';\nconst ENV_PREFIX_PRE = 'pre-';\nconst ENV_PREFIX_DES = 'des-';\nexport const PREBID_URL = (function IIFE() {\n var url, defaultUrl, prefix;\n\n defaultUrl = 'prebid.js';\n if (document.location.hostname === 'localhost') return defaultUrl;\n\n url = `static.vocento.com/vam/${pkg.version}/${defaultUrl}`;\n prefix = (document.location.hostname.indexOf(ENV_PREFIX_PRE) === 0 ? ENV_PREFIX_PRE : null) ||\n (document.location.hostname.indexOf(ENV_PREFIX_DES) === 0 ? ENV_PREFIX_DES : '');\n\n return `//${prefix}${url}`;\n}());\nexport const DEFAULT_PREBID_LOAD_TIMEOUT = 7000;\nexport const AMAZON_URL = '//c.amazon-adsystem.com/aax2/apstag.js';\nexport const DEFAULT_AMAZON_LOAD_TIMEOUT = 7000;\nexport const AMAZON_CONFIG = {\n pubID: '3470', // Amazon publisher ID\n adServer: 'googletag' // AdServer type that contains apstag line-items\n};\n\n/* legacy */\nexport const OLD_PREFIX = 'publi_';\nexport const NEW_SUFFIX = '-id';\n\n\n\n// WEBPACK FOOTER //\n// ./src/constants.js","module.exports = {\n\t\"name\": \"vam\",\n\t\"version\": \"3.6.9-0\",\n\t\"description\": \"\",\n\t\"main\": \"src/index.js\",\n\t\"scripts\": {\n\t\t\"test\": \"./node_modules/.bin/webpack && ./node_modules/.bin/mocha-phantomjs dist/spec/index.html --reporter xunit --file test-results.xml\",\n\t\t\"start\": \"webpack-dev-server --content-base dist/\",\n\t\t\"prebid\": \"cd ./node_modules/prebid.js && npm install && \\\"./node_modules/.bin/gulp\\\" build --modules=../../src/header-bidding/prebid-modules.json && cp build/dist/prebid.js ../../dist & cd ../..\",\n\t\t\"build\": \"./node_modules/.bin/webpack\"\n\t},\n\t\"contributors\": [\n\t\t\"Jose Manuel Ortega \",\n\t\t\"Ernesto V. \",\n\t\t\"Iván Pérez \"\n\t],\n\t\"license\": \"SEE LICENSE IN LICENSE.md\",\n\t\"devDependencies\": {\n\t\t\"babel-core\": \"^6.17.0\",\n\t\t\"babel-eslint\": \"^8.0.1\",\n\t\t\"babel-loader\": \"^6.2.5\",\n\t\t\"babel-polyfill\": \"^6.16.0\",\n\t\t\"babel-preset-es2015\": \"^6.16.0\",\n\t\t\"chai\": \"^3.5.0\",\n\t\t\"chalk\": \"^1.1.3\",\n\t\t\"css-loader\": \"^0.28.4\",\n\t\t\"eslint\": \"^4.7.2\",\n\t\t\"eslint-config-airbnb-base\": \"^12.0.1\",\n\t\t\"eslint-plugin-import\": \"^2.7.0\",\n\t\t\"extract-text-webpack-plugin\": \"^1.0.1\",\n\t\t\"html-webpack-plugin\": \"^2.24.1\",\n\t\t\"json-loader\": \"^0.5.4\",\n\t\t\"mocha\": \"^3.1.0\",\n\t\t\"mocha-loader\": \"^1.0.0\",\n\t\t\"mocha-phantomjs\": \"^4.1.0\",\n\t\t\"style-loader\": \"^0.18.2\",\n\t\t\"webpack\": \"^1.13.3\",\n\t\t\"webpack-shell-plugin\": \"^0.4.3\"\n\t},\n\t\"dependencies\": {\n\t\t\"prebid.js\": \"^0.29.0\",\n\t\t\"jquery-inview\": \"^1.1.2\",\n\t\t\"js-cookie\": \"^2.1.4\",\n\t\t\"rsvp\": \"^3.5.0\"\n\t}\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./package.json\n// module id = 13\n// module chunks = 0 1 3","import app from './application';\n\nconst\n UserTypes = Object.freeze({\n ANONYMOUS: 'anonimo'\n }),\n Genders = Object.freeze({\n FEM: 'f',\n MAS: 'm'\n }),\n VOCUSER_READY = 'vocuser:ready',\n VOCUSER_DATA = 'vocuser:userdata'\n;\n\n$(document).ready(function() {\n app.when(VOCUSER_READY).then(_onVocUserReady);\n $('body').on('vocento.gigya.products.onReady', function(event, gigyaux) {\n var gigyaUX;\n\n gigyaUX = gigyaux || window.gigyaUX;\n if (gigyaUX) {_onVocUserReady(gigyaUX);}\n });\n});\n\n/* Private */\n\nfunction _ord() {\n return Math.random() * 10000000000000;\n}\n\nfunction _onVocUserReady(gigyaux) {\n if (gigyaux.getUserType() === UserTypes.ANONYMOUS) {\n $('head').append(``);\n } else {\n $('head').append(``);\n if (typeof Voonto !== 'undefined') {\n app.when(VOCUSER_DATA).then(function(userData) {\n var gender, age;\n\n // NOTE: vocUserData promise object\n if (userData.responseGetUserInfo) {\n gender = userData.responseGetUserInfo.user &&\n userData.responseGetUserInfo.user.gender ?\n userData.responseGetUserInfo.user.gender : null;\n age = userData.responseGetUserInfo.user &&\n userData.responseGetUserInfo.user.age ?\n userData.responseGetUserInfo.user.age : null;\n }\n _onVocUserData(gender, age);\n });\n } else {\n $('body').on('vocento.gigya.accounts.onDataReady', function(event) {\n var gender, age;\n\n // NOTE: vocUserData promise object\n if (event.gigya_event) {\n gender = event.gigya_event.profile &&\n event.gigya_event.profile.gender ?\n event.gigya_event.profile.gender : null;\n age = event.gigya_event.profile &&\n event.gigya_event.profile.age ?\n event.gigya_event.profile.age : null;\n }\n _onVocUserData(gender, age);\n });\n }\n }\n}\n\nfunction _onVocUserData(gender, age) {\n switch (gender) {\n case Genders.FEM:\n $('head').append(``);\n break;\n case Genders.MAS:\n $('head').append(``);\n break;\n }\n\n switch (true) {\n case '' !== age && 17 >= age:\n $('head').append(``);\n break;\n case 18 <= age && 24 >= age:\n $('head').append(``);\n break;\n case 25 <= age && 34 >= age:\n $('head').append(``);\n break;\n case 35 <= age && 44 >= age:\n $('head').append(``);\n break;\n case 45 <= age && 54 >= age:\n $('head').append(``);\n break;\n case '' !== age && 54 > age:\n $('head').append(``);\n break;\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/dfp-pixel.js","import Evented from './mixins/evented';\nimport Deferred from './mixins/deferred';\n\nconst app = {};\n\n_extend.call(app, Evented);\n_extend.call(app, Deferred);\n\nexport default 'Voonto' in window ? Voonto.getInstance() : app;\n\n/* Private */\n\nfunction _extend(source) {\n Object.keys(source).forEach((key) => {\n this[key] = source[key];\n });\n\n return this;\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/application.js","import {\n SHOW_LOGS,\n DEFAULT_LOG_TEMPLATE\n} from '../constants';\n\nconst Evented = Object.preventExtensions({\n on() {window.$(this).on(...arguments);},\n one() {window.$(this).one(...arguments);},\n off() {window.$(this).off(...arguments);},\n trigger() {\n SHOW_LOGS && console.log(DEFAULT_LOG_TEMPLATE, 'Evented::trigger', ...arguments);\n window.$(this).trigger(...arguments);\n }\n});\n\nexport default Evented;\n\n\n// WEBPACK FOOTER //\n// ./src/mixins/evented.js","import {\n NAMESPACE,\n PROMISES_PROPERTY,\n SHOW_LOGS,\n DEFAULT_LOG_TEMPLATE\n} from '../constants';\n\nconst\n {RSVP} = window,\n DEFAULT_TIMEOUT = 2000,\n _defers = {},\n _hasOwnProperty = Object.prototype.hasOwnProperty\n;\n\nconst Deferred = Object.preventExtensions({\n whenUntil(promiseNS, time = DEFAULT_TIMEOUT) {\n SHOW_LOGS && console.log(DEFAULT_LOG_TEMPLATE, '[Deferred] whenUntil', {promiseNS, time});\n return new RSVP.Promise((resolve, reject) => {\n setTimeout(reject, time);\n this.when(promiseNS, resolve);\n });\n },\n\n when(promiseNS) {\n var owner, name, global;\n\n SHOW_LOGS && console.log(DEFAULT_LOG_TEMPLATE, '[Deferred] when', promiseNS);\n\n if (!promiseNS) {throw Error(`${DEFAULT_LOG_TEMPLATE} [Deferred] At least 1 argument needed. 0 passed.`);}\n [owner, name] = promiseNS.split(':');\n if (!owner || !name) {throw Error(`${DEFAULT_LOG_TEMPLATE} [Deferred] Illegal promise namespace name. Expected \"owner:name\".`);}\n\n if (_hasOwnProperty.call(_defers, promiseNS)) {return _defers[promiseNS].promise;}\n\n global = _createGlobal(`${NAMESPACE}.${owner}.${PROMISES_PROPERTY}`);\n global[name] = RSVP.defer();\n _defers[promiseNS] = global[name];\n\n return global[name].promise;\n },\n\n promised(promiseNS, value) {\n var owner, name, global;\n\n SHOW_LOGS && console.log(DEFAULT_LOG_TEMPLATE, '[Deferred] promised', {promiseNS, value});\n\n if (!promiseNS) {throw Error(`${DEFAULT_LOG_TEMPLATE} [Deferred] At least 1 argument needed. 0 passed.`);}\n [owner, name] = promiseNS.split(':');\n if (!owner || !name) {throw Error(`${DEFAULT_LOG_TEMPLATE} [Deferred] Illegal promise namespace name. Expected \"owner:name\".`);}\n\n if (_hasOwnProperty.call(_defers, promiseNS)) {\n _defers[promiseNS].resolve(value);\n return this;\n }\n\n global = _createGlobal(`${NAMESPACE}.${owner}.${PROMISES_PROPERTY}`);\n global[name] = RSVP.defer();\n global[name].resolve(value);\n _defers[promiseNS] = global[name];\n\n return this;\n }\n});\n\nexport default Deferred;\n\n/* Private */\n\nfunction _createGlobal(namespace) {\n var nso = window;\n\n if (!namespace) {return nso;}\n\n namespace.split('.').forEach((prop) => {\n nso[prop] = nso[prop] || {};\n nso = nso[prop];\n });\n\n return nso;\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/mixins/deferred.js","import {version} from '../package.json';\nimport HBProviderManager from './header-bidding/provider-manager';\nimport app from './application';\nimport HBConfigManager from './header-bidding/config-manager';\nimport {\n getUserType,\n lookup,\n showLog,\n showWarn,\n showError\n} from './utils';\nimport {\n GPT_ID_VOCENTO,\n GPT_READY,\n GPT_TIMEOUT,\n TIMEOUT_POSICIONES_ESTANDAR,\n ALTOS_MINIMOS_DISPOSITIVOS,\n POSITION_FLUID,\n SLOT_RENDERED,\n SLOT_EMPTY,\n SLOT_VIEWABLE,\n SLOT_INACTIVE,\n EDITIONS_NAMESPACE,\n DEFAULTS,\n CAPTURADOR_WS,\n RIJNDAEL_URL,\n MCRYPT_URL,\n MCRYPT_KEY,\n VAM_CSS_URL,\n JSON_GDP2_0,\n JSON_GDP2_1,\n JSON_GDP2_2,\n NOMBRE_FORMATO_JSON,\n HEADER_BIDDING_READY,\n OLD_PREFIX,\n NEW_SUFFIX\n} from './constants';\n\nvar\n _dynamicId = -1,\n _deviceType = 'desktop'\n;\n\nclass Publicidad {\n /**\n *\n * @param {object} app - Evented object\n * @param {object} configGDPMedio\n * @param {object} configGDP\n * @param {context} context$\n */\n static init(configGDPMedio, configGDP, context$) {\n var prioritizedPositions;\n\n _dynamicId += 1;\n Publicidad.context$ = context$;\n // Inicializacion de variables de instancia estaticas\n Publicidad.configGDPMedio = configGDPMedio;\n Publicidad.configGDP = configGDP;\n Publicidad.prevEncryptedCode = '';\n Publicidad.prevUnencryptedCode = '';\n Publicidad.capturadorDataPreview = '';\n\n // Detectamos si se fuerza via URL alguna configuracion\n Publicidad.checkConfigFromURL();\n\n Publicidad.medio = Publicidad.getMedio();\n Publicidad.listaEstandardDelayed = [];\n Publicidad.gpt_inicializado = false;\n Publicidad.listaPosicionesInsertadas = {};\n Publicidad.listaIdsInsertados = [];\n _deviceType = _getTipoDispositivo();\n Publicidad.tipoPagina = Publicidad.getTipoPagina();\n Publicidad.tipoFormatoJSON = Publicidad.getTipoFormatoJSON();\n\n if ((Publicidad.tipoFormatoJSON >= JSON_GDP2_2) && !Publicidad.configGDPMedio.activo) {\n showWarn('La publicidad ha sido desactivada en la configuracion del medio!');\n return;\n }\n showLog(`En constructor. tipoDispositivo: ${_deviceType} , tipoPagina: ${Publicidad.tipoPagina} , formatoJSON: ${NOMBRE_FORMATO_JSON[Publicidad.tipoFormatoJSON]} (Version ${version})`);\n Publicidad.valueUserType = null;\n Publicidad.esMedioResponsive = Publicidad.isResponsiveMedia();\n Publicidad.notDisplayedSlots = [];\n\n // Cargamos las librerias de HeaderBidding y GPT lo antes posible (para no penalizar la visibilidad de la publicidad).\n showLog('En constructor. HeaderBidding:init');\n _processConfigGDPMedio.call(Publicidad);\n HBProviderManager.init(Publicidad.configGDPMedio);\n Publicidad.cargaLibreriaGPT();\n\n // Inicializacion de la libreria GPT\n googletag.cmd.push(function () {\n googletag.pubads().collapseEmptyDivs();\n if ((typeof Publicidad.configGDPMedio.enableKrux != \"undefined\") && (Publicidad.configGDPMedio.enableKrux) && (typeof Krux != \"undefined\") &&\n (typeof Krux.vocento != \"undefined\") && (typeof Krux.vocento.segments != \"undefined\") && (typeof Krux.vocento.user != \"undefined\")) {\n googletag.pubads().setTargeting('ksg', Krux.vocento.segments);\n googletag.pubads().setTargeting('kuid', Krux.vocento.user);\n }\n if (Publicidad.configGDPMedio.singleRequest) googletag.pubads().enableSingleRequest();\n if (Publicidad.configGDPMedio.syncRendering) googletag.pubads().enableSyncRendering();\n googletag.enableServices();\n\n // Disparamos el evento de GPT inicializada\n showLog(`En constructor. Disparamos evento ${GPT_READY}`);\n app.trigger(GPT_READY);\n Publicidad.gpt_inicializado = true;\n });\n\n // Disparamos el evento de GPT inicializado tras N segundos para liberar posibles recursos que esten bloqueados\n setTimeout(function () {\n if (!Publicidad.gpt_inicializado) {\n showWarn(`En constructor. Disparamos evento ${GPT_READY} tras timeout`);\n app.trigger(GPT_READY);\n }\n }, GPT_TIMEOUT);\n\n // Tratamiento de excepciones\n Publicidad.configGDP = Publicidad.comprobamosExcepciones();\n\n // Gestion de posiciones priorizadas\n prioritizedPositions = lookup(`priorizadas.${_deviceType}.listaPosiciones`, Publicidad.configGDP);\n Publicidad.hayPriorizadas = prioritizedPositions.length || false;\n Publicidad.listaPriorizadas = Publicidad.hayPriorizadas ? prioritizedPositions : '';\n Publicidad.listaArrayPriorizadas = Publicidad.listaPriorizadas.split(',');\n Publicidad.hayPriorizadas && showLog(`En constructor. Hay posiciones priorizadas: ${Publicidad.listaPriorizadas}`);\n Publicidad.completadasPriorizadas = false;\n\n // Gestion de posiciones retrasadas\n Publicidad.hayRetrasadas = (eval(`Publicidad.configGDP.retrasadas.${_deviceType}`) !== undefined) && (eval(`Publicidad.configGDP.retrasadas.${_deviceType}.listaPosiciones`) !== undefined) ? true : false;\n Publicidad.listaRetrasadas = Publicidad.hayRetrasadas ? eval(`Publicidad.configGDP.retrasadas.${_deviceType}.listaPosiciones`) : '';\n if (Publicidad.hayRetrasadas) showLog(`En constructor. Hay posiciones retrasadas: ${Publicidad.listaRetrasadas}`);\n\n // Tratamiento de targetings\n Publicidad.targetings = Publicidad.getTargetingsConfig();\n\n // Gestion de eventos de pintado de publicidad\n googletag.cmd.push(function () {\n // Gestion de evento slotRenderEnded\n googletag.pubads().addEventListener('slotRenderEnded', function (ev) {\n var div_id = ev.slot.getSlotElementId();\n var position = ev.slot.getTargeting('pos');\n var container$ = $(\"#\" + div_id);\n var paramsSlot = container$.data(\"params\");\n\n if (ev.isEmpty) {\n showLog(`En constructor. slotRenderEnded. La posicion ${position} isEmpty`);\n container$.trigger(SLOT_EMPTY);\n if (Publicidad.configGDPMedio.infoSlot) Publicidad.infoSlotRender(paramsSlot, false);\n } else {\n showLog(`En constructor. slotRenderEnded. La posicion ${position} ha sido pintada en el DIV ${div_id}`);\n container$.trigger(SLOT_RENDERED);\n if (Publicidad.configGDPMedio.infoSlot) Publicidad.infoSlotRender(paramsSlot, true);\n }\n\n // Comprobacion si tiene eventos post_callback o post_event\n if (paramsSlot) {\n if (paramsSlot.post_callback) {\n showLog(`En constructor. slotRenderEnded. La posicion ${position} tiene el siguiente postCallback: ${paramsSlot.post_callback}`);\n paramsSlot.post_callback();\n }\n\n if (paramsSlot.post_event) {\n showLog(`En constructor. slotRenderEnded. La posicion ${position} tiene el siguiente postEvent: ${paramsSlot.post_event}`);\n app.trigger(paramsSlot.post_event);\n }\n }\n\n // Quitamos la posicion de la lista de posiciones priorizadas\n var index = $.inArray(position[0], Publicidad.listaArrayPriorizadas);\n if (index != -1) {\n Publicidad.listaArrayPriorizadas.splice(index, 1);\n }\n\n // Quitamos la posicion de la lista de posiciones estandar encoladas\n if (Publicidad.hayPriorizadas && (Publicidad.listaEstandardDelayed.length > 0) && !Publicidad.esPriorizada(paramsSlot)) {\n index = $.inArray(position[0], Publicidad.listaEstandardDelayed);\n if (index != -1) {\n Publicidad.listaEstandardDelayed.splice(index, 1);\n }\n }\n\n // Si esta era la ultima priorizada pintamos las estandar\n if (!Publicidad.completadasPriorizadas && (Publicidad.listaArrayPriorizadas.length === 0)) {\n Publicidad.completadasPriorizadas = true;\n Publicidad.displayDelayed();\n }\n });\n\n // Gestion de evento impressionViewable\n googletag.pubads().addEventListener('impressionViewable', function (ev) {\n var div_id = ev.slot.getSlotElementId();\n var position = ev.slot.getTargeting('pos');\n var container$ = $(\"#\" + div_id);\n var paramsSlot = container$.data(\"params\");\n\n showLog(`En constructor. impressionViewable. La posicion ${position} es visible`);\n container$.trigger(SLOT_VIEWABLE);\n });\n });\n\n // Si hay posiciones priorizadas las pintamos e invocamos el pintado de las estandar una vez pintadas estas\n if (Publicidad.hayPriorizadas) {\n Publicidad.pintaPriorizadas(Publicidad.listaPriorizadas);\n\n // Si han transcurrido N segundos y todavia no se han lanzado las posiciones estandar las forzamos\n setTimeout(function () {\n if (Publicidad.listaEstandardDelayed.length > 0) {\n Publicidad.completadasPriorizadas = true;\n Publicidad.displayDelayed();\n }\n }, TIMEOUT_POSICIONES_ESTANDAR);\n }\n\n return this;\n }\n\n /**\n * Normalizacion de parametros\n */\n static normalizaParams(datos) {\n var params, xpath, idAds, offset;\n\n params = {};\n // Distinguimos entre si recibimos un objeto DOM(jQuery) o bien un objeto JSON\n if (datos instanceof $) {\n $.extend(params, DEFAULTS, {\n position: datos.data('voc-vam-position') || null,\n serverType: datos.data('voc-vam-servertype') || Publicidad.getServerType(params),\n hideNoAds: datos.data('voc-vam-hidenoads'),\n outOfPage: datos.data('voc-vam-outofpage'),\n defineSlot: datos.data('voc-vam-defineslot') || Publicidad.getDefineSlotParam(),\n refresh: datos.data('voc-vam-refresh'),\n responsive: datos.data('voc-vam-responsive'),\n pre_callback: datos.data('voc-vam-precallback') || '',\n pre_event: datos.data('voc-vam-preevent') || '',\n post_callback: datos.data('voc-vam-postcallback') || '',\n post_event: datos.data('voc-vam-postevent') || '',\n oas: datos.data('voc-vam-oas') || '',\n tags: datos.data('voc-vam-tags')\n });\n } else {\n $.extend(params, DEFAULTS, {\n position: datos.position || null,\n id: datos.id || null,\n serverType: datos.serverType || Publicidad.getServerType(params),\n hideNoAds: datos.hideNoAds,\n outOfPage: datos.outOfPage,\n defineSlot: datos.defineSlot || Publicidad.getDefineSlotParam(),\n refresh: datos.refresh,\n responsive: datos.responsive,\n pre_callback: datos.pre_callback || '',\n pre_event: datos.pre_event || '',\n post_callback: datos.post_callback || '',\n post_event: datos.post_event || '',\n oas: datos.oas || '',\n tags: datos.tags\n });\n }\n\n // Si falta algun parametro obligatorio devolvemos null\n if (params.position === null) {\n showWarn('ERROR: El parametro position es obligatorio');\n return null;\n }\n\n if (!Publicidad.existePosEnConfigGDPMedio(params.position)) {\n showWarn(`ERROR: La posicion ${params.position} no existe en configGDPMedio`);\n return null;\n }\n\n // Tratamiento del parametro OutOfPage\n if (typeof params.outOfPage !== 'boolean') {\n // Valor por defecto\n params.outOfPage = false;\n if (Publicidad.tipoFormatoJSON >= JSON_GDP2_2) {\n xpath = lookup(`configGDPMedio.posicion_${_deviceType}.${params.position}.outofpage`, Publicidad);\n params.outOfPage = typeof xpath !== 'boolean' ? false : xpath;\n }\n }\n\n // DIV que contendra la publicidad\n idAds = Publicidad.getIdDiv(params);\n if (!$(`#${idAds}`).length && $(`[data-voc-vam-position = '${params.position}']`, Publicidad.context$).length && (typeof $(`[data-voc-vam-position = '${params.position}']`, Publicidad.context$).attr('id') === 'undefined')) {\n $(`[data-voc-vam-position = '${params.position}']`, Publicidad.context$).attr('id', idAds);\n }\n params.id = idAds;\n\n // Lectura de targetings globales por posicion\n if (!params.tags) {\n params.tags = {};\n if (Publicidad.tipoFormatoJSON >= JSON_GDP2_2) {\n params.tags = lookup(`configGDPMedio.posicion_${_deviceType}.${params.position}.targetings`, Publicidad) || {};\n }\n }\n\n // Comprobamos si tiene offset por posicion\n offset = lookup(`configGDP.posicion_${_deviceType}.${params.position}.offset`, Publicidad);\n if (offset && typeof offset !== 'object') {\n $(`#${params.id}`).attr('data-offset', offset);\n showLog(`Offset: ${offset} configurado para la posición: ${params.position}`);\n }\n\n // Construimos el parametro responsive en caso de que no venga relleno en la propia llamada\n if (!params.outOfPage && !params.responsive && Publicidad.esMedioResponsive) params.responsive = Publicidad.getResponsiveParam(params);\n\n return params;\n }\n\n /**\n * Funcion que genera el scriptText que pinta la publicidad.\n * @param object params\n * @return string\n */\n static defineSlot(params) {\n var scriptText, legacyCmvkey;\n var size_dc = Publicidad.getSizesGoogle(params.position);\n var idAds = Publicidad.getIdDiv(params);\n var targetingsTags = {};\n\n // Codigo para ocultar el div si no hay publi\n var hideText = params.hideNoAds ? '.setCollapseEmptyDiv(true)' : '';\n\n // Codigo para anadir tags en el caso que la posicion de publi lo necesite\n var targetingText = '';\n if (params.tags) { // si llegan en la funcion ads.print\n targetingsTags = params.tags;\n }\n\n var tag;\n for (tag in targetingsTags) {\n targetingText += `.setTargeting(\"${tag}\", \"${targetingsTags[tag]}\")`;\n }\n for (tag in Publicidad.targetings) {\n targetingText += `.setTargeting(\"${tag}\", \"${Publicidad.targetings[tag]}\")`;\n }\n\n // Targeting con tipo de usuario de Gigya\n if (Publicidad.valueUserType === null) Publicidad.valueUserType = Publicidad.getValueUser(getUserType());\n var cadenaTipoDispositivo = (_deviceType == 'mobile') ? 'm' : 'w';\n targetingText += `.setTargeting('st', '${Publicidad.valueUserType}').setTargeting('stt', '${cadenaTipoDispositivo}${Publicidad.valueUserType}')`;\n\n // Se comprueba si se fuerza algun targeting via URL con el parametro vam_cmvkey\n var decryptedURL = Publicidad.decryptURL();\n if (((typeof top.location !== 'undefined') && (top.location.href.indexOf('vam_cmvkey=') > -1 || top.location.href.indexOf('cmvkey=') > -1)) || (decryptedURL !== '')) {\n legacyCmvkey = top.location.href.indexOf('vam_cmvkey=') > -1 ? 'vam_cmvkey' : 'cmvkey';\n var pattern = new RegExp(`(\\\\?|&)${legacyCmvkey}=([^?&]+)`);\n var esValida = (decryptedURL !== '') ? pattern.exec(decryptedURL) : pattern.exec(top.location.href);\n\n if (esValida) {\n var targetingsURL = esValida[2];\n\n try {\n var targetingsURL_decoded = decodeURIComponent(targetingsURL);\n var targetingsURL_trozos = targetingsURL_decoded.split(',');\n\n for (var i = 0; i < targetingsURL_trozos.length; i++) {\n var clave_y_valor = targetingsURL_trozos[i].split(\"=\");\n\n var trozo_clave = clave_y_valor[0];\n var trozo_valor = clave_y_valor[1];\n targetingText += `.setTargeting(\"${trozo_clave}\", \"${trozo_valor}\")`;\n }\n } catch (e) {\n showWarn(`ERROR en defineSlot procesando ${legacyCmvkey}: ${e}`);\n }\n }\n }\n\n // Incluimos los topics como targeting si asi corresponde\n try {\n var topics = Publicidad.getTopics(false);\n if (topics.length > 0) {\n targetingText += `.setTargeting(\"topics\", \"${topics}\")`;\n }\n } catch (e) {\n showWarn(`ERROR en defineSlot procesando enableTopics: ${e}`);\n }\n\n // Se comprueba si enableTpag esta habilitado\n try {\n if ((typeof Publicidad.configGDPMedio != \"undefined\") && (typeof Publicidad.configGDPMedio.enableTpag != \"undefined\") && (Publicidad.configGDPMedio.enableTpag)) {\n targetingText += `.setTargeting(\"tpag\", \"${Publicidad.tipoPagina}\")`;\n }\n } catch (e) {\n showWarn(`ERROR en defineSlot procesando tpag: ${e}`);\n }\n\n // Comprobaciones para medios responsives\n var objetoMapping = {};\n var sizeMapping = '';\n var defineSizeMapping = '';\n if (!params.outOfPage && params.responsive && $.isArray(params.responsive) && params.responsive.length > 0) {\n objetoMapping = Publicidad.getSizeMapping(params);\n sizeMapping = ((typeof objetoMapping !== 'undefined') && (typeof objetoMapping.definicion !== 'undefined')) ? objetoMapping.definicion : '';\n defineSizeMapping = ((typeof objetoMapping !== 'undefined') && (typeof objetoMapping.script !== 'undefined')) ? objetoMapping.script : '';\n }\n\n if (!params.outOfPage) {\n if (params.defineSlot) {\n scriptText = `${sizeMapping}${Publicidad.getNombreSlot(params)} = googletag.defineSlot('${Publicidad.getOasSitepage(params)}', ${size_dc}, '${idAds}')${defineSizeMapping}.setTargeting('pos','${params.position}')${targetingText}${hideText}.addService(googletag.pubads());`;\n }\n } else if (params.defineSlot) {\n scriptText = `${sizeMapping}${Publicidad.getNombreSlot(params)} = googletag.defineOutOfPageSlot('${Publicidad.getOasSitepage(params)}', '${idAds}')${defineSizeMapping}.setTargeting('pos','${params.position}')${targetingText}${hideText}.addService(googletag.pubads());`;\n }\n\n googletag.cmd.push(function () {\n eval(scriptText);\n Publicidad.notDisplayedSlots.push(params.position);\n showLog(`En defineSlot. defineSlot: ${scriptText}`);\n\n var key = Publicidad.getClavePosicionInsertada(params);\n Publicidad.listaPosicionesInsertadas[key] = scriptText;\n Publicidad.listaIdsInsertados.push(idAds);\n });\n\n return scriptText;\n }\n\n /**\n * Hace display de una posicion\n */\n static display(params) {\n // Comprobamos si la posicion esta en la lista de posiciones definidas y pendientes de display\n var index = $.inArray(params.position, Publicidad.notDisplayedSlots);\n if (index != -1) {\n var idDiv = Publicidad.getIdDiv(params);\n if ($('#' + idDiv).length) {\n googletag.cmd.push(function () {\n googletag.display(idDiv);\n\n // Si singleRequest esta habilitado un unico display sirve para todas las posiciones para las que hemos hecho defineSlot previamente. En caso contrario solo quitamos la posicion concreta de la lista\n if (Publicidad.configGDPMedio.singleRequest) {\n Publicidad.notDisplayedSlots.length = 0;\n } else {\n Publicidad.notDisplayedSlots.splice(index, 1);\n }\n });\n } else {\n showWarn(`En display. ERROR: El DIV con ID ${idDiv} no existe`);\n }\n }\n }\n\n /**\n * Funcion que obtiene el valor de oas del fichero de configuracion.\n * @return string\n */\n static getOasSitepage(params) {\n var oasSitepage, legacyAdUnit;\n params = params || {};\n\n if ((typeof params.oas != \"undefined\") && (params.oas !== '')) {\n oasSitepage = params.oas;\n } else {\n oasSitepage = (typeof eval(`Publicidad.configGDP.OAS.${_deviceType}.${Publicidad.tipoPagina}`) != \"undefined\") ? eval(`Publicidad.configGDP.OAS.${_deviceType}.${Publicidad.tipoPagina}`) : '';\n }\n\n oasSitepage = oasSitepage.trim();\n\n // Comprobamos si se fuerza un adunit por defecto via URL\n try {\n var decryptedURL = Publicidad.decryptURL();\n if (((typeof top.location !== 'undefined') && (top.location.href.indexOf('vam_adUnit=') > -1 || top.location.href.indexOf('adunit=') > -1)) || decryptedURL !== '') {\n legacyAdUnit = top.location.href.indexOf('vam_adUnit=') > -1 ? 'vam_adUnit' : 'adunit';\n let pattern = new RegExp(`(\\\\?|&)${legacyAdUnit}=([^?&]+)`);\n let esValida = (decryptedURL !== '') ? pattern.exec(decryptedURL) : pattern.exec(top.location.href);\n\n if (esValida) {\n oasSitepage = (esValida[2].indexOf('/' + GPT_ID_VOCENTO + '/') != -1) ? esValida[2] : '/' + GPT_ID_VOCENTO + '/' + esValida[2];\n }\n }\n } catch (err) {}\n\n // Comprobamos si tiene alguna macro\n try {\n let pattern = /{(\\/)?edicion(\\/)?}/;\n let contieneMacroEdicion = pattern.exec(oasSitepage);\n if (contieneMacroEdicion) {\n // Lectura de la edicion del medio\n let cadenaEdicion = Publicidad.getEdition();\n\n if (contieneMacroEdicion[0].startsWith('{\\/') && (cadenaEdicion !== '')) cadenaEdicion = \"\\/\" + cadenaEdicion;\n if (contieneMacroEdicion[0].endsWith('\\/}') && (cadenaEdicion !== '')) cadenaEdicion += \"\\/\";\n\n oasSitepage = oasSitepage.replace(contieneMacroEdicion[0], cadenaEdicion);\n }\n } catch (err) {}\n\n // Guardamos el valor del adunit calculado por si no lo esta\n if (typeof Publicidad.configGDP.OAS.adunit === 'undefined') Publicidad.configGDP.OAS.adunit = oasSitepage;\n\n return oasSitepage;\n }\n\n /**\n * Funcion que obtiene las medidas en caso de que sea responsive.\n * @param object responsive\n * @return string sizeMapping\n */\n static getSizeMapping(params) {\n var objetoMapping = {\n definicion: '',\n script: ''\n };\n\n // @var responsive \n objetoMapping.definicion = 'var mapping = googletag.sizeMapping()';\n var responsive = params.responsive;\n\n for (var i = 0; i < responsive.length; i++) {\n var add_size_p = '';\n // @var responsive_p Pair viewportSize, slotSize\n var responsive_p = responsive[i];\n\n if (responsive_p.length === 2) {\n // @var viewportSize \n var viewportSize = responsive_p[0];\n // @var responsive_ad \n var responsive_ad = responsive_p[1];\n if (typeof responsive_ad === 'string') {\n if (responsive_ad.indexOf('fluid') !== -1) {\n responsive_ad = POSITION_FLUID;\n } else {\n responsive_ad = Publicidad.getSizesGoogle(responsive_ad);\n if ((typeof responsive_ad !== 'undefined') && (typeof responsive_ad === 'string')) responsive_ad = JSON.parse(responsive_ad);\n }\n }\n if ($.isArray(viewportSize) && viewportSize.length === 2 && ($.isArray(responsive_ad) || (responsive_ad === POSITION_FLUID))) {\n add_size_p = '[' + viewportSize[0] + ',' + viewportSize[1] + '],';\n if (responsive_ad.length > 0 && $.isArray(responsive_ad[0])) {\n // @var responsive_ad \n add_size_p += '[';\n for (var j = 0; j < responsive_ad.length; j++) {\n // @var singleSize \n var singleSize = responsive_ad[j];\n if (singleSize.length === 2) {\n add_size_p += (j === 0 ? '[' : ',[') + singleSize[0] + ',' + singleSize[1] + ']';\n }\n }\n add_size_p += ']';\n } else if (responsive_ad.length === 2) {\n // @var responsive_ad \n add_size_p += '[' + responsive_ad[0] + ',' + responsive_ad[1] + ']';\n } else if (responsive_ad === POSITION_FLUID) {\n add_size_p += POSITION_FLUID;\n } else {\n add_size_p += '[]';\n }\n objetoMapping.definicion += `.addSize(${add_size_p})`;\n } else {\n showWarn(`ERROR En getSizeMapping: Parametro responsive malformado en posicion ${params.position}. responsive: ${responsive}`);\n return;\n }\n } else {\n showWarn(`ERROR En getSizeMapping: Parametro responsive malformado en posicion ${params.position}. responsive: ${responsive}`);\n return;\n }\n }\n\n objetoMapping.definicion += '.build();';\n objetoMapping.script = '.defineSizeMapping(mapping)';\n\n return objetoMapping;\n }\n\n /**\n * Convierte el tipo de usuario de Gigya (en formato adaptado para publicidad)\n */\n static getValueUser(userType) {\n var valueUser = \"a\";\n\n if ((typeof userType == 'undefined') || (userType === null)) userType = getUserType();\n\n var arrayUsers = {\n suscriptor: \"s\",\n trial: \"t\",\n registrado: \"r\",\n anonimo: \"a\"\n };\n\n if (userType in arrayUsers) {\n valueUser = arrayUsers[userType];\n }\n\n return valueUser;\n }\n\n /**\n * Calcula el array de dimensiones para una posicion dada. Opcionalmente se puede indicar un tipo de dispositivo (si va vacio se usa el tipo actual)\n * @param {string} position\n * @param {string} tipoDispositivo\n * @return object\n */\n static getSizesGoogle(position, dispositivo) {\n var size, defineSlot;\n\n dispositivo = dispositivo || _deviceType;\n size = '[]';\n if (Publicidad.tipoFormatoJSON >= JSON_GDP2_1) {\n if (`posicion_${dispositivo}` in Publicidad.configGDPMedio && position in Publicidad.configGDPMedio[`posicion_${dispositivo}`] && 'dimensiones' in Publicidad.configGDPMedio[`posicion_${dispositivo}`][position]) {\n size = Publicidad.configGDPMedio[`posicion_${dispositivo}`][position].dimensiones;\n }\n } else if ('posiciones' in Publicidad.configGDPMedio && position in Publicidad.configGDPMedio.posiciones) {\n size = Publicidad.configGDPMedio.posiciones[position];\n }\n defineSlot = Publicidad.getDefineSlotParam();\n\n if (size.indexOf('[fluid]') !== -1) {\n size = size.replace('[fluid]', '\\'fluid\\'');\n\n if (!defineSlot) return ['fluid'];\n }\n\n return (defineSlot) ? size : JSON.parse(size);\n }\n\n /**\n * Version de la libreria\n */\n version() {\n return version;\n }\n\n /**\n * Funcion que busca el medio en el que nos encontramos, dentro del fichero de configuracion\n * @return string\n */\n static getMedio() {\n var medio = (typeof Publicidad.configGDPMedio.medio != \"undefined\") ? Publicidad.configGDPMedio.medio : '';\n return medio;\n }\n\n /**\n * Devuelve la version del tipo de formato JSON\n */\n static getTipoFormatoJSON() {\n var tipo = JSON_GDP2_0;\n\n if ((typeof Publicidad.configGDPMedio !== \"undefined\") && (typeof Publicidad.configGDPMedio.activo !== \"undefined\")) {\n tipo = JSON_GDP2_2;\n } else if ((typeof Publicidad.configGDPMedio !== \"undefined\") && (typeof Publicidad.configGDPMedio.tiposPublicidad !== \"undefined\")) {\n tipo = JSON_GDP2_1;\n }\n\n return tipo;\n }\n\n /**\n * Detectamos el tipo de pagina a partir del patron de la URL.\n * NOTA: Cada medio tiene sus propias reglas de URLs por lo que tiene su propia funcion para calcularlas\n */\n static getTipoPagina() {\n var tipoPagina = 'portada';\n if (Publicidad.medio == 'abc' || Publicidad.medio == 'lavozdigital' || Publicidad.medio == 'abcdesevilla') {\n tipoPagina = Publicidad.getTipoPaginaABC();\n } else if (Publicidad.medio == 'mujerhoy') {\n tipoPagina = Publicidad.getTipoPaginaMujerhoy();\n } else {\n tipoPagina = Publicidad.getTipoPaginaPortalesLocales();\n }\n\n return tipoPagina;\n }\n\n /**\n * Calculo del tipo de pagina en funcion de la URL para los medios de ABC (ABC, Sevilla y La Voz Digital)\n */\n static getTipoPaginaABC() {\n var reVideosAntiguos = /\\/videos\\/(.*)?\\/\\d{6}\\/\\d{2}\\/((?!index.html).)*.html/;\n var reVideos = /_video.html/;\n var esVideo = (reVideos.exec(location.pathname) || reVideosAntiguos.exec(location.pathname));\n if (esVideo) return 'video';\n\n var reGaleriasAntiguos2 = /\\/multimedia\\/fotos\\/(.*)?\\/((?!index.html).)*.html/;\n var reGaleriasAntiguos = /\\/fotos-(.*)?\\/\\d{8}\\/((?!index.html).)*.html/;\n var reGalerias = /_galeria.html/;\n var esGaleria = (reGalerias.exec(location.pathname) || reGaleriasAntiguos.exec(location.pathname) || reGaleriasAntiguos2.exec(location.pathname));\n if (esGaleria) return 'galeria';\n\n var reGraficos = /\\/multimedia\\/(graficos\\/(.)*|infografias)\\/((?!index.html).)*.html/;\n var esGrafico = reGraficos.exec(location.pathname);\n if (esGrafico) return 'grafico';\n\n var reNoticiasAntiguos = /\\d{8}\\/(.*)?((?!index.html).)*.html/;\n var reNoticias = /(_noticia.html|_directo.html)/;\n var esNoticia = (reNoticias.exec(location.pathname) || reNoticiasAntiguos.exec(location.pathname));\n if (esNoticia) return 'noticia';\n\n return 'portada';\n }\n\n /**\n * Calculo del tipo de pagina en funcion de la URL para Mujerhoy\n */\n static getTipoPaginaMujerhoy() {\n var reVideos = /-vi.html/;\n var reVideosOld = /\\/videos\\/(.*)?\\/\\d{6}\\/\\d{2}\\/.*-mm.html/;\n var reVideosBlogs = /\\/videos\\/\\d{4}\\/\\d{2}\\/\\d{2}\\/(.*).html/;\n var esVideo = (location.hostname.indexOf('blogs.') == -1) ? (reVideos.exec(location.pathname) || reVideosOld.exec(location.pathname)) : reVideosBlogs.exec(location.pathname);\n if (esVideo) return 'video';\n\n var reGalerias = /-ga.html/;\n var reGaleriasOld = /^\\/galerias\\/(.*)?\\d{6}\\/\\d{2}\\/.*-mm.html/;\n var reGaleriasBlogs = /\\/galerias\\/\\d{4}\\/\\d{2}\\/\\d{2}\\/(.*).html/;\n var esGaleria = (location.hostname.indexOf('blogs.') == -1) ? (reGalerias.exec(location.pathname) || reGaleriasOld.exec(location.pathname)) : reGaleriasBlogs.exec(location.pathname);\n if (esGaleria) return 'galeria';\n\n var reNoticias = /\\/\\d{6}\\/\\d{2}\\/((?!index.html).)*.html/;\n var reNoticiasBlogs = /\\/\\d{4}\\/\\d{2}\\/\\d{2}\\/((?!index.html).)*.html/;\n var reNoticiasRecetas = /\\/\\d{6}\\/((?!index.html).)*.html/;\n var esNoticia = false;\n if (location.hostname.indexOf('blogs.') != -1) esNoticia = reNoticiasBlogs.exec(location.pathname);\n else if (location.hostname.indexOf('recetas.') != -1) esNoticia = reNoticiasRecetas.exec(location.pathname);\n else esNoticia = reNoticias.exec(location.pathname);\n if (esNoticia) return 'noticia';\n\n return 'portada';\n }\n\n /**\n * Calculo del tipo de pagina en funcion de la URL para los Portales Locales\n */\n static getTipoPaginaPortalesLocales() {\n var reVideos = /-(vi|virc|vivo)(_amp)?.html/;\n var reVideosOld = /^\\/videos\\/(.*)?\\/\\d{6}\\/\\d{2}\\/.*-mm.html/;\n var esVideo = (reVideos.exec(location.pathname) || reVideosOld.exec(location.pathname));\n if (esVideo) return 'video';\n\n var reGalerias = /-(ga|garc|gavo|ft|ftrc|ftvo)(_amp)?.html/;\n var reGaleriasOld = /^\\/fotos\\/(.*)?\\d{6}\\/\\d{2}\\/.*-mm.html/;\n var esGaleria = (reGalerias.exec(location.pathname) || reGaleriasOld.exec(location.pathname));\n if (esGaleria) return 'galeria';\n\n var reNoticias = /-(nt|ntrc|ntvo)(_amp)?.html/;\n var reNoticiasOld = /\\/\\d{6}\\/\\d{2}\\/((?!index.html).)*.html/;\n var esNoticia = (reNoticias.exec(location.pathname) || reNoticiasOld.exec(location.pathname));\n if (esNoticia) return 'noticia';\n\n // NOTA: En PLs, a nivel de publicidad, contemplaremos graficos y videochats como noticias\n var reGraficos = /-(in|inrc|invo)(_amp)?.html/;\n var reGraficosOld = /^\\/graficos\\/(.*)?\\/\\d{6}\\/\\d{2}\\/.*-mm.html/;\n var esGrafico = (reGraficos.exec(location.pathname) || reGraficosOld.exec(location.pathname));\n //if (esGrafico) return 'grafico';\n if (esGrafico) return 'noticia';\n\n var reVideochats = /\\/videochats\\/((?!index.html).)\\w+/;\n var esVideochat = reVideochats.exec(location.pathname);\n //if (esVideochat) return 'videochat';\n if (esVideochat) return 'noticia';\n\n return 'portada';\n }\n\n /**\n * Comprobacion de si existen excepciones para la pagina donde nos encontramos.\n * @return object configGDP\n */\n static comprobamosExcepciones() {\n var configGDPAux = Publicidad.configGDP;\n if ((typeof Publicidad.configGDPMedio != 'undefined') && (typeof Publicidad.configGDPMedio.excepciones != 'undefined') && (Object.keys(Publicidad.configGDPMedio.excepciones).length > 0)) {\n showLog('En comprobamosExcepciones. Hay excepciones configuradas');\n\n $.each(Publicidad.configGDPMedio.excepciones, function (key, value) {\n if (key != \"priorizadas\" && key != \"retrasadas\") {\n if (location.pathname == key || location.pathname.match(key)) {\n var unix = Math.round(new Date() / 1000);\n var fechaini = value.fecha_in;\n var fechafin = value.fecha_fin;\n if ((fechaini === 0 || fechaini <= unix) && (fechafin === 0 || unix <= fechafin)) {\n configGDPAux = value;\n showLog(`En comprobamosExcepciones. Aplicamos la siguiente excepcion:\"${key}\"`);\n }\n }\n }\n });\n }\n\n return configGDPAux;\n }\n\n /**\n * Funcion que obtiene los tag definidos en los archivos de configuración\n * @return object\n */\n static getTargetingsConfig() {\n var targetingsMedio = (typeof Publicidad.configGDPMedio.targetings != \"undefined\") ? Publicidad.configGDPMedio.targetings : '';\n var targetingsPagina = (typeof Publicidad.configGDP.targetings != \"undefined\") ? Publicidad.configGDP.targetings : '';\n var targetings = $.extend({}, targetingsMedio, targetingsPagina);\n return targetings;\n }\n\n /**\n * Funcion que comprueba si una posicion esta priorizada\n */\n static esPriorizada(params) {\n var lista = Publicidad.listaPriorizadas.split(',');\n for (var i = 0; i < lista.length; i++) {\n if (lista[i] == params.position) {\n return true;\n }\n }\n return false;\n }\n\n /**\n * Funcion que comprueba si una posicion es retrasada\n */\n static esRetrasada(params) {\n var lista = Publicidad.listaRetrasadas.split(',');\n for (var i = 0; i < lista.length; i++) {\n if (lista[i] == params.position) {\n return true;\n }\n }\n return false;\n }\n\n /**\n * Lanza los printAds que se han encolado cuando hay priorizadas\n */\n static displayDelayed() {\n showLog('En displayDelayed.');\n $.each(Publicidad.listaEstandardDelayed, function (i, params) {\n Publicidad.printAds(params);\n });\n }\n\n /**\n * Generate position identifier\n * FUTURE: Clean this method when all MEDIAS use the new ADS strategy\n * @param {object} params\n * @return {string}\n */\n static getIdDiv(params) {\n var adsId, dynamicId;\n\n dynamicId = _dynamicId ? `-${_dynamicId}` : '';\n if (params.id && typeof params.id === 'string') {\n adsId = params.id.indexOf(OLD_PREFIX) > -1 ? params.id : `${OLD_PREFIX}${params.id}`;\n if (!$(`#${adsId}`).length) {\n adsId = params.id.indexOf(NEW_SUFFIX) > -1 ? params.id : `${params.id}${NEW_SUFFIX}${dynamicId}`;\n }\n } else {\n adsId = `${OLD_PREFIX}${params.position}`;\n if (!$(`#${adsId}`).length) {\n adsId = `${params.position}${NEW_SUFFIX}${dynamicId}`;\n }\n }\n\n return adsId;\n }\n\n /**\n * Funcion para pintar la publicidad priorizada\n * @return object\n */\n static pintaPriorizadas() {\n showLog(`En pintaPriorizadas. Pintaremos las siguientes posiciones: ${Publicidad.listaPriorizadas}`);\n var sonPosicionesPriorizadas = true;\n var lista = Publicidad.listaPriorizadas.split(',');\n Publicidad.pintaListaPosiciones(lista, sonPosicionesPriorizadas);\n return this;\n }\n\n /**\n * Funcion que recorre y pinta una lista de posiciones.\n * Si singleRequest esta habilitado las posiciones priorizadas funcionan como un Roadblock y se piden todas juntas (no llevaran eventos ni callbacks)\n */\n static pintaListaPosiciones(listaPositions, sonPosicionesPriorizadas) {\n if (Publicidad.configGDPMedio.singleRequest && sonPosicionesPriorizadas) {\n showLog('En pintaListaPosiciones. SingleRequest habilitado y hay posiciones priorizadas -> las pedimos como Roadblock');\n\n googletag.cmd.push(function () {\n let posCuyoDivExiste = null;\n\n for (var i = 0; i < listaPositions.length; i++) {\n var params = {\n position: listaPositions[i]\n };\n\n if (!Publicidad.existePosEnConfigGDPMedio(params.position)) {\n showWarn(`ERROR: La posicion priorizada ${params.position} no existe en configGDPMedio`);\n continue;\n }\n\n if (!Publicidad.isActive(params)) continue;\n\n // Recuperamos los parametros del DIV en caso de que exista en la pagina\n var container$ = $(`[data-voc-vam-position = '${params.position}']`, Publicidad.context$);\n if (container$.length) {\n params = Publicidad.normalizaParams(container$);\n if (posCuyoDivExiste == null) posCuyoDivExiste = params;\n } else {\n // NOTE: find legacy DIV\n container$ = $(`#${Publicidad.getIdDiv(params)}`);\n if (container$.length) {\n params = Publicidad.normalizaParams(params);\n if (posCuyoDivExiste == null) {posCuyoDivExiste = params;}\n } else {\n showWarn(`En pintaListaPosiciones. No existe el DIV de la posicion priorizada ${params.position}`);\n }\n }\n if ('id' in params) {\n showLog(`En pintaListaPosiciones. Llamando a defineSlot: ${JSON.stringify(params)}`);\n Publicidad.defineSlot(params);\n }\n }\n\n if (posCuyoDivExiste == null) {\n showError('ERROR En pintaListaPosiciones. No existe el DIV de ninguna de las posiciones priorizadas en la pagina, por lo que no se hara el display');\n }\n else {\n params = posCuyoDivExiste;\n }\n\n // NOTE: If there is Header Bidding wait for bidders promises\n if (HBProviderManager.isActive()) {\n showLog('pintaListaPosiciones::Waiting for HB`s promises to be solved');\n app.when(HEADER_BIDDING_READY).then(function() {\n showLog(`pintaListaPosiciones::HB promises resolved`);\n HBProviderManager.setTargetings();\n showLog(params);\n Publicidad.display(params);\n });\n } else {\n showLog(`En pintaListaPosiciones. Print without wait HB`);\n Publicidad.display(params);\n }\n });\n } else {\n showLog('En pintaListaPosiciones. SingleRequest NO habilitado o NO hay posiciones priorizadas');\n googletag.cmd.push(function () {\n for (var i = 0; i < listaPositions.length; i++) {\n var params = {\n position: listaPositions[i]\n };\n\n if (!Publicidad.existePosEnConfigGDPMedio(params.position)) {\n showWarn(`En pintaListaPosiciones. ERROR: La posicion priorizada ${params.position} no existe en configGDPMedio`);\n continue;\n }\n\n if (!Publicidad.isActive(params)) continue;\n\n // Recuperamos los paramteros del DIV en caso de que exista en la pagina\n var container$ = $(`[data-voc-vam-position = '${params.position}']`, Publicidad.context$);\n if (container$.length) {\n params = Publicidad.normalizaParams(container$);\n } else {\n params = Publicidad.normalizaParams(params);\n }\n\n Publicidad.printAds(params);\n }\n });\n }\n }\n\n /**\n * Funcion que obtiene el valor del defineSlot en nuestro objecto de configuracion\n * @return string\n */\n static getDefineSlotParam() {\n return ((typeof Publicidad.configGDPMedio.defineSlot != \"undefined\") ? Publicidad.configGDPMedio.defineSlot : '');\n }\n\n static isResponsiveMedia() {\n return (typeof Publicidad.configGDPMedio.responsive.esResponsive != \"undefined\") ? Publicidad.configGDPMedio.responsive.esResponsive : false;\n }\n\n /**\n * Construye el parametro responsive de la posicion en caso de que sea responsive\n * @return object\n */\n static getResponsiveParam(params) {\n var tieneParamResponsive = (params.responsive && $.isArray(params.responsive) && params.responsive.length > 0);\n\n // No sera posicion responsive\n if (!tieneParamResponsive && !Publicidad.esMedioResponsive) {\n return false;\n }\n // Tiene parametro responsive en la llamada\n else if (tieneParamResponsive) {\n return params.responsive;\n }\n // No tiene parametro responsive en la llamada pero es medio responsive por lo que creamos el parametro con resoluciones y dimensiones correspondientes\n else if (Publicidad.esMedioResponsive) {\n return Publicidad.createResponsive(params);\n } else {\n return false;\n }\n }\n\n /**\n * Funcion que crea el objeto responsive cuando un medio es responsive y la llamada no tiene el parametro relleno\n * @return object\n */\n static createResponsive(params) {\n var resolucionMinima, resolucionMaxima, responsive = [];\n var size_dc;\n\n var dispositivos = Publicidad.configGDPMedio.dispositivos;\n for (var i = 0; i < dispositivos.length; i++) {\n var dispositivo = dispositivos[i];\n\n if (!Publicidad.existePosEnConfigGDPMedio(params.position, dispositivo)) break;\n\n if (typeof eval(`Publicidad.configGDPMedio.responsive.resolucion${dispositivo}`) !== \"undefined\") {\n var anchoMinimo = (typeof eval(`Publicidad.configGDPMedio.responsive.resolucion${dispositivo}.resolucionMinima`) !== \"undefined\") ? eval(`Publicidad.configGDPMedio.responsive.resolucion${dispositivo}.resolucionMinima`) : '';\n var anchoMaximo = (typeof eval(`Publicidad.configGDPMedio.responsive.resolucion${dispositivo}.resolucionMaxima`) !== \"undefined\") ? eval(`Publicidad.configGDPMedio.responsive.resolucion${dispositivo}.resolucionMaxima`) : '';\n\n if (anchoMinimo !== '' || anchoMaximo !== '') {\n var dimension = [\n parseInt(anchoMinimo) || '0',\n ALTOS_MINIMOS_DISPOSITIVOS[dispositivo]\n ];\n\n var size = Publicidad.getSizesGoogle(params.position, dispositivo);\n try {\n if ((size !== null) && (size.indexOf('fluid') !== -1)) {\n size_dc = 'fluid';\n } else {\n size_dc = JSON.parse(size);\n }\n } catch (e) {\n showWarn(`ERROR en createResponsive procesando la posicion ${params.position}: ${e}`);\n size_dc = size;\n }\n\n // Insertamos el mapeo de dimensiones de manera ordenada de menor a mayor ancho\n var encontrado = false;\n for (let index = 0;\n (index < responsive.length) && !encontrado; index++) {\n let valorAncho = responsive[index][0][0];\n if (dimension[0] < valorAncho) {\n responsive.splice(index, 0, [dimension, size_dc]);\n encontrado = true;\n }\n }\n\n if (!encontrado) responsive.push([dimension, size_dc]);\n }\n }\n }\n\n return responsive;\n }\n\n /**\n * Devuelve el serverType de la posicion pasada como parametro\n */\n static getServerType(params) {\n var serverType = 'google';\n\n if (Publicidad.tipoFormatoJSON >= JSON_GDP2_1) {\n try {\n var xpath = `Publicidad.configGDPMedio.posicion_${tipoDispositivo}[\"${params.position}\"]`;\n serverType = (typeof eval(xpath) !== \"undefined\") && (typeof eval(xpath + '.tipo') !== \"undefined\") ? eval(xpath + '.tipo') : 'google';\n } catch (err) {}\n }\n\n return serverType;\n }\n\n /**\n * Check if position exist in media config.\n *\n * @param {string} position\n * @param {string} dispositivo\n * @returns {boolean} - TRUE if exist, FALSE otherwise\n */\n static existePosEnConfigGDPMedio(position, dispositivo) {\n var existe, idAds;\n\n dispositivo = dispositivo || _deviceType;\n existe = false;\n // Comprobamos que exista en la lista de posiciones de configGDPMedio\n if (Publicidad.tipoFormatoJSON >= JSON_GDP2_1) {\n if (`posicion_${dispositivo}` in Publicidad.configGDPMedio && position in Publicidad.configGDPMedio[`posicion_${dispositivo}`]) {\n existe = true;\n }\n } else if ('posiciones' in Publicidad.configGDPMedio && position in Publicidad.configGDPMedio.posiciones) {\n existe = true;\n }\n\n // Si no existe la posicion ocultamos su DIV contenedor\n if (!existe) {\n idAds = Publicidad.getIdDiv({position});\n $('#' + idAds).length && $('#' + idAds).hide();\n }\n\n return existe;\n }\n\n /**\n * Checkea si una posicion esta activa o desactivada\n * @param object params\n * @return boolean\n */\n static isActive(params) {\n // Comprobamos si se ha forzado via URL que todas las posiciones esten activas\n if ((typeof Publicidad.configGDPMedio !== \"undefined\") && (typeof Publicidad.configGDPMedio.forceActivePosition !== \"undefined\") && Publicidad.configGDPMedio.forceActivePosition) {\n return true;\n }\n\n var container$ = $(`#${Publicidad.getIdDiv(params)}`);\n\n //Comprobamos que se ha anadido la configuracion necesaria para el tipo de dispositivo\n var tipoDispositivoAux = _deviceType;\n\n if ((typeof eval(`Publicidad.configGDP.posicion_${tipoDispositivoAux}`) !== \"undefined\") && (typeof eval(`Publicidad.configGDP.posicion_${tipoDispositivoAux}[\"${params.position}\"]`) !== \"undefined\")) {\n var desactivadoen = (typeof eval(`Publicidad.configGDP.posicion_${tipoDispositivoAux}[\"${params.position}\"].desactivadoen`) !== \"undefined\") ? eval(`Publicidad.configGDP.posicion_${tipoDispositivoAux}[\"${params.position}\"].desactivadoen`) : '';\n\n // Comprobamos si esta activa para el tipo de pagina\n if ((typeof desactivadoen !== 'undefined') && (desactivadoen.length > 0) && (desactivadoen !== '') && (desactivadoen.indexOf(Publicidad.tipoPagina) !== -1)) {\n showLog(`En isActive. La posicion ${params.position} no esta activa para el tipo de pagina ${Publicidad.tipoPagina}`);\n container$.trigger(SLOT_INACTIVE);\n return false;\n }\n\n // Comprobamos si la posicion esta programada\n var programaciones = new Array();\n if (Publicidad.tipoFormatoJSON >= JSON_GDP2_1) {\n var objProgramaciones = eval(`Publicidad.configGDP.posicion_${tipoDispositivoAux}[\"${params.position}\"].programaciones`);\n for (let i = 0; i < objProgramaciones.length; i++) {\n let objProgramacion = objProgramaciones[i].programacion;\n let fechaini = (typeof objProgramacion !== \"undefined\") ? objProgramacion.fecha_in : 0;\n let fechafin = (typeof objProgramacion !== \"undefined\") ? objProgramacion.fecha_fin : 0;\n programaciones.push([fechaini, fechafin]);\n }\n } else {\n let fechaini = (typeof eval(`Publicidad.configGDP.posicion_${tipoDispositivoAux}[\"${params.position}\"].fecha_in`) !== \"undefined\") ? eval(`Publicidad.configGDP.posicion_${tipoDispositivoAux}[\"${params.position}\"].fecha_in`) : 0;\n let fechafin = (typeof eval(`Publicidad.configGDP.posicion_${tipoDispositivoAux}[\"${params.position}\"].fecha_fin`) !== \"undefined\") ? eval(`Publicidad.configGDP.posicion_${tipoDispositivoAux}[\"${params.position}\"].fecha_fin`) : 0;\n programaciones.push([fechaini, fechafin]);\n }\n\n // Comprobamos si la fecha actual esta comprendida dentro de alguno de los arrays de programaciones\n if (programaciones.length > 0) {\n var fechaActual = Math.round(+new Date() / 1000);\n var encontrada = false;\n for (let i = 0; (i < programaciones.length) && !encontrada; i++) {\n let fechaInicioProgramacion = programaciones[i][0];\n let fechaFinProgramacion = programaciones[i][1];\n if ((fechaInicioProgramacion == 0 || fechaActual >= fechaInicioProgramacion) && (fechaFinProgramacion == 0 || fechaActual <= fechaFinProgramacion)) {\n encontrada = true;\n }\n }\n\n if (!encontrada) {\n showLog(`En isActive. La posicion ${params.position} no esta activa para la hora actual`);\n container$.trigger(SLOT_INACTIVE);\n return false;\n }\n }\n } else {\n showLog(`En isActive. La posicion ${params.position} no esta activa`);\n container$.trigger(SLOT_INACTIVE);\n return false\n }\n\n return true;\n }\n\n /**\n * Pinta las posiciones retrasadas una vez que llegan al viewport\n * @param object params [parametros del ad]\n */\n static pintarRetrasada(params) {\n var idAds = Publicidad.getIdDiv(params);\n\n $(`#${idAds}`).one('inview', function (event, isInView) {\n if (isInView) {\n showLog('En pintarRetrasada. Pintando retrasada');\n Publicidad.getAdGoogle(params, false);\n }\n });\n }\n\n // FUTURE: completar\n static getAdMeta(params) {\n\n }\n\n /**\n * Muestra la publicidad.\n * @param {Object} datos - Puede ser un DIV obtenido con jQuery con los atributos de configuracion, o bien un objeto JSON con la configuracion a aplicar\n *\n * Descripcion de parametros que puede contener el objeto JSON:\n * position => string. Posicion publicitaria a mostrar\n * id => string. ID del elemento HTML en el que se muestra\n * serverType => string. Servidor de publicidad a usar\n * hideNoAds => boolean. Oculta el elemento HTML si el adserver no ha devuelto publi\n * outOfPage => boolean. Determina si el slot de publicidad es outOfPage o no. Por defecto vale false\n * defineSlot => boolean. Indica si hay que definir o no el slot\n * refresh => boolean. Se pide la posicion de publicidad aunque ya se hubiera mostrado antes. Por defecto false\n * responsive => Array. Indicamos si una publi se debe pintar solo en una(s) determinada(s) resolucion(es)\n * pre_callback => function. Función javascript a la que invocar previamente\n * pre_event => string. evento de precondicion\n * post_callback => function. Función javascript a la que invocar una vez disparado el slotRendered\n * post_event => string. evento a disparar una vez disparado evento de slotRendered\n * oas => string. Si se rellena es el OAS a utilizar en la posicion de publicidad\n *\n * Objeto Responsive\n * El primer par de valores indica la resolucion, y en el segundo los tamanos de la posicion de publi a servir, el cual puede definirse como sigue:\n * - vacio: []\n * - single array: [ancho, alto]\n * - multi array: [ [ancho1, alto1], [ancho2, alto2], ... ]\n * - string: En cuyo caso usa la funcion ads.getSizesGoogle para obtener el array\n *\n * Ejemplo llamada:\n * ads.printAds({'position': 'robapaginas', 'id': 'roba2', 'responsive': [\n * [[0, 0], []] // Small Mobile\n * ,[[350, 200], [300,150]] // Mobile\n * ,[[750, 200], 'robapaginas'] // Tablet\n * ,[[1050, 300], [[300,150],[300,250]]] // Desktop\n * ]});\n */\n static printAds(datos) {\n if ((Publicidad.tipoFormatoJSON >= JSON_GDP2_2) && !Publicidad.configGDPMedio.activo) {\n showWarn('La publicidad ha sido desactivada en la configuracion del medio!');\n return;\n }\n\n // Normalizacion de parametros\n var params = Publicidad.normalizaParams(datos);\n\n if (params == null) return;\n\n // Comprobamos si la posicion esta activada\n var idAds = Publicidad.getIdDiv(params);\n if (!Publicidad.isActive(params)) {\n // Ocultamos el DIV contenedor de la publicidad si esta habilitada la directiva hideNoAds\n if ($(`#${idAds}`).length && (typeof params.hideNoAds != 'undefined') && params.hideNoAds) $(`#${idAds}`).hide();\n\n return;\n }\n\n // Comprobamos si existe el DIV\n if ($(`#${idAds}`).length) {\n // Pintado de publicidad dependiendo del servidor\n switch (params.serverType) {\n case 'google':\n // Si estamos en modo preview comprobamos si esta posicion hay que traerla desde el SW del capturador\n if (Publicidad.configGDPMedio.preview && Publicidad.capturadorExistsPreview(params)) {\n Publicidad.capturadorSetPreview(params)\n return;\n }\n\n // Publicidades priorizadas en la carga\n var priorized = Publicidad.esPriorizada(params);\n var retrasada = Publicidad.esRetrasada(params);\n\n // Posicion priorizada\n if (priorized && !retrasada) {\n showLog('En printAds. Pintando priorizada', params);\n Publicidad.getAdGoogle(params, true);\n }\n // Posicion retrasada -> le anade la class inview\n else if (retrasada) {\n Publicidad.pintarRetrasada(params);\n }\n // Posicion estandar\n else if (!Publicidad.hayPriorizadas || Publicidad.completadasPriorizadas) {\n showLog('En printAds. Pintando estandar', params);\n Publicidad.getAdGoogle(params, false);\n } else {\n Publicidad.listaEstandardDelayed.push(params);\n }\n\n break;\n case 'admeta':\n Publicidad.getAdMeta(params);\n break;\n }\n } else {\n showWarn(`En printAds. ERROR: El DIV con ID ${idAds} no existe`);\n }\n\n return this;\n }\n\n /**\n * Pintado de publicidad de GPT\n */\n static getAdGoogle(params, esPosPriorizada) {\n if ((Publicidad.tipoFormatoJSON >= JSON_GDP2_2) && !Publicidad.configGDPMedio.activo) {\n showWarn('En getAdGoogle. La publicidad ha sido desactivada en la configuracion del medio!');\n return;\n }\n\n googletag.cmd.push(function () {\n if (!Publicidad.existePosEnConfigGDPMedio(params.position)) {\n showWarn(`En getAdGoogle. ERROR: La posicion ${params.position} no existe en configGDPMedio`);\n return null;\n }\n\n // Gestion de los eventos y callbacks\n var idDiv = Publicidad.getIdDiv(params);\n var eventParams = Publicidad.getEventsPosition(params);\n\n var tParams = params;\n tParams.pre_callback = eventParams.pre_callback;\n tParams.pre_event = eventParams.pre_event;\n\n tParams.post_callback = eventParams.post_callback;\n tParams.post_event = eventParams.post_event;\n $(\"#\" + idDiv).data(\"params\", tParams);\n\n var key = Publicidad.getClavePosicionInsertada(params);\n if (typeof Publicidad.listaPosicionesInsertadas[key] == 'undefined') {\n var hasPreevent = false;\n if (params.defineSlot) {\n showLog('En getAdGoogle. defineSlot', params);\n Publicidad.defineSlot(params);\n // No se trata de una posicion priorizada por lo que puede tener condicion de pre (callback o evento)\n if (!esPosPriorizada) {\n showLog('En getAdGoogle. No es priorizada', params);\n // Tiene precallback pero no evento\n if (eventParams.pre_callback && !eventParams.pre_event) {\n eventParams.pre_callback();\n }\n // Tiene evento de pre\n else if (eventParams.pre_event) {\n showLog('En getAdGoogle. Tiene evento pre', params);\n hasPreevent = true;\n app.one(eventParams.pre_event, params, function () {\n // NOTE: If there is Header Bidding wait for bidders promises\n if (HBProviderManager.isActive()) {\n showLog('getAdGoogle::Waiting for HB`s promises to be solved');\n app.when(HEADER_BIDDING_READY).then(function() {\n showLog(`getAdGoogle::HB promises resolved with preEvents`);\n if (params.pre_callback) {\n params.pre_callback();\n }\n HBProviderManager.setTargetings();\n showLog(params);\n Publicidad.display(params);\n });\n }\n });\n } else {\n showLog('En getAdGoogle. No tiene evento pre', params);\n // NOTE: If there is Header Bidding wait for bidders promises\n if (HBProviderManager.isActive()) {\n hasPreevent = true;\n showLog('getAdGoogle::Waiting for HB`s promises to be solved');\n app.when(HEADER_BIDDING_READY).then(function() {\n showLog(`getAdGoogle::HB promises resolved without preEvents`);\n if (params.pre_callback) {\n params.pre_callback();\n }\n HBProviderManager.setTargetings();\n showLog(params);\n Publicidad.display(params);\n });\n }\n }\n }\n else {\n // Se trata de una posicion priorizada\n showLog(`En getAdGoogle. Es priorizada`);\n // NOTE: If there is Header Bidding wait for bidders promises\n if (HBProviderManager.isActive()) {\n hasPreevent = true;\n showLog('getAdGoogle::Waiting for HB`s promises to be solved');\n app.when(HEADER_BIDDING_READY).then(function() {\n showLog(`getAdGoogle::HB promises resolved on prioritized position`);\n HBProviderManager.setTargetings();\n showLog(params);\n Publicidad.display(params);\n });\n }\n }\n }\n\n // No tiene evento de activacion\n if (!hasPreevent) {\n showLog(`En getAdGoogle. display:Pintando`);\n HBProviderManager.setTargetings();\n Publicidad.display(params);\n }\n } else {\n showLog(`En getAdGoogle. La posicion ${params.position} ya ha sido previamente invocada. Comprobamos el valor del parametro refresh: ${params.refresh}`);\n if (params.refresh) Publicidad.pintarPosicionRefresh(params);\n }\n });\n }\n\n /**\n * Funcion que recuperar si tiene evento pre o post callback, los parametros llegados por funcion prevalecen sobre los del CONFIG\n * @param object params\n */\n static getEventsPosition(params) {\n var tipoDispositivoAux = _deviceType;\n var positionEvents = {};\n\n if (typeof eval(`Publicidad.configGDP.posicion_${tipoDispositivoAux}[\"${params.position}\"]`) === \"undefined\") return positionEvents;\n\n if (params.pre_callback) {\n positionEvents.pre_callback = params.pre_callback;\n } else {\n positionEvents.pre_callback = (typeof eval(`Publicidad.configGDP.posicion_${tipoDispositivoAux}[\"${params.position}\"].pre_callback`) !== \"undefined\") ? eval(`Publicidad.configGDP.posicion_${tipoDispositivoAux}[\"${params.position}\"].pre_callback`) : '';\n }\n\n if (params.pre_event) {\n positionEvents.pre_event = params.pre_event;\n } else {\n positionEvents.pre_event = (typeof eval(`Publicidad.configGDP.posicion_${tipoDispositivoAux}[\"${params.position}\"].pre_event`) !== \"undefined\") ? eval(`Publicidad.configGDP.posicion_${tipoDispositivoAux}[\"${params.position}\"].pre_event`) : '';\n }\n\n if (params.post_callback) {\n positionEvents.post_callback = params.post_callback;\n } else {\n positionEvents.post_callback = (typeof eval(`Publicidad.configGDP.posicion_${tipoDispositivoAux}[\"${params.position}\"].post_callback`) !== \"undefined\") ? eval(`Publicidad.configGDP.posicion_${tipoDispositivoAux}[\"${params.position}\"].post_callback`) : '';\n }\n\n if (params.post_event) {\n positionEvents.post_event = params.post_event;\n } else {\n positionEvents.post_event = (typeof eval(`Publicidad.configGDP.posicion_${tipoDispositivoAux}[\"${params.position}\"].post_event`) !== \"undefined\") ? eval(`Publicidad.configGDP.posicion_${tipoDispositivoAux}[\"${params.position}\"].post_event`) : '';\n }\n\n return positionEvents;\n }\n\n /**\n * Devuelve el nombre de la variable que almacenara el slot\n */\n static getNombreSlot(params) {\n return `top.slot_${params.position.replace('-', '_')}`;\n }\n\n /**\n * Clave unica de la posicion\n */\n static getClavePosicionInsertada(params) {\n var clave = Publicidad.getNombreSlot(params) + '_' + Publicidad.getIdDiv(params);\n return clave;\n }\n\n /**\n * Refresh de una posicion\n */\n static pintarPosicionRefresh(params) {\n showLog(`En pintarPosicionRefresh. Refrescamos la posicion ${params.position}`);\n googletag.pubads().refresh([lookup(Publicidad.getNombreSlot(params))]);\n }\n\n /**\n * Detectamos si se fuerza alguna configuracion via parametro en la URL. Parametros soportados:\n * vam_adUnit\n * vam_cmvkey\n * vam_debug\n * vam_singleRequest\n * vam_syncRendering\n * vam_enableKrux\n * vam_forceActivePosition\n * vam_infoSlot\n */\n static checkConfigFromURL() {\n var legacyCode;\n if (typeof top.location === 'undefined') return;\n\n // HeaderBidding Prebid\n if ('hbPrebid' in Publicidad.configGDPMedio) {\n Publicidad.configGDPMedio.hbPrebid = top.location.href.indexOf('vam_disableHbPrebid=1') > -1 ? false : Publicidad.configGDPMedio.hbPrebid;\n }\n\n // HeaderBidding Amazon\n if ('hbAmazon' in Publicidad.configGDPMedio) {\n Publicidad.configGDPMedio.hbAmazon = top.location.href.indexOf('vam_disableHbAmazon=1') > -1 ? false : Publicidad.configGDPMedio.hbAmazon;\n }\n\n // Single Request\n Publicidad.configGDPMedio.singleRequest = top.location.href.indexOf('vam_enableSingleRequest=1') > -1 || top.location.href.indexOf('gdp_singleRequest=1') > -1 || Publicidad.configGDPMedio.singleRequest;\n\n // SyncRendering\n Publicidad.configGDPMedio.syncRendering = top.location.href.indexOf('vam_enableSyncRendering=1') > -1 || top.location.href.indexOf('gdp_syncRendering=1') > -1 || Publicidad.configGDPMedio.syncRendering;\n\n // Krux\n Publicidad.configGDPMedio.enableKrux = top.location.href.indexOf('vam_enableKrux=1') > -1 || top.location.href.indexOf('gdp_enableKrux=1') > -1 || Publicidad.configGDPMedio.enableKrux;\n\n // Force active position\n Publicidad.configGDPMedio.forceActivePosition = top.location.href.indexOf('vam_forceActivePosition=1') > -1 || top.location.href.indexOf('gdp_forceActivePosition=1') > -1;\n\n // InfoSlot\n Publicidad.configGDPMedio.infoSlot = top.location.href.indexOf('vam_infoSlot=1') > -1 || top.location.href.indexOf('gdp_infoSlot=1') > -1;\n if (Publicidad.configGDPMedio.infoSlot) {\n _loadjscssfile(VAM_CSS_URL, false, 'css');\n }\n\n // Capturador (modo preview)\n Publicidad.configGDPMedio.preview = top.location.href.indexOf('vam_preview') > -1 || top.location.href.indexOf('preview') > -1;\n if (Publicidad.configGDPMedio.preview) {\n showLog('En checkConfigFromURL. Detectado modo capturador. Invocamos al SW del capturador');\n Publicidad.capturadorDataPreview = Publicidad.capturadorGetPreviewData();\n\n // En modo capturador no pondremos priorizadas ni retrasadas\n Publicidad.configGDP.priorizadas = Publicidad.configGDP.retrasadas = {};\n }\n\n // Previsualizador\n if (top.location.href.indexOf('vam_code=') > -1 || top.location.href.indexOf('code=') > -1) {\n showLog('En checkConfigFromURL. Detectado modo previsualizador');\n legacyCode = top.location.href.indexOf('vam_code=') > -1 ? 'vam_code' : 'code';\n Publicidad.prevEncryptedCode = decodeURI(_getParameterByName(legacyCode, top.location.href));\n\n // En modo previsualizador no pondremos priorizadas ni retrasadas\n Publicidad.configGDP.priorizadas = Publicidad.configGDP.retrasadas = {};\n\n if (Publicidad.prevEncryptedCode !== '') {\n _loadjscssfile(MCRYPT_URL, true, 'js');\n _loadjscssfile(RIJNDAEL_URL, true, 'js');\n }\n }\n }\n\n /**\n * Carga del JS para la publicidad de Google\n */\n static cargaLibreriaGPT() {\n window.googletag = window.googletag || {};\n googletag.cmd = googletag.cmd || [];\n try {\n if ($(\"script[src*='www.googletagservices.com/tag/js/gpt.js']\").length === 0) {\n (function () {\n var gads = document.createElement('script');\n gads.async = true;\n gads.type = 'text/javascript';\n var useSSL = 'https:' == document.location.protocol;\n gads.src = (useSSL ? 'https:' : 'http:') + '//www.googletagservices.com/tag/js/gpt.js';\n var node = document.getElementsByTagName('script')[0];\n node.parentNode.insertBefore(gads, node);\n })();\n }\n } catch (err) {}\n }\n\n /**\n * Obtiene la edicion desde el namespace\n */\n static getEdition() {\n const editions = lookup(EDITIONS_NAMESPACE);\n return editions.current || (editions.main || '');\n }\n\n /**\n * INICIO: Renderizado de tablas de informacion cuando vam_infoSlot=1\n * --------------------------------------------------------------------------\n */\n /**\n * Metodo de entrada de tablas de informacion\n */\n static infoSlotRender(params, isSlotRendered) {\n var idDiv = Publicidad.getIdDiv(params);\n var container$ = $(`#${idDiv}`);\n var width = $(`#${idDiv} div iframe`).width();\n var height = $(`#${idDiv} div iframe`).height();\n\n // Obtenemos el tamano de la publi pintada y la borramos\n if (isSlotRendered) {\n container$.empty();\n } else {\n // Si DFP devuelve isEmpty cogemos la primera dimension del array, o 150x150 si es fluid\n try {\n height = width = 150;\n var dim = Publicidad.getSizesGoogle(params.position);\n if ((dim != null) && (dim.indexOf('fluid') == -1)) {\n var arrayObj = JSON.parse(dim);\n\n if ($.isArray(arrayObj[0])) {\n width = arrayObj[0][0];\n height = arrayObj[0][1];\n } else {\n width = arrayObj[0];\n height = arrayObj[1];\n }\n }\n } catch (e) {}\n\n container$.show();\n }\n\n // Rectangulo con color azul o rojo (si es local)\n container$.addClass('gdp_infoSlot_rectangle').html(`

${params.position} ${Publicidad.infoSlotFormateaDimensiones(params)}

`);\n if (Publicidad.isLocalPosition(params)) container$.addClass('gdp_infoSlot_localPosition');\n if (!isSlotRendered) container$.addClass('gdp_infoSlot_inactive');\n\n if (!$(\"#gdp_infoSlot_tableInfo\").length > 0) {\n $('body').append('
');\n }\n\n // Tablas de info adicional\n Publicidad.infoSlotRenderSlots(params);\n Publicidad.infoSlotRenderTopics();\n Publicidad.infoSlotRenderOAS(params);\n\n var numSlots = $(\"#gdp_infoSlot_tableInfo-slots\").length > 0 ? $(\"#gdp_infoSlot_tableInfo-slots tbody tr\").length : 0;\n var numTopics = $(\"#gdp_infoSlot_tableInfo-topics\").length > 0 ? $(\"#gdp_infoSlot_tableInfo-topics tbody tr\").length : 0;\n var numOas = $(\"#gdp_infoSlot_tableInfo-oas\").length > 0 ? $(\"#gdp_infoSlot_tableInfo-oas tbody tr\").length : 0;\n var max = Math.max(numSlots, numTopics);\n if (max > numSlots && $(\"#gdp_infoSlot_tableInfo-slots\").length > 0) {\n for (i = 0; i < max - numSlots; i++) {\n $(\"#gdp_infoSlot_tableInfo-slots tbody\").append(\" \");\n }\n }\n if (max > numTopics && $(\"#gdp_infoSlot_tableInfo-topics\").length > 0) {\n for (i = 0; i < max - numTopics; i++) {\n $(\"#gdp_infoSlot_tableInfo-topics tbody\").append(\" \");\n }\n }\n if (max > numOas && $(\"#gdp_infoSlot_tableInfo-oas\").length > 0) {\n for (i = 0; i < max - numOas; i++) {\n $(\"#gdp_infoSlot_tableInfo-oas tbody\").append(\" \");\n }\n }\n }\n\n static infoSlotFormateaDimensiones(params) {\n var resultado = '';\n var arrayDimensiones = new Array();\n\n try {\n var objetoMapping = {};\n var sizeMapping = '';\n\n if (params.outOfPage) {\n arrayDimensiones.push('oop');\n }\n else if (params.responsive && $.isArray(params.responsive) && params.responsive.length > 0) {\n objetoMapping = Publicidad.getSizeMapping(params);\n sizeMapping = ((typeof objetoMapping !== 'undefined') && (typeof objetoMapping.definicion !== 'undefined')) ? objetoMapping.definicion : '';\n var aux = sizeMapping.split('.');\n for (var i = 0; i < aux.length; i++) {\n if (aux[i].indexOf('addSize') != -1) {\n aux[i] = aux[i].replace(new RegExp('addSize\\\\(', 'g'), '').replace(new RegExp('\\\\)', 'g'), '');\n arrayDimensiones.push(aux[i]);\n }\n }\n } else {\n if (Publicidad.tipoFormatoJSON >= JSON_GDP2_1) {\n arrayDimensiones.push(eval(`Publicidad.configGDPMedio.posicion_${_deviceType}[\"${params.position}\"].dimensiones`));\n } else {\n arrayDimensiones.push(Publicidad.configGDPMedio.posiciones[params.position]);\n }\n }\n\n if ($.isArray(arrayDimensiones)) {\n // Posicion OutOfPage\n if (params.outOfPage) {\n resultado += '(oop)';\n }\n // Posicion no responsive\n else if (!params.responsive) {\n var dimension = arrayDimensiones[0];\n dimension = dimension.replace(new RegExp(\"'fluid'\", 'g'), '\\[fluid\\]').replace(new RegExp('\\\\],\\\\[', 'g'), '_').replace(new RegExp(',', 'g'), 'x').replace(new RegExp('\\\\[', 'g'), '').replace(new RegExp('\\\\]', 'g'), '').replace(new RegExp('_', 'g'), ',');\n resultado += '(' + dimension + ')';\n }\n // Posicion responsive\n else {\n let listaDimensionesNoRepetidas = new Set();\n for (var i = 0; i < arrayDimensiones.length; i++) {\n var dimension = arrayDimensiones[i];\n dimension = dimension.replace(new RegExp(\"'fluid'\", 'g'), '\\[fluid\\]').replace(new RegExp('\\\\],\\\\[', 'g'), '_').replace(new RegExp(',', 'g'), 'x').replace(new RegExp('\\\\[', 'g'), '').replace(new RegExp('\\\\]', 'g'), '').replace(new RegExp('_', 'g'), ',');\n\n // Quitamos la resolucion\n var resolucion = dimension.substring(0, dimension.indexOf(','));\n var dimension = dimension.substring(dimension.indexOf(',') + 1);\n listaDimensionesNoRepetidas.add(dimension);\n resultado += '
' + resolucion + ': (' + dimension + ')';\n }\n\n // Si todas las dimensiones de responsive son la misma escribimos solo una\n if (listaDimensionesNoRepetidas.size == 1) resultado = '(' + dimension + ')';\n }\n }\n } catch (err) {}\n\n return resultado;\n }\n\n /**\n * Tabla de informacion de SLOTS\n */\n static infoSlotRenderSlots(params) {\n if (!$(\"#gdp_infoSlot_tableInfo-slots\").length > 0) {\n $(\"#gdp_infoSlot_tableInfo\").append('
');\n $(\"#gdp_infoSlot_tableInfo-slots thead\").append(\"posiciones\");\n }\n $(\"#gdp_infoSlot_tableInfo-slots tbody\").append(`${params.position}`);\n }\n\n /**\n * Tabla de informacion de TOPICS\n * @returns {boolean}\n */\n static infoSlotRenderTopics() {\n var topics = Publicidad.getTopics(true);\n if (topics.length > 0) {\n if (!$(\"#gdp_infoSlot_tableInfo-topics\").length > 0) {\n $(\"#gdp_infoSlot_tableInfo\").append('
');\n $(\"#gdp_infoSlot_tableInfo-topics thead\").append(\"topics\");\n\n for (var i = 0; i < topics.length; i++) {\n $(\"#gdp_infoSlot_tableInfo-topics tbody\").append(`${topics[i]}`);\n }\n }\n }\n }\n\n /**\n * Tabla de informacion de OAS\n * @returns {boolean}\n */\n static infoSlotRenderOAS(params) {\n if (!$(\"#gdp_infoSlot_tableInfo-oas\").length > 0) {\n $(\"#gdp_infoSlot_tableInfo\").append('
');\n $(\"#gdp_infoSlot_tableInfo-oas thead\").append(\"oas\");\n $(\"#gdp_infoSlot_tableInfo-oas tbody\").append(`${Publicidad.getOasSitepage(params)}`);\n }\n }\n\n /**\n * Devuelve un array con los topics que contiene la pagina, en caso de que los contenga y que enableTopics este habilitado\n * @return array\n */\n static getTopics(forzarEnableTopics) {\n var topics = new Array();\n\n if ((((typeof Publicidad.configGDPMedio !== \"undefined\") && (typeof Publicidad.configGDPMedio.enableTopics !== \"undefined\") && (Publicidad.configGDPMedio.enableTopics)) || forzarEnableTopics) && (typeof voc_top != \"undefined\") && (voc_top != '')) {\n topics = voc_top.split(',');\n }\n\n return topics;\n }\n\n /**\n * Funcion que devuelve true si la posicion es local, false si no lo es\n * @return boolean\n */\n static isLocalPosition(params) {\n return params.position.includes(\"_local\");\n }\n /**\n * FIN: Renderizado de tablas de informacion cuando vam_infoSlot=1\n * --------------------------------------------------------------------------\n */\n\n\n /**\n * INICIO: Capturador (modo preview)\n * --------------------------------------------------------------------------\n */\n /**\n * Invoca al Servicio Web del Capturador para obtener las creatividades indicadas en el parametro preview directamente desde DFP\n */\n static capturadorGetPreviewData() {\n var legacyPreview, url, data;\n\n legacyPreview = top.location.href.indexOf('vam_preview') > -1 ? 'vam_preview' : 'preview';\n var url = CAPTURADOR_WS + \"?id=\" + _getParameterByName(legacyPreview);\n var data = \"\";\n $.ajax({\n type: 'POST',\n url: url,\n async: false,\n success: function (result) {\n data = result;\n }\n });\n\n return data;\n }\n\n /**\n * Devuelve true si hay preview para la posicion indicada o false en caso contrario\n * @returns {boolean}\n */\n static capturadorExistsPreview(params) {\n return ((typeof Publicidad.capturadorDataPreview !== \"undefined\") && (Publicidad.capturadorDataPreview[params.position]));\n }\n\n /**\n * funcion que cambia la publicidad por defecto, por una que se indica\n */\n static capturadorSetPreview(params) {\n try {\n var previewJSON = JSON.parse(Publicidad.capturadorDataPreview[params.position]);\n var preview = previewJSON[0];\n var idDiv = Publicidad.getIdDiv(params);\n var div = $(`#${idDiv}`);\n div.empty();\n var creatividad = ``;\n div.html(creatividad);\n showLog(`En capturadorSetPreview. Pintada preview para la posicion ${params.position}`);\n } catch (err) {}\n }\n /**\n * FIN: Capturador (modo preview)\n * --------------------------------------------------------------------------\n */\n\n\n /**\n * INICIO: Metodos para Modo Previsualizador\n * --------------------------------------------------------------------------\n */\n\n /**\n * Funcion que devuelve la URL desencriptada\n * @returns {string}\n */\n static decryptURL() {\n var legacyCmvkey;\n try {\n if (Publicidad.prevUnencryptedCode === '') {\n if (Publicidad.prevEncryptedCode !== '') {\n var key = MCRYPT_KEY;\n var iv = key;\n Publicidad.prevUnencryptedCode = '?' + mcrypt.Decrypt(atob(Publicidad.prevEncryptedCode), iv, key, 'rijndael-256', 'cbc');\n\n // Eliminamos caracteres especiales de la cadena\n Publicidad.prevUnencryptedCode = Publicidad.prevUnencryptedCode.replace(/[^A-Za-z 0-9 \\.,\\?\"\"!@#\\$%\\^&\\*\\(\\)-_=\\+;:<>\\/\\\\\\|\\}\\{\\[\\]`~]*/g, '');\n if (Publicidad.prevUnencryptedCode.endsWith('&vam_cmvkey=') || Publicidad.prevUnencryptedCode.endsWith('&cmvkey=')) {\n legacyCmvkey = Publicidad.prevUnencryptedCode.endsWith('&vam_cmvkey=') ? '&vam_cmvkey=' : '&cmvkey=';\n Publicidad.prevUnencryptedCode = Publicidad.prevUnencryptedCode.replace(legacyCmvkey, '');\n }\n showLog(`En decryptURL. cadena desencriptada: ${Publicidad.prevUnencryptedCode}`);\n } else {\n Publicidad.prevUnencryptedCode = '';\n }\n }\n } catch (err) {\n showError(`ERROR En decryptURL desencriptando cadena: ${err}`);\n Publicidad.prevUnencryptedCode = '';\n }\n\n return Publicidad.prevUnencryptedCode;\n }\n /**\n * FIN: Metodos para Modo Previsualizador\n * --------------------------------------------------------------------------\n */\n}\n\nexport default Publicidad;\n\n/* Private */\n\n/**\n * Devuelve el tipo de dispositivo en funcion del tamano de la pagina\n * @return string\n */\nfunction _getTipoDispositivo() {\n var cTipoDispositivo = 'desktop';\n\n if (!Publicidad.configGDPMedio.responsive.esResponsive) {\n if (Publicidad.configGDPMedio && Publicidad.configGDPMedio.tipoDispositivo) {\n cTipoDispositivo = Publicidad.configGDPMedio.tipoDispositivo;\n }\n } else {\n var screen_width = parseInt(top.window.innerWidth);\n\n $.each(Publicidad.configGDPMedio.responsive, function (clave, valor) {\n if ((clave !== 'esResponsive') && (valor.resolucionMaxima || valor.resolucionMinima)) {\n var maximo = valor.resolucionMaxima ? valor.resolucionMaxima : 999999;\n var minimo = valor.resolucionMinima ? valor.resolucionMinima : 0;\n\n if ((screen_width <= maximo) && (screen_width > minimo)) {\n var cTempTipo = clave.replace(\"resolucion\", \"\").toLowerCase();\n cTipoDispositivo = cTempTipo;\n }\n }\n });\n }\n\n return cTipoDispositivo;\n}\n\n/**\n * Devuelve el valor de un parametro de la URL indicada\n * Si no se indica URL se usa la actual\n */\nfunction _getParameterByName(paramName, url) {\n if (!paramName) return '';\n\n url = url || top.location.href;\n paramName = paramName.replace(/[\\[\\]]/g, \"\\\\$&\");\n var regex = new RegExp(\"[?&]\" + paramName + \"(=([^&#]*)|&|#|$)\"),\n results = regex.exec(url);\n if (!results) return '';\n if (!results[2]) return '';\n return decodeURIComponent(results[2].replace(/\\+/g, \" \"));\n}\n\n/**\n * Carga de ficheros de manera sincrona mediante XMLHttpRequest\n */\nfunction _loadjscssfile(filename, required, filetype) {\n if (filetype == \"js\") { //if filename is a external JavaScript file\n if ($('script[src=\"' + filename + '\"]').length > 0) return;\n\n var fileref = document.createElement('script');\n fileref.setAttribute(\"type\", \"text/javascript\");\n } else if (filetype == \"css\") { //if filename is an external CSS file\n var fileref = document.createElement(\"link\")\n fileref.setAttribute(\"rel\", \"stylesheet\")\n fileref.setAttribute(\"type\", \"text/css\")\n }\n\n if (required) {\n // get some kind of XMLHttpRequest\n var xhrObj = new XMLHttpRequest();\n // open and send a synchronous request\n xhrObj.open('GET', filename, false);\n xhrObj.send();\n fileref.text = xhrObj.responseText;\n } else {\n if (filetype == \"js\") {\n fileref.setAttribute(\"src\", filename);\n } else if (filetype == \"css\") {\n fileref.setAttribute(\"href\", filename);\n }\n }\n\n if (typeof fileref != \"undefined\")\n document.getElementsByTagName(\"head\")[0].appendChild(fileref);\n}\n\n/**\n * Process the configGDPMedia\n */\nfunction _processConfigGDPMedio() {\n // NOTE: HB processing\n HBConfigManager.processConfig.call(this, _deviceType, _dynamicId);\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/publicidad.js","import app from '../application';\nimport Amazon from './providers/amazon';\nimport Prebid from './providers/prebid';\nimport {\n showLog,\n showError\n} from '../utils';\nimport {\n HEADER_BIDDING_READY\n} from '../constants';\n\nconst GATEWAYS = [\n Amazon,\n Prebid\n];\nconst {RSVP} = window;\nvar _gatewaysPromises = [];\nvar _gatewaysAdded = [];\n\nwindow.googletag = window.googletag || {};\nwindow.googletag.cmd = window.googletag.cmd || [];\n\nexport default Object.preventExtensions({\n /**\n * Get promises from gateways.\n * NOTE: Init method must be call before isActive method\n * @param {string} device - device type\n * @param {object} config - configGDPMedio object\n * @param {integer} dynamicId - dynamicId(infinite-scroll)\n */\n init(config) {\n _gatewaysPromises = [];\n // NOTE: load promises of active gateways\n _loadActivesGateways.call(_gatewaysPromises, config);\n\n // NOTE: when all promises are resolved, rejected or timeout reached, resolve the HB-Promise\n return RSVP.all(_gatewaysPromises)\n .then(function() {\n showLog('All gateway promises are done');\n app.promised(HEADER_BIDDING_READY, true);\n })\n .catch(function(reason) {\n showError('HBManager::init::Error in gateways', reason);\n app.promised(HEADER_BIDDING_READY, false);\n });\n },\n /**\n * Set targeting to DFP request\n */\n setTargetings() {\n _gatewaysAdded.forEach(function(gateway) {\n gateway.setTargetings();\n });\n },\n /**\n * Check if there are gateways actives\n */\n isActive() {\n return _gatewaysPromises.length;\n }\n});\n\n/* Private */\n\n/**\n * Load active gateways by config\n * @param {object} configGDPMedio\n */\nfunction _loadActivesGateways(config) {\n _gatewaysAdded = [];\n GATEWAYS.forEach((gateway) => {\n if (gateway.isActive(config)) {\n showLog('HBManager::_loadActivesGateways::Add promise', gateway.NAME());\n _gatewaysAdded.push(gateway);\n this.push(gateway.getLoadPromise(config));\n }\n });\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/header-bidding/provider-manager.js","import {\n load,\n showLog,\n showError\n} from '../../utils';\nimport {\n DEFAULT_AMAZON_LOAD_TIMEOUT,\n AMAZON_URL,\n AMAZON_CONFIG\n} from '../../constants';\n\n// NOTE: function to queue the apstag calls before the library loaded(https://ams.amazon.com/webpublisher/docs/help/web-integration-documentation/integration-guide/javascript-guide/display.html)\n(function IIFE(a9,a){if(a[a9])return;function q(c,r){a[a9]._Q.push([c,r])}a[a9]={init:function(){q('i',arguments)},fetchBids:function(){q('f',arguments)},setDisplayBids:function(){},targetingKeys:function(){return[]},_Q:[]};}('apstag',window));\n// NOTE: 'apstag' is the global variable that Amazon searches for\nwindow.apstag.adserverRequestResponse = false;\n\nconst REASONS = {\n ERROR_LOAD_LIBRARY: 'ERROR_LOAD_LIBRARY',\n TIMEOUT_REACHED_GLOBAL: 'TIMEOUT_REACHED_GLOBAL',\n TIMEOUT_REACHED_FETCH_BIDS: 'TIMEOUT_REACHED_FETCH_BIDS',\n ERROR_INIT_CONFIG: 'ERROR_INIT_CONFIG'\n};\nconst {RSVP} = window;\nconst NAME = 'AMAZON';\n\nexport default Object.preventExtensions({\n NAME: function() {return NAME;},\n isActive({hbAmazon}) {\n if (hbAmazon) {\n showLog('Amazon::Is active');\n } else {\n showLog('Amazon::Is NOT active');\n }\n return hbAmazon;\n },\n /**\n * Launch amazon behaviour\n * @param {object} adUnits - adUnits config\n * @param {object} biddersConfig\n * @param {integer} timeout\n * @return {Promise}\n */\n getLoadPromise({hbAmazon}) {\n return new RSVP.Promise(function(resolve, reject) {\n var timeout = hbAmazon.timeout || DEFAULT_AMAZON_LOAD_TIMEOUT;\n _loadLibrary()\n .then(function() {\n showLog('Amazon::getLoadPromise::Library loaded');\n return _setConfig();\n })\n .then(function() {\n showLog('Amazon::getLoadPromise::apstag is loaded');\n return _fetchBid(hbAmazon);\n })\n .then(function() {\n resolve(true);\n });\n\n setTimeout(function() {\n reject(REASONS.TIMEOUT_REACHED_GLOBAL);\n }, timeout);\n }).catch(function(reason) {\n switch (reason) {\n case REASONS.TIMEOUT_REACHED_GLOBAL:\n showLog('Amazon::getLoadPromise::TIMEOUT reached global');\n break;\n case REASONS.TIMEOUT_REACHED_FETCH_BIDS:\n showLog('Amazon::getLoadPromise::TIMEOUT reached in _fetchBid');\n break;\n case REASONS.ERROR_LOAD_LIBRARY:\n showError('Amazon::getLoadPromise::Error loading library');\n break;\n case REASONS.ERROR_INIT_CONFIG:\n showError('Amazon::getLoadPromise::Error on init config');\n break;\n default:\n showError('Amazon::getLoadPromise::Error in Amazon process', reason);\n }\n return false;\n });\n },\n\n /**\n * Force setTargeting\n */\n setTargetings() {\n if (window.apstag.adserverRequestResponse) {\n window.googletag.cmd.push(function() {\n showLog('Amazon::setTargetings::Get targetings', window.apstag.targetingKeys());\n window.apstag.setDisplayBids();\n showLog('Amazon::setTargetings::Targetings added');\n });\n } else {\n showLog('Amazon::setTargetings::Targetings NOT added because no response from bidders');\n }\n }\n});\n\n/* Private */\n\n/**\n * Load Amazon library\n * @return {Promise}\n */\nfunction _loadLibrary() {\n showLog('Amazon::_loadLibrary::Loading library');\n return load(AMAZON_URL)\n .catch(function(reason) {\n showError('Amazon::_loadLibrary::Error', reason);\n return RSVP.reject(REASONS.ERROR_LOAD_LIBRARY);\n });\n}\n\n/**\n * Set apstag init config\n */\nfunction _setConfig() {\n return new RSVP.Promise(function(resolve, reject) {\n // NOTE: set custom config object\n showLog('Amazon::_setConfig::Show Amazon config', AMAZON_CONFIG);\n try {\n window.apstag.init(AMAZON_CONFIG, function() {\n resolve();\n });\n } catch (error) {\n showError('Amazon::_setConfig::Error', error);\n reject(REASONS.ERROR_INIT_CONFIG);\n }\n });\n}\n\n/**\n * Add slots config and make Amazon call\n * @param {object} config - hbAmazon config from configGDPMedio\n */\nfunction _fetchBid(config) {\n var bidConfig;\n\n bidConfig = {\n slots: config.slots,\n timeout: config.timeout || DEFAULT_AMAZON_LOAD_TIMEOUT\n };\n\n return new RSVP.Promise(function(resolve, reject) {\n showLog('Amazon::_fetchBid::Add Slots', bidConfig.slots);\n showLog('Amazon::_fetchBid::Request Amazon');\n window.apstag.fetchBids(bidConfig, function(bids) {\n showLog('Amazon::_fetchBid::Response from Amazon', bids);\n // NOTE: When there are no bids returned, the bids array will be empty\n if (Object.keys(bids).length === 0) {\n reject(REASONS.TIMEOUT_REACHED_FETCH_BIDS);\n return;\n }\n window.apstag.adserverRequestResponse = true;\n resolve();\n });\n });\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/header-bidding/providers/amazon.js","import {\n NAMESPACE,\n SHOW_LOGS,\n DEFAULT_LOG_TEMPLATE\n} from './constants';\n\nconst\n {Cookies, RSVP} = window,\n UserType = Object.freeze({\n ANONYMOUS: 'anonimo',\n REGISTERED: 'registrado',\n SUBSCRIBER: 'suscriptor',\n TRIAL: 'trial'\n }),\n _vocUid = decodeURIComponent(Cookies.get('voc_uid')),\n _cookie = _vocUid === 'undefined' ? {} : JSON.parse(_vocUid),\n _scripts = {},\n _hasOwnProperty = Object.prototype.hasOwnProperty\n;\n\n/**\n * Look for the namespace config\n * @param {string} namespace\n */\nexport function lookup(namespace = NAMESPACE, root) {\n return namespace.split('.').reduce((that, o) => {\n return o in that ? that[o] : {};\n }, root || window);\n}\n\n/**\n * Adapted User type from Gigya for advertising segmentation\n *\n * @return {string}\n */\nexport const getUserType = window.__VOONTO__ && window.__VOONTO__.getUserType ?\n window.__VOONTO__.getUserType :\n function() {\n var userType, paywall, pwUserType;\n\n userType = UserType.ANONYMOUS; // <'anonimo' | 'registrado' | 'trial' | 'suscriptor'>\n paywall = Cookies.get('voc_paywall');\n if (paywall) {pwUserType = paywall.split('|').pop();}\n\n if (pwUserType) {\n userType = pwUserType;\n } else if (_cookie.uid) {\n userType = UserType.REGISTERED;\n }\n\n return userType;\n }\n;\n\n/**\n * Load file\n *\n * @param {string} url\n * @param {object} options\n */\nexport function load(url, options = {}) {\n var script, src, key;\n\n src = url;\n key = url.split('?').shift();\n if (_hasOwnProperty.call(_scripts, key)) {return RSVP.resolve(_scripts[key]);}\n\n script = document.createElement('script');\n script.type = 'text/javascript';\n script.src = src;\n script.async = true;\n if (options.text) {script.text = options.text;}\n\n return new RSVP.Promise((resolve, reject) => {\n script.onload = (/*event*/) => resolve(script);\n script.onerror = reject;\n _scripts[key] = script;\n\n document.head.appendChild(script);\n });\n}\n\nexport function showLog() {\n SHOW_LOGS && console.log(DEFAULT_LOG_TEMPLATE, ...arguments);\n}\n\nexport function showWarn() {\n SHOW_LOGS && console.warn(DEFAULT_LOG_TEMPLATE, ...arguments);\n}\n\nexport function showError() {\n SHOW_LOGS && console.error(DEFAULT_LOG_TEMPLATE, ...arguments);\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/utils.js","import {\n load,\n showLog,\n showError\n} from '../../utils';\nimport {\n DEFAULT_PREBID_LOAD_TIMEOUT,\n PREBID_URL,\n SHOW_LOGS\n} from '../../constants';\n\nconst REASONS = {\n ERROR_LOAD_LIBRARY: 'ERROR_LOAD_LIBRARY',\n TIMEOUT_REACHED_GLOBAL: 'TIMEOUT_REACHED_GLOBAL',\n TIMEOUT_REACHED_FETCH_BIDS: 'TIMEOUT_REACHED_FETCH_BIDS',\n};\nconst {RSVP} = window;\nconst NAME = 'PREBID';\n\n// NOTE: This is the global variable that Prebid searches for\nwindow.pbjs = window.pbjs || {};\nwindow.pbjs.que = window.pbjs.que || [];\nwindow.pbjs.adserverRequestResponse = false;\n\nexport default Object.preventExtensions({\n NAME: function() {return NAME;},\n isActive({headerBidding}) {\n if (headerBidding) {\n showLog('Prebid::Is active');\n } else {\n showLog('Prebid::Is NOT active');\n }\n return headerBidding;\n },\n /**\n * Launch prebid behaviour\n * @param {object} adUnits - adUnits config\n * @param {object} biddersConfig\n * @param {integer} timeout\n * @return {Promise}\n */\n getLoadPromise({headerBidding}) {\n return new RSVP.Promise(function(resolve, reject) {\n var timeout = headerBidding.timeout || DEFAULT_PREBID_LOAD_TIMEOUT;\n _loadLibrary()\n .then(function() {\n showLog('Prebid::getLoadPromise::Library loaded');\n _setConfig(headerBidding);\n return _fetchBid(headerBidding);\n })\n .then(function() {\n resolve(true);\n });\n\n setTimeout(function() {\n reject(REASONS.TIMEOUT_REACHED_GLOBAL);\n }, timeout);\n }).catch(function(reason) {\n switch (reason) {\n case REASONS.TIMEOUT_REACHED_GLOBAL:\n showLog('Prebid::getLoadPromise::TIMEOUT reached global');\n break;\n case REASONS.TIMEOUT_REACHED_FETCH_BIDS:\n showLog('Prebid::getLoadPromise::TIMEOUT reached in _fetchBid');\n break;\n case REASONS.ERROR_LOAD_LIBRARY:\n showError('Prebid::_loadLibrary::Error loading library', reason);\n break;\n default:\n showError('Prebid::getLoadPromise::Error in Prebid process', reason);\n }\n return false;\n });\n },\n\n /**\n * Force setTargeting\n */\n setTargetings() {\n if (window.pbjs.adserverRequestResponse) {\n window.googletag.cmd.push(function() {\n window.pbjs.que.push(function() {\n showLog('Prebid::setTargetings::Get targetings', window.pbjs.getAdserverTargeting());\n window.pbjs.setTargetingForGPTAsync();\n showLog('Prebid::setTargetings::Targetings added');\n });\n });\n } else {\n showLog('Prebid::setTargetings::Targetings NOT added because no response from bidders');\n }\n }\n});\n\n/* Private */\n\n/**\n * Load prebid library\n * @return {Promise}\n */\nfunction _loadLibrary() {\n showLog('Prebid::_loadLibrary::Loading library');\n return load(PREBID_URL)\n .catch(function(reason) {\n showError('Prebid::_loadLibrary', reason);\n return RSVP.reject(REASONS.ERROR_LOAD_LIBRARY);\n });\n}\n\nfunction _setConfig(headerBidding) {\n var biddersConfig, pbjsConfig;\n\n biddersConfig = headerBidding.biddersConfig;\n // NOTE: set custom config object\n pbjsConfig = {\n debug : SHOW_LOGS,\n enableSendAllBids: headerBidding.enableSendAllBids || true,\n priceGranularity : {\n buckets : [{\n precision: 2, // NOTE: default is 2 if omitted - means 2.123456 rounded to 4 decimal places\n min: 0,\n max: 20,\n increment: 0.01\n }]\n }\n };\n\n showLog('Prebid::_setConfig::biddersConfig', biddersConfig);\n window.pbjs.bidderSettings = _fetchBiddersSettings(biddersConfig);\n window.pbjs.setConfig(pbjsConfig);\n showLog('Prebid::_setConfig::Show Prebid config', window.pbjs.getConfig());\n}\n\n/**\n * Add adUnits config and make prebid call\n * @param {object} config - headerBidding config from configGDPMedio\n */\nfunction _fetchBid(headerBidding) {\n var adUnits, timeout;\n\n adUnits = headerBidding.adUnits;\n timeout = headerBidding.timeout || DEFAULT_PREBID_LOAD_TIMEOUT;\n\n return new RSVP.Promise(function(resolve, reject) {\n window.pbjs.que.push(function() {\n showLog('Prebid::_fetchBid::Add adUnits', adUnits);\n window.pbjs.addAdUnits(adUnits);\n showLog('Prebid::_fetchBid::Request Prebid');\n window.pbjs.requestBids({\n timeout,\n bidsBackHandler: function(biddersResponse) {\n showLog('Prebid::_fetchBid::Response from Prebid', biddersResponse);\n if (Object.keys(biddersResponse).length === 0) {\n reject(REASONS.TIMEOUT_REACHED_FETCH_BIDS);\n return;\n }\n window.pbjs.adserverRequestResponse = true;\n resolve();\n }\n });\n });\n });\n}\n\n/**\n * Build bidders settings from config\n * @param {object} biddersConfig - biddersConfig from configGDPMedio.headerBidding\n * @return {object} bidderSettings\n */\nfunction _fetchBiddersSettings(biddersConfig) {\n const bidderSettings = {};\n\n Object.keys(biddersConfig).forEach(function(bidderName) {\n bidderSettings[bidderName] = {\n bidCpmAdjustment : function(bidCpm, bid) {\n var percent;\n\n percent = (1 - ('percent' in biddersConfig[bidderName] ? biddersConfig[bidderName].percent / 100 : 0));\n // NOTE: adjust the bid in real time before the auction takes place\n showLog('Prebid::_fetchBiddersSettings::bidCpmAdjustment Bidder is:', bid.bidderCode, 'with percent:', percent);\n // NOTE: return bidCpm * .85; Ex.: rest 15% to the gross price\n return bidCpm * percent;\n }\n };\n });\n\n return bidderSettings;\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/header-bidding/providers/prebid.js","import {\n DEFAULT_PREBID_LOAD_TIMEOUT,\n DEFAULT_AMAZON_LOAD_TIMEOUT,\n OLD_PREFIX,\n NEW_SUFFIX\n} from '../constants';\nimport {\n showLog,\n showWarn\n} from '../utils';\n\nexport default Object.preventExtensions({\n processConfig(_tipoDispositivo, _dynamicId) {\n this.configGDPMedio.headerBidding = _processPrebidConfig.call(this, _tipoDispositivo, _dynamicId);\n this.configGDPMedio.hbAmazon = _processAmazonConfig.call(this, _tipoDispositivo, _dynamicId);\n }\n});\n\n/**\n * Process Prebid HB config to set dynamicId\n * @param {string} device - device type\n * @param {integer} dynamicId - dynamic ID for infinite-scroll\n * @return {object}\n */\nfunction _processPrebidConfig(device, dynamicId) {\n var property, adUnits, newConfig;\n var {headerBidding} = this.configGDPMedio;\n\n if (!headerBidding) {\n showLog('hbConfigProcessor::_processPrebidConfig::There are not Prebid configuration');\n return null;\n }\n\n property = `adUnits_${device}`;\n if (!(property in headerBidding) || !headerBidding[property].length) {\n showLog('hbConfigProcessor::_processPrebidConfig::There are not bidders to device type', device);\n return null;\n }\n\n adUnits = dynamicId ? headerBidding[property].map(function(current, index) {\n this[index].code = `${this[index].code}${dynamicId}`;\n return this[index];\n }, headerBidding[property]) : headerBidding[property];\n\n adUnits = [];\n headerBidding[property].forEach((current) => {\n var position;\n\n position = current.code.replace(new RegExp(`(${OLD_PREFIX}|${NEW_SUFFIX})`, 'g'), '');\n if (!this.existePosEnConfigGDPMedio(position)) {\n showWarn(`hbConfigProcessor::_processPrebidConfig::Priority position ${position} does not exists in configGDPMedio`);\n return null;\n }\n if (!this.isActive({position})) return null;\n\n current.code = dynamicId ? `${current.code}${dynamicId}` : current.code;\n adUnits.push(current);\n });\n\n newConfig = {\n adUnits: adUnits,\n biddersConfig: headerBidding.biddersConfig,\n enableSendAllBids: headerBidding.enableSendAllBids,\n timeout: headerBidding.timeout || DEFAULT_PREBID_LOAD_TIMEOUT\n };\n\n return newConfig;\n}\n\n/**\n * Process Amazon HB config to set dynamicId and slotName\n * @param {string} device - device type\n * @param {integer} dynamicId - dynamic ID for infinite-scroll\n */\nfunction _processAmazonConfig(device, dynamicId) {\n var property, slots, newConfig;\n var {hbAmazon} = this.configGDPMedio;\n\n if (!hbAmazon) {\n showLog('hbConfigProcessor::_processAmazonConfig::There are not Amazon configuration');\n return null;\n }\n\n property = `slots_${device}`;\n if (!(property in hbAmazon) || !hbAmazon[property].length) {\n showLog('hbConfigProcessor::_processAmazonConfig::There are not slots to device type', device);\n return null;\n }\n\n slots = [];\n hbAmazon[property].forEach((current) => {\n var position;\n\n position = current.slotID.replace(new RegExp(`(${OLD_PREFIX}|${NEW_SUFFIX})`, 'g'), '');\n if (!this.existePosEnConfigGDPMedio(position)) {\n showWarn(`hbConfigProcessor::_processAmazonConfig::Priority position ${position} does not exists in configGDPMedio`);\n return null;\n }\n if (!this.isActive({position})) return null;\n\n current.slotName = _getAmazonSlotName.call(this, position);\n current.slotID = dynamicId ? `${current.slotID}${dynamicId}` : current.slotID;\n slots.push(current);\n });\n\n newConfig = {\n slots: slots,\n timeout: hbAmazon.timeout || DEFAULT_AMAZON_LOAD_TIMEOUT\n };\n\n return newConfig;\n}\n\nfunction _getAmazonSlotName(position) {\n var params;\n\n var container$ = $(`[data-voc-vam-position = '${position}']`, this.context$);\n if (container$.length) {\n params = this.normalizaParams(container$);\n } else {\n params = this.normalizaParams({position});\n }\n\n return this.getOasSitepage(params);\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/header-bidding/config-manager.js"],"sourceRoot":""}