import { translate } from '../../../utils/i18n';
import __vue_normalize__ from 'vue-runtime-helpers/dist/normalize-component.js';

var script = {
  name: 'GlMultiStepFormTemplate',
  props: {
    /**
     * The tile of the form. Should not be specific to the current step.
     */
    title: {
      type: String,
      required: true
    },
    /**
     * The number of the current step. If a non-zero number is passed, then the current step number will be shown at the top of the form.
     */
    currentStep: {
      type: Number,
      required: false,
      default: null
    },
    /**
     * The total number of steps. If a non-zero number is passed to this prop and a non-zero number is passed to the `currentStep` prop, then they will be formatted together at the top of the form. In English, this will appear as `Step n of x` where n is the current step and x is the step total.
     */
    stepsTotal: {
      type: Number,
      required: false,
      default: null
    },
    /**
     * Optional override to the semantic element used for the form title's heading tag. Defaults to `h1` but should be adjusted in usage to prevent unexpected heading level changes in the DOM.
     */
    headingTag: {
      type: String,
      required: false,
      default: 'h1'
    }
  },
  computed: {
    stepMessage() {
      return this.stepsTotal ? translate('GlMultiStepFormTemplate.stepXofY', 'Step %{currentStep} of %{stepsTotal}', {
        currentStep: this.currentStep,
        stepsTotal: this.stepsTotal
      }) : translate('GlMultiStepFormTemplate.stepX', 'Step %{currentStep}', {
        currentStep: this.currentStep
      });
    }
  }
};

/* script */
const __vue_script__ = script;

/* template */
var __vue_render__ = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:"gl-mx-auto gl-max-w-80 gl-pt-8"},[_c(_vm.headingTag,{tag:"component",staticClass:"gl-heading-1 gl-mb-3 gl-mt-0 gl-text-center",attrs:{"data-testid":"multi-step-form-title"}},[_vm._v("\n    "+_vm._s(_vm.title)+"\n  ")]),_vm._v(" "),(_vm.currentStep)?_c('p',{staticClass:"gl-m-0 gl-text-center",attrs:{"data-testid":"multi-step-form-steps"}},[_vm._v("\n    "+_vm._s(_vm.stepMessage)+"\n  ")]):_vm._e(),_vm._v(" "),_c('div',{staticClass:"gl-mt-7",attrs:{"data-testid":"multi-step-form-content"}},[_vm._t("default")],2),_vm._v(" "),(_vm.$scopedSlots.back || _vm.$scopedSlots.next)?_c('div',{staticClass:"gl-mt-6 gl-flex gl-justify-center gl-gap-3",attrs:{"data-testid":"multi-step-form-action"}},[_vm._t("back"),_vm._v(" "),_vm._t("next")],2):_vm._e(),_vm._v(" "),(_vm.$scopedSlots.footer)?_c('div',{staticClass:"gl-mt-7",attrs:{"data-testid":"multi-step-form-footer"}},[_vm._t("footer")],2):_vm._e()],1)};
var __vue_staticRenderFns__ = [];

  /* style */
  const __vue_inject_styles__ = undefined;
  /* scoped */
  const __vue_scope_id__ = undefined;
  /* module identifier */
  const __vue_module_identifier__ = undefined;
  /* functional template */
  const __vue_is_functional_template__ = false;
  /* style inject */
  
  /* style inject SSR */
  
  /* style inject shadow dom */
  

  
  const __vue_component__ = /*#__PURE__*/__vue_normalize__(
    { render: __vue_render__, staticRenderFns: __vue_staticRenderFns__ },
    __vue_inject_styles__,
    __vue_script__,
    __vue_scope_id__,
    __vue_is_functional_template__,
    __vue_module_identifier__,
    false,
    undefined,
    undefined,
    undefined
  );

export { __vue_component__ as default };
