import { FaviconFile , FaviconHtmlElement } from "../index.js" ; import { FaviconOptions , IconOptions } from "../config/defaults.js" ; import { transparentIcon } from "../config/icons.js" ; import { Dictionary , relativeTo } from "../helpers.js" ; import { logContext , Logger } from "../logger.js" ; import { Platform , uniformIconOptions } from "./base.js" ; const ICONS_OPTIONS = { "yandex-browser-50x50.png" : transparentIcon ( 50 ) , } ; export class YandexPlatform extends Platform { constructor ( options , logger ) { super ( options , uniformIconOptions ( options , options . icons . yandex , ICONS_OPTIONS ) , logContext ( logger , "yandex" ) ) ; } async createFiles ( ) { return [ this . manifest ( ) ] ; } async createHtml ( ) { return [ `<link rel="yandex-tableau-widget" href="${ this . relative ( this . manifestFileName ( ) ) }">` ] ; } private manifestFileName ( ) { return ( this . options . files ?. yandex ?. manifestFileName ?? "yandex-browser-manifest.json" ) ; } private manifest ( ) { const basePath = this . options . manifestRelativePaths ? null : this . options . path ; const logo = Object . keys ( this . iconOptions ) [ 0 ] ; const properties = { version : this . options . version , api_version : 1 , layout : { logo : relativeTo ( basePath , logo ) , color : this . options . background , show_title : true , } , } ; return { name : this . manifestFileName ( ) , contents : JSON . stringify ( properties , null , 2 ) , } ; } }