{"version":3,"file":"google-pay-button-angular.mjs","sources":["../../../lib/load-script.ts","../../../lib/button-manager.ts","../../../lib/debounce.ts","../../lib/google-pay-button.component.ts","../../lib/google-pay-button.module.ts","../../../angular-public-api.ts","../../../google-pay-button-angular.ts"],"sourcesContent":["/**\n * Copyright 2020 Google LLC\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 * Keeps track scripts that have been requested by loadScript.\n */\nlet cachedScripts: Record<string, Promise<any>> = {};\n\n/**\n * Asynchronously loads a script keeping track of which scripts have already\n * requested and loaded.\n *\n * Multiple requests to the same resource will return the same promise.\n *\n * @param src Script URL to load\n */\nexport function loadScript(src: string): Promise<void> {\n  const existing = cachedScripts[src];\n  if (existing) {\n    return existing;\n  }\n\n  const promise = new Promise<void>((resolve, reject) => {\n    // Create script\n    const script = document.createElement('script');\n    script.src = src;\n    script.async = true;\n\n    // Script event listener callbacks for load and error\n    const onScriptLoad = (): void => {\n      resolve();\n    };\n\n    const onScriptError = (): void => {\n      // eslint-disable-next-line @typescript-eslint/no-use-before-define\n      cleanup();\n\n      // Remove from cachedScripts so that we can try loading again\n      delete cachedScripts[src];\n      script.remove();\n\n      reject(new Error(`Unable to load script ${src}`));\n    };\n\n    script.addEventListener('load', onScriptLoad);\n    script.addEventListener('error', onScriptError);\n\n    // Add script to document body\n    document.body.appendChild(script);\n\n    // Remove event listeners on cleanup\n    function cleanup(): void {\n      script.removeEventListener('load', onScriptLoad);\n      script.removeEventListener('error', onScriptError);\n    }\n  });\n\n  cachedScripts[src] = promise;\n\n  return promise;\n}\n\n/**\n * Clears the script cache. Used for testing purposes only.\n */\nexport function clearScriptCache(): void {\n  cachedScripts = {};\n}\n","/**\n * Copyright 2020 Google LLC\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/* eslint-disable react/no-is-mounted */\n\nimport { loadScript } from '../lib/load-script';\n\nexport interface ReadyToPayChangeResponse {\n  isButtonVisible: boolean;\n  isReadyToPay: boolean;\n  paymentMethodPresent?: boolean;\n}\n\nexport interface Config {\n  environment: google.payments.api.Environment;\n  existingPaymentMethodRequired?: boolean;\n  paymentRequest: google.payments.api.PaymentDataRequest;\n  onPaymentDataChanged?: google.payments.api.PaymentDataChangedHandler;\n  onPaymentAuthorized?: google.payments.api.PaymentAuthorizedHandler;\n  onLoadPaymentData?: (paymentData: google.payments.api.PaymentData) => void;\n  onCancel?: (reason: google.payments.api.PaymentsError) => void;\n  onError?: (error: Error | google.payments.api.PaymentsError) => void;\n  onReadyToPayChange?: (result: ReadyToPayChangeResponse) => void;\n  onClick?: (event: Event) => void;\n  buttonType?: google.payments.api.ButtonType;\n  buttonColor?: google.payments.api.ButtonColor;\n  buttonRadius?: number;\n  buttonSizeMode?: google.payments.api.ButtonSizeMode;\n  buttonLocale?: string;\n  buttonBorderType?: google.payments.api.ButtonBorderType;\n}\n\ninterface ButtonManagerOptions {\n  cssSelector: string;\n  softwareInfoId: string;\n  softwareInfoVersion: string;\n}\n\n/**\n * Manages the lifecycle of the Google Pay button.\n *\n * Includes lifecycle management of the `PaymentsClient` instance,\n * `isReadyToPay`, `onClick`, `loadPaymentData`, and other callback methods.\n */\nexport class ButtonManager {\n  private client?: google.payments.api.PaymentsClient;\n  private config?: Config;\n  private element?: Element;\n  private options: ButtonManagerOptions;\n  private oldInvalidationValues?: any[];\n\n  isReadyToPay?: boolean;\n  paymentMethodPresent?: boolean;\n\n  constructor(options: ButtonManagerOptions) {\n    this.options = options;\n  }\n\n  getElement(): Element | undefined {\n    return this.element;\n  }\n\n  private isGooglePayLoaded(): boolean {\n    return 'google' in (window || global) && !!google?.payments?.api?.PaymentsClient;\n  }\n\n  async mount(element: Element): Promise<void> {\n    if (!this.isGooglePayLoaded()) {\n      try {\n        await loadScript('https://pay.google.com/gp/p/js/pay.js');\n      } catch (err) {\n        if (this.config?.onError) {\n          this.config.onError(err as Error);\n        } else {\n          console.error(err);\n        }\n        return;\n      }\n    }\n\n    this.element = element;\n    if (element) {\n      this.appendStyles();\n      if (this.config) {\n        this.updateElement();\n      }\n    }\n  }\n\n  unmount(): void {\n    this.element = undefined;\n  }\n\n  configure(newConfig: Config): Promise<void> {\n    let promise: Promise<void> | undefined = undefined;\n    this.config = newConfig;\n    if (!this.oldInvalidationValues || this.isClientInvalidated(newConfig)) {\n      promise = this.updateElement();\n    }\n    this.oldInvalidationValues = this.getInvalidationValues(newConfig);\n\n    return promise ?? Promise.resolve();\n  }\n\n  /**\n   * Creates client configuration options based on button configuration\n   * options.\n   *\n   * This method would normally be private but has been made public for\n   * testing purposes.\n   *\n   * @private\n   */\n  createClientOptions(config: Config): google.payments.api.PaymentOptions {\n    const clientConfig: google.payments.api.PaymentOptions = {\n      environment: config.environment,\n      merchantInfo: this.createMerchantInfo(config),\n    };\n\n    if (config.onPaymentDataChanged || config.onPaymentAuthorized) {\n      clientConfig.paymentDataCallbacks = {};\n\n      if (config.onPaymentDataChanged) {\n        // eslint-disable-next-line @typescript-eslint/explicit-function-return-type\n        clientConfig.paymentDataCallbacks.onPaymentDataChanged = paymentData => {\n          const result = config.onPaymentDataChanged!(paymentData);\n          return result || ({} as google.payments.api.PaymentDataRequestUpdate);\n        };\n      }\n\n      if (config.onPaymentAuthorized) {\n        // eslint-disable-next-line @typescript-eslint/explicit-function-return-type\n        clientConfig.paymentDataCallbacks.onPaymentAuthorized = paymentData => {\n          const result = config.onPaymentAuthorized!(paymentData);\n          return result || ({} as google.payments.api.PaymentAuthorizationResult);\n        };\n      }\n    }\n\n    return clientConfig;\n  }\n\n  private createIsReadyToPayRequest(config: Config): google.payments.api.IsReadyToPayRequest {\n    const paymentRequest = config.paymentRequest;\n    const request: google.payments.api.IsReadyToPayRequest = {\n      apiVersion: paymentRequest.apiVersion,\n      apiVersionMinor: paymentRequest.apiVersionMinor,\n      allowedPaymentMethods: paymentRequest.allowedPaymentMethods,\n      existingPaymentMethodRequired: config.existingPaymentMethodRequired,\n    };\n\n    return request;\n  }\n\n  /**\n   * Constructs `loadPaymentData` request object based on button configuration.\n   *\n   * It infers request properties like `shippingAddressRequired`,\n   * `shippingOptionRequired`, and `billingAddressRequired` if not already set\n   * based on the presence of their associated options and parameters. It also\n   * infers `callbackIntents` based on the callback methods defined in button\n   * configuration.\n   *\n   * This method would normally be private but has been made public for\n   * testing purposes.\n   *\n   * @private\n   */\n  createLoadPaymentDataRequest(config: Config): google.payments.api.PaymentDataRequest {\n    const request = {\n      ...config.paymentRequest,\n      merchantInfo: this.createMerchantInfo(config),\n    };\n\n    // TODO: #13 re-enable inferrence if/when we agree as a team\n\n    return request;\n  }\n\n  private createMerchantInfo(config: Config): google.payments.api.MerchantInfo {\n    const merchantInfo: google.payments.api.MerchantInfo = {\n      ...config.paymentRequest.merchantInfo,\n    };\n\n    // apply softwareInfo if not set\n    if (!merchantInfo.softwareInfo) {\n      merchantInfo.softwareInfo = {\n        id: this.options.softwareInfoId,\n        version: this.options.softwareInfoVersion,\n      };\n    }\n\n    return merchantInfo;\n  }\n\n  private isMounted(): boolean {\n    return this.element != null && this.element.isConnected !== false;\n  }\n\n  private removeButton(): void {\n    if (this.element instanceof ShadowRoot || this.element instanceof Element) {\n      for (const child of Array.from(this.element.children)) {\n        if (child.tagName !== 'STYLE') {\n          child.remove();\n        }\n      }\n    }\n  }\n\n  private async updateElement(): Promise<void> {\n    if (!this.isMounted()) return;\n    const element = this.getElement()!;\n\n    if (!this.config) {\n      throw new Error('google-pay-button: Missing configuration');\n    }\n\n    // remove existing button\n    this.removeButton();\n\n    try {\n      this.client = new google.payments.api.PaymentsClient(this.createClientOptions(this.config));\n    } catch (err) {\n      if (this.config.onError) {\n        this.config.onError(err as Error);\n      } else {\n        console.error(err);\n      }\n      return;\n    }\n\n    const buttonOptions: google.payments.api.ButtonOptions = {\n      buttonType: this.config.buttonType,\n      buttonColor: this.config.buttonColor,\n      buttonRadius: this.config.buttonRadius,\n      buttonSizeMode: this.config.buttonSizeMode,\n      buttonLocale: this.config.buttonLocale,\n      buttonBorderType: this.config.buttonBorderType,\n      onClick: this.handleClick,\n      allowedPaymentMethods: this.config.paymentRequest.allowedPaymentMethods,\n    };\n\n    const rootNode = element.getRootNode();\n    if (rootNode instanceof ShadowRoot) {\n      buttonOptions.buttonRootNode = rootNode;\n    }\n\n    // pre-create button\n    const button = this.client.createButton(buttonOptions);\n\n    this.setClassName(element, [element.className, 'not-ready']);\n    element.appendChild(button);\n\n    let showButton = false;\n    let readyToPay: google.payments.api.IsReadyToPayResponse | undefined;\n\n    try {\n      readyToPay = await this.client.isReadyToPay(this.createIsReadyToPayRequest(this.config));\n      showButton =\n        (readyToPay.result && !this.config.existingPaymentMethodRequired)\n        || (readyToPay.result && readyToPay.paymentMethodPresent && this.config.existingPaymentMethodRequired)\n        || false;\n    } catch (err) {\n      if (this.config.onError) {\n        this.config.onError(err as Error);\n      } else {\n        console.error(err);\n      }\n    }\n\n    if (!this.isMounted()) return;\n\n    if (showButton) {\n      try {\n        this.client.prefetchPaymentData(this.createLoadPaymentDataRequest(this.config));\n      } catch (err) {\n        console.log('Error with prefetch', err);\n      }\n\n      // remove hidden className\n      this.setClassName(\n        element,\n        (element.className || '').split(' ').filter(className => className && className !== 'not-ready'),\n      );\n    }\n\n    if (this.isReadyToPay !== readyToPay?.result || this.paymentMethodPresent !== readyToPay?.paymentMethodPresent) {\n      this.isReadyToPay = !!readyToPay?.result;\n      this.paymentMethodPresent = readyToPay?.paymentMethodPresent;\n\n      if (this.config.onReadyToPayChange) {\n        const readyToPayResponse: ReadyToPayChangeResponse = {\n          isButtonVisible: showButton,\n          isReadyToPay: this.isReadyToPay,\n        };\n\n        if (this.paymentMethodPresent) {\n          readyToPayResponse.paymentMethodPresent = this.paymentMethodPresent;\n        }\n\n        this.config.onReadyToPayChange(readyToPayResponse);\n      }\n    }\n  }\n\n  /**\n   * Handles the click event of the Google Pay button.\n   *\n   * This method would normally be private but has been made public for\n   * testing purposes.\n   *\n   * @private\n   */\n  handleClick = async (event: Event): Promise<void> => {\n    const config = this.config;\n    if (!config) {\n      throw new Error('google-pay-button: Missing configuration');\n    }\n\n    const request = this.createLoadPaymentDataRequest(config);\n\n    try {\n      if (config.onClick) {\n        config.onClick(event);\n      }\n\n      if (event.defaultPrevented) {\n        return;\n      }\n\n      const result = await this.client!.loadPaymentData(request);\n\n      if (config.onLoadPaymentData) {\n        config.onLoadPaymentData(result);\n      }\n    } catch (err) {\n      if ((err as google.payments.api.PaymentsError).statusCode === 'CANCELED') {\n        if (config.onCancel) {\n          config.onCancel(err as google.payments.api.PaymentsError);\n        }\n      } else if (config.onError) {\n        config.onError(err as google.payments.api.PaymentsError);\n      } else {\n        console.error(err);\n      }\n    }\n  };\n\n  private setClassName(element: Element, classNames: string[]): void {\n    const className = classNames.filter(name => name).join(' ');\n    if (className) {\n      element.className = className;\n    } else {\n      element.removeAttribute('class');\n    }\n  }\n\n  private appendStyles(): void {\n    if (typeof document === 'undefined') return;\n\n    const rootNode = this.element?.getRootNode() as Document | ShadowRoot | undefined;\n    const styleId = `default-google-style-${this.options.cssSelector.replace(/[^\\w-]+/g, '')}-${\n      this.config?.buttonLocale\n    }`;\n\n    // initialize styles if rendering on the client:\n    if (rootNode) {\n      if (!rootNode.getElementById?.(styleId)) {\n        const style = document.createElement('style');\n        style.id = styleId;\n        style.type = 'text/css';\n        style.innerHTML = `\n          ${this.options.cssSelector} {\n            display: inline-block;\n          }\n          ${this.options.cssSelector}.not-ready {\n            width: 0;\n            height: 0;\n            overflow: hidden;\n          }\n        `;\n\n        if (rootNode instanceof Document && rootNode.head) {\n          rootNode.head.appendChild(style);\n        } else {\n          rootNode.appendChild(style);\n        }\n      }\n    }\n  }\n\n  private isClientInvalidated(newConfig: Config): boolean {\n    if (!this.oldInvalidationValues) return true;\n\n    const newValues = this.getInvalidationValues(newConfig);\n    return newValues.some(\n      (value, index) => JSON.stringify(value) !== JSON.stringify(this.oldInvalidationValues![index]),\n    );\n  }\n\n  private getInvalidationValues(config: Config): any[] {\n    return [\n      config.environment,\n      config.existingPaymentMethodRequired,\n      !!config.onPaymentDataChanged,\n      !!config.onPaymentAuthorized,\n      config.buttonType,\n      config.buttonColor,\n      config.buttonRadius,\n      config.buttonLocale,\n      config.buttonSizeMode,\n      config.buttonBorderType,\n      config.paymentRequest.merchantInfo.merchantId,\n      config.paymentRequest.merchantInfo.merchantName,\n      config.paymentRequest.merchantInfo.softwareInfo?.id,\n      config.paymentRequest.merchantInfo.softwareInfo?.version,\n      config.paymentRequest.allowedPaymentMethods,\n    ];\n  }\n}\n","/**\n * Copyright 2020 Google LLC\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 * Returns a new function that delays invocations to the original function\n * within a specified wait period. The last invocation within this time period\n * gets invoked. All earlier invocations are ignore.\n *\n * @param func The function to invoke.\n * @param wait The time in milliseconds to wait for idle invocations.\n */\nexport function debounce<T>(func: (...params: any[]) => T, wait = 0): () => Promise<T> {\n  let timeout: number | undefined;\n\n  return function (...args: any[]): Promise<any> {\n    window.clearTimeout(timeout);\n\n    const later = function (): any {\n      timeout = undefined;\n      return func(...args);\n    };\n\n    return new Promise(resolve => {\n      timeout = window.setTimeout(() => {\n        const result = later();\n        resolve(result);\n      }, wait);\n    });\n  };\n}\n","/**\n * Copyright 2020 Google LLC\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 { ButtonManager, Config } from '../../lib/button-manager';\nimport { Directive, ElementRef, Input, OnChanges, OnInit } from '@angular/core';\nimport { name as softwareId, version as softwareVersion } from '../package.json';\nimport { debounce } from '../../lib/debounce';\n\n@Directive({\n  selector: 'google-pay-button',\n})\nexport class GooglePayButtonComponent implements OnInit, OnChanges {\n  private manager = new ButtonManager({\n    cssSelector: 'google-pay-button',\n    softwareInfoId: softwareId,\n    softwareInfoVersion: softwareVersion,\n  });\n\n  @Input() paymentRequest!: google.payments.api.PaymentDataRequest;\n  @Input() environment!: google.payments.api.Environment;\n  @Input() existingPaymentMethodRequired!: boolean;\n  @Input() buttonColor?: google.payments.api.ButtonColor;\n  @Input() buttonType?: google.payments.api.ButtonType;\n  @Input() buttonRadius?: number;\n  @Input() buttonSizeMode?: google.payments.api.ButtonSizeMode;\n  @Input() buttonLocale?: string;\n  @Input() buttonBorderType?: google.payments.api.ButtonBorderType;\n  @Input() paymentDataChangedCallback?: google.payments.api.PaymentDataChangedHandler;\n  @Input() paymentAuthorizedCallback?: google.payments.api.PaymentAuthorizedHandler;\n  @Input() readyToPayChangeCallback?: (result: any) => void;\n  @Input() loadPaymentDataCallback?: (paymentData: google.payments.api.PaymentData) => void;\n  @Input() cancelCallback?: (reason: google.payments.api.PaymentsError) => void;\n  @Input() errorCallback?: (error: Error | google.payments.api.PaymentsError) => void;\n  @Input() clickCallback?: (event: Event) => void;\n\n  constructor(private elementRef: ElementRef) {}\n\n  get isReadyToPay(): boolean | undefined {\n    return this.manager.isReadyToPay;\n  }\n\n  ngOnInit(): Promise<void> {\n    return this.manager.mount(this.elementRef.nativeElement);\n  }\n\n  ngOnChanges(): Promise<void> {\n    return this.initializeButton();\n  }\n\n  private initializeButton = debounce(() => {\n    if (!this.assertRequiredProperty('paymentRequest')) {\n      return;\n    }\n\n    if (!this.assertRequiredProperty('environment')) {\n      return;\n    }\n\n    const config: Config = {\n      paymentRequest: this.paymentRequest,\n      environment: this.environment,\n      existingPaymentMethodRequired: this.existingPaymentMethodRequired,\n      onPaymentDataChanged: this.paymentDataChangedCallback,\n      onPaymentAuthorized: this.paymentAuthorizedCallback,\n      buttonColor: this.buttonColor,\n      buttonType: this.buttonType,\n      buttonRadius: this.buttonRadius,\n      buttonSizeMode: this.buttonSizeMode,\n      buttonLocale: this.buttonLocale,\n      buttonBorderType: this.buttonBorderType,\n      onReadyToPayChange: result => {\n        if (this.readyToPayChangeCallback) {\n          this.readyToPayChangeCallback(result);\n        }\n        this.dispatch('readytopaychange', result);\n      },\n      onCancel: reason => {\n        if (this.cancelCallback) {\n          this.cancelCallback(reason);\n        }\n        this.dispatch('cancel', reason);\n      },\n      onError: error => {\n        if (this.errorCallback) {\n          this.errorCallback?.(error);\n        }\n        this.elementRef.nativeElement.dispatchEvent(new ErrorEvent('error', { error }));\n      },\n      onLoadPaymentData: paymentData => {\n        if (this.loadPaymentDataCallback) {\n          this.loadPaymentDataCallback(paymentData);\n        }\n        this.dispatch('loadpaymentdata', paymentData);\n      },\n      onClick: event => {\n        if (this.clickCallback) {\n          this.clickCallback?.(event);\n        }\n      },\n    };\n\n    this.manager.configure(config);\n  });\n\n  private assertRequiredProperty(name: string): boolean {\n    const value = (this as any)[name];\n    if (value === null || value === undefined) {\n      this.throwError(Error(`Required property not set: ${name}`));\n      return false;\n    }\n\n    return true;\n  }\n\n  /**\n   * Throws an error.\n   *\n   * Used for testing purposes so that the method can be spied on.\n   */\n  private throwError(error: Error): never {\n    throw error;\n  }\n\n  private dispatch<T>(type: string, detail: T): void {\n    this.elementRef.nativeElement.dispatchEvent(\n      new CustomEvent(type, {\n        bubbles: true,\n        cancelable: false,\n        detail,\n      }),\n    );\n  }\n}\n","/**\n * Copyright 2020 Google LLC\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 { GooglePayButtonComponent } from './google-pay-button.component';\nimport { NgModule } from '@angular/core';\n\n@NgModule({\n  declarations: [GooglePayButtonComponent],\n  imports: [],\n  exports: [GooglePayButtonComponent],\n})\nexport class GooglePayButtonModule {}\n","/**\n * Copyright 2020 Google LLC\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 * Public API Surface of google-pay-button\n */\n\nexport * from './button-angular/lib/google-pay-button.component';\nexport * from './button-angular/lib/google-pay-button.module';\n\nexport { ReadyToPayChangeResponse } from './lib/button-manager';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './angular-public-api';\n"],"names":["softwareId","softwareVersion"],"mappings":";;;AAAA;;;;;;;;;;;;;;AAcG;AAEH;;AAEG;AACH,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