(()=>{let e;function o(e,o,r,t){Object.defineProperty(e,o,{get:r,set:t,enumerable:!0,configurable:!0})}var r,t,i,d,n,a,_,l,s={};o(s,"Template",()=>a),o(s,"ErrorCode",()=>_),o(s,"errorDict",()=>K),o(s,"deepCopy",()=>z),o(s,"generateUUID",()=>eo),o(s,"triggerPmac",()=>eU),o(s,"initPubxGlobals",()=>eR),o(s,"arePubxFloorsSkipped",()=>eA),o(s,"arePubxFloorsSet",()=>eC),o(s,"getFloorsMvKeyVals",()=>eF),o(s,"getSplitKeyVals",()=>eS),o(s,"getFloorsConfigAy",()=>ex);let u="PubxFloorProvider";(r=n||(n={})).WIN="WIN",r.FLOORED="FLOORED",r.NOBIDS="NOBIDS";let p=e=>({provider:"pubxai",options:{samplingRate:e.samplingRate,pubxId:e.pubxId}}),O=e=>{let o={floors:{enforcement:{floorDeals:!0},auctionDelay:e.auctionDelay,endpoint:{url:e.floorFetchUrl},data:{floorProvider:u,modelVersion:e.modelVersion,currency:e.currency,schema:{fields:e.schema},values:e.defaultValues}}};return e.floorMin&&(o.floors.floorMin=e.floorMin),o},c=(e,o,r)=>{e&&o.pbNamespace.que.push(function(){let{debug:e,error:t,remotePageError:i}=window.__pubx__.logger;if(!o.pbNamespace.installedModules.includes("priceFloors")){t("priceFloors module is not installed"),i({code:s.ErrorCode.PRICE_FLOORS_NOT_FOUND});return}let d=o.pbNamespace.getConfig("floors");d&&d.data&&d.data.floorProvider!==u&&(t("Non-pubx floor provider present",d),i({code:s.ErrorCode.NON_PUBX_FLOORS_FOUND,payload:{existingFloors:d}}));let n=r(o);window.__pubxFloorsConfig__=n,o.pbNamespace.setConfig(n),e("Setting Floors Config",(0,s.deepCopy)(n))})},g=(e,o)=>{let r=void 0!==e.adserverTargeting&&void 0!==e.adserverTargeting[o]&&!isNaN(e.adserverTargeting[o])&&parseFloat(e.adserverTargeting[o])>0;return r},N=(e,o)=>e.filter(e=>e.adUnitCode===o),f=(e,o)=>e.filter(e=>e.adUnitCode===o),b=(e,o)=>e.flatMap(e=>e.bids).filter(e=>e.adUnitCode===o),m=(e,o,r)=>0===e.length&&0===o.length?n.NOBIDS:e.some(e=>g(e,r))?n.WIN:n.FLOORED,E=(e,o,r,t,i,d)=>o===r?e:"number"!=typeof e||"string"!=typeof o||"string"!=typeof r?(d({code:s.ErrorCode.CURRENCY_INVALID_INPUT,adUnitCode:i,payload:{value:e,fromCurrency:o,toCurrency:r}}),window.__pubx__.logger.error("Invalid input types for currency conversion",{value:e,fromCurrency:o,toCurrency:r},"Skipping conversion."),e):void 0===t.pbNamespace.convertCurrency?(d({code:s.ErrorCode.CURRENCY_MODULE_NOT_INSTALLED,adUnitCode:i,payload:{value:e,fromCurrency:o,toCurrency:r}}),window.__pubx__.logger.error("Currency module is not configured in prebid.js. Skipping conversion."),e):t.pbNamespace.convertCurrency(e,o,r),U=(e,o)=>[...e,...o],R=e=>{if(void 0!==e)return{floorValue:e.floorValue,floorRule:e.floorRule,floorCurrency:e.floorCurrency}},T=(e,o,r,t,i,d,a)=>{let _,l,u,p,O,c;let{remoteAucError:N,remoteAucEvent:f}=a,{hbPbKey:b}=d;switch(i){case n.WIN:let m=o.filter(e=>g(e,b)).sort((e,o)=>parseFloat(o.adserverTargeting[b])-parseFloat(e.adserverTargeting[b]))[0];_=parseFloat(m.adserverTargeting[b]),l=m.currency,u=m.floorData,p=m.adserverTargeting;break;case n.FLOORED:let T=U(r,o),A=T.sort((o,r)=>E(r.originalCpm,r.originalCurrency,d.currency,d,e.code,N)-E(o.originalCpm,o.originalCurrency,d.currency,d,e.code,N))[0];_=A.originalCpm,l=A.originalCurrency,u=A.floorData,p=A.adserverTargeting;break;case n.NOBIDS:if(l=d.currency,(0,s.arePubxFloorsSkipped)(e)){_=.01;break}void 0!==e.sizes?O=e.sizes:(N({code:s.ErrorCode.ADUNIT_SIZES_NOT_FOUND,adUnitCode:e.code}),window.__pubx__.logger.error("sizes in adUnit is undefined",e),O=["*"]);let C=t.flatMap(o=>O.map(r=>{if("function"==typeof o.getFloor){let t=o.getFloor({size:r,mediaType:"banner"});if(void 0!==t&&void 0!==t.floor)return t.floor;window.__pubx__.logger.error("calc nbids - bidderRequests.bid.getFloor().floor is undefined",e.code)}else window.__pubx__.logger.error("calc nbids - bidderRequests.bid.getFloor doesn't exist",e.code)})).filter(e=>void 0!==e);0!==C.length?c=C.reduce((e,o)=>e+o,0)/C.length:(0===t.length||(N({code:s.ErrorCode.GET_FLOOR_NOT_FOUND,adUnitCode:e.code}),window.__pubx__.logger.error("calc nbids - None of bidderRequests.bids.getFloor() is defined",e.code)),void 0!==d.defaultValues["*|banner"]?c=d.defaultValues["*|banner"]:(N({code:s.ErrorCode.TAG_DEFAULT_VALUES_NOT_FOUND,adUnitCode:e.code}),window.__pubx__.logger.error("defaultValues of *|banner in config is undefined",e.code),c=.01)),_=c}return f({type:"pbBid",data:{adUnitCode:e.code,status:i,bidCurrency:l,bidValue:parseFloat(_.toFixed(4)),pubCurrency:d.currency,floorData:R(u),adserverTargeting:p}}),i===n.FLOORED&&(_=E(_,l,d.currency,d,e.code,N)),parseFloat(_.toFixed(4))},A=e=>{let o=e.flatMap(e=>e.bids.map(({floorData:e})=>{if(e&&e.floorProvider===u&&e.modelVersion)return e.modelVersion})).filter(e=>void 0!==e)[0];return o},C=e=>{let o=e.includes("_AB_")?e.split("_AB_")[1].split("_")[0]:void 0;return o},F=(e,o,r)=>{switch(r){case n.WIN:return e.includes("_dwt_")?parseFloat(e.split("_dwt_")[1].split("_")[0]):o.winBidMultiplier;case n.FLOORED:return e.includes("_dt_")?parseFloat(e.split("_dt_")[1].split("_")[0]):o.flooredBidMultiplier;case n.NOBIDS:return e.includes("_dnt_")?parseFloat(e.split("_dnt_")[1].split("_")[0]):o.noBidMultiplier}},I=(e,o,r)=>{let{error:t}=window.__pubx__.logger;if(e.includes("_fm_"))return parseFloat(e.split("_fm_")[1].split("_")[0]);if(r({code:s.ErrorCode.PMAC_FLOOR_MULTIPLIER_NOT_FOUND,payload:{modelVersion:e}}),t(s.errorDict[s.ErrorCode.PMAC_FLOOR_MULTIPLIER_NOT_FOUND].message,{modelVersion:e}),!o.pmacFloorMultiplier)throw r({code:s.ErrorCode.PMAC_FLOOR_MULTIPLIER_NOT_FOUND_CONFIG}),t(s.errorDict[s.ErrorCode.PMAC_FLOOR_MULTIPLIER_NOT_FOUND_CONFIG].message,{modelVersion:e}),Error("pmacFloorMultiplier is not set in config");return o.pmacFloorMultiplier},y=(e,o,r)=>{let t=void 0!==e.mediaTypes.banner,i=e.bids.some(e=>!!e.bidder),d=(0,s.arePubxFloorsSet)(e);if(!o&&d)throw r({code:s.ErrorCode.PUBX_OFF_FLOORS_FOUND,adUnitCode:e.code}),Error("pubxLoaded is false but has floorData for adUnitCode "+e.code);return t&&i&&(!o&&!d||o&&d)},w=e=>e?e.filter(e=>!!e.originalCpm):[],S=(e,o,r,t,i)=>{let{remoteAucError:d}=i;return o.adUnits.filter(o=>y(o,e,d)&&(0,s.arePubxFloorsSet)(o)).map(e=>{let n=N(o.bidsReceived,e.code),a=f(w(o.bidsRejected),e.code),_=b(o.bidderRequests,e.code),l=m(n,a,t.hbPbKey);if(void 0===r)throw d({code:s.ErrorCode.MODEL_VERSION_NOT_FOUND_READ,adUnitCode:e.code}),Error("floorModelVersion is undefined but adUnit.bids is not");let u=T(e,n,a,_,l,t,i);try{(0,s.triggerPmac)(o.auctionId,e.code,u,l,t,I(r,t,d),i)}catch(e){window.__pubx__.logger.error("Error in Pmac",e)}e.code;let p=parseFloat((u*F(r,t,l)).toFixed(4));return(0,s.arePubxFloorsSkipped)(e)?void 0:{adUnitCode:e.code,floorValue:p,status:l}}).filter(e=>void 0!==e)},v=(e,o)=>{let r=googletag.pubads().getSlots(),t=[];return e.forEach(e=>{let i=r.find(o=>o.getAdUnitPath()===e||o.getSlotElementId()===e);void 0===i?(window.__pubx__.logger.error("GPT Slot not found for adUnitCode",e),o({code:s.ErrorCode.GPT_SLOT_NOT_FOUND,adUnitCode:e})):t.push({adUnitCode:e,slot:i})}),t},D=(e,o,r,t,i,d,n="")=>{let{remoteAucEvent:a}=d;i.setTargeting(r,t),window.__pubx__.logger.debug("Setting KVs in GAM",n,{auctionId:e,adUnitCode:o,key:r,value:t,gptSlot:i}),a({type:"gamTargeting",data:{adUnitCode:o,[r]:t}})},x=e=>{let o=googletag.pubads().getSlots().find(o=>o.getAdUnitPath()===e||o.getSlotElementId()===e);return o},L=(e,o,r,t)=>{let{remoteAucError:i}=t,{__pubxGamQue__:d,__pubx__:{logger:{error:n}}}=window,a=x(e);a?Object.entries(r).forEach(([r,i])=>{D(o,e,r,i,a,t)}):(n(s.errorDict[s.ErrorCode.GPT_SLOT_NOT_FOUND].message,e),d.push({id:(0,s.generateUUID)(),auctionId:o,adUnitCode:e,cmd:()=>{let i=x(e);return i?Object.entries(r).forEach(([r,d])=>{D(o,e,r,d,i,t,"from QUE")}):n(s.errorDict[s.ErrorCode.GAM_QUE_GPT_SLOT_NOT_FOUND].message,e),!!i},error:()=>{i({code:s.ErrorCode.GPT_SLOT_NOT_FOUND,adUnitCode:e})},logged:!1}))},M=(e,o,r)=>{let t=x(o);if(t){let i=t.getTargetingKeys().filter(e=>[r.pubxSplitKey,r.pubxOptimizedKey,r.pubxMvKey,r.pubxFloorKey,r.pubxFloorMvKey].includes(e));i.forEach(e=>{t.clearTargeting(e)}),window.__pubx__.logger.debug("Clearing KVs in GAM",{auctionId:e,adUnitCode:o,keys:i})}},P=(e,o)=>{if(0===e)return o[0];let r=o.find(o=>{let r=Object.keys(o)[0],[t,i]=o[r];return e>t&&e<=i});return r},h=(e,o,r)=>{let t=P(e.floorValue,o.gamBuckets);if(void 0===t)throw r({code:s.ErrorCode.GAM_BUCKET_NOT_FOUND,adUnitCode:e.adUnitCode,payload:{floorWithStatus:e}}),Error("GAM Bucket not found for floorValue "+JSON.stringify(e));let i=Object.keys(t)[0],d=e.status===n.WIN?"_w":e.status===n.FLOORED?"_f":"_n";return i.split("_n")[0]+d};var G=function(e,o,r,t){return new(r||(r=Promise))(function(i,d){function n(e){try{_(t.next(e))}catch(e){d(e)}}function a(e){try{_(t.throw(e))}catch(e){d(e)}}function _(e){var o;e.done?i(e.value):((o=e.value)instanceof r?o:new r(function(e){e(o)})).then(n,a)}_((t=t.apply(e,o||[])).next())})},V=function(e,o){var r={};for(var t in e)Object.prototype.hasOwnProperty.call(e,t)&&0>o.indexOf(t)&&(r[t]=e[t]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var i=0,t=Object.getOwnPropertySymbols(e);io.indexOf(t[i])&&Object.prototype.propertyIsEnumerable.call(e,t[i])&&(r[t[i]]=e[t[i]]);return r};let B="https://analytics.pbxai.com",j=B+"/errors",k=B+"/events";(t=a||(a={})).PB_GENERIC="PB_GENERIC",t.PB_GAM_GENERIC="PB_GAM_GENERIC",t.PB_GAM_GLOBAL_KVS="PB_GAM_GLOBAL_KVS",t.PB_GAM_CUSTOM_SNIGEL="PB_GAM_CUSTOM_SNIGEL",t.PB_GAM_CUSTOM_INVESTING="PB_GAM_CUSTOM_INVESTING",t.PB_GAM_CUSTOM_INVESTING_FLOORSCONFIG="PB_GAM_CUSTOM_INVESTING_FLOORSCONFIG",t.PB_GAM_CUSTOM_IMPROVEMEDIA="PB_GAM_CUSTOM_IMPROVEMEDIA",t.PB_GAM_CUSTOM_DAILYMOTION="PB_GAM_CUSTOM_DAILYMOTION",t.PB_GAM_CUSTOM_AY="PB_GAM_CUSTOM_AY",t.PB_GAM_CUSTOM_LIVEWRAPPED="PB_GAM_CUSTOM_LIVEWRAPPED",(i=_||(_={})).GPT_SLOT_NOT_FOUND="GPT_SLOT_NOT_FOUND",i.GAM_QUE_GPT_SLOT_NOT_FOUND="GAM_QUE_GPT_SLOT_NOT_FOUND",i.GAM_BUCKET_NOT_FOUND="GAM_BUCKET_NOT_FOUND",i.CALC_FLOOR_NOT_FOUND="CALC_FLOOR_NOT_FOUND",i.MODEL_VERSION_NOT_FOUND_WRITE="MODEL_VERSION_NOT_FOUND_WRITE",i.IMPROVEMEDIA_API_NOT_FOUND="IMPROVEMEDIA_API_NOT_FOUND",i.INVESTING_FILTER_NOT_FOUND="INVESTING_FILTER_NOT_FOUND",i.PUBX_AA_NOT_FOUND="PUBX_AA_NOT_FOUND",i.PRICE_FLOORS_NOT_FOUND="PRICE_FLOORS_NOT_FOUND",i.NON_PUBX_FLOORS_FOUND="NON_PUBX_FLOORS_FOUND",i.CURRENCY_INVALID_INPUT="CURRENCY_INVALID_INPUT",i.CURRENCY_MODULE_NOT_INSTALLED="CURRENCY_MODULE_NOT_INSTALLED",i.ADUNIT_SIZES_NOT_FOUND="ADUNIT_SIZES_NOT_FOUND",i.GET_FLOOR_NOT_FOUND="GET_FLOOR_NOT_FOUND",i.TAG_DEFAULT_VALUES_NOT_FOUND="TAG_DEFAULT_VALUES_NOT_FOUND",i.PUBX_OFF_FLOORS_FOUND="PUBX_OFF_FLOORS_FOUND",i.MODEL_VERSION_NOT_FOUND_READ="MODEL_VERSION_NOT_FOUND_READ",i.PMAC_FLOOR_MULTIPLIER_NOT_FOUND="PMAC_FLOOR_MULTIPLIER_NOT_FOUND",i.PMAC_FLOOR_MULTIPLIER_NOT_FOUND_CONFIG="PMAC_FLOOR_MULTIPLIER_NOT_FOUND_CONFIG",i.INVALID_SCHEMA_FIELDS_FLOORS_RESPONSE="INVALID_SCHEMA_FIELDS_FLOORS_RESPONSE",i.MISSING_ADUNIT_FLOOR_RESPONSE="MISSING_ADUNIT_FLOOR_RESPONSE",i.PMAC_FLOOR_RESPONSE_NOT_AVAILABLE="PMAC_FLOOR_RESPONSE_NOT_AVAILABLE",i.UNCAUGHT_ERROR="UNCAUGHT_ERROR",i.UNCAUGHT_GAM_ERROR="UNCAUGHT_GAM_ERROR",(d=l||(l={})).INFO="INFO",d.WARNING="WARNING",d.ERROR="ERROR",d.FATAL="FATAL";let K={[_.GPT_SLOT_NOT_FOUND]:{message:"GPT Slot not found",severity:l.WARNING},[_.GAM_QUE_GPT_SLOT_NOT_FOUND]:{message:"Gam Que: GPT Slot not found",severity:l.WARNING},[_.GAM_BUCKET_NOT_FOUND]:{message:"GAM Bucket not found",severity:l.WARNING},[_.CALC_FLOOR_NOT_FOUND]:{message:"floorWithStatus not found",severity:l.FATAL},[_.MODEL_VERSION_NOT_FOUND_WRITE]:{message:"floorModelVersion is undefined but floorsWithStatus is not",severity:l.FATAL},[_.IMPROVEMEDIA_API_NOT_FOUND]:{message:"lwhbim.adServerKeywordsAdUnit is not defined",severity:l.ERROR},[_.INVESTING_FILTER_NOT_FOUND]:{message:"window._imhb_auctions is not defined",severity:l.ERROR},[_.PUBX_AA_NOT_FOUND]:{message:"pubxaiAnalyticsAdapter module is not installed",severity:l.WARNING},[_.PRICE_FLOORS_NOT_FOUND]:{message:"priceFloors module is not installed",severity:l.WARNING},[_.NON_PUBX_FLOORS_FOUND]:{message:"Non-pubx floor provider present",severity:l.WARNING},[_.CURRENCY_INVALID_INPUT]:{message:"Invalid input types for currency conversion",severity:l.WARNING},[_.CURRENCY_MODULE_NOT_INSTALLED]:{message:"currency module of prebid.js is not installed",severity:l.WARNING},[_.ADUNIT_SIZES_NOT_FOUND]:{message:"sizes in adUnit is undefined",severity:l.WARNING},[_.GET_FLOOR_NOT_FOUND]:{message:"calc nbids - None of bidderRequests.bids.getFloor() is defined",severity:l.WARNING},[_.TAG_DEFAULT_VALUES_NOT_FOUND]:{message:"defaultValues of *|banner in config is undefined",severity:l.ERROR},[_.PUBX_OFF_FLOORS_FOUND]:{message:"pubxLoaded is false but has floorData",severity:l.FATAL},[_.MODEL_VERSION_NOT_FOUND_READ]:{message:"floorModelVersion is undefined but adUnit.bids is not",severity:l.FATAL},[_.PMAC_FLOOR_MULTIPLIER_NOT_FOUND]:{message:"PMAC floor multiplier not found in floors-response",severity:l.ERROR},[_.PMAC_FLOOR_MULTIPLIER_NOT_FOUND_CONFIG]:{message:"PMAC floor multiplier not found in config",severity:l.ERROR},[_.INVALID_SCHEMA_FIELDS_FLOORS_RESPONSE]:{message:"Invalid schema fields in floor rules response, expected only ['gptSlot']",severity:l.ERROR},[_.MISSING_ADUNIT_FLOOR_RESPONSE]:{message:"adUnitCode not found in floor rules response",severity:l.ERROR},[_.PMAC_FLOOR_RESPONSE_NOT_AVAILABLE]:{message:"Floors Reponse not available for pmac",severity:l.WARNING},[_.UNCAUGHT_ERROR]:{message:"Uncaught Error",severity:l.ERROR},[_.UNCAUGHT_GAM_ERROR]:{message:"Uncaught GAM Error",severity:l.ERROR}},W=e=>{let{__pubx__:{variant:o,version:r}}=window;return{variant:o,version:r,loadTime:window.__loadTime__,pbVersion:e.pbNamespace.version}},q=e=>({userAgent:navigator.userAgent,host:window.location.host,path:window.location.pathname,pageId:e,doNotTrack:navigator.doNotTrack}),H=(e,o)=>e.pbNamespace.getEvents().filter(e=>"auctionEnd"===e.eventType).findIndex(e=>e.args.auctionId===o),Y=e=>e.pbNamespace.getEvents().filter(e=>"auctionInit"===e.eventType).length,z=e=>JSON.parse(JSON.stringify(e)),X=e=>{let{code:o,adUnitCode:r,payload:t}=e,{message:i,severity:d}=K[o];return{code:o,severity:d,message:i,adUnitCode:r,payload:t}},Q=(e,o,r,t)=>{let i=z(o);if(e.adUnitCode){let{adUnits:o,bidderRequests:r,bidsReceived:t,bidsRejected:d}=i;i=Object.assign(Object.assign({},i),{adUnits:o.filter(o=>o.code===e.adUnitCode),bidderRequests:r.map(o=>Object.assign(Object.assign({},o),{bids:o.bids.filter(o=>o.adUnitCode===e.adUnitCode)})),bidsReceived:t.filter(o=>o.adUnitCode===e.adUnitCode),bidsRejected:d?d.filter(o=>o.adUnitCode===e.adUnitCode):void 0})}let{auctionId:d,adUnits:n,bidderRequests:a,bidsReceived:_,bidsRejected:l}=i,s={adUnits:n.map(({code:e,sizes:o,bids:r,mediaTypes:t})=>({code:e,mediaTypes:Object.keys(t)})),bidderRequestsCount:a.length,bidsReceived:_.map(({adUnitCode:e,adserverTargeting:o,cpm:r,currency:t,originalCpm:i,originalCurrency:d,floorData:n})=>({adUnitCode:e,adserverTargeting:o?{hb_pb:o.hb_pb}:void 0,cpm:r,currency:t,originalCpm:i,originalCurrency:d,floorData:n?{floorValue:n.floorValue}:void 0})),bidsRejected:l?l.map(({adUnitCode:e,adserverTargeting:o,cpm:r,currency:t,originalCpm:i,originalCurrency:d,floorData:n})=>({adUnitCode:e,adserverTargeting:o?{hb_pb:o.hb_pb}:void 0,cpm:r,currency:t,originalCpm:i,originalCurrency:d,floorData:n?{floorValue:n.floorValue}:void 0})):void 0};return Object.assign({previousAuctionCount:H(r,d),auctionId:d,auctionInfo:s,modelVersion:A(a)},J(e,r,t))},J=(e,o,r)=>({isPubxEnabled:window.__pubxLoaded__,pubxId:o.pubxId,tagInfo:W(o),pageInfo:q(r),errorData:X(e),timesince:Date.now()-window.__loadTimestamp__,timestamp:Date.now()}),Z=e=>{let o=e.pbNamespace.getConfig("floors");return o&&o.data&&o.data.floorProvider?o.data.floorProvider:void 0},$=(e,o,r,t)=>{let{auctionId:i,adUnits:d,bidsReceived:n,bidsRejected:a,bidderRequests:_}=e,l={adUnitCount:d.length,bidCount:n.length+(a?a.length:0),bidders:[...new Set(_.map(({bidderCode:e})=>e))]};return{isPubxEnabled:window.__pubxLoaded__,pubxId:o.pubxId,loadedBeforePb:window.__loadedBeforePb__,tagInfo:W(o),floorProvider:Z(o),pageInfo:q(t),missedAuctionCount:r,timesince:Date.now()-window.__loadTimestamp__,timestamp:Date.now(),previousAuctionCount:H(o,i),auctionId:i,auctionInfo:l,modelVersion:A(_),pbBidData:[],gamTargetingData:[]}},ee=e=>{let{severity:o}=K[e.code];return!1},eo=()=>"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,e=>{let o=16*Math.random()|0;return("x"===e?o:3&o|8).toString(16)}),er=()=>{window.__pubxGamQue__.filter(e=>!e.logged).forEach(e=>{e.error(),e.logged=!0})},et=e=>{let o=[],r=[],t=[],i=Y(e),d=eo(),n=1/e.samplingRate>Math.random();window.__pubxLogsEnabled__=n;let a=(e,o)=>{if(0===e.length)return;JSON.parse(JSON.stringify(e));let r=new Blob([JSON.stringify(e)],{type:"application/json"});navigator.sendBeacon(o,r),e.splice(0)},_=e=>{if(0===e.length)return 0;let o=new Blob([JSON.stringify(e)]);return o.size},l=()=>!!navigator.sendBeacon&&!!document.visibilityState;l()&&document.addEventListener("visibilitychange",()=>{"hidden"===document.visibilityState&&(er(),a(o,j),a(r,j),a(t,k))});let s=window.location.search,u=new URLSearchParams(s);return{debug:(e,...o)=>{u.has("pubx_debug")&&console.info("%cPubx.ai","background-color: #fc6203; color: white; border-radius: 3px; padding: 1px 4px","INFO:",e,...o)},error:(...e)=>{u.has("pubx_debug")&&console.error("%cPubx.ai","background-color: #fc6203; color: white; border-radius: 3px; padding: 1px 4px","ERROR:",...e)},makeRemoteAucError:r=>{let t=z(r),i=(o,r)=>{r.push(Q(o,t,e,d)),z(r)};return e=>{if(l()&&(n||ee(e))){let r=z(o);i(e,r),_(r)>65536?(a(o,j),i(e,o)):o=r}}},remotePageError:o=>{if(l()&&(n||ee(o))){let t=(o,r)=>{r.push(J(o,e,d))},i=z(r);t(o,i),_(i)>65536?(a(r,j),t(o,r)):r=i}},makeRemoteAucEvent:o=>{let r=z(o),s=(o,t)=>{let n=t.find(e=>e.auctionId===r.auctionId);if(void 0===n&&(n=$(r,e,i,d),t.push(n)),"pbBid"===o.type)n.pbBidData.push(o.data);else if("gamTargeting"===o.type){let e=o.data,r=n.gamTargetingData.find(o=>o.adUnitCode===e.adUnitCode);void 0===r?n.gamTargetingData.push(e):Object.assign(r,e)}z(t)};return e=>{if(l()&&n){let o=z(t);s(e,o),_(o)>65536?(a(t,k),s(e,t)):t=o}}}}},ei=()=>{window.__pubx__.logger.debug("version:",window.__pubx__.variant+"_"+window.__pubx__.version)},ed=()=>{window.__loadTime__=window.__loadTimestamp__?Date.now()-window.__loadTimestamp__:-1,window.__loadTimestamp__=Date.now()},en=(e,o)=>{let r=window.__pubxFloorsConfig__.floors,{auctionDelay:t,endpoint:i,data:d}=r,n=V(r,["auctionDelay","endpoint","data"]);window.__nextfloorsConfig__={floors:Object.assign(Object.assign({},n),{data:e})}},ea=e=>window.__pmacCpmHistory__[e],e_=e=>{let o=ea(e);return o?o.history:[]},el=(e,o,r,t)=>{let{debug:i}=window.__pubx__.logger,{__pmacCpmHistory__:d}=window;void 0===d[o]&&(d[o]={history:[],decayRate:void 0});let n={auctionId:e,cpm:r,adUnitStatus:t};e_(o).push(n),i("Update Pmac history",o,n)},es=(e,o,r)=>Math.log(o/(e=0===e?.01:e))/r,eu=(e,o,r)=>(e=0===e?.01:e)*Math.exp(o*r),ep=e=>{let{debug:o}=window.__pubx__.logger,r=ea(e),{history:t}=r,[i,d,n]=[t[0].cpm,t[t.length-1].cpm,t.length-1];r.decayRate=es(i,d,n),o("Update decay rate",e,r.decayRate)},eO=e=>{let o=e_(e);if(0===o.length)return!1;if(1===o.length)return!0;let r=o.slice(0,-1).map(e=>e.cpm).reduce((e,o)=>Math.min(e,o)),t=o[o.length-1].cpm;return t{let{remoteAucError:r}=o,{__pmacCpmHistory__:t}=window,i=Object.keys(t);if(window.__pubx__.variant===a.PB_GAM_CUSTOM_AY)i.forEach(r=>{eO(r)&&ef(r,void 0,em(r,e),o)});else{let t=v(i,r);t.forEach(({adUnitCode:r,slot:t})=>{eO(r)&&ef(r,t,em(r,e),o)})}},eg=(e,o)=>{let r=Object.keys(o),t=r.find(o=>[e.getAdUnitPath()+"|banner|*",e.getSlotElementId()+"|banner|*"].includes(o));return t},eN=(e,o)=>{let r=Object.keys(o),t=r.find(o=>o.split("|banner|*")[0]===ev(e));return t},ef=(e,o,r,t)=>{let i;let{remoteAucError:d}=t,{error:n}=window.__pubx__.logger,{__nextfloorsConfig__:l}=window;if(void 0===l)throw Error("__nextfloorsConfig__ undefined. Skip updating adUnit floors config");let{floors:{data:{values:s}}}=l;if(void 0===(i=window.__pubx__.variant===a.PB_GAM_CUSTOM_AY?eN(e,s):eg(o,s))){d({code:_.MISSING_ADUNIT_FLOOR_RESPONSE,adUnitCode:e}),n(K[_.MISSING_ADUNIT_FLOOR_RESPONSE].message,{adUnitCode:e});return}s[i]=r},eb=e=>e_(e).length<=1,em=(e,o)=>{let{decayRate:r,history:t}=ea(e),[i,d,a]=[t[0].cpm,t.length,t[t.length-1]];if(eb(e)||a.adUnitStatus===n.NOBIDS)return.01;let _=eu(i,r,d),l=_*o;return l<.01?.01:parseFloat(l.toFixed(4))},eE=(e,o)=>G(void 0,void 0,void 0,function*(){let{debug:o}=window.__pubx__.logger,r=yield fetch(e.floorFetchUrl),t=yield r.json();o("Received floor rules",t),en(t,e)}),eU=(e=null,(o,r,t,i,d,n,l)=>G(void 0,void 0,void 0,function*(){let{remoteAucError:s}=l,{error:u}=window.__pubx__.logger;null===e&&(e=eE(d,l)),yield e,el(o,r,t,i),eb(r)||ep(r);let{__nextfloorsConfig__:p,__pubxLoaded__:O}=window;if(void 0===p)throw s({code:_.PMAC_FLOOR_RESPONSE_NOT_AVAILABLE,adUnitCode:r}),u(K[_.PMAC_FLOOR_RESPONSE_NOT_AVAILABLE].message,{adUnitCode:r}),Error("__nextfloorsConfig__ undefined. Skip updating floors config");window.__pubx__.variant===a.PB_GAM_CUSTOM_AY?(ec(n,l),c(O,d,e=>p)):googletag.cmd.push(()=>{try{ec(n,l),c(O,d,e=>p)}catch(e){u(e),l.remoteAucError({code:_.UNCAUGHT_GAM_ERROR,payload:{name:e.name,message:e.message}})}})})),eR=(e,o)=>{window.__pubxFloors__={},window.__pubxLoaded__=eT(e.splitRate),window.__loadedBeforePb__=void 0===e.pbNamespace.version,window.__pmacCpmHistory__={},ed(),window.__pubx__={variant:o,version:"1711103739923"},e.pbNamespace.que.push(function(){window.__pubx__.logger=et(e),ei()}),window.__pubxGamQue__=[]},eT=e=>void 0!==window.__pubxLoaded__?window.__pubxLoaded__:e>100*Math.random(),eA=e=>e.bids.some(({floorData:e})=>e&&e.floorProvider===u&&e.skipped),eC=e=>e.bids.some(({floorData:e})=>e&&e.floorProvider===u&&e.modelVersion),eF=(e,o,r,t)=>{let i={},d=h(e,r,t);i[r.pubxFloorKey]=d;let n=C(o);if(n){i[r.pubxMvKey]=n;let e=eI(d,n);i[r.pubxFloorMvKey]=e}return i},eI=(e,o)=>e+"-"+o,ey=(e,o)=>{let r=eA(e);return r?o.pubxOptimizedOffValue:o.pubxOptimizedOnValue},ew=(e,o)=>{let r=eC(e);return r?o.pubxSplitOnValue:o.pubxSplitOffValue},eS=(e,o)=>{let r={},t=ew(e,o);if(r[o.pubxSplitKey]=t,t===o.pubxSplitOnValue){let t=ey(e,o);r[o.pubxOptimizedKey]=t}return r},ev=e=>e.split("__ayManagerEnv__")[0],eD=(e,o)=>ev(e.adUnitCode),ex=e=>{let o=O(e);return o.floors.additionalSchemaFields={customadunit:eD},o},eL=(()=>{window.googletag=window.googletag||{};window.googletag.cmd=window.googletag.cmd||[];window.pbjs=window.pbjs||{};window.pbjs.que=window.pbjs.que||[];return{splitRate:95,samplingRate:400,pbNamespace:pbjs,currency:"USD",modelVersion:"pbxdflt_AB_z_dt_0.75_dwt_0.95_dnt_0.15_fm_0.5",auctionDelay:100,pubxId:"dcd44e4d-5fce-4ac8-bf04-0663b18bded0",schema:['customadunit','mediaType'],defaultValues:{'*|*':0.1,'*|banner':0.1,'interstitial|banner':0.12,'jsid-ad-container-billboard|banner':0.11,'jsid-ad-container-inline_ad|banner':0.11,'jsid-ad-container-sidebar_1|banner':0.11,'jsid-ad-container-inline_ad_1|banner':0.11,'jsid-ad-container-inline_ad_2|banner':0.1103},floorFetchUrl:"https://floor.pbxai.com/?pubxId=dcd44e4d-5fce-4ac8-bf04-0663b18bded0&page="+window.location.href,floorMin:null,hbPbKey:"ay_hb_pb",pubxSplitKey:"pubx-a",pubxSplitOnValue:"on",pubxSplitOffValue:"off",pubxOptimizedKey:"pubx-op",pubxOptimizedOnValue:"on",pubxOptimizedOffValue:"off",pubxMvKey:"pubx-m_v",pubxFloorKey:"pubx-floor",pubxFloorMvKey:"pubx-floor-mv",flooredBidMultiplier:0.75,noBidMultiplier:0.15,winBidMultiplier:0.95,pmacFloorMultiplier:0.5,gamBuckets:[{'pbx_a0d_n':[0,0.03]},{'pbx_a1d_n':[0.03,0.06]},{'pbx_a2d_n':[0.06,0.09]},{'pbx_a3d_n':[0.09,0.12]},{'pbx_a4d_n':[0.12,0.15]},{'pbx_b0d_n':[0.15,0.2]},{'pbx_b1d_n':[0.2,0.25]},{'pbx_b2d_n':[0.25,0.3]},{'pbx_b3d_n':[0.3,0.35]},{'pbx_b4d_n':[0.35,0.4]},{'pbx_b5d_n':[0.4,0.45]},{'pbx_b6d_n':[0.45,0.5]},{'pbx_b7d_n':[0.5,0.55]},{'pbx_b8d_n':[0.55,0.6]},{'pbx_b9d_n':[0.6,0.65]},{'pbx_b10d_n':[0.65,0.7]},{'pbx_b11d_n':[0.7,0.75]},{'pbx_b12d_n':[0.75,0.8]},{'pbx_b13d_n':[0.8,0.85]},{'pbx_b14d_n':[0.85,0.9]},{'pbx_b15d_n':[0.9,0.95]},{'pbx_b16d_n':[0.95,1]},{'pbx_c0d_n':[1,1.1]},{'pbx_c1d_n':[1.1,1.2]},{'pbx_c2d_n':[1.2,1.3]},{'pbx_c3d_n':[1.3,1.4]},{'pbx_c4d_n':[1.4,1.5]},{'pbx_c5d_n':[1.5,1.6]},{'pbx_c6d_n':[1.6,1.7]},{'pbx_c7d_n':[1.7,1.8]},{'pbx_c8d_n':[1.8,1.9]},{'pbx_c9d_n':[1.9,2]},{'pbx_d0d_n':[2,2.25]},{'pbx_d1d_n':[2.25,2.5]},{'pbx_d2d_n':[2.5,2.75]},{'pbx_d3d_n':[2.75,3]},{'pbx_d4d_n':[3,3.25]},{'pbx_d5d_n':[3.25,3.5]},{'pbx_d6d_n':[3.5,3.75]},{'pbx_d7d_n':[3.75,4]},{'pbx_d8d_n':[4,4.25]},{'pbx_d9d_n':[4.25,4.5]},{'pbx_d10d_n':[4.5,4.75]},{'pbx_d11d_n':[4.75,5]},{'pbx_d12d_n':[5,111111]}]};})();(0,s.initPubxGlobals)(eL,s.Template.PB_GAM_CUSTOM_AY);let eM=window.__pubxLoaded__;(e=>{e.pbNamespace.que.push(function(){let{debug:o,error:r,remotePageError:t}=window.__pubx__.logger;if(!e.pbNamespace.installedModules.includes("pubxaiAnalyticsAdapter")){r("pubxaiAnalyticsAdapter module is not installed"),t({code:s.ErrorCode.PUBX_AA_NOT_FOUND});return}{let r=p(e);e.pbNamespace.enableAnalytics(r),o("Enabling Analytics",r)}})})(eL),c(eM,eL,s.getFloorsConfigAy),((e,o,r,t,i)=>{o.pbNamespace.que.push(function(){o.pbNamespace.onEvent("auctionEnd",d=>{try{let{makeRemoteAucError:n,makeRemoteAucEvent:a,error:_}=window.__pubx__.logger,l={remoteAucError:n(d),remoteAucEvent:a(d)};try{i&&(d=i(d,l)),r(e,o,d,l);let n=A(d.bidderRequests),a=S(e,d,n,o,l);t(a,n,d.auctionId,o,l)}catch(e){_(e),l.remoteAucError({code:s.ErrorCode.UNCAUGHT_ERROR,payload:{name:e.name,message:e.message}})}}catch(e){window.__pubx__.logger.error(e)}})})})(eM,eL,(e,o,r,t)=>{let{remoteAucError:i}=t,{error:d}=window.__pubx__.logger;googletag.cmd.push(()=>{try{r.adUnits.filter(o=>y(o,e,i)).map(e=>{M(r.auctionId,e.code,o);let i=(0,s.getSplitKeyVals)(e,o);L(e.code,r.auctionId,i,t)})}catch(e){d(e),t.remoteAucError({code:s.ErrorCode.UNCAUGHT_GAM_ERROR,payload:{name:e.name,message:e.message}})}})},(e,o,r,t,i)=>{let{remoteAucError:d}=i,{error:n}=window.__pubx__.logger;try{googletag.cmd.push(()=>{e.map(e=>{let{adUnitCode:n}=e;if(void 0===o)throw d({code:s.ErrorCode.MODEL_VERSION_NOT_FOUND_WRITE,adUnitCode:n,payload:{floorWithStatus:e}}),Error("floorModelVersion is undefined but floorsWithStatus is not");let a=(0,s.getFloorsMvKeyVals)(e,o,t,d);L(n,r,a,i)})})}catch(e){n(e),i.remoteAucError({code:s.ErrorCode.UNCAUGHT_GAM_ERROR,payload:{name:e.name,message:e.message}})}}),googletag.cmd.push(()=>{googletag.pubads().addEventListener("slotAdded",e=>{let o=e.slot,{__pubxGamQue__:r}=window,t=r.filter(e=>o&&(o.getAdUnitPath()===e.adUnitCode||o.getSlotElementId()===e.adUnitCode));t.forEach(e=>{if(e.cmd()){let o=r.findIndex(o=>o.id===e.id);o>-1&&r.splice(o,1)}})})})})();