{{ header }}
<header class="background-white bottom-margin-large">
	<div class="container-fluid">
		<div class="row no-space-xs">
			<div class="col-xs-12">
				<div class="content-box vertical-padding-large flex between-xs middle-xs">
					<div>
						<span class="text-x-large text-dark">{{ heading_title }}</span>
						<div class="adm-breadcrumb">
							{% for breadcrumb in breadcrumbs %}
								<i class="fas fa-angle-right text-x-small text-gray horizontal-padding-small"></i>
								<a href="{{ breadcrumb.href }}" class="text-x-small text-gray text-decoration-none">{{ breadcrumb.text }}</a>
							{% endfor %}
						</div>
					</div>
					<div class="flex flex-row middle-xs">
						<a href="{{ cancel }}" class="btn-default btn-medium btn-outline right-margin-small">
							<span>{{ button_cancel }}</span>
						</a>
						<button class="btn-default btn-medium btn-primary js-submit-payment-form" data-url="{{ url_save }}" data-redirect="{{url_redirect_success}}">
							<span>{{ button_save }}</span>
						</button>
					</div>
				</div>
				{% if error_warning %}
					<div class="warning full-width">{{ error_warning }}</div>
				{% endif %}
			</div>
			<div class="col-xs-12">
				<div class="flex js-tabs" id="tab-info"></div>
			</div>
		</div>
	</div>
</header>

<div class="container-fluid">
	<form class="js-main-form">
		<div class="container-fluid" data-tabs-id="tab-info">

			<div class="row hidden" data-tab="{{ tab_general }}">
				<div class="col-xs-12">
					<div class="content-box">
						<div class="flex between-xs middle-xs">
							<span class="text-x-large text-dark">{{ tab_general }}</span>
						</div>
					</div>
				</div>
				<div class="col-xs-12 col-md-8">
					<div class="background-white padding-large bottom-margin-medium shadow-small">
						<div class="bottom-margin-large">
							<span class="text-small text-dark text-bold visible-block">{{ text_callback_notification }}</span>
							<span class="text-small text-gray visible-block bottom-margin-small text-word-wrap" id="url_tokenization">{{ tokenization_callback }}</span>
              <button class="btn-default btn-outline btn-small" id="btn_copy_tokenization" type="button">
                <span>Copiar</span>
              </button>
						</div>
						<label class="field field-medium bottom-margin-large">
							<span class="field-label">{{ entry_rede_cnpj }}</span>
							<input type="field-entry" name="rede_credito_cnpj" class="field-entry " value="{{ rede_credito_cnpj }}" readonly/>
						</label>
						<label class="field field-medium bottom-margin-large">
							<span class="field-label">{{ entry_rede_description }}</span>
							<input class="field-entry" type="text" name="rede_descricao" value="{{ (rede_descricao is defined) ? rede_descricao : '' }}"/>
						</label>
						<label class="field field-medium bottom-margin-large">
							<span class="field-label">{{ entry_rede_token }}</span>

							<i class="far fa-eye cursor-pointer password-view js-password-view"></i>
							<input class="field-entry js-rede_token" type="password" name="rede_token" value="{{ rede_token }}"/>

						</label>
						<label class="field field-medium bottom-margin-large">
							<span class="field-label">{{ entry_rede_pv }}</span>

							<i class="far fa-eye cursor-pointer password-view js-pv-view"></i>
							<input class="field-entry js-rede_pv" type="password" name="rede_pv" value="{{ rede_pv }}"/>
						</label>
						<button type="button" class="btn-default btn-medium btn-primary bottom-margin-large js-validate-credentials" data-url="{{ url_validate_credentials }}">
							<span>{{ text_validate_credentials }}</span>
						</button>
						<label class="field field-medium bottom-margin-large">
							<span class="field-label">{{ entry_rede_total }}</span>
							<input class="field-entry mask-money" type="text" name="rede_total" value="{{ rede_total }}" placeholder="0,00"/>
						</label>
					</div>
				</div>

				<div class="col-xs-12 col-md-4">
					<div class="background-white padding-large bottom-margin-medium shadow-small">
						<label class="field field-medium bottom-margin-large">
							<span class="field-label">{{ entry_status }}</span>
							<select class="field-entry" name="rede_credito_status" id="id_rede_credito_status">
								<option value="1" {{ rede_credito_status ? 'selected' : '' }}>{{ text_enabled }}</option>
								<option value="0" {{ rede_credito_status ? '' : 'selected' }}>{{ text_disabled }}</option>
							</select>
						</label>

						<label class="field field-medium bottom-margin-large">
							<span class="field-label">
								{{ entry_display }}</span>
							<select class="field-entry" name="rede_display">
								{% for key, display in Type_DisplayModuleOption.getEnumList() %}
									<option value="{{ key }}" {{ ftr_geral.isSelected(key, rede_display, Type_DisplayModuleOption.Tp_Todos) }}>{{ display }}</option>
								{% endfor %}
							</select>
						</label>
						<label class="field field-medium bottom-margin-large">
							<span class="field-label">{{ text_client }}</span>
							<span class="text-x-small text-gray">{{ text_client_obs }}</span>
							<input class="field-entry js-number" type="text" name="rede_client_teste" value="{{ rede_client_teste }}" placeholder="ID do cliente de teste" id="input"/>
						</label>
						<label class="field field-medium bottom-margin-large">
							<span class="field-label">{{ text_ambiente }}</span>
							<span class="text-x-small text-gray">{{ text_ambiente_obs }}</span>
							<select class="field-entry" name="rede_ambiente_teste" id="id_rede_ambiente_teste">
								<option value="1" {{ rede_ambiente_teste ? 'selected' : '' }}>{{ text_enabled }}</option>
								<option value="0" {{ rede_ambiente_teste ? '' : 'selected' }}>{{ text_disabled }}</option>
							</select>
						</label>
						<label class="field field-medium bottom-margin-large">
							<span class="field-label">{{ entry_token_service }}</span>
							<span class="text-x-small text-gray">{{ text_token_service_obs }}</span>
							<select class="field-entry" name="rede_token_service" id="id_rede_token_service">
								<option value="1" {{ rede_token_service ? 'selected' : '' }}>{{ text_enabled }}</option>
								<option value="0" {{ rede_token_service ? '' : 'selected' }}>{{ text_disabled }}</option>
							</select>
						</label>
						<label class="field field-medium bottom-margin-large">
							<span class="field-label">{{ entry_sort_order }}</span>
							<input class="field-entry mask-number" type="text" name="rede_credito_sort_order" value="{{ rede_credito_sort_order }}" placeholder="{{ entry_sort_order }}" id="input-sort-order"/>
						</label>
						<label class="field field-medium">
							<span class="field-label">{{ entry_geo_zone }}</span>
							<select class="field-entry" name="rede_geo_zone_id" id="input-geo-zone">
								<option value="0">{{ text_all_zones }}</option>
								{% for geo_zone in geo_zones %}
									<option value="{{ geo_zone.geo_zone_id }}" {{ geo_zone.geo_zone_id == rede_geo_zone_id ? 'selected' : '' }}>
										{{ geo_zone.name }}
									</option>
								{% endfor %}
							</select>
						</label>
					</div>
				</div>

			</div>

			<div class="row hidden" data-tab="{{ tab_parcelamento }}">
				<div class="col-xs-12">
					<div class="content-box">
						<div class="flex between-xs middle-xs">
							<span class="text-x-large text-dark">{{ tab_parcelamento }}</span>
						</div>
					</div>
				</div>
				<div class="col-xs-12 col-md-8">
					<div class="background-white padding-large bottom-margin-medium shadow-small">
						<label class="field field-medium bottom-margin-large">
							<span class="field-label">{{ entry_rede_parcela_qtdmax }}</span>
							<input class="field-entry mask-number js-advanced-installments-number" type="text" name="rede_parcela_qtdmax" value="{{ rede_parcela_qtdmax }}"/>
						</label>
						<label class="field field-medium bottom-margin-large">
							<span class="field-label">{{ entry_rede_parcela_minimo }}</span>
							<input class="field-entry mask-money" type="text" name="rede_parcela_minimo" value="{{ rede_parcela_minimo }}" placeholder="0,00"/>
						</label>

						<label class="field field-medium bottom-margin-large">
							<span class="field-label">{{ entry_rede_config_parcelamento }}</span>
							<span class="text-x-small text-gray">{{ entry_rede_config_parcelamento_obs }}</span>
							<select class="field-entry js-advanced-installments-config" name="rede_config_parcelamento" data-url="{{ url_parcelamento_config }}" data-modulo="rede">
								{% for key, display in Type_ConfigParcelamento.getEnumList(false, exclude_type_config_parcelamento) %}
									<option value="{{ key }}" {{ ftr_geral.isSelected(key, rede_config_parcelamento) }}>{{ display }}</option>
								{% endfor %}
							</select>
						</label>

						<div class="parcelamento-avancado bottom-margin-large"></div>

						<div class="parcelamento-padrao">
							<div class="field-group-join">
								<label class="field field-medium bottom-margin-large">
									<span class="field-label">{{ entry_rede_parcela_semjuros }}</span>
									<span class="text-x-small text-gray">{{ text_parcela_juros_obs }}</span>
									<input class="field-entry mask-number" type="text" name="rede_parcela_semjuros" value="{{ rede_parcela_semjuros }}"/>
								</label>
								<label class="field field-medium bottom-margin-large field_installment_fee">
									<span class="field-label">{{ entry_rede_parcela_juros }}</span>
									<span class="text-x-small text-gray">{{ text_juros_obs }}</span>
									<input class="field-entry mask-percent" type="text" name="rede_parcela_juros" value="{{ rede_parcela_juros }}"/>
								</label>
							</div>
							<div class="field-group-join">
								<label class="field field-medium bottom-margin-large">
									<span class="field-label">{{ entry_rede_parcela_comdesconto }}</span>
									<input class="field-entry js-number" type="text" name="rede_parcela_comdesconto" value="{{ rede_parcela_comdesconto }}"/>
								</label>
								<label class="field field-medium bottom-margin-large">
									<span class="field-label">{{ entry_rede_parcela_desconto }}</span>
									<input class="field-entry mask-percent" type="text" name="rede_parcela_desconto" value="{{ rede_parcela_desconto }}"/>
								</label>
							</div>
						</div>

						<label class="field field-medium bottom-margin-large">
							<span class="field-label">{{ entry_rede_bandeiraspagamento }}</span>
							<div name="rede_credit_card_flag" class="flex-item-auto flex nowrap-xs middle-xs">

								{% for credit_card in credit_cards %}
									<label class="checkbox checkbox-medium">

										<input type="checkbox" class="checkbox-entry js-check-options" name="rede_credit_card[{{ credit_card.value }}][descricao]" value="{{ credit_card.description }}" {% if rede_credit_card[credit_card.value].descricao %} checked {% endif %}>
										<span class="checkbox-text">{{ credit_card.description }}</span>
									</label>
								{% endfor %}

							</div>
						</label>

					</div>
				</div>
			</div>

			<div class="row hidden" data-tab="{{ tab_settings_order_status }}">
				<div class="col-xs-12">
					<div class="content-box">
						<div class="flex between-xs middle-xs">
							<span class="text-x-large text-dark">{{ tab_settings_order_status }}</span>
						</div>
					</div>
				</div>
				<div class="col-xs-12">
					<div class="background-white padding-large bottom-margin-medium shadow-small">
						<label class="field field-medium bottom-margin-large">
							<span class="field-label">{{ entry_order_status }}</span>
							<select class="field-entry" name="rede_order_status_id" id="rede_order_status_id">
								{% for order_status in order_statuses %}
									<option value="{{ order_status.order_status_id }}" {{ order_status.order_status_id == rede_order_status_id ? 'selected' : '' }}>
										{{ order_status.name }}
									</option>
								{% endfor %}
							</select>
						</label>
						<label class="field field-medium bottom-margin-large">
							<span class="field-label">{{ entry_order_status_pago }}</span>
							<select class="field-entry" name="rede_order_pg_id" id="rede_order_pg_id">
								{% for order_status in order_statuses %}
									<option value="{{ order_status.order_status_id }}" {{ order_status.order_status_id == rede_order_pg_id ? 'selected' : '' }}>
										{{ order_status.name }}
									</option>
								{% endfor %}
							</select>
						</label>
						<label class="field field-medium bottom-margin-large">
							<span class="field-label">{{ entry_order_status_pendente }}</span>
							<select class="field-entry" name="rede_order_pe_id" id="rede_order_pe_id">
								{% for order_status in order_statuses %}
									<option value="{{ order_status.order_status_id }}" {{ order_status.order_status_id == rede_order_pe_id ? 'selected' : '' }}>
										{{ order_status.name }}
									</option>
								{% endfor %}
							</select>
						</label>
						<label class="field field-medium bottom-margin-large">
							<span class="field-label">{{ entry_order_status_negado }}</span>
							<select class="field-entry" name="rede_order_ne_id" id="rede_order_ne_id">
								{% for order_status in order_statuses %}
									<option value="{{ order_status.order_status_id }}" {{ order_status.order_status_id == rede_order_ne_id ? 'selected' : '' }}>
										{{ order_status.name }}
									</option>
								{% endfor %}
							</select>
						</label>
						<label class="field field-medium bottom-margin-large">
							<span class="field-label">{{ entry_order_status_autorizado }}</span>
							<select class="field-entry" name="rede_order_au_id" id="rede_order_au_id">
								{% for order_status in order_statuses %}
									<option value="{{ order_status.order_status_id }}" {{ order_status.order_status_id == rede_order_au_id ? 'selected' : '' }}>
										{{ order_status.name }}
									</option>
								{% endfor %}
							</select>
						</label>
						<label class="field field-medium">
							<span class="field-label">{{ entry_order_status_cancelado }}</span>
							<select class="field-entry" name="rede_order_status_cancelado_id" id="rede_order_status_cancelado_id">
								{% for order_status in order_statuses %}
									<option value="{{ order_status.order_status_id }}" {{ order_status.order_status_id == rede_order_status_cancelado_id ? 'selected' : '' }}>
										{{ order_status.name }}
									</option>
								{% endfor %}
							</select>
						</label>
					</div>
				</div>
			</div>

			<div class="row hidden" data-tab="{{ tab_anti_fraude }}">
				<div class="col-xs-12">
					<div class="content-box">
						<div class="flex between-xs middle-xs">
							<span class="text-x-large text-dark">{{ tab_anti_fraude }}</span>
						</div>
					</div>
				</div>
				<div class="col-xs-12">
					<div class="background-white padding-large bottom-margin-medium shadow-small">
						<label class="field field-medium bottom-margin-large">
							<span class="field-label">{{ entry_rede_anti_fraude }}</span>
							<span class="text-x-small text-gray">{{ entry_rede_anti_fraude_obs }}</span>
							<select class="field-entry" name="rede_anti_fraude">
								{% for key, value in Type_AntiFraudeCheckout.getEnumList%}
									<option value="{{ key }}" {{ ftr_geral.isSelected(key, rede_anti_fraude, Type_AntiFraudeCheckout.Tp_SemVerificacao) }}>{{ value }}</option>
								{% endfor %}
							</select>
						</label>
					</div>
				</div>
			</div>

		</div>
	</form>
</div>
{{ footer }}
