<commit_before>import { registerBidder } from '../src/adapters/bidderFactory.js';
import { BANNER, VIDEO } from '../src/mediaTypes.js';
import { deepAccess, isFn, isStr, isNumber, isArray, isEmpty, isPlainObject, generateUUID, logInfo, logWarn } from '../src/utils.js';
import { config } from '../src/config.js';
import { Renderer } from '../src/Renderer.js';

const INTEGRATION_METHOD = 'prebid.js';
const BIDDER_CODE = 'yahoossp';
const GVLID = 25;
const ADAPTER_VERSION = '1.0.2';
const PREBID_VERSION = '$prebid.version$';
const DEFAULT_BID_TTL = 300;
const TEST_MODE_DCN = '8a969516017a7a396ec539d97f540011';
const TEST_MODE_PUBID_DCN = '1234567';
const TEST_MODE_BANNER_POS = '8a969978017a7aaabab4ab0bc01a0009';
const TEST_MODE_VIDEO_POS = '8a96958a017a7a57ac375d50c0c700cc';
const DEFAULT_RENDERER_TIMEOUT = 700;
const DEFAULT_CURRENCY = 'USD';
const SSP_ENDPOINT_DCN_POS = 'https://c2shb.pubgw.yahoo.com/bidRequest';
const SSP_ENDPOINT_PUBID = 'https://c2shb.pubgw.yahoo.com/admax/bid/partners/PBJS';
const SUPPORTED_USER_ID_SOURCES = [
  'admixer.net',
  'adserver.org',
  'adtelligent.com',
  'akamai.com',
  'amxrtb.com',
  'audigent.com',
  'britepool.com',
  'criteo.com',
  'crwdcntrl.net',
  'deepintent.com',
  'hcn.health',
  'id5-sync.com',
  'idx.lat',
  'intentiq.com',
  'intimatemerger.com',
  'liveintent.com',
  'liveramp.com',
  'mediawallahscript.com',
  'merkleinc.com',
  'netid.de',
  'neustar.biz',
  'nextroll.com',
  'novatiq.com',
  'parrable.com',
  'pubcid.org',
  'quantcast.com',
  'quantcast.com',
  'tapad.com',
  'uidapi.com',
  'verizonmedia.com',
  'yahoo.com',
  'zeotap.com'
];

/* Utility functions */
function hasPurpose1Consent(bidderRequest) {
  if (bidderRequest && bidderRequest.gdprConsent) {
    if (bidderRequest.gdprConsent.gdprApplies && bidderRequest.gdprConsent.apiVersion === 2) {
      return !!false;
    }
  }
  return true;
}

function getSize(size) {
  return {
    w: parseInt(size[0]),
    h: parseInt(size[1])
  }
}

function transformSizes(sizes) {
  if (isArray(sizes) && sizes.length === 2 && !isArray(sizes[0])) {
    return [ getSize(sizes) ];
  }
  return sizes.map(getSize);
}

function extractUserSyncUrls(syncOptions, pixels) {<commit_msg>fix: Add back in correct logic for purpose 1 consent check (#8007)<commit_after>import { registerBidder } from '../src/adapters/bidderFactory.js';
import { BANNER, VIDEO } from '../src/mediaTypes.js';
import { deepAccess, isFn, isStr, isNumber, isArray, isEmpty, isPlainObject, generateUUID, logInfo, logWarn } from '../src/utils.js';
import { config } from '../src/config.js';
import { Renderer } from '../src/Renderer.js';

const INTEGRATION_METHOD = 'prebid.js';
const BIDDER_CODE = 'yahoossp';
const GVLID = 25;
const ADAPTER_VERSION = '1.0.2';
const PREBID_VERSION = '$prebid.version$';
const DEFAULT_BID_TTL = 300;
const TEST_MODE_DCN = '8a969516017a7a396ec539d97f540011';
const TEST_MODE_PUBID_DCN = '1234567';
const TEST_MODE_BANNER_POS = '8a969978017a7aaabab4ab0bc01a0009';
const TEST_MODE_VIDEO_POS = '8a96958a017a7a57ac375d50c0c700cc';
const DEFAULT_RENDERER_TIMEOUT = 700;
const DEFAULT_CURRENCY = 'USD';
const SSP_ENDPOINT_DCN_POS = 'https://c2shb.pubgw.yahoo.com/bidRequest';
const SSP_ENDPOINT_PUBID = 'https://c2shb.pubgw.yahoo.com/admax/bid/partners/PBJS';
const SUPPORTED_USER_ID_SOURCES = [
  'admixer.net',
  'adserver.org',
  'adtelligent.com',
  'akamai.com',
  'amxrtb.com',
  'audigent.com',
  'britepool.com',
  'criteo.com',
  'crwdcntrl.net',
  'deepintent.com',
  'hcn.health',
  'id5-sync.com',
  'idx.lat',
  'intentiq.com',
  'intimatemerger.com',
  'liveintent.com',
  'liveramp.com',
  'mediawallahscript.com',
  'merkleinc.com',
  'netid.de',
  'neustar.biz',
  'nextroll.com',
  'novatiq.com',
  'parrable.com',
  'pubcid.org',
  'quantcast.com',
  'quantcast.com',
  'tapad.com',
  'uidapi.com',
  'ver<EMAIL>',
  'yahoo.com',
  'zeotap.com'
];

/* Utility functions */
function hasPurpose1Consent(bidderRequest) {
  if (bidderRequest && bidderRequest.gdprConsent) {
    if (bidderRequest.gdprConsent.gdprApplies && bidderRequest.gdprConsent.apiVersion === 2) {
      return deepAccess(bidderRequest.gdprConsent, 'vendorData.purpose.consents.1') === true;
    }
  }
  return true;
}

function getSize(size) {
  return {
    w: parseInt(size[0]),
    h: parseInt(size[1])
  }
}

function transformSizes(sizes) {
  if (isArray(sizes) && sizes.length === 2 && !isArray(sizes[0])) {
    return [ getSize(sizes) ];
  }
  return sizes.map(getSize);
}

function extractUserSyncUrls(syncOptions, pixels) {
{'fraction_non_alphanumeric': 0.15900593798108642, 'fraction_numerical': 0.04178579283043765, 'mean_word_length': 4.685, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 4, 'https://': 4, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5369657', 'n_tokens_mistral': 1963, 'n_tokens_neox': 1855, 'n_words': 297}