import { r as registerInstance, d as createEvent, h } from './index-31949dc5.js';
import { s as state } from './store-cca1abc6.js';
import './index-afdf7f54.js';
import './getHandlebarsHelpers-ae9bfed4.js';
import './_commonjsHelpers-44457d8d.js';
import './index-e6b3332e.js';
import './localforage-394b59fa.js';

const appPayCss = "";

const AppPay = class {
  constructor(hostRef) {
    registerInstance(this, hostRef);
    this.fireenjinFetch = createEvent(this, "fireenjinFetch", 7);
    this.jobId = undefined;
  }
  async fetchJob() {
    if (!this.jobId)
      return;
    this.fireenjinFetch.emit({
      endpoint: "findJob",
      params: {
        id: this.jobId,
        withPayments: true,
        withUsers: true,
        withSites: true,
        withPayModel: true,
        withPhotos: true,
        withEfiles: true,
        withPayables: false,
        withReadings: true,
      },
    });
  }
  componentDidLoad() {
    if (!(state === null || state === void 0 ? void 0 : state.job) && this.jobId)
      this.fetchJob();
  }
  render() {
    return [
      h("ion-content", { class: "ion-padding", style: { position: "relative" } }, h("floodteam-title-bar", { back: `/jobs/${this.jobId}`, icon: "logo-usd" }, h("ion-router-link", { href: "/payments" }, "Make a Payment")), h("ion-card", { style: {
          width: "90%",
          maxWidth: "800px",
          margin: "10% auto",
        } }, h("floodteam-payment-flow", { jobId: this.jobId }))),
      h("floodteam-navigation-footer", null),
    ];
  }
};
AppPay.style = appPayCss;

export { AppPay as app_pay };
