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AC,IAAI,CAAC,EAAE,EAAE,sBAAsB,CAAC,CAAC;QACjE,IAAI,CAAC,OAAO,CAAC,WAAW,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IACpC,CAAC;IAEO,iCAAkB,GAA1B,UAA2B,IAA4B;QACrD,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC;IAC9D,CAAC;IAEM,mBAAI,GAAX;QACE,QAAE,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,QAAQ,CAAC,cAAc,CAAC,CAAC;IAC5C,CAAC;IAEM,mBAAI,GAAX;QACE,QAAE,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,WAAW,CAAC,cAAc,CAAC,CAAC;IAC/C,CAAC;IAhEM,OAAE,GAAG,MAAM,CAAC;IAEZ,aAAQ,GAAG;QAChB,8BAAc,CAAC;YACb,IAAI,EAAE,IAAI;SACX,CAAC,CAAC;IACL,CAAC,CAAC;IAEF;;;OAGG;IACI,YAAO,GAAiB;QAC7B;;;;;;WAMG;QACH,MAAM,EAAE,mCAAgB,CAAC,iBAAiB,EAAmB;KAC9D,CAAC;IA4CJ,WAAC;CAAA,CAlEyB,qBAAS,GAkElC;AAlEY,oBAAI;AAoEjB,+BAAc,CAAC,2BAA2B,CAAC,IAAI,CAAC,CAAC","file":"Logo__d2b01b0f173a0c131e66.js","sourcesContent":["import { IQuerySuccessEventArgs, QueryEvents } from '../../events/QueryEvents';\nimport { exportGlobally } from '../../GlobalExports';\nimport { l } from '../../strings/Strings';\nimport { $$ } from '../../utils/Dom';\nimport { SVGDom } from '../../utils/SVGDom';\nimport { SVGIcons } from '../../utils/SVGIcons';\nimport { Component } from '../Base/Component';\nimport { IComponentBindings } from '../Base/ComponentBindings';\nimport { ComponentOptions } from '../Base/ComponentOptions';\nimport { Initialization } from '../Base/Initialization';\n\nexport type ValidLogoTarget = '_top' | '_blank' | '_self' | '_parent';\n\nexport interface ILogoOptions {\n target: string;\n}\n\n/**\n * The Logo component adds a clickable Coveo logo in the search interface.\n */\nexport class Logo extends Component {\n static ID = 'Logo';\n\n static doExport = () => {\n exportGlobally({\n Logo: Logo\n });\n };\n\n /**\n * The possible options for the component\n * @componentOptions\n */\n static options: ILogoOptions = {\n /**\n * Specifies how the link to the Coveo website should be opened.\n *\n * Valid values supported are `_top`, `_blank`, `_self`, `_parent`.\n *\n * Default value is `undefined`, meaning standard browser behaviour for links will be respected.\n */\n target: ComponentOptions.buildStringOption<ValidLogoTarget>()\n };\n\n /**\n * Creates a new Logo component.\n * @param element The HTMLElement on which to instantiate the component.\n * @param options The options for the Logo component.\n * @param bindings The bindings that the component requires to function normally. If not set, these will be\n * automatically resolved (with a slower execution time).\n */\n constructor(public element: HTMLElement, public options?: ILogoOptions, bindings?: IComponentBindings) {\n super(element, Logo.ID, bindings);\n this.options = ComponentOptions.initComponentOptions(element, Logo, options);\n this.buildLink();\n this.bind.onRootElement(QueryEvents.queryError, () => this.hide());\n this.bind.onRootElement(QueryEvents.querySuccess, (data: IQuerySuccessEventArgs) => this.handleQuerySuccess(data));\n }\n\n private buildLink() {\n const link = $$(\n 'a',\n {\n className: 'coveo-powered-by coveo-footer-logo',\n href: 'https://www.coveo.com/',\n 'aria-label': l('CoveoHomePage')\n },\n SVGIcons.icons.coveoPoweredBy\n );\n this.options.target && link.setAttribute('target', this.options.target);\n\n SVGDom.addClassToSVGInContainer(link.el, 'coveo-powered-by-svg');\n this.element.appendChild(link.el);\n }\n\n private handleQuerySuccess(data: IQuerySuccessEventArgs) {\n data.results.results.length > 0 ? this.show() : this.hide();\n }\n\n public hide() {\n $$(this.element).addClass('coveo-hidden');\n }\n\n public show() {\n $$(this.element).removeClass('coveo-hidden');\n }\n}\n\nInitialization.registerAutoCreateComponent(Logo);\n\n\n\n// WEBPACK FOOTER //\n// ./src/ui/Logo/Logo.ts"],"sourceRoot":""}