{"version":3,"sources":["Logo.min__00ecf0bd3e47c7b52b32.js","./src/ui/Logo/Logo.ts"],"names":["webpackJsonpCoveo__temporary","257","module","exports","__webpack_require__","__extends","this","extendStatics","Object","setPrototypeOf","__proto__","Array","d","b","p","hasOwnProperty","__","constructor","prototype","create","defineProperty","value","element","options","bindings","Logo","ID","ComponentOptions","initComponentOptions","buildLink","bind","onRootElement","QueryEvents","queryError","hide","querySuccess","data","handleQuerySuccess","_this","link","$$","className","href","l","SVGIcons","icons","coveoPoweredBy","target","setAttribute","SVGDom","addClassToSVGInContainer","el","appendChild","results","length","show","addClass","removeClass","doExport","exportGlobally","buildStringOption","Component","Initialization","registerAutoCreateComponent"],"mappings":"AAAAA,8BAA8B,KAExBC,IACA,SAAUC,EAAQC,EAASC,GAEjC,YAEA,IAAIC,GAAaC,MAAQA,KAAKD,WAAc,WACxC,GAAIE,GAAgBC,OAAOC,iBACpBC,uBAA2BC,QAAS,SAAUC,EAAGC,GAAKD,EAAEF,UAAYG,IACvE,SAAUD,EAAGC,GAAK,IAAK,GAAIC,KAAKD,GAAOA,EAAEE,eAAeD,KAAIF,EAAEE,GAAKD,EAAEC,IACzE,OAAO,UAAUF,EAAGC,GAEhB,QAASG,KAAOV,KAAKW,YAAcL,EADnCL,EAAcK,EAAGC,GAEjBD,EAAEM,UAAkB,OAANL,EAAaL,OAAOW,OAAON,IAAMG,EAAGE,UAAYL,EAAEK,UAAW,GAAIF,OAGvFR,QAAOY,eAAejB,EAAS,cAAgBkB,OAAO,GCjBtD,aACA,OACA,OACA,OACA,QACA,QACA,OAEA,OACA,OAWA,cA+BE,WAAmBC,EAA6BC,EAAwBC,GAAxE,MACE,YAAMF,EAASG,EAAKC,GAAIF,IAAS,IDL7B,OCIa,GAAAF,UAA6B,EAAAC,UAE9C,EAAKA,QAAU,EAAAI,iBAAiBC,qBAAqBN,EAASG,EAAMF,GACpE,EAAKM,YACL,EAAKC,KAAKC,cAAc,EAAAC,YAAYC,WAAY,WAAM,SAAKC,SAC3D,EAAKJ,KAAKC,cAAc,EAAAC,YAAYG,aAAc,SAACC,GAAiC,SAAKC,mBAAmBD,KDTjGE,ECuCf,MAlE0B,QAuChB,YAAAT,UAAR,WACE,GAAMU,GAAO,EAAAC,GACX,KAEEC,UAAW,qCACXC,KAAM,yBACN,aAAc,EAAAC,EAAE,kBAElB,EAAAC,SAASC,MAAMC,eAEjBxC,MAAKiB,QAAQwB,QAAUR,EAAKS,aAAa,SAAU1C,KAAKiB,QAAQwB,QAEhE,EAAAE,OAAOC,yBAAyBX,EAAKY,GAAI,wBACzC7C,KAAKgB,QAAQ8B,YAAYb,EAAKY,KAGxB,YAAAd,mBAAR,SAA2BD,GACzBA,EAAKiB,QAAQA,QAAQC,OAAS,EAAIhD,KAAKiD,OAASjD,KAAK4B,QAGhD,YAAAA,KAAP,WACE,EAAAM,GAAGlC,KAAKgB,SAASkC,SAAS,iBAGrB,YAAAD,KAAP,WACE,EAAAf,GAAGlC,KAAKgB,SAASmC,YAAY,iBA/DxB,EAAA/B,GAAK,OAEL,EAAAgC,SAAW,WAChB,EAAAC,gBACElC,KAAMA,KAQH,EAAAF,SAQLwB,OAAQ,EAAApB,iBAAiBiC,qBA6C7B,GAlE0B,EAAAC,UAAb,GAAApC,OAoEb,EAAAqC,eAAeC,4BAA4BtC","file":"Logo.min__00ecf0bd3e47c7b52b32.js","sourcesContent":["webpackJsonpCoveo__temporary([80],{\n\n/***/ 257:\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar QueryEvents_1 = __webpack_require__(11);\nvar GlobalExports_1 = __webpack_require__(3);\nvar Strings_1 = __webpack_require__(6);\nvar Dom_1 = __webpack_require__(1);\nvar SVGDom_1 = __webpack_require__(15);\nvar SVGIcons_1 = __webpack_require__(12);\nvar Component_1 = __webpack_require__(7);\nvar ComponentOptions_1 = __webpack_require__(8);\nvar Initialization_1 = __webpack_require__(2);\n/**\n * The Logo component adds a clickable Coveo logo in the search interface.\n */\nvar Logo = /** @class */ (function (_super) {\n __extends(Logo, _super);\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 function Logo(element, options, bindings) {\n var _this = _super.call(this, element, Logo.ID, bindings) || this;\n _this.element = element;\n _this.options = options;\n _this.options = ComponentOptions_1.ComponentOptions.initComponentOptions(element, Logo, options);\n _this.buildLink();\n _this.bind.onRootElement(QueryEvents_1.QueryEvents.queryError, function () { return _this.hide(); });\n _this.bind.onRootElement(QueryEvents_1.QueryEvents.querySuccess, function (data) { return _this.handleQuerySuccess(data); });\n return _this;\n }\n Logo.prototype.buildLink = function () {\n var link = Dom_1.$$('a', {\n className: 'coveo-powered-by coveo-footer-logo',\n href: 'https://www.coveo.com/',\n 'aria-label': Strings_1.l('CoveoHomePage')\n }, SVGIcons_1.SVGIcons.icons.coveoPoweredBy);\n this.options.target && link.setAttribute('target', this.options.target);\n SVGDom_1.SVGDom.addClassToSVGInContainer(link.el, 'coveo-powered-by-svg');\n this.element.appendChild(link.el);\n };\n Logo.prototype.handleQuerySuccess = function (data) {\n data.results.results.length > 0 ? this.show() : this.hide();\n };\n Logo.prototype.hide = function () {\n Dom_1.$$(this.element).addClass('coveo-hidden');\n };\n Logo.prototype.show = function () {\n Dom_1.$$(this.element).removeClass('coveo-hidden');\n };\n Logo.ID = 'Logo';\n Logo.doExport = function () {\n GlobalExports_1.exportGlobally({\n Logo: Logo\n });\n };\n /**\n * The possible options for the component\n * @componentOptions\n */\n Logo.options = {\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_1.ComponentOptions.buildStringOption()\n };\n return Logo;\n}(Component_1.Component));\nexports.Logo = Logo;\nInitialization_1.Initialization.registerAutoCreateComponent(Logo);\n\n\n/***/ })\n\n});\n\n\n// WEBPACK FOOTER //\n// Logo.min__00ecf0bd3e47c7b52b32.js","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":""}