1(() => { var _a,_b,_c,_d,_e,_f,_g,_h,_i,_j,_k,_l,_m,_n,_o,_p,_q,_r,_s,_t,_u,_v,__freeze=Object.freeze,__defProp=Object.defineProperty,__template=(t,e)=>__freeze(__defProp(t,"raw",{value:__freeze(e||t.slice())}));!function(){"use strict";function t(t,e){for(var i=0;i<e.length;i++){const s=e[i];if("string"!=typeof s&&!Array.isArray(s))for(const e in s)if("default"!==e&&!(e in t)){const i=Object.getOwnPropertyDescriptor(s,e);i&&Object.defineProperty(t,e,i.get?i:{enumerable:!0,get:()=>s[e]})}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}const e="https://news.google.com",i="1.0.109",s="https://news.google.com/swg/js/v1";var n=(t=>(t.ENABLE_PUBLICATION_ID_SUFFIX_FOR_STORAGE_KEY="enable-pub-id-suffix-for-storage-key",t))(n||{}),r=(t=>(t.BACKGROUND_CLICK_BEHAVIOR_EXPERIMENT="background_click_behavior_experiment",t.DISMISSIBILITY_CTA_FILTER_EXPERIMENT="dismissibility_cta_filter_experiment",t.INLINE_CTA_EXPERIMENT="inline_cta_experiment",t.STANDARD_REWARDED_AD_EXPERIMENT="standard_rewarded_ad_experiment",t.MULTI_INSTANCE_CTA_EXPERIMENT="multi_instance_cta_experiment",t))(r||{}),o=(t=>(t[t.UNKNOWN=0]="UNKNOWN",t[t.IMPRESSION_PAYWALL=1]="IMPRESSION_PAYWALL",t[t.IMPRESSION_AD=2]="IMPRESSION_AD",t[t.IMPRESSION_OFFERS=3]="IMPRESSION_OFFERS",t[t.IMPRESSION_SUBSCRIBE_BUTTON=4]="IMPRESSION_SUBSCRIBE_BUTTON",t[t.IMPRESSION_SMARTBOX=5]="IMPRESSION_SMARTBOX",t[t.IMPRESSION_SWG_BUTTON=6]="IMPRESSION_SWG_BUTTON",t[t.IMPRESSION_CLICK_TO_SHOW_OFFERS=7]="IMPRESSION_CLICK_TO_SHOW_OFFERS",t[t.IMPRESSION_CLICK_TO_SHOW_OFFERS_OR_ALREADY_SUBSCRIBED=8]="IMPRESSION_CLICK_TO_SHOW_OFFERS_OR_ALREADY_SUBSCRIBED",t[t.IMPRESSION_SUBSCRIPTION_COMPLETE=9]="IMPRESSION_SUBSCRIPTION_COMPLETE",t[t.IMPRESSION_ACCOUNT_CHANGED=10]="IMPRESSION_ACCOUNT_CHANGED",t[t.IMPRESSION_PAGE_LOAD=11]="IMPRESSION_PAGE_LOAD",t[t.IMPRESSION_LINK=12]="IMPRESSION_LINK",t[t.IMPRESSION_SAVE_SUBSCR_TO_GOOGLE=13]="IMPRESSION_SAVE_SUBSCR_TO_GOOGLE",t[t.IMPRESSION_GOOGLE_UPDATED=14]="IMPRESSION_GOOGLE_UPDATED",t[t.IMPRESSION_SHOW_OFFERS_SMARTBOX=15]="IMPRESSION_SHOW_OFFERS_SMARTBOX",t[t.IMPRESSION_SHOW_OFFERS_SWG_BUTTON=16]="IMPRESSION_SHOW_OFFERS_SWG_BUTTON",t[t.IMPRESSION_SELECT_OFFER_SMARTBOX=17]="IMPRESSION_SELECT_OFFER_SMARTBOX",t[t.IMPRESSION_SELECT_OFFER_SWG_BUTTON=18]="IMPRESSION_SELECT_OFFER_SWG_BUTTON",t[t.IMPRESSION_SHOW_CONTRIBUTIONS_SWG_BUTTON=19]="IMPRESSION_SHOW_CONTRIBUTIONS_SWG_BUTTON",t[t.IMPRESSION_SELECT_CONTRIBUTION_SWG_BUTTON=20]="IMPRESSION_SELECT_CONTRIBUTION_SWG_BUTTON",t[t.IMPRESSION_METER_TOAST=21]="IMPRESSION_METER_TOAST",t[t.IMPRESSION_REGWALL=22]="IMPRESSION_REGWALL",t[t.IMPRESSION_SHOWCASE_REGWALL=23]="IMPRESSION_SHOWCASE_REGWALL",t[t.IMPRESSION_SWG_SUBSCRIPTION_MINI_PROMPT=24]="IMPRESSION_SWG_SUBSCRIPTION_MINI_PROMPT",t[t.IMPRESSION_SWG_CONTRIBUTION_MINI_PROMPT=25]="IMPRESSION_SWG_CONTRIBUTION_MINI_PROMPT",t[t.IMPRESSION_CONTRIBUTION_OFFERS=26]="IMPRESSION_CONTRIBUTION_OFFERS",t[t.IMPRESSION_TWG_COUNTER=27]="IMPRESSION_TWG_COUNTER",t[t.IMPRESSION_TWG_SITE_SUPPORTER_WALL=28]="IMPRESSION_TWG_SITE_SUPPORTER_WALL",t[t.IMPRESSION_TWG_PUBLICATION=29]="IMPRESSION_TWG_PUBLICATION",t[t.IMPRESSION_TWG_STATIC_BUTTON=30]="IMPRESSION_TWG_STATIC_BUTTON",t[t.IMPRESSION_TWG_DYNAMIC_BUTTON=31]="IMPRESSION_TWG_DYNAMIC_BUTTON",t[t.IMPRESSION_TWG_STICKER_SELECTION_SCREEN=32]="IMPRESSION_TWG_STICKER_SELECTION_SCREEN",t[t.IMPRESSION_TWG_PUBLICATION_NOT_SET_UP=33]="IMPRESSION_TWG_PUBLICATION_NOT_SET_UP",t[t.IMPRESSION_REGWALL_OPT_IN=34]="IMPRESSION_REGWALL_OPT_IN",t[t.IMPRESSION_NEWSLETTER_OPT_IN=35]="IMPRESSION_NEWSLETTER_OPT_IN",t[t.IMPRESSION_SUBSCRIPTION_OFFERS_ERROR=36]="IMPRESSION_SUBSCRIPTION_OFFERS_ERROR",t[t.IMPRESSION_CONTRIBUTION_OFFERS_ERROR=37]="IMPRESSION_CONTRIBUTION_OFFERS_ERROR",t[t.IMPRESSION_TWG_SHORTENED_STICKER_FLOW=38]="IMPRESSION_TWG_SHORTENED_STICKER_FLOW",t[t.IMPRESSION_SUBSCRIPTION_LINKING_LOADING=39]="IMPRESSION_SUBSCRIPTION_LINKING_LOADING",t[t.IMPRESSION_SUBSCRIPTION_LINKING_COMPLETE=40]="IMPRESSION_SUBSCRIPTION_LINKING_COMPLETE",t[t.IMPRESSION_SUBSCRIPTION_LINKING_ERROR=41]="IMPRESSION_SUBSCRIPTION_LINKING_ERROR",t[t.IMPRESSION_SURVEY=42]="IMPRESSION_SURVEY",t[t.IMPRESSION_REGWALL_ERROR=43]="IMPRESSION_REGWALL_ERROR",t[t.IMPRESSION_NEWSLETTER_ERROR=44]="IMPRESSION_NEWSLETTER_ERROR",t[t.IMPRESSION_SURVEY_ERROR=45]="IMPRESSION_SURVEY_ERROR",t[t.IMPRESSION_METER_TOAST_ERROR=46]="IMPRESSION_METER_TOAST_ERROR",t[t.IMPRESSION_MINI_PROMPT=47]="IMPRESSION_MINI_PROMPT",t[t.IMPRESSION_MINI_PROMPT_ERROR=48]="IMPRESSION_MINI_PROMPT_ERROR",t[t.IMPRESSION_REWARDED_AD=49]="IMPRESSION_REWARDED_AD",t[t.IMPRESSION_BYOP_NEWSLETTER_OPT_IN=50]="IMPRESSION_BYOP_NEWSLETTER_OPT_IN",t[t.IMPRESSION_REWARDED_AD_ERROR=51]="IMPRESSION_REWARDED_AD_ERROR",t[t.IMPRESSION_HOSTED_PAGE_SUBSCRIPTION_OFFERS=52]="IMPRESSION_HOSTED_PAGE_SUBSCRIPTION_OFFERS",t[t.IMPRESSION_HOSTED_PAGE_CONTRIBUTION_OFFERS=53]="IMPRESSION_HOSTED_PAGE_CONTRIBUTION_OFFERS",t[t.IMPRESSION_HOSTED_PAGE_SUBSCRIPTION_OFFERS_ERROR=54]="IMPRESSION_HOSTED_PAGE_SUBSCRIPTION_OFFERS_ERROR",t[t.IMPRESSION_HOSTED_PAGE_CONTRIBUTION_OFFERS_ERROR=55]="IMPRESSION_HOSTED_PAGE_CONTRIBUTION_OFFERS_ERROR",t[t.IMPRESSION_BYO_CTA=56]="IMPRESSION_BYO_CTA",t[t.IMPRESSION_BYO_CTA_ERROR=57]="IMPRESSION_BYO_CTA_ERROR",t[t.ACTION_SUBSCRIBE=1e3]="ACTION_SUBSCRIBE",t[t.ACTION_PAYMENT_COMPLETE=1001]="ACTION_PAYMENT_COMPLETE",t[t.ACTION_ACCOUNT_CREATED=1002]="ACTION_ACCOUNT_CREATED",t[t.ACTION_ACCOUNT_ACKNOWLEDGED=1003]="ACTION_ACCOUNT_ACKNOWLEDGED",t[t.ACTION_SUBSCRIPTIONS_LANDING_PAGE=1004]="ACTION_SUBSCRIPTIONS_LANDING_PAGE",t[t.ACTION_PAYMENT_FLOW_STARTED=1005]="ACTION_PAYMENT_FLOW_STARTED",t[t.ACTION_PAY_PAYMENT_FLOW_STARTED=1090]="A
1CTION_PAY_PAYMENT_FLOW_STARTED",t[t.ACTION_PLAY_PAYMENT_FLOW_STARTED=1091]="ACTION_PLAY_PAYMENT_FLOW_STARTED",t[t.ACTION_OFFER_SELECTED=1006]="ACTION_OFFER_SELECTED",t[t.ACTION_SWG_BUTTON_CLICK=1007]="ACTION_SWG_BUTTON_CLICK",t[t.ACTION_VIEW_OFFERS=1008]="ACTION_VIEW_OFFERS",t[t.ACTION_ALREADY_SUBSCRIBED=1009]="ACTION_ALREADY_SUBSCRIBED",t[t.ACTION_NEW_DEFERRED_ACCOUNT=1010]="ACTION_NEW_DEFERRED_ACCOUNT",t[t.ACTION_LINK_CONTINUE=1011]="ACTION_LINK_CONTINUE",t[t.ACTION_LINK_CANCEL=1012]="ACTION_LINK_CANCEL",t[t.ACTION_GOOGLE_UPDATED_CLOSE=1013]="ACTION_GOOGLE_UPDATED_CLOSE",t[t.ACTION_USER_CANCELED_PAYFLOW=1014]="ACTION_USER_CANCELED_PAYFLOW",t[t.ACTION_SAVE_SUBSCR_TO_GOOGLE_CONTINUE=1015]="ACTION_SAVE_SUBSCR_TO_GOOGLE_CONTINUE",t[t.ACTION_SAVE_SUBSCR_TO_GOOGLE_CANCEL=1016]="ACTION_SAVE_SUBSCR_TO_GOOGLE_CANCEL",t[t.ACTION_SWG_BUTTON_SHOW_OFFERS_CLICK=1017]="ACTION_SWG_BUTTON_SHOW_OFFERS_CLICK",t[t.ACTION_SWG_BUTTON_SELECT_OFFER_CLICK=1018]="ACTION_SWG_BUTTON_SELECT_OFFER_CLICK",t[t.ACTION_SWG_BUTTON_SHOW_CONTRIBUTIONS_CLICK=1019]="ACTION_SWG_BUTTON_SHOW_CONTRIBUTIONS_CLICK",t[t.ACTION_SWG_BUTTON_SELECT_CONTRIBUTION_CLICK=1020]="ACTION_SWG_BUTTON_SELECT_CONTRIBUTION_CLICK",t[t.ACTION_USER_CONSENT_DEFERRED_ACCOUNT=1021]="ACTION_USER_CONSENT_DEFERRED_ACCOUNT",t[t.ACTION_USER_DENY_DEFERRED_ACCOUNT=1022]="ACTION_USER_DENY_DEFERRED_ACCOUNT",t[t.ACTION_DEFERRED_ACCOUNT_REDIRECT=1023]="ACTION_DEFERRED_ACCOUNT_REDIRECT",t[t.ACTION_GET_ENTITLEMENTS=1024]="ACTION_GET_ENTITLEMENTS",t[t.ACTION_METER_TOAST_SUBSCRIBE_CLICK=1025]="ACTION_METER_TOAST_SUBSCRIBE_CLICK",t[t.ACTION_METER_TOAST_EXPANDED=1026]="ACTION_METER_TOAST_EXPANDED",t[t.ACTION_METER_TOAST_CLOSED_BY_ARTICLE_INTERACTION=1027]="ACTION_METER_TOAST_CLOSED_BY_ARTICLE_INTERACTION",t[t.ACTION_METER_TOAST_CLOSED_BY_SWIPE_DOWN=1028]="ACTION_METER_TOAST_CLOSED_BY_SWIPE_DOWN",t[t.ACTION_METER_TOAST_CLOSED_BY_X_CLICKED=1029]="ACTION_METER_TOAST_CLOSED_BY_X_CLICKED",t[t.ACTION_SWG_SUBSCRIPTION_MINI_PROMPT_CLICK=1030]="ACTION_SWG_SUBSCRIPTION_MINI_PROMPT_CLICK",t[t.ACTION_SWG_CONTRIBUTION_MINI_PROMPT_CLICK=1031]="ACTION_SWG_CONTRIBUTION_MINI_PROMPT_CLICK",t[t.ACTION_SWG_SUBSCRIPTION_MINI_PROMPT_CLOSE=1032]="ACTION_SWG_SUBSCRIPTION_MINI_PROMPT_CLOSE",t[t.ACTION_SWG_CONTRIBUTION_MINI_PROMPT_CLOSE=1033]="ACTION_SWG_CONTRIBUTION_MINI_PROMPT_CLOSE",t[t.ACTION_CONTRIBUTION_OFFER_SELECTED=1034]="ACTION_CONTRIBUTION_OFFER_SELECTED",t[t.ACTION_SHOWCASE_REGWALL_GSI_CLICK=1035]="ACTION_SHOWCASE_REGWALL_GSI_CLICK",t[t.ACTION_SHOWCASE_REGWALL_EXISTING_ACCOUNT_CLICK=1036]="ACTION_SHOWCASE_REGWALL_EXISTING_ACCOUNT_CLICK",t[t.ACTION_SUBSCRIPTION_OFFERS_CLOSED=1037]="ACTION_SUBSCRIPTION_OFFERS_CLOSED",t[t.ACTION_CONTRIBUTION_OFFERS_CLOSED=1038]="ACTION_CONTRIBUTION_OFFERS_CLOSED",t[t.ACTION_TWG_STATIC_CTA_CLICK=1039]="ACTION_TWG_STATIC_CTA_CLICK",t[t.ACTION_TWG_DYNAMIC_CTA_CLICK=1040]="ACTION_TWG_DYNAMIC_CTA_CLICK",t[t.ACTION_TWG_SITE_LEVEL_SUPPORTER_WALL_CTA_CLICK=1041]="ACTION_TWG_SITE_LEVEL_SUPPORTER_WALL_CTA_CLICK",t[t.ACTION_TWG_DIALOG_SUPPORTER_WALL_CTA_CLICK=1042]="ACTION_TWG_DIALOG_SUPPORTER_WALL_CTA_CLICK",t[t.ACTION_TWG_COUNTER_CLICK=1043]="ACTION_TWG_COUNTER_CLICK",t[t.ACTION_TWG_SITE_SUPPORTER_WALL_ALL_THANKS_CLICK=1044]="ACTION_TWG_SITE_SUPPORTER_WALL_ALL_THANKS_CLICK",t[t.ACTION_TWG_PAID_STICKER_SELECTED_SCREEN_CLOSE_CLICK=1045]="ACTION_TWG_PAID_STICKER_SELECTED_SCREEN_CLOSE_CLICK",t[t.ACTION_TWG_PAID_STICKER_SELECTION_CLICK=1046]="ACTION_TWG_PAID_STICKER_SELECTION_CLICK",t[t.ACTION_TWG_FREE_STICKER_SELECTION_CLICK=1047]="ACTION_TWG_FREE_STICKER_SELECTION_CLICK",t[t.ACTION_TWG_MINI_SUPPORTER_WALL_CLICK=1048]="ACTION_TWG_MINI_SUPPORTER_WALL_CLICK",t[t.ACTION_TWG_CREATOR_BENEFIT_CLICK=1049]="ACTION_TWG_CREATOR_BENEFIT_CLICK",t[t.ACTION_TWG_FREE_TRANSACTION_START_NEXT_BUTTON_CLICK=1050]="ACTION_TWG_FREE_TRANSACTION_START_NEXT_BUTTON_CLICK",t[t.ACTION_TWG_PAID_TRANSACTION_START_NEXT_BUTTON_CLICK=1051]="ACTION_TWG_PAID_TRANSACTION_START_NEXT_BUTTON_CLICK",t[t.ACTION_TWG_STICKER_SELECTION_SCREEN_CLOSE_CLICK=1052]="ACTION_TWG_STICKER_SELECTION_SCREEN_CLOSE_CLICK",t[t.ACTION_TWG_ARTICLE_LEVEL_SUPPORTER_WALL_CTA_CLICK=1053]="ACTION_TWG_ARTICLE_LEVEL_SUPPORTER_WALL_CTA_CLICK",t[t.ACTION_REGWALL_OPT_IN_BUTTON_CLICK=1054]="ACTION_REGWALL_OPT_IN_BUTTON_CLICK",t[t.ACTION_REGWALL_ALREADY_OPTED_IN_CLICK=1055]="ACTION_REGWALL_ALREADY_OPTED_IN_CLICK",t[t.ACTION_NEWSLETTER_OPT_IN_BUTTON_CLICK=1056]="ACTION_NEWSLETTER_OPT_IN_BUTTON_CLICK",t[t.ACTION_NEWSLETTER_ALREADY_OPTED_IN_CLICK=1057]="A
1CTION_NEWSLETTER_ALREADY_OPTED_IN_CLICK",t[t.ACTION_REGWALL_OPT_IN_CLOSE=1058]="ACTION_REGWALL_OPT_IN_CLOSE",t[t.ACTION_NEWSLETTER_OPT_IN_CLOSE=1059]="ACTION_NEWSLETTER_OPT_IN_CLOSE",t[t.ACTION_SHOWCASE_REGWALL_SIWG_CLICK=1060]="ACTION_SHOWCASE_REGWALL_SIWG_CLICK",t[t.ACTION_TWG_CHROME_APP_MENU_ENTRY_POINT_CLICK=1061]="ACTION_TWG_CHROME_APP_MENU_ENTRY_POINT_CLICK",t[t.ACTION_TWG_DISCOVER_FEED_MENU_ENTRY_POINT_CLICK=1062]="ACTION_TWG_DISCOVER_FEED_MENU_ENTRY_POINT_CLICK",t[t.ACTION_SHOWCASE_REGWALL_3P_BUTTON_CLICK=1063]="ACTION_SHOWCASE_REGWALL_3P_BUTTON_CLICK",t[t.ACTION_SUBSCRIPTION_OFFERS_RETRY=1064]="ACTION_SUBSCRIPTION_OFFERS_RETRY",t[t.ACTION_CONTRIBUTION_OFFERS_RETRY=1065]="ACTION_CONTRIBUTION_OFFERS_RETRY",t[t.ACTION_TWG_SHORTENED_STICKER_FLOW_STICKER_SELECTION_CLICK=1066]="ACTION_TWG_SHORTENED_STICKER_FLOW_STICKER_SELECTION_CLICK",t[t.ACTION_INITIATE_UPDATED_SUBSCRIPTION_LINKING=1067]="ACTION_INITIATE_UPDATED_SUBSCRIPTION_LINKING",t[t.ACTION_SURVEY_SUBMIT_CLICK=1068]="ACTION_SURVEY_SUBMIT_CLICK",t[t.ACTION_SURVEY_CLOSED=1069]="ACTION_SURVEY_CLOSED",t[t.ACTION_SURVEY_DATA_TRANSFER=1070]="ACTION_SURVEY_DATA_TRANSFER",t[t.ACTION_REGWALL_PAGE_REFRESH=1071]="ACTION_REGWALL_PAGE_REFRESH",t[t.ACTION_NEWSLETTER_PAGE_REFRESH=1072]="ACTION_NEWSLETTER_PAGE_REFRESH",t[t.ACTION_SURVEY_PAGE_REFRESH=1073]="ACTION_SURVEY_PAGE_REFRESH",t[t.ACTION_METER_TOAST_PAGE_REFRESH=1074]="ACTION_METER_TOAST_PAGE_REFRESH",t[t.ACTION_MINI_PROMPT_INTERACTION=1075]="ACTION_MINI_PROMPT_INTERACTION",t[t.ACTION_SURVEY_PREVIOUS_BUTTON_CLICK=1076]="ACTION_SURVEY_PREVIOUS_BUTTON_CLICK",t[t.ACTION_SURVEY_NEXT_BUTTON_CLICK=1077]="ACTION_SURVEY_NEXT_BUTTON_CLICK",t[t.ACTION_REWARDED_AD_VIEW=1078]="ACTION_REWARDED_AD_VIEW",t[t.ACTION_REWARDED_AD_CLOSE=1079]="ACTION_REWARDED_AD_CLOSE",t[t.ACTION_REWARDED_AD_CLOSE_AD=1080]="ACTION_REWARDED_AD_CLOSE_AD",t[t.ACTION_REWARDED_AD_SIGN_IN=1081]="ACTION_REWARDED_AD_SIGN_IN",t[t.ACTION_REWARDED_AD_SUPPORT=1082]="ACTION_REWARDED_AD_SUPPORT",t[t.ACTION_BACK_TO_HOMEPAGE=1083]="ACTION_BACK_TO_HOMEPAGE",t[t.ACTION_BYOP_NEWSLETTER_OPT_IN_CLOSE=1084]="ACTION_BYOP_NEWSLETTER_OPT_IN_CLOSE",t[t.ACTION_BYOP_NEWSLETTER_OPT_IN_SUBMIT=1085]="ACTION_BYOP_NEWSLETTER_OPT_IN_SUBMIT",t[t.ACTION_SUBSCRIPTION_LINKING_CLOSE=1086]="ACTION_SUBSCRIPTION_LINKING_CLOSE",t[t.ACTION_BYO_CTA_CLOSE=1087]="ACTION_BYO_CTA_CLOSE",t[t.ACTION_BYO_CTA_BUTTON_CLICK=1088]="ACTION_BYO_CTA_BUTTON_CLICK",t[t.ACTION_BYO_CTA_PAGE_REFRESH=1089]="ACTION_BYO_CTA_PAGE_REFRESH",t[t.EVENT_PAYMENT_FAILED=2e3]="EVENT_PAYMENT_FAILED",t[t.EVENT_REGWALL_OPT_IN_FAILED=2001]="EVENT_REGWALL_OPT_IN_FAILED",t[t.EVENT_NEWSLETTER_OPT_IN_FAILED=2002]="EVENT_NEWSLETTER_OPT_IN_FAILED",t[t.EVENT_REGWALL_ALREADY_OPT_IN=2003]="EVENT_REGWALL_ALREADY_OPT_IN",t[t.EVENT_NEWSLETTER_ALREADY_OPT_IN=2004]="EVENT_NEWSLETTER_ALREADY_OPT_IN",t[t.EVENT_SUBSCRIPTION_LINKING_FAILED=2005]="EVENT_SUBSCRIPTION_LINKING_FAILED",t[t.EVENT_SURVEY_ALREADY_SUBMITTED=2006]="EVENT_SURVEY_ALREADY_SUBMITTED",t[t.EVENT_SURVEY_COMPLETION_RECORD_FAILED=2007]="EVENT_SURVEY_COMPLETION_RECORD_FAILED",t[t.EVENT_SURVEY_DATA_TRANSFER_FAILED=2008]="EVENT_SURVEY_DATA_TRANSFER_FAILED",t[t.EVENT_BYO_CTA_COMPLETION_RECORD_FAILED=2009]="EVENT_BYO_CTA_COMPLETION_RECORD_FAILED",t[t.EVENT_CUSTOM=3e3]="EVENT_CUSTOM",t[t.EVENT_CONFIRM_TX_ID=3001]="EVENT_CONFIRM_TX_ID",t[t.EVENT_CHANGED_TX_ID=3002]="EVENT_CHANGED_TX_ID",t[t.EVENT_GPAY_NO_TX_ID=3003]="EVENT_GPAY_NO_TX_ID",t[t.EVENT_GPAY_CANNOT_CONFIRM_TX_ID=3004]="EVENT_GPAY_CANNOT_CONFIRM_TX_ID",t[t.EVENT_GOOGLE_UPDATED=3005]="EVENT_GOOGLE_UPDATED",t[t.EVENT_NEW_TX_ID=3006]="EVENT_NEW_TX_ID",t[t.EVENT_UNLOCKED_BY_SUBSCRIPTION=3007]="EVENT_UNLOCKED_BY_SUBSCRIPTION",t[t.EVENT_UNLOCKED_BY_METER=3008]="EVENT_UNLOCKED_BY_METER",t[t.EVENT_NO_ENTITLEMENTS=3009]="EVENT_NO_ENTITLEMENTS",t[t.EVENT_HAS_METERING_ENTITLEMENTS=3010]="EVENT_HAS_METERING_ENTITLEMENTS",t[t.EVENT_OFFERED_METER=3011]="EVENT_OFFERED_METER",t[t.EVENT_UNLOCKED_FREE_PAGE=3012]="EVENT_UNLOCKED_FREE_PAGE",t[t.EVENT_INELIGIBLE_PAYWALL=3013]="EVENT_INELIGIBLE_PAYWALL",t[t.EVENT_UNLOCKED_FOR_CRAWLER=3014]="EVENT_UNLOCKED_FOR_CRAWLER",t[t.EVENT_TWG_COUNTER_VIEW=3015]="EVENT_TWG_COUNTER_VIEW",t[t.EVENT_TWG_SITE_SUPPORTER_WALL_VIEW=3016]="EVENT_TWG_SITE_SUPPORTER_WALL_VIEW",t[t.EVENT_TWG_STATIC_BUTTON_VIEW=3017]="EVENT_TWG_STATIC_BUTTON_VIEW",t[t.EVENT_TWG_DYNAMIC_BUTTON_VIEW=3018]="EVENT_TWG_DYNAMIC_BUTTON_VIEW",t[t.EVENT_TWG_PRE_TRANSACTION_PRIVACY_SETTING_PRIVATE=3019]="EVENT_TWG_PRE_TRANSACTION_PRIVACY_SETTING_PRIVATE",t[t.EVENT_TWG_POST_TRANSACTION_SETTING_PRIVATE=3020]="EVENT_TWG_POST_TRANSACTION_SETTING_PRIVATE",t[t.EVENT_TWG_PRE_TRANSACTION_PRIVACY_SETTING_PUBLIC=3021]="EVENT_TWG_PRE_TRANSACTION_PRIVACY_SETTING_PUBLIC",t[t.EVENT_TWG_POST_TRANSACTION_SETTING_PUBLIC=3022]="EVENT_TWG_POST_TRANSACTION_SETTING_PUBLIC",t[t.EVENT_REGWALL_OPTED_IN=3023]="EVENT_REGWALL_OPTED_IN",t[t.EVENT_NEWSLETTER_OPTED_IN=3024]="EVENT_NEWSLETTER_OPTED_IN",t[t.EVENT_SHOWCASE_METERING_INIT=3025]="EVENT_SHOWCASE_METERING_INIT",t[t.EVENT_DISABLE_MINIPROMPT_DESKTOP=3026]="EVENT_DISABLE_MINIPROMPT_DESKTOP",t[t.EVENT_SUBSCRIPTION_LINKING_SUCCESS=3027]="EVENT_SUBSCRIPTION_LINKING_SUCCESS",t[t.EVENT_SURVEY_SUBMITTED=3028]="EVENT_SURVEY_SUBMITTED",t[t.EVENT_LINK_ACCOUNT_SUCCESS=3029]="EVENT_LINK_ACCOUNT_SUCCESS",t[t.EVENT_SAVE_SUBSCRIPTION_SUCCESS=3030]="EVENT_SAVE_SUBSCRIPTION_SUCCESS",t[t.EVENT_SURVEY_DATA_TRANSFER_COMPLETE=3031]="EVENT_SURVEY_DATA_TRANSFER_COMPLETE",t[t.EVENT_RUNTIME_IS_READY=3032]="EVENT_RUNTIME_IS_READY",t[t.EVENT_START_API=3033]="EVENT_START_API",t[t.EVENT_SHOW_OFFERS_API=3034]="EVENT_SHOW_OFFERS_API",t[t.EVENT_SHOW_CONTRIBUTION_OPTIONS_API=3035]="EVENT_SHOW_CONTRIBUTION_OPTIONS_API",t[t.EVENT_REWARDED_AD_FLOW_INIT=3048]="EVENT_REWARDED_AD_FLOW_INIT",t[t.EVENT_REWARDED_AD_READY=3036]="EVENT_REWARDED_AD_READY",t[t.EVENT_REWARDED_AD_GPT_MISSING_ERROR=3037]="EVENT_REWARDED_AD_GPT_MISSING_ERROR",t[t.EVENT_REWARDED_AD_CONFIG_ERROR=3038]="EVENT_REWARDED_AD_CONFIG_ERROR",t[t.EVENT_REWARDED_AD_PAGE_ERROR=3039]="EVENT_REWARDED_AD_PAGE_ERROR",t[t.EVENT_REWARDED_AD_GPT_ERROR=3040]="EVENT_REWARDED_AD_GPT_ERROR",t[t.EVENT_REWARDED_AD_GRANTED=3041]="EVENT_REWARDED_AD_GRANTED",t[t.EVENT_REWARDED_AD_NOT_FILLED=3049]="EVENT_REWARDED_AD_NOT_FILLED",t[t.EVENT_GLOBAL_FREQUENCY_CAP_MET=3042]="EVENT_GLOBAL_FREQUENCY_CAP_MET",t[t.EVENT_PROMPT_FREQUENCY_CAP_MET=3043]="EVENT_PROMPT_FREQUENCY_CAP_MET",t[t.EVENT_ACTION_IMPRESSIONS_STORAGE_KEY_NOT_FOUND_ERROR=3044]="EVENT_ACTION_IMPRESSIONS_STORAGE_KEY_NOT_FOUND_ERROR",t[t.EVENT_LOCAL_STORAGE_TIMESTAMPS_PARSING_ERROR=3052]="EVENT_LOCAL_STORAGE_TIMESTAMPS_PARSING_ERROR",t[t.EVENT_FREQUENCY_CAP_CONFIG_NOT_FOUND_ERROR=3045]="EVENT_FREQUENCY_CAP_CONFIG_NOT_FOUND_ERROR",t[t.EVENT_PROMPT_FREQUENCY_CONFIG_NOT_FOUND=3053]="EVENT_PROMPT_FREQUENCY_CONFIG_NOT_FOUND",t[t.EVENT_FREQUENCY_CAP_LOCAL_STORAGE_CONFIG_ID_KEY_NOT_FOUND=3057]="EVENT_FREQUENCY_CAP_LOCAL_STORAGE_CONFIG_ID_KEY_NOT_FOUND",t[t.EVENT_BYOP_NEWSLETTER_OPT_IN_CONFIG_ERROR=3046]="EVENT_BYOP_NEWSLETTER_OPT_IN_CONFIG_ERROR",t[t.EVENT_BYOP_NEWSLETTER_OPT_IN_CODE_SNIPPET_ERROR=3047]="EVENT_BYOP_NEWSLETTER_OPT_IN_CODE_SNIPPET_ERROR",t[t.EVENT_SUBSCRIPTION_PAYMENT_COMPLETE=3050]="EVENT_SUBSCRIPTION_PAYMENT_COMPLETE",t[t.EVENT_CONTRIBUTION_PAYMENT_COMPLETE=3051]="EVENT_CONTRIBUTION_PAYMENT_COMPLETE",t[t.EVENT_PAY_PAYMENT_COMPLETE=3058]="EVENT_PAY_PAYMENT_COMPLETE",t[t.EVENT_HOSTED_PAGE_SUBSCRIPTION_PAYMENT_COMPLETE=3054]="EVENT_HOSTED_PAGE_SUBSCRIPTION_PAYMENT_COMPLETE",t[t.EVENT_HOSTED_PAGE_CONTRIBUTION_PAYMENT_COMPLETE=3055]="EVENT_HOSTED_PAGE_CONTRIBUTION_PAYMENT_COMPLETE",t[t.EVENT_COMPLETION_COUNT_FOR_REPEATABLE_ACTION_MISSING_ERROR=3056]="EVENT_COMPLETION_COUNT_FOR_REPEATABLE_ACTION_MISSING_ERROR",t[t.EVENT_SUBSCRIPTION_STATE=4e3]="EVENT_SUBSCRIPTION_STATE",t))(o||{}),a=(t=>(t[t.UNKNOWN_ENTITLEMENT_RESULT=0]="UNKNOWN_ENTITLEMENT_RESULT",t[t.UNLOCKED_SUBSCRIBER=1001]="UNLOCKED_SUBSCRIBER",t[t.UNLOCKED_FREE=1002]="UNLOCKED_FREE",t[t.UNLOCKED_METER=1003]="UNLOCKED_METER",t[t.LOCKED_REGWALL=2001]="LOCKED_REGWALL",t[t.LOCKED_PAYWALL=2002]="LOCKED_PAYWALL",t[t.INELIGIBLE_PAYWALL=2003]="INELIGIBLE_PAYWALL",t))(a||{}),h=(t=>(t[t.UNKNOWN_ENTITLEMENT_SOURCE=0]="UNKNOWN_ENTITLEMENT_SOURCE",t[t.GOOGLE_SUBSCRIBER_ENTITLEMENT=1001]="GOOGLE_SUBSCRIBER_ENTITLEMENT",t[t.GOOGLE_SHOWCASE_METERING_SERVICE=2001]="GOOGLE_SHOWCASE_METERING_SERVICE",t[t.SUBSCRIBE_WITH_GOOGLE_METERING_SERVICE=2002]="SUBSCRIBE_WITH_GOOGLE_METERING_SERVICE",t[t.PUBLISHER_ENTITLEMENT=3001]="P
1UBLISHER_ENTITLEMENT",t))(h||{}),l=(t=>(t[t.UNKNOWN_CLIENT=0]="UNKNOWN_CLIENT",t[t.SWG_CLIENT=1]="SWG_CLIENT",t[t.AMP_CLIENT=2]="AMP_CLIENT",t[t.PROPENSITY_CLIENT=3]="PROPENSITY_CLIENT",t[t.SWG_SERVER=4]="SWG_SERVER",t[t.PUBLISHER_CLIENT=5]="PUBLISHER_CLIENT",t[t.SHOWCASE_CLIENT=6]="SHOWCASE_CLIENT",t))(l||{});class u{constructor(t=[],e=!0){const i=e?1:0;this.t=null==t[i]?null:t[i]}getComplete(){return this.t}setComplete(t){this.t=t}toArray(t=!0){const e=[this.t];return t&&e.unshift(this.label()),e}label(){return"AccountCreationRequest"}}class c{constructor(t=[],e=!0){const i=e?1:0;this.o=null==t[i]?null:t[i],this.h=null==t[1+i]?null:t[1+i]}getSubscriberOrMember(){return this.o}setSubscriberOrMember(t){this.o=t}getLinkRequested(){return this.h}setLinkRequested(t){this.h=t}toArray(t=!0){const e=[this.o,this.h];return t&&e.unshift(this.label()),e}label(){return"AlreadySubscribedResponse"}}class d{constructor(t=[],e=!0){const i=e?1:0;this.l=null==t[i]?null:t[i],this.u=null==t[1+i]?null:t[1+i],this.p=null==t[2+i]?null:t[2+i],this.m=null==t[3+i]?null:t[3+i],this._=null==t[4+i]?null:t[4+i],this.T=null==t[5+i]?null:t[5+i],this.I=null==t[6+i]?null:t[6+i],this.S=null==t[7+i]?null:t[7+i],this.C=t[8+i]||[],this.O=null==t[9+i]?null:t[9+i],this.N=null==t[10+i]?null:t[10+i],this.A=null==t[11+i]?null:new j(t[11+i],e),this.v=null==t[12+i]?null:t[12+i],this.R=null==t[13+i]?null:t[13+i],this.P=null==t[14+i]?null:new j(t[14+i],e),this.L=null==t[15+i]?null:new w(t[15+i],e),this.M=null==t[16+i]?null:new j(t[16+i],e),this.k=null==t[17+i]?null:t[17+i],this.D=null==t[18+i]?null:t[18+i]}getEmbedderOrigin(){return this.l}setEmbedderOrigin(t){this.l=t}getTransactionId(){return this.u}setTransactionId(t){this.u=t}getReferringOrigin(){return this.p}setReferringOrigin(t){this.p=t}getUtmSource(){return this.m}setUtmSource(t){this.m=t}getUtmCampaign(){return this._}setUtmCampaign(t){this._=t}getUtmMedium(){return this.T}setUtmMedium(t){this.T=t}getSku(){return this.I}setSku(t){this.I=t}getReadyToPay(){return this.S}setReadyToPay(t){this.S=t}getLabelList(){return this.C}setLabelList(t){this.C=t}getClientVersion(){return this.O}setClientVersion(t){this.O=t}getUrl(){return this.N}setUrl(t){this.N=t}getClientTimestamp(){return this.A}setClientTimestamp(t){this.A=t}getReaderSurfaceType(){return this.v}setReaderSurfaceType(t){this.v=t}getIntegrationVersion(){return this.R}setIntegrationVersion(t){this.R=t}getPageLoadBeginTimestamp(){return this.P}setPageLoadBeginTimestamp(t){this.P=t}getLoadEventStartDelay(){return this.L}setLoadEventStartDelay(t){this.L=t}getRuntimeCreationTimestamp(){return this.M}setRuntimeCreationTimestamp(t){this.M=t}getIsLockedContent(){return this.k}setIsLockedContent(t){this.k=t}getUrlFromMarkup(){return this.D}setUrlFromMarkup(t){this.D=t}toArray(t=!0){const e=[this.l,this.u,this.p,this.m,this._,this.T,this.I,this.S,this.C,this.O,this.N,this.A?this.A.toArray(t):[],this.v,this.R,this.P?this.P.toArray(t):[],this.L?this.L.toArray(t):[],this.M?this.M.toArray(t):[],this.k,this.D];return t&&e.unshift(this.label()),e}label(){return"AnalyticsContext"}}class p{constructor(t=[],e=!0){const i=e?1:0;this.U=null==t[i]?null:t[i],this.G=null==t[1+i]?null:t[1+i],this.j=null==t[2+i]?null:t[2+i]}getEventOriginator(){return this.U}setEventOriginator(t){this.U=t}getIsFromUserAction(){return this.G}setIsFromUserAction(t){this.G=t}getConfigurationId(){return this.j}setConfigurationId(t){this.j=t}toArray(t=!0){const e=[this.U,this.G,this.j];return t&&e.unshift(this.label()),e}label(){return"AnalyticsEventMeta"}}class g{constructor(t=[],e=!0){const i=e?1:0;this.F=null==t[i]?null:new d(t[i],e),this.B=null==t[1+i]?null:t[1+i],this.W=null==t[2+i]?null:new p(t[2+i],e),this.V=null==t[3+i]?null:new I(t[3+i],e)}getContext(){return this.F}setContext(t){this.F=t}getEvent(){return this.B}setEvent(t){this.B=t}getMeta(){return this.W}setMeta(t){this.W=t}getParams(){return this.V}setParams(t){this.V=t}toArray(t=!0){const e=[this.F?this.F.toArray(t):[],this.B,this.W?this.W.toArray(t):[],this.V?this.V.toArray(t):[]];return t&&e.unshift(this.label()),e}label(){return"AnalyticsRequest"}}class m{constructor(t=[],e=!0){const i=e?1:0;this.B=null==t[i]?null:t[i]}getEvent(){return this.B}setEvent(t){this.B=t}toArray(t=!0){const e=[this.B];return t&&e.unshift(this.label()),e}label(){return"AudienceActivityClientLogsRequest"}}class _{constructor(t=[],e=!0){const i=e?1:0;this.Y=null==t[i]?null:t[i]}getUnused(){return this.Y}setUnused(t){this.Y=t}toArray(t=!0){const e=[this.Y];return t&&e.unshift(this.label()),e}label(){return"CloseWindowRequest"}}class f{constructor(t=[],e=!0){const i=e?1:0;this.q=null==t[i]?null:t[i],this.K=null==t[1+i]?null:t[1+i],this.H=null==t[2+i]?null:t[2+i],this.$=null==t[3+i]?null:t[3+i],this.J=null==t[4+i]?null:t[4+i],this.X=null==t[5+i]?null:t[5+i],this.Z=null==t[6+i]?null:t[6+i],this.tt
1=null==t[7+i]?null:t[7+i]}getSwgUserToken(){return this.q}setSwgUserToken(t){this.q=t}getActionCompleted(){return this.K}setActionCompleted(t){this.K=t}getUserEmail(){return this.H}setUserEmail(t){this.H=t}getAlreadyCompleted(){return this.$}setAlreadyCompleted(t){this.$=t}getDisplayName(){return this.J}setDisplayName(t){this.J=t}getGivenName(){return this.X}setGivenName(t){this.X=t}getFamilyName(){return this.Z}setFamilyName(t){this.Z=t}getTermsAndConditionsConsent(){return this.tt}setTermsAndConditionsConsent(t){this.tt=t}toArray(t=!0){const e=[this.q,this.K,this.H,this.$,this.J,this.X,this.Z,this.tt];return t&&e.unshift(this.label()),e}label(){return"CompleteAudienceActionResponse"}}let w=class{constructor(t=[],e=!0){const i=e?1:0;this.seconds_=null==t[i]?null:t[i],this.nanos_=null==t[1+i]?null:t[1+i]}getSeconds(){return this.seconds_}setSeconds(t){this.seconds_=t}getNanos(){return this.nanos_}setNanos(t){this.nanos_=t}toArray(t=!0){const e=[this.seconds_,this.nanos_];return t&&e.unshift(this.label()),e}label(){return"Duration"}};class E{constructor(t=[],e=!0){const i=e?1:0;this.et=null==t[i]?null:t[i],this.st=null==t[1+i]?null:t[1+i]}getJwt(){return this.et}setJwt(t){this.et=t}getSource(){return this.st}setSource(t){this.st=t}toArray(t=!0){const e=[this.et,this.st];return t&&e.unshift(this.label()),e}label(){return"EntitlementJwt"}}class b{constructor(t=[],e=!0){const i=e?1:0;this.nt=null==t[i]?null:new E(t[i],e),this.rt=null==t[1+i]?null:new j(t[1+i],e),this.ot=null==t[2+i]?null:t[2+i],this.ht=null==t[3+i]?null:t[3+i],this.lt=null==t[4+i]?null:t[4+i],this.ut=null==t[5+i]?null:t[5+i],this.ct=null==t[6+i]?null:new j(t[6+i],e)}getUsedEntitlement(){return this.nt}setUsedEntitlement(t){this.nt=t}getClientEventTime(){return this.rt}setClientEventTime(t){this.rt=t}getEntitlementSource(){return this.ot}setEntitlementSource(t){this.ot=t}getEntitlementResult(){return this.ht}setEntitlementResult(t){this.ht=t}getToken(){return this.lt}setToken(t){this.lt=t}getIsUserRegistered(){return this.ut}setIsUserRegistered(t){this.ut=t}getSubscriptionTimestamp(){return this.ct}setSubscriptionTimestamp(t){this.ct=t}toArray(t=!0){const e=[this.nt?this.nt.toArray(t):[],this.rt?this.rt.toArray(t):[],this.ot,this.ht,this.lt,this.ut,this.ct?this.ct.toArray(t):[]];return t&&e.unshift(this.label()),e}label(){return"EntitlementsRequest"}}class T{constructor(t=[],e=!0){const i=e?1:0;this.et=null==t[i]?null:t[i],this.q=null==t[1+i]?null:t[1+i]}getJwt(){return this.et}setJwt(t){this.et=t}getSwgUserToken(){return this.q}setSwgUserToken(t){this.q=t}toArray(t=!0){const e=[this.et,this.q];return t&&e.unshift(this.label()),e}label(){return"EntitlementsResponse"}}class I{constructor(t=[],e=!0){const i=e?1:0;this.dt=null==t[i]?null:t[i],this.gt=null==t[1+i]?null:t[1+i],this._t=null==t[2+i]?null:t[2+i],this.I=null==t[3+i]?null:t[3+i],this.ft=null==t[4+i]?null:t[4+i],this.ut=null==t[5+i]?null:t[5+i],this.wt=null==t[6+i]?null:t[6+i],this.ct=null==t[7+i]?null:new j(t[7+i],e),this.Et=null==t[8+i]?null:t[8+i],this.bt=null==t[9+i]?null:t[9+i]}getSmartboxMessage(){return this.dt}setSmartboxMessage(t){this.dt=t}getGpayTransactionId(){return this.gt}setGpayTransactionId(t){this.gt=t}getHadLogged(){return this._t}setHadLogged(t){this._t=t}getSku(){return this.I}setSku(t){this.I=t}getOldTransactionId(){return this.ft}setOldTransactionId(t){this.ft=t}getIsUserRegistered(){return this.ut}setIsUserRegistered(t){this.ut=t}getSubscriptionFlow(){return this.wt}setSubscriptionFlow(t){this.wt=t}getSubscriptionTimestamp(){return this.ct}setSubscriptionTimestamp(t){this.ct=t}getCampaignId(){return this.Et}setCampaignId(t){this.Et=t}getLinkedPublicationsCount(){return this.bt}setLinkedPublicationsCount(t){this.bt=t}toArray(t=!0){const e=[this.dt,this.gt,this._t,this.I,this.ft,this.ut,this.wt,this.ct?this.ct.toArray(t):[],this.Et,this.bt];return t&&e.unshift(this.label()),e}label(){return"EventParams"}}class y{constructor(t=[],e=!0){const i=e?1:0;this.t=null==t[i]?null:t[i],this.Tt=null==t[1+i]?null:t[1+i]}getComplete(){return this.t}setComplete(t){this.t=t}getError(){return this.Tt}setError(t){this.Tt=t}toArray(t=!0){const e=[this.t,this.Tt];return t&&e.unshift(this.label()),e}label(){return"FinishedLoggingResponse"}}class S{constructor(t=[],e=!0){const i=e?1:0;this.It=null==t[i]?null:t[i],this.lt=null==t[1+i]?null:t[1+i]}getAuthCode(){return this.It}setAuthCode(t){this.It=t}getToken(){return this.lt}setToken(t){this.lt=t}toArray(t=!0){const e=[this.It,this.lt];return t&&e.unshift(this.label()),e}label(){return"LinkSaveTokenRequest"}}class C{constructor(t=[],e=!0){const i=e?1:0;this.yt=null==t[i]?null:t[i]}getRequested(){return this.yt}setRequested(t){this.yt=t}toArray(t=!0){const e=[this.yt];return t&&e.unshift(this.label()),e}label(){return"LinkingInfoResponse"}}class O{constructor(t=[],e=!0){const i=e?1:0;this.Y=null==t[i]?null:t[i]}getUnused(){return this.Y}setUnused(t){this.Y=t}toArray(t=!0){const e=[this.Y];return t&&e.unshift(this.label()),e}label(){return"RewardedAdAlternateActionRequest"}}class N{constructor(t=[],e=!0){const i=e?1:0;this.St=null==t[i]?null:t[i]}getAdUnit(){return this.St}setAdUnit(t){this.St=t}toArray(t=!0){const e=[this.St];return t&&e.unshift(this.label()),e}label(){return"RewardedAdLoadAdRequest"}}class A{constructor(t=[],e=!0){const i=e?1:0;this.Ct=null==t[i]?null:t[i]}getSuccess(){return this.Ct}setSuccess(t){this.Ct=t}toArray(t=!0){const e=[this.Ct];return t&&e.unshift(this.label()),e}label(){return"RewardedAdLoadAdResponse"}}class v{constructor(t=[],e=!0){const i=e?1:0;this.St=null==t[i]?null:t[i]}getAdUnit(){return this.St}setAdUnit(t){this.St=t}toArray(t=!0){const e=[this.St];return t&&e.unshift(this.label()),e}label(){return"RewardedAdViewAdRequest"}}class R{constructor(t=[],e=!0){const i=e?1:0;this.I=null==t[i]?null:t[i],this.Ot=null==t[1+i]?null:t[1+i],this.Nt=null==t[2+i]?null:t[2+i],this.At=null==t[3+i]?null:t[3+i],this.vt=null==t[4+i]?null:t[4+i],this.Rt=null==t[5+i]?null:t[5+i],this.Pt=null==t[6+i]?null:t[6+i],this.xt=null==t[7+i]?null:t[7+i]}getSku(){return this.I}setSku(t){this.I=t}getOldSku(){return this.Ot}setOldSku(t){this.Ot=t}getOneTime(){return this.Nt}setOneTime(t){this.Nt=t}getPlayOffer(){return this.At}setPlayOffer(t){this.At=t}getOldPlayOffer(){return this.vt}setOldPlayOffer(t){this.vt=t}getCustomMessage(){return this.Rt}setCustomMessage(t){this.Rt=t}getAnonymous(){return this.Pt}setAnonymous(t){this.Pt=t}getSharingPolicyEnabled(){return this.xt}setSharingPolicyEnabled(t){this.xt=t}toArray(t=!0){const e=[this.I,this.Ot,this.Nt,this.At,this.vt,this.Rt,this.Pt,this.xt];return t&&e.unshift(this.label()),e}label(){return"SkuSelectedResponse"}}class P{constructor(t=[],e=!0){const i=e?1:0;this.Lt=null==t[i]?null:t[i]}getIsClicked(){return this.Lt}setIsClicked(t){this.Lt=t}toArray(t=!0){const e=[this.Lt];return t&&e.unshift(this.label()),e}label(){return"SmartBoxMessage"}}let x=class{constructor(t=[],e=!0){const i=e?1:0;this.Mt=null==t[i]?null:t[i]}getSubscribe(){return this.Mt}setSubscribe(t){this.Mt=t}toArray(t=!0){const e=[this.Mt];return t&&e.unshift(this.label()),e}label(){return"SubscribeResponse"}};class L{constructor(t=[],e=!0){const i=e?1:0;this.kt=null==t[i]?null:t[i],this.Ct=null==t[1+i]?null:t[1+i],this.Dt=(t[2+i]||[]).map((t=>new M(t,e)))}getPublisherProvidedId(){return this.kt}setPublisherProvidedId(t){this.kt=t}getSuccess(){return this.Ct}setSuccess(t){this.Ct=t}getLinkResultsList(){return this.Dt}setLinkResultsList(t){this.Dt=t}toArray(t=!0){const e=[this.kt,this.Ct,this.Dt?this.Dt.map((e=>e.toArray(t))):[]];return t&&e.unshift(this.label()),e}label(){return"SubscriptionLinkingCompleteResponse"}}class M{constructor(t=[],e=!0){const i=e?1:0;this.Ct=null==t[i]?null:t[i],this.Ut=null==t[1+i]?null:t[1+i],this.kt=null==t[2+i]?null:t[2+i]}getSuccess(){return this.Ct}setSuccess(t){this.Ct=t}getSwgPublicationId(){return this.Ut}setSwgPublicationId(t){this.Ut=t}getPublisherProvidedId(){return this.kt}setPublisherProvidedId(t){this.kt=t}toArray(t=!0){const e=[this.Ct,this.Ut,this.kt];return t&&e.unshift(this.label()),e}label(){return"SubscriptionLinkingLinkResult"}}class k{constructor(t=[],e=!0){const i=e?1:0;
1this.Gt=null==t[i]?null:t[i],this.jt=null==t[1+i]?null:t[1+i],this.Ft=null==t[2+i]?null:t[2+i],this.zt=null==t[3+i]?null:t[3+i]}getAnswerId(){return this.Gt}setAnswerId(t){this.Gt=t}getAnswerText(){return this.jt}setAnswerText(t){this.jt=t}getAnswerCategory(){return this.Ft}setAnswerCategory(t){this.Ft=t}getPpsValue(){return this.zt}setPpsValue(t){this.zt=t}toArray(t=!0){const e=[this.Gt,this.jt,this.Ft,this.zt];return t&&e.unshift(this.label()),e}label(){return"SurveyAnswer"}}class D{constructor(t=[],e=!0){const i=e?1:0;this.Bt=(t[i]||[]).map((t=>new G(t,e))),this.Wt=null==t[1+i]?null:t[1+i]}getSurveyQuestionsList(){return this.Bt}setSurveyQuestionsList(t){this.Bt=t}getStorePpsInLocalStorage(){return this.Wt}setStorePpsInLocalStorage(t){this.Wt=t}toArray(t=!0){const e=[this.Bt?this.Bt.map((e=>e.toArray(t))):[],this.Wt];return t&&e.unshift(this.label()),e}label(){return"SurveyDataTransferRequest"}}class U{constructor(t=[],e=!0){const i=e?1:0;this.Ct=null==t[i]?null:t[i]}getSuccess(){return this.Ct}setSuccess(t){this.Ct=t}toArray(t=!0){const e=[this.Ct];return t&&e.unshift(this.label()),e}label(){return"SurveyDataTransferResponse"}}class G{constructor(t=[],e=!0){const i=e?1:0;this.Vt=null==t[i]?null:t[i],this.Yt=null==t[1+i]?null:t[1+i],this.qt=null==t[2+i]?null:t[2+i],this.Kt=(t[3+i]||[]).map((t=>new k(t,e)))}getQuestionId(){return this.Vt}setQuestionId(t){this.Vt=t}getQuestionText(){return this.Yt}setQuestionText(t){this.Yt=t}getQuestionCategory(){return this.qt}setQuestionCategory(t){this.qt=t}getSurveyAnswersList(){return this.Kt}setSurveyAnswersList(t){this.Kt=t}toArray(t=!0){const e=[this.Vt,this.Yt,this.qt,this.Kt?this.Kt.map((e=>e.toArray(t))):[]];return t&&e.unshift(this.label()),e}label(){return"SurveyQuestion"}}class j{constructor(t=[],e=!0){const i=e?1:0;this.seconds_=null==t[i]?null:t[i],this.nanos_=null==t[1+i]?null:t[1+i]}getSeconds(){return this.seconds_}setSeconds(t){this.seconds_=t}getNanos(){return this.nanos_}setNanos(t){this.nanos_=t}toArray(t=!0){const e=[this.seconds_,this.nanos_];return t&&e.unshift(this.label()),e}label(){return"Timestamp"}}class F{constructor(t=[],e=!0){const i=e?1:0;this.Ht=null==t[i]?null:t[i]}getClose(){return this.Ht}setClose(t){this.Ht=t}toArray(t=!0){const e=[this.Ht];return t&&e.unshift(this.label()),e}label(){return"ToastCloseRequest"}}class z{constructor(t=[],e=!0){const i=e?1:0;this.$t=null==t[i]?null:t[i]}getNative(){return this.$t}setNative(t){this.$t=t}toArray(t=!0){const e=[this.$t];return t&&e.unshift(this.label()),e}label(){return"ViewSubscriptionsResponse"}}const B={AccountCreationRequest:u,ActionRequest:class{constructor(t=[],e=!0){const i=e?1:0;this.Jt=null==t[i]?null:t[i]}getAction(){return this.Jt}setAction(t){this.Jt=t}toArray(t=!0){const e=[this.Jt];return t&&e.unshift(this.label()),e}label(){return"ActionRequest"}},AlreadySubscribedResponse:c,AnalyticsContext:d,AnalyticsEventMeta:p,AnalyticsRequest:g,AudienceActivityClientLogsRequest:m,CloseWindowRequest:_,CompleteAudienceActionResponse:f,Duration:w,EntitlementJwt:E,EntitlementsRequest:b,EntitlementsResponse:T,EventParams:I,FinishedLoggingResponse:y,LinkSaveTokenRequest:S,LinkingInfoResponse:C,OpenDialogRequest:class{constructor(t=[],e=!0){const i=e?1:0;this.Qt=null==t[i]?null:t[i]}getUrlPath(){return this.Qt}setUrlPath(t){this.Qt=t}toArray(t=!0){const e=[this.Qt];return t&&e.unshift(this.label()),e}label(){return"OpenDialogRequest"}},RewardedAdAlternateActionRequest:O,RewardedAdLoadAdRequest:N,RewardedAdLoadAdResponse:A,RewardedAdViewAdRequest:v,SkuSelectedResponse:R,SmartBoxMessage:P,SubscribeResponse:x,SubscriptionLinkingCompleteResponse:L,SubscriptionLinkingLinkResult:M,SubscriptionLinkingResponse:class{constructor(t=[],e=!0){const i=e?1:0;this.kt=null==t[i]?null:t[i]}getPublisherProvidedId(){return this.kt}setPublisherProvidedId(t){this.kt=t}toArray(t=!0){const e=[this.kt];return t&&e.unshift(this.label()),e}label(){return"SubscriptionLinkingResponse"}},SurveyAnswer:k,SurveyDataTransferRequest:D,SurveyDataTransferResponse:U,SurveyQuestion:G,Timestamp:j,ToastCloseRequest:F,ViewSubscriptionsResponse:z};var W=(t=>(t.NONE="none",t.CONTRIBUTION="contribution",t.CONTRIBUTION_LARGE="contribution_large",t.SUBSCRIPTION="subscription",t.SUBSCRIPTION_LARGE="subscription_large",t))(W||{}),V=(t=>(t.OPEN="OPEN",t.CLOSED="CLOSED",t))(V||{});const Y=String.raw,q=String.raw,K=q(_a||(_a=__template(["\n @keyframes slideUp {\n from {\n transform: translate(0, 200px
1);\n }\n to {\n transform: translate(0, 0);\n }\n }\n"]))),H=q(_b||(_b=__template(["\n .exit-container {\n width: 100%;\n display: flex;\n flex-direction: row-reverse;\n }\n"]))),$=q(_c||(_c=__template(["\n .back-to-home-button {\n border-radius: 4px;\n text-decoration: none;\n font-size: 14px;\n color: #1a73e8;\n padding: 17px;\n outline-offset: 4px;\n outline-color: #145ab5;\n }\n\n .back-to-home-button:focus,\n .back-to-home-button:hover {\n background-color: #f2f8ff;\n }\n"]))),J=Y(_d||(_d=__template(['\n <a class="back-to-home-button" href="$BACK_TO_HOME_LINK$">\n $BACK_TO_HOME_TEXT$\n </a>\n']))),Q=q(_e||(_e=__template(["\n ","\n\n .rewarded-ad-prompt {\n animation: 0.5s slideUp;\n margin-left: auto !important;\n margin-right: auto !important;\n margin-top: auto !important;\n border-top-left-radius: 20px !important;\n border-top-right-radius: 20px !important;\n pointer-events: auto !important;\n background: white !important;\n max-height: 90%;\n overflow: auto;\n outline: none;\n font-family: 'Google Sans', 'Roboto-Regular', sans-serif, arial;\n width: 100%;\n }\n\n @media (min-width: 450px) {\n .rewarded-ad-prompt {\n width: 375px !important;\n }\n }\n"])),K),X=q(_f||(_f=__template(["\n button {\n background: none;\n color: inherit;\n border: none;\n padding: 0;\n font: inherit;\n cursor: pointer;\n outline-offset: 4px; // 0.25rem;\n outline-color: #145ab5;\n }\n"]))),Z=q(_g||(_g=__template(["\n .rewarded-ad-close-button {\n margin: 8px 8px 0px 0px;\n padding: 12px;\n height: 48px;\n width: 48px;\n grid-column: 3;\n grid-row: 1;\n border-radius: 4px;\n }\n .rewarded-ad-close-img {\n border-radius: 20px;\n height: 24px;\n width: 24px;\n background: #5f6368;\n -webkit-mask: url(https://fonts.gstatic.com/s/i/short-term/release/googlesymbols/close/default/24px.svg)\n center/contain no-repeat;\n }\n\n .rewarded-ad-close-button:hover,\n .rewarded-ad-close-button:focus {\n background-color: #f2f8ff;\n }\n"]))),tt=Y(_h||(_h=__template([' <button\n aria-label="$CLOSE_BUTTON_DESCRIPTION$"\n class="rewarded-ad-close-button"\n>\n <div class="rewarded-ad-close-img"></div>\n</button>']))),et=q(_i||(_i=__template(["\n .opt-in-close-button-container {\n text-align: end !important;\n }\n\n .opt-in-close-button {\n background: none;\n border: none;\n border-radius: 4px;\n height: 48px;\n padding: 12px;\n width: 48px;\n }\n\n .opt-in-close-img {\n border-radius: 20px;\n height: 24px;\n width: 24px;\n }\n\n .opt-in-close-button:hover,\n .opt-in-close-button:focus {\n background-color: #f2f8ff;\n }\n\n @media (forced-colors: active) {\n .opt-in-close-img {\n background: buttonText;\n }\n }\n"]))),it=Y(_j||(_j=__template(["<style>\n ",'\n </style>\n <div class="opt-in-close-button-container">\n <button aria-label="$CLOSE_BUTTON_DESCRIPTION$" class="opt-in-close-button">\n <img\n class="opt-in-close-img"\n src="https://fonts.gstatic.com/s/i/short-term/release/googlesymbols/close/default/24px.svg"\n alt="Close button"\n />\n </button>\n </div>'])),et),st=q(_k||(_k=__template(["\n ","\n"])),Q),nt=Y(_l||(_l=__template(["\n <style>\n ",' .rewarded-ad-prompt {\n height: 120px;\n width: 100%;\n align-items: center;\n justify-items: center;\n display: grid;\n }\n </style>\n <div class="rewarded-ad-prompt">Something went wrong.</div>\n'])),st),rt=q(_m||(_m=__template(["\n swg-container,\n swg-loading,\n swg-loading-animate,\n swg-loading-image {\n display: block;\n }\n\n swg-loading-container {\n margin-left: auto !important;\n margin-right: auto !important;\n margin-top: auto !important;\n\n border-top-left-radius: 8px !important;\n border-top-right-radius: 8px !important;\n\n height: 148px !important;\n width: 100% !important;\n\n display: flex !important;\n align-items: center !important;\n justify-content: center !important;\n\n bottom: 0 !important;\n z-index: 2147483647 !important;\n\n background-color: rgba(255, 255, 255, 1) !important;\n box-shadow: rgba(60, 64, 67, 0.3) 0 1px 1px,\n rgba(60, 64, 67, 0.15) 0 1px 4px 1px !important;\n }\n\n swg-loading-container.centered-on-desktop {\n height: 120px !important;\n min-height: 120px !important;\n border-radius: 8px !important;\n }\n\n swg-loading {\n z-index: 2147483647 !important;\n width: 36px;\n height: 36px;\n overflow: hidden;\n animation: mspin-rotate 1568.63ms infinite linear;\n }\n\n swg-loading-animate {\n animation: mspin-revrot 5332ms infinite steps(4);\n }\n\n swg-loading-image {\n background-image: url('","/loader.svg');\n background-size: 100%;\n width: 11664px;\n height: 36px;\n animation: swg-loading-film 5332ms infinite steps(324);\n }\n\n @keyframes swg-loading-film {\n from {\n transform: translateX(0);\n }\n to {\n transform: translateX(-11664px);\n }\n }\n\n @keyframes mspin-rotate {\n from {\n transform: rotate(0deg);\n }\n to {\n transform: rotate(360deg);\n }\n }\n\n @keyframes mspin-revrot {\n from {\n transform: rotate(0deg);\n }\n to {\n transform: rotate(-360deg);\n }\n }\n\n @media (min-width: 450px) {\n swg-loading-container {\n width: 375px !important;\n }\n }\n"])),s),ot=Y(_n||(_n=__template(["\n <style>\n ","\n </style>\n <swg-loading-container>\n <swg-loading>\n <swg-loading-animate>\n <swg-loading-image></swg-loading-image>\n </swg-loading-animate>\n </swg-loading>\n </swg-loading-container>\n"])),rt),at=q(_o||(_o=__template(["\n ","\n ","\n ","\n ","\n ","\n\n .rewarded-ad-container {\n margin: 0px;\n text-align: center;\n }\n\n .rewarded-ad-header {\n display: grid !important;\n grid-template-columns: 56px 1fr 56px;\n }\n\n .rewarded-ad-title {\n font-size: 28px; //1.75rem;\n line-height: 36px; // 2.25rem;\n font-weight: 400;\n letter-spacing: 0em;\n color: #202124;\n grid-column: 2;\n grid-row: 1;\n line-break: auto;\n }\n\n .rewarded-ad-message {\n margin-top: 8px;\n padding: 0px 11px 0px 11px;\n font-size: 16px; // 1rem;\n font-weight: 500;\n line-height: 24px; // 1.5rem;\n letter-spacing: 0.25px;\n color: #202124;\n }\n\n .rewarded-ad-cta {\n margin: 20px 14px 0px 14px;\n }\n\n .rewarded-ad-cta-button {\n padding: 6px; // 0.375rem;\n width: 100%;\n outline-offset: -2px; // 0.125rem;\n }\n\n .rewarded-ad-cta-button-inner {\n width: 100%;\n height: 36px; // 2.25rem;\n border-radius: 4px; // 0.25rem;\n font-size: 14px; // 0.875rem;\n font-weight: 500;\n letter-spacing: 0.25px;\n display: flex;\n justify-content: center;
1\n align-items: center;\n }\n\n .rewarded-ad-view-ad-button-inner {\n background-color: #1a73e8;\n color: white;\n }\n\n .rewarded-ad-cta-button:focus .rewarded-ad-view-ad-button-inner,\n .rewarded-ad-cta-button:hover .rewarded-ad-view-ad-button-inner {\n background-color: #145ab5;\n }\n\n .rewarded-ad-view-ad-button:disabled .rewarded-ad-view-ad-button-inner {\n background-color: darkgrey;\n color: lightgrey;\n }\n\n .rewarded-ad-support-button-inner {\n border: 1px solid #dadce0;\n border-radius: 4px; // 0.25rem;\n color: #1a73e8;\n }\n\n .rewarded-ad-cta-button:focus .rewarded-ad-support-button-inner,\n .rewarded-ad-cta-button:hover .rewarded-ad-support-button-inner {\n background-color: #e6e6e6;\n }\n\n .rewarded-ad-google-logo {\n float: left;\n height: 24px;\n margin: 20px 0px 20px 0px;\n }\n\n .rewarded-ad-sign-in-button {\n float: right;\n font-size: 14px; // 0.875rem;\n font-weight: 500;\n line-height: 20px; // 1.25rem;\n letter-spacing: 0.25px;\n text-align: right;\n color: #1a73e8;\n height: 48px;\n border-radius: 4px;\n margin: 8px 0px 8px 0px;\n padding: 0px 7px 0px 7px;\n }\n\n .rewarded-ad-sign-in-button:focus,\n .rewarded-ad-sign-in-button:hover {\n background-color: #f2f8ff;\n }\n\n .rewarded-ad-footer {\n margin-left: 20px;\n margin-right: 20px;\n }\n"])),X,Z,Q,$,H),ht=Y(_p||(_p=__template(['<button\n class="rewarded-ad-support-button rewarded-ad-cta-button"\n>\n <div class="rewarded-ad-support-button-inner rewarded-ad-cta-button-inner">\n $SUPPORT_MESSAGE$\n </div>\n</button>']))),lt=Y(_q||(_q=__template(['<button\n class="rewarded-ad-sign-in-button"\n>\n $SIGN_IN_MESSAGE$\n</button>']))),ut=Y(_r||(_r=__template(["\n <style>\n ",'\n </style>\n <div\n class="rewarded-ad-prompt"\n tabindex="-1"\n role="dialog"\n aria-labelledby="title-id"\n aria-describedby="message-id"\n aria-modal="true"\n >\n <div class="rewarded-ad-container">\n <div class="exit-container">$EXIT$</div>\n <div class="rewarded-ad-header">\n <div class="rewarded-ad-title" id="title-id">$TITLE$</div>\n </div>\n <div class="rewarded-ad-message" id="message-id">$MESSAGE$</div>\n <div class="rewarded-ad-cta">\n <button class="rewarded-ad-view-ad-button rewarded-ad-cta-button">\n <div\n class="rewarded-ad-view-ad-button-inner rewarded-ad-cta-button-inner"\n >\n $VIEW_AN_AD$\n </div>\n </button>\n $SUPPORT_BUTTON$\n </div>\n <div class="rewarded-ad-footer">\n <img\n alt="Google"\n class="rewarded-ad-google-logo"\n src="','"\n />\n $SIGN_IN_BUTTON$\n </div>\n </div>\n </div>\n'])),at,"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSI3NCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDc0IDI0Ij48cGF0aCBmaWxsPSIjNDI4NUY0IiBkPSJNOS4yNCA4LjE5djIuNDZoNS44OGMtLjE4IDEuMzgtLjY0IDIuMzktMS4zNCAzLjEtLjg2Ljg2LTIuMiAxLjgtNC41NCAxLjgtMy42MiAwLTYuNDUtMi45Mi02LjQ1LTYuNTRzMi44My02LjU0IDYuNDUtNi41NGMxLjk1IDAgMy4zOC43NyA0LjQzIDEuNzZMMTUuNCAyLjVDMTMuOTQgMS4wOCAxMS45OCAwIDkuMjQgMCA0LjI4IDAgLjExIDQuMDQuMTEgOXM0LjE3IDkgOS4xMyA5YzIuNjggMCA0LjctLjg4IDYuMjgtMi41MiAxLjYyLTEuNjIgMi4xMy0zLjkxIDIuMTMtNS43NSAwLS41Ny0uMDQtMS4xLS4xMy0xLjU0SDkuMjR6Ii8+PHBhdGggZmlsbD0iI0VBNDMzNSIgZD0iTTI1IDYuMTljLTMuMjEgMC01LjgzIDIuNDQtNS44MyA1LjgxIDAgMy4zNCAyLjYyIDUuODEgNS44MyA1LjgxczUuODMtMi40NiA1LjgzLTUuODFjMC0zLjM3LTIuNjItNS44MS01LjgzLTUuODF6bTAgOS4zM2MtMS43NiAwLTMuMjgtMS40NS0zLjI4LTMuNTIgMC0yLjA5IDEuNTItMy41MiAzLjI4LTMuNTJzMy4yOCAxLjQzIDMuMjggMy41MmMwIDIuMDctMS41MiAzLjUyLTMuMjggMy41MnoiLz48cGF0aCBmaWxsPSIjNDI4NUY0IiBkPSJNNTMuNTggNy40OWgtLjA5Yy0uNTctLjY4LTEuNjctMS4zLTMuMDYtMS4zQzQ3LjUzIDYuMTkgNDUgOC43MiA0NSAxMmMwIDMuMjYgMi41MyA1LjgxIDUuNDMgNS44MSAxLjM5IDAgMi40OS0uNjIgMy4wNi0xLjMyaC4wOXYuODFjMCAyLjIyLTEuMTkgMy40MS0zLjEgMy40MS0xLjU2IDAtMi41My0xLjEyLTIuOTMtMi4wN2wtMi4yMi45MmMuNjQgMS41NCAyLjMzIDMuNDMgNS4xNSAzLjQzIDIuOTkgMCA1LjUyLTEuNzYgNS41Mi02LjA1VjYuNDloLTIuNDJ2MXptLTIuOTMgOC4wM2MtMS43NiAwLTMuMS0xLjUtMy4xLTMuNTIgMC0yLjA1IDEuMzQtMy41MiAzLjEtMy41MiAxLjc0IDAgMy4xIDEuNSAzLjEgMy41NC4wMSAyLjAzLTEuMzYgMy41LTMuMSAzLjV6Ii8+PHBhdGggZmlsbD0iI0ZCQkMwNSIgZD0iTTM4IDYuMTljLTMuMjEgMC01LjgzIDIuNDQtNS44MyA1LjgxIDAgMy4z
1NCAyLjYyIDUuODEgNS44MyA1LjgxczUuODMtMi40NiA1LjgzLTUuODFjMC0zLjM3LTIuNjItNS44MS01LjgzLTUuODF6bTAgOS4zM2MtMS43NiAwLTMuMjgtMS40NS0zLjI4LTMuNTIgMC0yLjA5IDEuNTItMy41MiAzLjI4LTMuNTJzMy4yOCAxLjQzIDMuMjggMy41MmMwIDIuMDctMS41MiAzLjUyLTMuMjggMy41MnoiLz48cGF0aCBmaWxsPSIjMzRBODUzIiBkPSJNNTggLjI0aDIuNTF2MTcuNTdINTh6Ii8+PHBhdGggZmlsbD0iI0VBNDMzNSIgZD0iTTY4LjI2IDE1LjUyYy0xLjMgMC0yLjIyLS41OS0yLjgyLTEuNzZsNy43Ny0zLjIxLS4yNi0uNjZjLS40OC0xLjMtMS45Ni0zLjctNC45Ny0zLjctMi45OSAwLTUuNDggMi4zNS01LjQ4IDUuODEgMCAzLjI2IDIuNDYgNS44MSA1Ljc2IDUuODEgMi42NiAwIDQuMi0xLjYzIDQuODQtMi41N2wtMS45OC0xLjMyYy0uNjYuOTYtMS41NiAxLjYtMi44NiAxLjZ6bS0uMTgtNy4xNWMxLjAzIDAgMS45MS41MyAyLjIgMS4yOGwtNS4yNSAyLjE3YzAtMi40NCAxLjczLTMuNDUgMy4wNS0zLjQ1eiIvPjwvc3ZnPg=="),ct=q(_s||(_s=__template(["\n ","\n ","\n ","\n ","\n\n .rewarded-ad-prompt {\n width: 100%;\n }\n\n .rewarded-ad-thanks-message {\n font-size: 22px; // 1.375rem;\n font-weight: 400;\n line-height: 28px; // 1.75rem;\n letter-spacing: 0px;\n text-align: center;\n color: #202124;\n margin-block-end: 48px; // 3rem;\n }\n"])),X,Z,Q,H),dt=Y(_t||(_t=__template(["\n <style>\n ",'\n </style>\n <div\n class="rewarded-ad-prompt"\n tabindex="-1"\n role="dialog"\n aria-labelledby="thanks-id"\n aria-modal="true"\n >\n <div class="exit-container">','</div>\n <div class="rewarded-ad-thanks-message" id="thanks-id">\n $THANKS_FOR_VIEWING_THIS_AD$\n </div>\n </div>\n'])),ct,tt);var pt=(t=>(t.TYPE_REGISTRATION_WALL="TYPE_REGISTRATION_WALL",t.TYPE_NEWSLETTER_SIGNUP="TYPE_NEWSLETTER_SIGNUP",t.TYPE_REWARDED_SURVEY="TYPE_REWARDED_SURVEY",t.TYPE_REWARDED_AD="TYPE_REWARDED_AD",t.TYPE_CONTRIBUTION="TYPE_CONTRIBUTION",t.TYPE_SUBSCRIPTION="TYPE_SUBSCRIPTION",t.TYPE_BYO_CTA="TYPE_BYO_CTA",t))(pt||{});const gt={en:"Subscribe with Google",ar:"Google اشترÙ Ù
ع",de:"Abonnieren mit Google","en-au":"Subscribe with Google","en-ca":"Subscribe with Google","en-gb":"Subscribe with Google","en-us":"Subscribe with Google",es:"SuscrÃbete con Google","es-419":"SuscrÃbete con Google","es-latam":"SuscrÃbete con Google","es-latn":"SuscrÃbete con Google",fr:"S'abonner avec Google","fr-ca":"S'abonner avec Google",hi:"Google à¤à¥ à¥à¤°à¤¿à¤¯à¥ सदसà¥à¤¯à¤¤à¤¾",id:"Berlangganan dengan Google",it:"Abbonati con Google",ja:"Google ã§è³¼èª",ko:"Google ì íµí구ë
",ms:"Langgan dengan Google",nl:"Abonneren via Google",no:"Abonner med Google",pl:"Subskrybuj z Google",pt:"Subscrever com o Google","pt-br":"Assine com o Google",ru:"Ðодпиcка ÑеÑез Google",sv:"Prenumerera med Google",th:"สมัà¸à¸£à¸à¸²à¸ Google",tr:"Google ile Abone Ol",uk:"ÐÑдпиÑаÑиÑÑ ÑеÑез Google","zh-cn":"éè¿ Google 订é
","zh-hk":"éé Google è¨é±","zh-tw":"éé Google è¨é±"},mt={en:"Contribute with Google",ar:"اÙÙ
ساÙÙ
Ø© باستخداÙ
Google",de:"Mit Google beitragen","en-au":"Contribute with Google","en-ca":"Contribute with Google","en-gb":"Contribute with Google","en-us":"Contribute with Google",es:"\tContribuye con Google","es-419":"Contribuir con Google","es-latam":"Contribuir con Google","es-latn":"Contribuye con Google",fr:"Contribuer avec Google","fr-ca":"Contribuer avec Google",hi:"Google à¤à¤¾à¤¤à¥ à¤à¥ मदद सॠयà¥à¤à¤¦à¤¾à¤¨ à¤à¤°à¥à¤",id:"Berkontribusi dengan Google",it:"Contribuisci con Google",ja:"Google ã§å¯ä»",ko:"Googleì íµí´ ì°¸ì¬í기",ms:"Sumbangkan dengan Google",nl:"Bijdragen met Google",no:"Bidra med Google",pl:"Wesprzyj publikacjÄ przez Google",pt:"Contribuir utilizando o Google","pt-br":"Contribua usando o Google",ru:"ÐнеÑÑи ÑÑедÑÑва ÑеÑез Google",sv:"Bidra med Google",th:"มีสà¹à¸§à¸à¸£à¹à¸§à¸¡à¸à¹à¸²à¸ Google",tr:"Google ile Katkıda Bulun",uk:"ÐÑобиÑи внеÑок ÑеÑез Google","zh-cn":"éè¿ Google æèµ ","zh-hk":"éé Google æä¾å
§å®¹","zh-tw":"éé Google ææ¬¾"},ft={en:"You have signed up before.",ar:"Ø³Ø¨Ù Ø£Ù Ø§Ø´ØªØ±ÙØª Ù٠اÙÙØ´Ø±Ø© Ø§ÙØ¥Ø®Ø¨Ø§Ø±ÙØ©.",de:"Du hast dich bereits angemeldet.","en-au":"You have signed up before.","en-ca":"You have signed up before.","en-gb":"You have signed up before.","en-us":"You have signed up before.",es:"Ya te has registrado anteriormente.","es-419":"Ya te registraste antes.",fr:"Vous vous êtes déjà inscrit.","fr
1-ca":"Vous vous êtes inscrit auparavant.",hi:"नà¥à¤¯à¥à¤à¤¼à¤²à¥à¤à¤° à¤à¥ लिठपहलॠहॠसाà¤à¤¨ à¤
प à¤à¤¿à¤¯à¤¾ à¤à¤¾ à¤à¥à¤à¤¾ हà¥.",id:"Anda telah mendaftar sebelumnya.",it:"Hai già effettuato l'iscrizione.",ja:"ãã§ã«ç»é²ããã¦ãã¾ãã",ko:"ì´ì ì ê°ì
í ì¬ì©ìì
ëë¤.",ms:"Anda sudah mendaftar sebelum ini.",nl:"Je hebt je al eerder aangemeld.",no:"Du er allerede registrert.",pl:"Już wczeÅniej siÄ zarejestrowaÅeÅ(-aÅ).",pt:"Já se inscreveu anteriormente.","pt-br":"Você se inscreveu anteriormente.",ru:"ÐÑ Ñже заÑегиÑÑÑиÑованÑ.",sv:"Du har redan registrerat dig.",th:"à¸à¸¸à¸à¸ªà¸¡à¸±à¸à¸£à¸£à¸±à¸à¸à¹à¸à¸¡à¸¹à¸¥à¸¡à¸²à¸à¹à¸à¸à¹à¸¥à¹à¸§",tr:"Daha önce kaydolmuÅtunuz.",uk:"Ðи вже заÑеÑÑÑÑÑвалиÑÑ.","zh-cn":"æ¨ä¹å已注åã","zh-hk":"æ¨ä¹åå·²è¨é±ã","zh-tw":"ä½ å·²ç¶è¨é±äºã"},wt={en:"Registration failed. Try registering again.",ar:"تعذÙÙØ±Øª عÙ
ÙÙØ© Ø§ÙØªØ³Ø¬ÙÙ. ÙÙØ±Ø¬Ù إعادة اÙÙ
ØØ§ÙÙØ©.",de:"Registrierung fehlgeschlagen. Versuche es n
1och einmal.","en-au":"Registration failed. Try registering again.","en-ca":"Registration failed. Try registering again.","en-gb":"Registration failed. Try registering again.","en-us":"Registration failed. Try registering again.",es:"No se ha podido completar el registro. Prueba a registrarte de nuevo.","es-419":"No se pudo completar el registro. Vuelve a intentarlo.",fr:"Ãchec de l'enregistrement. Réessayez.","fr-ca":"Ãchec de l'inscription. Essayez de vous inscrire à nouveau.",hi:"रà¤à¤¿à¤¸à¥à¤à¥à¤°à¥à¤¶à¤¨ नहà¥à¤ हॠसà¤à¤¾. फिर सॠरà¤à¤¿à¤¸à¥à¤à¤° à¤à¤°à¤¨à¥ à¤à¥ à¤à¥à¤¶à¤¿à¤¶ à¤à¤°à¥à¤.",id:"Pendaftaran gagal. Coba daftar lagi.",it:"Registrazione non riuscita. Prova a registrarti di nuovo.",ja:"ç»é²ã§ãã¾ããã§ãããããä¸åº¦ã試ããã ããã",ko:"ë±ë¡ì ì¤í¨íìµëë¤. ë¤ì ë±ë¡í´ ë³´ì¸ì.",ms:"Pendaftaran gagal. Cuba mendaftar lagi.",nl:"Registratie mislukt. Probeer opnieuw te registreren.",no:"Registreringen mislyktes. Prøv Ã¥ registrere deg pÃ¥ nytt.",pl:"Rejestracja siÄ nie udaÅa. Spróbuj jeszcze raz siÄ zarejestrowaÄ.",pt:"Falha no registo. Tente registar-se novamente.","pt-br":"Não foi possÃvel fazer o registro. Tente novamente.",ru:"ÐÑибка ÑегиÑÑÑаÑии. ÐовÑоÑиÑе попÑÑкÑ.",sv:"Registreringen misslyckades. Försök att registrera dig igen.",th:"ลà¸à¸à¸°à¹à¸à¸µà¸¢à¸à¹à¸¡à¹à¸ªà¸³à¹à¸£à¹à¸ ลà¸à¸à¸¥à¸à¸à¸°à¹à¸à¸µà¸¢à¸à¸à¸µà¸à¸à¸£à¸±à¹à¸",tr:"Kayıt iÅlemi baÅarısız oldu. Tekrar kaydolmayı deneyin.",uk:"Ðомилка ÑеÑÑÑÑаÑÑÑ. ÐовÑоÑÑÑÑ ÑпÑобÑ.","zh-cn":"注å失败ã请å°è¯éæ°æ³¨åã","zh-hk":"註å失æãè«åè©¦éæ°è¨»åã","zh-tw":"註å失æï¼è«åè©¦ä¸æ¬¡ã"},Et={en:"Signup failed. Try signing up again.",ar:"تعذÙÙØ±Øª عÙ
ÙÙØ© Ø§ÙØ§Ø´ØªØ±Ø§Ù. ÙÙØ±Ø¬Ù إعادة اÙÙ
ØØ§ÙÙØ©.",de:"Anmeldung fehlgeschlagen. Versuche es n
1och einmal.","en-au":"Sign-up failed. Try signing up again.","en-ca":"Sign-up failed. Try signing up again.","en-gb":"Sign-up failed. Try signing up again.","en-us":"Sign-up failed. Try signing up again.",es:"No se ha podido completar la suscripción. Prueba a suscribirte de nuevo.","es-419":"Se produjo un error de registro. Vuelve a intentarlo.",fr:"Ãchec de l'inscription. Réessayez.","fr-ca":"Ãchec de l'inscription. Essayez de vous inscrire à nouveau.",hi:"साà¤à¤¨ à¤
प नहà¥à¤ à¤à¤¿à¤¯à¤¾ à¤à¤¾ सà¤à¤¾. फिर सॠसाà¤à¤¨ à¤
प à¤à¤°à¤¨à¥ à¤à¥ à¤à¥à¤¶à¤¿à¤¶ à¤à¤°à¥à¤.",id:"Pendaftaran gagal. Coba daftar lagi.",it:"Iscrizione non riuscita. Prova a iscriverti di nuovo.",ja:"ç»é²ã§ãã¾ããã§ãããããä¸åº¦ã試ããã ããã",ko:"ê°ì
ì ì¤í¨íìµëë¤. ë¤ì ê°ì
í´ ë³´ì¸ì.",ms:"Daftar gagal. Cuba daftar lagi.",nl:"Aanmelding mislukt. Probeer opnieuw aan te melden.",no:"Registreringen mislyktes. Prøv Ã¥ registrere deg pÃ¥ nytt.",pl:"Rejestracja siÄ nie udaÅa. Spróbuj jeszcze raz siÄ zarejestrowaÄ.",pt:"Falha na inscrição. Tente inscrever-se novamente.","pt-br":"Não foi possÃvel se inscrever. Tente novamente.",ru:"Ðе ÑдалоÑÑ Ð·Ð°ÑегиÑÑÑиÑоваÑÑÑÑ. ÐовÑоÑиÑе попÑÑкÑ.",sv:"Registreringen misslyckades. Försök att registrera dig igen.",th:"ลà¸à¸à¸·à¹à¸à¸ªà¸¡à¸±à¸à¸£à¹à¸à¹à¹à¸¡à¹à¸ªà¸³à¹à¸£à¹à¸ ลà¸à¸à¸¥à¸à¸à¸·à¹à¸à¸ªà¸¡à¸±à¸à¸£à¹à¸à¹à¸à¸µà¸à¸à¸£à¸±à¹à¸",tr:"Kaydolma iÅlemi baÅarısız oldu. Tekrar kaydolmayı deneyin.",uk:"Ðомилка ÑеÑÑÑÑаÑÑÑ. ÐовÑоÑÑÑÑ ÑпÑобÑ.","zh-cn":"注å失败ã请å°è¯éæ°æ³¨åã","zh-hk":"ç³è«å¤±æãè«åè©¦éæ°ç³è«ã","zh-tw":"è¨é±å¤±æï¼è«åè©¦ä¸æ¬¡ã"},bt={en:'Created an account with <ph name="EMAIL"><ex>[email protected]</ex>%s</ph>',ar:'تÙ
Ø¥ÙØ´Ø§Ø¡ ØØ³Ø§Ø¨ باستخداÙ
<ph name="EMAIL"><ex>[email protected]</ex>%s</ph>.',de:'Konto bei <ph name="EMAIL"><ex>[email protected]</ex>%s</ph> wurde erstellt',"en-au":'Created an account with <ph name="EMAIL"><ex>[email protected]</ex>%s</ph>',"en-ca":'Created an account with <ph name="EMAIL"><ex>[email protected]</ex>%s</ph>',"en-gb":'Created an account with <ph name="EMAIL"><ex>[email protected]</ex>%s</ph>',"en-us":'Created an account with <ph name="EMAIL"><ex>[email protected]</ex>%s</ph>',es:'Has creado una cuenta con <ph name="EMAIL"><ex>[email protected]</ex>%s</ph>',"es-419":'Se creó una cuenta con <ph name="EMAIL"><ex>[email protected]</ex>%s</ph>',fr:'A créé un compte avec <ph name="EMAIL"><ex>[email protected]</ex>%s</ph>',"fr-ca":'Un compte a été créé avec l\'adresse <ph name="EMAIL"><ex>[email protected]</ex>%s</ph>',hi:'<ph name="EMAIL"><ex>[email protected]</ex>%s</ph> à¤à¤¾ à¤à¤¸à¥à¤¤à¥à¤®à¤¾à¤² à¤à¤°à¤à¥, à¤à¤ à¤à¤¾à¤¤à¤¾ बनाया à¤à¤¯à¤¾',id:'Membuat akun dengan <ph name="EMAIL"><ex>[email protected]</ex>%s</ph>',it:'à stato creato un account con l\'indirizzo <ph name="EMAIL"><ex>[email protected]</ex>%s</ph>',ja:'<ph name="EMAIL"><ex>[email protected]</ex>%s</ph> ã§ã¢ã«ã¦ã³ãã使ãã¾ãã',ko:'<ph name="EMAIL"><ex>[email protected]</ex>%s</ph>(ì¼)ë¡ ê³ì ì ë§ë¤ììµëë¤.',ms:'Membuat akaun dengan <ph name="EMAIL"><ex>[email protected]</ex>%s</ph>',nl:'Account gemaakt met <ph name="EMAIL"><ex>[email protected]</ex>%s</ph>',no:'Du har opprettet en konto med <ph name="EMAIL"><ex>[email protected]</ex>%s</ph>',pl:'Utworzono konto za pomocÄ
adresu <ph name="EMAIL"><ex>[email protected]</ex>%s</ph>',pt:'Criou uma conta com <ph name="EMAIL"><ex>[email protected]</ex>%s</ph>',"pt-br":'Conta criada com o e-mail <ph name="EMAIL"><ex>[email protected]</ex>%s</ph>',ru:'ÐÑ Ð·Ð°ÑегиÑÑÑиÑовали аккаÑÐ½Ñ Ð½Ð° адÑÐµÑ <ph name="EMAIL"><ex>[email protected]</ex>%s</ph>.',sv:'Du skapade ett konto med <ph name="EMAIL"><ex>[email protected]</ex>%s</ph>',th:'สรà¹à¸²à¸à¸à¸±à¸à¸à¸µà¸à¹à¸§à¸¢ <ph name="EMAIL"><ex>[email protected]</ex>%s</ph>',tr:'<ph name="EMAIL"><ex>[email protected]</ex>%s</ph> ile bir hesap oluÅturun',uk:'ÐблÑковий Ð·Ð°Ð¿Ð¸Ñ ÑÑвоÑено за Ð´Ð¾Ð¿Ð¾Ð¼Ð¾Ð³Ð¾Ñ ÐµÐ»ÐµÐºÑÑÐ¾Ð½Ð½Ð¾Ñ Ð°Ð´ÑеÑи <ph name="EMAIL"><ex>[email protected]</ex>%s</ph>',"zh-cn":'å·²ä½¿ç¨ <ph name="EMAIL"><ex>[email protected]</ex>%s</ph>
1 å建å¸å·',"zh-hk":'å·²ä½¿ç¨ <ph name="EMAIL"><ex>[email protected]</ex>%s</ph> 建ç«å¸³æ¶',"zh-tw":'å·²ä½¿ç¨ <ph name="EMAIL"><ex>[email protected]</ex>%s</ph> 建ç«å¸³æ¶'},Tt={en:'Signed up with <ph name="EMAIL"><ex>[email protected]</ex>%s</ph> for the newsletter',ar:'تÙ
Ø§ÙØ§Ø´ØªØ±Ø§Ù Ù٠اÙÙØ´Ø±Ø© Ø§ÙØ¥Ø®Ø¨Ø§Ø±ÙØ© باستخداÙ
<ph name="EMAIL"><ex>[email protected]</ex>%s</ph>.',de:'Du hast dich für den Newsletter von <ph name="EMAIL"><ex>[email protected]</ex>%s</ph> angemeldet',"en-au":'Signed up with <ph name="EMAIL"><ex>[email protected]</ex>%s</ph> for the newsletter',"en-ca":'Signed up with <ph name="EMAIL"><ex>[email protected]</ex>%s</ph> for the newsletter',"en-gb":'Signed up with <ph name="EMAIL"><ex>[email protected]</ex>%s</ph> for the newsletter',"en-us":'Signed up with <ph name="EMAIL"><ex>[email protected]</ex>%s</ph> for the newsletter',es:'Te has suscrito a la newsletter con <ph name="EMAIL"><ex>[email protected]</ex>%s</ph>',"es-419":'Te registraste con <ph name="EMAIL"><ex>[email protected]</ex>%s</ph> para recibir el boletÃn informativo',fr:'S\'est abonné à la newsletter avec <ph name="EMAIL"><ex>[email protected]</ex>%s</ph>',"fr-ca":"Vous êtes inscrit au bulletin d'information avec l'adresse <ph name=\"EMAIL\"><ex>[email protected]</ex>%s</ph>",hi:'नà¥à¤¯à¥à¥à¤²à¥à¤à¤° पानॠà¤à¥ लिà¤, <ph name="EMAIL"><ex>[email protected]</ex>%s</ph> सॠसाà¤à¤¨ à¤
प à¤à¤¿à¤¯à¤¾ à¤à¤¯à¤¾',id:'Mendaftar dengan <ph name="EMAIL"><ex>[email protected]</ex>%s</ph> untuk mendapatkan newsletter',it:'Iscrizione alla newsletter con l\'indirizzo <ph name="EMAIL"><ex>[email protected]</ex>%s</ph> effettuata',ja:'<ph name="EMAIL"><ex>[email protected]</ex>%s</ph> ã§ãã¥ã¼ã¹ã¬ã¿ã¼ãç»é²ãã¾ãã',ko:'<ph name="EMAIL"><ex>[email protected]</ex>%s</ph>(ì¼)ë¡ ë´ì¤ë í°ì ê°ì
íìµëë¤.',ms:'Mendaftar dengan <ph name="EMAIL"><ex>[email protected]</ex>%s</ph> untuk surat berita',nl:'Aangemeld met <ph name="EMAIL"><ex>[email protected]</ex>%s</ph> voor de nieuwsbrief',no:'Du har registrert deg for nyhetsbrevet med <ph name="EMAIL"><ex>[email protected]</ex>%s</ph>',pl:'Zapisano siÄ na newsletter za pomocÄ
adresu <ph name="EMAIL"><ex>[email protected]</ex>%s</ph>',pt:'Inscreveu-se com <ph name="EMAIL"><ex>[email protected]</ex>%s</ph> no boletim informativo',"pt-br":'Inscrição na newsletter feita com o e-mail <ph name="EMAIL"><ex>[email protected]</ex>%s</ph>',ru:'ÐÑ Ð¿Ð¾Ð´Ð¿Ð¸ÑалиÑÑ Ð½Ð° новоÑÑнÑÑ ÑаÑÑÑлкÑ, иÑполÑзÑÑ Ð°ÐºÐºÐ°ÑÐ½Ñ <ph name="EMAIL"><ex>[email protected]</ex>%s</ph>.',sv:'Du registrerade dig för nyhetsbrevet med <ph name="EMAIL"><ex>[email protected]</ex>%s</ph>',th:'ลà¸à¸à¸·à¹à¸à¹à¸à¹à¸²à¹à¸à¹à¸à¹à¸§à¸¢ <ph name="EMAIL"><ex>[email protected]</ex>%s</ph> สำหรัà¸à¸à¸à¸«à¸¡à¸²à¸¢à¸à¹à¸²à¸§',tr:'Bülten için <ph name="EMAIL"><ex>[email protected]</ex>%s</ph> ile kaydoldunuz',uk:'Ðи пÑдпиÑалиÑÑ Ð½Ð° ÑнÑоÑмаÑÑÐ¹Ð½Ñ Ð»Ð¸ÑÑи на елекÑÑÐ¾Ð½Ð½Ñ Ð°Ð´ÑеÑÑ <ph name="EMAIL"><ex>[email protected]</ex>%s</ph>',"zh-cn":'å·²ä½¿ç¨ <ph name="EMAIL"><ex>[email protected]</ex>%s</ph> 订é
ç®æ¥',"zh-hk":'å·²ä½¿ç¨ <ph name="EMAIL"><ex>[email protected]</ex>%s</ph> 註åéè¨',"zh-tw":'å·²ä½¿ç¨ <ph name="EMAIL"><ex>[email protected]</ex>%s</ph> è¨é±é»åå ±'},It={en:"No membership found",ar:"ÙÙ
ÙØªÙ
Ø§ÙØ¹Ø«Ùر عÙ٠أ٠اشتراÙ.",de:"Keine Mitgliedschaftsdaten gefunden","en-au":"No membership found","en-ca":"No membership found","en-gb":"No membership found","en-us":"No membership found",es:"No se han encontrado suscripciones","es-419":"No se encontró ninguna membresÃa",fr:"Aucun abonnement trouvé","fr-ca":"Aucun abonnement trouvé",hi:"पà¥à¤¸à¥ à¤à¥à¤à¤¾à¤à¤° लॠà¤à¤¾à¤¨à¥ वालॠà¤à¥à¤ सदसà¥à¤¯à¤¤à¤¾ नहà¥à¤ मिलà¥",id:"Langganan tidak ditemukan",it:"Nessun abbonamento trovato",ja:"ã¡ã³ãã¼ã·ãããè¦ã¤ããã¾ãã",ko:"멤ë²ì ì 보를 ì°¾ì ì ììµëë¤.",ms:"Tiada keahlian ditemukan",nl:"Geen lidmaatschap gevonden",no:"Fant ingen abonnementer",pl:"Nie znaleziono subskrypcji",pt:"Nenhuma subscrição encontrada","pt-br":"Nenhuma assinatura foi encontrada",ru:"ÐодпиÑка не найдена.",sv:"Inget medlemskap hittades",th:"à¹à¸¡à¹à¸à¸à¸à¸²à¸£à¹à¸à¹à¸à¸ªà¸¡à¸²à¸à¸´à¸",tr:"Ãyelik bulunamadı",uk:"ÐÐµÐ¼Ð°Ñ Ð¿ÑдпиÑок","zh-cn":"æªæ¾å°ä¼åèµæ","zh-hk":"æ¾ä¸å°æç±","zh-tw":"æ¾ä¸å°æå¡è³æ"},yt={en:"Close dialog",ar:"Ø¥ØºÙØ§Ù Ù
Ø±Ø¨ÙØ¹ Ø§ÙØÙØ§Ø±",de
1:"Dialogfeld schlieÃen","en-au":"Close dialog","en-ca":"Close dialog","en-gb":"Close dialog","en-us":"Close dialog",es:"Cerrar cuadro de diálogo","es-419":"Cerrar diálogo",fr:"Fermer la boîte de dialogue","fr-ca":"Fermer la boîte de dialogue",hi:"डायलà¥à¤ बà¥à¤à¥à¤¸ बà¤à¤¦ à¤à¤°à¥à¤",id:"Tutup dialog",it:"Chiudi la finestra di dialogo",ja:"ãã¤ã¢ãã°ãéãã",ko:"ëíìì ë«ê¸°",ms:"Tutup dialog",nl:"Dialoogvenster sluiten",no:"Lukk dialogboksen",pl:"Zamknij okno",pt:"Fechar caixa de diálogo","pt-br":"Fechar caixa de diálogo",ru:"ÐакÑÑÑÑ Ð´Ð¸Ð°Ð»Ð¾Ð³Ð¾Ð²Ð¾Ðµ окно",sv:"Stäng dialogrutan",th:"à¸à¸´à¸à¸à¸¥à¹à¸à¸à¹à¸à¹à¸à¸à¸",tr:"İletiÅim kutusunu kapat",uk:"ÐакÑиÑи вÑкно","zh-cn":"å
³éå¯¹è¯æ¡","zh-hk":"éå°è©±æ¡","zh-tw":"ééå°è©±æ¹å¡"},St={en:"Contribute",ar:"Ù
ساÙÙ
Ø©",de:"Beitragen","en-au":"Contribute","en-ca":"Contribute","en-gb":"Contribute","en-us":"Contribute",es:"Contribuir","es-419":"Contribuir",fr:"Contribuer","fr-ca":"Faire une contribution",hi:"यà¥à¤à¤¦à¤¾à¤¨ दà¥à¤",id:"Beri kontribusi",it:"Contribuisci",ja:"å¯ä»",ko:"íì",ms:"Sumbang",nl:"Bijdragen",no:"Bidra",pl:"Przekaż darowiznÄ",pt:"Contribuir","pt-br":"Contribuir",ru:"СделаÑÑ Ð²Ð·Ð½Ð¾Ñ",sv:"Bidra",th:"สà¸à¸±à¸à¸ªà¸à¸¸à¸",tr:"Katkıda bulun",uk:"ÐÑобиÑи внеÑок","zh-cn":"æèµ ","zh-hk":"è³å©","zh-tw":"ææ¬¾"},Ct={en:"Subscribe",ar:"اشتراÙ",de:"Abonnieren","en-au":"Subscribe","en-ca":"Subscribe","en-gb":"Subscribe","en-us":"Subscribe",es:"Suscribirme","es-419":"Suscribirse",fr:"S'abonner","fr-ca":"S'abonner",hi:"सदसà¥à¤¯à¤¤à¤¾ लà¥à¤",id:"Langganan",it:"Iscriviti",ja:"è³¼èª",ko:"구ë
",ms:"Langgan",nl:"Abonneren",no:"Abonner",pl:"Subskrybuj",pt:"Subscrever","pt-br":"Fazer inscrição",ru:"ÐодпиÑаÑÑÑÑ",sv:"Prenumerera",th:"สมัà¸à¸£à¸ªà¸¡à¸²à¸à¸´à¸",tr:"Abone ol",uk:"ÐÑдпиÑаÑиÑÑ","zh-cn":"订é
","zh-hk":"è¨é±","zh-tw":"è¨é±"},Ot={en:"Already a contributor?",ar:"ÙÙ Ø£ÙØª Ù
ساÙÙ
ØØ§ÙÙØ",de:"Du bist schon Beitragende/r?","en-au":"Already a contributor?","en-ca":"Already a contributor?","en-gb":"Already a contributor?","en-us":"Already a contributor?",es:"¿Ya has contribuido?","es-419":"¿Ya contribuyes?",fr:"Déjà contributeur ?","fr-ca":"Vous êtes déjà contributeur?",hi:"à¤à¥à¤¯à¤¾ à¤à¤ªà¤¨à¥ पहलॠयà¥à¤à¤¦à¤¾à¤¨ दिया हà¥?",id:"Sudah menjadi kontributor?",it:"Hai già dato contributi?",ja:"ãã§ã«å¯ä»ãã¦ãã¾ããï¼",ko:"ì´ë¯¸ íìíê³ ê³ì ê°ì?",ms:"Sudah menjadi penyumbang?",nl:"Ben je al een bijdrager?",no:"Har du allerede bidratt?",pl:"Już przekazujesz darowizny?",pt:"Já contribui?","pt-br":"Já faz contribuições?",ru:"Уже делаеÑе взноÑÑ?",sv:"Ãr du redan en bidragsgivare?",th:"หาà¸à¹à¸à¹à¸à¸à¸¹à¹à¸ªà¸à¸±à¸à¸ªà¸à¸¸à¸à¸à¸¢à¸¹à¹à¹à¸¥à¹à¸§",tr:"Halihazırda katkıda bulunuyor musunuz?",uk:"Уже ÑобиÑе внеÑки?","zh-cn":"å·²æ¯æèµ è
ï¼","zh-hk":"å·²æ¯è³å©è
ï¼","zh-tw":"å·²ç¶æ¯ææ¬¾è
äºåï¼"},Nt={en:"Already a subscriber?",ar:"ÙÙ Ø£ÙØª Ù
Ø´ØªØ±Ù ØØ§ÙÙØ",de:"Du bist bereits Abonnent/in?","en-au":"Already a subscriber?","en-ca":"Already a subscriber?","en-gb":"Already a subscriber?","en-us":"Already a subscriber?",es:"¿Ya te has suscrito?","es-419":"¿Ya te suscribiste?",fr:"Déjà abonné ?","fr-ca":"Vous êtes déjà abonné?",hi:"à¤à¥à¤¯à¤¾ à¤à¤ªà¤¨à¥ पहलॠहॠसदसà¥à¤¯à¤¤à¤¾ लॠलॠहà¥?",id:"Sudah berlangganan?",it:"Hai già l'abbonamento?",ja:"è³¼èªæ¸ã¿ã§ããï¼",ko:"ì´ë¯¸ 구ë
ì¤ì´ì ê°ì?",ms:"Sudah menjadi pelanggan?",nl:"Ben je al abonnee?",no:"Er du allerede abonnent?",pl:"Już subskrybujesz?",pt:"Já subscreve?","pt-br":"Já é assinante?",ru:"Уже подпиÑанÑ?",sv:"Prenumererar du redan?",th:"หาà¸à¹à¸à¹à¸à¸ªà¸¡à¸²à¸à¸´à¸à¸à¸¢à¸¹à¹à¹à¸¥à¹à¸§",tr:"Halihazırda abone misiniz?",uk:"Уже пÑдпиÑалиÑÑ?","zh-cn":"已订é
ï¼","zh-hk":"å·²ç¶æ¯è¨é±è
ï¼","zh-tw":"å·²ç¶æ¯è¨é±è
äºåï¼"},At={en:"Thanks for viewing this ad",ar:"ÙØ´Ùر٠عÙÙ Ù
Ø´Ø§ÙØ¯Ø© ÙØ°Ø§ Ø§ÙØ¥Ø¹ÙاÙ.",de:"Vielen Dank, dass du dir diese Anzeige angesehen hast","en-au":"Thanks for viewing this ad","en-ca":"Thanks for viewing this ad","en-gb":"Thanks for viewing this ad","en-us":"Thanks for viewing this ad",es:"Gracias por ver este anuncio","es-419":"Gracias por ver este anuncio",fr:"Merci d'avoir regardé cette annonce","fr-ca":"Merci d'avoir regardé cette annonce",hi:"यह विà¤à¥à¤à¤¾à¤ªà¤¨ दà¥à¤à¤¨à¥ à¤à¥ लिठधनà¥à¤¯à¤µà¤¾à¤¦",id:"Terima kasih telah melihat iklan ini",it:"Grazie per aver visualizzato questo annuncio",ja:"ãã®åºåãã覧ããã ããããã¨ããããã¾ã",ko:"ì´ ê´ê³ 를 ìì²í´ 주ì
ì ê°ì¬í©ëë¤.",ms:"Terima kasih kerana menonton iklan ini",nl:"Bedankt dat je deze advertentie hebt bekeken",no:"Takk for at du sÃ¥ pÃ¥ denne annonsen",pl:"DziÄkujemy za obejrzenie tej reklamy",pt:"Obrigado por ver este anúncio","pt-br":"Agradecemos por assistir este anúncio",ru:"СпаÑибо, ÑÑо поÑмоÑÑели ÑÑÑ ÑекламÑ!",sv:"Tack för att du tittade pÃ¥ den här annonsen",th:"à¸à¸à¸à¸à¸¸à¸à¸à¸µà¹à¸à¸¹à¹à¸à¸©à¸à¸²à¸à¸µà¹",tr:"Bu reklamı görüntülediÄiniz için teÅekkür ederiz",uk:"ÐÑкÑÑмо, Ñо пеÑеглÑнÑли Ñе оголоÑеннÑ","zh-cn":"æè°¢è§çæ¤å¹¿å","zh-hk":"æè¬è§çæ¤å»£å","zh-tw":"æè¬è§çéå廣å"},vt={en:"View an ad",ar:"عرض Ø¥Ø¹ÙØ§Ù",de:"Anzeige ansehen","en-au":"View an ad","en-ca":"View an ad","en-gb":"View an ad","en-us":"View an ad",es:"Ver un anuncio","es-419":"Ver un anuncio",fr:"Visionner une annonce","fr-ca":"Afficher une annonce",hi:"à¤à¥à¤ विà¤à¥à¤à¤¾à¤ªà¤¨ दà¥à¤à¥à¤",id:"Lihat iklan",it:"Visualizza un annuncio",ja:"åºåã表示",ko:"ê´ê³ 보기",ms:"Lihat iklan",nl:"Een advertentie bekijken",no:"Se en annonsv",pl:"Obejrzyj reklamÄ",pt:"Mostrar um anúncio","pt-br":"Ver anúncio",ru:"ÐоÑмоÑÑеÑÑ ÑекламÑ",sv:"Se en annons",th:"à¸à¸¹à¹
1à¸à¸©à¸à¸²",tr:"Reklam izle",uk:"ÐеÑеглÑнÑÑи оголоÑеннÑ","zh-cn":"è§ç广å","zh-hk":"è§ç廣å","zh-tw":"è§ç廣å"},Rt={en:"Back to homepage",ar:"Ø§ÙØ±Ø¬Ùع Ø¥ÙÙ Ø§ÙØµÙØØ© Ø§ÙØ±Ø¦ÙØ³ÙØ©",de:"Zurück zur Startseite","en-au":"Back to homepage","en-ca":"Back to homepage","en-gb":"Back to homepage","en-us":"Back to homepage",es:"Volver a la página principal","es-419":"Volver a la página principal",fr:"Retourner à la page d'accueil","fr-ca":"Retour à la page d'accueil",hi:"हà¥à¤® पà¥à¤ पर वापस à¤à¤¾à¤à¤",id:"Kembali ke halaman beranda",it:"Torna alla home page",ja:"ãã¼ã ãã¼ã¸ã«æ»ã",ko:"ííì´ì§ë¡ ëìê°ê¸°",ms:"Kembali kepada halaman utama",nl:"Terug naar homepage",no:"Tilbake til startsiden",pl:"Powrót do strony gÅównej",pt:"Volte à página inicial","pt-br":"Voltar à página inicial",ru:"ÐеÑнÑÑÑÑÑ Ð½Ð° главнÑÑ ÑÑÑаниÑÑ",sv:"Tillbaka till startsidan",th:"à¸à¸¥à¸±à¸à¹à¸à¸à¸µà¹à¸«à¸à¹à¸²à¹à¸£à¸",tr:"Ana sayfaya geri dön",uk:"Ðазад на Ð³Ð¾Ð»Ð¾Ð²Ð½Ñ ÑÑоÑÑнкÑ","zh-cn":"è¿åé¦é¡µ","zh-hk":"è¿åé¦é ","zh-tw":"è¿åé¦é "},Pt=1,xt="USER_TOKEN",Lt="READ_TIME",Mt="ents",kt="isreadytopay",Dt="subscribe.google.com:rk",Ut="toast",Gt={PPS_TAXONOMIES:"ppstaxonomies"};function jt(t,e,i,s){const n=t.createElement(e);return function(t,e={}){for(const[i,s]of Object.entries(e))t.setAttribute(i,s)}(n,i),s&&(n.textContent=s),n}function Ft(t){t.parentElement&&t.parentElement.removeChild(t)}function zt(t,e){var i;const s=jt(t.getWin().document,"style",{type:"text/css"});return s.textContent=e,null==(i=t.getHead())||i.appendChild(s),s}function Bt(t){let e=t;do{if(e.nextSibling)return!0}while(e=e.parentNode);return!1}const Wt={"align-content":"normal",animation:"none","align-items":"normal","align-self":"auto","alignment-baseline":"auto","backface-visibility":"hidden","background-clip":"border-box","background-image":"none","baseline-shift":"0","block-size":"auto",border:"none","border-collapse":"separate",bottom:"0","box-sizing":"border-box","break-after":"auto","break-before":"auto","break-inside":"auto","buffered-rendering":"auto","caption-side":"top","caret-color":"rgb(51, 51, 51)",clear:"none",color:"rgb(51, 51, 51)","color-rendering":"auto","column-count":"auto","column-fill":"balance","column-gap":"normal","column-rule-color":"rgb(51, 51, 51)","column-rule-style":"none","column-rule-width":"0","column-span":"none","column-width":"auto",contain:"none","counter-increment":"none","counter-reset":"none",cursor:"auto",direction:"inherit",display:"block","empty-cells":"show",filter:"none",flex:"none","flex-flow":"row nowrap",float:"none","flood-color":"rgb(0, 0, 0)","flood-opacity":"1",font:"none","font-size":"medium","font-family":"",height:"auto",hyphens:"manual","image-rendering":"auto","inline-size":"",isolation:"auto","justify-content":"normal","justify-items":"normal","justify-self":"auto","letter-spacing":"normal","lighting-color":"rgb(255, 255, 255)","line-break":"auto","line-height":"normal","margin-bottom":"0",mask:"none","max-block-size":"none","max-height":"none","max-inline-size":"none","max-width":"none","min-block-size":"none","min-height":"0","min-inline-size":"0","min-width":"0","mix-blend-mode":"normal","object-fit":"fill","offset-distance":"none","offset-path":"none","offset-rotate":"auto 0deg",opacity:"1",order:"0",orphans:"2",outline:"none","overflow-anchor":"auto","overflow-wrap":"normal",overflow:"visible",padding:"0",page:"",perspective:"none","pointer-events":"auto",position:"static",quotes:"",resize:"none",right:"0","scroll-behavior":"auto","tab-size":"8","table-layout":"auto","text-align":"start","text-align-last":"auto","text-anchor":"start","text-combine-upright":"none","text-decoration":"none","text-indent":"0","text-orientation":"mixed","text-overflow":"clip","text-rendering":"auto","text-shadow":"none","text-size-adjust":"auto","text-transform":"none","text-underline-position":"auto",top:"auto","touch-action":"auto",transform:"none",transition:"none 0s ease 0s","unicode
1-bidi":"normal","user-select":"auto","vector-effect":"none","vertical-align":"baseline",visibility:"visible","white-space":"normal",widows:"2","word-break":"normal","word-spacing":"0","word-wrap":"normal","writing-mode":"horizontal-tb",zoom:"1","z-index":"auto"};function Vt(t,e){for(const[i,s]of Object.entries(e))t.style.setProperty(i,s.toString(),"important")}function Yt(t,e,i){t.style.setProperty(e,i)}async function qt(t,e,i,s){const n=t.ownerDocument.defaultView,r=t.style.transition||"";await new Promise((r=>{n.setTimeout((()=>{n.setTimeout(r,i);const o="".concat(i,"ms ").concat(s);Vt(t,Object.assign({transition:"transform ".concat(o,", opacity ").concat(o)},e))}))})),Vt(t,{transition:r})}const Kt={height:"0"},Ht={frameborder:"0",scrolling:"no",class:"swg-toast"};class $t{constructor(t,e,i={}){this.Xt=e,this.Zt=i,this.te=null,this.ee=t.doc(),this.ie=t.activities(),this.se=jt(this.ee.getWin().document,"iframe",Ht),Vt(this.se,Kt)}getElement(){return this.se}open(){var t;return null==(t=this.ee.getBody())||t.appendChild(this.se),this.ne()}async ne(){const t=await this.ie.openIframe(this.se,this.Xt,this.Zt);await t.whenReady(),function(t){for(const e of["height"])Yt(t,e,"")}(this.se),this.te=this.re({callback:()=>(Vt(this.se,{transform:"translateY(100%)",opacity:"1",visibility:"visible"}),qt(this.se,{transform:"translateY(0)",opacity:"1",visibility:"visible"},400,"ease-out"))}),this.ee.getWin().setTimeout((()=>{this.close()}),8e3)}async re({callback:t}){await this.te;try{await t()}catch{}}close(){return this.te=this.re({callback:()=>(this.ee.getWin().setTimeout((()=>{var t;null==(t=this.ee.getBody())||t.removeChild(this.se)}),500),qt(this.se,{transform:"translateY(100%)",opacity:"1",visibility:"visible"},400,"ease-out"))}),this.te}}function Jt(t){return"AbortError"===(null==t?void 0:t.name)}function Qt(t){const e=new Error("AbortError: "+t);return e.name="AbortError",e}class Xt{static throwAsync(t){setTimeout((()=>{throw t}))}}function Zt(...t){/swg.debug=1/.test(self.location.hash)&&(t.unshift("[Subscriptions]"),te(...t))}function te(...t){console.log(...t)}function ee(...t){console.warn(...t)}function ie(t,e="Assertion failed",...i){if(t)return;const s=e.split("%s");let n=s.shift();for(const r of i){const t=s.shift();n+=se(r)+t}throw new Error(n)}function se(t){const e=t;return 1==(null==e?void 0:e.nodeType)?e.tagName.toLowerCase()+(e.id?"#"+e.id:""):String(t)}const ne=self.document.createElement("a"),re={};function oe(t){const e=re[t];if(e)return e;const i=function(t,e){t.href=e;const i={href:t.href,protocol:t.protocol,host:t.host,hostname:t.hostname,port:"0"==t.port?"":t.port,pathname:t.pathname,search:t.search,hash:t.hash,origin:t.protocol+"//"+t.host};return t.origin&&"null"!==t.origin?i.origin=t.origin:"data:"!==i.protocol&&i.host||(i.origin=i.href),i}(ne,t);return re[t]=i}function ae(t){return t?(/^[?#]/.test(t)?t.slice(1):t).split("&").reduce(((t,e)=>{const i=e.split("=");try{const e=decodeURIComponent(i[0]||""),s=decodeURIComponent(i[1]||"");e&&(t[e]=s)}catch{ee("SwG could not parse a URL query param: ".concat(i[0]))}return t}),{}):{}}function he(t,e,i){const s=t.indexOf("?"),n=t.indexOf("#");let r="";return-1!=n&&(r=t.substring(n),t=t.substring(0,n)),-1==s?t+="?":s<t.length-1&&(t+="&"),(t+=encodeURIComponent(e)+"="+encodeURIComponent(i))+r}function le(t){return JSON.stringify(t.toArray(!1))}function ue(t){const e=t.getRootNode().querySelector("link[rel='canonical']");return null==e?void 0:e.href}function ce(t){const e=t.getRootNode();return ue(t)||e.location.origin+e.location.pathname}const de=oe(self.window.location.href);oe(self.document.referrer);const pe={[pt.TYPE_SUBSCRIPTION]:"/subscriptionoffersiframe",[pt.TYPE_CONTRIBUTION]:"/contributionoffersiframe",[pt.TYPE_REGISTRATION_WALL]:"/regwalliframe",[pt.TYPE_NEWSLETTER_SIGNUP]:"/newsletteriframe",[pt.TYPE_REWARDED_SURVEY]:"/surveyiframe",[pt.TYPE_BYO_CTA]:"/byoctaiframe",[pt.TYPE_REWARDED_AD]:"/rewardedadiframe"},ge=/^(\)\]\}'\n)/;class me{constructor(t){this.oe=t}async fetchCredentialedJson(t){const e=await this.fetch(t,{method:"GET",headers:{Accept:"text/plain, application/json"},credentials:"include"}),i=(await e.text()).replace(ge,"");return JSON.parse(i)}async sendPost(t,e){const i={method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded;charset=UTF-8"},credentials:"include",body:"f.req="+le(e)},s=await this.fetch(t,i);if(!s)return{};const n=await s.text();try{const t=n.replace(ge,"");return JSON.parse(t)}catch(r){return Xt.throwAsync(r),{}}}async fetch(t,e){try{return await this.oe.fetch(t,e)}catch(i){const e=oe(t).origin;throw new Error("XHR Failed fetching (".concat(e,"/...): (Note: a CORS error above may indicate that this publisher or domain is not configured in Publisher Center. The CORS error happens because 4xx responses do not set CORS headers.)\n\n")+i)}}sendBeacon(t,e){const i=new Blob(["f.req="+le(e)],{type:"application/x-www-form-urlencoded;charset=UTF-8"});navigator.sendBeacon(t,i)}}const fe={zero:"0",nocache:"1",hr1:"3600000",hr12:"43200000"},we={default:{frontEnd:e,payEnv:"PRODUCTION",playEnv:"PROD",feCache:"nocache"},prod:{frontEnd:"https://news.google.com",payEnv:"PRODUCTION",playEnv:"PROD",feCache:"nocache"},autopush:{frontEnd:"https://subscribe-autopush.sandbox.google.com",payEnv:"PRODUCTION",playEnv:"AUTOPUSH",feCache:"nocache"},qual:{frontEnd:"https://subscribe-qual.sandbox.google.com",payEnv:"SANDBOX",playEnv:"STAGING",feCache:"nocache"}};function Ee(){const t=ae(self.location.hash)["swg.mode"];return t&&we[t]?we[t]:we.default}function be(){return oe(Ee().frontEnd).origin}function Te(t){const e=ae(self.location.hash)["swg.experiments"];return void 0!==e&&(t=he(t,"e",e)),"".concat(Ee().frontEnd,"/swg/_/api/v1")+t}function Ie(t){return"https://pubads.g.doubleclick.net"+t}function ye(t,e={},i=""){const s=i?"swg/".concat(i):"swg";t=function(t){return he(t,"_",function(t){const e=Number(fe[t]||1);if(0===e)return"_";const i=Date.now();return String(e<=1?i:Math.floor(i/e))} 2/** 3 * @license 4 * Copyright Google LLC 5 * SPDX-License-Identifier: Apache-2.0 6 */(Ee().feCache))}("".concat(Ee().frontEnd,"/").concat(s,"/ui/v1").concat(t));const n=ae(self.location.hash),r=n["swg.boqjsmode"];void 0!==r&&(t=he(t,"jsmode",r));const o=n["swg.experiments"];void 0!==o&&(t=he(t,"e",o));for(const a in e)t=he(t,a,e[a]);return t}function Se(t){return Object.assign(t,{_client:"SwG ".concat(i)})}const Ce={}; 7/** 8 * @license 9 * Copyright Google LLC 10 * SPDX-License-Identifier: Apache-2.0 11 */let Oe,Ne=globalThis.trustedTypes; 12/** 13 * @license 14 * Copyright Google LLC 15 * SPDX-License-Identifier: Apache-2.0 16 */ 17class Ae{constructor(t,e){this.privateDoNotAccessOrElseWrappedHtml=e}toString(){return this.privateDoNotAccessOrElseWrappedHtml+""}}const ve=Ae; 18/** 19 * @license 20 * Copyright Google LLC 21 * SPDX-License-Identifier: Apache-2.0 22 */ 23function Re(t,e){return function(t){return t instanceof Ae}(t)?t:function(t){const e=t,i=(void 0===Oe&&(Oe=function(){let t=null;if(!Ne)return t;try{const e=t=>t;t=Ne.createPolicy("google#safe",{createHTML:e,createScript:e,createScriptURL:e})}catch(e){}return t}()),Oe);return function(t){return new ve(Ce,t)}(i?i.createHTML(e):e)}(String(t).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'"))}function Pe(t,e){const i=t.en;if("object"!=typeof t||!e)return i;let s="string"==typeof e?e:(n=e).lang?n.lang:(null==(o=null==(r=null==n?void 0:n.ownerDocument)?void 0:r.documentElement)?void 0:o.lang)?n.ownerDocument.documentElement.lang:"en";var n,r,o;s=s.toLowerCase(),s=s.replace(/_/g,"-");const a=s.split("-");for(;a.length;){const e=a.join("-");if(e in t)return t[e];a.pop()}return i}class xe{constructor(t,e,i=1e4,s=3e3){this.ae=t,this.V=e,this.he=i,this.le=s,this.ue=t.clientConfigManager(),this.ee=t.doc().getRootNode(),this.ce=this.pe(),this.ge=this.me(),this._e=new me(t.win()),this.fe=t.eventManager(),this.we=t.entitlementsManager(),this.rewardedSlotReadyHandler=this.Ee.bind(this),this.rewardedSlotClosedHandler=this.be.bind(this),this.rewardedSlotGrantedHandler=this.Te.bind(this),this.slotRenderEndedHandler=this.Ie.bind(this)}me(){const t=jt(this.ee,"div",{class:"audience-action-local-wrapper"});Vt(t,{all:"unset","background-color":"rgba(32, 33, 36, 0.6)",border:"none",bottom:"0",height:"100%",left:"0",opacity:"0","pointer-events":"auto",position:"fixed",right:"0",transition:"opacity 0.5s",top:"0",width:"100%","z-index":"2147483646"}),this.V.isClosable&&(t.onclick=this.close.bind(this));const e=t.attachShadow({mode:"open"}
23),i=jt(this.ee,"audience-action-top-sentinal",{tabindex:"0"});return i.addEventListener("focus",this.ye.bind(this)),this.Se=jt(this.ee,"audience-action-bottom-sentinal",{tabindex:"0"}),this.Se.addEventListener("focus",this.Ce.bind(this)),e.appendChild(i),e.appendChild(this.ce),e.appendChild(this.Se),t}pe(){const t=jt(this.ee,"div",{});return Vt(t,{height:"100%",display:"flex","display-flex-direction":"column","pointer-events":"none"}),t.onclick=t=>{t.stopPropagation()},t}Oe(){this.ce.innerHTML=nt}Ne(){var t,e,i,s;this.V.isClosable||this.V.monetizationFunction||this.fe.logSwgEvent(o.IMPRESSION_REWARDED_AD_ERROR),this.cleanUpGoogletag(),null==(e=(t=this.V).onCancel)||e.call(t),null==(s=(i=this.V).monetizationFunction)||s.call(i),this.triggerRewardedAdOnResultCallback(!1,!1)}Ae(){this.ce.innerHTML=ot}async ve(){var t,e;this.V.action===pt.TYPE_REWARDED_AD?await this.Re():this.V.action===pt.TYPE_NEWSLETTER_SIGNUP?await this.Pe():(null==(e=(t=this.V).onCancel)||e.call(t),this.V.isClosable||(this.Oe(),this.xe()))}async Pe(){var t,e;this.Ae(),this.xe(),this.fe.logSwgEvent(o.IMPRESSION_BYOP_NEWSLETTER_OPT_IN);const i=await this.Le(),s=null==(t=null==i?void 0:i.optInParameters)?void 0:t.rawCodeSnippet;s&&"PREFERENCE_PUBLISHER_PROVIDED_PROMPT"===(null==(e=null==i?void 0:i.optInParameters)?void 0:e.promptPreference)?this.Me(s):(this.fe.logSwgEvent(o.EVENT_BYOP_NEWSLETTER_OPT_IN_CONFIG_ERROR),this.Oe())}Me(t){var e,i,s;const n=jt(this.ee,"div",{}),r=this.ke(it);n.innerHTML=r.concat(t);const a=n.querySelector("form");a&&this.ge?(Vt(n,{"background-color":"white",border:"none","border-top-left-radius":"20px","border-top-right-radius":"20px",bottom:"0",left:"50%","max-height":"90%","max-width":"100%","pointer-events":"auto",position:"fixed",overflow:"auto","text-align":"center",transform:"translate(-50%, 0)","z-index":"2147483646"}),n.onclick=t=>{t.stopPropagation()},null==(e=this.ge.shadowRoot)||e.removeChild(this.ce),null==(i=this.ge.shadowRoot)||i.appendChild(n),this.De(),null==(s=n.querySelector(".opt-in-close-button"))||s.addEventListener("click",this.Ue.bind(this)),a.addEventListener("submit",this.Ge.bind(this))):(this.fe.logSwgEvent(o.EVENT_BYOP_NEWSLETTER_OPT_IN_CODE_SNIPPET_ERROR),this.Oe())}De(){var t;null==(t=this.ge.shadowRoot)||t.appendChild(this.Se),this.je().length>0&&this.je()[0].focus()}async Ge(){Vt(this.ge,{opacity:"0"}),this.fe.logSwgEvent(o.ACTION_BYOP_NEWSLETTER_OPT_IN_SUBMIT),await this.t(),await this.Fe(1e3),this.ze()}async Fe(t){return new Promise((e=>this.ae.win().setTimeout(e,t)))}Ue(){var t,e;this.fe.logSwgEvent(o.ACTION_BYOP_NEWSLETTER_OPT_IN_CLOSE),this.V.isClosable&&(this.ze(),null==(e=(t=this.V).onCancel)||e.call(t))}isSubscription(){var t,e,i;return this.V.autoPromptType===W.SUBSCRIPTION||this.V.autoPromptType===W.SUBSCRIPTION_LARGE||!this.V.autoPromptType&&!!(null==(i=null==(e=null==(t=this.config)?void 0:t.publication)?void 0:e.revenueModel)?void 0:i.subscriptions)}isContribution(){var t,e,i;return this.V.autoPromptType===W.CONTRIBUTION||this.V.autoPromptType===W.CONTRIBUTION_LARGE||!this.V.autoPromptType&&!!(null==(i=null==(e=null==(t=this.config)?void 0:t.publication)?void 0:e.revenueModel)?void 0:i.contributions)}async Be(){var t,e;const i=this.ae.win();return!((null==(t=i.googletag)?void 0:t.apiReady)&&!(null==(e=i.googletag)?void 0:e.getVersion()))&&new Promise((t=>{const e=setTimeout((()=>t(!1)),this.he);i.googletag=i.googletag||{cmd:[]},i.googletag.cmd.push((()=>{clearTimeout(e),t(!0)}))}))}async Re(){var t,e,i;this.fe.logSwgEvent(o.EVENT_REWARDED_AD_FLOW_INIT);const[s,n]=await Promise.all([this.Le(),this.Be()]);return n?(null==(t=null==s?void 0:s.rewardedAdParameters)?void 0:t.adunit)&&(null==(e=null==s?void 0:s.rewardedAdParameters)?void 0:e.customMessage)&&(null==(i=null==s?void 0:s.publication)?void 0:i.name)?(this.config=s,this.ae.win().googletag.cmd.push(this.We.bind(this)),void(this.Ve=setTimeout((()=>{this.fe.logSwgEvent(o.EVENT_REWARDED_AD_GPT_ERROR),this.Ne()}),this.he))):(this.fe.logSwgEvent(o.EVENT_REWARDED_AD_CONFIG_ERROR),void this.Ne()):(this.fe.logSwgEvent(o.EVENT_REWARDED_AD_GPT_MISSING_ERROR),void this.Ne())}
23We(){const t=this.ae.win().googletag;if(this.Ye=t.defineOutOfPageSlot(this.config.rewardedAdParameters.adunit,t.enums.OutOfPageFormat.REWARDED),!this.Ye)return this.fe.logSwgEvent(o.EVENT_REWARDED_AD_PAGE_ERROR),void this.Ne();this.Ye.addService(t.pubads()),t.pubads().addEventListener("rewardedSlotReady",this.rewardedSlotReadyHandler),t.pubads().addEventListener("rewardedSlotClosed",this.rewardedSlotClosedHandler),t.pubads().addEventListener("rewardedSlotGranted",this.rewardedSlotGrantedHandler),t.pubads().addEventListener("slotRenderEnded",this.slotRenderEndedHandler),t.enableServices(),t.display(this.Ye),t.pubads().refresh([this.Ye])}Ie(t){t.slot===this.Ye&&t.isEmpty&&(clearTimeout(this.Ve),this.fe.logSwgEvent(o.EVENT_REWARDED_AD_NOT_FILLED),ee("Rewarded ad slot could not be filled"),this.Ne())}Ee(t){var e,i,s,n;clearTimeout(this.Ve),this.qe=t.makeRewardedVisible;const r=!this.isContribution()&&!this.isSubscription(),a=this.ue.getLanguage(),h=Re(this.config.publication.name).toString(),l=this.ke(tt),u=Re(this.config.rewardedAdParameters.customMessage).toString(),c=Pe(vt,a),d=this.isSubscription()||this.V.onAlternateAction?Pe(Ct,a):Pe(St,a),p=!this.V.onAlternateAction&&r?"":ht.replace("$SUPPORT_MESSAGE$",d),g=this.isSubscription()||this.V.onSignIn?Pe(Nt,a):Pe(Ot,a),m=!this.V.onSignIn&&r?"":lt.replace("$SIGN_IN_MESSAGE$",g);this.ce.innerHTML=ut.replace("$TITLE$",h).replace("$EXIT$",l).replace("$MESSAGE$",u).replace("$VIEW_AN_AD$",c).replace("$SUPPORT_BUTTON$",p).replace("$SIGN_IN_BUTTON$",m),null==(e=this.ce.querySelector(".rewarded-ad-support-button"))||e.addEventListener("click",this.Ke.bind(this)),null==(i=this.ce.querySelector(".rewarded-ad-view-ad-button"))||i.addEventListener("click",this.He.bind(this)),null==(s=this.ce.querySelector(".rewarded-ad-close-button"))||s.addEventListener("click",this.$e.bind(this)),null==(n=this.ce.querySelector(".rewarded-ad-sign-in-button"))||n.addEventListener("click",this.Je.bind(this)),this.xe(),this.Qe(),this.fe.logSwgEvent(o.EVENT_REWARDED_AD_READY),this.fe.logSwgEvent(o.IMPRESSION_REWARDED_AD)}be(){var t,e;this.cleanUpGoogletag(),this.V.isClosable&&(this.ze(),null==(e=(t=this.V).onCancel)||e.call(t)),this.fe.logSwgEvent(o.ACTION_REWARDED_AD_CLOSE_AD,!0),this.triggerRewardedAdOnResultCallback(!0,!1)}async Te(t){var e,i,s;const n=this.ue.getLanguage(),r=Pe(yt,n),a=Pe(At,n);this.ce.innerHTML=dt.replace("$CLOSE_BUTTON_DESCRIPTION$",r).replace("$THANKS_FOR_VIEWING_THIS_AD$",a);const h=this.ce.getElementsByClassName("rewarded-ad-close-button"),l=setTimeout(this.ze.bind(this),this.le);null==(e=h.item(0))||e.addEventListener("click",(()=>{clearTimeout(l),this.ze()})),this.cleanUpGoogletag(),this.fe.logSwgEvent(o.EVENT_REWARDED_AD_GRANTED),this.Qe(),this.triggerRewardedAdOnResultCallback(!0,!0,null==(i=null==t?void 0:t.payload)?void 0:i.amount,null==(s=null==t?void 0:t.payload)?void 0:s.type),await this.t()}$e(){var t,e;this.cleanUpGoogletag(),this.ze(),null==(e=(t=this.V).onCancel)||e.call(t),this.fe.logSwgEvent(o.ACTION_REWARDED_AD_CLOSE,!0),this.triggerRewardedAdOnResultCallback(!0,!1)}Ke(){var t,e;this.fe.logSwgEvent(o.ACTION_REWARDED_AD_SUPPORT,!0),null==(e=(t=this.V).onCancel)||e.call(t),this.ze(),this.cleanUpGoogletag(),this.V.onAlternateAction?this.V.onAlternateAction():this.V.monetizationFunction()}He(){var t;null==(t=this.ce.getElementsByClassName("rewarded-ad-view-ad-button").item(0))||t.setAttribute("disabled","true"),this.fe.logSwgEvent(o.ACTION_REWARDED_AD_VIEW,!0),this.qe()}Je(){var t,e;this.fe.logSwgEvent(o.ACTION_REWARDED_AD_SIGN_IN,!0),this.V.onSignIn?(null==(e=(t=this.V).onCancel)||e.call(t),this.ze(),this.cleanUpGoogletag(),this.V.onSignIn()):this.ae.callbacks().triggerLoginRequest({linkRequested:!1})}Xe(t,e){const i=this.ae.pageConfig().getPublicationId(),s="/publication/".concat(encodeURIComponent(i),"/").concat(t);return e.reduce(((t,[e,i])=>he(t,e,i)),Te(s))}async Le(){const t=[["publicationId",this.ae.pageConfig().getPublicationId()],["configurationId",this.V.configurationId],["origin",oe(this.ae.win().location.href).origin],["previewEnabled",(!!this.V.shouldRenderPreview).toString()]],e=this.Xe("getactionconfigurationui",t);return await this._e.fetchCredentialedJson(e)}async t(){if(this.V.shouldRenderPreview)return;const t=[["sut",await this.ae.storage().get(xt,!0)],["configurationId",this.V.configurationId],["audienceActionType",this.V.action]],e=this.Xe("completeaudienceaction",t),i={toArray:()=>[],label:String},s=await this._e.sendPost(e,i);if(s.updated){this.we.clear(),s.swgUserToken&&await this.ae.storage().set(xt,s.swgUserToken,!0);const t=Date.now().toString();await this.ae.storage().set(Lt,t,!1),await this.we.getEntitlements()}}xe(){this.ee.documentElement.appendChild(this.ge),Yt(this.ee.body,"overflow","hidden"),this.ge.offsetHeight,Vt(this.ge,{opacity:"1.0"})}ze(){Ft(this.ge),Yt(this.ee.body,"overflow","")}Qe(){this.ce.querySelector(".rewarded-ad-prompt").focus()}
23Ce(){this.Ze()[1].focus()}ye(){const t=this.Ze();t[t.length-2].focus()}Ze(){return this.ge.shadowRoot.querySelectorAll('a[href], button, input, textarea, select, details, [tabindex]:not([tabindex="-1"])')}je(){return this.ge.shadowRoot.querySelectorAll("input, textarea")}async start(){await this.ve()}ke(t){const e=this.ue.getLanguage();if(this.V.isClosable){const i=Pe(yt,e);return t.replace("$CLOSE_BUTTON_DESCRIPTION$",i)}{if(this.V.action===pt.TYPE_NEWSLETTER_SIGNUP)return"";const t=Pe(Rt,e);return J.replace("$BACK_TO_HOME_TEXT$",t).replace("$BACK_TO_HOME_LINK$",oe(this.ae.win().location.href).origin)}}showNoEntitlementFoundToast(){const t=this.ue.getLanguage(),e=Pe(It,t);new $t(this.ae,ye("/toastiframe",{flavor:"custom",customText:e})).open()}close(){this.V.action===pt.TYPE_REWARDED_AD?this.$e():this.V.action===pt.TYPE_NEWSLETTER_SIGNUP&&this.Ue()}cleanUpGoogletag(){var t,e,i,s,n,r;const o=this.ae.win().googletag;this.Ye&&(null==(t=null==o?void 0:o.destroySlots)||t.call(o,[this.Ye]));const a=null==(e=null==o?void 0:o.pubads)?void 0:e.call(o);null==(i=null==a?void 0:a.removeEventListener)||i.call(a,"rewardedSlotReady",this.rewardedSlotReadyHandler),null==(s=null==a?void 0:a.removeEventListener)||s.call(a,"rewardedSlotClosed",this.rewardedSlotClosedHandler),null==(n=null==a?void 0:a.removeEventListener)||n.call(a,"rewardedSlotGranted",this.rewardedSlotGrantedHandler),null==(r=null==a?void 0:a.removeEventListener)||r.call(a,"slotRenderEnded",this.slotRenderEndedHandler)}triggerRewardedAdOnResultCallback(t,e,i,s){var n,r;null==(r=(n=this.V).onResult)||r.call(n,{configurationId:this.V.configurationId,data:{rendered:t,rewardGranted:e,reward:i,type:s}})}}const Le=new Set([o.ACTION_BYO_CTA_BUTTON_CLICK,o.ACTION_BYO_CTA_CLOSE,o.ACTION_CONTRIBUTION_OFFER_SELECTED,o.ACTION_NEWSLETTER_ALREADY_OPTED_IN_CLICK,o.ACTION_NEWSLETTER_OPT_IN_BUTTON_CLICK,o.ACTION_PAYMENT_COMPLETE,o.ACTION_PAYMENT_FLOW_STARTED,o.ACTION_REGWALL_ALREADY_OPTED_IN_CLICK,o.ACTION_REGWALL_OPT_IN_BUTTON_CLICK,o.ACTION_SURVEY_CLOSED,o.ACTION_SURVEY_NEXT_BUTTON_CLICK,o.ACTION_SURVEY_PREVIOUS_BUTTON_CLICK,o.ACTION_SURVEY_SUBMIT_CLICK,o.EVENT_NEWSLETTER_OPTED_IN,o.EVENT_REGWALL_OPTED_IN,o.EVENT_SURVEY_SUBMITTED,o.IMPRESSION_BYO_CTA,o.IMPRESSION_CONTRIBUTION_OFFERS,o.IMPRESSION_NEWSLETTER_OPT_IN,o.IMPRESSION_OFFERS,o.IMPRESSION_PAGE_LOAD,o.IMPRESSION_PAYWALL,o.IMPRESSION_REGWALL_OPT_IN,o.IMPRESSION_SURVEY]);class Me{constructor(t,e){this.ae=t,this._e=e,this.fe=this.ae.eventManager(),this.ti=this.ae.storage()}start(){this.fe.registerEventListener(this.ei.bind(this))}async ei(t){if(!t.eventType||!Le.has(t.eventType))return;const e=await this.ti.get(xt,!0);if(!e)return;const i=encodeURIComponent(this.ae.pageConfig().getPublicationId()),s=this.ii(t);let n="/publication/".concat(i,"/audienceactivity");n=he(n,"sut",e),this._e.sendBeacon(Te(n),s)}ii(t){const e=new m;return e.setEvent(t.eventType),e}}class ke{constructor(){}resized(){}}async function De(t,e,i,s){const n=await t.acceptResult();if(n.origin!=e||i&&!n.originVerified||s&&!n.secureChannel)throw new Error("channel mismatch");return n.data}const Ue={frameborder:"0",scrolling:"no"};class Ge extends ke{constructor(t,e,i,s,n=!1,r=!1,o=!0){super(),this.oe=t,this.ie=e,this.Xt=i,this.Zt=s,this.si=n,this.ni=r,this.ri=o,this.oi=null,this.ee=this.oe.document,this.se=jt(this.ee,"iframe",Ue),this.ai=new Promise((t=>{this.li=t}))}getElement(){return this.se}async init(t){const e=await this.ie.openIframe(this.se,this.Xt,this.Zt);return this.ui(e,t)}shouldFadeBody(){return this.si}hasLoadingIndicator(){return this.ni}ui(t,e){return this.oi=t,this.li(t),e?this.oi.onResizeRequest((t=>{e.resizeView(this,t)})):t.onResizeRequest((t=>{Vt(this.se,{height:"".concat(t,"px")})})),this.oi.whenReady()}ci(){return this.ai}async on(t,e){(await this.ci()).on(t,e)}async execute(t){(await this.ci()).execute(t)}async acceptResult(){return(await this.ci()).acceptResult()}async acceptResultAndVerify(t,e,i){return De(await this.ci(),t,e,i)}async whenComplete(){await this.acceptResult()}async onCancel(t){try{await this.acceptResult()}catch(e){throw Jt(e)&&t(),e}}resized(){this.oi&&this.oi.resized()}shouldAnimateFade(){return this.ri}}var je=(t=>(t.EVENT_SHOWCASE_METER_OFFERED="EVENT_SHOWCASE_METER_OFFERED",t.EVENT_SHOWCASE_UNLOCKED_BY_SUBSCRIPTION="EVENT_SHOWCASE_UNLOCKED_BY_SUBSCRIPTION",t.EVENT_SHOWCASE_UNLOCKED_BY_METER="EVENT_SHOWCASE_UNLOCKED_BY_METER",t.EVENT_SHOWCASE_UNLOCKED_FREE_PAGE="EVENT_SHOWCASE_UNLOCKED_FREE_PAGE",t.EVENT_SHOWCASE_NO_ENTITLEMENTS_REGWALL="EVENT_SHOWCASE_NO_ENTITLEMENTS_REGWALL",t.EVENT_SHOWCASE_INELIGIBLE_PAYWALL="EVENT_SHOWCASE_INELIGIBLE_PAYWALL",t.EVENT_SHOWCASE_NO_ENTITLEMENTS_PAYWALL="EVENT_SHOWCASE_NO_ENTITLEMENTS_PAYWALL",t))(je||{}),Fe=(t=>(t.SHOW_OFFERS="showOffers",t.SHOW_SUBSCRIBE_OPTION="showSubscribeOption",t.SHOW_ABBRV_OFFER="showAbbrvOffer",t.SHOW_CONTRIBUTION_OPTIONS="showContributionOptions",t.SUBSCRIBE="subscribe",t.CONTRIBUTE="contribute",t.COMPLETE_DEFERRED_ACCOUNT_CREATION="completeDeferredAccountCreation",t.LINK_ACCOUNT="linkAccount",t.SHOW_LOGIN_PROMPT="showLoginPrompt",t.SHOW_LOGIN_NOTIFICATION="showLoginNotification",t.SHOW_METER_TOAST="showMeterToast",t))(Fe||{}),ze=(t=>(t[t.DEFAULT=0]="DEFAULT",t[t.IMPRESSIONS=1]="IMPRESSIONS",t))(ze||{}),Be=(t=>(t.AUTO="auto",t.REDIRECT="redirect",t))(Be||{}),We=(t=>(t.SUBSCRIPTION="SUBSCRIPTION",t.UI_CONTRIBUTION="UI_CONTRIBUTION",t))(We||{}),Ve=(t=>(t.LIGHT="light",t.DARK="dark",t))(Ve||{}),Ye=(t=>(t.PREFERENCE_UNSPECIFIED="PREFERENCE_UNSPECIFIED",t.PREFERENCE_GOOGLE_PROVIDED_PROMPT="PREFERENCE_GOOGLE_PROVIDED_PROMPT",t.PREFERENCE_PUBLISHER_PROVIDED_PROMPT="PREFERENCE_PUBLISHER_PROVIDED_PROMPT",t.PREFERENCE_ADSENSE_REWARDED_AD="PREFERENCE_ADSENSE_REWARDED_AD",t))(Ye||{}),qe=(t=>(t.UNKNOWN="unknown",t.NON_SUBSCRIBER="non_subscriber",t.SUBSCRIBER="subscriber",t.PAST_SUBSCRIBER="past_subscriber",t))(qe||{}),Ke=(t=>(t.IMPRESSION_PAYWALL="paywall",t.IMPRESSION_AD="ad_shown",t.IMPRESSION_OFFERS="offers_shown",t.ACTION_SUBSCRIPTIONS_LANDING_PAGE="subscriptions_landing_page",t.ACTION_OFFER_SELECTED="offer_selected",t.ACTION_PAYMENT_FLOW_STARTED="payment_flow_start",t.ACTION_PAYMENT_COMPLETED="payment_complete",t.EVENT_CUSTOM="custom",t))(Ke||{});const He={[Ke.IMPRESSION_PAYWALL]:o.IMPRESSION_PAYWALL,[Ke.IMPRESSION_AD]:o.IMPRESSION_AD,[Ke.IMPRESSION_OFFERS]:o.IMPRESSION_OFFERS,[Ke.ACTION_SUBSCRIPTIONS_LANDING_PAGE]:o.ACTION_SUBSCRIPTIONS_LANDING_PAGE,[Ke.ACTION_OFFER_SELECTED]:o.ACTION_OFFER_SELECTED,[Ke.ACTION_PAYMENT_FLOW_STARTED]:o.ACTION_PAYMENT_FLOW_STARTED,[Ke.ACTION_PAYMENT_COMPLETED]:o.ACTION_PAYMENT_COMPLETE,[Ke.EVENT_CUSTOM]:o.EVENT_CUSTOM},$e={[o.UNKNOWN]:null,[o.IMPRESSION_PAYWALL]:Ke.IMPRESSION_PAYWALL,[o.IMPRESSION_AD]:Ke.IMPRESSION_AD,[o.IMPRESSION_OFFERS]:Ke.IMPRESSION_OFFERS,[o.IMPRESSION_SUBSCRIBE_BUTTON]:null,[o.IMPRESSION_SMARTBOX]:null,[o.ACTION_SUBSCRIBE]:null,[o.ACTION_PAYMENT_COMPLETE]:Ke.ACTION_PAYMENT_COMPLETED,[o.ACTION_ACCOUNT_CREATED]:null,[o.ACTION_ACCOUNT_ACKNOWLEDGED]:null,[o.ACTION_SUBSCRIPTIONS_LANDING_PAGE]:Ke.ACTION_SUBSCRIPTIONS_LANDING_PAGE,[o.ACTION_PAYMENT_FLOW_STARTED]:Ke.ACTION_PAYMENT_FLOW_STARTED,[o.ACTION_OFFER_SELECTED]:Ke.ACTION_OFFER_SELECTED,[o.EVENT_PAYMENT_FAILED]:null,[o.EVENT_CUSTOM]:Ke.EVENT_CUSTOM},Je={[je.EVENT_SHOWCASE_METER_OFFERED]:[o.EVENT_HAS_METERING_ENTITLEMENTS,o.EVENT_OFFERED_MET
23ER],[je.EVENT_SHOWCASE_UNLOCKED_BY_SUBSCRIPTION]:[o.EVENT_UNLOCKED_BY_SUBSCRIPTION],[je.EVENT_SHOWCASE_UNLOCKED_BY_METER]:[o.EVENT_HAS_METERING_ENTITLEMENTS,o.EVENT_UNLOCKED_BY_METER],[je.EVENT_SHOWCASE_UNLOCKED_FREE_PAGE]:[o.EVENT_UNLOCKED_FREE_PAGE],[je.EVENT_SHOWCASE_NO_ENTITLEMENTS_REGWALL]:[o.EVENT_NO_ENTITLEMENTS,o.IMPRESSION_REGWALL,o.IMPRESSION_SHOWCASE_REGWALL],[je.EVENT_SHOWCASE_NO_ENTITLEMENTS_PAYWALL]:[o.EVENT_NO_ENTITLEMENTS,o.IMPRESSION_PAYWALL],[je.EVENT_SHOWCASE_INELIGIBLE_PAYWALL]:[o.EVENT_INELIGIBLE_PAYWALL,o.EVENT_NO_ENTITLEMENTS]},Qe={[o.IMPRESSION_REGWALL]:a.LOCKED_REGWALL,[o.EVENT_UNLOCKED_BY_METER]:a.UNLOCKED_METER,[o.EVENT_UNLOCKED_BY_SUBSCRIPTION]:a.UNLOCKED_SUBSCRIBER,[o.EVENT_UNLOCKED_FREE_PAGE]:a.UNLOCKED_FREE,[o.IMPRESSION_PAYWALL]:a.LOCKED_PAYWALL,[o.EVENT_INELIGIBLE_PAYWALL]:a.INELIGIBLE_PAYWALL};function Xe(t,e,i,s){return{eventCategory:t,eventAction:e,eventLabel:i,nonInteraction:s}}const Ze={[o.IMPRESSION_OFFERS]:Xe("NTG paywall","paywall modal impression","",!0),[o.IMPRESSION_CONTRIBUTION_OFFERS]:Xe("NTG membership","offer impressions","",!0),[o.ACTION_OFFER_SELECTED]:Xe("NTG paywall","click","",!1),[o.ACTION_SWG_SUBSCRIPTION_MINI_PROMPT_CLICK]:Xe("NTG subscription","marketing modal click","",!1),[o.IMPRESSION_SWG_SUBSCRIPTION_MINI_PROMPT]:Xe("NTG subscription","marketing modal impression","",!0),[o.ACTION_SWG_CONTRIBUTION_MINI_PROMPT_CLICK]:Xe("NTG membership","marketing modal click","",!1),[o.IMPRESSION_SWG_CONTRIBUTION_MINI_PROMPT]:Xe("NTG membership","membership modal impression","",!0),[o.IMPRESSION_NEWSLETTER_OPT_IN]:Xe("NTG newsletter","newsletter modal impression","",!0),[o.EVENT_NEWSLETTER_OPTED_IN]:Xe("NTG newsletter","newsletter signup","success",!1),[o.IMPRESSION_BYOP_NEWSLETTER_OPT_IN]:Xe("NTG newsletter","newsletter modal impression","",!0),[o.ACTION_BYOP_NEWSLETTER_OPT_IN_SUBMIT]:Xe("NTG newsletter","newsletter signup","success",!1),[o.IMPRESSION_REGWALL_OPT_IN]:Xe("NTG account","registration modal impression","",!0),[o.EVENT_REGWALL_OPTED_IN]:Xe("NTG account","registration","success",!1),[o.ACTION_SURVEY_DATA_TRANSFER]:Xe("","survey submission","",!1),[o.IMPRESSION_BYO_CTA]:Xe("","custom cta modal impression","",!0),[o.ACTION_BYO_CTA_BUTTON_CLICK]:Xe("","custom cta click","",!1)},ti={[o.ACTION_PAYMENT_COMPLETE]:Xe("NTG subscription","submit","success",!1)},ei={[o.ACTION_PAYMENT_COMPLETE]:Xe("NTG membership","submit","success",!1)};function ii(t){return He[t]}function si(t){return"[object Object]"===Object.prototype.toString.call(t)}function ni(t,e){return Object.values(t).includes(e)}function ri(t){return"function"==typeof t}function oi(t){return"boolean"==typeof t}class ai{constructor(t){this.ae=t,this.fe=t.eventManager()}start(){this.fe.registerEventListener(this.ei.bind(this))}ei(t,e){var i,s,n;const r=ai.isGaEligible(this.ae),o=ai.isGtagEligible(this.ae),a=ai.isGtmEligible(this.ae);if(!(r||o||a))return;const{ga:h,gtag:l,dataLayer:u}=this.ae.win(),c=(null==(i=t.additionalParameters)?void 0:i.subscriptionFlow)||(null==(n=null==(s=t.additionalParameters)?void 0:s.getSubscriptionFlow)?void 0:n.call(s))||"";let d=function(t,e){if(!t)return;let i;
23return e===Fe.SUBSCRIBE?i=ti[t]:e===Fe.CONTRIBUTE&&(i=ei[t]),i||Ze[t]}(t.eventType,c);if(!d)return;const p=(null==e?void 0:e.googleAnalyticsParameters)||{};if(d={...d,eventCategory:p.event_category||d.eventCategory,eventLabel:p.event_label||d.eventLabel},r&&h("send","event",d),o){const t={event_category:d.eventCategory,event_label:d.eventLabel,non_interaction:d.nonInteraction,...p};l("event",d.eventAction,t)}a&&u.push({event:d.eventAction,event_category:d.eventCategory,event_label:d.eventLabel,non_interaction:d.nonInteraction,configurationId:t.configurationId||"",...p})}static isGaEligible(t){return ri(t.win().ga)}static isGtagEligible(t){return ri(t.win().gtag)}static isGtmEligible(t){var e;return ri(null==(e=t.win().dataLayer)?void 0:e.push)}}async function hi(t,e,i,s,n){const r=await async function(t,e,i,s){if(s)try{return await s({configurationId:e,data:t})}catch(n){return ee("[swg.js] Exception in publisher provided logging callback: ".concat(n)),!1}return function(t,e){var i;return!!(ai.isGaEligible(e)||ai.isGtagEligible(e)||ai.isGtmEligible(e))&&(null==(i=t.getSurveyQuestionsList())||i.map((t=>{var i;const s={eventType:o.ACTION_SURVEY_DATA_TRANSFER,eventOriginator:l.SWG_CLIENT,isFromUserAction:!0,additionalParameters:null};null==(i=t.getSurveyAnswersList())||i.map((i=>{const n={googleAnalyticsParameters:{survey_question:t.getQuestionText()||"",survey_question_category:t.getQuestionCategory()||"",survey_answer:i.getAnswerText()||"",survey_answer_category:i.getAnswerCategory()||"",content_id:t.getQuestionCategory()||"",content_group:t.getQuestionText()||"",content_type:i.getAnswerText()||"",event_category:t.getQuestionCategory()||"",event_label:i.getAnswerText()||""}};e.eventManager().logEvent(s,n)}))})),!0)}(t,i)}(t,s,e,n);r?e.eventManager().logSwgEvent(o.EVENT_SURVEY_DATA_TRANSFER_COMPLETE,!0):e.eventManager().logSwgEvent(o.EVENT_SURVEY_DATA_TRANSFER_FAILED,!1);const a=new U;t.getStorePpsInLocalStorage()&&await async function(t,e){var i,s;const n=Gt.PPS_TAXONOMIES,r=t.getSurveyQuestionsList().flatMap((t=>t.getSurveyAnswersList())).map((t=>null==t?void 0:t.getPpsValue())).filter((t=>null!==t)),o=await e.storage().get(n,!0);let a=[];try{const t=null==(s=null==(i=JSON.parse(o))?void 0:i[1])?void 0:s.values;a=Array.isArray(t)?t:[]}catch{}const h=Array.from(new Set(r.concat(a))),l={[Pt]:{values:h}};await Promise.resolve(e.storage().set(n,JSON.stringify(l),!0))}(t,e),a.setSuccess(r),i.execute(a)}function li(t,e,i){let s;switch(t){case"TYPE_REGISTRATION_WALL":s={flavor:"basic"};break;case"TYPE_NEWSLETTER_SIGNUP":s={flavor:"custom",customText:Pe(ft,e)};break;default:return}new $t(i,ye("/toastiframe",s)).open()}function ui(t,e,i,s=!1){if(!t.useUpdatedOfferFlows)return ye("/contributionsiframe");const n={publicationId:i.getPublicationId()};return e.shouldForceLangInIframes()&&(n.hl=e.getLanguage()),s&&(n.ctaMode="CTA_MODE_INLINE"),ye("/contributionoffersiframe",n)}const ci=[pt.TYPE_BYO_CTA,pt.TYPE_REGISTRATION_WALL,pt.TYPE_NEWSLETTER_SIGNUP,pt.TYPE_REWARDED_AD,pt.TYPE_REWARDED_SURVEY],di={[W.SUBSCRIPTION]:We.SUBSCRIPTION,[W.SUBSCRIPTION_LARGE]:We.SUBSCRIPTION,[W.CONTRIBUTION]:We.UI_CONTRIBUTION,[W.CONTRIBUTION_LARGE]:We.UI_CONTRIBUTION},pi=We.SUBSCRIPTION,gi=/<ph name="EMAIL".+?\/ph>/g;class mi{constructor(t,e){this.ae=t,this.V=e,this.di=e.autoPromptType?di[e.autoPromptType]:pi,this.pi=t.dialogManager(),this.we=t.entitlementsManager(),this.ue=t.clientConfigManager(),this.fetcher=new me(t.win()),this.rewardedSlotReadyHandler=this.rewardedSlotReady.bind(this),this.rewardedSlotClosedHandler=this.rewardedSlotClosed.bind(this),this.rewardedSlotGrantedHandler=this.rewardedSlotGranted.bind(this),this.slotRenderEndedHandler=this.slotRenderEnded.bind(this);const i={origin:oe(t.win().location.href).origin,configurationId:this.V.configurationId||"",isClosable:(!!e.isClosable).toString(),calledManually:e.calledManually.toString(),previewEnabled:(!!e.shouldRenderPreview).toString()};this.ue.shouldForceLangInIframes()&&(i.hl=this.ue.getLanguage()),this.V.onAlternateAction&&(i.onaa="true"),this.V.onSignIn&&(i.onsi="true"),this.gi=new Ge(t.win(),t.activities(),ye(pe[e.action],i),Se({supportsEventManager:!0,productType:this.di,windowHeight:t.win().innerHeight}),!0),e.shouldRenderPreview&&e.action!==pt.TYPE_BYO_CTA&&Vt(this.gi.getElement(),{"pointer-events":"none"})}start(){return this.gi.on(f,(t=>this.mi(t))),this.gi.on(D,(t=>hi(t,this.ae,this.gi,this.V.configurationId,this.V.onResult))),this.gi.on(c,this._i.bind(this)),this.gi.on(N,this.handleRewardedAdLoadAdRequest.bind(this)),this.gi.on(v,this.handleRewardedAdViewAdRequest.bind(this)),this.gi.on(O,this.handleRewardedAdAlternateActionRequest.bind(this)),this.gi.onCancel((()=>{var t,e,i;null==(e=(t=this.V).onCancel)||e.call(t),this.cleanUpGoogletag(),null==(i=this.disposeAd)||i.call(this)})),this.pi.openView(this.gi,!1,{shouldDisableBodyScrolling:!0,closeOnBackgroun
23dClick:!!this.V.isClosable})}async mi(t){var e;const{onResult:i,configurationId:s}=this.V;this.pi.completeView(this.gi);const n=t.getSwgUserToken();await this.updateEntitlements(n),this.isOptIn(this.V.action)&&i&&i({configurationId:s,data:{email:t.getUserEmail(),displayName:t.getDisplayName(),givenName:t.getGivenName(),familyName:t.getFamilyName(),termsAndConditionsConsent:t.getTermsAndConditionsConsent()}}),this.V.suppressToast||(t.getActionCompleted()?this.fi(null!=(e=t.getUserEmail())?e:""):t.getAlreadyCompleted()?li(this.V.action,this.ue.getLanguage(),this.ae):this.wi())}fi(t){const e=this.ue.getLanguage();let i="";switch(this.V.action){case pt.TYPE_REGISTRATION_WALL:i=Pe(bt,e).replace(gi,t);break;case pt.TYPE_NEWSLETTER_SIGNUP:i=Pe(Tt,e).replace(gi,t);break;default:return}new $t(this.ae,ye("/toastiframe",{flavor:"custom",customText:i})).open()}isOptIn(t){return t===pt.TYPE_NEWSLETTER_SIGNUP||t===pt.TYPE_REGISTRATION_WALL}wi(){const t=this.ue.getLanguage();let e="";switch(this.V.action){case pt.TYPE_REGISTRATION_WALL:e=Pe(wt,t);break;case pt.TYPE_NEWSLETTER_SIGNUP:e=Pe(Et,t);break;default:return}new $t(this.ae,ye("/toastiframe",{flavor:"custom",customText:e})).open()}_i(t){this.V.onSignIn?this.V.onSignIn():t.getSubscriberOrMember()&&this.ae.callbacks().triggerLoginRequest({linkRequested:!1})}handleRewardedAdLoadAdRequest(t){if(this.V.preference===Ye.PREFERENCE_ADSENSE_REWARDED_AD){const t=this.ae.win().adsbygoogle;if(!t)return void this.sendRewardedAdLoadAdResponse(!1);null==t||t.push({params:{google_adtest:"on",google_tag_origin:"rrm",google_reactive_ad_format:11,google_wrap_fullscreen_ad:!0,google_video_play_muted:!1,google_acr:this.showASRewardedAd.bind(this)}})}else{const e=this.ae.win().googletag;if(!e)return this.ae.eventManager().logSwgEvent(o.EVENT_REWARDED_AD_GPT_MISSING_ERROR),void this.sendRewardedAdLoadAdResponse(!1);e.cmd.push((()=>this.setUpRewardedAd(t.getAdUnit())))}this.rewardedAdTimeout=setTimeout(this.handleRewardedAdLoadAdRequestTimeout.bind(this),5e3)}handleRewardedAdLoadAdRequestTimeout(){this.ae.eventManager().logSwgEvent(o.EVENT_REWARDED_AD_GPT_ERROR),this.sendRewardedAdLoadAdResponse(!1)}showASRewardedAd(t){clearTimeout(this.rewardedAdTimeout),(null==t?void 0:t.show)||(this.ae.eventManager().logSwgEvent(o.EVENT_REWARDED_AD_NOT_FILLED),this.sendRewardedAdLoadAdResponse(!1)),this.showRewardedAd=()=>t.show(this.handleASRewardedAdResult.bind(this)),this.disposeAd=null==t?void 0:t.disposeAd,this.sendRewardedAdLoadAdResponse(!0)}async handleASRewardedAdResult(t){var e,i;"viewed"===t.status?await this.rewardedAdGrant(null==(e=null==t?void 0:t.reward)?void 0:e.amount,null==(i=null==t?void 0:t.reward)?void 0:i.type):this.rewardedSlotClosed()}setUpRewardedAd(t){const e=this.ae.win().googletag;if(this.rewardedAdSlot=e.defineOutOfPageSlot(t,e.enums.OutOfPageFormat.REWARDED),!this.rewardedAdSlot)return this.ae.eventManager().logSwgEvent(o.EVENT_REWARDED_AD_PAGE_ERROR),void this.sendRewardedAdLoadAdResponse(!1);const i=e.pubads();this.rewardedAdSlot.addService(i),i.addEventListener("rewardedSlotReady",this.rewardedSlotReadyHandler),i.addEventListener("rewardedSlotClosed",this.rewardedSlotClosedHandler),i.addEventListener("rewardedSlotGranted",this.rewardedSlotGrantedHandler),i.addEventListener("slotRenderEnded",this.slotRenderEndedHandler),e.enableServices(),e.display(this.rewardedAdSlot),i.refresh([this.rewardedAdSlot])}rewardedSlotReady(t){clearTimeout(this.rewardedAdTimeout),this.showRewardedAd=t.makeRewardedVisible,this.sendRewardedAdLoadAdResponse(!0)}rewardedSlotClosed(){var t,e,i,s;this.cleanUpGoogletag(),this.ae.eventManager().logSwgEvent(o.ACTION_REWARDED_AD_CLOSE_AD,!0),this.V.onAlternateAction?this.V.onAlternateAction():null==(e=(t=this.V).monetizationFunction)||e.call(t),null==(s=(i=this.V).onResult)||s.call(i,{configurationId:this.V.configurationId,data:{rendered:!0,rewardGranted:!1}})}async rewardedSlotGranted(t){var e,i;this.cleanUpGoogletag(),await this.rewardedAdGrant(null==(e=null==t?void 0:t.payload)?void 0:e.amount,null==(i=null==t?void 0:t.payload)?void 0:i.type)}async rewardedAdGrant(t,e){var i,s;this.ae.eventManager().logSwgEvent(o.EVENT_REWARDED_AD_GRANTED),null==(s=(i=this.V).onResult)||s.call(i,{configurationId:this.V.configurationId,data:{rendered:!0,rewardGranted:!0,reward:t,type:e}}),this.pi.completeView(this.gi),await this.completeAudienceAction()}slotRenderEnded(t){t.slot===this.rewardedAdSlot&&t.isEmpty&&(clearTimeout(this.rewardedAdTimeout),this.ae.eventManager().logSwgEvent(o.EVENT_REWARDED_AD_NOT_FILLED),this.sendRewardedAdLoadAdResponse(!1))}sendRewardedAdLoadAdResponse(t){var e,i;const s=new A;s.setSuccess(t),this.gi.execute(s),t||null==(i=(e=this.V).onResult)||i.call(e,{configurationId:this.V.configurationId,data:{rendered:!1,rewardGranted:!1}})}handleRewardedAdViewAdRequest(){var t;null==(t=this.showRewardedAd)||t.call(this)}handleRewardedAdAlternateActionRequest(){var t,e;this.V.onAlternateAction?this.V.onAlternateAction():null==(e=(t=this.V).monetizationFunction)||e.call(t)}cleanUpGoogletag(){var t,e,i,s,n,r;const o=this.ae.win().googletag;this.rewardedAdSlot&&(null==(t=null==o?void 0:o.destroySlots)||t.call(o,[this.rewardedAdSlot]));const a=null==(e=null==o?void 0:o.pubads)?void 0:e.call(o);null==(i=null==a?void 0:a.removeEventListener)||i.call(a,"rewardedSlotReady",this.rewardedSlotReadyHandler),null==(s=null==a?void 0:a.removeEventListener)||s.call(a,"rewardedSlotClosed",this.rewardedSlotClosedHandler),null==(n=null==a?void 0:a.removeEventListener)||n.call(a,"rewardedSlotGranted",this.rewardedSlotGrantedHandler),null==(r=null==a?void 0:a.removeEventListener)||r.call(a,"slotRenderEnded",this.slotRenderEndedHandler)}async completeAudienceAction(){const t=[["sut",await this.ae.storage().get(xt,!0)],["configurationId",this.V.configurationId],["audienceActionType",this.V.action]],e=this.ae.pageConfig().getPublicationId(),i="/publication/".concat(encodeURIComponent(e),"/completeaudienceaction"),s=t.reduce(((t,[e,i])=>he(t,e,i)),Te(i)),n={toArray:()=>[],label:String},r=await this.fetcher.sendPost(s,n);r.updated&&await this.updateEntitlements(r.swgUserToken)}async updateEntitlements(t){this.we.clear(),t&&await this.ae.storage().set(xt,t,!0);const e=Date.now().toString();await this.ae.storage().set(Lt,e,!1),await this.we.getEntitlements()}showNoEntitlementFoundToast(){this.gi.execute(new T)}}var fi=(t=>(t.UNSPECIFIED="UNSPECIFIED",t.DISMISSIBLE="DISMISSIBLE",t.BLOCKING="BLOCKING",t))(fi||{}),wi=(t=>(t.UNSPECIFIED="UNSPECIFIED",t.FINITE="FINITE",t.INFINITE="INFINITE",t))(wi||{});class Ei{constructor(t){this.ee=t.doc(),this.ue=t.clientConfigManager(),ie(this.ue,"MiniPromptApi requires an instance of ClientConfigManager."),this.fe=t.eventManager()}init(){const t=this.ee.getHead();if(!t)return void ee("Unable to retrieve the head node of the current document, which is needed by MiniPromptApi.");const e="".concat(s,"/swg-mini-prompt.css");t.querySelector('link[href="'.concat(e,'"]'))||t.appendChild(jt(this.ee.getWin().document,"link",{rel:"stylesheet",type:"text/css",href:e}))}create(t){if(t.autoPromptType!==W.CONTRIBUTION&&t.autoPromptType!==W.SUBSCRIPTION)return;const e=this.ue.getTheme(),i=this.ue.getLanguage();let s="";t.autoPromptType===W.CONTRIBUTION?s=Pe(mt,i):t.autoPromptType===W.SUBSCRIPTION&&(s=Pe(gt,i));const n=jt(this.ee.getWin().document,"div",{role:"dialog",lang:i});n.classList.add("swg-mini-prompt-".concat(e));const r=jt(this.ee.getWin().document,"div",{role:"button"});r.classList.add("swg-mini-prompt-title-container"),r.innerHTML='\n<div class="swg-mini-prompt-icon-$theme$"></div>\n<h1 class="swg-mini-prompt-title-text-$theme$">$textContent$</h1>\n'.replace(/\$theme\$/g,e).replace("$textContent$",s);const o=jt(this.ee.getWin().document,"div",{});o.classList.add("swg-mini-prompt-close-button-container"),o.innerHTML='\n<div class="swg-mini-prompt-close-icon-$theme$"></div>\n'.replace("$theme$",e),n.appendChild(r),n.appendChild(o),this.ee.getWin().document.body.appendChild(n),r.addEventListener("click",(()=>{this.Ei(t.autoPromptType),"function"==typeof t.clickCallback&&t.clickCallback(),Yt(n,"visibility","hidden")})),o.addEventListener("click",(()=>{Yt(n,"visibility","hidden"),this.bi(t.autoPromptType)})),this.Ti(t.autoPromptType)}Ti(t){let e;t===W.CONTRIBUTION?e=o.IMPRESSION_SWG_CONTRIBUTION_MINI_PROMPT:t===W.SUBSCRIPTION&&(e=o.IMPRESSION_SWG_SUBSCRIPTION_MINI_PROMPT),e&&this.fe.logSwgEvent(e,!1)}Ei(t){let e;t===W.CONTRIBUTION?e=o.ACTION_SWG_CONTRIBUTION_MINI_PROMPT_CLICK:t===W.SUBSCRIPTION&&(e=o.ACTION_SWG_SUBSCRIPTION_MINI_PROMPT_CLICK),e&&this.fe.logSwgEvent(e,!0)}bi(t){let e;t===W.CONTRIBUTION?e=o.ACTION_SWG_CONTRIBUTION_MINI_PROMPT_CLOSE:t===W.SUBSCRIPTION&&(e=o.ACTION_SWG_SUBSCRIPTION_MINI_PROMPT_CLOSE),e&&this.fe.logSwgEvent(e,!0)}}let bi=null;function Ti(t){if(!bi){bi={};let i="enable-pub-id-suffix-for-storage-key";try{const e=ae(t.location.hash)["swg.experiments"];e&&(i+=","+e)}catch(e){Xt.throwAsync(e)}for(let s of i.split(","))if(s=s.trim(),s)try{Ii(t,bi,s)}catch(e){Xt.throwAsync(e)}}return bi}function Ii(t,e,i){let s,n,r=!1;const o=i.indexOf(":");if(-1==o?(s=i,n=100,r=!1):(s=i.substring(0,o).trim(),"c"==(i=i.substring(o+1)).substring(i.length-1)&&(r=!0,i=i.substring(0,i.length-1)),n=parseInt(i,10)),isNaN(n))throw new Error("invalid fraction");let a;if(n>99)a=!0;else if(n<1)a=!1;else if(t.sessionStorage){r=r&&n<=20;try{const e="subscribe.google.com:e:"+s+":"+n+(r?"c":"");let i="e"==(h=t.sessionStorage.getItem(e))?"e":"c"==h?"c":null;!i&&100*Math.random()<=n*(r?2:1)&&(i=!r||Math.random()<=.5?"e":"c",t.sessionStorage.setItem(e,i)),a=!!i,"c"==i&&(s="c-"+s)}catch(l){a=!1,Xt.throwAsync(l)}}else a=!1;var h;e[s]=a}function yi(t,e){return Ti(t)[e]||!1}function Si(t){const e=Ti(t),i=[];for(const s in e)e[s]&&i.push(s);return i}const Ci="subscribe.google.com";class Oi{constructor(t,e){this.oe=t,this.Ii=e,this.yi={}}async get(t,e=!1){const i=this.Si(t),s=this.Ci(t),n=await this.Oi(s,e);return null!==n?n:this.Oi(i,e)}Oi(t,e){return this.yi[t]||(this.yi[t]=new Promise((i=>{const s=e?this.oe.localStorage:this.oe.sessionStorage;if(s)try{i(s.getItem(t))}catch{i(null)}else i(null)}))),this.yi[t]}async set(t,e,i=!1){const s=this.Si(t),r=this.Ci(t);return null!==await this.Oi(r,i)||yi(this.oe,n.ENABLE_PUBLICATION_ID_SUFFIX_FOR_STORAGE_KEY)?(await this.Ni(s,i),this.Ai(r,e,i)):this.Ai(s,e,i)}Ai(t,e,i){return this.yi[t]=Promise.resolve(e),new Promise((s=>{const n=i?this.oe.localStorage:this.oe.sessionStorage;if(n)try{n.setItem(t,e)}catch{}s()}))}async remove(t,e=!1){const i=this.Si(t),s=this.Ci(t);return null!==await this.Oi(s,e)||yi(this.oe,n.ENABLE_PUBLICATION_ID_SUFFIX_FOR_STORAGE_KEY)?this.Ni(s,e):this.Ni(i,e)}Ni(t,e){return delete this.yi[t],new Promise((i=>{const s=e?this.oe.localStorage:this.oe.sessionStorage;if(s)try{s.removeItem(t)}catch{}i()}))}Si(t){return Ci+":"+t}Ci(t){if(Object.values(Gt).includes(t))return this.Si(t);const e=this.Ii.getPublicationId();return Ci+":"+t+":"+e}}function Ni(t){const e=Date.now()-12096e5;let i=0;for(;i<t.length&&!(t[i]>=e);i++);return t.slice(i)}const Ai=[o.IMPRESSION_SWG_CONTRIBUTION_MINI_PROMPT,o.IMPRESSION_SWG_SUBSCRIPTION_MINI_PROMPT,o.IMPRESSION_OFFERS,o.IMPRESSION_CONTRIBUTION_OFFERS],vi=new Map([[o.ACTION_SWG_CONTRIBUTION_MINI_PROMPT_CLOSE,pt.TYPE_CONTRIBUTION],[o.ACTION_CONTRIBUTION_OFFERS_CLOSED,pt.TYPE_CONTRIBUTION],[o.ACTION_NEWSLETTER_OPT_IN_CLOSE,pt.TYPE_NEWSLETTER_SIGNUP],[o.ACTION_BYOP_NEWSLETTER_OPT_IN_CLOSE,pt.TYPE_NEWSLETTER_SIGNUP],[o.ACTION_REGWALL_OPT_IN_CLOSE,pt.TYPE_REGISTRATION_WALL],[o.ACTION_SURVEY_CLOSED,pt.TYPE_REWARDED_SURVEY],[o.ACTION_REWARDED_AD_CLOSE,pt.TYPE_REWARDED_AD],[o.ACTION_BYO_CTA_CLOSE,pt.TYPE_BYO_CTA],[o.ACTION_SWG_SUBSCRIPTION_MINI_PROMPT_CLOSE,pt.TYPE_SUBSCRIPTION],[o.ACTION_SUBSCRIPTION_OFFERS_CLOSED,pt.TYPE_SUBSCRIPTION]]),Ri=new Map([[o.EVENT_CONTRIBUTION_PAYMENT_COMPLETE,pt.TYPE_CONTRIBUTION],[o.ACTION_NEWSLETTER_OPT_IN_BUTTON_CLICK,pt.TYPE_NEWSLETTER_SIGNUP],[o.ACTION_BYOP_NEWSLETTER_OPT_IN_SUBMIT,pt.TYPE_NEWSLETTER_SIGNUP],[o.ACTION_REGWALL_OPT_IN_BUTTON_CLICK,pt.TYPE_REGISTRATION_WALL],[o.ACTION_SURVEY_SUBMIT_CLICK,pt.TYPE_REWARDED_SURVEY],[o.ACTION_REWARDED_AD_VIEW,pt.TYPE_REWARDED_AD],[o.ACTION_BYO_CTA_BUTTON_CLICK,pt.TYPE_BYO_CTA],[o.EVENT_SUBSCRIPTION_PAYMENT_COMPLETE,pt.TYPE_SUBSCRIPTION]]),Pi=new Map([[o.IMPRESSION_SWG_CONTRIBUTION_MINI_PROMPT,pt.TYPE_CONTRIBUTION],[o.IMPRESSION_CONTRIBUTION_OFFERS,pt.TYPE_CONTRIBUTION],[o.IMPRESSION_NEWSLETTER_OPT_IN,pt.TYPE_NEWSLETTER_SIGNUP],[o.IMPRESSION_BYOP_NEWSLETTER_OPT_IN,pt.TYPE_NEWSLETTER_SIGNUP],[o.IMPRESSION_REGWALL_OPT_IN,pt.TYPE_REGISTRATION_WALL],[o.IMPRESSION_SURVEY,pt.TYPE_REWARDED_SURVEY],[o.IMPRESSION_REWARDED_AD,pt.TYPE_REWARDED_AD],[o.IMPRESSION_BYO_CTA,pt.TYPE_BYO_CTA],[o.IMPRESSION_SWG_SUBSCRIPTION_MINI_PROMPT,pt.TYPE_SUBSCRIPTION],[o.IMPRESSION_OFFERS,pt.TYPE_SUBSCRIPTION]]),xi=[o.EVENT_PAYMENT_FAILED],Li=[o.ACTION_SWG_BUTTON_SHOW_OFFERS_CLICK,o.ACTION_SWG_BUTTON_SHOW_CONTRIBUTIONS_CLICK];class Mi{constructor(t,e){this.ae=t,this.Ri=e,this.Pi=!1,this.xi=!1,this.Li=null,this.Mi=!1,this.ki=!1,this.standardRewardedAdExperiment=!1,this.multiInstanceCtaExperiment=!1,this.ee=t.doc(),this.Ii=t.pageConfig(),this.we=t.entitlementsManager(),this.ue=t.clientConfigManager(),ie(this.ue,"AutoPromptManager requires an instance of ClientConfigManager."),this.ti=t.storage(),t.eventManager().registerEventListener(this.ei.bind(this)),this.Di=new Ei(t),this.Di.init(),this.fe=t.eventManager()}async showAutoPrompt(t){if(t.autoPromptType===W.NONE)return;if(this.Ui=t.contentType,t.alwaysShow)return this.Gi=!0,this.ji=this.Fi(t.autoPromptType),this.zi=this.Ui!=V.CLOSED,void this.Bi()();const[e,i,s]=await Promise.all([this.ue.getClientConfig(),this.we.getEntitlements(),this.we.getArticle()]);this.Wi(s),this.Mi=!!(null==s?void 0:s.previewEnabled),this.Mi?await this.Vi(s,t):await this.Yi(e,i,s,t)}Wi(t){t&&(this.ki=this.qi(t,r.DISMISSIBILITY_CTA_FILTER_EXPERIMENT),this.standardRewardedAdExperiment=this.qi(t,r.STANDARD_REWARDED_AD_EXPERIMENT),this.multiInstanceCtaExperiment=this.qi(t,r.MULTI_INSTANCE_CTA_EXPERIMENT))}async Vi(t,e){var i,s;const n=null==(i=t.audienceActions)?void 0:i.actions;
23if(!n||0===n.length)return;this.ji=this.Ki(null==(s=t.audienceActions)?void 0:s.actions,e.autoPromptType),this.zi=this.Ui!=V.CLOSED;const r=n[0];this.Hi(r)()}async Yi(t,e,i,s){var n,r,o,a,h,l,u,c;if(this.Gi=!1,!i)return;if(!(null==(n=t.uiPredicates)?void 0:n.canDisplayAutoPrompt))return;if(e.enablesThis())return;let d;if(this.ji=this.Ki(null==(r=i.audienceActions)?void 0:r.actions,s.autoPromptType),i.actionOrchestration){const e=await this.$i(t,i);if(e){switch(null==e?void 0:e.closability){case fi.BLOCKING:this.zi=!1;break;case fi.DISMISSIBLE:this.zi=!0;break;default:this.zi=this.Ui!=V.CLOSED}d=null==(a=null==(o=i.audienceActions)?void 0:o.actions)?void 0:a.find((t=>t.configurationId===e.configId))}}else if(this.Ui===V.CLOSED){const t=null==(l=null==(h=i.audienceActions)?void 0:h.actions)?void 0:l.find((t=>t.type===pt.TYPE_SUBSCRIPTION));t&&(this.zi=!1,d={type:t.type,configurationId:t.configurationId})}const p=d?this.Hi(d):void 0;if(!p)return;this.xi=!1,this.Ji=null==d?void 0:d.configurationId;const g=this.zi?1e3*((null==(c=null==(u=null==t?void 0:t.autoPromptConfig)?void 0:u.clientDisplayTrigger)?void 0:c.displayDelaySeconds)||0):0;g>0?this.ae.win().setTimeout(p,g):p()}Qi(){return this.ji===W.SUBSCRIPTION||this.ji===W.SUBSCRIPTION_LARGE}Xi(){return this.ji===W.CONTRIBUTION||this.ji===W.CONTRIBUTION_LARGE}Zi(t){return t===pt.TYPE_SUBSCRIPTION||t===pt.TYPE_CONTRIBUTION}Ki(t=[],e){const i=t.find((t=>t.type===pt.TYPE_CONTRIBUTION||t.type===pt.TYPE_SUBSCRIPTION));if(!i)return;const s=i.type===pt.TYPE_CONTRIBUTION?e===W.CONTRIBUTION?W.CONTRIBUTION:W.CONTRIBUTION_LARGE:e===W.SUBSCRIPTION?W.SUBSCRIPTION:W.SUBSCRIPTION_LARGE;return this.Fi(s)}async $i(t,e){var i,s,n,r,a,h,l;const u=null==(i=e.audienceActions)?void 0:i.actions;let c=null==(n=null==(s=e.actionOrchestration)?void 0:s.interventionFunnel)?void 0:n.interventions;if(!(null==u?void 0:u.length)||!(null==c?void 0:c.length))return;const d=await this.getTimestamps(),p=new Set(u.filter((t=>this.ts(t,d))).map((t=>t.configurationId)));if(0===p.size)return;const g=new Map(e.audienceActions.actions.filter((t=>!!t.numberOfCompletions)).map((t=>[t.configurationId,t.numberOfCompletions])));if(c=c.filter((e=>this.ss(e,p,g,t))),0===c.length)return;if(this.Ui===V.CLOSED)return c[0];if(!this.ns(null==(r=t.autoPromptConfig)?void 0:r.frequencyCapConfig))return this.fe.logSwgEvent(o.EVENT_FREQUENCY_CAP_CONFIG_NOT_FOUND_ERROR),c[0];let m;for(const f of c){const e=this.rs(null==(a=t.autoPromptConfig)?void 0:a.frequencyCapConfig,f);if(this.hs(e)){const t=this.ls(d,f);if(this.us(e,t)){this.fe.logSwgEvent(o.EVENT_PROMPT_FREQUENCY_CAP_MET);continue}}m=f;break}if(!m)return;const _=this.ds(null==(h=t.autoPromptConfig)?void 0:h.frequencyCapConfig,null==(l=e.actionOrchestration)?void 0:l.interventionFunnel);if(this.hs(_)){const t=Array.prototype.concat.apply([],Object.entries(d).filter((([t,e])=>!!this.multiInstanceCtaExperiment||Object.values(pt).includes(t))).map((([t,e])=>this.multiInstanceCtaExperiment&&t===m.configId||t===m.type?e.completions:e.impressions)));if(this.us(_,t))return void this.fe.logSwgEvent(o.EVENT_GLOBAL_FREQUENCY_CAP_MET)}return m}ps(t=!0){const e={isClosable:!!this.zi,shouldAnimateFade:t};return this.Qi()?()=>{this.Ri.showOffers(e)}:this.Xi()?()=>{this.Ri.showContributionOptions(e)}:void 0}gs(t,e,i){return()=>{const s=t!==pt.TYPE_REWARDED_AD||this.standardRewardedAdExperiment?t===pt.TYPE_NEWSLETTER_SIGNUP&&i===Ye.PREFERENCE_PUBLISHER_PROVIDED_PROMPT?new xe(this.ae,{action:t,configurationId:e,autoPromptType:this.ji,isClosable:this.zi,calledManually:!1,shouldRenderPreview:!!this.Mi}):new mi(this.ae,{action:t,configurationId:e,preference:i,autoPromptType:this.ji,isClosable:this.zi,calledManually:!1,shouldRenderPreview:!!this.Mi,monetizationFunction:this.ps(!1)}):new xe(this.ae,{action:t,configurationId:e,autoPromptType:this.ji,isClosable:this.zi,monetizationFunction:this.ps(!1),calledManually:!1,shouldRenderPreview:!!this.Mi});this.setLastAudienceActionFlow(s),s.start()}}setLastAudienceActionFlow(t){this.Li=t}getLastAudienceActionFlow(){return this.Li}Bi(){const t=this.ps();return()=>{this.ji===W.SUBSCRIPTION||this.ji===W.CONTRIBUTION?this.Di.create({autoPromptType:this.ji,clickCallback:t}):this.ji!==W.SUBSCRIPTION_LARGE&&this.ji!==W.CONTRIBUTION_LARGE||
23!t||t()}}Fi(t){if(this._s()>480){if(t===W.SUBSCRIPTION)return this.fs(t),W.SUBSCRIPTION_LARGE;if(t===W.CONTRIBUTION)return this.fs(t),W.CONTRIBUTION_LARGE}return t}fs(t){this.fe.logEvent({eventType:o.EVENT_DISABLE_MINIPROMPT_DESKTOP,eventOriginator:l.SWG_CLIENT,isFromUserAction:!1,additionalParameters:{publicationid:this.Ii.getPublicationId(),promptType:t}})}async ei(t){t.eventType&&(Li.find((e=>e===t.eventType))&&(this.xi=!0),await this.ws(t.eventType))}async ws(t){if(this.Ui!==V.CLOSED&&(Pi.has(t)||vi.has(t)||Ri.has(t)||xi.find((e=>e===t)))){if(!this.xi&&Ai.includes(t)){if(this.Pi)return;this.Pi=!0}this.storeEvent(t)}}async getTimestamps(){const t=await this.ti.get("tsp",!0);if(!t)return{};const e=JSON.parse(t);return this.Es(e)?Object.entries(e).reduce(((t,[e,i])=>({...t,[e]:{impressions:Ni(i.impressions),dismissals:Ni(i.dismissals),completions:Ni(i.completions)}})),{}):(this.fe.logSwgEvent(o.EVENT_LOCAL_STORAGE_TIMESTAMPS_PARSING_ERROR),{})}ls(t,e){const i=this.multiInstanceCtaExperiment?t[e.configId]:t[e.type];return e.closability===fi.BLOCKING?(null==i?void 0:i.completions)||[]:[...(null==i?void 0:i.dismissals)||[],...(null==i?void 0:i.completions)||[]]}Es(t){return t instanceof Object&&!(t instanceof Array)&&Object.values(Object.values(t).map((t=>3===Object.keys(t).length&&t.impressions.every((t=>!isNaN(t)))&&t.dismissals.every((t=>!isNaN(t)))&&t.completions.every((t=>!isNaN(t)))))).every(Boolean)}async setTimestamps(t){const e=JSON.stringify(t);this.ti.set("tsp",e,!0)}async storeImpression(t){const e=await this.getTimestamps(),i=e[t]||{impressions:[],dismissals:[],completions:[]};if(i.impressions.push(Date.now()),e[t]=i,!this.bs()&&this.Ji){const t=e[this.Ji]||{impressions:[],dismissals:[],completions:[]};t.impressions.push(Date.now()),e[this.Ji]=t}this.setTimestamps(e)}async storeDismissal(t){const e=await this.getTimestamps(),i=e[t]||{impressions:[],dismissals:[],completions:[]};if(i.dismissals.push(Date.now()),e[t]=i,!this.bs()&&this.Ji){const t=e[this.Ji]||{impressions:[],dismissals:[],completions:[]};t.dismissals.push(Date.now()),e[this.Ji]=t}this.setTimestamps(e)}async storeCompletion(t){const e=await this.getTimestamps(),i=e[t]||{impressions:[],dismissals:[],completions:[]};if(i.completions.push(Date.now()),e[t]=i,!this.bs()&&this.Ji){const t=e[this.Ji]||{impressions:[],dismissals:[],completions:[]};t.completions.push(Date.now()),e[this.Ji]=t}this.setTimestamps(e)}async storeEvent(t){let e;Pi.has(t)?this.xi||(e=Pi.get(t),this.storeImpression(e)):vi.has(t)?(e=vi.get(t),this.storeDismissal(e)):Ri.has(t)?(e=Ri.get(t),this.storeCompletion(e)):xi.includes(t)&&(this.Xi()&&this.storeCompletion(pt.TYPE_CONTRIBUTION),this.Qi()&&this.storeCompletion(pt.TYPE_SUBSCRIPTION))}_s(){return this.ee.getWin().innerWidth}bs(){return this.Gi||this.Mi}ts(t,e){var i,s;if(t.type===pt.TYPE_REWARDED_SURVEY)return!!(ai.isGaEligible(this.ae)||ai.isGtagEligible(this.ae)||ai.isGtmEligible(this.ae))&&!((this.multiInstanceCtaExperiment?null==(i=e[t.configurationId])?void 0:i.completions:null==(s=e[pt.TYPE_REWARDED_SURVEY])?void 0:s.completions)||[]).length;if(t.type===pt.TYPE_REWARDED_AD)if(t.preference===Ye.PREFERENCE_ADSENSE_REWARDED_AD){const t=this.ae.win().adsbygoogle;if(!(null==t?void 0:t.loaded))return!1}else{const t=this.ae.win().googletag;if(!(null==t?void 0:t.getVersion()))return this.fe.logSwgEvent(o.EVENT_REWARDED_AD_GPT_MISSING_ERROR),!1}return!0}ss(t,e,i,s){var n;const{repeatability:r,closability:a,configId:h}=t;if(!e.has(h))return!1;if((null==r?void 0:r.type)!==wi.INFINITE){const t=wi.FINITE===(null==r?void 0:r.type)&&r.count||1;let e;if(i.has(h)?e=i.get(h):(wi.FINITE===(null==r?void 0:r.type)&&this.fe.logSwgEvent(o.EVENT_COMPLETION_COUNT_FOR_REPEATABLE_ACTION_MISSING_ERROR),e=0),e>=t)return!1}const l=!!(null==(n=null==s?void 0:s.uiPredicates)?void 0:n.purchaseUnavailableRegion)&&this.Zi(t.type),u=this.Ui!==V.CLOSED||a===fi.DISMISSIBLE;return!(this.ki&&u&&l)}us(t,e){if(0===e.length)return!1;const i=Math.max(...e),s=1e3*(t.seconds||0)+this.Ts(t.nanos||0);return Date.now()-i<s}Ts(t){return Math.floor(t/Math.pow(10,6))}rs(t,e){var i,s;return(null==(i=e.promptFrequencyCap)?void 0:i.duration)||(this.fe.logSwgEvent(o.EVENT_PROMPT_FREQUENCY_CONFIG_NOT_FOUND),null==(s=t.anyPromptFrequencyCap)?void 0:s.frequencyCapDuration)}ds(t,e){var i;return(null==(i=e.globalFrequencyCap)?void 0:i.duration)||t.globalFrequencyCap.frequencyCapDuration}ns(t){var e,i,s;return this.hs(null==(e=null==t?void 0:t.globalFrequencyCap)?void 0:e.frequencyCapDuration)||(null==(i=null==t?void 0:t.promptFrequencyCaps)?void 0:i.map((t=>t.frequencyCapDuration)).some(this.hs))||this.hs(null==(s=null==t?void 0:t.anyPromptFrequencyCap)?void 0:s.frequencyCapDuration)}hs(t){return!!(null==t?void 0:t.seconds)||!!(null==t?void 0:t.nanos)}Hi(t){return e=t.type,ci.includes(e)&&t.configurationId?this.gs(t.type,t.configurationId,t.preference):this.Bi();var e}qi(t,e){return this.we.parseArticleExperimentConfigFlags(t).includes(e)}}const ki={frameborder:"0",scrolling:"no"};var Di=(t=>(t.LIGHT="light",t.DARK="dark",t))(Di||{});class Ui{constructor(t,e,i,s){this.ae=t,this.Is=e,this.ys=i,this.Ss=s,this.Xt=ye("/smartboxiframe"),this.ie=t.activities(),this.se=jt(t.win().document,"iframe",ki);const n={publicationId:this.ae.pageConfig().getPublicationId(),theme:this.ys&&this.ys.theme||"light",lang:this.ys&&this.ys.lang||"en"},r=this.ys&&this.ys.messageTextColor;r&&(n.messageTextColor=r),this.Zt=Se(n)}Cs(t){var e;t&&t.getIsClicked()&&(null==(e=this.Ss)||e.call(this))}start(){Vt(this.se,{opacity:"1",position:"absolute",top:"0",bottom:"0",left:"0",height:"100%",right:"0",width:"100%"}),this.Is.appendChild(this.se);const t=this.ie.addDefaultArguments(this.Zt);return this.ie.openIframe(this.se,this.Xt,t).then((t=>{t.on(P,this.Cs.bind(this))})),this.se}}var Gi=(t=>(t.SUBSCRIPTION="subscription",t.CONTRIBUTION="contribution",t))(Gi||{});const ji='<div class="swg-button-v2-icon-$theme$"></div>$textContent$';class Fi{constructor(t,e){this.ee=t,this.Os=e}init(){const t=this.ee.getHead();if(!t)return;const e="".concat(s,"/swg-button.css");t.querySelector('link[href="'.concat(e,'"]'))||t.appendChild(jt(this.ee.getWin().document,"link",{rel:"stylesheet",type:"text/css",href:e}))}create(t,e){const i=jt(this.ee.getWin().document,"button",{});return this.attach(i,t,e)}attach(t,e,i){const s=this.Ns(t,o.ACTION_SWG_BUTTON_CLICK,e,i).options,n=s.theme;return t.classList.add("swg-button-".concat(n)),t.setAttribute("role","button"),s.lang&&t.setAttribute("lang",s.lang),t.setAttribute("title",Pe(gt,t)),this.As(o.IMPRESSION_SWG_BUTTON),t}attachSubscribeButton(t,e,i){const s=this.Ns(t,o.ACTION_SWG_BUTTON_SHOW_OFFERS_CLICK,e,i).options,n=s.theme;return t.classList.add("swg-button-v2-".concat(n)),t.setAttribute("role","button"),s.lang&&t.setAttribute("lang",s.lang),s.enable||t.setAttribute("disabled","disabled"),t.innerHTML=ji.replace("$theme$",n).replace("$textContent$",Pe(gt,t)),this.As(o.IMPRESSION_SHOW_OFFERS_SWG_BUTTON),t}attachContributeButton(t,e,i){const s=this.Ns(t,o.ACTION_SWG_BUTTON_SHOW_CONTRIBUTIONS_CLICK,e,i).options,n=s.theme;return t.classList.add("swg-button-v2-".concat(n)),t.setAttribute("role","button"),s.lang&&t.setAttribute("lang",s.lang),s.enable||t.setAttribute("disabled","disabled"),t.innerHTML=ji.replace("$theme$",n).replace("$textContent$",Pe(mt,t)),this.As(o.IMPRESSION_SHOW_CONTRIBUTIONS_SWG_BUTTON),t}attachButtonsWithAttribute(t,e,i,s){for(const n of e){const e=Array.from(this.ee.getRootNode().querySelectorAll("[".concat(t,'="').concat(n,'"]')));for(const t of e)"subscription"===n?this.attachSubscribeButton(t,i,s[n]):"contribution"===n&&this.attachContributeButton(t,i,s[n])}}async As(t,e){(await this.Os).eventManager().logSwgEvent(t,e)}vs(t){const e=t&&"function"!=typeof t?t:{theme:Di.LIGHT},i=e.theme;return i!==Di.LIGHT&&i!==Di.DARK&&(e.theme=Di.LIGHT),e}Rs(t,e){return("function"==typeof t?t:null)||e}Ns(t,e,i,s){const n=this.vs(i),r=this.Rs(i,s),o=t=>{this.As(e,!0),"function"==typeof r&&r(t)};return t.addEventListener("click",o),{options:n,clickFun:o}}attachSmartButton(t,e,i,s){const n=this.Ns(e,o.ACTION_SWG_BUTTON_CLICK,i,s);return e.classList.add("swg-smart-button"),new Ui(t,e,n.options,n.clickFun).start()}}function zi(t){const e=new Uint8Array(t.length);for(let i=0;i<t.length;i++){const s=t.charCodeAt(i);ie(s<=255,"Characters must be in range [0,255]"),e[i]=s}return e}function Bi(t){const e=new Array(t.length);for(let i=0;i<t.length;i++)e[i]=String.fromCharCode(t[i]);return e.join("")}function Wi(t){if("undefined"!=typeof TextDecoder)return new TextDecoder("utf-8").decode(t);const e=Bi(new Uint8Array(t));return decodeURIComponent(escape(e))}function Vi(t){return"undefined"!=typeof TextEncoder?(new TextEncoder).encode(t):zi(unescape(encodeURIComponent(t)))}function Yi(t){return zi(atob(t.replaceAll("-","+").replaceAll("_","/")))}function qi(t){const e=Bi(t);return btoa(e).replaceAll("+","-").replaceAll("/","_").replaceAll("=","")}function Ki(t,e){try{return JSON.parse(t)}catch(i){return void(e&&e(i))}}function Hi(t,e){const i=Ki(t);return null==i?void 0:i[e]}class $i{constructor(){}decode(t){return this.Ps(t).payload}Ps(t){function e(){throw new Error('Invalid token: "'.concat(t,'"'))}const i=t.split(".");3!=i.length&&e();const s=Yi(i[0]),n=Yi(i[1]);return{header:Ki(Wi(s),e),payload:Ki(Wi(n),e),verifiable:"".concat(i[0],".").concat(i[1]),sig:i[2]}}}class Ji{constructor(t,e,i,s,n,r,o=null,a=null,h=null,l=null){this.raw=t,this.purchaseData=e,this.userData=i,this.entitlements=s,this.productType=n,this.xs=r,this.oldSku=o,this.swgUserToken=a,this.paymentRecurrence=h,this.requestMetadata=l}clone(){return new Ji(this.raw,this.purchaseData,this.userData,this.entitlements,this.productType,this.xs,this.oldSku,this.swgUserToken)}json(){return{purchaseData:this.purchaseData.json(),userData:this.userData?this.userData.json():null,entitlements:this.entitlements?this.entitlements.json():null,oldSku:this.oldSku,productType:this.productType,swgUserToken:this.swgUserToken}}complete(){return this.xs()}}class Qi{constructor(t,e){this.raw=t,this.signature=e,this.data=t}clone(){return new Qi(this.raw,this.signature)}json(){return{data:this.raw,signature:this.signature}}}class Xi{constructor(t,e){this.idToken=t,this.data=e,this.id=e.sub,this.email=e.email,this.emailVerified=e.email_verified,this.name=e.name,this.givenName=e.given_name,this.familyName=e.family_name,this.pictureUrl=e.picture}clone(){return new Xi(this.idToken,this.data)}json(){return{id:this.id,email:this.email,emailVerified:this.emailVerified,name:this.name,givenName:this.givenName,fam
23ilyName:this.familyName,pictureUrl:this.pictureUrl}}}const Zi={IMMEDIATE_WITH_TIME_PRORATION:1};function ts(t,e=null){return new I([,,,,t,,,e])}class es{constructor(t,e,i=We.SUBSCRIPTION){this.ae=t,this.Ls=e,this.di=i,this.Ms=t.payClient(),this.Ii=t.pageConfig(),this.ks=t.analytics(),this.fe=t.eventManager(),this.ue=t.clientConfigManager()}async start(){const t=await this.ue.getClientConfig();this.Ds(t.useUpdatedOfferFlows,t.paySwgVersion)}Ds(t,e){const i={skuId:this.Ls.skuId,publicationId:this.Ii.getPublicationId()};if(e&&(i.swgVersion=e),this.Ls.oldSku){i.oldSku=this.Ls.oldSku;const t=this.Ls.replaceSkuProrationMode;i.replaceSkuProrationMode=t?Zi[t]:Zi.IMMEDIATE_WITH_TIME_PRORATION,this.ks.setSku(i.oldSku)}this.Ls.oneTime&&(i.paymentRecurrence=2),this.Ls.metadata&&(i.metadata=this.Ls.metadata);const s=this.di==We.UI_CONTRIBUTION?Fe.CONTRIBUTE:Fe.SUBSCRIBE;this.ae.callbacks().triggerFlowStarted(s,this.Ls),this.fe.logSwgEvent(o.ACTION_PAYMENT_FLOW_STARTED,!0,ts(i.skuId)),this.fe.logSwgEvent(t?o.ACTION_PAY_PAYMENT_FLOW_STARTED:o.ACTION_PLAY_PAYMENT_FLOW_STARTED,!0),ss.waitingForPayClient=!0,this.Ms.start({apiVersion:1,allowedPaymentMethods:["CARD"],environment:Ee().payEnv,playEnvironment:Ee().playEnv,swg:i,i:{startTimeMs:Date.now(),productType:this.di}},{forceRedirect:this.ae.config().windowOpenMode==Be.REDIRECT,forceDisableNative:"2"==e})}}const is=class t{constructor(t){this.ae=t,this.gi=null,this.Us=null,this.I=null,this.oe=t.win(),this.ie=t.activities(),this.pi=t.dialogManager(),this.fe=t.eventManager(),this.ue=t.clientConfigManager()}static configurePending(e){const i=e.eventManager();e.payClient().onResponse((async s=>{e.entitlementsManager().blockNextNotification();const n=new t(e),r=async function(t,e,i){const s=!ss.waitingForPayClient;ss.waitingForPayClient=!1;const n=await e;let r,a=o.UNKNOWN;if("object"==typeof n&&n.googleTransactionId){const e=t.analytics().getTransactionId(),i=n.googleTransactionId;s?(t.analytics().setTransactionId(i),a=o.EVENT_GPAY_CANNOT_CONFIRM_TX_ID):e===i?a=o.EVENT_CONFIRM_TX_ID:(r=new I,r.setGpayTransactionId(i),a=o.EVENT_CHANGED_TX_ID)}else r=new I,r.setHadLogged(!s),a=o.EVENT_GPAY_NO_TX_ID;return t.eventManager().logSwgEvent(a,!0,r),function(t,e,i){var s;let n=null,r=null,o=We.SUBSCRIPTION,a=null,h=null,l=null;if(e)if("string"==typeof e)r=e;else{const t=e;if(t.swgCallbackData?n=t.swgCallbackData:t.integratorClientCallbackData&&(r=t.integratorClientCallbackData),e.paymentRequest){const t=e.paymentRequest.swg||{};a=t.oldSku,h=t.paymentRecurrence,l=t.metadata,o=(null==(s=e.paymentRequest.i)?void 0:s.productType)||We.SUBSCRIPTION}else e.productType&&(o=e.productType)}if(r&&!n&&(r=atob(r),r)&&(n=JSON.parse(r).swgCallbackData),!n)throw new Error("unexpected payment response");return r=JSON.stringify(n),new Ji(r,function(t){const e=t.purchaseData,i=t.purchaseDataSignature;return new Qi(e,i)}(n),function(t){const e=t.idToken;if(!e)return null;const i=(new $i).decode(e);return new Xi(e,i)}(n),function(t,e){return e.signedEntitlements?t.entitlementsManager().parseEntitlements(e):null}(t,n),o,i,a,n.swgUserToken,h,l)}(t,n,i)}(e,s,n.complete.bind(n));e.callbacks().triggerPaymentResponse(r);try{const t=await r,s=ns(t.purchaseData);e.analytics().setSku(s||""),i.logSwgEvent(o.ACTION_PAYMENT_COMPLETE,!0,ts(s||"",t.productType==We.UI_CONTRIBUTION?Fe.CONTRIBUTE:Fe.SUBSCRIBE)),(await e.clientConfigManager().getClientConfig()).useUpdatedOfferFlows&&i.logSwgEvent(o.EVENT_PAY_PAYMENT_COMPLETE,!0),t.productType==We.UI_CONTRIBUTION?i.logSwgEvent(o.EVENT_CONTRIBUTION_PAYMENT_COMPLETE,!0,ts(s||"",Fe.CONTRIBUTE)):t.productType==We.SUBSCRIPTION&&i.logSwgEvent(o.EVENT_SUBSCRIPTION_PAYMENT_COMPLETE,!0,ts(s||"",Fe.SUBSCRIBE)),n.start(t)}catch(a){const t=a;if(!Jt(t))throw e.eventManager().logSwgEvent(o.EVENT_PAYMENT_FAILED,!1),e.jserror().error("Pay failed",t),t;{const i=t.productType==We.UI_CONTRIBUTION?Fe.CONTRIBUTE:Fe.SUBSCRIBE;e.callbacks().triggerFlowCanceled(i),e.eventManager().logSwgEvent(o.ACTION_USER_CANCELED_PAYFLOW,!0)}}}))}async start(t){var e;this.I=ns(t.purchaseData),this.fe.logSwgEvent(o.IMPRESSION_ACCOUNT_CHANGED,!0,ts(this.I||"")),this.ae.entitlementsManager().reset(!0);const i={publicationId:this.ae.pageConfig().getPublicationId(),productType:t.productType,isSubscriptionUpdate:!!t.oldSku,isOneTime:!!t.paymentRecurrence};t.userData&&t.entitlements?(i.idToken=t.userData.idToken,this.ae.entitlementsManager().pushNextEntitlements(t.entitlements.raw),t.swgUserToken&&this.ae.storage().set(xt,t.swgUserToken,!0)):i.loginHint=null==(e=t.userData)?void 0:e.email;const s={};this.ue.shouldForceLangInIframes()&&(s.hl=this.ue.getLanguage());const n=ye("/payconfirmiframe",s),r=await this.ue.getClientConfig();i.useUpdatedConfirmUi=r.useUpdatedOfferFlows,i.skipAccountCreationScreen=r.skipAccountCreationScreen,this.gi=new Ge(this.oe,this.ie,n,Se(i),!0),this.gi.on(T,this.Gs.bind(this)),this.gi.acceptResult().then((()=>{this.pi.completeView(this.gi)})),this.Us=this.pi.openView(this.gi),this.Us.then((()=>{this.ae.callbacks().triggerPayConfirmOpened(this.gi)}))}Gs(t){const e=t.getJwt();e&&this.ae.entitlementsManager().pushNextEntitlements(e)}async complete(){this.fe.logSwgEvent(o.ACTION_ACCOUNT_CREATED,!0,ts(this.I||""));const t=Date.now().toString();this.ae.storage().set(Lt,t,!1),this.ae.entitlementsManager().unblockNextNotification();const e=await this.ue.getClientConfig();if(await this.Us,!e.skipAccountCreationScreen){const t=new u;t.setComplete(!0),this.gi.execute(t)}try{await this.gi.acceptResult()}catch{}e.skipAccountCreationScreen||this.fe.logSwgEvent(o.ACTION_ACCOUNT_ACKNOWLEDGED,!0,ts(this.I||"")),this.ae.entitlementsManager().setToastShown(!0)}};is.waitingForPayClient=!1;let ss=is;function ns(t){return Hi(t.raw,"productId")||null}const rs=!0;class os{constructor(t,e){var i;this.ae=t,this.gi=null,this.oe=t.win(),this.ie=t.activities(),this.pi=t.dialogManager(),this.fe=t.eventManager(),this.ue=t.clientConfigManager(),this.ri=void 0===(null==e?void 0:e.shouldAnimateFade)||(null==e?void 0:e.shouldAnimateFade),this.zi=null!=(i=null==e?void 0:e.isClosable)&&i;const s=t.activities().addDefaultArguments({showNative:t.callbacks().hasSubscribeRequestCallback(),productType:We.SUBSCRIPTION,list:(null==e?void 0:e.list)||"default",skus:(null==e?void 0:e.skus)||null,isClosable:this.zi});if(null==e?void 0:e.oldSku){s.oldSku=e.oldSku,ie(s.skus,"Need a sku list if old sku is provided!");let t=s.skus;const i=s.oldSku;t=t.filter((t=>t!==i)),ie(t.length>0,"Sku list only contained offer user already has"),s.skus=t}if(s.skus&&1===s.skus.length){const t=s.skus[0],e=s.oldSku;if(e){const i=new R;return i.setSku(t),i.setOldSku(e),void this.js(i)}}this.Fs=s.skus||["*"],this.zs=this.ue.getClientConfig(),this.Bs=this.Ws(s)}async Ws(t){const e=await this.zs;return new Ge(this.oe,this.ie,this.Vs(e,this.ae.pageConfig()),t,!0,!1,this.ri)}js(t){const e=t.getSku();if(e){const i={skuId:e},s=t.getOldSku();s&&(i.oldSku=s,this.ae.analytics().setSku(s)),this.fe.logSwgEvent(o.ACTION_OFFER_SELECTED,!0,function(t){return new I([,,,,t])}(e)),new es(this.ae,i).start()}}_i(t){t.getSubscriberOrMember()&&(this.fe.logSwgEvent(o.ACTION_ALREADY_SUBSCRIBED,!0),this.ae.callbacks().triggerLoginRequest({linkRequested:!!t.getLinkRequested()}))}Ys(t){t.getNative()&&this.ae.callbacks().triggerSubscribeRequest()}
23async start(){if(this.gi=await this.Bs,!this.gi)return;this.ae.callbacks().triggerFlowStarted(Fe.SHOW_OFFERS,{skus:this.Fs,source:"SwG"}),this.gi.onCancel((()=>{this.ae.callbacks().triggerFlowCanceled(Fe.SHOW_OFFERS)})),this.gi.on(R,this.js.bind(this)),this.gi.on(c,this._i.bind(this)),this.gi.on(z,this.Ys.bind(this));const t=await this.zs;return this.pi.openView(this.gi,!1,this.qs(t,this.ue.shouldAllowScroll()))}qs(t,e){return t.useUpdatedOfferFlows?{desktopConfig:{isCenterPositioned:!0,supportsWideScreen:!0},shouldDisableBodyScrolling:!e,closeOnBackgroundClick:this.zi}:{}}Vs(t,e){var i;if(!t.useUpdatedOfferFlows){const t=ae(this.oe.location.hash)["swg.newoffercard"];return ye("/offersiframe",t?{useNewOfferCard:t}:{})}const s={publicationId:e.getPublicationId()};return this.ue.shouldForceLangInIframes()&&(s.hl=this.ue.getLanguage()),(null==(i=t.uiPredicates)?void 0:i.purchaseUnavailableRegion)&&(s.purchaseUnavailableRegion="true"),ye("/subscriptionoffersiframe",s)}showNoEntitlementFoundToast(){this.gi&&this.gi.execute(new T)}}class as{constructor(t,e){this.ae=t,this.ys=e,this.ie=t.activities(),this.pi=t.dialogManager(),this.fe=t.eventManager(),this.gi=new Ge(t.win(),this.ie,ye("/optionsiframe"),Se({publicationId:t.pageConfig().getPublicationId(),productId:t.pageConfig().getProductId(),list:(null==e?void 0:e.list)||"default",skus:(null==e?void 0:e.skus)||null,isClosable:!0}),!1)}start(){return this.ae.callbacks().triggerFlowStarted(Fe.SHOW_SUBSCRIBE_OPTION),this.gi.onCancel((()=>{this.ae.callbacks().triggerFlowCanceled(Fe.SHOW_SUBSCRIBE_OPTION)})),this.gi.on(x,this.Ks.bind(this)),this.gi.acceptResult().then((t=>{const e=t.data,i=new x;e.subscribe&&i.setSubscribe(!0),this.Ks(i)}),(t=>{throw this.pi.completeView(this.gi),t})),this.fe.logSwgEvent(o.IMPRESSION_CLICK_TO_SHOW_OFFERS),this.pi.openView(this.gi)}Ks(t){if(t.getSubscribe()){const t=this.ys||{};null==t.isClosable&&(t.isClosable=rs),this.fe.logSwgEvent(o.ACTION_VIEW_OFFERS,!0),new os(this.ae,t).start()}}}class hs{constructor(t,e={}){this.ae=t,this.ys=e,this.oe=t.win(),this.ie=t.activities(),this.pi=t.dialogManager(),this.fe=t.eventManager(),this.gi=new Ge(this.oe,this.ie,ye("/abbrvofferiframe"),Se({publicationId:t.pageConfig().getPublicationId(),productId:t.pageConfig().getProductId(),showNative:t.callbacks().hasSubscribeRequestCallback(),list:e.list||"default",skus:e.skus||null,isClosable:!0}),!1)}_i(t){t.getSubscriberOrMember()&&(this.fe.logSwgEvent(o.ACTION_ALREADY_SUBSCRIBED,!0),this.ae.callbacks().triggerLoginRequest({linkRequested:!!t.getLinkRequested()}))}start(){return this.ae.callbacks().triggerFlowStarted(Fe.SHOW_ABBRV_OFFER),this.gi.onCancel((()=>{this.ae.callbacks().triggerFlowCanceled(Fe.SHOW_ABBRV_OFFER)})),this.gi.on(c,this._i.bind(this)),this.gi.acceptResult().then((t=>{const e=t.data;return e.viewOffers?(null==this.ys.isClosable&&(this.ys.isClosable=rs),this.fe.logSwgEvent(o.ACTION_VIEW_OFFERS,!0),void new os(this.ae,this.ys).start()):e.native?(this.ae.callbacks().triggerSubscribeRequest(),void this.pi.completeView(this.gi)):void 0})),this.fe.logSwgEvent(o.IMPRESSION_CLICK_TO_SHOW_OFFERS_OR_ALREADY_SUBSCRIBED),this.pi.openView(this.gi)}}function ls(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function us(t){if(t.__esModule)return t;var e=t.default;if("function"==typeof e){var i=function t(){return this instanceof t?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};i.prototype=e.prototype}else i={};return Object.defineProperty(i,"__esModule",{value:!0}),Object.keys(t).forEach((function(e){var s=Object.getOwnPropertyDescriptor(t,e);Object.defineProperty(i,e,s.get?s:{enumerable:!0,get:function(){return t[e]}})})),i} 24/** 25 * @license 26 * Copyright 2017 The Web Activities Authors. All Rights Reserved. 27 * 28 * Licensed under the Apache License, Version 2.0 (the "License"); 29 * you may not use this file except in compliance with the License. 30 * You may obtain a copy of the License at 31 * 32 * http://www.apache.org/licenses/LICENSE-2.0 33 * 34 * Unless required by applicable law or agreed to in writing, softw
34are 35 * distributed under the License is distributed on an "AS-IS" BASIS, 36 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 37 * See the License for the specific language governing permissions and 38 * limitations under the License. 39 */const cs={IFRAME:"iframe",POPUP:"popup",REDIRECT:"redirect"},ds={OK:"ok",CANCELED:"canceled",FAILED:"failed"};class ps{constructor(t,e,i,s,n,r){this.code=t,this.data=t==ds.OK?e:null,this.mode=i,this.origin=s,this.originVerified=n,this.secureChannel=r,this.ok=t==ds.OK,this.error=t==ds.FAILED?new Error(String(e)||""):null}}const gs="AbortError";let ms;function fs(t){return function(t){if(t.origin)return t.origin;const e=t.protocol;let i=t.host;return"https:"==e&&i.indexOf(":443")==i.length-4?i=i.replace(":443",""):"http:"==e&&i.indexOf(":80")==i.length-3&&(i=i.replace(":80","")),e+"//"+i}(function(t){return ms||(ms=document.createElement("a")),ms.href=t,ms}(t))}function ws(t,e){const i="AbortError"+(e?": "+e:"");let s=null;if("function"==typeof t.DOMException){const e=t.DOMException;try{s=new e(i,gs)}catch(n){}}return s||(s=new Error(i),s.name=gs,s.code=20),s}function Es(t,e,i){if(e.ok)i(e);else{const s=e.error||ws(t);s.activityResult=e,i(Promise.reject(s))}}function bs(t){const e=t.navigator;return/Trident|MSIE|IEMobile/i.test(e&&e.userAgent)}function Ts(t){const e=t.navigator;return/Edge/i.test(e&&e.userAgent)}const Is="__ACTIVITIES__";class ys{constructor(t,e,i,s){this.oe=t,this.Hs=e,this.$s=i,this.Js=s,this.Qs=null,this.Xs=!1,this.oi=null,this.Zs=null,this.sn=null,this.nn=null,this.rn=this.an.bind(this)}connect(t){if(this.Zs)throw new Error("already connected");this.Zs=t,this.oe.addEventListener("message",this.rn)}disconnect(){if(this.Zs&&(this.Zs=null,this.oi&&(Ss(this.oi),this.oi=null),this.oe.removeEventListener("message",this.rn),this.nn)){for(const t in this.nn){const e=this.nn[t];e.port1&&Ss(e.port1),e.port2&&Ss(e.port2)}this.nn=null}}isConnected(){return null!=this.$s}getTarget(){const t=this.hn();if(!t)throw new Error("not connected");return t}hn(){return this.Zs&&!this.Qs&&("function"==typeof this.Hs?this.Qs=this.Hs():this.Qs=this.Hs),this.Qs}getTargetOrigin(){if(null==this.$s)throw new Error("not connected");return this.$s}sendConnectCommand(){const t=bs(this.oe)||Ts(this.oe);this.sendCommand("connect",{acceptsChannel:t})}sendStartCommand(t){let e=null;this.Xs&&"function"==typeof this.oe.MessageChannel&&(e=new this.oe.MessageChannel),e?(this.sendCommand("start",t,[e.port2]),this.ln(e.port1)):this.sendCommand("start",t)}sendCommand(t,e,i){const s={sentinel:Is,cmd:t,payload:e||null};if(this.oi)this.oi.postMessage(s,i||void 0);else{const e=this.getTarget(),n="connect"==t?null!=this.$s?this.$s:"*":this.getTargetOrigin();e.postMessage(s,n,i||void 0)}}customMessage(t){this.sendCommand("msg",t)}onCustomMessage(t){this.sn=t}startChannel(t){const e=t||"",i=this.un(e);if(!i.port1){const t=new this.oe.MessageChannel;i.port1=t.port1,i.port2=t.port2,i.resolver(i.port1)}return i.port2&&(this.sendCommand("cnset",{name:e},[i.port2]),i.port2=null),i.promise}askChannel(t){const e=t||"",i=this.un(e);return i.port1||this.sendCommand("cnget",{name:e}),i.promise}cn(t,e){const i=this.un(t);i.port1=e,i.resolver(e)}un(t){this.nn||(this.nn={});let e=this.nn[t];if(!e){let i;const s=new Promise((t=>{i=t}));e={port1:null,port2:null,resolver:i,promise:s},this.nn[t]=e}return e}ln(t){this.oi&&Ss(this.oi),this.oi=t,this.oi.onmessage=t=>{const e=t.data,i=e&&e.cmd,s=e&&e.payload||null;i&&this.dn(i,s,t)}}an(t){if(this.Js&&this.hn()!=t.source)return;const e=t.data;if(!e||e.sentinel!=Is)return;const i=e.cmd;if(this.oi&&"connect"!=i&&"start"!=i)return;const s=t.origin,n=e.payload||null;null==this.$s&&"start"==i&&(this.$s=s),null==this.$s&&t.source&&this.hn()==t.source&&(this.$s=s),s==this.$s&&this.dn(i,n,t)}dn(t,e,i){if("connect"==t)this.oi&&(Ss(this.oi),this.oi=null),this.Xs=e&&e.acceptsChannel||!1,this.Zs(t,e);else if("start"==t){const s=i.ports&&i.ports[0];s&&this.ln(s),this.Zs(t,e)}else if("msg"==t)null!=this.sn&&null!=e&&this.sn(e);else if("cnget"==t){const t=e.name;this.startChannel(t)}else if("cnset"==t){const t=e.name,s=i.ports[0];this.cn(t,s)}else this.Zs(t,e)}}function Ss(t){try{t.close()}catch(e){}}let Cs=class{constructor(t,e,i){this.se=t,this.N=e,this.Zt=i||null,this.oe=this.se.ownerDocument.defaultView,this.$s=fs(e),this.gn=!1,this.mn=null,this._n=new Promise((t=>{this.mn=t})),this.fn=null,this.Us=new Promise((t=>{this.fn=t})),this.wn=null,this.En=new Promise((t=>{this.wn=t})),this.bn=null,this.Tn=null,this.In=new ys(this.oe,(()=>this.se.contentWindow),this.$s,!0)}getMode(){return cs.IFRAME}connect(){if(!function(t){if("isConnected"in t)return t.isConnected;const e=t.ownerDocument&&t.ownerDocument.documentElement;return e&&e.contains(t)||!1}(this.se))throw new Error("iframe must be in DOM");return this.In.connect(this.dn.bind(this)),this.se.src=this.N,this._n}disconnect(){this.gn=!1,this.In.disconnect()}acceptResult(){return this.En}getTargetWin(){return this.se.contentWindow||null}message(t){this.In.customMessage(t)}onMessage(t){this.In.onCustomMessage(t)}
39messageChannel(t){return this.In.askChannel(t)}whenReady(){return this.Us}onResizeRequest(t){this.bn=t,Promise.resolve().then((()=>{null!=this.Tn&&t(this.Tn)}))}resized(){if(!this.gn)return;const t=this.se.offsetHeight;this.In.sendCommand("resized",{height:t})}dn(t,e){if("connect"==t)this.gn=!0,this.In.sendStartCommand(this.Zt),this.mn();else if("result"==t){if(this.wn){const t=e.code,i=t==ds.FAILED?new Error(e.data||""):e.data,s=new ps(t,i,cs.IFRAME,this.In.getTargetOrigin(),!0,!0);Es(this.oe,s,this.wn),this.wn=null,this.In.sendCommand("close"),this.disconnect()}}else"ready"==t?this.fn&&(this.fn(),this.fn=null):"resize"==t&&(this.Tn=e.height,this.bn&&this.bn(this.Tn))}};class Os{constructor(t,e,i,s,n,r){if(!s||"_blank"!=s&&"_top"!=s&&"_"==s[0])throw new Error('The only allowed targets are "_blank", "_top" and name targets');this.oe=t,this.yn=e,this.N=i,this.Sn=s,this.Zt=n||null,this.ys=r||{},this.mn=null,this._n=new Promise((t=>{this.mn=t})),this.wn=null,this.En=new Promise((t=>{this.wn=t})),this.Cn=null,this.On=null,this.In=null}getMode(){return"_top"==this.Sn?cs.REDIRECT:cs.POPUP}open(){return this.Nn()}whenConnected(){return this._n}disconnect(){if(this.On&&(this.oe.clearInterval(this.On),this.On=null),this.In&&(this.In.disconnect(),this.In=null),this.Cn){try{this.Cn.close()}catch(t){}this.Cn=null}this.wn=null}getTargetWin(){return this.Cn}acceptResult(){return this.En}message(t){this.In.customMessage(t)}onMessage(t){this.In.onCustomMessage(t)}
39messageChannel(t){return this.In.askChannel(t)}Nn(){const t=this.An();let e,i=this.N;if(!this.ys.skipRequestInUrl){const t=this.ys.returnUrl||function(t){const e=t.indexOf("#");return-1==e?t:t.substring(0,e)}(this.oe.location.href);i=function(t,e,i){return t+(-1==t.indexOf("#")?"#":"&")+encodeURIComponent("__WA__")+"="+encodeURIComponent(i)}(i,0,function(t){const e={requestId:t.requestId,returnUrl:t.returnUrl,args:t.args};return void 0!==t.origin&&(e.origin=t.origin),void 0!==t.originVerified&&(e.originVerified=t.originVerified),JSON.stringify(e)}({requestId:this.yn,returnUrl:t,args:this.Zt}))}let s=this.Sn;"_top"!=s&&bs(this.oe)&&(s="_top");try{e=this.oe.open(i,s,t)}catch(n){}if(!e&&"_top"!=s&&!this.ys.disableRedirectFallback){s="_top";try{e=this.oe.open(i,s)}catch(n){}}return e?(this.Cn=e,"_top"!=s&&this.vn()):this.Rn(new Error("failed to open window")),this.En.catch((()=>{}))}An(){const t=this.oe.screen,e=t.availWidth||t.width,i=t.availHeight||t.height,s=this.Pn(),n=Ts(this.oe),r=s&&this.oe.outerWidth>this.oe.innerWidth?Math.min(100,this.oe.outerWidth-this.oe.innerWidth):n?100:0,o=s&&this.oe.outerHeight>this.oe.innerHeight?Math.min(100,this.oe.outerHeight-this.oe.innerHeight):n?100:0,a=Math.max(e-r,.5*e),h=Math.max(i-o,.5*i);let l=Math.floor(Math.min(600,.9*a)),u=Math.floor(Math.min(600,.9*h));this.ys.width&&(l=Math.min(this.ys.width,a)),this.ys.height&&(u=Math.min(this.ys.height,h));const c=Math.floor((t.width-l)/2),d=Math.floor((t.height-u)/2),p={height:u,width:l,resizable:"yes",scrollbars:"yes"};n||(p.left=c,p.top=d);let g="";for(const m in p)g&&(g+=","),g+="".concat(m,"=").concat(p[m]);return g}Pn(){return this.oe==this.oe.top}vn(){this.On=this.oe.setInterval((()=>{this.xn(!0)}),500),this.In=new ys(this.oe,this.Cn,null,!0),this.In.connect(this.dn.bind(this))}xn(t){this.Cn&&!this.Cn.closed||(this.On&&(this.oe.clearInterval(this.On),this.On=null),this.oe.setTimeout((()=>{try{this.Ln(ds.CANCELED,null)}catch(t){this.Rn(t)}}),t?3e3:0))}Rn(t){this.wn&&this.wn(Promise.reject(t)),this.disconnect()}Ln(t,e){if(this.wn){const i=this.In.isConnected(),s=new ps(t,e,cs.POPUP,i?this.In.getTargetOrigin():fs(this.N),i,i);Es(this.oe,s,this.wn),this.wn=null}this.In&&this.In.sendCommand("close"),this.disconnect()}dn(t,e){if("connect"==t)this.In.sendStartCommand(this.Zt),this.mn();else if("result"==t){const t=e.code,i=t==ds.FAILED?new Error(e.data||""):e.data;this.Ln(t,i)}else"check"==t&&this.oe.setTimeout((()=>this.xn()),200)}}class Ns{constructor(t,e,i,s,n){this.oe=t,this.Mn=e,this.kn=i,this.$s=s,this.Dn=n}getMode(){return cs.REDIRECT}acceptResult(){const t=new ps(this.Mn,this.kn,cs.REDIRECT,this.$s,this.Dn,!1);return new Promise((e=>{Es(this.oe,t,e)}))}}var As={ActivityPorts:class{constructor(t){this.version="1.24",this.oe=t,this.Un=t.location.hash,this.Gn={},this.jn={},this.Fn=null,this.zn=new Promise((t=>{this.Fn=t}))}openIframe(t,e,i){const s=new Cs(t,e,i);return s.connect().then((()=>s))}open(t,e,i,s,n){return{targetWin:this.Bn(t,e,i,s,n).getTargetWin()}}openWithMessaging(t,e,i,s,n){const r=this.Bn(t,e,i,s,n);return r.whenConnected().then((()=>r))}onResult(t,e){let i=this.Gn[t];i||(i=[],this.Gn[t]=i),i.push(e);const s=this.Wn(t);s&&this.Vn(s,e)}onRedirectError(t){this.zn.then(t)}Bn(t,e,i,s,n){const r=new Os(this.oe,t,e,i,s,n);return r.open().then((()=>{this.Yn(t,r)})),r}Wn(t){let e=this.jn[t];if(!e&&this.Un){try{e=function(t,e,i){const s="__WA_RES__",n=(r=s,(o=e,o?(/^[?#]/.test(o)?o.slice(1):o).split("&").reduce(((t,e)=>{const i=e.split("="),s=decodeURIComponent(i[0]||""),n=decodeURIComponent(i[1]||"");return s&&(t[s]=n),t}),{}):{})[r]);var r,o;if(!n)return null;const a=JSON.parse(n);if(!a||a.requestId!=i)return null;const h=function(t,e){if(!t)return t;const i=encodeURIComponent(e)+"=";let s=-1;do{if(s=t.indexOf(i,s),-1!=s){const e=s>0?t.substring(s-1,s):"";if(""==e||"?"==e||"#"==e||"&"==e){let e=t.indexOf("&",s+1);-1==e&&(e=t.length),t=t.substring(0,s)+t.substring(e+1)}else s++}}while(-1!=s&&s<t.length);return t}(t.location.hash,s)||"";if(h!=t.location.hash&&t.history&&t.history.replaceState)try{t.history.replaceState(t.history.state,"",h)}catch(p){}const l=a.code,u=a.data,c=a.origin,d=t.document.referrer&&fs(t.document.referrer);return new Ns(t,l,u,c,c==d)}(this.oe,this.Un,t)}catch(i){!function(t){setTimeout((()=>{throw t}))}(i),this.Fn(i)}e&&(this.jn[t]=e)}return e}Vn(t,e){Promise.resolve().then((()=>{e(t)}))}Yn(t,e){const i=this.Gn[t];
39i&&i.forEach((t=>{this.Vn(e,t)})),this.jn[t]=e}},ActivityIframePort:Cs,ActivityMessagingPort:class{getTargetWin(){}message(t){}onMessage(t){}messageChannel(t){}},ActivityMode:cs,ActivityOpenOptions:void 0,ActivityPort:class{getMode(){}acceptResult(){}},ActivityRequest:void 0,ActivityResult:ps,ActivityResultCode:ds,ActivityWindowPort:Os,createAbortError:ws,isAbortError:function(t){return!(!t||"object"!=typeof t)&&t.name===gs}};const vs=t({__proto__:null,default:ls(As)},[As]);class Rs{constructor(t){this.oi=t}acceptResult(){return this.oi.acceptResult()}}let Ps=class{constructor(t,e,i,s){this.ae=i,this.qn=new As.ActivityIframePort(t,e,s),this.Kn={}}whenReady(){return this.qn.whenReady()}async connect(){await this.qn.connect(),this.qn.onMessage((t=>{const e=null==t?void 0:t.RESPONSE;if(!e)return;const i=this.Kn[e[0]];if(i){const t=function(t){const e=t?t[0]:null;if(e){const i=B[e];if(i)return new i(t)}throw new Error("Deserialization failed for ".concat(t))}(e);i(t)}})),this.ae&&this.ae.eventManager()&&this.on(g,(t=>{var e,i;this.ae.eventManager().logEvent({eventType:t.getEvent(),eventOriginator:l.SWG_SERVER,isFromUserAction:null==(e=t.getMeta())?void 0:e.getIsFromUserAction(),additionalParameters:t.getParams(),configurationId:null==(i=t.getMeta())?void 0:i.getConfigurationId()})}))}disconnect(){this.qn.disconnect()}getMode(){return this.qn.getMode()}acceptResult(){return this.qn.acceptResult()}onResizeRequest(t){return this.qn.onResizeRequest(t)}execute(t){this.qn.message({REQUEST:t.toArray()})}on(t,e){let i=null;try{i=t.prototype.label()}catch{i=null}if(!i)throw new Error("Invalid data type");if(this.Kn[i])throw new Error("Invalid type or duplicate callback for "+i);this.Kn[i]=e}resized(){this.qn.resized()}},xs=class{constructor(t){this.ae=t,this.ie=new As.ActivityPorts(t.win())}addDefaultArguments(t){const e=this.ae,s=e.pageConfig(),n=e.analytics().getContext();return Object.assign({analyticsContext:n.toArray(),publicationId:s.getPublicationId(),productId:s.getProductId(),_client:"SwG ".concat(i),supportsEventManager:!0},t||{})}async Hn(t,e,i){const s=new Ps(t,e,this.ae,i);return await s.connect(),s}async openIframe(t,e,i,s=!1){s&&(i=this.addDefaultArguments(i));const n=await this.ae.storage().get(xt,!0),r=new URL(e).searchParams;n&&!r.has("sut")&&(e=he(e,"sut",n));const o=this.ae.pageConfig().getPublicationId();return o&&!r.has("publicationId")&&(e=he(e,"publicationId",o)),this.Hn(t,e,i)}open(t,e,i,s,n,r=!1){return r&&(s=this.addDefaultArguments(s)),this.ie.open(t,e,i,s,n)}onResult(t,e){this.ie.onResult(t,(t=>{e(new Rs(t))}))}onRedirectError(t){this.ie.onRedirectError(t)}getOriginalWebActivityPorts(){return this.ie}};var Ls=(t=>(t[t.PROCESS_EVENT=0]="PROCESS_EVENT",t[t.CANCEL_EVENT=1]="CANCEL_EVENT",t))(Ls||{});function Ms(t,e){return"Event has an invalid "+t+"("+e+")"}class ks{constructor(t){this.$n=t,this.Jn=[],this.Qn=[],this.lastAction=null}static isPublisherEvent(t){return t.eventOriginator===l.PROPENSITY_CLIENT||t.eventOriginator===l.PUBLISHER_CLIENT}registerEventListener(t){if(!ri(t))throw new Error("Event manager listeners must be a function");this.Jn.push(t)}registerEventFilterer(t){if(!ri(t))throw new Error("Event manager filterers must be a function");this.Qn.push(t)}logEvent(t,e,i){!function(t){if(!si(t))throw new Error("Event must be a valid object");if(!ni(o,t.eventType))throw new Error(Ms("eventType",t.eventType));if(!ni(l,t.eventOriginator))throw new Error(Ms("eventOriginator",t.eventOriginator));if(!si(t.additionalParameters)&&null!=t.additionalParameters)throw new Error(Ms("additionalParameters",t.additionalParameters));if(null!=t.isFromUserAction&&!oi(t.isFromUserAction))throw new Error(Ms("isFromUserAction",t.isFromUserAction))}(t),t.timestamp=null!=i?i:Date.now(),this.lastAction=this.an(t,e)}async an(t,e){await this.$n;for(const s of this.Qn)try{if(s(t)===Ls.CANCEL_EVENT)return}catch(i){te(i)}for(const s of this.Jn)try{s(t,e)}catch(i){te(i)}}logSwgEvent(t,e=!1,i=null,s,n=null){this.logEvent({eventType:t,eventOriginator:l.SWG_CLIENT,isFromUserAction:e,additionalParameters:i,configurationId:n},void 0,s)}getReadyPromise(){return this.$n}}const Ds="0123456789ABCDEF";function Us(t){return new j([Math.floor(t/1e3),t%1e3*1e6],!1)}const Gs={opacity:"0",position:"absolute",top:"-10px",left:"-10px",height:"1px",width:"1px"},js="AnalyticsService timed out waiting for a response";function Fs(t){const e=new y;return e.setComplete(!1),e.setError(t),e}class zs{constructor(t){var e;this.ae=t,this.F=new d,this.Xn=!1,this.Zn=!1,this.er=null,this.ir=[],this.ai=null,this.nr=null,this.rr=!1,this.lr=null,this.ur=0,this.lastAction=null,this.M=Us(t.creationTimestamp()),this.ee=t.doc(),this.ie=t.activities(),this.se=jt(this.ee.getWin().document,"iframe",{}),Vt(this.se,Gs),null==(e=this.ee.getBody())||e.appendChild(this.getElement()),this.cr(),this.fe=t.eventManager(),this.fe.registerEventListener(this.ei.bind(this))}setReadyForLogging(){this.rr=!0;for(const t of this.ir)this.ei(t)}setTransactionId(t){const e=this.F.getTransactionId();if(this.F.setTransactionId(t),null!=e&&e!=t){const t=o.EVENT_NEW_TX_ID,i=new I;i.setOldTransactionId(e),this.fe.logSwgEvent(t,!0,i)}}getTransactionId(){return this.F.getTransactionId()}
39getSku(){return this.F.getSku()}setSku(t){this.F.setSku(t)}setUrl(t){this.F.setUrl(t)}addLabels(t){if(t&&t.length>0){const e=[].concat(this.F.getLabelList());for(const i of t)-1==e.indexOf(i)&&e.push(i);this.F.setLabelList(e)}}getElement(){return this.se}dr(){return this.ee.getWin().location.search}pr(){return this.ee.getWin().document.referrer}gr(){const t=this.mr();if(t&&t.length){const e=t[0],i=e.loadEventStart-e.unloadEventEnd;if(i>0)return i}return 0}mr(){return performance.getEntriesByType("navigation")}cr(){const t=this.F;t.setTransactionId(function(){let t=function(){const t=Date.now().toString(16);return t.substring(t.length-8).toUpperCase()}()+"-",e=0;const i=function(){const t=new Uint8Array(23);self.crypto.getRandomValues(t);for(let e=t.length-1;e>-1;e--)t[e]=t[e]%16;return t}();for(let n=9;n<36;n++)switch(n){case 13:case 18:case 23:t+="-";break;case 14:t+="4";break;case 19:t+=(s=i[e++],Ds[3&s|8]);break;default:t+=Ds[i[e++]]}var s;return t}()+".swg"),t.setReferringOrigin(oe(this.pr()).origin),t.setClientVersion("SwG ".concat(i)),t.setUrl(ce(this.ee)),t.setIsLockedContent(this.ae.pageConfig().isLocked()),t.setUrlFromMarkup(ue(this.ee)||"");const e=ae(this.dr()),s=e.utm_campaign,n=e.utm_medium,r=e.utm_source;s&&t.setUtmCampaign(s),n&&t.setUtmMedium(n),r&&t.setUtmSource(r)}start(){return this.ai||(this.addLabels(Si(this.ee.getWin())),this.ai=this.preparePort()),this.ai}async preparePort(){let t;try{t=await this.ie.openIframe(this.se,ye("/serviceiframe"),null,!0)}catch(e){return this.Zn=!0,this._r(Fs("Could not connect ["+e+"]")),null}return t.on(y,this._r.bind(this)),await t.whenReady(),this.addLabels(Si(this.ee.getWin())),t}setReadyToPay(t){this.F.setReadyToPay(t)}close(){var t;null==(t=this.ee.getBody())||t.removeChild(this.getElement())}getContext(){return this.F}ii(t){const e=new p;e.setEventOriginator(t.eventOriginator),e.setIsFromUserAction(!!t.isFromUserAction),t.configurationId&&e.setConfigurationId(t.configurationId),this.F.setClientTimestamp(Us(t.timestamp));const i=this.gr();var s;i>0&&this.F.setLoadEventStartDelay((s=i,new w([Math.floor(s/1e3),s%1e3*1e6],!1))),this.F.setRuntimeCreationTimestamp(this.M);const n=new g;return n.setEvent(t.eventType),n.setContext(this.F),n.setMeta(e),t.additionalParameters instanceof I&&n.setParams(t.additionalParameters),n}wr(){return!0===this.ae.config().enableSwgAnalytics}ei(t){t.eventType!==o.EVENT_SUBSCRIPTION_STATE&&t.eventOriginator!==l.SHOWCASE_CLIENT&&(ks.isPublisherEvent(t)&&!this.wr()||(this.rr?(this.ur++,this.lastAction=this.Er(t)):this.ir.push(t)))}async Er(t){const e=await this.start(),i=this.ii(t);null==e||e.execute(i)}_r(t){const e=(null==t?void 0:t.getComplete())||!1,i=(null==t?void 0:t.getError())||"Unknown logging Error",s=i===js;e||te("Error when logging: "+i),this.ur--,s||(this.Xn=!0),null!==this.er&&(0===this.ur||this.Zn||s)&&(null!==this.lr&&(clearTimeout(this.lr),this.lr=null),this.er(e),this.nr=null,this.er=null)}getLoggingPromise(){return 0===this.ur||this.Zn?Promise.resolve(!0):(null===this.nr&&(this.nr=new Promise((t=>{this.er=t})),this.lr=self.setTimeout((()=>{this.lr=null,this._r(Fs(js))}),this.Xn?200:500)),this.nr)}}class Bs{constructor(){this.br={},this.jn={},this.Tr=null}setOnEntitlementsResponse(t){this.Ir(1,t)}triggerEntitlementsResponse(t){return this.yr(1,t.then((t=>t.clone())))}hasEntitlementsResponsePending(){return!!this.jn[1]}setOnLoginRequest(t){this.Ir(4,t)}triggerLoginRequest(t){return this.yr(4,t)}setOnLinkProgress(t){this.Ir(5,t)}triggerLinkProgress(){return this.yr(5,!0)}resetLinkProgress(){this.Sr(5)}setOnLinkComplete(t){this.Ir(6,t)}triggerLinkComplete(){return this.yr(6,!0)}hasLinkCompletePending(){return!!this.jn[6]}setOnPayConfirmOpened(t){this.Ir(9,t)}triggerPayConfirmOpened(t){return this.yr(9,t)}setOnSubscribeRequest(t){this.Ir(2,t)}triggerSubscribeRequest(){return this.yr(2,!0)}hasSubscribeRequestCallback(){return!!this.br[2]}setOnOffersFlowRequest(t){this.Ir(10,t)}triggerOffersFlowRequest(){return this.yr(10,!0)}hasOffersFlowRequestCallback(){return!!this.br[10]}setOnSubscribeResponse(t){ee("[swg.js:setOnSubscribeResponse]: This method has been deprecated, please switch usages to 'setOnPaymentResponse'"),this.Ir(3,t)}setOnContributionResponse(t){ee("[swg.js:setOnContributionResponse]: This method has been deprecated, please switch usages to 'setOnPaymentResponse'"),this.Ir(3,t)}setOnPaymentResponse(t){this.Ir(3,t)}triggerPaymentResponse(t){return this.Tr=t.then((t=>{this.yr(3,Promise.resolve(t.clone()))}),(t=>
39{if(!Jt(t))throw t})),!!this.br[3]}hasPaymentResponsePending(){return!!this.jn[3]}setOnFlowStarted(t){this.Ir(7,t)}triggerFlowStarted(t,e={}){return this.yr(7,{flow:t,data:e})}setOnFlowCanceled(t){this.Ir(8,t)}triggerFlowCanceled(t,e={}){return this.yr(8,{flow:t,data:e})}Ir(t,e){this.br[t]&&ee("[swg.js]: You have registered multiple callbacks for the same response."),this.br[t]=e,t in this.jn&&this.Cr(t,e,this.jn[t])}yr(t,e){this.jn[t]=e;const i=this.br[t];return i&&this.Cr(t,i,e),!!i}Sr(t){t in this.jn&&delete this.jn[t]}async Cr(t,e,i){await 0,e(i),this.Sr(t)}}class Ws{constructor(t,e){this.displayName=t,this.avatarUrl=e}}class Vs{constructor({displayDelaySeconds:t,numImpressionsBetweenPrompts:e,dismissalBackOffSeconds:i,maxDismissalsPerWeek:s,maxDismissalsResultingHideSeconds:n,impressionBackOffSeconds:r,maxImpressions:o,maxImpressionsResultingHideSeconds:a,globalFrequencyCapDurationSeconds:h,globalFrequencyCapDurationNano:l,promptFrequencyCaps:u,anyPromptFrequencyCapDurationSeconds:c,anyPromptFrequencyCapDurationNano:d}){this.clientDisplayTrigger=new Ys(t,e),this.explicitDismissalConfig=new qs(i,s,n),this.impressionConfig=new Ks(r,o,a),this.frequencyCapConfig=new Hs(new $s(new Xs(h,l)),null==u?void 0:u.map((t=>{var e,i;return new Js(t.audienceActionType,new Xs(null==(e=t.frequencyCapDuration)?void 0:e.seconds,null==(i=t.frequencyCapDuration)?void 0:i.nano))})),new Qs(new Xs(c,d)))}}class Ys{constructor(t,e){this.displayDelaySeconds=t,this.numImpressionsBetweenPrompts=e}}class qs{constructor(t,e,i){this.backOffSeconds=t,this.maxDismissalsPerWeek=e,this.maxDismissalsResultingHideSeconds=i}}class Ks{constructor(t,e,i){this.backOffSeconds=t,this.maxImpressions=e,this.maxImpressionsResultingHideSeconds=i}}class Hs{constructor(t,e,i){this.globalFrequencyCap=t,this.promptFrequencyCaps=e,this.anyPromptFrequencyCap=i}}class $s{constructor(t){this.frequencyCapDuration=t}}class Js{constructor(t,e){this.audienceActionType=t,this.frequencyCapDuration=e}}class Qs{constructor(t){this.frequencyCapDuration=t}}class Xs{constructor(t,e){this.seconds=t,this.nanos=e}}class Zs{constructor({attributionParams:t,autoPromptConfig:e,paySwgVersion:i,uiPredicates:s,useUpdatedOfferFlows:n,skipAccountCreationScreen:r}){this.autoPromptConfig=e,this.paySwgVersion=i,this.useUpdatedOfferFlows=n||!1,this.skipAccountCreationScreen=r||!1,this.uiPredicates=s,this.attributionParams=t}}class tn{constructor(t,e,i){this.canDisplayAutoPrompt=t,this.canDisplayButton=e,this.purchaseUnavailableRegion=i}}class en{constructor(t,e,i,s={}){this.ae=t,this.Or=e,this._e=i,this.Nr=s,this.Ar=null}fetchClientConfig(t){if(!this.Or)throw new Error("fetchClientConfig requires publicationId");return this.Ar||(t=t||Promise.resolve(),this.Ar=t.then((()=>this.vr()))),this.Ar}getClientConfig(){return this.Ar||this.Rr()}async Rr(){return new Zs({paySwgVersion:this.ae.config().paySwgVersion,skipAccountCreationScreen:this.Nr.skipAccountCreationScreen,useUpdatedOfferFlows:!!this.ae.config().paySwgVersion||void 0})}async getAutoPromptConfig(){this.Ar||this.fetchClientConfig();const t=await this.Ar;return null==t?void 0:t.autoPromptConfig}getLanguage(){return this.Nr.lang||"en"}getTheme(){const t=self.matchMedia("(prefers-color-scheme: dark)").matches?Ve.DARK:Ve.LIGHT;return this.Nr.theme||t}shouldAllowScroll(){return!!this.Nr.allowScroll}shouldForceLangInIframes(){return!!this.Nr.forceLangInIframes&&!!this.Nr.lang}async shouldEnableButton(){var t;if(this.Nr.disableButton)return Promise.resolve(!1);this.Ar||this.fetchClientConfig();const e=await this.Ar;return null==(t=null==e?void 0:e.uiPredicates)?void 0:t.canDisplayButton}async vr(){const t=await this.ae.entitlementsManager().getArticle();if(t)return this.Pr(t.clientConfig);const e=Te("/publication/"+encodeURIComponent(this.Or)+"/clientconfiguration"),i=await this._e.fetchCredentialedJson(e);return this.Pr(i)}Pr(t){var e,i,s,n,r,o,a,h,l,u,c,d,p,g,m,_,f,w,E,b;const T=t.autoPromptConfig;let I;T&&(I=new Vs({displayDelaySeconds:null==(e=T.clientDisplayTrigger)?void 0:e.displayDelaySeconds,dismissalBackOffSeconds:null==(i=T.explicitDismissalConfig)?void 0:i.backOffSeconds,maxDismissalsPerWeek:null==(s=T.explicitDismissalConfig)?void 0:s.maxDismissalsPerWeek,maxDismissalsResultingHideSeconds:null==(n=T.explicitDismissalConfig)?void 0:n.maxDismissalsResultingHideSeconds,impressionBackOffSeconds:null==(r=T.impressionConfig)?void 0:r.backOffSeconds,maxImpressions:null==(o=T.impressionConfig)?void 0:o.maxImpressions,maxImpressionsResultingHideSeconds:null==(a=T.impressionConfig)?void 0:a.maxImpressionsResultingHideSeconds,globalFrequencyCapDurationSeconds:null==(u=null==(l=null==(h=T.frequencyCapConfig)?void 0:h.globalFrequencyCap)?void 0:l.frequencyCapDuration)?void 0:u.seconds,globalFrequencyCapDurationNano:null==(p=null==(d=null==(c=T.frequencyCapConfig)?void 0:c.globalFrequencyCap)?void 0:d.frequencyCapDuration)?void 0:p.nano,promptFrequencyCaps:null==(g=T.frequencyCapConfig)?void 0:g.promptFrequencyCaps,anyPromptFrequencyCapDurationSeconds:null==(f=null==(_=null==(m=T.frequencyCapConfig)?void 0:m.anyPromptFrequencyCap)?void 0:_.frequencyCapDuration)?void 0:f.seconds,anyPromptFrequencyCapDurationNano:null==(b=null==(E=null==(w=T.frequencyCapConfig)?void 0:w.anyPromptFrequencyCap)?void 0:E.frequencyCapDuration)?void 0:b.nano}));const y=t.uiPredicates;let S;
39y&&(S=new tn(y.canDisplayAutoPrompt,y.canDisplayButton,y.purchaseUnavailableRegion));const C=t.attributionParams;let O;C&&(O=new Ws(C.displayName,C.avatarUrl));const N=this.ae.config().paySwgVersion||t.paySwgVersion,A=!!this.ae.config().paySwgVersion||t.useUpdatedOfferFlows;return new Zs({autoPromptConfig:I,paySwgVersion:N,useUpdatedOfferFlows:A,skipAccountCreationScreen:this.Nr.skipAccountCreationScreen,uiPredicates:S,attributionParams:O})}}class sn{constructor(t,e){var i,s,n,r;this.ae=t,this.ys=e,this.oe=t.win(),this.ue=t.clientConfigManager(),this.ie=t.activities(),this.pi=t.dialogManager(),this.zi=null==(s=null==(i=this.ys)?void 0:i.isClosable)||s,this.Bs=this.Lr(),this.ri=void 0===(null==(n=this.ys)?void 0:n.shouldAnimateFade)||(null==(r=this.ys)?void 0:r.shouldAnimateFade)}async Lr(){var t,e;const i=await this.ue.getClientConfig();return new Ge(this.oe,this.ie,ui(i,this.ue,this.ae.pageConfig()),Se({productId:this.ae.pageConfig().getProductId(),publicationId:this.ae.pageConfig().getPublicationId(),productType:We.UI_CONTRIBUTION,list:(null==(t=this.ys)?void 0:t.list)||"default",skus:(null==(e=this.ys)?void 0:e.skus)||null,isClosable:this.zi,supportsEventManager:!0}),!0,!1,this.ri)}_i(t){t.getSubscriberOrMember()&&this.ae.callbacks().triggerLoginRequest({linkRequested:!!t.getLinkRequested()})}js(t){const e=t.getSku(),i=t.getOneTime();if(e){const t={skuId:e};i&&(t.oneTime=i),new es(this.ae,t,We.UI_CONTRIBUTION).start()}}async start(){const t=await this.Bs;this.ae.callbacks().triggerFlowStarted(Fe.SHOW_CONTRIBUTION_OPTIONS),t.onCancel((()=>{this.ae.callbacks().triggerFlowCanceled(Fe.SHOW_CONTRIBUTION_OPTIONS)})),t.on(c,this._i.bind(this)),t.on(R,this.js.bind(this));const e=await this.ue.getClientConfig();return this.pi.openView(t,!1,this.qs(e,this.ue.shouldAllowScroll()))}qs(t,e){return t.useUpdatedOfferFlows&&!e?{shouldDisableBodyScrolling:!0,closeOnBackgroundClick:this.zi}:{}}async showNoEntitlementFoundToast(){(await this.Bs).execute(new T)}}const nn=String.raw,rn=nn(_u||(_u=__template(["\n body {\n padding: 0;\n margin: 0;\n }\n\n swg-container,\n swg-loading,\n swg-loading-animate,\n swg-loading-image {\n display: block;\n }\n\n swg-loading-container {\n width: 100% !important;\n display: flex !important;\n align-items: center !important;\n justify-content: center !important;\n min-height: 148px !important;\n height: 100% !important;\n bottom: 0 !important;\n margin-top: 5px !important;\n z-index: 2147483647 !important;\n }\n\n /**\n * Since the desktop view has the parent iframe (.swg-dialog) transparent,\n * this style adds the background with borders to the loading indicator.\n */\n @media (min-width: 630px), (min-height: 630px) {\n swg-loading-container {\n width: 560px !important;\n margin-left: auto !important;\n margin-right: auto !important;\n border-top-left-radius: 8px !important;\n border-top-right-radius: 8px !important;\n background-color: rgba(255, 255, 255, 1) !important;\n box-shadow: rgba(60, 64, 67, 0.3) 0 1px 1px,\n rgba(60, 64, 67, 0.15) 0 1px 4px 1px !important;\n }\n\n swg-loading-container.centered-on-desktop {\n height: 120px !important;\n min-height: 120px !important;\n border-radius: 8px !important;\n }\n }\n\n swg-loading {\n z-index: 2147483647 !important;\n width: 36px;\n height: 36px;\n overflow: hidden;\n animation: mspin-rotate 1568.63ms infinite linear;\n }\n\n swg-loading-animate {\n animation: mspin-revrot 5332ms infinite steps(4);\n }\n\n swg-loading-image {\n background-image: url('","/loader.svg');\n background-size: 100%;\n width: 11664px;\n height: 36px;\n animation: swg-loading-film 5332ms infinite steps(324);\n }\n\n @keyframes swg-loading-film {\n from {\n transform: translateX(0);\n }\n to {\n transform: translateX(-11664px);\n }\n }\n\n @keyframes mspin-rotate {\n from {\n transform: rotate(0deg);\n }\n to {\n transform: rotate(360deg);\n }\n }\n\n @keyframes mspin-revrot {\n from {\n transform: rotate(0deg);\n }\n to {\n transform: rotate(-360deg);\n }\n }\n"])),s),on=nn(_v||(_v=__template(["\n /** Common styles across all window sizes. */\n .swg-dialog,\n .swg-toast {\n box-sizing: border-box;\n background-color: rgba(255, 255, 255, 1) !important;\n }\n\n .swg-toast {\n position: fixed !important;\n bottom: 0 !important;\n max-height: 46px !important;\n z-index: 2147483647 !important;\n border: none !important;\n }\n\n /**\n * Wide desktop screen support, when width is >= 871px and height is >= 641px.\n */\n @media (min-width: 871px) and (min-height: 641px) {\n .swg-dialog.swg-wide-dialog {\n width: 870px !important;\n left: -435px !important;\n }\n }\n\n /** Tablet/Medium screen support, when width OR height is <= 640px. */\n @media (max-width: 640px), (max-height: 640px) {\n .swg-dialog,\n .swg-toast {\n width: 480px !important;\n left: -240px !important;
39\n margin-inline-start: calc(100vw - 100vw / 2) !important;\n border-top-left-radius: 8px !important;\n border-top-right-radius: 8px !important;\n box-shadow: rgba(60, 64, 67, 0.3) 0 1px 1px,\n rgba(60, 64, 67, 0.15) 0 1px 4px 1px !important;\n }\n\n [dir='rtl'] .swg-dialog,\n [dir='rtl'] .swg-toast {\n margin-inline-start: calc(100vw - 100vw / 2 - 240px) !important;\n }\n }\n\n /** Desktop/Large screen support, when width AND height are >= 641px. */\n @media (min-width: 641px) and (min-height: 641px) {\n .swg-dialog {\n width: 630px !important;\n left: -315px !important;\n margin-inline-start: calc(100vw - 100vw / 2) !important;\n background-color: transparent !important;\n border: none !important;\n }\n\n [dir='rtl'] .swg-dialog {\n margin-inline-start: calc(100vw - 100vw / 2 - 315px) !important;\n }\n\n .swg-toast {\n border-radius: 4px !important;\n bottom: 8px !important;\n box-shadow: 0 3px 1px -2px rgb(0 0 0 / 20%), 0 2px 2px 0 rgb(0 0 0 / 14%),\n 0 1px 5px 0 rgb(0 0 0 / 12%) !important;\n left: 8px !important;\n }\n }\n\n /** Phone/Small screen support, when width is <= 480px. */\n @media (max-width: 480px) {\n .swg-dialog,\n .swg-toast {\n width: 100% !important;\n left: 0 !important;\n right: 0 !important;\n margin-inline-start: 0 !important;\n }\n }\n\n /**\n * Class applied to content page to disable scrolling.\n */\n html > body.swg-disable-scroll {\n overflow: hidden !important;\n }\n"])));class an{constructor(t,e,i,s){this.entitlements=t,this.userData=e,this.purchaseDataList=i,this.xs=s,this.purchaseData=i[0]}clone(){return new an(this.entitlements,this.userData,this.purchaseDataList,this.xs)}json(){return{entitlements:this.entitlements.json(),userData:this.userData.json(),purchaseDataList:this.purchaseDataList.map((t=>t.json())),purchaseData:this.purchaseData.json()}}complete(){return this.xs()}}class hn{constructor(t,e){this.ae=t,this.gi=null,this.openPromise=null,this.oe=t.win(),this.ie=t.activities(),this.pi=t.dialogManager(),this.ys=Object.assign({entitlements:null,consent:!0},e||{})}async start(){const t=this.ys.entitlements;if(!t||!t.getEntitlementForSource("google"))throw new Error('No entitlements with "google" source');this.ae.callbacks().triggerFlowStarted(Fe.COMPLETE_DEFERRED_ACCOUNT_CREATION),this.gi=new Ge(this.oe,this.ie,ye("/recoveriframe"),Se({publicationId:this.ae.pageConfig().getPublicationId(),productId:this.ae.pageConfig().getProductId(),entitlements:t.raw||null,consent:this.ys.consent}),!0),this.openPromise=this.pi.openView(this.gi);try{const t=await this.gi.acceptResult();return this.Mr(t.data)}catch(e){throw Jt(e)?this.ae.callbacks().triggerFlowCanceled(Fe.COMPLETE_DEFERRED_ACCOUNT_CREATION):this.pi.completeView(this.gi),e}}Mr(t){this.ae.entitlementsManager().blockNextNotification();const e=t.entitlements,i=t.idToken,s=t.productType,n=this.ae.entitlementsManager().parseEntitlements({signedEntitlements:e}),r=new Xi(i,(new $i).decode(i)),a=t.purchaseDataList?t.purchaseDataList.map((t=>new Qi(t.data,t.signature))):[new Qi(t.purchaseData.data,t.purchaseData.signature)],h=new ss(this.ae),l=h.complete.bind(h),u=new an(n,r,a,l);this.ae.eventManager().logSwgEvent(o.ACTION_NEW_DEFERRED_ACCOUNT,!0);const c=Promise.resolve.bind(Promise);return h.start(new Ji("",a[0],r,n,s,c)),u}}function ln(t){const e=function(t){return t.readyState}(t);return"loading"!==e&&"uninitialized"!==e}class un{constructor(t){const e="document"in t;this.oe=e?t:t.defaultView,this.ee=e?t.document:t}getWin(){return this.oe}getRootNode(){return this.ee}getRootElement(){return this.ee.documentElement}getHead(){return this.ee.head}getBody(){return this.ee.body}isReady(){return ln(this.ee)}async whenReady(){var t;await(t=this.ee,new Promise((e=>{!function(t,e){!function(t,e,i){if(e(t))return void i(t);let s=!1;const n=()=>{e(t)&&!s&&(i(t),s=!0,t.removeEventListener("readystatechange",n))};t.addEventListener("readystatechange",n)}(t,ln,e)}(t,e)})))}}function cn(t){return"nodeType"in t||"document"in t?new un(t):t}const dn={frameborder:"0",scrolling:"no",src:"about:blank"};class pn{constructor(t,e){const i=Object.assign({},dn,e);this.se=jt(t,"iframe",i),Vt(this.se,Wt),this.kr=new Promise((t=>{this.se.onload=()=>{t()}}))}whenReady(){return this.kr}getElement(){return this.se}getDocument(){var t;const e=this.getElement().contentDocument||(null==(t=this.getElement().contentWindow)?void 0:t.document);if(!e)throw new Error("not loaded");return e}getBody(){return this.getDocument().body}isConnected(){return this.getElement().isConnected}}let gn=class{constructor(t,e){this.ee=t,this.Dr=this.ee.getWin().document.createElement("swg-popup-background"),this.Dr.setAttribute("role","button"),Vt(this.Dr,{"z-index":e.toString(),display:"none",position:"fixed",top:"0",right:"0",bottom:"0",left:"0","background-color":"rgba(32, 33, 36, .6)"})}getElement(){return this.Dr}isAttached(){return!!this.Dr.parentNode}attach(){var t;null==(t=this.ee.getBody())||t.appendChild(this.Dr)}destroy(){var t;null==(t=this.ee.getBody())||t.removeChild(this.Dr)}show(t){if(Vt(this.Dr,{display:"block",opacity:t?"0":"1"}),t)return qt(this.Dr,{opacity:"1"},300,"ease-out")}async hide(t=!0){t&&await qt(this.Dr,{opacity:"0"},300,"ease-out"),Vt(this.Dr,{display:"none"})}};class mn{constructor(t,e={}){if(this.ee=t,this.Ur=jt(this.ee,"swg-loading-container",{}),e.additionalClasses)for(const i of e.additionalClasses)this.Ur.classList.add(i);this.Gr=jt(this.ee,"swg-loading",{}),this.Ur.appendChild(this.Gr),this.Ur.style.setProperty("display","none","important"),this.jr()}getElement(){return this.Ur}show(){this.Ur.style.removeProperty("display")}hide(){this.Ur.style.setProperty("display","none","important")}jr(){const t=this.Gr,e=jt(this.ee,"swg-loading-animate",{});t.appendChild(e);const i=jt(this.ee,"swg-loading-image",{});e.appendChild(i)}}const fn=2147483647,wn={"min-height":"50px",border:"none",display:"block",position:"fixed","z-index":fn,"box-sizing":"border-box"},En={position:"absolute",top:"0",left:"0",right:"0",bottom:"0",opacity:"0",height:"0","max-height":"100%","max-width":"100%","min-height":"100%","min-width":"100%",width:"0"};class bn{constructor(t,e={},i={},s={},n=!1){this.ee=t;const r=s.desktopConfig||{}
39,o=!!r.supportsWideScreen,a="swg-dialog ".concat(o?"swg-wide-dialog":""),h=s.iframeCssClassOverride||a;this.se=new pn(t.getWin().document,{class:h}),this.Fr=new gn(t,fn-1),this.zr=s.closeOnBackgroundClick,this.Br=n;const l=Object.assign({},wn,e);Vt(this.se.getElement(),l),function(t,e){for(const[i,s]of Object.entries(e))Yt(t,i,s)}(this.se.getElement(),i),this.Wr=null,this.Vr=null,this.Yr=null,this.te=null,this.qr=0,this.Kr=!1,this.Hr=null,this.$r=void 0!==s.maxAllowedHeightRatio?s.maxAllowedHeightRatio:.9,this.Jr=!!r.isCenterPositioned,this.Qr=!!s.shouldDisableBodyScrolling,this.Xr=this.ee.getWin().matchMedia("(min-width: 641px)"),this.Zr=null}async open(t=!1){var e;this.Br&&void 0!==this.zr&&this.Fr.getElement().addEventListener("click",this.eo.bind(this));const i=this.se;if(i.isConnected())throw new Error("already opened");return null==(e=this.ee.getBody())||e.appendChild(i.getElement()),this.Fr.attach(),t?(Vt(i.getElement(),{visibility:"hidden",opacity:"0"}),this.Kr=t):this.io(),await i.whenReady(),this.so(),this}so(){const t=this.se.getBody(),e=this.se.getDocument();zt(cn(e),rn);const i=[];this.isPositionCenterOnDesktop()&&i.push("centered-on-desktop"),this.Wr=new mn(e,{additionalClasses:i}),t.appendChild(this.Wr.getElement()),this.Vr=jt(e,"swg-container",{}),t.appendChild(this.Vr),this.ro(),this.Jr&&(this.Zr=()=>{this.ro()},this.Xr.addListener(this.Zr))}async close(t=!0){var e,i;let s;if(t){const t=this.oo()?{opacity:"0"}:{transform:"translateY(100%)"};s=this.re((()=>(this.Fr.hide(!0),qt(this.getElement(),t,300,"ease-out"))))}else s=Promise.resolve();null==(e=this.ee.getBody())||e.classList.remove("swg-disable-scroll"),await s;const n=this.se.getElement();null==(i=n.parentNode)||i.removeChild(n),this.ao(),this.Fr.destroy(),this.Zr&&this.Xr.removeListener(this.Zr)}getContainer(){if(!this.Vr)throw new Error("not opened yet");return this.Vr}getIframe(){return this.se}getElement(){return this.se.getElement()}getLoadingView(){return this.Wr}getMaxAllowedHeightRatio(){return this.$r}isPositionCenterOnDesktop(){return this.Jr}ho(){var t;this.Yr&&this.Yr.hasLoadingIndicator()?this.Hr=this.Yr:(this.getContainer().textContent="",null==(t=this.Wr)||t.show())}lo(){var t;this.Hr?(Ft(this.Hr.getElement()),this.Hr=null):null==(t=this.Wr)||t.hide()}getCurrentView(){return this.Yr}async openView(t){var e;Vt(t.getElement(),En),this.ho(),this.Yr=t,this.getContainer().appendChild(t.getElement()),this.Qr&&(null==(e=this.ee.getBody())||e.classList.add("swg-disable-scroll")),t.shouldFadeBody()&&!this.Kr&&this.Fr.show(t.shouldAnimateFade()),await t.init(this),Vt(t.getElement(),{opacity:"1"}),this.Kr&&(t.shouldFadeBody()&&this.Fr.show(t.shouldAnimateFade()),this.io()),this.lo()}io(){this.re((async()=>{Vt(this.getElement(),{transform:"translateY(100%)",opactiy:"1",visibility:"visible"}),await qt(this.getElement(),{transform:this.uo(),opacity:"1",visibility:"visible"},300,"ease-out"),this.getElement().focus()})),this.Kr=!1}eo(t){if(t.stopPropagation(),this.zr){const t=this.Yr;t.execute&&t.execute(new _)}return!1}async resizeView(t,e,i=!0){if(this.Yr!=t)return null;const s=this.co(e),n=++this.qr,r=()=>n!==this.qr;let o;if(i){const t=this.getElement().offsetHeight;o=s>=t?this.re((()=>{if(r())return Promise.resolve();const e={height:"".concat(s,"px")};return this.oo()||(e.transform="translateY(".concat(s-t,"px)")),Vt(this.getElement(),e),requestAnimationFrame((()=>{qt(this.getElement(),{transform:this.uo()},300,"ease-out")})),Promise.resolve()})):this.re((async()=>{const e=r()?Promise.resolve():qt(this.getElement(),{transform:this.oo()?this.uo():"translateY(".concat(t-s,"px)")},300,"ease-out");await e,r()||Vt(this.getElement(),{height:"".concat(s,"px"),transform:this.uo()})}))}else Vt(this.getElement(),{height:"".concat(s,"px")}),o=Promise.resolve();await o,r()||(this.do(e),t.resized())}async re(t){await this.te;try{await t()}catch{}this.te=null}co(t){return Math.min(t,this.ee.getWin().innerHeight*this.$r)}do(t){if(this.oo())return void this.ao();const e=t+20;Vt(this.ee.getRootElement(),{"padding-bottom":"".concat(e,"px")})}ao(){this.ee.getRootElement().style.removeProperty("padding-bottom")}ro(){Vt(this.getElement(),this.po())}oo(){return this.Jr&&this.Xr.matches}po(){return this.oo()?{top:"50%",bottom:"0",transform:this.uo()}:{top:"auto",bottom:"0",transform:this.uo()}}uo(){return this.oo()?"translateY(-50%)":"translateY(0px)"}}class Tn{constructor(t){this.Br=!1,this.ee=t,this.mo=null,this._o=null,this.fo=new gn(t,2147483647),this.wo=null,this.fo.getElement().addEventListener("click",(()=>{if(this.wo)try{this.wo.focus()}catch{}}))}
39setEnableBackgroundClickExperiment(t){this.Br=t}openDialog(t=!1,e={}){return this._o||(this.mo=new bn(this.ee,{},{},e,this.Br),this._o=this.mo.open(t)),this._o}async openView(t,e=!1,i={}){return this.handleCancellations(t),(await this.openDialog(e,i)).openView(t)}async handleCancellations(t){try{await t.whenComplete()}catch(e){throw Jt(e)&&this.completeView(t),e}}completeView(t){setTimeout((()=>{this.mo&&this.mo.getCurrentView()===t&&this.Ht()}),100)}completeAll(){this.mo&&this.Ht(),this.fo.isAttached()&&this.fo.destroy()}getDialog(){return this.mo}Ht(){var t;null==(t=this.mo)||t.close(),this.mo=null,this._o=null}popupOpened(t){this.wo=t||null,this.fo.isAttached()||this.fo.attach(),this.fo.show(!0)}popupClosed(){this.wo=null;try{this.fo.hide()}catch{}}}class In{constructor(t,e){this.intervention=t,this.ae=e,this.type=t.type,this.configurationId=t.configurationId}async show(t){if(this.intervention.type===pt.TYPE_NEWSLETTER_SIGNUP||this.intervention.type===pt.TYPE_REWARDED_SURVEY||this.intervention.type===pt.TYPE_BYO_CTA||this.intervention.type===pt.TYPE_REWARDED_AD)return new mi(this.ae,{action:this.intervention.type,configurationId:this.intervention.configurationId,onResult:t.onResult,isClosable:t.isClosable,calledManually:!0,suppressToast:t.suppressToast,onAlternateAction:t.onAlternateAction,onSignIn:t.onSignIn}).start();throw Error("Can't show ".concat(this.type))}}const yn="google:metering";class Sn{constructor(t,e,i,s,n,r,o=!1,a=null){this.service=t,this.raw=e,this.entitlements=i,this.Eo=s,this.bo=n,this.To=r,this.decryptedDocumentKey=a,this.isReadyToPay=!!o}clone(){return new Sn(this.service,this.raw,this.entitlements.map((t=>t.clone())),this.Eo,this.bo,this.To,this.isReadyToPay,this.decryptedDocumentKey)}json(){return{service:this.service,entitlements:this.entitlements.map((t=>t.json())),isReadyToPay:this.isReadyToPay}}enablesThisWithCacheableEntitlements(){return!!this.getEntitlementForThis()&&!this.enablesThisWithGoogleMetering()&&!this.enablesThisWithGoogleDevMode()}enablesThisWithGoogleMetering(){const t=this.getEntitlementForThis();return!!t&&t.source===yn}enablesThisWithGoogleDevMode(){const t=this.getEntitlementForThis();if(!t)return!1;const e="google"===t.source&&-1!==t.subscriptionToken.indexOf("GOOGLE_DEV_MODE_ORDER"),i="GOOGLE_DEV_MODE_TOKEN"===t.subscriptionToken;return e||i}enablesThis(t){return this.enables(this.Eo,t)}enablesAny(t){for(let e=0;e<this.entitlements.length;e++)if(this.entitlements[e].products.length>0&&(!t||t==this.entitlements[e].source))return!0;return!1}enables(t,e){return!!t&&!!this.getEntitlementFor(t,e)}getEntitlementForThis(t){return this.getEntitlementFor(this.Eo,t)}getEntitlementFor(t,e){if(!t)return ee("SwG needs this article to define a product ID (e.g. example.com:premium). Articles can define a product ID using JSON+LD. SwG can check entitlements after this article defines a product ID."),null;const i=this.entitlements.filter((i=>i.enables(t)&&(!e||e===i.source))),s=i.find((({source:t})=>t!==yn)),n=i.find((({source:t})=>t===yn));return s||n||null}getEntitlementForSource(t){if(this.entitlements.length>0)for(let e=0;e<this.entitlements.length;e++)if(this.entitlements[e].subscriptionToken&&t==this.entitlements[e].source)return this.entitlements[e];return null}ack(){this.bo(this)}consume(t){this.To(this,t)}}class Cn{constructor(t,e,i,s,n,r){this.source=t,this.products=e,this.subscriptionToken=i,this.subscriptionTokenContents=s,this.subscriptionTimestamp=n,this.readerId=r}clone(){return new Cn(this.source,this.products.slice(0),this.subscriptionToken,this.subscriptionTokenContents,this.subscriptionTimestamp,this.readerId)}json(){return{source:this.source,products:this.products,subscriptionToken:this.subscriptionToken,readerId:this.readerId}}enables(t){if(!t)return!1;const e=t.indexOf(":");if(-1!=e){const i=t.substring(0,e+1);if(i+"*"==t&&this.products.filter((t=>t.substring(0,e+1)==i)).length>=1)return Zt("enabled with wildcard productId"),!0;if(this.products.includes(i+"*"))return Zt("enabled with wildcard entitlement"),!0}return this.products.includes(t)}static parseFromJson(t,e){t||(t={});const i=t.source||"",s=t.products||[],n=t.subscriptionToken||"",r=t.readerId;let o;try{o=n?e.decode(n):null}catch{o=null}const a=t.subscriptionTimestamp;let h;try{const t=a.seconds_,e=a.nanos_;h=new j([t,e],!1)}catch{h=null}return new Cn(i,s,n,o,h,r)}static parseListFromJson(t,e){return(Array.isArray(t)?t:[t]).map((t=>Cn.parseFromJson(t,e)))}getSku(){if("google"!==this.source)return null;const t=Hi(this.subscriptionToken,"productId")||null;return t||ee("Unable to retrieve SKU from SwG subscription token"),t}}var On=(t=>(t[t.LICENSED_BY_GOOGLE=1]="LICENSED_BY_GOOGLE",t[t.METERED_BY_GOOGLE=2]="METERED_BY_GOOGLE",t))(On||{});const Nn="rgba(60, 64, 67, 0.3) 0px -2px 5px, rgba(60, 64, 67, 0.15) 0px -5px 5px",An="anonymous_user",vn={[On.LICENSED_BY_GOOGLE]:"/metertoastiframe",[On.METERED_BY_GOOGLE]:"/meteriframe"};class Rn{constructor(t,{meterClientType:e=On.LICENSED_BY_GOOGLE,meterClientUserAttribute:i=An}={}){this.ae=t,this.Io=null,this.yo=!1,this.So=null,this.Co=()=>{},this.oe=t.win(),this.ie=t.activities(),this.pi=t.dialogManager(),this.Oo=e,this.No=i,this.ue=t.clientConfigManager();const s={isClosable:!0,hasSubscriptionCallback:t.callbacks().hasSubscribeRequestCallback()};this.Oo===On.METERED_BY_GOOGLE&&(s.meterType=this.No===An?"UNKNOWN":"KNOWN");const n=this.ie.addDefaultArguments(s),r=vn[this.Oo],o={origin:oe(this.oe.location.href).origin};this.ue.shouldForceLangInIframes()&&(o.hl=this.ue.getLanguage()),this.gi=new Ge(this.oe,this.ie,ye(r,o),n,!1)}async start(){this.Co=()=>{const t=new F;t.setClose(!0),this.gi.execute(t),this.removeCloseEventListener(),this.ae.eventManager().logSwgEvent(o.ACTION_METER_TOAST_CLOSED_BY_ARTICLE_INTERACTION,!0),this.Io&&!this.yo&&(this.yo=!0,this.Io())},this.ae.callbacks().triggerFlowStarted(Fe.SHOW_METER_TOAST),this.gi.on(z,this.Ao.bind(this)),this.gi.on(c,this._i.bind(this)),this.ae.callbacks().hasSubscribeRequestCallback()||this.ae.callbacks().hasOffersFlowRequestCallback()||ee("[swg.js]: `setOnNativeSubscribeRequest` has not been set before starting the metering flow, so users will not be able to subscribe from the metering dialog directly. Please call `setOnNativeSubscribeRequest` with a subscription flow callback before starting metering."),this.pi.handleCancellations(this.gi).catch((t=>{if(this.Io&&!this.yo&&(this.yo=!0,this.Io()),!Jt(t))throw console.error("[swg.js]: Error occurred during meter toast handling: "+t),t}));const t=await this.pi.openDialog();if(this.vo(),this.Ro(),await t.openView(this.gi),this.oe.addEventListener("click",this.Co),this.oe.addEventListener("touchstart",this.Co),this.oe.addEventListener("mousedown",this.Co),this.Po())Yt(this.oe.document.body,"overflow","hidden");else{let t,e;this.So=()=>{t=t||this.oe.pageYOffset,this.oe.clearTimeout(e),e=this.oe.setTimeout((()=>{Math.abs(this.oe.pageYOffset-t)>100&&this.Co()}),100)},this.oe.addEventListener("scroll",this.So)}this.ae.eventManager().logSwgEvent(o.IMPRESSION_METER_TOAST),this.ae.eventManager().logSwgEvent(o.EVENT_OFFERED_MET
39ER)}setOnConsumeCallback(t){this.Io=t}removeCloseEventListener(){this.oe.removeEventListener("click",this.Co),this.oe.removeEventListener("touchstart",this.Co),this.oe.removeEventListener("mousedown",this.Co),this.Po()?Yt(this.oe.document.body,"overflow","visible"):this.So&&this.oe.removeEventListener("scroll",this.So)}vo(){const t=this.oe.matchMedia("(max-width: 640px), (max-height: 640px)"),e=this.pi.getDialog().getElement();t.matches&&Vt(e,{"box-shadow":Nn}),t.addListener((t=>{t.matches?Vt(e,{"box-shadow":Nn}):Vt(e,{"box-shadow":""})}))}Ro(){this.oe.matchMedia("(min-width: 640px) and (min-height: 640px)").matches&&Vt(this.pi.getDialog().getLoadingView().getElement(),{width:"420px",margin:"auto"})}Ao(t){this.removeCloseEventListener(),this.yo=!0,t.getNative()?this.ae.callbacks().triggerSubscribeRequest():this.ae.callbacks().triggerOffersFlowRequest()}Po(){return!!this.oe.navigator.userAgent.match(/Android|iPhone|iPad|iPod|BlackBerry|IEMobile/i)}_i(t){t.getSubscriberOrMember()&&this.ae.callbacks().triggerLoginRequest({linkRequested:!1})}showNoEntitlementFoundToast(){this.gi&&this.gi.execute(new T)}}function Pn(t,e=!1){const i=ae(t);return!(!(i.gaa_at&&i.gaa_n&&i.gaa_sig&&i.gaa_ts)||!e&&"na"===i.gaa_at||parseInt(i.gaa_ts,16)<Date.now()/1e3)}const xn=new Set([pt.TYPE_NEWSLETTER_SIGNUP,pt.TYPE_REWARDED_SURVEY,pt.TYPE_REWARDED_AD,pt.TYPE_BYO_CTA]);class Ln{constructor(t,e,i,s,n){this.oe=t,this.Ii=e,this._e=i,this.ae=s,this.xo=n,this.Lo=null,this.Mo=!1,this.Do=!1,this.Uo=!1,this.Go=null,this.jo=null,this.Fo=0,this.Ar=null,this.entitlementsPostPromise=null,this.Or=this.Ii.getPublicationId(),this.zo=new $i,this.ti=s.storage(),this.ks=s.analytics(),this.Bo=s.config(),this.ae.eventManager().registerEventListener(this.Wo.bind(this))}reset(t=!1){this.Ar=null,this.Fo=Math.max(this.Fo,t?3:0),t&&(this.ti.remove(Mt),this.ti.remove(kt))}clear(){this.Ar=null,this.Fo=0,this.unblockNextNotification(),this.ti.remove(Mt),this.ti.remove(Ut),this.ti.remove(kt)}async getEntitlements(t){"string"==typeof t&&(Date.now()>1600289016959&&ee("[swg.js:getEntitlements]: If present, the first param of getEntitlements() should be an object of type GetEntitlementsParamsExternalDef."),t={encryption:{encryptedDocumentKey:t}}),this.Ar||(this.Ar=this.Vo(t));const e=await this.Ar;return null!=e.isReadyToPay&&this.ks.setReadyToPay(e.isReadyToPay),e}pushNextEntitlements(t,e){const i=this.Yo(t,!0,e);return!(!i||!i.enablesThis()||(this.ti.set(Mt,t),0))}qo(){return ae(this.oe.location.search).gaa_n}Ko(t){var e;if(!t||t.source!==yn)return;let i,s;if((null==(e=t.subscriptionTokenContents)?void 0:e.metering.clientType)===On.METERED_BY_GOOGLE)s=h.SUBSCRIBE_WITH_GOOGLE_METERING_SERVICE;else{if(!Pn(this.oe.location.search))return;s=h.GOOGLE_SHOWCASE_METERING_SERVICE,i=this.qo()}this.ae.eventManager().logSwgEvent(o.EVENT_UNLOCKED_BY_METER,!1);const n=new E;n.setSource(t.source),n.setJwt(t.subscriptionToken),this.entitlementsPostPromise=this.Ho(n,a.UNLOCKED_METER,s,i)}Wo(t){var e,i,s,n;if(!Pn(this.oe.location.search,!0))return;const r=function(t){return Qe[t]}(t.eventType);if(!r)return;let o=null;switch(t.eventOriginator){case l.SHOWCASE_CLIENT:o=h.PUBLISHER_ENTITLEMENT;break;case l.SWG_CLIENT:if(r==a.UNLOCKED_METER)return;o=h.GOOGLE_SUBSCRIBER_ENTITLEMENT;break;default:return}const u=this.qo(),c=null==(i=null==(e=null==t?void 0:t.additionalParameters)?void 0:e.getIsUserRegistered)?void 0:i.call(e),d=null==(n=null==(s=null==t?void 0:t.additionalParameters)?void 0:s.getSubscriptionTimestamp)?void 0:n.call(s);this.entitlementsPostPromise=this.Ho(new E,r,o,u,c,d)}async Ho(t,e,i,s="",n=null,r=null){const o=new b;o.setUsedEntitlement(t),o.setClientEventTime(Us(Date.now())),o.setEntitlementResult(e),o.setEntitlementSource(i),o.setToken(s),"boolean"==typeof n&&o.setIsUserRegistered(n),r&&o.setSubscriptionTimestamp(r);let a="/publication/".concat(encodeURIComponent(this.Or),"/article");if(a=Mn(this.oe.location,a),!this.jo){const t={metering:{resource:{hashedCanonicalUrl:await this.$o()}}};this.jo=qi(Vi(JSON.stringify(t)))}const h=await this.ti.get(xt,!0);h&&(a=he(a,"sut",h)),a=he(a,"encodedEntitlementsParams",this.jo),await this._e.sendPost(Te(a),o)}async $o(){return async function(t){var e;const i=null==(e=self.crypto)?void 0:e.subtle;if(!i){const t="Swgjs only works on secure (HTTPS or localhost) pages.";return ee(t),Promise.reject(t)}return function(t){const e=[],i=new DataView(t);for(let s=0;s<i.byteLength;s+=4){const t=i.getUint32(s).toString(16);e.push(("00000000"+t).slice(-8))}return e.join("")}(await i.digest("SHA-512",Vi(t)))}(ce(this.ae.doc()))}async Vo(t){const e=await this.Jo(t);return this.Qo(e),e}async Jo(t){const e=await this.ti.get(Mt),i=await this.ti.get(kt),s=!(!t||!t.encryption);if(e&&!s){const t=this.Yo(e,!0,function(t){switch(t){case"true":return!0;case"false":return!1;default:return}}(i));if(t&&t.enablesThis())return this.Fo=0,t}const n=await this.Xo(t);return n&&n.enablesThisWithCacheableEntitlements()&&n.raw&&this.ti.set(Mt,n.raw),n}async getArticle(){return this.Ar?(await this.Ar,this.Lo):null}async getExperimentConfigFlags(){const t=await this.getArticle();return this.parseArticleExperimentConfigFlags(t)}parseArticleExperimentConfigFlags(t){if(t){const e=t.experimentConfig;if(null!=e){const t=e.experimentFlags;if(null!=t)return t}}return[]}Xo(t){let e=this.Fo;this.Fo=0;const i=async()=>{e--;const s=await this.vr(t);return s.enablesThis()||e<=0?s:new Promise((t=>{this.oe.setTimeout((()=>{t(i())}),550)}))};return i()}setToastShown(t){this.ti.set(Ut,t?"1":"0")}blockNextNotification(){this.Mo=!0}blockNextToast(){this.Do=!0}unblockNextNotification(){this.Mo=!1}enableMeteredByGoogle(){this.Uo=!0}getLastMeterToast(){return this.Go}parseEntitlements(t){const e=t.isReadyToPay;null==e?this.ti.remove(kt):this.ti.set(kt,String(e));const i=t.signedEntitlements,s=t.decryptedDocumentKey,n=t.swgUserToken;if(n&&this.Zo(n),i){const t=this.Yo(i,!1,e,s);if(t)return t}else{const i=t.entitlements;if(i)return this.ta("",i,e,s)}return this.ta("",[],e)}
39Zo(t){t&&this.ti.set(xt,t,!0)}Yo(t,e,i,s){try{const n=this.zo.decode(t);if(e){const t=Date.now(),e=n.exp;if(1e3*parseFloat(e)<t)return null}const r=n.entitlements;return r&&this.ta(t,r,i,s)||null}catch(n){this.oe.setTimeout((()=>{throw n}))}return null}ta(t,e,i,s){return new Sn("subscribe.google.com",t,Cn.parseListFromJson(e,this.zo),this.Ii.getProductId(),this.ea.bind(this),this.ia.bind(this),i,s)}Qo(t){const e=this.Mo;this.Mo=!1;const i=this.Do;if(this.Do=!1,e)return;this.ae.callbacks().triggerEntitlementsResponse(Promise.resolve(t)),this.xo&&t.enablesThisWithGoogleMetering()&&t.consume();const s=t.getEntitlementForThis();s?i||this.sa(s):this.ae.eventManager().logSwgEvent(o.EVENT_NO_ENTITLEMENTS,!1)}async sa(t){if(t.source===yn)return this.ae.eventManager().logSwgEvent(o.EVENT_HAS_METERING_ENTITLEMENTS,!1),Promise.resolve();const e=new I;e.setIsUserRegistered(!0),t.subscriptionTimestamp&&e.setSubscriptionTimestamp(t.subscriptionTimestamp);const i="privileged"===t.source?o.EVENT_UNLOCKED_FOR_CRAWLER:o.EVENT_UNLOCKED_BY_SUBSCRIPTION;if(this.ae.eventManager().logSwgEvent(i,!1,e),"1"===await this.ti.get(Ut))return;const s=t.source||yn;return new $t(this.ae,ye("/toastiframe"),Se({publicationId:this.Or,source:s})).open()}ea(t){t.getEntitlementForThis()&&this.setToastShown(!0)}ia(t,e){var i;if(t.enablesThisWithGoogleMetering()){const s=t.getEntitlementForThis(),n=()=>{e&&e(),this.Ko(s)},r=s.subscriptionTokenContents;if(!r)return n();if(!0===(null==(i=r.metering)?void 0:i.showToast)){const t=new Rn(this.ae,{meterClientType:r.metering.clientType,meterClientUserAttribute:r.metering.clientUserAttribute});return t.setOnConsumeCallback(n),this.Go=t,t.start()}return n()}}async vr(t){var e;const i=await this.ti.get(xt,!0),s=await this.ti.get(Lt,!1);let n="/publication/".concat(encodeURIComponent(this.Or),"/article");if(n=Mn(this.oe.location,n),n=function(t,e){const i=ae(t.hash).rrmPromptRequested;return void 0===i?e:he(e,"previewConfigId",i)}(this.oe.location,n),n=function(t,e){const i=ae(t.hash).rrmPreviewKey;return void 0===i?e:he(e,"previewKey",i)}(this.oe.location,n),(null==t?void 0:t.encryption)&&(n=he(n,"crypt",t.encryption.encryptedDocumentKey)),i&&(n=he(n,"sut",i)),this.Bo.publisherProvidedId?n=he(n,"ppid",this.Bo.publisherProvidedId):(null==t?void 0:t.publisherProvidedId)&&"string"==typeof t.publisherProvidedId&&t.publisherProvidedId.length>0&&(n=he(n,"ppid",t.publisherProvidedId)),s){const t=parseInt(s,10);if(t){const e=Math.floor((Date.now()-t)/1e3);e>=0&&(n=he(n,"interaction_age",e.toString()))}}n=he(n,"locked",String(this.Ii.isLocked())),n=he(n,"contentType",this.Ii.isLocked()?V.CLOSED.toString():V.OPEN.toString());const r=await this.$o();let a=this.Uo?{metering:{clientTypes:[On.METERED_BY_GOOGLE],owner:this.Or,resource:{hashedCanonicalUrl:r}}}:void 0;if(this.Or&&(null==(e=null==t?void 0:t.metering)?void 0:e.state)&&Pn(this.oe.location.search)){const e=t.metering.state.id;if("string"==typeof e&&e.length>0){let i=function({attributes:t,category:e}){if(!t)return;const i=Object.keys(t);for(const s of i){const i="".concat(e,"_").concat(s),n=Number(t[s].timestamp),r=n>Date.now()/1e3*2;n&&!r||ee('SwG Entitlements: Please specify a Unix timestamp, in seconds, for the "'.concat(s,'" ').concat(e," attribute. The timestamp you passed (").concat(t[s].timestamp,") looks invalid.")),a.metering.state.attributes.push({name:i,timestamp:n})}};a={metering:{clientTypes:[On.LICENSED_BY_GOOGLE],owner:this.Or,resource:{hashedCanonicalUrl:r},state:{id:e,attributes:[]},token:this.qo()}},i({attributes:t.metering.state.standardAttributes,category:"standard"}),i({attributes:t.metering.state.customAttributes,category:"custom"})}else ee("SwG Entitlements: Please specify a metering state ID string, ideally a hash to avoid PII.")}a&&(this.jo=qi(Vi(JSON.stringify(a))),n=he(n,"encodedEntitlementsParams",this.jo)),n=Te(n),this.ae.eventManager().logSwgEvent(o.ACTION_GET_ENTITLEMENTS,!1);const h=await this._e.fetchCredentialedJson(n);this.Lo=h;const l=this.Lo.entitlements||{},u=h.errorMessages;if(Number(null==u?void 0:u.length)>0)for(const o of u)ee("SwG Entitlements: "+o);return this.parseEntitlements(l)}async getAvailableInterventions(){var t,e;const i=await this.getArticle();return i?(null==(e=null==(t=i.audienceActions)?void 0:t.actions)?void 0:e.filter((t=>xn.has(t.type))).map((t=>new In(t,this.ae))))||[]:(ee("[swg.js:getAvailableInterventions] Article is null."),null)}}function Mn(t,e){const i=ae(t.hash)["swg.deventitlement"];return void 0===i?e:he(e,"devEnt",i)}class kn{constructor(t){this.ee=t}async error(...t){await 0;const i=function(t){let e=null,i="";for(const s of t)s instanceof Error&&!e?e=Dn(s):(i&&(i+=" "),i+=s);return e?i&&(e.message=i+": "+e.message):e=new Error(i),e}(t);i.reported||(this.ee.getWin().document.createElement("img").src="".concat(e,"/swg/_/SubscribewithgoogleClientUi/jserror?error=")+encodeURIComponent(String(i))+"&script="+encodeURIComponent("".concat(e,"/swg/js/v1/swg.js"))+"&line="+(i.lineNumber||1)+"&trace="+encodeURIComponent(i.stack||""),i.reported=!0)}}function Dn(t){const e=Object.getOwnPropertyDescriptor(t,"message");if(e&&e.writable)return t;const{lineNumber:i,message:s,reported:n,stack:r}=t,o=new Error(s);return o.lineNumber=i,o.stack=r,o.reported=n,o}const Un="swg-link";class Gn{constructor(t){this.ae=t,this.ie=t.activities(),this.Ii=t.pageConfig(),this.pi=t.dialogManager()}start(t={}){this.ae.callbacks().triggerFlowStarted(Fe.LINK_ACCOUNT);const e=this.ae.config().windowOpenMode==Be.REDIRECT,i=t.ampReaderId?Se({publicationId:this.Ii.getPublicationId(),ampReaderId:t.ampReaderId}):Se({publicationId:this.Ii.getPublicationId()}),s=this.ie.open(Un,ye("/linkbackstart"),e?"_top":"_blank",i,{});return this.ae.eventManager().logSwgEvent(o.IMPRESSION_LINK),this.pi.popupOpened(s&&s.targetWin),Promise.resolve()}}class jn{constructor(t,e){this.ae=t,this.na=e,this.gi=null,this.ra=null,this.oe=t.win(),this.ie=t.activities(),this.pi=t.dialogManager(),this.we=t.entitlementsManager(),this.br=t.callbacks(),this.na||
39(this.na={}),this.oa=new Promise((t=>{this.ra=t}))}static configurePending(t){t.activities().onResult(Un,(async function(e){t.entitlementsManager().blockNextNotification(),t.callbacks().triggerLinkProgress(),t.dialogManager().popupClosed();try{const i=await De(e,be(),!1,!1);t.eventManager().logSwgEvent(o.ACTION_LINK_CONTINUE,!0),t.eventManager().logSwgEvent(o.EVENT_LINK_ACCOUNT_SUCCESS),new jn(t,i).start()}catch(i){t.entitlementsManager().unblockNextNotification(),Jt(i)?(t.eventManager().logSwgEvent(o.ACTION_LINK_CANCEL,!0),t.callbacks().triggerFlowCanceled(Fe.LINK_ACCOUNT)):t.eventManager().logSwgEvent(o.ACTION_LINK_CONTINUE,!0)}}))}async start(){if(this.na.saveAndRefresh)return this.t(this.na,!!this.na.linked),Promise.resolve();const t=this.na.index||"0";return this.gi=new Ge(this.oe,this.ie,ye("/linkconfirmiframe",{},"u/"+t),Se({productId:this.ae.pageConfig().getProductId(),publicationId:this.ae.pageConfig().getPublicationId()}),!0),this.aa(),this.ae.eventManager().logSwgEvent(o.EVENT_GOOGLE_UPDATED,!0),this.ae.eventManager().logSwgEvent(o.IMPRESSION_GOOGLE_UPDATED,!0),this.pi.openView(this.gi)}async aa(){try{const t=await this.gi.acceptResultAndVerify(be(),!0,!0);this.t(t,!!t.success)}catch(t){this.oe.setTimeout((()=>{throw t}))}this.pi.completeView(this.gi)}t(t,e){this.ae.eventManager().logSwgEvent(o.ACTION_GOOGLE_UPDATED_CLOSE,!0);const i=t.swgUserToken;i&&this.ae.storage().set(xt,i,!0),this.br.triggerLinkComplete(),this.br.resetLinkProgress(),this.we.setToastShown(!0),this.we.unblockNextNotification(),this.we.reset(e),this.ra()}whenComplete(){return this.oa}}class Fn{constructor(t,e){this.ae=t,this.Ss=e,this.ha=null,this.gi=null,this.openPromise=null,this.oe=t.win(),this.ie=t.activities(),this.pi=t.dialogManager()}getRequestPromise(){return this.ha}t(){this.pi.completeView(this.gi)}async la(t){if(this.t(),!t.linked)throw Qt("not linked");this.pi.popupClosed(),this.ae.callbacks().triggerFlowStarted(Fe.LINK_ACCOUNT),this.ae.eventManager().logSwgEvent(o.EVENT_SAVE_SUBSCRIPTION_SUCCESS);const e=new jn(this.ae,t);return await e.start(),this.ae.callbacks().triggerLinkProgress(),await e.whenComplete(),!0}async ua(t){if(t&&t.getRequested())try{const t=await this.Ss(),e=new S;if(null==t?void 0:t.token){if(t.authCode)throw new Error("Both authCode and token are available");e.setToken(t.token)}else{if(!(null==t?void 0:t.authCode))throw new Error("Neither token or authCode is available");e.setAuthCode(t.authCode)}return this.gi.execute(e),t}catch(e){throw this.t(),e}}async start(){const t=this.ie.addDefaultArguments({isClosable:!0});this.gi=new Ge(this.oe,this.ie,ye("/linksaveiframe"),t,!1,!0),this.gi.on(C,(t=>{this.ha=this.ua(t)})),this.openPromise=this.pi.openView(this.gi,!0),this.ae.eventManager().logSwgEvent(o.IMPRESSION_SAVE_SUBSCR_TO_GOOGLE);try{const t=await this.gi.acceptResultAndVerify(be(),!0,!0);return await this.la(t)}catch(e){if(this.t(),Jt(e))return this.ae.eventManager().logSwgEvent(o.ACTION_SAVE_SUBSCR_TO_GOOGLE_CANCEL,!0),this.ae.callbacks().triggerFlowCanceled(Fe.LINK_ACCOUNT),!1;throw e}}}class zn{constructor(t){this.fe=t.eventManager()}sendSubscriptionState(t,e){if(!ni(qe,t))throw new Error("Invalid subscription state provided");if((qe.SUBSCRIBER==t||qe.PAST_SUBSCRIBER==t)&&!e)throw new Error("Entitlements must be provided for users with active or expired subscriptions");if(e&&!si(e))throw new Error("Entitlements must be an Object");let i=null;e&&(i=JSON.stringify(e)),this.fe.logEvent({eventType:o.EVENT_SUBSCRIPTION_STATE,eventOriginator:l.PUBLISHER_CLIENT,isFromUserAction:null,additionalParameters:{state:t,productsOrSkus:i}})}sendEvent(t){let e=null;if(!ni(Ke,t.name)||!ii(t.name))throw new Error("Invalid user event provided("+t.name+")");if(t.data){if(!si(t.data))throw new Error("Event data must be an Object("+t.data+")");e=Object.assign({},e,t.data)}if(oi(t.active))e||(e={}),Object.assign(e,{is_active:t.active});else if(null!=t.active)throw new Error("Event active must be a boolean");this.fe.logEvent({eventType:ii(t.name),eventOriginator:l.PUBLISHER_CLIENT,isFromUserAction:t.active,additionalParameters:e})}}class Bn{constructor(t){this.ae=t,this.openViewPromise=null,this.oe=t.win(),this.ie=t.activities(),this.pi=t.dialogManager(),this.gi=new Ge(this.oe,this.ie,ye("/loginiframe"),Se({publicationId:t.pageConfig().getPublicationId(),productId:t.pageConfig().getProductId(),userConsent:!1}),!0)}async start(){this.ae.callbacks().triggerFlowStarted(Fe.SHOW_LOGIN_NOTIFICATION),this.openViewPromise=this.pi.openView(this.gi);try{await this.gi.acceptResult()}catch(t){throw this.pi.completeView(this.gi),t}this.pi.completeView(this.gi)}}
39class Wn{constructor(t){this.ae=t,this.openViewPromise=null,this.oe=t.win(),this.ie=t.activities(),this.pi=t.dialogManager(),this.gi=new Ge(this.oe,this.ie,ye("/loginiframe"),Se({publicationId:t.pageConfig().getPublicationId(),productId:t.pageConfig().getProductId(),userConsent:!0}),!0)}async start(){this.ae.callbacks().triggerFlowStarted(Fe.SHOW_LOGIN_PROMPT),this.openViewPromise=this.pi.openView(this.gi);try{await this.gi.acceptResult()}catch(t){throw Jt(t)?this.ae.callbacks().triggerFlowCanceled(Fe.SHOW_LOGIN_PROMPT):this.pi.completeView(this.gi),t}this.pi.completeView(this.gi)}}class Vn{constructor(t,e){this.Bo=t,this._e=e}getOffers(t=this.Bo.getProductId()){if(!t)throw new Error("getOffers requires productId in config or arguments");return this.vr(t)}async vr(t){const e=Te("/publication/"+encodeURIComponent(this.Bo.getPublicationId())+"/offers?label="+encodeURIComponent(t));return(await this._e.fetchCredentialedJson(e)).offers||[]}}class Yn{constructor(t,e){let i,s,n;const r=t.indexOf(":");-1!=r?(s=t,i=s.substring(0,r),n=s.substring(r+1)):(i=t,s=null,n=null),this.Or=i,this.ca=s,this.C=n,this.da=e}getPublicationId(){return this.Or}getProductId(){return this.ca}getLabel(){return this.C}isLocked(){return this.da}}const qn="__SWG-SEEN__",Kn=["CreativeWork","Article","NewsArticle","Blog","Comment","Course","HowTo","Message","Review","WebPage"],Hn=new RegExp(Kn.join("|"));class $n{constructor(t){this.ma=null,this._a=null,this.ee=cn(t),this.fa=new Promise(((t,e)=>{this.ma=t,this._a=e})),this.wa=new Qn(this.ee),this.Ea=new Xn(this.ee),this.ba=new Zn(this.ee)}resolveConfig(){return Promise.resolve().then(this.check.bind(this)),this.ee.whenReady().then(this.check.bind(this)),this.fa}check(){if(!this.ma||!this._a)return null;const t=this.wa.check()||this.Ea.check()||this.ba.check();return t?(this.ma(t),this.ma=null,this._a=null):this.ee.isReady()&&(this._a("No config could be discovered in the page"),this.ma=null,this._a=null),Zt(t),t}}class Jn{checkValue(t,e){return!("string"!=typeof t&&!Array.isArray(t))&&this.Ta(this.Ia(t),e)}checkSpaceDelimitedList(t,e){const i=t.split(/\s+/);return this.Ta(i,e)}Ta(t,e){for(let i of t)if(i=i.replace(/^http:\/\/schema.org\//i,""),e.includes(i))return!0;return!1}Ia(t){return Array.isArray(t)?t:[t]}}class Qn{constructor(t){this.ee=t}check(){if(!this.ee.getBody())return null;const t=tr(this.ee.getRootNode(),"subscriptions-product-id");if(!t)return null;const e=tr(this.ee.getRootNode(),"subscriptions-accessible-for-free"),i=!(!e||"false"!==e.toLowerCase());return new Yn(t,i)}}class Xn{constructor(t){this.ee=t,this.ya=new Jn}check(){if(!this.ee.getBody())return null;const t=this.ee.isReady(),e=Array.from(this.ee.getRootNode().querySelectorAll('script[type="application/ld+json"]'));for(let i=0;i<e.length;i++){const s=e[i];if(s[qn]||!s.textContent||!t&&!Bt(s))continue;if(s[qn]=!0,!Hn.test(s.textContent))continue;const n=this.Sa(s);if(n)return n}return null}Sa(t){let e=Ki(t.textContent);if(!e)return null;Array.isArray(e)||(e=[e]);let i=e;for(let s=0;s<i.length;s++){const t=i[s];if(t["@graph"]&&Array.isArray(t["@graph"])&&(i=i.concat(t["@graph"])),!this.ya.checkValue(t["@type"],Kn))continue;let e=null;const n=this.Ca(t,"isPartOf");if(n)for(let i=0;i<n.length&&(e=this.Oa(n[i]),!e);i++);if(!e)continue;const r=this.Na(this.Aa(t,"isAccessibleForFree"),!0);return new Yn(e,!r)}return null}Na(t,e){if("boolean"==typeof t)return t;if("string"==typeof t){const e=t.toLowerCase();if("false"===e)return!1;if("true"===e)return!0}return e}Oa(t){return this.ya.checkValue(t["@type"],["Product"])?this.Aa(t,"productID"):null}Ca(t,e){const i=t[e];return null==i||""===i?null:Array.isArray(i)?i:[i]}Aa(t,e){const i=this.Ca(t,e),s=i&&i[0];return null==s||""===s?null:s}}class Zn{constructor(t){this.ee=t,this.va=null,this.ca=null,this.ya=new Jn}Ra(t){const e=t.querySelectorAll("[itemprop='isAccessibleForFree']");for(let i=0;e[i];i++){const t=e[i],s=t.getAttribute("content")||t.textContent;if(s&&this.Pa(t,"alreadySeenForAccessInfo")){let t=null;return"true"===s.toLowerCase()?t=!0:"false"===s.toLowerCase()&&(t=!1),t}}return null}Pa(t,e){for(let i=t;i&&!i[e];i=i.parentNode)if(i[e]=!0,i.hasAttribute&&i.hasAttribute("itemscope")&&i.hasAttribute("itemtype")){const t=i.getAttribute("itemtype");return this.ya.checkSpaceDelimitedList(t,Kn)}return!1}Oa(t){const e=t.querySelectorAll('[itemprop="productID"]');for(let i=0;e[i];i++){const t=e[i],s=t.getAttribute("content")||t.textContent,n=t.closest("[itemtype][itemscope]");if(!(n.getAttribute("itemtype").indexOf("http://schema.org/Product")<=-1)&&this.Pa(n.parentElement,"alreadySeenForProductInfo"))return s}return null}xa(){let t=null;return null!=this.va?t=!this.va:this.ee.isReady()&&(t=!1),null!=this.ca&&null!=t?new Yn(this.ca,t):null}Sa(){const t=Array.prototype.slice.call(this.ee.getRootNode().querySelectorAll("[itemscope][itemtype]")).filter((t=>this.ya.checkSpaceDelimitedList(t.getAttribute("itemtype"),Kn)));for(const e of t){null==this.va&&(this.va=this.Ra(e)),this.ca||(this.ca=this.Oa(e));const t=this.xa();if(t)return t}return null}check(){return this.ee.getBody()?this.Sa():null}}function tr(t,e){const i=t.querySelector('meta[name="'.concat(e,'"]'));return i?i.getAttribute("content"):null}const er=us(vs),ir=2147483647,sr={Environment:{LOCAL:"LOCAL",PREPROD:"PREPROD",PRODUCTION:"PRODUCTION",SANDBOX:"SANDBOX",TEST:"TEST",TIN:"TIN"}
39,PaymentMethod:{CARD:"CARD",TOKENIZED_CARD:"TOKENIZED_CARD",UPI:"UPI"},AuthMethod:{CRYPTOGRAM_3DS:"CRYPTOGRAM_3DS",PAN_ONLY:"PAN_ONLY"},ResponseStatus:{CANCELED:"CANCELED",DEVELOPER_ERROR:"DEVELOPER_ERROR"},TotalPriceStatus:{ESTIMATED:"ESTIMATED",FINAL:"FINAL",NOT_CURRENTLY_KNOWN:"NOT_CURRENTLY_KNOWN"},ButtonType:{SHORT:"short",LONG:"long"},ButtonColor:{DEFAULT:"default",BLACK:"black",WHITE:"white"},Id:{POPUP_WINDOW_CONTAINER:"popup-window-container"},STORAGE_KEY_PREFIX:"google.payments.api.storage"}; 40/** 41 * @license 42 * Copyright 2018 Google Inc. All Rights Reserved. 43 * 44 * Licensed under the Apache License, Version 2.0 (the "License"); 45 * you may not use this file except in compliance with the License. 46 * You may obtain a copy of the License at 47 * 48 * http://www.apache.org/licenses/LICENSE-2.0 49 * 50 * Unless required by applicable law or agreed to in writing, software 51 * distributed under the License is distributed on an "AS-IS" BASIS, 52 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 53 * See the License for the specific language governing permissions and 54 * limitations under the License. 55 */sr.IS_READY_TO_PAY_RESULT_KEY=sr.STORAGE_KEY_PREFIX+".isreadytopay.result",sr.UPI_CAN_MAKE_PAYMENT_CACHE_KEY=sr.STORAGE_KEY_PREFIX+".upi.canMakePaymentCache",sr.CLASS_PREFIX="google-payments-",sr.IFRAME_ACTIVE_CONTAINER_CLASS="".concat(sr.CLASS_PREFIX,"activeContainer"),sr.IFRAME_CONTAINER_CLASS="".concat(sr.CLASS_PREFIX,"dialogContainer"),sr.IFRAME_STYLE_CENTER_CLASS="".concat(sr.CLASS_PREFIX,"dialogCenter"),sr.IFRAME_STYLE_CLASS="".concat(sr.CLASS_PREFIX,"dialog"),sr.IFRAME_STYLE="\n.".concat(sr.IFRAME_STYLE_CLASS," {\n animation: none 0s ease 0s 1 normal none running;\n background: none 0 0 / auto repeat scroll padding-box border-box #fff;\n background-blend-mode: normal;\n border: 0 none #333;\n border-radius: 8px 8px 0 0;\n border-collapse: separate;\n bottom: 0;\n box-shadow: #808080 0 3px 0 0, #808080 0 0 22px;\n box-sizing: border-box;\n letter-spacing: normal;\n max-height: 100%;\n overflow: visible;\n position: fixed;\n width: 100%;\n z-index: ").concat(ir,";\n -webkit-appearance: none;\n left: 0;\n}\n@media (min-width: 480px) {\n .").concat(sr.IFRAME_STYLE_CLASS," {\n width: 480px !important;\n left: -240px !important;\n margin-left: calc(100vw - 100vw / 2) !important;\n }\n}\n.").concat(sr.IFRAME_CONTAINER_CLASS," {\n background-color: rgba(0,0,0,0.26);\n bottom: 0;\n height: 100%;\n left: 0;\n position: absolute;\n right: 0;\n}\n.iframeContainer {\n -webkit-overflow-scrolling: touch;\n}\n"),sr.IFRAME_STYLE_CENTER="\n.".concat(sr.IFRAME_STYLE_CENTER_CLASS," {\n animation: none 0s ease 0s 1 normal none running;\n background-blend-mode: normal;\n background: none 0 0 / auto repeat scroll padding-box border-box #fff;\n border-collapse: separate;\n border-radius: 8px;\n border: 0px none #333;\n bottom: auto;\n box-shadow: #808080 0 0 22px;\n box-sizing: border-box;\n left: -240px;\n letter-spacing: normal;\n margin-left: calc(100vw - 100vw / 2) !important;\n max-height: 90%;\n overflow: visible;\n position: absolute;\n top: 100%;\n transform: scale(0.8);\n width: 480px;\n z-index: ").concat(ir,";\n -webkit-appearance: none;\n}\n@media (min-height: 667px) {\n .").concat(sr.IFRAME_STYLE_CENTER_CLASS," {\n max-height: 600px;\n }\n}\n.").concat(sr.IFRAME_ACTIVE_CONTAINER_CLASS," {\n top: 50%;\n transform: scale(1.0) translateY(-50%);\n}\n"),sr.GPAY_BUTTON_WITH_CARD_INFO_IMAGE="background-image: url(https://pay.google.com/gp/p/generate_gpay_btn_img);",sr.BUTTON_LOCALE_TO_MIN_WIDTH={en:152,bg:163,cs:192,de:183,es:183,fr:183,hr:157,id:186,ja:148,ko:137,ms:186,nl:167,pl:182,pt:193,ru:206,sk:157,sl:211,sr:146,tr:161,uk:207,zh:156},sr.GPAY_GRAYPANE="gpay-graypane",sr.GPAY_BUTTON_CLASS="gpay-button",sr.BUTTON_STYLE="\n.".concat(sr.GPAY_BUTTON_CLASS," {\n background-origin: content-box;\n background-position: center center;\n background-repeat: no-repeat;\n background-size: contain;\n border: 0px;\n border-radius: 4px;\n box-shadow: rgba(60, 64, 67, 0.3) 0px 1px 1px 0px, rgba(60, 64, 67, 0.15) 0px 1px 3px 1px;\n cursor: pointer;\n height: 40px;\n min-height: 40px;\n padding: 11px 24px;\n}\n\n.").concat(sr.GPAY_BUTTON_CLASS,".black {\n background-color: #000;\n box-shadow: none;\n padding: 12px 24px 10px;\n}\n\n.").concat(sr.GPAY_BUTTON_CLASS,".white {\n background-color: #fff;\n}\n\n.").concat(sr.GPAY_BUTTON_CLASS,".short {\n min-width: 90px;\n width: 160px;\n}\n\n.").concat(sr.GPAY_BUTTON_CLASS,".black.short {\n background-image: url(https://www.gstatic.
55com/instantbuy/svg/dark_gpay.svg);\n}\n\n.").concat(sr.GPAY_BUTTON_CLASS,".white.short {\n background-image: url(https://www.gstatic.com/instantbuy/svg/light_gpay.svg);\n}\n\n.").concat(sr.GPAY_BUTTON_CLASS,".black.active {\n background-color: #5f6368;\n}\n\n.").concat(sr.GPAY_BUTTON_CLASS,".black.hover {\n background-color: #3c4043;\n}\n\n.").concat(sr.GPAY_BUTTON_CLASS,".white.active {\n background-color: #fff;\n}\n\n.").concat(sr.GPAY_BUTTON_CLASS,".white.focus {\n box-shadow: #e8e8e8 0 1px 1px 0, #e8e8e8 0 1px 3px;\n}\n\n.").concat(sr.GPAY_BUTTON_CLASS,".white.hover {\n background-color: #f8f8f8;\n}\n"),sr.GPAY_BUTTON_WITH_OFFER_ICON_ADDITIONAL_STYLE="position: relative;",sr.GPAY_OFFER_ICON_CLASS="gpay-offer-icon",sr.GPAY_OFFER_ICON_SVG='<svg width="20px" height="20px" viewBox="0 0 20 20" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" class="gpay-offer-icon"><defs><path d="M19.41,9.58 L10.41,0.58 C10.05,0.22 9.55,0 9,0 L2,0 C0.9,0 0,0.9 0,2 L0,9 C0,9.55 0.22,10.05 0.59,10.42 L9.59,19.42 C9.95,19.78 10.45,20 11,20 C11.55,20 12.05,19.78 12.41,19.41 L19.41,12.41 C19.78,12.05 20,11.55 20,11 C20,10.45 19.77,9.94 19.41,9.58 Z" id="path-1"></path></defs><g id="buttons_10.05" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd"><g id="Artboard" transform="translate(-40.000000, -43.000000)"><g id="Group-3" transform="translate(40.000000, 43.000000)"><g id="Group-2-Copy-2"><g id="Group-Copy"><g id="ic_loyalty_24px"><mask id="mask-2" fill="white"><use xlink:href="#path-1"></use></mask><use id="gpay-Shape" fill="#FF6100" fill-rule="nonzero" xlink:href="#path-1"></use><path d="M3.5,5 C2.67,5 2,4.33 2,3.5 C2,2.67 2.67,2 3.5,2 C4.33,2 5,2.67 5,3.5 C5,4.33 4.33,5 3.5,5 Z" id="Path" fill="#FFFFFF" fill-rule="nonzero" mask="url(#mask-2)"></path></g></g></g><g id="Group-13-Copy-7" transform="translate(6.000000, 6.000000)" fill="#FFFFFF" fill-rule="nonzero"><g id="Group-13-Copy-2"><path d="M2.15217391,4.55172414 C0.963561082,4.55172414 1.99840144e-14,3.53278598 1.99840144e-14,2.27586207 C1.99840144e-14,1.01893816 0.963561082,6.30606678e-14 2.15217391,6.30606678e-14 C3.34078674,6.30606678e-14 4.30434783,1.01893816 4.30434783,2.27586207 C4.30434783,3.53278598 3.34078674,4.55172414 2.15217391,4.55172414 Z M2.15217391,3.31034483 C2.69245247,3.31034483 3.13043478,2.84719112 3.13043478,2.27586207 C3.13043478,1.70453302 2.69245247,1.24137931 2.15217391,1.24137931 C1.61189535,1.24137931 1.17391304,1.70453302 1.17391304,2.27586207 C1.17391304,2.84719112 1.61189535,3.31034483 2.15217391,3.31034483 Z" id="Combined-Shape"></path><path d="M6.84782609,9 C5.65921326,9 4.69565217,7.98106184 4.69565217,6.72413793 C4.69565217,5.46721402 5.65921326,4.44827586 6.84782609,4.44827586 C8.03643892,4.44827586 9,5.46721402 9,6.72413793 C9,7.98106184 8.03643892,9 6.84782609,9 Z M6.84782609,7.75862069 C7.38810465,7.75862069 7.82608696,7.29546698 7.82608696,6.72413793 C7.82608696,6.15280888 7.38810465,5.68965517 6.84782609,5.68965517 C6.30754753,5.68965517 5.86956522,6.15280888 5.86956522,6.72413793 C5.86956522,7.29546698 6.30754753,7.75862069 6.84782609,7.75862069 Z" id="Combined-Shape"></path><polygon id="Rectangle" transform="translate(4.497720, 4.541938) rotate(34.000000) translate(-4.497720, -4.541938) " points="3.77901778 -0.202295978 4.9740273 -0.171019161 5.21642263 9.28617278 4.02141311 9.25489596"></polygon></g></g></g></g></g></svg>',sr.GPAY_OFFER_ICON_STYLE="\n.".concat(sr.GPAY_OFFER_ICON_CLASS," {\n position: absolute;\n right: -5px;\n top: -5px;\n}\n\n#ic_loyalty_24px use.hover {\n fill: #FC853B;\n}\n"),sr.GPAY_OFFER_DESCRIPTION_CLASS="gpay-offer-description",sr.GPAY_OFFER_DESCRIPTION_STYLE="\n@import url(//fonts.googleapis.com/css?family=Google+Sans:500);\n.".concat(sr.GPAY_OFFER_DESCRIPTION_CLASS," {\n text-align: center;\n font: 10px 'Google Sans';\n margin-top: 2px;\n margin-bottom: 0px;\n}\n\n.").concat(sr.GPAY_OFFER_DESCRIPTION_CLASS,".gpay-btn-clicked {\n color: #3C4043;\n}\n\n.").concat(sr.GPAY_OFFER_DESCRIPTION_CLASS,".short {\n min-width: 90px;\n width: 160px;\n}\n\n.").concat(sr.GPAY_OFFER_DESCRIPTION_CLASS,".long {\n min-width: 152px;\n width: 240px;\n}\n"),sr.GPAY_BUTTON_CARD_INFO_CLASS="gpay-card-info-btn",sr.GPAY_BUTTON_CARD_INFO_BUTTON_STYLE="\n .".concat(sr.GPAY_BUTTON_CARD_INFO_CLASS," {\n background-origin: content-box;\n background-position: center center;\n background-repeat: no-repeat;\n background-size: contain;\n border: 0px;\n border-radius: 4px;\n box-shadow: rgba(60, 64, 67, 0.3) 0px 1px 1px 0px, rgba(60, 64, 67, 0.15) 0px 1px 3px 1px;\n cursor: pointer;\n height: 40px;\n min-height: 40px;\n padding: 11px 24px;\n background-color: #000;\n box-shadow: none;\n padding: 9px 24px 10px;\n min-width: 190px;\n width: 240px;\n }\n\n .").concat(sr.GPAY_BUTTON_CARD_INFO_CLASS,".active {\n background-color: #5f6368;\n }\n\n .").concat(sr.GPAY_BUTTON_CARD_INFO_CLASS,".hover {\n background-color: #3c4043;\n }\n "),sr.TRUSTED_DOMAIN=".google.com"; 56/** 57 * @license 58 * Copyright 2018 Google Inc. All Rights Reserved. 59 * 60 * Licensed under the Apache License, Version 2.0 (the "License");
61 * you may not use this file except in compliance with the License. 62 * You may obtain a copy of the License at 63 * 64 * http://www.apache.org/licenses/LICENSE-2.0 65 * 66 * Unless required by applicable law or agreed to in writing, software 67 * distributed under the License is distributed on an "AS-IS" BASIS, 68 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 69 * See the License for the specific language governing permissions and 70 * limitations under the License. 71 */ 72class nr{constructor(t){this.La=t}postMessage(t,e){this.La.postMessage(t,e)}} 73/** 74 * @license 75 * Copyright 2018 Google Inc. All Rights Reserved. 76 * 77 * Licensed under the Apache License, Version 2.0 (the "License"); 78 * you may not use this file except in compliance with the License. 79 * You may obtain a copy of the License at 80 * 81 * http://www.apache.org/licenses/LICENSE-2.0 82 * 83 * Unless required by applicable law or agreed to in writing, software 84 * distributed under the License is distributed on an "AS-IS" BASIS, 85 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 86 * See the License for the specific language governing permissions and 87 * limitations under the License. 88 */let rr=null,or=null,ar=null,hr=null,lr=Date.now(),ur=null,cr=!1,dr=[];class pr{static load(){if(rr)return;const t=window.gpayInitParams||{};ar=t.environment||sr.Environment.PRODUCTION,rr=document.createElement("iframe"),rr.src=pr.Ma(window.location.origin,t.merchantInfo&&t.merchantInfo.merchantId),pr.postMessage({eventType:15,clientLatencyStartMs:Date.now()}),rr.height="0",rr.width="0",rr.style.display="none",rr.style.visibility="hidden",rr.onload=function(){pr.postMessage({eventType:17,clientLatencyStartMs:Date.now()}),pr.iframeLoaded()},document.body?pr.ka():document.addEventListener("DOMContentLoaded",(()=>pr.ka()))}static ka(){document.body.appendChild(rr),or=new nr(rr.contentWindow)}static sendAndWaitForResponse(t,e,i,s){pr.Da((function t(e){e.data[i]&&(s(e),pr.Ua(t))}));const n=Object.assign({eventType:e},t);pr.postMessage(n)}static Da(t){window.addEventListener("message",t)}static Ua(t){window.removeEventListener("message",t)}static postMessage(t){if(!cr)return void dr.push(t);const e=Object.assign({buyFlowActivityMode:ur,googleTransactionId:hr,originTimeMs:lr},t);or.postMessage(e,pr.Ga())}static setBuyFlowActivityMode(t){ur=t}static setGoogleTransactionId(t){hr=t}static setOriginTimeMs(t){lr=t}static setPostMessageService(t){or=t}static reset(){rr=null,dr.length=0,cr=!1,ur=null}static setIframeLoaded(t){cr=t}static iframeLoaded(){cr=!0,dr.forEach((function(t){pr.postMessage(t)})),dr.length=0}static getBuffer(){return dr}static injectIframeForTesting(){pr.reset(),rr=document.createElement("p"),pr.iframeLoaded()}static Ga(){let t="https://pay";return ar==sr.Environment.SANDBOX?t+=".sandbox":ar==sr.Environment.PREPROD&&(t+="-preprod.sandbox"),t+".google.com"}static Ma(t,e){return"https://pay".concat(ar==sr.Environment.PREPROD?"-preprod.sandbox":ar==sr.Environment.SANDBOX?".sandbox":"",".google.com/gp/p/ui/payframe?origin=").concat(t,"&mid=%{merchantId}")}} 89/** 90 * @license 91 * Copyright 2018 Google Inc. All Rights Reserved. 92 * 93 * Licensed under the Apache License, Version 2.0 (the "License"); 94 * you may not use this file except in compliance with the License. 95 * You may obtain a copy of the License at 96 * 97 * http://www.apache.org/licenses/LICENSE-2.0 98 * 99 * Unless required by applicable law or agreed to in writing, software 100 * distributed under the License is distributed on an "AS-IS" BASIS, 101 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 102 * See the License for the specific language governing permissions and 103 * limitations under the License. 104 */class gr{constructor(t){this.Fa=t,this.Ss=null}onResult(t){this.Ss=t}isReadyToPay(t){const e=this.za(t);return new Promise(((i,s)=>{e.canMakePayment().then((e=>{window.sessionStorage.setItem(sr.IS_READY_TO_PAY_RESULT_KEY,e.toString());const s={result:e};t.apiVersion>=2&&t.existingPaymentMethodRequired&&(s.paymentMethodPresent=e),i(s)})).catch((function(t){window.sessionStorage.getItem(sr.IS_READY_TO_PAY_RESULT_KEY)?i({result:"true"==window.sessionStorage.getItem(sr.IS_READY_TO_PAY_RESULT_KEY)}):i({result:!1})}))}))}prefetchPaymentData(t){this.za(t,this.Fa,t.transactionInfo.currencyCode,t.transactionInfo.totalPrice)}loadPaymentData(t){this.Ba(t)}
104za(t,e,i,s){let n={};return t&&(n=JSON.parse(JSON.stringify(t))),n.apiVersion||(n.apiVersion=1),n.swg&&(n.allowedPaymentMethods=[sr.PaymentMethod.CARD]),e&&e==sr.Environment.TEST&&(n.environment=e),new PaymentRequest([{supportedMethods:["https://google.com/pay"],data:n}],{total:{label:"Estimated Total Price",amount:{currency:i||"USD",value:s||"0"}}})}Ba(t){const e=t.transactionInfo&&t.transactionInfo.currencyCode||void 0,i=t.transactionInfo&&t.transactionInfo.totalPrice||void 0,s=this.za(t,this.Fa,e,i);this.Ss(s.show().then((t=>(t.complete("success"),t.details))).catch((function(t){throw t.statusCode=sr.ResponseStatus.CANCELED,t})))}} 105/** 106 * @license 107 * Copyright 2018 Google Inc. All Rights Reserved. 108 * 109 * Licensed under the Apache License, Version 2.0 (the "License"); 110 * you may not use this file except in compliance with the License. 111 * You may obtain a copy of the License at 112 * 113 * http://www.apache.org/licenses/LICENSE-2.0 114 * 115 * Unless required by applicable law or agreed to in writing, software 116 * distributed under the License is distributed on an "AS-IS" BASIS, 117 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 118 * See the License for the specific language governing permissions and 119 * limitations under the License. 120 */class mr{constructor(t){this.ee=t,this.Wa=t.createElement(sr.GPAY_GRAYPANE),fr(this.Wa,{"z-index":2147483647,display:"none",position:"fixed",top:0,right:0,bottom:0,left:0,"background-color":"rgba(32, 33, 36, .6)"}),this.Va=null,this.Wa.addEventListener("click",(()=>{if(this.Va)try{this.Va.focus()}catch(t){}}))}show(t){return this.Va=t||null,this.ee.body.appendChild(this.Wa),fr(this.Wa,{display:"block",opacity:0}
120),wr(this.Wa,{opacity:1},300,"ease-out")}hide(){if(this.Va=null,this.Wa.parentElement)return wr(this.Wa,{opacity:0},300,"ease-out").then((()=>{fr(this.Wa,{display:"none"}),this.ee.body.removeChild(this.Wa)}))}}function fr(t,e){for(const i in e)t.style.setProperty(i,e[i].toString(),"important")}function wr(t,e,i,s){const n=t.ownerDocument.defaultView,r=t.style.transition||"";return new Promise((r=>{n.setTimeout((()=>{n.setTimeout(r,i);const o="".concat(i,"ms ").concat(s);fr(t,Object.assign({transition:"transform ".concat(o,", opacity ").concat(o)},e))}))})).then((()=>{fr(t,Object.assign({transition:r},e))}))} 121/** 122 * @license 123 * Copyright 2018 Google Inc. All Rights Reserved. 124 * 125 * Licensed under the Apache License, Version 2.0 (the "License"); 126 * you may not use this file except in compliance with the License. 127 * You may obtain a copy of the License at 128 * 129 * http://www.apache.org/licenses/LICENSE-2.0 130 * 131 * Unless required by applicable law or agreed to in writing, software 132 * distributed under the License is distributed on an "AS-IS" BASIS, 133 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 134 * See the License for the specific language governing permissions and 135 * limitations under the License. 136 */function Er(){if(-1!=window.navigator.userAgent.indexOf("OPR/"))return!1;const t=window.navigator.userAgent.match(/Android/i),e=window.navigator.userAgent.match(/Chrome\/([0-9]+)\./i);return null!=t&&"PaymentRequest"in window&&"Google Inc."==window.navigator.vendor&&null!=e&&Number(e[1])>=59}function br(t){if(t.apiVersion>=2){const e=Nr(t);if(e&&1==e.length&&e[0]==sr.AuthMethod.CRYPTOGRAM_3DS)return!0}return 1==t.allowedPaymentMethods.length&&t.allowedPaymentMethods[0]==sr.PaymentMethod.TOKENIZED_CARD}function Tr(t,e){if(t.apiVersion>=2){const i=Nr(t);return!(!i||!i.includes(e))}return!1}function Ir(){return window.location.hostname.endsWith(sr.TRUSTED_DOMAIN)||void 0===window.isSecureContext||window.isSecureContext?null:"Google Pay APIs should be called in secure context!"}function yr(t){return Object.values(sr.PaymentMethod).includes(t)}function Sr(t){return Object.values(sr.AuthMethod).includes(t)}function Cr(t){if(!t)return"paymentDataRequest must be set!";if(t.swg)return(e=t.swg)?e.skuId&&e.publicationId?null:"Both skuId and publicationId must be provided":"Swg parameters must be provided";var e;if(!t.transactionInfo)return"transactionInfo must be set!";if(!t.transactionInfo.currencyCode)return"currencyCode in transactionInfo must be set!";if(!t.transactionInfo.totalPriceStatus||!Object.values(sr.TotalPriceStatus).includes(t.transactionInfo.totalPriceStatus))return"totalPriceStatus in transactionInfo must be set to one of NOT_CURRENTLY_KNOWN, ESTIMATED or FINAL!";if("NOT_CURRENTLY_KNOWN"!==t.transactionInfo.totalPriceStatus&&!t.transactionInfo.totalPrice)return"totalPrice in transactionInfo must be set when totalPriceStatus is ESTIMATED or FINAL!";const i=Or(t);if(i){if(!i.parameters)return"parameters must be set in allowedPaymentMethod!";var s=i.parameters;if(!s.payeeVpa)return"payeeVpa in allowedPaymentMethod parameters must be set!";if(!s.payeeName)return"payeeName in allowedPaymentMethod parameters must be set!";if(!s.referenceUrl)return"referenceUrl in allowedPaymentMethod parameters must be set!";if(!s.mcc)return"mcc in allowedPaymentMethod parameters must be set!";if(!s.transactionReferenceId)return"transactionReferenceId in allowedPaymentMethod parameters must be set!";if("INR"!==t.transactionInfo.currencyCode)return"currencyCode in transactionInfo must be set to INR!";if("FINAL"!==t.transactionInfo.totalPriceStatus)return"totalPriceStatus in transactionInfo must be set to FINAL!";if(!t.transactionInfo.transactionNote)return"transactionNote in transactionInfo must be set!"}return null}function Or(t){return!Er()||t.apiVersion<2||!t.allowedPaymentMethods?null:Ar(t,sr.PaymentMethod.UPI)}function Nr(t){if(t.allowedPaymentMethods){const e=Ar(t,sr.PaymentMethod.CARD);if(e&&e.parameters)return e.parameters.allowedAuthMethods}return null}function Ar(t,e){for(var i=0;i<t.allowedPaymentMethods.length;i++){const s=t.allowedPaymentMethods[i];if(s.type==e)return s}return null} 137/** 138 * @license 139 * Copyright 2018 Google Inc. All Rights Reserved. 140 * 141 * Licensed under the Apache License, Version 2.0 (the "License");
142 * you may not use this file except in compliance with the License. 143 * You may obtain a copy of the License at 144 * 145 * http://www.apache.org/licenses/LICENSE-2.0 146 * 147 * Unless required by applicable law or agreed to in writing, software 148 * distributed under the License is distributed on an "AS-IS" BASIS, 149 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 150 * See the License for the specific language governing permissions and 151 * limitations under the License. 152 */ 153/** 154 * @license 155 * Copyright 2018 Google Inc. All Rights Reserved. 156 * 157 * Licensed under the Apache License, Version 2.0 (the "License"); 158 * you may not use this file except in compliance with the License. 159 * You may obtain a copy of the License at 160 * 161 * http://www.apache.org/licenses/LICENSE-2.0 162 * 163 * Unless required by applicable law or agreed to in writing, software 164 * distributed under the License is distributed on an "AS-IS" BASIS, 165 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 166 * See the License for the specific language governing permissions and 167 * limitations under the License. 168 */ 169const{ActivityPort:vr,ActivityPorts:Rr,ActivityIframePort:Pr}=er,xr="GPAY",Lr="height ".concat(250,"ms"),Mr="Safari";class kr{constructor(t,e,i,s,n){this.Fa=t,this.activities=s||new Rr(window),this.Fr=new mr(window.document),this.Ss=null,this.Ya=null,this.qa=!1,this.oi=null,this.Ka=null,this.Ha=e,this.$a=n||null,this.Ja=null}onResult(t){this.Ss||(this.Ss=t,this.activities.onResult(xr,this.Qa.bind(this)))}Qa(t){this.Fr.hide(),this.Ss(t.acceptResult().then((t=>{if(t.origin!=this.Xa())throw new Error("channel mismatch");const e=t.data;if(e.redirectEncryptedCallbackData)return pr.setBuyFlowActivityMode(3),this.Za(e.redirectEncryptedCallbackData).then((t=>{const i=Object.assign({},e);return delete i.redirectEncryptedCallbackData,Object.assign(i,t)}));if(!t.originVerified||!t.secureChannel)throw new Error("channel mismatch");return e}),(t=>{const e=t.message;let i=t.message;try{i=JSON.parse(e.substring(7))}catch(s){}return i.statusCode&&-1==["DEVELOPER_ERROR","MERCHANT_ACCOUNT_ERROR"].indexOf(i.statusCode)&&(i={statusCode:"CANCELED"}),"AbortError"==i&&(i={statusCode:"CANCELED"}),Promise.reject(i)})))}Za(t){return new Promise(((e,i)=>{const s=this.eh(),n=new XMLHttpRequest;n.open("POST",s,!0),"withCredentials"in n&&(n.withCredentials=!0),n.onreadystatechange=()=>{if(!(n.readyState<2)){if(n.status<100||n.status>599)return n.onreadystatechange=null,void i(new Error("Unknown HTTP status ".concat(n.status)));if(4==n.readyState)try{e(JSON.parse(n.responseText))}catch(t){i(t)}}},n.onerror=()=>{i(new Error("Network failure"))},n.onabort=()=>{i(new Error("Request aborted"))},n.send(t)}))}isReadyToPay(t){return new Promise(((e,i)=>{if(br(t))return void e({result:!1});const s=window.navigator.userAgent;if(s.indexOf("GSA/")>0&&s.indexOf(Mr)>0)return void e({result:!1});if(s.indexOf("FxiOS")>0)return void e({result:!1});const n=s.indexOf("Chrome")>0||s.indexOf("Firefox")>0||s.indexOf(Mr)>0;n&&t.apiVersion>=2&&t.existingPaymentMethodRequired?(t.environment=this.Fa,pr.sendAndWaitForResponse(t,6,"isReadyToPayResponse",(i=>{const s={result:n};t.existingPaymentMethodRequired&&(s.paymentMethodPresent="READY_TO_PAY"==i.data.isReadyToPayResponse),e(s)}))):e({result:n})}))}prefetchPaymentData(t){}loadPaymentData(t){t.swg||t.apiVersion||(t.apiVersion=1),t.environment=this.Fa,pr.setBuyFlowActivityMode(t.forceRedirect?3:2);const e=this.activities.open(xr,this.ih(this.sh(t)),this.nh(t),t,{width:600,height:600});this.Fr.show(e&&e.targetWin)}nh(t){return t.forceRedirect?"_top":"gp-js-popup"}Xa(){if(this.Fa==sr.Environment.LOCAL)return"";let t;return t=this.Fa==sr.Environment.PREPROD?"pay-preprod.sandbox":this.Fa==sr.Environment.SANDBOX?"pay.sandbox":"pay","https://"+t+".google.com"}rh(){return this.Xa()+"/gp/p"}eh(){let t=this.rh()+"/apis/buyflow/process";return this.$a&&(t+="?rk="+encodeURIComponent(this.$a)),t}sh(t){const e=t.swg;if(e)return e.swgVersion}ih(t){if(this.Fa==sr.Environment.TIN)return"/ui/pay";let e=this.rh()+"/ui/pay?swg=true";return t&&(e=e+"&swgVersion="+t),e}getIframeUrl(t,e,i){let s="https://pay.google.com/gp/p/ui/pay?origin=".concat(e,"&swg=true");return t!=sr.Environment.SANDBOX&&t!=sr.Environment.PREPROD||(s="https://pay'+ (environment == Constants.Environment.PREPROD ? '-preprod' : '')+ '.s
169andbox.google.com/gp/p/ui/pay?origin=".concat(e,"&swg=true")),i&&(s=s+"&swgVersion="+i),s}oh(t,e){this.ah(e,"all 250ms ease 0s"),e.height="0px",setTimeout((()=>{t.parentNode&&t.parentNode.removeChild(t)}),250)}hh(t){const e=function(t){const e=document.createElement("div");e.classList.add(sr.IFRAME_CONTAINER_CLASS);const i=document.createElement("div");i.classList.add("iframeContainer");const s=document.createElement("iframe");return s.classList.add(t),s.setAttribute("frameborder","0"),s.setAttribute("scrolling","no"),i.appendChild(s),e.appendChild(i),document.body.appendChild(e),{container:e,iframe:s}}(this.uh(t)?sr.IFRAME_STYLE_CENTER_CLASS:sr.IFRAME_STYLE_CLASS),i=e.iframe,s=e.container;return s.addEventListener("click",this.dh.bind(this,e)),s.style.display="none",i.style.display="none",i.height="0px",this.ah(i,"all 250ms ease 0s"),this.qa=!1,e}ph(t){this.gh(t)}dh(t){t.container.parentNode&&history.back()}gh(t){t.container.parentNode&&(this.Ka(Promise.reject({errorCode:"CANCELED"})),this.oh(t.container,t.iframe),this.oi&&this.oi.disconnect())}uh(t){return null}mh(t,e,i){t.style.display="block",e.style.display="block",setTimeout((()=>{e.height="280px",this.uh(i)&&e.classList.add(sr.IFRAME_ACTIVE_CONTAINER_CLASS),setTimeout((()=>{this.qa=!0,this.Ja&&(this.ah(e,this.Ja.transition),e.height=this.Ja.height,this.Ja=null)}),250)}),1)}ah(t,e){t.style.setProperty("transition",e),t.style.setProperty("-webkit-transition",e)}_h(t,e,i){let s;i.swg||i.apiVersion||(i.apiVersion=1),i.environment=this.Fa;const n=this.getIframeUrl(this.Fa,window.location.origin,this.sh(i));return this.activities.openIframe(e,n,i).then((t=>(this.oi=t,t.onMessage((t=>{"resize"===t.type&&this.qa?(s||(s=Date.now()),Date.now()<s+250?this.ah(e,t.transition+", "+Lr):this.ah(e,t.transition),e.height=t.height):this.Ja={height:t.height,transition:t.transition}})),t.acceptResult()))).then((i=>(this.oh(t,e),history.back(),i.data)),(i=>(this.oh(t,e),history.back(),Promise.reject(i))))}} 170/** 171 * @license 172 * Copyright 2018 Google Inc. All Rights Reserved. 173 * 174 * Licensed under the Apache License, Version 2.0 (the "License"); 175 * you may not use this file except in compliance with the License. 176 * You may obtain a copy of the License at 177 * 178 * http://www.apache.org/licenses/LICENSE-2.0 179 * 180 * Unless required by applicable law or agreed to in writing, software 181 * distributed under the License is distributed on an "AS-IS" BASIS, 182 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 183 * See the License for the specific language governing permissions and 184 * limitations under the License. 185 */class Dr{constructor(){}isUpiRequest(t){return!!Or(t)}isReadyToPay(t){if(Or(t))return t.existingPaymentMethodRequired?Promise.resolve({result:!0,paymentMethodPresent:!0}):Promise.resolve({result:!0});throw new Error("No Upi payment method found in handler")}loadPaymentData(t,e,i){const s=e.parameters,n=t.transactionInfo,r=[{supportedMethods:["https://tez.google.com/pay"],data:{pa:s.payeeVpa,pn:s.payeeName,tr:s.transactionReferenceId,url:s.referenceUrl,mc:s.mcc,tn:n.transactionNote}}];s.transactionId&&(r[0].data.tid=s.transactionId);const o={total:{label:"Total",amount:{currency:n.currencyCode,value:n.totalPrice}},displayItems:[{label:"Original Amount",amount:{currency:n.currencyCode,value:n.totalPrice}}]};let a=new PaymentRequest(r,o);i(this.fh(a).then((t=>t?this.wh(a):this.Eh())).then((i=>this.bh(i,t,e))).catch((t=>(t.statusCode=sr.ResponseStatus.CANCELED,Promise.reject(t)))))}wh(t){return t.show().then((t=>(t.complete("success"),t.details)))}fh(t){const e=window.sessionStorage.getItem(sr.UPI_CAN_MAKE_PAYMENT_CACHE_KEY);return e?Promise.resolve("true"===e):t.canMakePayment?t.canMakePayment().then((t=>(t&&window.sessionStorage.setItem(sr.UPI_CAN_MAKE_PAYMENT_CACHE_KEY,t.toString()),t))):Promise.resolve(!0)}Eh(){return window.location.replace("https://play.google.com/store/apps/details?id=com.google.android.apps.nbu.paisa.user"),Promise.reject({errorMessage:"Cannot redirect to Tez page in Google Play."})}bh(t,e,i){const s=JSON.parse(t.tezResponse);if("FAILURE"===s.Status){let t;switch(s.responseCode){case"ZM":t={errorCode:3,errorMessage:"Payment failure due to invali
185d MPIN."};break;case"Z9":t={errorCode:3,errorMessage:"Payment failure due to insufficient funds."};break;case"91":t={errorCode:1,errorMessage:"Payment failure due to transaction timeout or connection issue."};break;default:t={errorMessage:"Payment cancelled."}}return Promise.reject(t)}const n={paymentMethodType:"UPI",payeeVpa:i.parameters.payeeVpa,status:s.Status,transactionReferenceId:i.parameters.transactionReferenceId,transactionId:i.parameters.transactionId?i.parameters.transactionId:s.txnId,transactionInfo:e.transactionInfo};let r={apiVersion:e.apiVersion,apiVersionMinor:e.apiVersionMinor,paymentMethodData:{type:i.type,tokenizationData:{type:"DIRECT",token:{protocolVersion:"ECv1",signature:"",signedMessage:n}}}};return Promise.resolve(r)}} 186/** @license 187 Math.uuid.js (v1.4) 188 http://www.broofa.com 189 mailto:[email protected] 190 Copyright (c) 2010 Robert Kieffer 191 Dual licensed under the MIT and GPL licenses. 192 */class Ur{}var Gr="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".split("");Ur.uuid=function(t,e){var i,s,n=Gr,r=[];if(e=e||n.length,t)for(i=0;i<t;i++)r[i]=n[0|Math.random()*e];else for(r[8]=r[13]=r[18]=r[23]="-",r[14]="4",i=0;i<36;i++)r[i]||(s=0|16*Math.random(),r[i]=n[19==i?3&s|8:s]);return r.join("")},Ur.uuidFast=function(){for(var t,e=Gr,i=new Array(36),s=0,n=0;n<36;n++)8==n||13==n||18==n||23==n?i[n]="-":14==n?i[n]="4":(s<=2&&(s=33554432+16777216*Math.random()|0),t=15&s,s>>=4,i[n]=e[19==n?3&t|8:t]);return i.join("")},Ur.uuidCompact=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(t){var e=16*Math.random()|0;return("x"==t?e:3&e|8).toString(16)}))}; 193/** 194 * @license 195 * Copyright 2018 Google Inc. All Rights Reserved. 196 * 197 * Licensed under the Apache License, Version 2.0 (the "License"); 198 * you may not use this file except in compliance with the License. 199 * You may obtain a copy of the License at 200 * 201 * http://www.apache.org/licenses/LICENSE-2.0 202 * 203 * Unless required by applicable law or agreed to in writing, software 204 * distributed under the License is distributed on an "AS-IS" BASIS, 205 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 206 * See the License for the specific language governing permissions and 207 * limitations under the License. 208 */ 209const{ActivityPorts:jr}=er,Fr=["actions.google.com","amp-actions.sandbox.google.com","amp-actions-staging.sandbox.google.com","amp-actions-autopush.sandbox.google.com","payments.developers.google.com","payments.google.com"];class zr{constructor(t,e,i,s){ 210/** 211 * @license 212 * Copyright 2018 Google Inc. All Rights Reserved. 213 * 214 * Licensed under the Apache License, Version 2.0 (the "License"); 215 * you may not use this file except in compliance with the License. 216 * You may obtain a copy of the License at 217 * 218 * http://www.apache.org/licenses/LICENSE-2.0 219 * 220 * Unless required by applicable law or agreed to in writing, software 221 * distributed under the License is distributed on an "AS-IS" BASIS, 222 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 223 * See the License for the specific language governing permissions and 224 * limitations under the License. 225 */ 226var n;this.Th=e,function(t){if(t.environment&&!Object.values(sr.Environment).includes(t.environment))throw new Error("Parameter environment in PaymentOptions can optionally be set to PRODUCTION, otherwise it defaults to TEST. "+t.environment)}(t),this.Ih=null,this.Fa=t.environment||sr.Environment.TEST,zr.Ha||(zr.Ha=this.yh()&&t.i&&t.i.googleTransactionId?t.i.googleTransactionId:(n=this.Fa,Ur.uuidFast()+"."+n)),this.Sh=t,this.Ch=new kr(this.Fa,zr.Ha,i,s,t.i&&t.i.redirectKey),this.Oh=5;const r=Er();this.Nh=r&&!i?new gr(this.Fa):this.Ch,this.Ah=new Dr,this.Ch.onResult(this.Rh.bind(this)),this.Nh.onResult(this.Rh.bind(this)),pr.load(),r&&pr.setBuyFlowActivityMode(4),pr.setGoogleTransactionId(zr.Ha),pr.postMessage({eventType:9,clientLatencyStartMs:Date.now()}),window.addEventListener("message",(t=>this.Ph(t)))}isReadyToPay(t){t&&(t=Object.assign({},this.Sh,t));const e=Date.now(),i=Ir()||function(t){if(!t)return"isReadyToPayRequest must be set!";if(t.apiVersion>=2){if(!("apiVersionMinor"in t))return"apiVersionMinor must be set!";if(!t.allowedPaymentMethods||!Array.isArray(t.allowedPaymentMethods)||0==t.allowedPaymentMethods.length)return"for v2 allowedPaymentMethods must be set to an array containing a list of accepted payment methods";for(var e=0;e<t.allowedPaymentMethods.length;e++){let n=t.allowedPaymentMethods[e];if(n.type==sr.PaymentMethod.CARD){if(!n.parameters)return"Field parameters must be setup in each allowedPaymentMethod";var i=n.parameters.allowedCardNetworks;if(!i||!Array.isArray(i)||0==i.length)return"allowedCardNetworks must be setup in parameters for type CARD";var s=n.parameters.allowedAuthMethods;if(!s||!Array.isArray(s)||0==s.length||!s.every(Sr))return"allowedAuthMethods must be setup in parameters for type 'CARD' and must contain 'CRYPTOGRAM_3DS' and/or 'PAN_ONLY'"}}return null}return t.allowedPaymentMethods&&Array.isArray(t.allowedPaymentMethods)&&0!=t.allowedPaymentMethods.length&&t.allowedPaymentMethods.every(yr)?null:"allowedPaymentMethods must be set to an array containing 'CARD' and/or 'TOKENIZED_CARD'!"}(t);if(i)return new Promise(((t,e)=>{zr.xh("isReadyToPay",i),pr.postMessage({eventType:0,error:2}),e({statusCode:sr.ResponseStatus.DEVELOPER_ERROR,statusMessage:i})}));const s=this.Lh(t);return s.then((t=>(pr.postMessage({eventType:0,clientLatencyStartMs:e,isReadyToPayApiResponse:t}),t))),s}Lh(t){if(this.Ah.isUpiRequest(t))return this.Ah.isReadyToPay(t);if(Er()&&!Br(t)){if(t.apiVersion>=2)return this.Mh(t);{const e=this.Ch.isReadyToPay(t),i=this.Nh.isReadyToPay(t);return br(t)?i:i.then((()=>e))}}return this.Ch.isReadyToPay(t)}Mh(t){let e=Promise.resolve({result:!1});t.existingPaymentMethodRequired&&(e=Promise.resolve({result:!1,paymentMethodPresent:!1}));let i=e;if(Tr(t,sr.AuthMethod.CRYPTOGRAM_3DS)){const e=JSON.parse(JSON.stringify(t));for(let t=0;t<e.allowedPaymentMethods.length;t++)e.allowedPaymentMethods[t].type==sr.PaymentMethod.CARD&&(e.allowedPaymentMethods[t].parameters.allowedAuthMethods=[sr.AuthMethod.CRYPTOGRAM_3DS]);i=this.Nh.isReadyToPay(e)}let s=e;return Tr(t,sr.AuthMethod.PAN_ONLY)&&(s=this.Ch.isReadyToPay(t)),i.then((t=>1==(t&&t.result)?t:s))}prefetchPaymentData(t){const e=Ir()||Cr(t);e?zr.xh("prefetchPaymentData",e):(this.kh(t),Er()&&!Br(t)?this.Nh.prefetchPaymentData(t):this.Ch.prefetchPaymentData(t))}loadPaymentData(t){pr.postMessage({eventType:5});const e=Ir()||Cr(t);if(this.Oh=t&&t.swg?6:5,e)return void this.Th(new Promise(((t,i)=>{pr.postMessage({eventType:1,error:2,buyFlowMode:this.Oh}),zr.xh("loadPaymentData",e),i({statusCode:sr.ResponseStatus.DEVELOPER_ERROR,statusMessage:e})})));const i=Or(t);i?this.Ah.loadPaymentData(t,i,this.Rh.bind(this)):(this.Ih=Date.now(),this.kh(t),Br(t)?this.Ch.loadPaymentData(t):this.Nh.loadPaymentData(t))}static xh(t,e){console.error("DEVELOPER_ERROR in "+t+" : "+e)}createButton(t={}){const e=Date.now();return pr.postMessage({eventType:2,clientLatencyStartMs:e}),null}Ph(t){this.yh()&&"logPaymentData"===t.data.name&&pr.postMessage(t.data.data)}yh(){return-1!=Fr.indexOf(window.location.hostname)}Rh(t){t.then((t=>{pr.postMessage({eventType:1,clientLatencyStartMs:this.Ih,buyFlowMode:this.Oh})})).catch((t=>{t.errorCode?pr.postMessage({eventType:1,error:t.errorCode,buyFlowMode:this.Oh}):pr.postMessage({eventType:1,error:6,buyFlowMode:this.Oh})})),this.Th(t)}kh(t){const e={startTimeMs:Date.now(),googleTransactionId:zr.Ha};return t.i=t.i?Object.assign(e,t.i):e,t}}function Br(t){return!0===(t.i&&t.i.disableNative)}
226class Wr{constructor(t){this.ee=t}preconnect(t){this.Dh(t,"preconnect")}prefetch(t){this.Dh(t,"preconnect prefetch")}Dh(t,e){const i=jt(this.ee,"link",{rel:e,href:t});this.ee.head.appendChild(i)}}class Vr{constructor(t){this.Uh=null,this.na=null,this.Gh=null,this.jh=null,this.oe=t.win(),this.ie=t.activities(),this.Fh=t.analytics(),this.Bh=new Yr(this.oe),this.Wh=new Wr(this.oe.document),this.Vh()&&(this.preconnect(this.Wh),this.Yh()),this.Bh.prepare(),this.fe=t.eventManager()}qh(t,e,i){return zr.Ha=e,new zr(t,i,!1,this.ie.getOriginalWebActivityPorts())}preconnect(t){t.prefetch("https://payments.google.com/payments/v4/js/integrator.js?ss=md"),t.prefetch("https://clients2.google.com/gr/gr_full_2.0.6.js")}Yh(){this.Uh=this.qh({environment:Ee().payEnv,i:{redirectKey:this.Bh.restoreKey()}},this.Fh.getTransactionId(),this.Kh.bind(this))}Vh(){const t=this.oe.location.hash,e=/redirectEncryptedCallbackData/.test(t),i=/swgRequest/.test(t);return e&&i}getType(){return"PAYJS"}start(t,e={}){let i;this.jh=t,this.Uh||(this.preconnect(this.Wh),this.Yh()),e.forceRedirect&&(t.forceRedirect=!0),qr(t,"disableNative",!0),qr(t,"disableNgbf",!0);const s=new Promise((t=>{i=t}));return this.Bh.useVerifier((async s=>{s&&qr(t,"redirectVerifier",s),e.forceRedirect&&(await this.fe.getReadyPromise(),await this.Fh.getLoggingPromise()),this.Uh.loadPaymentData(t),i(!0)})),s}async onResponse(t){this.Gh=t,this.na&&(await 0,t(this.Hh(this.na,this.jh)))}Kh(t){this.na=t,this.Gh&&this.Gh(this.Hh(this.na,this.jh))}async Hh(t,e){try{const i=await t;return e&&(i.paymentRequest=e),i}catch(i){const t=i;if("object"==typeof t&&"CANCELED"===t.statusCode){const t=Qt("Cancelled");throw t.productType=e?e.i.productType:null,t}throw t}}}class Yr{constructor(t){this.oe=t,this.$h=null,this.Jh=null}prepare(){return this.Qh((()=>{}))}useVerifier(t){this.Qh((e=>{if(e)try{this.oe.localStorage.setItem(Dt,e.key)}catch{e=null}t(e&&e.verifier||null)}))}restoreKey(){try{return this.oe.localStorage&&this.oe.localStorage.getItem(Dt)||null}catch{return null}}async Qh(t){this.$h||(this.Xh()?(this.$h=this.Zh(),this.Jh=await this.$h):(this.$h=Promise.resolve(null),this.Jh=null)),t(this.Jh)}Xh(){let t;try{t=!!this.oe.localStorage}catch{return!1}const e=this.oe.crypto;return!!(t&&e&&e.subtle&&e.subtle.digest)}async Zh(){const t=this.oe.crypto;try{const e=new Uint8Array(16);t.getRandomValues(e);const i=btoa(Bi(e)),s=await t.subtle.digest({name:"SHA-384"},zi(i));return{key:i,verifier:btoa(Bi(new Uint8Array(s)))}}catch{return null}}}function qr(t,e,i){t.i=Object.assign(t.i||{},{[e]:i})}var Kr=(t=>(t.GENERAL="general",t.PAYWALL="paywall",t))(Kr||{});class Hr{constructor(t,e,i){this.oe=t,this.ae=e,this._e=i,this.tl=null,this.el=1,this.Or=this.ae.pageConfig().getPublicationId(),this.ae.eventManager().registerEventListener(this.ei.bind(this))}il(){return this.oe.document.cookie}rl(){if(!this.tl){const t=this.il().match("(^|;)\\s*__gads\\s*=\\s*([^;]+)");this.tl=t&&encodeURIComponent(t.pop())}return this.tl}ol(t){t=he(t,"u_tz","240"),t=he(t,"v",String(this.el));const e=this.rl();return e&&(t=he(t,"cookie",e)),he(t,"cdm",this.oe.location.hostname)}sendSubscriptionState(t,e){let i=Ie("/subopt/data");return i=he(i,"states",this.Or+":"+t),e&&(i=he(i,"extrainfo",e)),this._e.fetch(this.ol(i),{method:"GET",credentials:"include"})}al(t,e){let i=Ie("/subopt/data");return i=he(i,"events",this.Or+":"+t),e&&(i=he(i,"extrainfo",e)),this._e.fetch(this.ol(i),{method:"GET",credentials:"include"})}ei(t){if(t.eventOriginator===l.SHOWCASE_CLIENT)return;if(!this.ae.config().enablePropensity&&t.eventOriginator!==l.PROPENSITY_CLIENT)return;let e=t.additionalParameters;if(t.eventType===o.EVENT_SUBSCRIPTION_STATE)return void this.sendSubscriptionState(e.state,e.productsOrSkus);const i=(s=t.eventType)&&$e[s]||null;var s;null!=i&&(e instanceof I&&(e=void 0),oi(t.isFromUserAction)&&(si(e)||(e={}),e.is_active=t.isFromUserAction),this.al(i,JSON.stringify(e)))}ll(t){if(!t.header)return{header:{ok:!1},body:{error:"No valid response"}};if(t.header.ok){let e=null;const i=t.scores,s=[];for(let t=0;t<i.length;t++){const n=i[t];let r;if(n.score){const t={value:n.score,bucketed:2==n.score_type};r={product:n.product,score:t}}else r={product:n.product,error:n.error_message};s.push(r),e={header:{ok:!0},body:{scores:s}}}return e}return{header:{ok:!1},body:{error:t.error}}}async getPropensity(t,e){const i=Ie("/subopt/pts?products=")+this.Or+"&type="+e+"&ref="+t,s=await this._e.fetch(this.ol(i),{method:"GET",credentials:"include"}),n=await s.json();return this.ll(n)}}class $r{constructor(t,e,i){this.oe=t,this.ul=new Hr(t,e,i),this.fe=e.eventManager()}sendSubscriptionState(t,e){if(!Object.values(qe).includes(t))throw new Error("Invalid subscription state provided");
226if((qe.SUBSCRIBER==t||qe.PAST_SUBSCRIBER==t)&&!e)throw new Error("Entitlements must be provided for users with active or expired subscriptions");if(e&&!si(e))throw new Error("Entitlements must be an Object");let i=null;e&&(i=JSON.stringify(e)),this.ul.sendSubscriptionState(t,i)}getPropensity(t){if(t&&!Object.values(Kr).includes(t))throw new Error("Invalid propensity type requested");return t||(t=Kr.GENERAL),this.ul.getPropensity(this.oe.document.referrer,t)}sendEvent(t){const e=ii(t.name);let i=null;if(!ni(Ke,t.name)||!e)throw new Error("Invalid user event provided("+t.name+")");if(t.data){if(!si(t.data))throw new Error("Event data must be an Object("+t.data+")");i={},Object.assign(i,t.data)}if(oi(t.active))i||(i={}),Object.assign(i,{is_active:t.active});else if(null!=t.active)throw new Error("Event active must be a boolean");this.fe.logEvent({eventType:e,eventOriginator:l.PROPENSITY_CLIENT,isFromUserAction:t.active,additionalParameters:i})}}class Jr{constructor(t){this.ae=t,this.cl=()=>{},this.ie=t.activities(),this.oe=t.win(),this.Ii=t.pageConfig(),this.pi=t.dialogManager()}getRenderPromise(){return this.dl}async startMultipleLinks(t){const{linkTo:e}=t;if(!e||0===e.length)throw new Error("Missing required field: linkTo");const i=this.Ii.getPublicationId(),s=e.map((t=>encodeURIComponent("".concat(t.publicationId,",").concat(t.publisherProvidedId)))).join("&linkTo="),n=Se({publicationId:i}),r=ye("/linksaveiframe",{subscriptionLinking:"true"})+"&linkTo=".concat(s),a=new Ge(this.oe,this.ie,r,n,!1);a.onCancel((()=>this.onCancel(e))),a.on(L,this.onResponse.bind(this));const h=new Promise((t=>this.cl=t));try{this.ae.eventManager().logSwgEvent(o.IMPRESSION_SUBSCRIPTION_LINKING_LOADING);const t={desktopConfig:{isCenterPositioned:!1}};return this.dl=this.pi.openView(a,!1,t),await this.dl,this.ae.eventManager().logSwgEvent(o.IMPRESSION_SUBSCRIPTION_LINKING_COMPLETE),h}catch(l){throw this.ae.eventManager().logSwgEvent(o.IMPRESSION_SUBSCRIPTION_LINKING_ERROR),l}}onResponse(t){const e=t.getSuccess()?o.EVENT_SUBSCRIPTION_LINKING_SUCCESS:o.EVENT_SUBSCRIPTION_LINKING_FAILED;this.ae.eventManager().logSwgEvent(e);const i=t.getLinkResultsList()||[];this.cl({anyFailure:!t.getSuccess(),anySuccess:i.filter((t=>t.getSuccess())).length>0,links:i.map((t=>({publicationId:t.getSwgPublicationId(),publisherProvidedId:t.getPublisherProvidedId(),success:!!t.getSuccess()})))})}onCancel(t){const e=o.ACTION_SUBSCRIPTION_LINKING_CLOSE;this.ae.eventManager().logSwgEvent(e,!0),this.cl({anyFailure:!0,anySuccess:!1,links:t.map((t=>({publicationId:t.publicationId,publisherProvidedId:t.publisherProvidedId,success:!1})))})}async start(t){const{publisherProvidedId:e}=t;if(!e)throw new Error("Missing required field: publisherProvidedId");const i={linkTo:[{publicationId:this.Ii.getPublicationId(),publisherProvidedId:e}]};return this.startMultipleLinks(i).then((t=>({publisherProvidedId:e,success:!t.anyFailure})))}}class Qr{constructor(t,e){this.gl=e,this.openViewPromise=null,this.oe=t.win(),this.ie=t.activities(),this.pi=t.dialogManager(),this.gl||(this.gl=Promise.reject("No account promise provided")),this.gi=new Ge(this.oe,this.ie,ye("/waitforsubscriptionlookupiframe"),Se({publicationId:t.pageConfig().getPublicationId(),productId:t.pageConfig().getProductId()}),!0,!0)}async start(){this.openViewPromise=this.pi.openView(this.gi);try{const t=await this.gl;return this.pi.completeView(this.gi),t}catch(t){throw this.pi.completeView(this.gi),t}}}class Xr{constructor(t,e,i,n,r,a=0){this.ml=a,this._l=null,this.fl=null,(i=i||{}).configPromise||(i.configPromise=Promise.resolve()),this.fe=new ks(i.configPromise),this.ee=cn(t),this.oe=this.ee.getWin(),this.Bo={windowOpenMode:"auto",analyticsMode:0,enableSwgAnalytics:!1,enablePropensity:!1},n&&this.wl(n),this.Ii=e,this.El=this.ee.whenReady(),this.bl=new kn(this.ee),this._e=i.fetcher||new me(this.oe),this.ti=new Oi(this.oe,this.Ii),this.br=new Bs,i.enableGoogleAnalytics&&(this.Tl=new ai(this),this.Tl.start()),this.ie=new xs(this),this.ks=new zs(this),this.Ms=new Vr(this),this.Il=new zn(this),this.we=new Ln(this.oe,this.Ii,this._e,this,i.enableDefaultMeteringHandler||!1),this.pi=new Tn(this.ee),this.ue=new en(this,e.getPublicationId(),this._e,r),this.yl=new $r(this.oe,this,this._e),this.fe.logSwgEvent(o.IMPRESSION_PAGE_LOAD,!1),this.Sl=new Vn(this.Ii,this._e),this.Cl=new Fi(this.ee,Promise.resolve(this));const h=new Wr(this.oe.document);
226h.prefetch("".concat(s,"/loader.svg")),h.preconnect("https://www.gstatic.com/"),h.preconnect("https://www.google.com/"),jn.configurePending(this),ss.configurePending(this),zt(this.ee,on),this.ie.onRedirectError((t=>{this.ks.addLabels(["redirect"]),this.fe.logSwgEvent(o.EVENT_PAYMENT_FAILED,!1),this.bl.error("Redirect error",t)}))}creationTimestamp(){return this.ml}doc(){return this.ee}win(){return this.oe}pageConfig(){return this.Ii}jserror(){return this.bl}activities(){return this.ie}payClient(){return this.Ms}dialogManager(){return this.pi}entitlementsManager(){return this.we}callbacks(){return this.br}storage(){return this.ti}clientConfigManager(){return this.ue}analytics(){return this.ks}init(){}configure(t){this.wl(t)}wl(t){let e="";for(const s in t){const n=t[s];switch(s){case"windowOpenMode":n!=Be.AUTO&&n!=Be.REDIRECT&&(e="Unknown windowOpenMode: "+n);break;case"experiments":for(const t of n)i=t,Ti(this.oe)[i]=!0;this.analytics()&&this.analytics().addLabels(n);break;case"analyticsMode":n!=ze.DEFAULT&&n!=ze.IMPRESSIONS&&(e="Unknown analytics mode: "+n);break;case"enableSwgAnalytics":oi(n)||(e="enableSwgAnalytics must be a boolean, type: "+typeof n);break;case"enablePropensity":oi(n)||(e="enablePropensity must be a boolean, type: "+typeof n);break;case"skipAccountCreationScreen":oi(n)||(e="skipAccountCreationScreen must be a boolean, type: "+typeof n);break;case"publisherProvidedId":null==n||"string"==typeof n&&""!=n||(e="publisherProvidedId must be a string, value: "+n);break;case"paySwgVersion":if("string"!=typeof n){e="paySwgVersion must be a string, type: "+typeof n;break}break;default:e="Unknown config property: "+s}}var i;ie(!e,e||void 0),Object.assign(this.Bo,t)}config(){return this.Bo}reset(){this.we.reset(),this.closeDialog()}clear(){this.we.clear(),this.closeDialog()}closeDialog(){this.pi.completeAll()}start(){if(!this.Ii.getProductId()||!this.Ii.isLocked())return Promise.resolve();this.getEntitlements()}async getEntitlements(t){(null==t?void 0:t.publisherProvidedId)&&(t.publisherProvidedId=this.kt);const e=this.we.getEntitlements(t);this.clientConfigManager().fetchClientConfig(e);const i=await e;if(this.ks.setReadyForLogging(),this.ks.start(),i)try{const t=i.entitlements.map((t=>t.getSku()||"unknown subscriptionToken"));t.length>0&&this.ks.setSku(t.join(","))}catch{}const s=await this.we.getExperimentConfigFlags().then((t=>t.includes(r.BACKGROUND_CLICK_BEHAVIOR_EXPERIMENT)));return this.pi.setEnableBackgroundClickExperiment(s),i.clone()}setOnEntitlementsResponse(t){this.br.setOnEntitlementsResponse(t)}getOffers(t){return this.Sl.getOffers(t&&t.productId)}async showOffers(t){return await this.El,ie(!t||!t.oldSku,"The showOffers() method cannot be used to update a subscription. Use the showUpdateOffers() method instead."),this._l=new os(this,t),this._l.start()}async showUpdateOffers(t){return await this.El,ie(!!t&&!!t.oldSku,"The showUpdateOffers() method cannot be used for new subscribers. Use the showOffers() method instead."),new os(this,t).start()}async showSubscribeOption(t){return await this.El,new as(this,t).start()}async showAbbrvOffer(t){return await this.El,new hs(this,t).start()}async showContributionOptions(t){return await this.El,this.fl=new sn(this,t),this.fl.start()}getLastContributionsFlow(){return this.fl}async waitForSubscriptionLookup(t){return await this.El,new Qr(this,t).start()}setOnLoginRequest(t){this.br.setOnLoginRequest(t)}triggerLoginRequest(t){this.br.triggerLoginRequest(t)}setOnLinkComplete(t){this.br.setOnLinkComplete(t)}async linkAccount(t){return await this.El,new Gn(this).start(t)}async saveSubscription(t){return await this.El,await new Fn(this,t).start()}async showLoginPrompt(){return await this.El,new Wn(this).start()}async showLoginNotification(){return await this.El,new Bn(this).start()}setOnNativeSubscribeRequest(t){this.br.setOnSubscribeRequest(t)}setOnSubscribeResponse(t){this.br.setOnSubscribeResponse(t)}setOnPaymentResponse(t){this.br.setOnPaymentResponse(t)}async subscribe(t){return ie("string"==typeof t,"The subscribe() method can only take a sku as its parameter; for subscription updates please use the updateSubscription() method"),await this.El,new es(this,{skuId:t}).start()}async updateSubscription(t){return ie(null==t?void 0:t.oldSku,"The updateSubscription() method should be used for subscription updates; for new subscriptions please use the subscribe() method"),await this.El,new es(this,t).start()}setOnContributionResponse(t){this.br.setOnContributionResponse(t)}async contribute(t){const e="string"==typeof t?{skuId:t}:t;return await this.El,new es(this,e,We.UI_CONTRIBUTION).start()}async completeDeferredAccountCreation(t=null){return await this.El,new hn(this,t).start()}setOnFlowStarted(t){this.br.setOnFlowStarted(t)}setOnFlowCanceled(t){this.br.setOnFlowCanceled(t)}createButton(t,e){return this.Cl.create(t,e)}attachButton(t,e,i){this.Cl.attach(t,e,i)}attachSmartButton(t,e,i){this.Cl.attachSmartButton(this,t,e,i)}getPropensityModule(){return Promise.resolve(this.yl)}eventManager(){return this.fe}getLastOffersFlow(){return this._l}getEventManager(){return Promise.resolve(this.fe)}getLogger(){return Promise.resolve(this.Il)}setShowcaseEntitlement(t){if(!t||!function(t=de){return"https"===t.protocol||"https:"===t.protocol}(this.win().location)||!Pn(this.win().location.search,!0))return Promise.resolve();const e=(i=t.entitlement,Je[i]||[]);var i;const s=new I;
226s.setIsUserRegistered(t.isUserRegistered),t.subscriptionTimestamp&&s.setSubscriptionTimestamp(Us(function(t){let e;return e=t>=1e14||t<=-1e14?Math.floor(t/1e3):t>=1e11||t<=-3e10?t:Math.floor(1e3*t),e}(t.subscriptionTimestamp)));for(let n=0;n<e.length;n++)this.eventManager().logEvent({eventType:e[n],eventOriginator:l.SHOWCASE_CLIENT,isFromUserAction:!1,additionalParameters:s});return Promise.resolve()}consumeShowcaseEntitlementJwt(t,e){this.entitlementsManager().parseEntitlements({signedEntitlements:t}).consume(e)}showBestAudienceAction(){ee("Not implemented yet")}setPublisherProvidedId(t){this.kt=t}async linkSubscription(t){return await this.El,new Jr(this).start(t)}async linkSubscriptions(t){return await this.El,new Jr(this).startMultipleLinks(t)}async getAvailableInterventions(){return await this.getEntitlements(),this.entitlementsManager().getAvailableInterventions()}}const Zr=We.UI_CONTRIBUTION;class to{constructor(t){this.ae=t,this.ee=t.doc(),this.oe=t.win(),this.ie=t.activities(),this.we=t.entitlementsManager(),this.ue=t.clientConfigManager(),this.ti=t.storage(),ie(this.ue,"InlineCta requires an instance of ClientConfigManager.")}Vs(t,e){const i={origin:oe(this.oe.location.href).origin,configurationId:e,isClosable:"true",calledManually:"false",previewEnabled:"false",publicationId:this.ae.pageConfig().getPublicationId(),ctaMode:"CTA_MODE_INLINE"};return this.ue.shouldForceLangInIframes()&&(i.hl=this.ue.getLanguage()),ye(t,i)}mi(t,e,i){this.we.clear();const s=t.getSwgUserToken();s&&this.ti.set(xt,s,!0),t.getAlreadyCompleted()&&(this.Ol(i),li(e,this.ue.getLanguage(),this.ae));const n=Date.now().toString();this.ti.set(Lt,n,!1),this.we.getEntitlements()}Ol(t){t.firstChild&&t.removeChild(t.firstChild)}async Nl(t,e,i){const s=t.getAttribute("rrm-inline-cta");if(!s)return;const n=e.find((t=>t.configurationId===s));if(!n)return;if(n.type===pt.TYPE_REWARDED_AD||n.type===pt.TYPE_BYO_CTA)return;const r=pe[n.type],o=n.type===pt.TYPE_CONTRIBUTION?ui(i,this.ue,this.ae.pageConfig(),!0):this.Vs(r,s),a=n.type===pt.TYPE_CONTRIBUTION?Se({productId:this.ae.pageConfig().getProductId(),publicationId:this.ae.pageConfig().getPublicationId(),productType:We.UI_CONTRIBUTION,list:"default",skus:null,isClosable:!1,supportsEventManager:!0}):Se({supportsEventManager:!0,productType:Zr}),h=new Ge(this.oe,this.ie,o,a);Vt(h.getElement(),{width:"100%"}),h.on(f,(e=>this.mi(e,n.type,t))),h.on(D,(t=>hi(t,this.ae,h,s))),t.appendChild(h.getElement()),await h.init()}async attachInlineCtasWithAttribute(){var t,e;const i=Array.from(this.ee.getWin().document.querySelectorAll("div[rrm-inline-cta]"));if(0===i.length)return;const[s,n,r]=await Promise.all([this.ue.getClientConfig(),this.we.getEntitlements(),this.we.getArticle()]);if(!(null==(t=s.uiPredicates)?void 0:t.canDisplayAutoPrompt)||!r||n.enablesThis())return;const o=null==(e=r.audienceActions)?void 0:e.actions;if(o&&0!==o.length)for(const a of i)this.Nl(a,o,s)}}class eo{constructor(t){this.Al=null,this.vl=null,this.ee=cn(t),this.Rl=new Promise((t=>{this.vl=t}))}writeConfigWhenReady(t){return this.Al=t,this.ee.whenReady().then((()=>{this.Pl()})),this.Rl}Pl(){var t,e,i,s,n,r,o,a,h;if(!this.vl)return;const l={productID:null==(t=this.Al)?void 0:t.isPartOfProductId,"@type":null==(e=this.Al)?void 0:e.isPartOfType},u={"@context":"http://schema.org","@type":null==(i=this.Al)?void 0:i.type,isAccessibleForFree:null==(s=this.Al)?void 0:s.isAccessibleForFree,isPartOf:l},c=this.ee.getRootNode().querySelectorAll('script[type="application/ld+json"]');for(let p=0;p<c.length;p++){const t=c[p];if(t.textContent){const e=Ki(t.textContent);if(!e)continue;let i;return i=Array.isArray(e)?e[0]:e,i["@type"]=this.xl(i["@type"],null==(n=this.Al)?void 0:n.type),i.isAccessibleForFree=i.isAccessibleForFree||(null==(r=this.Al)?void 0:r.isAccessibleForFree),i.isPartOf?(i.isPartOf["@type"]=this.xl(i.isPartOf["@type"],null==(o=this.Al)?void 0:o.isPartOfType),i.isPartOf.productID=i.isPartOf.productID||(null==(a=this.Al)?void 0:a.isPartOfProductId)):i.isPartOf=l,t.textContent=JSON.stringify(e),this.vl(),void(this.vl=null)}}const d=jt(this.ee.getWin().document,"script",{type:"application/ld+json"},JSON.stringify(u));null==(h=this.ee.getHead())||h.appendChild(d),this.vl(),this.vl=null}xl(t,e){if(!t&&!e)return[];if(!t)return e;if(!e)return t;const i=this.Ia(t),s=this.Ia(e),n=i.concat(s.filter((t=>i.indexOf(t)<0)));return 1==n.length?n.pop():n}Ia(t){return Array.isArray(t)?t:[t]}}const io="SWG_BASIC",so="CHECK_ENTITLEMENTS";class no{constructor(t){this.Ll=!1,this.Ml=null,this.kl=null,this.Dl=null,this.xo=!0,this.Bo={},this.ml=Date.now(),this.ee=cn(t),this.Ul=new Promise((t=>{this.Ml=t}))}Gl(t){return this.Bo.publisherProvidedId=this.kt,this.Ll||!t||this.kl?t&&this.Dl&&this.Dl.check():(this.Ll=!0,this.Dl=new $n(this.ee),this.Dl.resolve
226Config().then((t=>{this.Dl=null,this.Ml(new ro(this.ee,t,{configPromise:this.Ul.then(),enableDefaultMeteringHandler:this.xo},this.Bo,this.Nr,this.ml)),this.Ml=null}),(t=>{this.Ml(Promise.reject(t)),this.Ml=null}))),this.Ul}async jl(t){this.kl=new eo(this.ee),await this.kl.writeConfigWhenReady(t),this.kl=null,this.Gl(!0)}init({type:t,isAccessibleForFree:e,isPartOfType:i,isPartOfProductId:s,clientOptions:n,autoPromptType:r,alwaysShow:o=!1,disableDefaultMeteringHandler:a=!1,publisherProvidedId:h}){this.xo=!a,this.kt=h;const l=this.Fl(s);this.jl({type:t,isAccessibleForFree:null!=e?e:l,isPartOfType:i,isPartOfProductId:s});const u=this.ee.getRootElement().lang;this.Nr=Object.assign({lang:u},n,{forceLangInIframes:!!u||!!(null==n?void 0:n.lang)});let c=e;l&&(null!=c||(c=!0)),this.setupAndShowAutoPrompt({autoPromptType:r,alwaysShow:o,isClosable:c,contentType:this.zl(null!=e?e:l)}),this.setOnLoginRequest(),this.processEntitlements()}async setOnEntitlementsResponse(t){(await this.Gl(!1)).setOnEntitlementsResponse(t)}async setOnPaymentResponse(t){(await this.Gl(!1)).setOnPaymentResponse(t)}async setOnLoginRequest(){(await this.Gl(!1)).setOnLoginRequest()}async setupAndShowAutoPrompt(t){(await this.Gl(!1)).setupAndShowAutoPrompt(t)}async dismissSwgUI(){(await this.Gl(!1)).dismissSwgUI()}async setupButtons(){(await this.Gl(!1)).setupButtons()}async setupInlineCta(){(await this.Gl(!1)).setupInlineCta()}async processEntitlements(){(await this.Gl(!1)).processEntitlements()}Fl(t){return t.endsWith(":openaccess")}zl(t){return t?V.OPEN:V.CLOSED}}class ro{constructor(t,e,i={},s,n,r=0){this.ml=r,this.ee=cn(t),this.oe=this.ee.getWin(),i.configPromise||(i.configPromise=Promise.resolve()),i.fetcher=i.fetcher||new me(this.oe),i.enableGoogleAnalytics=!0,this._e=i.fetcher,this.Bl=new Xr(t,e,i,s,n,r),this.entitlementsManager().blockNextToast(),e.isLocked()&&this.entitlementsManager().enableMeteredByGoogle(),this.Wl((()=>{this.dismissSwgUI(),this.Bl.showOffers({isClosable:!0})})),this.Bl.start(),this.Bl.clientConfigManager().fetchClientConfig(this.Bl.getEntitlements()),this.Vl=new Me(this,this._e),this.Vl.start(),this.Yl=new Mi(this,this.Bl),this.ql=new to(this),this.Cl=new Fi(this.ee,Promise.resolve(this.Bl)),this.Cl.init()}configuredClassicRuntime(){return this.Bl}creationTimestamp(){return this.ml}doc(){return this.ee}win(){return this.oe}config(){return this.Bl.config()}pageConfig(){return this.Bl.pageConfig()}activities(){return this.Bl.activities()}payClient(){return this.Bl.payClient()}dialogManager(){return this.Bl.dialogManager()}entitlementsManager(){return this.Bl.entitlementsManager()}callbacks(){return this.Bl.callbacks()}storage(){return this.Bl.storage()}analytics(){return this.Bl.analytics()}jserror(){return this.Bl.jserror()}eventManager(){return this.Bl.eventManager()}clientConfigManager(){return this.Bl.clientConfigManager()}init(){}setOnEntitlementsResponse(t){this.Bl.setOnEntitlementsResponse(t)}setOnPaymentResponse(t){this.Bl.setOnPaymentResponse(t)}setOnLoginRequest(){this.Bl.setOnLoginRequest((()=>{const t=this.pageConfig().getPublicationId(),e=Se({publicationId:t});this.activities().open(so,ye("/checkentitlements",{publicationId:t}),"_blank",e,{width:600,height:600})}))}processEntitlements(){this.activities().onResult(so,this.entitlementsResponseHandler.bind(this))}async entitlementsResponseHandler(t){const e=await De(t,be(),!0,!1),i=e.jwt;if(i){const t=this.Yl.getLastAudienceActionFlow();t instanceof xe?t.close():this.Bl.closeDialog(),this.entitlementsManager().pushNextEntitlements(i);const s=e.usertoken;s&&this.storage().set(xt,s,!0),new $t(this,ye("/toastiframe",{flavor:"basic"})).open()}else{const t=this.Bl.getLastOffersFlow();if(t)return void t.showNoEntitlementFoundToast();const e=this.Bl.getLastContributionsFlow();if(e)return void e.showNoEntitlementFoundToast();const i=this.entitlementsManager().getLastMeterToast();if(i)return void i.showNoEntitlementFoundToast();const s=this.Yl.getLastAudienceActionFlow();if(s)return void s.showNoEntitlementFoundToast();const n=this.clientConfigManager().getLanguage(),r=Pe(It,n);new $t(this,ye("/toastiframe",{flavor:"custom",customText:r})).open()}}setupAndShowAutoPrompt(t){return this.Yl.showAutoPrompt(t)}dismissSwgUI(){this.dialogManager().completeAll()}async setupButtons(){const t=await this.clientConfigManager().shouldEnableButton();
226this.Cl.attachButtonsWithAttribute("swg-standard-button",[Gi.SUBSCRIPTION,Gi.CONTRIBUTION],{theme:this.clientConfigManager().getTheme(),lang:this.clientConfigManager().getLanguage(),enable:!!t},{[Gi.SUBSCRIPTION]:()=>{this.Bl.showOffers({isClosable:!0})},[Gi.CONTRIBUTION]:()=>{this.Bl.showContributionOptions({isClosable:!0})}})}async setupInlineCta(){await this.entitlementsManager().getExperimentConfigFlags().then((t=>t.includes(r.INLINE_CTA_EXPERIMENT)))&&this.ql.attachInlineCtasWithAttribute()}Wl(t){this.callbacks().setOnOffersFlowRequest(t)}}te("BasicSubscriptions Runtime: ".concat(i)),function(t){if(t[io]&&!Array.isArray(t[io]))return;const e=new no(t),i=function(t){return{init:t.init.bind(t),setOnEntitlementsResponse:t.setOnEntitlementsResponse.bind(t),setOnPaymentResponse:t.setOnPaymentResponse.bind(t),setOnLoginRequest:t.setOnLoginRequest.bind(t),setupAndShowAutoPrompt:t.setupAndShowAutoPrompt.bind(t),dismissSwgUI:t.dismissSwgUI.bind(t)}}(e);async function s(t){t&&(await 0,t(i))}const n=[].concat(t[io]);for(const r of n)s(r);t[io]={push:s},e.setupButtons(),e.setupInlineCta()}(self)}(); 227//# sourceMappingURL=swg-basic.js.map 228 })();
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.