function pwtCreatePrebidNamespace(preBidNameSpace) { window[preBidNameSpace] = window[preBidNameSpace] || {}; window[preBidNameSpace].que = window[preBidNameSpace].que || [];/* prebid.js v0.33.0Updated : 2018-05-08 */!(function(s){var c=window.pbjsChunk;window.pbjsChunk=function(e,n,r){for(var t,i,o,a=0,d=[];an.timeToRespond?n:e;return e.cpm';u+="",u+="",u+="",u+=i.adHtml,u+="",d.write(u),d.close()}catch(l){f.log("Error in rendering creative in safe frame."),f.log(l),f.log("Rendering synchronously."),f.displayCreative(window.document,msgData.pwt_bid)}else i.adUrl?f.writeIframe(window.document,i.adUrl,i.width,i.height,""):(f.log("creative details are not found"),f.log(i))}}}catch(l){}},t.addMessageEventListenerForSafeFrame=function(e){f.addMessageEventListener(e,f.safeFrameCommunicationProtocol)},t.getElementLocation=function(e){var t,i=0,n=0;if(f.isFunction(e.getBoundingClientRect))t=e.getBoundingClientRect(),i=Math.floor(t.left),n=Math.floor(t.top);else for(;e;)i+=e.offsetLeft,n+=e.offsetTop,e=e.offsetParent;return{x:i,y:n}},t.createVLogInfoPanel=function(e,t){var i,n,r,o=window.document;if(f.visualDebugLogIsEnabled&&(i=o.getElementById(e),i&&t.length&&t[0][0]&&t[0][1]&&(r=e+"-pwtc-info",!f.isUndefined(o.getElementById(r))))){var a=f.getElementLocation(i);n=o.createElement("div"),n.id=r,n.style="position: absolute; /*top: "+a.y+"px;*/ left: "+a.x+"px; width: "+t[0][0]+"px; height: "+t[0][1]+"px; border: 1px solid rgb(255, 204, 52); padding-left: 11px; background: rgb(247, 248, 224) none repeat scroll 0% 0%; overflow: auto; z-index: 9999997; visibility: hidden;opacity:0.9;font-size:13px;font-family:monospace;";var s=o.createElement("img");s.src=f.metaInfo.protocol+"ads.pubmatic.com/AdServer/js/pwt/close.png",s.style="cursor:pointer; position: absolute; top: 2px; left: "+(a.x+t[0][0]-16-15)+"px; z-index: 9999998;",s.title="close",s.onclick=function(){n.style.display="none"},n.appendChild(s),n.appendChild(o.createElement("br"));for(var d="Slot: "+e+" | ",u=0;ua&&(a=0),n="Bid: "+t.bidder+(t.s2s?"(s2s)":"")+": "+s.getNetEcpm()+"("+s.getGrossEcpm()+"): "+a+"ms",s.getPostTimeoutStatus()&&(n+=": POST-TIMEOUT");break;case"win-bid":var s=t.bidDetails;n="Winning Bid: "+s.getAdapterID()+": "+s.getNetEcpm();break;case"win-bid-fail":n="There are no bids from PWT";break;case"hr":n="----------------------";break;case"disp":n="Displaying creative from "+t.adapter}i.appendChild(r.createTextNode(n)),i.appendChild(r.createElement("br"))}}},t.getExternalBidderStatus=function(e){var t=!0;return f.forEachOnArray(e,(function(e,i){t=window.OWT.externalBidderStatuses[i]?t&&window.OWT.externalBidderStatuses[i].status:t})),t},t.resetExternalBidderStatus=function(e){f.forEachOnArray(e,(function(e,t){f.log("resetExternalBidderStatus: "+t),window.OWT.externalBidderStatuses[t]=void 0}))}}),(function(e,t){t.COMMON={BID_PRECISION:2,DEAL_KEY_FIRST_PART:"pwtdeal_",DEAL_KEY_VALUE_SEPARATOR:"_-_",PREBID_PREFIX:"PB_",CONFIG:"config",DIV_ID:"divID",PARAMS:"params",SIZES:"sizes",HEIGHT:"height",WIDTH:"width",SLOTS:"slots",KEY_GENERATION_PATTERN_VALUE:"kgpv",KEY_VALUE_PAIRS:"kvp",IMPRESSION_ID:"iid",PARENT_ADAPTER_PREBID:"prebid"},t.CONFIG={GLOBAL:"global",ADAPTERS:"adapters",COMMON:"pwt",TIMEOUT:"t",KEY_GENERATION_PATTERN:"kgp",KEY_LOOKUP_MAP:"klm",SERVER_SIDE_KEY:"sk",PUBLISHER_ID:"pubid",PROFILE_ID:"pid",PROFILE_VERSION_ID:"pdvid",LOGGER_URL:"dataURL",TRACKER_URL:"winURL",REV_SHARE:"rev_share",THROTTLE:"throttle",BID_PASS_THROUGH:"pt",GLOBAL_KEY_VALUE:"gkv",MASK_BIDS:"maksBids",META_DATA_PATTERN:"metaDataPattern",SEND_ALL_BIDS:"sendAllBids",SERVER_SIDE_ENABLED:"serverSideEnabled"},t.METADATA_MACROS={WIDTH:"_W_",HEIGHT:"_H_",PARTNER:"_P_",GROSS_ECPM:"_GE_",NET_ECPM:"_NE_",BID_COUNT:"_BC_",PARTNER_COUNT:"_PC_"},t.MACROS={WIDTH:"_W_",HEIGHT:"_H_",AD_UNIT_ID:"_AU_",AD_UNIT_INDEX:"_AUI_",INTEGER:"_I_",DIV:"_DIV_"},t.SLOT_STATUS={CREATED:0,PARTNERS_CALLED:1,TARGETING_ADDED:2,DISPLAYED:3},t.WRAPPER_TARGETING_KEYS={BID_ID:"pwtsid",BID_STATUS:"pwtbst",BID_ECPM:"pwtecp",BID_DEAL_ID:"pwtdid",BID_ADAPTER_ID:"pwtpid",BID_SIZE:"pwtsz",PUBLISHER_ID:"pwtpubid",PROFILE_ID:"pwtprofid",PROFILE_VERSION_ID:"pwtverid",META_DATA:"pwtm"},t.IGNORE_PREBID_KEYS={hb_bidder:1,hb_adid:1,hb_pb:1,hb_size:1,hb_deal:1},t.LOGGER_PIXEL_PARAMS={TIMESTAMP:"tst",PAGE_URL:"purl",TIMEOUT:"to"},t.MESSAGES={M1:": In fetchbids.",M2:": Throttled.",M3:": adapter must implement the fetchBids() function.",M4:"BidManager: entry ",M5:": Callback.",M6:"bidAlreadExists : ",M7:": Exiting from fetchBids.",M8:". Config not found, ignored.",M9:". Config ignored.",M10:"Bid is rejected as ecpm is NULL.",M11:"Bid is rejected as ecpm is NaN: ",M12:"Existing bid ecpm: ",M13:", is lower than new bid ecpm ",M14:", so we are replacing bid.",M15:", is greater than new bid ecpm ",M16:", so we are not replacing bid.",M17:"Post timeout bid, ignored.",M18:"Bid is selected.",M19:": Found winning adapterID: ",M20:"Bid is rejected as ecpm is empty string.",M21:": error in respose handler.",M22:"Bid is rejected as ecpm is <= 0.",M23:"Existing bid is default-bid with zero ecpm, thus replacing it with the new bid from partner.",M24:"Passsed argument is not a bidAdaptor",M25:"Bid details not found for bidID: "}}),(function(e,t,i){function n(e,t){this.adapterID=e,this.kgpv=t,this.bidID=a.getUniqueIdentifierStr(),this.grossEcpm=0,this.netEcpm=0,this.defaultBid=0,this.adHtml="",this.adUrl="",this.height=0,this.width=0,this.creativeID="",this.keyValuePairs={},this.isPostTimeout=!1,this.receivedTime=0,this.dealID="",this.dealChannel="",this.isWinningBid=!1,this.status=0}var r=i(4),o=i(2),a=i(1);n.prototype.getAdapterID=function(){return this.adapterID},n.prototype.getBidID=function(){return this.bidID},n.prototype.setGrossEcpm=function(e){return null===e?(a.log(o.MESSAGES.M10),a.log(this),this):a.isString(e)&&(e=e.replace(/\s/g,""),0===e.length)?(a.log(o.MESSAGES.M20),a.log(this),this):window.isNaN(e)?(a.log(o.MESSAGES.M11+e),a.log(this),this):(e=window.parseFloat(e.toFixed(o.COMMON.BID_PRECISION)),this.grossEcpm=e,this.netEcpm=window.parseFloat((this.grossEcpm*r.getAdapterRevShare(this.getAdapterID())).toFixed(o.COMMON.BID_PRECISION)),this)},n.prototype.getGrossEcpm=function(){return this.grossEcpm},n.prototype.getNetEcpm=function(){return this.netEcpm},n.prototype.setDefaultBidStatus=function(e){return this.defaultBid=e,this},n.prototype.getDefaultBidStatus=function(){return this.defaultBid},n.prototype.setAdHtml=function(e){return this.adHtml=e,this},n.prototype.getAdHtml=function(){return this.adHtml},n.prototype.setAdUrl=function(e){return this.adUrl=e,this},n.prototype.getAdUrl=function(){return this.adUrl},n.prototype.setHeight=function(e){return this.height=e,this},n.prototype.getHeight=function(){return this.height},n.prototype.setWidth=function(e){return this.width=e,this},n.prototype.getWidth=function(){return this.width},n.prototype.getKGPV=function(){return this.kgpv},n.prototype.setKeyValuePair=function(e,t){return this.keyValuePairs[e.substr(0,20)]=t,this},n.prototype.getKeyValuePairs=function(){return this.keyValuePairs},n.prototype.setPostTimeoutStatus=function(){return this.isPostTimeout=!0,this},n.prototype.getPostTimeoutStatus=function(){return this.isPostTimeout},n.prototype.setReceivedTime=function(e){return this.receivedTime=e,this},n.prototype.getReceivedTime=function(){return this.receivedTime},n.prototype.setDealID=function(e){return e&&(this.dealID=e,this.dealChannel=this.dealChannel||"PMP",this.setKeyValuePair(o.COMMON.DEAL_KEY_FIRST_PART+this.adapterID,this.dealChannel+o.COMMON.DEAL_KEY_VALUE_SEPARATOR+this.dealID+o.COMMON.DEAL_KEY_VALUE_SEPARATOR+this.bidID)),this},n.prototype.getDealID=function(){return this.dealID},n.prototype.setDealChannel=function(e){return this.dealID&&e&&(this.dealChannel=e,this.setKeyValuePair(o.COMMON.DEAL_KEY_FIRST_PART+this.adapterID,this.dealChannel+o.COMMON.DEAL_KEY_VALUE_SEPARATOR+this.dealID+o.COMMON.DEAL_KEY_VALUE_SEPARATOR+this.bidID)),this},n.prototype.getDealChannel=function(){return this.dealChannel},n.prototype.setWinningBidStatus=function(){return this.isWinningBid=!0,this},n.prototype.getWinningBidStatus=function(){return this.isWinningBid},n.prototype.setStatus=function(e){return this.status=e,this},n.prototype.getStatus=function(){return this.status},n.prototype.setSendAllBidsKeys=function(){this.setKeyValuePair(o.WRAPPER_TARGETING_KEYS.BID_ID+"_"+this.adapterID,this.bidID),this.setKeyValuePair(o.WRAPPER_TARGETING_KEYS.BID_STATUS+"_"+this.adapterID,this.getNetEcpm()>0?1:0),this.setKeyValuePair(o.WRAPPER_TARGETING_KEYS.BID_ECPM+"_"+this.adapterID,this.getNetEcpm().toFixed(o.COMMON.BID_PRECISION)),this.setKeyValuePair(o.WRAPPER_TARGETING_KEYS.BID_SIZE+"_"+this.adapterID,this.width+"x"+this.height)},e.exports.Bid=n,t.createBid=function(e,t){return new n(e,t)}}),(function(e,t,i){function n(){var e=o.COMMON.PARENT_ADAPTER_PREBID;if(!a.isOwnProperty(r.adapters,e)){var t={};t[o.CONFIG.REV_SHARE]="0.0",t[o.CONFIG.THROTTLE]="100",t[o.CONFIG.KEY_GENERATION_PATTERN]="_DIV_",t[o.CONFIG.KEY_LOOKUP_MAP]={},r.adapters[e]=t}}var r=i(5),o=i(2),a=i(1),s=null;s=this,t.getPublisherId=function(){return a.trim(r.pwt.pubid)||"0"},t.getMataDataPattern=function(){return a.isString(r[o.CONFIG.COMMON][o.CONFIG.META_DATA_PATTERN])?r[o.CONFIG.COMMON][o.CONFIG.META_DATA_PATTERN]:null},t.getSendAllBidsStatus=function(){return window.parseInt(r[o.CONFIG.COMMON][o.CONFIG.SEND_ALL_BIDS])||0},t.getTimeout=function(){return window.parseInt(r.pwt.t)||1e3},t.getAdapterRevShare=function(e){var t=r.adapters;return a.isOwnProperty(t[e],o.CONFIG.REV_SHARE)?1-window.parseFloat(t[e][o.CONFIG.REV_SHARE])/100:1},t.getAdapterThrottle=function(e){var t=r.adapters;return a.isOwnProperty(t[e],o.CONFIG.THROTTLE)?100-window.parseFloat(t[e][o.CONFIG.THROTTLE]):0},t.isServerSideAdapter=function(e){var t=r.adapters;return a.isOwnProperty(t[e],o.CONFIG.SERVER_SIDE_ENABLED)?1===window.parseInt(t[e][o.CONFIG.SERVER_SIDE_ENABLED]):!1},t.getAdapterMaskBidsStatus=function(e){var t=r.adapters,i={audienceNetwork:1,rubicon:1};return a.isOwnProperty(i,e)?i[e]:a.isOwnProperty(t[e],o.CONFIG.MASK_BIDS)?window.parseInt(t[e][o.CONFIG.MASK_BIDS])||0:0},t.getBidPassThroughStatus=function(e){var t=r.adapters;return a.isOwnProperty(t[e],o.CONFIG.BID_PASS_THROUGH)?window.parseInt(t[e][o.CONFIG.BID_PASS_THROUGH]):0},t.getProfileID=function(){return a.trim(r.pwt[o.CONFIG.PROFILE_ID])||"0"},t.getProfileDisplayVersionID=function(){return a.trim(r.pwt[o.CONFIG.PROFILE_VERSION_ID])||"0"},t.getAnalyticsPixelURL=function(){return r.pwt[o.CONFIG.LOGGER_URL]||!1},t.getMonetizationPixelURL=function(){return r.pwt[o.CONFIG.TRACKER_URL]||!1},t.forEachAdapter=function(e){a.forEachOnObject(r.adapters,e)},t.addPrebidAdapter=n,t.initConfig=function(){s.addPrebidAdapter();var e={};a.forEachOnObject(o.CONFIG,(function(t,i){e[i]=""})),a.forEachOnObject(r.adapters,(function(t,i){var n={};a.forEachOnObject(i,(function(t,i){a.isOwnProperty(e,t)||(n[t]=i)})),a.forEachOnObject(i[o.CONFIG.KEY_LOOKUP_MAP],(function(e,t){a.forEachOnObject(n,(function(e,i){t[e]=i}))}))}))}}),(function(e,t){t.pwt={t:"1000",pid:"413",gcv:"44",pdvid:"15",pubid:"156461",dataURL:"t.pubmatic.com/wl?",winURL:"t.pubmatic.com/wt?",metaDataPattern:0,sendAllBids:"1",adserver:"DFP",gdpr:"0",cmp:0,gdprTimeout:0,awc:0},t.adapters={pubmatic:{publisherId:"156461",rev_share:"0.0",timeout:"1000",throttle:"100",pt:0,serverSideEnabled:"0",kgp:"_AU_@_W_x_H_:_AUI_",sk:"true"}}}),(function(e,t,i){function n(e){p.isOwnProperty(window.PWT.bidMap,e)||(window.PWT.bidMap[e]=g.createBMEntry(e))}function r(e,t,i,n){window.PWT.bidMap[e].setNewBid(t,i),window.PWT.bidIdMap[i.getBidID()]={s:e,a:t},0===i.getDefaultBidStatus()&&p.vLogInfo(e,{type:"bid",bidder:t+(0!==l.getBidPassThroughStatus(t)?"(Passthrough)":""),bidDetails:i,latency:n,s2s:l.isServerSideAdapter(t)})}function o(e,t,i){var n="",r=0,o=0,s=c.METADATA_MACROS,d="g";p.forEachOnObject(t.adapters,(function(t,i){""!=i.getLastBidID()&&("pubmaticServer"!==t&&o++,p.forEachOnObject(i.bids,(function(t,i){1!=i.getDefaultBidStatus()&&1!=i.getPostTimeoutStatus()&&(r++,n+=a(e,i))})))})),0==n.length&&(n=e),n=n.replace(new RegExp(s.BID_COUNT,d),r),n=n.replace(new RegExp(s.PARTNER_COUNT,d),o),i[c.WRAPPER_TARGETING_KEYS.META_DATA]=encodeURIComponent(n)}function a(e,t){var i=c.METADATA_MACROS,n="g";return e.replace(new RegExp(i.PARTNER,n),t.getAdapterID()).replace(new RegExp(i.WIDTH,n),t.getWidth()).replace(new RegExp(i.HEIGHT,n),t.getHeight()).replace(new RegExp(i.GROSS_ECPM,n),t.getGrossEcpm()).replace(new RegExp(i.NET_ECPM,n),t.getNetEcpm())}function s(e){var t=null,i={};return p.forEachOnObject(e.adapters,(function(e,n){var r=f.auctionBidsCallBack(e,n,i,t);t=r.winningBid,i=r.keyValuePairs})),null!==l.getMataDataPattern()&&o(l.getMataDataPattern(),e,i),{wb:t,kvp:i}}function d(e,t,i,n){return""!=t.getLastBidID()?(p.forEachOnObject(t.bids,(function(t,r){return r.getPostTimeoutStatus()===!0?{winningBid:n,keyValuePairs:i}:(1!==r.getDefaultBidStatus()&&1==l.getSendAllBidsStatus()&&r.setSendAllBidsKeys(),0===l.getBidPassThroughStatus(e)&&p.copyKeyValueObject(i,r.getKeyValuePairs()),0!==l.getBidPassThroughStatus(e)?(p.copyKeyValueObject(i,r.getKeyValuePairs()),{winningBid:n,keyValuePairs:i}):(null==n?n=r:n.getNetEcpm()0?(t.setStatus(1),t.setWinningBidStatus(),p.vLogInfo(e,{type:"win-bid",bidDetails:t})):p.vLogInfo(e,{type:"win-bid-fail"})}return{wb:t,kvp:i}},t.getBidById=function(e){if(!p.isOwnProperty(window.PWT.bidIdMap,e))return p.log(c.MESSAGES.M25+e),null;var t=window.PWT.bidIdMap[e].s,i=window.PWT.bidIdMap[e].a;if(p.isOwnProperty(window.PWT.bidMap,t)){p.log("BidID: "+e+", DivID: "+t+c.MESSAGES.M19+i);var n=window.PWT.bidMap[t].getBid(i,e);return null==n?null:{bid:n,slotid:t}}return p.log(c.MESSAGES.M25+e),null},t.displayCreative=function(e,t){var i=f.getBidById(t);if(i){var n=i.bid,r=i.slotid;p.displayCreative(e,n),p.vLogInfo(r,{type:"disp",adapter:n.getAdapterID()}),f.executeMonetizationPixel(r,n)}},t.executeAnalyticsPixel=function(){var e={s:[]},t=l.getAnalyticsPixelURL(),i={};t&&(t=p.metaInfo.protocol+t+"pubid="+l.getPublisherId()+"&json=",e[c.CONFIG.PUBLISHER_ID]=l.getPublisherId(),e[c.LOGGER_PIXEL_PARAMS.TIMEOUT]=""+l.getTimeout(),e[c.LOGGER_PIXEL_PARAMS.PAGE_URL]=window.decodeURIComponent(p.metaInfo.pageURL),e[c.LOGGER_PIXEL_PARAMS.TIMESTAMP]=p.getCurrentTimestamp(),e[c.CONFIG.PROFILE_ID]=l.getProfileID(),e[c.CONFIG.PROFILE_VERSION_ID]=l.getProfileDisplayVersionID(),p.forEachOnObject(window.PWT.bidMap,(function(e,t){f.analyticalPixelCallback(e,t,i)})),p.forEachOnObject(i,(function(i,n){n.length>0&&(e.s=n,e[c.COMMON.IMPRESSION_ID]=window.encodeURIComponent(i),(new window.Image).src=t+window.encodeURIComponent(JSON.stringify(e)))})))},t.executeMonetizationPixel=function(e,t){var i=l.getMonetizationPixelURL();i&&(i+="pubid="+l.getPublisherId(),i+="&purl="+window.encodeURIComponent(p.metaInfo.pageURL),i+="&tst="+p.getCurrentTimestamp(),i+="&iid="+window.encodeURIComponent(window.PWT.bidMap[e].getImpressionID()),i+="&bidid="+window.encodeURIComponent(t.getBidID()),i+="&pid="+window.encodeURIComponent(l.getProfileID()),i+="&pdvid="+window.encodeURIComponent(l.getProfileDisplayVersionID()),i+="&slot="+window.encodeURIComponent(e),i+="&pn="+window.encodeURIComponent(t.getAdapterID()),i+="&en="+window.encodeURIComponent(t.getNetEcpm()),i+="&eg="+window.encodeURIComponent(t.getGrossEcpm()),i+="&kgpv="+window.encodeURIComponent(t.getKGPV()),f.setImageSrcToPixelURL(i))},t.analyticalPixelCallback=u,t.setImageSrcToPixelURL=function(e){var t=new window.Image;t.src=p.metaInfo.protocol+e},t.getAllPartnersBidStatuses=function(e,t){var i=!0;return p.forEachOnArray(t,(function(t,n){e[n]&&p.forEachOnObject(e[n].adapters,(function(e,t){p.forEachOnObject(t.bids,(function(e,t){i=i&&0===t.getDefaultBidStatus()}))}))})),i}}),(function(e,t,i){function n(e){this.name=e,this.sizes=[],this.adapters={},this.creationTime=o.getCurrentTimestampInMs(),this.impressionID="",this.analyticsEnabled=!1,this.expired=!1}var r=i(2),o=i(1),a=i(8).AdapterEntry;n.prototype.setExpired=function(){return this.expired=!0,this},n.prototype.getExpiredStatus=function(){return this.expired},n.prototype.setAnalyticEnabled=function(){return this.analyticsEnabled=!0,this},n.prototype.getAnalyticEnabledStatus=function(){return this.analyticsEnabled},n.prototype.setNewBid=function(e,t){o.isOwnProperty(this.adapters,e)||(this.adapters[e]=new a(e)),this.adapters[e].setNewBid(t)},n.prototype.getBid=function(e,t){return o.isOwnProperty(this.adapters,e)?this.adapters[e].getBid(t):void 0},n.prototype.getName=function(){return this.name},n.prototype.getCreationTime=function(){return this.creationTime},n.prototype.setImpressionID=function(e){return this.impressionID=e,this},n.prototype.getImpressionID=function(){return this.impressionID},n.prototype.setSizes=function(e){return this.sizes=e,this},n.prototype.getSizes=function(){return this.sizes},n.prototype.setAdapterEntry=function(e){return o.isOwnProperty(this.adapters,e)||(this.adapters[e]=new a(e),o.log(r.MESSAGES.M4+this.name+" "+e+" "+this.adapters[e].getCallInitiatedTime())),this},n.prototype.getLastBidIDForAdapter=function(e){return o.isOwnProperty(this.adapters,e)?this.adapters[e].getLastBidID():""},e.exports.BMEntry=n,t.createBMEntry=function(e){return new n(e)}}),(function(e,t,i){function n(e){this.adapterID=e,this.callInitiatedTime=r.getCurrentTimestampInMs(),this.bids={},this.lastBidID=""}var r=i(1);n.prototype.getCallInitiatedTime=function(){return this.callInitiatedTime},n.prototype.getLastBidID=function(){return this.lastBidID},n.prototype.getBid=function(e){return r.isOwnProperty(this.bids,e)?this.bids[e]:null},n.prototype.setNewBid=function(e){delete this.bids[this.lastBidID];var t=e.getBidID();this.bids[t]=e,this.lastBidID=t},e.exports.AdapterEntry=n}),(function(e,t,i){function n(e){q.isObject(e)&&(ot=e)}function r(){return ot}function o(e){var t=0;try{var i=e.getSlotId().getId().split("_");t=parseInt(i[i.length-1])}catch(n){}return t}function a(e,t){if(!q.isOwnProperty(t,e))return!1;var i=t[e],n=q.getScreenWidth(at.getWindowReference()),r=q.getScreenHeight(at.getWindowReference());if(q.log(e+": responsiveSizeMapping found: screenWidth: "+n+", screenHeight: "+r),q.log(i),!q.isArray(i))return!1;for(var o=0,a=i.length;a>o;o++)if(2==i[o].length&&2==i[o][0].length){var s=i[o][0][0],d=i[o][0][1];if(n>=s&&r>=d){if(0!=i[o][1].length&&!q.isArray(i[o][1][0])){if(2==i[o][1].length&&q.isNumber(i[o][1][0])&&q.isNumber(i[o][1][1]))return[i[o][1]];q.log(e+": Unsupported mapping template."),q.log(i)}return i[o][1]}}return!1}function s(e,t){var i=at.getSizeFromSizeMapping(e,at.slotSizeMapping);if(i!==!1)return q.log(e+": responsiveSizeMapping applied: "),q.log(i),i;var n=[];return q.isFunction(t.getSizes)&&q.forEachOnArray(t.getSizes(),(function(t,i){q.isFunction(i.getWidth)&&q.isFunction(i.getHeight)?n.push([i.getWidth(),i.getHeight()]):(q.log(e+", size object does not have getWidth and getHeight method. Ignoring: "),q.log(i))})),n}function d(e,t){q.isObject(e)&&q.isFunction(e.getDivID)&&q.isArray(t)&&t[0]&&t[0]==e.getDivID()&&(e.setDisplayFunctionCalled(!0),e.setArguments(t))}function u(e,t,i){if(q.isOwnProperty(at.slotsMap,e))i||at.slotsMap[e].setSizes(at.getAdSlotSizesArray(e,t));else{var n=X.createSlot(e);n.setDivID(e),n.setPubAdServerObject(t),n.setAdUnitID(t.getAdUnitPath()),n.setAdUnitIndex(at.getAdUnitIndex(t)),n.setSizes(at.getAdSlotSizesArray(e,t)),n.setStatus(Y.SLOT_STATUS.CREATED),et&&q.isObject(JSON)&&q.isFunction(JSON.stringify)&&q.forEachOnArray(t.getTargetingKeys(),(function(e,i){n.setKeyValue(i,t.getTargeting(i))})),at.slotsMap[e]=n,q.createVLogInfoPanel(e,n.getSizes())}}function l(e){if(q.isObject(e)&&q.isFunction(e.getSlotId)){var t=e.getSlotId();if(t&&q.isFunction(t.getDomId))return t.getDomId()}return""}function c(e,t,i){q.log("Generating slotsMap"),q.forEachOnArray(e,(function(e,n){var r=at.generateSlotName(n);at.storeInSlotsMap(r,n,i),i&&q.isOwnProperty(at.slotsMap,r)&&at.setDisplayFunctionCalledIfRequired(at.slotsMap[r],t)})),q.log(at.slotsMap)}function p(e){return q.isOwnProperty(at.slotsMap,e)?at.slotsMap[e].getStatus():Y.SLOT_STATUS.DISPLAYED}function g(e,t){q.isOwnProperty(at.slotsMap,e)&&at.slotsMap[e].updateStatusAfterRendering(t)}function f(e){var t=[];return q.forEachOnObject(at.slotsMap,(function(i,n){q.isOwnProperty(e,n.getStatus())&&t.push(i)})),t}function h(e){var t,i={};q.isOwnProperty(at.slotsMap,e)&&(t=at.slotsMap[e].getPubAdServerObject(),q.forEachOnArray(t.getTargetingKeys(),(function(e,n){i[n]=t.getTargeting(n)})),t.clearTargeting(),q.forEachOnObject(i,(function(e,i){q.isOwnProperty(at.wrapperTargetingKeys,e)||t.setTargeting(e,i)})))}function I(e,t,i){q.forEachOnArray(e,(function(e,n){if(q.isOwnProperty(at.slotsMap,n)){var r=at.slotsMap[n];r.setStatus(Y.SLOT_STATUS.PARTNERS_CALLED),i&&(at.removeDMTargetingFromSlot(n),r.setRefreshFunctionCalled(!0),r.setArguments(t))}}))}function E(e){var t=[];return q.forEachOnArray(e,(function(e,i){t.push(at.slotsMap[i])})),t}function S(e){var t={};return q.forEachOnObject(e,(function(e,i){t[i]=""})),t}function w(e){var t=Q.getBid(e),i=t.wb||null,n=t.kvp||null,r=at.slotsMap[e].getPubAdServerObject(),o=Y.IGNORE_PREBID_KEYS;if(q.log("DIV: "+e+" winningBid: "),q.log(i),i&&i.getNetEcpm()>0){at.slotsMap[e].setStatus(Y.SLOT_STATUS.TARGETING_ADDED),r.setTargeting(Y.WRAPPER_TARGETING_KEYS.BID_ID,i.getBidID()),r.setTargeting(Y.WRAPPER_TARGETING_KEYS.BID_STATUS,i.getStatus()),r.setTargeting(Y.WRAPPER_TARGETING_KEYS.BID_ECPM,i.getNetEcpm().toFixed(Y.COMMON.BID_PRECISION));var a=i.getDealID();a&&r.setTargeting(Y.WRAPPER_TARGETING_KEYS.BID_DEAL_ID,a),r.setTargeting(Y.WRAPPER_TARGETING_KEYS.BID_ADAPTER_ID,i.getAdapterID()),r.setTargeting(Y.WRAPPER_TARGETING_KEYS.PUBLISHER_ID,z.getPublisherId()),r.setTargeting(Y.WRAPPER_TARGETING_KEYS.PROFILE_ID,z.getProfileID()),r.setTargeting(Y.WRAPPER_TARGETING_KEYS.PROFILE_VERSION_ID,z.getProfileDisplayVersionID())}q.forEachOnObject(n,(function(e,t){q.isOwnProperty(o,e)||(r.setTargeting(e,t),at.defineWrapperTargetingKey(e))}))}function m(e){q.isObject(at.wrapperTargetingKeys)||(at.wrapperTargetingKeys={}),at.wrapperTargetingKeys[e]=""}function A(e,t){return q.isObject(e)&&q.isFunction(t)?function(){return $=!0,q.log("Disable Initial Load is called"),t.apply(e,arguments)}:(q.log("disableInitialLoad: originalFunction is not a function"),null)}function T(e,t){return q.isObject(e)&&q.isFunction(t)?function(){return q.log("enableSingleRequest is called"),t.apply(e,arguments)}:(q.log("disableInitialLoad: originalFunction is not a function"),null)}function y(e,t){return q.isObject(e)&&q.isFunction(t)?function(){var i=arguments,n=i[0]?i[0]:null;return null!=n&&(q.isOwnProperty(rt,n)||(rt[n]=[]),rt[n]=rt[n].concat(i[1])),t.apply(e,arguments)}:(q.log("setTargeting: originalFunction is not a function"),null)}function D(e,t){return q.isObject(e)&&q.isFunction(t)?function(){var i=arguments[0]||window.googletag.pubads().getSlots();return q.forEachOnArray(i,(function(e,t){delete nt[at.generateSlotName(t)]})),t.apply(e,arguments)}:(q.log("destroySlots: originalFunction is not a function"),null)}function P(e,t,i,n){q.log(e),q.log(n),at.updateStatusAfterRendering(n[0],!1),i.apply(t,n)}function O(e,t){var i=t.getStatus();i!=Y.SLOT_STATUS.DISPLAYED&&i!=Y.SLOT_STATUS.TARGETING_ADDED&&at.findWinningBidAndApplyTargeting(e)}function b(e,t,i){at.getStatusOfSlotForDivId(i[0])!=Y.SLOT_STATUS.DISPLAYED?at.updateStatusAndCallOriginalFunction_Display("Calling original display function after timeout with arguments, ",e,t,i):q.log("AdSlot already rendered")}function v(e,t,i){q.getExternalBidderStatus(t)&&Q.getAllPartnersBidStatuses(window.PWT.bidMap,t)?(q.resetExternalBidderStatus(t),i()):e>0&&window.setTimeout((function(){at.executeDisplay(e-10,t,i)}),10)}function R(e,t,i,n){switch(e){case Y.SLOT_STATUS.CREATED:case Y.SLOT_STATUS.PARTNERS_CALLED:var r=Object.keys(at.slotsMap);"object"==typeof window.OWT.externalBidderStatuses[n[0]]&&window.OWT.externalBidderStatuses[n[0]]&&at.executeDisplay(z.getTimeout(),r,(function(){q.forEachOnObject(at.slotsMap,(function(e,t){at.findWinningBidIfRequired_Display(e,t)})),at.processDisplayCalledSlot(t,i,n)})),setTimeout((function(){q.log("PostTimeout.. back in display function"),q.forEachOnObject(at.slotsMap,(function(e,t){at.findWinningBidIfRequired_Display(e,t)})),at.processDisplayCalledSlot(t,i,n)}),z.getTimeout());break;case Y.SLOT_STATUS.TARGETING_ADDED:at.updateStatusAndCallOriginalFunction_Display("As DM processing is already done, Calling original display function with arguments",t,i,n);break;case Y.SLOT_STATUS.DISPLAYED:at.updateStatusAndCallOriginalFunction_Display("As slot is already displayed, Calling original display function with arguments",t,i,n)}}function _(e,t,i){if(e.length>0){at.updateStatusOfQualifyingSlotsBeforeCallingAdapters(e,t,i);var n=at.arrayOfSelectedSlots(e);J.callAdapters(n)}}function M(e,t){return q.isObject(e)&&q.isFunction(t)?function(){if(q.log("In display function, with arguments: "),q.log(arguments),$)return q.log("DisableInitialLoad was called, Nothing to do"),t.apply(e,arguments);at.updateSlotsMapFromGoogleSlots(e.pubads().getSlots(),arguments,!0),at.displayFunctionStatusHandler(p(arguments[0]),e,t,arguments);var i={};i[Y.SLOT_STATUS.CREATED]="",at.forQualifyingSlotNamesCallAdapters(f(i),arguments,!1);var n=arguments[0];setTimeout((function(){q.realignVLogInfoPanel(n),Q.executeAnalyticsPixel()}),2e3+z.getTimeout())}:(q.log("display: originalFunction is not a function"),null)}function B(e){at.displayHookIsAdded||(at.displayHookIsAdded=!0,q.log("Adding hook on googletag.display."),q.addHookOnFunction(e,!1,"display",this.newDisplayFunction))}function C(e,t,i){return q.isOwnProperty(at.slotsMap,e)&&at.slotsMap[e].isRefreshFunctionCalled()===!0&&at.slotsMap[e].getStatus()!==Y.SLOT_STATUS.DISPLAYED?(at.findWinningBidAndApplyTargeting(t),at.updateStatusAfterRendering(t,!0),!0):i}function L(e,t){q.createVLogInfoPanel(e,at.slotsMap[t].getSizes()),q.realignVLogInfoPanel(e),Q.executeAnalyticsPixel()}function F(e,t,i,n){q.log("Executing post timeout events, arguments: "),q.log(n);var r=!1;q.forEachOnArray(e,(function(e,t){var i=at.slotsMap[t].getDivID();r=at.findWinningBidIfRequired_Refresh(t,i,r),window.setTimeout((function(){at.postRederingChores(i,t)}),2e3)})),this.callOriginalRefeshFunction(r,t,i,n)}function N(e,t,i,n){e===!0?(q.log("Calling original refresh function post timeout"),i.apply(t,n)):q.log("AdSlot already rendered")}function W(e,t){var i=[],n=[];return n=0==e.length||null==e[0]?t.getSlots():e[0],q.forEachOnArray(n,(function(e,t){var n=at.generateSlotName(t);n.length>0&&(i=i.concat(n))})),i}function U(e,t){return q.isObject(e)&&q.isFunction(t)?function(){q.log("In Refresh function"),at.updateSlotsMapFromGoogleSlots(e.getSlots(),arguments,!1);var i=W(arguments,e);at.forQualifyingSlotNamesCallAdapters(i,arguments,!0),q.log("Intiating Call to original refresh function with Timeout: "+z.getTimeout()+" ms");var n=arguments;"object"==typeof window.OWT.externalBidderStatuses[i[0]]&&window.OWT.externalBidderStatuses[i[0]]&&at.executeDisplay(z.getTimeout(),i,(function(){at.postTimeoutRefreshExecution(i,e,t,n)})),setTimeout((function(){at.postTimeoutRefreshExecution(i,e,t,n)}),z.getTimeout())}:(q.log("refresh: originalFunction is not a function"),null)}function x(e,t){return q.isObject(e)&&q.isFunction(t)?function(){return it[at.generateSlotName(this)]=arguments[0],t.apply(this,arguments)}:(q.log("newSizeMappingFunction: originalFunction is not a function"),null)}function G(e){if(q.isObject(e)&&q.isFunction(e.defineSlot)){var t=e.defineSlot("/Harshad",[[728,90]],"Harshad-02051986");if(t)return q.addHookOnFunction(t,!0,"defineSizeMapping",at.newSizeMappingFunction),e.destroySlots([t]),!0}return!1}function H(e){if(q.isObject(e)&&q.isObject(e.googletag)&&q.isFunction(e.googletag.pubads)){var t=e.googletag,i=t.pubads();return q.isObject(i)?(at.addHookOnSlotDefineSizeMapping(t),q.addHookOnFunction(i,!1,"disableInitialLoad",at.newDisableInitialLoadFunction),q.addHookOnFunction(i,!1,"enableSingleRequest",at.newEnableSingleRequestFunction),at.newAddHookOnGoogletagDisplay(t),q.addHookOnFunction(i,!1,"refresh",at.newRefreshFuncton),q.addHookOnFunction(i,!1,"setTargeting",at.newSetTargetingFunction),q.addHookOnFunction(t,!1,"destroySlots",at.newDestroySlotsFunction),!0):!1}return!1}function k(e){return q.isObject(e)?(e.googletag=e.googletag||{},e.googletag.cmd=e.googletag.cmd||[],!0):!1}function j(e){if(q.isUndefined(e.google_onload_fired)&&q.isObject(e.googletag)&&q.isArray(e.googletag.cmd)&&q.isFunction(e.googletag.cmd.unshift)){q.log("Succeeded to load before GPT");var t=this;return e.googletag.cmd.unshift((function(){q.log("OpenWrap initialization started"),t.addHooks(e),q.log("OpenWrap initialization completed")})),!0}return q.log("Failed to load before GPT"),!1}function K(e){return q.isObject(e)&&q.isObject(e.PWT)&&q.isFunction(e.PWT.jsLoaded)?(e.PWT.jsLoaded(),!0):!1}function V(e){e.PWT.safeFrameMessageListenerAdded||(q.addMessageEventListenerForSafeFrame(e),e.PWT.safeFrameMessageListenerAdded=!0)}var z=i(4),Y=i(2),q=i(1),Q=i(6),J=i(10),X=i(12),Z=!1;t.displayHookIsAdded=Z;var $=!1,et=!0,tt={};t.wrapperTargetingKeys=tt;var it={};t.slotSizeMapping=it;var nt={};t.slotsMap=nt;var rt={},ot=null,at=this;t.setWindowReference=n,t.getWindowReference=r,t.getAdUnitIndex=o,t.getSizeFromSizeMapping=a,t.getAdSlotSizesArray=s,t.setDisplayFunctionCalledIfRequired=d,t.storeInSlotsMap=u,t.generateSlotName=l,t.updateSlotsMapFromGoogleSlots=c,t.getStatusOfSlotForDivId=p,t.updateStatusAfterRendering=g,t.getSlotNamesByStatus=f,t.removeDMTargetingFromSlot=h,t.updateStatusOfQualifyingSlotsBeforeCallingAdapters=I,t.arrayOfSelectedSlots=E,t.defineWrapperTargetingKeys=S,t.findWinningBidAndApplyTargeting=w,t.defineWrapperTargetingKey=m,t.newDisableInitialLoadFunction=A,t.newEnableSingleRequestFunction=T,t.newSetTargetingFunction=y,t.newDestroySlotsFunction=D,t.updateStatusAndCallOriginalFunction_Display=P,t.findWinningBidIfRequired_Display=O,t.processDisplayCalledSlot=b,t.executeDisplay=v,t.displayFunctionStatusHandler=R,t.forQualifyingSlotNamesCallAdapters=_,t.newDisplayFunction=M,t.newAddHookOnGoogletagDisplay=B,t.findWinningBidIfRequired_Refresh=C,t.postRederingChores=L,t.postTimeoutRefreshExecution=F,t.callOriginalRefeshFunction=N,t.getQualifyingSlotNamesForRefresh=W,t.newRefreshFuncton=U,t.newSizeMappingFunction=x,t.addHookOnSlotDefineSizeMapping=G,t.addHooks=H,t.defineGPTVariables=k,t.addHooksIfPossible=j,t.callJsLoadedIfRequired=K,t.initSafeFrameListener=V,t.init=function(e){return z.initConfig(),q.isObject(e)?(at.setWindowReference(e),at.initSafeFrameListener(e),at.wrapperTargetingKeys=at.defineWrapperTargetingKeys(Y.WRAPPER_TARGETING_KEYS),at.defineGPTVariables(e),J.registerAdapters(),at.addHooksIfPossible(e),at.callJsLoadedIfRequired(e),!0):!1}}),(function(e,t,i){function n(){return Math.floor(100*Math.random())}function r(e,t,i){p.forEachOnObject(e,(function(e,n){I.setInitTimeForSlotsForAdapter(t,e),n.fB(t,i)}))}function o(e,t){p.forEachOnArray(e,(function(e,i){var n=i.getDivID();g.resetBid(n,t),g.setSizes(n,p.generateSlotNamesFromPattern(i,"_W_x_H_"))}))}function a(e,t){return!(e>=l.getAdapterThrottle(t))}function s(e,t){p.forEachOnObject(e,(function(e,i){g.setCallInitTime(i.getDivID(),t)}))}function d(e){if(e){var t=e.ID();p.isFunction(e.fB)?I.registeredAdapters[t]=e:p.log(t+c.MESSAGES.M3)}else p.log(c.MESSAGES.M3),p.log(e)}function u(){I.registerAdapter(f.register())}var l=i(4),c=i(2),p=i(1),g=i(6),f=i(11),h={};t.registeredAdapters=h;var I=this;t.callAdapters=function(e){var t=p.generateUUID();I.resetSlots(e,t),I.callAdapter(h,e,t)},t.getRandomNumberBelow100=n,t.callAdapter=r,t.resetSlots=o,t.throttleAdapter=a,t.setInitTimeForSlotsForAdapter=s,t.registerAdapter=d,t.registerAdapters=u}),(function(e,t,i){function n(e,t){var i=f.createBid(e.bidderCode,t),n=parseInt(e.pubmaticServerErrorCode);return i.setGrossEcpm(e.cpm),i.setDealID(e.dealId),i.setDealChannel(e.dealChannel),i.setAdHtml(e.ad||""),i.setAdUrl(e.adUrl||""),i.setWidth(e.width),i.setHeight(e.height),i.setReceivedTime(e.responseTimestamp),1===n||2===n?(i.setDefaultBidStatus(0),i.setWidth(0),i.setHeight(0)):3===n||5===n?(i.setDefaultBidStatus(1),i.setPostTimeoutStatus()):n&&i.setDefaultBidStatus(1),h.forEachOnObject(e.adserverTargeting,(function(e,t){i.setKeyValuePair(e,t)})),i}function r(e){var t=e.adUnitCode||"";if(h.isOwnProperty(T.kgpvMap,t)){if("pubmaticServer"===e.bidderCode&&(e.bidderCode=e.originalBidder),e.bidderCode&&p.isServerSideAdapter(e.bidderCode)){var i=T.kgpvMap[t].divID,n=T.getPBCodeWithWidthAndHeight(i,e.bidderCode,e.width,e.height),r=T.getPBCodeWithoutWidthAndHeight(i,e.bidderCode);if(h.isOwnProperty(T.kgpvMap,n))t=n;else{if(!h.isOwnProperty(T.kgpvMap,r))return h.log("Failed to find kgpv details for S2S-adapter:"+e.bidderCode),void 0;t=r}}e.bidderCode&&I.setBidFromBidder(T.kgpvMap[t].divID,T.transformPBBidToOWBid(e,T.kgpvMap[t].kgpv))}else h.log("Failed to find pbBid.adUnitCode in kgpvMap, pbBid.adUnitCode:"+e.adUnitCode)}function o(e){for(var t in e)if(h.isOwnProperty(e,t)&&h.isOwnProperty(T.kgpvMap,t))for(var i=e[t],r=i.bids||[],o=0;o0&&window[i])try{if(h.isFunction(window[i].setConfig)&&window[i].setConfig({debug:h.isDebugLogEnabled(),bidderSequence:"random",userSync:{iframeEnabled:!0,pixelEnabled:!0,enabledBidders:(function(){var e=[];return p.forEachAdapter((function(t){e.push(t)})),e})(),syncDelay:2e3}}),!h.isFunction(window[i].requestBids))return h.log("PreBid js requestBids function is not available"),void 0;window[i].requestBids({adUnits:o,bidsBackHandler:function(e){h.log("In PreBid bidsBackHandler with bidResponses: "),h.log(e)},timeout:p.getTimeout()-50})}catch(s){h.log("Error occured in calling PreBid."),h.log(s)}}function c(){return T.parentAdapterID}var p=i(4),g=i(2),f=i(3),h=i(1),I=i(6),E=i(10),S=(i(5),g.COMMON.PARENT_ADAPTER_PREBID),w="pbjs",m=0;t.parentAdapterID=S;var A={};t.kgpvMap=A;var T=this;t.transformPBBidToOWBid=n,t.pbBidStreamHandler=r,t.handleBidResponses=o,t.getPBCodeWithWidthAndHeight=a,t.getPBCodeWithoutWidthAndHeight=s,t.generatedKeyCallback=d,t.generatePbConf=u,t.fetchBids=l,t.getParenteAdapterID=c,t.register=function(){return{fB:T.fetchBids,ID:T.getParenteAdapterID}}}),(function(e,t,i){function n(e){this.name=e,this.status=r.SLOT_STATUS.CREATED,this.divID="",this.adUnitID="",this.adUnitIndex=0,this.sizes=[],this.keyValues={},this.arguments=[],this.pubAdServerObject=null,this.displayFunctionCalled=!1,this.refreshFunctionCalled=!1}var r=i(2);n.prototype.getName=function(){return this.name},n.prototype.setStatus=function(e){return this.status=e,this},n.prototype.getStatus=function(){return this.status},n.prototype.setDivID=function(e){return this.divID=e,this},n.prototype.getDivID=function(){return this.divID},n.prototype.setAdUnitID=function(e){return this.adUnitID=e,this},n.prototype.getAdUnitID=function(){return this.adUnitID},n.prototype.setAdUnitIndex=function(e){return this.adUnitIndex=e,this},n.prototype.getAdUnitIndex=function(){return this.adUnitIndex},n.prototype.setSizes=function(e){return this.sizes=e,this},n.prototype.getSizes=function(){return this.sizes},n.prototype.setKeyValue=function(e,t){return this.keyValues[e]=t,this},n.prototype.setKeyValues=function(e){return this.keyValues=e,this},n.prototype.getkeyValues=function(){return this.keyValues},n.prototype.setArguments=function(e){return this.arguments=e,this},n.prototype.getArguments=function(){return this.arguments},n.prototype.setPubAdServerObject=function(e){return this.pubAdServerObject=e,this},n.prototype.getPubAdServerObject=function(){return this.pubAdServerObject},n.prototype.setDisplayFunctionCalled=function(e){return this.displayFunctionCalled=e,this},n.prototype.isDisplayFunctionCalled=function(){return this.displayFunctionCalled},n.prototype.setRefreshFunctionCalled=function(e){return this.refreshFunctionCalled=e,this},n.prototype.isRefreshFunctionCalled=function(){return this.refreshFunctionCalled},n.prototype.updateStatusAfterRendering=function(e){this.status=r.SLOT_STATUS.DISPLAYED,this.arguments=[],e?this.refreshFunctionCalled=!1:this.displayFunctionCalled=!1},e.exports.Slot=n,t.createSlot=function(e){return new n(e)}})]);