@optable/web-sdk 0.9.1 → 0.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +183 -18
- package/browser/dist/sdk.js +1 -1
- package/lib/dist/addons/gpt-events.js +1 -1
- package/lib/dist/build.json +1 -1
- package/lib/dist/core/network.js +3 -3
- package/lib/dist/core/storage.d.ts +5 -3
- package/lib/dist/core/storage.js +32 -6
- package/lib/dist/edge/targeting.d.ts +28 -10
- package/lib/dist/edge/targeting.js +34 -16
- package/lib/dist/sdk.d.ts +10 -4
- package/lib/dist/sdk.js +41 -11
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# Optable Web SDK [](https://dl.circleci.com/status-badge/redirect/gh/Optable/optable-web-sdk/tree/master)
|
|
2
2
|
|
|
3
3
|
JavaScript SDK for integrating with an [Optable Data Connectivity Node (DCN)](https://docs.optable.co/) from a web site or web application.
|
|
4
4
|
|
|
@@ -20,6 +20,9 @@ JavaScript SDK for integrating with an [Optable Data Connectivity Node (DCN)](ht
|
|
|
20
20
|
- [Targeting key values](#targeting-key-values)
|
|
21
21
|
- [Targeting key values from local cache](#targeting-key-values-from-local-cache)
|
|
22
22
|
- [Witnessing ad events](#witnessing-ad-events)
|
|
23
|
+
- [Integrating Prebid](#integrating-prebid)
|
|
24
|
+
- [Seller Defined Audiences](#seller-defined-audiences)
|
|
25
|
+
- [Custom key values](#custom-key-values)
|
|
23
26
|
- [Identifying visitors arriving from Email newsletters](#identifying-visitors-arriving-from-email-newsletters)
|
|
24
27
|
- [Insert oeid into your Email newsletter template](#insert-oeid-into-your-email-newsletter-template)
|
|
25
28
|
- [Call tryIdentifyFromParams SDK API](#call-tryidentifyfromparams-sdk-api)
|
|
@@ -163,21 +166,19 @@ type ProfileTraits = {
|
|
|
163
166
|
|
|
164
167
|
### Targeting API
|
|
165
168
|
|
|
166
|
-
To get the targeting
|
|
169
|
+
To get the targeting information associated by the configured DCN with the user's browser in real-time, you can call the targeting API as follows:
|
|
167
170
|
|
|
168
171
|
```js
|
|
169
172
|
sdk
|
|
170
173
|
.targeting()
|
|
171
|
-
.then((
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
console.log(`Targeting KV: ${key} = ${values.join(",")}`);
|
|
175
|
-
}
|
|
174
|
+
.then((response) => {
|
|
175
|
+
console.log(`Audience targeting: ${targeting.audience}`)
|
|
176
|
+
console.log(`User targeting: ${targeting.user}`)
|
|
176
177
|
})
|
|
177
178
|
.catch((err) => console.warn(`Targeting API Error: ${err.message}`));
|
|
178
179
|
```
|
|
179
180
|
|
|
180
|
-
On success, the resulting
|
|
181
|
+
On success, the resulting targeting data is typically sent as part of a subsequent ad call. Therefore we recommend that you either call targeting() before each ad call, or in parallel periodically, caching the resulting targeting data which you then provide in ad calls.
|
|
181
182
|
|
|
182
183
|
#### Caching Targeting Data
|
|
183
184
|
|
|
@@ -186,9 +187,8 @@ The `targeting` API will automatically cache resulting key value data in client
|
|
|
186
187
|
```{javascript
|
|
187
188
|
const cachedTargetingData = sdk.targetingFromCache();
|
|
188
189
|
if (cachedTargetingData) {
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
}
|
|
190
|
+
console.log(`Audience targeting: ${targeting.audience}`)
|
|
191
|
+
console.log(`User targeting: ${targeting.user}`)
|
|
192
192
|
}
|
|
193
193
|
```
|
|
194
194
|
|
|
@@ -268,7 +268,7 @@ The following shows an example of how to safely initialize the SDK and dispatch
|
|
|
268
268
|
|
|
269
269
|
## Integrating GAM360
|
|
270
270
|
|
|
271
|
-
The Optable Web SDK can fetch targeting
|
|
271
|
+
The Optable Web SDK can fetch targeting data from a DCN and map it to be sent to [Google Ad Manager 360](https://admanager.google.com/home/) ad server account for real-time targeting. It's also capable of intercepting advertising events from the [Google Publisher Tag](https://developers.google.com/doubleclick-gpt/guides/get-started) and logging them to a DCN via the **witness API**.
|
|
272
272
|
|
|
273
273
|
### Targeting key values
|
|
274
274
|
|
|
@@ -330,10 +330,8 @@ It's suggested to load the GAM banner view with an ad even when the call to your
|
|
|
330
330
|
// so that GAM ads are always loaded.
|
|
331
331
|
optable.cmd.push(function () {
|
|
332
332
|
optable.instance
|
|
333
|
-
.
|
|
334
|
-
.then(
|
|
335
|
-
loadGAM(result);
|
|
336
|
-
})
|
|
333
|
+
.targetingKeyValues()
|
|
334
|
+
.then(loadGAM)
|
|
337
335
|
.catch((err) => {
|
|
338
336
|
loadGAM();
|
|
339
337
|
});
|
|
@@ -349,7 +347,7 @@ Note the use of `googletag.pubads().disableInitialLoad()` in the above example.
|
|
|
349
347
|
|
|
350
348
|
### Targeting key values from local cache
|
|
351
349
|
|
|
352
|
-
It's also possible to avoid disabling of the initial ad load by using the SDK's `
|
|
350
|
+
It's also possible to avoid disabling of the initial ad load by using the SDK's `targetingKeyValuesFromCache()` method instead as in the following example:
|
|
353
351
|
|
|
354
352
|
```html
|
|
355
353
|
<!-- Optable SDK async load: -->
|
|
@@ -376,7 +374,7 @@ It's also possible to avoid disabling of the initial ad load by using the SDK's
|
|
|
376
374
|
|
|
377
375
|
// Attempt to load Optable targeting key values from local cache, then load GAM ads:
|
|
378
376
|
optable.cmd.push(function () {
|
|
379
|
-
const tdata = optable.instance.
|
|
377
|
+
const tdata = optable.instance.targetingKeyValuesFromCache();
|
|
380
378
|
for (const [key, values] of Object.entries(tdata)) {
|
|
381
379
|
googletag.pubads().setTargeting(key, values);
|
|
382
380
|
}
|
|
@@ -425,6 +423,161 @@ Note that you can call `installGPTEventListeners()` as many times as you like on
|
|
|
425
423
|
|
|
426
424
|
A working example of both targeting and event witnessing is available in the demo pages.
|
|
427
425
|
|
|
426
|
+
## Integrating Prebid
|
|
427
|
+
|
|
428
|
+
The Optable Web SDK can fetch targeting data from a DCN and prepare an audience taxonomy object similar to the one described in [the prebid.js first party data documentation](https://docs.prebid.org/features/firstPartyData.html#segments-and-taxonomy). The `prebidUserDataFromCache()` function returns the object from the targeting data stored by `targeting()` API calls in `LocalStorage`.
|
|
429
|
+
|
|
430
|
+
### Seller Defined Audiences
|
|
431
|
+
|
|
432
|
+
The HTML code snippet below shows how `prebidUserDataFromCache()` can be used to retrieve targeting data from the `LocalStorage` administered by the Optable SDK, and write Seller Defined Audiences (SDA) into [prebid.js](https://prebid.org/product-suite/prebid-js/) which is also loaded into the page, using `pbjs.setConfig({ ortb2: { user: { data: [ { ... } ] } } })` as documented in [the prebid.js first party data documentation](https://docs.prebid.org/features/firstPartyData.html#segments-and-taxonomy). The `targeting()` API is also called in order to retrieve and locally store the latest matching activations from `dcn.customer.com/my-site`.
|
|
433
|
+
|
|
434
|
+
Note that [prebid.js bidder adapters](https://docs.prebid.org/dev-docs/bidders.html) can subsequently retrieve the data from the [global config](https://docs.prebid.org/features/firstPartyData.html#supplying-global-data).
|
|
435
|
+
|
|
436
|
+
An example of how to install the SDA data through `pbjs` is shown below. The `districtMDMX` bidder adapter is referenced, though the integration would look similar with any SDA compatible bidder adapters.
|
|
437
|
+
|
|
438
|
+
For a working demo showing a `pbjs` and GAM integrated together, see the [demo pages section](#demo-pages) below.
|
|
439
|
+
|
|
440
|
+
```html
|
|
441
|
+
<!-- Optable SDK async load: -->
|
|
442
|
+
<script async src="https://cdn.optable.co/web-sdk/v0/sdk.js"></script>
|
|
443
|
+
|
|
444
|
+
<!-- Prebid.js lib async load: -->
|
|
445
|
+
<script async src="prebid.js"></script>
|
|
446
|
+
|
|
447
|
+
<!-- Initialize Optable SDK, and targeting call early when possible: -->
|
|
448
|
+
<script>
|
|
449
|
+
window.optable = window.optable || { cmd: [] };
|
|
450
|
+
|
|
451
|
+
// Init Optable SDK via command:
|
|
452
|
+
optable.cmd.push(function () {
|
|
453
|
+
optable.instance = new optable.SDK({ host: "dcn.customer.com", site: "my-site" });
|
|
454
|
+
});
|
|
455
|
+
|
|
456
|
+
// Call Optable DCN for targeting data which will update the local cache on success.
|
|
457
|
+
optable.cmd.push(function () {
|
|
458
|
+
optable.instance.targeting().catch((err) => {
|
|
459
|
+
// Maybe log error
|
|
460
|
+
});
|
|
461
|
+
});
|
|
462
|
+
</script>
|
|
463
|
+
|
|
464
|
+
<!-- Placeholder DIV for adSlot -->
|
|
465
|
+
<div id="div-gpt-ad-12345-0"></div>
|
|
466
|
+
|
|
467
|
+
<!-- Initialize prebid.js -->
|
|
468
|
+
<script>
|
|
469
|
+
window.pbjs = window.pbjs || { que: [] };
|
|
470
|
+
|
|
471
|
+
var PREBID_TIMEOUT = 3000;
|
|
472
|
+
var FAILSAFE_TIMEOUT = 5000;
|
|
473
|
+
|
|
474
|
+
var adUnits = [
|
|
475
|
+
{
|
|
476
|
+
code: "/22081946781/web-sdk-demo/box-ad",
|
|
477
|
+
mediaTypes: {
|
|
478
|
+
banner: {
|
|
479
|
+
sizes: [
|
|
480
|
+
[250, 250],
|
|
481
|
+
[300, 250],
|
|
482
|
+
[200, 200],
|
|
483
|
+
],
|
|
484
|
+
},
|
|
485
|
+
},
|
|
486
|
+
bids: [
|
|
487
|
+
{
|
|
488
|
+
bidder: "districtmDMX",
|
|
489
|
+
params: {
|
|
490
|
+
dmxid: "/22081946781/web-sdk-demo/box-ad",
|
|
491
|
+
memberid: "102034",
|
|
492
|
+
},
|
|
493
|
+
},
|
|
494
|
+
],
|
|
495
|
+
},
|
|
496
|
+
];
|
|
497
|
+
|
|
498
|
+
function initAdserver() {
|
|
499
|
+
if (pbjs.initAdserverSet) return;
|
|
500
|
+
pbjs.initAdserverSet = true;
|
|
501
|
+
// ... etc ...
|
|
502
|
+
}
|
|
503
|
+
|
|
504
|
+
pbjs.que.push(function () {
|
|
505
|
+
optable.cmd.push(function () {
|
|
506
|
+
const pbdata = optable.instance.prebidUserDataFromCache();
|
|
507
|
+
if (pbdata.length > 0) {
|
|
508
|
+
pbjs.setConfig({
|
|
509
|
+
ortb2: {
|
|
510
|
+
user: {
|
|
511
|
+
data: pbdata,
|
|
512
|
+
},
|
|
513
|
+
},
|
|
514
|
+
});
|
|
515
|
+
}
|
|
516
|
+
|
|
517
|
+
// ... etc ...
|
|
518
|
+
|
|
519
|
+
pbjs.requestBids({
|
|
520
|
+
bidsBackHandler: initAdserver,
|
|
521
|
+
timeout: PREBID_TIMEOUT,
|
|
522
|
+
});
|
|
523
|
+
});
|
|
524
|
+
});
|
|
525
|
+
|
|
526
|
+
setTimeout(function () {
|
|
527
|
+
initAdserver();
|
|
528
|
+
}, FAILSAFE_TIMEOUT);
|
|
529
|
+
</script>
|
|
530
|
+
```
|
|
531
|
+
|
|
532
|
+
### Custom key values
|
|
533
|
+
|
|
534
|
+
For bidder adapters that do not support SDA, but that do support targeting private marketplace deals to key values, you can use a similar approach to the [Google Ad Manager integration with key values from local cache](#targeting-key-values-from-local-cache). For example, for the IX bidder adapter and [IX bidder-specific FPD](https://docs.prebid.org/dev-docs/bidders/ix.html#ix-bidder-specific-fpd), you can encode the targeting key values as shown below:
|
|
535
|
+
|
|
536
|
+
```html
|
|
537
|
+
<script>
|
|
538
|
+
// ...
|
|
539
|
+
// prior to pbjs.requestBids():
|
|
540
|
+
pbjs.que.push(function () {
|
|
541
|
+
optable.cmd.push(function () {
|
|
542
|
+
const tdata = optable.instance.targetingKeyValuesFromCache();
|
|
543
|
+
var fpd = {};
|
|
544
|
+
|
|
545
|
+
/*
|
|
546
|
+
* Flatten targeting key=values from Optable SDK targeting cache
|
|
547
|
+
* into a custom key value object, such that a key K with values
|
|
548
|
+
* V1, V2, ... in the Optable SDK targeting cache is transformed
|
|
549
|
+
* to look like:
|
|
550
|
+
* {
|
|
551
|
+
* K + V1: 1,
|
|
552
|
+
* K + V2: 1,
|
|
553
|
+
* ...
|
|
554
|
+
* }
|
|
555
|
+
*
|
|
556
|
+
* Note that + above indicates string concatenation.
|
|
557
|
+
*
|
|
558
|
+
* Optable DCNs have K configured to "optable" by default, so the
|
|
559
|
+
* above would result in a custom key value "optable_audienceKeyword=1"
|
|
560
|
+
* being set whenever the visitor is matched to the activated audience
|
|
561
|
+
* specified by audienceKeyword by the DCN.
|
|
562
|
+
*/
|
|
563
|
+
for (const [key, values] of Object.entries(tdata || {})) {
|
|
564
|
+
for (const seg of values) {
|
|
565
|
+
fpd[key + seg] = "1";
|
|
566
|
+
}
|
|
567
|
+
}
|
|
568
|
+
|
|
569
|
+
pbjs.setConfig({
|
|
570
|
+
ix: {
|
|
571
|
+
firstPartyData: fpd,
|
|
572
|
+
},
|
|
573
|
+
});
|
|
574
|
+
});
|
|
575
|
+
|
|
576
|
+
pbjs.requestBids(...);
|
|
577
|
+
});
|
|
578
|
+
</script>
|
|
579
|
+
```
|
|
580
|
+
|
|
428
581
|
## Identifying visitors arriving from Email newsletters
|
|
429
582
|
|
|
430
583
|
If you send Email newsletters that contain links to your website, then you may want to automatically _identify_ visitors that have clicked on any such links via their Email address.
|
|
@@ -460,3 +613,15 @@ On your website destination page, you can call a helper method provided by the S
|
|
|
460
613
|
The demo pages are working examples of both `identify` and `targeting` APIs, as well as an integration with the [Google Ad Manager 360](https://admanager.google.com/home/) ad server, enabling the targeting of ads served by GAM360 to audiences activated in the [Optable](https://optable.co/) DCN.
|
|
461
614
|
|
|
462
615
|
You can browse a recent (but not necessarily the latest) released version of the demo pages at [https://demo.optable.co/](https://demo.optable.co/). The source code to the demos can be found [here](https://github.com/Optable/optable-web-sdk/tree/master/demos). The demo pages will connect to the [Optable](https://optable.co/) demo DCN at `sandbox.optable.co` and reference the web site slug `web-sdk-demo`. The GAM360 targeting demo loads ads from a GAM360 account operated by [Optable](https://optable.co/).
|
|
616
|
+
|
|
617
|
+
Note that the demo pages at [https://demo.optable.co/](https://demo.optable.co/) will by default rely on secure HTTP first-party cookies as described [here](https://github.com/Optable/optable-web-sdk#domains-and-cookies). To see an example based on [LocalStorage](https://github.com/Optable/optable-web-sdk#localstorage), see the [index-nocookies variant here](https://demo.optable.co/index-nocookies.html).
|
|
618
|
+
|
|
619
|
+
To build and run the demos locally, you will need [Docker](https://www.docker.com/), `docker-compose` and `make`:
|
|
620
|
+
```
|
|
621
|
+
$ cd path/to/optable-web-sdk
|
|
622
|
+
$ make
|
|
623
|
+
$ docker-compose up
|
|
624
|
+
```
|
|
625
|
+
Then head to [http://localhost:8180/](localhost:8180) to see the demo pages. You can modify the code in each demo, then run `make build` and finally refresh the demo pages to see your changes take effect. If you want to test the demos with your own DCN, make sure to update the configuration (hostname and site slug) given to the OptableSDK (see `webpack.config.js` for the react example).
|
|
626
|
+
|
|
627
|
+
Note that using HTTP first-party cookies with a local instance of the demos pages pointing to an Optable DCN will not work because [http://localhost:8180/](localhost:8180) does not share the same top-level domain name `.optable.co`. We recommend using [LocalStorage](https://github.com/Optable/optable-web-sdk#localstorage) instead.
|
package/browser/dist/sdk.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/*! For license information please see sdk.js.LICENSE.txt */
|
|
2
|
-
(()=>{var __webpack_modules__={228:t=>{t.exports=function(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}},858:t=>{t.exports=function(t){if(Array.isArray(t))return t}},646:(t,e,r)=>{var n=r(228);t.exports=function(t){if(Array.isArray(t))return n(t)}},926:t=>{function e(t,e,r,n,o,i,a){try{var s=t[i](a),c=s.value}catch(t){return void r(t)}s.done?e(c):Promise.resolve(c).then(n,o)}t.exports=function(t){return function(){var r=this,n=arguments;return new Promise((function(o,i){var a=t.apply(r,n);function s(t){e(a,o,i,s,c,"next",t)}function c(t){e(a,o,i,s,c,"throw",t)}s(void 0)}))}}},575:t=>{t.exports=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}},913:t=>{function e(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}t.exports=function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}},713:t=>{t.exports=function(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}},860:t=>{t.exports=function(t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t))return Array.from(t)}},884:t=>{t.exports=function(t,e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t)){var r=[],n=!0,o=!1,i=void 0;try{for(var a,s=t[Symbol.iterator]();!(n=(a=s.next()).done)&&(r.push(a.value),!e||r.length!==e);n=!0);}catch(t){o=!0,i=t}finally{try{n||null==s.return||s.return()}finally{if(o)throw i}}return r}}},521:t=>{t.exports=function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}},206:t=>{t.exports=function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}},38:(t,e,r)=>{var n=r(858),o=r(884),i=r(379),a=r(521);t.exports=function(t,e){return n(t)||o(t,e)||i(t,e)||a()}},319:(t,e,r)=>{var n=r(646),o=r(860),i=r(379),a=r(206);t.exports=function(t){return n(t)||o(t)||i(t)||a()}},379:(t,e,r)=>{var n=r(228);t.exports=function(t,e){if(t){if("string"==typeof t)return n(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?n(t,e):void 0}}},757:(t,e,r)=>{t.exports=r(666)},869:(t,e,r)=>{"use strict";var n=r(575),o=r.n(n),i=r(913),a=r.n(i);function s(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}const c=function(){function t(e){if(o()(this,t),this.cmds=e,Array.isArray(this.cmds)){var r,n=function(t,e){var r;if("undefined"==typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(r=function(t,e){if(t){if("string"==typeof t)return s(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?s(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,c=!1;return{s:function(){r=t[Symbol.iterator]()},n:function(){var t=r.next();return a=t.done,t},e:function(t){c=!0,i=t},f:function(){try{a||null==r.return||r.return()}finally{if(c)throw i}}}}(this.cmds);try{for(n.s();!(r=n.n()).done;){var i=r.value;"function"==typeof i&&i()}}catch(t){n.e(t)}finally{n.f()}}}return a()(t,[{key:"push",value:function(t){t()}}]),t}();var u=r(757),h=r.n(u),f=r(38),l=r.n(f),p=r(926),y=r.n(p),d=r(713),_=r.n(d);function v(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function g(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?v(Object(r),!0).forEach((function(e){_()(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):v(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}var b={insecure:!1,cookies:!0};const w="v0.9.1";var S=r(319),m=r.n(S),E=function(){function t(e){o()(this,t),this.Config=e,_()(this,"passportKey",void 0),_()(this,"targetingKey",void 0);var r=btoa(function(t){for(var e=new Uint16Array(t.length),r=0;r<e.length;r++)e[r]=t.charCodeAt(r);return String.fromCharCode.apply(String,m()(new Uint8Array(e.buffer)))}("".concat(this.Config.host,"/").concat(this.Config.site)));this.passportKey="OPTABLE_PASS_"+r,this.targetingKey="OPTABLE_TGT_"+r}return a()(t,[{key:"getPassport",value:function(){return window.localStorage.getItem(this.passportKey)}},{key:"getTargeting",value:function(){var t=window.localStorage.getItem(this.targetingKey);return t?JSON.parse(t):null}},{key:"setPassport",value:function(t){t&&t.length>0&&window.localStorage.setItem(this.passportKey,t)}},{key:"setTargeting",value:function(t){t&&window.localStorage.setItem(this.targetingKey,JSON.stringify(t))}},{key:"clearPassport",value:function(){window.localStorage.removeItem(this.passportKey)}},{key:"clearTargeting",value:function(){window.localStorage.removeItem(this.targetingKey)}}]),t}();function A(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function H(t,e,r){var n=function(t){return g(g({},b),t)}(e),o=n.site,i=n.host,a=n.insecure,s=n.cookies,c=a?"http":"https",u=new URL("".concat(o).concat(t),"".concat(c,"://").concat(i));if(s)u.search=new URLSearchParams({cookies:"yes",osdk:"web-".concat(w)}).toString();else{var h=new E(e).getPassport();u.search=new URLSearchParams({cookies:"no",passport:h||"",osdk:"web-".concat(w)}).toString()}var f=function(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?A(Object(r),!0).forEach((function(e){_()(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):A(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}({},r);return f.credentials="include",new Request(u.toString(),f)}function R(t,e,r){return O.apply(this,arguments)}function O(){return(O=y()(h().mark((function t(e,r,n){var o,i,a;return h().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,window.fetch(H(e,r,n));case 2:if(o=t.sent,!(null==(i=o.headers.get("Content-Type"))?void 0:i.startsWith("application/json"))){t.next=10;break}return t.next=7,o.json();case 7:t.t0=t.sent,t.next=13;break;case 10:return t.next=12,o.text();case 12:t.t0=t.sent;case 13:if(a=t.t0,o.ok){t.next=16;break}throw new Error(a.error);case 16:return a.passport&&(new E(r).setPassport(a.passport),delete a.passport),t.abrupt("return",a);case 18:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function C(){return(C=y()(h().mark((function t(e){var r;return h().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,R("/targeting",e,{method:"GET",headers:{"Content-Type":"application/json"}});case 2:return(r=t.sent)&&new E(e).setTargeting(r),t.abrupt("return",r);case 5:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function x(t){return new E(t).getTargeting()}function k(t,e){return R("/identify",t,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})}function X(t,e,r){var n={event:e,properties:r};return R("/witness",t,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(n)})}var j=r(23);const T=function(){function t(e){o()(this,t),this.sandbox=e}return a()(t,[{key:"identify",value:function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];return k(this.sandbox,e.filter((function(t){return t})))}},{key:"targeting",value:function(){return function(t){return C.apply(this,arguments)}(this.sandbox)}},{key:"targetingFromCache",value:function(){return x(this.sandbox)}},{key:"targetingClearCache",value:function(){var t;t=this.sandbox,new E(t).clearTargeting()}},{key:"prebidUserDataFromCache",value:function(){return function(t){for(var e=x(t),r=[],n=function(){var t=l()(i[o],2),e=t[0],n=t[1].map((function(t){return{name:e,value:t}}));n.length>0&&r.push({id:"optable",name:"optable",segment:n})},o=0,i=Object.entries(e||{});o<i.length;o++)n();return r}(this.sandbox)}},{key:"witness",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return X(this.sandbox,t,e)}},{key:"profile",value:function(t){return function(t,e){var r={traits:e};return R("/profile",t,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(r)})}(this.sandbox,t)}}],[{key:"eid",value:function(t){return t?"e:"+j.sha256.hex(t.toLowerCase().trim()):""}},{key:"cid",value:function(t){return t?"c:"+t.trim():""}}]),t}();function I(t){var e,r,n,o,i,a,s,c,u,h;return{advertiserId:null===(e=t.advertiserId)||void 0===e?void 0:e.toString(),campaignId:null===(r=t.campaignId)||void 0===r?void 0:r.toString(),creativeId:null===(n=t.creativeId)||void 0===n?void 0:n.toString(),isEmpty:null===(o=t.isEmpty)||void 0===o?void 0:o.toString(),lineItemId:null===(i=t.lineItemId)||void 0===i?void 0:i.toString(),serviceName:null===(a=t.serviceName)||void 0===a?void 0:a.toString(),size:null===(s=t.size)||void 0===s?void 0:s.toString(),slotElementId:null===(c=t.slot)||void 0===c?void 0:c.getSlotElementId(),sourceAgnosticCreativeId:null===(u=t.sourceAgnosticCreativeId)||void 0===u?void 0:u.toString(),sourceAgnosticLineItemId:null===(h=t.sourceAgnosticLineItemId)||void 0===h?void 0:h.toString()}}function P(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}T.prototype.installGPTEventListeners=function(){var t=this;t.installGPTEventListeners=function(){},window.googletag=window.googletag||{cmd:[]};var e=window.googletag;e.cmd.push((function(){e.pubads().addEventListener("slotRenderEnded",(function(e){t.witness("googletag.events.slotRenderEnded",I(e))})),e.pubads().addEventListener("impressionViewable",(function(e){t.witness("googletag.events.impressionViewable",I(e))}))}))},T.prototype.tryIdentifyFromParams=function(){var t,e=new URLSearchParams(window.location.search),r="",n=function(t,e){var r;if("undefined"==typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(r=function(t,e){if(t){if("string"==typeof t)return P(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?P(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,s=!1;return{s:function(){r=t[Symbol.iterator]()},n:function(){var t=r.next();return a=t.done,t},e:function(t){s=!0,i=t},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw i}}}}(e.keys());try{for(n.s();!(t=n.n()).done;){var o=t.value;if(o.match(/^oeid$/i)){r=e.get(o);break}}}catch(t){n.e(t)}finally{n.f()}(function(t){return null!==t.match(/^[a-f0-9]{64}$/i)})(r=r||"")&&this.identify("e:"+r.toLowerCase())},window.optable=window.optable||{},window.optable.SDK=T,window.optable.cmd=new c(window.optable.cmd||[])},23:(module,exports,__webpack_require__)=>{var __WEBPACK_AMD_DEFINE_RESULT__;(function(){"use strict";var ERROR="input is invalid type",WINDOW="object"==typeof window,root=WINDOW?window:{};root.JS_SHA256_NO_WINDOW&&(WINDOW=!1);var WEB_WORKER=!WINDOW&&"object"==typeof self,NODE_JS=!root.JS_SHA256_NO_NODE_JS&&"object"==typeof process&&process.versions&&process.versions.node;NODE_JS?root=__webpack_require__.g:WEB_WORKER&&(root=self);var COMMON_JS=!root.JS_SHA256_NO_COMMON_JS&&module.exports,AMD=__webpack_require__.amdO,ARRAY_BUFFER=!root.JS_SHA256_NO_ARRAY_BUFFER&&"undefined"!=typeof ArrayBuffer,HEX_CHARS="0123456789abcdef".split(""),EXTRA=[-2147483648,8388608,32768,128],SHIFT=[24,16,8,0],K=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],OUTPUT_TYPES=["hex","array","digest","arrayBuffer"],blocks=[];!root.JS_SHA256_NO_NODE_JS&&Array.isArray||(Array.isArray=function(t){return"[object Array]"===Object.prototype.toString.call(t)}),!ARRAY_BUFFER||!root.JS_SHA256_NO_ARRAY_BUFFER_IS_VIEW&&ArrayBuffer.isView||(ArrayBuffer.isView=function(t){return"object"==typeof t&&t.buffer&&t.buffer.constructor===ArrayBuffer});var createOutputMethod=function(t,e){return function(r){return new Sha256(e,!0).update(r)[t]()}},createMethod=function(t){var e=createOutputMethod("hex",t);NODE_JS&&(e=nodeWrap(e,t)),e.create=function(){return new Sha256(t)},e.update=function(t){return e.create().update(t)};for(var r=0;r<OUTPUT_TYPES.length;++r){var n=OUTPUT_TYPES[r];e[n]=createOutputMethod(n,t)}return e},nodeWrap=function(method,is224){var crypto=eval("require('crypto')"),Buffer=eval("require('buffer').Buffer"),algorithm=is224?"sha224":"sha256",nodeMethod=function(t){if("string"==typeof t)return crypto.createHash(algorithm).update(t,"utf8").digest("hex");if(null==t)throw new Error(ERROR);return t.constructor===ArrayBuffer&&(t=new Uint8Array(t)),Array.isArray(t)||ArrayBuffer.isView(t)||t.constructor===Buffer?crypto.createHash(algorithm).update(new Buffer(t)).digest("hex"):method(t)};return nodeMethod},createHmacOutputMethod=function(t,e){return function(r,n){return new HmacSha256(r,e,!0).update(n)[t]()}},createHmacMethod=function(t){var e=createHmacOutputMethod("hex",t);e.create=function(e){return new HmacSha256(e,t)},e.update=function(t,r){return e.create(t).update(r)};for(var r=0;r<OUTPUT_TYPES.length;++r){var n=OUTPUT_TYPES[r];e[n]=createHmacOutputMethod(n,t)}return e};function Sha256(t,e){e?(blocks[0]=blocks[16]=blocks[1]=blocks[2]=blocks[3]=blocks[4]=blocks[5]=blocks[6]=blocks[7]=blocks[8]=blocks[9]=blocks[10]=blocks[11]=blocks[12]=blocks[13]=blocks[14]=blocks[15]=0,this.blocks=blocks):this.blocks=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],t?(this.h0=3238371032,this.h1=914150663,this.h2=812702999,this.h3=4144912697,this.h4=4290775857,this.h5=1750603025,this.h6=1694076839,this.h7=3204075428):(this.h0=1779033703,this.h1=3144134277,this.h2=1013904242,this.h3=2773480762,this.h4=1359893119,this.h5=2600822924,this.h6=528734635,this.h7=1541459225),this.block=this.start=this.bytes=this.hBytes=0,this.finalized=this.hashed=!1,this.first=!0,this.is224=t}function HmacSha256(t,e,r){var n,o=typeof t;if("string"===o){var i,a=[],s=t.length,c=0;for(n=0;n<s;++n)(i=t.charCodeAt(n))<128?a[c++]=i:i<2048?(a[c++]=192|i>>6,a[c++]=128|63&i):i<55296||i>=57344?(a[c++]=224|i>>12,a[c++]=128|i>>6&63,a[c++]=128|63&i):(i=65536+((1023&i)<<10|1023&t.charCodeAt(++n)),a[c++]=240|i>>18,a[c++]=128|i>>12&63,a[c++]=128|i>>6&63,a[c++]=128|63&i);t=a}else{if("object"!==o)throw new Error(ERROR);if(null===t)throw new Error(ERROR);if(ARRAY_BUFFER&&t.constructor===ArrayBuffer)t=new Uint8Array(t);else if(!(Array.isArray(t)||ARRAY_BUFFER&&ArrayBuffer.isView(t)))throw new Error(ERROR)}t.length>64&&(t=new Sha256(e,!0).update(t).array());var u=[],h=[];for(n=0;n<64;++n){var f=t[n]||0;u[n]=92^f,h[n]=54^f}Sha256.call(this,e,r),this.update(h),this.oKeyPad=u,this.inner=!0,this.sharedMemory=r}Sha256.prototype.update=function(t){if(!this.finalized){var e,r=typeof t;if("string"!==r){if("object"!==r)throw new Error(ERROR);if(null===t)throw new Error(ERROR);if(ARRAY_BUFFER&&t.constructor===ArrayBuffer)t=new Uint8Array(t);else if(!(Array.isArray(t)||ARRAY_BUFFER&&ArrayBuffer.isView(t)))throw new Error(ERROR);e=!0}for(var n,o,i=0,a=t.length,s=this.blocks;i<a;){if(this.hashed&&(this.hashed=!1,s[0]=this.block,s[16]=s[1]=s[2]=s[3]=s[4]=s[5]=s[6]=s[7]=s[8]=s[9]=s[10]=s[11]=s[12]=s[13]=s[14]=s[15]=0),e)for(o=this.start;i<a&&o<64;++i)s[o>>2]|=t[i]<<SHIFT[3&o++];else for(o=this.start;i<a&&o<64;++i)(n=t.charCodeAt(i))<128?s[o>>2]|=n<<SHIFT[3&o++]:n<2048?(s[o>>2]|=(192|n>>6)<<SHIFT[3&o++],s[o>>2]|=(128|63&n)<<SHIFT[3&o++]):n<55296||n>=57344?(s[o>>2]|=(224|n>>12)<<SHIFT[3&o++],s[o>>2]|=(128|n>>6&63)<<SHIFT[3&o++],s[o>>2]|=(128|63&n)<<SHIFT[3&o++]):(n=65536+((1023&n)<<10|1023&t.charCodeAt(++i)),s[o>>2]|=(240|n>>18)<<SHIFT[3&o++],s[o>>2]|=(128|n>>12&63)<<SHIFT[3&o++],s[o>>2]|=(128|n>>6&63)<<SHIFT[3&o++],s[o>>2]|=(128|63&n)<<SHIFT[3&o++]);this.lastByteIndex=o,this.bytes+=o-this.start,o>=64?(this.block=s[16],this.start=o-64,this.hash(),this.hashed=!0):this.start=o}return this.bytes>4294967295&&(this.hBytes+=this.bytes/4294967296<<0,this.bytes=this.bytes%4294967296),this}},Sha256.prototype.finalize=function(){if(!this.finalized){this.finalized=!0;var t=this.blocks,e=this.lastByteIndex;t[16]=this.block,t[e>>2]|=EXTRA[3&e],this.block=t[16],e>=56&&(this.hashed||this.hash(),t[0]=this.block,t[16]=t[1]=t[2]=t[3]=t[4]=t[5]=t[6]=t[7]=t[8]=t[9]=t[10]=t[11]=t[12]=t[13]=t[14]=t[15]=0),t[14]=this.hBytes<<3|this.bytes>>>29,t[15]=this.bytes<<3,this.hash()}},Sha256.prototype.hash=function(){var t,e,r,n,o,i,a,s,c,u=this.h0,h=this.h1,f=this.h2,l=this.h3,p=this.h4,y=this.h5,d=this.h6,_=this.h7,v=this.blocks;for(t=16;t<64;++t)e=((o=v[t-15])>>>7|o<<25)^(o>>>18|o<<14)^o>>>3,r=((o=v[t-2])>>>17|o<<15)^(o>>>19|o<<13)^o>>>10,v[t]=v[t-16]+e+v[t-7]+r<<0;for(c=h&f,t=0;t<64;t+=4)this.first?(this.is224?(i=300032,_=(o=v[0]-1413257819)-150054599<<0,l=o+24177077<<0):(i=704751109,_=(o=v[0]-210244248)-1521486534<<0,l=o+143694565<<0),this.first=!1):(e=(u>>>2|u<<30)^(u>>>13|u<<19)^(u>>>22|u<<10),n=(i=u&h)^u&f^c,_=l+(o=_+(r=(p>>>6|p<<26)^(p>>>11|p<<21)^(p>>>25|p<<7))+(p&y^~p&d)+K[t]+v[t])<<0,l=o+(e+n)<<0),e=(l>>>2|l<<30)^(l>>>13|l<<19)^(l>>>22|l<<10),n=(a=l&u)^l&h^i,d=f+(o=d+(r=(_>>>6|_<<26)^(_>>>11|_<<21)^(_>>>25|_<<7))+(_&p^~_&y)+K[t+1]+v[t+1])<<0,e=((f=o+(e+n)<<0)>>>2|f<<30)^(f>>>13|f<<19)^(f>>>22|f<<10),n=(s=f&l)^f&u^a,y=h+(o=y+(r=(d>>>6|d<<26)^(d>>>11|d<<21)^(d>>>25|d<<7))+(d&_^~d&p)+K[t+2]+v[t+2])<<0,e=((h=o+(e+n)<<0)>>>2|h<<30)^(h>>>13|h<<19)^(h>>>22|h<<10),n=(c=h&f)^h&l^s,p=u+(o=p+(r=(y>>>6|y<<26)^(y>>>11|y<<21)^(y>>>25|y<<7))+(y&d^~y&_)+K[t+3]+v[t+3])<<0,u=o+(e+n)<<0;this.h0=this.h0+u<<0,this.h1=this.h1+h<<0,this.h2=this.h2+f<<0,this.h3=this.h3+l<<0,this.h4=this.h4+p<<0,this.h5=this.h5+y<<0,this.h6=this.h6+d<<0,this.h7=this.h7+_<<0},Sha256.prototype.hex=function(){this.finalize();var t=this.h0,e=this.h1,r=this.h2,n=this.h3,o=this.h4,i=this.h5,a=this.h6,s=this.h7,c=HEX_CHARS[t>>28&15]+HEX_CHARS[t>>24&15]+HEX_CHARS[t>>20&15]+HEX_CHARS[t>>16&15]+HEX_CHARS[t>>12&15]+HEX_CHARS[t>>8&15]+HEX_CHARS[t>>4&15]+HEX_CHARS[15&t]+HEX_CHARS[e>>28&15]+HEX_CHARS[e>>24&15]+HEX_CHARS[e>>20&15]+HEX_CHARS[e>>16&15]+HEX_CHARS[e>>12&15]+HEX_CHARS[e>>8&15]+HEX_CHARS[e>>4&15]+HEX_CHARS[15&e]+HEX_CHARS[r>>28&15]+HEX_CHARS[r>>24&15]+HEX_CHARS[r>>20&15]+HEX_CHARS[r>>16&15]+HEX_CHARS[r>>12&15]+HEX_CHARS[r>>8&15]+HEX_CHARS[r>>4&15]+HEX_CHARS[15&r]+HEX_CHARS[n>>28&15]+HEX_CHARS[n>>24&15]+HEX_CHARS[n>>20&15]+HEX_CHARS[n>>16&15]+HEX_CHARS[n>>12&15]+HEX_CHARS[n>>8&15]+HEX_CHARS[n>>4&15]+HEX_CHARS[15&n]+HEX_CHARS[o>>28&15]+HEX_CHARS[o>>24&15]+HEX_CHARS[o>>20&15]+HEX_CHARS[o>>16&15]+HEX_CHARS[o>>12&15]+HEX_CHARS[o>>8&15]+HEX_CHARS[o>>4&15]+HEX_CHARS[15&o]+HEX_CHARS[i>>28&15]+HEX_CHARS[i>>24&15]+HEX_CHARS[i>>20&15]+HEX_CHARS[i>>16&15]+HEX_CHARS[i>>12&15]+HEX_CHARS[i>>8&15]+HEX_CHARS[i>>4&15]+HEX_CHARS[15&i]+HEX_CHARS[a>>28&15]+HEX_CHARS[a>>24&15]+HEX_CHARS[a>>20&15]+HEX_CHARS[a>>16&15]+HEX_CHARS[a>>12&15]+HEX_CHARS[a>>8&15]+HEX_CHARS[a>>4&15]+HEX_CHARS[15&a];return this.is224||(c+=HEX_CHARS[s>>28&15]+HEX_CHARS[s>>24&15]+HEX_CHARS[s>>20&15]+HEX_CHARS[s>>16&15]+HEX_CHARS[s>>12&15]+HEX_CHARS[s>>8&15]+HEX_CHARS[s>>4&15]+HEX_CHARS[15&s]),c},Sha256.prototype.toString=Sha256.prototype.hex,Sha256.prototype.digest=function(){this.finalize();var t=this.h0,e=this.h1,r=this.h2,n=this.h3,o=this.h4,i=this.h5,a=this.h6,s=this.h7,c=[t>>24&255,t>>16&255,t>>8&255,255&t,e>>24&255,e>>16&255,e>>8&255,255&e,r>>24&255,r>>16&255,r>>8&255,255&r,n>>24&255,n>>16&255,n>>8&255,255&n,o>>24&255,o>>16&255,o>>8&255,255&o,i>>24&255,i>>16&255,i>>8&255,255&i,a>>24&255,a>>16&255,a>>8&255,255&a];return this.is224||c.push(s>>24&255,s>>16&255,s>>8&255,255&s),c},Sha256.prototype.array=Sha256.prototype.digest,Sha256.prototype.arrayBuffer=function(){this.finalize();var t=new ArrayBuffer(this.is224?28:32),e=new DataView(t);return e.setUint32(0,this.h0),e.setUint32(4,this.h1),e.setUint32(8,this.h2),e.setUint32(12,this.h3),e.setUint32(16,this.h4),e.setUint32(20,this.h5),e.setUint32(24,this.h6),this.is224||e.setUint32(28,this.h7),t},HmacSha256.prototype=new Sha256,HmacSha256.prototype.finalize=function(){if(Sha256.prototype.finalize.call(this),this.inner){this.inner=!1;var t=this.array();Sha256.call(this,this.is224,this.sharedMemory),this.update(this.oKeyPad),this.update(t),Sha256.prototype.finalize.call(this)}};var exports=createMethod();exports.sha256=exports,exports.sha224=createMethod(!0),exports.sha256.hmac=createHmacMethod(),exports.sha224.hmac=createHmacMethod(!0),COMMON_JS?module.exports=exports:(root.sha256=exports.sha256,root.sha224=exports.sha224,AMD&&(__WEBPACK_AMD_DEFINE_RESULT__=function(){return exports}.call(exports,__webpack_require__,exports,module),void 0===__WEBPACK_AMD_DEFINE_RESULT__||(module.exports=__WEBPACK_AMD_DEFINE_RESULT__)))})()},666:t=>{var e=function(t){"use strict";var e,r=Object.prototype,n=r.hasOwnProperty,o="function"==typeof Symbol?Symbol:{},i=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",s=o.toStringTag||"@@toStringTag";function c(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{c({},"")}catch(t){c=function(t,e,r){return t[e]=r}}function u(t,e,r,n){var o=e&&e.prototype instanceof _?e:_,i=Object.create(o.prototype),a=new C(n||[]);return i._invoke=function(t,e,r){var n=f;return function(o,i){if(n===p)throw new Error("Generator is already running");if(n===y){if("throw"===o)throw i;return k()}for(r.method=o,r.arg=i;;){var a=r.delegate;if(a){var s=H(a,r);if(s){if(s===d)continue;return s}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(n===f)throw n=y,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n=p;var c=h(t,e,r);if("normal"===c.type){if(n=r.done?y:l,c.arg===d)continue;return{value:c.arg,done:r.done}}"throw"===c.type&&(n=y,r.method="throw",r.arg=c.arg)}}}(t,r,a),i}function h(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=u;var f="suspendedStart",l="suspendedYield",p="executing",y="completed",d={};function _(){}function v(){}function g(){}var b={};b[i]=function(){return this};var w=Object.getPrototypeOf,S=w&&w(w(x([])));S&&S!==r&&n.call(S,i)&&(b=S);var m=g.prototype=_.prototype=Object.create(b);function E(t){["next","throw","return"].forEach((function(e){c(t,e,(function(t){return this._invoke(e,t)}))}))}function A(t,e){function r(o,i,a,s){var c=h(t[o],t,i);if("throw"!==c.type){var u=c.arg,f=u.value;return f&&"object"==typeof f&&n.call(f,"__await")?e.resolve(f.__await).then((function(t){r("next",t,a,s)}),(function(t){r("throw",t,a,s)})):e.resolve(f).then((function(t){u.value=t,a(u)}),(function(t){return r("throw",t,a,s)}))}s(c.arg)}var o;this._invoke=function(t,n){function i(){return new e((function(e,o){r(t,n,e,o)}))}return o=o?o.then(i,i):i()}}function H(t,r){var n=t.iterator[r.method];if(n===e){if(r.delegate=null,"throw"===r.method){if(t.iterator.return&&(r.method="return",r.arg=e,H(t,r),"throw"===r.method))return d;r.method="throw",r.arg=new TypeError("The iterator does not provide a 'throw' method")}return d}var o=h(n,t.iterator,r.arg);if("throw"===o.type)return r.method="throw",r.arg=o.arg,r.delegate=null,d;var i=o.arg;return i?i.done?(r[t.resultName]=i.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,d):i:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,d)}function R(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function O(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function C(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(R,this),this.reset(!0)}function x(t){if(t){var r=t[i];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,a=function r(){for(;++o<t.length;)if(n.call(t,o))return r.value=t[o],r.done=!1,r;return r.value=e,r.done=!0,r};return a.next=a}}return{next:k}}function k(){return{value:e,done:!0}}return v.prototype=m.constructor=g,g.constructor=v,v.displayName=c(g,s,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===v||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,g):(t.__proto__=g,c(t,s,"GeneratorFunction")),t.prototype=Object.create(m),t},t.awrap=function(t){return{__await:t}},E(A.prototype),A.prototype[a]=function(){return this},t.AsyncIterator=A,t.async=function(e,r,n,o,i){void 0===i&&(i=Promise);var a=new A(u(e,r,n,o),i);return t.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},E(m),c(m,s,"Generator"),m[i]=function(){return this},m.toString=function(){return"[object Generator]"},t.keys=function(t){var e=[];for(var r in t)e.push(r);return e.reverse(),function r(){for(;e.length;){var n=e.pop();if(n in t)return r.value=n,r.done=!1,r}return r.done=!0,r}},t.values=x,C.prototype={constructor:C,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(O),!t)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=e)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var r=this;function o(n,o){return s.type="throw",s.arg=t,r.next=n,o&&(r.method="next",r.arg=e),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],s=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var c=n.call(a,"catchLoc"),u=n.call(a,"finallyLoc");if(c&&u){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(c){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,d):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),d},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),O(r),d}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;O(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:x(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),d}},t}(t.exports);try{regeneratorRuntime=e}catch(t){Function("r","regeneratorRuntime = r")(e)}}},__webpack_module_cache__={};function __webpack_require__(t){var e=__webpack_module_cache__[t];if(void 0!==e)return e.exports;var r=__webpack_module_cache__[t]={exports:{}};return __webpack_modules__[t](r,r.exports,__webpack_require__),r.exports}__webpack_require__.amdO={},__webpack_require__.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return __webpack_require__.d(e,{a:e}),e},__webpack_require__.d=(t,e)=>{for(var r in e)__webpack_require__.o(e,r)&&!__webpack_require__.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},__webpack_require__.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),__webpack_require__.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e);var __webpack_exports__=__webpack_require__(869)})();
|
|
2
|
+
(()=>{var __webpack_modules__={228:t=>{t.exports=function(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}},858:t=>{t.exports=function(t){if(Array.isArray(t))return t}},646:(t,e,r)=>{var n=r(228);t.exports=function(t){if(Array.isArray(t))return n(t)}},926:t=>{function e(t,e,r,n,o,i,a){try{var s=t[i](a),c=s.value}catch(t){return void r(t)}s.done?e(c):Promise.resolve(c).then(n,o)}t.exports=function(t){return function(){var r=this,n=arguments;return new Promise((function(o,i){var a=t.apply(r,n);function s(t){e(a,o,i,s,c,"next",t)}function c(t){e(a,o,i,s,c,"throw",t)}s(void 0)}))}}},575:t=>{t.exports=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}},913:t=>{function e(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}t.exports=function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}},713:t=>{t.exports=function(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}},860:t=>{t.exports=function(t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t))return Array.from(t)}},884:t=>{t.exports=function(t,e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t)){var r=[],n=!0,o=!1,i=void 0;try{for(var a,s=t[Symbol.iterator]();!(n=(a=s.next()).done)&&(r.push(a.value),!e||r.length!==e);n=!0);}catch(t){o=!0,i=t}finally{try{n||null==s.return||s.return()}finally{if(o)throw i}}return r}}},521:t=>{t.exports=function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}},206:t=>{t.exports=function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}},38:(t,e,r)=>{var n=r(858),o=r(884),i=r(379),a=r(521);t.exports=function(t,e){return n(t)||o(t,e)||i(t,e)||a()}},319:(t,e,r)=>{var n=r(646),o=r(860),i=r(379),a=r(206);t.exports=function(t){return n(t)||o(t)||i(t)||a()}},379:(t,e,r)=>{var n=r(228);t.exports=function(t,e){if(t){if("string"==typeof t)return n(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?n(t,e):void 0}}},757:(t,e,r)=>{t.exports=r(666)},869:(t,e,r)=>{"use strict";var n=r(575),o=r.n(n),i=r(913),a=r.n(i);function s(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}const c=function(){function t(e){if(o()(this,t),this.cmds=e,Array.isArray(this.cmds)){var r,n=function(t,e){var r;if("undefined"==typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(r=function(t,e){if(t){if("string"==typeof t)return s(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?s(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,c=!1;return{s:function(){r=t[Symbol.iterator]()},n:function(){var t=r.next();return a=t.done,t},e:function(t){c=!0,i=t},f:function(){try{a||null==r.return||r.return()}finally{if(c)throw i}}}}(this.cmds);try{for(n.s();!(r=n.n()).done;){var i=r.value;"function"==typeof i&&i()}}catch(t){n.e(t)}finally{n.f()}}}return a()(t,[{key:"push",value:function(t){t()}}]),t}();var u=r(757),h=r.n(u),f=r(926),l=r.n(f),p=r(713),y=r.n(p);function d(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function v(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?d(Object(r),!0).forEach((function(e){y()(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):d(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}var _={insecure:!1,cookies:!0};const g="v0.11.0";var b=r(38),w=r.n(b),S=r(319),m=r.n(S),A=function(){function t(e){o()(this,t),this.Config=e,y()(this,"passportKey",void 0),y()(this,"targetingV1Key",void 0),y()(this,"targetingKey",void 0);var r=btoa(function(t){for(var e=new Uint16Array(t.length),r=0;r<e.length;r++)e[r]=t.charCodeAt(r);return String.fromCharCode.apply(String,m()(new Uint8Array(e.buffer)))}("".concat(this.Config.host,"/").concat(this.Config.site)));this.targetingV1Key="OPTABLE_TGT_"+r,this.passportKey="OPTABLE_PASS_"+r,this.targetingKey="OPTABLE_V2_TGT_"+r}return a()(t,[{key:"getPassport",value:function(){return window.localStorage.getItem(this.passportKey)}},{key:"getV1Targeting",value:function(){var t=window.localStorage.getItem(this.targetingV1Key),e=t?JSON.parse(t):null;return e?{user:[],audience:Object.entries(e).map((function(t){var e,r=w()(t,2),n=r[0],o=r[1];return{provider:"optable.co",keyspace:n,rtb_segtax:5001,ids:(e=[]).concat.apply(e,[o]).map((function(t){return{id:String(t)}}))}}))}:null}},{key:"getTargeting",value:function(){var t=window.localStorage.getItem(this.targetingKey);return(t?JSON.parse(t):null)||this.getV1Targeting()}},{key:"setPassport",value:function(t){t&&t.length>0&&window.localStorage.setItem(this.passportKey,t)}},{key:"setTargeting",value:function(t){t&&window.localStorage.setItem(this.targetingKey,JSON.stringify(t))}},{key:"clearPassport",value:function(){window.localStorage.removeItem(this.passportKey)}},{key:"clearTargeting",value:function(){window.localStorage.removeItem(this.targetingKey)}}]),t}();function E(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function H(t,e,r){var n=function(t){return v(v({},_),t)}(e),o=n.site,i=n.host,a=n.insecure,s=n.cookies,c=a?"http":"https",u=new URL("".concat(o).concat(t),"".concat(c,"://").concat(i));if(s)u.search=new URLSearchParams({cookies:"yes",osdk:"web-".concat(g)}).toString();else{var h=new A(e).getPassport();u.search=new URLSearchParams({cookies:"no",passport:h||"",osdk:"web-".concat(g)}).toString()}var f=function(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?E(Object(r),!0).forEach((function(e){y()(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):E(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}({},r);return f.credentials="include",new Request(u.toString(),f)}function R(t,e,r){return O.apply(this,arguments)}function O(){return(O=l()(h().mark((function t(e,r,n){var o,i,a;return h().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,window.fetch(H(e,r,n));case 2:if(o=t.sent,!(null==(i=o.headers.get("Content-Type"))?void 0:i.startsWith("application/json"))){t.next=10;break}return t.next=7,o.json();case 7:t.t0=t.sent,t.next=13;break;case 10:return t.next=12,o.text();case 12:t.t0=t.sent;case 13:if(a=t.t0,o.ok){t.next=16;break}throw new Error(a.error);case 16:return a.passport&&(new A(r).setPassport(a.passport),delete a.passport),t.abrupt("return",a);case 18:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function k(t,e){return R("/identify",t,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})}function C(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function x(){return(x=l()(h().mark((function t(e){var r;return h().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,R("/v2/targeting",e,{method:"GET",headers:{"Content-Type":"application/json"}});case 2:return(r=t.sent)&&new A(e).setTargeting(r),t.abrupt("return",r);case 5:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function T(t){var e;return(null!==(e=null==t?void 0:t.audience)&&void 0!==e?e:[]).map((function(t){return{name:t.provider,segment:t.ids,ext:{segtax:t.rtb_segtax}}}))}function j(t){var e,r={};if(!t)return r;var n,o=function(t,e){var r;if("undefined"==typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(r=function(t,e){if(t){if("string"==typeof t)return C(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?C(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,s=!1;return{s:function(){r=t[Symbol.iterator]()},n:function(){var t=r.next();return a=t.done,t},e:function(t){s=!0,i=t},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw i}}}}(null!==(e=t.audience)&&void 0!==e?e:[]);try{for(o.s();!(n=o.n()).done;){var i,a=n.value;a.keyspace&&(a.keyspace in r||(r[a.keyspace]=[]),(i=r[a.keyspace]).push.apply(i,m()(a.ids.map((function(t){return t.id})))))}}catch(t){o.e(t)}finally{o.f()}return r}function I(t,e,r){var n={event:e,properties:r};return R("/witness",t,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(n)})}var X=r(23);const P=function(){function t(e){o()(this,t),this.dcn=e,y()(this,"sandbox",void 0),this.sandbox=e}var e,r;return a()(t,[{key:"identify",value:function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];return k(this.dcn,e.filter((function(t){return t})))}},{key:"targeting",value:function(){return function(t){return x.apply(this,arguments)}(this.dcn)}},{key:"targetingFromCache",value:function(){return t=this.dcn,new A(t).getTargeting();var t}},{key:"targetingClearCache",value:function(){var t;t=this.dcn,new A(t).clearTargeting()}},{key:"prebidUserData",value:(r=l()(h().mark((function t(){return h().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.t0=T,t.next=3,this.targeting();case 3:return t.t1=t.sent,t.abrupt("return",(0,t.t0)(t.t1));case 5:case"end":return t.stop()}}),t,this)}))),function(){return r.apply(this,arguments)})},{key:"prebidUserDataFromCache",value:function(){return T(this.targetingFromCache())}},{key:"targetingKeyValues",value:(e=l()(h().mark((function t(){return h().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.t0=j,t.next=3,this.targeting();case 3:return t.t1=t.sent,t.abrupt("return",(0,t.t0)(t.t1));case 5:case"end":return t.stop()}}),t,this)}))),function(){return e.apply(this,arguments)})},{key:"targetingKeyValuesFromCache",value:function(){return j(this.targetingFromCache())}},{key:"witness",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return I(this.dcn,t,e)}},{key:"profile",value:function(t){return function(t,e){var r={traits:e};return R("/profile",t,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(r)})}(this.dcn,t)}}],[{key:"eid",value:function(t){return t?"e:"+X.sha256.hex(t.toLowerCase().trim()):""}},{key:"cid",value:function(t){return t?"c:"+t.trim():""}},{key:"TargetingKeyValues",value:function(t){return j(t)}},{key:"PrebidUserData",value:function(t){return T(t)}}]),t}();function L(t){var e,r,n,o,i,a,s,c,u,h;return{advertiserId:null===(e=t.advertiserId)||void 0===e?void 0:e.toString(),campaignId:null===(r=t.campaignId)||void 0===r?void 0:r.toString(),creativeId:null===(n=t.creativeId)||void 0===n?void 0:n.toString(),isEmpty:null===(o=t.isEmpty)||void 0===o?void 0:o.toString(),lineItemId:null===(i=t.lineItemId)||void 0===i?void 0:i.toString(),serviceName:null===(a=t.serviceName)||void 0===a?void 0:a.toString(),size:null===(s=t.size)||void 0===s?void 0:s.toString(),slotElementId:null===(c=t.slot)||void 0===c?void 0:c.getSlotElementId(),sourceAgnosticCreativeId:null===(u=t.sourceAgnosticCreativeId)||void 0===u?void 0:u.toString(),sourceAgnosticLineItemId:null===(h=t.sourceAgnosticLineItemId)||void 0===h?void 0:h.toString()}}function U(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}P.prototype.installGPTEventListeners=function(){var t=this;t.installGPTEventListeners=function(){},window.googletag=window.googletag||{cmd:[]};var e=window.googletag;e.cmd.push((function(){e.pubads().addEventListener("slotRenderEnded",(function(e){t.witness("googletag.events.slotRenderEnded",L(e))})),e.pubads().addEventListener("impressionViewable",(function(e){t.witness("googletag.events.impressionViewable",L(e))}))}))},P.prototype.tryIdentifyFromParams=function(){var t,e=new URLSearchParams(window.location.search),r="",n=function(t,e){var r;if("undefined"==typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(r=function(t,e){if(t){if("string"==typeof t)return U(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?U(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,s=!1;return{s:function(){r=t[Symbol.iterator]()},n:function(){var t=r.next();return a=t.done,t},e:function(t){s=!0,i=t},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw i}}}}(e.keys());try{for(n.s();!(t=n.n()).done;){var o=t.value;if(o.match(/^oeid$/i)){r=e.get(o);break}}}catch(t){n.e(t)}finally{n.f()}(function(t){return null!==t.match(/^[a-f0-9]{64}$/i)})(r=r||"")&&this.identify("e:"+r.toLowerCase())},window.optable=window.optable||{},window.optable.SDK=P,window.optable.cmd=new c(window.optable.cmd||[])},23:(module,exports,__webpack_require__)=>{var __WEBPACK_AMD_DEFINE_RESULT__;(function(){"use strict";var ERROR="input is invalid type",WINDOW="object"==typeof window,root=WINDOW?window:{};root.JS_SHA256_NO_WINDOW&&(WINDOW=!1);var WEB_WORKER=!WINDOW&&"object"==typeof self,NODE_JS=!root.JS_SHA256_NO_NODE_JS&&"object"==typeof process&&process.versions&&process.versions.node;NODE_JS?root=__webpack_require__.g:WEB_WORKER&&(root=self);var COMMON_JS=!root.JS_SHA256_NO_COMMON_JS&&module.exports,AMD=__webpack_require__.amdO,ARRAY_BUFFER=!root.JS_SHA256_NO_ARRAY_BUFFER&&"undefined"!=typeof ArrayBuffer,HEX_CHARS="0123456789abcdef".split(""),EXTRA=[-2147483648,8388608,32768,128],SHIFT=[24,16,8,0],K=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],OUTPUT_TYPES=["hex","array","digest","arrayBuffer"],blocks=[];!root.JS_SHA256_NO_NODE_JS&&Array.isArray||(Array.isArray=function(t){return"[object Array]"===Object.prototype.toString.call(t)}),!ARRAY_BUFFER||!root.JS_SHA256_NO_ARRAY_BUFFER_IS_VIEW&&ArrayBuffer.isView||(ArrayBuffer.isView=function(t){return"object"==typeof t&&t.buffer&&t.buffer.constructor===ArrayBuffer});var createOutputMethod=function(t,e){return function(r){return new Sha256(e,!0).update(r)[t]()}},createMethod=function(t){var e=createOutputMethod("hex",t);NODE_JS&&(e=nodeWrap(e,t)),e.create=function(){return new Sha256(t)},e.update=function(t){return e.create().update(t)};for(var r=0;r<OUTPUT_TYPES.length;++r){var n=OUTPUT_TYPES[r];e[n]=createOutputMethod(n,t)}return e},nodeWrap=function(method,is224){var crypto=eval("require('crypto')"),Buffer=eval("require('buffer').Buffer"),algorithm=is224?"sha224":"sha256",nodeMethod=function(t){if("string"==typeof t)return crypto.createHash(algorithm).update(t,"utf8").digest("hex");if(null==t)throw new Error(ERROR);return t.constructor===ArrayBuffer&&(t=new Uint8Array(t)),Array.isArray(t)||ArrayBuffer.isView(t)||t.constructor===Buffer?crypto.createHash(algorithm).update(new Buffer(t)).digest("hex"):method(t)};return nodeMethod},createHmacOutputMethod=function(t,e){return function(r,n){return new HmacSha256(r,e,!0).update(n)[t]()}},createHmacMethod=function(t){var e=createHmacOutputMethod("hex",t);e.create=function(e){return new HmacSha256(e,t)},e.update=function(t,r){return e.create(t).update(r)};for(var r=0;r<OUTPUT_TYPES.length;++r){var n=OUTPUT_TYPES[r];e[n]=createHmacOutputMethod(n,t)}return e};function Sha256(t,e){e?(blocks[0]=blocks[16]=blocks[1]=blocks[2]=blocks[3]=blocks[4]=blocks[5]=blocks[6]=blocks[7]=blocks[8]=blocks[9]=blocks[10]=blocks[11]=blocks[12]=blocks[13]=blocks[14]=blocks[15]=0,this.blocks=blocks):this.blocks=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],t?(this.h0=3238371032,this.h1=914150663,this.h2=812702999,this.h3=4144912697,this.h4=4290775857,this.h5=1750603025,this.h6=1694076839,this.h7=3204075428):(this.h0=1779033703,this.h1=3144134277,this.h2=1013904242,this.h3=2773480762,this.h4=1359893119,this.h5=2600822924,this.h6=528734635,this.h7=1541459225),this.block=this.start=this.bytes=this.hBytes=0,this.finalized=this.hashed=!1,this.first=!0,this.is224=t}function HmacSha256(t,e,r){var n,o=typeof t;if("string"===o){var i,a=[],s=t.length,c=0;for(n=0;n<s;++n)(i=t.charCodeAt(n))<128?a[c++]=i:i<2048?(a[c++]=192|i>>6,a[c++]=128|63&i):i<55296||i>=57344?(a[c++]=224|i>>12,a[c++]=128|i>>6&63,a[c++]=128|63&i):(i=65536+((1023&i)<<10|1023&t.charCodeAt(++n)),a[c++]=240|i>>18,a[c++]=128|i>>12&63,a[c++]=128|i>>6&63,a[c++]=128|63&i);t=a}else{if("object"!==o)throw new Error(ERROR);if(null===t)throw new Error(ERROR);if(ARRAY_BUFFER&&t.constructor===ArrayBuffer)t=new Uint8Array(t);else if(!(Array.isArray(t)||ARRAY_BUFFER&&ArrayBuffer.isView(t)))throw new Error(ERROR)}t.length>64&&(t=new Sha256(e,!0).update(t).array());var u=[],h=[];for(n=0;n<64;++n){var f=t[n]||0;u[n]=92^f,h[n]=54^f}Sha256.call(this,e,r),this.update(h),this.oKeyPad=u,this.inner=!0,this.sharedMemory=r}Sha256.prototype.update=function(t){if(!this.finalized){var e,r=typeof t;if("string"!==r){if("object"!==r)throw new Error(ERROR);if(null===t)throw new Error(ERROR);if(ARRAY_BUFFER&&t.constructor===ArrayBuffer)t=new Uint8Array(t);else if(!(Array.isArray(t)||ARRAY_BUFFER&&ArrayBuffer.isView(t)))throw new Error(ERROR);e=!0}for(var n,o,i=0,a=t.length,s=this.blocks;i<a;){if(this.hashed&&(this.hashed=!1,s[0]=this.block,s[16]=s[1]=s[2]=s[3]=s[4]=s[5]=s[6]=s[7]=s[8]=s[9]=s[10]=s[11]=s[12]=s[13]=s[14]=s[15]=0),e)for(o=this.start;i<a&&o<64;++i)s[o>>2]|=t[i]<<SHIFT[3&o++];else for(o=this.start;i<a&&o<64;++i)(n=t.charCodeAt(i))<128?s[o>>2]|=n<<SHIFT[3&o++]:n<2048?(s[o>>2]|=(192|n>>6)<<SHIFT[3&o++],s[o>>2]|=(128|63&n)<<SHIFT[3&o++]):n<55296||n>=57344?(s[o>>2]|=(224|n>>12)<<SHIFT[3&o++],s[o>>2]|=(128|n>>6&63)<<SHIFT[3&o++],s[o>>2]|=(128|63&n)<<SHIFT[3&o++]):(n=65536+((1023&n)<<10|1023&t.charCodeAt(++i)),s[o>>2]|=(240|n>>18)<<SHIFT[3&o++],s[o>>2]|=(128|n>>12&63)<<SHIFT[3&o++],s[o>>2]|=(128|n>>6&63)<<SHIFT[3&o++],s[o>>2]|=(128|63&n)<<SHIFT[3&o++]);this.lastByteIndex=o,this.bytes+=o-this.start,o>=64?(this.block=s[16],this.start=o-64,this.hash(),this.hashed=!0):this.start=o}return this.bytes>4294967295&&(this.hBytes+=this.bytes/4294967296<<0,this.bytes=this.bytes%4294967296),this}},Sha256.prototype.finalize=function(){if(!this.finalized){this.finalized=!0;var t=this.blocks,e=this.lastByteIndex;t[16]=this.block,t[e>>2]|=EXTRA[3&e],this.block=t[16],e>=56&&(this.hashed||this.hash(),t[0]=this.block,t[16]=t[1]=t[2]=t[3]=t[4]=t[5]=t[6]=t[7]=t[8]=t[9]=t[10]=t[11]=t[12]=t[13]=t[14]=t[15]=0),t[14]=this.hBytes<<3|this.bytes>>>29,t[15]=this.bytes<<3,this.hash()}},Sha256.prototype.hash=function(){var t,e,r,n,o,i,a,s,c,u=this.h0,h=this.h1,f=this.h2,l=this.h3,p=this.h4,y=this.h5,d=this.h6,v=this.h7,_=this.blocks;for(t=16;t<64;++t)e=((o=_[t-15])>>>7|o<<25)^(o>>>18|o<<14)^o>>>3,r=((o=_[t-2])>>>17|o<<15)^(o>>>19|o<<13)^o>>>10,_[t]=_[t-16]+e+_[t-7]+r<<0;for(c=h&f,t=0;t<64;t+=4)this.first?(this.is224?(i=300032,v=(o=_[0]-1413257819)-150054599<<0,l=o+24177077<<0):(i=704751109,v=(o=_[0]-210244248)-1521486534<<0,l=o+143694565<<0),this.first=!1):(e=(u>>>2|u<<30)^(u>>>13|u<<19)^(u>>>22|u<<10),n=(i=u&h)^u&f^c,v=l+(o=v+(r=(p>>>6|p<<26)^(p>>>11|p<<21)^(p>>>25|p<<7))+(p&y^~p&d)+K[t]+_[t])<<0,l=o+(e+n)<<0),e=(l>>>2|l<<30)^(l>>>13|l<<19)^(l>>>22|l<<10),n=(a=l&u)^l&h^i,d=f+(o=d+(r=(v>>>6|v<<26)^(v>>>11|v<<21)^(v>>>25|v<<7))+(v&p^~v&y)+K[t+1]+_[t+1])<<0,e=((f=o+(e+n)<<0)>>>2|f<<30)^(f>>>13|f<<19)^(f>>>22|f<<10),n=(s=f&l)^f&u^a,y=h+(o=y+(r=(d>>>6|d<<26)^(d>>>11|d<<21)^(d>>>25|d<<7))+(d&v^~d&p)+K[t+2]+_[t+2])<<0,e=((h=o+(e+n)<<0)>>>2|h<<30)^(h>>>13|h<<19)^(h>>>22|h<<10),n=(c=h&f)^h&l^s,p=u+(o=p+(r=(y>>>6|y<<26)^(y>>>11|y<<21)^(y>>>25|y<<7))+(y&d^~y&v)+K[t+3]+_[t+3])<<0,u=o+(e+n)<<0;this.h0=this.h0+u<<0,this.h1=this.h1+h<<0,this.h2=this.h2+f<<0,this.h3=this.h3+l<<0,this.h4=this.h4+p<<0,this.h5=this.h5+y<<0,this.h6=this.h6+d<<0,this.h7=this.h7+v<<0},Sha256.prototype.hex=function(){this.finalize();var t=this.h0,e=this.h1,r=this.h2,n=this.h3,o=this.h4,i=this.h5,a=this.h6,s=this.h7,c=HEX_CHARS[t>>28&15]+HEX_CHARS[t>>24&15]+HEX_CHARS[t>>20&15]+HEX_CHARS[t>>16&15]+HEX_CHARS[t>>12&15]+HEX_CHARS[t>>8&15]+HEX_CHARS[t>>4&15]+HEX_CHARS[15&t]+HEX_CHARS[e>>28&15]+HEX_CHARS[e>>24&15]+HEX_CHARS[e>>20&15]+HEX_CHARS[e>>16&15]+HEX_CHARS[e>>12&15]+HEX_CHARS[e>>8&15]+HEX_CHARS[e>>4&15]+HEX_CHARS[15&e]+HEX_CHARS[r>>28&15]+HEX_CHARS[r>>24&15]+HEX_CHARS[r>>20&15]+HEX_CHARS[r>>16&15]+HEX_CHARS[r>>12&15]+HEX_CHARS[r>>8&15]+HEX_CHARS[r>>4&15]+HEX_CHARS[15&r]+HEX_CHARS[n>>28&15]+HEX_CHARS[n>>24&15]+HEX_CHARS[n>>20&15]+HEX_CHARS[n>>16&15]+HEX_CHARS[n>>12&15]+HEX_CHARS[n>>8&15]+HEX_CHARS[n>>4&15]+HEX_CHARS[15&n]+HEX_CHARS[o>>28&15]+HEX_CHARS[o>>24&15]+HEX_CHARS[o>>20&15]+HEX_CHARS[o>>16&15]+HEX_CHARS[o>>12&15]+HEX_CHARS[o>>8&15]+HEX_CHARS[o>>4&15]+HEX_CHARS[15&o]+HEX_CHARS[i>>28&15]+HEX_CHARS[i>>24&15]+HEX_CHARS[i>>20&15]+HEX_CHARS[i>>16&15]+HEX_CHARS[i>>12&15]+HEX_CHARS[i>>8&15]+HEX_CHARS[i>>4&15]+HEX_CHARS[15&i]+HEX_CHARS[a>>28&15]+HEX_CHARS[a>>24&15]+HEX_CHARS[a>>20&15]+HEX_CHARS[a>>16&15]+HEX_CHARS[a>>12&15]+HEX_CHARS[a>>8&15]+HEX_CHARS[a>>4&15]+HEX_CHARS[15&a];return this.is224||(c+=HEX_CHARS[s>>28&15]+HEX_CHARS[s>>24&15]+HEX_CHARS[s>>20&15]+HEX_CHARS[s>>16&15]+HEX_CHARS[s>>12&15]+HEX_CHARS[s>>8&15]+HEX_CHARS[s>>4&15]+HEX_CHARS[15&s]),c},Sha256.prototype.toString=Sha256.prototype.hex,Sha256.prototype.digest=function(){this.finalize();var t=this.h0,e=this.h1,r=this.h2,n=this.h3,o=this.h4,i=this.h5,a=this.h6,s=this.h7,c=[t>>24&255,t>>16&255,t>>8&255,255&t,e>>24&255,e>>16&255,e>>8&255,255&e,r>>24&255,r>>16&255,r>>8&255,255&r,n>>24&255,n>>16&255,n>>8&255,255&n,o>>24&255,o>>16&255,o>>8&255,255&o,i>>24&255,i>>16&255,i>>8&255,255&i,a>>24&255,a>>16&255,a>>8&255,255&a];return this.is224||c.push(s>>24&255,s>>16&255,s>>8&255,255&s),c},Sha256.prototype.array=Sha256.prototype.digest,Sha256.prototype.arrayBuffer=function(){this.finalize();var t=new ArrayBuffer(this.is224?28:32),e=new DataView(t);return e.setUint32(0,this.h0),e.setUint32(4,this.h1),e.setUint32(8,this.h2),e.setUint32(12,this.h3),e.setUint32(16,this.h4),e.setUint32(20,this.h5),e.setUint32(24,this.h6),this.is224||e.setUint32(28,this.h7),t},HmacSha256.prototype=new Sha256,HmacSha256.prototype.finalize=function(){if(Sha256.prototype.finalize.call(this),this.inner){this.inner=!1;var t=this.array();Sha256.call(this,this.is224,this.sharedMemory),this.update(this.oKeyPad),this.update(t),Sha256.prototype.finalize.call(this)}};var exports=createMethod();exports.sha256=exports,exports.sha224=createMethod(!0),exports.sha256.hmac=createHmacMethod(),exports.sha224.hmac=createHmacMethod(!0),COMMON_JS?module.exports=exports:(root.sha256=exports.sha256,root.sha224=exports.sha224,AMD&&(__WEBPACK_AMD_DEFINE_RESULT__=function(){return exports}.call(exports,__webpack_require__,exports,module),void 0===__WEBPACK_AMD_DEFINE_RESULT__||(module.exports=__WEBPACK_AMD_DEFINE_RESULT__)))})()},666:t=>{var e=function(t){"use strict";var e,r=Object.prototype,n=r.hasOwnProperty,o="function"==typeof Symbol?Symbol:{},i=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",s=o.toStringTag||"@@toStringTag";function c(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{c({},"")}catch(t){c=function(t,e,r){return t[e]=r}}function u(t,e,r,n){var o=e&&e.prototype instanceof v?e:v,i=Object.create(o.prototype),a=new k(n||[]);return i._invoke=function(t,e,r){var n=f;return function(o,i){if(n===p)throw new Error("Generator is already running");if(n===y){if("throw"===o)throw i;return x()}for(r.method=o,r.arg=i;;){var a=r.delegate;if(a){var s=H(a,r);if(s){if(s===d)continue;return s}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(n===f)throw n=y,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n=p;var c=h(t,e,r);if("normal"===c.type){if(n=r.done?y:l,c.arg===d)continue;return{value:c.arg,done:r.done}}"throw"===c.type&&(n=y,r.method="throw",r.arg=c.arg)}}}(t,r,a),i}function h(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=u;var f="suspendedStart",l="suspendedYield",p="executing",y="completed",d={};function v(){}function _(){}function g(){}var b={};b[i]=function(){return this};var w=Object.getPrototypeOf,S=w&&w(w(C([])));S&&S!==r&&n.call(S,i)&&(b=S);var m=g.prototype=v.prototype=Object.create(b);function A(t){["next","throw","return"].forEach((function(e){c(t,e,(function(t){return this._invoke(e,t)}))}))}function E(t,e){function r(o,i,a,s){var c=h(t[o],t,i);if("throw"!==c.type){var u=c.arg,f=u.value;return f&&"object"==typeof f&&n.call(f,"__await")?e.resolve(f.__await).then((function(t){r("next",t,a,s)}),(function(t){r("throw",t,a,s)})):e.resolve(f).then((function(t){u.value=t,a(u)}),(function(t){return r("throw",t,a,s)}))}s(c.arg)}var o;this._invoke=function(t,n){function i(){return new e((function(e,o){r(t,n,e,o)}))}return o=o?o.then(i,i):i()}}function H(t,r){var n=t.iterator[r.method];if(n===e){if(r.delegate=null,"throw"===r.method){if(t.iterator.return&&(r.method="return",r.arg=e,H(t,r),"throw"===r.method))return d;r.method="throw",r.arg=new TypeError("The iterator does not provide a 'throw' method")}return d}var o=h(n,t.iterator,r.arg);if("throw"===o.type)return r.method="throw",r.arg=o.arg,r.delegate=null,d;var i=o.arg;return i?i.done?(r[t.resultName]=i.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,d):i:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,d)}function R(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function O(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function k(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(R,this),this.reset(!0)}function C(t){if(t){var r=t[i];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,a=function r(){for(;++o<t.length;)if(n.call(t,o))return r.value=t[o],r.done=!1,r;return r.value=e,r.done=!0,r};return a.next=a}}return{next:x}}function x(){return{value:e,done:!0}}return _.prototype=m.constructor=g,g.constructor=_,_.displayName=c(g,s,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===_||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,g):(t.__proto__=g,c(t,s,"GeneratorFunction")),t.prototype=Object.create(m),t},t.awrap=function(t){return{__await:t}},A(E.prototype),E.prototype[a]=function(){return this},t.AsyncIterator=E,t.async=function(e,r,n,o,i){void 0===i&&(i=Promise);var a=new E(u(e,r,n,o),i);return t.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},A(m),c(m,s,"Generator"),m[i]=function(){return this},m.toString=function(){return"[object Generator]"},t.keys=function(t){var e=[];for(var r in t)e.push(r);return e.reverse(),function r(){for(;e.length;){var n=e.pop();if(n in t)return r.value=n,r.done=!1,r}return r.done=!0,r}},t.values=C,k.prototype={constructor:k,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(O),!t)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=e)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var r=this;function o(n,o){return s.type="throw",s.arg=t,r.next=n,o&&(r.method="next",r.arg=e),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],s=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var c=n.call(a,"catchLoc"),u=n.call(a,"finallyLoc");if(c&&u){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(c){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,d):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),d},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),O(r),d}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;O(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:C(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),d}},t}(t.exports);try{regeneratorRuntime=e}catch(t){Function("r","regeneratorRuntime = r")(e)}}},__webpack_module_cache__={};function __webpack_require__(t){var e=__webpack_module_cache__[t];if(void 0!==e)return e.exports;var r=__webpack_module_cache__[t]={exports:{}};return __webpack_modules__[t](r,r.exports,__webpack_require__),r.exports}__webpack_require__.amdO={},__webpack_require__.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return __webpack_require__.d(e,{a:e}),e},__webpack_require__.d=(t,e)=>{for(var r in e)__webpack_require__.o(e,r)&&!__webpack_require__.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},__webpack_require__.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),__webpack_require__.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e);var __webpack_exports__=__webpack_require__(869)})();
|
|
@@ -17,7 +17,7 @@ function toWitnessProperties(event) {
|
|
|
17
17
|
/*
|
|
18
18
|
* installGPTEventListeners() sets up event listeners on the Google Publisher Tag
|
|
19
19
|
* "slotRenderEnded" and "impressionViewable" page events, and calls witness()
|
|
20
|
-
* on the OptableSDK instance to send log data to a
|
|
20
|
+
* on the OptableSDK instance to send log data to a DCN.
|
|
21
21
|
*/
|
|
22
22
|
OptableSDK.prototype.installGPTEventListeners = function () {
|
|
23
23
|
// Next time we get called is a no-op:
|
package/lib/dist/build.json
CHANGED
package/lib/dist/core/network.js
CHANGED
|
@@ -8,7 +8,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
8
8
|
});
|
|
9
9
|
};
|
|
10
10
|
import { getConfig } from "../config";
|
|
11
|
-
import {
|
|
11
|
+
import { default as buildInfo } from "../build.json";
|
|
12
12
|
import { LocalStorage } from "./storage";
|
|
13
13
|
function buildRequest(path, config, init) {
|
|
14
14
|
const { site, host, insecure, cookies } = getConfig(config);
|
|
@@ -17,7 +17,7 @@ function buildRequest(path, config, init) {
|
|
|
17
17
|
if (cookies) {
|
|
18
18
|
url.search = new URLSearchParams({
|
|
19
19
|
cookies: "yes",
|
|
20
|
-
osdk: `web-${version}`,
|
|
20
|
+
osdk: `web-${buildInfo.version}`,
|
|
21
21
|
}).toString();
|
|
22
22
|
}
|
|
23
23
|
else {
|
|
@@ -26,7 +26,7 @@ function buildRequest(path, config, init) {
|
|
|
26
26
|
url.search = new URLSearchParams({
|
|
27
27
|
cookies: "no",
|
|
28
28
|
passport: pass ? pass : "",
|
|
29
|
-
osdk: `web-${version}`,
|
|
29
|
+
osdk: `web-${buildInfo.version}`,
|
|
30
30
|
}).toString();
|
|
31
31
|
}
|
|
32
32
|
const requestInit = Object.assign({}, init);
|
|
@@ -1,14 +1,16 @@
|
|
|
1
1
|
import type { OptableConfig } from "../config";
|
|
2
|
-
import type {
|
|
2
|
+
import type { TargetingResponse } from "../edge/targeting";
|
|
3
3
|
declare class LocalStorage {
|
|
4
4
|
private Config;
|
|
5
5
|
private passportKey;
|
|
6
|
+
private targetingV1Key;
|
|
6
7
|
private targetingKey;
|
|
7
8
|
constructor(Config: OptableConfig);
|
|
8
9
|
getPassport(): string | null;
|
|
9
|
-
|
|
10
|
+
getV1Targeting(): TargetingResponse | null;
|
|
11
|
+
getTargeting(): TargetingResponse | null;
|
|
10
12
|
setPassport(passport: string): void;
|
|
11
|
-
setTargeting(
|
|
13
|
+
setTargeting(targeting: TargetingResponse): void;
|
|
12
14
|
clearPassport(): void;
|
|
13
15
|
clearTargeting(): void;
|
|
14
16
|
}
|
package/lib/dist/core/storage.js
CHANGED
|
@@ -9,24 +9,50 @@ class LocalStorage {
|
|
|
9
9
|
constructor(Config) {
|
|
10
10
|
this.Config = Config;
|
|
11
11
|
const sfx = btoa(toBinary(`${this.Config.host}/${this.Config.site}`));
|
|
12
|
+
// Legacy targeting key
|
|
13
|
+
this.targetingV1Key = "OPTABLE_TGT_" + sfx;
|
|
12
14
|
this.passportKey = "OPTABLE_PASS_" + sfx;
|
|
13
|
-
this.targetingKey = "
|
|
15
|
+
this.targetingKey = "OPTABLE_V2_TGT_" + sfx;
|
|
14
16
|
}
|
|
15
17
|
getPassport() {
|
|
16
18
|
return window.localStorage.getItem(this.passportKey);
|
|
17
19
|
}
|
|
20
|
+
getV1Targeting() {
|
|
21
|
+
const raw = window.localStorage.getItem(this.targetingV1Key);
|
|
22
|
+
const parsed = raw ? JSON.parse(raw) : null;
|
|
23
|
+
if (!parsed) {
|
|
24
|
+
return null;
|
|
25
|
+
}
|
|
26
|
+
const audiences = Object.entries(parsed).map(([keyspace, values]) => {
|
|
27
|
+
return {
|
|
28
|
+
provider: "optable.co",
|
|
29
|
+
keyspace,
|
|
30
|
+
// 5001 is Optable Private Member Defined Audiences
|
|
31
|
+
// See: https://github.com/InteractiveAdvertisingBureau/openrtb/pull/81
|
|
32
|
+
//
|
|
33
|
+
// Starting v2 this is returned in the targeting payload directly
|
|
34
|
+
rtb_segtax: 5001,
|
|
35
|
+
ids: [].concat(...[values]).map((id) => ({ id: String(id) })),
|
|
36
|
+
};
|
|
37
|
+
});
|
|
38
|
+
return {
|
|
39
|
+
user: [],
|
|
40
|
+
audience: audiences,
|
|
41
|
+
};
|
|
42
|
+
}
|
|
18
43
|
getTargeting() {
|
|
19
|
-
const
|
|
20
|
-
|
|
44
|
+
const raw = window.localStorage.getItem(this.targetingKey);
|
|
45
|
+
const parsed = raw ? JSON.parse(raw) : null;
|
|
46
|
+
return parsed ? parsed : this.getV1Targeting();
|
|
21
47
|
}
|
|
22
48
|
setPassport(passport) {
|
|
23
49
|
if (passport && passport.length > 0) {
|
|
24
50
|
window.localStorage.setItem(this.passportKey, passport);
|
|
25
51
|
}
|
|
26
52
|
}
|
|
27
|
-
setTargeting(
|
|
28
|
-
if (
|
|
29
|
-
window.localStorage.setItem(this.targetingKey, JSON.stringify(
|
|
53
|
+
setTargeting(targeting) {
|
|
54
|
+
if (targeting) {
|
|
55
|
+
window.localStorage.setItem(this.targetingKey, JSON.stringify(targeting));
|
|
30
56
|
}
|
|
31
57
|
}
|
|
32
58
|
clearPassport() {
|
|
@@ -1,20 +1,38 @@
|
|
|
1
1
|
import type { OptableConfig } from "../config";
|
|
2
|
-
declare type
|
|
3
|
-
|
|
2
|
+
declare type Identifier = {
|
|
3
|
+
id: string;
|
|
4
|
+
};
|
|
5
|
+
declare type AudienceIdentifiers = {
|
|
6
|
+
ids: Identifier[];
|
|
7
|
+
provider: string;
|
|
8
|
+
rtb_segtax: number;
|
|
9
|
+
keyspace?: string;
|
|
10
|
+
};
|
|
11
|
+
declare type UserIdentifiers = {
|
|
12
|
+
ids: Identifier[];
|
|
13
|
+
provider: string;
|
|
14
|
+
};
|
|
15
|
+
declare type TargetingResponse = {
|
|
16
|
+
audience?: AudienceIdentifiers[];
|
|
17
|
+
user?: UserIdentifiers[];
|
|
4
18
|
};
|
|
5
|
-
declare function Targeting(config: OptableConfig): Promise<
|
|
6
|
-
declare function TargetingFromCache(config: OptableConfig):
|
|
19
|
+
declare function Targeting(config: OptableConfig): Promise<TargetingResponse>;
|
|
20
|
+
declare function TargetingFromCache(config: OptableConfig): TargetingResponse | null;
|
|
7
21
|
declare function TargetingClearCache(config: OptableConfig): void;
|
|
8
|
-
declare type PrebidUserSegment =
|
|
9
|
-
|
|
10
|
-
|
|
22
|
+
declare type PrebidUserSegment = Identifier;
|
|
23
|
+
declare type PrebidSegtax = {
|
|
24
|
+
segtax: number;
|
|
11
25
|
};
|
|
12
26
|
declare type PrebidUserSegmentProvider = {
|
|
13
|
-
id: string;
|
|
14
27
|
name: string;
|
|
28
|
+
ext: PrebidSegtax;
|
|
15
29
|
segment: PrebidUserSegment[];
|
|
16
30
|
};
|
|
17
31
|
declare type PrebidUserData = PrebidUserSegmentProvider[];
|
|
18
|
-
declare function
|
|
19
|
-
|
|
32
|
+
declare function PrebidUserData(tdata: TargetingResponse | null): PrebidUserData;
|
|
33
|
+
declare type TargetingKeyValues = {
|
|
34
|
+
[key: string]: string[];
|
|
35
|
+
};
|
|
36
|
+
declare function TargetingKeyValues(tdata: TargetingResponse | null): TargetingKeyValues;
|
|
37
|
+
export { Targeting, TargetingFromCache, TargetingClearCache, TargetingResponse, PrebidUserData, TargetingKeyValues, };
|
|
20
38
|
export default Targeting;
|
|
@@ -11,7 +11,7 @@ import { fetch } from "../core/network";
|
|
|
11
11
|
import { LocalStorage } from "../core/storage";
|
|
12
12
|
function Targeting(config) {
|
|
13
13
|
return __awaiter(this, void 0, void 0, function* () {
|
|
14
|
-
const response = yield fetch("/targeting", config, {
|
|
14
|
+
const response = yield fetch("/v2/targeting", config, {
|
|
15
15
|
method: "GET",
|
|
16
16
|
headers: {
|
|
17
17
|
"Content-Type": "application/json",
|
|
@@ -32,23 +32,41 @@ function TargetingClearCache(config) {
|
|
|
32
32
|
const ls = new LocalStorage(config);
|
|
33
33
|
ls.clearTargeting();
|
|
34
34
|
}
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
35
|
+
/*
|
|
36
|
+
* Prebid.js supports passing seller-defined audiences to compatible
|
|
37
|
+
* bidder adapters.
|
|
38
|
+
*
|
|
39
|
+
* We return the contents to be pushed to ortb2.user.data and passed to
|
|
40
|
+
* bidder adapters via setConfig(ortb2.user.data)... the caller is free
|
|
41
|
+
* to append additional objects before setting the final result.
|
|
42
|
+
*
|
|
43
|
+
* References:
|
|
44
|
+
* https://docs.prebid.org/features/firstPartyData.html#segments-and-taxonomy
|
|
45
|
+
* https://iabtechlab.com/wp-content/uploads/2021/03/IABTechLab_Taxonomy_and_Data_Transparency_Standards_to_Support_Seller-defined_Audience_and_Context_Signaling_2021-03.pdf
|
|
46
|
+
*/
|
|
47
|
+
function PrebidUserData(tdata) {
|
|
48
|
+
var _a;
|
|
49
|
+
return ((_a = tdata === null || tdata === void 0 ? void 0 : tdata.audience) !== null && _a !== void 0 ? _a : []).map((identifiers) => ({
|
|
50
|
+
name: identifiers.provider,
|
|
51
|
+
segment: identifiers.ids,
|
|
52
|
+
ext: { segtax: identifiers.rtb_segtax },
|
|
53
|
+
}));
|
|
54
|
+
}
|
|
55
|
+
function TargetingKeyValues(tdata) {
|
|
56
|
+
var _a;
|
|
57
|
+
const result = {};
|
|
58
|
+
if (!tdata) {
|
|
59
|
+
return result;
|
|
60
|
+
}
|
|
61
|
+
for (const identifiers of ((_a = tdata.audience) !== null && _a !== void 0 ? _a : [])) {
|
|
62
|
+
if (identifiers.keyspace) {
|
|
63
|
+
if (!(identifiers.keyspace in result)) {
|
|
64
|
+
result[identifiers.keyspace] = [];
|
|
65
|
+
}
|
|
66
|
+
result[identifiers.keyspace].push(...identifiers.ids.map((el) => el.id));
|
|
49
67
|
}
|
|
50
68
|
}
|
|
51
69
|
return result;
|
|
52
70
|
}
|
|
53
|
-
export { Targeting, TargetingFromCache, TargetingClearCache,
|
|
71
|
+
export { Targeting, TargetingFromCache, TargetingClearCache, PrebidUserData, TargetingKeyValues, };
|
|
54
72
|
export default Targeting;
|
package/lib/dist/sdk.d.ts
CHANGED
|
@@ -1,19 +1,25 @@
|
|
|
1
1
|
import type { OptableConfig } from "./config";
|
|
2
|
-
import { PrebidUserData, TargetingKeyValues } from "./edge/targeting";
|
|
3
2
|
import type { WitnessProperties } from "./edge/witness";
|
|
4
3
|
import type { ProfileTraits } from "./edge/profile";
|
|
4
|
+
import { TargetingKeyValues, PrebidUserData, TargetingResponse } from "./edge/targeting";
|
|
5
5
|
declare class OptableSDK {
|
|
6
|
+
dcn: OptableConfig;
|
|
6
7
|
sandbox: OptableConfig;
|
|
7
|
-
constructor(
|
|
8
|
+
constructor(dcn: OptableConfig);
|
|
8
9
|
identify(...ids: string[]): Promise<void>;
|
|
9
|
-
targeting(): Promise<
|
|
10
|
-
targetingFromCache():
|
|
10
|
+
targeting(): Promise<TargetingResponse>;
|
|
11
|
+
targetingFromCache(): TargetingResponse | null;
|
|
11
12
|
targetingClearCache(): void;
|
|
13
|
+
prebidUserData(): Promise<PrebidUserData>;
|
|
12
14
|
prebidUserDataFromCache(): PrebidUserData;
|
|
15
|
+
targetingKeyValues(): Promise<TargetingKeyValues>;
|
|
16
|
+
targetingKeyValuesFromCache(): TargetingKeyValues;
|
|
13
17
|
witness(event: string, properties?: WitnessProperties): Promise<void>;
|
|
14
18
|
profile(traits: ProfileTraits): Promise<void>;
|
|
15
19
|
static eid(email: string): string;
|
|
16
20
|
static cid(ppid: string): string;
|
|
21
|
+
static TargetingKeyValues(tdata: TargetingResponse): TargetingKeyValues;
|
|
22
|
+
static PrebidUserData(tdata: TargetingResponse): PrebidUserData;
|
|
17
23
|
}
|
|
18
24
|
export { OptableSDK };
|
|
19
25
|
export type { OptableConfig };
|
package/lib/dist/sdk.js
CHANGED
|
@@ -1,33 +1,57 @@
|
|
|
1
|
-
|
|
1
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
+
});
|
|
9
|
+
};
|
|
2
10
|
import { Identify } from "./edge/identify";
|
|
3
|
-
import { Targeting, TargetingFromCache, TargetingClearCache } from "./edge/targeting";
|
|
11
|
+
import { TargetingKeyValues, PrebidUserData, Targeting, TargetingFromCache, TargetingClearCache } from "./edge/targeting";
|
|
4
12
|
import { Witness } from "./edge/witness";
|
|
5
13
|
import { Profile } from "./edge/profile";
|
|
6
14
|
import { sha256 } from "js-sha256";
|
|
7
15
|
class OptableSDK {
|
|
8
|
-
constructor(
|
|
9
|
-
this.
|
|
16
|
+
constructor(dcn) {
|
|
17
|
+
this.dcn = dcn;
|
|
18
|
+
this.sandbox = dcn; // legacy
|
|
10
19
|
}
|
|
11
20
|
identify(...ids) {
|
|
12
|
-
return Identify(this.
|
|
21
|
+
return Identify(this.dcn, ids.filter((id) => id));
|
|
13
22
|
}
|
|
14
23
|
targeting() {
|
|
15
|
-
return Targeting(this.
|
|
24
|
+
return Targeting(this.dcn);
|
|
16
25
|
}
|
|
17
26
|
targetingFromCache() {
|
|
18
|
-
return TargetingFromCache(this.
|
|
27
|
+
return TargetingFromCache(this.dcn);
|
|
19
28
|
}
|
|
20
29
|
targetingClearCache() {
|
|
21
|
-
TargetingClearCache(this.
|
|
30
|
+
TargetingClearCache(this.dcn);
|
|
31
|
+
}
|
|
32
|
+
prebidUserData() {
|
|
33
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
34
|
+
return PrebidUserData(yield this.targeting());
|
|
35
|
+
});
|
|
22
36
|
}
|
|
23
37
|
prebidUserDataFromCache() {
|
|
24
|
-
|
|
38
|
+
const tdata = this.targetingFromCache();
|
|
39
|
+
return PrebidUserData(tdata);
|
|
40
|
+
}
|
|
41
|
+
targetingKeyValues() {
|
|
42
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
43
|
+
return TargetingKeyValues(yield this.targeting());
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
targetingKeyValuesFromCache() {
|
|
47
|
+
const tdata = this.targetingFromCache();
|
|
48
|
+
return TargetingKeyValues(tdata);
|
|
25
49
|
}
|
|
26
50
|
witness(event, properties = {}) {
|
|
27
|
-
return Witness(this.
|
|
51
|
+
return Witness(this.dcn, event, properties);
|
|
28
52
|
}
|
|
29
53
|
profile(traits) {
|
|
30
|
-
return Profile(this.
|
|
54
|
+
return Profile(this.dcn, traits);
|
|
31
55
|
}
|
|
32
56
|
static eid(email) {
|
|
33
57
|
return email ? "e:" + sha256.hex(email.toLowerCase().trim()) : "";
|
|
@@ -35,6 +59,12 @@ class OptableSDK {
|
|
|
35
59
|
static cid(ppid) {
|
|
36
60
|
return ppid ? "c:" + ppid.trim() : "";
|
|
37
61
|
}
|
|
62
|
+
static TargetingKeyValues(tdata) {
|
|
63
|
+
return TargetingKeyValues(tdata);
|
|
64
|
+
}
|
|
65
|
+
static PrebidUserData(tdata) {
|
|
66
|
+
return PrebidUserData(tdata);
|
|
67
|
+
}
|
|
38
68
|
}
|
|
39
69
|
export { OptableSDK };
|
|
40
70
|
export default OptableSDK;
|
package/package.json
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
"repository": "https://github.com/optable/optable-web-sdk",
|
|
7
7
|
"homepage": "https://optable.co",
|
|
8
8
|
"license": "SEE LICENSE IN LICENSE",
|
|
9
|
-
"version": "v0.
|
|
9
|
+
"version": "v0.11.0",
|
|
10
10
|
"devDependencies": {
|
|
11
11
|
"@babel/core": "^7.12.3",
|
|
12
12
|
"@babel/plugin-proposal-class-properties": "^7.12.1",
|