{"version":3,"file":"swg-basic.js","sources":["src/constants.ts","src/proto/api_messages.ts","src/api/basic-subscriptions.ts","src/utils/assets.ts","src/runtime/audience-action-local-ui.ts","src/api/intervention-type.ts","src/i18n/swg-strings.ts","src/utils/constants.ts","src/utils/dom.ts","src/utils/style.ts","src/utils/animation.ts","src/ui/toast.ts","src/utils/errors.ts","src/utils/log.ts","src/utils/url.ts","src/runtime/fetcher.ts","src/runtime/services.ts","../node_modules/safevalues/dist/mjs/internals/secrets.js","../node_modules/safevalues/dist/mjs/internals/trusted_types.js","../node_modules/safevalues/dist/mjs/internals/html_impl.js","../node_modules/safevalues/dist/mjs/builders/html_builders.js","src/utils/i18n.ts","src/runtime/audience-action-local-flow.ts","src/runtime/audience-activity-listener.ts","src/runtime/experiment-flags.ts","src/components/view.ts","src/utils/activity-utils.ts","src/ui/activity-iframe-view.ts","src/api/logger-api.ts","src/api/subscriptions.ts","src/runtime/event-type-mapping.ts","src/utils/types.ts","src/runtime/google-analytics-event-listener.ts","src/runtime/audience-action-flow.ts","src/api/action-orchestration.ts","src/runtime/mini-prompt-api.ts","src/runtime/experiments.ts","src/runtime/storage.ts","src/runtime/auto-prompt-manager.ts","src/runtime/smart-button-api.ts","src/runtime/button-api.ts","src/utils/bytes.ts","src/utils/json.ts","src/utils/jwt.ts","src/api/subscribe-response.ts","src/api/user-data.ts","src/runtime/pay-flow.ts","src/runtime/offers-flow.ts","../node_modules/web-activities/activity-ports.js","src/components/activities.ts","src/api/client-event-manager-api.ts","src/runtime/client-event-manager.ts","src/utils/string.ts","src/utils/date-utils.ts","src/runtime/analytics-service.ts","src/utils/random.ts","src/runtime/callbacks.ts","src/model/attribution-params.ts","src/model/auto-prompt-config.ts","src/model/client-config.ts","src/runtime/client-config-manager.ts","src/runtime/contributions-flow.ts","src/ui/ui-css.ts","src/api/deferred-account-creation.ts","src/runtime/deferred-account-flow.ts","src/utils/document-ready.ts","src/model/doc.ts","src/components/friendly-iframe.ts","src/components/graypane.ts","src/ui/loading-view.ts","src/components/dialog.ts","src/components/dialog-manager.ts","src/api/available-intervention.ts","src/api/entitlements.ts","src/api/metering.ts","src/runtime/meter-toast-api.ts","src/runtime/extended-access/utils.ts","src/runtime/entitlements-manager.ts","src/runtime/jserror.ts","src/runtime/link-accounts-flow.ts","src/runtime/logger.ts","src/runtime/login-notification-api.ts","src/runtime/login-prompt-api.ts","src/runtime/offers-api.ts","src/model/page-config.ts","src/model/page-config-resolver.ts","../third_party/gpay/src/constants.js","../third_party/gpay/src/post_message_service.js","../third_party/gpay/src/pay_frame_helper.js","../third_party/gpay/src/payments_request_delegate.js","../third_party/gpay/src/graypane.js","../third_party/gpay/src/validator.js","../third_party/gpay/src/payments_web_activity_delegate.js","../third_party/gpay/src/element_injector.js","../third_party/gpay/src/upi_handler.js","../third_party/gpay/third_party/random_uuid/Random.uuid.js","../third_party/gpay/src/payjs_async.js","../third_party/gpay/src/utils.js","src/utils/preconnect.ts","src/runtime/pay-client.ts","src/api/propensity-api.ts","src/runtime/propensity-server.ts","src/runtime/propensity.ts","src/runtime/subscription-linking-flow.ts","src/runtime/wait-for-subscription-lookup-api.ts","src/runtime/runtime.ts","src/model/page-config-writer.ts","src/runtime/basic-runtime.ts","src/basic-main.ts"],"sourcesContent":["/**\n * Copyright 2018 The Subscribe with Google Authors. All Rights Reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS-IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/**\n * This file contains a set of variables the compiler will overwrite.\n * The initial values are just placeholders for tests.\n */\n\nexport const FRONTEND = 'https://news.google.com';\nexport const PAY_ENVIRONMENT = 'TEST';\nexport const PLAY_ENVIRONMENT = 'STAGING';\nexport const FRONTEND_CACHE = 'nocache';\nexport const INTERNAL_RUNTIME_VERSION = '0.0.0';\nexport const ASSETS = '/assets';\nexport const ADS_SERVER = 'https://pubads.g.doubleclick.net';\nexport const EXPERIMENTS = '';\n","/**\n * Copyright 2018 The Subscribe with Google Authors. All Rights Reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS-IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/**\n * @fileoverview Protos for SwG client/iframe messaging\n * Auto generated, do not edit\n */\n\n/* tslint:disable:enforce-name-casing */\n/* tslint:disable:strip-private-property-underscore */\n\n// clang-format off\n\n/** Carries information relating to RRM. */\nexport interface Message {\n label(): string;\n\n toArray(includeLabel?: boolean): unknown[];\n}\n\n/** Constructor for a message that carries information relating to RRM. */\ninterface MessageConstructor {\n new (data?: unknown[], includesLabel?: boolean): Message;\n}\n\n/** */\nexport enum ActionType {\n ACTION_TYPE_UNKNOWN = 0,\n ACTION_TYPE_RELOAD_PAGE = 1,\n ACTION_TYPE_UPDATE_COUNTER = 2,\n}\n\n/** */\nexport enum AnalyticsEvent {\n UNKNOWN = 0,\n IMPRESSION_PAYWALL = 1,\n IMPRESSION_AD = 2,\n IMPRESSION_OFFERS = 3,\n IMPRESSION_SUBSCRIBE_BUTTON = 4,\n IMPRESSION_SMARTBOX = 5,\n IMPRESSION_SWG_BUTTON = 6,\n IMPRESSION_CLICK_TO_SHOW_OFFERS = 7,\n IMPRESSION_CLICK_TO_SHOW_OFFERS_OR_ALREADY_SUBSCRIBED = 8,\n IMPRESSION_SUBSCRIPTION_COMPLETE = 9,\n IMPRESSION_ACCOUNT_CHANGED = 10,\n IMPRESSION_PAGE_LOAD = 11,\n IMPRESSION_LINK = 12,\n IMPRESSION_SAVE_SUBSCR_TO_GOOGLE = 13,\n IMPRESSION_GOOGLE_UPDATED = 14,\n IMPRESSION_SHOW_OFFERS_SMARTBOX = 15,\n IMPRESSION_SHOW_OFFERS_SWG_BUTTON = 16,\n IMPRESSION_SELECT_OFFER_SMARTBOX = 17,\n IMPRESSION_SELECT_OFFER_SWG_BUTTON = 18,\n IMPRESSION_SHOW_CONTRIBUTIONS_SWG_BUTTON = 19,\n IMPRESSION_SELECT_CONTRIBUTION_SWG_BUTTON = 20,\n IMPRESSION_METER_TOAST = 21,\n IMPRESSION_REGWALL = 22,\n IMPRESSION_SHOWCASE_REGWALL = 23,\n IMPRESSION_SWG_SUBSCRIPTION_MINI_PROMPT = 24,\n IMPRESSION_SWG_CONTRIBUTION_MINI_PROMPT = 25,\n IMPRESSION_CONTRIBUTION_OFFERS = 26,\n IMPRESSION_TWG_COUNTER = 27,\n IMPRESSION_TWG_SITE_SUPPORTER_WALL = 28,\n IMPRESSION_TWG_PUBLICATION = 29,\n IMPRESSION_TWG_STATIC_BUTTON = 30,\n IMPRESSION_TWG_DYNAMIC_BUTTON = 31,\n IMPRESSION_TWG_STICKER_SELECTION_SCREEN = 32,\n IMPRESSION_TWG_PUBLICATION_NOT_SET_UP = 33,\n IMPRESSION_REGWALL_OPT_IN = 34,\n IMPRESSION_NEWSLETTER_OPT_IN = 35,\n IMPRESSION_SUBSCRIPTION_OFFERS_ERROR = 36,\n IMPRESSION_CONTRIBUTION_OFFERS_ERROR = 37,\n IMPRESSION_TWG_SHORTENED_STICKER_FLOW = 38,\n IMPRESSION_SUBSCRIPTION_LINKING_LOADING = 39,\n IMPRESSION_SUBSCRIPTION_LINKING_COMPLETE = 40,\n IMPRESSION_SUBSCRIPTION_LINKING_ERROR = 41,\n IMPRESSION_SURVEY = 42,\n IMPRESSION_REGWALL_ERROR = 43,\n IMPRESSION_NEWSLETTER_ERROR = 44,\n IMPRESSION_SURVEY_ERROR = 45,\n IMPRESSION_METER_TOAST_ERROR = 46,\n IMPRESSION_MINI_PROMPT = 47,\n IMPRESSION_MINI_PROMPT_ERROR = 48,\n IMPRESSION_REWARDED_AD = 49,\n IMPRESSION_BYOP_NEWSLETTER_OPT_IN = 50,\n IMPRESSION_REWARDED_AD_ERROR = 51,\n IMPRESSION_HOSTED_PAGE_SUBSCRIPTION_OFFERS = 52,\n IMPRESSION_HOSTED_PAGE_CONTRIBUTION_OFFERS = 53,\n IMPRESSION_HOSTED_PAGE_SUBSCRIPTION_OFFERS_ERROR = 54,\n IMPRESSION_HOSTED_PAGE_CONTRIBUTION_OFFERS_ERROR = 55,\n IMPRESSION_BYO_CTA = 56,\n IMPRESSION_BYO_CTA_ERROR = 57,\n ACTION_SUBSCRIBE = 1000,\n ACTION_PAYMENT_COMPLETE = 1001,\n ACTION_ACCOUNT_CREATED = 1002,\n ACTION_ACCOUNT_ACKNOWLEDGED = 1003,\n ACTION_SUBSCRIPTIONS_LANDING_PAGE = 1004,\n ACTION_PAYMENT_FLOW_STARTED = 1005,\n ACTION_OFFER_SELECTED = 1006,\n ACTION_SWG_BUTTON_CLICK = 1007,\n ACTION_VIEW_OFFERS = 1008,\n ACTION_ALREADY_SUBSCRIBED = 1009,\n ACTION_NEW_DEFERRED_ACCOUNT = 1010,\n ACTION_LINK_CONTINUE = 1011,\n ACTION_LINK_CANCEL = 1012,\n ACTION_GOOGLE_UPDATED_CLOSE = 1013,\n ACTION_USER_CANCELED_PAYFLOW = 1014,\n ACTION_SAVE_SUBSCR_TO_GOOGLE_CONTINUE = 1015,\n ACTION_SAVE_SUBSCR_TO_GOOGLE_CANCEL = 1016,\n ACTION_SWG_BUTTON_SHOW_OFFERS_CLICK = 1017,\n ACTION_SWG_BUTTON_SELECT_OFFER_CLICK = 1018,\n ACTION_SWG_BUTTON_SHOW_CONTRIBUTIONS_CLICK = 1019,\n ACTION_SWG_BUTTON_SELECT_CONTRIBUTION_CLICK = 1020,\n ACTION_USER_CONSENT_DEFERRED_ACCOUNT = 1021,\n ACTION_USER_DENY_DEFERRED_ACCOUNT = 1022,\n ACTION_DEFERRED_ACCOUNT_REDIRECT = 1023,\n ACTION_GET_ENTITLEMENTS = 1024,\n ACTION_METER_TOAST_SUBSCRIBE_CLICK = 1025,\n ACTION_METER_TOAST_EXPANDED = 1026,\n ACTION_METER_TOAST_CLOSED_BY_ARTICLE_INTERACTION = 1027,\n ACTION_METER_TOAST_CLOSED_BY_SWIPE_DOWN = 1028,\n ACTION_METER_TOAST_CLOSED_BY_X_CLICKED = 1029,\n ACTION_SWG_SUBSCRIPTION_MINI_PROMPT_CLICK = 1030,\n ACTION_SWG_CONTRIBUTION_MINI_PROMPT_CLICK = 1031,\n ACTION_SWG_SUBSCRIPTION_MINI_PROMPT_CLOSE = 1032,\n ACTION_SWG_CONTRIBUTION_MINI_PROMPT_CLOSE = 1033,\n ACTION_CONTRIBUTION_OFFER_SELECTED = 1034,\n ACTION_SHOWCASE_REGWALL_GSI_CLICK = 1035,\n ACTION_SHOWCASE_REGWALL_EXISTING_ACCOUNT_CLICK = 1036,\n ACTION_SUBSCRIPTION_OFFERS_CLOSED = 1037,\n ACTION_CONTRIBUTION_OFFERS_CLOSED = 1038,\n ACTION_TWG_STATIC_CTA_CLICK = 1039,\n ACTION_TWG_DYNAMIC_CTA_CLICK = 1040,\n ACTION_TWG_SITE_LEVEL_SUPPORTER_WALL_CTA_CLICK = 1041,\n ACTION_TWG_DIALOG_SUPPORTER_WALL_CTA_CLICK = 1042,\n ACTION_TWG_COUNTER_CLICK = 1043,\n ACTION_TWG_SITE_SUPPORTER_WALL_ALL_THANKS_CLICK = 1044,\n ACTION_TWG_PAID_STICKER_SELECTED_SCREEN_CLOSE_CLICK = 1045,\n ACTION_TWG_PAID_STICKER_SELECTION_CLICK = 1046,\n ACTION_TWG_FREE_STICKER_SELECTION_CLICK = 1047,\n ACTION_TWG_MINI_SUPPORTER_WALL_CLICK = 1048,\n ACTION_TWG_CREATOR_BENEFIT_CLICK = 1049,\n ACTION_TWG_FREE_TRANSACTION_START_NEXT_BUTTON_CLICK = 1050,\n ACTION_TWG_PAID_TRANSACTION_START_NEXT_BUTTON_CLICK = 1051,\n ACTION_TWG_STICKER_SELECTION_SCREEN_CLOSE_CLICK = 1052,\n ACTION_TWG_ARTICLE_LEVEL_SUPPORTER_WALL_CTA_CLICK = 1053,\n ACTION_REGWALL_OPT_IN_BUTTON_CLICK = 1054,\n ACTION_REGWALL_ALREADY_OPTED_IN_CLICK = 1055,\n ACTION_NEWSLETTER_OPT_IN_BUTTON_CLICK = 1056,\n ACTION_NEWSLETTER_ALREADY_OPTED_IN_CLICK = 1057,\n ACTION_REGWALL_OPT_IN_CLOSE = 1058,\n ACTION_NEWSLETTER_OPT_IN_CLOSE = 1059,\n ACTION_SHOWCASE_REGWALL_SIWG_CLICK = 1060,\n ACTION_TWG_CHROME_APP_MENU_ENTRY_POINT_CLICK = 1061,\n ACTION_TWG_DISCOVER_FEED_MENU_ENTRY_POINT_CLICK = 1062,\n ACTION_SHOWCASE_REGWALL_3P_BUTTON_CLICK = 1063,\n ACTION_SUBSCRIPTION_OFFERS_RETRY = 1064,\n ACTION_CONTRIBUTION_OFFERS_RETRY = 1065,\n ACTION_TWG_SHORTENED_STICKER_FLOW_STICKER_SELECTION_CLICK = 1066,\n ACTION_INITIATE_UPDATED_SUBSCRIPTION_LINKING = 1067,\n ACTION_SURVEY_SUBMIT_CLICK = 1068,\n ACTION_SURVEY_CLOSED = 1069,\n ACTION_SURVEY_DATA_TRANSFER = 1070,\n ACTION_REGWALL_PAGE_REFRESH = 1071,\n ACTION_NEWSLETTER_PAGE_REFRESH = 1072,\n ACTION_SURVEY_PAGE_REFRESH = 1073,\n ACTION_METER_TOAST_PAGE_REFRESH = 1074,\n ACTION_MINI_PROMPT_INTERACTION = 1075,\n ACTION_SURVEY_PREVIOUS_BUTTON_CLICK = 1076,\n ACTION_SURVEY_NEXT_BUTTON_CLICK = 1077,\n ACTION_REWARDED_AD_VIEW = 1078,\n ACTION_REWARDED_AD_CLOSE = 1079,\n ACTION_REWARDED_AD_CLOSE_AD = 1080,\n ACTION_REWARDED_AD_SIGN_IN = 1081,\n ACTION_REWARDED_AD_SUPPORT = 1082,\n ACTION_BACK_TO_HOMEPAGE = 1083,\n ACTION_BYOP_NEWSLETTER_OPT_IN_CLOSE = 1084,\n ACTION_BYOP_NEWSLETTER_OPT_IN_SUBMIT = 1085,\n ACTION_SUBSCRIPTION_LINKING_CLOSE = 1086,\n ACTION_BYO_CTA_CLOSE = 1087,\n ACTION_BYO_CTA_BUTTON_CLICK = 1088,\n EVENT_PAYMENT_FAILED = 2000,\n EVENT_REGWALL_OPT_IN_FAILED = 2001,\n EVENT_NEWSLETTER_OPT_IN_FAILED = 2002,\n EVENT_REGWALL_ALREADY_OPT_IN = 2003,\n EVENT_NEWSLETTER_ALREADY_OPT_IN = 2004,\n EVENT_SUBSCRIPTION_LINKING_FAILED = 2005,\n EVENT_SURVEY_ALREADY_SUBMITTED = 2006,\n EVENT_SURVEY_COMPLETION_RECORD_FAILED = 2007,\n EVENT_SURVEY_DATA_TRANSFER_FAILED = 2008,\n EVENT_BYO_CTA_COMPLETION_RECORD_FAILED = 2009,\n EVENT_CUSTOM = 3000,\n EVENT_CONFIRM_TX_ID = 3001,\n EVENT_CHANGED_TX_ID = 3002,\n EVENT_GPAY_NO_TX_ID = 3003,\n EVENT_GPAY_CANNOT_CONFIRM_TX_ID = 3004,\n EVENT_GOOGLE_UPDATED = 3005,\n EVENT_NEW_TX_ID = 3006,\n EVENT_UNLOCKED_BY_SUBSCRIPTION = 3007,\n EVENT_UNLOCKED_BY_METER = 3008,\n EVENT_NO_ENTITLEMENTS = 3009,\n EVENT_HAS_METERING_ENTITLEMENTS = 3010,\n EVENT_OFFERED_METER = 3011,\n EVENT_UNLOCKED_FREE_PAGE = 3012,\n EVENT_INELIGIBLE_PAYWALL = 3013,\n EVENT_UNLOCKED_FOR_CRAWLER = 3014,\n EVENT_TWG_COUNTER_VIEW = 3015,\n EVENT_TWG_SITE_SUPPORTER_WALL_VIEW = 3016,\n EVENT_TWG_STATIC_BUTTON_VIEW = 3017,\n EVENT_TWG_DYNAMIC_BUTTON_VIEW = 3018,\n EVENT_TWG_PRE_TRANSACTION_PRIVACY_SETTING_PRIVATE = 3019,\n EVENT_TWG_POST_TRANSACTION_SETTING_PRIVATE = 3020,\n EVENT_TWG_PRE_TRANSACTION_PRIVACY_SETTING_PUBLIC = 3021,\n EVENT_TWG_POST_TRANSACTION_SETTING_PUBLIC = 3022,\n EVENT_REGWALL_OPTED_IN = 3023,\n EVENT_NEWSLETTER_OPTED_IN = 3024,\n EVENT_SHOWCASE_METERING_INIT = 3025,\n EVENT_DISABLE_MINIPROMPT_DESKTOP = 3026,\n EVENT_SUBSCRIPTION_LINKING_SUCCESS = 3027,\n EVENT_SURVEY_SUBMITTED = 3028,\n EVENT_LINK_ACCOUNT_SUCCESS = 3029,\n EVENT_SAVE_SUBSCRIPTION_SUCCESS = 3030,\n EVENT_SURVEY_DATA_TRANSFER_COMPLETE = 3031,\n EVENT_RUNTIME_IS_READY = 3032,\n EVENT_START_API = 3033,\n EVENT_SHOW_OFFERS_API = 3034,\n EVENT_SHOW_CONTRIBUTION_OPTIONS_API = 3035,\n EVENT_REWARDED_AD_FLOW_INIT = 3048,\n EVENT_REWARDED_AD_READY = 3036,\n EVENT_REWARDED_AD_GPT_MISSING_ERROR = 3037,\n EVENT_REWARDED_AD_CONFIG_ERROR = 3038,\n EVENT_REWARDED_AD_PAGE_ERROR = 3039,\n EVENT_REWARDED_AD_GPT_ERROR = 3040,\n EVENT_REWARDED_AD_GRANTED = 3041,\n EVENT_REWARDED_AD_NOT_FILLED = 3049,\n EVENT_GLOBAL_FREQUENCY_CAP_MET = 3042,\n EVENT_PROMPT_FREQUENCY_CAP_MET = 3043,\n EVENT_ACTION_IMPRESSIONS_STORAGE_KEY_NOT_FOUND_ERROR = 3044,\n EVENT_LOCAL_STORAGE_TIMESTAMPS_PARSING_ERROR = 3052,\n EVENT_FREQUENCY_CAP_CONFIG_NOT_FOUND_ERROR = 3045,\n EVENT_PROMPT_FREQUENCY_CONFIG_NOT_FOUND = 3053,\n EVENT_BYOP_NEWSLETTER_OPT_IN_CONFIG_ERROR = 3046,\n EVENT_BYOP_NEWSLETTER_OPT_IN_CODE_SNIPPET_ERROR = 3047,\n EVENT_SUBSCRIPTION_PAYMENT_COMPLETE = 3050,\n EVENT_CONTRIBUTION_PAYMENT_COMPLETE = 3051,\n EVENT_HOSTED_PAGE_SUBSCRIPTION_PAYMENT_COMPLETE = 3054,\n EVENT_HOSTED_PAGE_CONTRIBUTION_PAYMENT_COMPLETE = 3055,\n EVENT_COMPLETION_COUNT_FOR_REPEATABLE_ACTION_MISSING_ERROR = 3056,\n EVENT_SUBSCRIPTION_STATE = 4000,\n}\n\n/** */\nexport enum EntitlementResult {\n UNKNOWN_ENTITLEMENT_RESULT = 0,\n UNLOCKED_SUBSCRIBER = 1001,\n UNLOCKED_FREE = 1002,\n UNLOCKED_METER = 1003,\n LOCKED_REGWALL = 2001,\n LOCKED_PAYWALL = 2002,\n INELIGIBLE_PAYWALL = 2003,\n}\n\n/** */\nexport enum EntitlementSource {\n UNKNOWN_ENTITLEMENT_SOURCE = 0,\n GOOGLE_SUBSCRIBER_ENTITLEMENT = 1001,\n GOOGLE_SHOWCASE_METERING_SERVICE = 2001,\n SUBSCRIBE_WITH_GOOGLE_METERING_SERVICE = 2002,\n PUBLISHER_ENTITLEMENT = 3001,\n}\n\n/** */\nexport enum EventOriginator {\n UNKNOWN_CLIENT = 0,\n SWG_CLIENT = 1,\n AMP_CLIENT = 2,\n PROPENSITY_CLIENT = 3,\n SWG_SERVER = 4,\n PUBLISHER_CLIENT = 5,\n SHOWCASE_CLIENT = 6,\n}\n\n/** */\nexport enum ReaderSurfaceType {\n READER_SURFACE_TYPE_UNSPECIFIED = 0,\n READER_SURFACE_WORDPRESS = 1,\n READER_SURFACE_CHROME = 2,\n READER_SURFACE_TENOR = 3,\n}\n\n/** */\nexport class AccountCreationRequest implements Message {\n private complete_: boolean | null;\n\n constructor(data: unknown[] = [], includesLabel = true) {\n const base = includesLabel ? 1 : 0;\n\n this.complete_ = data[base] == null ? null : (data[base] as boolean);\n }\n\n getComplete(): boolean | null {\n return this.complete_;\n }\n\n setComplete(value: boolean): void {\n this.complete_ = value;\n }\n\n toArray(includeLabel = true): unknown[] {\n const arr: unknown[] = [\n this.complete_, // field 1 - complete\n ];\n if (includeLabel) {\n arr.unshift(this.label());\n }\n return arr;\n }\n\n label(): string {\n return 'AccountCreationRequest';\n }\n}\n\n/** */\nexport class ActionRequest implements Message {\n private action_: ActionType | null;\n\n constructor(data: unknown[] = [], includesLabel = true) {\n const base = includesLabel ? 1 : 0;\n\n this.action_ = data[base] == null ? null : (data[base] as ActionType);\n }\n\n getAction(): ActionType | null {\n return this.action_;\n }\n\n setAction(value: ActionType): void {\n this.action_ = value;\n }\n\n toArray(includeLabel = true): unknown[] {\n const arr: unknown[] = [\n this.action_, // field 1 - action\n ];\n if (includeLabel) {\n arr.unshift(this.label());\n }\n return arr;\n }\n\n label(): string {\n return 'ActionRequest';\n }\n}\n\n/** */\nexport class AlreadySubscribedResponse implements Message {\n private subscriberOrMember_: boolean | null;\n private linkRequested_: boolean | null;\n\n constructor(data: unknown[] = [], includesLabel = true) {\n const base = includesLabel ? 1 : 0;\n\n this.subscriberOrMember_ =\n data[base] == null ? null : (data[base] as boolean);\n\n this.linkRequested_ =\n data[1 + base] == null ? null : (data[1 + base] as boolean);\n }\n\n getSubscriberOrMember(): boolean | null {\n return this.subscriberOrMember_;\n }\n\n setSubscriberOrMember(value: boolean): void {\n this.subscriberOrMember_ = value;\n }\n\n getLinkRequested(): boolean | null {\n return this.linkRequested_;\n }\n\n setLinkRequested(value: boolean): void {\n this.linkRequested_ = value;\n }\n\n toArray(includeLabel = true): unknown[] {\n const arr: unknown[] = [\n this.subscriberOrMember_, // field 1 - subscriber_or_member\n this.linkRequested_, // field 2 - link_requested\n ];\n if (includeLabel) {\n arr.unshift(this.label());\n }\n return arr;\n }\n\n label(): string {\n return 'AlreadySubscribedResponse';\n }\n}\n\n/** */\nexport class AnalyticsContext implements Message {\n private embedderOrigin_: string | null;\n private transactionId_: string | null;\n private referringOrigin_: string | null;\n private utmSource_: string | null;\n private utmCampaign_: string | null;\n private utmMedium_: string | null;\n private sku_: string | null;\n private readyToPay_: boolean | null;\n private label_: string[] | null;\n private clientVersion_: string | null;\n private url_: string | null;\n private clientTimestamp_: Timestamp | null;\n private readerSurfaceType_: ReaderSurfaceType | null;\n private integrationVersion_: string | null;\n private pageLoadBeginTimestamp_: Timestamp | null;\n private loadEventStartDelay_: Duration | null;\n private runtimeCreationTimestamp_: Timestamp | null;\n private isLockedContent_: boolean | null;\n private urlFromMarkup_: string | null;\n\n constructor(data: unknown[] = [], includesLabel = true) {\n const base = includesLabel ? 1 : 0;\n\n this.embedderOrigin_ = data[base] == null ? null : (data[base] as string);\n\n this.transactionId_ =\n data[1 + base] == null ? null : (data[1 + base] as string);\n\n this.referringOrigin_ =\n data[2 + base] == null ? null : (data[2 + base] as string);\n\n this.utmSource_ =\n data[3 + base] == null ? null : (data[3 + base] as string);\n\n this.utmCampaign_ =\n data[4 + base] == null ? null : (data[4 + base] as string);\n\n this.utmMedium_ =\n data[5 + base] == null ? null : (data[5 + base] as string);\n\n this.sku_ = data[6 + base] == null ? null : (data[6 + base] as string);\n\n this.readyToPay_ =\n data[7 + base] == null ? null : (data[7 + base] as boolean);\n\n this.label_ = (data[8 + base] as string[]) || [];\n\n this.clientVersion_ =\n data[9 + base] == null ? null : (data[9 + base] as string);\n\n this.url_ = data[10 + base] == null ? null : (data[10 + base] as string);\n\n this.clientTimestamp_ =\n data[11 + base] == null\n ? null\n : new Timestamp(data[11 + base] as unknown[], includesLabel);\n\n this.readerSurfaceType_ =\n data[12 + base] == null ? null : (data[12 + base] as ReaderSurfaceType);\n\n this.integrationVersion_ =\n data[13 + base] == null ? null : (data[13 + base] as string);\n\n this.pageLoadBeginTimestamp_ =\n data[14 + base] == null\n ? null\n : new Timestamp(data[14 + base] as unknown[], includesLabel);\n\n this.loadEventStartDelay_ =\n data[15 + base] == null\n ? null\n : new Duration(data[15 + base] as unknown[], includesLabel);\n\n this.runtimeCreationTimestamp_ =\n data[16 + base] == null\n ? null\n : new Timestamp(data[16 + base] as unknown[], includesLabel);\n\n this.isLockedContent_ =\n data[17 + base] == null ? null : (data[17 + base] as boolean);\n\n this.urlFromMarkup_ =\n data[18 + base] == null ? null : (data[18 + base] as string);\n }\n\n getEmbedderOrigin(): string | null {\n return this.embedderOrigin_;\n }\n\n setEmbedderOrigin(value: string): void {\n this.embedderOrigin_ = value;\n }\n\n getTransactionId(): string | null {\n return this.transactionId_;\n }\n\n setTransactionId(value: string): void {\n this.transactionId_ = value;\n }\n\n getReferringOrigin(): string | null {\n return this.referringOrigin_;\n }\n\n setReferringOrigin(value: string): void {\n this.referringOrigin_ = value;\n }\n\n getUtmSource(): string | null {\n return this.utmSource_;\n }\n\n setUtmSource(value: string): void {\n this.utmSource_ = value;\n }\n\n getUtmCampaign(): string | null {\n return this.utmCampaign_;\n }\n\n setUtmCampaign(value: string): void {\n this.utmCampaign_ = value;\n }\n\n getUtmMedium(): string | null {\n return this.utmMedium_;\n }\n\n setUtmMedium(value: string): void {\n this.utmMedium_ = value;\n }\n\n getSku(): string | null {\n return this.sku_;\n }\n\n setSku(value: string): void {\n this.sku_ = value;\n }\n\n getReadyToPay(): boolean | null {\n return this.readyToPay_;\n }\n\n setReadyToPay(value: boolean): void {\n this.readyToPay_ = value;\n }\n\n getLabelList(): string[] | null {\n return this.label_;\n }\n\n setLabelList(value: string[]): void {\n this.label_ = value;\n }\n\n getClientVersion(): string | null {\n return this.clientVersion_;\n }\n\n setClientVersion(value: string): void {\n this.clientVersion_ = value;\n }\n\n getUrl(): string | null {\n return this.url_;\n }\n\n setUrl(value: string): void {\n this.url_ = value;\n }\n\n getClientTimestamp(): Timestamp | null {\n return this.clientTimestamp_;\n }\n\n setClientTimestamp(value: Timestamp): void {\n this.clientTimestamp_ = value;\n }\n\n getReaderSurfaceType(): ReaderSurfaceType | null {\n return this.readerSurfaceType_;\n }\n\n setReaderSurfaceType(value: ReaderSurfaceType): void {\n this.readerSurfaceType_ = value;\n }\n\n getIntegrationVersion(): string | null {\n return this.integrationVersion_;\n }\n\n setIntegrationVersion(value: string): void {\n this.integrationVersion_ = value;\n }\n\n getPageLoadBeginTimestamp(): Timestamp | null {\n return this.pageLoadBeginTimestamp_;\n }\n\n setPageLoadBeginTimestamp(value: Timestamp): void {\n this.pageLoadBeginTimestamp_ = value;\n }\n\n getLoadEventStartDelay(): Duration | null {\n return this.loadEventStartDelay_;\n }\n\n setLoadEventStartDelay(value: Duration): void {\n this.loadEventStartDelay_ = value;\n }\n\n getRuntimeCreationTimestamp(): Timestamp | null {\n return this.runtimeCreationTimestamp_;\n }\n\n setRuntimeCreationTimestamp(value: Timestamp): void {\n this.runtimeCreationTimestamp_ = value;\n }\n\n getIsLockedContent(): boolean | null {\n return this.isLockedContent_;\n }\n\n setIsLockedContent(value: boolean): void {\n this.isLockedContent_ = value;\n }\n\n getUrlFromMarkup(): string | null {\n return this.urlFromMarkup_;\n }\n\n setUrlFromMarkup(value: string): void {\n this.urlFromMarkup_ = value;\n }\n\n toArray(includeLabel = true): unknown[] {\n const arr: unknown[] = [\n this.embedderOrigin_, // field 1 - embedder_origin\n this.transactionId_, // field 2 - transaction_id\n this.referringOrigin_, // field 3 - referring_origin\n this.utmSource_, // field 4 - utm_source\n this.utmCampaign_, // field 5 - utm_campaign\n this.utmMedium_, // field 6 - utm_medium\n this.sku_, // field 7 - sku\n this.readyToPay_, // field 8 - ready_to_pay\n this.label_, // field 9 - label\n this.clientVersion_, // field 10 - client_version\n this.url_, // field 11 - url\n this.clientTimestamp_ ? this.clientTimestamp_.toArray(includeLabel) : [], // field 12 - client_timestamp\n this.readerSurfaceType_, // field 13 - reader_surface_type\n this.integrationVersion_, // field 14 - integration_version\n this.pageLoadBeginTimestamp_\n ? this.pageLoadBeginTimestamp_.toArray(includeLabel)\n : [], // field 15 - page_load_begin_timestamp\n this.loadEventStartDelay_\n ? this.loadEventStartDelay_.toArray(includeLabel)\n : [], // field 16 - load_event_start_delay\n this.runtimeCreationTimestamp_\n ? this.runtimeCreationTimestamp_.toArray(includeLabel)\n : [], // field 17 - runtime_creation_timestamp\n this.isLockedContent_, // field 18 - is_locked_content\n this.urlFromMarkup_, // field 19 - url_from_markup\n ];\n if (includeLabel) {\n arr.unshift(this.label());\n }\n return arr;\n }\n\n label(): string {\n return 'AnalyticsContext';\n }\n}\n\n/** */\nexport class AnalyticsEventMeta implements Message {\n private eventOriginator_: EventOriginator | null;\n private isFromUserAction_: boolean | null;\n private configurationId_: string | null;\n\n constructor(data: unknown[] = [], includesLabel = true) {\n const base = includesLabel ? 1 : 0;\n\n this.eventOriginator_ =\n data[base] == null ? null : (data[base] as EventOriginator);\n\n this.isFromUserAction_ =\n data[1 + base] == null ? null : (data[1 + base] as boolean);\n\n this.configurationId_ =\n data[2 + base] == null ? null : (data[2 + base] as string);\n }\n\n getEventOriginator(): EventOriginator | null {\n return this.eventOriginator_;\n }\n\n setEventOriginator(value: EventOriginator): void {\n this.eventOriginator_ = value;\n }\n\n getIsFromUserAction(): boolean | null {\n return this.isFromUserAction_;\n }\n\n setIsFromUserAction(value: boolean): void {\n this.isFromUserAction_ = value;\n }\n\n getConfigurationId(): string | null {\n return this.configurationId_;\n }\n\n setConfigurationId(value: string): void {\n this.configurationId_ = value;\n }\n\n toArray(includeLabel = true): unknown[] {\n const arr: unknown[] = [\n this.eventOriginator_, // field 1 - event_originator\n this.isFromUserAction_, // field 2 - is_from_user_action\n this.configurationId_, // field 3 - configuration_id\n ];\n if (includeLabel) {\n arr.unshift(this.label());\n }\n return arr;\n }\n\n label(): string {\n return 'AnalyticsEventMeta';\n }\n}\n\n/** */\nexport class AnalyticsRequest implements Message {\n private context_: AnalyticsContext | null;\n private event_: AnalyticsEvent | null;\n private meta_: AnalyticsEventMeta | null;\n private params_: EventParams | null;\n\n constructor(data: unknown[] = [], includesLabel = true) {\n const base = includesLabel ? 1 : 0;\n\n this.context_ =\n data[base] == null\n ? null\n : new AnalyticsContext(data[base] as unknown[], includesLabel);\n\n this.event_ =\n data[1 + base] == null ? null : (data[1 + base] as AnalyticsEvent);\n\n this.meta_ =\n data[2 + base] == null\n ? null\n : new AnalyticsEventMeta(data[2 + base] as unknown[], includesLabel);\n\n this.params_ =\n data[3 + base] == null\n ? null\n : new EventParams(data[3 + base] as unknown[], includesLabel);\n }\n\n getContext(): AnalyticsContext | null {\n return this.context_;\n }\n\n setContext(value: AnalyticsContext): void {\n this.context_ = value;\n }\n\n getEvent(): AnalyticsEvent | null {\n return this.event_;\n }\n\n setEvent(value: AnalyticsEvent): void {\n this.event_ = value;\n }\n\n getMeta(): AnalyticsEventMeta | null {\n return this.meta_;\n }\n\n setMeta(value: AnalyticsEventMeta): void {\n this.meta_ = value;\n }\n\n getParams(): EventParams | null {\n return this.params_;\n }\n\n setParams(value: EventParams): void {\n this.params_ = value;\n }\n\n toArray(includeLabel = true): unknown[] {\n const arr: unknown[] = [\n this.context_ ? this.context_.toArray(includeLabel) : [], // field 1 - context\n this.event_, // field 2 - event\n this.meta_ ? this.meta_.toArray(includeLabel) : [], // field 3 - meta\n this.params_ ? this.params_.toArray(includeLabel) : [], // field 4 - params\n ];\n if (includeLabel) {\n arr.unshift(this.label());\n }\n return arr;\n }\n\n label(): string {\n return 'AnalyticsRequest';\n }\n}\n\n/** */\nexport class AudienceActivityClientLogsRequest implements Message {\n private event_: AnalyticsEvent | null;\n\n constructor(data: unknown[] = [], includesLabel = true) {\n const base = includesLabel ? 1 : 0;\n\n this.event_ = data[base] == null ? null : (data[base] as AnalyticsEvent);\n }\n\n getEvent(): AnalyticsEvent | null {\n return this.event_;\n }\n\n setEvent(value: AnalyticsEvent): void {\n this.event_ = value;\n }\n\n toArray(includeLabel = true): unknown[] {\n const arr: unknown[] = [\n this.event_, // field 1 - event\n ];\n if (includeLabel) {\n arr.unshift(this.label());\n }\n return arr;\n }\n\n label(): string {\n return 'AudienceActivityClientLogsRequest';\n }\n}\n\n/** */\nexport class CompleteAudienceActionResponse implements Message {\n private swgUserToken_: string | null;\n private actionCompleted_: boolean | null;\n private userEmail_: string | null;\n private alreadyCompleted_: boolean | null;\n private displayName_: string | null;\n private givenName_: string | null;\n private familyName_: string | null;\n\n constructor(data: unknown[] = [], includesLabel = true) {\n const base = includesLabel ? 1 : 0;\n\n this.swgUserToken_ = data[base] == null ? null : (data[base] as string);\n\n this.actionCompleted_ =\n data[1 + base] == null ? null : (data[1 + base] as boolean);\n\n this.userEmail_ =\n data[2 + base] == null ? null : (data[2 + base] as string);\n\n this.alreadyCompleted_ =\n data[3 + base] == null ? null : (data[3 + base] as boolean);\n\n this.displayName_ =\n data[4 + base] == null ? null : (data[4 + base] as string);\n\n this.givenName_ =\n data[5 + base] == null ? null : (data[5 + base] as string);\n\n this.familyName_ =\n data[6 + base] == null ? null : (data[6 + base] as string);\n }\n\n getSwgUserToken(): string | null {\n return this.swgUserToken_;\n }\n\n setSwgUserToken(value: string): void {\n this.swgUserToken_ = value;\n }\n\n getActionCompleted(): boolean | null {\n return this.actionCompleted_;\n }\n\n setActionCompleted(value: boolean): void {\n this.actionCompleted_ = value;\n }\n\n getUserEmail(): string | null {\n return this.userEmail_;\n }\n\n setUserEmail(value: string): void {\n this.userEmail_ = value;\n }\n\n getAlreadyCompleted(): boolean | null {\n return this.alreadyCompleted_;\n }\n\n setAlreadyCompleted(value: boolean): void {\n this.alreadyCompleted_ = value;\n }\n\n getDisplayName(): string | null {\n return this.displayName_;\n }\n\n setDisplayName(value: string): void {\n this.displayName_ = value;\n }\n\n getGivenName(): string | null {\n return this.givenName_;\n }\n\n setGivenName(value: string): void {\n this.givenName_ = value;\n }\n\n getFamilyName(): string | null {\n return this.familyName_;\n }\n\n setFamilyName(value: string): void {\n this.familyName_ = value;\n }\n\n toArray(includeLabel = true): unknown[] {\n const arr: unknown[] = [\n this.swgUserToken_, // field 1 - swg_user_token\n this.actionCompleted_, // field 2 - action_completed\n this.userEmail_, // field 3 - user_email\n this.alreadyCompleted_, // field 4 - already_completed\n this.displayName_, // field 5 - display_name\n this.givenName_, // field 6 - given_name\n this.familyName_, // field 7 - family_name\n ];\n if (includeLabel) {\n arr.unshift(this.label());\n }\n return arr;\n }\n\n label(): string {\n return 'CompleteAudienceActionResponse';\n }\n}\n\n/** */\nexport class Duration implements Message {\n private seconds_: number | null;\n private nanos_: number | null;\n\n constructor(data: unknown[] = [], includesLabel = true) {\n const base = includesLabel ? 1 : 0;\n\n this.seconds_ = data[base] == null ? null : (data[base] as number);\n\n this.nanos_ = data[1 + base] == null ? null : (data[1 + base] as number);\n }\n\n getSeconds(): number | null {\n return this.seconds_;\n }\n\n setSeconds(value: number): void {\n this.seconds_ = value;\n }\n\n getNanos(): number | null {\n return this.nanos_;\n }\n\n setNanos(value: number): void {\n this.nanos_ = value;\n }\n\n toArray(includeLabel = true): unknown[] {\n const arr: unknown[] = [\n this.seconds_, // field 1 - seconds\n this.nanos_, // field 2 - nanos\n ];\n if (includeLabel) {\n arr.unshift(this.label());\n }\n return arr;\n }\n\n label(): string {\n return 'Duration';\n }\n}\n\n/** */\nexport class EntitlementJwt implements Message {\n private jwt_: string | null;\n private source_: string | null;\n\n constructor(data: unknown[] = [], includesLabel = true) {\n const base = includesLabel ? 1 : 0;\n\n this.jwt_ = data[base] == null ? null : (data[base] as string);\n\n this.source_ = data[1 + base] == null ? null : (data[1 + base] as string);\n }\n\n getJwt(): string | null {\n return this.jwt_;\n }\n\n setJwt(value: string): void {\n this.jwt_ = value;\n }\n\n getSource(): string | null {\n return this.source_;\n }\n\n setSource(value: string): void {\n this.source_ = value;\n }\n\n toArray(includeLabel = true): unknown[] {\n const arr: unknown[] = [\n this.jwt_, // field 1 - jwt\n this.source_, // field 2 - source\n ];\n if (includeLabel) {\n arr.unshift(this.label());\n }\n return arr;\n }\n\n label(): string {\n return 'EntitlementJwt';\n }\n}\n\n/** */\nexport class EntitlementsRequest implements Message {\n private usedEntitlement_: EntitlementJwt | null;\n private clientEventTime_: Timestamp | null;\n private entitlementSource_: EntitlementSource | null;\n private entitlementResult_: EntitlementResult | null;\n private token_: string | null;\n private isUserRegistered_: boolean | null;\n private subscriptionTimestamp_: Timestamp | null;\n\n constructor(data: unknown[] = [], includesLabel = true) {\n const base = includesLabel ? 1 : 0;\n\n this.usedEntitlement_ =\n data[base] == null\n ? null\n : new EntitlementJwt(data[base] as unknown[], includesLabel);\n\n this.clientEventTime_ =\n data[1 + base] == null\n ? null\n : new Timestamp(data[1 + base] as unknown[], includesLabel);\n\n this.entitlementSource_ =\n data[2 + base] == null ? null : (data[2 + base] as EntitlementSource);\n\n this.entitlementResult_ =\n data[3 + base] == null ? null : (data[3 + base] as EntitlementResult);\n\n this.token_ = data[4 + base] == null ? null : (data[4 + base] as string);\n\n this.isUserRegistered_ =\n data[5 + base] == null ? null : (data[5 + base] as boolean);\n\n this.subscriptionTimestamp_ =\n data[6 + base] == null\n ? null\n : new Timestamp(data[6 + base] as unknown[], includesLabel);\n }\n\n getUsedEntitlement(): EntitlementJwt | null {\n return this.usedEntitlement_;\n }\n\n setUsedEntitlement(value: EntitlementJwt): void {\n this.usedEntitlement_ = value;\n }\n\n getClientEventTime(): Timestamp | null {\n return this.clientEventTime_;\n }\n\n setClientEventTime(value: Timestamp): void {\n this.clientEventTime_ = value;\n }\n\n getEntitlementSource(): EntitlementSource | null {\n return this.entitlementSource_;\n }\n\n setEntitlementSource(value: EntitlementSource): void {\n this.entitlementSource_ = value;\n }\n\n getEntitlementResult(): EntitlementResult | null {\n return this.entitlementResult_;\n }\n\n setEntitlementResult(value: EntitlementResult): void {\n this.entitlementResult_ = value;\n }\n\n getToken(): string | null {\n return this.token_;\n }\n\n setToken(value: string): void {\n this.token_ = value;\n }\n\n getIsUserRegistered(): boolean | null {\n return this.isUserRegistered_;\n }\n\n setIsUserRegistered(value: boolean): void {\n this.isUserRegistered_ = value;\n }\n\n getSubscriptionTimestamp(): Timestamp | null {\n return this.subscriptionTimestamp_;\n }\n\n setSubscriptionTimestamp(value: Timestamp): void {\n this.subscriptionTimestamp_ = value;\n }\n\n toArray(includeLabel = true): unknown[] {\n const arr: unknown[] = [\n this.usedEntitlement_ ? this.usedEntitlement_.toArray(includeLabel) : [], // field 1 - used_entitlement\n this.clientEventTime_ ? this.clientEventTime_.toArray(includeLabel) : [], // field 2 - client_event_time\n this.entitlementSource_, // field 3 - entitlement_source\n this.entitlementResult_, // field 4 - entitlement_result\n this.token_, // field 5 - token\n this.isUserRegistered_, // field 6 - is_user_registered\n this.subscriptionTimestamp_\n ? this.subscriptionTimestamp_.toArray(includeLabel)\n : [], // field 7 - subscription_timestamp\n ];\n if (includeLabel) {\n arr.unshift(this.label());\n }\n return arr;\n }\n\n label(): string {\n return 'EntitlementsRequest';\n }\n}\n\n/** */\nexport class EntitlementsResponse implements Message {\n private jwt_: string | null;\n private swgUserToken_: string | null;\n\n constructor(data: unknown[] = [], includesLabel = true) {\n const base = includesLabel ? 1 : 0;\n\n this.jwt_ = data[base] == null ? null : (data[base] as string);\n\n this.swgUserToken_ =\n data[1 + base] == null ? null : (data[1 + base] as string);\n }\n\n getJwt(): string | null {\n return this.jwt_;\n }\n\n setJwt(value: string): void {\n this.jwt_ = value;\n }\n\n getSwgUserToken(): string | null {\n return this.swgUserToken_;\n }\n\n setSwgUserToken(value: string): void {\n this.swgUserToken_ = value;\n }\n\n toArray(includeLabel = true): unknown[] {\n const arr: unknown[] = [\n this.jwt_, // field 1 - jwt\n this.swgUserToken_, // field 2 - swg_user_token\n ];\n if (includeLabel) {\n arr.unshift(this.label());\n }\n return arr;\n }\n\n label(): string {\n return 'EntitlementsResponse';\n }\n}\n\n/** */\nexport class EventParams implements Message {\n private smartboxMessage_: string | null;\n private gpayTransactionId_: string | null;\n private hadLogged_: boolean | null;\n private sku_: string | null;\n private oldTransactionId_: string | null;\n private isUserRegistered_: boolean | null;\n private subscriptionFlow_: string | null;\n private subscriptionTimestamp_: Timestamp | null;\n\n constructor(data: unknown[] = [], includesLabel = true) {\n const base = includesLabel ? 1 : 0;\n\n this.smartboxMessage_ = data[base] == null ? null : (data[base] as string);\n\n this.gpayTransactionId_ =\n data[1 + base] == null ? null : (data[1 + base] as string);\n\n this.hadLogged_ =\n data[2 + base] == null ? null : (data[2 + base] as boolean);\n\n this.sku_ = data[3 + base] == null ? null : (data[3 + base] as string);\n\n this.oldTransactionId_ =\n data[4 + base] == null ? null : (data[4 + base] as string);\n\n this.isUserRegistered_ =\n data[5 + base] == null ? null : (data[5 + base] as boolean);\n\n this.subscriptionFlow_ =\n data[6 + base] == null ? null : (data[6 + base] as string);\n\n this.subscriptionTimestamp_ =\n data[7 + base] == null\n ? null\n : new Timestamp(data[7 + base] as unknown[], includesLabel);\n }\n\n getSmartboxMessage(): string | null {\n return this.smartboxMessage_;\n }\n\n setSmartboxMessage(value: string): void {\n this.smartboxMessage_ = value;\n }\n\n getGpayTransactionId(): string | null {\n return this.gpayTransactionId_;\n }\n\n setGpayTransactionId(value: string): void {\n this.gpayTransactionId_ = value;\n }\n\n getHadLogged(): boolean | null {\n return this.hadLogged_;\n }\n\n setHadLogged(value: boolean): void {\n this.hadLogged_ = value;\n }\n\n getSku(): string | null {\n return this.sku_;\n }\n\n setSku(value: string): void {\n this.sku_ = value;\n }\n\n getOldTransactionId(): string | null {\n return this.oldTransactionId_;\n }\n\n setOldTransactionId(value: string): void {\n this.oldTransactionId_ = value;\n }\n\n getIsUserRegistered(): boolean | null {\n return this.isUserRegistered_;\n }\n\n setIsUserRegistered(value: boolean): void {\n this.isUserRegistered_ = value;\n }\n\n getSubscriptionFlow(): string | null {\n return this.subscriptionFlow_;\n }\n\n setSubscriptionFlow(value: string): void {\n this.subscriptionFlow_ = value;\n }\n\n getSubscriptionTimestamp(): Timestamp | null {\n return this.subscriptionTimestamp_;\n }\n\n setSubscriptionTimestamp(value: Timestamp): void {\n this.subscriptionTimestamp_ = value;\n }\n\n toArray(includeLabel = true): unknown[] {\n const arr: unknown[] = [\n this.smartboxMessage_, // field 1 - smartbox_message\n this.gpayTransactionId_, // field 2 - gpay_transaction_id\n this.hadLogged_, // field 3 - had_logged\n this.sku_, // field 4 - sku\n this.oldTransactionId_, // field 5 - old_transaction_id\n this.isUserRegistered_, // field 6 - is_user_registered\n this.subscriptionFlow_, // field 7 - subscription_flow\n this.subscriptionTimestamp_\n ? this.subscriptionTimestamp_.toArray(includeLabel)\n : [], // field 8 - subscription_timestamp\n ];\n if (includeLabel) {\n arr.unshift(this.label());\n }\n return arr;\n }\n\n label(): string {\n return 'EventParams';\n }\n}\n\n/** */\nexport class FinishedLoggingResponse implements Message {\n private complete_: boolean | null;\n private error_: string | null;\n\n constructor(data: unknown[] = [], includesLabel = true) {\n const base = includesLabel ? 1 : 0;\n\n this.complete_ = data[base] == null ? null : (data[base] as boolean);\n\n this.error_ = data[1 + base] == null ? null : (data[1 + base] as string);\n }\n\n getComplete(): boolean | null {\n return this.complete_;\n }\n\n setComplete(value: boolean): void {\n this.complete_ = value;\n }\n\n getError(): string | null {\n return this.error_;\n }\n\n setError(value: string): void {\n this.error_ = value;\n }\n\n toArray(includeLabel = true): unknown[] {\n const arr: unknown[] = [\n this.complete_, // field 1 - complete\n this.error_, // field 2 - error\n ];\n if (includeLabel) {\n arr.unshift(this.label());\n }\n return arr;\n }\n\n label(): string {\n return 'FinishedLoggingResponse';\n }\n}\n\n/** */\nexport class LinkSaveTokenRequest implements Message {\n private authCode_: string | null;\n private token_: string | null;\n\n constructor(data: unknown[] = [], includesLabel = true) {\n const base = includesLabel ? 1 : 0;\n\n this.authCode_ = data[base] == null ? null : (data[base] as string);\n\n this.token_ = data[1 + base] == null ? null : (data[1 + base] as string);\n }\n\n getAuthCode(): string | null {\n return this.authCode_;\n }\n\n setAuthCode(value: string): void {\n this.authCode_ = value;\n }\n\n getToken(): string | null {\n return this.token_;\n }\n\n setToken(value: string): void {\n this.token_ = value;\n }\n\n toArray(includeLabel = true): unknown[] {\n const arr: unknown[] = [\n this.authCode_, // field 1 - auth_code\n this.token_, // field 2 - token\n ];\n if (includeLabel) {\n arr.unshift(this.label());\n }\n return arr;\n }\n\n label(): string {\n return 'LinkSaveTokenRequest';\n }\n}\n\n/** */\nexport class LinkingInfoResponse implements Message {\n private requested_: boolean | null;\n\n constructor(data: unknown[] = [], includesLabel = true) {\n const base = includesLabel ? 1 : 0;\n\n this.requested_ = data[base] == null ? null : (data[base] as boolean);\n }\n\n getRequested(): boolean | null {\n return this.requested_;\n }\n\n setRequested(value: boolean): void {\n this.requested_ = value;\n }\n\n toArray(includeLabel = true): unknown[] {\n const arr: unknown[] = [\n this.requested_, // field 1 - requested\n ];\n if (includeLabel) {\n arr.unshift(this.label());\n }\n return arr;\n }\n\n label(): string {\n return 'LinkingInfoResponse';\n }\n}\n\n/** */\nexport class OpenDialogRequest implements Message {\n private urlPath_: string | null;\n\n constructor(data: unknown[] = [], includesLabel = true) {\n const base = includesLabel ? 1 : 0;\n\n this.urlPath_ = data[base] == null ? null : (data[base] as string);\n }\n\n getUrlPath(): string | null {\n return this.urlPath_;\n }\n\n setUrlPath(value: string): void {\n this.urlPath_ = value;\n }\n\n toArray(includeLabel = true): unknown[] {\n const arr: unknown[] = [\n this.urlPath_, // field 1 - url_path\n ];\n if (includeLabel) {\n arr.unshift(this.label());\n }\n return arr;\n }\n\n label(): string {\n return 'OpenDialogRequest';\n }\n}\n\n/** */\nexport class SkuSelectedResponse implements Message {\n private sku_: string | null;\n private oldSku_: string | null;\n private oneTime_: boolean | null;\n private playOffer_: string | null;\n private oldPlayOffer_: string | null;\n private customMessage_: string | null;\n private anonymous_: boolean | null;\n private sharingPolicyEnabled_: boolean | null;\n\n constructor(data: unknown[] = [], includesLabel = true) {\n const base = includesLabel ? 1 : 0;\n\n this.sku_ = data[base] == null ? null : (data[base] as string);\n\n this.oldSku_ = data[1 + base] == null ? null : (data[1 + base] as string);\n\n this.oneTime_ = data[2 + base] == null ? null : (data[2 + base] as boolean);\n\n this.playOffer_ =\n data[3 + base] == null ? null : (data[3 + base] as string);\n\n this.oldPlayOffer_ =\n data[4 + base] == null ? null : (data[4 + base] as string);\n\n this.customMessage_ =\n data[5 + base] == null ? null : (data[5 + base] as string);\n\n this.anonymous_ =\n data[6 + base] == null ? null : (data[6 + base] as boolean);\n\n this.sharingPolicyEnabled_ =\n data[7 + base] == null ? null : (data[7 + base] as boolean);\n }\n\n getSku(): string | null {\n return this.sku_;\n }\n\n setSku(value: string): void {\n this.sku_ = value;\n }\n\n getOldSku(): string | null {\n return this.oldSku_;\n }\n\n setOldSku(value: string): void {\n this.oldSku_ = value;\n }\n\n getOneTime(): boolean | null {\n return this.oneTime_;\n }\n\n setOneTime(value: boolean): void {\n this.oneTime_ = value;\n }\n\n getPlayOffer(): string | null {\n return this.playOffer_;\n }\n\n setPlayOffer(value: string): void {\n this.playOffer_ = value;\n }\n\n getOldPlayOffer(): string | null {\n return this.oldPlayOffer_;\n }\n\n setOldPlayOffer(value: string): void {\n this.oldPlayOffer_ = value;\n }\n\n getCustomMessage(): string | null {\n return this.customMessage_;\n }\n\n setCustomMessage(value: string): void {\n this.customMessage_ = value;\n }\n\n getAnonymous(): boolean | null {\n return this.anonymous_;\n }\n\n setAnonymous(value: boolean): void {\n this.anonymous_ = value;\n }\n\n getSharingPolicyEnabled(): boolean | null {\n return this.sharingPolicyEnabled_;\n }\n\n setSharingPolicyEnabled(value: boolean): void {\n this.sharingPolicyEnabled_ = value;\n }\n\n toArray(includeLabel = true): unknown[] {\n const arr: unknown[] = [\n this.sku_, // field 1 - sku\n this.oldSku_, // field 2 - old_sku\n this.oneTime_, // field 3 - one_time\n this.playOffer_, // field 4 - play_offer\n this.oldPlayOffer_, // field 5 - old_play_offer\n this.customMessage_, // field 6 - custom_message\n this.anonymous_, // field 7 - anonymous\n this.sharingPolicyEnabled_, // field 8 - sharing_policy_enabled\n ];\n if (includeLabel) {\n arr.unshift(this.label());\n }\n return arr;\n }\n\n label(): string {\n return 'SkuSelectedResponse';\n }\n}\n\n/** */\nexport class SmartBoxMessage implements Message {\n private isClicked_: boolean | null;\n\n constructor(data: unknown[] = [], includesLabel = true) {\n const base = includesLabel ? 1 : 0;\n\n this.isClicked_ = data[base] == null ? null : (data[base] as boolean);\n }\n\n getIsClicked(): boolean | null {\n return this.isClicked_;\n }\n\n setIsClicked(value: boolean): void {\n this.isClicked_ = value;\n }\n\n toArray(includeLabel = true): unknown[] {\n const arr: unknown[] = [\n this.isClicked_, // field 1 - is_clicked\n ];\n if (includeLabel) {\n arr.unshift(this.label());\n }\n return arr;\n }\n\n label(): string {\n return 'SmartBoxMessage';\n }\n}\n\n/** */\nexport class SubscribeResponse implements Message {\n private subscribe_: boolean | null;\n\n constructor(data: unknown[] = [], includesLabel = true) {\n const base = includesLabel ? 1 : 0;\n\n this.subscribe_ = data[base] == null ? null : (data[base] as boolean);\n }\n\n getSubscribe(): boolean | null {\n return this.subscribe_;\n }\n\n setSubscribe(value: boolean): void {\n this.subscribe_ = value;\n }\n\n toArray(includeLabel = true): unknown[] {\n const arr: unknown[] = [\n this.subscribe_, // field 1 - subscribe\n ];\n if (includeLabel) {\n arr.unshift(this.label());\n }\n return arr;\n }\n\n label(): string {\n return 'SubscribeResponse';\n }\n}\n\n/** */\nexport class SubscriptionLinkingCompleteResponse implements Message {\n private publisherProvidedId_: string | null;\n private success_: boolean | null;\n\n constructor(data: unknown[] = [], includesLabel = true) {\n const base = includesLabel ? 1 : 0;\n\n this.publisherProvidedId_ =\n data[base] == null ? null : (data[base] as string);\n\n this.success_ = data[1 + base] == null ? null : (data[1 + base] as boolean);\n }\n\n getPublisherProvidedId(): string | null {\n return this.publisherProvidedId_;\n }\n\n setPublisherProvidedId(value: string): void {\n this.publisherProvidedId_ = value;\n }\n\n getSuccess(): boolean | null {\n return this.success_;\n }\n\n setSuccess(value: boolean): void {\n this.success_ = value;\n }\n\n toArray(includeLabel = true): unknown[] {\n const arr: unknown[] = [\n this.publisherProvidedId_, // field 1 - publisher_provided_id\n this.success_, // field 2 - success\n ];\n if (includeLabel) {\n arr.unshift(this.label());\n }\n return arr;\n }\n\n label(): string {\n return 'SubscriptionLinkingCompleteResponse';\n }\n}\n\n/** */\nexport class SubscriptionLinkingResponse implements Message {\n private publisherProvidedId_: string | null;\n\n constructor(data: unknown[] = [], includesLabel = true) {\n const base = includesLabel ? 1 : 0;\n\n this.publisherProvidedId_ =\n data[base] == null ? null : (data[base] as string);\n }\n\n getPublisherProvidedId(): string | null {\n return this.publisherProvidedId_;\n }\n\n setPublisherProvidedId(value: string): void {\n this.publisherProvidedId_ = value;\n }\n\n toArray(includeLabel = true): unknown[] {\n const arr: unknown[] = [\n this.publisherProvidedId_, // field 1 - publisher_provided_id\n ];\n if (includeLabel) {\n arr.unshift(this.label());\n }\n return arr;\n }\n\n label(): string {\n return 'SubscriptionLinkingResponse';\n }\n}\n\n/** */\nexport class SurveyAnswer implements Message {\n private answerId_: number | null;\n private answerText_: string | null;\n private answerCategory_: string | null;\n private ppsValue_: string | null;\n\n constructor(data: unknown[] = [], includesLabel = true) {\n const base = includesLabel ? 1 : 0;\n\n this.answerId_ = data[base] == null ? null : (data[base] as number);\n\n this.answerText_ =\n data[1 + base] == null ? null : (data[1 + base] as string);\n\n this.answerCategory_ =\n data[2 + base] == null ? null : (data[2 + base] as string);\n\n this.ppsValue_ = data[3 + base] == null ? null : (data[3 + base] as string);\n }\n\n getAnswerId(): number | null {\n return this.answerId_;\n }\n\n setAnswerId(value: number): void {\n this.answerId_ = value;\n }\n\n getAnswerText(): string | null {\n return this.answerText_;\n }\n\n setAnswerText(value: string): void {\n this.answerText_ = value;\n }\n\n getAnswerCategory(): string | null {\n return this.answerCategory_;\n }\n\n setAnswerCategory(value: string): void {\n this.answerCategory_ = value;\n }\n\n getPpsValue(): string | null {\n return this.ppsValue_;\n }\n\n setPpsValue(value: string): void {\n this.ppsValue_ = value;\n }\n\n toArray(includeLabel = true): unknown[] {\n const arr: unknown[] = [\n this.answerId_, // field 1 - answer_id\n this.answerText_, // field 2 - answer_text\n this.answerCategory_, // field 3 - answer_category\n this.ppsValue_, // field 4 - pps_value\n ];\n if (includeLabel) {\n arr.unshift(this.label());\n }\n return arr;\n }\n\n label(): string {\n return 'SurveyAnswer';\n }\n}\n\n/** */\nexport class SurveyDataTransferRequest implements Message {\n private surveyQuestions_: SurveyQuestion[] | null;\n private storePpsInLocalStorage_: boolean | null;\n\n constructor(data: unknown[] = [], includesLabel = true) {\n const base = includesLabel ? 1 : 0;\n\n this.surveyQuestions_ = ((data[base] as unknown[][]) || []).map(\n (item) => new SurveyQuestion(item, includesLabel)\n );\n\n this.storePpsInLocalStorage_ =\n data[1 + base] == null ? null : (data[1 + base] as boolean);\n }\n\n getSurveyQuestionsList(): SurveyQuestion[] | null {\n return this.surveyQuestions_;\n }\n\n setSurveyQuestionsList(value: SurveyQuestion[]): void {\n this.surveyQuestions_ = value;\n }\n\n getStorePpsInLocalStorage(): boolean | null {\n return this.storePpsInLocalStorage_;\n }\n\n setStorePpsInLocalStorage(value: boolean): void {\n this.storePpsInLocalStorage_ = value;\n }\n\n toArray(includeLabel = true): unknown[] {\n const arr: unknown[] = [\n this.surveyQuestions_\n ? this.surveyQuestions_.map((item) => item.toArray(includeLabel))\n : [], // field 1 - survey_questions\n this.storePpsInLocalStorage_, // field 2 - store_pps_in_local_storage\n ];\n if (includeLabel) {\n arr.unshift(this.label());\n }\n return arr;\n }\n\n label(): string {\n return 'SurveyDataTransferRequest';\n }\n}\n\n/** */\nexport class SurveyDataTransferResponse implements Message {\n private success_: boolean | null;\n\n constructor(data: unknown[] = [], includesLabel = true) {\n const base = includesLabel ? 1 : 0;\n\n this.success_ = data[base] == null ? null : (data[base] as boolean);\n }\n\n getSuccess(): boolean | null {\n return this.success_;\n }\n\n setSuccess(value: boolean): void {\n this.success_ = value;\n }\n\n toArray(includeLabel = true): unknown[] {\n const arr: unknown[] = [\n this.success_, // field 1 - success\n ];\n if (includeLabel) {\n arr.unshift(this.label());\n }\n return arr;\n }\n\n label(): string {\n return 'SurveyDataTransferResponse';\n }\n}\n\n/** */\nexport class SurveyQuestion implements Message {\n private questionId_: number | null;\n private questionText_: string | null;\n private questionCategory_: string | null;\n private surveyAnswers_: SurveyAnswer[] | null;\n\n constructor(data: unknown[] = [], includesLabel = true) {\n const base = includesLabel ? 1 : 0;\n\n this.questionId_ = data[base] == null ? null : (data[base] as number);\n\n this.questionText_ =\n data[1 + base] == null ? null : (data[1 + base] as string);\n\n this.questionCategory_ =\n data[2 + base] == null ? null : (data[2 + base] as string);\n\n this.surveyAnswers_ = ((data[3 + base] as unknown[][]) || []).map(\n (item) => new SurveyAnswer(item, includesLabel)\n );\n }\n\n getQuestionId(): number | null {\n return this.questionId_;\n }\n\n setQuestionId(value: number): void {\n this.questionId_ = value;\n }\n\n getQuestionText(): string | null {\n return this.questionText_;\n }\n\n setQuestionText(value: string): void {\n this.questionText_ = value;\n }\n\n getQuestionCategory(): string | null {\n return this.questionCategory_;\n }\n\n setQuestionCategory(value: string): void {\n this.questionCategory_ = value;\n }\n\n getSurveyAnswersList(): SurveyAnswer[] | null {\n return this.surveyAnswers_;\n }\n\n setSurveyAnswersList(value: SurveyAnswer[]): void {\n this.surveyAnswers_ = value;\n }\n\n toArray(includeLabel = true): unknown[] {\n const arr: unknown[] = [\n this.questionId_, // field 1 - question_id\n this.questionText_, // field 2 - question_text\n this.questionCategory_, // field 3 - question_category\n this.surveyAnswers_\n ? this.surveyAnswers_.map((item) => item.toArray(includeLabel))\n : [], // field 4 - survey_answers\n ];\n if (includeLabel) {\n arr.unshift(this.label());\n }\n return arr;\n }\n\n label(): string {\n return 'SurveyQuestion';\n }\n}\n\n/** */\nexport class Timestamp implements Message {\n private seconds_: number | null;\n private nanos_: number | null;\n\n constructor(data: unknown[] = [], includesLabel = true) {\n const base = includesLabel ? 1 : 0;\n\n this.seconds_ = data[base] == null ? null : (data[base] as number);\n\n this.nanos_ = data[1 + base] == null ? null : (data[1 + base] as number);\n }\n\n getSeconds(): number | null {\n return this.seconds_;\n }\n\n setSeconds(value: number): void {\n this.seconds_ = value;\n }\n\n getNanos(): number | null {\n return this.nanos_;\n }\n\n setNanos(value: number): void {\n this.nanos_ = value;\n }\n\n toArray(includeLabel = true): unknown[] {\n const arr: unknown[] = [\n this.seconds_, // field 1 - seconds\n this.nanos_, // field 2 - nanos\n ];\n if (includeLabel) {\n arr.unshift(this.label());\n }\n return arr;\n }\n\n label(): string {\n return 'Timestamp';\n }\n}\n\n/** */\nexport class ToastCloseRequest implements Message {\n private close_: boolean | null;\n\n constructor(data: unknown[] = [], includesLabel = true) {\n const base = includesLabel ? 1 : 0;\n\n this.close_ = data[base] == null ? null : (data[base] as boolean);\n }\n\n getClose(): boolean | null {\n return this.close_;\n }\n\n setClose(value: boolean): void {\n this.close_ = value;\n }\n\n toArray(includeLabel = true): unknown[] {\n const arr: unknown[] = [\n this.close_, // field 1 - close\n ];\n if (includeLabel) {\n arr.unshift(this.label());\n }\n return arr;\n }\n\n label(): string {\n return 'ToastCloseRequest';\n }\n}\n\n/** */\nexport class ViewSubscriptionsResponse implements Message {\n private native_: boolean | null;\n\n constructor(data: unknown[] = [], includesLabel = true) {\n const base = includesLabel ? 1 : 0;\n\n this.native_ = data[base] == null ? null : (data[base] as boolean);\n }\n\n getNative(): boolean | null {\n return this.native_;\n }\n\n setNative(value: boolean): void {\n this.native_ = value;\n }\n\n toArray(includeLabel = true): unknown[] {\n const arr: unknown[] = [\n this.native_, // field 1 - native\n ];\n if (includeLabel) {\n arr.unshift(this.label());\n }\n return arr;\n }\n\n label(): string {\n return 'ViewSubscriptionsResponse';\n }\n}\n\nconst PROTO_MAP: {[key: string]: MessageConstructor} = {\n 'AccountCreationRequest': AccountCreationRequest,\n 'ActionRequest': ActionRequest,\n 'AlreadySubscribedResponse': AlreadySubscribedResponse,\n 'AnalyticsContext': AnalyticsContext,\n 'AnalyticsEventMeta': AnalyticsEventMeta,\n 'AnalyticsRequest': AnalyticsRequest,\n 'AudienceActivityClientLogsRequest': AudienceActivityClientLogsRequest,\n 'CompleteAudienceActionResponse': CompleteAudienceActionResponse,\n 'Duration': Duration,\n 'EntitlementJwt': EntitlementJwt,\n 'EntitlementsRequest': EntitlementsRequest,\n 'EntitlementsResponse': EntitlementsResponse,\n 'EventParams': EventParams,\n 'FinishedLoggingResponse': FinishedLoggingResponse,\n 'LinkSaveTokenRequest': LinkSaveTokenRequest,\n 'LinkingInfoResponse': LinkingInfoResponse,\n 'OpenDialogRequest': OpenDialogRequest,\n 'SkuSelectedResponse': SkuSelectedResponse,\n 'SmartBoxMessage': SmartBoxMessage,\n 'SubscribeResponse': SubscribeResponse,\n 'SubscriptionLinkingCompleteResponse': SubscriptionLinkingCompleteResponse,\n 'SubscriptionLinkingResponse': SubscriptionLinkingResponse,\n 'SurveyAnswer': SurveyAnswer,\n 'SurveyDataTransferRequest': SurveyDataTransferRequest,\n 'SurveyDataTransferResponse': SurveyDataTransferResponse,\n 'SurveyQuestion': SurveyQuestion,\n 'Timestamp': Timestamp,\n 'ToastCloseRequest': ToastCloseRequest,\n 'ViewSubscriptionsResponse': ViewSubscriptionsResponse,\n};\n\n/**\n * Utility to deserialize a buffer\n */\nexport function deserialize(data: unknown[]): Message {\n const key = data ? (data[0] as string) : null;\n if (key) {\n const ctor = PROTO_MAP[key];\n if (ctor) {\n return new ctor(data);\n }\n }\n throw new Error(`Deserialization failed for ${data}`);\n}\n\n/**\n * Gets a message's label.\n */\nexport function getLabel(messageType: MessageConstructor): string {\n return messageType.prototype.label();\n}\n","/**\n * Copyright 2020 The Subscribe with Google Authors. All Rights Reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS-IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {ClientTheme} from './subscriptions';\nimport {Entitlements} from './entitlements';\nimport {SubscribeResponse} from './subscribe-response';\n\n/**\n * Interface for users of the basic tier of Subscribe with Google.\n */\nexport interface BasicSubscriptions {\n /**\n * Initializes the basic subscriptions runtime. This includes setting of the\n * specified param values in the JSON-LD markup of the page, sets up any SwG\n * buttons with attribute 'swg-standard-button', and inserts a SwG prompt for\n * contributions/subscriptions. If the fields specified in the params are\n * already specified in the JSON-LD markup on the page, the existing values\n * will be preserved, and the values within init will be ignored.\n */\n init(params: {\n type: string | string[];\n isAccessibleForFree: boolean;\n isPartOfType: string | string[];\n isPartOfProductId: string;\n autoPromptType?: AutoPromptType;\n clientOptions?: ClientOptions;\n alwaysShow?: boolean;\n disableDefaultMeteringHandler?: boolean;\n publisherProvidedId?: string;\n }): void;\n\n /**\n * Set the entitlement check callback.\n */\n setOnEntitlementsResponse(\n callback: (entitlementsPromise: Promise) => void\n ): void;\n\n /**\n * Set the payment complete callback.\n */\n setOnPaymentResponse(\n callback: (subscribeResponsePromise: Promise) => void\n ): void;\n\n /**\n * Open CheckEntitlementsView to let users log in Google and check their entitlements.\n */\n setOnLoginRequest(callback: (loginRequest: LoginRequest) => void): void;\n\n /**\n * Creates and displays a SwG subscription or contribution prompt, where the\n * prompt type is determined by the parameters passed in to init. If the auto\n * prompt is determined to have been already set up, the setup portion of the\n * function will be skipped, and the prompt will be displayed. The\n * autoPromptType specifies which type of prompt should be displayed (see\n * AutoPromptType below). The alwaysShow parameter is an option to force show\n * the prompt, regardless of any display rules. This parameter is intended for\n * preview purposes.\n */\n setupAndShowAutoPrompt(options: {\n autoPromptType?: AutoPromptType;\n alwaysShow?: boolean;\n isAccessibleForFree?: boolean;\n }): Promise;\n\n /**\n * Dismisses any SwG UI currently displayed. Intended to be used for preview\n * purposes.\n */\n dismissSwgUI(): void;\n}\n\n/**\n * The types of autoprompt that can be specified to be shown. CONTRIBUTION and\n * SUBSCRIPTION will trigger the small, button-like prompt, and\n * CONTRIBUTION_LARGE and SUBSCRIPTION_LARGE will trigger the larger purchase\n * UI.\n */\nexport enum AutoPromptType {\n NONE = 'none',\n CONTRIBUTION = 'contribution',\n CONTRIBUTION_LARGE = 'contribution_large',\n SUBSCRIPTION = 'subscription',\n SUBSCRIPTION_LARGE = 'subscription_large',\n}\n\n/**\n * The types of supported publication content type. Should be maintained with:\n * google3/java/com/google/subscribewithgoogle/audienceactions/proto/audience_member_flow_service.proto.\n */\nexport enum ContentType {\n OPEN = 'OPEN',\n CLOSED = 'CLOSED',\n}\n\n/**\n * Options for configuring all client UI.\n */\nexport interface ClientOptions {\n /** Whether to enable button. */\n disableButton?: boolean;\n /** Sets the button and prompt language. Default is \"en\". */\n lang?: string;\n /** Whether to force the specified lang in iframes. */\n forceLangInIframes?: boolean;\n /** \"Light\" or \"dark\". Default is \"light\". */\n theme?: ClientTheme;\n /** Whether to allow scrolling. */\n allowScroll?: boolean;\n /** Skip account creation screen if requested. */\n skipAccountCreationScreen?: boolean;\n}\n\nexport interface LoginRequest {\n linkRequested: boolean;\n}\n","/**\n * Copyright 2023 The Subscribe with Google Authors. All Rights Reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License atCONST_GOOGLE_LOGO\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS-IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/**\n * This is the Google logo in base64 to be used in the src of an tag.\n */\nexport const GOOGLE_LOGO_IMAGE_DATA =\n 'data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSI3NCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDc0IDI0Ij48cGF0aCBmaWxsPSIjNDI4NUY0IiBkPSJNOS4yNCA4LjE5djIuNDZoNS44OGMtLjE4IDEuMzgtLjY0IDIuMzktMS4zNCAzLjEtLjg2Ljg2LTIuMiAxLjgtNC41NCAxLjgtMy42MiAwLTYuNDUtMi45Mi02LjQ1LTYuNTRzMi44My02LjU0IDYuNDUtNi41NGMxLjk1IDAgMy4zOC43NyA0LjQzIDEuNzZMMTUuNCAyLjVDMTMuOTQgMS4wOCAxMS45OCAwIDkuMjQgMCA0LjI4IDAgLjExIDQuMDQuMTEgOXM0LjE3IDkgOS4xMyA5YzIuNjggMCA0LjctLjg4IDYuMjgtMi41MiAxLjYyLTEuNjIgMi4xMy0zLjkxIDIuMTMtNS43NSAwLS41Ny0uMDQtMS4xLS4xMy0xLjU0SDkuMjR6Ii8+PHBhdGggZmlsbD0iI0VBNDMzNSIgZD0iTTI1IDYuMTljLTMuMjEgMC01LjgzIDIuNDQtNS44MyA1LjgxIDAgMy4zNCAyLjYyIDUuODEgNS44MyA1LjgxczUuODMtMi40NiA1LjgzLTUuODFjMC0zLjM3LTIuNjItNS44MS01LjgzLTUuODF6bTAgOS4zM2MtMS43NiAwLTMuMjgtMS40NS0zLjI4LTMuNTIgMC0yLjA5IDEuNTItMy41MiAzLjI4LTMuNTJzMy4yOCAxLjQzIDMuMjggMy41MmMwIDIuMDctMS41MiAzLjUyLTMuMjggMy41MnoiLz48cGF0aCBmaWxsPSIjNDI4NUY0IiBkPSJNNTMuNTggNy40OWgtLjA5Yy0uNTctLjY4LTEuNjctMS4zLTMuMDYtMS4zQzQ3LjUzIDYuMTkgNDUgOC43MiA0NSAxMmMwIDMuMjYgMi41MyA1LjgxIDUuNDMgNS44MSAxLjM5IDAgMi40OS0uNjIgMy4wNi0xLjMyaC4wOXYuODFjMCAyLjIyLTEuMTkgMy40MS0zLjEgMy40MS0xLjU2IDAtMi41My0xLjEyLTIuOTMtMi4wN2wtMi4yMi45MmMuNjQgMS41NCAyLjMzIDMuNDMgNS4xNSAzLjQzIDIuOTkgMCA1LjUyLTEuNzYgNS41Mi02LjA1VjYuNDloLTIuNDJ2MXptLTIuOTMgOC4wM2MtMS43NiAwLTMuMS0xLjUtMy4xLTMuNTIgMC0yLjA1IDEuMzQtMy41MiAzLjEtMy41MiAxLjc0IDAgMy4xIDEuNSAzLjEgMy41NC4wMSAyLjAzLTEuMzYgMy41LTMuMSAzLjV6Ii8+PHBhdGggZmlsbD0iI0ZCQkMwNSIgZD0iTTM4IDYuMTljLTMuMjEgMC01LjgzIDIuNDQtNS44MyA1LjgxIDAgMy4zNCAyLjYyIDUuODEgNS44MyA1LjgxczUuODMtMi40NiA1LjgzLTUuODFjMC0zLjM3LTIuNjItNS44MS01LjgzLTUuODF6bTAgOS4zM2MtMS43NiAwLTMuMjgtMS40NS0zLjI4LTMuNTIgMC0yLjA5IDEuNTItMy41MiAzLjI4LTMuNTJzMy4yOCAxLjQzIDMuMjggMy41MmMwIDIuMDctMS41MiAzLjUyLTMuMjggMy41MnoiLz48cGF0aCBmaWxsPSIjMzRBODUzIiBkPSJNNTggLjI0aDIuNTF2MTcuNTdINTh6Ii8+PHBhdGggZmlsbD0iI0VBNDMzNSIgZD0iTTY4LjI2IDE1LjUyYy0xLjMgMC0yLjIyLS41OS0yLjgyLTEuNzZsNy43Ny0zLjIxLS4yNi0uNjZjLS40OC0xLjMtMS45Ni0zLjctNC45Ny0zLjctMi45OSAwLTUuNDggMi4zNS01LjQ4IDUuODEgMCAzLjI2IDIuNDYgNS44MSA1Ljc2IDUuODEgMi42NiAwIDQuMi0xLjYzIDQuODQtMi41N2wtMS45OC0xLjMyYy0uNjYuOTYtMS41NiAxLjYtMi44NiAxLjZ6bS0uMTgtNy4xNWMxLjAzIDAgMS45MS41MyAyLjIgMS4yOGwtNS4yNSAyLjE3YzAtMi40NCAxLjczLTMuNDUgMy4wNS0zLjQ1eiIvPjwvc3ZnPg==';\n","/**\n * Copyright 2023 The Subscribe with Google Authors. All Rights Reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS-IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {ASSETS} from '../constants';\nimport {GOOGLE_LOGO_IMAGE_DATA} from '../utils/assets';\n\n// Helper for syntax highlighting.\nconst html = String.raw;\nconst css = String.raw;\n\nconst SLIDE_UP_ANIMATION = css`\n @keyframes slideUp {\n from {\n transform: translate(0, 200px);\n }\n to {\n transform: translate(0, 0);\n }\n }\n`;\n\nconst EXIT_CSS = css`\n .exit-container {\n width: 100%;\n display: flex;\n flex-direction: row-reverse;\n }\n`;\n\nconst BACK_TO_HOME_CSS = css`\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`;\n\nexport const BACK_TO_HOME_HTML = html`\n \n $BACK_TO_HOME_TEXT$\n \n`;\n\nconst REWARDED_AD_PROMPT = css`\n ${SLIDE_UP_ANIMATION}\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`;\n\nconst DEFAULT_BUTTON = css`\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`;\n\nconst REWARDED_AD_CLOSE_BUTTON_CSS = css`\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`;\n\nexport const REWARDED_AD_CLOSE_BUTTON_HTML = html` \n
\n`;\n\nconst OPT_IN_CLOSE_BUTTON_CSS = css`\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`;\n\nexport const OPT_IN_CLOSE_BUTTON_HTML = html`\n
\n \n
`;\n\n// Error view for prompts that fail to init.\nconst ERROR_CSS = css`\n ${REWARDED_AD_PROMPT}\n`;\n\nexport const ERROR_HTML = html`\n \n
Something went wrong.
\n`;\n\nconst LOADING_CSS = css`\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('${ASSETS}/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`;\n\nexport const LOADING_HTML = html`\n \n \n \n \n \n \n \n \n`;\n\n// Rewarded ad wall prompt css and html.\nconst REWARDED_AD_CSS = css`\n ${DEFAULT_BUTTON}\n ${REWARDED_AD_CLOSE_BUTTON_CSS}\n ${REWARDED_AD_PROMPT}\n ${BACK_TO_HOME_CSS}\n ${EXIT_CSS}\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;\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`;\n\nexport const REWARDED_AD_SUPPORT_HTML = html`\n
\n $SUPPORT_MESSAGE$\n
\n`;\n\nexport const REWARDED_AD_SIGN_IN_HTML = html`