var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
  if (kind === "a" && !f)
    throw new TypeError("Private accessor was defined without a getter");
  if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
    throw new TypeError("Cannot read private member from an object whose class did not declare it");
  return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
};
var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
  if (kind === "m")
    throw new TypeError("Private method is not writable");
  if (kind === "a" && !f)
    throw new TypeError("Private accessor was defined without a setter");
  if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
    throw new TypeError("Cannot write private member to an object whose class did not declare it");
  return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
};
var _KlevuProductQueryPopup_instances, _KlevuProductQueryPopup_popup, _KlevuProductQueryPopup_layoutElement, _KlevuProductQueryPopup_contentDiv, _KlevuProductQueryPopup_sendMessage, _KlevuProductQueryPopup_register, _KlevuProductQueryPopup_pqafeedback, _KlevuProductQueryPopup_closeModal, _KlevuProductQueryPopup_start, _KlevuProductQueryPopup_onAction, _KlevuProductQueryPopup_onFeedback, _KlevuProductQueryPopup_renderChat, _KlevuProductQueryPopup_renderFeedback;
import { Fragment, Host, h } from "@stencil/core";
import { KlevuInit } from "../klevu-init/klevu-init";
import { startMoi, } from "@klevu/core";
import { parts } from "../../utils/parts";
import { getTranslation } from "../../utils/getTranslation";
/**
 * Klevu Product Query popup application that shows a popup for asking questions about a product
 *
 * @csspart product-query-header - Header of the popup
 * @csspart product-query-footer - Footer of the popup where input is
 * @csspart product-query-feedback - Feedback section of the popup when it is being closed
 * @csspart product-query-open-button - Button that opens the popup
 * @csspart popup-origin - Popup origin element
 * @csspart popup-content - Popup content element
 *
 * @slot fineprint - Fine print of the popup
 */
export class KlevuProductQueryPopup {
  constructor() {
    _KlevuProductQueryPopup_instances.add(this);
    _KlevuProductQueryPopup_popup.set(this, void 0);
    _KlevuProductQueryPopup_layoutElement.set(this, void 0);
    _KlevuProductQueryPopup_contentDiv.set(this, void 0);
    this.url = "";
    this.productId = undefined;
    this.pqaWidgetId = undefined;
    this.textFieldVariant = "pill";
    this.tTextFieldPlaceholder = getTranslation("productQueryPopup.tTextFieldPlaceholder");
    this.tPopupTitle = getTranslation("productQueryPopup.tPopuptitle");
    this.tButtonText = getTranslation("productQueryPopup.tButtonText");
    this.tFinePrint = getTranslation("productQueryPopup.tFinePrint");
    this.tLoadingSorry = getTranslation("productQueryPopup.tLoadingSorry");
    this.tRateExperienceTitle = getTranslation("productQueryPopup.tRateExperienceTitle");
    this.tRateExperienceText = getTranslation("productQueryPopup.tRateExperienceText");
    this.tDataProtectionNotice = getTranslation("productQueryPopup.tDataProtectionNotice");
    this.askButtonText = undefined;
    this.useBackground = undefined;
    this.popupAnchor = "bottom-start";
    this.popupOffset = undefined;
    this.settings = undefined;
    this.originElement = undefined;
    this.disableCloseOutsideClick = undefined;
    this.config = undefined;
    this.useNativeScrollbars = undefined;
    this.text = "";
    this.name = "";
    this.email = "";
    this.registered = true // change to false when registering works
    ;
    this.showFeedback = false;
    this.showLoading = false;
    this.showLoadingSorry = false;
    this.feedbacks = [];
    this.showMessageFeedbackFor = undefined;
    this.messages = [];
  }
  async connectedCallback() {
    var _a, _b;
    await KlevuInit.ready();
    if ((_a = window.klevu_page_meta) === null || _a === void 0 ? void 0 : _a.itemId) {
      this.productId = window.klevu_page_meta.itemId;
    }
    if (!this.productId && this.url == "") {
      const canonical = document.querySelector("link[rel='canonical']");
      this.url = (_b = canonical === null || canonical === void 0 ? void 0 : canonical.href) !== null && _b !== void 0 ? _b : window.location.href;
    }
  }
  onMessage() {
    var _a;
    if (!this.session) {
      return;
    }
    this.messages = this.session.messages;
    this.feedbacks = this.session.feedbacks;
    (_a = __classPrivateFieldGet(this, _KlevuProductQueryPopup_layoutElement, "f")) === null || _a === void 0 ? void 0 : _a.scrollMainToBottom();
  }
  async onMessageFeedback(e) {
    var _a, _b, _c;
    await ((_a = this.session) === null || _a === void 0 ? void 0 : _a.addFeedback(e.detail.feedback.id, e.detail.feedback.thumbs, e.detail.reason));
    this.feedbacks = ((_b = this.session) === null || _b === void 0 ? void 0 : _b.feedbacks) || [];
    this.messages = ((_c = this.session) === null || _c === void 0 ? void 0 : _c.messages) || [];
  }
  render() {
    return (h(Host, null, h("klevu-popup", { ref: (el) => (__classPrivateFieldSet(this, _KlevuProductQueryPopup_popup, el, "f")), exportparts: parts["klevu-popup"], onKlevuPopupClose: __classPrivateFieldGet(this, _KlevuProductQueryPopup_instances, "m", _KlevuProductQueryPopup_closeModal).bind(this), onKlevuPopupOpen: () => {
        __classPrivateFieldGet(this, _KlevuProductQueryPopup_instances, "m", _KlevuProductQueryPopup_start).call(this);
      }, anchor: this.popupAnchor, offset: this.popupOffset, elevation: 3, useBackground: this.useBackground, popupWidth: 520, originElement: this.originElement, closeAtOutsideClick: !this.disableCloseOutsideClick, fullscreenOnMobileSize: true }, h("div", { class: "content", slot: "content", ref: (el) => (__classPrivateFieldSet(this, _KlevuProductQueryPopup_contentDiv, el, "f")) }, this.showFeedback ? __classPrivateFieldGet(this, _KlevuProductQueryPopup_instances, "m", _KlevuProductQueryPopup_renderFeedback).call(this) : __classPrivateFieldGet(this, _KlevuProductQueryPopup_instances, "m", _KlevuProductQueryPopup_renderChat).call(this)))));
  }
  static get is() { return "klevu-product-query-popup"; }
  static get encapsulation() { return "shadow"; }
  static get originalStyleUrls() {
    return {
      "$": ["klevu-product-query-popup.css"]
    };
  }
  static get styleUrls() {
    return {
      "$": ["klevu-product-query-popup.css"]
    };
  }
  static get properties() {
    return {
      "url": {
        "type": "string",
        "mutable": false,
        "complexType": {
          "original": "string",
          "resolved": "string",
          "references": {}
        },
        "required": false,
        "optional": false,
        "docs": {
          "tags": [],
          "text": "Url of the page where the product is"
        },
        "attribute": "url",
        "reflect": false,
        "defaultValue": "\"\""
      },
      "productId": {
        "type": "string",
        "mutable": false,
        "complexType": {
          "original": "string",
          "resolved": "string | undefined",
          "references": {}
        },
        "required": false,
        "optional": true,
        "docs": {
          "tags": [],
          "text": "Alternative to url, productId can be used to start a session"
        },
        "attribute": "product-id",
        "reflect": false
      },
      "pqaWidgetId": {
        "type": "string",
        "mutable": false,
        "complexType": {
          "original": "string",
          "resolved": "string | undefined",
          "references": {}
        },
        "required": false,
        "optional": true,
        "docs": {
          "tags": [],
          "text": "Instead of Klevu API-key use a widget id to start a session"
        },
        "attribute": "pqa-widget-id",
        "reflect": false
      },
      "textFieldVariant": {
        "type": "string",
        "mutable": false,
        "complexType": {
          "original": "KlevuTextfieldVariant",
          "resolved": "\"default\" | \"pill\"",
          "references": {
            "KlevuTextfieldVariant": {
              "location": "import",
              "path": "../klevu-textfield/klevu-textfield",
              "id": "src/components/klevu-textfield/klevu-textfield.tsx::KlevuTextfieldVariant"
            }
          }
        },
        "required": false,
        "optional": false,
        "docs": {
          "tags": [],
          "text": "Variant of the textfield how does it look like"
        },
        "attribute": "text-field-variant",
        "reflect": false,
        "defaultValue": "\"pill\""
      },
      "tTextFieldPlaceholder": {
        "type": "any",
        "mutable": false,
        "complexType": {
          "original": "any",
          "resolved": "any",
          "references": {}
        },
        "required": false,
        "optional": false,
        "docs": {
          "tags": [],
          "text": "Placeholder of the textfield"
        },
        "attribute": "t-text-field-placeholder",
        "reflect": false,
        "defaultValue": "getTranslation(\"productQueryPopup.tTextFieldPlaceholder\")"
      },
      "tPopupTitle": {
        "type": "any",
        "mutable": false,
        "complexType": {
          "original": "any",
          "resolved": "any",
          "references": {}
        },
        "required": false,
        "optional": false,
        "docs": {
          "tags": [],
          "text": "Title of the popup"
        },
        "attribute": "t-popup-title",
        "reflect": false,
        "defaultValue": "getTranslation(\"productQueryPopup.tPopuptitle\")"
      },
      "tButtonText": {
        "type": "any",
        "mutable": false,
        "complexType": {
          "original": "any",
          "resolved": "any",
          "references": {}
        },
        "required": false,
        "optional": false,
        "docs": {
          "tags": [],
          "text": "Text of the button to open the popup"
        },
        "attribute": "t-button-text",
        "reflect": false,
        "defaultValue": "getTranslation(\"productQueryPopup.tButtonText\")"
      },
      "tFinePrint": {
        "type": "any",
        "mutable": false,
        "complexType": {
          "original": "any",
          "resolved": "any",
          "references": {}
        },
        "required": false,
        "optional": false,
        "docs": {
          "tags": [],
          "text": "Fine print of the popup under the title"
        },
        "attribute": "t-fine-print",
        "reflect": false,
        "defaultValue": "getTranslation(\"productQueryPopup.tFinePrint\")"
      },
      "tLoadingSorry": {
        "type": "any",
        "mutable": false,
        "complexType": {
          "original": "any",
          "resolved": "any",
          "references": {}
        },
        "required": false,
        "optional": false,
        "docs": {
          "tags": [],
          "text": "When loading takes a bit longer, show this text"
        },
        "attribute": "t-loading-sorry",
        "reflect": false,
        "defaultValue": "getTranslation(\"productQueryPopup.tLoadingSorry\")"
      },
      "tRateExperienceTitle": {
        "type": "any",
        "mutable": false,
        "complexType": {
          "original": "any",
          "resolved": "any",
          "references": {}
        },
        "required": false,
        "optional": false,
        "docs": {
          "tags": [],
          "text": "Title of the feedback section when closing the popup"
        },
        "attribute": "t-rate-experience-title",
        "reflect": false,
        "defaultValue": "getTranslation(\"productQueryPopup.tRateExperienceTitle\")"
      },
      "tRateExperienceText": {
        "type": "any",
        "mutable": false,
        "complexType": {
          "original": "any",
          "resolved": "any",
          "references": {}
        },
        "required": false,
        "optional": false,
        "docs": {
          "tags": [],
          "text": "Description of the feedback section when closing the popup"
        },
        "attribute": "t-rate-experience-text",
        "reflect": false,
        "defaultValue": "getTranslation(\"productQueryPopup.tRateExperienceText\")"
      },
      "tDataProtectionNotice": {
        "type": "any",
        "mutable": false,
        "complexType": {
          "original": "any",
          "resolved": "any",
          "references": {}
        },
        "required": false,
        "optional": false,
        "docs": {
          "tags": [],
          "text": "Data protection notice when user registering is enabled"
        },
        "attribute": "t-data-protection-notice",
        "reflect": false,
        "defaultValue": "getTranslation(\"productQueryPopup.tDataProtectionNotice\")"
      },
      "askButtonText": {
        "type": "string",
        "mutable": false,
        "complexType": {
          "original": "string",
          "resolved": "string | undefined",
          "references": {}
        },
        "required": false,
        "optional": true,
        "docs": {
          "tags": [],
          "text": "Text of the button for asking a question"
        },
        "attribute": "ask-button-text",
        "reflect": false
      },
      "useBackground": {
        "type": "boolean",
        "mutable": false,
        "complexType": {
          "original": "boolean",
          "resolved": "boolean | undefined",
          "references": {}
        },
        "required": false,
        "optional": true,
        "docs": {
          "tags": [],
          "text": "Use dark background with the popup"
        },
        "attribute": "use-background",
        "reflect": false
      },
      "popupAnchor": {
        "type": "string",
        "mutable": false,
        "complexType": {
          "original": "Placement",
          "resolved": "\"bottom\" | \"bottom-end\" | \"bottom-start\" | \"left\" | \"left-end\" | \"left-start\" | \"right\" | \"right-end\" | \"right-start\" | \"top\" | \"top-end\" | \"top-start\"",
          "references": {
            "Placement": {
              "location": "import",
              "path": "@floating-ui/dom",
              "id": ""
            }
          }
        },
        "required": false,
        "optional": false,
        "docs": {
          "tags": [],
          "text": "Anchor popup to which side of the origin"
        },
        "attribute": "popup-anchor",
        "reflect": false,
        "defaultValue": "\"bottom-start\""
      },
      "popupOffset": {
        "type": "number",
        "mutable": false,
        "complexType": {
          "original": "number",
          "resolved": "number | undefined",
          "references": {}
        },
        "required": false,
        "optional": true,
        "docs": {
          "tags": [],
          "text": "How many pixels to offset the popup from origin"
        },
        "attribute": "popup-offset",
        "reflect": false
      },
      "settings": {
        "type": "unknown",
        "mutable": false,
        "complexType": {
          "original": "MoiRequest[\"klevuSettings\"]",
          "resolved": "undefined | { offset?: number | undefined; excludeIds?: { key: string; value: string; }[] | undefined; typeOfSearch?: KlevuTypeOfSearch | undefined; advancedSorting?: { type: \"FIELD\"; key: string; order: AdvancedSortingDiretion; }[] | undefined; personalisation?: { enablePersonalisation: true; fields?: KlevuRecordFields[] | undefined; } | undefined; groupBy?: \"name\" | \"id\" | undefined; typeOfRecords?: KlevuAnyTypeOfRecord[] | undefined; fields?: KlevuRecordFields[] | undefined; sort?: KlevuSearchSorting | undefined; limit?: number | undefined; searchPrefs?: KlevuSearchPreference[] | undefined; fallbackQueryId?: string | undefined; fallbackWhenCountLessThan?: number | undefined; topIds?: { key: string; value: string; }[] | undefined; includeIds?: { key: string; value: string; }[] | undefined; customANDQuery?: string | undefined; context?: { recentObjects?: { typeOfRecord: KlevuAnyTypeOfRecord; records: { id: string; }[]; }[] | undefined; sourceObjects?: { typeOfRecord: KlevuAnyTypeOfRecord; records: ({ itemGroupId: string; } | { id: string; } | { url: string; })[]; }[] | undefined; } | undefined; priceFieldSuffix?: string | undefined; visibilityGroupID?: string | undefined; campaignForCatNav?: string | undefined; groupCondition?: KlevuGroupConditions | undefined; }",
          "references": {
            "MoiRequest": {
              "location": "import",
              "path": "@klevu/core",
              "id": "../klevu-core/dist/cjs/index.d.ts::MoiRequest"
            }
          }
        },
        "required": false,
        "optional": true,
        "docs": {
          "tags": [],
          "text": "Settings for requests to Klevu. Deeper modification on how the product query works."
        }
      },
      "originElement": {
        "type": "unknown",
        "mutable": false,
        "complexType": {
          "original": "HTMLElement",
          "resolved": "HTMLElement | undefined",
          "references": {
            "HTMLElement": {
              "location": "global",
              "id": "global::HTMLElement"
            }
          }
        },
        "required": false,
        "optional": true,
        "docs": {
          "tags": [],
          "text": "Element to anchor the product query popup to"
        }
      },
      "disableCloseOutsideClick": {
        "type": "boolean",
        "mutable": false,
        "complexType": {
          "original": "boolean",
          "resolved": "boolean | undefined",
          "references": {}
        },
        "required": false,
        "optional": true,
        "docs": {
          "tags": [],
          "text": "Disable closing the popup when clicking outside of it"
        },
        "attribute": "disable-close-outside-click",
        "reflect": false
      },
      "config": {
        "type": "unknown",
        "mutable": false,
        "complexType": {
          "original": "KlevuConfig",
          "resolved": "KlevuConfig | undefined",
          "references": {
            "KlevuConfig": {
              "location": "import",
              "path": "@klevu/core",
              "id": "../klevu-core/dist/cjs/index.d.ts::KlevuConfig"
            }
          }
        },
        "required": false,
        "optional": true,
        "docs": {
          "tags": [],
          "text": "Config for Klevu"
        }
      },
      "useNativeScrollbars": {
        "type": "boolean",
        "mutable": false,
        "complexType": {
          "original": "boolean",
          "resolved": "boolean | undefined",
          "references": {}
        },
        "required": false,
        "optional": true,
        "docs": {
          "tags": [],
          "text": "Use native scrollbars instead of custom ones"
        },
        "attribute": "use-native-scrollbars",
        "reflect": false
      }
    };
  }
  static get states() {
    return {
      "text": {},
      "name": {},
      "email": {},
      "registered": {},
      "showFeedback": {},
      "showLoading": {},
      "showLoadingSorry": {},
      "feedbacks": {},
      "showMessageFeedbackFor": {},
      "messages": {}
    };
  }
  static get elementRef() { return "el"; }
  static get listeners() {
    return [{
        "name": "klevuMessageFeedbackReason",
        "method": "onMessageFeedback",
        "target": undefined,
        "capture": false,
        "passive": false
      }];
  }
}
_KlevuProductQueryPopup_popup = new WeakMap(), _KlevuProductQueryPopup_layoutElement = new WeakMap(), _KlevuProductQueryPopup_contentDiv = new WeakMap(), _KlevuProductQueryPopup_instances = new WeakSet(), _KlevuProductQueryPopup_sendMessage = async function _KlevuProductQueryPopup_sendMessage() {
  var _a, _b;
  const message = this.text.trim();
  if (message == "") {
    return;
  }
  this.text = "";
  (_a = __classPrivateFieldGet(this, _KlevuProductQueryPopup_layoutElement, "f")) === null || _a === void 0 ? void 0 : _a.scrollMainToBottom();
  this.showLoading = true;
  const timeout = setTimeout(() => {
    this.showLoadingSorry = true;
  }, 4000);
  await ((_b = this.session) === null || _b === void 0 ? void 0 : _b.query({
    message: message,
    klevuSettings: this.settings,
  }));
  clearTimeout(timeout);
  this.showLoadingSorry = false;
  this.showLoading = false;
}, _KlevuProductQueryPopup_register = function _KlevuProductQueryPopup_register() {
  var _a, _b;
  (_a = this.session) === null || _a === void 0 ? void 0 : _a.messages.push({
    message: {
      id: "register",
      type: "text",
      value: `${this.name}, (${this.email})`,
      note: null,
    },
  });
  this.registered = true;
  (_b = __classPrivateFieldGet(this, _KlevuProductQueryPopup_layoutElement, "f")) === null || _b === void 0 ? void 0 : _b.scrollMainToBottom();
}, _KlevuProductQueryPopup_pqafeedback = function _KlevuProductQueryPopup_pqafeedback(dir) {
  var _a;
  (_a = __classPrivateFieldGet(this, _KlevuProductQueryPopup_popup, "f")) === null || _a === void 0 ? void 0 : _a.closeModal();
}, _KlevuProductQueryPopup_closeModal = function _KlevuProductQueryPopup_closeModal(e) {
  /*
  if (!this.showFeedback) {
    this.showFeedback = true
    e.preventDefault()
    return
  }
  */
}, _KlevuProductQueryPopup_start = async function _KlevuProductQueryPopup_start() {
  var _a, _b, _c;
  this.showFeedback = false;
  const useConfig = ((_a = this.config) === null || _a === void 0 ? void 0 : _a.apiKey) && ((_b = this.config) === null || _b === void 0 ? void 0 : _b.apiKey) !== "";
  this.session = await startMoi({
    onMessage: this.onMessage.bind(this),
    // Do nothing on redirect as we have our own system
    onRedirect: () => { },
    url: this.url === "" ? undefined : this.url,
    productId: this.productId,
    mode: "PQA",
    onAction: __classPrivateFieldGet(this, _KlevuProductQueryPopup_instances, "m", _KlevuProductQueryPopup_onAction).bind(this),
    pqaWidgetId: this.pqaWidgetId,
    settings: {
      configOverride: useConfig ? this.config : undefined,
    },
  });
  this.messages = this.session.messages;
  this.feedbacks = this.session.feedbacks;
  await ((_c = __classPrivateFieldGet(this, _KlevuProductQueryPopup_layoutElement, "f")) === null || _c === void 0 ? void 0 : _c.scrollMainToBottom("instant"));
  // add this when registering works
  //this.registered = this.messages.length > 1
}, _KlevuProductQueryPopup_onAction = function _KlevuProductQueryPopup_onAction(action) {
  if (action.type !== "askFeedbackReason") {
    return;
  }
  this.showMessageFeedbackFor = action.context.messageId;
}, _KlevuProductQueryPopup_onFeedback = async function _KlevuProductQueryPopup_onFeedback(e) {
  var _a, _b;
  await ((_a = this.session) === null || _a === void 0 ? void 0 : _a.addFeedback(e.detail.message.id, e.detail.feedback));
  this.feedbacks = ((_b = this.session) === null || _b === void 0 ? void 0 : _b.feedbacks) || [];
}, _KlevuProductQueryPopup_renderChat = function _KlevuProductQueryPopup_renderChat() {
  return (h(Fragment, null, h("klevu-chat-layout", { useNativeScrollbars: this.useNativeScrollbars, ref: (el) => (__classPrivateFieldSet(this, _KlevuProductQueryPopup_layoutElement, el, "f")) }, h("div", { part: "product-query-header", slot: "header" }, h("div", { class: "header" }, h("klevu-typography", { variant: "body-m-bold" }, this.tPopupTitle), h("klevu-icon", { name: "close", onClick: () => { var _a; return (_a = __classPrivateFieldGet(this, _KlevuProductQueryPopup_popup, "f")) === null || _a === void 0 ? void 0 : _a.closeModal(); } })), h("klevu-typography", { variant: "body-xs", class: "fineprint" }, this.tFinePrint, h("slot", { name: "after-fineprint" }))), h("klevu-chat-messages", { messages: this.messages, feedbacks: this.feedbacks, enableMessageFeedback: true, onKlevuMessageFeedback: __classPrivateFieldGet(this, _KlevuProductQueryPopup_instances, "m", _KlevuProductQueryPopup_onFeedback).bind(this), showFeedbackFor: this.showMessageFeedbackFor }, h("div", { slot: "chat-messages-after" }, this.showLoading ? h("klevu-loading-indicator", null) : null, this.showLoadingSorry ? (h("klevu-typography", { class: "loading-sorry", variant: "body-xs" }, this.tLoadingSorry)) : null)), h("div", { part: "product-query-footer", slot: "footer" }, !this.registered ? (h(Fragment, null, h("div", { class: "inputs" }, h("klevu-textfield", { value: this.name, variant: "pill", placeholder: "Name", onKlevuTextEnterPressed: () => __classPrivateFieldGet(this, _KlevuProductQueryPopup_instances, "m", _KlevuProductQueryPopup_register).call(this), onKlevuTextChanged: (e) => (this.name = e.detail) }), h("klevu-textfield", { value: this.email, variant: "pill", placeholder: "Email", onKlevuTextEnterPressed: () => __classPrivateFieldGet(this, _KlevuProductQueryPopup_instances, "m", _KlevuProductQueryPopup_register).call(this), onKlevuTextChanged: (e) => {
      this.email = e.detail;
    } }), h("klevu-button", { icon: "send", onClick: () => __classPrivateFieldGet(this, _KlevuProductQueryPopup_instances, "m", _KlevuProductQueryPopup_register).call(this) })), h("klevu-typography", { variant: "body-xs" }, this.tDataProtectionNotice))) : (h("div", { class: "sendmessage" }, h("klevu-textfield", { value: this.text, variant: this.textFieldVariant, placeholder: this.tTextFieldPlaceholder, onKlevuTextEnterPressed: () => __classPrivateFieldGet(this, _KlevuProductQueryPopup_instances, "m", _KlevuProductQueryPopup_sendMessage).call(this), onKlevuTextChanged: (e) => (this.text = e.detail) }), this.askButtonText ? (h("klevu-button", { onClick: () => __classPrivateFieldGet(this, _KlevuProductQueryPopup_instances, "m", _KlevuProductQueryPopup_sendMessage).call(this) }, this.askButtonText)) : (h("klevu-button", { icon: "chevron_right", onClick: () => __classPrivateFieldGet(this, _KlevuProductQueryPopup_instances, "m", _KlevuProductQueryPopup_sendMessage).call(this) }))))))));
}, _KlevuProductQueryPopup_renderFeedback = function _KlevuProductQueryPopup_renderFeedback() {
  return (h("div", { class: "pqa_feedback", part: "product-query-feedback" }, h("klevu-typography", { variant: "body-l-bold" }, this.tRateExperienceTitle), h("klevu-typography", { variant: "body-m" }, this.tRateExperienceText), h("div", null, h("klevu-icon", { onClick: () => __classPrivateFieldGet(this, _KlevuProductQueryPopup_instances, "m", _KlevuProductQueryPopup_pqafeedback).call(this, "up"), name: "thumb_up" }), h("klevu-icon", { onClick: () => __classPrivateFieldGet(this, _KlevuProductQueryPopup_instances, "m", _KlevuProductQueryPopup_pqafeedback).call(this, "down"), name: "thumb_down" }))));
};
//# sourceMappingURL=klevu-product-query-popup.js.map
