import { T as r, F as i, a as l, j as m, h as d, i as y, L as p } from "./index-162fd1aa.mjs";
import e from "react";
import { A as u, b as P, a as v } from "./AccountMainSection-4c35f8d7.mjs";
import { a0 as g } from "./dateFns-2367ee5b.mjs";
import { s as E } from "./MockVars-1cf2eb0a.mjs";
import "./validator-61879ab7.mjs";
import "./reactPlayer-2f69f369.mjs";
import "react-router-dom";
import "./reactSlick-cb4a2d39.mjs";
const R = "privacyRecordsTable _privacyRecordsTable_42594", _ = {
  privacyRecordsTable: R
}, h = ({ agreement: a }) => /* @__PURE__ */ e.createElement("tr", null, /* @__PURE__ */ e.createElement("td", null, a.policyName), /* @__PURE__ */ e.createElement("td", null, a.displayVersion), /* @__PURE__ */ e.createElement("td", null, i.formatDate(g.legacyParse(a.signingDate || ""), "LL"))), A = ({ agreements: a }) => /* @__PURE__ */ e.createElement("table", { className: _.privacyRecordsTable }, /* @__PURE__ */ e.createElement("thead", null, /* @__PURE__ */ e.createElement("tr", null, /* @__PURE__ */ e.createElement("th", null, /* @__PURE__ */ e.createElement(r, { i18nKey: "PrivacyRecordsPage.PrivacyRecords.document" }, "Document")), /* @__PURE__ */ e.createElement("th", null, /* @__PURE__ */ e.createElement(r, { i18nKey: "PrivacyRecordsPage.PrivacyRecords.version" }, "Version")), /* @__PURE__ */ e.createElement("th", null, /* @__PURE__ */ e.createElement(r, { i18nKey: "PrivacyRecordsPage.PrivacyRecords.date" }, "Date")))), /* @__PURE__ */ e.createElement("tbody", null, a.map((t) => /* @__PURE__ */ e.createElement(h, { key: t.id, agreement: t })))), f = "accountPrivacyRecordsPage _accountPrivacyRecordsPage_2f2c8", b = "mainBody _mainBody_47f57", o = {
  accountPrivacyRecordsPage: f,
  mainBody: b
};
class x extends e.Component {
  constructor(t) {
    super(t), this.logic = l.getAppState().legalAppManager, this.logic.subscribe(() => this.setState({}));
  }
  componentDidMount() {
    this.props.isPreviewMode || this.logic.fetchAcceptedAgreement();
  }
  render() {
    const { isLoading: t, acceptedAgreements: s, error: n } = this.logic.state, c = this.props.isPreviewMode ? E : s;
    return /* @__PURE__ */ e.createElement(u, { className: o.accountPrivacyRecordsPage }, /* @__PURE__ */ e.createElement(P, null, /* @__PURE__ */ e.createElement(r, { i18nKey: "PrivacyRecordsPage.title" }, "Privacy Records")), /* @__PURE__ */ e.createElement(v, { className: o.mainBody }, !t && n && /* @__PURE__ */ e.createElement(m, { type: d.danger }, /* @__PURE__ */ e.createElement(y, { error: n })), t && /* @__PURE__ */ e.createElement(p, null), !t && Array.isArray(c) && /* @__PURE__ */ e.createElement(e.Fragment, null, c.length > 0 ? /* @__PURE__ */ e.createElement(A, { agreements: c }) : /* @__PURE__ */ e.createElement("p", null, /* @__PURE__ */ e.createElement(r, { i18nKey: "PrivacyRecordsPage.noRecord" }, "There is no record to show")))));
  }
}
export {
  x as default
};
