(()=>{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={};o(l,"ErrorCode",()=>n),o(l,"errorDict",()=>G),o(l,"deepCopy",()=>K),o(l,"triggerPmac",()=>ef),o(l,"initPubxGlobals",()=>eg),o(l,"arePubxFloorsSkipped",()=>eN),o(l,"arePubxFloorsSet",()=>em),o(l,"getFloorMvValue",()=>eE),o(l,"getPubxOptimizedValue",()=>eR),o(l,"getPubxSplitValue",()=>eU),o(l,"auctionDataInvestingFilter",()=>eF);let _="PubxFloorProvider";(r=d||(d={})).WIN="WIN",r.FLOORED="FLOORED",r.NOBIDS="NOBIDS";let s=e=>({provider:"pubxai",options:{samplingRate:e.samplingRate,pubxId:e.pubxId}}),u=e=>{let o={floors:{enforcement:{floorDeals:!0},auctionDelay:e.auctionDelay,endpoint:{url:e.floorFetchUrl},data:{floorProvider:_,modelVersion:e.modelVersion,currency:e.currency,schema:{fields:e.schema},values:e.defaultValues}}};return e.floorMin&&(o.floors.floorMin=e.floorMin),o},p=(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:l.ErrorCode.PRICE_FLOORS_NOT_FOUND});return}let d=o.pbNamespace.getConfig("floors");d&&d.data&&d.data.floorProvider!==_&&(t("Non-pubx floor provider present",d),i({code:l.ErrorCode.NON_PUBX_FLOORS_FOUND,payload:{existingFloors:d}}));let n=r(o);o.pbNamespace.setConfig(n),e("Setting Floors Config",(0,l.deepCopy)(n))})},c=(e,o)=>{let r=void 0!==e.adserverTargeting&&void 0!==e.adserverTargeting[o]&&!isNaN(e.adserverTargeting[o])&&parseFloat(e.adserverTargeting[o])>0;return r},O=(e,o)=>e.filter(e=>e.adUnitCode===o),f=(e,o)=>e.filter(e=>e.adUnitCode===o),g=(e,o)=>e.flatMap(e=>e.bids).filter(e=>e.adUnitCode===o),b=(e,o,r)=>0===e.length&&0===o.length?d.NOBIDS:e.some(e=>c(e,r))?d.WIN:d.FLOORED,N=(e,o,r,t,i,d)=>o===r?e:"number"!=typeof e||"string"!=typeof o||"string"!=typeof r?(d({code:l.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:l.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),m=(e,o)=>[...e,...o],E=e=>{if(void 0!==e)return{floorValue:e.floorValue,floorRule:e.floorRule,floorCurrency:e.floorCurrency}},R=(e,o,r,t,i,n,a)=>{let _,s,u,p,O,f;let{remoteAucError:g,remoteAucEvent:b}=a,{hbPbKey:R}=n;switch(i){case d.WIN:let U=o.filter(e=>c(e,R)).sort((e,o)=>parseFloat(o.adserverTargeting[R])-parseFloat(e.adserverTargeting[R]))[0];_=parseFloat(U.adserverTargeting[R]),s=U.currency,u=U.floorData,p=U.adserverTargeting;break;case d.FLOORED:let F=m(r,o),I=F.sort((o,r)=>N(r.originalCpm,r.originalCurrency,n.currency,n,e.code,g)-N(o.originalCpm,o.originalCurrency,n.currency,n,e.code,g))[0];_=I.originalCpm,s=I.originalCurrency,u=I.floorData,p=I.adserverTargeting;break;case d.NOBIDS:if(s=n.currency,(0,l.arePubxFloorsSkipped)(e)){_=.01;break}void 0!==e.sizes?O=e.sizes:(g({code:l.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?f=C.reduce((e,o)=>e+o,0)/C.length:(0===t.length||(g({code:l.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!==n.defaultValues["*|banner"]?f=n.defaultValues["*|banner"]:(g({code:l.ErrorCode.TAG_DEFAULT_VALUES_NOT_FOUND,adUnitCode:e.code}),window.__pubx__.logger.error("defaultValues of *|banner in config is undefined",e.code),f=.01)),_=f}return b({type:"pbBid",data:{adUnitCode:e.code,status:i,bidCurrency:s,bidValue:parseFloat(_.toFixed(4)),pubCurrency:n.currency,floorData:E(u),adserverTargeting:p}}),i===d.FLOORED&&(_=N(_,s,n.currency,n,e.code,g)),parseFloat(_.toFixed(4))},U=e=>{let o=e.flatMap(e=>e.bids.map(({floorData:e})=>{if(e&&e.floorProvider===_&&e.modelVersion)return e.modelVersion})).filter(e=>void 0!==e)[0];return o},F=e=>{let o=e.includes("_AB_")?e.split("_AB_")[1].split("_")[0]:void 0;return o},I=(e,o,r)=>{switch(r){case d.WIN:return e.includes("_dwt_")?parseFloat(e.split("_dwt_")[1].split("_")[0]):o.winBidMultiplier;case d.FLOORED:return e.includes("_dt_")?parseFloat(e.split("_dt_")[1].split("_")[0]):o.flooredBidMultiplier;case d.NOBIDS:return e.includes("_dnt_")?parseFloat(e.split("_dnt_")[1].split("_")[0]):o.noBidMultiplier}},C=(e,o,r)=>{let{error:t}=window.__pubx__.logger;if(e.includes("_fm_"))return parseFloat(e.split("_fm_")[1].split("_")[0]);if(r({code:l.ErrorCode.PMAC_FLOOR_MULTIPLIER_NOT_FOUND,payload:{modelVersion:e}}),t(l.errorDict[l.ErrorCode.PMAC_FLOOR_MULTIPLIER_NOT_FOUND].message,{modelVersion:e}),!o.pmacFloorMultiplier)throw r({code:l.ErrorCode.PMAC_FLOOR_MULTIPLIER_NOT_FOUND_CONFIG}),t(l.errorDict[l.ErrorCode.PMAC_FLOOR_MULTIPLIER_NOT_FOUND_CONFIG].message,{modelVersion:e}),Error("pmacFloorMultiplier is not set in config");return o.pmacFloorMultiplier},T=(e,o,r)=>{let t=void 0!==e.mediaTypes.banner,i=e.bids.some(e=>!!e.bidder),d=(0,l.arePubxFloorsSet)(e);if(!o&&d)throw r({code:l.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)},y=e=>e?e.filter(e=>!!e.originalCpm):[],w=(e,o,r,t,i)=>{let{remoteAucError:d}=i;return o.adUnits.filter(o=>T(o,e,d)&&(0,l.arePubxFloorsSet)(o)).map(e=>{let n=O(o.bidsReceived,e.code),a=f(y(o.bidsRejected),e.code),_=g(o.bidderRequests,e.code),s=b(n,a,t.hbPbKey);if(void 0===r)throw d({code:l.ErrorCode.MODEL_VERSION_NOT_FOUND_READ,adUnitCode:e.code}),Error("floorModelVersion is undefined but adUnit.bids is not");let u=R(e,n,a,_,s,t,i);try{(0,l.triggerPmac)(o.auctionId,e.code,u,s,t,C(r,t,d),i)}catch(e){window.__pubx__.logger.error("Error in Pmac",e)}e.code;let p=parseFloat((u*I(r,t,s)).toFixed(4));return(0,l.arePubxFloorsSkipped)(e)?void 0:{adUnitCode:e.code,floorValue:p,status:s}}).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:l.ErrorCode.GPT_SLOT_NOT_FOUND,adUnitCode:e})):t.push({adUnitCode:e,slot:i})}),t},A=(e,o,r,t,i,d)=>{let{remoteAucEvent:n}=d;i.setTargeting(r,t),window.__pubx__.logger.debug("Setting KVs in GAM",{auctionId:e,adUnitCode:o,key:r,value:t,gptSlot:i}),n({type:"gamTargeting",data:{adUnitCode:o,[r]:t}})},x=(e,o,r,t)=>{let i=r.getTargetingKeys().filter(e=>[t.pubxSplitKey,t.pubxOptimizedKey,t.pubxMvKey,t.pubxFloorKey,t.pubxFloorMvKey].includes(e));i.forEach(e=>{r.clearTargeting(e)}),window.__pubx__.logger.debug("Clearing KVs in GAM",{auctionId:e,adUnitCode:o,keys:i})},D=(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},L=(e,o,r)=>{let t=D(e.floorValue,o.gamBuckets);if(void 0===t)throw r({code:l.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],n=e.status===d.WIN?"_w":e.status===d.FLOORED?"_f":"_n";return i.split("_n")[0]+n};var S=function(e,o,r,t){return new(r||(r=Promise))(function(i,d){function n(e){try{l(t.next(e))}catch(e){d(e)}}function a(e){try{l(t.throw(e))}catch(e){d(e)}}function l(e){var o;e.done?i(e.value):((o=e.value)instanceof r?o:new r(function(e){e(o)})).then(n,a)}l((t=t.apply(e,o||[])).next())})},h=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);i<t.length;i++)0>o.indexOf(t[i])&&Object.prototype.propertyIsEnumerable.call(e,t[i])&&(r[t[i]]=e[t[i]]);return r};let P="https://analytics.pbxai.com",M=P+"/errors",V=P+"/events";(t=n||(n={})).GPT_SLOT_NOT_FOUND="GPT_SLOT_NOT_FOUND",t.GAM_BUCKET_NOT_FOUND="GAM_BUCKET_NOT_FOUND",t.CALC_FLOOR_NOT_FOUND="CALC_FLOOR_NOT_FOUND",t.MODEL_VERSION_NOT_FOUND_WRITE="MODEL_VERSION_NOT_FOUND_WRITE",t.IMPROVEMEDIA_API_NOT_FOUND="IMPROVEMEDIA_API_NOT_FOUND",t.INVESTING_FILTER_NOT_FOUND="INVESTING_FILTER_NOT_FOUND",t.PUBX_AA_NOT_FOUND="PUBX_AA_NOT_FOUND",t.PRICE_FLOORS_NOT_FOUND="PRICE_FLOORS_NOT_FOUND",t.NON_PUBX_FLOORS_FOUND="NON_PUBX_FLOORS_FOUND",t.CURRENCY_INVALID_INPUT="CURRENCY_INVALID_INPUT",t.CURRENCY_MODULE_NOT_INSTALLED="CURRENCY_MODULE_NOT_INSTALLED",t.ADUNIT_SIZES_NOT_FOUND="ADUNIT_SIZES_NOT_FOUND",t.GET_FLOOR_NOT_FOUND="GET_FLOOR_NOT_FOUND",t.TAG_DEFAULT_VALUES_NOT_FOUND="TAG_DEFAULT_VALUES_NOT_FOUND",t.PUBX_OFF_FLOORS_FOUND="PUBX_OFF_FLOORS_FOUND",t.MODEL_VERSION_NOT_FOUND_READ="MODEL_VERSION_NOT_FOUND_READ",t.PMAC_FLOOR_MULTIPLIER_NOT_FOUND="PMAC_FLOOR_MULTIPLIER_NOT_FOUND",t.PMAC_FLOOR_MULTIPLIER_NOT_FOUND_CONFIG="PMAC_FLOOR_MULTIPLIER_NOT_FOUND_CONFIG",t.INVALID_SCHEMA_FIELDS_FLOORS_RESPONSE="INVALID_SCHEMA_FIELDS_FLOORS_RESPONSE",t.MISSING_ADUNIT_FLOOR_RESPONSE="MISSING_ADUNIT_FLOOR_RESPONSE",t.PMAC_FLOOR_RESPONSE_NOT_AVAILABLE="PMAC_FLOOR_RESPONSE_NOT_AVAILABLE",t.UNCAUGHT_ERROR="UNCAUGHT_ERROR",(i=a||(a={})).INFO="INFO",i.WARNING="WARNING",i.ERROR="ERROR",i.FATAL="FATAL";let G={[n.GPT_SLOT_NOT_FOUND]:{message:"GPT Slot not found",severity:a.WARNING},[n.GAM_BUCKET_NOT_FOUND]:{message:"GAM Bucket not found",severity:a.WARNING},[n.CALC_FLOOR_NOT_FOUND]:{message:"floorWithStatus not found",severity:a.FATAL},[n.MODEL_VERSION_NOT_FOUND_WRITE]:{message:"floorModelVersion is undefined but floorsWithStatus is not",severity:a.FATAL},[n.IMPROVEMEDIA_API_NOT_FOUND]:{message:"lwhbim.adServerKeywordsAdUnit is not defined",severity:a.ERROR},[n.INVESTING_FILTER_NOT_FOUND]:{message:"window._imhb_auctions is not defined",severity:a.ERROR},[n.PUBX_AA_NOT_FOUND]:{message:"pubxaiAnalyticsAdapter module is not installed",severity:a.WARNING},[n.PRICE_FLOORS_NOT_FOUND]:{message:"priceFloors module is not installed",severity:a.WARNING},[n.NON_PUBX_FLOORS_FOUND]:{message:"Non-pubx floor provider present",severity:a.WARNING},[n.CURRENCY_INVALID_INPUT]:{message:"Invalid input types for currency conversion",severity:a.WARNING},[n.CURRENCY_MODULE_NOT_INSTALLED]:{message:"currency module of prebid.js is not installed",severity:a.WARNING},[n.ADUNIT_SIZES_NOT_FOUND]:{message:"sizes in adUnit is undefined",severity:a.WARNING},[n.GET_FLOOR_NOT_FOUND]:{message:"calc nbids - None of bidderRequests.bids.getFloor() is defined",severity:a.WARNING},[n.TAG_DEFAULT_VALUES_NOT_FOUND]:{message:"defaultValues of *|banner in config is undefined",severity:a.ERROR},[n.PUBX_OFF_FLOORS_FOUND]:{message:"pubxLoaded is false but has floorData",severity:a.FATAL},[n.MODEL_VERSION_NOT_FOUND_READ]:{message:"floorModelVersion is undefined but adUnit.bids is not",severity:a.FATAL},[n.PMAC_FLOOR_MULTIPLIER_NOT_FOUND]:{message:"PMAC floor multiplier not found in floors-response",severity:a.ERROR},[n.PMAC_FLOOR_MULTIPLIER_NOT_FOUND_CONFIG]:{message:"PMAC floor multiplier not found in config",severity:a.ERROR},[n.INVALID_SCHEMA_FIELDS_FLOORS_RESPONSE]:{message:"Invalid schema fields in floor rules response, expected only ['gptSlot']",severity:a.ERROR},[n.MISSING_ADUNIT_FLOOR_RESPONSE]:{message:"adUnitCode not found in floor rules response",severity:a.ERROR},[n.PMAC_FLOOR_RESPONSE_NOT_AVAILABLE]:{message:"Floors Reponse not available for pmac",severity:a.WARNING},[n.UNCAUGHT_ERROR]:{message:"Uncaught Error",severity:a.ERROR}},B=e=>{let{__pubx__:{variant:o,version:r}}=window;return{variant:o,version:r,loadTime:window.__loadTime__,pbVersion:e.pbNamespace.version}},j=e=>({userAgent:navigator.userAgent,host:window.location.host,path:window.location.pathname,pageId:e,doNotTrack:navigator.doNotTrack}),k=(e,o)=>e.pbNamespace.getEvents().filter(e=>"auctionEnd"===e.eventType).findIndex(e=>e.args.auctionId===o),W=e=>e.pbNamespace.getEvents().filter(e=>"auctionInit"===e.eventType).length,K=e=>JSON.parse(JSON.stringify(e)),q=e=>{let{code:o,adUnitCode:r,payload:t}=e,{message:i,severity:d}=G[o];return{code:o,severity:d,message:i,adUnitCode:r,payload:t}},z=(e,o,r,t)=>{let i=K(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:l,bidsRejected:_}=i,s={adUnits:n.map(({code:e,sizes:o,bids:r,mediaTypes:t})=>({code:e,mediaTypes:Object.keys(t)})),bidderRequestsCount:a.length,bidsReceived: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})),bidsRejected:_?_.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:k(r,d),auctionId:d,auctionInfo:s,modelVersion:U(a)},X(e,r,t))},X=(e,o,r)=>({isPubxEnabled:window.__pubxLoaded__,pubxId:o.pubxId,tagInfo:B(o),pageInfo:j(r),errorData:q(e),timesince:Date.now()-window.__loadTimestamp__,timestamp:Date.now()}),H=e=>{let o=e.pbNamespace.getConfig("floors");return o&&o.data&&o.data.floorProvider?o.data.floorProvider:void 0},Y=(e,o,r,t)=>{let{auctionId:i,adUnits:d,bidsReceived:n,bidsRejected:a,bidderRequests:l}=e,_={adUnitCount:d.length,bidCount:n.length+(a?a.length:0),bidders:[...new Set(l.map(({bidderCode:e})=>e))]};return{isPubxEnabled:window.__pubxLoaded__,pubxId:o.pubxId,loadedBeforePb:window.__loadedBeforePb__,tagInfo:B(o),floorProvider:H(o),pageInfo:j(t),missedAuctionCount:r,timesince:Date.now()-window.__loadTimestamp__,timestamp:Date.now(),previousAuctionCount:k(o,i),auctionId:i,auctionInfo:_,modelVersion:U(l),pbBidData:[],gamTargetingData:[]}},J=e=>{let{severity:o}=G[e.code];return!1},Z=()=>"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,e=>{let o=16*Math.random()|0;return("x"===e?o:3&o|8).toString(16)}),Q=e=>{let o=[],r=[],t=[],i=W(e),d=Z(),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)},l=e=>{if(0===e.length)return 0;let o=new Blob([JSON.stringify(e)]);return o.size},_=()=>!!navigator.sendBeacon&&!!document.visibilityState;_()&&document.addEventListener("visibilitychange",()=>{"hidden"===document.visibilityState&&(a(o,M),a(r,M),a(t,V))});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=K(r),i=(o,r)=>{r.push(z(o,t,e,d)),K(r)};return e=>{if(_()&&(n||J(e))){let r=K(o);i(e,r),l(r)>65536?(a(o,M),i(e,o)):o=r}}},remotePageError:o=>{if(_()&&(n||J(o))){let t=(o,r)=>{r.push(X(o,e,d))},i=K(r);t(o,i),l(i)>65536?(a(r,M),t(o,r)):r=i}},makeRemoteAucEvent:o=>{let r=K(o),s=(o,t)=>{let n=t.find(e=>e.auctionId===r.auctionId);if(void 0===n&&(n=Y(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)}K(t)};return e=>{if(_()&&n){let o=K(t);s(e,o),l(o)>65536?(a(t,V),s(e,t)):t=o}}}}},$=()=>{window.__pubx__.logger.debug("version:","pubx_"+window.__pubx__.variant+"_"+window.__pubx__.version)},ee=()=>{window.__loadTime__=window.__loadTimestamp__?Date.now()-window.__loadTimestamp__:-1,window.__loadTimestamp__=Date.now()},eo=(e,o)=>{let r=u(o).floors,{auctionDelay:t,endpoint:i,data:d}=r,n=h(r,["auctionDelay","endpoint","data"]);window.__nextfloorsConfig__={floors:Object.assign(Object.assign({},n),{data:e})}},er=e=>window.__pmacCpmHistory__[e],et=e=>{let o=er(e);return o?o.history:[]},ei=(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};et(o).push(n),i("Update Pmac history",o,n)},ed=(e,o,r)=>Math.log(o/(e=0===e?.01:e))/r,en=(e,o,r)=>(e=0===e?.01:e)*Math.exp(o*r),ea=e=>{let{debug:o}=window.__pubx__.logger,r=er(e),{history:t}=r,[i,d,n]=[t[0].cpm,t[t.length-1].cpm,t.length-1];r.decayRate=ed(i,d,n),o("Update decay rate",e,r.decayRate)},el=e=>{let o=et(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<r},e_=(e,o)=>{let{remoteAucError:r}=o,{__pmacCpmHistory__:t}=window,i=Object.keys(t),d=v(i,r);d.forEach(({adUnitCode:r,slot:t})=>{el(r)&&eu(r,t,ec(r,e),o)})},es=(e,o)=>{let r=Object.keys(o),t=r.find(o=>[e.getAdUnitPath()+"|banner|*",e.getSlotElementId()+"|banner|*"].includes(o));return t},eu=(e,o,r,t)=>{let{remoteAucError:i}=t,{error:d}=window.__pubx__.logger,{__nextfloorsConfig__:a}=window;if(void 0===a)throw Error("__nextfloorsConfig__ undefined. Skip updating adUnit floors config");let{floors:{data:{values:l}}}=a,_=es(o,l);if(void 0===_){i({code:n.MISSING_ADUNIT_FLOOR_RESPONSE,adUnitCode:e}),d(G[n.MISSING_ADUNIT_FLOOR_RESPONSE].message,{adUnitCode:e});return}l[_]=r},ep=e=>et(e).length<=1,ec=(e,o)=>{let{decayRate:r,history:t}=er(e),[i,n,a]=[t[0].cpm,t.length,t[t.length-1]];if(ep(e)||a.adUnitStatus===d.NOBIDS)return.01;let l=en(i,r,n),_=l*o;return _<.01?.01:parseFloat(_.toFixed(4))},eO=(e,o)=>S(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),eo(t,e)}),ef=(e=null,(o,r,t,i,d,a,l)=>S(void 0,void 0,void 0,function*(){let{remoteAucError:_}=l,{error:s}=window.__pubx__.logger;null===e&&(e=eO(d,l)),yield e,ei(o,r,t,i),ep(r)||ea(r);let{__nextfloorsConfig__:u,__pubxLoaded__:c}=window;if(void 0===u)throw _({code:n.PMAC_FLOOR_RESPONSE_NOT_AVAILABLE,adUnitCode:r}),s(G[n.PMAC_FLOOR_RESPONSE_NOT_AVAILABLE].message,{adUnitCode:r}),Error("__nextfloorsConfig__ undefined. Skip updating floors config");googletag.cmd.push(()=>{e_(a,l),p(c,d,e=>u)})})),eg=(e,o)=>{window.__pubxFloors__={},window.__pubxLoaded__=eb(e.splitRate),window.__loadedBeforePb__=void 0===e.pbNamespace.version,window.__pmacCpmHistory__={},ee(),e.pbNamespace.que.push(function(){window.__pubx__={variant:o,version:"1708004648745",logger:Q(e)},$()})},eb=e=>void 0!==window.__pubxLoaded__?window.__pubxLoaded__:e>100*Math.random(),eN=e=>e.bids.some(({floorData:e})=>e&&e.floorProvider===_&&e.skipped),em=e=>e.bids.some(({floorData:e})=>e&&e.floorProvider===_&&e.modelVersion),eE=(e,o)=>e+"-"+o,eR=(e,o)=>{let r=eN(e);return r?o.pubxOptimizedOffValue:o.pubxOptimizedOnValue},eU=(e,o)=>{let r=em(e);return r?o.pubxSplitOnValue:o.pubxSplitOffValue},eF=(e,o)=>{let{auctionId:r,adUnits:t}=e,{remoteAucError:i}=o,d=[];void 0!==window._imhb_auctions&&void 0!==window._imhb_auctions[r]?d=Object.keys(window._imhb_auctions[r]):(window.__pubx__.logger.error("window._imhb_auctions is not defined for auctionId",r),i({code:n.INVESTING_FILTER_NOT_FOUND,payload:{_imhb_auctions:window._imhb_auctions}}));let a=t.filter(e=>d.includes(e.code));return Object.assign(Object.assign({},e),{adUnits:a})},eI=(()=>{window.googletag=window.googletag||{};window.googletag.cmd=window.googletag.cmd||[];window.pbjs=window.pbjs||{};window.pbjs.que=window.pbjs.que||[];return{splitRate:95,samplingRate:166,pbNamespace:pbjs,currency:"USD",modelVersion:"pbxdflt_AB_s_dt_0.9_dwt_1.0_dnt_0.1_fm_0.5",auctionDelay:100,pubxId:"aba93a3a-0792-49b0-9740-2018808409c4",schema:['gptSlot','mediaType'],defaultValues:{'*|banner':0.01},floorFetchUrl:"https://floor.pbxai.com/?pubxId=aba93a3a-0792-49b0-9740-2018808409c4&page="+window.top.location.href,floorMin:null,hbPbKey:"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.9,noBidMultiplier:0.1,winBidMultiplier:1.0,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,l.initPubxGlobals)(eI,"pb_gam_custom_investing");let eC=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:l.ErrorCode.PUBX_AA_NOT_FOUND});return}{let r=s(e);e.pbNamespace.enableAnalytics(r),o("Enabling Analytics",r)}})})(eI),p(eC,eI,u),((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,s={remoteAucError:n(d),remoteAucEvent:a(d)};try{i&&(d=i(d,s)),r(e,o,d,s);let n=U(d.bidderRequests),a=w(e,d,n,o,s);t(a,n,d.auctionId,o,s)}catch(e){_(e),s.remoteAucError({code:l.ErrorCode.UNCAUGHT_ERROR,payload:{error:e}})}}catch(e){window.__pubx__.logger.error(e)}})})})(eC,eI,(e,o,r,t)=>{let{remoteAucError:i,remoteAucEvent:d}=t;googletag.cmd.push(()=>{let d=r.adUnits.filter(o=>T(o,e,i)).map(e=>e.code),n=v(d,i);n.forEach(({adUnitCode:e,slot:i})=>{let d=r.adUnits.find(o=>o.code===e);x(r.auctionId,e,i,o);let n=(0,l.getPubxSplitValue)(d,o);if(A(r.auctionId,e,o.pubxSplitKey,n,i,t),n===o.pubxSplitOnValue){let n=(0,l.getPubxOptimizedValue)(d,o);A(r.auctionId,e,o.pubxOptimizedKey,n,i,t)}})})},(e,o,r,t,i)=>{let{remoteAucError:d}=i;googletag.cmd.push(()=>{let n=e.map(e=>e.adUnitCode),a=v(n,d);a.forEach(({adUnitCode:n,slot:a})=>{let _=e.find(e=>e.adUnitCode===n);if(void 0===_)throw d({code:l.ErrorCode.CALC_FLOOR_NOT_FOUND,adUnitCode:n}),Error("floorWithStatus not found for adUnitCode "+n);let s=L(_,t,d);if(A(r,n,t.pubxFloorKey,s,a,i),void 0===o)throw d({code:l.ErrorCode.MODEL_VERSION_NOT_FOUND_WRITE,adUnitCode:n,payload:{floorWithStatus:_}}),Error("floorModelVersion is undefined but floorsWithStatus is not");let u=F(o);if(u){A(r,n,t.pubxMvKey,u,a,i);let e=(0,l.getFloorMvValue)(s,u);A(r,n,t.pubxFloorMvKey,e,a,i)}})})},l.auctionDataInvestingFilter)})();