{"version":3,"file":"zakarliuka-ng-telegram-webapp.mjs","sources":["../../../projects/ng-telegram-webapp/src/lib/button.ts","../../../projects/ng-telegram-webapp/src/lib/back-button.ts","../../../projects/ng-telegram-webapp/src/lib/cloud-storage.ts","../../../projects/ng-telegram-webapp/src/lib/haptic-feedback.ts","../../../projects/ng-telegram-webapp/src/lib/main-button.ts","../../../projects/ng-telegram-webapp/src/lib/telegram-webapp.token.ts","../../../projects/ng-telegram-webapp/src/lib/telegram-webapp.service.ts","../../../projects/ng-telegram-webapp/src/public-api.ts","../../../projects/ng-telegram-webapp/src/zakarliuka-ng-telegram-webapp.ts"],"sourcesContent":["import { TelegramWebApp } from '@zakarliuka/tg-webapp-types';\nimport { Observable } from 'rxjs';\n\nexport abstract class TwaButton<\n  T extends TelegramWebApp.MainButton | TelegramWebApp.BackButton\n> {\n\n  public readonly clicks$: Observable<void>;\n\n  constructor(protected readonly button: T) {\n    this.clicks$ = new Observable<void>(subscriber => {\n      const clickHandler = subscriber.next.bind(subscriber);\n      button.onClick(clickHandler);\n\n      return () => {\n        button.offClick(clickHandler);\n      };\n    });\n  }\n\n  /**\n   *  A method to make the button active and visible.\n   */\n  show() {\n    this.button.show();\n  }\n\n  /**\n   *  A method to hide the button.\n   */\n  hide() {\n    this.button.hide();\n  }\n}\n","import { TelegramWebApp } from '@zakarliuka/tg-webapp-types';\nimport { TwaButton } from './button';\n\nexport class BackButton extends TwaButton<TelegramWebApp.BackButton> {\n  get isVisible() {\n    return this.button.isVisible;\n  }\n}\n","import { TelegramWebApp } from '@zakarliuka/tg-webapp-types';\nimport { Observable } from 'rxjs';\n\nexport class CloudStorage {\n  constructor(private readonly storage: TelegramWebApp.CloudStorage) {}\n\n  /**\n   * Bot API 6.9+ A method that stores a value in the cloud storage using the specified key.\n   *\n   * The key should contain 1-128 characters, only A-Z, a-z, 0-9, _ and - are allowed.\n   *\n   * The value should contain 0-4096 characters. You can store up to 1024 keys in the cloud storage.\n   */\n  setItem(key: string, value: string) {\n    return new Observable<boolean>(subscriber => {\n      this.storage.setItem(key, value, (error, success) => {\n        if (error) {\n          subscriber.error(error);\n          return;\n        }\n\n        subscriber.next(success);\n        subscriber.complete();\n      });\n    });\n  }\n\n  /**\n   * Bot API 6.9+ A method that receives a value from the cloud storage using the specified key.\n   *\n   * The key should contain 1-128 characters, only A-Z, a-z, 0-9, _ and - are allowed.\n   */\n  getItem(key: string) {\n    return new Observable(subscriber => {\n      this.storage.getItem(key, (error, value) => {\n        if (error) {\n          subscriber.error(error);\n          return;\n        }\n\n        subscriber.next(value);\n        subscriber.complete();\n      });\n    })\n  }\n\n  /**\n   * Bot API 6.9+ A method that receives values from the cloud storage using the specified keys.\n   *\n   * The keys should contain 1-128 characters, only A-Z, a-z, 0-9, _ and - are allowed.\n   */\n  getItems<T extends string>(keys: T[]) {\n    return new Observable<Record<T, string>>(subscriber => {\n      this.storage.getItems(keys, (error, values) => {\n        if (error) {\n          subscriber.error(error);\n          return;\n        }\n\n        subscriber.next(values);\n        subscriber.complete();\n      });\n    })\n  }\n\n  /**\n   * Bot API 6.9+ A method that removes a value from the cloud storage using the specified key.\n   *\n   * The key should contain 1-128 characters, only A-Z, a-z, 0-9, _ and - are allowed.\n   */\n  removeItem(key: string) {\n    return new Observable<boolean>(subscriber => {\n      this.storage.removeItem(key, (error, success) => {\n        if (error) {\n          subscriber.error(error);\n          return;\n        }\n\n        subscriber.next(success);\n        subscriber.complete();\n      });\n    });\n  }\n\n  /**\n   * Bot API 6.9+ A method that removes values from the cloud storage using the specified keys.\n   *\n   * The keys should contain 1-128 characters, only A-Z, a-z, 0-9, _ and - are allowed.\n   */\n  removeItems(keys: string[]) {\n    return new Observable<boolean>(subscriber => {\n      this.storage.removeItems(keys, (error, success) => {\n        if (error) {\n          subscriber.error(error);\n          return;\n        }\n\n        subscriber.next(success);\n        subscriber.complete();\n      });\n    });\n  }\n\n  /**\n   *  Bot API 6.9+ A method that receives the list of all keys stored in the cloud storage.\n   */\n  getKeys() {\n    return new Observable<string[]>(subscriber => {\n      this.storage.getKeys((error, keys) => {\n        if (error) {\n          subscriber.error(error);\n          return;\n        }\n\n        subscriber.next(keys);\n        subscriber.complete();\n      });\n    });\n  }\n}\n","import { TelegramWebApp } from '@zakarliuka/tg-webapp-types';\n\nexport class HapticFeedback {\n  constructor(private readonly haptic: TelegramWebApp.HapticFeedback) {}\n\n  /**\n   * Bot API 6.1+ A method tells that an impact occurred. The Telegram app may play the appropriate haptics based on the style value passed.\n   */\n  impactOccurred(style: 'light' | 'medium' | 'heavy' | 'rigid' | 'soft') {\n    this.haptic.impactOccurred(style);\n    return this;\n  }\n\n  /**\n   * Bot API 6.1+ A method tells that a task or action has succeeded, failed, or produced a warning. The Telegram app may play the appropriate haptics based on the type value passed.\n   */\n  notificationOccurred(type: 'error' | 'success' | 'warning') {\n    this.haptic.notificationOccurred(type);\n    return this;\n  }\n\n  /**\n   * Bot API 6.1+ A method tells that the user has changed a selection. The Telegram app may play the appropriate haptics.\n   *\n   * Do not use this feedback when the user makes or confirms a selection; use it only when the selection changes.\n   */\n  selectionChanged() {\n    this.haptic.selectionChanged();\n    return this;\n  }\n}\n","import { TelegramWebApp } from '@zakarliuka/tg-webapp-types';\nimport { TwaButton } from './button';\n\nexport class MainButton extends TwaButton<TelegramWebApp.MainButton> {\n\n  /**\n   * Current button text\n   */\n  get text() {\n    return this.button.text;\n  }\n\n  /**\n   * Current button color.\n   */\n  get color() {\n    return this.button.color;\n  }\n\n  /**\n   * Current button text color.\n   */\n  get textColor() {\n    return this.button.textColor;\n  }\n\n  /**\n   * Shows whether the button is visible. Set to false by default.\n   */\n  get isVisible() {\n    return this.button.isVisible;\n  }\n\n  /**\n   * Shows whether the button is active. Set to true by default.\n   */\n  get isActive() {\n    return this.button.isActive;\n  }\n\n  /**\n   *  Shows whether the button is displaying a loading indicator.\n   */\n  get isProgressVisible() {\n    return this.button.isProgressVisible;\n  }\n\n  /**\n   * A method to set the button text.\n   */\n  setText(text: string) {\n    this.button.setText(text);\n    return this;\n  }\n\n  /**\n   *  A method to enable the button.\n   */\n  enable() {\n    this.button.enable();\n    return this;\n  }\n\n  /**\n   * A method to disable the button.\n   */\n  disable() {\n    this.button.disable();\n    return this;\n  }\n\n  /**\n   * A method to show a loading indicator on the button.\n   * @param leaveActive  when leaveActive=true is passed, the button remains enabled.\n   */\n  showProgress(leaveActive = false) {\n    this.button.showProgress(leaveActive);\n    return this;\n  }\n\n  /**\n   * Shows whether the button is active. Set to true by default.\n   */\n  hideProgress() {\n    this.button.hideProgress();\n    return this;\n  }\n\n  /**\n   * A method to set the button parameters. The params parameter is an object containing one or several fields that need to be changed:\n   * - text - button text;\n   * - color - button color;\n   * - text_color - button text color;\n   * - is_active - enable the button;\n   * - is_visible - show the button.\n   */\n  setParams(params: Parameters<TelegramWebApp.MainButton['setParams']>[0]) {\n    this.button.setParams(params);\n    return this;\n  }\n}\n","import { InjectionToken } from '@angular/core';\nimport { TelegramWebApp } from '@zakarliuka/tg-webapp-types';\n\nexport const TWA = new InjectionToken<TelegramWebApp.WebApp>(\n  'instance of telegram webapp',\n  {\n    providedIn: 'root',\n    factory: () => {\n      if(!Telegram || !Telegram.WebApp){\n        throw new Error('Telegram context not found. Initialize mini app first: https://core.telegram.org/bots/webapps#initializing-mini-apps');\n      }\n\n      return Telegram.WebApp;\n    },\n  }\n);\n","import { Injectable, inject } from '@angular/core';\nimport { TelegramWebApp } from '@zakarliuka/tg-webapp-types';\nimport { Observable } from 'rxjs';\nimport { BackButton } from './back-button';\nimport { CloudStorage } from './cloud-storage';\nimport { HapticFeedback } from './haptic-feedback';\nimport { MainButton } from './main-button';\nimport { TWA } from './telegram-webapp.token';\n\ntype EventDataMap = {\n  themeChanged: void;\n  viewportChanged: { isStateStable: boolean };\n  mainButtonClicked: void;\n  backButtonClicked: void;\n  settingsButtonClicked: void;\n  invoiceClosed: TelegramWebApp.PaymentStatus;\n  popupClosed: { button_id: string | null };\n  qrTextReceived: { data: string };\n  clipboardTextReceived: { data: string | null };\n  writeAccessRequested: { status: 'allowed' | 'cancelled' };\n  contactRequested: { status: 'sent' | 'cancelled' };\n};\n\ntype ChatType = 'users' | 'bots' | 'groups' | 'channels';\n\n@Injectable({\n  providedIn: 'root',\n})\nexport class TelegramWebappService {\n\n  readonly webApp = inject(TWA);\n\n  readonly backButton = new BackButton(this.webApp.BackButton);\n  readonly mainButton = new MainButton(this.webApp.MainButton);\n  readonly hapticFeedback = new HapticFeedback(this.webApp.HapticFeedback);\n  readonly cloudStorage = new CloudStorage(this.webApp.CloudStorage);\n\n  /**\n   * A string with raw data transferred to the Mini App, convenient for validating data.\n   */\n  get initData() {\n    return this.webApp.initData;\n  }\n\n  /**\n   * An object with input data transferred to the Mini App.\n   */\n  get initDataUnsafe() {\n    return this.webApp.initDataUnsafe;\n  }\n\n  /**\n   * The version of the Bot API available in the user's Telegram app.\n   */\n  get webappVersion() {\n    return this.webApp.version;\n  }\n\n  /**\n   * The name of the platform of the user's Telegram app.\n   */\n  get platform() {\n    return this.webApp.platform;\n  }\n\n  /**\n   * The color scheme currently used in the Telegram app. Either \"light\" or \"dark\". Also available as the CSS variable var(--tg-color-scheme).\n   */\n  get colorScheme() {\n    return this.webApp.colorScheme;\n  }\n\n  /**\n   * An object containing the current theme settings used in the Telegram app.\n   */\n  get themeParams() {\n    return this.webApp.themeParams;\n  }\n\n  /**\n   * True, if the Mini App is expanded to the maximum available height. False, if the Mini App occupies part of the screen and can be expanded to the full height using the expand() method.\n   */\n  get isExpanded() {\n    return this.webApp.isExpanded;\n  }\n\n  /**\n   * The current height of the visible area of the Mini App. Also available in CSS as the variable var(--tg-viewport-height).\n   */\n  get viewportHeight() {\n    return this.webApp.viewportHeight;\n  }\n\n  /**\n   * The height of the visible area of the Mini App in its last stable state. Also available in CSS as a variable var(--tg-viewport-stable-height).\n   */\n  get viewportStableHeight() {\n    return this.webApp.viewportStableHeight;\n  }\n\n  /**\n   * Current header color in the #RRGGBB format.\n   */\n  get headerColor() {\n    return this.webApp.headerColor;\n  }\n\n  /**\n   * Current background color in the #RRGGBB format.\n   */\n  get backgroundColor() {\n    return this.webApp.backgroundColor;\n  }\n\n  /**\n   * True, if the confirmation dialog is enabled while the user is trying to close the Mini App. False, if the confirmation dialog is disabled.\n   */\n  get isClosingConfirmationEnabled() {\n    return this.webApp.isClosingConfirmationEnabled;\n  }\n\n  /**\n   * A method that informs the Telegram app that the Mini App is ready to be displayed.\n   */\n  ready() {\n    this.webApp.ready();\n  }\n\n  /**\n   * A method that expands the Mini App to the maximum available height.\n   */\n  expand() {\n    if (this.webApp && !this.webApp.isExpanded) {\n      this.webApp.expand();\n    }\n  }\n\n  /**\n   * A method that closes the Mini App.\n   */\n  close() {\n    this.webApp.close();\n  }\n\n  /**\n   * Function that sets the app event handler.\n   * @param event - The mini app events. {@link https://core.telegram.org/bots/webapps#events-available-for-mini-apps list of available events}\n   * @returns a data depends on event type\n   */\n  onEvent<T extends keyof EventDataMap>(event: T): Observable<EventDataMap[T]> {\n    return new Observable<EventDataMap[T]>((subscriber) => {\n      const cb = subscriber.next.bind(subscriber);\n      this.webApp.onEvent(event, cb);\n\n      return () => {\n        this.webApp.offEvent(event, cb);\n      };\n    });\n  }\n\n  /**\n   *  Function that sets the app header color in the #RRGGBB format.\n   */\n  setHeaderColor(color: string) {\n    this.webApp.setHeaderColor(color);\n  }\n\n  /**\n   *  Function that sets the app background color in the #RRGGBB format.\n   */\n  setBackgroundColor(color: string) {\n    this.webApp.setBackgroundColor(color);\n  }\n\n  /**\n   * Function that enables a confirmation dialog while the user is trying to close the Mini App.\n   */\n  enableClosingConfirmation() {\n    this.webApp.enableClosingConfirmation();\n  }\n\n  /**\n   * Function that disables the confirmation dialog while the user is trying to close the Mini App.\n   */\n  disableClosingConfirmation() {\n    this.webApp.disableClosingConfirmation();\n  }\n\n  /**\n   * Function used to send data to the bot. When this method is called, a\n   * service message is sent to the bot containing the data of the length\n   * up to 4096 bytes, and the Mini App is closed. See the field web_app_data\n   * in the class Message. This method is only available for Mini Apps launched\n   * via a Keyboard button.\n   */\n  sendData(data: object | string | number | boolean | undefined) {\n    const payload = JSON.stringify(data || '');\n    this.webApp.sendData(payload);\n  }\n\n  /**\n   * Function that shows a native popup for scanning a QR code described by the params argument of the type ScanQrPopupParams.\n   */\n  showScanQrPopup(params: TelegramWebApp.ScanQrPopupParams = {}) {\n    return new Observable<string>(subscriber => {\n      this.webApp.showScanQrPopup(params, subscriber.next.bind(subscriber));\n\n      return () => {\n        this.webApp.closeScanQrPopup();\n      };\n    });\n  }\n\n  /**\n   * Function that closes the native popup for scanning a QR code opened with the showScanQrPopup method.\n   */\n  closeScanQrPopup() {\n    this.webApp.closeScanQrPopup();\n  }\n\n  /**\n   * Function that opens a link in an external browser.\n   */\n  openLink(url: string, options?: { try_instant_view: boolean }) {\n    this.webApp.openLink(url, options);\n  }\n\n  /**\n   * Function that opens a telegram link inside Telegram app. The Mini App will be closed.\n   */\n  openTelegramLink(url: string) {\n    return this.webApp.openTelegramLink(url);\n  }\n\n  /**\n   * Function that opens an invoice using the link url.\n   */\n  openInvoice(url: string) {\n    return new Observable<TelegramWebApp.PaymentStatus>(subscriber => {\n      this.webApp.openInvoice(url, (status: TelegramWebApp.PaymentStatus) => {\n        subscriber.next(status);\n        subscriber.complete();\n      });\n    })\n  }\n\n  /**\n   * Function that shows a native popup described by the params argument of the type PopupParams.\n   */\n  showPopup(params: TelegramWebApp.PopupParams) {\n    return new Observable<string>(subscriber => {\n      this.webApp.showPopup(params, (buttonId: string) => {\n        subscriber.next(buttonId);\n        subscriber.complete();\n      });\n    });\n  }\n\n  /**\n   * Function that shows a native popup described by the params argument of the type PopupParams.\n   */\n  showAlert(msg: string) {\n    return new Observable<void>(subscriber => {\n      this.webApp.showAlert(msg, () => {\n        subscriber.next();\n        subscriber.complete();\n      });\n    });\n  }\n\n  /**\n   * Function that shows message in a simple confirmation window with 'OK' and 'Cancel' buttons.\n   */\n  showConfirm(msg: string) {\n    return new Observable<boolean>(subscriber => {\n      this.webApp.showConfirm(msg, (okButtonPressed: boolean) => {\n        subscriber.next(okButtonPressed);\n        subscriber.complete();\n      });\n    });\n  }\n\n  /**\n   * Function that shows a native popup requesting permission for the bot to send messages to the user.\n   */\n  requestWriteAccess() {\n    return new Observable<boolean>(subscriber => {\n      this.webApp.requestWriteAccess((isAccessGranted: boolean) => {\n        subscriber.next(isAccessGranted);\n        subscriber.complete();\n      });\n    });\n  }\n\n  /**\n   * Function that inserts the bot's username and the specified inline query in the current chat's input field.\n   */\n  switchInlineQuery(query: string = '', chatTypes?: ChatType[] | undefined) {\n    this.webApp.switchInlineQuery(query, chatTypes);\n  }\n\n  /**\n   * Function that shows a native popup prompting the user for their phone number.\n   */\n  requestContact() {\n    return new Observable<boolean>(subscriber => {\n      this.webApp.requestContact((isContactShared: boolean) => {\n        subscriber.next(isContactShared);\n        subscriber.complete();\n      });\n    })\n  }\n\n  /**\n   *  Function that requests text from the clipboard.\n   */\n  readTextFromClipboard() {\n    return new Observable<string | null>((subscriber) => {\n      this.webApp.readTextFromClipboard((clipboardText: string | null) => {\n        subscriber.next(clipboardText);\n        subscriber.complete();\n      });\n    });\n  }\n}\n","/*\n * Public API Surface of ng-telegram-webapp\n */\n\nexport * from './lib/telegram-webapp.service';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;MAGsB,SAAS,CAAA;AAM7B,IAAA,WAAA,CAA+B,MAAS,EAAA;QAAT,IAAM,CAAA,MAAA,GAAN,MAAM,CAAG;QACtC,IAAI,CAAC,OAAO,GAAG,IAAI,UAAU,CAAO,UAAU,IAAG;YAC/C,MAAM,YAAY,GAAG,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;AACtD,YAAA,MAAM,CAAC,OAAO,CAAC,YAAY,CAAC,CAAC;AAE7B,YAAA,OAAO,MAAK;AACV,gBAAA,MAAM,CAAC,QAAQ,CAAC,YAAY,CAAC,CAAC;AAChC,aAAC,CAAC;AACJ,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