Last active
February 19, 2021 16:27
-
-
Save rdricco/cbfe1ff2198cc8e490927caab15f2f97 to your computer and use it in GitHub Desktop.
Fascar
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
window.onload = function() { | |
$("#cart-link-coupon-add").click(); | |
$("#vtexIdUI-auth-selector button").click(function() { | |
setTimeout(() => { | |
$("#dark").remove(); | |
$("#boxLight").remove(); | |
}, 500); | |
}); | |
$("#print-bank-invoice").click(function() { | |
$("#dark").remove(); | |
$("#boxLight").remove(); | |
}); | |
$(".checkout-container .cart-template.full-cart > .cart-links.cart-links-bottom").clone().insertAfter("body > div.container.container-main.container-cart > div.checkout-container.row-fluid.cart-active > div.cart-template.full-cart.span12.active > .cart-template-holder"); | |
setInterval(function() { | |
$("#ship-number").attr({ "data-parsley-maxlength": 10, maxlength: 10 }), | |
$("#ship-more-info").attr({ | |
"data-parsley-maxlength": 20, | |
maxlength: 20 | |
}); | |
}, 500); | |
$(".container-cart .cart-template.full-cart").prepend( | |
'<p class="entrega-info"><strong>Compre com <span style="background-color: black;color: #ffe5ac;padding: 0px 10px;">Frete Grรกtis!*</span> </strong> <br>Sul, Sudeste, Centro-Oeste, BA e PE;<br>Demais Localidades acima de R$ 400,00.<br><small>*Exceto para meias, conservaรงรฃo e pulseiras.</small><br><br><small><strong style="color: maroon;">Importante: Devido os protocolos de seguranรงa ligados ao Covid- 19, o prazo de entrega poderรก sofrer alteraรงรฃo e ser estendido sem aviso prรฉvio</small></strong></p>' | |
); | |
setTimeout(function() { | |
$(".payment-discounts-alert-wrap").remove(), | |
$(".gift-card-section:not(.only-gift-card):nth-child(2)").click(); | |
}, 500); | |
$("a#remove-gift-card").click(function() { | |
setTimeout(() => { | |
$("#show-gift-card-group").click(); | |
}, 500); | |
}); | |
function voucherVtex() { | |
$("#show-gift-card-group").click(); | |
$("#gift-card-provider-selector") | |
.val("VtexGiftCard") | |
.change(); | |
// .hide() | |
$("#gift-card-provider-selector option:contains('fascarclub')").hide(); | |
$("#payment-data .payment-discounts-options.text label").text("Voucher"); | |
$("#show-gift-card-group").text("Voucher"); | |
$("a#remove-gift-card").click(function() { | |
setTimeout(() => { | |
$("#show-gift-card-group").click(); | |
}, 500); | |
}); | |
} | |
function observeElement(el) { | |
var target = document.querySelector(el); | |
var observer = new MutationObserver(function(mutations) { | |
console.log("mutaรงรฃo detectada"); | |
voucherVtex(); | |
}); | |
var configObserver = { | |
attributes: true, | |
childList: true, | |
characterData: true | |
}; | |
observer.observe(target, configObserver); | |
} | |
observeElement("#payment-data"); | |
$("#show-gift-card-group").text("Voucher"); | |
function checkCPF() { | |
if ( | |
$("#client-document").attr("value") === undefined || | |
$("#client-document").attr("value").length == 0 | |
) { | |
console.log("CPF Vazio"); | |
} else { | |
console.log("CPF Preenchido"); | |
$("#client-document") | |
.attr("disabled", true) | |
.attr("readonly", true); | |
} | |
} | |
function observeAccountElement(el) { | |
var targetElement = document.querySelector(el); | |
var observerAccount = new MutationObserver(function(mutations) { | |
checkCPF(); | |
console.log("mutation detected"); | |
}); | |
var configObserver = { | |
attributes: true, | |
childList: true, | |
characterData: true | |
}; | |
observerAccount.observe(targetElement, configObserver); | |
} | |
observeAccountElement(".box-info"); | |
vtexjs.checkout.getOrderForm().done(function(orderForm) { | |
function promokit01() { | |
const kit_01 = | |
"<div id='sugestao-compra'><div class='kit-image'><img src='http://fascar.vteximg.com.br/arquivos/ids/390829-250-250/REV00_505_VTEX_KIT01_1000x1000px.png' alt-text='kit 1'/></div><div class='kit-content'><h4>LEVE TAMBรM!</h4><span>01 Creme Hidratante para Sapato de Couro (incolor) + 01 Calรงadeira de R$ 45,00 por R$ 30,00. Aproveite!</span></div> <div class='kit-comprar'> <span>?</span> <button onclick='#'>INCLUIR</button></div></div><a href='/' class='voltar'>Escolher mais produtos</a>"; | |
$(kit_01).insertAfter("table.cart-items"); | |
$(".kit-comprar button").on("click", function() { | |
vtexjs.checkout.addToCart([{ id: 4349967, quantity: 1, seller: "1" }]); | |
console.log("DESATIVAR BOTAO"); | |
$("#sugestao-compra").remove(); | |
}); | |
} | |
function promokit02() { | |
const kit_02 = | |
'<div id="sugestao-compra"><div class="kit-image"><img src="https://fascar.vteximg.com.br/arquivos/ids/390830-250-250/REV00_505_VTEX_KIT02_1000x1000px.png" alt-text="kit 2"/></div><div class="kit-content"><h4>LEVE TAMBรM!</h4><span>02 Pares de Meias Sociais (cafรฉ e preta) de R$ 44,00 (141156) por R$ 33,00. Aproveite!</span></div><div class="kit-comprar"><span>?</span><button onclick="buyKit02()">INCLUIR</button></div></div><a href="/" class="voltar">Escolher mais produtos</a>'; | |
$(kit_02).insertAfter("table.cart-items"); | |
$(".kit-comprar button").on("click", function() { | |
vtexjs.checkout.addToCart([{ id: 4349968, quantity: 1, seller: "1" }]); | |
console.log("DESATIVAR BOTAO"); | |
$("#sugestao-compra").remove(); | |
}); | |
} | |
function promokit03() { | |
const kit_03 = | |
'<div id="sugestao-compra"><div class="kit-image"><img src="https://fascar.vteximg.com.br/arquivos/ids/390831-250-250/REV00_505_VTEX_KIT03_1000x1000px.png" alt-text="kit 3"/></div><div class="kit-content"><h4>LEVE TAMBรM!</h4><span>02 Pares de Meias Sociais (preta e azul marinho) de R$ 44,00 por R$ 33,00. Aproveite!</span></div><div class="kit-comprar"><span>?</span><button onclick="buyKit03()">INCLUIR</button></div></div><a class="voltar" href="/">Escolher mais produtos</a>'; | |
$(kit_03).insertAfter("table.cart-items"); | |
$(".kit-comprar button").on("click", function() { | |
vtexjs.checkout.addToCart([{ id: 4349969, quantity: 1, seller: "1" }]); | |
console.log("DESATIVAR BOTAO"); | |
$("#sugestao-compra").remove(); | |
}); | |
} | |
var regra1 = "Social"; | |
var regra2 = "Casual"; | |
var regra3 = "Alto Conforto"; | |
var regra4 = "Lazer"; | |
var regra5 = "Linhas Especiais"; | |
let estadoPromo = "Invรกlido"; | |
function checagemPromoKit(regra) { | |
var itemsCarrinho = orderForm.items; | |
$.each(itemsCarrinho, function(value, key) { | |
var categoriasProduto = key.productCategories; | |
$.each(categoriasProduto, function(value, key) { | |
let promoverifica = key; | |
if (promoverifica === regra) { | |
// console.log(promoverifica); | |
// console.log("Vรกlido"); | |
estadoPromo = "Vรกlido"; | |
} | |
}); | |
}); | |
} | |
checagemPromoKit(regra1); | |
checagemPromoKit(regra2); | |
checagemPromoKit(regra3); | |
checagemPromoKit(regra4); | |
checagemPromoKit(regra5); | |
console.log(estadoPromo); | |
if (estadoPromo === "Vรกlido") { | |
if (".product-name a:contains(Calรงadeira)".length > 0) { | |
promokit01(); | |
} else { | |
if (".product-name a:contains(Meia):contains(Marrom)".length > 0) { | |
promokit02(); | |
} else { | |
promokit03(); | |
} | |
} | |
} | |
if ($('td.product-name:contains("Kit")').length > 0) { | |
$("#sugestao-compra").hide(); | |
} | |
}); | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
div#cartLoadedDiv { | |
width: 60%; | |
} | |
.container .checkout-container .cart-template .summary-template-holder { | |
margin-top: 20px; | |
width: 30%; | |
float: right; | |
background-color: #f2f2f2; | |
padding: 15px; | |
border: 0.5px solid darkgray; | |
margin-left: auto; | |
margin-right: 18px; | |
} | |
.container .checkout-container .cart-template .cart-links { | |
padding: 15px; | |
} | |
table.cart-items td.product-name a { | |
font-weight: 500; | |
color: #333; | |
line-height: 18px !important; | |
text-transform: uppercase; | |
min-height: 60px; | |
} | |
.coupon-form .coupon-fieldset p a { | |
background: lightgray; | |
background: black; | |
color: white !important; | |
} | |
.clearfix.pull-right.cart-links.cart-links-bottom.hide { | |
margin-left: auto; | |
margin-right: 0; | |
padding-right: 0; | |
} | |
.cart-items .product-name { | |
width: auto; | |
max-width: 200px; | |
} | |
footer#footer { | |
padding: 50px 10% !important; | |
} | |
.container .checkout-container .cart-template .cart-links .btn-place-order-wrapper { | |
padding: 0; | |
margin: 0; | |
max-width: 100%; | |
width: 100%; | |
} | |
.clearfix.pull-right.cart-links.cart-links-bottom.hide { | |
padding: 10px 0px; | |
} | |
.container .checkout-container .cart-template .cart-links .btn-place-order-wrapper { | |
padding: 0px 20px; | |
background-color: transparent; | |
margin: 0; | |
padding: 0 20px 0 0; | |
float: none; | |
} | |
#payment-data .gift-card-provider-options>label { | |
visibility: hidden; | |
} | |
#payment-data #btn-add-gift-card { | |
margin-top: 10px; | |
} | |
#payment-data .payment-discounts-options label:before { | |
content: "Insira o cรยณdigo"; | |
text-transform: initial; | |
color: black !important; | |
} | |
#payment-data .payment-discounts-options label { | |
color: transparent !important; | |
} | |
.entrega-warning { | |
background-color: white; | |
font-weight: 600; | |
border-top: 1px solid; | |
padding: 20px; | |
border-bottom: 1px solid; | |
margin: 0; | |
} | |
span.brand-name, #payment-data .link-gift-card, #payment-data #gift-card-provider-selector, #payment-data #show-gift-card-group, #cart-choose-more-products, .payment-discounts-alert-wrap, .gift-card-section:not(.only-gift-card):nth-child(1), .vtex-profile-form__toggle-business-btn__wrapper, .fieldset.payment-discounts, .gift-card-multiple-providers, .gift-card-section.form-step.box-default, p#go-to-cart-button, .gift-card-multiple-providers, .gift-card-section.form-step.box-default { | |
display: none !important; | |
} | |
#payment-data .link-gift-card, #payment-data #show-gift-card-group, .gift-card-multiple-providers, .gift-card-section.form-step.box-default { | |
display: block !important; | |
} | |
@media screen and (max-width: 1180px) { | |
body>div.container.container-main.container-cart>div.checkout-container.row-fluid.cart-active>div.cart-template.full-cart.span12.active>div:nth-child(3) { | |
display: none !important; | |
} | |
.cart-template.full-cart.span12.active { | |
display: flex !important; | |
flex-direction: column !important; | |
} | |
div#cartLoadedDiv { | |
width: 100%; | |
} | |
.container .checkout-container .cart-template .summary-template-holder { | |
width: 100%; | |
/* max-width: 320px; */ | |
} | |
.clearfix.pull-right.cart-links.cart-links-bottom.hide { | |
width: 100%; | |
max-width: 390px; | |
} | |
} | |
@media screen and (max-width: 768px) { | |
a#show-gift-card-group { | |
margin: 12px 10px; | |
} | |
#payment-data .payment-discounts-options label:before { | |
content: ""; | |
} | |
header .logo-checkout { | |
margin-left: 10px; | |
} | |
.cart { | |
/* max-width: 320px !important; */ | |
margin-left: auto; | |
margin-right: auto; | |
} | |
div#cartLoadedDiv { | |
display: flex; | |
} | |
.summary-template-holder { | |
margin-right: auto; | |
justify-content: center; | |
display: flex; | |
} | |
.clearfix.pull-right.cart-links.cart-links-bottom.hide { | |
max-width: 100%; | |
width: 100% !important; | |
} | |
.container .checkout-container .cart-template .summary-template-holder { | |
max-width: 90%; | |
} | |
#cartLoadedDiv>div.cart>table>tbody { | |
display: flex; | |
flex-direction: row !important; | |
flex-wrap: wrap; | |
width: auto; | |
} | |
#cartLoadedDiv>div.cart>table>tbody { | |
display: flex; | |
justify-content: center; | |
} | |
} | |
@media screen and (max-width: 490px) { | |
.full-cart .cart table tbody { | |
display: flex; | |
} | |
.cart { | |
max-width: 100%x !important; | |
/* max-width: 320px !important; */ | |
} | |
} | |
@media (min-width: 1024px) { | |
.gift-card-multiple-providers, .gift-card-section.form-step.box-default { | |
/* display: none !important; */ | |
} | |
} | |
a#show-gift-card-group { | |
margin-left: auto; | |
text-align: start; | |
padding: 6px 10px; | |
margin-right: 20px; | |
} | |
a#show-gift-card-group { | |
color: #666; | |
} | |
p.link.link-gift-card { | |
left: 0px; | |
margin-top: 0px; | |
position: absolute; | |
border: 2px solid #f4f4f4; | |
border-right: none; | |
opacity: 0.7; | |
width: 100%; | |
border-radius: 5px 0 0 5px; | |
-moz-border-radius: 5px 0 0 5px; | |
-webkit-border-radius: 5px 0 0 5px; | |
-webkit-transition: all 0.2s ease-in-out; | |
-moz-transition: all 0.2s ease-in-out; | |
-o-transition: all 0.2s ease-in-out; | |
transition: all 0.2s ease-in-out; | |
} | |
.cart-fixed.cart-fixed-transition.affix-top { | |
width: 100%; | |
} | |
#show-gift-card-group { | |
color: black !important; | |
} | |
.container .checkout-container .cart-template .summary-template-holder { | |
float: initial; | |
padding: 0; | |
max-width: 100%; | |
} | |
.cart-fixed.cart-fixed-transition.affix { | |
margin-bottom: 20px; | |
} | |
.checkout-container.row-fluid.orderform-active { | |
padding-bottom: 20px; | |
} | |
.clearfix.pull-right.cart-links.cart-links-bottom.hide { | |
width: 30%; | |
margin-right: 18px; | |
} | |
body>div.container.container-main.container-cart>div.checkout-container.row-fluid.cart-active>div.cart-template.full-cart.span12.active>div.summary-template-holder>div { | |
border: 1px solid dimgray; | |
} | |
/* CUSTOM */ | |
@media (min-width: 1180px) { | |
.container .checkout-container .cart-template .cart-template-holder .cart { | |
width: 110% !important; | |
} | |
} | |
.clearfix.pull-right.cart-links.cart-links-bottom.hide { | |
background: none !important; | |
border: none !important; | |
} | |
thead { | |
background-color: gray; | |
color: white; | |
} | |
table.cart-items thead th { | |
color: white; | |
padding: 3px; | |
} | |
table.cart-items thead th.product { | |
padding-left: 20px; | |
} | |
.cart-items span.shipping-estimate-date, th.shipping-date { | |
color: transparent !important; | |
} | |
td.shipping-date.empty { | |
color: transparent !important; | |
cursor: default; | |
} | |
span.new-product-price { | |
font-weight: 600; | |
} | |
.container .checkout-container .cart-template .summary-template-holder { | |
background: none; | |
border: none; | |
float: right; | |
} | |
table.cart-items tbody tr { | |
border-right: 1px dotted #ccc; | |
} | |
body>div.container.container-main.container-cart>div.checkout-container.row-fluid.cart-active>div.cart-template.full-cart.span12.active>div.summary-template-holder>div>div.forms.coupon-column.summary-coupon-wrap.span7.pull-left>div>form>fieldset>div { | |
padding: 10px 15px; | |
} | |
p.coupon-data.pull-right { | |
width: 90%; | |
float: none; | |
margin: auto; | |
margin-top: 10px; | |
} | |
.product-image { | |
width: auto; | |
max-width: 90px; | |
} | |
.mini-cart .summary-cart-template-holder, .cart-fixed .payment-confirmation-wrap { | |
border-left: 0px solid #999!important; | |
border-right: 0px solid #999!important; | |
border-bottom: 0px solid #999!important; | |
border-top: 0px solid #999!important; | |
} | |
body>div.container.container-main.container-order-form>div.checkout-container.row-fluid.orderform-active>div.row-fluid.orderform-template.span12.active>div.cart-template.mini-cart.span4>div { | |
border: 1px solid; | |
display: flex; | |
flex-direction: column; | |
} | |
body>div.container.container-main.container-cart>div.checkout-container.row-fluid.cart-active>div.cart-template.full-cart.span12.active>div.summary-template-holder>div>div.span5.totalizers.summary-totalizers.cart-totalizers.pull-right>div>div.accordion-body.collapse.in>div>table>tbody.totalizers-list>tr.Items>td.info, tbody.totalizers-list span { | |
color: black; | |
font-weight: 700; | |
} | |
tbody.totalizers-list span { | |
margin: 10px 0px; | |
} | |
.container .checkout-container .cart-template .summary-template-holder .summary .totalizers .accordion-group .accordion-body .accordion-inner .table tr td.monetary { | |
text-align: right; | |
font-weight: 700; | |
font-size: 14px; | |
} | |
.container .checkout-container .cart-template .summary-template-holder .summary .totalizers .accordion-group .accordion-body .accordion-inner .table tfoot tr td.info { | |
font-size: 15px; | |
} | |
a.btn.btn-mini.btn-default.dropdown-toggle.shipping-sla-button { | |
background: white; | |
box-shadow: none; | |
border-radius: 0; | |
padding: 5px 10px; | |
border: 1px solid gray; | |
transition: .5s; | |
color: gray; | |
} | |
a.btn.btn-mini.btn-default.dropdown-toggle.shipping-sla-button:hover { | |
background: white; | |
box-shadow: none; | |
border: 1px solid #E38E26; | |
color: black; | |
} | |
div#sugestao-compra { | |
display: flex; | |
flex-direction: row; | |
/* width: 60%; */ | |
margin-top: 30px; | |
background-color: gray; | |
color: white; | |
border: 1px solid lightgray; | |
} | |
div#sugestao-compra img { | |
max-width: 150px; | |
} | |
div#sugestao-compra .kit-content { | |
width: -webkit-fill-available; | |
color: white; | |
padding: 10px 20px; | |
} | |
div#sugestao-compra .kit-content h4 { | |
color: white; | |
} | |
div#sugestao-compra .kit-comprar { | |
display: flex; | |
flex-direction: column; | |
align-items: flex-end; | |
margin-right: 20px; | |
margin-top: 20px; | |
} | |
div#sugestao-compra .kit-comprar button { | |
background: #E38E26 !important; | |
border: none; | |
color: white; | |
padding: 10px 25px; | |
} | |
div#sugestao-compra .kit-comprar span { | |
background: black !important; | |
border-radius: 100%; | |
color: white; | |
padding: 1px 9px; | |
margin: 5px 0px; | |
font-size: 10px; | |
visibility: hidden; | |
} | |
table.cart-items td.product-image { | |
display: flex !important; | |
} | |
table.cart-items td.product-name { | |
margin-left: auto !important; | |
margin-right: auto !important; | |
} | |
table.cart-items td.product-image { | |
margin-left: auto !important; | |
margin-right: auto !important; | |
} | |
div.container.container-main.container-cart>div.checkout-container.row-fluid.cart-active>div.cart-template.full-cart.span12.active>div.summary-template-holder>div>div.span5.totalizers.summary-totalizers.cart-totalizers.pull-right>div>div.accordion-body.collapse.in>div>table>tbody.totalizers-list>tr.Items>td.info, div.container.container-main.container-cart>div.checkout-container.row-fluid.cart-active>div.cart-template.full-cart.span12.active>div.summary-template-holder>div>div.span5.totalizers.summary-totalizers.cart-totalizers.pull-right>div>div.accordion-body.collapse.in>div>table>tbody.totalizers-list>tr.Items>td.monetary, div.container.container-main.container-cart>div.checkout-container.row-fluid.cart-active>div.cart-template.full-cart.span12.active>div.summary-template-holder>div>div.span5.totalizers.summary-totalizers.cart-totalizers.pull-right>div>div.accordion-body.collapse.in>div>table>tfoot>tr { | |
background-color: white; | |
padding-left: 5px; | |
padding-right: 10px; | |
} | |
.cart-template.full-cart .summary-template-holder .summary .totalizers { | |
padding: 10px 0px 0px; | |
} | |
div.container.container-main.container-cart>div.checkout-container.row-fluid.cart-active>div.cart-template.full-cart.span12.active>div.summary-template-holder>div>div.span5.totalizers.summary-totalizers.cart-totalizers.pull-right>div>div.accordion-body.collapse.in>div>table>tfoot>tr>td.info, div.container.container-main.container-cart>div.checkout-container.row-fluid.cart-active>div.cart-template.full-cart.span12.active>div.summary-template-holder>div>div.span5.totalizers.summary-totalizers.cart-totalizers.pull-right>div>div.accordion-body.collapse.in>div>table>tfoot>tr>td.monetary { | |
padding: 0 10px; | |
} | |
.container .checkout-container .cart-template .summary-template-holder .summary .totalizers .accordion-group .accordion-body .accordion-inner .table tr td.info { | |
padding-left: 5px; | |
} | |
.coupon-form .coupon-fieldset p a { | |
background: lightgray; | |
background: darkgray; | |
color: white !important; | |
} | |
@media (max-width: 768px) { | |
table.cart-items tbody .product-item { | |
margin-bottom: 30px; | |
position: relative; | |
border: 1px solid lightgray; | |
} | |
table.cart-items td.product-image { | |
display: flex !important; | |
} | |
table.cart-items td.product-name { | |
margin-left: auto !important; | |
margin-right: auto !important; | |
} | |
table.cart-items td.product-image { | |
margin-left: auto !important; | |
margin-right: auto !important; | |
} | |
} | |
@media (max-width: 768px) { | |
#cartLoadedDiv>div.cart>table>tbody>tr>td.product-name a { | |
margin-right: 0; | |
padding-right: 0; | |
} | |
#cartLoadedDiv>div.cart>table>tbody>tr>td.product-name, .full-cart .cart table tbody tr td.product-image, .full-cart .cart table tbody tr td.bundle-item-image { | |
justify-content: center; | |
margin: auto !important; | |
padding-left: 0; | |
padding-right: 0; | |
display: flex !important; | |
} | |
#cartLoadedDiv>div.cart>table>tbody>tr>td.shipping-date { | |
display: none !important; | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8" /> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | |
<meta http-equiv="X-UA-Compatible" content="ie=edge" /> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" /> | |
<title>Fascar</title> | |
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/meyer-reset/2.0/reset.min.css" /> | |
<style> | |
body{ | |
background: #111111; | |
font-family: arial; | |
font-size: 22px; | |
text-align: center; | |
} | |
.wrap-tab{ | |
width: 1200px; | |
margin: 0 auto; | |
} | |
.tab-header, | |
.tab-footer{ | |
float: left; | |
position: relative; | |
width: 100%; | |
} | |
.tab-header .bx-img, | |
.tab-footer .bx-img{ | |
float: left; | |
position: relative; | |
width: 25%; | |
} | |
.tab-header .bx-img img, | |
.tab-footer .bx-img img{ | |
width: 100%; | |
} | |
.text--desc{ | |
color: #968862; | |
} | |
.tab-content{ | |
padding: 25px 0px; | |
float: left; | |
width: 100%; | |
color: #969396; | |
line-height: 28px; | |
background: url("/arquivos/img-tab-bg.jpg") repeat-x; | |
} | |
.tab-content p { | |
margin-bottom: 40px; | |
font-weight: 100; | |
} | |
.clearfix{ | |
clear: both; | |
} | |
@media (max-width: 900px) { | |
.wrap-tab{ | |
width: 100%; | |
} | |
.tab-content{ | |
padding-left: 10px; | |
padding-right: 10px; | |
box-sizing: border-box; | |
background: transparent; | |
} | |
.tab-content br{ | |
display: none; | |
} | |
} | |
</style> | |
</head> | |
<body> | |
<div class="wrap-tab"> | |
<div class="tab-header"> | |
<div class="bx-img"><img src="/arquivos/img-tab-1.jpg" alt="" /></div> | |
<div class="bx-img"><img src="/arquivos/img-tab-2.jpg" alt="" /></div> | |
<div class="bx-img"><img src="/arquivos/img-tab-3.jpg" alt="" /></div> | |
<div class="bx-img"><img src="/arquivos/img-tab-4.jpg" alt="" /></div> | |
</div> | |
<div class="tab-content"> | |
<div class="content--text"> | |
<p class="text--desc"> | |
Uma nova Fascar On-line estรก chegando e, com ela, muito mais novidades<br /> para vocรช. Caso tenha pedidos em andamento. | |
nรฃo se preocupe: todos serรฃo<br /> entregues normalmente e vocรช poderรก acompanhรก-los pelo nosso SAC. | |
</p> | |
<p> | |
SAC FASCAR 0300 0327 227 | sac@fascar.com.br.<br /> | |
De 2ยช a 6ยช, exceto feriados. das 8h30 ร s 17h30. | |
</p> | |
<div> | |
<img src="/arquivos/img-tab-logo.jpg" alt="" /> | |
</div> | |
</div> | |
</div> | |
<div class="tab-footer"> | |
<div class="bx-img"><img src="/arquivos/img-tab-5.jpg" alt="" /></div> | |
<div class="bx-img"><img src="/arquivos/img-tab-6.jpg" alt="" /></div> | |
<div class="bx-img"><img src="/arquivos/img-tab-7.jpg" alt="" /></div> | |
<div class="bx-img"><img src="/arquivos/img-tab-8.jpg" alt="" /></div> | |
</div> | |
<div class="clearfix"></div> | |
</div> | |
</body> | |
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:vtex="http://www.vtex.com.br/2009/vtex-common" xmlns:vtex.cmc="http://www.vtex.com.br/2009/vtex-commerce" lang="pt-BR"> | |
<meta charset="utf-8" /> | |
<head> | |
<title>Fascar | 404</title> | |
<vtex:metaTags /> | |
<vtex:template id="00-CommonStyles" /> | |
</head> | |
<!--/head--> | |
<body class="erro404"> | |
<div id="app-fascar" class="wrapper"> | |
<vtex:template id="00-header" /> | |
<div id="container_404" class="page-error shell"> | |
<div class="col-1-1"> | |
<div class="page-error-ico">404</div> | |
<h1>Pรกgina nรฃo encontrada.</h1> | |
<p> | |
<b>Procuramos estรก pagina por toda a loja.</b><br /> | |
Tem certeza de que a URL do site estรก correta? | |
</p> | |
<a href="/" class="btn-back">Voltar para o inicio</a> | |
</div> | |
</div> | |
<vtex:template id="00-footer" /> | |
</div> | |
</body> | |
<!-- templateHeader --> | |
<vtex.cmc:welcomeModal /> | |
<vtex:template id="00-CommonScripts" /> | |
<!-- / templateHeader --> | |
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:vtex="http://www.vtex.com.br/2009/vtex-common" xmlns:vtex.cmc="http://www.vtex.com.br/2009/vtex-commerce" lang="pt-BR"> | |
<meta charset="utf-8" /> | |
<head> | |
<title>500</title> | |
<vtex:metaTags /> | |
<vtex:template id="00-CommonStyles" /> | |
</head> | |
<!--/head--> | |
<body class="erro404"> | |
<div id="app-fascar" class="wrapper"> | |
<vtex:template id="00-header" /> | |
<div id="container_404" class="page-error shell"> | |
<div class="col-1-1"> | |
<div class="page-error-ico">500</div> | |
<h1>Pagina nรฃo encontrada :( </h1> | |
<p> | |
<b>Houve um problema interno.</b><br /> | |
Caso necessรกrio entre em contato conosco! | |
</p> | |
<a href="/" class="btn-back">Voltar para o inicio</a> | |
</div> | |
</div> | |
<vtex:template id="00-footer" /> | |
</div> | |
</body> | |
<!-- templateHeader --> | |
<vtex:template id="00-CommonScripts" /> | |
<!-- / templateHeader --> | |
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:vtex="http://www.vtex.com.br/2009/vtex-common" | |
xmlns:vtex.cmc="http://www.vtex.com.br/2009/vtex-commerce" lang="pt-BR"> | |
<meta charset="utf-8" /> | |
<head> | |
<title> | |
<vtex.cmc:searchTitle /> | Fascar Online | |
</title> | |
<vtex:metaTags /> | |
<vtex:template id="00-CommonStylesV2" /> | |
<vtex:contentPlaceHolder id="metatags" /> | |
<!-- Hotjar Tracking Code for fascar.com.br --> | |
</head> | |
<body> | |
<vtex:template id="00-header-V3" /> | |
<main> | |
<div class="fascar-hero"> | |
<vtex:contentPlaceHolder id="fascar-hero" /> | |
</div> | |
<div class="fascar-breadCrumb"> | |
<div class="container"> | |
<vtex.cmc:breadCrumb /> | |
</div> | |
</div> | |
<div> | |
<div class="container"> | |
<span class="line"></span> | |
<div class="area-especial-info"> | |
<div class="especial-field especial-left-field"> | |
<vtex:contentPlaceHolder id="intro-texto" /> | |
</div> | |
<div class="especial-field especial-right-field"> | |
<vtex:contentPlaceHolder id="intro-imagem" /> | |
</div> | |
</div> | |
</div> | |
</div> | |
<div class="resultados-de-busca container"> | |
<div class="fascar-searchNavigator"> | |
<vtex.cmc:searchNavigator /> | |
</div> | |
<div id="fascar-searchResult"> | |
<vtex.cmc:searchResult layout="67bd95d5-e6d6-483f-8ec4-8407089b9d9c" itemCount="12" columnCount="12" /> | |
</div> | |
</div> | |
<vtex:template id="00-newsletterV2" /> | |
</main> | |
<vtex:template id="00-footerV2" /> | |
</body> | |
<vtex:template id="00-CommonScriptsV2" /> | |
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<header id="headroom" class="header headroom headroom--top headroom--not-bottom"> | |
<vtex.cmc:cssCustomMenu /> | |
<div class="header__bar"> | |
<div class="shell"> | |
<div class="header__bar-inner"> | |
<ul class="list-features"> | |
<li><span style="color: white; text-transform: none;"> | |
FRETE GRรTIS* Brasil: Veja as condiรงรตes. | |
</span></li> | |
<li><span style="color: white;"> | |
Parcele em atรฉ 6x no cartรฃo | |
</span> <span style="color: white;"> | |
5% OFF no Boleto | |
</span></li> | |
</ul> | |
<ul class="list-links"> | |
<li><a href="/Institucional/nossas-lojas">Lojas</a></li> | |
<li><a href="/Institucional/atendimento">Atendimento</a></li> | |
<li><a href="/Institucional/duvidas-frequentes">Ajuda</a></li> | |
</ul> | |
</div> | |
</div> | |
</div> | |
<div class="header__body"> | |
<div class="shell"> | |
<div class="header__content"> | |
<a href="/"> | |
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 119.02 22.75" class="logo"> | |
<title>Logo Fascar</title> | |
<g id="logo" data-name="Camada 2"> | |
<g id="Camada_1-2" data-name="Camada 1"> | |
<polygon | |
points="1.67 2.78 15.01 2.78 15.01 1.16 0 1.16 0 22.41 1.67 22.41 1.67 12.74 13.23 12.74 13.23 11.13 1.67 11.13 1.67 2.78"> | |
</polygon> | |
<path | |
d="M45.66,10.85c-4.51-.92-6.11-2-6.11-4.26V6.53c0-2,2-4.05,5.37-4.05a10.2,10.2,0,0,1,6.21,2.15l.41.31,1-1.33-.41-.32A11.74,11.74,0,0,0,45,.87c-4,0-7.1,2.5-7.1,5.69v.06c0,3.12,2,4.76,7.32,5.82s6.2,2.39,6.2,4.35v.06c0,2.5-2.34,4.25-5.69,4.25a10.26,10.26,0,0,1-7.24-3l-.37-.36L36.9,19l.38.37a12,12,0,0,0,8.36,3.38c4.37,0,7.42-2.42,7.42-5.89v-.06C53.06,13.59,51,11.93,45.66,10.85Z"> | |
</path> | |
<path | |
d="M74.07,18a9.43,9.43,0,0,1-7,3.13c-4.91,0-8.75-4.1-8.75-9.33v-.06c0-5.23,3.84-9.33,8.75-9.33A9.17,9.17,0,0,1,74,5.35l.37.35,1.17-1.17-.38-.37a10.46,10.46,0,0,0-8-3.35c-5.86,0-10.45,4.82-10.45,11v.06c0,6.12,4.57,10.91,10.39,10.91a11,11,0,0,0,8.23-3.6l.36-.38-1.22-1.15Z"> | |
</path> | |
<path | |
d="M76.87,22.41h1.81l2.89-6.06H93.8l2.89,6.06h1.84L87.7,0ZM93,14.74H82.36l1-2h8.75Zm-8.94-3.61,3.61-7.46,3.61,7.46Z"> | |
</path> | |
<path | |
d="M112.23,12.63c3.07-.24,6.21-2.24,6.21-5.63V6.94c0-3.73-2.77-5.78-7.81-5.78h-8.78V22.41h1.67V12.73h6.72l6.61,9.53.11.15H119Zm-8.71-9.85h7c4.08,0,6.15,1.4,6.15,4.15V7c0,3.42-3.49,4.14-6.41,4.14h-6.79V2.78Z"> | |
</path> | |
<path | |
d="M13.87,22.41h1.81l2.89-6.06H30.8l2.89,6.06h1.84L24.7,0ZM30,14.74H19.36l.95-2h8.75Zm-8.94-3.61,3.61-7.46,3.61,7.46Z"> | |
</path> | |
</g> | |
</g> | |
</svg> | |
</a> | |
<div class="header__content-inner"> | |
<div class="pw-header-search"> | |
<vtex.cmc:fullTextSearchBox /> | |
</div> | |
<ul class="list-actions"> | |
<li class="account-drop"><a href="/account"><i class="ico-account"></i><span | |
class="botao-entrar">Entrar</span></a> | |
<div class="user-DropDown"> | |
<ul> | |
<li class="account-name">Minha conta</li> | |
<li class="account-data"><a href="/account">Meus dados</a></li> | |
<li class="account-order"><a href="/account/orders">Meus pedidos</a></li> | |
<!----> | |
</ul> | |
</div> | |
</li> | |
<li><a href="/checkout/#/cart"> | |
<i class="ico-bag"></i> | |
<input type="hidden" name="headercart_count" value="" /> | |
<span id="contagem_produtos_carrinho">0</span> | |
<span>|</span> Finalizar | |
</a> | |
</li> | |
</ul> | |
</div> | |
</div> | |
<div class="header__body-bar"> | |
<div> | |
<nav class="nav__dropdown__newstyle"> | |
<ul> | |
<li data-categoria="Acessรณrios" class="menu-father"><a title="Acessรณrios" | |
href="http://www.fascar.com.br/acessorios?PS=12&O=OrderByReleaseDateDESC">Acessรณrios</a> | |
<div> | |
<div class=" nav__dropdown__newstyle-div"> | |
<ul> | |
<li class="aaaa"><a | |
href="http://www.fascar.com.br/acessorios/carteira?PS=12&O=OrderByReleaseDateDESC"> | |
Carteira | |
</a></li> | |
<li class="aaaa"><a | |
href="http://www.fascar.com.br/acessorios/cinto?PS=12&O=OrderByReleaseDateDESC"> | |
Cinto | |
</a></li> | |
<li class="aaaa"><a | |
href="http://www.fascar.com.br/acessorios/conservacao?PS=12&O=OrderByReleaseDateDESC"> | |
Conservaรงรฃo | |
</a></li> | |
<li class="aaaa"><a | |
href="http://www.fascar.com.br/acessorios/meia?PS=12&O=OrderByReleaseDateDESC"> | |
Meia | |
</a></li> | |
<li class="aaaa"><a | |
href="http://www.fascar.com.br/acessorios/mochila?PS=12&O=OrderByReleaseDateDESC"> | |
Mochila | |
</a></li> | |
<li class="aaaa"><a | |
href="http://www.fascar.com.br/acessorios/necessaire?PS=12&O=OrderByReleaseDateDESC"> | |
Nรฉcessaire | |
</a></li> | |
<li class="aaaa"><a | |
href="http://www.fascar.com.br/acessorios/pasta?PS=12&O=OrderByReleaseDateDESC"> | |
Pasta | |
</a></li> | |
<li class="aaaa"><a | |
href="http://www.fascar.com.br/acessorios/pulseira?PS=12&O=OrderByReleaseDateDESC"> | |
Pulseira | |
</a></li> | |
</ul> | |
</div> | |
</div> | |
</li> | |
<li data-categoria="Alto Conforto" class="menu-father"><a title="Alto Conforto" | |
href="http://www.fascar.com.br/alto-conforto?PS=12&O=OrderByReleaseDateDESC">Alto | |
Conforto</a> | |
<div> | |
<div class=" nav__dropdown__newstyle-div"> | |
<ul> | |
<li class="aaaa"><a | |
href="http://www.fascar.com.br/alto-conforto/bota?PS=12&O=OrderByReleaseDateDESC"> | |
Bota | |
</a></li> | |
<li class="aaaa"><a | |
href="http://www.fascar.com.br/alto-conforto/chinelo?PS=12&O=OrderByReleaseDateDESC"> | |
Chinelo | |
</a></li> | |
<li class="aaaa"><a | |
href="http://www.fascar.com.br/alto-conforto/classico?PS=12&O=OrderByReleaseDateDESC"> | |
Clรกssico | |
</a></li> | |
<li class="aaaa"><a | |
href="http://www.fascar.com.br/alto-conforto/mocassim?PS=12&O=OrderByReleaseDateDESC"> | |
Mocassim | |
</a></li> | |
<li class="aaaa"><a | |
href="http://www.fascar.com.br/alto-conforto/sandalia?PS=12&O=OrderByReleaseDateDESC"> | |
Sandรกlia | |
</a></li> | |
<li class="aaaa"><a | |
href="http://www.fascar.com.br/alto-conforto/sneaker?PS=12&O=OrderByReleaseDateDESC"> | |
Sneaker | |
</a></li> | |
</ul> | |
</div> | |
</div> | |
</li> | |
<li data-categoria="Casual" class="menu-father"><a title="Casual" | |
href="http://www.fascar.com.br/casual?PS=12&O=OrderByReleaseDateDESC">Casual</a> | |
<div> | |
<div class=" nav__dropdown__newstyle-div"> | |
<ul> | |
<li class="aaaa"><a | |
href="http://www.fascar.com.br/casual/bota?PS=12&O=OrderByReleaseDateDESC"> | |
Bota | |
</a></li> | |
<li class="aaaa"><a | |
href="http://www.fascar.com.br/casual/esportivo?PS=12&O=OrderByReleaseDateDESC"> | |
Esportivo | |
</a></li> | |
<li class="aaaa"><a | |
href="http://www.fascar.com.br/casual/mocassim?PS=12&O=OrderByReleaseDateDESC"> | |
Mocassim | |
</a></li> | |
<li class="aaaa"><a | |
href="http://www.fascar.com.br/casual/mule?PS=12&O=OrderByReleaseDateDESC"> | |
Mule | |
</a></li> | |
</ul> | |
</div> | |
</div> | |
</li> | |
<li data-categoria="Lazer" class="menu-father"><a title="Lazer" | |
href="http://www.fascar.com.br/lazer?PS=12&O=OrderByReleaseDateDESC">Lazer</a> | |
<div> | |
<div class=" nav__dropdown__newstyle-div"> | |
<ul> | |
<li class="aaaa"><a | |
href="http://www.fascar.com.br/lazer/chinelo?PS=12&O=OrderByReleaseDateDESC"> | |
Chinelo | |
</a></li> | |
<li class="aaaa"><a | |
href="http://www.fascar.com.br/lazer/drive?PS=12&O=OrderByReleaseDateDESC"> | |
Drive | |
</a></li> | |
<li class="aaaa"><a | |
href="http://www.fascar.com.br/lazer/sandalia?PS=12&O=OrderByReleaseDateDESC"> | |
Sandรกlia | |
</a></li> | |
<li class="aaaa"><a | |
href="http://www.fascar.com.br/lazer/sider?PS=12&O=OrderByReleaseDateDESC"> | |
Sider | |
</a></li> | |
<li class="aaaa"><a | |
href="http://www.fascar.com.br/lazer/sneaker?PS=12&O=OrderByReleaseDateDESC"> | |
Sneaker | |
</a></li> | |
</ul> | |
</div> | |
</div> | |
</li> | |
<li data-categoria="Social" class="menu-father"><a title="Social" | |
href="http://www.fascar.com.br/social?PS=12&O=OrderByReleaseDateDESC">Social</a> | |
<div> | |
<div class=" nav__dropdown__newstyle-div"> | |
<ul> | |
<li class="aaaa"><a | |
href="http://www.fascar.com.br/social/bota?PS=12&O=OrderByReleaseDateDESC"> | |
Bota | |
</a></li> | |
<li class="aaaa"><a | |
href="http://www.fascar.com.br/social/classico?PS=12&O=OrderByReleaseDateDESC"> | |
Clรกssico | |
</a></li> | |
<li class="aaaa"><a | |
href="http://www.fascar.com.br/social/mocassim?PS=12&O=OrderByReleaseDateDESC"> | |
Mocassim | |
</a></li> | |
</ul> | |
</div> | |
</div> | |
</li> | |
<li data-categoria="Hand Made" class="menu-father not-childs"><a title="Hand Made" | |
href="http://www.fascar.com.br/handmade?PS=12&O=OrderByReleaseDateDESC">Hand | |
Made</a> | |
<div style="display: none;"> | |
<div class=" nav__dropdown__newstyle-div"> | |
<ul></ul> | |
</div> | |
</div> | |
</li> | |
<li data-categoria="Outlet" class="menu-father not-childs"><a title="Outlet" | |
href="http://www.fascar.com.br/outlet?PS=12&O=OrderByReleaseDateDESC">Outlet</a> | |
<div style="display: none;"> | |
<div class=" nav__dropdown__newstyle-div"> | |
<ul></ul> | |
</div> | |
</div> | |
</li> | |
<li data-categoria="Linhas Especiais" class="menu-father"><a title="Linhas Especiais" | |
href="/especial?PS=12&O=OrderByReleaseDateDESC">Linhas Especiais</a> | |
<div> | |
<div class=" nav__dropdown__newstyle-div"> | |
<ul> | |
<li class="aaaa"><a | |
href="/especial/active-airflow?PS=12&O=OrderByReleaseDateDESC"> | |
Active Airflow | |
</a></li> | |
<li class="aaaa"><a | |
href="/especial/airtech?PS=12&O=OrderByReleaseDateDESC"> | |
Airtech | |
</a></li> | |
<li class="aaaa"><a | |
href="/especial/altus?PS=12&O=OrderByReleaseDateDESC"> | |
Altus | |
</a></li> | |
<li class="aaaa"><a | |
href="/especial/Flexilinea?PS=12&O=OrderByReleaseDateDESC"> | |
Flexilinea | |
</a></li> | |
<li class="aaaa"><a href="/handmade?PS=12&O=OrderByReleaseDateDESC"> | |
Handmade | |
</a></li> | |
<li class="aaaa"><a href="/especial/izi?PS=12&O=OrderByReleaseDateDESC"> | |
IZI | |
</a></li> | |
<li class="aaaa"><a | |
href="/especial/linha-branca?PS=12&O=OrderByReleaseDateDESC"> | |
Linha branca | |
</a></li> | |
<li class="aaaa"><a | |
href="/especial/lite?PS=12&O=OrderByReleaseDateDESC"> | |
Lite | |
</a></li> | |
<li class="aaaa"><a href="/ns20?PS=12&O=OrderByReleaseDateDESC"> | |
NS20 | |
</a></li> | |
<li class="aaaa"><a | |
href="/especial/tamanhos-grandes?PS=12&O=OrderByReleaseDateDESC"> | |
Tamanhos Grandes | |
</a></li> | |
</ul> | |
</div> | |
</div> | |
</li> | |
</ul> | |
</nav> | |
</div> | |
</div> | |
</div> | |
</div> | |
<div class="header__bar mobile hidden padrao"> | |
<div class="shell"> | |
<div class="header__bar-inner morphext"><span class="animated fadeIn">FRETE GRรTIS* Brasil: Veja as | |
condiรงรตes.</span></div> | |
</div> | |
</div> | |
</header> | |
<vtex.cmc:hadertopbar /> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:vtex="http://www.vtex.com.br/2009/vtex-common" | |
xmlns:vtex.cmc="http://www.vtex.com.br/2009/vtex-commerce" lang="pt-BR"> | |
<head> | |
<title>Fascar | Calรงados e Acessรณrios Masculinos em Couro</title> | |
<vtex:metaTags /> | |
<vtex:template id="00-CommonStyles" /> | |
<vtex:contentPlaceHolder id="metatags" /> | |
</head> | |
<body class="home"> | |
<vtex:template id="00-header-dev" /> | |
<main> | |
<section id="hero"> | |
<vtex:contentPlaceHolder id="carrossel-topo" /> | |
<vtex:contentPlaceHolder id="carrossel-topo-mobile" /> | |
</section> | |
<section id="mosaico" class="container"> | |
</section> | |
<section id="vitrine01" class="container"> | |
<header class="heading"> | |
<span class="line"> </span> | |
<h3>TITULO</h3> | |
</header> | |
<main class="vitrine-carrossel"> | |
<vtex:contentPlaceHolder id="vitrine01-carrossel" /> | |
</main> | |
</section> | |
<section id="vitrine02" class="container"> | |
<header class="heading"> | |
<span class="line"> </span> | |
<h3>TITULO</h3> | |
</header> | |
<main class="vitrine-mista"> | |
<vtex:contentPlaceHolder id="vitrine02-banner" /> | |
<vtex:contentPlaceHolder id="vitrine02-carrossel" /> | |
</main> | |
</section> | |
<section id="vitrine03" class="container"> | |
<header class="heading"> | |
<span class="line"> </span> | |
<h3>TITULO</h3> | |
</header> | |
<main class="vitrine-mista"> | |
<vtex:contentPlaceHolder id="vitrine03-banner" /> | |
<vtex:contentPlaceHolder id="vitrine03-carrossel" /> | |
</main> | |
</section> | |
<section id="newsletter"> | |
<vtex:template id="newsletter-form" /> | |
</section> | |
</main> | |
<vtex:template id="00-footer" /> | |
<div id="returnToTop" style="opacity: 1; display: none;"> | |
<a href="#"><span class="text">voltar ao</span> | |
<span class="text2">TOPO</span> | |
<span class="arrowToTop"></span> | |
</a> | |
</div> | |
<vtex:template id="00-CommonScripts" /> | |
</body> | |
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:vtex="http://www.vtex.com.br/2009/vtex-common" | |
xmlns:vtex.cmc="http://www.vtex.com.br/2009/vtex-commerce" lang="pt-BR"> | |
<meta charset="utf-8" /> | |
<head> | |
<title> | |
<vtex.cmc:searchTitle /> | Fascar Online | |
</title> | |
<vtex:metaTags /> | |
<vtex:template id="00-CommonStylesV2" /> | |
<vtex:contentPlaceHolder id="metatags" /> | |
<!-- Hotjar Tracking Code for fascar.com.br --> | |
</head> | |
<body class="cms V2"> | |
<vtex:template id="00-header-V3" /> | |
<main> | |
<div class="fascar-breadCrumb"> | |
<div class="container"> | |
<!-- <vtex.cmc:breadCrumb /> --> | |
<vtex:contentPlaceHolder id="nomedapagina" /> | |
</div> | |
</div> | |
<div> | |
<div class="container"> | |
<vtex:contentPlaceHolder id="conteudodapagina" /> | |
</div> | |
</div> | |
<vtex:template id="00-newsletterV2" /> | |
</main> | |
<vtex:template id="00-footerV2" /> | |
</body> | |
<vtex:template id="00-CommonScriptsV2" /> | |
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html | |
xmlns="http://www.w3.org/1999/xhtml" | |
xmlns:vtex="http://www.vtex.com.br/2009/vtex-common" | |
xmlns:vtex.cmc="http://www.vtex.com.br/2009/vtex-commerce" | |
lang="pt-BR" | |
> | |
<head> | |
<title><vtex.cmc:productPageTitle /></title> | |
<vtex:metaTags /> | |
<vtex:template id="00-CommonStylesV2" /> | |
<vtex:contentPlaceHolder id="metatags" /> | |
</head> | |
<body class="product V2020"> | |
<vtex:template id="00-header-V3" /> | |
<div class="fascar-breadCrumb"> | |
<div class="container"> | |
<vtex.cmc:breadCrumb /> | |
</div> | |
</div> | |
<main class="container"> | |
<div class="hproduct"> | |
<div class="hproduct-preview left-panel"> | |
<vtex.cmc:HightLight /> | |
<div class="product-thumb"> | |
<vtex.cmc:ProductImage zoom="on" /> | |
</div> | |
</div> | |
<div class="hproduct-details right-panel"> | |
<div class="product-title"> | |
<vtex.cmc:productName /> | |
</div> | |
<vtex.cmc:skuReference /> | |
<div class="product-type"> | |
<vtex.cmc:productDescriptionShort /> | |
</div> | |
<div class="value"> | |
<vtex.cmc:skuPrice /> | |
</div> | |
<div class="property"> | |
<vtex.cmc:skuRichSelection changeImage="1" /> | |
</div> | |
<div class="product-buy"> | |
<vtex.cmc:BuyButton /> | |
<vtex.cmc:BuyInPage /> | |
</div> | |
<div class="product-promoInfo"> | |
<span> | |
<svg | |
aria-hidden="true" | |
focusable="false" | |
data-prefix="far" | |
data-icon="check-circle" | |
class="svg-inline--fa fa-check-circle fa-w-16" | |
role="img" | |
xmlns="http://www.w3.org/2000/svg" | |
viewBox="0 0 512 512" | |
> | |
<path | |
fill="currentColor" | |
d="M256 8C119.033 8 8 119.033 8 256s111.033 248 248 248 248-111.033 248-248S392.967 8 256 8zm0 48c110.532 0 200 89.451 200 200 0 110.532-89.451 200-200 200-110.532 0-200-89.451-200-200 0-110.532 89.451-200 200-200m140.204 130.267l-22.536-22.718c-4.667-4.705-12.265-4.736-16.97-.068L215.346 303.697l-59.792-60.277c-4.667-4.705-12.265-4.736-16.97-.069l-22.719 22.536c-4.705 4.667-4.736 12.265-.068 16.971l90.781 91.516c4.667 4.705 12.265 4.736 16.97.068l172.589-171.204c4.704-4.668 4.734-12.266.067-16.971z" | |
></path> | |
</svg> | |
Entrega grรกtis ร partir de R$ 300,00 | |
</span> | |
<span> | |
<svg | |
aria-hidden="true" | |
focusable="false" | |
data-prefix="far" | |
data-icon="check-circle" | |
class="svg-inline--fa fa-check-circle fa-w-16" | |
role="img" | |
xmlns="http://www.w3.org/2000/svg" | |
viewBox="0 0 512 512" | |
> | |
<path | |
fill="currentColor" | |
d="M256 8C119.033 8 8 119.033 8 256s111.033 248 248 248 248-111.033 248-248S392.967 8 256 8zm0 48c110.532 0 200 89.451 200 200 0 110.532-89.451 200-200 200-110.532 0-200-89.451-200-200 0-110.532 89.451-200 200-200m140.204 130.267l-22.536-22.718c-4.667-4.705-12.265-4.736-16.97-.068L215.346 303.697l-59.792-60.277c-4.667-4.705-12.265-4.736-16.97-.069l-22.719 22.536c-4.705 4.667-4.736 12.265-.068 16.971l90.781 91.516c4.667 4.705 12.265 4.736 16.97.068l172.589-171.204c4.704-4.668 4.734-12.266.067-16.971z" | |
></path> | |
</svg> | |
Primeira troca grรกtis | |
</span> | |
</div> | |
<div class="product-minictaWidget"> | |
<vtex.cmc:fascarClubSmallWidget /> | |
</div> | |
</div> | |
<div class="produto-detalhes left-panel"> | |
<vtex.cmc:ProductDescription /> | |
<vtex.cmc:productSpecification /> | |
</div> | |
<div class="produto-detalhex-extra right-panel"> | |
<vtex.cmc:sobreCouros /> | |
</div> | |
<div class="produto-extras-recomendacoes"> | |
<section class="BuyTogether container hidden"> | |
<vtex.cmc:BuyTogether /> | |
</section> | |
<section | |
id="complementoCompra" | |
class="complement-compra container hidden" | |
> | |
<header class="heading"> | |
<span class="line"> </span> | |
<h3>COMPLEMENTE SUA COMPRA</h3> | |
<vtex:contentPlaceHolder id="complementoCompra-Titulo" /> | |
</header> | |
<main class="vitrine-carrossel"> | |
<vtex:contentPlaceHolder id="colecao-complemente-sua-compra" /> | |
</main> | |
</section> | |
<section | |
id="produtosRelacionados" | |
class="confira-tambem container hidden" | |
> | |
<header class="heading"> | |
<span class="line"> </span> | |
<h3>MAIS PROCURADOS</h3> | |
<vtex:contentPlaceHolder id="produtosRelacionados-Titulo" /> | |
</header> | |
<main class="vitrine-carrossel"> | |
<vtex:contentPlaceHolder id="colecao-produtos-relacionados" /> | |
</main> | |
</section> | |
</div> | |
<div class="produto-extras-components"> | |
<vtex:contentPlaceHolder id="link-guia-tamanho" /> | |
<vtex:contentPlaceHolder id="modal-guia" /> | |
<vtex.cmc:discountHightLight /> | |
<vtex.cmc:AmountItemsInCart /> | |
</div> | |
</div> | |
</main> | |
<vtex:template id="00-newsletterV2" /> | |
<vtex:template id="00-footerV2" /> | |
<vtex:template id="00-CommonScriptsV2" /> | |
</body> | |
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:vtex="http://www.vtex.com.br/2009/vtex-common" xmlns:vtex.cmc="http://www.vtex.com.br/2009/vtex-commerce" lang="pt-BR"> | |
<meta charset="utf-8" /> | |
<head> | |
<title>Fascar | Sobre a Fascar</title> | |
<vtex:metaTags /> | |
<vtex:template id="00-CommonStyles" /> | |
<!-- faรงo o style incorporado pois nรฃo hรก complexibilidade --> | |
<style> | |
.col-1-1 { | |
margin-top: 0; | |
} | |
.area-sobre-fascar { | |
padding: 10px; | |
} | |
#titulo { | |
font-size: 18pt; | |
} | |
.texto-sobre { | |
font-size: 12pt; | |
color: #757575; | |
line-height: 1.4em; | |
/*margin-top: 20px;*/ | |
margin-bottom: 25px; | |
} | |
.area-elementos { | |
display: inline-flex; | |
justify-content: space-between; | |
align-items: flex-start; | |
margin-top: 30px; | |
} | |
.area-imagem { | |
width: 30%; | |
} | |
.area-texto { | |
width: 68%; | |
} | |
.area-beneficios { | |
display: flex; | |
align-items: center; | |
justify-content: space-between; | |
margin-top: 30px; | |
margin-bottom: 20px; | |
} | |
.figura-beneficio { | |
align-items: center; | |
display: inline-flex; | |
padding:10px; | |
width: 300px; | |
} | |
.figura-beneficio img { | |
opacity: .6; | |
width: 80px; | |
margin-right: 20px; | |
} | |
/*botรฃo fale com a gente*/ | |
.fale-com-a-gente { | |
align-items: center; | |
display: flex; | |
justify-content: center; | |
margin-top: 40px; | |
width: 100%; | |
} | |
#botao_fale_com_a_gente { | |
background-color: white; | |
color: #444444; | |
border:1px solid #444444; | |
padding: 15px 30px 15px 30px; | |
cursor: pointer; | |
transition: .2s ease; | |
} | |
#botao_fale_com_a_gente:hover { | |
background-color: #444444; | |
color: white; | |
} | |
/* responsivo */ | |
@media screen and (max-width: 414px) { | |
.area-bread:after { | |
right: 10px !important; | |
} | |
.area-elementos { | |
display: flex; | |
flex-wrap: wrap; | |
} | |
.area-elementos div { | |
width: 100%; | |
margin-bottom: 40px; | |
} | |
} | |
</style> | |
</head> | |
<body class="cms V2"> | |
<vtex:template id="00-header-V3" /> | |
<section id="app-fascar"> | |
<vtex:template id="00-header" /> | |
<div class="bread-crumb"> | |
<!-- estrutura bread crumb --> | |
<div class="grid area-bread"> | |
<p class="vc-esta">Vocรช estรก em:</p> | |
<ul class="lista-bread"> | |
<!-- <li><a title="pearson" href="index.html">Inicio</a></li> --> | |
<li class="last"><strong><a href="#" class="bread-active">Sobre a fascar</a></strong></li> | |
</ul> | |
</div> | |
</div> | |
<div class="fundo-conteiner"> | |
<div class="grid"> | |
<div class="col-1-1"> | |
<article class="area-sobre-fascar"> | |
<!-- <header> | |
<h1 id="titulo">Sobre a fascar</h1> | |
</header> --> | |
<div class="area-elementos"> | |
<div class="area-imagem"> | |
<vtex:contentPlaceHolder id="banner-sobre-fascar" /> | |
</div> | |
<div class="area-texto"> | |
<p class="texto-sobre">Desde 1963, a Fascar cumpre uma missรฃo que vai alรฉm de produzir sapatos de alta qualidade. Hรก mais de 50 anos, รฉ sinรดnimo de inovaรงรฃo em calรงados masculinos modernos, usados por homens de estilo e personalidade, e referรชncia de atendimento, pelo nรญvel de dedicaรงรฃo de seus funcionรกrios.</p> | |
<p class="texto-sobre">Uma marca nรฃo conquista este espaรงo por acaso. | |
<br />ร preciso inspiraรงรฃo... Ser diferente. Fazer mais!</p> | |
<p class="texto-sobre">Foi assim que comeรงamos quando nosso fundador, Manuel de Souza, um experiente artesรฃo sapateiro europeu e apaixonado por calรงados, chegou ao Brasil. Um grande admirador da arte de manufaturar calรงados impecรกveis, exclusivos e de altรญssima qualidade.</p> | |
<p class="texto-sobre">Hoje, com presenรงa em todo o Brasil, nosso compromisso permanece o mesmo: oferecer sempre o melhor em conforto, design e tecnologia, seguindo sempre as maiores tendรชncias da moda internacional. Produtos sofisticados e exclusivos para clientes exigentes que tambรฉm admiram calรงados bem feitos, รบnicos, que, mais do que protegerem os pรฉs de quem os compra, os levam sempre adiante.</p> | |
</div> | |
</div> | |
</article> | |
</div> | |
</div> | |
</div> | |
</section> | |
<vtex:template id="00-footerV2" /> | |
<!-- templateHeader --> | |
<vtex:template id="00-CommonScripts" /> | |
</body> | |
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
body{ | |
transition: all .3s; | |
} | |
.fascar-produto { | |
background-color: white; | |
position: relative; | |
} | |
.produto-imagem { | |
width: 100%; | |
} | |
.produto-titulo { | |
color: #6c6c6c !important; | |
display: block; | |
overflow: hidden; | |
-o-text-overflow: ellipsis; | |
text-overflow: ellipsis; | |
width: 100%; | |
height: 40px; | |
} | |
.produto-precode { | |
color: #a1a1a1; | |
font-size: 11px; | |
} | |
.produto-preco { | |
font-size: 16px; | |
font-weight: 700; | |
} | |
.produto-comprar { | |
background-color: #fff; | |
color: #333; | |
width: auto; | |
display: block; | |
position: relative; | |
opacity: 1; | |
right: 0; | |
border: 1px solid #6c6c6c; | |
padding: 10px 28px; | |
text-transform: uppercase; | |
} | |
.produto-comprar:hover { | |
background-color: #333; | |
color: #fff; | |
border: 1px solid #6c6c6c; | |
} | |
.fascar-vitrine ul { | |
display: flex; | |
flex-wrap: wrap; | |
} | |
.produto-flag { | |
position: absolute; | |
} | |
.compare, | |
.searchResultsTime, | |
.filterBy { | |
display: none; | |
} | |
span { | |
display: block; | |
color: #757575; | |
font-size: 12px; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#set($id = $product.Id) | |
#set($uri = $product.Uri) | |
#set($escapedName = $product.HtmlEscapedName) | |
<div class="fascar-produto" data-id="$id"> | |
<a href="#" class="produto-flag"> | |
$product.HightLight | |
</a> | |
<a class="produto-imagem" title="$product.Name" alt="$product.Name" href="$uri" width="281" height="281"> | |
$product.GetImageTag(30) | |
</a> | |
<div class="produto-infos"> | |
<p> | |
<a class="produto-titulo" title="$escapedName" href="$uri">$product.Name</a> | |
</p> | |
<div class="product__content-inner"> | |
<!-- vtexcp miniaturas --> | |
<div class="vtex-cpBox"> | |
<div class="vtex-cpSkuList #if($product.IsInStock) vtex-cpShow #else vtex-cpHide #end"></div> | |
<span class="vtex-cpViewMore vtex-cpHide"><a href="$uri" class="vtex-cpProductLink">+</a></span> | |
<div style="clear:both;"></div> | |
</div> | |
<!-- vtexcp miniaturas --> | |
#if ($product.IsInStock) | |
<div class="info-valores ab"> | |
<p class="produto-a-partir"> | |
<span class="txt-a-partir"></span> | |
</p> | |
#if ($product.HasBestPrice) | |
<p class="produto-precode"> | |
<span class="txt-de"> | |
$product.ListPrice | |
</span> | |
</p> | |
#end | |
<p class="produto-preco">$product.BestPrice</p> | |
#if ($product.NumbersOfInstallment > 1) | |
<p> | |
<span> | |
ou ${product.NumbersOfInstallment}x de $product.InstallmentValue | |
</span> | |
</p> | |
#end | |
</div> | |
<span class="produto-comprar"> | |
$product.BottomBuy | |
</span> | |
#else | |
<p class="text-sem-estoque" style="width: 100%;text-align: center;margin-top: 10px;"> | |
Sem estoque, | |
<a href="$uri" style="color: #424242; text-decoration: underline;"> | |
avise-me quando disponรญvel | |
</a> | |
</p> | |
#end | |
</div> | |
</div> | |
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
โโโ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div class="header__bar"> | |
<div class="shell"> | |
<div class="header__bar-inner"> | |
<ul class="list-features"> | |
<li> | |
<span style="color: white; text-transform:none;"> | |
<a href="https://www.fascar.com.br/Institucional/formas-de-entrega-e-frete"> | |
<strong>FRETE GRรTIS</strong>* Brasil: Veja as condiรงรตes. | |
</a> | |
</span> | |
</li> | |
<li> | |
<span style="color: white;"> | |
Parcele em atรฉ <strong>6x no cartรฃo</strong> | |
</span> | |
</li> | |
<li> | |
<span style="color: white;"> | |
<strong>5% OFF</strong> no Boleto | |
</span> | |
</li> | |
<li> | |
<span> | |
<a href="https://www.fascar.com.br/Institucional/formas-de-entrega-e-frete"> | |
<strong>Troca Fรกcil</strong> | |
na loja fรญsica ou no site | |
</a> | |
</span> | |
</li> | |
</ul> | |
<ul class="list-links"> | |
<li><a href="/Institucional/nossas-lojas">Lojas</a></li> | |
<li><a href="/Institucional/atendimento">Atendimento</a></li> | |
<li><a href="/Institucional/duvidas-frequentes">Ajuda</a></li> | |
</ul> | |
</div> | |
</div> | |
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<style> | |
.tooltip { | |
position: relative; | |
display: inline-block; | |
} | |
.tooltip .tooltiptext { | |
visibility: hidden; | |
width: 140px; | |
background-color: #555; | |
color: #fff; | |
text-align: center; | |
border-radius: 6px; | |
padding: 5px; | |
position: absolute; | |
z-index: 1; | |
bottom: 150%; | |
left: 50%; | |
margin-left: -75px; | |
opacity: 0; | |
transition: opacity 0.3s; | |
} | |
.tooltip .tooltiptext::after { | |
content: ""; | |
position: absolute; | |
top: 100%; | |
left: 50%; | |
margin-left: -5px; | |
border-width: 5px; | |
border-style: solid; | |
border-color: #555 transparent transparent transparent; | |
} | |
.tooltip:hover .tooltiptext { | |
visibility: visible; | |
opacity: 1; | |
} | |
</style> | |
</head> | |
<div id="modal-welcome" class="modal hidden"> | |
<header> | |
<h2>Bem-Vindo</h2> | |
</header> | |
<main> | |
<p> | |
Inscreva-se para receber nossos lanรงamentos e sugestรตes para o seu estilo, e na sua primeira compra ganhe: | |
</p> | |
<span> | |
<img src="/arquivos/modal-15percent.png" alt="quinze por cento de desconto"> | |
</span> | |
<form id=""> | |
<input class='name' type="text" placeholder="Insira seu Nome"/> | |
<input class='email' type="email" placeholder="Insira seu Email"/> | |
<button type="submit" class="cadastroModal">Enviar</button> | |
</form> | |
</main> | |
<footer> | |
<span> | |
Ao clicar em enviar, vocรช concorda com a nossa Polรญtica de Privacidade e aceita receber mensagens da Fascar via e-mail. Desconto vรกlido exclusivamente para a primeira compra, exceto para promoรงรตes e frete. Oferta nรฃo cumulativa e limitada a um รบnico | |
</span> | |
</footer> | |
</div> | |
<h2>Obrigado!</h2> | |
<span>Vocรช ganhou 15% de desconto para usar na sua primeira compra.</span> | |
<div id="cupomBv"> | |
<span>Cupom:</span> | |
<input type="text" value="BEMVINDO15" id="myInput"> | |
<div class="tooltip"> | |
<button onclick="myFunction()" onmouseout="outFunc()"> | |
<span class="tooltiptext" id="myTooltip">Copiar para Area de Transferรชncia</span> | |
Copiar Texto | |
</button> | |
</div> | |
</div> | |
<div id="fvpp-blackout"></div> | |
<div id="blackout-overlay"></div> | |
<script> | |
function myFunction() { | |
var copyText = document.getElementById("myInput"); | |
copyText.select(); | |
copyText.setSelectionRange(0, 99999); | |
document.execCommand("copy"); | |
var tooltip = document.getElementById("myTooltip"); | |
tooltip.innerHTML = "Copied: " + copyText.value; | |
} | |
function outFunc() { | |
var tooltip = document.getElementById("myTooltip"); | |
tooltip.innerHTML = "Copy to clipboard"; | |
} | |
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
โโโ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.zoomPup {}/* VENDOR */ | |
.zoomPad { | |
position: relative; | |
float: left; | |
z-index: 99; | |
cursor: crosshair; | |
} | |
.zoomPreload { | |
-moz-opacity: 0.8; | |
opacity: 0.8; | |
filter: alpha(opacity=80); | |
color: #333; | |
font-size: 12px; | |
font-family: Tahoma; | |
text-decoration: none; | |
border: 1px solid #ccc; | |
background-color: #fff; | |
padding: 8px; | |
text-align: center; | |
background-image: url(/arquivos/ajax-loader.gif); | |
background-repeat: no-repeat; | |
background-position: center center; | |
z-index: 110; | |
width: 100%; | |
height: 100%; | |
position: absolute; | |
top: 0; | |
left: 0; | |
} | |
.zoomPup { | |
overflow: hidden; | |
background-color: #fff; | |
-moz-opacity: 0.6; | |
opacity: 0.6; | |
filter: alpha(opacity=60); | |
z-index: 120; | |
border: none !important; | |
position: absolute; | |
border: 1px solid #ccc; | |
z-index: 101; | |
cursor: crosshair; | |
} | |
.zoomOverlay { | |
position: absolute; | |
left: 0; | |
top: 0; | |
background: #fff; | |
z-index: 5000; | |
width: 100%; | |
height: 100%; | |
display: none; | |
z-index: 101; | |
} | |
.zoomWindow { | |
position: absolute; | |
left: 0px !important; | |
top: 0px !important; | |
background: #fff; | |
z-index: 6000; | |
height: auto; | |
z-index: 10000; | |
z-index: 110; | |
width: auto; | |
} | |
.zoomWrapper { | |
position: relative; | |
border: none; | |
z-index: 110; | |
width: 740px !important; | |
height: 740px !important; | |
} | |
.zoomWrapperTitle { | |
display: block; | |
background: #999; | |
color: #fff; | |
height: 18px; | |
line-height: 18px; | |
width: 100%; | |
overflow: hidden; | |
text-align: center; | |
font-size: 10px; | |
position: absolute; | |
top: 0; | |
left: 0; | |
z-index: 120; | |
-moz-opacity: 0.6; | |
opacity: 0.6; | |
filter: alpha(opacity=60); | |
} | |
.zoomWrapperImage { | |
display: block; | |
position: relative; | |
overflow: hidden; | |
z-index: 110; | |
height: 745px !important; | |
} | |
.zoomWrapperImage img { | |
border: 0; | |
display: block; | |
position: absolute; | |
z-index: 101; | |
width: 1500px !important; | |
height: 1500px !important; | |
max-width: 1500px !important; | |
max-height: 1500px !important; | |
} | |
.zoomIframe { | |
z-index: -1; | |
filter: alpha(opacity=0); | |
-moz-opacity: 0.8; | |
opacity: 0.8; | |
position: absolute; | |
display: block; | |
} | |
.fascarClub--landingPage main#fascarClub { | |
max-width: 1140px; | |
margin: auto; | |
} | |
.fascarClub--landingPage .bread-crumb { | |
display: none; | |
} | |
.fascarClub--landingPage a.vtex-account_menu-link { | |
border-top: none; | |
border-bottom: none; | |
border-right: none; | |
} | |
.fascarClub--landingPage #generic--content > header > img { | |
border-bottom: 5px solid black; | |
border-top: 5px solid black; | |
} | |
.fascarClub--landingPage #generic--content { | |
color: white; | |
background-color: #816e71; | |
} | |
.fascarClub--landingPage #fascarClub > h1 { | |
font-family: "Montserrat"; | |
font-size: 50px; | |
text-align: center; | |
font-weight: bold; | |
} | |
.fascarClub--landingPage #fascarClub > div > div { | |
background-color: #916f71; | |
display: flex; | |
min-height: 285px; | |
max-width: 48%; | |
} | |
.fascarClub--landingPage div#descontos-fc { | |
flex-direction: row; | |
display: flex; | |
justify-content: space-between; | |
margin-bottom: 50px; | |
margin-top: 120px; | |
} | |
.fascarClub--landingPage #descontos-fc > div > img { | |
width: 269px; | |
} | |
.fascarClub--landingPage #fascarClub > h2 { | |
text-align: center; | |
/* font-size: 25px; */ | |
margin-bottom: 50px; | |
} | |
.fascarClub--landingPage #descontos-fc > div > span { | |
font-size: 27px; | |
text-align: start; | |
margin-top: auto; | |
margin-left: -50px; | |
} | |
.fascarClub--landingPage #descontos-fc > div { | |
padding: 20px; | |
} | |
.fascarClub--landingPage #participe-fc a { | |
background-color: #000000; | |
color: white; | |
font-size: 30px; | |
padding: 15px 20px; | |
width: 100%; | |
max-width: 390px; | |
display: flex; | |
justify-content: center; | |
font-weight: bold; | |
margin: 50px auto; | |
} | |
#fascarClubLPLogo { | |
display: flex; | |
align-items: center; | |
text-align: center; | |
margin: 50px auto; | |
} | |
#fascarClubLPLogo::after { | |
content: ""; | |
flex: 1; | |
margin-left: 1rem; | |
height: 1px; | |
background-color: #000; | |
} | |
#fascarClubLPLogo::before { | |
content: ""; | |
flex: 1; | |
margin-left: 1rem; | |
height: 1px; | |
background-color: #000; | |
} | |
#fascarclublplogo { | |
display: flex; | |
align-items: center; | |
text-align: center; | |
margin: auto; | |
} | |
#fascarclublplogo::after { | |
content: ""; | |
flex: 1; | |
margin-left: 1rem; | |
height: 1px; | |
background-color: #000; | |
} | |
#fascarclublplogo::before { | |
content: ""; | |
flex: 1; | |
margin-left: 1rem; | |
height: 1px; | |
background-color: #000; | |
} | |
@media (max-width: 768px) { | |
.fascarClub--landingPage div#descontos-fc { | |
flex-direction: column; | |
margin-top: 40px; | |
} | |
.fascarClub--landingPage #fascarClub > div > div { | |
width: 100%; | |
max-width: 100%; | |
margin-bottom: 20px; | |
} | |
.fascarClub--landingPage #fascarClub > h2 { | |
margin-bottom: 20px; | |
} | |
.fascarClub--landingPage #descontos-fc > div > img { | |
width: 150px; | |
height: auto; | |
} | |
.fascarClub--landingPage #descontos-fc > div > span { | |
font-size: 20px; | |
margin-left: 0; | |
margin-bottom: auto; | |
} | |
} | |
.boleto_product { | |
/* display: none !important; */ | |
} | |
.zoomWindow, | |
.zoomPup { | |
/* display: none !important; */ | |
} | |
body.produto main { | |
/* max-width: calc(100% - 40px); */ | |
/* margin: auto; */ | |
} | |
body.produto .hproduct { | |
display: flex; | |
flex-wrap: wrap; | |
background-color: #ffffff; | |
padding: 20px; | |
margin-bottom: 25px; | |
} | |
body.produto .hproduct .product-thumb { | |
/* width: 60%; */ | |
} | |
body.produto .hproduct .product-thumb #botaoZoom { | |
background-color: gray; | |
} | |
body.produto .hproduct div#show { | |
display: flex; | |
flex-direction: column; | |
} | |
body.produto .hproduct ul.thumbs { | |
flex-direction: row; | |
display: flex; | |
flex-wrap: wrap; | |
justify-content: space-evenly; | |
margin-top: 10px; | |
} | |
body.produto .hproduct .productName { | |
font-family: "Montserrat"; | |
font-weight: bold; | |
font-size: 25px; | |
margin-bottom: 15px; | |
} | |
body.produto .hproduct .right-panel { | |
max-width: 440px; | |
height: 100%; | |
display: flex; | |
flex-direction: column; | |
} | |
body.produto .hproduct .left-panel { | |
max-width: 840px; | |
padding-right: 15px; | |
} | |
body.produto .hproduct .skuReference { | |
font-size: 14px; | |
font-family: "Montserrat"; | |
margin-bottom: 25px; | |
color: #acacac; | |
} | |
body.produto .hproduct .economia-de, | |
body.produto .hproduct .preco-a-vista { | |
display: none !important; | |
} | |
.hproduct p.descricao-preco { | |
display: flex; | |
flex-direction: row; | |
flex-wrap: wrap; | |
} | |
.hproduct .descricao-preco { | |
flex-direction: row; | |
} | |
body.produto .hproduct .sku-selector-container { | |
font-family: "Montserrat"; | |
font-size: 14px; | |
text-transform: none; | |
} | |
.hproduct ul.thumbs { | |
display: flex; | |
} | |
body.produto .hproduct #show > ul > li > a > img { | |
max-height: 115px; | |
} | |
body.produto .hproduct #show .thumbs li { | |
/* padding: 5px; */ | |
max-width: 25% !important; | |
display: block; | |
} | |
body.produto .descricao-preco .price-list-price { | |
width: 100%; | |
color: #acacac; | |
font-style: normal; | |
font-size: 17px; | |
} | |
body.produto .hproduct em.valor-por.price-best-price, | |
body.produto .hproduct em.valor-dividido.price-installments { | |
} | |
body.produto .hproduct em.valor-dividido.price-installments { | |
} | |
body.produto .hproduct em.valor-por.price-best-price { | |
margin-right: 25px; | |
} | |
body.produto .hproduct .price-installments, | |
body.produto .hproduct .price-installments span, | |
body.produto .hproduct .skuBestInstallmentValue { | |
font-family: "Montserrat"; | |
font-style: normal; | |
color: #404040; | |
font-weight: 500; | |
font-size: 16px; | |
margin-top: auto; | |
} | |
body.produto .hproduct label.skuBestInstallmentValue { | |
} | |
body.produto .hproduct strong.skuBestPrice { | |
font-family: "Montserrat"; | |
font-size: 29px; | |
font-style: normal; | |
} | |
body.produto .hproduct .product-buy { | |
/* background-color: #e48f27; */ | |
color: white; | |
text-transform: capitalize; | |
justify-content: center; | |
display: flex; | |
margin-bottom: 15px; | |
margin-top: 10px; | |
flex-direction: column; | |
} | |
body.produto .hproduct #caracteristicas > table > tbody > tr.even > td > p { | |
background-color: #f4f4f4; | |
width: calc(50% - 10px); | |
margin: 5px; | |
padding: 11px; | |
} | |
#caracteristicas > table > tbody > tr:nth-child(2) { | |
display: flex; | |
/* flex-direction: column; */ | |
width: 100%; | |
max-width: 100%; | |
} | |
#caracteristicas > table > tbody > tr:nth-child(2) > td { | |
display: flex; | |
flex-wrap: wrap; | |
font-weight: 300; | |
font-family: "Montserrat"; | |
margin: 0 -5px; | |
} | |
body.produto th.name-field.Uso-e-Conservacao, | |
body.produto td.value-field.Uso-e-Conservacao, | |
.sobreCouros { | |
font-weight: 300; | |
font-family: "Montserrat"; | |
text-align: start; | |
font-size: 14px; | |
} | |
body.produto th.name-field.Uso-e-Conservacao, | |
sobreCouros span { | |
font-size: 16px; | |
margin-bottom: 15px; | |
margin-top: 10px; | |
} | |
#caracteristicas > table > tbody > tr:nth-child(2) > th { | |
text-align: start; | |
font-weight: 400; | |
margin-bottom: 20px; | |
margin-top: 15px; | |
display: none; | |
} | |
body.produto .descricao-preco .price-list-price { | |
width: 100%; | |
} | |
body.produto h4.group.Fascar { | |
display: none; | |
} | |
body.produto .hproduct #caracteristicas > table > tbody > tr.even > td > p, | |
body.produto | |
.hproduct | |
#caracteristicas | |
> table | |
> tbody | |
> tr.even | |
> td | |
> p | |
br:nth-child(1), | |
body.produto | |
.hproduct | |
#caracteristicas | |
> table | |
> tbody | |
> tr.even | |
> td | |
> p | |
br:nth-child(2) { | |
display: none; | |
} | |
body.produto | |
.hproduct | |
#caracteristicas | |
> table | |
> tbody | |
> tr.even | |
> td | |
> p:nth-child(1), | |
body.produto | |
.hproduct | |
#caracteristicas | |
> table | |
> tbody | |
> tr.even | |
> td | |
> p:nth-child(3), | |
body.produto | |
.hproduct | |
#caracteristicas | |
> table | |
> tbody | |
> tr.even | |
> td | |
> p:nth-child(5), | |
body.produto | |
.hproduct | |
#caracteristicas | |
> table | |
> tbody | |
> tr.even | |
> td | |
> p:nth-child(7) { | |
display: block; | |
} | |
body.produto .hproduct p.flag { | |
display: none !important; | |
} | |
body.produto input.buy-in-page-quantity { | |
display: none !important; | |
} | |
body.produto a.buy-in-page-button { | |
text-align: center; | |
} | |
body.produto a.buy-button.buy-button-ref { | |
text-align: center; | |
margin: auto; | |
} | |
body.produto .product-buy a { | |
margin-bottom: 5px; | |
background-color: #e48f27; | |
width: 100%; | |
padding: 15px 10px; | |
margin-bottom: 5px !important; | |
} | |
.product-promoInfo { | |
display: flex; | |
flex-direction: column; | |
color: dimgray; | |
font-weight: bold; | |
margin-bottom: auto; | |
} | |
body.produto > .bread-crumb { | |
padding: 10px; | |
} | |
.fascar-breadCrumb ul > li.last { | |
margin-top: 15px !important; | |
display: block !important; | |
} | |
body.produto .fascar-breadCrumb { | |
background-color: rgb(51, 51, 51); | |
color: white; | |
margin-bottom: 25px; | |
} | |
body.produto .bread-crumb { | |
max-width: 1280px; | |
margin: auto; | |
} | |
body.produto .bread-crumb ul { | |
display: flex; | |
flex-wrap: wrap; | |
padding: 5px 0px 0px; | |
margin-bottom: 15px; | |
margin-left: 0px; | |
} | |
body.produto .bread-crumb ul li { | |
font-family: Montserrat; | |
text-transform: uppercase; | |
font-size: 12px; | |
margin: 5px 0px; | |
color: gray; | |
} | |
body.produto .bread-crumb ul li:last-child { | |
font-size: 20px; | |
color: white !important; | |
} | |
body.produto .bread-crumb ul li.last { | |
font-family: Montserrat; | |
font-weight: 700; | |
text-transform: uppercase; | |
width: 100%; | |
} | |
body.produto .bread-crumb ul li a { | |
color: lightgray; | |
display: flex; | |
} | |
body.produto .bread-crumb ul li a::before { | |
content: "|"; | |
margin: 0px 5px; | |
} | |
body.produto .bread-crumb ul li:nth-child(1) > a::before, | |
body.produto .bread-crumb ul li.last::before { | |
content: ""; | |
display: none !important; | |
} | |
body.produto .bread-crumb ul li.last a::before { | |
display: none; | |
} | |
body.produto .bread-crumb ul li a:hover { | |
color: white; | |
} | |
body.produto .bread-crumb ul li strong a { | |
color: white; | |
} | |
.product-minictaWidget { | |
background: #303030; | |
color: #ffffff; | |
display: flex; | |
flex-direction: row; | |
padding: 10px; | |
} | |
.product-minictaWidget > div { | |
display: flex; | |
flex-direction: column; | |
} | |
.cashback-widget-left { | |
display: flex; | |
flex-direction: column; | |
margin-right: 15px; | |
padding-top: 15px; | |
} | |
.cashback-widget-left span { | |
width: 100%; | |
text-align: center; | |
} | |
.cashback-widget-right a { | |
background-color: gray; | |
width: 100%; | |
} | |
.cashback-widget-right { | |
display: flex; | |
flex-direction: column; | |
} | |
.cashback-widget-right a.botรฃo-fclub { | |
text-align: center; | |
color: #303030; | |
background: #d6d6d6; | |
width: 100%; | |
padding: 10px; | |
margin-top: 15px; | |
} | |
.product-minictaWidget span { | |
font-family: "Montserrat"; | |
font-size: 15px; | |
} | |
.product-minictaWidget { | |
margin-top: auto; | |
position: relative; | |
bottom: 0; | |
/* transform: translateY(-100%); */ | |
} | |
body.produto .product-buy a.buy-in-page-button { | |
background: none; | |
text-decoration: underline !important; | |
text-transform: uppercase; | |
border: 1px solid #e48f27; | |
color: #e48f27; | |
transition: .3s ease; | |
} | |
body.produto .product-buy a.buy-in-page-button:hover { | |
color: white; | |
background: #e48f27; | |
} | |
body.produto .product-buy a.buy-button { | |
text-transform: uppercase; | |
} | |
.sobreCouros span.title { | |
text-transform: none; | |
margin-bottom: 15px; | |
display: flex; | |
} | |
.produto-detalhes.left-panel, | |
.produto-detalhex-extra.right-panel { | |
padding-top: 15px; | |
} | |
.cashback-detalhe { | |
text-align: center; | |
display: flex; | |
flex-direction: column; | |
margin-top: auto; | |
margin-bottom: 0; | |
} | |
@media all and (min-width: 600px) { | |
body.produto .hproduct .left-panel { | |
width: 60%; | |
} | |
body.produto .hproduct .right-panel { | |
width: 40%; | |
} | |
body > main > div > div.hproduct-details.right-panel{ | |
min-height: 840px; | |
justify-content: space-evenly; | |
} | |
body.produto .hproduct #caracteristicas > table > tbody > tr.even > td > p { | |
background-color: transparent; | |
width: 100%; | |
margin: 5px 0px; | |
padding: 0; | |
} | |
} | |
/* tablet-large */ | |
@media all and (min-width: 601px) and (max-width: 1090px) and (orientation: portrait) { | |
body.produto .hproduct .left-panel { | |
width: 50%; | |
} | |
body.produto .hproduct .right-panel { | |
width: 50%; | |
} | |
} | |
/* desktop-x-small-landscape */ | |
@media all and (min-width: 0) and (max-width: 480px) and (orientation: landscape) { | |
} | |
/* desktop-x-small */ | |
@media all and (min-width: 0) and (max-width: 480px) and (max-aspect-ratio: 4/3) { | |
} | |
/* desktop-small-landscape */ | |
@media all and (min-width: 481px) and (max-width: 840px) and (orientation: landscape) { | |
} | |
/* desktop-small */ | |
@media all and (min-width: 481px) and (max-width: 840px) and (max-aspect-ratio: 4/3) { | |
} | |
/* desktop-medium-landscape */ | |
@media all and (min-width: 841px) and (max-width: 1280px) and (orientation: landscape) { | |
} | |
/* desktop-medium */ | |
@media all and (min-width: 841px) and (max-width: 1280px) and (max-aspect-ratio: 4/3) { | |
} | |
/* desktop-large */ | |
@media all and (min-width: 1281px) and (max-width: 1600px) { | |
} | |
/* desktop-xlarge */ | |
@media all and (min-width: 1601px) and (max-width: 1920px) { | |
} | |
body.produto { | |
display: flex: | |
flex-direction: column; | |
justify-content: center; | |
} | |
body.produto main { | |
width: calc(100% - 40px); | |
margin: auto; | |
} | |
.hproduct { | |
display: flex; | |
flex-wrap: wrap; | |
} | |
.hproduct .product-thumb { | |
/* width: 60%; */ | |
} | |
.hproduct div#show { | |
display: flex; | |
flex-direction: column; | |
} | |
.hproduct ul.thumbs { | |
flex-direction: row; | |
display: flex; | |
/* min-width: 100px; */ | |
} | |
.hproduct .productName { | |
font-family: 'Montserrat'; | |
font-weight: bold; | |
font-size: 25px; | |
margin-bottom: 35px; | |
} | |
.hproduct .right-panel { | |
max-width: 440px; | |
} | |
.hproduct .left-panel { | |
max-width: 840px; | |
} | |
.hproduct .skuReference { | |
font-size: 14px; | |
font-family: 'Montserrat'; | |
margin-bottom: 25px; | |
color: #ACACAC; | |
} | |
.hproduct .economia-de, | |
.hproduct .preco-a-vista { display: none !important; } | |
.hproduct p.descricao-preco { | |
display: flex; | |
flex-direction: row; | |
} | |
.hproduct .descricao-preco { | |
flex-direction: row; | |
} | |
.hproduct .sku-selector-container { | |
font-family: 'Montserrat'; | |
font-size: 14px; | |
text-transform: none; | |
} | |
ul.thumbs { | |
/* min-height: 335px; */ | |
} | |
#show > ul > li > a > img { | |
height: 335px; | |
width: 335px; | |
} | |
#show .thumbs li { | |
max-width: 150px; | |
max-height: 150px; | |
} | |
.hproduct-details .skuList.item-dimension-Cor input { | |
display: none; | |
} | |
label.dimension-Cor::before { | |
content: ""; | |
width: 45px; | |
height: 16px; | |
-webkit-box-sizing: border-box; | |
box-sizing: border-box; | |
border: 2px solid; | |
display: inline-block; | |
vertical-align: middle; | |
margin-right: 12px; | |
} | |
label.dimension-Cor { | |
font-size: 0; | |
} | |
label.dimension-Cor.skuespec_Azul.skuespec_Cor_opcao_Azul.skuespec_Cor_opcao_Azul::before { | |
border-color: blue; | |
background-color: blue; | |
} | |
label.dimension-Cor.skuespec_Preto.skuespec_Cor_opcao_Preto.skuespec_Cor_opcao_Preto::before { | |
border-color: black; | |
background-color: black; | |
} | |
label.dimension-Cor.espec_0.skuespec_Verde.skuespec_Cor_opcao_Verde.skuespec_Cor_opcao_Verde::before { | |
border-color: green; | |
background-color: green; | |
} | |
label.dimension-Cor.skuespec_Cor_opcao_Marrom::before { | |
border-color: brown; | |
background-color: brown; | |
} | |
label.dimension-Cor.skuespec_Cor_opcao_Marrom::before { | |
border-color: brown; | |
background-color: brown; | |
} | |
label.dimension-Cor.skuespec_Cor_opcao_Marromclaro::before { | |
border-color: lightsalmon; | |
background-color: lightsalmon; | |
} | |
label.dimension-Cor.skuespec_Cor_opcao_Marrom::before { | |
border-color: brown; | |
background-color: brown; | |
} | |
#caracteristicas > table > tbody > tr > td > p { | |
width: fit-content; | |
} | |
#caracteristicas > table > tbody > tr:nth-child(1) {} | |
#caracteristicas > table > tbody > tr:nth-child(1) > th { | |
display: none; | |
} | |
#caracteristicas > table > tbody > tr:nth-child(1) > td {} | |
#caracteristicas > table > tbody > tr:nth-child(3) {} | |
#caracteristicas > table > tbody > tr > td > p br { | |
display: none; | |
} | |
.produto-extras-components { | |
display: none; | |
} | |
#caracteristicas > table > tbody > tr:nth-child(2) > td > p:nth-child(7) { | |
display: none; | |
width: 100%; | |
} | |
.hproduct-details.right-panel .topic.Cor > li.specification { | |
color: #707070; | |
font-family: 'Montserrat'; | |
font-size: 14px; | |
} | |
#caracteristicas > table > tbody > tr a { | |
font-weight: bold; | |
display: contents; | |
} | |
#caracteristicas > table > tbody > tr.even > td > br { | |
display: none; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Copyright (c) 2014 Mike King (@micjamking) | |
* | |
* jQuery Succinct plugin | |
* Version 1.1.0 (October 2014) | |
* | |
* Licensed under the MIT License | |
*/ | |
/*global jQuery*/ | |
(function($) { | |
'use strict'; | |
$.fn.succinct = function(options) { | |
var settings = $.extend({ | |
size: 240, | |
omission: '...', | |
ignore: true | |
}, options); | |
return this.each(function() { | |
var textDefault, | |
textTruncated, | |
elements = $(this), | |
regex = /[!-\/:-@\[-`{-~]$/, | |
init = function() { | |
elements.each(function() { | |
textDefault = $(this).html(); | |
if (textDefault.length > settings.size) { | |
textTruncated = $.trim(textDefault) | |
.substring(0, settings.size) | |
.split(' ') | |
.slice(0, -1) | |
.join(' '); | |
if (settings.ignore) { | |
textTruncated = textTruncated.replace(regex, ''); | |
} | |
$(this).html(textTruncated + settings.omission); | |
} | |
}); | |
}; | |
init(); | |
}); | |
}; | |
})(jQuery); | |
/* | |
_ _ _ _ | |
___| (_) ___| | __ (_)___ | |
/ __| | |/ __| |/ / | / __| | |
\__ \ | | (__| < _ | \__ \ | |
|___/_|_|\___|_|\_(_)/ |___/ | |
|__/ | |
Version: 1.9.0 | |
Author: Ken Wheeler | |
Website: http://kenwheeler.github.io | |
Docs: http://kenwheeler.github.io/slick | |
Repo: http://github.com/kenwheeler/slick | |
Issues: http://github.com/kenwheeler/slick/issues | |
*/ | |
/* global window, document, define, jQuery, setInterval, clearInterval */ | |
;(function(factory) { | |
'use strict'; | |
if (typeof define === 'function' && define.amd) { | |
define(['jquery'], factory); | |
} else if (typeof exports !== 'undefined') { | |
module.exports = factory(require('jquery')); | |
} else { | |
factory(jQuery); | |
} | |
}(function($) { | |
'use strict'; | |
var Slick = window.Slick || {}; | |
Slick = (function() { | |
var instanceUid = 0; | |
function Slick(element, settings) { | |
var _ = this, dataSettings; | |
_.defaults = { | |
accessibility: true, | |
adaptiveHeight: false, | |
appendArrows: $(element), | |
appendDots: $(element), | |
arrows: true, | |
asNavFor: null, | |
prevArrow: '<button class="slick-prev" aria-label="Previous" type="button">Previous</button>', | |
nextArrow: '<button class="slick-next" aria-label="Next" type="button">Next</button>', | |
autoplay: false, | |
autoplaySpeed: 3000, | |
centerMode: false, | |
centerPadding: '50px', | |
cssEase: 'ease', | |
customPaging: function(slider, i) { | |
return $('<button type="button" />').text(i + 1); | |
}, | |
dots: false, | |
dotsClass: 'slick-dots', | |
draggable: true, | |
easing: 'linear', | |
edgeFriction: 0.35, | |
fade: false, | |
focusOnSelect: false, | |
focusOnChange: false, | |
infinite: true, | |
initialSlide: 0, | |
lazyLoad: 'ondemand', | |
mobileFirst: false, | |
pauseOnHover: true, | |
pauseOnFocus: true, | |
pauseOnDotsHover: false, | |
respondTo: 'window', | |
responsive: null, | |
rows: 1, | |
rtl: false, | |
slide: '', | |
slidesPerRow: 1, | |
slidesToShow: 1, | |
slidesToScroll: 1, | |
speed: 500, | |
swipe: true, | |
swipeToSlide: false, | |
touchMove: true, | |
touchThreshold: 5, | |
useCSS: true, | |
useTransform: true, | |
variableWidth: false, | |
vertical: false, | |
verticalSwiping: false, | |
waitForAnimate: true, | |
zIndex: 1000 | |
}; | |
_.initials = { | |
animating: false, | |
dragging: false, | |
autoPlayTimer: null, | |
currentDirection: 0, | |
currentLeft: null, | |
currentSlide: 0, | |
direction: 1, | |
$dots: null, | |
listWidth: null, | |
listHeight: null, | |
loadIndex: 0, | |
$nextArrow: null, | |
$prevArrow: null, | |
scrolling: false, | |
slideCount: null, | |
slideWidth: null, | |
$slideTrack: null, | |
$slides: null, | |
sliding: false, | |
slideOffset: 0, | |
swipeLeft: null, | |
swiping: false, | |
$list: null, | |
touchObject: {}, | |
transformsEnabled: false, | |
unslicked: false | |
}; | |
$.extend(_, _.initials); | |
_.activeBreakpoint = null; | |
_.animType = null; | |
_.animProp = null; | |
_.breakpoints = []; | |
_.breakpointSettings = []; | |
_.cssTransitions = false; | |
_.focussed = false; | |
_.interrupted = false; | |
_.hidden = 'hidden'; | |
_.paused = true; | |
_.positionProp = null; | |
_.respondTo = null; | |
_.rowCount = 1; | |
_.shouldClick = true; | |
_.$slider = $(element); | |
_.$slidesCache = null; | |
_.transformType = null; | |
_.transitionType = null; | |
_.visibilityChange = 'visibilitychange'; | |
_.windowWidth = 0; | |
_.windowTimer = null; | |
dataSettings = $(element).data('slick') || {}; | |
_.options = $.extend({}, _.defaults, settings, dataSettings); | |
_.currentSlide = _.options.initialSlide; | |
_.originalSettings = _.options; | |
if (typeof document.mozHidden !== 'undefined') { | |
_.hidden = 'mozHidden'; | |
_.visibilityChange = 'mozvisibilitychange'; | |
} else if (typeof document.webkitHidden !== 'undefined') { | |
_.hidden = 'webkitHidden'; | |
_.visibilityChange = 'webkitvisibilitychange'; | |
} | |
_.autoPlay = $.proxy(_.autoPlay, _); | |
_.autoPlayClear = $.proxy(_.autoPlayClear, _); | |
_.autoPlayIterator = $.proxy(_.autoPlayIterator, _); | |
_.changeSlide = $.proxy(_.changeSlide, _); | |
_.clickHandler = $.proxy(_.clickHandler, _); | |
_.selectHandler = $.proxy(_.selectHandler, _); | |
_.setPosition = $.proxy(_.setPosition, _); | |
_.swipeHandler = $.proxy(_.swipeHandler, _); | |
_.dragHandler = $.proxy(_.dragHandler, _); | |
_.keyHandler = $.proxy(_.keyHandler, _); | |
_.instanceUid = instanceUid++; | |
// A simple way to check for HTML strings | |
// Strict HTML recognition (must start with <) | |
// Extracted from jQuery v1.11 source | |
_.htmlExpr = /^(?:\s*(<[\w\W]+>)[^>]*)$/; | |
_.registerBreakpoints(); | |
_.init(true); | |
} | |
return Slick; | |
}()); | |
Slick.prototype.activateADA = function() { | |
var _ = this; | |
_.$slideTrack.find('.slick-active').attr({ | |
'aria-hidden': 'false' | |
}).find('a, input, button, select').attr({ | |
'tabindex': '0' | |
}); | |
}; | |
Slick.prototype.addSlide = Slick.prototype.slickAdd = function(markup, index, addBefore) { | |
var _ = this; | |
if (typeof(index) === 'boolean') { | |
addBefore = index; | |
index = null; | |
} else if (index < 0 || (index >= _.slideCount)) { | |
return false; | |
} | |
_.unload(); | |
if (typeof(index) === 'number') { | |
if (index === 0 && _.$slides.length === 0) { | |
$(markup).appendTo(_.$slideTrack); | |
} else if (addBefore) { | |
$(markup).insertBefore(_.$slides.eq(index)); | |
} else { | |
$(markup).insertAfter(_.$slides.eq(index)); | |
} | |
} else { | |
if (addBefore === true) { | |
$(markup).prependTo(_.$slideTrack); | |
} else { | |
$(markup).appendTo(_.$slideTrack); | |
} | |
} | |
_.$slides = _.$slideTrack.children(this.options.slide); | |
_.$slideTrack.children(this.options.slide).detach(); | |
_.$slideTrack.append(_.$slides); | |
_.$slides.each(function(index, element) { | |
$(element).attr('data-slick-index', index); | |
}); | |
_.$slidesCache = _.$slides; | |
_.reinit(); | |
}; | |
Slick.prototype.animateHeight = function() { | |
var _ = this; | |
if (_.options.slidesToShow === 1 && _.options.adaptiveHeight === true && _.options.vertical === false) { | |
var targetHeight = _.$slides.eq(_.currentSlide).outerHeight(true); | |
_.$list.animate({ | |
height: targetHeight | |
}, _.options.speed); | |
} | |
}; | |
Slick.prototype.animateSlide = function(targetLeft, callback) { | |
var animProps = {}, | |
_ = this; | |
_.animateHeight(); | |
if (_.options.rtl === true && _.options.vertical === false) { | |
targetLeft = -targetLeft; | |
} | |
if (_.transformsEnabled === false) { | |
if (_.options.vertical === false) { | |
_.$slideTrack.animate({ | |
left: targetLeft | |
}, _.options.speed, _.options.easing, callback); | |
} else { | |
_.$slideTrack.animate({ | |
top: targetLeft | |
}, _.options.speed, _.options.easing, callback); | |
} | |
} else { | |
if (_.cssTransitions === false) { | |
if (_.options.rtl === true) { | |
_.currentLeft = -(_.currentLeft); | |
} | |
$({ | |
animStart: _.currentLeft | |
}).animate({ | |
animStart: targetLeft | |
}, { | |
duration: _.options.speed, | |
easing: _.options.easing, | |
step: function(now) { | |
now = Math.ceil(now); | |
if (_.options.vertical === false) { | |
animProps[_.animType] = 'translate(' + | |
now + 'px, 0px)'; | |
_.$slideTrack.css(animProps); | |
} else { | |
animProps[_.animType] = 'translate(0px,' + | |
now + 'px)'; | |
_.$slideTrack.css(animProps); | |
} | |
}, | |
complete: function() { | |
if (callback) { | |
callback.call(); | |
} | |
} | |
}); | |
} else { | |
_.applyTransition(); | |
targetLeft = Math.ceil(targetLeft); | |
if (_.options.vertical === false) { | |
animProps[_.animType] = 'translate3d(' + targetLeft + 'px, 0px, 0px)'; | |
} else { | |
animProps[_.animType] = 'translate3d(0px,' + targetLeft + 'px, 0px)'; | |
} | |
_.$slideTrack.css(animProps); | |
if (callback) { | |
setTimeout(function() { | |
_.disableTransition(); | |
callback.call(); | |
}, _.options.speed); | |
} | |
} | |
} | |
}; | |
Slick.prototype.getNavTarget = function() { | |
var _ = this, | |
asNavFor = _.options.asNavFor; | |
if ( asNavFor && asNavFor !== null ) { | |
asNavFor = $(asNavFor).not(_.$slider); | |
} | |
return asNavFor; | |
}; | |
Slick.prototype.asNavFor = function(index) { | |
var _ = this, | |
asNavFor = _.getNavTarget(); | |
if ( asNavFor !== null && typeof asNavFor === 'object' ) { | |
asNavFor.each(function() { | |
var target = $(this).slick('getSlick'); | |
if(!target.unslicked) { | |
target.slideHandler(index, true); | |
} | |
}); | |
} | |
}; | |
Slick.prototype.applyTransition = function(slide) { | |
var _ = this, | |
transition = {}; | |
if (_.options.fade === false) { | |
transition[_.transitionType] = _.transformType + ' ' + _.options.speed + 'ms ' + _.options.cssEase; | |
} else { | |
transition[_.transitionType] = 'opacity ' + _.options.speed + 'ms ' + _.options.cssEase; | |
} | |
if (_.options.fade === false) { | |
_.$slideTrack.css(transition); | |
} else { | |
_.$slides.eq(slide).css(transition); | |
} | |
}; | |
Slick.prototype.autoPlay = function() { | |
var _ = this; | |
_.autoPlayClear(); | |
if ( _.slideCount > _.options.slidesToShow ) { | |
_.autoPlayTimer = setInterval( _.autoPlayIterator, _.options.autoplaySpeed ); | |
} | |
}; | |
Slick.prototype.autoPlayClear = function() { | |
var _ = this; | |
if (_.autoPlayTimer) { | |
clearInterval(_.autoPlayTimer); | |
} | |
}; | |
Slick.prototype.autoPlayIterator = function() { | |
var _ = this, | |
slideTo = _.currentSlide + _.options.slidesToScroll; | |
if ( !_.paused && !_.interrupted && !_.focussed ) { | |
if ( _.options.infinite === false ) { | |
if ( _.direction === 1 && ( _.currentSlide + 1 ) === ( _.slideCount - 1 )) { | |
_.direction = 0; | |
} | |
else if ( _.direction === 0 ) { | |
slideTo = _.currentSlide - _.options.slidesToScroll; | |
if ( _.currentSlide - 1 === 0 ) { | |
_.direction = 1; | |
} | |
} | |
} | |
_.slideHandler( slideTo ); | |
} | |
}; | |
Slick.prototype.buildArrows = function() { | |
var _ = this; | |
if (_.options.arrows === true ) { | |
_.$prevArrow = $(_.options.prevArrow).addClass('slick-arrow'); | |
_.$nextArrow = $(_.options.nextArrow).addClass('slick-arrow'); | |
if( _.slideCount > _.options.slidesToShow ) { | |
_.$prevArrow.removeClass('slick-hidden').removeAttr('aria-hidden tabindex'); | |
_.$nextArrow.removeClass('slick-hidden').removeAttr('aria-hidden tabindex'); | |
if (_.htmlExpr.test(_.options.prevArrow)) { | |
_.$prevArrow.prependTo(_.options.appendArrows); | |
} | |
if (_.htmlExpr.test(_.options.nextArrow)) { | |
_.$nextArrow.appendTo(_.options.appendArrows); | |
} | |
if (_.options.infinite !== true) { | |
_.$prevArrow | |
.addClass('slick-disabled') | |
.attr('aria-disabled', 'true'); | |
} | |
} else { | |
_.$prevArrow.add( _.$nextArrow ) | |
.addClass('slick-hidden') | |
.attr({ | |
'aria-disabled': 'true', | |
'tabindex': '-1' | |
}); | |
} | |
} | |
}; | |
Slick.prototype.buildDots = function() { | |
var _ = this, | |
i, dot; | |
if (_.options.dots === true && _.slideCount > _.options.slidesToShow) { | |
_.$slider.addClass('slick-dotted'); | |
dot = $('<ul />').addClass(_.options.dotsClass); | |
for (i = 0; i <= _.getDotCount(); i += 1) { | |
dot.append($('<li />').append(_.options.customPaging.call(this, _, i))); | |
} | |
_.$dots = dot.appendTo(_.options.appendDots); | |
_.$dots.find('li').first().addClass('slick-active'); | |
} | |
}; | |
Slick.prototype.buildOut = function() { | |
var _ = this; | |
_.$slides = | |
_.$slider | |
.children( _.options.slide + ':not(.slick-cloned)') | |
.addClass('slick-slide'); | |
_.slideCount = _.$slides.length; | |
_.$slides.each(function(index, element) { | |
$(element) | |
.attr('data-slick-index', index) | |
.data('originalStyling', $(element).attr('style') || ''); | |
}); | |
_.$slider.addClass('slick-slider'); | |
_.$slideTrack = (_.slideCount === 0) ? | |
$('<div class="slick-track"/>').appendTo(_.$slider) : | |
_.$slides.wrapAll('<div class="slick-track"/>').parent(); | |
_.$list = _.$slideTrack.wrap( | |
'<div class="slick-list"/>').parent(); | |
_.$slideTrack.css('opacity', 0); | |
if (_.options.centerMode === true || _.options.swipeToSlide === true) { | |
_.options.slidesToScroll = 1; | |
} | |
$('img[data-lazy]', _.$slider).not('[src]').addClass('slick-loading'); | |
_.setupInfinite(); | |
_.buildArrows(); | |
_.buildDots(); | |
_.updateDots(); | |
_.setSlideClasses(typeof _.currentSlide === 'number' ? _.currentSlide : 0); | |
if (_.options.draggable === true) { | |
_.$list.addClass('draggable'); | |
} | |
}; | |
Slick.prototype.buildRows = function() { | |
var _ = this, a, b, c, newSlides, numOfSlides, originalSlides,slidesPerSection; | |
newSlides = document.createDocumentFragment(); | |
originalSlides = _.$slider.children(); | |
if(_.options.rows > 0) { | |
slidesPerSection = _.options.slidesPerRow * _.options.rows; | |
numOfSlides = Math.ceil( | |
originalSlides.length / slidesPerSection | |
); | |
for(a = 0; a < numOfSlides; a++){ | |
var slide = document.createElement('div'); | |
for(b = 0; b < _.options.rows; b++) { | |
var row = document.createElement('div'); | |
for(c = 0; c < _.options.slidesPerRow; c++) { | |
var target = (a * slidesPerSection + ((b * _.options.slidesPerRow) + c)); | |
if (originalSlides.get(target)) { | |
row.appendChild(originalSlides.get(target)); | |
} | |
} | |
slide.appendChild(row); | |
} | |
newSlides.appendChild(slide); | |
} | |
_.$slider.empty().append(newSlides); | |
_.$slider.children().children().children() | |
.css({ | |
'width':(100 / _.options.slidesPerRow) + '%', | |
'display': 'inline-block' | |
}); | |
} | |
}; | |
Slick.prototype.checkResponsive = function(initial, forceUpdate) { | |
var _ = this, | |
breakpoint, targetBreakpoint, respondToWidth, triggerBreakpoint = false; | |
var sliderWidth = _.$slider.width(); | |
var windowWidth = window.innerWidth || $(window).width(); | |
if (_.respondTo === 'window') { | |
respondToWidth = windowWidth; | |
} else if (_.respondTo === 'slider') { | |
respondToWidth = sliderWidth; | |
} else if (_.respondTo === 'min') { | |
respondToWidth = Math.min(windowWidth, sliderWidth); | |
} | |
if ( _.options.responsive && | |
_.options.responsive.length && | |
_.options.responsive !== null) { | |
targetBreakpoint = null; | |
for (breakpoint in _.breakpoints) { | |
if (_.breakpoints.hasOwnProperty(breakpoint)) { | |
if (_.originalSettings.mobileFirst === false) { | |
if (respondToWidth < _.breakpoints[breakpoint]) { | |
targetBreakpoint = _.breakpoints[breakpoint]; | |
} | |
} else { | |
if (respondToWidth > _.breakpoints[breakpoint]) { | |
targetBreakpoint = _.breakpoints[breakpoint]; | |
} | |
} | |
} | |
} | |
if (targetBreakpoint !== null) { | |
if (_.activeBreakpoint !== null) { | |
if (targetBreakpoint !== _.activeBreakpoint || forceUpdate) { | |
_.activeBreakpoint = | |
targetBreakpoint; | |
if (_.breakpointSettings[targetBreakpoint] === 'unslick') { | |
_.unslick(targetBreakpoint); | |
} else { | |
_.options = $.extend({}, _.originalSettings, | |
_.breakpointSettings[ | |
targetBreakpoint]); | |
if (initial === true) { | |
_.currentSlide = _.options.initialSlide; | |
} | |
_.refresh(initial); | |
} | |
triggerBreakpoint = targetBreakpoint; | |
} | |
} else { | |
_.activeBreakpoint = targetBreakpoint; | |
if (_.breakpointSettings[targetBreakpoint] === 'unslick') { | |
_.unslick(targetBreakpoint); | |
} else { | |
_.options = $.extend({}, _.originalSettings, | |
_.breakpointSettings[ | |
targetBreakpoint]); | |
if (initial === true) { | |
_.currentSlide = _.options.initialSlide; | |
} | |
_.refresh(initial); | |
} | |
triggerBreakpoint = targetBreakpoint; | |
} | |
} else { | |
if (_.activeBreakpoint !== null) { | |
_.activeBreakpoint = null; | |
_.options = _.originalSettings; | |
if (initial === true) { | |
_.currentSlide = _.options.initialSlide; | |
} | |
_.refresh(initial); | |
triggerBreakpoint = targetBreakpoint; | |
} | |
} | |
// only trigger breakpoints during an actual break. not on initialize. | |
if( !initial && triggerBreakpoint !== false ) { | |
_.$slider.trigger('breakpoint', [_, triggerBreakpoint]); | |
} | |
} | |
}; | |
Slick.prototype.changeSlide = function(event, dontAnimate) { | |
var _ = this, | |
$target = $(event.currentTarget), | |
indexOffset, slideOffset, unevenOffset; | |
// If target is a link, prevent default action. | |
if($target.is('a')) { | |
event.preventDefault(); | |
} | |
// If target is not the <li> element (ie: a child), find the <li>. | |
if(!$target.is('li')) { | |
$target = $target.closest('li'); | |
} | |
unevenOffset = (_.slideCount % _.options.slidesToScroll !== 0); | |
indexOffset = unevenOffset ? 0 : (_.slideCount - _.currentSlide) % _.options.slidesToScroll; | |
switch (event.data.message) { | |
case 'previous': | |
slideOffset = indexOffset === 0 ? _.options.slidesToScroll : _.options.slidesToShow - indexOffset; | |
if (_.slideCount > _.options.slidesToShow) { | |
_.slideHandler(_.currentSlide - slideOffset, false, dontAnimate); | |
} | |
break; | |
case 'next': | |
slideOffset = indexOffset === 0 ? _.options.slidesToScroll : indexOffset; | |
if (_.slideCount > _.options.slidesToShow) { | |
_.slideHandler(_.currentSlide + slideOffset, false, dontAnimate); | |
} | |
break; | |
case 'index': | |
var index = event.data.index === 0 ? 0 : | |
event.data.index || $target.index() * _.options.slidesToScroll; | |
_.slideHandler(_.checkNavigable(index), false, dontAnimate); | |
$target.children().trigger('focus'); | |
break; | |
default: | |
return; | |
} | |
}; | |
Slick.prototype.checkNavigable = function(index) { | |
var _ = this, | |
navigables, prevNavigable; | |
navigables = _.getNavigableIndexes(); | |
prevNavigable = 0; | |
if (index > navigables[navigables.length - 1]) { | |
index = navigables[navigables.length - 1]; | |
} else { | |
for (var n in navigables) { | |
if (index < navigables[n]) { | |
index = prevNavigable; | |
break; | |
} | |
prevNavigable = navigables[n]; | |
} | |
} | |
return index; | |
}; | |
Slick.prototype.cleanUpEvents = function() { | |
var _ = this; | |
if (_.options.dots && _.$dots !== null) { | |
$('li', _.$dots) | |
.off('click.slick', _.changeSlide) | |
.off('mouseenter.slick', $.proxy(_.interrupt, _, true)) | |
.off('mouseleave.slick', $.proxy(_.interrupt, _, false)); | |
if (_.options.accessibility === true) { | |
_.$dots.off('keydown.slick', _.keyHandler); | |
} | |
} | |
_.$slider.off('focus.slick blur.slick'); | |
if (_.options.arrows === true && _.slideCount > _.options.slidesToShow) { | |
_.$prevArrow && _.$prevArrow.off('click.slick', _.changeSlide); | |
_.$nextArrow && _.$nextArrow.off('click.slick', _.changeSlide); | |
if (_.options.accessibility === true) { | |
_.$prevArrow && _.$prevArrow.off('keydown.slick', _.keyHandler); | |
_.$nextArrow && _.$nextArrow.off('keydown.slick', _.keyHandler); | |
} | |
} | |
_.$list.off('touchstart.slick mousedown.slick', _.swipeHandler); | |
_.$list.off('touchmove.slick mousemove.slick', _.swipeHandler); | |
_.$list.off('touchend.slick mouseup.slick', _.swipeHandler); | |
_.$list.off('touchcancel.slick mouseleave.slick', _.swipeHandler); | |
_.$list.off('click.slick', _.clickHandler); | |
$(document).off(_.visibilityChange, _.visibility); | |
_.cleanUpSlideEvents(); | |
if (_.options.accessibility === true) { | |
_.$list.off('keydown.slick', _.keyHandler); | |
} | |
if (_.options.focusOnSelect === true) { | |
$(_.$slideTrack).children().off('click.slick', _.selectHandler); | |
} | |
$(window).off('orientationchange.slick.slick-' + _.instanceUid, _.orientationChange); | |
$(window).off('resize.slick.slick-' + _.instanceUid, _.resize); | |
$('[draggable!=true]', _.$slideTrack).off('dragstart', _.preventDefault); | |
$(window).off('load.slick.slick-' + _.instanceUid, _.setPosition); | |
}; | |
Slick.prototype.cleanUpSlideEvents = function() { | |
var _ = this; | |
_.$list.off('mouseenter.slick', $.proxy(_.interrupt, _, true)); | |
_.$list.off('mouseleave.slick', $.proxy(_.interrupt, _, false)); | |
}; | |
Slick.prototype.cleanUpRows = function() { | |
var _ = this, originalSlides; | |
if(_.options.rows > 0) { | |
originalSlides = _.$slides.children().children(); | |
originalSlides.removeAttr('style'); | |
_.$slider.empty().append(originalSlides); | |
} | |
}; | |
Slick.prototype.clickHandler = function(event) { | |
var _ = this; | |
if (_.shouldClick === false) { | |
event.stopImmediatePropagation(); | |
event.stopPropagation(); | |
event.preventDefault(); | |
} | |
}; | |
Slick.prototype.destroy = function(refresh) { | |
var _ = this; | |
_.autoPlayClear(); | |
_.touchObject = {}; | |
_.cleanUpEvents(); | |
$('.slick-cloned', _.$slider).detach(); | |
if (_.$dots) { | |
_.$dots.remove(); | |
} | |
if ( _.$prevArrow && _.$prevArrow.length ) { | |
_.$prevArrow | |
.removeClass('slick-disabled slick-arrow slick-hidden') | |
.removeAttr('aria-hidden aria-disabled tabindex') | |
.css('display',''); | |
if ( _.htmlExpr.test( _.options.prevArrow )) { | |
_.$prevArrow.remove(); | |
} | |
} | |
if ( _.$nextArrow && _.$nextArrow.length ) { | |
_.$nextArrow | |
.removeClass('slick-disabled slick-arrow slick-hidden') | |
.removeAttr('aria-hidden aria-disabled tabindex') | |
.css('display',''); | |
if ( _.htmlExpr.test( _.options.nextArrow )) { | |
_.$nextArrow.remove(); | |
} | |
} | |
if (_.$slides) { | |
_.$slides | |
.removeClass('slick-slide slick-active slick-center slick-visible slick-current') | |
.removeAttr('aria-hidden') | |
.removeAttr('data-slick-index') | |
.each(function(){ | |
$(this).attr('style', $(this).data('originalStyling')); | |
}); | |
_.$slideTrack.children(this.options.slide).detach(); | |
_.$slideTrack.detach(); | |
_.$list.detach(); | |
_.$slider.append(_.$slides); | |
} | |
_.cleanUpRows(); | |
_.$slider.removeClass('slick-slider'); | |
_.$slider.removeClass('slick-initialized'); | |
_.$slider.removeClass('slick-dotted'); | |
_.unslicked = true; | |
if(!refresh) { | |
_.$slider.trigger('destroy', [_]); | |
} | |
}; | |
Slick.prototype.disableTransition = function(slide) { | |
var _ = this, | |
transition = {}; | |
transition[_.transitionType] = ''; | |
if (_.options.fade === false) { | |
_.$slideTrack.css(transition); | |
} else { | |
_.$slides.eq(slide).css(transition); | |
} | |
}; | |
Slick.prototype.fadeSlide = function(slideIndex, callback) { | |
var _ = this; | |
if (_.cssTransitions === false) { | |
_.$slides.eq(slideIndex).css({ | |
zIndex: _.options.zIndex | |
}); | |
_.$slides.eq(slideIndex).animate({ | |
opacity: 1 | |
}, _.options.speed, _.options.easing, callback); | |
} else { | |
_.applyTransition(slideIndex); | |
_.$slides.eq(slideIndex).css({ | |
opacity: 1, | |
zIndex: _.options.zIndex | |
}); | |
if (callback) { | |
setTimeout(function() { | |
_.disableTransition(slideIndex); | |
callback.call(); | |
}, _.options.speed); | |
} | |
} | |
}; | |
Slick.prototype.fadeSlideOut = function(slideIndex) { | |
var _ = this; | |
if (_.cssTransitions === false) { | |
_.$slides.eq(slideIndex).animate({ | |
opacity: 0, | |
zIndex: _.options.zIndex - 2 | |
}, _.options.speed, _.options.easing); | |
} else { | |
_.applyTransition(slideIndex); | |
_.$slides.eq(slideIndex).css({ | |
opacity: 0, | |
zIndex: _.options.zIndex - 2 | |
}); | |
} | |
}; | |
Slick.prototype.filterSlides = Slick.prototype.slickFilter = function(filter) { | |
var _ = this; | |
if (filter !== null) { | |
_.$slidesCache = _.$slides; | |
_.unload(); | |
_.$slideTrack.children(this.options.slide).detach(); | |
_.$slidesCache.filter(filter).appendTo(_.$slideTrack); | |
_.reinit(); | |
} | |
}; | |
Slick.prototype.focusHandler = function() { | |
var _ = this; | |
// If any child element receives focus within the slider we need to pause the autoplay | |
_.$slider | |
.off('focus.slick blur.slick') | |
.on( | |
'focus.slick', | |
'*', | |
function(event) { | |
var $sf = $(this); | |
setTimeout(function() { | |
if( _.options.pauseOnFocus ) { | |
if ($sf.is(':focus')) { | |
_.focussed = true; | |
_.autoPlay(); | |
} | |
} | |
}, 0); | |
} | |
).on( | |
'blur.slick', | |
'*', | |
function(event) { | |
var $sf = $(this); | |
// When a blur occurs on any elements within the slider we become unfocused | |
if( _.options.pauseOnFocus ) { | |
_.focussed = false; | |
_.autoPlay(); | |
} | |
} | |
); | |
}; | |
Slick.prototype.getCurrent = Slick.prototype.slickCurrentSlide = function() { | |
var _ = this; | |
return _.currentSlide; | |
}; | |
Slick.prototype.getDotCount = function() { | |
var _ = this; | |
var breakPoint = 0; | |
var counter = 0; | |
var pagerQty = 0; | |
if (_.options.infinite === true) { | |
if (_.slideCount <= _.options.slidesToShow) { | |
++pagerQty; | |
} else { | |
while (breakPoint < _.slideCount) { | |
++pagerQty; | |
breakPoint = counter + _.options.slidesToScroll; | |
counter += _.options.slidesToScroll <= _.options.slidesToShow ? _.options.slidesToScroll : _.options.slidesToShow; | |
} | |
} | |
} else if (_.options.centerMode === true) { | |
pagerQty = _.slideCount; | |
} else if(!_.options.asNavFor) { | |
pagerQty = 1 + Math.ceil((_.slideCount - _.options.slidesToShow) / _.options.slidesToScroll); | |
}else { | |
while (breakPoint < _.slideCount) { | |
++pagerQty; | |
breakPoint = counter + _.options.slidesToScroll; | |
counter += _.options.slidesToScroll <= _.options.slidesToShow ? _.options.slidesToScroll : _.options.slidesToShow; | |
} | |
} | |
return pagerQty - 1; | |
}; | |
Slick.prototype.getLeft = function(slideIndex) { | |
var _ = this, | |
targetLeft, | |
verticalHeight, | |
verticalOffset = 0, | |
targetSlide, | |
coef; | |
_.slideOffset = 0; | |
verticalHeight = _.$slides.first().outerHeight(true); | |
if (_.options.infinite === true) { | |
if (_.slideCount > _.options.slidesToShow) { | |
_.slideOffset = (_.slideWidth * _.options.slidesToShow) * -1; | |
coef = -1 | |
if (_.options.vertical === true && _.options.centerMode === true) { | |
if (_.options.slidesToShow === 2) { | |
coef = -1.5; | |
} else if (_.options.slidesToShow === 1) { | |
coef = -2 | |
} | |
} | |
verticalOffset = (verticalHeight * _.options.slidesToShow) * coef; | |
} | |
if (_.slideCount % _.options.slidesToScroll !== 0) { | |
if (slideIndex + _.options.slidesToScroll > _.slideCount && _.slideCount > _.options.slidesToShow) { | |
if (slideIndex > _.slideCount) { | |
_.slideOffset = ((_.options.slidesToShow - (slideIndex - _.slideCount)) * _.slideWidth) * -1; | |
verticalOffset = ((_.options.slidesToShow - (slideIndex - _.slideCount)) * verticalHeight) * -1; | |
} else { | |
_.slideOffset = ((_.slideCount % _.options.slidesToScroll) * _.slideWidth) * -1; | |
verticalOffset = ((_.slideCount % _.options.slidesToScroll) * verticalHeight) * -1; | |
} | |
} | |
} | |
} else { | |
if (slideIndex + _.options.slidesToShow > _.slideCount) { | |
_.slideOffset = ((slideIndex + _.options.slidesToShow) - _.slideCount) * _.slideWidth; | |
verticalOffset = ((slideIndex + _.options.slidesToShow) - _.slideCount) * verticalHeight; | |
} | |
} | |
if (_.slideCount <= _.options.slidesToShow) { | |
_.slideOffset = 0; | |
verticalOffset = 0; | |
} | |
if (_.options.centerMode === true && _.slideCount <= _.options.slidesToShow) { | |
_.slideOffset = ((_.slideWidth * Math.floor(_.options.slidesToShow)) / 2) - ((_.slideWidth * _.slideCount) / 2); | |
} else if (_.options.centerMode === true && _.options.infinite === true) { | |
_.slideOffset += _.slideWidth * Math.floor(_.options.slidesToShow / 2) - _.slideWidth; | |
} else if (_.options.centerMode === true) { | |
_.slideOffset = 0; | |
_.slideOffset += _.slideWidth * Math.floor(_.options.slidesToShow / 2); | |
} | |
if (_.options.vertical === false) { | |
targetLeft = ((slideIndex * _.slideWidth) * -1) + _.slideOffset; | |
} else { | |
targetLeft = ((slideIndex * verticalHeight) * -1) + verticalOffset; | |
} | |
if (_.options.variableWidth === true) { | |
if (_.slideCount <= _.options.slidesToShow || _.options.infinite === false) { | |
targetSlide = _.$slideTrack.children('.slick-slide').eq(slideIndex); | |
} else { | |
targetSlide = _.$slideTrack.children('.slick-slide').eq(slideIndex + _.options.slidesToShow); | |
} | |
if (_.options.rtl === true) { | |
if (targetSlide[0]) { | |
targetLeft = (_.$slideTrack.width() - targetSlide[0].offsetLeft - targetSlide.width()) * -1; | |
} else { | |
targetLeft = 0; | |
} | |
} else { | |
targetLeft = targetSlide[0] ? targetSlide[0].offsetLeft * -1 : 0; | |
} | |
if (_.options.centerMode === true) { | |
if (_.slideCount <= _.options.slidesToShow || _.options.infinite === false) { | |
targetSlide = _.$slideTrack.children('.slick-slide').eq(slideIndex); | |
} else { | |
targetSlide = _.$slideTrack.children('.slick-slide').eq(slideIndex + _.options.slidesToShow + 1); | |
} | |
if (_.options.rtl === true) { | |
if (targetSlide[0]) { | |
targetLeft = (_.$slideTrack.width() - targetSlide[0].offsetLeft - targetSlide.width()) * -1; | |
} else { | |
targetLeft = 0; | |
} | |
} else { | |
targetLeft = targetSlide[0] ? targetSlide[0].offsetLeft * -1 : 0; | |
} | |
targetLeft += (_.$list.width() - targetSlide.outerWidth()) / 2; | |
} | |
} | |
return targetLeft; | |
}; | |
Slick.prototype.getOption = Slick.prototype.slickGetOption = function(option) { | |
var _ = this; | |
return _.options[option]; | |
}; | |
Slick.prototype.getNavigableIndexes = function() { | |
var _ = this, | |
breakPoint = 0, | |
counter = 0, | |
indexes = [], | |
max; | |
if (_.options.infinite === false) { | |
max = _.slideCount; | |
} else { | |
breakPoint = _.options.slidesToScroll * -1; | |
counter = _.options.slidesToScroll * -1; | |
max = _.slideCount * 2; | |
} | |
while (breakPoint < max) { | |
indexes.push(breakPoint); | |
breakPoint = counter + _.options.slidesToScroll; | |
counter += _.options.slidesToScroll <= _.options.slidesToShow ? _.options.slidesToScroll : _.options.slidesToShow; | |
} | |
return indexes; | |
}; | |
Slick.prototype.getSlick = function() { | |
return this; | |
}; | |
Slick.prototype.getSlideCount = function() { | |
var _ = this, | |
slidesTraversed, swipedSlide, swipeTarget, centerOffset; | |
centerOffset = _.options.centerMode === true ? Math.floor(_.$list.width() / 2) : 0; | |
swipeTarget = (_.swipeLeft * -1) + centerOffset; | |
if (_.options.swipeToSlide === true) { | |
_.$slideTrack.find('.slick-slide').each(function(index, slide) { | |
var slideOuterWidth, slideOffset, slideRightBoundary; | |
slideOuterWidth = $(slide).outerWidth(); | |
slideOffset = slide.offsetLeft; | |
if (_.options.centerMode !== true) { | |
slideOffset += (slideOuterWidth / 2); | |
} | |
slideRightBoundary = slideOffset + (slideOuterWidth); | |
if (swipeTarget < slideRightBoundary) { | |
swipedSlide = slide; | |
return false; | |
} | |
}); | |
slidesTraversed = Math.abs($(swipedSlide).attr('data-slick-index') - _.currentSlide) || 1; | |
return slidesTraversed; | |
} else { | |
return _.options.slidesToScroll; | |
} | |
}; | |
Slick.prototype.goTo = Slick.prototype.slickGoTo = function(slide, dontAnimate) { | |
var _ = this; | |
_.changeSlide({ | |
data: { | |
message: 'index', | |
index: parseInt(slide) | |
} | |
}, dontAnimate); | |
}; | |
Slick.prototype.init = function(creation) { | |
var _ = this; | |
if (!$(_.$slider).hasClass('slick-initialized')) { | |
$(_.$slider).addClass('slick-initialized'); | |
_.buildRows(); | |
_.buildOut(); | |
_.setProps(); | |
_.startLoad(); | |
_.loadSlider(); | |
_.initializeEvents(); | |
_.updateArrows(); | |
_.updateDots(); | |
_.checkResponsive(true); | |
_.focusHandler(); | |
} | |
if (creation) { | |
_.$slider.trigger('init', [_]); | |
} | |
if (_.options.accessibility === true) { | |
_.initADA(); | |
} | |
if ( _.options.autoplay ) { | |
_.paused = false; | |
_.autoPlay(); | |
} | |
}; | |
Slick.prototype.initADA = function() { | |
var _ = this, | |
numDotGroups = Math.ceil(_.slideCount / _.options.slidesToShow), | |
tabControlIndexes = _.getNavigableIndexes().filter(function(val) { | |
return (val >= 0) && (val < _.slideCount); | |
}); | |
_.$slides.add(_.$slideTrack.find('.slick-cloned')).attr({ | |
'aria-hidden': 'true', | |
'tabindex': '-1' | |
}).find('a, input, button, select').attr({ | |
'tabindex': '-1' | |
}); | |
if (_.$dots !== null) { | |
_.$slides.not(_.$slideTrack.find('.slick-cloned')).each(function(i) { | |
var slideControlIndex = tabControlIndexes.indexOf(i); | |
$(this).attr({ | |
'role': 'tabpanel', | |
'id': 'slick-slide' + _.instanceUid + i, | |
'tabindex': -1 | |
}); | |
if (slideControlIndex !== -1) { | |
var ariaButtonControl = 'slick-slide-control' + _.instanceUid + slideControlIndex | |
if ($('#' + ariaButtonControl).length) { | |
$(this).attr({ | |
'aria-describedby': ariaButtonControl | |
}); | |
} | |
} | |
}); | |
_.$dots.attr('role', 'tablist').find('li').each(function(i) { | |
var mappedSlideIndex = tabControlIndexes[i]; | |
$(this).attr({ | |
'role': 'presentation' | |
}); | |
$(this).find('button').first().attr({ | |
'role': 'tab', | |
'id': 'slick-slide-control' + _.instanceUid + i, | |
'aria-controls': 'slick-slide' + _.instanceUid + mappedSlideIndex, | |
'aria-label': (i + 1) + ' of ' + numDotGroups, | |
'aria-selected': null, | |
'tabindex': '-1' | |
}); | |
}).eq(_.currentSlide).find('button').attr({ | |
'aria-selected': 'true', | |
'tabindex': '0' | |
}).end(); | |
} | |
for (var i=_.currentSlide, max=i+_.options.slidesToShow; i < max; i++) { | |
if (_.options.focusOnChange) { | |
_.$slides.eq(i).attr({'tabindex': '0'}); | |
} else { | |
_.$slides.eq(i).removeAttr('tabindex'); | |
} | |
} | |
_.activateADA(); | |
}; | |
Slick.prototype.initArrowEvents = function() { | |
var _ = this; | |
if (_.options.arrows === true && _.slideCount > _.options.slidesToShow) { | |
_.$prevArrow | |
.off('click.slick') | |
.on('click.slick', { | |
message: 'previous' | |
}, _.changeSlide); | |
_.$nextArrow | |
.off('click.slick') | |
.on('click.slick', { | |
message: 'next' | |
}, _.changeSlide); | |
if (_.options.accessibility === true) { | |
_.$prevArrow.on('keydown.slick', _.keyHandler); | |
_.$nextArrow.on('keydown.slick', _.keyHandler); | |
} | |
} | |
}; | |
Slick.prototype.initDotEvents = function() { | |
var _ = this; | |
if (_.options.dots === true && _.slideCount > _.options.slidesToShow) { | |
$('li', _.$dots).on('click.slick', { | |
message: 'index' | |
}, _.changeSlide); | |
if (_.options.accessibility === true) { | |
_.$dots.on('keydown.slick', _.keyHandler); | |
} | |
} | |
if (_.options.dots === true && _.options.pauseOnDotsHover === true && _.slideCount > _.options.slidesToShow) { | |
$('li', _.$dots) | |
.on('mouseenter.slick', $.proxy(_.interrupt, _, true)) | |
.on('mouseleave.slick', $.proxy(_.interrupt, _, false)); | |
} | |
}; | |
Slick.prototype.initSlideEvents = function() { | |
var _ = this; | |
if ( _.options.pauseOnHover ) { | |
_.$list.on('mouseenter.slick', $.proxy(_.interrupt, _, true)); | |
_.$list.on('mouseleave.slick', $.proxy(_.interrupt, _, false)); | |
} | |
}; | |
Slick.prototype.initializeEvents = function() { | |
var _ = this; | |
_.initArrowEvents(); | |
_.initDotEvents(); | |
_.initSlideEvents(); | |
_.$list.on('touchstart.slick mousedown.slick', { | |
action: 'start' | |
}, _.swipeHandler); | |
_.$list.on('touchmove.slick mousemove.slick', { | |
action: 'move' | |
}, _.swipeHandler); | |
_.$list.on('touchend.slick mouseup.slick', { | |
action: 'end' | |
}, _.swipeHandler); | |
_.$list.on('touchcancel.slick mouseleave.slick', { | |
action: 'end' | |
}, _.swipeHandler); | |
_.$list.on('click.slick', _.clickHandler); | |
$(document).on(_.visibilityChange, $.proxy(_.visibility, _)); | |
if (_.options.accessibility === true) { | |
_.$list.on('keydown.slick', _.keyHandler); | |
} | |
if (_.options.focusOnSelect === true) { | |
$(_.$slideTrack).children().on('click.slick', _.selectHandler); | |
} | |
$(window).on('orientationchange.slick.slick-' + _.instanceUid, $.proxy(_.orientationChange, _)); | |
$(window).on('resize.slick.slick-' + _.instanceUid, $.proxy(_.resize, _)); | |
$('[draggable!=true]', _.$slideTrack).on('dragstart', _.preventDefault); | |
$(window).on('load.slick.slick-' + _.instanceUid, _.setPosition); | |
$(_.setPosition); | |
}; | |
Slick.prototype.initUI = function() { | |
var _ = this; | |
if (_.options.arrows === true && _.slideCount > _.options.slidesToShow) { | |
_.$prevArrow.show(); | |
_.$nextArrow.show(); | |
} | |
if (_.options.dots === true && _.slideCount > _.options.slidesToShow) { | |
_.$dots.show(); | |
} | |
}; | |
Slick.prototype.keyHandler = function(event) { | |
var _ = this; | |
//Dont slide if the cursor is inside the form fields and arrow keys are pressed | |
if(!event.target.tagName.match('TEXTAREA|INPUT|SELECT')) { | |
if (event.keyCode === 37 && _.options.accessibility === true) { | |
_.changeSlide({ | |
data: { | |
message: _.options.rtl === true ? 'next' : 'previous' | |
} | |
}); | |
} else if (event.keyCode === 39 && _.options.accessibility === true) { | |
_.changeSlide({ | |
data: { | |
message: _.options.rtl === true ? 'previous' : 'next' | |
} | |
}); | |
} | |
} | |
}; | |
Slick.prototype.lazyLoad = function() { | |
var _ = this, | |
loadRange, cloneRange, rangeStart, rangeEnd; | |
function loadImages(imagesScope) { | |
$('img[data-lazy]', imagesScope).each(function() { | |
var image = $(this), | |
imageSource = $(this).attr('data-lazy'), | |
imageSrcSet = $(this).attr('data-srcset'), | |
imageSizes = $(this).attr('data-sizes') || _.$slider.attr('data-sizes'), | |
imageToLoad = document.createElement('img'); | |
imageToLoad.onload = function() { | |
image | |
.animate({ opacity: 0 }, 100, function() { | |
if (imageSrcSet) { | |
image | |
.attr('srcset', imageSrcSet ); | |
if (imageSizes) { | |
image | |
.attr('sizes', imageSizes ); | |
} | |
} | |
image | |
.attr('src', imageSource) | |
.animate({ opacity: 1 }, 200, function() { | |
image | |
.removeAttr('data-lazy data-srcset data-sizes') | |
.removeClass('slick-loading'); | |
}); | |
_.$slider.trigger('lazyLoaded', [_, image, imageSource]); | |
}); | |
}; | |
imageToLoad.onerror = function() { | |
image | |
.removeAttr( 'data-lazy' ) | |
.removeClass( 'slick-loading' ) | |
.addClass( 'slick-lazyload-error' ); | |
_.$slider.trigger('lazyLoadError', [ _, image, imageSource ]); | |
}; | |
imageToLoad.src = imageSource; | |
}); | |
} | |
if (_.options.centerMode === true) { | |
if (_.options.infinite === true) { | |
rangeStart = _.currentSlide + (_.options.slidesToShow / 2 + 1); | |
rangeEnd = rangeStart + _.options.slidesToShow + 2; | |
} else { | |
rangeStart = Math.max(0, _.currentSlide - (_.options.slidesToShow / 2 + 1)); | |
rangeEnd = 2 + (_.options.slidesToShow / 2 + 1) + _.currentSlide; | |
} | |
} else { | |
rangeStart = _.options.infinite ? _.options.slidesToShow + _.currentSlide : _.currentSlide; | |
rangeEnd = Math.ceil(rangeStart + _.options.slidesToShow); | |
if (_.options.fade === true) { | |
if (rangeStart > 0) rangeStart--; | |
if (rangeEnd <= _.slideCount) rangeEnd++; | |
} | |
} | |
loadRange = _.$slider.find('.slick-slide').slice(rangeStart, rangeEnd); | |
if (_.options.lazyLoad === 'anticipated') { | |
var prevSlide = rangeStart - 1, | |
nextSlide = rangeEnd, | |
$slides = _.$slider.find('.slick-slide'); | |
for (var i = 0; i < _.options.slidesToScroll; i++) { | |
if (prevSlide < 0) prevSlide = _.slideCount - 1; | |
loadRange = loadRange.add($slides.eq(prevSlide)); | |
loadRange = loadRange.add($slides.eq(nextSlide)); | |
prevSlide--; | |
nextSlide++; | |
} | |
} | |
loadImages(loadRange); | |
if (_.slideCount <= _.options.slidesToShow) { | |
cloneRange = _.$slider.find('.slick-slide'); | |
loadImages(cloneRange); | |
} else | |
if (_.currentSlide >= _.slideCount - _.options.slidesToShow) { | |
cloneRange = _.$slider.find('.slick-cloned').slice(0, _.options.slidesToShow); | |
loadImages(cloneRange); | |
} else if (_.currentSlide === 0) { | |
cloneRange = _.$slider.find('.slick-cloned').slice(_.options.slidesToShow * -1); | |
loadImages(cloneRange); | |
} | |
}; | |
Slick.prototype.loadSlider = function() { | |
var _ = this; | |
_.setPosition(); | |
_.$slideTrack.css({ | |
opacity: 1 | |
}); | |
_.$slider.removeClass('slick-loading'); | |
_.initUI(); | |
if (_.options.lazyLoad === 'progressive') { | |
_.progressiveLazyLoad(); | |
} | |
}; | |
Slick.prototype.next = Slick.prototype.slickNext = function() { | |
var _ = this; | |
_.changeSlide({ | |
data: { | |
message: 'next' | |
} | |
}); | |
}; | |
Slick.prototype.orientationChange = function() { | |
var _ = this; | |
_.checkResponsive(); | |
_.setPosition(); | |
}; | |
Slick.prototype.pause = Slick.prototype.slickPause = function() { | |
var _ = this; | |
_.autoPlayClear(); | |
_.paused = true; | |
}; | |
Slick.prototype.play = Slick.prototype.slickPlay = function() { | |
var _ = this; | |
_.autoPlay(); | |
_.options.autoplay = true; | |
_.paused = false; | |
_.focussed = false; | |
_.interrupted = false; | |
}; | |
Slick.prototype.postSlide = function(index) { | |
var _ = this; | |
if( !_.unslicked ) { | |
_.$slider.trigger('afterChange', [_, index]); | |
_.animating = false; | |
if (_.slideCount > _.options.slidesToShow) { | |
_.setPosition(); | |
} | |
_.swipeLeft = null; | |
if ( _.options.autoplay ) { | |
_.autoPlay(); | |
} | |
if (_.options.accessibility === true) { | |
_.initADA(); | |
if (_.options.focusOnChange) { | |
var $currentSlide = $(_.$slides.get(_.currentSlide)); | |
$currentSlide.attr('tabindex', 0).focus(); | |
} | |
} | |
} | |
}; | |
Slick.prototype.prev = Slick.prototype.slickPrev = function() { | |
var _ = this; | |
_.changeSlide({ | |
data: { | |
message: 'previous' | |
} | |
}); | |
}; | |
Slick.prototype.preventDefault = function(event) { | |
event.preventDefault(); | |
}; | |
Slick.prototype.progressiveLazyLoad = function( tryCount ) { | |
tryCount = tryCount || 1; | |
var _ = this, | |
$imgsToLoad = $( 'img[data-lazy]', _.$slider ), | |
image, | |
imageSource, | |
imageSrcSet, | |
imageSizes, | |
imageToLoad; | |
if ( $imgsToLoad.length ) { | |
image = $imgsToLoad.first(); | |
imageSource = image.attr('data-lazy'); | |
imageSrcSet = image.attr('data-srcset'); | |
imageSizes = image.attr('data-sizes') || _.$slider.attr('data-sizes'); | |
imageToLoad = document.createElement('img'); | |
imageToLoad.onload = function() { | |
if (imageSrcSet) { | |
image | |
.attr('srcset', imageSrcSet ); | |
if (imageSizes) { | |
image | |
.attr('sizes', imageSizes ); | |
} | |
} | |
image | |
.attr( 'src', imageSource ) | |
.removeAttr('data-lazy data-srcset data-sizes') | |
.removeClass('slick-loading'); | |
if ( _.options.adaptiveHeight === true ) { | |
_.setPosition(); | |
} | |
_.$slider.trigger('lazyLoaded', [ _, image, imageSource ]); | |
_.progressiveLazyLoad(); | |
}; | |
imageToLoad.onerror = function() { | |
if ( tryCount < 3 ) { | |
/** | |
* try to load the image 3 times, | |
* leave a slight delay so we don't get | |
* servers blocking the request. | |
*/ | |
setTimeout( function() { | |
_.progressiveLazyLoad( tryCount + 1 ); | |
}, 500 ); | |
} else { | |
image | |
.removeAttr( 'data-lazy' ) | |
.removeClass( 'slick-loading' ) | |
.addClass( 'slick-lazyload-error' ); | |
_.$slider.trigger('lazyLoadError', [ _, image, imageSource ]); | |
_.progressiveLazyLoad(); | |
} | |
}; | |
imageToLoad.src = imageSource; | |
} else { | |
_.$slider.trigger('allImagesLoaded', [ _ ]); | |
} | |
}; | |
Slick.prototype.refresh = function( initializing ) { | |
var _ = this, currentSlide, lastVisibleIndex; | |
lastVisibleIndex = _.slideCount - _.options.slidesToShow; | |
// in non-infinite sliders, we don't want to go past the | |
// last visible index. | |
if( !_.options.infinite && ( _.currentSlide > lastVisibleIndex )) { | |
_.currentSlide = lastVisibleIndex; | |
} | |
// if less slides than to show, go to start. | |
if ( _.slideCount <= _.options.slidesToShow ) { | |
_.currentSlide = 0; | |
} | |
currentSlide = _.currentSlide; | |
_.destroy(true); | |
$.extend(_, _.initials, { currentSlide: currentSlide }); | |
_.init(); | |
if( !initializing ) { | |
_.changeSlide({ | |
data: { | |
message: 'index', | |
index: currentSlide | |
} | |
}, false); | |
} | |
}; | |
Slick.prototype.registerBreakpoints = function() { | |
var _ = this, breakpoint, currentBreakpoint, l, | |
responsiveSettings = _.options.responsive || null; | |
if ( $.type(responsiveSettings) === 'array' && responsiveSettings.length ) { | |
_.respondTo = _.options.respondTo || 'window'; | |
for ( breakpoint in responsiveSettings ) { | |
l = _.breakpoints.length-1; | |
if (responsiveSettings.hasOwnProperty(breakpoint)) { | |
currentBreakpoint = responsiveSettings[breakpoint].breakpoint; | |
// loop through the breakpoints and cut out any existing | |
// ones with the same breakpoint number, we don't want dupes. | |
while( l >= 0 ) { | |
if( _.breakpoints[l] && _.breakpoints[l] === currentBreakpoint ) { | |
_.breakpoints.splice(l,1); | |
} | |
l--; | |
} | |
_.breakpoints.push(currentBreakpoint); | |
_.breakpointSettings[currentBreakpoint] = responsiveSettings[breakpoint].settings; | |
} | |
} | |
_.breakpoints.sort(function(a, b) { | |
return ( _.options.mobileFirst ) ? a-b : b-a; | |
}); | |
} | |
}; | |
Slick.prototype.reinit = function() { | |
var _ = this; | |
_.$slides = | |
_.$slideTrack | |
.children(_.options.slide) | |
.addClass('slick-slide'); | |
_.slideCount = _.$slides.length; | |
if (_.currentSlide >= _.slideCount && _.currentSlide !== 0) { | |
_.currentSlide = _.currentSlide - _.options.slidesToScroll; | |
} | |
if (_.slideCount <= _.options.slidesToShow) { | |
_.currentSlide = 0; | |
} | |
_.registerBreakpoints(); | |
_.setProps(); | |
_.setupInfinite(); | |
_.buildArrows(); | |
_.updateArrows(); | |
_.initArrowEvents(); | |
_.buildDots(); | |
_.updateDots(); | |
_.initDotEvents(); | |
_.cleanUpSlideEvents(); | |
_.initSlideEvents(); | |
_.checkResponsive(false, true); | |
if (_.options.focusOnSelect === true) { | |
$(_.$slideTrack).children().on('click.slick', _.selectHandler); | |
} | |
_.setSlideClasses(typeof _.currentSlide === 'number' ? _.currentSlide : 0); | |
_.setPosition(); | |
_.focusHandler(); | |
_.paused = !_.options.autoplay; | |
_.autoPlay(); | |
_.$slider.trigger('reInit', [_]); | |
}; | |
Slick.prototype.resize = function() { | |
var _ = this; | |
if ($(window).width() !== _.windowWidth) { | |
clearTimeout(_.windowDelay); | |
_.windowDelay = window.setTimeout(function() { | |
_.windowWidth = $(window).width(); | |
_.checkResponsive(); | |
if( !_.unslicked ) { _.setPosition(); } | |
}, 50); | |
} | |
}; | |
Slick.prototype.removeSlide = Slick.prototype.slickRemove = function(index, removeBefore, removeAll) { | |
var _ = this; | |
if (typeof(index) === 'boolean') { | |
removeBefore = index; | |
index = removeBefore === true ? 0 : _.slideCount - 1; | |
} else { | |
index = removeBefore === true ? --index : index; | |
} | |
if (_.slideCount < 1 || index < 0 || index > _.slideCount - 1) { | |
return false; | |
} | |
_.unload(); | |
if (removeAll === true) { | |
_.$slideTrack.children().remove(); | |
} else { | |
_.$slideTrack.children(this.options.slide).eq(index).remove(); | |
} | |
_.$slides = _.$slideTrack.children(this.options.slide); | |
_.$slideTrack.children(this.options.slide).detach(); | |
_.$slideTrack.append(_.$slides); | |
_.$slidesCache = _.$slides; | |
_.reinit(); | |
}; | |
Slick.prototype.setCSS = function(position) { | |
var _ = this, | |
positionProps = {}, | |
x, y; | |
if (_.options.rtl === true) { | |
position = -position; | |
} | |
x = _.positionProp == 'left' ? Math.ceil(position) + 'px' : '0px'; | |
y = _.positionProp == 'top' ? Math.ceil(position) + 'px' : '0px'; | |
positionProps[_.positionProp] = position; | |
if (_.transformsEnabled === false) { | |
_.$slideTrack.css(positionProps); | |
} else { | |
positionProps = {}; | |
if (_.cssTransitions === false) { | |
positionProps[_.animType] = 'translate(' + x + ', ' + y + ')'; | |
_.$slideTrack.css(positionProps); | |
} else { | |
positionProps[_.animType] = 'translate3d(' + x + ', ' + y + ', 0px)'; | |
_.$slideTrack.css(positionProps); | |
} | |
} | |
}; | |
Slick.prototype.setDimensions = function() { | |
var _ = this; | |
if (_.options.vertical === false) { | |
if (_.options.centerMode === true) { | |
_.$list.css({ | |
padding: ('0px ' + _.options.centerPadding) | |
}); | |
} | |
} else { | |
_.$list.height(_.$slides.first().outerHeight(true) * _.options.slidesToShow); | |
if (_.options.centerMode === true) { | |
_.$list.css({ | |
padding: (_.options.centerPadding + ' 0px') | |
}); | |
} | |
} | |
_.listWidth = _.$list.width(); | |
_.listHeight = _.$list.height(); | |
if (_.options.vertical === false && _.options.variableWidth === false) { | |
_.slideWidth = Math.ceil(_.listWidth / _.options.slidesToShow); | |
_.$slideTrack.width(Math.ceil((_.slideWidth * _.$slideTrack.children('.slick-slide').length))); | |
} else if (_.options.variableWidth === true) { | |
_.$slideTrack.width(5000 * _.slideCount); | |
} else { | |
_.slideWidth = Math.ceil(_.listWidth); | |
_.$slideTrack.height(Math.ceil((_.$slides.first().outerHeight(true) * _.$slideTrack.children('.slick-slide').length))); | |
} | |
var offset = _.$slides.first().outerWidth(true) - _.$slides.first().width(); | |
if (_.options.variableWidth === false) _.$slideTrack.children('.slick-slide').width(_.slideWidth - offset); | |
}; | |
Slick.prototype.setFade = function() { | |
var _ = this, | |
targetLeft; | |
_.$slides.each(function(index, element) { | |
targetLeft = (_.slideWidth * index) * -1; | |
if (_.options.rtl === true) { | |
$(element).css({ | |
position: 'relative', | |
right: targetLeft, | |
top: 0, | |
zIndex: _.options.zIndex - 2, | |
opacity: 0 | |
}); | |
} else { | |
$(element).css({ | |
position: 'relative', | |
left: targetLeft, | |
top: 0, | |
zIndex: _.options.zIndex - 2, | |
opacity: 0 | |
}); | |
} | |
}); | |
_.$slides.eq(_.currentSlide).css({ | |
zIndex: _.options.zIndex - 1, | |
opacity: 1 | |
}); | |
}; | |
Slick.prototype.setHeight = function() { | |
var _ = this; | |
if (_.options.slidesToShow === 1 && _.options.adaptiveHeight === true && _.options.vertical === false) { | |
var targetHeight = _.$slides.eq(_.currentSlide).outerHeight(true); | |
_.$list.css('height', targetHeight); | |
} | |
}; | |
Slick.prototype.setOption = | |
Slick.prototype.slickSetOption = function() { | |
/** | |
* accepts arguments in format of: | |
* | |
* - for changing a single option's value: | |
* .slick("setOption", option, value, refresh ) | |
* | |
* - for changing a set of responsive options: | |
* .slick("setOption", 'responsive', [{}, ...], refresh ) | |
* | |
* - for updating multiple values at once (not responsive) | |
* .slick("setOption", { 'option': value, ... }, refresh ) | |
*/ | |
var _ = this, l, item, option, value, refresh = false, type; | |
if( $.type( arguments[0] ) === 'object' ) { | |
option = arguments[0]; | |
refresh = arguments[1]; | |
type = 'multiple'; | |
} else if ( $.type( arguments[0] ) === 'string' ) { | |
option = arguments[0]; | |
value = arguments[1]; | |
refresh = arguments[2]; | |
if ( arguments[0] === 'responsive' && $.type( arguments[1] ) === 'array' ) { | |
type = 'responsive'; | |
} else if ( typeof arguments[1] !== 'undefined' ) { | |
type = 'single'; | |
} | |
} | |
if ( type === 'single' ) { | |
_.options[option] = value; | |
} else if ( type === 'multiple' ) { | |
$.each( option , function( opt, val ) { | |
_.options[opt] = val; | |
}); | |
} else if ( type === 'responsive' ) { | |
for ( item in value ) { | |
if( $.type( _.options.responsive ) !== 'array' ) { | |
_.options.responsive = [ value[item] ]; | |
} else { | |
l = _.options.responsive.length-1; | |
// loop through the responsive object and splice out duplicates. | |
while( l >= 0 ) { | |
if( _.options.responsive[l].breakpoint === value[item].breakpoint ) { | |
_.options.responsive.splice(l,1); | |
} | |
l--; | |
} | |
_.options.responsive.push( value[item] ); | |
} | |
} | |
} | |
if ( refresh ) { | |
_.unload(); | |
_.reinit(); | |
} | |
}; | |
Slick.prototype.setPosition = function() { | |
var _ = this; | |
_.setDimensions(); | |
_.setHeight(); | |
if (_.options.fade === false) { | |
_.setCSS(_.getLeft(_.currentSlide)); | |
} else { | |
_.setFade(); | |
} | |
_.$slider.trigger('setPosition', [_]); | |
}; | |
Slick.prototype.setProps = function() { | |
var _ = this, | |
bodyStyle = document.body.style; | |
_.positionProp = _.options.vertical === true ? 'top' : 'left'; | |
if (_.positionProp === 'top') { | |
_.$slider.addClass('slick-vertical'); | |
} else { | |
_.$slider.removeClass('slick-vertical'); | |
} | |
if (bodyStyle.WebkitTransition !== undefined || | |
bodyStyle.MozTransition !== undefined || | |
bodyStyle.msTransition !== undefined) { | |
if (_.options.useCSS === true) { | |
_.cssTransitions = true; | |
} | |
} | |
if ( _.options.fade ) { | |
if ( typeof _.options.zIndex === 'number' ) { | |
if( _.options.zIndex < 3 ) { | |
_.options.zIndex = 3; | |
} | |
} else { | |
_.options.zIndex = _.defaults.zIndex; | |
} | |
} | |
if (bodyStyle.OTransform !== undefined) { | |
_.animType = 'OTransform'; | |
_.transformType = '-o-transform'; | |
_.transitionType = 'OTransition'; | |
if (bodyStyle.perspectiveProperty === undefined && bodyStyle.webkitPerspective === undefined) _.animType = false; | |
} | |
if (bodyStyle.MozTransform !== undefined) { | |
_.animType = 'MozTransform'; | |
_.transformType = '-moz-transform'; | |
_.transitionType = 'MozTransition'; | |
if (bodyStyle.perspectiveProperty === undefined && bodyStyle.MozPerspective === undefined) _.animType = false; | |
} | |
if (bodyStyle.webkitTransform !== undefined) { | |
_.animType = 'webkitTransform'; | |
_.transformType = '-webkit-transform'; | |
_.transitionType = 'webkitTransition'; | |
if (bodyStyle.perspectiveProperty === undefined && bodyStyle.webkitPerspective === undefined) _.animType = false; | |
} | |
if (bodyStyle.msTransform !== undefined) { | |
_.animType = 'msTransform'; | |
_.transformType = '-ms-transform'; | |
_.transitionType = 'msTransition'; | |
if (bodyStyle.msTransform === undefined) _.animType = false; | |
} | |
if (bodyStyle.transform !== undefined && _.animType !== false) { | |
_.animType = 'transform'; | |
_.transformType = 'transform'; | |
_.transitionType = 'transition'; | |
} | |
_.transformsEnabled = _.options.useTransform && (_.animType !== null && _.animType !== false); | |
}; | |
Slick.prototype.setSlideClasses = function(index) { | |
var _ = this, | |
centerOffset, allSlides, indexOffset, remainder; | |
allSlides = _.$slider | |
.find('.slick-slide') | |
.removeClass('slick-active slick-center slick-current') | |
.attr('aria-hidden', 'true'); | |
_.$slides | |
.eq(index) | |
.addClass('slick-current'); | |
if (_.options.centerMode === true) { | |
var evenCoef = _.options.slidesToShow % 2 === 0 ? 1 : 0; | |
centerOffset = Math.floor(_.options.slidesToShow / 2); | |
if (_.options.infinite === true) { | |
if (index >= centerOffset && index <= (_.slideCount - 1) - centerOffset) { | |
_.$slides | |
.slice(index - centerOffset + evenCoef, index + centerOffset + 1) | |
.addClass('slick-active') | |
.attr('aria-hidden', 'false'); | |
} else { | |
indexOffset = _.options.slidesToShow + index; | |
allSlides | |
.slice(indexOffset - centerOffset + 1 + evenCoef, indexOffset + centerOffset + 2) | |
.addClass('slick-active') | |
.attr('aria-hidden', 'false'); | |
} | |
if (index === 0) { | |
allSlides | |
.eq(allSlides.length - 1 - _.options.slidesToShow) | |
.addClass('slick-center'); | |
} else if (index === _.slideCount - 1) { | |
allSlides | |
.eq(_.options.slidesToShow) | |
.addClass('slick-center'); | |
} | |
} | |
_.$slides | |
.eq(index) | |
.addClass('slick-center'); | |
} else { | |
if (index >= 0 && index <= (_.slideCount - _.options.slidesToShow)) { | |
_.$slides | |
.slice(index, index + _.options.slidesToShow) | |
.addClass('slick-active') | |
.attr('aria-hidden', 'false'); | |
} else if (allSlides.length <= _.options.slidesToShow) { | |
allSlides | |
.addClass('slick-active') | |
.attr('aria-hidden', 'false'); | |
} else { | |
remainder = _.slideCount % _.options.slidesToShow; | |
indexOffset = _.options.infinite === true ? _.options.slidesToShow + index : index; | |
if (_.options.slidesToShow == _.options.slidesToScroll && (_.slideCount - index) < _.options.slidesToShow) { | |
allSlides | |
.slice(indexOffset - (_.options.slidesToShow - remainder), indexOffset + remainder) | |
.addClass('slick-active') | |
.attr('aria-hidden', 'false'); | |
} else { | |
allSlides | |
.slice(indexOffset, indexOffset + _.options.slidesToShow) | |
.addClass('slick-active') | |
.attr('aria-hidden', 'false'); | |
} | |
} | |
} | |
if (_.options.lazyLoad === 'ondemand' || _.options.lazyLoad === 'anticipated') { | |
_.lazyLoad(); | |
} | |
}; | |
Slick.prototype.setupInfinite = function() { | |
var _ = this, | |
i, slideIndex, infiniteCount; | |
if (_.options.fade === true) { | |
_.options.centerMode = false; | |
} | |
if (_.options.infinite === true && _.options.fade === false) { | |
slideIndex = null; | |
if (_.slideCount > _.options.slidesToShow) { | |
if (_.options.centerMode === true) { | |
infiniteCount = _.options.slidesToShow + 1; | |
} else { | |
infiniteCount = _.options.slidesToShow; | |
} | |
for (i = _.slideCount; i > (_.slideCount - | |
infiniteCount); i -= 1) { | |
slideIndex = i - 1; | |
$(_.$slides[slideIndex]).clone(true).attr('id', '') | |
.attr('data-slick-index', slideIndex - _.slideCount) | |
.prependTo(_.$slideTrack).addClass('slick-cloned'); | |
} | |
for (i = 0; i < infiniteCount + _.slideCount; i += 1) { | |
slideIndex = i; | |
$(_.$slides[slideIndex]).clone(true).attr('id', '') | |
.attr('data-slick-index', slideIndex + _.slideCount) | |
.appendTo(_.$slideTrack).addClass('slick-cloned'); | |
} | |
_.$slideTrack.find('.slick-cloned').find('[id]').each(function() { | |
$(this).attr('id', ''); | |
}); | |
} | |
} | |
}; | |
Slick.prototype.interrupt = function( toggle ) { | |
var _ = this; | |
if( !toggle ) { | |
_.autoPlay(); | |
} | |
_.interrupted = toggle; | |
}; | |
Slick.prototype.selectHandler = function(event) { | |
var _ = this; | |
var targetElement = | |
$(event.target).is('.slick-slide') ? | |
$(event.target) : | |
$(event.target).parents('.slick-slide'); | |
var index = parseInt(targetElement.attr('data-slick-index')); | |
if (!index) index = 0; | |
if (_.slideCount <= _.options.slidesToShow) { | |
_.slideHandler(index, false, true); | |
return; | |
} | |
_.slideHandler(index); | |
}; | |
Slick.prototype.slideHandler = function(index, sync, dontAnimate) { | |
var targetSlide, animSlide, oldSlide, slideLeft, targetLeft = null, | |
_ = this, navTarget; | |
sync = sync || false; | |
if (_.animating === true && _.options.waitForAnimate === true) { | |
return; | |
} | |
if (_.options.fade === true && _.currentSlide === index) { | |
return; | |
} | |
if (sync === false) { | |
_.asNavFor(index); | |
} | |
targetSlide = index; | |
targetLeft = _.getLeft(targetSlide); | |
slideLeft = _.getLeft(_.currentSlide); | |
_.currentLeft = _.swipeLeft === null ? slideLeft : _.swipeLeft; | |
if (_.options.infinite === false && _.options.centerMode === false && (index < 0 || index > _.getDotCount() * _.options.slidesToScroll)) { | |
if (_.options.fade === false) { | |
targetSlide = _.currentSlide; | |
if (dontAnimate !== true && _.slideCount > _.options.slidesToShow) { | |
_.animateSlide(slideLeft, function() { | |
_.postSlide(targetSlide); | |
}); | |
} else { | |
_.postSlide(targetSlide); | |
} | |
} | |
return; | |
} else if (_.options.infinite === false && _.options.centerMode === true && (index < 0 || index > (_.slideCount - _.options.slidesToScroll))) { | |
if (_.options.fade === false) { | |
targetSlide = _.currentSlide; | |
if (dontAnimate !== true && _.slideCount > _.options.slidesToShow) { | |
_.animateSlide(slideLeft, function() { | |
_.postSlide(targetSlide); | |
}); | |
} else { | |
_.postSlide(targetSlide); | |
} | |
} | |
return; | |
} | |
if ( _.options.autoplay ) { | |
clearInterval(_.autoPlayTimer); | |
} | |
if (targetSlide < 0) { | |
if (_.slideCount % _.options.slidesToScroll !== 0) { | |
animSlide = _.slideCount - (_.slideCount % _.options.slidesToScroll); | |
} else { | |
animSlide = _.slideCount + targetSlide; | |
} | |
} else if (targetSlide >= _.slideCount) { | |
if (_.slideCount % _.options.slidesToScroll !== 0) { | |
animSlide = 0; | |
} else { | |
animSlide = targetSlide - _.slideCount; | |
} | |
} else { | |
animSlide = targetSlide; | |
} | |
_.animating = true; | |
_.$slider.trigger('beforeChange', [_, _.currentSlide, animSlide]); | |
oldSlide = _.currentSlide; | |
_.currentSlide = animSlide; | |
_.setSlideClasses(_.currentSlide); | |
if ( _.options.asNavFor ) { | |
navTarget = _.getNavTarget(); | |
navTarget = navTarget.slick('getSlick'); | |
if ( navTarget.slideCount <= navTarget.options.slidesToShow ) { | |
navTarget.setSlideClasses(_.currentSlide); | |
} | |
} | |
_.updateDots(); | |
_.updateArrows(); | |
if (_.options.fade === true) { | |
if (dontAnimate !== true) { | |
_.fadeSlideOut(oldSlide); | |
_.fadeSlide(animSlide, function() { | |
_.postSlide(animSlide); | |
}); | |
} else { | |
_.postSlide(animSlide); | |
} | |
_.animateHeight(); | |
return; | |
} | |
if (dontAnimate !== true && _.slideCount > _.options.slidesToShow) { | |
_.animateSlide(targetLeft, function() { | |
_.postSlide(animSlide); | |
}); | |
} else { | |
_.postSlide(animSlide); | |
} | |
}; | |
Slick.prototype.startLoad = function() { | |
var _ = this; | |
if (_.options.arrows === true && _.slideCount > _.options.slidesToShow) { | |
_.$prevArrow.hide(); | |
_.$nextArrow.hide(); | |
} | |
if (_.options.dots === true && _.slideCount > _.options.slidesToShow) { | |
_.$dots.hide(); | |
} | |
_.$slider.addClass('slick-loading'); | |
}; | |
Slick.prototype.swipeDirection = function() { | |
var xDist, yDist, r, swipeAngle, _ = this; | |
xDist = _.touchObject.startX - _.touchObject.curX; | |
yDist = _.touchObject.startY - _.touchObject.curY; | |
r = Math.atan2(yDist, xDist); | |
swipeAngle = Math.round(r * 180 / Math.PI); | |
if (swipeAngle < 0) { | |
swipeAngle = 360 - Math.abs(swipeAngle); | |
} | |
if ((swipeAngle <= 45) && (swipeAngle >= 0)) { | |
return (_.options.rtl === false ? 'left' : 'right'); | |
} | |
if ((swipeAngle <= 360) && (swipeAngle >= 315)) { | |
return (_.options.rtl === false ? 'left' : 'right'); | |
} | |
if ((swipeAngle >= 135) && (swipeAngle <= 225)) { | |
return (_.options.rtl === false ? 'right' : 'left'); | |
} | |
if (_.options.verticalSwiping === true) { | |
if ((swipeAngle >= 35) && (swipeAngle <= 135)) { | |
return 'down'; | |
} else { | |
return 'up'; | |
} | |
} | |
return 'vertical'; | |
}; | |
Slick.prototype.swipeEnd = function(event) { | |
var _ = this, | |
slideCount, | |
direction; | |
_.dragging = false; | |
_.swiping = false; | |
if (_.scrolling) { | |
_.scrolling = false; | |
return false; | |
} | |
_.interrupted = false; | |
_.shouldClick = ( _.touchObject.swipeLength > 10 ) ? false : true; | |
if ( _.touchObject.curX === undefined ) { | |
return false; | |
} | |
if ( _.touchObject.edgeHit === true ) { | |
_.$slider.trigger('edge', [_, _.swipeDirection() ]); | |
} | |
if ( _.touchObject.swipeLength >= _.touchObject.minSwipe ) { | |
direction = _.swipeDirection(); | |
switch ( direction ) { | |
case 'left': | |
case 'down': | |
slideCount = | |
_.options.swipeToSlide ? | |
_.checkNavigable( _.currentSlide + _.getSlideCount() ) : | |
_.currentSlide + _.getSlideCount(); | |
_.currentDirection = 0; | |
break; | |
case 'right': | |
case 'up': | |
slideCount = | |
_.options.swipeToSlide ? | |
_.checkNavigable( _.currentSlide - _.getSlideCount() ) : | |
_.currentSlide - _.getSlideCount(); | |
_.currentDirection = 1; | |
break; | |
default: | |
} | |
if( direction != 'vertical' ) { | |
_.slideHandler( slideCount ); | |
_.touchObject = {}; | |
_.$slider.trigger('swipe', [_, direction ]); | |
} | |
} else { | |
if ( _.touchObject.startX !== _.touchObject.curX ) { | |
_.slideHandler( _.currentSlide ); | |
_.touchObject = {}; | |
} | |
} | |
}; | |
Slick.prototype.swipeHandler = function(event) { | |
var _ = this; | |
if ((_.options.swipe === false) || ('ontouchend' in document && _.options.swipe === false)) { | |
return; | |
} else if (_.options.draggable === false && event.type.indexOf('mouse') !== -1) { | |
return; | |
} | |
_.touchObject.fingerCount = event.originalEvent && event.originalEvent.touches !== undefined ? | |
event.originalEvent.touches.length : 1; | |
_.touchObject.minSwipe = _.listWidth / _.options | |
.touchThreshold; | |
if (_.options.verticalSwiping === true) { | |
_.touchObject.minSwipe = _.listHeight / _.options | |
.touchThreshold; | |
} | |
switch (event.data.action) { | |
case 'start': | |
_.swipeStart(event); | |
break; | |
case 'move': | |
_.swipeMove(event); | |
break; | |
case 'end': | |
_.swipeEnd(event); | |
break; | |
} | |
}; | |
Slick.prototype.swipeMove = function(event) { | |
var _ = this, | |
edgeWasHit = false, | |
curLeft, swipeDirection, swipeLength, positionOffset, touches, verticalSwipeLength; | |
touches = event.originalEvent !== undefined ? event.originalEvent.touches : null; | |
if (!_.dragging || _.scrolling || touches && touches.length !== 1) { | |
return false; | |
} | |
curLeft = _.getLeft(_.currentSlide); | |
_.touchObject.curX = touches !== undefined ? touches[0].pageX : event.clientX; | |
_.touchObject.curY = touches !== undefined ? touches[0].pageY : event.clientY; | |
_.touchObject.swipeLength = Math.round(Math.sqrt( | |
Math.pow(_.touchObject.curX - _.touchObject.startX, 2))); | |
verticalSwipeLength = Math.round(Math.sqrt( | |
Math.pow(_.touchObject.curY - _.touchObject.startY, 2))); | |
if (!_.options.verticalSwiping && !_.swiping && verticalSwipeLength > 4) { | |
_.scrolling = true; | |
return false; | |
} | |
if (_.options.verticalSwiping === true) { | |
_.touchObject.swipeLength = verticalSwipeLength; | |
} | |
swipeDirection = _.swipeDirection(); | |
if (event.originalEvent !== undefined && _.touchObject.swipeLength > 4) { | |
_.swiping = true; | |
event.preventDefault(); | |
} | |
positionOffset = (_.options.rtl === false ? 1 : -1) * (_.touchObject.curX > _.touchObject.startX ? 1 : -1); | |
if (_.options.verticalSwiping === true) { | |
positionOffset = _.touchObject.curY > _.touchObject.startY ? 1 : -1; | |
} | |
swipeLength = _.touchObject.swipeLength; | |
_.touchObject.edgeHit = false; | |
if (_.options.infinite === false) { | |
if ((_.currentSlide === 0 && swipeDirection === 'right') || (_.currentSlide >= _.getDotCount() && swipeDirection === 'left')) { | |
swipeLength = _.touchObject.swipeLength * _.options.edgeFriction; | |
_.touchObject.edgeHit = true; | |
} | |
} | |
if (_.options.vertical === false) { | |
_.swipeLeft = curLeft + swipeLength * positionOffset; | |
} else { | |
_.swipeLeft = curLeft + (swipeLength * (_.$list.height() / _.listWidth)) * positionOffset; | |
} | |
if (_.options.verticalSwiping === true) { | |
_.swipeLeft = curLeft + swipeLength * positionOffset; | |
} | |
if (_.options.fade === true || _.options.touchMove === false) { | |
return false; | |
} | |
if (_.animating === true) { | |
_.swipeLeft = null; | |
return false; | |
} | |
_.setCSS(_.swipeLeft); | |
}; | |
Slick.prototype.swipeStart = function(event) { | |
var _ = this, | |
touches; | |
_.interrupted = true; | |
if (_.touchObject.fingerCount !== 1 || _.slideCount <= _.options.slidesToShow) { | |
_.touchObject = {}; | |
return false; | |
} | |
if (event.originalEvent !== undefined && event.originalEvent.touches !== undefined) { | |
touches = event.originalEvent.touches[0]; | |
} | |
_.touchObject.startX = _.touchObject.curX = touches !== undefined ? touches.pageX : event.clientX; | |
_.touchObject.startY = _.touchObject.curY = touches !== undefined ? touches.pageY : event.clientY; | |
_.dragging = true; | |
}; | |
Slick.prototype.unfilterSlides = Slick.prototype.slickUnfilter = function() { | |
var _ = this; | |
if (_.$slidesCache !== null) { | |
_.unload(); | |
_.$slideTrack.children(this.options.slide).detach(); | |
_.$slidesCache.appendTo(_.$slideTrack); | |
_.reinit(); | |
} | |
}; | |
Slick.prototype.unload = function() { | |
var _ = this; | |
$('.slick-cloned', _.$slider).remove(); | |
if (_.$dots) { | |
_.$dots.remove(); | |
} | |
if (_.$prevArrow && _.htmlExpr.test(_.options.prevArrow)) { | |
_.$prevArrow.remove(); | |
} | |
if (_.$nextArrow && _.htmlExpr.test(_.options.nextArrow)) { | |
_.$nextArrow.remove(); | |
} | |
_.$slides | |
.removeClass('slick-slide slick-active slick-visible slick-current') | |
.attr('aria-hidden', 'true') | |
.css('width', ''); | |
}; | |
Slick.prototype.unslick = function(fromBreakpoint) { | |
var _ = this; | |
_.$slider.trigger('unslick', [_, fromBreakpoint]); | |
_.destroy(); | |
}; | |
Slick.prototype.updateArrows = function() { | |
var _ = this, | |
centerOffset; | |
centerOffset = Math.floor(_.options.slidesToShow / 2); | |
if ( _.options.arrows === true && | |
_.slideCount > _.options.slidesToShow && | |
!_.options.infinite ) { | |
_.$prevArrow.removeClass('slick-disabled').attr('aria-disabled', 'false'); | |
_.$nextArrow.removeClass('slick-disabled').attr('aria-disabled', 'false'); | |
if (_.currentSlide === 0) { | |
_.$prevArrow.addClass('slick-disabled').attr('aria-disabled', 'true'); | |
_.$nextArrow.removeClass('slick-disabled').attr('aria-disabled', 'false'); | |
} else if (_.currentSlide >= _.slideCount - _.options.slidesToShow && _.options.centerMode === false) { | |
_.$nextArrow.addClass('slick-disabled').attr('aria-disabled', 'true'); | |
_.$prevArrow.removeClass('slick-disabled').attr('aria-disabled', 'false'); | |
} else if (_.currentSlide >= _.slideCount - 1 && _.options.centerMode === true) { | |
_.$nextArrow.addClass('slick-disabled').attr('aria-disabled', 'true'); | |
_.$prevArrow.removeClass('slick-disabled').attr('aria-disabled', 'false'); | |
} | |
} | |
}; | |
Slick.prototype.updateDots = function() { | |
var _ = this; | |
if (_.$dots !== null) { | |
_.$dots | |
.find('li') | |
.removeClass('slick-active') | |
.end(); | |
_.$dots | |
.find('li') | |
.eq(Math.floor(_.currentSlide / _.options.slidesToScroll)) | |
.addClass('slick-active'); | |
} | |
}; | |
Slick.prototype.visibility = function() { | |
var _ = this; | |
if ( _.options.autoplay ) { | |
if ( document[_.hidden] ) { | |
_.interrupted = true; | |
} else { | |
_.interrupted = false; | |
} | |
} | |
}; | |
$.fn.slick = function() { | |
var _ = this, | |
opt = arguments[0], | |
args = Array.prototype.slice.call(arguments, 1), | |
l = _.length, | |
i, | |
ret; | |
for (i = 0; i < l; i++) { | |
if (typeof opt == 'object' || typeof opt == 'undefined') | |
_[i].slick = new Slick(_[i], opt); | |
else | |
ret = _[i].slick[opt].apply(_[i].slick, args); | |
if (typeof ret != 'undefined') return ret; | |
} | |
return _; | |
}; | |
})); | |
/*! | |
* sweetalert2 v8.11.8 | |
* Released under the MIT License. | |
*/ | |
(function (global, factory) { | |
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() : | |
typeof define === 'function' && define.amd ? define(factory) : | |
(global.Sweetalert2 = factory()); | |
}(this, (function () { 'use strict'; | |
function _typeof(obj) { | |
if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { | |
_typeof = function (obj) { | |
return typeof obj; | |
}; | |
} else { | |
_typeof = function (obj) { | |
return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; | |
}; | |
} | |
return _typeof(obj); | |
} | |
function _classCallCheck(instance, Constructor) { | |
if (!(instance instanceof Constructor)) { | |
throw new TypeError("Cannot call a class as a function"); | |
} | |
} | |
function _defineProperties(target, props) { | |
for (var i = 0; i < props.length; i++) { | |
var descriptor = props[i]; | |
descriptor.enumerable = descriptor.enumerable || false; | |
descriptor.configurable = true; | |
if ("value" in descriptor) descriptor.writable = true; | |
Object.defineProperty(target, descriptor.key, descriptor); | |
} | |
} | |
function _createClass(Constructor, protoProps, staticProps) { | |
if (protoProps) _defineProperties(Constructor.prototype, protoProps); | |
if (staticProps) _defineProperties(Constructor, staticProps); | |
return Constructor; | |
} | |
function _extends() { | |
_extends = Object.assign || function (target) { | |
for (var i = 1; i < arguments.length; i++) { | |
var source = arguments[i]; | |
for (var key in source) { | |
if (Object.prototype.hasOwnProperty.call(source, key)) { | |
target[key] = source[key]; | |
} | |
} | |
} | |
return target; | |
}; | |
return _extends.apply(this, arguments); | |
} | |
function _inherits(subClass, superClass) { | |
if (typeof superClass !== "function" && superClass !== null) { | |
throw new TypeError("Super expression must either be null or a function"); | |
} | |
subClass.prototype = Object.create(superClass && superClass.prototype, { | |
constructor: { | |
value: subClass, | |
writable: true, | |
configurable: true | |
} | |
}); | |
if (superClass) _setPrototypeOf(subClass, superClass); | |
} | |
function _getPrototypeOf(o) { | |
_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { | |
return o.__proto__ || Object.getPrototypeOf(o); | |
}; | |
return _getPrototypeOf(o); | |
} | |
function _setPrototypeOf(o, p) { | |
_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { | |
o.__proto__ = p; | |
return o; | |
}; | |
return _setPrototypeOf(o, p); | |
} | |
function isNativeReflectConstruct() { | |
if (typeof Reflect === "undefined" || !Reflect.construct) return false; | |
if (Reflect.construct.sham) return false; | |
if (typeof Proxy === "function") return true; | |
try { | |
Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); | |
return true; | |
} catch (e) { | |
return false; | |
} | |
} | |
function _construct(Parent, args, Class) { | |
if (isNativeReflectConstruct()) { | |
_construct = Reflect.construct; | |
} else { | |
_construct = function _construct(Parent, args, Class) { | |
var a = [null]; | |
a.push.apply(a, args); | |
var Constructor = Function.bind.apply(Parent, a); | |
var instance = new Constructor(); | |
if (Class) _setPrototypeOf(instance, Class.prototype); | |
return instance; | |
}; | |
} | |
return _construct.apply(null, arguments); | |
} | |
function _assertThisInitialized(self) { | |
if (self === void 0) { | |
throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); | |
} | |
return self; | |
} | |
function _possibleConstructorReturn(self, call) { | |
if (call && (typeof call === "object" || typeof call === "function")) { | |
return call; | |
} | |
return _assertThisInitialized(self); | |
} | |
function _superPropBase(object, property) { | |
while (!Object.prototype.hasOwnProperty.call(object, property)) { | |
object = _getPrototypeOf(object); | |
if (object === null) break; | |
} | |
return object; | |
} | |
function _get(target, property, receiver) { | |
if (typeof Reflect !== "undefined" && Reflect.get) { | |
_get = Reflect.get; | |
} else { | |
_get = function _get(target, property, receiver) { | |
var base = _superPropBase(target, property); | |
if (!base) return; | |
var desc = Object.getOwnPropertyDescriptor(base, property); | |
if (desc.get) { | |
return desc.get.call(receiver); | |
} | |
return desc.value; | |
}; | |
} | |
return _get(target, property, receiver || target); | |
} | |
var consolePrefix = 'SweetAlert2:'; | |
/** | |
* Filter the unique values into a new array | |
* @param arr | |
*/ | |
var uniqueArray = function uniqueArray(arr) { | |
var result = []; | |
for (var i = 0; i < arr.length; i++) { | |
if (result.indexOf(arr[i]) === -1) { | |
result.push(arr[i]); | |
} | |
} | |
return result; | |
}; | |
/** | |
* Returns the array ob object values (Object.values isn't supported in IE11) | |
* @param obj | |
*/ | |
var objectValues = function objectValues(obj) { | |
return Object.keys(obj).map(function (key) { | |
return obj[key]; | |
}); | |
}; | |
/** | |
* Convert NodeList to Array | |
* @param nodeList | |
*/ | |
var toArray = function toArray(nodeList) { | |
return Array.prototype.slice.call(nodeList); | |
}; | |
/** | |
* Standardise console warnings | |
* @param message | |
*/ | |
var warn = function warn(message) { | |
console.warn("".concat(consolePrefix, " ").concat(message)); | |
}; | |
/** | |
* Standardise console errors | |
* @param message | |
*/ | |
var error = function error(message) { | |
console.error("".concat(consolePrefix, " ").concat(message)); | |
}; | |
/** | |
* Private global state for `warnOnce` | |
* @type {Array} | |
* @private | |
*/ | |
var previousWarnOnceMessages = []; | |
/** | |
* Show a console warning, but only if it hasn't already been shown | |
* @param message | |
*/ | |
var warnOnce = function warnOnce(message) { | |
if (!(previousWarnOnceMessages.indexOf(message) !== -1)) { | |
previousWarnOnceMessages.push(message); | |
warn(message); | |
} | |
}; | |
/** | |
* Show a one-time console warning about deprecated params/methods | |
*/ | |
var warnAboutDepreation = function warnAboutDepreation(deprecatedParam, useInstead) { | |
warnOnce("\"".concat(deprecatedParam, "\" is deprecated and will be removed in the next major release. Please use \"").concat(useInstead, "\" instead.")); | |
}; | |
/** | |
* If `arg` is a function, call it (with no arguments or context) and return the result. | |
* Otherwise, just pass the value through | |
* @param arg | |
*/ | |
var callIfFunction = function callIfFunction(arg) { | |
return typeof arg === 'function' ? arg() : arg; | |
}; | |
var isPromise = function isPromise(arg) { | |
return arg && Promise.resolve(arg) === arg; | |
}; | |
var DismissReason = Object.freeze({ | |
cancel: 'cancel', | |
backdrop: 'backdrop', | |
close: 'close', | |
esc: 'esc', | |
timer: 'timer' | |
}); | |
var argsToParams = function argsToParams(args) { | |
var params = {}; | |
switch (_typeof(args[0])) { | |
case 'object': | |
_extends(params, args[0]); | |
break; | |
default: | |
['title', 'html', 'type'].forEach(function (name, index) { | |
switch (_typeof(args[index])) { | |
case 'string': | |
params[name] = args[index]; | |
break; | |
case 'undefined': | |
break; | |
default: | |
error("Unexpected type of ".concat(name, "! Expected \"string\", got ").concat(_typeof(args[index]))); | |
} | |
}); | |
} | |
return params; | |
}; | |
var swalPrefix = 'swal2-'; | |
var prefix = function prefix(items) { | |
var result = {}; | |
for (var i in items) { | |
result[items[i]] = swalPrefix + items[i]; | |
} | |
return result; | |
}; | |
var swalClasses = prefix(['container', 'shown', 'height-auto', 'iosfix', 'popup', 'modal', 'no-backdrop', 'toast', 'toast-shown', 'toast-column', 'fade', 'show', 'hide', 'noanimation', 'close', 'title', 'header', 'content', 'actions', 'confirm', 'cancel', 'footer', 'icon', 'image', 'input', 'file', 'range', 'select', 'radio', 'checkbox', 'label', 'textarea', 'inputerror', 'validation-message', 'progress-steps', 'active-progress-step', 'progress-step', 'progress-step-line', 'loading', 'styled', 'top', 'top-start', 'top-end', 'top-left', 'top-right', 'center', 'center-start', 'center-end', 'center-left', 'center-right', 'bottom', 'bottom-start', 'bottom-end', 'bottom-left', 'bottom-right', 'grow-row', 'grow-column', 'grow-fullscreen', 'rtl']); | |
var iconTypes = prefix(['success', 'warning', 'info', 'question', 'error']); | |
var states = { | |
previousBodyPadding: null | |
}; | |
var hasClass = function hasClass(elem, className) { | |
return elem.classList.contains(className); | |
}; | |
var applyCustomClass = function applyCustomClass(elem, customClass, className) { | |
// Clean up previous custom classes | |
toArray(elem.classList).forEach(function (className) { | |
if (!(objectValues(swalClasses).indexOf(className) !== -1) && !(objectValues(iconTypes).indexOf(className) !== -1)) { | |
elem.classList.remove(className); | |
} | |
}); | |
if (customClass && customClass[className]) { | |
addClass(elem, customClass[className]); | |
} | |
}; | |
function getInput(content, inputType) { | |
if (!inputType) { | |
return null; | |
} | |
switch (inputType) { | |
case 'select': | |
case 'textarea': | |
case 'file': | |
return getChildByClass(content, swalClasses[inputType]); | |
case 'checkbox': | |
return content.querySelector(".".concat(swalClasses.checkbox, " input")); | |
case 'radio': | |
return content.querySelector(".".concat(swalClasses.radio, " input:checked")) || content.querySelector(".".concat(swalClasses.radio, " input:first-child")); | |
case 'range': | |
return content.querySelector(".".concat(swalClasses.range, " input")); | |
default: | |
return getChildByClass(content, swalClasses.input); | |
} | |
} | |
var focusInput = function focusInput(input) { | |
input.focus(); // place cursor at end of text in text input | |
if (input.type !== 'file') { | |
// http://stackoverflow.com/a/2345915 | |
var val = input.value; | |
input.value = ''; | |
input.value = val; | |
} | |
}; | |
var toggleClass = function toggleClass(target, classList, condition) { | |
if (!target || !classList) { | |
return; | |
} | |
if (typeof classList === 'string') { | |
classList = classList.split(/\s+/).filter(Boolean); | |
} | |
classList.forEach(function (className) { | |
if (target.forEach) { | |
target.forEach(function (elem) { | |
condition ? elem.classList.add(className) : elem.classList.remove(className); | |
}); | |
} else { | |
condition ? target.classList.add(className) : target.classList.remove(className); | |
} | |
}); | |
}; | |
var addClass = function addClass(target, classList) { | |
toggleClass(target, classList, true); | |
}; | |
var removeClass = function removeClass(target, classList) { | |
toggleClass(target, classList, false); | |
}; | |
var getChildByClass = function getChildByClass(elem, className) { | |
for (var i = 0; i < elem.childNodes.length; i++) { | |
if (hasClass(elem.childNodes[i], className)) { | |
return elem.childNodes[i]; | |
} | |
} | |
}; | |
var applyNumericalStyle = function applyNumericalStyle(elem, property, value) { | |
if (value || parseInt(value) === 0) { | |
elem.style[property] = typeof value === 'number' ? value + 'px' : value; | |
} else { | |
elem.style.removeProperty(property); | |
} | |
}; | |
var show = function show(elem) { | |
var display = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'flex'; | |
elem.style.opacity = ''; | |
elem.style.display = display; | |
}; | |
var hide = function hide(elem) { | |
elem.style.opacity = ''; | |
elem.style.display = 'none'; | |
}; | |
var toggle = function toggle(elem, condition, display) { | |
condition ? show(elem, display) : hide(elem); | |
}; // borrowed from jquery $(elem).is(':visible') implementation | |
var isVisible = function isVisible(elem) { | |
return !!(elem && (elem.offsetWidth || elem.offsetHeight || elem.getClientRects().length)); | |
}; | |
var isScrollable = function isScrollable(elem) { | |
return !!(elem.scrollHeight > elem.clientHeight); | |
}; // borrowed from https://stackoverflow.com/a/46352119 | |
var hasCssAnimation = function hasCssAnimation(elem) { | |
var style = window.getComputedStyle(elem); | |
var animDuration = parseFloat(style.getPropertyValue('animation-duration') || '0'); | |
var transDuration = parseFloat(style.getPropertyValue('transition-duration') || '0'); | |
return animDuration > 0 || transDuration > 0; | |
}; | |
var contains = function contains(haystack, needle) { | |
if (typeof haystack.contains === 'function') { | |
return haystack.contains(needle); | |
} | |
}; | |
var getContainer = function getContainer() { | |
return document.body.querySelector('.' + swalClasses.container); | |
}; | |
var elementBySelector = function elementBySelector(selectorString) { | |
var container = getContainer(); | |
return container ? container.querySelector(selectorString) : null; | |
}; | |
var elementByClass = function elementByClass(className) { | |
return elementBySelector('.' + className); | |
}; | |
var getPopup = function getPopup() { | |
return elementByClass(swalClasses.popup); | |
}; | |
var getIcons = function getIcons() { | |
var popup = getPopup(); | |
return toArray(popup.querySelectorAll('.' + swalClasses.icon)); | |
}; | |
var getIcon = function getIcon() { | |
var visibleIcon = getIcons().filter(function (icon) { | |
return isVisible(icon); | |
}); | |
return visibleIcon.length ? visibleIcon[0] : null; | |
}; | |
var getTitle = function getTitle() { | |
return elementByClass(swalClasses.title); | |
}; | |
var getContent = function getContent() { | |
return elementByClass(swalClasses.content); | |
}; | |
var getImage = function getImage() { | |
return elementByClass(swalClasses.image); | |
}; | |
var getProgressSteps = function getProgressSteps() { | |
return elementByClass(swalClasses['progress-steps']); | |
}; | |
var getValidationMessage = function getValidationMessage() { | |
return elementByClass(swalClasses['validation-message']); | |
}; | |
var getConfirmButton = function getConfirmButton() { | |
return elementBySelector('.' + swalClasses.actions + ' .' + swalClasses.confirm); | |
}; | |
var getCancelButton = function getCancelButton() { | |
return elementBySelector('.' + swalClasses.actions + ' .' + swalClasses.cancel); | |
}; | |
var getActions = function getActions() { | |
return elementByClass(swalClasses.actions); | |
}; | |
var getHeader = function getHeader() { | |
return elementByClass(swalClasses.header); | |
}; | |
var getFooter = function getFooter() { | |
return elementByClass(swalClasses.footer); | |
}; | |
var getCloseButton = function getCloseButton() { | |
return elementByClass(swalClasses.close); | |
}; | |
var getFocusableElements = function getFocusableElements() { | |
var focusableElementsWithTabindex = toArray(getPopup().querySelectorAll('[tabindex]:not([tabindex="-1"]):not([tabindex="0"])')) // sort according to tabindex | |
.sort(function (a, b) { | |
a = parseInt(a.getAttribute('tabindex')); | |
b = parseInt(b.getAttribute('tabindex')); | |
if (a > b) { | |
return 1; | |
} else if (a < b) { | |
return -1; | |
} | |
return 0; | |
}); // https://github.com/jkup/focusable/blob/master/index.js | |
var otherFocusableElements = toArray(getPopup().querySelectorAll('a[href], area[href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), button:not([disabled]), iframe, object, embed, [tabindex="0"], [contenteditable], audio[controls], video[controls]')).filter(function (el) { | |
return el.getAttribute('tabindex') !== '-1'; | |
}); | |
return uniqueArray(focusableElementsWithTabindex.concat(otherFocusableElements)).filter(function (el) { | |
return isVisible(el); | |
}); | |
}; | |
var isModal = function isModal() { | |
return !isToast() && !document.body.classList.contains(swalClasses['no-backdrop']); | |
}; | |
var isToast = function isToast() { | |
return document.body.classList.contains(swalClasses['toast-shown']); | |
}; | |
var isLoading = function isLoading() { | |
return getPopup().hasAttribute('data-loading'); | |
}; | |
// Detect Node env | |
var isNodeEnv = function isNodeEnv() { | |
return typeof window === 'undefined' || typeof document === 'undefined'; | |
}; | |
var sweetHTML = "\n <div aria-labelledby=\"".concat(swalClasses.title, "\" aria-describedby=\"").concat(swalClasses.content, "\" class=\"").concat(swalClasses.popup, "\" tabindex=\"-1\">\n <div class=\"").concat(swalClasses.header, "\">\n <ul class=\"").concat(swalClasses['progress-steps'], "\"></ul>\n <div class=\"").concat(swalClasses.icon, " ").concat(iconTypes.error, "\">\n <span class=\"swal2-x-mark\"><span class=\"swal2-x-mark-line-left\"></span><span class=\"swal2-x-mark-line-right\"></span></span>\n </div>\n <div class=\"").concat(swalClasses.icon, " ").concat(iconTypes.question, "\"></div>\n <div class=\"").concat(swalClasses.icon, " ").concat(iconTypes.warning, "\"></div>\n <div class=\"").concat(swalClasses.icon, " ").concat(iconTypes.info, "\"></div>\n <div class=\"").concat(swalClasses.icon, " ").concat(iconTypes.success, "\">\n <div class=\"swal2-success-circular-line-left\"></div>\n <span class=\"swal2-success-line-tip\"></span> <span class=\"swal2-success-line-long\"></span>\n <div class=\"swal2-success-ring\"></div> <div class=\"swal2-success-fix\"></div>\n <div class=\"swal2-success-circular-line-right\"></div>\n </div>\n <img class=\"").concat(swalClasses.image, "\" />\n <h2 class=\"").concat(swalClasses.title, "\" id=\"").concat(swalClasses.title, "\"></h2>\n <button type=\"button\" class=\"").concat(swalClasses.close, "\">×</button>\n </div>\n <div class=\"").concat(swalClasses.content, "\">\n <div id=\"").concat(swalClasses.content, "\"></div>\n <input class=\"").concat(swalClasses.input, "\" />\n <input type=\"file\" class=\"").concat(swalClasses.file, "\" />\n <div class=\"").concat(swalClasses.range, "\">\n <input type=\"range\" />\n <output></output>\n </div>\n <select class=\"").concat(swalClasses.select, "\"></select>\n <div class=\"").concat(swalClasses.radio, "\"></div>\n <label for=\"").concat(swalClasses.checkbox, "\" class=\"").concat(swalClasses.checkbox, "\">\n <input type=\"checkbox\" />\n <span class=\"").concat(swalClasses.label, "\"></span>\n </label>\n <textarea class=\"").concat(swalClasses.textarea, "\"></textarea>\n <div class=\"").concat(swalClasses['validation-message'], "\" id=\"").concat(swalClasses['validation-message'], "\"></div>\n </div>\n <div class=\"").concat(swalClasses.actions, "\">\n <button type=\"button\" class=\"").concat(swalClasses.confirm, "\">OK</button>\n <button type=\"button\" class=\"").concat(swalClasses.cancel, "\">Cancel</button>\n </div>\n <div class=\"").concat(swalClasses.footer, "\">\n </div>\n </div>\n").replace(/(^|\n)\s*/g, ''); | |
var resetOldContainer = function resetOldContainer() { | |
var oldContainer = getContainer(); | |
if (!oldContainer) { | |
return; | |
} | |
oldContainer.parentNode.removeChild(oldContainer); | |
removeClass([document.documentElement, document.body], [swalClasses['no-backdrop'], swalClasses['toast-shown'], swalClasses['has-column']]); | |
}; | |
var oldInputVal; // IE11 workaround, see #1109 for details | |
var resetValidationMessage = function resetValidationMessage(e) { | |
if (Swal.isVisible() && oldInputVal !== e.target.value) { | |
Swal.resetValidationMessage(); | |
} | |
oldInputVal = e.target.value; | |
}; | |
var addInputChangeListeners = function addInputChangeListeners() { | |
var content = getContent(); | |
var input = getChildByClass(content, swalClasses.input); | |
var file = getChildByClass(content, swalClasses.file); | |
var range = content.querySelector(".".concat(swalClasses.range, " input")); | |
var rangeOutput = content.querySelector(".".concat(swalClasses.range, " output")); | |
var select = getChildByClass(content, swalClasses.select); | |
var checkbox = content.querySelector(".".concat(swalClasses.checkbox, " input")); | |
var textarea = getChildByClass(content, swalClasses.textarea); | |
input.oninput = resetValidationMessage; | |
file.onchange = resetValidationMessage; | |
select.onchange = resetValidationMessage; | |
checkbox.onchange = resetValidationMessage; | |
textarea.oninput = resetValidationMessage; | |
range.oninput = function (e) { | |
resetValidationMessage(e); | |
rangeOutput.value = range.value; | |
}; | |
range.onchange = function (e) { | |
resetValidationMessage(e); | |
range.nextSibling.value = range.value; | |
}; | |
}; | |
var getTarget = function getTarget(target) { | |
return typeof target === 'string' ? document.querySelector(target) : target; | |
}; | |
var setupAccessibility = function setupAccessibility(params) { | |
var popup = getPopup(); | |
popup.setAttribute('role', params.toast ? 'alert' : 'dialog'); | |
popup.setAttribute('aria-live', params.toast ? 'polite' : 'assertive'); | |
if (!params.toast) { | |
popup.setAttribute('aria-modal', 'true'); | |
} | |
}; | |
var setupRTL = function setupRTL(targetElement) { | |
if (window.getComputedStyle(targetElement).direction === 'rtl') { | |
addClass(getContainer(), swalClasses.rtl); | |
} | |
}; | |
/* | |
* Add modal + backdrop to DOM | |
*/ | |
var init = function init(params) { | |
// Clean up the old popup container if it exists | |
resetOldContainer(); | |
/* istanbul ignore if */ | |
if (isNodeEnv()) { | |
error('SweetAlert2 requires document to initialize'); | |
return; | |
} | |
var container = document.createElement('div'); | |
container.className = swalClasses.container; | |
container.innerHTML = sweetHTML; | |
var targetElement = getTarget(params.target); | |
targetElement.appendChild(container); | |
setupAccessibility(params); | |
setupRTL(targetElement); | |
addInputChangeListeners(); | |
}; | |
var parseHtmlToContainer = function parseHtmlToContainer(param, target) { | |
// DOM element | |
if (param instanceof HTMLElement) { | |
target.appendChild(param); // JQuery element(s) | |
} else if (_typeof(param) === 'object') { | |
handleJqueryElem(target, param); // Plain string | |
} else if (param) { | |
target.innerHTML = param; | |
} | |
}; | |
var handleJqueryElem = function handleJqueryElem(target, elem) { | |
target.innerHTML = ''; | |
if (0 in elem) { | |
for (var i = 0; i in elem; i++) { | |
target.appendChild(elem[i].cloneNode(true)); | |
} | |
} else { | |
target.appendChild(elem.cloneNode(true)); | |
} | |
}; | |
var animationEndEvent = function () { | |
// Prevent run in Node env | |
/* istanbul ignore if */ | |
if (isNodeEnv()) { | |
return false; | |
} | |
var testEl = document.createElement('div'); | |
var transEndEventNames = { | |
'WebkitAnimation': 'webkitAnimationEnd', | |
'OAnimation': 'oAnimationEnd oanimationend', | |
'animation': 'animationend' | |
}; | |
for (var i in transEndEventNames) { | |
if (transEndEventNames.hasOwnProperty(i) && typeof testEl.style[i] !== 'undefined') { | |
return transEndEventNames[i]; | |
} | |
} | |
return false; | |
}(); | |
// Measure width of scrollbar | |
// https://github.com/twbs/bootstrap/blob/master/js/modal.js#L279-L286 | |
var measureScrollbar = function measureScrollbar() { | |
var supportsTouch = 'ontouchstart' in window || navigator.msMaxTouchPoints; | |
if (supportsTouch) { | |
return 0; | |
} | |
var scrollDiv = document.createElement('div'); | |
scrollDiv.style.width = '50px'; | |
scrollDiv.style.height = '50px'; | |
scrollDiv.style.overflow = 'scroll'; | |
document.body.appendChild(scrollDiv); | |
var scrollbarWidth = scrollDiv.offsetWidth - scrollDiv.clientWidth; | |
document.body.removeChild(scrollDiv); | |
return scrollbarWidth; | |
}; | |
function handleButtonsStyling(confirmButton, cancelButton, params) { | |
addClass([confirmButton, cancelButton], swalClasses.styled); // Buttons background colors | |
if (params.confirmButtonColor) { | |
confirmButton.style.backgroundColor = params.confirmButtonColor; | |
} | |
if (params.cancelButtonColor) { | |
cancelButton.style.backgroundColor = params.cancelButtonColor; | |
} // Loading state | |
var confirmButtonBackgroundColor = window.getComputedStyle(confirmButton).getPropertyValue('background-color'); | |
confirmButton.style.borderLeftColor = confirmButtonBackgroundColor; | |
confirmButton.style.borderRightColor = confirmButtonBackgroundColor; | |
} | |
function renderButton(button, buttonType, params) { | |
toggle(button, params['showC' + buttonType.substring(1) + 'Button'], 'inline-block'); | |
button.innerHTML = params[buttonType + 'ButtonText']; // Set caption text | |
button.setAttribute('aria-label', params[buttonType + 'ButtonAriaLabel']); // ARIA label | |
// Add buttons custom classes | |
button.className = swalClasses[buttonType]; | |
applyCustomClass(button, params.customClass, buttonType + 'Button'); | |
addClass(button, params[buttonType + 'ButtonClass']); | |
} | |
var renderActions = function renderActions(instance, params) { | |
var actions = getActions(); | |
var confirmButton = getConfirmButton(); | |
var cancelButton = getCancelButton(); // Actions (buttons) wrapper | |
if (!params.showConfirmButton && !params.showCancelButton) { | |
hide(actions); | |
} else { | |
show(actions); | |
} // Custom class | |
applyCustomClass(actions, params.customClass, 'actions'); // Render confirm button | |
renderButton(confirmButton, 'confirm', params); // render Cancel Button | |
renderButton(cancelButton, 'cancel', params); | |
if (params.buttonsStyling) { | |
handleButtonsStyling(confirmButton, cancelButton, params); | |
} else { | |
removeClass([confirmButton, cancelButton], swalClasses.styled); | |
confirmButton.style.backgroundColor = confirmButton.style.borderLeftColor = confirmButton.style.borderRightColor = ''; | |
cancelButton.style.backgroundColor = cancelButton.style.borderLeftColor = cancelButton.style.borderRightColor = ''; | |
} | |
}; | |
function handleBackdropParam(container, backdrop) { | |
if (typeof backdrop === 'string') { | |
container.style.background = backdrop; | |
} else if (!backdrop) { | |
addClass([document.documentElement, document.body], swalClasses['no-backdrop']); | |
} | |
} | |
function handlePositionParam(container, position) { | |
if (position in swalClasses) { | |
addClass(container, swalClasses[position]); | |
} else { | |
warn('The "position" parameter is not valid, defaulting to "center"'); | |
addClass(container, swalClasses.center); | |
} | |
} | |
function handleGrowParam(container, grow) { | |
if (grow && typeof grow === 'string') { | |
var growClass = 'grow-' + grow; | |
if (growClass in swalClasses) { | |
addClass(container, swalClasses[growClass]); | |
} | |
} | |
} | |
var renderContainer = function renderContainer(instance, params) { | |
var container = getContainer(); | |
if (!container) { | |
return; | |
} | |
handleBackdropParam(container, params.backdrop); | |
if (!params.backdrop && params.allowOutsideClick) { | |
warn('"allowOutsideClick" parameter requires `backdrop` parameter to be set to `true`'); | |
} | |
handlePositionParam(container, params.position); | |
handleGrowParam(container, params.grow); // Custom class | |
applyCustomClass(container, params.customClass, 'container'); | |
if (params.customContainerClass) { | |
// @deprecated | |
addClass(container, params.customContainerClass); | |
} | |
}; | |
/** | |
* This module containts `WeakMap`s for each effectively-"private property" that a `Swal` has. | |
* For example, to set the private property "foo" of `this` to "bar", you can `privateProps.foo.set(this, 'bar')` | |
* This is the approach that Babel will probably take to implement private methods/fields | |
* https://github.com/tc39/proposal-private-methods | |
* https://github.com/babel/babel/pull/7555 | |
* Once we have the changes from that PR in Babel, and our core class fits reasonable in *one module* | |
* then we can use that language feature. | |
*/ | |
var privateProps = { | |
promise: new WeakMap(), | |
innerParams: new WeakMap(), | |
domCache: new WeakMap() | |
}; | |
var renderInput = function renderInput(instance, params) { | |
var innerParams = privateProps.innerParams.get(instance); | |
var rerender = !innerParams || params.input !== innerParams.input; | |
var content = getContent(); | |
var inputTypes = ['input', 'file', 'range', 'select', 'radio', 'checkbox', 'textarea']; | |
for (var i = 0; i < inputTypes.length; i++) { | |
var inputClass = swalClasses[inputTypes[i]]; | |
var inputContainer = getChildByClass(content, inputClass); // set attributes | |
setAttributes(inputTypes[i], params.inputAttributes); // set class | |
setClass(inputContainer, inputClass, params); | |
rerender && hide(inputContainer); | |
} | |
if (!params.input) { | |
return; | |
} | |
if (!renderInputType[params.input]) { | |
return error("Unexpected type of input! Expected \"text\", \"email\", \"password\", \"number\", \"tel\", \"select\", \"radio\", \"checkbox\", \"textarea\", \"file\" or \"url\", got \"".concat(params.input, "\"")); | |
} | |
if (rerender) { | |
var input = renderInputType[params.input](params); | |
show(input); | |
} | |
}; | |
var removeAttributes = function removeAttributes(input) { | |
for (var i = 0; i < input.attributes.length; i++) { | |
var attrName = input.attributes[i].name; | |
if (!(['type', 'value', 'style'].indexOf(attrName) !== -1)) { | |
input.removeAttribute(attrName); | |
} | |
} | |
}; | |
var setAttributes = function setAttributes(inputType, inputAttributes) { | |
var input = getInput(getContent(), inputType); | |
if (!input) { | |
return; | |
} | |
removeAttributes(input); | |
for (var attr in inputAttributes) { | |
// Do not set a placeholder for <input type="range"> | |
// it'll crash Edge, #1298 | |
if (inputType === 'range' && attr === 'placeholder') { | |
continue; | |
} | |
input.setAttribute(attr, inputAttributes[attr]); | |
} | |
}; | |
var setClass = function setClass(inputContainer, inputClass, params) { | |
inputContainer.className = inputClass; | |
if (params.inputClass) { | |
addClass(inputContainer, params.inputClass); | |
} | |
if (params.customClass) { | |
addClass(inputContainer, params.customClass.input); | |
} | |
}; | |
var setInputPlaceholder = function setInputPlaceholder(input, params) { | |
if (!input.placeholder || params.inputPlaceholder) { | |
input.placeholder = params.inputPlaceholder; | |
} | |
}; | |
var renderInputType = {}; | |
renderInputType.text = renderInputType.email = renderInputType.password = renderInputType.number = renderInputType.tel = renderInputType.url = function (params) { | |
var input = getChildByClass(getContent(), swalClasses.input); | |
if (typeof params.inputValue === 'string' || typeof params.inputValue === 'number') { | |
input.value = params.inputValue; | |
} else if (!isPromise(params.inputValue)) { | |
warn("Unexpected type of inputValue! Expected \"string\", \"number\" or \"Promise\", got \"".concat(_typeof(params.inputValue), "\"")); | |
} | |
setInputPlaceholder(input, params); | |
input.type = params.input; | |
return input; | |
}; | |
renderInputType.file = function (params) { | |
var input = getChildByClass(getContent(), swalClasses.file); | |
setInputPlaceholder(input, params); | |
input.type = params.input; | |
return input; | |
}; | |
renderInputType.range = function (params) { | |
var range = getChildByClass(getContent(), swalClasses.range); | |
var rangeInput = range.querySelector('input'); | |
var rangeOutput = range.querySelector('output'); | |
rangeInput.value = params.inputValue; | |
rangeInput.type = params.input; | |
rangeOutput.value = params.inputValue; | |
return range; | |
}; | |
renderInputType.select = function (params) { | |
var select = getChildByClass(getContent(), swalClasses.select); | |
select.innerHTML = ''; | |
if (params.inputPlaceholder) { | |
var placeholder = document.createElement('option'); | |
placeholder.innerHTML = params.inputPlaceholder; | |
placeholder.value = ''; | |
placeholder.disabled = true; | |
placeholder.selected = true; | |
select.appendChild(placeholder); | |
} | |
return select; | |
}; | |
renderInputType.radio = function () { | |
var radio = getChildByClass(getContent(), swalClasses.radio); | |
radio.innerHTML = ''; | |
return radio; | |
}; | |
renderInputType.checkbox = function (params) { | |
var checkbox = getChildByClass(getContent(), swalClasses.checkbox); | |
var checkboxInput = getInput(getContent(), 'checkbox'); | |
checkboxInput.type = 'checkbox'; | |
checkboxInput.value = 1; | |
checkboxInput.id = swalClasses.checkbox; | |
checkboxInput.checked = Boolean(params.inputValue); | |
var label = checkbox.querySelector('span'); | |
label.innerHTML = params.inputPlaceholder; | |
return checkbox; | |
}; | |
renderInputType.textarea = function (params) { | |
var textarea = getChildByClass(getContent(), swalClasses.textarea); | |
textarea.value = params.inputValue; | |
setInputPlaceholder(textarea, params); | |
return textarea; | |
}; | |
var renderContent = function renderContent(instance, params) { | |
var content = getContent().querySelector('#' + swalClasses.content); // Content as HTML | |
if (params.html) { | |
parseHtmlToContainer(params.html, content); | |
show(content, 'block'); // Content as plain text | |
} else if (params.text) { | |
content.textContent = params.text; | |
show(content, 'block'); // No content | |
} else { | |
hide(content); | |
} | |
renderInput(instance, params); // Custom class | |
applyCustomClass(getContent(), params.customClass, 'content'); | |
}; | |
var renderFooter = function renderFooter(instance, params) { | |
var footer = getFooter(); | |
toggle(footer, params.footer); | |
if (params.footer) { | |
parseHtmlToContainer(params.footer, footer); | |
} // Custom class | |
applyCustomClass(footer, params.customClass, 'footer'); | |
}; | |
var renderCloseButton = function renderCloseButton(instance, params) { | |
var closeButton = getCloseButton(); // Custom class | |
applyCustomClass(closeButton, params.customClass, 'closeButton'); | |
toggle(closeButton, params.showCloseButton); | |
closeButton.setAttribute('aria-label', params.closeButtonAriaLabel); | |
}; | |
var renderIcon = function renderIcon(instance, params) { | |
var innerParams = privateProps.innerParams.get(instance); // if the icon with the given type already rendered, | |
// apply the custom class without re-rendering the icon | |
if (innerParams && params.type === innerParams.type && getIcon()) { | |
applyCustomClass(getIcon(), params.customClass, 'icon'); | |
return; | |
} | |
hideAllIcons(); | |
if (!params.type) { | |
return; | |
} | |
adjustSuccessIconBackgoundColor(); | |
if (Object.keys(iconTypes).indexOf(params.type) !== -1) { | |
var icon = elementBySelector(".".concat(swalClasses.icon, ".").concat(iconTypes[params.type])); | |
show(icon); // Custom class | |
applyCustomClass(icon, params.customClass, 'icon'); // Animate icon | |
toggleClass(icon, "swal2-animate-".concat(params.type, "-icon"), params.animation); | |
} else { | |
error("Unknown type! Expected \"success\", \"error\", \"warning\", \"info\" or \"question\", got \"".concat(params.type, "\"")); | |
} | |
}; | |
var hideAllIcons = function hideAllIcons() { | |
var icons = getIcons(); | |
for (var i = 0; i < icons.length; i++) { | |
hide(icons[i]); | |
} | |
}; // Adjust success icon background color to match the popup background color | |
var adjustSuccessIconBackgoundColor = function adjustSuccessIconBackgoundColor() { | |
var popup = getPopup(); | |
var popupBackgroundColor = window.getComputedStyle(popup).getPropertyValue('background-color'); | |
var successIconParts = popup.querySelectorAll('[class^=swal2-success-circular-line], .swal2-success-fix'); | |
for (var i = 0; i < successIconParts.length; i++) { | |
successIconParts[i].style.backgroundColor = popupBackgroundColor; | |
} | |
}; | |
var renderImage = function renderImage(instance, params) { | |
var image = getImage(); | |
if (!params.imageUrl) { | |
return hide(image); | |
} | |
show(image); // Src, alt | |
image.setAttribute('src', params.imageUrl); | |
image.setAttribute('alt', params.imageAlt); // Width, height | |
applyNumericalStyle(image, 'width', params.imageWidth); | |
applyNumericalStyle(image, 'height', params.imageHeight); // Class | |
image.className = swalClasses.image; | |
applyCustomClass(image, params.customClass, 'image'); | |
if (params.imageClass) { | |
addClass(image, params.imageClass); | |
} | |
}; | |
var createStepElement = function createStepElement(step) { | |
var stepEl = document.createElement('li'); | |
addClass(stepEl, swalClasses['progress-step']); | |
stepEl.innerHTML = step; | |
return stepEl; | |
}; | |
var createLineElement = function createLineElement(params) { | |
var lineEl = document.createElement('li'); | |
addClass(lineEl, swalClasses['progress-step-line']); | |
if (params.progressStepsDistance) { | |
lineEl.style.width = params.progressStepsDistance; | |
} | |
return lineEl; | |
}; | |
var renderProgressSteps = function renderProgressSteps(instance, params) { | |
var progressStepsContainer = getProgressSteps(); | |
if (!params.progressSteps || params.progressSteps.length === 0) { | |
return hide(progressStepsContainer); | |
} | |
show(progressStepsContainer); | |
progressStepsContainer.innerHTML = ''; | |
var currentProgressStep = parseInt(params.currentProgressStep === null ? Swal.getQueueStep() : params.currentProgressStep); | |
if (currentProgressStep >= params.progressSteps.length) { | |
warn('Invalid currentProgressStep parameter, it should be less than progressSteps.length ' + '(currentProgressStep like JS arrays starts from 0)'); | |
} | |
params.progressSteps.forEach(function (step, index) { | |
var stepEl = createStepElement(step); | |
progressStepsContainer.appendChild(stepEl); | |
if (index === currentProgressStep) { | |
addClass(stepEl, swalClasses['active-progress-step']); | |
} | |
if (index !== params.progressSteps.length - 1) { | |
var lineEl = createLineElement(step); | |
progressStepsContainer.appendChild(lineEl); | |
} | |
}); | |
}; | |
var renderTitle = function renderTitle(instance, params) { | |
var title = getTitle(); | |
toggle(title, params.title || params.titleText); | |
if (params.title) { | |
parseHtmlToContainer(params.title, title); | |
} | |
if (params.titleText) { | |
title.innerText = params.titleText; | |
} // Custom class | |
applyCustomClass(title, params.customClass, 'title'); | |
}; | |
var renderHeader = function renderHeader(instance, params) { | |
var header = getHeader(); // Custom class | |
applyCustomClass(header, params.customClass, 'header'); // Progress steps | |
renderProgressSteps(instance, params); // Icon | |
renderIcon(instance, params); // Image | |
renderImage(instance, params); // Title | |
renderTitle(instance, params); // Close button | |
renderCloseButton(instance, params); | |
}; | |
var renderPopup = function renderPopup(instance, params) { | |
var popup = getPopup(); // Width | |
applyNumericalStyle(popup, 'width', params.width); // Padding | |
applyNumericalStyle(popup, 'padding', params.padding); // Background | |
if (params.background) { | |
popup.style.background = params.background; | |
} // Default Class | |
popup.className = swalClasses.popup; | |
if (params.toast) { | |
addClass([document.documentElement, document.body], swalClasses['toast-shown']); | |
addClass(popup, swalClasses.toast); | |
} else { | |
addClass(popup, swalClasses.modal); | |
} // Custom class | |
applyCustomClass(popup, params.customClass, 'popup'); | |
if (typeof params.customClass === 'string') { | |
addClass(popup, params.customClass); | |
} // CSS animation | |
toggleClass(popup, swalClasses.noanimation, !params.animation); | |
}; | |
var render = function render(instance, params) { | |
renderPopup(instance, params); | |
renderContainer(instance, params); | |
renderHeader(instance, params); | |
renderContent(instance, params); | |
renderActions(instance, params); | |
renderFooter(instance, params); | |
}; | |
/* | |
* Global function to determine if SweetAlert2 popup is shown | |
*/ | |
var isVisible$1 = function isVisible$$1() { | |
return isVisible(getPopup()); | |
}; | |
/* | |
* Global function to click 'Confirm' button | |
*/ | |
var clickConfirm = function clickConfirm() { | |
return getConfirmButton() && getConfirmButton().click(); | |
}; | |
/* | |
* Global function to click 'Cancel' button | |
*/ | |
var clickCancel = function clickCancel() { | |
return getCancelButton() && getCancelButton().click(); | |
}; | |
function fire() { | |
var Swal = this; | |
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { | |
args[_key] = arguments[_key]; | |
} | |
return _construct(Swal, args); | |
} | |
/** | |
* Returns an extended version of `Swal` containing `params` as defaults. | |
* Useful for reusing Swal configuration. | |
* | |
* For example: | |
* | |
* Before: | |
* const textPromptOptions = { input: 'text', showCancelButton: true } | |
* const {value: firstName} = await Swal.fire({ ...textPromptOptions, title: 'What is your first name?' }) | |
* const {value: lastName} = await Swal.fire({ ...textPromptOptions, title: 'What is your last name?' }) | |
* | |
* After: | |
* const TextPrompt = Swal.mixin({ input: 'text', showCancelButton: true }) | |
* const {value: firstName} = await TextPrompt('What is your first name?') | |
* const {value: lastName} = await TextPrompt('What is your last name?') | |
* | |
* @param mixinParams | |
*/ | |
function mixin(mixinParams) { | |
var MixinSwal = | |
/*#__PURE__*/ | |
function (_this) { | |
_inherits(MixinSwal, _this); | |
function MixinSwal() { | |
_classCallCheck(this, MixinSwal); | |
return _possibleConstructorReturn(this, _getPrototypeOf(MixinSwal).apply(this, arguments)); | |
} | |
_createClass(MixinSwal, [{ | |
key: "_main", | |
value: function _main(params) { | |
return _get(_getPrototypeOf(MixinSwal.prototype), "_main", this).call(this, _extends({}, mixinParams, params)); | |
} | |
}]); | |
return MixinSwal; | |
}(this); | |
return MixinSwal; | |
} | |
// private global state for the queue feature | |
var currentSteps = []; | |
/* | |
* Global function for chaining sweetAlert popups | |
*/ | |
var queue = function queue(steps) { | |
var Swal = this; | |
currentSteps = steps; | |
var resetAndResolve = function resetAndResolve(resolve, value) { | |
currentSteps = []; | |
document.body.removeAttribute('data-swal2-queue-step'); | |
resolve(value); | |
}; | |
var queueResult = []; | |
return new Promise(function (resolve) { | |
(function step(i, callback) { | |
if (i < currentSteps.length) { | |
document.body.setAttribute('data-swal2-queue-step', i); | |
Swal.fire(currentSteps[i]).then(function (result) { | |
if (typeof result.value !== 'undefined') { | |
queueResult.push(result.value); | |
step(i + 1, callback); | |
} else { | |
resetAndResolve(resolve, { | |
dismiss: result.dismiss | |
}); | |
} | |
}); | |
} else { | |
resetAndResolve(resolve, { | |
value: queueResult | |
}); | |
} | |
})(0); | |
}); | |
}; | |
/* | |
* Global function for getting the index of current popup in queue | |
*/ | |
var getQueueStep = function getQueueStep() { | |
return document.body.getAttribute('data-swal2-queue-step'); | |
}; | |
/* | |
* Global function for inserting a popup to the queue | |
*/ | |
var insertQueueStep = function insertQueueStep(step, index) { | |
if (index && index < currentSteps.length) { | |
return currentSteps.splice(index, 0, step); | |
} | |
return currentSteps.push(step); | |
}; | |
/* | |
* Global function for deleting a popup from the queue | |
*/ | |
var deleteQueueStep = function deleteQueueStep(index) { | |
if (typeof currentSteps[index] !== 'undefined') { | |
currentSteps.splice(index, 1); | |
} | |
}; | |
/** | |
* Show spinner instead of Confirm button and disable Cancel button | |
*/ | |
var showLoading = function showLoading() { | |
var popup = getPopup(); | |
if (!popup) { | |
Swal.fire(''); | |
} | |
popup = getPopup(); | |
var actions = getActions(); | |
var confirmButton = getConfirmButton(); | |
var cancelButton = getCancelButton(); | |
show(actions); | |
show(confirmButton); | |
addClass([popup, actions], swalClasses.loading); | |
confirmButton.disabled = true; | |
cancelButton.disabled = true; | |
popup.setAttribute('data-loading', true); | |
popup.setAttribute('aria-busy', true); | |
popup.focus(); | |
}; | |
var RESTORE_FOCUS_TIMEOUT = 100; | |
var globalState = {}; | |
var focusPreviousActiveElement = function focusPreviousActiveElement() { | |
if (globalState.previousActiveElement && globalState.previousActiveElement.focus) { | |
globalState.previousActiveElement.focus(); | |
globalState.previousActiveElement = null; | |
} else if (document.body) { | |
document.body.focus(); | |
} | |
}; // Restore previous active (focused) element | |
var restoreActiveElement = function restoreActiveElement() { | |
return new Promise(function (resolve) { | |
var x = window.scrollX; | |
var y = window.scrollY; | |
globalState.restoreFocusTimeout = setTimeout(function () { | |
focusPreviousActiveElement(); | |
resolve(); | |
}, RESTORE_FOCUS_TIMEOUT); // issues/900 | |
if (typeof x !== 'undefined' && typeof y !== 'undefined') { | |
// IE doesn't have scrollX/scrollY support | |
window.scrollTo(x, y); | |
} | |
}); | |
}; | |
/** | |
* If `timer` parameter is set, returns number of milliseconds of timer remained. | |
* Otherwise, returns undefined. | |
*/ | |
var getTimerLeft = function getTimerLeft() { | |
return globalState.timeout && globalState.timeout.getTimerLeft(); | |
}; | |
/** | |
* Stop timer. Returns number of milliseconds of timer remained. | |
* If `timer` parameter isn't set, returns undefined. | |
*/ | |
var stopTimer = function stopTimer() { | |
return globalState.timeout && globalState.timeout.stop(); | |
}; | |
/** | |
* Resume timer. Returns number of milliseconds of timer remained. | |
* If `timer` parameter isn't set, returns undefined. | |
*/ | |
var resumeTimer = function resumeTimer() { | |
return globalState.timeout && globalState.timeout.start(); | |
}; | |
/** | |
* Resume timer. Returns number of milliseconds of timer remained. | |
* If `timer` parameter isn't set, returns undefined. | |
*/ | |
var toggleTimer = function toggleTimer() { | |
var timer = globalState.timeout; | |
return timer && (timer.running ? timer.stop() : timer.start()); | |
}; | |
/** | |
* Increase timer. Returns number of milliseconds of an updated timer. | |
* If `timer` parameter isn't set, returns undefined. | |
*/ | |
var increaseTimer = function increaseTimer(n) { | |
return globalState.timeout && globalState.timeout.increase(n); | |
}; | |
/** | |
* Check if timer is running. Returns true if timer is running | |
* or false if timer is paused or stopped. | |
* If `timer` parameter isn't set, returns undefined | |
*/ | |
var isTimerRunning = function isTimerRunning() { | |
return globalState.timeout && globalState.timeout.isRunning(); | |
}; | |
var defaultParams = { | |
title: '', | |
titleText: '', | |
text: '', | |
html: '', | |
footer: '', | |
type: null, | |
toast: false, | |
customClass: '', | |
customContainerClass: '', | |
target: 'body', | |
backdrop: true, | |
animation: true, | |
heightAuto: true, | |
allowOutsideClick: true, | |
allowEscapeKey: true, | |
allowEnterKey: true, | |
stopKeydownPropagation: true, | |
keydownListenerCapture: false, | |
showConfirmButton: true, | |
showCancelButton: false, | |
preConfirm: null, | |
confirmButtonText: 'OK', | |
confirmButtonAriaLabel: '', | |
confirmButtonColor: null, | |
confirmButtonClass: '', | |
cancelButtonText: 'Cancel', | |
cancelButtonAriaLabel: '', | |
cancelButtonColor: null, | |
cancelButtonClass: '', | |
buttonsStyling: true, | |
reverseButtons: false, | |
focusConfirm: true, | |
focusCancel: false, | |
showCloseButton: false, | |
closeButtonAriaLabel: 'Close this dialog', | |
showLoaderOnConfirm: false, | |
imageUrl: null, | |
imageWidth: null, | |
imageHeight: null, | |
imageAlt: '', | |
imageClass: '', | |
timer: null, | |
width: null, | |
padding: null, | |
background: null, | |
input: null, | |
inputPlaceholder: '', | |
inputValue: '', | |
inputOptions: {}, | |
inputAutoTrim: true, | |
inputClass: '', | |
inputAttributes: {}, | |
inputValidator: null, | |
validationMessage: null, | |
grow: false, | |
position: 'center', | |
progressSteps: [], | |
currentProgressStep: null, | |
progressStepsDistance: null, | |
onBeforeOpen: null, | |
onAfterClose: null, | |
onOpen: null, | |
onClose: null, | |
scrollbarPadding: true | |
}; | |
var updatableParams = ['title', 'titleText', 'text', 'html', 'type', 'customClass', 'showConfirmButton', 'showCancelButton', 'confirmButtonText', 'confirmButtonAriaLabel', 'confirmButtonColor', 'confirmButtonClass', 'cancelButtonText', 'cancelButtonAriaLabel', 'cancelButtonColor', 'cancelButtonClass', 'buttonsStyling', 'reverseButtons', 'imageUrl', 'imageWidth', 'imageHeigth', 'imageAlt', 'imageClass', 'progressSteps', 'currentProgressStep']; | |
var deprecatedParams = { | |
customContainerClass: 'customClass', | |
confirmButtonClass: 'customClass', | |
cancelButtonClass: 'customClass', | |
imageClass: 'customClass', | |
inputClass: 'customClass' | |
}; | |
var toastIncompatibleParams = ['allowOutsideClick', 'allowEnterKey', 'backdrop', 'focusConfirm', 'focusCancel', 'heightAuto', 'keydownListenerCapture']; | |
/** | |
* Is valid parameter | |
* @param {String} paramName | |
*/ | |
var isValidParameter = function isValidParameter(paramName) { | |
return defaultParams.hasOwnProperty(paramName); | |
}; | |
/** | |
* Is valid parameter for Swal.update() method | |
* @param {String} paramName | |
*/ | |
var isUpdatableParameter = function isUpdatableParameter(paramName) { | |
return updatableParams.indexOf(paramName) !== -1; | |
}; | |
/** | |
* Is deprecated parameter | |
* @param {String} paramName | |
*/ | |
var isDeprecatedParameter = function isDeprecatedParameter(paramName) { | |
return deprecatedParams[paramName]; | |
}; | |
var checkIfParamIsValid = function checkIfParamIsValid(param) { | |
if (!isValidParameter(param)) { | |
warn("Unknown parameter \"".concat(param, "\"")); | |
} | |
}; | |
var checkIfToastParamIsValid = function checkIfToastParamIsValid(param) { | |
if (toastIncompatibleParams.indexOf(param) !== -1) { | |
warn("The parameter \"".concat(param, "\" is incompatible with toasts")); | |
} | |
}; | |
var checkIfParamIsDeprecated = function checkIfParamIsDeprecated(param) { | |
if (isDeprecatedParameter(param)) { | |
warnAboutDepreation(param, isDeprecatedParameter(param)); | |
} | |
}; | |
/** | |
* Show relevant warnings for given params | |
* | |
* @param params | |
*/ | |
var showWarningsForParams = function showWarningsForParams(params) { | |
for (var param in params) { | |
checkIfParamIsValid(param); | |
if (params.toast) { | |
checkIfToastParamIsValid(param); | |
} | |
checkIfParamIsDeprecated(); | |
} | |
}; | |
var staticMethods = Object.freeze({ | |
isValidParameter: isValidParameter, | |
isUpdatableParameter: isUpdatableParameter, | |
isDeprecatedParameter: isDeprecatedParameter, | |
argsToParams: argsToParams, | |
isVisible: isVisible$1, | |
clickConfirm: clickConfirm, | |
clickCancel: clickCancel, | |
getContainer: getContainer, | |
getPopup: getPopup, | |
getTitle: getTitle, | |
getContent: getContent, | |
getImage: getImage, | |
getIcon: getIcon, | |
getIcons: getIcons, | |
getCloseButton: getCloseButton, | |
getActions: getActions, | |
getConfirmButton: getConfirmButton, | |
getCancelButton: getCancelButton, | |
getHeader: getHeader, | |
getFooter: getFooter, | |
getFocusableElements: getFocusableElements, | |
getValidationMessage: getValidationMessage, | |
isLoading: isLoading, | |
fire: fire, | |
mixin: mixin, | |
queue: queue, | |
getQueueStep: getQueueStep, | |
insertQueueStep: insertQueueStep, | |
deleteQueueStep: deleteQueueStep, | |
showLoading: showLoading, | |
enableLoading: showLoading, | |
getTimerLeft: getTimerLeft, | |
stopTimer: stopTimer, | |
resumeTimer: resumeTimer, | |
toggleTimer: toggleTimer, | |
increaseTimer: increaseTimer, | |
isTimerRunning: isTimerRunning | |
}); | |
/** | |
* Enables buttons and hide loader. | |
*/ | |
function hideLoading() { | |
var innerParams = privateProps.innerParams.get(this); | |
var domCache = privateProps.domCache.get(this); | |
if (!innerParams.showConfirmButton) { | |
hide(domCache.confirmButton); | |
if (!innerParams.showCancelButton) { | |
hide(domCache.actions); | |
} | |
} | |
removeClass([domCache.popup, domCache.actions], swalClasses.loading); | |
domCache.popup.removeAttribute('aria-busy'); | |
domCache.popup.removeAttribute('data-loading'); | |
domCache.confirmButton.disabled = false; | |
domCache.cancelButton.disabled = false; | |
} | |
function getInput$1(instance) { | |
var innerParams = privateProps.innerParams.get(instance || this); | |
var domCache = privateProps.domCache.get(instance || this); | |
return getInput(domCache.content, innerParams.input); | |
} | |
var fixScrollbar = function fixScrollbar() { | |
// for queues, do not do this more than once | |
if (states.previousBodyPadding !== null) { | |
return; | |
} // if the body has overflow | |
if (document.body.scrollHeight > window.innerHeight) { | |
// add padding so the content doesn't shift after removal of scrollbar | |
states.previousBodyPadding = parseInt(window.getComputedStyle(document.body).getPropertyValue('padding-right')); | |
document.body.style.paddingRight = states.previousBodyPadding + measureScrollbar() + 'px'; | |
} | |
}; | |
var undoScrollbar = function undoScrollbar() { | |
if (states.previousBodyPadding !== null) { | |
document.body.style.paddingRight = states.previousBodyPadding + 'px'; | |
states.previousBodyPadding = null; | |
} | |
}; | |
/* istanbul ignore next */ | |
var iOSfix = function iOSfix() { | |
var iOS = /iPad|iPhone|iPod/.test(navigator.userAgent) && !window.MSStream; | |
if (iOS && !hasClass(document.body, swalClasses.iosfix)) { | |
var offset = document.body.scrollTop; | |
document.body.style.top = offset * -1 + 'px'; | |
addClass(document.body, swalClasses.iosfix); | |
lockBodyScroll(); | |
} | |
}; | |
var lockBodyScroll = function lockBodyScroll() { | |
// #1246 | |
var container = getContainer(); | |
var preventTouchMove; | |
container.ontouchstart = function (e) { | |
preventTouchMove = e.target === container || !isScrollable(container) && e.target.tagName !== 'INPUT' // #1603 | |
; | |
}; | |
container.ontouchmove = function (e) { | |
if (preventTouchMove) { | |
e.preventDefault(); | |
e.stopPropagation(); | |
} | |
}; | |
}; | |
/* istanbul ignore next */ | |
var undoIOSfix = function undoIOSfix() { | |
if (hasClass(document.body, swalClasses.iosfix)) { | |
var offset = parseInt(document.body.style.top, 10); | |
removeClass(document.body, swalClasses.iosfix); | |
document.body.style.top = ''; | |
document.body.scrollTop = offset * -1; | |
} | |
}; | |
var isIE11 = function isIE11() { | |
return !!window.MSInputMethodContext && !!document.documentMode; | |
}; // Fix IE11 centering sweetalert2/issues/933 | |
/* istanbul ignore next */ | |
var fixVerticalPositionIE = function fixVerticalPositionIE() { | |
var container = getContainer(); | |
var popup = getPopup(); | |
container.style.removeProperty('align-items'); | |
if (popup.offsetTop < 0) { | |
container.style.alignItems = 'flex-start'; | |
} | |
}; | |
/* istanbul ignore next */ | |
var IEfix = function IEfix() { | |
if (typeof window !== 'undefined' && isIE11()) { | |
fixVerticalPositionIE(); | |
window.addEventListener('resize', fixVerticalPositionIE); | |
} | |
}; | |
/* istanbul ignore next */ | |
var undoIEfix = function undoIEfix() { | |
if (typeof window !== 'undefined' && isIE11()) { | |
window.removeEventListener('resize', fixVerticalPositionIE); | |
} | |
}; | |
// Adding aria-hidden="true" to elements outside of the active modal dialog ensures that | |
// elements not within the active modal dialog will not be surfaced if a user opens a screen | |
// readerโs list of elements (headings, form controls, landmarks, etc.) in the document. | |
var setAriaHidden = function setAriaHidden() { | |
var bodyChildren = toArray(document.body.children); | |
bodyChildren.forEach(function (el) { | |
if (el === getContainer() || contains(el, getContainer())) { | |
return; | |
} | |
if (el.hasAttribute('aria-hidden')) { | |
el.setAttribute('data-previous-aria-hidden', el.getAttribute('aria-hidden')); | |
} | |
el.setAttribute('aria-hidden', 'true'); | |
}); | |
}; | |
var unsetAriaHidden = function unsetAriaHidden() { | |
var bodyChildren = toArray(document.body.children); | |
bodyChildren.forEach(function (el) { | |
if (el.hasAttribute('data-previous-aria-hidden')) { | |
el.setAttribute('aria-hidden', el.getAttribute('data-previous-aria-hidden')); | |
el.removeAttribute('data-previous-aria-hidden'); | |
} else { | |
el.removeAttribute('aria-hidden'); | |
} | |
}); | |
}; | |
/** | |
* This module containts `WeakMap`s for each effectively-"private property" that a `Swal` has. | |
* For example, to set the private property "foo" of `this` to "bar", you can `privateProps.foo.set(this, 'bar')` | |
* This is the approach that Babel will probably take to implement private methods/fields | |
* https://github.com/tc39/proposal-private-methods | |
* https://github.com/babel/babel/pull/7555 | |
* Once we have the changes from that PR in Babel, and our core class fits reasonable in *one module* | |
* then we can use that language feature. | |
*/ | |
var privateMethods = { | |
swalPromiseResolve: new WeakMap() | |
}; | |
/* | |
* Instance method to close sweetAlert | |
*/ | |
function removePopupAndResetState(container, isToast, onAfterClose) { | |
if (isToast) { | |
triggerOnAfterClose(onAfterClose); | |
} else { | |
restoreActiveElement().then(function () { | |
return triggerOnAfterClose(onAfterClose); | |
}); | |
globalState.keydownTarget.removeEventListener('keydown', globalState.keydownHandler, { | |
capture: globalState.keydownListenerCapture | |
}); | |
globalState.keydownHandlerAdded = false; | |
} // Unset globalState props so GC will dispose globalState (#1569) | |
delete globalState.keydownHandler; | |
delete globalState.keydownTarget; | |
if (container.parentNode) { | |
container.parentNode.removeChild(container); | |
} | |
removeBodyClasses(); | |
if (isModal()) { | |
undoScrollbar(); | |
undoIOSfix(); | |
undoIEfix(); | |
unsetAriaHidden(); | |
} | |
} | |
function removeBodyClasses() { | |
removeClass([document.documentElement, document.body], [swalClasses.shown, swalClasses['height-auto'], swalClasses['no-backdrop'], swalClasses['toast-shown'], swalClasses['toast-column']]); | |
} | |
function swalCloseEventFinished(popup, container, isToast, onAfterClose) { | |
if (hasClass(popup, swalClasses.hide)) { | |
removePopupAndResetState(container, isToast, onAfterClose); | |
} // Unset WeakMaps so GC will be able to dispose them (#1569) | |
unsetWeakMaps(privateProps); | |
unsetWeakMaps(privateMethods); | |
} | |
function close(resolveValue) { | |
var container = getContainer(); | |
var popup = getPopup(); | |
if (!popup || hasClass(popup, swalClasses.hide)) { | |
return; | |
} | |
var innerParams = privateProps.innerParams.get(this); | |
var swalPromiseResolve = privateMethods.swalPromiseResolve.get(this); | |
var onClose = innerParams.onClose; | |
var onAfterClose = innerParams.onAfterClose; | |
removeClass(popup, swalClasses.show); | |
addClass(popup, swalClasses.hide); // If animation is supported, animate | |
if (animationEndEvent && hasCssAnimation(popup)) { | |
popup.addEventListener(animationEndEvent, function (e) { | |
if (e.target === popup) { | |
swalCloseEventFinished(popup, container, isToast(), onAfterClose); | |
} | |
}); | |
} else { | |
// Otherwise, remove immediately | |
removePopupAndResetState(container, isToast(), onAfterClose); | |
} | |
if (onClose !== null && typeof onClose === 'function') { | |
onClose(popup); | |
} // Resolve Swal promise | |
swalPromiseResolve(resolveValue || {}); // Unset this.params so GC will dispose it (#1569) | |
delete this.params; | |
} | |
var unsetWeakMaps = function unsetWeakMaps(obj) { | |
for (var i in obj) { | |
obj[i] = new WeakMap(); | |
} | |
}; | |
var triggerOnAfterClose = function triggerOnAfterClose(onAfterClose) { | |
if (onAfterClose !== null && typeof onAfterClose === 'function') { | |
setTimeout(function () { | |
onAfterClose(); | |
}); | |
} | |
}; | |
function setButtonsDisabled(instance, buttons, disabled) { | |
var domCache = privateProps.domCache.get(instance); | |
buttons.forEach(function (button) { | |
domCache[button].disabled = disabled; | |
}); | |
} | |
function setInputDisabled(input, disabled) { | |
if (!input) { | |
return false; | |
} | |
if (input.type === 'radio') { | |
var radiosContainer = input.parentNode.parentNode; | |
var radios = radiosContainer.querySelectorAll('input'); | |
for (var i = 0; i < radios.length; i++) { | |
radios[i].disabled = disabled; | |
} | |
} else { | |
input.disabled = disabled; | |
} | |
} | |
function enableButtons() { | |
setButtonsDisabled(this, ['confirmButton', 'cancelButton'], false); | |
} | |
function disableButtons() { | |
setButtonsDisabled(this, ['confirmButton', 'cancelButton'], true); | |
} // @deprecated | |
function enableConfirmButton() { | |
warnAboutDepreation('Swal.disableConfirmButton()', "Swal.getConfirmButton().removeAttribute('disabled')"); | |
setButtonsDisabled(this, ['confirmButton'], false); | |
} // @deprecated | |
function disableConfirmButton() { | |
warnAboutDepreation('Swal.enableConfirmButton()', "Swal.getConfirmButton().setAttribute('disabled', '')"); | |
setButtonsDisabled(this, ['confirmButton'], true); | |
} | |
function enableInput() { | |
return setInputDisabled(this.getInput(), false); | |
} | |
function disableInput() { | |
return setInputDisabled(this.getInput(), true); | |
} | |
function showValidationMessage(error) { | |
var domCache = privateProps.domCache.get(this); | |
domCache.validationMessage.innerHTML = error; | |
var popupComputedStyle = window.getComputedStyle(domCache.popup); | |
domCache.validationMessage.style.marginLeft = "-".concat(popupComputedStyle.getPropertyValue('padding-left')); | |
domCache.validationMessage.style.marginRight = "-".concat(popupComputedStyle.getPropertyValue('padding-right')); | |
show(domCache.validationMessage); | |
var input = this.getInput(); | |
if (input) { | |
input.setAttribute('aria-invalid', true); | |
input.setAttribute('aria-describedBy', swalClasses['validation-message']); | |
focusInput(input); | |
addClass(input, swalClasses.inputerror); | |
} | |
} // Hide block with validation message | |
function resetValidationMessage$1() { | |
var domCache = privateProps.domCache.get(this); | |
if (domCache.validationMessage) { | |
hide(domCache.validationMessage); | |
} | |
var input = this.getInput(); | |
if (input) { | |
input.removeAttribute('aria-invalid'); | |
input.removeAttribute('aria-describedBy'); | |
removeClass(input, swalClasses.inputerror); | |
} | |
} | |
function getProgressSteps$1() { | |
warnAboutDepreation('Swal.getProgressSteps()', "const swalInstance = Swal.fire({progressSteps: ['1', '2', '3']}); const progressSteps = swalInstance.params.progressSteps"); | |
var innerParams = privateProps.innerParams.get(this); | |
return innerParams.progressSteps; | |
} | |
function setProgressSteps(progressSteps) { | |
warnAboutDepreation('Swal.setProgressSteps()', 'Swal.update()'); | |
var innerParams = privateProps.innerParams.get(this); | |
var updatedParams = _extends({}, innerParams, { | |
progressSteps: progressSteps | |
}); | |
renderProgressSteps(this, updatedParams); | |
privateProps.innerParams.set(this, updatedParams); | |
} | |
function showProgressSteps() { | |
var domCache = privateProps.domCache.get(this); | |
show(domCache.progressSteps); | |
} | |
function hideProgressSteps() { | |
var domCache = privateProps.domCache.get(this); | |
hide(domCache.progressSteps); | |
} | |
var Timer = | |
/*#__PURE__*/ | |
function () { | |
function Timer(callback, delay) { | |
_classCallCheck(this, Timer); | |
this.callback = callback; | |
this.remaining = delay; | |
this.running = false; | |
this.start(); | |
} | |
_createClass(Timer, [{ | |
key: "start", | |
value: function start() { | |
if (!this.running) { | |
this.running = true; | |
this.started = new Date(); | |
this.id = setTimeout(this.callback, this.remaining); | |
} | |
return this.remaining; | |
} | |
}, { | |
key: "stop", | |
value: function stop() { | |
if (this.running) { | |
this.running = false; | |
clearTimeout(this.id); | |
this.remaining -= new Date() - this.started; | |
} | |
return this.remaining; | |
} | |
}, { | |
key: "increase", | |
value: function increase(n) { | |
var running = this.running; | |
if (running) { | |
this.stop(); | |
} | |
this.remaining += n; | |
if (running) { | |
this.start(); | |
} | |
return this.remaining; | |
} | |
}, { | |
key: "getTimerLeft", | |
value: function getTimerLeft() { | |
if (this.running) { | |
this.stop(); | |
this.start(); | |
} | |
return this.remaining; | |
} | |
}, { | |
key: "isRunning", | |
value: function isRunning() { | |
return this.running; | |
} | |
}]); | |
return Timer; | |
}(); | |
var defaultInputValidators = { | |
email: function email(string, validationMessage) { | |
return /^[a-zA-Z0-9.+_-]+@[a-zA-Z0-9.-]+\.[a-zA-Z0-9-]{2,24}$/.test(string) ? Promise.resolve() : Promise.resolve(validationMessage ? validationMessage : 'Invalid email address'); | |
}, | |
url: function url(string, validationMessage) { | |
// taken from https://stackoverflow.com/a/3809435 with a small change from #1306 | |
return /^https?:\/\/(www\.)?[-a-zA-Z0-9@:%._+~#=]{2,256}\.[a-z]{2,63}\b([-a-zA-Z0-9@:%_+.~#?&/=]*)$/.test(string) ? Promise.resolve() : Promise.resolve(validationMessage ? validationMessage : 'Invalid URL'); | |
} | |
}; | |
/** | |
* Set type, text and actions on popup | |
* | |
* @param params | |
* @returns {boolean} | |
*/ | |
function setParameters(params) { | |
// Use default `inputValidator` for supported input types if not provided | |
if (!params.inputValidator) { | |
Object.keys(defaultInputValidators).forEach(function (key) { | |
if (params.input === key) { | |
params.inputValidator = defaultInputValidators[key]; | |
} | |
}); | |
} // showLoaderOnConfirm && preConfirm | |
if (params.showLoaderOnConfirm && !params.preConfirm) { | |
warn('showLoaderOnConfirm is set to true, but preConfirm is not defined.\n' + 'showLoaderOnConfirm should be used together with preConfirm, see usage example:\n' + 'https://sweetalert2.github.io/#ajax-request'); | |
} // params.animation will be actually used in renderPopup.js | |
// but in case when params.animation is a function, we need to call that function | |
// before popup (re)initialization, so it'll be possible to check Swal.isVisible() | |
// inside the params.animation function | |
params.animation = callIfFunction(params.animation); // Determine if the custom target element is valid | |
if (!params.target || typeof params.target === 'string' && !document.querySelector(params.target) || typeof params.target !== 'string' && !params.target.appendChild) { | |
warn('Target parameter is not valid, defaulting to "body"'); | |
params.target = 'body'; | |
} // Replace newlines with <br> in title | |
if (typeof params.title === 'string') { | |
params.title = params.title.split('\n').join('<br />'); | |
} | |
var oldPopup = getPopup(); | |
var targetElement = typeof params.target === 'string' ? document.querySelector(params.target) : params.target; | |
if (!oldPopup || // If the model target has changed, refresh the popup | |
oldPopup && targetElement && oldPopup.parentNode !== targetElement.parentNode) { | |
init(params); | |
} | |
} | |
function swalOpenAnimationFinished(popup, container) { | |
popup.removeEventListener(animationEndEvent, swalOpenAnimationFinished); | |
container.style.overflowY = 'auto'; | |
} | |
/** | |
* Open popup, add necessary classes and styles, fix scrollbar | |
* | |
* @param {Array} params | |
*/ | |
var openPopup = function openPopup(params) { | |
var container = getContainer(); | |
var popup = getPopup(); | |
if (params.onBeforeOpen !== null && typeof params.onBeforeOpen === 'function') { | |
params.onBeforeOpen(popup); | |
} | |
if (params.animation) { | |
addClass(popup, swalClasses.show); | |
addClass(container, swalClasses.fade); | |
} | |
show(popup); // scrolling is 'hidden' until animation is done, after that 'auto' | |
if (animationEndEvent && hasCssAnimation(popup)) { | |
container.style.overflowY = 'hidden'; | |
popup.addEventListener(animationEndEvent, swalOpenAnimationFinished.bind(null, popup, container)); | |
} else { | |
container.style.overflowY = 'auto'; | |
} | |
addClass([document.documentElement, document.body, container], swalClasses.shown); | |
if (params.heightAuto && params.backdrop && !params.toast) { | |
addClass([document.documentElement, document.body], swalClasses['height-auto']); | |
} | |
if (isModal()) { | |
if (params.scrollbarPadding) { | |
fixScrollbar(); | |
} | |
iOSfix(); | |
IEfix(); | |
setAriaHidden(); // sweetalert2/issues/1247 | |
setTimeout(function () { | |
container.scrollTop = 0; | |
}); | |
} | |
if (!isToast() && !globalState.previousActiveElement) { | |
globalState.previousActiveElement = document.activeElement; | |
} | |
if (params.onOpen !== null && typeof params.onOpen === 'function') { | |
setTimeout(function () { | |
params.onOpen(popup); | |
}); | |
} | |
}; | |
var _this = undefined; | |
var handleInputOptions = function handleInputOptions(instance, params) { | |
var content = getContent(); | |
var processInputOptions = function processInputOptions(inputOptions) { | |
return populateInputOptions[params.input](content, formatInputOptions(inputOptions), params); | |
}; | |
if (isPromise(params.inputOptions)) { | |
showLoading(); | |
params.inputOptions.then(function (inputOptions) { | |
instance.hideLoading(); | |
processInputOptions(inputOptions); | |
}); | |
} else if (_typeof(params.inputOptions) === 'object') { | |
processInputOptions(params.inputOptions); | |
} else { | |
error("Unexpected type of inputOptions! Expected object, Map or Promise, got ".concat(_typeof(params.inputOptions))); | |
} | |
}; | |
var handleInputValue = function handleInputValue(instance, params) { | |
var input = instance.getInput(); | |
hide(input); | |
params.inputValue.then(function (inputValue) { | |
input.value = params.input === 'number' ? parseFloat(inputValue) || 0 : inputValue + ''; | |
show(input); | |
input.focus(); | |
instance.hideLoading(); | |
})["catch"](function (err) { | |
error('Error in inputValue promise: ' + err); | |
input.value = ''; | |
show(input); | |
input.focus(); | |
_this.hideLoading(); | |
}); | |
}; | |
var populateInputOptions = { | |
select: function select(content, inputOptions, params) { | |
var select = getChildByClass(content, swalClasses.select); | |
inputOptions.forEach(function (inputOption) { | |
var optionValue = inputOption[0]; | |
var optionLabel = inputOption[1]; | |
var option = document.createElement('option'); | |
option.value = optionValue; | |
option.innerHTML = optionLabel; | |
if (params.inputValue.toString() === optionValue.toString()) { | |
option.selected = true; | |
} | |
select.appendChild(option); | |
}); | |
select.focus(); | |
}, | |
radio: function radio(content, inputOptions, params) { | |
var radio = getChildByClass(content, swalClasses.radio); | |
inputOptions.forEach(function (inputOption) { | |
var radioValue = inputOption[0]; | |
var radioLabel = inputOption[1]; | |
var radioInput = document.createElement('input'); | |
var radioLabelElement = document.createElement('label'); | |
radioInput.type = 'radio'; | |
radioInput.name = swalClasses.radio; | |
radioInput.value = radioValue; | |
if (params.inputValue.toString() === radioValue.toString()) { | |
radioInput.checked = true; | |
} | |
var label = document.createElement('span'); | |
label.innerHTML = radioLabel; | |
label.className = swalClasses.label; | |
radioLabelElement.appendChild(radioInput); | |
radioLabelElement.appendChild(label); | |
radio.appendChild(radioLabelElement); | |
}); | |
var radios = radio.querySelectorAll('input'); | |
if (radios.length) { | |
radios[0].focus(); | |
} | |
} | |
/** | |
* Converts `inputOptions` into an array of `[value, label]`s | |
* @param inputOptions | |
*/ | |
}; | |
var formatInputOptions = function formatInputOptions(inputOptions) { | |
var result = []; | |
if (typeof Map !== 'undefined' && inputOptions instanceof Map) { | |
inputOptions.forEach(function (value, key) { | |
result.push([key, value]); | |
}); | |
} else { | |
Object.keys(inputOptions).forEach(function (key) { | |
result.push([key, inputOptions[key]]); | |
}); | |
} | |
return result; | |
}; | |
function _main(userParams) { | |
var _this = this; | |
showWarningsForParams(userParams); | |
var innerParams = _extends({}, defaultParams, userParams); | |
setParameters(innerParams); | |
Object.freeze(innerParams); // clear the previous timer | |
if (globalState.timeout) { | |
globalState.timeout.stop(); | |
delete globalState.timeout; | |
} // clear the restore focus timeout | |
clearTimeout(globalState.restoreFocusTimeout); | |
var domCache = { | |
popup: getPopup(), | |
container: getContainer(), | |
content: getContent(), | |
actions: getActions(), | |
confirmButton: getConfirmButton(), | |
cancelButton: getCancelButton(), | |
closeButton: getCloseButton(), | |
validationMessage: getValidationMessage(), | |
progressSteps: getProgressSteps() | |
}; | |
privateProps.domCache.set(this, domCache); | |
render(this, innerParams); | |
privateProps.innerParams.set(this, innerParams); | |
var constructor = this.constructor; | |
return new Promise(function (resolve) { | |
// functions to handle all closings/dismissals | |
var succeedWith = function succeedWith(value) { | |
_this.closePopup({ | |
value: value | |
}); | |
}; | |
var dismissWith = function dismissWith(dismiss) { | |
_this.closePopup({ | |
dismiss: dismiss | |
}); | |
}; | |
privateMethods.swalPromiseResolve.set(_this, resolve); // Close on timer | |
if (innerParams.timer) { | |
globalState.timeout = new Timer(function () { | |
dismissWith('timer'); | |
delete globalState.timeout; | |
}, innerParams.timer); | |
} // Get the value of the popup input | |
var getInputValue = function getInputValue() { | |
var input = _this.getInput(); | |
if (!input) { | |
return null; | |
} | |
switch (innerParams.input) { | |
case 'checkbox': | |
return input.checked ? 1 : 0; | |
case 'radio': | |
return input.checked ? input.value : null; | |
case 'file': | |
return input.files.length ? input.files[0] : null; | |
default: | |
return innerParams.inputAutoTrim ? input.value.trim() : input.value; | |
} | |
}; // input autofocus | |
if (innerParams.input) { | |
setTimeout(function () { | |
var input = _this.getInput(); | |
if (input) { | |
focusInput(input); | |
} | |
}, 0); | |
} | |
var confirm = function confirm(value) { | |
if (innerParams.showLoaderOnConfirm) { | |
constructor.showLoading(); // TODO: make showLoading an *instance* method | |
} | |
if (innerParams.preConfirm) { | |
_this.resetValidationMessage(); | |
var preConfirmPromise = Promise.resolve().then(function () { | |
return innerParams.preConfirm(value, innerParams.validationMessage); | |
}); | |
preConfirmPromise.then(function (preConfirmValue) { | |
if (isVisible(domCache.validationMessage) || preConfirmValue === false) { | |
_this.hideLoading(); | |
} else { | |
succeedWith(typeof preConfirmValue === 'undefined' ? value : preConfirmValue); | |
} | |
}); | |
} else { | |
succeedWith(value); | |
} | |
}; // Mouse interactions | |
var onButtonEvent = function onButtonEvent(e) { | |
var target = e.target; | |
var confirmButton = domCache.confirmButton, | |
cancelButton = domCache.cancelButton; | |
var targetedConfirm = confirmButton && (confirmButton === target || confirmButton.contains(target)); | |
var targetedCancel = cancelButton && (cancelButton === target || cancelButton.contains(target)); | |
switch (e.type) { | |
case 'click': | |
// Clicked 'confirm' | |
if (targetedConfirm) { | |
_this.disableButtons(); | |
if (innerParams.input) { | |
var inputValue = getInputValue(); | |
if (innerParams.inputValidator) { | |
_this.disableInput(); | |
var validationPromise = Promise.resolve().then(function () { | |
return innerParams.inputValidator(inputValue, innerParams.validationMessage); | |
}); | |
validationPromise.then(function (validationMessage) { | |
_this.enableButtons(); | |
_this.enableInput(); | |
if (validationMessage) { | |
_this.showValidationMessage(validationMessage); | |
} else { | |
confirm(inputValue); | |
} | |
}); | |
} else if (!_this.getInput().checkValidity()) { | |
_this.enableButtons(); | |
_this.showValidationMessage(innerParams.validationMessage); | |
} else { | |
confirm(inputValue); | |
} | |
} else { | |
confirm(true); | |
} // Clicked 'cancel' | |
} else if (targetedCancel) { | |
_this.disableButtons(); | |
dismissWith(constructor.DismissReason.cancel); | |
} | |
break; | |
default: | |
} | |
}; | |
var buttons = domCache.popup.querySelectorAll('button'); | |
for (var i = 0; i < buttons.length; i++) { | |
buttons[i].onclick = onButtonEvent; | |
buttons[i].onmouseover = onButtonEvent; | |
buttons[i].onmouseout = onButtonEvent; | |
buttons[i].onmousedown = onButtonEvent; | |
} // Closing popup by close button | |
domCache.closeButton.onclick = function () { | |
dismissWith(constructor.DismissReason.close); | |
}; | |
if (innerParams.toast) { | |
// Closing popup by internal click | |
domCache.popup.onclick = function () { | |
if (innerParams.showConfirmButton || innerParams.showCancelButton || innerParams.showCloseButton || innerParams.input) { | |
return; | |
} | |
dismissWith(constructor.DismissReason.close); | |
}; | |
} else { | |
var ignoreOutsideClick = false; // Ignore click events that had mousedown on the popup but mouseup on the container | |
// This can happen when the user drags a slider | |
domCache.popup.onmousedown = function () { | |
domCache.container.onmouseup = function (e) { | |
domCache.container.onmouseup = undefined; // We only check if the mouseup target is the container because usually it doesn't | |
// have any other direct children aside of the popup | |
if (e.target === domCache.container) { | |
ignoreOutsideClick = true; | |
} | |
}; | |
}; // Ignore click events that had mousedown on the container but mouseup on the popup | |
domCache.container.onmousedown = function () { | |
domCache.popup.onmouseup = function (e) { | |
domCache.popup.onmouseup = undefined; // We also need to check if the mouseup target is a child of the popup | |
if (e.target === domCache.popup || domCache.popup.contains(e.target)) { | |
ignoreOutsideClick = true; | |
} | |
}; | |
}; | |
domCache.container.onclick = function (e) { | |
if (ignoreOutsideClick) { | |
ignoreOutsideClick = false; | |
return; | |
} | |
if (e.target !== domCache.container) { | |
return; | |
} | |
if (callIfFunction(innerParams.allowOutsideClick)) { | |
dismissWith(constructor.DismissReason.backdrop); | |
} | |
}; | |
} // Reverse buttons (Confirm on the right side) | |
if (innerParams.reverseButtons) { | |
domCache.confirmButton.parentNode.insertBefore(domCache.cancelButton, domCache.confirmButton); | |
} else { | |
domCache.confirmButton.parentNode.insertBefore(domCache.confirmButton, domCache.cancelButton); | |
} // Focus handling | |
var setFocus = function setFocus(index, increment) { | |
var focusableElements = getFocusableElements(innerParams.focusCancel); // search for visible elements and select the next possible match | |
for (var _i = 0; _i < focusableElements.length; _i++) { | |
index = index + increment; // rollover to first item | |
if (index === focusableElements.length) { | |
index = 0; // go to last item | |
} else if (index === -1) { | |
index = focusableElements.length - 1; | |
} | |
return focusableElements[index].focus(); | |
} // no visible focusable elements, focus the popup | |
domCache.popup.focus(); | |
}; | |
var keydownHandler = function keydownHandler(e, innerParams) { | |
if (innerParams.stopKeydownPropagation) { | |
e.stopPropagation(); | |
} | |
var arrowKeys = ['ArrowLeft', 'ArrowRight', 'ArrowUp', 'ArrowDown', 'Left', 'Right', 'Up', 'Down' // IE11 | |
]; | |
if (e.key === 'Enter' && !e.isComposing) { | |
if (e.target && _this.getInput() && e.target.outerHTML === _this.getInput().outerHTML) { | |
if (['textarea', 'file'].indexOf(innerParams.input) !== -1) { | |
return; // do not submit | |
} | |
constructor.clickConfirm(); | |
e.preventDefault(); | |
} // TAB | |
} else if (e.key === 'Tab') { | |
var targetElement = e.target; | |
var focusableElements = getFocusableElements(innerParams.focusCancel); | |
var btnIndex = -1; | |
for (var _i2 = 0; _i2 < focusableElements.length; _i2++) { | |
if (targetElement === focusableElements[_i2]) { | |
btnIndex = _i2; | |
break; | |
} | |
} | |
if (!e.shiftKey) { | |
// Cycle to the next button | |
setFocus(btnIndex, 1); | |
} else { | |
// Cycle to the prev button | |
setFocus(btnIndex, -1); | |
} | |
e.stopPropagation(); | |
e.preventDefault(); // ARROWS - switch focus between buttons | |
} else if (arrowKeys.indexOf(e.key) !== -1) { | |
// focus Cancel button if Confirm button is currently focused | |
if (document.activeElement === domCache.confirmButton && isVisible(domCache.cancelButton)) { | |
domCache.cancelButton.focus(); // and vice versa | |
} else if (document.activeElement === domCache.cancelButton && isVisible(domCache.confirmButton)) { | |
domCache.confirmButton.focus(); | |
} // ESC | |
} else if ((e.key === 'Escape' || e.key === 'Esc') && callIfFunction(innerParams.allowEscapeKey) === true) { | |
e.preventDefault(); | |
dismissWith(constructor.DismissReason.esc); | |
} | |
}; | |
if (globalState.keydownTarget && globalState.keydownHandlerAdded) { | |
globalState.keydownTarget.removeEventListener('keydown', globalState.keydownHandler, { | |
capture: globalState.keydownListenerCapture | |
}); | |
globalState.keydownHandlerAdded = false; | |
} | |
if (!innerParams.toast) { | |
globalState.keydownHandler = function (e) { | |
return keydownHandler(e, innerParams); | |
}; | |
globalState.keydownTarget = innerParams.keydownListenerCapture ? window : domCache.popup; | |
globalState.keydownListenerCapture = innerParams.keydownListenerCapture; | |
globalState.keydownTarget.addEventListener('keydown', globalState.keydownHandler, { | |
capture: globalState.keydownListenerCapture | |
}); | |
globalState.keydownHandlerAdded = true; | |
} | |
_this.enableButtons(); | |
_this.hideLoading(); | |
_this.resetValidationMessage(); | |
if (innerParams.toast && (innerParams.input || innerParams.footer || innerParams.showCloseButton)) { | |
addClass(document.body, swalClasses['toast-column']); | |
} else { | |
removeClass(document.body, swalClasses['toast-column']); | |
} // inputOptions, inputValue | |
if (innerParams.input === 'select' || innerParams.input === 'radio') { | |
handleInputOptions(_this, innerParams); | |
} else if (['text', 'email', 'number', 'tel', 'textarea'].indexOf(innerParams.input) !== -1 && isPromise(innerParams.inputValue)) { | |
handleInputValue(_this, innerParams); | |
} | |
openPopup(innerParams); | |
if (!innerParams.toast) { | |
if (!callIfFunction(innerParams.allowEnterKey)) { | |
if (document.activeElement && typeof document.activeElement.blur === 'function') { | |
document.activeElement.blur(); | |
} | |
} else if (innerParams.focusCancel && isVisible(domCache.cancelButton)) { | |
domCache.cancelButton.focus(); | |
} else if (innerParams.focusConfirm && isVisible(domCache.confirmButton)) { | |
domCache.confirmButton.focus(); | |
} else { | |
setFocus(-1, 1); | |
} | |
} // fix scroll | |
domCache.container.scrollTop = 0; | |
}); | |
} | |
/** | |
* Updates popup parameters. | |
*/ | |
function update(params) { | |
var validUpdatableParams = {}; // assign valid params from `params` to `defaults` | |
Object.keys(params).forEach(function (param) { | |
if (Swal.isUpdatableParameter(param)) { | |
validUpdatableParams[param] = params[param]; | |
} else { | |
warn("Invalid parameter to update: \"".concat(param, "\". Updatable params are listed here: https://github.com/sweetalert2/sweetalert2/blob/master/src/utils/params.js")); | |
} | |
}); | |
var innerParams = privateProps.innerParams.get(this); | |
var updatedParams = _extends({}, innerParams, validUpdatableParams); | |
render(this, updatedParams); | |
privateProps.innerParams.set(this, updatedParams); | |
Object.defineProperties(this, { | |
params: { | |
value: _extends({}, this.params, params), | |
writable: false, | |
enumerable: true | |
} | |
}); | |
} | |
var instanceMethods = Object.freeze({ | |
hideLoading: hideLoading, | |
disableLoading: hideLoading, | |
getInput: getInput$1, | |
close: close, | |
closePopup: close, | |
closeModal: close, | |
closeToast: close, | |
enableButtons: enableButtons, | |
disableButtons: disableButtons, | |
enableConfirmButton: enableConfirmButton, | |
disableConfirmButton: disableConfirmButton, | |
enableInput: enableInput, | |
disableInput: disableInput, | |
showValidationMessage: showValidationMessage, | |
resetValidationMessage: resetValidationMessage$1, | |
getProgressSteps: getProgressSteps$1, | |
setProgressSteps: setProgressSteps, | |
showProgressSteps: showProgressSteps, | |
hideProgressSteps: hideProgressSteps, | |
_main: _main, | |
update: update | |
}); | |
var currentInstance; // SweetAlert constructor | |
function SweetAlert() { | |
// Prevent run in Node env | |
/* istanbul ignore if */ | |
if (typeof window === 'undefined') { | |
return; | |
} // Check for the existence of Promise | |
/* istanbul ignore if */ | |
if (typeof Promise === 'undefined') { | |
error('This package requires a Promise library, please include a shim to enable it in this browser (See: https://github.com/sweetalert2/sweetalert2/wiki/Migration-from-SweetAlert-to-SweetAlert2#1-ie-support)'); | |
} | |
currentInstance = this; | |
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { | |
args[_key] = arguments[_key]; | |
} | |
var outerParams = Object.freeze(this.constructor.argsToParams(args)); | |
Object.defineProperties(this, { | |
params: { | |
value: outerParams, | |
writable: false, | |
enumerable: true, | |
configurable: true | |
} | |
}); | |
var promise = this._main(this.params); | |
privateProps.promise.set(this, promise); | |
} // `catch` cannot be the name of a module export, so we define our thenable methods here instead | |
SweetAlert.prototype.then = function (onFulfilled) { | |
var promise = privateProps.promise.get(this); | |
return promise.then(onFulfilled); | |
}; | |
SweetAlert.prototype["finally"] = function (onFinally) { | |
var promise = privateProps.promise.get(this); | |
return promise["finally"](onFinally); | |
}; // Assign instance methods from src/instanceMethods/*.js to prototype | |
_extends(SweetAlert.prototype, instanceMethods); // Assign static methods from src/staticMethods/*.js to constructor | |
_extends(SweetAlert, staticMethods); // Proxy to instance methods to constructor, for now, for backwards compatibility | |
Object.keys(instanceMethods).forEach(function (key) { | |
SweetAlert[key] = function () { | |
if (currentInstance) { | |
var _currentInstance; | |
return (_currentInstance = currentInstance)[key].apply(_currentInstance, arguments); | |
} | |
}; | |
}); | |
SweetAlert.DismissReason = DismissReason; | |
SweetAlert.version = '8.11.8'; | |
var Swal = SweetAlert; | |
Swal["default"] = Swal; | |
return Swal; | |
}))); | |
if (typeof window !== 'undefined' && window.Sweetalert2){ window.swal = window.sweetAlert = window.Swal = window.SweetAlert = window.Sweetalert2} | |
// CUSTOM JS | |
class SlideColorSpecificationSelection { | |
constructor() { | |
this._elementoDataId = []; | |
} | |
// pega as informaรงรตes do produto na api da vtex | |
informacoesAPI(productId) { | |
// caso receber um valor falso ou algo diferente de um numero inteiro, retorna | |
if (!productId && !Number.isInteger(productId)) return; | |
return new Promise((resolve, reject) => { | |
// protocol opening | |
let http = new XMLHttpRequest(); | |
http.open( | |
"GET", | |
"/api/catalog_system/pub/products/search?fq=productId:" + | |
productId | |
); | |
// set headers | |
http.setRequestHeader("Content-type", "application/json"); | |
http.setRequestHeader("Accept", "application/json"); | |
// received return data | |
http.onload = () => { | |
resolve(JSON.parse(http.responseText)); | |
}; | |
// send request | |
http.send(); | |
}); | |
} | |
// retorna as cores disponiveis do produto | |
coresDisponiveis(items) { | |
// array de cores capturadas para controle de cores | |
let coresCapturadas = []; | |
// modifico e filtro o array de cores | |
return items | |
.map((item) => { | |
// modifico o item do array | |
return item.Cor[0]; | |
}) | |
.filter((item) => { | |
// caso a cord capturada for repetida remove | |
if (coresCapturadas.includes(item)) return; | |
// coloca no array de cores capturadas a nova cor disponivel | |
coresCapturadas.push(item); | |
return item; // retorna a cor | |
}); | |
} | |
// monta o elemento com as imagens das cores para aplicar no elemento atual | |
montaCores(cores) { | |
if (!cores.length) return; | |
return cores.map((cor) => { | |
let imagemCor = new Image(30, 9); | |
imagemCor.src = "/arquivos/" + cor + ".jpg"; | |
imagemCor.title = cor; | |
return imagemCor; | |
}); | |
} | |
aplicaSelecaoCor(coresMontadas, elemento) { | |
let divCores = document.createElement("div"); | |
divCores.classList.add("area-cores-produto"); | |
coresMontadas.forEach((corMontada) => divCores.appendChild(corMontada)); | |
elemento.appendChild(divCores); | |
} | |
adaptaCorParaListaProdutos(referenciaElemento) { | |
// pega todos os elementos do slide com [data-id] | |
this._elementoDataId = document.querySelectorAll(referenciaElemento); | |
if (!this._elementoDataId.length) return; | |
// passa em cada elemento encontrado | |
this._elementoDataId.forEach((item) => { | |
this.informacoesAPI(item.dataset.id).then((data) => { | |
let coresMontadas = this.montaCores( | |
this.coresDisponiveis(data[0].items) | |
); | |
this.aplicaSelecaoCor(coresMontadas, item); | |
}); | |
}); | |
} | |
} | |
window.addEventListener("load", () => { | |
function insereCores() { | |
const slideColorSpecificationSelection = new SlideColorSpecificationSelection(); | |
slideColorSpecificationSelection.adaptaCorParaListaProdutos( | |
"div[data-id].product" | |
); | |
} | |
$.when($.ajax(insereCores())).then(function () { | |
$("#fascar-searchResult div.area-cores-produto").each(function (index) { | |
console.log(`div${index}: ${this.id}`); | |
var targetCor = $(this).parent().find(".product__content > p"); | |
$(this).insertAfter(targetCor); | |
}); | |
$("#tachyons-x-ray-body > main > div.fascar-searchNavigator > div.navigation-tabs > div > div > div.search-multiple-navigator > a").appendTo(".search-multiple-navigator"); | |
}); | |
}); | |
function checaLogin() { | |
vtexjs.checkout.getOrderForm().done(function (orderForm) { | |
var logado = orderForm.loggedIn; | |
if (($logado = true)) { | |
console.log("usuรกrio logado"); | |
} | |
}); | |
} | |
checaLogin(); | |
function montaSlick() { | |
$(".prateleira-categoria .helperComplement").remove(); | |
$(".prateleira-home .prateleira-categoria ul").slick({ | |
slidesToShow: 3, | |
arrows: false, | |
slidesToScroll: 1, | |
infinite: true, | |
dots: false, | |
centerMode: false, | |
focusOnSelect: true, | |
variableWidth: false, | |
responsive: [ | |
{ | |
breakpoint: 1024, | |
settings: { | |
slidesToShow: 2, | |
slidesToScroll: 2, | |
infinite: true, | |
dots: false | |
} | |
}, | |
{ | |
breakpoint: 600, | |
settings: { | |
slidesToShow: 1, | |
slidesToScroll: 1 | |
} | |
}, | |
{ | |
breakpoint: 480, | |
settings: { | |
slidesToShow: 1, | |
slidesToScroll: 1 | |
} | |
} | |
] | |
}); | |
$(".prateleira-recomendados .prateleira-categoria ul").slick({ | |
slidesToShow: 3, | |
arrows: false, | |
slidesToScroll: 1, | |
infinite: true, | |
dots: false, | |
centerMode: false, | |
focusOnSelect: true, | |
variableWidth: false, | |
responsive: [ | |
{ | |
breakpoint: 1024, | |
settings: { | |
slidesToShow: 2, | |
slidesToScroll: 2, | |
infinite: true, | |
dots: false | |
} | |
}, | |
{ | |
breakpoint: 600, | |
settings: { | |
slidesToShow: 1, | |
slidesToScroll: 1 | |
} | |
}, | |
{ | |
breakpoint: 480, | |
settings: { | |
slidesToShow: 1, | |
slidesToScroll: 1 | |
} | |
} | |
] | |
}); | |
$(".prateleira-busca .prateleira-categoria ul").slick({ | |
slidesToShow: 3, | |
arrows: false, | |
slidesToScroll: 1, | |
infinite: true, | |
dots: false, | |
centerMode: false, | |
focusOnSelect: true, | |
variableWidth: false, | |
responsive: [ | |
{ | |
breakpoint: 1024, | |
settings: { | |
slidesToShow: 2, | |
slidesToScroll: 2, | |
infinite: true, | |
dots: false | |
} | |
}, | |
{ | |
breakpoint: 600, | |
settings: { | |
slidesToShow: 1, | |
slidesToScroll: 1 | |
} | |
}, | |
{ | |
breakpoint: 480, | |
settings: { | |
slidesToShow: 1, | |
slidesToScroll: 1 | |
} | |
} | |
] | |
}); | |
} | |
montaSlick(); | |
This file has been truncated, but you can view the full file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{/* <script src="https://cdn.rawgit.com/inexorabletash/polyfill/v0.1.41/polyfill.min.js"></script> */ | |
} | |
function __cons(t, a) { | |
return eval("new t(" + a.map(function(t, e) { | |
return "a[" + e + "]" | |
}).join(",") + ")") | |
} | |
Object.getPrototypeOf || (Object.getPrototypeOf = function(t) { | |
if (t !== Object(t)) | |
throw TypeError("Object.getPrototypeOf called on non-object"); | |
return t.__proto__ || t.constructor.prototype || Object.prototype | |
} | |
), | |
"function" != typeof Object.getOwnPropertyNames && (Object.getOwnPropertyNames = function(t) { | |
if (t !== Object(t)) | |
throw TypeError("Object.getOwnPropertyNames called on non-object"); | |
var e, r = []; | |
for (e in t) | |
Object.prototype.hasOwnProperty.call(t, e) && r.push(e); | |
return r | |
} | |
), | |
"function" != typeof Object.create && (Object.create = function(t, e) { | |
function r() {} | |
if ("object" != typeof t) | |
throw TypeError(); | |
r.prototype = t; | |
var n = new r; | |
if (t && (n.constructor = r), | |
e !== undefined) { | |
if (e !== Object(e)) | |
throw TypeError(); | |
Object.defineProperties(n, e) | |
} | |
return n | |
} | |
), | |
function() { | |
if (!Object.defineProperty || !function() { | |
try { | |
return Object.defineProperty({}, "x", {}), | |
!0 | |
} catch (t) { | |
return !1 | |
} | |
}()) { | |
var t = Object.defineProperty; | |
Object.defineProperty = function(e, r, n) { | |
if (t) | |
try { | |
return t(e, r, n) | |
} catch (o) {} | |
if (e !== Object(e)) | |
throw TypeError("Object.defineProperty called on non-object"); | |
return Object.prototype.__defineGetter__ && "get"in n && Object.prototype.__defineGetter__.call(e, r, n.get), | |
Object.prototype.__defineSetter__ && "set"in n && Object.prototype.__defineSetter__.call(e, r, n.set), | |
"value"in n && (e[r] = n.value), | |
e | |
} | |
} | |
}(), | |
"function" != typeof Object.defineProperties && (Object.defineProperties = function(t, e) { | |
if (t !== Object(t)) | |
throw TypeError("Object.defineProperties called on non-object"); | |
var r; | |
for (r in e) | |
Object.prototype.hasOwnProperty.call(e, r) && Object.defineProperty(t, r, e[r]); | |
return t | |
} | |
), | |
Object.keys || (Object.keys = function(t) { | |
if (t !== Object(t)) | |
throw TypeError("Object.keys called on non-object"); | |
var e, r = []; | |
for (e in t) | |
Object.prototype.hasOwnProperty.call(t, e) && r.push(e); | |
return r | |
} | |
), | |
Function.prototype.bind || (Function.prototype.bind = function(t) { | |
if ("function" != typeof this) | |
throw TypeError("Bind must be called on a function"); | |
var e = Array.prototype.slice.call(arguments, 1) | |
, r = this | |
, n = function() {} | |
, o = function() { | |
return r.apply(this instanceof n ? this : t, e.concat(Array.prototype.slice.call(arguments))) | |
}; | |
return this.prototype && (n.prototype = this.prototype), | |
o.prototype = new n, | |
o | |
} | |
), | |
Array.isArray = Array.isArray || function(t) { | |
return Boolean(t && "[object Array]" === Object.prototype.toString.call(Object(t))) | |
} | |
, | |
Array.prototype.indexOf || (Array.prototype.indexOf = function(t) { | |
if (void 0 === this || null === this) | |
throw TypeError(); | |
var e = Object(this) | |
, r = e.length >>> 0; | |
if (0 === r) | |
return -1; | |
var n = 0; | |
if (arguments.length > 0 && (n = Number(arguments[1]), | |
isNaN(n) ? n = 0 : 0 !== n && n !== 1 / 0 && n !== -1 / 0 && (n = (n > 0 || -1) * Math.floor(Math.abs(n)))), | |
n >= r) | |
return -1; | |
for (var o = n >= 0 ? n : Math.max(r - Math.abs(n), 0); o < r; o++) | |
if (o in e && e[o] === t) | |
return o; | |
return -1 | |
} | |
), | |
Array.prototype.lastIndexOf || (Array.prototype.lastIndexOf = function(t) { | |
if (void 0 === this || null === this) | |
throw TypeError(); | |
var e = Object(this) | |
, r = e.length >>> 0; | |
if (0 === r) | |
return -1; | |
var n = r; | |
arguments.length > 1 && ((n = Number(arguments[1])) !== n ? n = 0 : 0 !== n && n !== 1 / 0 && n !== -1 / 0 && (n = (n > 0 || -1) * Math.floor(Math.abs(n)))); | |
for (var o = n >= 0 ? Math.min(n, r - 1) : r - Math.abs(n); o >= 0; o--) | |
if (o in e && e[o] === t) | |
return o; | |
return -1 | |
} | |
), | |
Array.prototype.every || (Array.prototype.every = function(t) { | |
if (void 0 === this || null === this) | |
throw TypeError(); | |
var e = Object(this) | |
, r = e.length >>> 0; | |
if ("function" != typeof t) | |
throw TypeError(); | |
var n, o = arguments[1]; | |
for (n = 0; n < r; n++) | |
if (n in e && !t.call(o, e[n], n, e)) | |
return !1; | |
return !0 | |
} | |
), | |
Array.prototype.some || (Array.prototype.some = function(t) { | |
if (void 0 === this || null === this) | |
throw TypeError(); | |
var e = Object(this) | |
, r = e.length >>> 0; | |
if ("function" != typeof t) | |
throw TypeError(); | |
var n, o = arguments[1]; | |
for (n = 0; n < r; n++) | |
if (n in e && t.call(o, e[n], n, e)) | |
return !0; | |
return !1 | |
} | |
), | |
Array.prototype.forEach || (Array.prototype.forEach = function(t) { | |
if (void 0 === this || null === this) | |
throw TypeError(); | |
var e = Object(this) | |
, r = e.length >>> 0; | |
if ("function" != typeof t) | |
throw TypeError(); | |
var n, o = arguments[1]; | |
for (n = 0; n < r; n++) | |
n in e && t.call(o, e[n], n, e) | |
} | |
), | |
Array.prototype.map || (Array.prototype.map = function(t) { | |
if (void 0 === this || null === this) | |
throw TypeError(); | |
var e = Object(this) | |
, r = e.length >>> 0; | |
if ("function" != typeof t) | |
throw TypeError(); | |
var n = []; | |
n.length = r; | |
var o, i = arguments[1]; | |
for (o = 0; o < r; o++) | |
o in e && (n[o] = t.call(i, e[o], o, e)); | |
return n | |
} | |
), | |
Array.prototype.filter || (Array.prototype.filter = function(t) { | |
if (void 0 === this || null === this) | |
throw TypeError(); | |
var e = Object(this) | |
, r = e.length >>> 0; | |
if ("function" != typeof t) | |
throw TypeError(); | |
var n, o = [], i = arguments[1]; | |
for (n = 0; n < r; n++) | |
if (n in e) { | |
var a = e[n]; | |
t.call(i, a, n, e) && o.push(a) | |
} | |
return o | |
} | |
), | |
Array.prototype.reduce || (Array.prototype.reduce = function(t) { | |
if (void 0 === this || null === this) | |
throw TypeError(); | |
var e = Object(this) | |
, r = e.length >>> 0; | |
if ("function" != typeof t) | |
throw TypeError(); | |
if (0 === r && 1 === arguments.length) | |
throw TypeError(); | |
var n, o = 0; | |
if (arguments.length >= 2) | |
n = arguments[1]; | |
else | |
for (; ; ) { | |
if (o in e) { | |
n = e[o++]; | |
break | |
} | |
if (++o >= r) | |
throw TypeError() | |
} | |
for (; o < r; ) | |
o in e && (n = t.call(undefined, n, e[o], o, e)), | |
o++; | |
return n | |
} | |
), | |
Array.prototype.reduceRight || (Array.prototype.reduceRight = function(t) { | |
if (void 0 === this || null === this) | |
throw TypeError(); | |
var e = Object(this) | |
, r = e.length >>> 0; | |
if ("function" != typeof t) | |
throw TypeError(); | |
if (0 === r && 1 === arguments.length) | |
throw TypeError(); | |
var n, o = r - 1; | |
if (arguments.length >= 2) | |
n = arguments[1]; | |
else | |
for (; ; ) { | |
if (o in this) { | |
n = this[o--]; | |
break | |
} | |
if (--o < 0) | |
throw TypeError() | |
} | |
for (; o >= 0; ) | |
o in e && (n = t.call(undefined, n, e[o], o, e)), | |
o--; | |
return n | |
} | |
), | |
String.prototype.trim || (String.prototype.trim = function() { | |
return String(this).replace(/^\s+/, "").replace(/\s+$/, "") | |
} | |
), | |
Date.now || (Date.now = function() { | |
return Number(new Date) | |
} | |
), | |
Date.prototype.toISOString || (Date.prototype.toISOString = function() { | |
function t(t) { | |
return ("00" + t).slice(-2) | |
} | |
return this.getUTCFullYear() + "-" + t(this.getUTCMonth() + 1) + "-" + t(this.getUTCDate()) + "T" + t(this.getUTCHours()) + ":" + t(this.getUTCMinutes()) + ":" + t(this.getUTCSeconds()) + "." + function(t) { | |
return ("000" + t).slice(-3) | |
}(this.getUTCMilliseconds()) + "Z" | |
} | |
), | |
function(t) { | |
"use strict"; | |
function e(e) { | |
return e === t ? C : e | |
} | |
function r(t, e) { | |
for (var r = Object.getOwnPropertyDescriptor(t, e), n = Object.getPrototypeOf(t); !r && n; ) | |
r = Object.getOwnPropertyDescriptor(n, e), | |
n = Object.getPrototypeOf(n); | |
return r | |
} | |
function n(t, e, r, n) { | |
e in t && !n && !I || ("function" == typeof r ? Object.defineProperty(t, e, { | |
value: r, | |
configurable: !0, | |
enumerable: !1, | |
writable: !0 | |
}) : Object.defineProperty(t, e, { | |
value: r, | |
configurable: !1, | |
enumerable: !1, | |
writable: !1 | |
})) | |
} | |
function o(t, e, r) { | |
Object.defineProperty(t, e, { | |
value: r, | |
configurable: !1, | |
enumerable: !1, | |
writable: !0 | |
}) | |
} | |
function i() { | |
function t(t) { | |
var e = t.valueOf | |
, n = R(null); | |
return Object.defineProperty(t, "valueOf", { | |
value: function(r) { | |
return function(o) { | |
return o === r ? n : e.apply(t, arguments) | |
} | |
}(r), | |
configurable: !0, | |
writeable: !0, | |
enumerable: !1 | |
}), | |
n | |
} | |
function e(t) { | |
var e = "function" == typeof t.valueOf && t.valueOf(r); | |
return e === t ? null : e | |
} | |
var r = R(null); | |
return { | |
clear: function() { | |
r = R(null) | |
}, | |
remove: function(t) { | |
var r = e(t); | |
return !(!r || !b(r, "value")) && (delete r.value, | |
!0) | |
}, | |
get: function(t, r) { | |
var n = e(t); | |
return n && b(n, "value") ? n.value : r | |
}, | |
has: function(t) { | |
var r = e(t); | |
return Boolean(r && b(r, "value")) | |
}, | |
set: function(r, n) { | |
(e(r) || t(r)).value = n | |
} | |
} | |
} | |
function a(e) { | |
switch (typeof e) { | |
case "undefined": | |
return "undefined"; | |
case "boolean": | |
return "boolean"; | |
case "number": | |
return "number"; | |
case "string": | |
return "string"; | |
case "symbol": | |
return "symbol"; | |
default: | |
return null === e ? "null" : e instanceof t.Symbol ? "symbol" : "object" | |
} | |
} | |
function u(t) { | |
return t = Number(t), | |
L(t) ? 0 : 0 === t || t === Infinity || t === -Infinity ? t : (t < 0 ? -1 : 1) * V(H(t)) | |
} | |
function c(t) { | |
return t >>> 0 | |
} | |
function s(t) { | |
if (null === t || t === C) | |
throw TypeError(); | |
return Object(t) | |
} | |
function f(t) { | |
var e = u(t); | |
return e <= 0 ? 0 : e === Infinity ? 9007199254740991 : K(e, 9007199254740991) | |
} | |
function l(t) { | |
return "function" == typeof t | |
} | |
function p(t) { | |
return !!/Constructor/.test(Object.prototype.toString.call(t)) || (!!/Function/.test(Object.prototype.toString.call(t)) || "function" == typeof t) | |
} | |
function h(t, e) { | |
if (typeof t != typeof e) | |
return !1; | |
switch (typeof t) { | |
case "undefined": | |
return !0; | |
case "number": | |
return t !== t && e !== e || (0 === t && 0 === e ? 1 / t == 1 / e : t === e); | |
case "boolean": | |
case "string": | |
case "object": | |
default: | |
return t === e | |
} | |
} | |
function y(t, e) { | |
if (typeof t != typeof e) | |
return !1; | |
switch (typeof t) { | |
case "undefined": | |
return !0; | |
case "number": | |
return t !== t && e !== e || t === e; | |
case "boolean": | |
case "string": | |
case "object": | |
default: | |
return t === e | |
} | |
} | |
function v(t, e) { | |
return s(t)[e] | |
} | |
function d(t, e) { | |
var r = v(t, e); | |
if (r === C || null === r) | |
return C; | |
if (!l(r)) | |
throw TypeError(); | |
return r | |
} | |
function m(t, e) { | |
for (; t; ) { | |
if (Object.prototype.hasOwnProperty.call(t, e)) | |
return !0; | |
if ("object" !== a(t)) | |
return !1; | |
t = Object.getPrototypeOf(t) | |
} | |
return !1 | |
} | |
function b(t, e) { | |
return Object.prototype.hasOwnProperty.call(t, e) | |
} | |
function g(t, e) { | |
arguments.length < 2 && (e = d(t, it)); | |
var r = e.call(t); | |
if ("object" !== a(r)) | |
throw TypeError(); | |
return r | |
} | |
function E(t, e) { | |
if (arguments.length < 2) | |
var r = t.next(); | |
else | |
r = t.next(e); | |
if ("object" !== a(r)) | |
throw TypeError(); | |
return r | |
} | |
function w(t) { | |
return t.value | |
} | |
function S(t, e) { | |
var r = E(t, e) | |
, n = r.done; | |
return !0 !== Boolean(n) && r | |
} | |
function O(t, e) { | |
var r = {}; | |
return r.value = t, | |
r.done = e, | |
r | |
} | |
function T(t, e, r) { | |
k(function() { | |
e.apply(C, r) | |
}) | |
} | |
function j(t) {} | |
function _(t) { | |
var e = []; | |
if (Object(t) !== t) | |
return e; | |
for (var r = new Set; null !== t; ) | |
Object.getOwnPropertyNames(t).forEach(function(n) { | |
if (!r.has(n)) { | |
var o = Object.getOwnPropertyDescriptor(t, n); | |
o && (r.add(n), | |
o.enumerable && e.push(n)) | |
} | |
}), | |
t = Object.getPrototypeOf(t); | |
return e[it]() | |
} | |
function P(t) { | |
return Object.getOwnPropertyNames(t) | |
} | |
function R(t, e) { | |
return Object.create(t, e) | |
} | |
function A() {} | |
function D(t, e) { | |
var r = String(t) | |
, n = new A; | |
return o(n, "[[IteratedString]]", r), | |
o(n, "[[StringIteratorNextIndex]]", 0), | |
o(n, "[[StringIterationKind]]", e), | |
n | |
} | |
function N() {} | |
function M(t, e) { | |
var r = s(t) | |
, n = new N; | |
return o(n, "[[IteratedObject]]", r), | |
o(n, "[[ArrayIteratorNextIndex]]", 0), | |
o(n, "[[ArrayIterationKind]]", e), | |
n | |
} | |
var x, I = !1, C = void 0, k = function(t, e) { | |
return t ? function(e) { | |
t.resolve().then(function() { | |
e() | |
}) | |
} | |
: e ? function(t) { | |
e(t) | |
} | |
: function(t) { | |
setTimeout(t, 0) | |
} | |
}(t.Promise, t.setImmediate), L = t.isNaN, U = t.parseInt, F = t.parseFloat, W = Math.E, q = Math.LOG10E, B = Math.LOG2E, H = Math.abs, X = Math.ceil, G = Math.exp, V = Math.floor, z = Math.log, $ = Math.max, K = Math.min, J = Math.pow, Y = Math.random, Z = Math.sqrt, Q = String.prototype.match, tt = String.prototype.replace, et = String.prototype.search, rt = String.prototype.split, nt = Object.create(null); | |
!function() { | |
function r(t) { | |
return Array(t + 1).join("x").replace(/x/g, function() { | |
return Y() < .5 ? "โ" : "โ" | |
}) | |
} | |
function i(t) { | |
if (!(this instanceof i)) | |
return new i(t,a); | |
if (this instanceof i && arguments[1] !== a) | |
throw TypeError(); | |
var e = t === C ? C : String(t); | |
return o(this, "[[SymbolData]]", r(128)), | |
o(this, "[[Description]]", e), | |
u[this] = this, | |
this | |
} | |
var a = Object.create(null) | |
, u = {}; | |
x = function(t) { | |
return u[t] | |
} | |
; | |
var c = []; | |
"Symbol"in t && !I || (t.Symbol = i), | |
n(i, "for", function(t) { | |
for (var e = String(t), r = 0; r < c.length; ++r) { | |
var n = c[r]; | |
if (h(n["[[key]]"], e)) | |
return n["[[symbol]]"] | |
} | |
var o = i(t); | |
return c.push({ | |
"[[key]]": e, | |
"[[symbol]]": o | |
}), | |
o | |
}), | |
n(t.Symbol, "iterator", t.Symbol("Symbol.iterator")), | |
n(i, "keyFor", function(t) { | |
if (!(t instanceof i)) | |
throw TypeError(); | |
for (var e = 0; e < c.length; ++e) { | |
var r = c[e]; | |
if (h(r["[[symbol]]"], t)) | |
return r["[[key]]"] | |
} | |
return C | |
}), | |
n(t.Symbol, "match", t.Symbol("Symbol.match")), | |
n(t.Symbol, "replace", t.Symbol("Symbol.replace")), | |
n(t.Symbol, "search", t.Symbol("Symbol.search")), | |
n(t.Symbol, "split", t.Symbol("Symbol.split")), | |
n(t.Symbol, "toStringTag", t.Symbol("Symbol.toStringTag")), | |
Object.defineProperty(i.prototype, "toString", { | |
value: function() { | |
var t = e(this) | |
, r = t["[[Description]]"]; | |
return "Symbol(" + (r === C ? "" : r) + t["[[SymbolData]]"] + ")" | |
}, | |
configurable: !0, | |
writeable: !0, | |
enumerable: !1 | |
}), | |
Object.defineProperty(i.prototype, "valueOf", { | |
value: function() { | |
throw TypeError() | |
}, | |
configurable: !0, | |
writeable: !0, | |
enumerable: !1 | |
}) | |
}(); | |
var ot = {} | |
, it = t.Symbol.iterator | |
, at = t.Symbol.match | |
, ut = t.Symbol.replace | |
, ct = t.Symbol.search | |
, st = t.Symbol.split | |
, ft = t.Symbol.toStringTag; | |
n(Object, "assign", function(t, e) { | |
var r = s(t); | |
if (arguments.length < 2) | |
return r; | |
for (var n = 1; n < arguments.length; ) { | |
var o = arguments[n++]; | |
if (o === C || null === o) | |
var i = []; | |
else { | |
var a = s(o); | |
i = P(a) | |
} | |
for (var u = 0; u < i.length; ++u) { | |
var c = i[u] | |
, f = Object.getOwnPropertyDescriptor(a, c); | |
if (f !== C && f.enumerable) { | |
var l = a[c]; | |
r[c] = l | |
} | |
} | |
} | |
return r | |
}), | |
function() { | |
function e(t) { | |
return !x(t) | |
} | |
var r = "symbol" == typeof t.Symbol() | |
, o = Object.getOwnPropertyNames | |
, i = Object.keys | |
, a = "object" == typeof window ? o(window) : []; | |
n(Object, "getOwnPropertyNames", function(t) { | |
if ("[object Window]" === Object.prototype.toString.call(t)) | |
try { | |
return o(t).filter(e) | |
} catch (r) { | |
return a.slice() | |
} | |
return o(t).filter(e) | |
}, !r), | |
n(Object, "getOwnPropertySymbols", function(t) { | |
return o(t).filter(x).map(x) | |
}, !r), | |
n(Object, "keys", function(t) { | |
return i(t).filter(e) | |
}, !r) | |
}(), | |
n(Object, "is", function(t, e) { | |
return h(t, e) | |
}), | |
n(Object, "setPrototypeOf", function(t, e) { | |
if ("object" !== a(t)) | |
throw TypeError(); | |
if ("object" !== a(e) && "null" !== a(e)) | |
throw TypeError(); | |
return t.__proto__ = e, | |
t | |
}); | |
var lt = Object.prototype.toString; | |
n(Object.prototype, "toString", function() { | |
var t = e(this); | |
return t === Object(t) && ft in t ? "[object " + t[ft] + "]" : lt.apply(t, arguments) | |
}), | |
n(t.Symbol.prototype, t.Symbol.toStringTag, "Symbol"), | |
n(Number, "EPSILON", function() { | |
var t, e; | |
for (t = 1; 1 + t !== 1; t /= 2) | |
e = t; | |
return e | |
}()), | |
n(Number, "isFinite", function(t) { | |
return "number" === a(t) && (t === t && t !== +Infinity && t !== -Infinity) | |
}), | |
n(Number, "isInteger", function(t) { | |
return "number" === a(t) && (t === t && t !== +Infinity && t !== -Infinity && u(t) === t) | |
}), | |
n(Number, "isNaN", function(t) { | |
return "number" === a(t) && t !== t | |
}), | |
n(Number, "isSafeInteger", function(t) { | |
if ("number" !== a(t)) | |
return !1; | |
if (t !== t || t === +Infinity || t === -Infinity) | |
return !1; | |
var e = u(t); | |
return e === t && H(e) <= 9007199254740991 | |
}), | |
n(Number, "MAX_SAFE_INTEGER", 9007199254740991), | |
n(Number, "MIN_SAFE_INTEGER", -9007199254740991), | |
n(Number, "parseFloat", F), | |
n(Number, "parseInt", U), | |
n(Math, ft, "Math"), | |
n(Math, "acosh", function(t) { | |
return t = Number(t), | |
z(t + Z(t * t - 1)) | |
}), | |
n(Math, "asinh", function(t) { | |
if (t = Number(t), | |
h(t, -0)) | |
return t; | |
var e = Z(t * t + 1); | |
return z(e === -t ? 0 : t + e) | |
}), | |
n(Math, "atanh", function(t) { | |
return 0 === (t = Number(t)) ? t : z((1 + t) / (1 - t)) / 2 | |
}), | |
n(Math, "cbrt", function(t) { | |
if (t = Number(t), | |
L(t / t)) | |
return t; | |
var e = J(H(t), 1 / 3) | |
, r = t / e / e; | |
return e + e * (r - e) / (2 * e + r) | |
}), | |
n(Math, "clz32", function(t) { | |
function e(t) { | |
return 240 & t ? 128 & t ? 0 : 64 & t ? 1 : 32 & t ? 2 : 3 : 8 & t ? 4 : 4 & t ? 5 : 2 & t ? 6 : 1 & t ? 7 : 8 | |
} | |
return 4278190080 & (t = c(t)) ? e(t >> 24) : 16711680 & t ? e(t >> 16) + 8 : 65280 & t ? e(t >> 8) + 16 : e(t) + 24 | |
}), | |
n(Math, "cosh", function(t) { | |
return t = Number(t), | |
(J(W, t) + J(W, -t)) / 2 | |
}), | |
n(Math, "expm1", function(t) { | |
return t = Number(t), | |
h(t, -0) ? -0 : H(t) < 1e-5 ? t + .5 * t * t : G(t) - 1 | |
}), | |
n(Math, "fround", function(t) { | |
return L(t) ? NaN : 1 / t == +Infinity || 1 / t == -Infinity || t === +Infinity || t === -Infinity ? t : new Float32Array([t])[0] | |
}), | |
n(Math, "hypot", function() { | |
for (var t = [], e = 0, r = !1, n = 0; n < arguments.length; ++n) { | |
var o = H(Number(arguments[n])); | |
if (o === Infinity) | |
return o; | |
o !== o && (r = !0), | |
o > e && (e = o), | |
t[n] = o | |
} | |
if (r) | |
return NaN; | |
if (0 === e) | |
return 0; | |
var i = 0; | |
for (n = 0; n < t.length; ++n) { | |
var a = t[n] / e; | |
i += a * a | |
} | |
return e * Z(i) | |
}), | |
n(Math, "imul", function(t, e) { | |
var r = c(t) | |
, n = c(e) | |
, o = 65535 & r | |
, i = 65535 & n; | |
return o * i + ((r >>> 16 & 65535) * i + o * (n >>> 16 & 65535) << 16 >>> 0) | 0 | |
}, "imul"in Math && 0 === Math.imul(1, 2147483648)), | |
n(Math, "log1p", function(t) { | |
return (t = Number(t)) < -1 ? NaN : h(t, -0) ? -0 : H(t) > 1e-4 ? z(1 + t) : (-.5 * t + 1) * t | |
}), | |
n(Math, "log10", function(t) { | |
return t = Number(t), | |
z(t) * q | |
}), | |
n(Math, "log2", function(t) { | |
return t = Number(t), | |
z(t) * B | |
}), | |
n(Math, "sign", function(t) { | |
return (t = Number(t)) < 0 ? -1 : t > 0 ? 1 : t | |
}), | |
n(Math, "sinh", function(t) { | |
return t = Number(t), | |
h(t, -0) ? t : (J(W, t) - J(W, -t)) / 2 | |
}), | |
n(Math, "tanh", function(t) { | |
t = Number(t); | |
var e = J(W, 2 * t) - 1 | |
, r = J(W, 2 * t) + 1; | |
return h(t, -0) ? t : e === r ? 1 : e / r | |
}), | |
n(Math, "trunc", function(t) { | |
return t = Number(t), | |
L(t) ? NaN : t < 0 ? X(t) : V(t) | |
}); | |
var pt = function() { | |
var t = {} | |
, e = Symbol(); | |
return t[Symbol.match] = function() { | |
return e | |
} | |
, | |
"".match(t) === e | |
}(); | |
n(String, "fromCodePoint", function() { | |
for (var t = arguments, e = t.length, r = [], n = 0; n < e; ) { | |
var o = t[n] | |
, i = Number(o); | |
if (!h(i, u(i)) || i < 0 || i > 1114111) | |
throw RangeError("Invalid code point " + i); | |
i < 65536 ? r.push(String.fromCharCode(i)) : (i -= 65536, | |
r.push(String.fromCharCode(55296 + (i >> 10))), | |
r.push(String.fromCharCode(i % 1024 + 56320))), | |
n += 1 | |
} | |
return r.join("") | |
}), | |
n(String, "raw", function(t) { | |
var e = [].slice.call(arguments, 1) | |
, r = Object(t).raw | |
, n = Object(r) | |
, o = f(n.length); | |
if (o <= 0) | |
return ""; | |
for (var i = [], a = 0; ; ) { | |
var u = n[a] | |
, c = String(u); | |
if (i.push(c), | |
a + 1 === o) | |
return i.join(""); | |
u = e[a]; | |
var s = String(u); | |
i.push(s), | |
a += 1 | |
} | |
}), | |
n(String.prototype, "codePointAt", function(t) { | |
var r = e(this) | |
, n = String(r) | |
, o = u(t) | |
, i = n.length; | |
if (o < 0 || o >= i) | |
return C; | |
var a = n.charCodeAt(o); | |
if (a < 55296 || a > 56319 || o + 1 === i) | |
return a; | |
var c = n.charCodeAt(o + 1); | |
return c < 56320 || c > 57343 ? a : 1024 * (a - 55296) + (c - 56320) + 65536 | |
}), | |
n(String.prototype, "endsWith", function(t) { | |
var r = arguments[1] | |
, n = e(this) | |
, o = String(n) | |
, i = String(t) | |
, a = o.length | |
, c = r === C ? a : u(r) | |
, s = K($(c, 0), a) | |
, f = i.length | |
, l = s - f; | |
return !(l < 0) && o.substring(l, l + f) === i | |
}), | |
n(String.prototype, "includes", function(t) { | |
var r = arguments[1] | |
, n = e(this) | |
, o = String(n) | |
, i = String(t) | |
, a = u(r) | |
, c = o.length | |
, s = K($(a, 0), c); | |
return -1 !== o.indexOf(i, s) | |
}), | |
n(String.prototype, "match", function(t) { | |
var r = e(this) | |
, n = String(r); | |
if (m(t, at)) | |
var o = t; | |
else | |
o = new RegExp(t); | |
return o[at](n) | |
}, !pt), | |
n(String.prototype, "repeat", function(t) { | |
var r = e(this) | |
, n = String(r) | |
, o = u(t); | |
if (o < 0) | |
throw RangeError(); | |
if (o === Infinity) | |
throw RangeError(); | |
return new Array(o + 1).join(n) | |
}), | |
n(String.prototype, "replace", function(t, r) { | |
var n = e(this); | |
return m(t, ut) ? t[ut](n, r) : tt.call(n, t, r) | |
}, !pt), | |
n(String.prototype, "search", function(t) { | |
var r = e(this) | |
, n = String(r); | |
if (m(t, ct)) | |
var o = t; | |
else | |
o = new RegExp(t); | |
return o[ct](n) | |
}, !pt), | |
n(String.prototype, "split", function(t, r) { | |
var n = e(this); | |
return m(t, st) ? t[st](n, r) : rt.call(n, t, r) | |
}, !pt), | |
n(String.prototype, "startsWith", function(t) { | |
var r = arguments[1] | |
, n = e(this) | |
, o = String(n) | |
, i = String(t) | |
, a = u(r) | |
, c = o.length | |
, s = K($(a, 0), c) | |
, f = i.length; | |
return !(f + s > c) && o.substring(s, s + f) === i | |
}), | |
n(String.prototype, it, function() { | |
return D(this, "value") | |
}); | |
var ht = Object.create(ot); | |
A.prototype = ht, | |
n(ht, "next", function() { | |
var t = s(this) | |
, e = String(t["[[IteratedString]]"]) | |
, r = t["[[StringIteratorNextIndex]]"]; | |
if (r >= e.length) | |
return o(t, "[[StringIteratorNextIndex]]", Infinity), | |
O(C, !0); | |
var n = e.codePointAt(r); | |
return o(t, "[[StringIteratorNextIndex]]", r + (n > 65535 ? 2 : 1)), | |
O(String.fromCodePoint(n), !1) | |
}), | |
n(ht, ft, "String Iterator"), | |
"flags"in RegExp.prototype || Object.defineProperty(RegExp.prototype, "flags", { | |
get: function() { | |
var t = String(this); | |
return t.substring(t.lastIndexOf("/") + 1) | |
} | |
}), | |
n(RegExp.prototype, at, function(t) { | |
var r = e(this); | |
return Q.call(t, r) | |
}), | |
n(RegExp.prototype, ut, function(t, r) { | |
var n = e(this); | |
return tt.call(t, n, r) | |
}), | |
n(RegExp.prototype, ct, function(t) { | |
var r = e(this); | |
return et.call(t, r) | |
}), | |
n(RegExp.prototype, st, function(t, r) { | |
var n = e(this); | |
return rt.call(t, n, r) | |
}), | |
n(Array, "from", function(t) { | |
var r = arguments[1] | |
, n = arguments[2] | |
, o = e(this); | |
if (r === C) | |
var i = !1; | |
else { | |
if (!l(r)) | |
throw TypeError(); | |
var a = n; | |
i = !0 | |
} | |
var u = d(t, it); | |
if (u !== C) { | |
if (p(o)) | |
var c = new o; | |
else | |
c = new Array(0); | |
for (var h = g(t, u), y = 0; ; ) { | |
var v = S(h); | |
if (!1 === v) | |
return c.length = y, | |
c; | |
var m = w(v); | |
if (i) | |
var b = r.call(a, m); | |
else | |
b = m; | |
c[y] = b, | |
y += 1 | |
} | |
} | |
var E = s(t) | |
, O = f(E.length); | |
for (c = p(o) ? new o(O) : new Array(O), | |
y = 0; y < O; ) { | |
var T = E[y]; | |
b = i ? r.call(a, T, y) : T, | |
c[y] = b, | |
y += 1 | |
} | |
return c.length = O, | |
c | |
}), | |
n(Array, "of", function() { | |
var t, r = arguments, n = c(r.length), o = e(this); | |
t = p(o) ? s(t = new o(n)) : new Array(n); | |
for (var i = 0; i < n; ) | |
t[i] = r[i], | |
i += 1; | |
return t.length = n, | |
t | |
}), | |
n(Array.prototype, "copyWithin", function(t, e) { | |
var r = arguments[2] | |
, n = s(this) | |
, o = f(n.length); | |
o = $(o, 0); | |
var i, a = u(t); | |
i = a < 0 ? $(o + a, 0) : K(a, o); | |
var c, l = u(e); | |
c = l < 0 ? $(o + l, 0) : K(l, o); | |
var p, h; | |
h = (p = r === C ? o : u(r)) < 0 ? $(o + p, 0) : K(p, o); | |
var y, v = K(h - c, o - i); | |
for (c < i && i < c + v ? (y = -1, | |
c = c + v - 1, | |
i = i + v - 1) : y = 1; v > 0; ) { | |
var d = String(c) | |
, b = String(i); | |
if (m(n, d)) { | |
var g = n[d]; | |
n[b] = g | |
} else | |
delete n[b]; | |
c += y, | |
i += y, | |
v -= 1 | |
} | |
return n | |
}); | |
var yt = "entries"in Array.prototype && "next"in [].entries(); | |
n(Array.prototype, "entries", function() { | |
return M(this, "key+value") | |
}, !yt), | |
n(Array.prototype, "fill", function(t) { | |
var e = arguments[1] | |
, r = arguments[2] | |
, n = s(this) | |
, o = f(n.length); | |
o = $(o, 0); | |
var i, a = u(e); | |
i = a < 0 ? $(o + a, 0) : K(a, o); | |
var c, l; | |
for (l = (c = r === C ? o : u(r)) < 0 ? $(o + c, 0) : K(c, o); i < l; ) | |
n[String(i)] = t, | |
i += 1; | |
return n | |
}), | |
n(Array.prototype, "find", function(t) { | |
var e = s(this) | |
, r = u(e.length); | |
if (!l(t)) | |
throw TypeError(); | |
for (var n = arguments.length > 1 ? arguments[1] : C, o = 0; o < r; ) { | |
var i = String(o); | |
if (m(e, i)) { | |
var a = e[i] | |
, c = t.call(n, a, o, e); | |
if (Boolean(c)) | |
return a | |
} | |
++o | |
} | |
return C | |
}), | |
n(Array.prototype, "findIndex", function(t) { | |
var e = s(this) | |
, r = f(e.length); | |
if (!l(t)) | |
throw TypeError(); | |
for (var n = arguments.length > 1 ? arguments[1] : C, o = 0; o < r; ) { | |
var i = String(o); | |
if (m(e, i)) { | |
var a = e[i] | |
, u = t.call(n, a, o, e); | |
if (Boolean(u)) | |
return o | |
} | |
++o | |
} | |
return -1 | |
}), | |
n(Array.prototype, "keys", function() { | |
return M(this, "key") | |
}, !yt), | |
n(Array.prototype, "values", function() { | |
return M(this, "value") | |
}, !yt), | |
n(Array.prototype, it, Array.prototype.values); | |
var vt = Object.create(ot); | |
N.prototype = vt, | |
n(vt, "next", function() { | |
var t = e(this); | |
if ("object" !== a(t)) | |
throw TypeError(); | |
var r, n, i = t["[[IteratedObject]]"], u = t["[[ArrayIteratorNextIndex]]"], s = t["[[ArrayIterationKind]]"], f = c(i.length); | |
if (-1 !== s.indexOf("sparse")) | |
for (var l = !1; !l && u < f; ) | |
(l = m(i, r = String(u))) || (u += 1); | |
if (u >= f) | |
return o(t, "[[ArrayIteratorNextIndex]]", Infinity), | |
O(C, !0); | |
if (r = u, | |
o(t, "[[ArrayIteratorNextIndex]]", u + 1), | |
-1 !== s.indexOf("value") && (n = i[r]), | |
-1 !== s.indexOf("key+value")) | |
return O([r, n], !1); | |
if (-1 !== s.indexOf("key")) | |
return O(r, !1); | |
if ("value" === s) | |
return O(n, !1); | |
throw Error("Internal error") | |
}), | |
n(vt, ft, "Array Iterator"), | |
["Int8Array", "Uint8Array", "Uint8ClampedArray", "Int16Array", "Uint16Array", "Int32Array", "Uint32Array", "Float32Array", "Float64Array"].forEach(function(r) { | |
if (r in t) { | |
var o = t[r]; | |
n(o, "from", function(t) { | |
var r = arguments[1] | |
, n = arguments[2] | |
, o = e(this); | |
if (!p(o)) | |
throw TypeError(); | |
if (r === C) | |
var i = !1; | |
else { | |
if (l(r)) | |
throw TypeError(); | |
var a = n; | |
i = !0 | |
} | |
var u = d(t, it); | |
if (u !== C) { | |
for (var c = g(t, u), h = [], y = !0; !1 !== y; ) | |
if (!1 !== (y = S(c))) { | |
var v = w(y); | |
h.push(v) | |
} | |
for (var m = h.length, b = new o(m), E = 0; E < m; ) { | |
var O = h.shift(); | |
if (i) | |
var T = r.call(a, O); | |
else | |
T = O; | |
b[E] = T, | |
++E | |
} | |
return b | |
} | |
var j = s(t); | |
for (b = new o(m = f(j.length)), | |
E = 0; E < m; ) | |
O = j[E], | |
T = i ? r.call(a, O, E) : O, | |
b[E] = T, | |
++E; | |
return b | |
}), | |
n(o, "of", function() { | |
for (var t = arguments, r = t.length, n = new (e(this))(r), o = 0; o < r; ) | |
n[o] = t[o], | |
++o; | |
return n | |
}), | |
n(o.prototype, "copyWithin", Array.prototype.copyWithin), | |
n(o.prototype, "entries", Array.prototype.entries), | |
n(o.prototype, "every", Array.prototype.every), | |
n(o.prototype, "fill", function(t) { | |
var e = arguments[1] | |
, r = arguments[2] | |
, n = s(this) | |
, o = f(n.length); | |
o = $(o, 0); | |
var i, a = u(e); | |
i = a < 0 ? $(o + a, 0) : K(a, o); | |
var c, l; | |
for (l = (c = r === C ? o : u(r)) < 0 ? $(o + c, 0) : K(c, o); i < l; ) | |
n[String(i)] = t, | |
i += 1; | |
return n | |
}), | |
n(o.prototype, "filter", function(t) { | |
var e = arguments[1] | |
, r = s(this) | |
, n = f(r.length); | |
if (!l(t)) | |
throw TypeError(); | |
for (var o = e, i = r.constructor, a = [], u = 0, c = 0; u < n; ) { | |
var p = r[u]; | |
t.call(o, p, u, r) && (a.push(p), | |
++c), | |
++u | |
} | |
for (var h = new i(c), y = 0, v = 0; v < a.length; ++v) { | |
var d = a[v]; | |
h[y] = d, | |
++y | |
} | |
return h | |
}), | |
n(o.prototype, "find", Array.prototype.find), | |
n(o.prototype, "findIndex", Array.prototype.findIndex), | |
n(o.prototype, "forEach", Array.prototype.forEach), | |
n(o.prototype, "indexOf", Array.prototype.indexOf), | |
n(o.prototype, "join", Array.prototype.join), | |
n(o.prototype, "keys", Array.prototype.keys), | |
n(o.prototype, "lastIndexOf", Array.prototype.lastIndexOf), | |
n(o.prototype, "map", function(t) { | |
var e = arguments[1] | |
, r = s(this) | |
, n = f(r.length); | |
if (!l(t)) | |
throw TypeError(); | |
var o = e | |
, i = C | |
, a = r.constructor; | |
p(a) && (i = new a(n)), | |
i === C && (i = new Array(n)); | |
for (var u = 0; u < n; ) { | |
if (m(r, u)) { | |
var c = r[u] | |
, h = t.call(o, c, u, r); | |
i[u] = h | |
} | |
++u | |
} | |
return i | |
}), | |
n(o.prototype, "reduce", Array.prototype.reduce), | |
n(o.prototype, "reduceRight", Array.prototype.reduceRight), | |
n(o.prototype, "reverse", Array.prototype.reverse), | |
n(o.prototype, "slice", function(t, e) { | |
var r = s(this) | |
, n = f(r.length) | |
, o = u(t) | |
, i = o < 0 ? $(n + o, 0) : K(o, n) | |
, a = e === C ? n : u(e) | |
, c = a < 0 ? $(n + a, 0) : K(a, n) | |
, l = c - i | |
, h = r.constructor; | |
if (!p(h)) | |
throw TypeError(); | |
for (var y = new h(l), v = 0; i < c; ) { | |
var d = r[i]; | |
y[v] = d, | |
++i, | |
++v | |
} | |
return y | |
}), | |
n(o.prototype, "some", Array.prototype.some), | |
n(o.prototype, "sort", function() { | |
var t = arguments[0]; | |
return Array.prototype.sort.call(this, function(e, r) { | |
return e !== e && r !== r ? 0 : e !== e ? 1 : r !== r ? -1 : t !== C ? t(e, r) : e < r ? -1 : e > r ? 1 : 0 | |
}) | |
}), | |
n(o.prototype, "values", Array.prototype.values), | |
n(o.prototype, it, o.prototype.values), | |
n(o.prototype, ft, r) | |
} | |
}), | |
function() { | |
function r() { | |
var t = e(this) | |
, r = arguments[0]; | |
if ("object" !== a(t)) | |
throw TypeError(); | |
if ("[[MapData]]"in t) | |
throw TypeError(); | |
if (r !== C) { | |
var n = t.set; | |
if (!l(n)) | |
throw TypeError(); | |
var i = g(s(r)) | |
} | |
if (o(t, "[[MapData]]", { | |
keys: [], | |
values: [] | |
}), | |
i === C) | |
return t; | |
for (; ; ) { | |
var u = S(i); | |
if (!1 === u) | |
return t; | |
var c = w(u); | |
if ("object" !== a(c)) | |
throw TypeError(); | |
var f = c[0] | |
, p = c[1]; | |
n.call(t, f, p) | |
} | |
return t | |
} | |
function i(t, e) { | |
var r; | |
if (e === e) | |
return t.keys.indexOf(e); | |
for (r = 0; r < t.keys.length; r += 1) | |
if (y(t.keys[r], e)) | |
return r; | |
return -1 | |
} | |
function u() {} | |
function c(t, e) { | |
if ("object" !== a(t)) | |
throw TypeError(); | |
if (!("[[MapData]]"in t)) | |
throw TypeError(); | |
if (t["[[MapData]]"] === C) | |
throw TypeError(); | |
var r = new u; | |
return o(r, "[[Map]]", t), | |
o(r, "[[MapNextIndex]]", 0), | |
o(r, "[[MapIterationKind]]", e), | |
r | |
} | |
"Map"in t && !I && !function() { | |
try { | |
return new t.Map([]), | |
!1 | |
} catch (e) { | |
return !0 | |
} | |
}() && !function() { | |
try { | |
return !(new t.Map).entries().next | |
} catch (e) { | |
return !0 | |
} | |
}() && 1 === new t.Map([["a", 1]]).size || (t.Map = r); | |
var f = {}; | |
n(r.prototype = f, "clear", function() { | |
var t = e(this); | |
if ("object" !== a(t)) | |
throw TypeError(); | |
if (!("[[MapData]]"in t)) | |
throw TypeError(); | |
if (t["[[MapData]]"] === C) | |
throw TypeError(); | |
var r = t["[[MapData]]"]; | |
return r.keys.length = 0, | |
r.values.length = 0, | |
C | |
}), | |
n(r.prototype, "delete", function(t) { | |
var r = e(this); | |
if ("object" !== a(r)) | |
throw TypeError(); | |
if (!("[[MapData]]"in r)) | |
throw TypeError(); | |
if (r["[[MapData]]"] === C) | |
throw TypeError(); | |
var n = r["[[MapData]]"] | |
, o = i(n, t); | |
return !(o < 0) && (n.keys[o] = nt, | |
n.values[o] = nt, | |
!0) | |
}), | |
n(r.prototype, "entries", function() { | |
var t = e(this); | |
if ("object" !== a(t)) | |
throw TypeError(); | |
return c(t, "key+value") | |
}), | |
n(r.prototype, "forEach", function(t) { | |
var r = arguments[1] | |
, n = e(this); | |
if ("object" !== a(n)) | |
throw TypeError(); | |
if (!("[[MapData]]"in n)) | |
throw TypeError(); | |
if (n["[[MapData]]"] === C) | |
throw TypeError(); | |
var o = n["[[MapData]]"]; | |
if (!l(t)) | |
throw TypeError("First argument to forEach is not callable."); | |
for (var i = 0; i < o.keys.length; ++i) | |
o.keys[i] !== nt && t.call(r, o.values[i], o.keys[i], n); | |
return C | |
}), | |
n(r.prototype, "get", function(t) { | |
var r = e(this); | |
if ("object" !== a(r)) | |
throw TypeError(); | |
if (!("[[MapData]]"in r)) | |
throw TypeError(); | |
if (r["[[MapData]]"] === C) | |
throw TypeError(); | |
var n = r["[[MapData]]"] | |
, o = i(n, t); | |
return o >= 0 ? n.values[o] : C | |
}), | |
n(r.prototype, "has", function(t) { | |
var r = e(this); | |
if ("object" !== a(r)) | |
throw TypeError(); | |
if (!("[[MapData]]"in r)) | |
throw TypeError(); | |
if (r["[[MapData]]"] === C) | |
throw TypeError(); | |
return i(r["[[MapData]]"], t) >= 0 | |
}), | |
n(r.prototype, "keys", function() { | |
var t = e(this); | |
if ("object" !== a(t)) | |
throw TypeError(); | |
return c(t, "key") | |
}), | |
n(r.prototype, "set", function(t, r) { | |
var n = e(this); | |
if ("object" !== a(n)) | |
throw TypeError(); | |
if (!("[[MapData]]"in n)) | |
throw TypeError(); | |
if (n["[[MapData]]"] === C) | |
throw TypeError(); | |
var o = n["[[MapData]]"] | |
, u = i(o, t); | |
return u < 0 && (u = o.keys.length), | |
h(t, -0) && (t = 0), | |
o.keys[u] = t, | |
o.values[u] = r, | |
n | |
}), | |
Object.defineProperty(r.prototype, "size", { | |
get: function() { | |
var t = e(this); | |
if ("object" !== a(t)) | |
throw TypeError(); | |
if (!("[[MapData]]"in t)) | |
throw TypeError(); | |
if (t["[[MapData]]"] === C) | |
throw TypeError(); | |
for (var r = t["[[MapData]]"], n = 0, o = 0; o < r.keys.length; ++o) | |
r.keys[o] !== nt && (n += 1); | |
return n | |
} | |
}), | |
n(r.prototype, "values", function() { | |
var t = e(this); | |
if ("object" !== a(t)) | |
throw TypeError(); | |
return c(t, "value") | |
}), | |
n(r.prototype, it, function() { | |
var t = e(this); | |
if ("object" !== a(t)) | |
throw TypeError(); | |
return c(t, "key+value") | |
}), | |
n(t.Map.prototype, ft, "Map"); | |
var p = Object.create(ot); | |
u.prototype = p, | |
n(p, "next", function() { | |
var t = e(this); | |
if ("object" !== a(t)) | |
throw TypeError(); | |
for (var r = t["[[Map]]"], n = t["[[MapNextIndex]]"], i = t["[[MapIterationKind]]"], u = r["[[MapData]]"]; n < u.keys.length; ) { | |
var c = { | |
key: u.keys[n], | |
value: u.values[n] | |
}; | |
if (n = n += 1, | |
o(t, "[[MapNextIndex]]", n), | |
c.key !== nt) | |
return "key" === i ? O(c.key, !1) : "value" === i ? O(c.value, !1) : O([c.key, c.value], !1) | |
} | |
return O(C, !0) | |
}), | |
n(p, ft, "Map Iterator") | |
}(), | |
function() { | |
function r() { | |
var t = e(this) | |
, r = arguments[0]; | |
if ("object" !== a(t)) | |
throw TypeError(); | |
if ("[[SetData]]"in t) | |
throw TypeError(); | |
if (r !== C) { | |
var n = t.add; | |
if (!l(n)) | |
throw TypeError(); | |
var i = g(s(r)) | |
} | |
if (o(t, "[[SetData]]", []), | |
i === C) | |
return t; | |
for (; ; ) { | |
var u = S(i); | |
if (!1 === u) | |
return t; | |
var c = w(u); | |
n.call(t, c) | |
} | |
return t | |
} | |
function i(t, e) { | |
var r; | |
if (e === e) | |
return t.indexOf(e); | |
for (r = 0; r < t.length; r += 1) | |
if (y(t[r], e)) | |
return r; | |
return -1 | |
} | |
function u() {} | |
function c(t, e) { | |
if ("object" !== a(t)) | |
throw TypeError(); | |
if (!("[[SetData]]"in t)) | |
throw TypeError(); | |
if (t["[[SetData]]"] === C) | |
throw TypeError(); | |
var r = new u; | |
return o(r, "[[IteratedSet]]", t), | |
o(r, "[[SetNextIndex]]", 0), | |
o(r, "[[SetIterationKind]]", e), | |
r | |
} | |
"Set"in t && !I && !function() { | |
try { | |
return !(new t.Set).entries().next | |
} catch (e) { | |
return !0 | |
} | |
}() && 1 === new t.Set([1]).size || (t.Set = r); | |
var f = {}; | |
n(r.prototype = f, "add", function(t) { | |
var r = e(this); | |
if ("object" !== a(r)) | |
throw TypeError(); | |
if (!("[[SetData]]"in r)) | |
throw TypeError(); | |
if (r["[[SetData]]"] === C) | |
throw TypeError(); | |
h(t, -0) && (t = 0); | |
var n = i(r["[[SetData]]"], t); | |
return n < 0 && (n = r["[[SetData]]"].length), | |
r["[[SetData]]"][n] = t, | |
r | |
}), | |
n(r.prototype, "clear", function() { | |
var t = e(this); | |
if ("object" !== a(t)) | |
throw TypeError(); | |
if (!("[[SetData]]"in t)) | |
throw TypeError(); | |
if (t["[[SetData]]"] === C) | |
throw TypeError(); | |
return t["[[SetData]]"].length = 0, | |
C | |
}), | |
n(r.prototype, "delete", function(t) { | |
var r = e(this); | |
if ("object" !== a(r)) | |
throw TypeError(); | |
if (!("[[SetData]]"in r)) | |
throw TypeError(); | |
if (r["[[SetData]]"] === C) | |
throw TypeError(); | |
var n = r["[[SetData]]"] | |
, o = i(n, t); | |
return !(o < 0) && (n[o] = nt, | |
!0) | |
}), | |
n(r.prototype, "entries", function() { | |
var t = e(this); | |
if ("object" !== a(t)) | |
throw TypeError(); | |
return c(t, "key+value") | |
}), | |
n(r.prototype, "forEach", function(t) { | |
var r = arguments[1] | |
, n = e(this); | |
if ("object" !== a(n)) | |
throw TypeError(); | |
if (!("[[SetData]]"in n)) | |
throw TypeError(); | |
if (n["[[SetData]]"] === C) | |
throw TypeError(); | |
var o = n["[[SetData]]"]; | |
if (!l(t)) | |
throw TypeError("First argument to forEach is not callable."); | |
for (var i = 0; i < o.length; ++i) | |
o[i] !== nt && t.call(r, o[i], o[i], n) | |
}), | |
n(r.prototype, "has", function(t) { | |
var r = e(this); | |
if ("object" !== a(r)) | |
throw TypeError(); | |
if (!("[[SetData]]"in r)) | |
throw TypeError(); | |
if (r["[[SetData]]"] === C) | |
throw TypeError(); | |
return -1 !== i(r["[[SetData]]"], t) | |
}), | |
Object.defineProperty(r.prototype, "size", { | |
get: function() { | |
var t = e(this); | |
if ("object" !== a(t)) | |
throw TypeError(); | |
if (!("[[SetData]]"in t)) | |
throw TypeError(); | |
if (t["[[SetData]]"] === C) | |
throw TypeError(); | |
for (var r = t["[[SetData]]"], n = 0, o = 0; o < r.length; ++o) | |
r[o] !== nt && (n += 1); | |
return n | |
} | |
}), | |
n(r.prototype, "values", function() { | |
var t = e(this); | |
if ("object" !== a(t)) | |
throw TypeError(); | |
return c(t, "value") | |
}), | |
r.prototype.keys = r.prototype.values, | |
n(r.prototype, it, function() { | |
var t = e(this); | |
if ("object" !== a(t)) | |
throw TypeError(); | |
return c(t) | |
}), | |
n(t.Set.prototype, ft, "Set"); | |
var p = Object.create(ot); | |
u.prototype = p, | |
n(p, "next", function() { | |
var t = e(this); | |
if ("object" !== a(t)) | |
throw TypeError(); | |
for (var r = t["[[IteratedSet]]"], n = t["[[SetNextIndex]]"], i = t["[[SetIterationKind]]"], u = r["[[SetData]]"]; n < u.length; ) { | |
var c = u[n]; | |
if (n = n += 1, | |
o(t, "[[SetNextIndex]]", n), | |
c !== nt) | |
return "key+value" === i ? O([c, c], !1) : O(c, !1) | |
} | |
return O(C, !0) | |
}), | |
n(p, ft, "Set Iterator") | |
}(), | |
function() { | |
function r() { | |
var t = e(this) | |
, r = arguments[0]; | |
if ("object" !== a(t)) | |
throw TypeError(); | |
if ("[[WeakMapData]]"in t) | |
throw TypeError(); | |
if (r !== C) { | |
var n = t.set; | |
if (!l(n)) | |
throw TypeError(); | |
var u = g(s(r)) | |
} | |
if (o(t, "[[WeakMapData]]", new i), | |
u === C) | |
return t; | |
for (; ; ) { | |
var c = S(u); | |
if (!1 === c) | |
return t; | |
var f = w(c); | |
if ("object" !== a(f)) | |
throw TypeError(); | |
var p = f[0] | |
, h = f[1]; | |
n.call(t, p, h) | |
} | |
return t | |
} | |
"WeakMap"in t && !I || (t.WeakMap = r); | |
var u = {}; | |
n(r.prototype = u, "delete", function(t) { | |
var r = e(this); | |
if ("object" !== a(r)) | |
throw TypeError(); | |
if (r["[[WeakMapData]]"] === C) | |
throw TypeError(); | |
if ("object" !== a(t)) | |
throw TypeError("Expected object"); | |
return r["[[WeakMapData]]"].remove(t) | |
}), | |
n(r.prototype, "get", function(t, r) { | |
var n = e(this); | |
if ("object" !== a(n)) | |
throw TypeError(); | |
if (n["[[WeakMapData]]"] === C) | |
throw TypeError(); | |
if ("object" !== a(t)) | |
throw TypeError("Expected object"); | |
return n["[[WeakMapData]]"].get(t, r) | |
}), | |
n(r.prototype, "has", function(t) { | |
var r = e(this); | |
if ("object" !== a(r)) | |
throw TypeError(); | |
if (r["[[WeakMapData]]"] === C) | |
throw TypeError(); | |
if ("object" !== a(t)) | |
throw TypeError("Expected object"); | |
return r["[[WeakMapData]]"].has(t) | |
}), | |
n(r.prototype, "set", function(t, r) { | |
var n = e(this); | |
if ("object" !== a(n)) | |
throw TypeError(); | |
if (n["[[WeakMapData]]"] === C) | |
throw TypeError(); | |
if ("object" !== a(t)) | |
throw TypeError("Expected object"); | |
return n["[[WeakMapData]]"].set(t, r), | |
n | |
}), | |
n(t.WeakMap.prototype, ft, "WeakMap"), | |
function() { | |
var e = new t.WeakMap | |
, r = t.WeakMap.prototype.set; | |
n(t.WeakMap.prototype, "set", function() { | |
return r.apply(this, arguments), | |
this | |
}, e.set({}, 0) !== e) | |
}() | |
}(), | |
function() { | |
function r() { | |
var t = e(this) | |
, r = arguments[0]; | |
if ("object" !== a(t)) | |
throw TypeError(); | |
if ("[[WeakSetData]]"in t) | |
throw TypeError(); | |
if (r !== C) { | |
var n = t.add; | |
if (!l(n)) | |
throw TypeError(); | |
var u = g(s(r)) | |
} | |
if (o(t, "[[WeakSetData]]", new i), | |
u === C) | |
return t; | |
for (; ; ) { | |
var c = S(u); | |
if (!1 === c) | |
return t; | |
var f = w(c); | |
n.call(t, f) | |
} | |
return t | |
} | |
"WeakSet"in t && !I || (t.WeakSet = r); | |
var u = {}; | |
n(r.prototype = u, "add", function(t) { | |
var r = e(this); | |
if ("object" !== a(r)) | |
throw TypeError(); | |
if (r["[[WeakSetData]]"] === C) | |
throw TypeError(); | |
if ("object" !== a(t)) | |
throw TypeError("Expected object"); | |
return r["[[WeakSetData]]"].set(t, !0), | |
r | |
}), | |
n(r.prototype, "delete", function(t) { | |
var r = e(this); | |
if ("object" !== a(r)) | |
throw TypeError(); | |
if (r["[[WeakSetData]]"] === C) | |
throw TypeError(); | |
if ("object" !== a(t)) | |
throw TypeError("Expected object"); | |
return r["[[WeakSetData]]"].remove(t) | |
}), | |
n(r.prototype, "has", function(t) { | |
var r = e(this); | |
if ("object" !== a(r)) | |
throw TypeError(); | |
if (r["[[WeakSetData]]"] === C) | |
throw TypeError(); | |
if ("object" !== a(t)) | |
throw TypeError("Expected object"); | |
return r["[[WeakSetData]]"].has(t) | |
}), | |
n(t.WeakSet.prototype, ft, "WeakSet"), | |
function() { | |
var e = new t.WeakSet | |
, r = t.WeakSet.prototype.add; | |
n(t.WeakSet.prototype, "add", function() { | |
return r.apply(this, arguments), | |
this | |
}, e.add({}) !== e) | |
}() | |
}(), | |
"ArrayBuffer"in t && (n(ArrayBuffer, "isView", function(t) { | |
return "object" === a(t) && ("buffer"in t && t.buffer instanceof ArrayBuffer) | |
}), | |
n(ArrayBuffer.prototype, ft, "ArrayBuffer")), | |
"DataView"in t && n(DataView.prototype, ft, "DataView"), | |
n(JSON, ft, "JSON"), | |
n(ot, it, function() { | |
return this | |
}), | |
function() { | |
function r(t) { | |
var e = { | |
"[[value]]": !1 | |
} | |
, r = u(); | |
o(r, "[[Promise]]", t), | |
o(r, "[[AlreadyResolved]]", e); | |
var n = i(); | |
return o(n, "[[Promise]]", t), | |
o(n, "[[AlreadyResolved]]", e), | |
{ | |
"[[Resolve]]": r, | |
"[[Reject]]": n | |
} | |
} | |
function i() { | |
var t = function(e) { | |
var r = t["[[Promise]]"] | |
, n = t["[[AlreadyResolved]]"]; | |
return n["[[value]]"] ? C : (o(n, "[[value]]", !0), | |
v(r, e)) | |
}; | |
return t | |
} | |
function u() { | |
var t = function(e) { | |
var r = t["[[Promise]]"] | |
, n = t["[[AlreadyResolved]]"]; | |
if (n["[[value]]"]) | |
return C; | |
if (o(n, "[[value]]", !0), | |
h(e, r)) { | |
var i = TypeError(); | |
return v(r, i) | |
} | |
if ("object" !== a(e)) | |
return c(r, e); | |
try { | |
var u = e.then | |
} catch (u) { | |
return v(r, u) | |
} | |
return l(u) ? (T("PromiseJobs", b, [r, e, u]), | |
C) : c(r, e) | |
}; | |
return t | |
} | |
function c(t, e) { | |
var r = t["[[PromiseFulfillReactions]]"]; | |
return o(t, "[[PromiseResult]]", e), | |
o(t, "[[PromiseFulfillReactions]]", C), | |
o(t, "[[PromiseRejectReactions]]", C), | |
o(t, "[[PromiseState]]", "fulfilled"), | |
d(r, e) | |
} | |
function s(t) { | |
return f(C, t) | |
} | |
function f(t, e) { | |
var r = {}; | |
o(r, "[[Promise]]", t), | |
o(r, "[[Resolve]]", C), | |
o(r, "[[Reject]]", C); | |
var n = p(); | |
o(n, "[[Capability]]", r); | |
var i = t = new e(n); | |
if (o(r, "[[Promise]]", t), | |
!l(r["[[Resolve]]"])) | |
throw TypeError(); | |
if (!l(r["[[Reject]]"])) | |
throw TypeError(); | |
if ("object" === a(i) && !h(t, i)) | |
throw TypeError(); | |
return r | |
} | |
function p() { | |
var t = function(e, r) { | |
var n = t["[[Capability]]"]; | |
if (n["[[Resolve]]"] !== C) | |
throw TypeError(); | |
if (n["[[Reject]]"] !== C) | |
throw TypeError(); | |
return o(n, "[[Resolve]]", e), | |
o(n, "[[Reject]]", r), | |
C | |
}; | |
return t | |
} | |
function y(t) { | |
return "object" === a(t) && ("[[PromiseState]]"in t && t["[[PromiseState]]"] !== C) | |
} | |
function v(t, e) { | |
var r = t["[[PromiseRejectReactions]]"]; | |
return o(t, "[[PromiseResult]]", e), | |
o(t, "[[PromiseFulfillReactions]]", C), | |
o(t, "[[PromiseRejectReactions]]", C), | |
o(t, "[[PromiseState]]", "rejected"), | |
d(r, e) | |
} | |
function d(t, e) { | |
for (var r = 0, n = t.length; r < n; ++r) | |
T("PromiseJobs", m, [t[r], e]); | |
return C | |
} | |
function m(t, e) { | |
var r, n, o = t["[[Capabilities]]"], i = t["[[Handler]]"]; | |
try { | |
if ("Identity" === i) | |
r = e; | |
else { | |
if ("Thrower" === i) | |
throw e; | |
r = i.call(C, e) | |
} | |
} catch (r) { | |
return n = o["[[Reject]]"].call(C, r), | |
void j(n) | |
} | |
j(n = o["[[Resolve]]"].call(C, r)) | |
} | |
function b(t, e, n) { | |
var o = r(t); | |
try { | |
var i = n.call(e, o["[[Resolve]]"], o["[[Reject]]"]) | |
} catch (i) { | |
return void j(o["[[Reject]]"].call(C, i)) | |
} | |
j(i) | |
} | |
function E(t) { | |
var e = { | |
configurable: !1, | |
enumerable: !1, | |
writable: !0, | |
value: C | |
}; | |
Object.defineProperty(this, "[[PromiseState]]", e), | |
Object.defineProperty(this, "[[PromiseConstructor]]", e), | |
Object.defineProperty(this, "[[PromiseResult]]", e), | |
Object.defineProperty(this, "[[PromiseFulfillReactions]]", e), | |
Object.defineProperty(this, "[[PromiseRejectReactions]]", e); | |
var r = this; | |
if ("object" !== a(r)) | |
throw new TypeError; | |
if (!("[[PromiseState]]"in r)) | |
throw TypeError(); | |
if (r["[[PromiseState]]"] !== C) | |
throw TypeError(); | |
if (!l(t)) | |
throw TypeError(); | |
return o(r, "[[PromiseConstructor]]", E), | |
O(r, t) | |
} | |
function O(t, e) { | |
o(t, "[[PromiseState]]", "pending"), | |
o(t, "[[PromiseFulfillReactions]]", []), | |
o(t, "[[PromiseRejectReactions]]", []); | |
var n = r(t); | |
try { | |
var i = e.call(C, n["[[Resolve]]"], n["[[Reject]]"]) | |
} catch (i) { | |
n["[[Reject]]"].call(C, i) | |
} | |
return t | |
} | |
function _() { | |
var t = function(e) { | |
var r = t["[[AlreadyCalled]]"]; | |
if (r.value) | |
return C; | |
r.value = !0; | |
var n = t["[[Index]]"] | |
, o = t["[[Values]]"] | |
, i = t["[[Capabilities]]"] | |
, a = t["[[RemainingElements]]"]; | |
try { | |
o[n] = e | |
} catch (u) { | |
return i["[[Reject]]"].call(C, u), | |
i["[[Promise]]"] | |
} | |
return a.value -= 1, | |
0 === a.value ? i["[[Resolve]]"].call(C, o) : C | |
}; | |
return t | |
} | |
n(E, "all", function(t) { | |
var r = e(this) | |
, n = s(r); | |
try { | |
var i = g(t) | |
} catch (y) { | |
return n["[[Reject]]"].call(C, y), | |
n["[[Promise]]"] | |
} | |
for (var a = [], u = { | |
value: 1 | |
}, c = 0; ; ) { | |
try { | |
var f = S(i) | |
} catch (y) { | |
return n["[[Reject]]"].call(C, y), | |
n["[[Promise]]"] | |
} | |
if (!f) { | |
if (u.value -= 1, | |
0 === u.value) | |
n["[[Resolve]]"].apply(C, a); | |
return n["[[Promise]]"] | |
} | |
try { | |
var l = w(f) | |
} catch (y) { | |
return n["[[Reject]]"].call(C, y), | |
n["[[Promise]]"] | |
} | |
try { | |
var p = r.resolve(l) | |
} catch (y) { | |
return n["[[Reject]]"].call(C, y), | |
n["[[Promise]]"] | |
} | |
var h = _(); | |
o(h, "[[AlreadyCalled]]", { | |
value: !1 | |
}), | |
o(h, "[[Index]]", c), | |
o(h, "[[Values]]", a), | |
o(h, "[[Capabilities]]", n), | |
o(h, "[[RemainingElements]]", u), | |
u.value += 1; | |
try { | |
p.then(h, n["[[Reject]]"]) | |
} catch (y) { | |
return n["[[Reject]]"].call(C, y), | |
n["[[Promise]]"] | |
} | |
c += 1 | |
} | |
}), | |
E.prototype = {}, | |
n(E, "race", function(t) { | |
var r = e(this) | |
, n = s(r); | |
try { | |
var o = g(t) | |
} catch (c) { | |
return n["[[Reject]]"].call(C, c), | |
n["[[Promise]]"] | |
} | |
for (; ; ) { | |
try { | |
var i = S(o) | |
} catch (c) { | |
return n["[[Reject]]"].call(C, c), | |
n["[[Promise]]"] | |
} | |
if (!i) | |
return n["[[Promise]]"]; | |
try { | |
var a = w(i) | |
} catch (c) { | |
return n["[[Reject]]"].call(C, c), | |
n["[[Promise]]"] | |
} | |
try { | |
var u = r.resolve(a) | |
} catch (c) { | |
return n["[[Reject]]"].call(C, c), | |
n["[[Promise]]"] | |
} | |
try { | |
u.then(n["[[Resolve]]"], n["[[Reject]]"]) | |
} catch (c) { | |
return n["[[Reject]]"].call(C, c), | |
n["[[Promise]]"] | |
} | |
} | |
}), | |
n(E, "reject", function(t) { | |
var r = s(e(this)); | |
r["[[Reject]]"].call(C, t); | |
return r["[[Promise]]"] | |
}), | |
n(E, "resolve", function(t) { | |
var r = e(this); | |
if (y(t) && h(t["[[PromiseConstructor]]"], r)) | |
return t; | |
var n = s(r); | |
n["[[Resolve]]"].call(C, t); | |
return n["[[Promise]]"] | |
}), | |
n(E.prototype, "catch", function(t) { | |
return this.then(C, t) | |
}), | |
E.prototype.constructor = E, | |
n(E.prototype, "then", function(t, e) { | |
var r = this; | |
if (!y(r)) | |
throw TypeError(); | |
l(t) || (t = "Identity"), | |
l(e) || (e = "Thrower"); | |
var n = s(r.constructor) | |
, o = { | |
"[[Capabilities]]": n, | |
"[[Handler]]": t | |
} | |
, i = { | |
"[[Capabilities]]": n, | |
"[[Handler]]": e | |
}; | |
return "pending" === r["[[PromiseState]]"] ? (r["[[PromiseFulfillReactions]]"].push(o), | |
r["[[PromiseRejectReactions]]"].push(i)) : "fulfilled" === r["[[PromiseState]]"] ? T("PromiseJobs", m, [o, r["[[PromiseResult]]"]]) : "rejected" === r["[[PromiseState]]"] && T("PromiseJobs", m, [i, r["[[PromiseResult]]"]]), | |
n["[[Promise]]"] | |
}), | |
"Promise"in t && !I || (t.Promise = E), | |
"cast"in t.Promise && (t.Promise.resolve = t.Promise.cast) | |
}(), | |
n(Promise.prototype, ft, "Promise"), | |
"Reflect"in t && !I || (t.Reflect = {}), | |
n(Reflect, "apply", function(t, e, r) { | |
if (!l(t)) | |
throw TypeError(); | |
return Function.prototype.apply.call(t, e, r) | |
}), | |
n(Reflect, "construct", function(t, e) { | |
return __cons(t, e) | |
}), | |
n(Reflect, "defineProperty", function(t, e, r) { | |
try { | |
return Object.defineProperty(t, e, r), | |
!0 | |
} catch (n) { | |
return !1 | |
} | |
}), | |
n(Reflect, "deleteProperty", function(t, e) { | |
try { | |
return delete t[e], | |
!b(t, e) | |
} catch (r) { | |
return !1 | |
} | |
}), | |
n(Reflect, "enumerate", function(t) { | |
return _(t = s(t)) | |
}), | |
n(Reflect, "get", function(t, e, n) { | |
t = s(t), | |
e = String(e), | |
n = n === C ? t : s(n); | |
var o = r(t, e); | |
return o && "get"in o ? Function.prototype.call.call(o.get, n) : t[e] | |
}), | |
n(Reflect, "getOwnPropertyDescriptor", Object.getOwnPropertyDescriptor), | |
n(Reflect, "getPrototypeOf", Object.getPrototypeOf), | |
n(Reflect, "has", function(t, e) { | |
return String(e)in s(t) | |
}), | |
n(Reflect, "isExtensible", Object.isExtensible), | |
n(Reflect, "ownKeys", function(t) { | |
var e = s(t); | |
return Object.getOwnPropertyNames(e) | |
}), | |
n(Reflect, "preventExtensions", function(t) { | |
try { | |
return Object.preventExtensions(t), | |
!0 | |
} catch (e) { | |
return !1 | |
} | |
}), | |
n(Reflect, "set", function(t, e, n, o) { | |
t = s(t), | |
e = String(e), | |
o = o === C ? t : s(o); | |
var i = r(t, e); | |
try { | |
return i && "set"in i ? Function.prototype.call.call(i.set, o, n) : t[e] = n, | |
!0 | |
} catch (a) { | |
return !1 | |
} | |
}), | |
n(Reflect, "setPrototypeOf", function(t, e) { | |
try { | |
return t.__proto__ = e, | |
Reflect.getPrototypeOf(t) === e | |
} catch (r) { | |
return !1 | |
} | |
}) | |
}(self), | |
function(t) { | |
"use strict"; | |
function e(t) { | |
return t = Number(t), | |
a(t) ? 0 : 0 === t || t === Infinity || t === -Infinity ? t : (t < 0 ? -1 : 1) * c(u(t)) | |
} | |
function r(t) { | |
if (null === t || t === i) | |
throw TypeError(); | |
return Object(t) | |
} | |
function n(t) { | |
var r = e(t); | |
return r <= 0 ? 0 : s(r, 9007199254740991) | |
} | |
function o(t, e) { | |
if (typeof t != typeof e) | |
return !1; | |
switch (typeof t) { | |
case "undefined": | |
return !0; | |
case "number": | |
return t !== t && e !== e || t === e; | |
case "boolean": | |
case "string": | |
case "object": | |
default: | |
return t === e | |
} | |
} | |
var i = void 0 | |
, a = t.isNaN | |
, u = Math.abs | |
, c = Math.floor | |
, s = (Math.max, | |
Math.min); | |
!function(t, e, r, n) { | |
e in t && !n || ("function" == typeof r ? Object.defineProperty(t, e, { | |
value: r, | |
configurable: !0, | |
enumerable: !1, | |
writable: !0 | |
}) : Object.defineProperty(t, e, { | |
value: r, | |
configurable: !1, | |
enumerable: !1, | |
writable: !1 | |
})) | |
}(Array.prototype, "includes", function(t) { | |
var i = arguments[1] | |
, a = r(this) | |
, u = n(a.length); | |
if (0 === u) | |
return !1; | |
var c = e(i); | |
if (c >= 0) | |
var s = c; | |
else | |
(s = u + c) < 0 && (s = 0); | |
for (; s < u; ) { | |
a[s]; | |
if (o(a[s], t)) | |
return !0; | |
s += 1 | |
} | |
return !1 | |
}) | |
}(this), | |
function(t) { | |
"use strict"; | |
function e(t, e, r, n) { | |
e in t && !n || ("function" == typeof r ? Object.defineProperty(t, e, { | |
value: r, | |
configurable: !0, | |
enumerable: !1, | |
writable: !0 | |
}) : Object.defineProperty(t, e, { | |
value: r, | |
configurable: !1, | |
enumerable: !1, | |
writable: !1 | |
})) | |
} | |
function r(t) { | |
return t = Number(t), | |
c(t) ? 0 : 0 === t || t === Infinity || t === -Infinity ? t : (t < 0 ? -1 : 1) * f(s(t)) | |
} | |
function n(t) { | |
if (null === t || t === u) | |
throw TypeError(); | |
return Object(t) | |
} | |
function o(t) { | |
var e = r(t); | |
return e <= 0 ? 0 : l(e, 9007199254740991) | |
} | |
function i(t, e, r) { | |
Object.defineProperty(t, e, { | |
value: r, | |
writable: !0, | |
enumerable: !0, | |
configurable: !0 | |
}) | |
} | |
function a(t, e) { | |
var r = []; | |
return Object.keys(t).forEach(function(n) { | |
var o = Object.getOwnPropertyDescriptor(t, n); | |
if (o && o.enumerable) | |
if ("key" === e) | |
r.push(n); | |
else { | |
var i = t[n]; | |
"value" === e ? r.push(i) : r.push([n, i]) | |
} | |
}), | |
r | |
} | |
var u = void 0 | |
, c = t.isNaN | |
, s = Math.abs | |
, f = Math.floor | |
, l = Math.min; | |
e(Object, "entries", function(t) { | |
return a(n(t), "key+value") | |
}), | |
e(Object, "getOwnPropertyDescriptors", function(t) { | |
for (var e = n(t), r = Object.getOwnPropertyNames(e), o = {}, a = 0; a < r.length; ++a) { | |
var u = r[a]; | |
i(o, u, Object.getOwnPropertyDescriptor(e, u)) | |
} | |
return o | |
}), | |
e(Object, "values", function(t) { | |
return a(n(t), "value") | |
}), | |
e(String.prototype, "padEnd", function(t) { | |
var e = arguments[1] | |
, r = String(this) | |
, n = r.length; | |
if (e === u) | |
var i = ""; | |
else | |
i = String(e); | |
"" === i && (i = " "); | |
var a = o(t); | |
if (a <= n) | |
return r; | |
for (var c = a - n, s = ""; s.length < c; ) | |
s += i; | |
return r + s.substring(0, c) | |
}), | |
e(String.prototype, "padStart", function(t) { | |
var e = arguments[1] | |
, r = String(this) | |
, n = r.length; | |
if (e === u) | |
var i = ""; | |
else | |
i = String(e); | |
"" === i && (i = " "); | |
var a = o(t); | |
if (a <= n) | |
return r; | |
for (var c = a - n, s = ""; s.length < c; ) | |
s += i; | |
return s.substring(0, c) + r | |
}) | |
}(this), | |
function(t) { | |
"use strict"; | |
"window"in t && "document"in t && ("head"in document || (document.head = document.getElementsByTagName("head")[0]), | |
["abbr", "article", "aside", "audio", "bdi", "canvas", "data", "datalist", "details", "dialog", "figcaption", "figure", "footer", "header", "hgroup", "main", "mark", "meter", "nav", "output", "picture", "progress", "section", "summary", "template", "time", "video"].forEach(function(t) { | |
document.createElement(t) | |
}), | |
!("dataset"in document.createElement("span")) && "Element"in t && Element.prototype && Object.defineProperty && Object.defineProperty(Element.prototype, "dataset", { | |
get: function() { | |
for (var t = Object.create(null), e = 0; e < this.attributes.length; ++e) { | |
var r = this.attributes[e]; | |
r.specified && "data-" === r.name.substring(0, 5) && function(e, r) { | |
var n = r.replace(/-([a-z])/g, function(t, e) { | |
return e.toUpperCase() | |
}); | |
t[n] = e.getAttribute("data-" + r), | |
Object.defineProperty(t, n, { | |
get: function() { | |
return e.getAttribute("data-" + r) | |
}, | |
set: function(t) { | |
e.setAttribute("data-" + r, t) | |
} | |
}) | |
}(this, r.name.substring(5)) | |
} | |
return t | |
} | |
}), | |
function() { | |
if (!("atob"in t && "btoa"in t)) { | |
var e = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="; | |
t.atob = function(t) { | |
var r = 0 | |
, n = [] | |
, o = 0 | |
, i = 0; | |
if ((t = (t = String(t)).replace(/\s/g, "")).length % 4 == 0 && (t = t.replace(/=+$/, "")), | |
t.length % 4 == 1) | |
throw Error("InvalidCharacterError"); | |
if (/[^+/0-9A-Za-z]/.test(t)) | |
throw Error("InvalidCharacterError"); | |
for (; r < t.length; ) | |
o = o << 6 | e.indexOf(t.charAt(r)), | |
24 === (i += 6) && (n.push(String.fromCharCode(o >> 16 & 255)), | |
n.push(String.fromCharCode(o >> 8 & 255)), | |
n.push(String.fromCharCode(255 & o)), | |
i = 0, | |
o = 0), | |
r += 1; | |
return 12 === i ? (o >>= 4, | |
n.push(String.fromCharCode(255 & o))) : 18 === i && (o >>= 2, | |
n.push(String.fromCharCode(o >> 8 & 255)), | |
n.push(String.fromCharCode(255 & o))), | |
n.join("") | |
} | |
, | |
t.btoa = function(t) { | |
t = String(t); | |
var r, n, o, i, a, u, c, s = 0, f = []; | |
if (/[^\x00-\xFF]/.test(t)) | |
throw Error("InvalidCharacterError"); | |
for (; s < t.length; ) | |
i = (r = t.charCodeAt(s++)) >> 2, | |
a = (3 & r) << 4 | (n = t.charCodeAt(s++)) >> 4, | |
u = (15 & n) << 2 | (o = t.charCodeAt(s++)) >> 6, | |
c = 63 & o, | |
s === t.length + 2 ? (u = 64, | |
c = 64) : s === t.length + 1 && (c = 64), | |
f.push(e.charAt(i), e.charAt(a), e.charAt(u), e.charAt(c)); | |
return f.join("") | |
} | |
} | |
}(), | |
function() { | |
function e(t) { | |
return t.offsetWidth > 0 && t.offsetHeight > 0 | |
} | |
function r() { | |
var t = o; | |
o = Object.create(null), | |
a = -1, | |
Object.keys(t).forEach(function(r) { | |
var n = t[r]; | |
n.element && !e(n.element) || n.callback(Date.now()) | |
}) | |
} | |
if (!("requestAnimationFrame"in t)) { | |
var n = 60 | |
, o = Object.create(null) | |
, i = 0 | |
, a = -1; | |
t.requestAnimationFrame = function(e, u) { | |
var c = ++i; | |
return o[c] = { | |
callback: e, | |
element: u | |
}, | |
-1 === a && (a = t.setTimeout(r, 1e3 / n)), | |
c | |
} | |
, | |
t.cancelAnimationFrame = function(e) { | |
delete o[e], | |
0 === Object.keys(o).length && (t.clearTimeout(a), | |
a = -1) | |
} | |
} | |
}()) | |
}(self), | |
function(t) { | |
"use strict"; | |
function e(t, e) { | |
t && Object.keys(e).forEach(function(r) { | |
if (!(r in t || r in t.prototype)) | |
try { | |
Object.defineProperty(t.prototype, r, Object.getOwnPropertyDescriptor(e, r)) | |
} catch (n) { | |
t[r] = e[r] | |
} | |
}) | |
} | |
function r(t) { | |
var e = null; | |
return 1 === (t = t.map(function(t) { | |
return t instanceof Node ? t : document.createTextNode(t) | |
})).length ? e = t[0] : (e = document.createDocumentFragment(), | |
t.forEach(function(t) { | |
e.appendChild(t) | |
})), | |
e | |
} | |
if ("window"in t && "document"in t) { | |
document.querySelectorAll || (document.querySelectorAll = function(t) { | |
var e, r = document.createElement("style"), n = []; | |
for (document.documentElement.firstChild.appendChild(r), | |
document._qsa = [], | |
r.styleSheet.cssText = t + "{x-qsa:expression(document._qsa && document._qsa.push(this))}", | |
window.scrollBy(0, 0), | |
r.parentNode.removeChild(r); document._qsa.length; ) | |
(e = document._qsa.shift()).style.removeAttribute("x-qsa"), | |
n.push(e); | |
return document._qsa = null, | |
n | |
} | |
), | |
document.querySelector || (document.querySelector = function(t) { | |
var e = document.querySelectorAll(t); | |
return e.length ? e[0] : null | |
} | |
), | |
document.getElementsByClassName || (document.getElementsByClassName = function(t) { | |
return t = String(t).replace(/^|\s+/g, "."), | |
document.querySelectorAll(t) | |
} | |
), | |
t.Node = t.Node || function() { | |
throw TypeError("Illegal constructor") | |
} | |
, | |
[["ELEMENT_NODE", 1], ["ATTRIBUTE_NODE", 2], ["TEXT_NODE", 3], ["CDATA_SECTION_NODE", 4], ["ENTITY_REFERENCE_NODE", 5], ["ENTITY_NODE", 6], ["PROCESSING_INSTRUCTION_NODE", 7], ["COMMENT_NODE", 8], ["DOCUMENT_NODE", 9], ["DOCUMENT_TYPE_NODE", 10], ["DOCUMENT_FRAGMENT_NODE", 11], ["NOTATION_NODE", 12]].forEach(function(e) { | |
e[0]in t.Node || (t.Node[e[0]] = e[1]) | |
}), | |
t.DOMException = t.DOMException || function() { | |
throw TypeError("Illegal constructor") | |
} | |
, | |
[["INDEX_SIZE_ERR", 1], ["DOMSTRING_SIZE_ERR", 2], ["HIERARCHY_REQUEST_ERR", 3], ["WRONG_DOCUMENT_ERR", 4], ["INVALID_CHARACTER_ERR", 5], ["NO_DATA_ALLOWED_ERR", 6], ["NO_MODIFICATION_ALLOWED_ERR", 7], ["NOT_FOUND_ERR", 8], ["NOT_SUPPORTED_ERR", 9], ["INUSE_ATTRIBUTE_ERR", 10], ["INVALID_STATE_ERR", 11], ["SYNTAX_ERR", 12], ["INVALID_MODIFICATION_ERR", 13], ["NAMESPACE_ERR", 14], ["INVALID_ACCESS_ERR", 15]].forEach(function(e) { | |
e[0]in t.DOMException || (t.DOMException[e[0]] = e[1]) | |
}), | |
function() { | |
function e(t, e, r) { | |
if ("function" == typeof e) { | |
"DOMContentLoaded" === t && (t = "load"); | |
var n = this | |
, o = function(t) { | |
t._timeStamp = Date.now(), | |
t._currentTarget = n, | |
e.call(this, t), | |
t._currentTarget = null | |
}; | |
this["_" + t + e] = o, | |
this.attachEvent("on" + t, o) | |
} | |
} | |
function r(t, e, r) { | |
if ("function" == typeof e) { | |
"DOMContentLoaded" === t && (t = "load"); | |
var n = this["_" + t + e]; | |
n && (this.detachEvent("on" + t, n), | |
this["_" + t + e] = null) | |
} | |
} | |
"Element"in t && !Element.prototype.addEventListener && Object.defineProperty && (Event.CAPTURING_PHASE = 1, | |
Event.AT_TARGET = 2, | |
Event.BUBBLING_PHASE = 3, | |
Object.defineProperties(Event.prototype, { | |
CAPTURING_PHASE: { | |
get: function() { | |
return 1 | |
} | |
}, | |
AT_TARGET: { | |
get: function() { | |
return 2 | |
} | |
}, | |
BUBBLING_PHASE: { | |
get: function() { | |
return 3 | |
} | |
}, | |
target: { | |
get: function() { | |
return this.srcElement | |
} | |
}, | |
currentTarget: { | |
get: function() { | |
return this._currentTarget | |
} | |
}, | |
eventPhase: { | |
get: function() { | |
return this.srcElement === this.currentTarget ? Event.AT_TARGET : Event.BUBBLING_PHASE | |
} | |
}, | |
bubbles: { | |
get: function() { | |
switch (this.type) { | |
case "click": | |
case "dblclick": | |
case "mousedown": | |
case "mouseup": | |
case "mouseover": | |
case "mousemove": | |
case "mouseout": | |
case "mousewheel": | |
case "keydown": | |
case "keypress": | |
case "keyup": | |
case "resize": | |
case "scroll": | |
case "select": | |
case "change": | |
case "submit": | |
case "reset": | |
return !0 | |
} | |
return !1 | |
} | |
}, | |
cancelable: { | |
get: function() { | |
switch (this.type) { | |
case "click": | |
case "dblclick": | |
case "mousedown": | |
case "mouseup": | |
case "mouseover": | |
case "mouseout": | |
case "mousewheel": | |
case "keydown": | |
case "keypress": | |
case "keyup": | |
case "submit": | |
return !0 | |
} | |
return !1 | |
} | |
}, | |
timeStamp: { | |
get: function() { | |
return this._timeStamp | |
} | |
}, | |
stopPropagation: { | |
value: function() { | |
this.cancelBubble = !0 | |
} | |
}, | |
preventDefault: { | |
value: function() { | |
this.returnValue = !1 | |
} | |
}, | |
defaultPrevented: { | |
get: function() { | |
return !1 === this.returnValue | |
} | |
} | |
}), | |
[Window, HTMLDocument, Element].forEach(function(t) { | |
t.prototype.addEventListener = e, | |
t.prototype.removeEventListener = r | |
})) | |
}(), | |
function() { | |
function e(t, e) { | |
e = e || { | |
bubbles: !1, | |
cancelable: !1, | |
detail: undefined | |
}; | |
var r = document.createEvent("CustomEvent"); | |
return r.initCustomEvent(t, e.bubbles, e.cancelable, e.detail), | |
r | |
} | |
"CustomEvent"in t && "function" == typeof t.CustomEvent || (e.prototype = t.Event.prototype, | |
t.CustomEvent = e) | |
}(), | |
window.addEvent = function(t, e, r) { | |
t.addEventListener ? t.addEventListener(e, r, !1) : t.attachEvent && (t["e" + e + r] = r, | |
t[e + r] = function() { | |
var n = window.event; | |
n.currentTarget = t, | |
n.preventDefault = function() { | |
n.returnValue = !1 | |
} | |
, | |
n.stopPropagation = function() { | |
n.cancelBubble = !0 | |
} | |
, | |
n.target = n.srcElement, | |
n.timeStamp = Date.now(), | |
t["e" + e + r].call(this, n) | |
} | |
, | |
t.attachEvent("on" + e, t[e + r])) | |
} | |
, | |
window.removeEvent = function(t, e, r) { | |
t.removeEventListener ? t.removeEventListener(e, r, !1) : t.detachEvent && (t.detachEvent("on" + e, t[e + r]), | |
t[e + r] = null, | |
t["e" + e + r] = null) | |
} | |
, | |
function() { | |
function e(t, e) { | |
function r(t) { | |
return t.length ? t.split(/\s+/g) : [] | |
} | |
function n(t, e) { | |
var n = r(e) | |
, o = n.indexOf(t); | |
return -1 !== o && n.splice(o, 1), | |
n.join(" ") | |
} | |
if (Object.defineProperties(this, { | |
length: { | |
get: function() { | |
return r(t[e]).length | |
} | |
}, | |
item: { | |
value: function(n) { | |
var o = r(t[e]); | |
return 0 <= n && n < o.length ? o[n] : null | |
} | |
}, | |
contains: { | |
value: function(n) { | |
if (0 === (n = String(n)).length) | |
throw SyntaxError(); | |
if (/\s/.test(n)) | |
throw Error("InvalidCharacterError"); | |
return -1 !== r(t[e]).indexOf(n) | |
} | |
}, | |
add: { | |
value: function() { | |
var n = Array.prototype.slice.call(arguments).map(String); | |
if (n.some(function(t) { | |
return 0 === t.length | |
})) | |
throw SyntaxError(); | |
if (n.some(function(t) { | |
return /\s/.test(t) | |
})) | |
throw Error("InvalidCharacterError"); | |
try { | |
var o = t[e] | |
, i = r(o); | |
if (0 === (n = n.filter(function(t) { | |
return -1 === i.indexOf(t) | |
})).length) | |
return; | |
0 === o.length || /\s$/.test(o) || (o += " "), | |
o += n.join(" "), | |
t[e] = o | |
} finally { | |
var a = r(t[e]).length; | |
this.length !== a && (this.length = a) | |
} | |
} | |
}, | |
remove: { | |
value: function() { | |
var o = Array.prototype.slice.call(arguments).map(String); | |
if (o.some(function(t) { | |
return 0 === t.length | |
})) | |
throw SyntaxError(); | |
if (o.some(function(t) { | |
return /\s/.test(t) | |
})) | |
throw Error("InvalidCharacterError"); | |
try { | |
var i = t[e]; | |
o.forEach(function(t) { | |
i = n(t, i) | |
}), | |
t[e] = i | |
} finally { | |
var a = r(t[e]).length; | |
this.length !== a && (this.length = a) | |
} | |
} | |
}, | |
toggle: { | |
value: function(o) { | |
var i = arguments[1]; | |
try { | |
if (0 === (o = String(o)).length) | |
throw SyntaxError(); | |
if (/\s/.test(o)) | |
throw Error("InvalidCharacterError"); | |
var a = r(t[e]).indexOf(o); | |
if (-1 !== a && (!i || void 0 === i)) | |
return t[e] = n(o, t[e]), | |
!1; | |
if (-1 !== a && i) | |
return !0; | |
var u = t[e]; | |
return 0 === u.length || /\s$/.test(u) || (u += " "), | |
u += o, | |
t[e] = u, | |
!0 | |
} finally { | |
var c = r(t[e]).length; | |
this.length !== c && (this.length = c) | |
} | |
} | |
}, | |
toString: { | |
value: function() { | |
return t[e] | |
} | |
} | |
}), | |
"length"in this) | |
for (var o = 0; o < 100; ++o) | |
Object.defineProperty(this, String(o), { | |
get: function(t) { | |
return function() { | |
return this.item(t) | |
} | |
}(o) | |
}); | |
else | |
this.length = r(t[e]).length | |
} | |
function r(e, r) { | |
"Element"in t && Element.prototype && Object.defineProperty && Object.defineProperty(Element.prototype, e, { | |
get: r | |
}) | |
} | |
"classList"in document.createElement("span") ? window.getClassList = function(t) { | |
return t.classList | |
} | |
: (window.getClassList = function(t) { | |
return new e(t,"className") | |
} | |
, | |
r("classList", function() { | |
return new e(this,"className") | |
})), | |
"relList"in document.createElement("link") ? window.getRelList = function(t) { | |
return t.relList | |
} | |
: (window.getRelList = function(t) { | |
return new e(t,"rel") | |
} | |
, | |
r("relList", function() { | |
return new e(this,"rel") | |
})), | |
function() { | |
if ("DOMTokenList"in t) { | |
var e = document.createElement("span"); | |
"classList"in e && (e.classList.toggle("x", !1), | |
e.classList.contains("x") && (t.DOMTokenList.prototype.toggle = function(t) { | |
var e = arguments[1]; | |
if (e === undefined) { | |
var r = !this.contains(t); | |
return this[r ? "add" : "remove"](t), | |
r | |
} | |
return e = !!e, | |
this[e ? "add" : "remove"](t), | |
e | |
} | |
)) | |
} | |
}(), | |
"previousElementSibling"in document.documentElement || r("previousElementSibling", function() { | |
for (var t = this.previousSibling; t && t.nodeType !== Node.ELEMENT_NODE; ) | |
t = t.previousSibling; | |
return t | |
}), | |
"nextElementSibling"in document.documentElement || r("nextElementSibling", function() { | |
for (var t = this.nextSibling; t && t.nodeType !== Node.ELEMENT_NODE; ) | |
t = t.nextSibling; | |
return t | |
}) | |
}(), | |
"Element"in t && !Element.prototype.matches && (Element.prototype.msMatchesSelector ? Element.prototype.matches = Element.prototype.msMatchesSelector : Element.prototype.oMatchesSelector ? Element.prototype.matches = Element.prototype.oMatchesSelector : Element.prototype.mozMatchesSelector ? Element.prototype.matches = Element.prototype.mozMatchesSelector : Element.prototype.webkitMatchesSelector ? Element.prototype.matches = Element.prototype.webkitMatchesSelector : document.querySelectorAll && (Element.prototype.matches = function(t) { | |
for (var e = (this.document || this.ownerDocument).querySelectorAll(t), r = e.length; --r >= 0 && e.item(r) !== this; ) | |
; | |
return r > -1 | |
} | |
)), | |
window.Element && !Element.prototype.closest && (Element.prototype.closest = function(t) { | |
var e, r = (this.document || this.ownerDocument).querySelectorAll(t), n = this; | |
do { | |
for (e = r.length; --e >= 0 && r.item(e) !== n; ) | |
; | |
} while (e < 0 && (n = n.parentElement));return n | |
} | |
); | |
var n = { | |
prepend: function() { | |
var t = [].slice.call(arguments); | |
t = r(t), | |
this.insertBefore(t, this.firstChild) | |
}, | |
append: function() { | |
var t = [].slice.call(arguments); | |
t = r(t), | |
this.appendChild(t) | |
} | |
}; | |
e(t.Document || t.HTMLDocument, n), | |
e(t.DocumentFragment, n), | |
e(t.Element, n); | |
var o = { | |
before: function() { | |
var t = [].slice.call(arguments) | |
, e = this.parentNode; | |
if (e) { | |
for (var n = this.previousSibling; -1 !== t.indexOf(n); ) | |
n = n.previousSibling; | |
var o = r(t); | |
e.insertBefore(o, n ? n.nextSibling : e.firstChild) | |
} | |
}, | |
after: function() { | |
var t = [].slice.call(arguments) | |
, e = this.parentNode; | |
if (e) { | |
for (var n = this.nextSibling; -1 !== t.indexOf(n); ) | |
n = n.nextSibling; | |
var o = r(t); | |
e.insertBefore(o, n) | |
} | |
}, | |
replaceWith: function() { | |
var t = [].slice.call(arguments) | |
, e = this.parentNode; | |
if (e) { | |
for (var n = this.nextSibling; -1 !== t.indexOf(n); ) | |
n = n.nextSibling; | |
var o = r(t); | |
this.parentNode === e ? e.replaceChild(o, this) : e.insertBefore(o, n) | |
} | |
}, | |
remove: function() { | |
this.parentNode && this.parentNode.removeChild(this) | |
} | |
}; | |
e(t.DocumentType, o), | |
e(t.Element, o), | |
e(t.CharacterData, o) | |
} | |
}(self), | |
function(t) { | |
"use strict"; | |
"window"in t && "document"in t && (t.XMLHttpRequest = t.XMLHttpRequest || function() { | |
try { | |
return new ActiveXObject("Msxml2.XMLHTTP.6.0") | |
} catch (t) {} | |
try { | |
return new ActiveXObject("Msxml2.XMLHTTP.3.0") | |
} catch (t) {} | |
try { | |
return new ActiveXObject("Msxml2.XMLHTTP") | |
} catch (t) {} | |
throw Error("This browser does not support XMLHttpRequest.") | |
} | |
, | |
[["UNSENT", 0], ["OPENED", 1], ["HEADERS_RECEIVED", 2], ["LOADING", 3], ["DONE", 4]].forEach(function(e) { | |
e[0]in t.XMLHttpRequest || (t.XMLHttpRequest[e[0]] = e[1]) | |
}), | |
function() { | |
function e(t) { | |
if (this._data = [], | |
t) | |
for (var e = 0; e < t.elements.length; ++e) { | |
var r = t.elements[e]; | |
"" !== r.name && this.append(r.name, r.value) | |
} | |
} | |
if (!("FormData"in t)) { | |
e.prototype = { | |
append: function(e, r) { | |
if ("Blob"in t && r instanceof t.Blob) | |
throw TypeError("Blob not supported"); | |
e = String(e), | |
this._data.push([e, r]) | |
}, | |
toString: function() { | |
return this._data.map(function(t) { | |
return encodeURIComponent(t[0]) + "=" + encodeURIComponent(t[1]) | |
}).join("&") | |
} | |
}, | |
t.FormData = e; | |
var r = t.XMLHttpRequest.prototype.send; | |
t.XMLHttpRequest.prototype.send = function(t) { | |
return t instanceof e && (this.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"), | |
arguments[0] = t.toString()), | |
r.apply(this, arguments) | |
} | |
} | |
}()) | |
}(self), | |
function(t) { | |
"use strict"; | |
"window"in t && "document"in t && "TextRectangle"in t && !("width"in t.TextRectangle.prototype) && Object.defineProperties(t.TextRectangle.prototype, { | |
width: { | |
get: function() { | |
return this.right - this.left | |
} | |
}, | |
height: { | |
get: function() { | |
return this.bottom - this.top | |
} | |
} | |
}) | |
}(self), | |
function(t) { | |
"use strict"; | |
function e(e) { | |
return !!e && ("Symbol"in t && "iterator"in t.Symbol && "function" == typeof e[Symbol.iterator] || !!Array.isArray(e)) | |
} | |
function r(t) { | |
return "from"in Array ? Array.from(t) : Array.prototype.slice.call(t) | |
} | |
!function() { | |
function n(t) { | |
var e = "" | |
, r = !0; | |
return t.forEach(function(t) { | |
var n = encodeURIComponent(t.name) | |
, o = encodeURIComponent(t.value); | |
r || (e += "&"), | |
e += n + "=" + o, | |
r = !1 | |
}), | |
e.replace(/%20/g, "+") | |
} | |
function o(t, e) { | |
var r = t.split("&"); | |
e && -1 === r[0].indexOf("=") && (r[0] = "=" + r[0]); | |
var n = []; | |
r.forEach(function(t) { | |
if (0 !== t.length) { | |
var e = t.indexOf("="); | |
if (-1 !== e) | |
var r = t.substring(0, e) | |
, o = t.substring(e + 1); | |
else | |
r = t, | |
o = ""; | |
r = r.replace(/\+/g, " "), | |
o = o.replace(/\+/g, " "), | |
n.push({ | |
name: r, | |
value: o | |
}) | |
} | |
}); | |
var o = []; | |
return n.forEach(function(t) { | |
o.push({ | |
name: decodeURIComponent(t.name), | |
value: decodeURIComponent(t.value) | |
}) | |
}), | |
o | |
} | |
function i(t) { | |
if (s) | |
return new f(t); | |
var e = document.createElement("a"); | |
return e.href = t, | |
e | |
} | |
function a(t) { | |
var i = this; | |
this._list = [], | |
t === undefined || null === t || (t instanceof a ? this._list = o(String(t)) : "object" == typeof t && e(t) ? r(t).forEach(function(t) { | |
if (!e(t)) | |
throw TypeError(); | |
var n = r(t); | |
if (2 !== n.length) | |
throw TypeError(); | |
i._list.push({ | |
name: String(n[0]), | |
value: String(n[1]) | |
}) | |
}) : "object" == typeof t && t ? Object.keys(t).forEach(function(e) { | |
i._list.push({ | |
name: String(e), | |
value: String(t[e]) | |
}) | |
}) : ("?" === (t = String(t)).substring(0, 1) && (t = t.substring(1)), | |
this._list = o(t))), | |
this._url_object = null, | |
this._setList = function(t) { | |
u || (i._list = t) | |
} | |
; | |
var u = !1; | |
this._update_steps = function() { | |
u || (u = !0, | |
i._url_object && ("about:" === i._url_object.protocol && -1 !== i._url_object.pathname.indexOf("?") && (i._url_object.pathname = i._url_object.pathname.split("?")[0]), | |
i._url_object.search = n(i._list), | |
u = !1)) | |
} | |
} | |
function u(t, e) { | |
var r = 0; | |
this.next = function() { | |
if (r >= t.length) | |
return { | |
done: !0, | |
value: undefined | |
}; | |
var n = t[r++]; | |
return { | |
done: !1, | |
value: "key" === e ? n.name : "value" === e ? n.value : [n.name, n.value] | |
} | |
} | |
} | |
function c(e, r) { | |
function n() { | |
var t = c.href.replace(/#$|\?$|\?(?=#)/g, ""); | |
c.href !== t && (c.href = t) | |
} | |
function u() { | |
p._setList(c.search ? o(c.search.substring(1)) : []), | |
p._update_steps() | |
} | |
if (!(this instanceof t.URL)) | |
throw new TypeError("Failed to construct 'URL': Please use the 'new' operator."); | |
r && (e = function() { | |
if (s) | |
return new f(e,r).href; | |
var t; | |
try { | |
var n; | |
if ("[object OperaMini]" === Object.prototype.toString.call(window.operamini) ? ((t = document.createElement("iframe")).style.display = "none", | |
document.documentElement.appendChild(t), | |
n = t.contentWindow.document) : document.implementation && document.implementation.createHTMLDocument ? n = document.implementation.createHTMLDocument("") : document.implementation && document.implementation.createDocument ? ((n = document.implementation.createDocument("http://www.w3.org/1999/xhtml", "html", null)).documentElement.appendChild(n.createElement("head")), | |
n.documentElement.appendChild(n.createElement("body"))) : window.ActiveXObject && ((n = new window.ActiveXObject("htmlfile")).write("<head></head><body></body>"), | |
n.close()), | |
!n) | |
throw Error("base not supported"); | |
var o = n.createElement("base"); | |
o.href = r, | |
n.getElementsByTagName("head")[0].appendChild(o); | |
var i = n.createElement("a"); | |
return i.href = e, | |
i.href | |
} finally { | |
t && t.parentNode.removeChild(t) | |
} | |
}()); | |
var c = i(e || "") | |
, l = function() { | |
if (!("defineProperties"in Object)) | |
return !1; | |
try { | |
var t = {}; | |
return Object.defineProperties(t, { | |
prop: { | |
get: function() { | |
return !0 | |
} | |
} | |
}), | |
t.prop | |
} catch (e) { | |
return !1 | |
} | |
}() ? this : document.createElement("a") | |
, p = new a(c.search ? c.search.substring(1) : null); | |
return p._url_object = l, | |
Object.defineProperties(l, { | |
href: { | |
get: function() { | |
return c.href | |
}, | |
set: function(t) { | |
c.href = t, | |
n(), | |
u() | |
}, | |
enumerable: !0, | |
configurable: !0 | |
}, | |
origin: { | |
get: function() { | |
return "origin"in c ? c.origin : this.protocol + "//" + this.host | |
}, | |
enumerable: !0, | |
configurable: !0 | |
}, | |
protocol: { | |
get: function() { | |
return c.protocol | |
}, | |
set: function(t) { | |
c.protocol = t | |
}, | |
enumerable: !0, | |
configurable: !0 | |
}, | |
username: { | |
get: function() { | |
return c.username | |
}, | |
set: function(t) { | |
c.username = t | |
}, | |
enumerable: !0, | |
configurable: !0 | |
}, | |
password: { | |
get: function() { | |
return c.password | |
}, | |
set: function(t) { | |
c.password = t | |
}, | |
enumerable: !0, | |
configurable: !0 | |
}, | |
host: { | |
get: function() { | |
var t = { | |
"http:": /:80$/, | |
"https:": /:443$/, | |
"ftp:": /:21$/ | |
}[c.protocol]; | |
return t ? c.host.replace(t, "") : c.host | |
}, | |
set: function(t) { | |
c.host = t | |
}, | |
enumerable: !0, | |
configurable: !0 | |
}, | |
hostname: { | |
get: function() { | |
return c.hostname | |
}, | |
set: function(t) { | |
c.hostname = t | |
}, | |
enumerable: !0, | |
configurable: !0 | |
}, | |
port: { | |
get: function() { | |
return c.port | |
}, | |
set: function(t) { | |
c.port = t | |
}, | |
enumerable: !0, | |
configurable: !0 | |
}, | |
pathname: { | |
get: function() { | |
return "/" !== c.pathname.charAt(0) ? "/" + c.pathname : c.pathname | |
}, | |
set: function(t) { | |
c.pathname = t | |
}, | |
enumerable: !0, | |
configurable: !0 | |
}, | |
search: { | |
get: function() { | |
return c.search | |
}, | |
set: function(t) { | |
c.search !== t && (c.search = t, | |
n(), | |
u()) | |
}, | |
enumerable: !0, | |
configurable: !0 | |
}, | |
searchParams: { | |
get: function() { | |
return p | |
}, | |
enumerable: !0, | |
configurable: !0 | |
}, | |
hash: { | |
get: function() { | |
return c.hash | |
}, | |
set: function(t) { | |
c.hash = t, | |
n() | |
}, | |
enumerable: !0, | |
configurable: !0 | |
}, | |
toString: { | |
value: function() { | |
return c.toString() | |
}, | |
enumerable: !1, | |
configurable: !0 | |
}, | |
valueOf: { | |
value: function() { | |
return c.valueOf() | |
}, | |
enumerable: !1, | |
configurable: !0 | |
} | |
}), | |
l | |
} | |
var s, f = t.URL; | |
try { | |
if (f) { | |
if ("searchParams"in (s = new t.URL("http://example.com"))) | |
return; | |
"href"in s || (s = undefined) | |
} | |
} catch (p) {} | |
if (Object.defineProperties(a.prototype, { | |
append: { | |
value: function(t, e) { | |
this._list.push({ | |
name: t, | |
value: e | |
}), | |
this._update_steps() | |
}, | |
writable: !0, | |
enumerable: !0, | |
configurable: !0 | |
}, | |
"delete": { | |
value: function(t) { | |
for (var e = 0; e < this._list.length; ) | |
this._list[e].name === t ? this._list.splice(e, 1) : ++e; | |
this._update_steps() | |
}, | |
writable: !0, | |
enumerable: !0, | |
configurable: !0 | |
}, | |
get: { | |
value: function(t) { | |
for (var e = 0; e < this._list.length; ++e) | |
if (this._list[e].name === t) | |
return this._list[e].value; | |
return null | |
}, | |
writable: !0, | |
enumerable: !0, | |
configurable: !0 | |
}, | |
getAll: { | |
value: function(t) { | |
for (var e = [], r = 0; r < this._list.length; ++r) | |
this._list[r].name === t && e.push(this._list[r].value); | |
return e | |
}, | |
writable: !0, | |
enumerable: !0, | |
configurable: !0 | |
}, | |
has: { | |
value: function(t) { | |
for (var e = 0; e < this._list.length; ++e) | |
if (this._list[e].name === t) | |
return !0; | |
return !1 | |
}, | |
writable: !0, | |
enumerable: !0, | |
configurable: !0 | |
}, | |
set: { | |
value: function(t, e) { | |
for (var r = !1, n = 0; n < this._list.length; ) | |
this._list[n].name === t ? r ? this._list.splice(n, 1) : (this._list[n].value = e, | |
r = !0, | |
++n) : ++n; | |
r || this._list.push({ | |
name: t, | |
value: e | |
}), | |
this._update_steps() | |
}, | |
writable: !0, | |
enumerable: !0, | |
configurable: !0 | |
}, | |
entries: { | |
value: function() { | |
return new u(this._list,"key+value") | |
}, | |
writable: !0, | |
enumerable: !0, | |
configurable: !0 | |
}, | |
keys: { | |
value: function() { | |
return new u(this._list,"key") | |
}, | |
writable: !0, | |
enumerable: !0, | |
configurable: !0 | |
}, | |
values: { | |
value: function() { | |
return new u(this._list,"value") | |
}, | |
writable: !0, | |
enumerable: !0, | |
configurable: !0 | |
}, | |
forEach: { | |
value: function(t) { | |
var e = arguments.length > 1 ? arguments[1] : undefined; | |
this._list.forEach(function(r, n) { | |
t.call(e, r.value, r.name) | |
}) | |
}, | |
writable: !0, | |
enumerable: !0, | |
configurable: !0 | |
}, | |
toString: { | |
value: function() { | |
return n(this._list) | |
}, | |
writable: !0, | |
enumerable: !1, | |
configurable: !0 | |
} | |
}), | |
"Symbol"in t && "iterator"in t.Symbol && (Object.defineProperty(a.prototype, t.Symbol.iterator, { | |
value: a.prototype.entries, | |
writable: !0, | |
enumerable: !0, | |
configurable: !0 | |
}), | |
Object.defineProperty(u.prototype, t.Symbol.iterator, { | |
value: function() { | |
return this | |
}, | |
writable: !0, | |
enumerable: !0, | |
configurable: !0 | |
})), | |
f) | |
for (var l in f) | |
f.hasOwnProperty(l) && "function" == typeof f[l] && (c[l] = f[l]); | |
t.URL = c, | |
t.URLSearchParams = a | |
}(), | |
function() { | |
if ("1" !== new t.URLSearchParams([["a", 1]]).get("a") || "1" !== new t.URLSearchParams({ | |
a: 1 | |
}).get("a")) { | |
var n = t.URLSearchParams; | |
t.URLSearchParams = function(t) { | |
if (t && "object" == typeof t && e(t)) { | |
var o = new n; | |
return r(t).forEach(function(t) { | |
if (!e(t)) | |
throw TypeError(); | |
var n = r(t); | |
if (2 !== n.length) | |
throw TypeError(); | |
o.append(n[0], n[1]) | |
}), | |
o | |
} | |
return t && "object" == typeof t ? (o = new n, | |
Object.keys(t).forEach(function(e) { | |
o.set(e, t[e]) | |
}), | |
o) : new n(t) | |
} | |
} | |
}() | |
}(self), | |
function(t) { | |
"use strict"; | |
function e(t) { | |
if ((t = String(t)).match(/[^\x00-\xFF]/)) | |
throw TypeError("Not a valid ByteString"); | |
return t | |
} | |
function r(t) { | |
return (t = String(t)).replace(/([\u0000-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDFFF])/g, function(t) { | |
return /^[\uD800-\uDFFF]$/.test(t) ? "๏ฟฝ" : t | |
}) | |
} | |
function n(t) { | |
return 65535 & t | |
} | |
function o(t) { | |
return String(t).replace(/[a-z]/g, function(t) { | |
return t.toUpperCase() | |
}) | |
} | |
function i(t) { | |
return "CONNECT" === (t = o(t)) || "TRACE" === t || "TRACK" === t | |
} | |
function a(t) { | |
var e = o(t); | |
return "DELETE" === e || "GET" === e || "HEAD" === e || "OPTIONS" === e || "POST" === e || "PUT" === e ? e : t | |
} | |
function u(t) { | |
return /^[!#$%&'*+\-.09A-Z^_`a-z|~]+$/.test(t) | |
} | |
function c(t) { | |
return { | |
"accept-charset": !0, | |
"accept-encoding": !0, | |
"access-control-request-headers": !0, | |
"access-control-request-method": !0, | |
connection: !0, | |
"content-length": !0, | |
cookie: !0, | |
cookie2: !0, | |
date: !0, | |
dnt: !0, | |
expect: !0, | |
host: !0, | |
"keep-alive": !0, | |
origin: !0, | |
referer: !0, | |
te: !0, | |
trailer: !0, | |
"transfer-encoding": !0, | |
upgrade: !0, | |
"user-agent": !0, | |
via: !0 | |
}[t = String(t).toLowerCase()] || "proxy-" === t.substring(0, 6) || "sec-" === t.substring(0, 4) | |
} | |
function s(t) { | |
return { | |
"set-cookie": !0, | |
"set-cookie2": !0 | |
}[t = String(t).toLowerCase()] | |
} | |
function f(t, e) { | |
return "accept" === (t = String(t).toLowerCase()) || "accept-language" === t || "content-language" === t || "content-type" === t && -1 !== ["application/x-www-form-encoded", "multipart/form-data", "text/plain"].indexOf(e) | |
} | |
function l(t) { | |
this._guard = "none", | |
this._headerList = [], | |
t && p(this, t) | |
} | |
function p(t, e) { | |
e instanceof l ? e._headerList.forEach(function(e) { | |
t.append(e[0], e[1]) | |
}) : Array.isArray(e) ? e.forEach(function(e) { | |
if (!Array.isArray(e) || 2 !== e.length) | |
throw TypeError(); | |
t.append(e[0], e[1]) | |
}) : (e = Object(e), | |
Object.keys(e).forEach(function(r) { | |
t.append(r, e[r]) | |
})) | |
} | |
function h(t) { | |
this._headers = t, | |
this._index = 0 | |
} | |
function y(t) { | |
this._stream = t, | |
this.bodyUsed = !1 | |
} | |
function v(t, n) { | |
if (arguments.length < 1) | |
throw TypeError("Not enough arguments"); | |
if (y.call(this, null), | |
this.method = "GET", | |
this.url = "", | |
this.headers = new l, | |
this.headers._guard = "request", | |
this.referrer = null, | |
this.mode = null, | |
this.credentials = "omit", | |
t instanceof v) { | |
if (t.bodyUsed) | |
throw TypeError(); | |
t.bodyUsed = !0, | |
this.method = t.method, | |
this.url = t.url, | |
this.headers = new l(t.headers), | |
this.headers._guard = t.headers._guard, | |
this.credentials = t.credentials, | |
this._stream = t._stream | |
} else | |
t = r(t), | |
this.url = String(new URL(t,self.location)); | |
if ("method"in (n = Object(n))) { | |
var o = e(n.method); | |
if (i(o)) | |
throw TypeError(); | |
this.method = a(o) | |
} | |
"headers"in n && (this.headers = new l, | |
p(this.headers, n.headers)), | |
"body"in n && (this._stream = n.body), | |
"credentials"in n && -1 !== ["omit", "same-origin", "include"].indexOf(n.credentials) && (this.credentials = n.credentials) | |
} | |
function d(t, e) { | |
if (arguments.length < 1 && (t = ""), | |
this.headers = new l, | |
this.headers._guard = "response", | |
t instanceof XMLHttpRequest && "_url"in t) { | |
var o = t; | |
return this.type = "basic", | |
this.url = r(o._url), | |
this.status = o.status, | |
this.ok = 200 <= this.status && this.status <= 299, | |
this.statusText = o.statusText, | |
o.getAllResponseHeaders().split(/\r?\n/).filter(function(t) { | |
return t.length | |
}).forEach(function(t) { | |
var e = t.indexOf(":"); | |
this.headers.append(t.substring(0, e), t.substring(e + 2)) | |
}, this), | |
void y.call(this, o.responseText) | |
} | |
y.call(this, t), | |
e = Object(e) || {}, | |
this.url = ""; | |
var i = "status"in e ? n(e.status) : 200; | |
if (i < 200 || i > 599) | |
throw RangeError(); | |
this.status = i, | |
this.ok = 200 <= this.status && this.status <= 299; | |
var a = "statusText"in e ? String(e.statusText) : "OK"; | |
if (/[^\x00-\xFF]/.test(a)) | |
throw TypeError(); | |
this.statusText = a, | |
"headers"in e && p(this.headers, e), | |
this.type = "basic" | |
} | |
l.prototype = { | |
append: function(t, r) { | |
if (t = e(t), | |
!u(t)) | |
throw TypeError(); | |
if ("immutable" === this._guard) | |
throw TypeError(); | |
"request" === this._guard && c(t) || ("request-no-CORS" !== this._guard || f(t, r)) && ("response" === this._guard && s(t) || (t = t.toLowerCase(), | |
this._headerList.push([t, r]))) | |
}, | |
"delete": function(t) { | |
if (t = e(t), | |
!u(t)) | |
throw TypeError(); | |
if ("immutable" === this._guard) | |
throw TypeError(); | |
if (("request" !== this._guard || !c(t)) && ("request-no-CORS" !== this._guard || f(t, "invalid")) && ("response" !== this._guard || !s(t))) { | |
t = t.toLowerCase(); | |
for (var r = 0; r < this._headerList.length; ) | |
this._headerList[r][0] === t ? this._headerList.splice(r, 1) : ++r | |
} | |
}, | |
get: function(t) { | |
if (t = e(t), | |
!u(t)) | |
throw TypeError(); | |
t = t.toLowerCase(); | |
for (var r = 0; r < this._headerList.length; ++r) | |
if (this._headerList[r][0] === t) | |
return this._headerList[r][1]; | |
return null | |
}, | |
getAll: function(t) { | |
if (t = e(t), | |
!u(t)) | |
throw TypeError(); | |
t = t.toLowerCase(); | |
for (var r = [], n = 0; n < this._headerList.length; ++n) | |
this._headerList[n][0] === t && r.push(this._headerList[n][1]); | |
return r | |
}, | |
has: function(t) { | |
if (t = e(t), | |
!u(t)) | |
throw TypeError(); | |
t = t.toLowerCase(); | |
for (var r = 0; r < this._headerList.length; ++r) | |
if (this._headerList[r][0] === t) | |
return !0; | |
return !1 | |
}, | |
set: function(t, r) { | |
if (t = e(t), | |
!u(t)) | |
throw TypeError(); | |
if ("immutable" === this._guard) | |
throw TypeError(); | |
if (("request" !== this._guard || !c(t)) && ("request-no-CORS" !== this._guard || f(t, r)) && ("response" !== this._guard || !s(t))) { | |
t = t.toLowerCase(); | |
for (var n = 0; n < this._headerList.length; ++n) | |
if (this._headerList[n][0] === t) { | |
for (this._headerList[n++][1] = r; n < this._headerList.length; ) | |
this._headerList[n][0] === t ? this._headerList.splice(n, 1) : ++n; | |
return | |
} | |
this._headerList.push([t, r]) | |
} | |
} | |
}, | |
l.prototype[Symbol.iterator] = function() { | |
return new h(this) | |
} | |
, | |
(h.prototype = {}).next = function() { | |
return this._index >= this._headers._headerList.length ? { | |
value: undefined, | |
done: !0 | |
} : { | |
value: this._headers._headerList[this._index++], | |
done: !1 | |
} | |
} | |
, | |
h.prototype[Symbol.iterator] = function() { | |
return this | |
} | |
, | |
y.prototype = { | |
arrayBuffer: function() { | |
if (this.bodyUsed) | |
return Promise.reject(TypeError()); | |
if (this.bodyUsed = !0, | |
this._stream instanceof ArrayBuffer) | |
return Promise.resolve(this._stream); | |
var t = this._stream; | |
return new Promise(function(e, r) { | |
var n = unescape(encodeURIComponent(t)).split("").map(function(t) { | |
return t.charCodeAt(0) | |
}); | |
e(new Uint8Array(n).buffer) | |
} | |
) | |
}, | |
blob: function() { | |
return this.bodyUsed ? Promise.reject(TypeError()) : (this.bodyUsed = !0, | |
this._stream instanceof Blob ? Promise.resolve(this._stream) : Promise.resolve(new Blob([this._stream]))) | |
}, | |
formData: function() { | |
return this.bodyUsed ? Promise.reject(TypeError()) : (this.bodyUsed = !0, | |
this._stream instanceof FormData ? Promise.resolve(this._stream) : Promise.reject(Error("Not yet implemented"))) | |
}, | |
json: function() { | |
if (this.bodyUsed) | |
return Promise.reject(TypeError()); | |
this.bodyUsed = !0; | |
var t = this; | |
return new Promise(function(e, r) { | |
e(JSON.parse(t._stream)) | |
} | |
) | |
}, | |
text: function() { | |
return this.bodyUsed ? Promise.reject(TypeError()) : (this.bodyUsed = !0, | |
Promise.resolve(String(this._stream))) | |
} | |
}, | |
v.prototype = y.prototype, | |
d.prototype = y.prototype, | |
d.redirect = function() { | |
throw Error("Not supported") | |
} | |
, | |
"fetch"in t || (t.Headers = l, | |
t.Request = v, | |
t.Response = d, | |
t.fetch = function(t, e) { | |
return new Promise(function(r, n) { | |
var o = new v(t,e) | |
, i = new XMLHttpRequest; | |
i._url = o.url; | |
try { | |
i.open(o.method, o.url, !0) | |
} catch (c) { | |
throw TypeError(c.message) | |
} | |
for (var a = o.headers[Symbol.iterator](), u = a.next(); !u.done; u = a.next()) | |
i.setRequestHeader(u.value[0], u.value[1]); | |
"include" === o.credentials && (i.withCredentials = !0), | |
i.onreadystatechange = function() { | |
i.readyState === XMLHttpRequest.DONE && (0 === i.status ? n(new TypeError("Network error")) : r(new d(i))) | |
} | |
, | |
i.send(o._stream) | |
} | |
) | |
} | |
) | |
}(self); | |
{/* <script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script> */ | |
} | |
/* | |
HTML5 Shiv v3.7.0 | @afarkas @jdalton @jon_neal @rem | MIT/GPL2 Licensed | |
*/ | |
(function(l, f) { | |
function m() { | |
var a = e.elements; | |
return "string" == typeof a ? a.split(" ") : a | |
} | |
function i(a) { | |
var b = n[a[o]]; | |
b || (b = {}, | |
h++, | |
a[o] = h, | |
n[h] = b); | |
return b | |
} | |
function p(a, b, c) { | |
b || (b = f); | |
if (g) | |
return b.createElement(a); | |
c || (c = i(b)); | |
b = c.cache[a] ? c.cache[a].cloneNode() : r.test(a) ? (c.cache[a] = c.createElem(a)).cloneNode() : c.createElem(a); | |
return b.canHaveChildren && !s.test(a) ? c.frag.appendChild(b) : b | |
} | |
function t(a, b) { | |
if (!b.cache) | |
b.cache = {}, | |
b.createElem = a.createElement, | |
b.createFrag = a.createDocumentFragment, | |
b.frag = b.createFrag(); | |
a.createElement = function(c) { | |
return !e.shivMethods ? b.createElem(c) : p(c, a, b) | |
} | |
; | |
a.createDocumentFragment = Function("h,f", "return function(){var n=f.cloneNode(),c=n.createElement;h.shivMethods&&(" + m().join().replace(/[\w\-]+/g, function(a) { | |
b.createElem(a); | |
b.frag.createElement(a); | |
return 'c("' + a + '")' | |
}) + ");return n}")(e, b.frag) | |
} | |
function q(a) { | |
a || (a = f); | |
var b = i(a); | |
if (e.shivCSS && !j && !b.hasCSS) { | |
var c, d = a; | |
c = d.createElement("p"); | |
d = d.getElementsByTagName("head")[0] || d.documentElement; | |
c.innerHTML = "x<style>article,aside,dialog,figcaption,figure,footer,header,hgroup,main,nav,section{display:block}mark{background:#FF0;color:#000}template{display:none}</style>"; | |
c = d.insertBefore(c.lastChild, d.firstChild); | |
b.hasCSS = !!c | |
} | |
g || t(a, b); | |
return a | |
} | |
var k = l.html5 || {}, s = /^<|^(?:button|map|select|textarea|object|iframe|option|optgroup)$/i, r = /^(?:a|b|code|div|fieldset|h1|h2|h3|h4|h5|h6|i|label|li|ol|p|q|span|strong|style|table|tbody|td|th|tr|ul)$/i, j, o = "_html5shiv", h = 0, n = {}, g; | |
(function() { | |
try { | |
var a = f.createElement("a"); | |
a.innerHTML = "<xyz></xyz>"; | |
j = "hidden"in a; | |
var b; | |
if (!(b = 1 == a.childNodes.length)) { | |
f.createElement("a"); | |
var c = f.createDocumentFragment(); | |
b = "undefined" == typeof c.cloneNode || "undefined" == typeof c.createDocumentFragment || "undefined" == typeof c.createElement | |
} | |
g = b | |
} catch (d) { | |
g = j = !0 | |
} | |
} | |
)(); | |
var e = { | |
elements: k.elements || "abbr article aside audio bdi canvas data datalist details dialog figcaption figure footer header hgroup main mark meter nav output progress section summary template time video", | |
version: "3.7.0", | |
shivCSS: !1 !== k.shivCSS, | |
supportsUnknownElements: g, | |
shivMethods: !1 !== k.shivMethods, | |
type: "default", | |
shivDocument: q, | |
createElement: p, | |
createDocumentFragment: function(a, b) { | |
a || (a = f); | |
if (g) | |
return a.createDocumentFragment(); | |
for (var b = b || i(a), c = b.frag.cloneNode(), d = 0, e = m(), h = e.length; d < h; d++) | |
c.createElement(e[d]); | |
return c | |
} | |
}; | |
l.html5 = e; | |
q(f) | |
} | |
)(this, document); | |
{/* <script src="https://oss.maxcdn.com/libs/respond.js/1.3.0/respond.min.js"></script> */ | |
} | |
/*! matchMedia() polyfill - Test a CSS media type/query in JS. Authors & copyright (c) 2012: Scott Jehl, Paul Irish, Nicholas Zakas. Dual MIT/BSD license */ | |
/*! NOTE: If you're already including a window.matchMedia polyfill via Modernizr or otherwise, you don't need this part */ | |
window.matchMedia = window.matchMedia || function(a) { | |
"use strict"; | |
var c, d = a.documentElement, e = d.firstElementChild || d.firstChild, f = a.createElement("body"), g = a.createElement("div"); | |
return g.id = "mq-test-1", | |
g.style.cssText = "position:absolute;top:-100em", | |
f.style.background = "none", | |
f.appendChild(g), | |
function(a) { | |
return g.innerHTML = '­<style media="' + a + '"> #mq-test-1 { width: 42px; }</style>', | |
d.insertBefore(f, e), | |
c = 42 === g.offsetWidth, | |
d.removeChild(f), | |
{ | |
matches: c, | |
media: a | |
} | |
} | |
}(document); | |
/*! Respond.js v1.3.0: min/max-width media query polyfill. (c) Scott Jehl. MIT/GPLv2 Lic. j.mp/respondjs */ | |
(function(a) { | |
"use strict"; | |
function x() { | |
u(!0) | |
} | |
var b = {}; | |
if (a.respond = b, | |
b.update = function() {} | |
, | |
b.mediaQueriesSupported = a.matchMedia && a.matchMedia("only all").matches, | |
!b.mediaQueriesSupported) { | |
var q, r, t, c = a.document, d = c.documentElement, e = [], f = [], g = [], h = {}, i = 30, j = c.getElementsByTagName("head")[0] || d, k = c.getElementsByTagName("base")[0], l = j.getElementsByTagName("link"), m = [], n = function() { | |
for (var b = 0; l.length > b; b++) { | |
var c = l[b] | |
, d = c.href | |
, e = c.media | |
, f = c.rel && "stylesheet" === c.rel.toLowerCase(); | |
d && f && !h[d] && (c.styleSheet && c.styleSheet.rawCssText ? (p(c.styleSheet.rawCssText, d, e), | |
h[d] = !0) : (!/^([a-zA-Z:]*\/\/)/.test(d) && !k || d.replace(RegExp.$1, "").split("/")[0] === a.location.host) && m.push({ | |
href: d, | |
media: e | |
})) | |
} | |
o() | |
}, o = function() { | |
if (m.length) { | |
var b = m.shift(); | |
v(b.href, function(c) { | |
p(c, b.href, b.media), | |
h[b.href] = !0, | |
a.setTimeout(function() { | |
o() | |
}, 0) | |
}) | |
} | |
}, p = function(a, b, c) { | |
var d = a.match(/@media[^\{]+\{([^\{\}]*\{[^\}\{]*\})+/gi) | |
, g = d && d.length || 0; | |
b = b.substring(0, b.lastIndexOf("/")); | |
var h = function(a) { | |
return a.replace(/(url\()['"]?([^\/\)'"][^:\)'"]+)['"]?(\))/g, "$1" + b + "$2$3") | |
} | |
, i = !g && c; | |
b.length && (b += "/"), | |
i && (g = 1); | |
for (var j = 0; g > j; j++) { | |
var k, l, m, n; | |
i ? (k = c, | |
f.push(h(a))) : (k = d[j].match(/@media *([^\{]+)\{([\S\s]+?)$/) && RegExp.$1, | |
f.push(RegExp.$2 && h(RegExp.$2))), | |
m = k.split(","), | |
n = m.length; | |
for (var o = 0; n > o; o++) | |
l = m[o], | |
e.push({ | |
media: l.split("(")[0].match(/(only\s+)?([a-zA-Z]+)\s?/) && RegExp.$2 || "all", | |
rules: f.length - 1, | |
hasquery: l.indexOf("(") > -1, | |
minw: l.match(/\(\s*min\-width\s*:\s*(\s*[0-9\.]+)(px|em)\s*\)/) && parseFloat(RegExp.$1) + (RegExp.$2 || ""), | |
maxw: l.match(/\(\s*max\-width\s*:\s*(\s*[0-9\.]+)(px|em)\s*\)/) && parseFloat(RegExp.$1) + (RegExp.$2 || "") | |
}) | |
} | |
u() | |
}, s = function() { | |
var a, b = c.createElement("div"), e = c.body, f = !1; | |
return b.style.cssText = "position:absolute;font-size:1em;width:1em", | |
e || (e = f = c.createElement("body"), | |
e.style.background = "none"), | |
e.appendChild(b), | |
d.insertBefore(e, d.firstChild), | |
a = b.offsetWidth, | |
f ? d.removeChild(e) : e.removeChild(b), | |
a = t = parseFloat(a) | |
}, u = function(b) { | |
var h = "clientWidth" | |
, k = d[h] | |
, m = "CSS1Compat" === c.compatMode && k || c.body[h] || k | |
, n = {} | |
, o = l[l.length - 1] | |
, p = (new Date).getTime(); | |
if (b && q && i > p - q) | |
return a.clearTimeout(r), | |
r = a.setTimeout(u, i), | |
void 0; | |
q = p; | |
for (var v in e) | |
if (e.hasOwnProperty(v)) { | |
var w = e[v] | |
, x = w.minw | |
, y = w.maxw | |
, z = null === x | |
, A = null === y | |
, B = "em"; | |
x && (x = parseFloat(x) * (x.indexOf(B) > -1 ? t || s() : 1)), | |
y && (y = parseFloat(y) * (y.indexOf(B) > -1 ? t || s() : 1)), | |
w.hasquery && (z && A || !(z || m >= x) || !(A || y >= m)) || (n[w.media] || (n[w.media] = []), | |
n[w.media].push(f[w.rules])) | |
} | |
for (var C in g) | |
g.hasOwnProperty(C) && g[C] && g[C].parentNode === j && j.removeChild(g[C]); | |
for (var D in n) | |
if (n.hasOwnProperty(D)) { | |
var E = c.createElement("style") | |
, F = n[D].join("\n"); | |
E.type = "text/css", | |
E.media = D, | |
j.insertBefore(E, o.nextSibling), | |
E.styleSheet ? E.styleSheet.cssText = F : E.appendChild(c.createTextNode(F)), | |
g.push(E) | |
} | |
}, v = function(a, b) { | |
var c = w(); | |
c && (c.open("GET", a, !0), | |
c.onreadystatechange = function() { | |
4 !== c.readyState || 200 !== c.status && 304 !== c.status || b(c.responseText) | |
} | |
, | |
4 !== c.readyState && c.send(null)) | |
}, w = function() { | |
var b = !1; | |
try { | |
b = new a.XMLHttpRequest | |
} catch (c) { | |
b = new a.ActiveXObject("Microsoft.XMLHTTP") | |
} | |
return function() { | |
return b | |
} | |
}(); | |
n(), | |
b.update = n, | |
a.addEventListener ? a.addEventListener("resize", x, !1) : a.attachEvent && a.attachEvent("onresize", x) | |
} | |
} | |
)(this); | |
{/* <script src="https://cdn.jsdelivr.net/npm/es6-promise@4/dist/es6-promise.min.js"></script> */ | |
} | |
!function(t, e) { | |
"object" == typeof exports && "undefined" != typeof module ? module.exports = e() : "function" == typeof define && define.amd ? define(e) : t.ES6Promise = e() | |
}(this, function() { | |
"use strict"; | |
function t(t) { | |
var e = typeof t; | |
return null !== t && ("object" === e || "function" === e) | |
} | |
function e(t) { | |
return "function" == typeof t | |
} | |
function n(t) { | |
W = t | |
} | |
function r(t) { | |
z = t | |
} | |
function o() { | |
return function() { | |
return process.nextTick(a) | |
} | |
} | |
function i() { | |
return "undefined" != typeof U ? function() { | |
U(a) | |
} | |
: c() | |
} | |
function s() { | |
var t = 0 | |
, e = new H(a) | |
, n = document.createTextNode(""); | |
return e.observe(n, { | |
characterData: !0 | |
}), | |
function() { | |
n.data = t = ++t % 2 | |
} | |
} | |
function u() { | |
var t = new MessageChannel; | |
return t.port1.onmessage = a, | |
function() { | |
return t.port2.postMessage(0) | |
} | |
} | |
function c() { | |
var t = setTimeout; | |
return function() { | |
return t(a, 1) | |
} | |
} | |
function a() { | |
for (var t = 0; t < N; t += 2) { | |
var e = Q[t] | |
, n = Q[t + 1]; | |
e(n), | |
Q[t] = void 0, | |
Q[t + 1] = void 0 | |
} | |
N = 0 | |
} | |
function f() { | |
try { | |
var t = Function("return this")().require("vertx"); | |
return U = t.runOnLoop || t.runOnContext, | |
i() | |
} catch (e) { | |
return c() | |
} | |
} | |
function l(t, e) { | |
var n = this | |
, r = new this.constructor(v); | |
void 0 === r[V] && x(r); | |
var o = n._state; | |
if (o) { | |
var i = arguments[o - 1]; | |
z(function() { | |
return T(o, r, i, n._result) | |
}) | |
} else | |
j(n, r, t, e); | |
return r | |
} | |
function h(t) { | |
var e = this; | |
if (t && "object" == typeof t && t.constructor === e) | |
return t; | |
var n = new e(v); | |
return w(n, t), | |
n | |
} | |
function v() {} | |
function p() { | |
return new TypeError("You cannot resolve a promise with itself") | |
} | |
function d() { | |
return new TypeError("A promises callback cannot return that same promise.") | |
} | |
function _(t, e, n, r) { | |
try { | |
t.call(e, n, r) | |
} catch (o) { | |
return o | |
} | |
} | |
function y(t, e, n) { | |
z(function(t) { | |
var r = !1 | |
, o = _(n, e, function(n) { | |
r || (r = !0, | |
e !== n ? w(t, n) : A(t, n)) | |
}, function(e) { | |
r || (r = !0, | |
S(t, e)) | |
}, "Settle: " + (t._label || " unknown promise")); | |
!r && o && (r = !0, | |
S(t, o)) | |
}, t) | |
} | |
function m(t, e) { | |
e._state === Z ? A(t, e._result) : e._state === $ ? S(t, e._result) : j(e, void 0, function(e) { | |
return w(t, e) | |
}, function(e) { | |
return S(t, e) | |
}) | |
} | |
function b(t, n, r) { | |
n.constructor === t.constructor && r === l && n.constructor.resolve === h ? m(t, n) : void 0 === r ? A(t, n) : e(r) ? y(t, n, r) : A(t, n) | |
} | |
function w(e, n) { | |
if (e === n) | |
S(e, p()); | |
else if (t(n)) { | |
var r = void 0; | |
try { | |
r = n.then | |
} catch (o) { | |
return void S(e, o) | |
} | |
b(e, n, r) | |
} else | |
A(e, n) | |
} | |
function g(t) { | |
t._onerror && t._onerror(t._result), | |
E(t) | |
} | |
function A(t, e) { | |
t._state === X && (t._result = e, | |
t._state = Z, | |
0 !== t._subscribers.length && z(E, t)) | |
} | |
function S(t, e) { | |
t._state === X && (t._state = $, | |
t._result = e, | |
z(g, t)) | |
} | |
function j(t, e, n, r) { | |
var o = t._subscribers | |
, i = o.length; | |
t._onerror = null, | |
o[i] = e, | |
o[i + Z] = n, | |
o[i + $] = r, | |
0 === i && t._state && z(E, t) | |
} | |
function E(t) { | |
var e = t._subscribers | |
, n = t._state; | |
if (0 !== e.length) { | |
for (var r = void 0, o = void 0, i = t._result, s = 0; s < e.length; s += 3) | |
r = e[s], | |
o = e[s + n], | |
r ? T(n, r, o, i) : o(i); | |
t._subscribers.length = 0 | |
} | |
} | |
function T(t, n, r, o) { | |
var i = e(r) | |
, s = void 0 | |
, u = void 0 | |
, c = !0; | |
if (i) { | |
try { | |
s = r(o) | |
} catch (a) { | |
c = !1, | |
u = a | |
} | |
if (n === s) | |
return void S(n, d()) | |
} else | |
s = o; | |
n._state !== X || (i && c ? w(n, s) : c === !1 ? S(n, u) : t === Z ? A(n, s) : t === $ && S(n, s)) | |
} | |
function M(t, e) { | |
try { | |
e(function(e) { | |
w(t, e) | |
}, function(e) { | |
S(t, e) | |
}) | |
} catch (n) { | |
S(t, n) | |
} | |
} | |
function P() { | |
return tt++ | |
} | |
function x(t) { | |
t[V] = tt++, | |
t._state = void 0, | |
t._result = void 0, | |
t._subscribers = [] | |
} | |
function C() { | |
return new Error("Array Methods must be provided an Array") | |
} | |
function O(t) { | |
return new et(this,t).promise | |
} | |
function k(t) { | |
var e = this; | |
return new e(L(t) ? function(n, r) { | |
for (var o = t.length, i = 0; i < o; i++) | |
e.resolve(t[i]).then(n, r) | |
} | |
: function(t, e) { | |
return e(new TypeError("You must pass an array to race.")) | |
} | |
) | |
} | |
function F(t) { | |
var e = this | |
, n = new e(v); | |
return S(n, t), | |
n | |
} | |
function Y() { | |
throw new TypeError("You must pass a resolver function as the first argument to the promise constructor") | |
} | |
function q() { | |
throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.") | |
} | |
function D() { | |
var t = void 0; | |
if ("undefined" != typeof global) | |
t = global; | |
else if ("undefined" != typeof self) | |
t = self; | |
else | |
try { | |
t = Function("return this")() | |
} catch (e) { | |
throw new Error("polyfill failed because global object is unavailable in this environment") | |
} | |
var n = t.Promise; | |
if (n) { | |
var r = null; | |
try { | |
r = Object.prototype.toString.call(n.resolve()) | |
} catch (e) {} | |
if ("[object Promise]" === r && !n.cast) | |
return | |
} | |
t.Promise = nt | |
} | |
var K = void 0; | |
K = Array.isArray ? Array.isArray : function(t) { | |
return "[object Array]" === Object.prototype.toString.call(t) | |
} | |
; | |
var L = K | |
, N = 0 | |
, U = void 0 | |
, W = void 0 | |
, z = function(t, e) { | |
Q[N] = t, | |
Q[N + 1] = e, | |
N += 2, | |
2 === N && (W ? W(a) : R()) | |
} | |
, B = "undefined" != typeof window ? window : void 0 | |
, G = B || {} | |
, H = G.MutationObserver || G.WebKitMutationObserver | |
, I = "undefined" == typeof self && "undefined" != typeof process && "[object process]" === {}.toString.call(process) | |
, J = "undefined" != typeof Uint8ClampedArray && "undefined" != typeof importScripts && "undefined" != typeof MessageChannel | |
, Q = new Array(1e3) | |
, R = void 0; | |
R = I ? o() : H ? s() : J ? u() : void 0 === B && "function" == typeof require ? f() : c(); | |
var V = Math.random().toString(36).substring(2) | |
, X = void 0 | |
, Z = 1 | |
, $ = 2 | |
, tt = 0 | |
, et = function() { | |
function t(t, e) { | |
this._instanceConstructor = t, | |
this.promise = new t(v), | |
this.promise[V] || x(this.promise), | |
L(e) ? (this.length = e.length, | |
this._remaining = e.length, | |
this._result = new Array(this.length), | |
0 === this.length ? A(this.promise, this._result) : (this.length = this.length || 0, | |
this._enumerate(e), | |
0 === this._remaining && A(this.promise, this._result))) : S(this.promise, C()) | |
} | |
return t.prototype._enumerate = function(t) { | |
for (var e = 0; this._state === X && e < t.length; e++) | |
this._eachEntry(t[e], e) | |
} | |
, | |
t.prototype._eachEntry = function(t, e) { | |
var n = this._instanceConstructor | |
, r = n.resolve; | |
if (r === h) { | |
var o = void 0 | |
, i = void 0 | |
, s = !1; | |
try { | |
o = t.then | |
} catch (u) { | |
s = !0, | |
i = u | |
} | |
if (o === l && t._state !== X) | |
this._settledAt(t._state, e, t._result); | |
else if ("function" != typeof o) | |
this._remaining--, | |
this._result[e] = t; | |
else if (n === nt) { | |
var c = new n(v); | |
s ? S(c, i) : b(c, t, o), | |
this._willSettleAt(c, e) | |
} else | |
this._willSettleAt(new n(function(e) { | |
return e(t) | |
} | |
), e) | |
} else | |
this._willSettleAt(r(t), e) | |
} | |
, | |
t.prototype._settledAt = function(t, e, n) { | |
var r = this.promise; | |
r._state === X && (this._remaining--, | |
t === $ ? S(r, n) : this._result[e] = n), | |
0 === this._remaining && A(r, this._result) | |
} | |
, | |
t.prototype._willSettleAt = function(t, e) { | |
var n = this; | |
j(t, void 0, function(t) { | |
return n._settledAt(Z, e, t) | |
}, function(t) { | |
return n._settledAt($, e, t) | |
}) | |
} | |
, | |
t | |
}() | |
, nt = function() { | |
function t(e) { | |
this[V] = P(), | |
this._result = this._state = void 0, | |
this._subscribers = [], | |
v !== e && ("function" != typeof e && Y(), | |
this instanceof t ? M(this, e) : q()) | |
} | |
return t.prototype["catch"] = function(t) { | |
return this.then(null, t) | |
} | |
, | |
t.prototype["finally"] = function(t) { | |
var n = this | |
, r = n.constructor; | |
return e(t) ? n.then(function(e) { | |
return r.resolve(t()).then(function() { | |
return e | |
}) | |
}, function(e) { | |
return r.resolve(t()).then(function() { | |
throw e | |
}) | |
}) : n.then(t, t) | |
} | |
, | |
t | |
}(); | |
return nt.prototype.then = l, | |
nt.all = O, | |
nt.race = k, | |
nt.resolve = h, | |
nt.reject = F, | |
nt._setScheduler = n, | |
nt._setAsap = r, | |
nt._asap = z, | |
nt.polyfill = D, | |
nt.Promise = nt, | |
nt | |
}); | |
{/* <script src="https://cdn.jsdelivr.net/npm/es6-promise@4/dist/es6-promise.auto.min.js"></script> */ | |
} | |
!function(t, e) { | |
"object" == typeof exports && "undefined" != typeof module ? module.exports = e() : "function" == typeof define && define.amd ? define(e) : t.ES6Promise = e() | |
}(this, function() { | |
"use strict"; | |
function t(t) { | |
var e = typeof t; | |
return null !== t && ("object" === e || "function" === e) | |
} | |
function e(t) { | |
return "function" == typeof t | |
} | |
function n(t) { | |
W = t | |
} | |
function r(t) { | |
z = t | |
} | |
function o() { | |
return function() { | |
return process.nextTick(a) | |
} | |
} | |
function i() { | |
return "undefined" != typeof U ? function() { | |
U(a) | |
} | |
: c() | |
} | |
function s() { | |
var t = 0 | |
, e = new H(a) | |
, n = document.createTextNode(""); | |
return e.observe(n, { | |
characterData: !0 | |
}), | |
function() { | |
n.data = t = ++t % 2 | |
} | |
} | |
function u() { | |
var t = new MessageChannel; | |
return t.port1.onmessage = a, | |
function() { | |
return t.port2.postMessage(0) | |
} | |
} | |
function c() { | |
var t = setTimeout; | |
return function() { | |
return t(a, 1) | |
} | |
} | |
function a() { | |
for (var t = 0; t < N; t += 2) { | |
var e = Q[t] | |
, n = Q[t + 1]; | |
e(n), | |
Q[t] = void 0, | |
Q[t + 1] = void 0 | |
} | |
N = 0 | |
} | |
function f() { | |
try { | |
var t = Function("return this")().require("vertx"); | |
return U = t.runOnLoop || t.runOnContext, | |
i() | |
} catch (e) { | |
return c() | |
} | |
} | |
function l(t, e) { | |
var n = this | |
, r = new this.constructor(p); | |
void 0 === r[V] && x(r); | |
var o = n._state; | |
if (o) { | |
var i = arguments[o - 1]; | |
z(function() { | |
return T(o, r, i, n._result) | |
}) | |
} else | |
j(n, r, t, e); | |
return r | |
} | |
function h(t) { | |
var e = this; | |
if (t && "object" == typeof t && t.constructor === e) | |
return t; | |
var n = new e(p); | |
return w(n, t), | |
n | |
} | |
function p() {} | |
function v() { | |
return new TypeError("You cannot resolve a promise with itself") | |
} | |
function d() { | |
return new TypeError("A promises callback cannot return that same promise.") | |
} | |
function _(t, e, n, r) { | |
try { | |
t.call(e, n, r) | |
} catch (o) { | |
return o | |
} | |
} | |
function y(t, e, n) { | |
z(function(t) { | |
var r = !1 | |
, o = _(n, e, function(n) { | |
r || (r = !0, | |
e !== n ? w(t, n) : A(t, n)) | |
}, function(e) { | |
r || (r = !0, | |
S(t, e)) | |
}, "Settle: " + (t._label || " unknown promise")); | |
!r && o && (r = !0, | |
S(t, o)) | |
}, t) | |
} | |
function m(t, e) { | |
e._state === Z ? A(t, e._result) : e._state === $ ? S(t, e._result) : j(e, void 0, function(e) { | |
return w(t, e) | |
}, function(e) { | |
return S(t, e) | |
}) | |
} | |
function b(t, n, r) { | |
n.constructor === t.constructor && r === l && n.constructor.resolve === h ? m(t, n) : void 0 === r ? A(t, n) : e(r) ? y(t, n, r) : A(t, n) | |
} | |
function w(e, n) { | |
if (e === n) | |
S(e, v()); | |
else if (t(n)) { | |
var r = void 0; | |
try { | |
r = n.then | |
} catch (o) { | |
return void S(e, o) | |
} | |
b(e, n, r) | |
} else | |
A(e, n) | |
} | |
function g(t) { | |
t._onerror && t._onerror(t._result), | |
E(t) | |
} | |
function A(t, e) { | |
t._state === X && (t._result = e, | |
t._state = Z, | |
0 !== t._subscribers.length && z(E, t)) | |
} | |
function S(t, e) { | |
t._state === X && (t._state = $, | |
t._result = e, | |
z(g, t)) | |
} | |
function j(t, e, n, r) { | |
var o = t._subscribers | |
, i = o.length; | |
t._onerror = null, | |
o[i] = e, | |
o[i + Z] = n, | |
o[i + $] = r, | |
0 === i && t._state && z(E, t) | |
} | |
function E(t) { | |
var e = t._subscribers | |
, n = t._state; | |
if (0 !== e.length) { | |
for (var r = void 0, o = void 0, i = t._result, s = 0; s < e.length; s += 3) | |
r = e[s], | |
o = e[s + n], | |
r ? T(n, r, o, i) : o(i); | |
t._subscribers.length = 0 | |
} | |
} | |
function T(t, n, r, o) { | |
var i = e(r) | |
, s = void 0 | |
, u = void 0 | |
, c = !0; | |
if (i) { | |
try { | |
s = r(o) | |
} catch (a) { | |
c = !1, | |
u = a | |
} | |
if (n === s) | |
return void S(n, d()) | |
} else | |
s = o; | |
n._state !== X || (i && c ? w(n, s) : c === !1 ? S(n, u) : t === Z ? A(n, s) : t === $ && S(n, s)) | |
} | |
function M(t, e) { | |
try { | |
e(function(e) { | |
w(t, e) | |
}, function(e) { | |
S(t, e) | |
}) | |
} catch (n) { | |
S(t, n) | |
} | |
} | |
function P() { | |
return tt++ | |
} | |
function x(t) { | |
t[V] = tt++, | |
t._state = void 0, | |
t._result = void 0, | |
t._subscribers = [] | |
} | |
function C() { | |
return new Error("Array Methods must be provided an Array") | |
} | |
function O(t) { | |
return new et(this,t).promise | |
} | |
function k(t) { | |
var e = this; | |
return new e(L(t) ? function(n, r) { | |
for (var o = t.length, i = 0; i < o; i++) | |
e.resolve(t[i]).then(n, r) | |
} | |
: function(t, e) { | |
return e(new TypeError("You must pass an array to race.")) | |
} | |
) | |
} | |
function F(t) { | |
var e = this | |
, n = new e(p); | |
return S(n, t), | |
n | |
} | |
function Y() { | |
throw new TypeError("You must pass a resolver function as the first argument to the promise constructor") | |
} | |
function q() { | |
throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.") | |
} | |
function D() { | |
var t = void 0; | |
if ("undefined" != typeof global) | |
t = global; | |
else if ("undefined" != typeof self) | |
t = self; | |
else | |
try { | |
t = Function("return this")() | |
} catch (e) { | |
throw new Error("polyfill failed because global object is unavailable in this environment") | |
} | |
var n = t.Promise; | |
if (n) { | |
var r = null; | |
try { | |
r = Object.prototype.toString.call(n.resolve()) | |
} catch (e) {} | |
if ("[object Promise]" === r && !n.cast) | |
return | |
} | |
t.Promise = nt | |
} | |
var K = void 0; | |
K = Array.isArray ? Array.isArray : function(t) { | |
return "[object Array]" === Object.prototype.toString.call(t) | |
} | |
; | |
var L = K | |
, N = 0 | |
, U = void 0 | |
, W = void 0 | |
, z = function(t, e) { | |
Q[N] = t, | |
Q[N + 1] = e, | |
N += 2, | |
2 === N && (W ? W(a) : R()) | |
} | |
, B = "undefined" != typeof window ? window : void 0 | |
, G = B || {} | |
, H = G.MutationObserver || G.WebKitMutationObserver | |
, I = "undefined" == typeof self && "undefined" != typeof process && "[object process]" === {}.toString.call(process) | |
, J = "undefined" != typeof Uint8ClampedArray && "undefined" != typeof importScripts && "undefined" != typeof MessageChannel | |
, Q = new Array(1e3) | |
, R = void 0; | |
R = I ? o() : H ? s() : J ? u() : void 0 === B && "function" == typeof require ? f() : c(); | |
var V = Math.random().toString(36).substring(2) | |
, X = void 0 | |
, Z = 1 | |
, $ = 2 | |
, tt = 0 | |
, et = function() { | |
function t(t, e) { | |
this._instanceConstructor = t, | |
this.promise = new t(p), | |
this.promise[V] || x(this.promise), | |
L(e) ? (this.length = e.length, | |
this._remaining = e.length, | |
this._result = new Array(this.length), | |
0 === this.length ? A(this.promise, this._result) : (this.length = this.length || 0, | |
this._enumerate(e), | |
0 === this._remaining && A(this.promise, this._result))) : S(this.promise, C()) | |
} | |
return t.prototype._enumerate = function(t) { | |
for (var e = 0; this._state === X && e < t.length; e++) | |
this._eachEntry(t[e], e) | |
} | |
, | |
t.prototype._eachEntry = function(t, e) { | |
var n = this._instanceConstructor | |
, r = n.resolve; | |
if (r === h) { | |
var o = void 0 | |
, i = void 0 | |
, s = !1; | |
try { | |
o = t.then | |
} catch (u) { | |
s = !0, | |
i = u | |
} | |
if (o === l && t._state !== X) | |
this._settledAt(t._state, e, t._result); | |
else if ("function" != typeof o) | |
this._remaining--, | |
this._result[e] = t; | |
else if (n === nt) { | |
var c = new n(p); | |
s ? S(c, i) : b(c, t, o), | |
this._willSettleAt(c, e) | |
} else | |
this._willSettleAt(new n(function(e) { | |
return e(t) | |
} | |
), e) | |
} else | |
this._willSettleAt(r(t), e) | |
} | |
, | |
t.prototype._settledAt = function(t, e, n) { | |
var r = this.promise; | |
r._state === X && (this._remaining--, | |
t === $ ? S(r, n) : this._result[e] = n), | |
0 === this._remaining && A(r, this._result) | |
} | |
, | |
t.prototype._willSettleAt = function(t, e) { | |
var n = this; | |
j(t, void 0, function(t) { | |
return n._settledAt(Z, e, t) | |
}, function(t) { | |
return n._settledAt($, e, t) | |
}) | |
} | |
, | |
t | |
}() | |
, nt = function() { | |
function t(e) { | |
this[V] = P(), | |
this._result = this._state = void 0, | |
this._subscribers = [], | |
p !== e && ("function" != typeof e && Y(), | |
this instanceof t ? M(this, e) : q()) | |
} | |
return t.prototype["catch"] = function(t) { | |
return this.then(null, t) | |
} | |
, | |
t.prototype["finally"] = function(t) { | |
var n = this | |
, r = n.constructor; | |
return e(t) ? n.then(function(e) { | |
return r.resolve(t()).then(function() { | |
return e | |
}) | |
}, function(e) { | |
return r.resolve(t()).then(function() { | |
throw e | |
}) | |
}) : n.then(t, t) | |
} | |
, | |
t | |
}(); | |
return nt.prototype.then = l, | |
nt.all = O, | |
nt.race = k, | |
nt.resolve = h, | |
nt.reject = F, | |
nt._setScheduler = n, | |
nt._setAsap = r, | |
nt._asap = z, | |
nt.polyfill = D, | |
nt.Promise = nt, | |
nt.polyfill(), | |
nt | |
}); | |
{/* <script src="/arquivos/fascar-vendor.min.js?v=32168132312"></script> */ | |
} | |
window.MutationObserver = window.MutationObserver || function(t) { | |
"use strict"; | |
function e(t) { | |
this._watched = [], | |
this._listener = t | |
} | |
function n(t) { | |
!function n() { | |
var r = t.takeRecords(); | |
r.length && t._listener(r, t), | |
t._timeout = setTimeout(n, e._period) | |
}() | |
} | |
function r(e) { | |
var n = { | |
type: null, | |
target: null, | |
addedNodes: [], | |
removedNodes: [], | |
previousSibling: null, | |
nextSibling: null, | |
attributeName: null, | |
attributeNamespace: null, | |
oldValue: null | |
}; | |
for (var r in e) | |
m(n, r) && e[r] !== t && (n[r] = e[r]); | |
return n | |
} | |
function i(t, e) { | |
var n = c(t, e); | |
return function(i) { | |
var o, a = i.length; | |
e.charData && 3 === t.nodeType && t.nodeValue !== n.charData && i.push(new r({ | |
type: "characterData", | |
target: t, | |
oldValue: n.charData | |
})), | |
e.attr && n.attr && s(i, t, n.attr, e.afilter), | |
(e.kids || e.descendents) && (o = l(i, t, n, e)), | |
(o || i.length !== a) && (n = c(t, e)) | |
} | |
} | |
function o(t, e) { | |
return e.value | |
} | |
function a(t, e) { | |
return "style" !== e.name ? e.value : t.style.cssText | |
} | |
function s(t, e, n, i) { | |
for (var o, a, s = {}, l = e.attributes, c = l.length; c--; ) | |
o = l[c], | |
a = o.name, | |
i && !m(i, a) || (y(e, o) !== n[a] && t.push(r({ | |
type: "attributes", | |
target: e, | |
attributeName: a, | |
oldValue: n[a], | |
attributeNamespace: o.namespaceURI | |
})), | |
s[a] = !0); | |
for (a in n) | |
s[a] || t.push(r({ | |
target: e, | |
type: "attributes", | |
attributeName: a, | |
oldValue: n[a] | |
})) | |
} | |
function l(e, n, i, o) { | |
function a(t, n, i, a, c) { | |
for (var u, p, d, f = t.length - 1, h = -~((f - c) / 2); d = t.pop(); ) | |
u = i[d.i], | |
p = a[d.j], | |
o.kids && h && Math.abs(d.i - d.j) >= f && (e.push(r({ | |
type: "childList", | |
target: n, | |
addedNodes: [u], | |
removedNodes: [u], | |
nextSibling: u.nextSibling, | |
previousSibling: u.previousSibling | |
})), | |
h--), | |
o.attr && p.attr && s(e, u, p.attr, o.afilter), | |
o.charData && 3 === u.nodeType && u.nodeValue !== p.charData && e.push(r({ | |
type: "characterData", | |
target: u, | |
oldValue: p.charData | |
})), | |
o.descendents && l(u, p) | |
} | |
function l(n, i) { | |
for (var d, f, m, v, g, y, _, b = n.childNodes, w = i.kids, x = b.length, C = w ? w.length : 0, $ = 0, S = 0, k = 0; S < x || k < C; ) | |
y = b[S], | |
g = w[k], | |
_ = g && g.node, | |
y === _ ? (o.attr && g.attr && s(e, y, g.attr, o.afilter), | |
o.charData && g.charData !== t && y.nodeValue !== g.charData && e.push(r({ | |
type: "characterData", | |
target: y, | |
oldValue: g.charData | |
})), | |
f && a(f, n, b, w, $), | |
o.descendents && (y.childNodes.length || g.kids && g.kids.length) && l(y, g), | |
S++, | |
k++) : (c = !0, | |
d || (d = {}, | |
f = []), | |
y && (d[m = p(y)] || (d[m] = !0, | |
-1 === (v = u(w, y, k)) ? o.kids && (e.push(r({ | |
type: "childList", | |
target: n, | |
addedNodes: [y], | |
nextSibling: y.nextSibling, | |
previousSibling: y.previousSibling | |
})), | |
$++) : f.push({ | |
i: S, | |
j: v | |
})), | |
S++), | |
_ && _ !== b[S] && (d[m = p(_)] || (d[m] = !0, | |
-1 === (v = h(b, _, S)) ? o.kids && (e.push(r({ | |
type: "childList", | |
target: i.node, | |
removedNodes: [_], | |
nextSibling: w[k + 1], | |
previousSibling: w[k - 1] | |
})), | |
$--) : f.push({ | |
i: v, | |
j: k | |
})), | |
k++)); | |
f && a(f, n, b, w, $) | |
} | |
var c; | |
return l(n, i), | |
c | |
} | |
function c(t, e) { | |
var n = !0; | |
return function t(r) { | |
var i = { | |
node: r | |
}; | |
return !e.charData || 3 !== r.nodeType && 8 !== r.nodeType ? (e.attr && n && 1 === r.nodeType && (i.attr = f(r.attributes, function(t, n) { | |
return e.afilter && !e.afilter[n.name] || (t[n.name] = y(r, n)), | |
t | |
}, {})), | |
n && (e.kids || e.charData || e.attr && e.descendents) && (i.kids = d(r.childNodes, t)), | |
n = e.descendents) : i.charData = r.nodeValue, | |
i | |
}(t) | |
} | |
function u(t, e, n) { | |
return h(t, e, n, v("node")) | |
} | |
function p(t) { | |
try { | |
return t.id || (t[b] = t[b] || _++) | |
} catch (e) { | |
try { | |
return t.nodeValue | |
} catch (t) { | |
return _++ | |
} | |
} | |
} | |
function d(t, e) { | |
for (var n = [], r = 0; r < t.length; r++) | |
n[r] = e(t[r], r, t); | |
return n | |
} | |
function f(t, e, n) { | |
for (var r = 0; r < t.length; r++) | |
n = e(n, t[r], r, t); | |
return n | |
} | |
function h(t, e, n, r) { | |
for (; n < t.length; n++) | |
if ((r ? t[n][r] : t[n]) === e) | |
return n; | |
return -1 | |
} | |
function m(e, n) { | |
return e[n] !== t | |
} | |
function v(t) { | |
return t | |
} | |
e._period = 30, | |
e.prototype = { | |
observe: function(t, e) { | |
for (var r = { | |
attr: !!(e.attributes || e.attributeFilter || e.attributeOldValue), | |
kids: !!e.childList, | |
descendents: !!e.subtree, | |
charData: !(!e.characterData && !e.characterDataOldValue) | |
}, o = this._watched, a = 0; a < o.length; a++) | |
o[a].tar === t && o.splice(a, 1); | |
e.attributeFilter && (r.afilter = f(e.attributeFilter, function(t, e) { | |
return t[e] = !0, | |
t | |
}, {})), | |
o.push({ | |
tar: t, | |
fn: i(t, r) | |
}), | |
this._timeout || n(this) | |
}, | |
takeRecords: function() { | |
for (var t = [], e = this._watched, n = 0; n < e.length; n++) | |
e[n].fn(t); | |
return t | |
}, | |
disconnect: function() { | |
this._watched = [], | |
clearTimeout(this._timeout), | |
this._timeout = null | |
} | |
}; | |
var g = document.createElement("i"); | |
g.style.top = 0, | |
g = "null" != g.attributes.style.value; | |
var y = g ? o : a | |
, _ = 1 | |
, b = "mo_id"; | |
return e | |
}(void 0), | |
function(t) { | |
"use strict"; | |
var e = ["items", "totalizers", "clientProfileData", "shippingData", "paymentData", "sellers", "messages", "marketingData", "clientPreferencesData", "storePreferencesData", "giftRegistryData", "ratesAndBenefitsData", "openTextField", "commercialConditionData"] | |
, n = {} | |
, r = new Date | |
, i = {}; | |
i.upperAllFirstLetter = function(t) { | |
if (t) { | |
for (var e, n, r = t.toLowerCase(), i = r.split(" "), o = 0; o < i.length; o++) | |
e = i[o], | |
(n = e[0]) && (e = n.toUpperCase() + e.slice(1), | |
i[o] = e); | |
return i.join(" ") | |
} | |
} | |
, | |
i.toFormData = function(t) { | |
var e = ""; | |
for (var n in t) | |
e += "&" + n + "=" + t[n]; | |
return e && (e = e.substring(1)), | |
e | |
} | |
, | |
i.getNumberOfString = function(t) { | |
if (t) | |
return t.replace(/[^0-9]/g, "") | |
} | |
, | |
i.getIdUserCripty = function(t) { | |
if (t) | |
return t.match(/\'(.*)'/, ""), | |
"object" == typeof t ? t[1] : "" | |
} | |
, | |
i.toObjectReview = function(e) { | |
var n = new DOMParser | |
, r = n.parseFromString(e, "text/html") | |
, o = { | |
userId: null, | |
rating: null, | |
media: null, | |
comments: [] | |
}; | |
return t(r).find(".resenhas > .quem > li").each(function() { | |
var e = t(this); | |
o.comments.push({ | |
author: e.find(".dados > strong").text().replace("Opiniรฃo de: ", ""), | |
rating: t.trim(e.find(".rating-wrapper div").attr("class").replace("rating", "")), | |
comment: e.find(".opt-texto p").text(), | |
id: i.getNumberOfString(e.find("#lnkAjudou").attr("href")) | |
}) | |
}), | |
o.userId = i.getIdUserCripty(t(r).find("#ulPubliqueResenha #lnkPubliqueResenha").attr("href")), | |
o.rating = t(r).find(".avaliacao > ul.rating").html(), | |
o.media = t(r).find(".media > em").html(), | |
o | |
} | |
, | |
i.getPriceTotalBuyTogether = function(e) { | |
if (e) | |
return e = e.match(/total:(.*)/, ""), | |
"object" == typeof e ? t.trim(e[1]) : "" | |
} | |
, | |
i.getSkusBuyTogether = function(t) { | |
var e = []; | |
if (t) | |
return e = t.match(/sku=[0-9]{0,}/g, ""), | |
"object" != typeof e ? "" : (e[0] = i.getNumberOfString(e[0]), | |
e[1] = i.getNumberOfString(e[1]), | |
e) | |
} | |
, | |
i.toObjectBuyTogether = function(e) { | |
var n, r, o = new DOMParser, a = o.parseFromString(e, "text/html"), s = { | |
url: null, | |
category: null, | |
total_price: null, | |
installment: null, | |
skus: [], | |
items: [] | |
}; | |
return n = t(a).find(".buy > strong:eq(0)").text(), | |
r = t(a).find(".buy > strong:eq(1)").text(), | |
s.url = t(a).find(".comprar-junto > #lnkComprar").attr("href"), | |
s.installment = { | |
number: t.trim(n), | |
price: t.trim(r) | |
}, | |
s.total_price = i.getPriceTotalBuyTogether(t(a).find(".buy").text()), | |
s.category = t(a).find(".more > a#lnkVejaMais").attr("href"), | |
s.skus = i.getSkusBuyTogether(s.url), | |
s.items.push({ | |
thumb: t(a).find(".itemA a img").attr("src"), | |
title: t(a).find(".itemA h3").text(), | |
url: t(a).find(".itemA a").attr("href") | |
}), | |
s.items.push({ | |
thumb: t(a).find(".itemB a img").attr("src"), | |
title: t(a).find(".itemB h3").text(), | |
url: t(a).find(".itemB a").attr("href") | |
}), | |
s | |
} | |
, | |
i.monthNumber = function(t) { | |
if (t) { | |
var e; | |
switch (t) { | |
case "jan": | |
e = 0; | |
break; | |
case "fev": | |
e = 1; | |
break; | |
case "mar": | |
e = 2; | |
break; | |
case "abr": | |
e = 3; | |
break; | |
case "mai": | |
e = 4; | |
break; | |
case "jun": | |
e = 5; | |
break; | |
case "jul": | |
e = 6; | |
break; | |
case "ago": | |
e = 7; | |
break; | |
case "set": | |
e = 8; | |
break; | |
case "out": | |
e = 9; | |
break; | |
case "nov": | |
e = 10; | |
break; | |
case "dez": | |
e = 11 | |
} | |
return e | |
} | |
} | |
, | |
i.formatData = function(t) { | |
return t = t.replace(",", ""), | |
t = t.split(" "), | |
t[0] = String(this.monthNumber(t[0])), | |
new Date(t[2],t[0],t[1],hours[0],hours[1],hours[2]) | |
} | |
; | |
var o = function() { | |
return null | |
}; | |
o.prototype.config = function(t) { | |
if (this.params = t, | |
this.params) { | |
var e = { | |
Accept: "application/json; charset=utf-8", | |
"Content-Type": "application/json", | |
"REST-Range": "resources=0-49" | |
}; | |
n.DEBUG = this.params.DEBUG || !1, | |
n.headers = this.params.headers || e, | |
n.store_url = this.params.store_url || "", | |
n.url_api_search = n.store_url + "/api/catalog_system/pub/products/search", | |
n.url_api_search_autocomplete = n.store_url + "/buscaautocomplete", | |
n.url_api_search_buscapagina = n.store_url + "/buscapagina", | |
n.url_api_category = n.store_url + "/api/catalog_system/pub/category/tree/3", | |
n.url_api_brand = n.store_url + "/api/catalog_system/pvt/brand/list", | |
n.url_product_sku = n.store_url + "/produto/sku/", | |
n.url_product_variations = n.store_url + "/api/catalog_system/pub/products/variations/", | |
n.url_profile = n.store_url + "/api/checkout/pub/profiles", | |
n.url_get_profile = n.store_url + "/no-cache/profileSystem/getProfile", | |
n.url_order_form = n.store_url + "/api/checkout/pub/orderForm", | |
n.url_orders = n.store_url + "/api/checkout/pub/orders/", | |
n.url_orders_oms = n.store_url + "/api/oms/pvt/orders/", | |
n.url_postcode = n.store_url + "/no-cache/postalcode/address/", | |
n.url_simulation_shipping = n.store_url + "/api/checkout/pub/orderForms/simulation", | |
n.url_warn_me = n.store_url + "/no-cache/AviseMe.aspx", | |
n.url_sku_details = n.store_url + "/api/catalog_system/pvt/sku/stockkeepingunitbyid/", | |
n.url_publish_userreviewcomment = n.store_url + "/publishuserreviewcomment", | |
n.url_userreview = n.store_url + "/userreview", | |
n.url_publish_userreviewrelevance = n.store_url + "/PublishUserReviewRelevance", | |
n.url_add_coupon = n.store_url + "/coupons", | |
n.url_attachments_shippingData = n.store_url + "/attachments/shippingData", | |
n.url_attachments_openTextField = n.store_url + "/attachments/openTextField", | |
n.url_address_save = n.store_url + "/no-cache/account/address/save", | |
n.url_profile_save = n.store_url + "/no-cache/account/profile/save", | |
n.url_address_remove = n.store_url + "/no-cache/account/address/delete/", | |
n.url_address_detail = n.store_url + "/no-cache/account/address/detail/", | |
n.url_user_logout = n.store_url + "/no-cache/user/logout", | |
n.url_orderform_clear = n.store_url + "/checkout/changeToAnonymousUser/", | |
n.url_buy_together = n.store_url + "/comprejuntosku/", | |
n.url_service_sku = n.store_url + "/servico/", | |
n.url_api_newsletter = n.store_url + "/no-cache/Newsletter.aspx", | |
n.url_api_dataserver = n.store_url + "/no-cache/HoraAtualServidor.aspx", | |
n.url_api_carriers = n.store_url + "/api/logistics/pvt/configuration/carriers", | |
n.header = this.params.headers, | |
n.apiMasterData = "/api/dataentities/" | |
} else | |
console.error("Metodo config nรฃo definido!") | |
} | |
, | |
o.prototype.log = function(t) { | |
if (t) | |
return this.DEBUG && console.log(t) | |
} | |
, | |
o.prototype.error = function(t) { | |
if (t) | |
return this.DEBUG && console.error(t) | |
} | |
, | |
o.prototype.warn = function(t) { | |
if (t) | |
return this.DEBUG && console.warn(t) | |
} | |
, | |
o.prototype.parameters = function(t) { | |
if (!t) | |
return ""; | |
var e = ""; | |
for (var n in t) | |
e += "&" + n + "=" + t[n]; | |
return "?" + e.substring(1) | |
} | |
, | |
o.prototype.ajax = function(e, n, r, i, o, a) { | |
if (e && n) { | |
var s, l; | |
a && "object" == typeof r ? (r = JSON.stringify(r), | |
s = "application/json", | |
l = "json") : (s = "application/x-www-form-urlencoded; charset=UTF-8", | |
l = ""), | |
t.ajax({ | |
url: e, | |
type: n, | |
contentType: s, | |
dataType: l, | |
data: r || "", | |
success: function(t) { | |
i(t) | |
}, | |
error: function(t) { | |
o(t) | |
} | |
}) | |
} | |
} | |
, | |
o.prototype.search = function() { | |
var e = this; | |
return { | |
products: function(r, i, o) { | |
if (r) { | |
var a = "function" == typeof i && "function" == typeof o; | |
t.getJSON(n.url_api_search + e.parameters(r), function(t) { | |
a && i(t) | |
}, function(t) { | |
a && o(t) | |
}) | |
} | |
}, | |
autocomplete: function(r, i, o, a) { | |
if (r) { | |
var s = "function" == typeof i && "function" == typeof o | |
, l = { | |
productNameContains: r | |
} | |
, c = a || !1; | |
t.getJSON(n.url_api_search_autocomplete + e.parameters(l), function(t) { | |
s && i(!!t && (c ? [{ | |
items: [], | |
thumb: "", | |
thumbUrl: null, | |
name: "Pocket em Toy", | |
href: "http://corebiz.vtexcommercestable.com.br/toy/Pocket", | |
criteria: "ยฃPocket em Toyยข/toy/Pocket" | |
}, { | |
items: [{ | |
itemId: "21", | |
name: "Greg", | |
nameComplete: "Pocket Steven Universo Greg", | |
imageUrl: "http://corebiz.vteximg.com.br/arquivos/ids/156430-25-25/greg.jpg" | |
}, { | |
itemId: "22", | |
name: "Connie", | |
nameComplete: "Pocket Steven Universo Connie", | |
imageUrl: "http://corebiz.vteximg.com.br/arquivos/ids/156431-25-25/connie.jpg" | |
}, { | |
itemId: "23", | |
name: "Garnet", | |
nameComplete: "Pocket Steven Universo Garnet", | |
imageUrl: "http://corebiz.vteximg.com.br/arquivos/ids/156432-25-25/garnet.jpg" | |
}, { | |
itemId: "24", | |
name: "Leon", | |
nameComplete: "Pocket Steven Universo Leon", | |
imageUrl: "http://corebiz.vteximg.com.br/arquivos/ids/156434-25-25/leon.jpg" | |
}, { | |
itemId: "25", | |
name: "Rose", | |
nameComplete: "Pocket Steven Universo Rose", | |
imageUrl: "http://corebiz.vteximg.com.br/arquivos/ids/156435-25-25/rose.jpg" | |
}, { | |
itemId: "26", | |
name: "Peridot", | |
nameComplete: "Pocket Steven Universo Peridot", | |
imageUrl: "http://corebiz.vteximg.com.br/arquivos/ids/156436-25-25/peridot.jpg" | |
}, { | |
itemId: "27", | |
name: "Pรฉrola", | |
nameComplete: "Pocket Steven Universo Pรฉrola", | |
imageUrl: "http://corebiz.vteximg.com.br/arquivos/ids/156437-25-25/perola.jpg" | |
}, { | |
itemId: "28", | |
name: "steven", | |
nameComplete: "Pocket Steven Universo steven", | |
imageUrl: "http://corebiz.vteximg.com.br/arquivos/ids/156439-25-25/1stevenuniverse.jpg" | |
}], | |
thumb: '<img src="http://corebiz.vteximg.com.br/arquivos/ids/156439-25-25/1stevenuniverse.jpg" width="25" height="25" alt="steven" id="" />', | |
thumbUrl: "http://corebiz.vteximg.com.br/arquivos/ids/156439-25-25/1stevenuniverse.jpg", | |
name: "pocket steven universo", | |
href: "http://corebiz.vtexcommercestable.com.br/pocket_steven_universo/p", | |
criteria: null | |
}] : t.itemsReturned)) | |
}, function(t) { | |
s && o(t) | |
}) | |
} | |
}, | |
buscapagina: function(r, i, o) { | |
if (r) { | |
var a = "function" == typeof i && "function" == typeof o; | |
e.ajax(n.url_api_search_buscapagina + e.parameters(r), "GET", null, function(e) { | |
var n = t.parseHTML(e); | |
a && i(n) | |
}, function(t) { | |
a && o(t) | |
}, !0) | |
} | |
}, | |
goPageSearch: function(t) { | |
t && (window.location.href = "/" + t) | |
} | |
} | |
} | |
, | |
o.prototype.default = function() { | |
var e = this; | |
return { | |
init: function(r, i) { | |
var o = "function" == typeof r && "function" == typeof i; | |
t.getJSON(n.url_api_search + e.parameters(config), function(t) { | |
o && r(t) | |
}, function(t) { | |
o && i(t) | |
}) | |
} | |
} | |
} | |
, | |
o.prototype.brands = function() { | |
return { | |
list: function(e, r) { | |
var i = "function" == typeof e && "function" == typeof r; | |
t.getJSON(n.url_api_brand, function(t) { | |
i && e(t) | |
}, function(t) { | |
i && r(t) | |
}) | |
} | |
} | |
} | |
, | |
o.prototype.category = function() { | |
return { | |
list: function(e, r, i) { | |
var o = "function" == typeof e && "function" == typeof r | |
, a = i || !1; | |
t.getJSON(n.url_api_category, function(t) { | |
o && e(a ? [{ | |
id: 1, | |
name: "Testes e Integraรงรฃo (Departamento)", | |
hasChildren: !1, | |
url: "http://corebiz.vtexcommercestable.com.br/testes-e-integracao--departamento-", | |
children: [] | |
}, { | |
id: 4, | |
name: "Moda", | |
hasChildren: !1, | |
url: "http://corebiz.vtexcommercestable.com.br/moda", | |
children: [{ | |
id: 5, | |
name: "Vestuario", | |
hasChildren: !1, | |
url: "http://corebiz.vtexcommercestable.com.br/moda/vestuario", | |
children: [] | |
}, { | |
id: 6, | |
name: "Celulares", | |
hasChildren: !1, | |
url: "http://corebiz.vtexcommercestable.com.br/moda/celulares", | |
children: [] | |
}, { | |
id: 7, | |
name: "Acessorios", | |
hasChildren: !1, | |
url: "http://corebiz.vtexcommercestable.com.br/moda/acessorios", | |
children: [] | |
}] | |
}, { | |
id: 8, | |
name: "Eletrรดnicos", | |
hasChildren: !1, | |
url: "http://corebiz.vtexcommercestable.com.br/eletronicos", | |
children: [] | |
}, { | |
id: 10, | |
name: "Parceiros VTEX Store", | |
hasChildren: !1, | |
url: "http://corebiz.vtexcommercestable.com.br/parceiros-vtex-store", | |
children: [] | |
}, { | |
id: 12, | |
name: "Toy", | |
hasChildren: !1, | |
url: "http://corebiz.vtexcommercestable.com.br/toy", | |
children: [{ | |
id: 13, | |
name: "steven universo", | |
hasChildren: !1, | |
url: "http://corebiz.vtexcommercestable.com.br/toy/steven-universo", | |
children: [] | |
}] | |
}, { | |
id: 14, | |
name: "recorrencia", | |
hasChildren: !1, | |
url: "http://corebiz.vtexcommercestable.com.br/recorrencia", | |
children: [] | |
}] : t) | |
}, function(t) { | |
o && r(t) | |
}) | |
} | |
} | |
} | |
, | |
o.prototype.products = function() { | |
var e = this; | |
return { | |
service: function(e, r, i) { | |
if (e) { | |
var o = "function" == typeof r && "function" == typeof i; | |
t.get(n.url_service_sku + e, function(t) { | |
o && r(t || !1) | |
}) | |
} | |
}, | |
buyTogether: function(e, r, o, a) { | |
if (e) { | |
var s = "function" == typeof r && "function" == typeof o | |
, l = a || !1; | |
t.post(n.url_buy_together + e, function(t) { | |
s && r(!!t && (l ? { | |
url: "https://corebiz.vtexcommercestable.com.br/checkout/cart/add?sku=3&sku=19&qtโฆ97a901a7e09572e8f34c43c1037f41_geral:467225D68C45B0DCBF4368FECA3DFB67&sc=1", | |
category: "http://corebiz.vtexcommercestable.com.br/moda", | |
total_price: "R$ 110,98", | |
installment: { | |
number: "12x", | |
price: "R$ 9,24" | |
}, | |
skus: ["3", "19"], | |
items: [{ | |
thumb: "http://corebiz.vteximg.com.br/arquivos/ids/155398-90-90/carexemplo.png", | |
title: "Produto Variaรงรฃo Cor e Tam SKU Variaรงรฃo Cor1 e Tam 1", | |
url: "http://corebiz.vtexcommercestable.com.br/produto-variacao-cor-e-tam/p" | |
}, { | |
thumb: "http://corebiz.vteximg.com.br/arquivos/ids/155397-90-90/corebiz-vtex-store.jpg", | |
title: "Agรชncia Corebiz Vermelho", | |
url: "http://corebiz.vtexcommercestable.com.br/corebiz/p" | |
}] | |
} : i.toObjectBuyTogether(t))) | |
}) | |
} | |
}, | |
sku: function(e, r, i) { | |
if (e) { | |
var o = "function" == typeof r && "function" == typeof i; | |
t.getJSON(n.url_product_sku + e, function(t) { | |
o && r(t) | |
}, function(t) { | |
o && i(t) | |
}) | |
} | |
}, | |
product: function(t, n, r) { | |
if (t) { | |
var i = "function" == typeof n && "function" == typeof r; | |
e.search().products({ | |
fq: "productId:" + t | |
}, function(t) { | |
i && n(t) | |
}, function(t) { | |
i && r(t) | |
}) | |
} | |
}, | |
variations: function(e, r, i) { | |
if (e) { | |
var o = "function" == typeof r && "function" == typeof i; | |
t.getJSON(n.url_product_variations + e, function(t) { | |
o && r(t) | |
}, function(t) { | |
o && i(t) | |
}) | |
} | |
}, | |
simulationShipping: function(t, r, i) { | |
if (t) { | |
var o = "function" == typeof r && "function" == typeof i; | |
e.ajax(n.url_simulation_shipping, "POST", t, function(t) { | |
o && r(!!t.logisticsInfo && t.logisticsInfo) | |
}, function(t) { | |
o && i(t) | |
}, !0) | |
} | |
}, | |
warnMe: function(t, r, o) { | |
if (t) { | |
var a = i.toFormData(t) | |
, s = "function" == typeof r && "function" == typeof o; | |
e.ajax(n.url_warn_me, "POST", a, function(t) { | |
s && r(t) | |
}, function(t) { | |
s && o(t) | |
}, !0) | |
} | |
}, | |
skuDetails: function(e, r, i) { | |
if (e) { | |
var o = "function" == typeof r && "function" == typeof i; | |
t.getJSON(n.url_sku_details + e, function(t) { | |
o && r(t) | |
}, function(t) { | |
o && i(t) | |
}) | |
} | |
}, | |
publishReviewComment: function(t, r, o) { | |
if (t && Object.keys(t).length) { | |
var a = "function" == typeof r && "function" == typeof o; | |
e.orderForm().list(function(s) { | |
if (s.loggedIn) { | |
var l = encodeURI("<Score><EvaluationRating><EvaluationId>" + t.productId + "</EvaluationId><Rating>" + t.ratingValue + "</Rating></EvaluationRating></Score>"); | |
l = String(l); | |
var c = { | |
userId: t.userId, | |
productId: t.productId, | |
title: t.title, | |
comment: t.comment, | |
allowShowUserEmail: "false", | |
ratingValue: encodeURI(l), | |
save: "true", | |
categoryId: t.categoryId | |
} | |
, u = i.toFormData(c); | |
e.ajax(n.url_publish_userreviewcomment, "POST", u, function(t) { | |
a && r(t) | |
}, function(t) { | |
a && o(t) | |
}, !0) | |
} | |
}, function(t) { | |
a && o(t) | |
}) | |
} | |
}, | |
userReview: function(t, r, o, a) { | |
if (t) { | |
var s = { | |
productLinkId: t.produto_variacao, | |
qtdReviewsToBeShown: t.qtdReviewsToBeShown, | |
productId: t.productId, | |
categoryId: t.categoryId | |
} | |
, l = i.toFormData(s) | |
, c = "function" == typeof r && "function" == typeof o | |
, u = a || !1; | |
e.ajax(n.url_userreview, "POST", l, function(t) { | |
c && r(u ? { | |
userId: "", | |
rating: '<strong id="spnRatingProdutoBottom" class="rating-produto avaliacao30">\n <li>\n <em class="voteRatingStar">\n <strong class="rating-demonstrativo avaliacao50">\n </strong></em><strong class="rating-demonstrativo avaliacao50">\n <span class="voteRatingBar">\n <span style="width: 0%">\n </span>\n <span>nenhum voto</span>\n </span></strong></li><strong class="rating-demonstrativo avaliacao50">\n <li>\n <em class="voteRatingStar">\n <strong class="rating-demonstrativo avaliacao40">\n </strong></em><strong class="rating-demonstrativo avaliacao40">\n <span class="voteRatingBar">\n <span style="width: 0%">\n </span>\n <span>nenhum voto</span>\n </span></strong></li><strong class="rating-demonstrativo avaliacao40">\n <li>\n <em class="voteRatingStar">\n <strong class="rating-demonstrativo avaliacao30">\n </strong></em><strong class="rating-demonstrativo avaliacao30">\n <span class="voteRatingBar">\n <span style="width: 100%">\n </span>\n <span> 1 Voto</span>\n </span></strong></li><strong class="rating-demonstrativo avaliacao30">\n <li>\n <em class="voteRatingStar">\n <strong class="rating-demonstrativo avaliacao20">\n </strong></em><strong class="rating-demonstrativo avaliacao20">\n <span class="voteRatingBar">\n <span style="width: 0%">\n </span>\n <span>nenhum voto</span>\n </span></strong></li><strong class="rating-demonstrativo avaliacao20">\n <li>\n <em class="voteRatingStar">\n <strong class="rating-demonstrativo avaliacao10">\n </strong></em><strong class="rating-demonstrativo avaliacao10">\n <span class="voteRatingBar">\n <span style="width: 0%">\n </span>\n <span>nenhum voto</span>\n </span></strong></li><strong class="rating-demonstrativo avaliacao10">\n </strong></strong></strong></strong></strong></strong>', | |
media: '\n <strong id="spnRatingProdutoBottom" class="rating-produto avaliacao30">\n <span>\n1 voto\n</span>\n </strong>', | |
comments: [{ | |
author: "Rafael", | |
rating: "a30", | |
comment: "Meu comentario 2", | |
id: "24" | |
}] | |
} : i.toObjectReview(t)) | |
}, function(t) { | |
c && o(t) | |
}, !0) | |
} | |
}, | |
ratingValue: function(t, r, i) { | |
if (t && Object.keys(t).length) { | |
var o = { | |
productId: t.productId, | |
categoryId: t.categoryId, | |
productLinkId: t.productLinkId, | |
ratingValue: t.ratingValue, | |
qtdReviewsToBeShown: t.qtdReviewsToBeShown | |
} | |
, a = "function" == typeof r && "function" == typeof i; | |
e.ajax(n.url_userreview, "POST", o, function(t) { | |
a && r(t) | |
}, function(t) { | |
a && i(t) | |
}, !0) | |
} | |
}, | |
ratingViewRelevance: function(t, r, i) { | |
if (t && Object.keys(t).length) { | |
var o = { | |
ProductId: t.ProductId, | |
PaginaAtual: t.PaginaAtual, | |
TamPagina: t.TamPagina, | |
SortOrder: t.SortOrder, | |
isRelevant: t.isRelevant, | |
reviewId: t.reviewId, | |
qtdReviewsToBeShown: t.qtdReviewsToBeShown, | |
source: "UserReview", | |
currentPage: t.currentPage | |
} | |
, a = "function" == typeof r && "function" == typeof i; | |
e.ajax(n.url_publish_userreviewrelevance, "POST", o, function(t) { | |
a && r(t) | |
}, function(t) { | |
a && i(t) | |
}, !0) | |
} | |
} | |
} | |
} | |
, | |
o.prototype.profile = function() { | |
var e = this; | |
return { | |
getProfileByEmail: function(r, i, o) { | |
if (r) { | |
var a = "function" == typeof i && "function" == typeof o; | |
t.getJSON(n.url_profile + e.parameters(r), function(t) { | |
a && i(t) | |
}, function(t) { | |
a && o(t) | |
}) | |
} | |
}, | |
getProfile: function(e, r, i) { | |
var o = "function" == typeof e && "function" == typeof r | |
, a = i || !1; | |
t.getJSON(n.url_get_profile, function(t) { | |
o && e(a ? { | |
UserId: "555c43ff-c97c-43a8-8bfc-2e76e2255cc0", | |
IsReturningUser: !0, | |
IsUserDefined: !0, | |
IsPJ: !1, | |
FirstName: "Rafael", | |
LastName: "Cruz", | |
Gender: "M", | |
Email: "rafael.cruz@corebiz.com.br" | |
} : t) | |
}, function(t) { | |
o && r(t) | |
}) | |
}, | |
isUserLogged: function(t, n) { | |
var r = "function" == typeof t && "function" == typeof n; | |
e.orderForm().list(function(e) { | |
r && t(e.loggedIn) | |
}, function(t) { | |
r && n(t) | |
}) | |
}, | |
postcode: function(e, r, i) { | |
var o = "function" == typeof r && "function" == typeof i; | |
e && t.getJSON(n.url_postcode + e, function(t) { | |
o && r(t) | |
}, function(t) { | |
o && i(t) | |
}) | |
}, | |
getClientProfileData: function(t, n) { | |
var r = "function" == typeof t && "function" == typeof n; | |
e.orderForm().list(function(e) { | |
r && t(e.clientProfileData) | |
}, function(t) { | |
r && n(t) | |
}) | |
}, | |
getAddresses: function(t, e) { | |
var n = "function" == typeof t && "function" == typeof e | |
, r = this; | |
this.getProfile(function(i) { | |
if (!i && n) | |
return void t(!1); | |
var o = i.Email; | |
o || t(!1), | |
r.getProfileByEmail({ | |
email: o | |
}, function(e) { | |
t(!(!n || !e) && { | |
email: o, | |
availableAddresses: e.availableAddresses | |
}) | |
}, function(t) { | |
n && e(t) | |
}) | |
}, function(t) { | |
console.error(t) | |
}) | |
}, | |
getAddress: function(e, r, i) { | |
var o = "function" == typeof r && "function" == typeof i; | |
t.getJSON(n.url_address_detail + e, function(t) { | |
o && r(t || !1) | |
}, function(t) { | |
o && i(t) | |
}) | |
}, | |
saveAddress: function(t, r, o) { | |
var a = "function" == typeof r && "function" == typeof o | |
, s = i.toFormData(t); | |
e.ajax(n.url_address_save, "POST", s, function() { | |
a && r(!0) | |
}, function(t) { | |
a && o(t) | |
}, !0) | |
}, | |
saveProfile: function(t, r, o) { | |
var a = "function" == typeof r && "function" == typeof o | |
, s = i.toFormData(t); | |
e.ajax(n.url_profile_save, "POST", s, function(t) { | |
a && r(t) | |
}, function(t) { | |
a && o(t) | |
}, !0) | |
}, | |
removeAddress: function(e, r, i) { | |
var o = "function" == typeof r && "function" == typeof i; | |
e && t.get(n.url_address_remove + e, function(t) { | |
o && r(t) | |
}, function(t) { | |
o && i(t) | |
}, !0) | |
}, | |
loggout: function(e, r) { | |
var i = "function" == typeof e && "function" == typeof r; | |
i ? t.get(n.url_user_logout, function(t) { | |
i && e(t) | |
}, function(t) { | |
i && r(t) | |
}, !0) : window.location.href = n.url_user_logout | |
} | |
} | |
} | |
, | |
o.prototype.order = function() { | |
return { | |
list: function(e, r) { | |
var i = "function" == typeof e && "function" == typeof r; | |
t.getJSON(n.url_orders, function(t) { | |
i && e(t) | |
}, function(t) { | |
i && r(t) | |
}) | |
}, | |
orderByIdOrEmail: function(e, r, i) { | |
var o = "function" == typeof r && "function" == typeof i; | |
e && t.getJSON(n.url_orders + e, function(t) { | |
o && r(t) | |
}, function(t) { | |
o && i(t) | |
}) | |
}, | |
oms: function(e, r, i) { | |
var o = "function" == typeof r && "function" == typeof i; | |
e && t.getJSON(n.url_orders_oms + e, function(t) { | |
o && r(t) | |
}, function(t) { | |
o && i(t) | |
}) | |
} | |
} | |
} | |
, | |
o.prototype.cart = function() { | |
var t = this; | |
return { | |
list: function(e, n, r) { | |
var i = "function" == typeof e && "function" == typeof n | |
, o = r || !1; | |
t.orderForm().list(function(t) { | |
var n = {} | |
, r = t.items.reduce(function(t, e) { | |
return t + e.quantity | |
}, 0); | |
n.resume = { | |
total_cart: t.value, | |
quantity_cart: r | |
}, | |
n.items = t.items, | |
i && e(o ? { | |
resume: { | |
total_cart: 19798, | |
quantity_cart: 2 | |
}, | |
items: [{ | |
uniqueId: "3C181015F9294BECB6AB3DAEECC3971A", | |
id: "30", | |
productId: "9", | |
refId: "camisetaazulpp", | |
ean: null, | |
name: "camiseta azul-pp", | |
skuName: "azul-pp", | |
modalType: null, | |
priceValidUntil: "2018-05-01T02:03:56.4800255Z", | |
tax: 0, | |
price: 9899, | |
listPrice: 2e4, | |
manualPrice: null, | |
sellingPrice: 9899, | |
rewardValue: 0, | |
isGift: !1, | |
additionalInfo: { | |
brandName: "Marca Eletrรดnicos", | |
brandId: "2000001", | |
offeringInfo: null, | |
offeringType: null, | |
offeringTypeId: null | |
}, | |
preSaleDate: null, | |
productCategoryIds: "/4/5/", | |
productCategories: { | |
4: "Moda", | |
5: "Vestuario" | |
}, | |
defaultPicker: null, | |
handlerSequence: 0, | |
handling: !1, | |
quantity: 1, | |
seller: "1", | |
imageUrl: "http://corebiz.vteximg.com.br/arquivos/ids/156440-55-55/ico-socks-2x.png", | |
detailUrl: "/camiseta/p", | |
components: [], | |
bundleItems: [], | |
attachments: [], | |
itemAttachment: { | |
name: null, | |
content: {} | |
}, | |
attachmentOfferings: [], | |
offerings: [], | |
priceTags: [], | |
availability: "available", | |
measurementUnit: "un", | |
unitMultiplier: 1 | |
}, { | |
uniqueId: "3C181015F9294BECB6AB3DAEECC3971A", | |
id: "30", | |
productId: "9", | |
refId: "camisetaazulpp", | |
ean: null, | |
name: "camiseta azul-pp 2", | |
skuName: "azul-pp", | |
modalType: null, | |
priceValidUntil: "2018-05-01T02:03:56.4800255Z", | |
tax: 0, | |
price: 9899, | |
listPrice: 2e4, | |
manualPrice: null, | |
sellingPrice: 9899, | |
rewardValue: 0, | |
isGift: !1, | |
additionalInfo: { | |
brandName: "Marca Eletrรดnicos", | |
brandId: "2000001", | |
offeringInfo: null, | |
offeringType: null, | |
offeringTypeId: null | |
}, | |
preSaleDate: null, | |
productCategoryIds: "/4/5/", | |
productCategories: { | |
4: "Moda", | |
5: "Vestuario" | |
}, | |
defaultPicker: null, | |
handlerSequence: 0, | |
handling: !1, | |
quantity: 1, | |
seller: "1", | |
imageUrl: "http://corebiz.vteximg.com.br/arquivos/ids/156440-55-55/ico-socks-2x.png", | |
detailUrl: "/camiseta/p", | |
components: [], | |
bundleItems: [], | |
attachments: [], | |
itemAttachment: { | |
name: null, | |
content: {} | |
}, | |
attachmentOfferings: [], | |
offerings: [], | |
priceTags: [], | |
availability: "available", | |
measurementUnit: "un", | |
unitMultiplier: 1 | |
}] | |
} : n) | |
}, function(t) { | |
i && error_fnr(t) | |
}) | |
}, | |
handleremove: function(r, i, o, a) { | |
if (r = r || 0, | |
0 !== i.items.length) { | |
var s = "function" == typeof o && "function" == typeof a | |
, l = [{ | |
index: r, | |
quantity: 0 | |
}] | |
, c = { | |
orderItems: l, | |
expectedOrderFormSections: e, | |
noSplitItem: !1 | |
} | |
, u = i.orderFormId; | |
return t.ajax(n.url_order_form + "/" + u + "/items/update", "POST", c, function(t) { | |
s && o(t) | |
}, function(t) { | |
s && a(t) | |
}, !0), | |
null | |
} | |
}, | |
handleRemoveAllSkus: function(r, i, o, a) { | |
if (0 !== i.items.length) { | |
var s = "function" == typeof o && "function" == typeof a | |
, l = []; | |
r >= 0 ? l.push({ | |
index: r, | |
quantity: 0 | |
}) : l = i.items.map(function(t, e) { | |
return { | |
index: e, | |
quantity: 0 | |
} | |
}), | |
t.warn(l); | |
var c = { | |
orderItems: l, | |
expectedOrderFormSections: e, | |
noSplitItem: !1 | |
} | |
, u = i.orderFormId; | |
return t.ajax(n.url_order_form + "/" + u + "/items/update", "POST", c, function(t) { | |
s && o(t) | |
}, function(t) { | |
s && a(t) | |
}, !0), | |
null | |
} | |
}, | |
remove: function(e, n, r, i) { | |
var o = "function" == typeof n && "function" == typeof r; | |
i || !1 ? n(!0) : t.orderForm().list(function(t) { | |
e >= 0 ? this.handleremove(e, t, function(t) { | |
o && n(t) | |
}, function(t) { | |
o && r(t) | |
}) : this.handleRemoveAllSkus(e, t, function(t) { | |
o && n(t) | |
}, function(t) { | |
o && r(t) | |
}) | |
} | |
.bind(this), function(t) { | |
r(t) | |
}) | |
}, | |
handleadd: function(r, i, o, a, s) { | |
var l = "function" == typeof a && "function" == typeof s | |
, c = { | |
orderItems: i, | |
expectedOrderFormSections: e | |
}; | |
return t.ajax(n.url_order_form + "/" + o + "/items?sc=" + r, "POST", c, function(t) { | |
l && a(t) | |
}, function(t) { | |
l && s(t) | |
}, !0), | |
null | |
}, | |
add: function(e, n, r, i, o) { | |
if (n && "object" == typeof n) { | |
var a = "function" == typeof r && "function" == typeof i; | |
o || !1 ? r(!0) : t.orderForm().list(function(t) { | |
this.handleadd(e, n, t.orderFormId, function(t) { | |
a && r(t) | |
}, function(t) { | |
a && i(t) | |
}) | |
} | |
.bind(this), function(t) { | |
i(t) | |
}) | |
} | |
}, | |
handleUpdate: function(r, i, o, a) { | |
var s = "function" == typeof o && "function" == typeof a; | |
r.hasBundleItems = !1; | |
var l = { | |
orderItems: r, | |
noSplitItem: !0, | |
expectedOrderFormSections: e | |
}; | |
return t.ajax(n.url_order_form + "/" + i + "/items/update/", "POST", l, function(t) { | |
s && o(t) | |
}, function(t) { | |
s && a(t) | |
}, !0), | |
null | |
}, | |
update: function(e, n, r, i) { | |
if (e && "object" == typeof e) { | |
var o = "function" == typeof n && "function" == typeof r; | |
i || !1 ? n(!0) : t.orderForm().list(function(t) { | |
this.handleUpdate(e, t.orderFormId, function(t) { | |
o && n(t) | |
}, function(t) { | |
o && r(t) | |
}) | |
} | |
.bind(this), function(t) { | |
r(t) | |
}) | |
} | |
}, | |
handleAddCoupon: function(r, i, o, a) { | |
var s = "function" == typeof o && "function" == typeof a | |
, l = { | |
text: r, | |
expectedOrderFormSections: e | |
}; | |
return t.ajax(n.url_order_form + "/" + i + n.url_add_coupon, "POST", l, function(t) { | |
s && o(t) | |
}, function(t) { | |
s && a(t) | |
}, !0), | |
null | |
}, | |
addCoupon: function(e, n, r, i, o) { | |
var a = "function" == typeof n && "function" == typeof r | |
, s = i || !1; | |
o = o || !1, | |
s ? n(!0) : t.orderForm().list(function(t) { | |
this.handleAddCoupon(e, t.orderFormId, function(t) { | |
a && n(!!(t.marketingData && t.marketingData.coupon === e || o) && t) | |
}, function(t) { | |
a && r(t) | |
}) | |
} | |
.bind(this), function(t) { | |
r(t) | |
}) | |
}, | |
deleteCoupon: function(t, e) { | |
var n = "function" == typeof t && "function" == typeof e; | |
this.addCoupon("", function(e) { | |
n && t(e) | |
}, function(e) { | |
n && t(e) | |
}, !1, !0) | |
}, | |
getCouponActive: function(e, n, r) { | |
var i = "function" == typeof e && "function" == typeof n; | |
r || !1 ? i && e({ | |
marketingData: { | |
attachmentId: "marketingData", | |
utmSource: null, | |
utmMedium: null, | |
utmCampaign: null, | |
utmipage: null, | |
utmiPart: null, | |
utmiCampaign: null, | |
coupon: "isDeveloperCupom", | |
marketingTags: [] | |
}, | |
totalizers: [{ | |
id: "Items", | |
name: "Total dos Itens", | |
value: 9899 | |
}, { | |
id: "Discounts", | |
name: "Total dos Descontos", | |
value: -990 | |
}], | |
value: 8909 | |
}) : t.orderForm().list(function(t) { | |
i && e(!(!t.marketingData || !t.marketingData.coupon) && { | |
marketingData: t.marketingData, | |
totalizers: t.totalizers, | |
value: t.value | |
}) | |
}, function(t) { | |
i && n(t) | |
}, !1) | |
}, | |
handleSimulationShipping: function(r, i, o, a) { | |
var s = "function" == typeof o && "function" == typeof a; | |
if (r) { | |
var l = { | |
address: { | |
postalCode: r, | |
country: "BRA" | |
}, | |
country: "BRA", | |
postalCode: "06416070", | |
expectedOrderFormSections: e | |
}; | |
return t.ajax(n.url_order_form + "/" + i + n.url_attachments_shippingData, "POST", l, function(t) { | |
s && o(t) | |
}, function(t) { | |
s && a(t) | |
}, !0), | |
null | |
} | |
}, | |
simulationShipping: function(e, n, r, i) { | |
if (e) { | |
var o = "function" == typeof n && "function" == typeof r; | |
i || !1 ? n([{ | |
id: "Sedex", | |
name: "Sedex", | |
deliveryIds: [{ | |
courierId: "1", | |
warehouseId: "1_1", | |
dockId: "1", | |
courierName: "Sedex", | |
quantity: 1 | |
}], | |
shippingEstimate: "3d", | |
shippingEstimateDate: null, | |
lockTTL: null, | |
availableDeliveryWindows: [{ | |
startDateUtc: "2017-05-04T07:00:00+00:00", | |
endDateUtc: "2017-05-04T21:00:00+00:00", | |
price: 2e3, | |
lisPrice: 2e3, | |
tax: 0 | |
}, { | |
startDateUtc: "2017-05-05T07:00:00+00:00", | |
endDateUtc: "2017-05-05T21:00:00+00:00", | |
price: 2e3, | |
lisPrice: 2e3, | |
tax: 0 | |
}], | |
deliveryWindow: null, | |
price: 500, | |
listPrice: 500, | |
tax: 0, | |
pickupStoreInfo: null | |
}]) : t.orderForm().list(function(t) { | |
this.handleSimulationShipping(e, t.orderFormId, function(t) { | |
o && n(t.shippingData.logisticsInfo) | |
}, function(t) { | |
o && r(t) | |
}) | |
} | |
.bind(this), function(t) { | |
r(t) | |
}) | |
} | |
} | |
} | |
} | |
, | |
o.prototype.orderForm = function() { | |
return { | |
list: function(e, r, i) { | |
var o = "function" == typeof e && "function" == typeof r; | |
i || !1 ? e({ | |
orderFormId: "35480778a7354d1b8162515599255c13", | |
salesChannel: "1", | |
loggedIn: !0, | |
isCheckedIn: !1, | |
storeId: null, | |
allowManualPrice: !1, | |
canEditData: !0, | |
userProfileId: "555c43ff-c97c-43a8-8bfc-2e76e2255cc0", | |
userType: null, | |
ignoreProfileData: !1, | |
value: 0, | |
messages: [], | |
items: [], | |
selectableGifts: [], | |
products: [], | |
totalizers: [], | |
shippingData: { | |
attachmentId: "shippingData", | |
address: { | |
addressType: null, | |
receiverName: null, | |
addressId: "0e33c6c6387c4a8da1c02d80a399eed2", | |
postalCode: "06416070", | |
city: "Barueri", | |
state: "SP", | |
country: "BRA", | |
street: "Rua Major รlvaro Fontes", | |
number: null, | |
neighborhood: "Vila Engenho Novo", | |
complement: null, | |
reference: null, | |
geoCoordinates: [] | |
}, | |
logisticsInfo: [], | |
availableAddresses: [{ | |
addressType: null, | |
receiverName: null, | |
addressId: "0e33c6c6387c4a8da1c02d80a399eed2", | |
postalCode: "06416070", | |
city: "Barueri", | |
state: "SP", | |
country: "BRA", | |
street: "Rua Major รlvaro Fontes", | |
number: null, | |
neighborhood: "Vila Engenho Novo", | |
complement: null, | |
reference: null, | |
geoCoordinates: [] | |
}] | |
}, | |
clientProfileData: { | |
attachmentId: "clientProfileData", | |
email: "rafael.cruz@corebiz.com.br", | |
firstName: null, | |
lastName: null, | |
document: null, | |
documentType: null, | |
phone: null, | |
corporateName: null, | |
tradeName: null, | |
corporateDocument: null, | |
stateInscription: null, | |
corporatePhone: null, | |
isCorporate: !1, | |
profileCompleteOnLoading: !1, | |
profileErrorOnLoading: !1 | |
}, | |
paymentData: { | |
installmentOptions: [{ | |
paymentSystem: "2", | |
bin: null, | |
paymentName: null, | |
paymentGroupName: null, | |
value: 39596, | |
installments: [{ | |
count: 1, | |
hasInterestRate: !1, | |
interestRate: 0, | |
value: 39596, | |
total: 39596, | |
sellerMerchantInstallments: [{ | |
id: "COREBIZ", | |
count: 1, | |
hasInterestRate: !1, | |
interestRate: 0, | |
value: 39596, | |
total: 39596 | |
}] | |
}, { | |
count: 2, | |
hasInterestRate: !1, | |
interestRate: 0, | |
value: 19798, | |
total: 39596, | |
sellerMerchantInstallments: [{ | |
id: "COREBIZ", | |
count: 2, | |
hasInterestRate: !1, | |
interestRate: 0, | |
value: 19798, | |
total: 39596 | |
}] | |
}, { | |
count: 3, | |
hasInterestRate: !1, | |
interestRate: 0, | |
value: 13198, | |
total: 39596, | |
sellerMerchantInstallments: [{ | |
id: "COREBIZ", | |
count: 3, | |
hasInterestRate: !1, | |
interestRate: 0, | |
value: 13198, | |
total: 39596 | |
}] | |
}, { | |
count: 4, | |
hasInterestRate: !1, | |
interestRate: 0, | |
value: 9899, | |
total: 39596, | |
sellerMerchantInstallments: [{ | |
id: "COREBIZ", | |
count: 4, | |
hasInterestRate: !1, | |
interestRate: 0, | |
value: 9899, | |
total: 39596 | |
}] | |
}, { | |
count: 5, | |
hasInterestRate: !1, | |
interestRate: 0, | |
value: 7919, | |
total: 39596, | |
sellerMerchantInstallments: [{ | |
id: "COREBIZ", | |
count: 5, | |
hasInterestRate: !1, | |
interestRate: 0, | |
value: 7919, | |
total: 39596 | |
}] | |
}, { | |
count: 6, | |
hasInterestRate: !1, | |
interestRate: 0, | |
value: 6599, | |
total: 39596, | |
sellerMerchantInstallments: [{ | |
id: "COREBIZ", | |
count: 6, | |
hasInterestRate: !1, | |
interestRate: 0, | |
value: 6599, | |
total: 39596 | |
}] | |
}, { | |
count: 7, | |
hasInterestRate: !1, | |
interestRate: 0, | |
value: 5656, | |
total: 39596, | |
sellerMerchantInstallments: [{ | |
id: "COREBIZ", | |
count: 7, | |
hasInterestRate: !1, | |
interestRate: 0, | |
value: 5656, | |
total: 39596 | |
}] | |
}, { | |
count: 8, | |
hasInterestRate: !1, | |
interestRate: 0, | |
value: 4949, | |
total: 39596, | |
sellerMerchantInstallments: [{ | |
id: "COREBIZ", | |
count: 8, | |
hasInterestRate: !1, | |
interestRate: 0, | |
value: 4949, | |
total: 39596 | |
}] | |
}, { | |
count: 9, | |
hasInterestRate: !1, | |
interestRate: 0, | |
value: 4399, | |
total: 39596, | |
sellerMerchantInstallments: [{ | |
id: "COREBIZ", | |
count: 9, | |
hasInterestRate: !1, | |
interestRate: 0, | |
value: 4399, | |
total: 39596 | |
}] | |
}, { | |
count: 10, | |
hasInterestRate: !1, | |
interestRate: 0, | |
value: 3959, | |
total: 39596, | |
sellerMerchantInstallments: [{ | |
id: "COREBIZ", | |
count: 10, | |
hasInterestRate: !1, | |
interestRate: 0, | |
value: 3959, | |
total: 39596 | |
}] | |
}, { | |
count: 11, | |
hasInterestRate: !1, | |
interestRate: 0, | |
value: 3599, | |
total: 39596, | |
sellerMerchantInstallments: [{ | |
id: "COREBIZ", | |
count: 11, | |
hasInterestRate: !1, | |
interestRate: 0, | |
value: 3599, | |
total: 39596 | |
}] | |
}, { | |
count: 12, | |
hasInterestRate: !1, | |
interestRate: 0, | |
value: 3299, | |
total: 39596, | |
sellerMerchantInstallments: [{ | |
id: "COREBIZ", | |
count: 12, | |
hasInterestRate: !1, | |
interestRate: 0, | |
value: 3299, | |
total: 39596 | |
}] | |
}] | |
}, { | |
paymentSystem: "4", | |
bin: null, | |
paymentName: null, | |
paymentGroupName: null, | |
value: 39596, | |
installments: [{ | |
count: 1, | |
hasInterestRate: !1, | |
interestRate: 0, | |
value: 39596, | |
total: 39596, | |
sellerMerchantInstallments: [{ | |
id: "COREBIZ", | |
count: 1, | |
hasInterestRate: !1, | |
interestRate: 0, | |
value: 39596, | |
total: 39596 | |
}] | |
}, { | |
count: 2, | |
hasInterestRate: !1, | |
interestRate: 0, | |
value: 19798, | |
total: 39596, | |
sellerMerchantInstallments: [{ | |
id: "COREBIZ", | |
count: 2, | |
hasInterestRate: !1, | |
interestRate: 0, | |
value: 19798, | |
total: 39596 | |
}] | |
}, { | |
count: 3, | |
hasInterestRate: !1, | |
interestRate: 0, | |
value: 13198, | |
total: 39596, | |
sellerMerchantInstallments: [{ | |
id: "COREBIZ", | |
count: 3, | |
hasInterestRate: !1, | |
interestRate: 0, | |
value: 13198, | |
total: 39596 | |
}] | |
}, { | |
count: 4, | |
hasInterestRate: !1, | |
interestRate: 0, | |
value: 9899, | |
total: 39596, | |
sellerMerchantInstallments: [{ | |
id: "COREBIZ", | |
count: 4, | |
hasInterestRate: !1, | |
interestRate: 0, | |
value: 9899, | |
total: 39596 | |
}] | |
}, { | |
count: 5, | |
hasInterestRate: !1, | |
interestRate: 0, | |
value: 7919, | |
total: 39596, | |
sellerMerchantInstallments: [{ | |
id: "COREBIZ", | |
count: 5, | |
hasInterestRate: !1, | |
interestRate: 0, | |
value: 7919, | |
total: 39596 | |
}] | |
}, { | |
count: 6, | |
hasInterestRate: !1, | |
interestRate: 0, | |
value: 6599, | |
total: 39596, | |
sellerMerchantInstallments: [{ | |
id: "COREBIZ", | |
count: 6, | |
hasInterestRate: !1, | |
interestRate: 0, | |
value: 6599, | |
total: 39596 | |
}] | |
}, { | |
count: 7, | |
hasInterestRate: !1, | |
interestRate: 0, | |
value: 5656, | |
total: 39596, | |
sellerMerchantInstallments: [{ | |
id: "COREBIZ", | |
count: 7, | |
hasInterestRate: !1, | |
interestRate: 0, | |
value: 5656, | |
total: 39596 | |
}] | |
}, { | |
count: 8, | |
hasInterestRate: !1, | |
interestRate: 0, | |
value: 4949, | |
total: 39596, | |
sellerMerchantInstallments: [{ | |
id: "COREBIZ", | |
count: 8, | |
hasInterestRate: !1, | |
interestRate: 0, | |
value: 4949, | |
total: 39596 | |
}] | |
}, { | |
count: 9, | |
hasInterestRate: !1, | |
interestRate: 0, | |
value: 4399, | |
total: 39596, | |
sellerMerchantInstallments: [{ | |
id: "COREBIZ", | |
count: 9, | |
hasInterestRate: !1, | |
interestRate: 0, | |
value: 4399, | |
total: 39596 | |
}] | |
}, { | |
count: 10, | |
hasInterestRate: !1, | |
interestRate: 0, | |
value: 3959, | |
total: 39596, | |
sellerMerchantInstallments: [{ | |
id: "COREBIZ", | |
count: 10, | |
hasInterestRate: !1, | |
interestRate: 0, | |
value: 3959, | |
total: 39596 | |
}] | |
}, { | |
count: 11, | |
hasInterestRate: !1, | |
interestRate: 0, | |
value: 3599, | |
total: 39596, | |
sellerMerchantInstallments: [{ | |
id: "COREBIZ", | |
count: 11, | |
hasInterestRate: !1, | |
interestRate: 0, | |
value: 3599, | |
total: 39596 | |
}] | |
}, { | |
count: 12, | |
hasInterestRate: !1, | |
interestRate: 0, | |
value: 3299, | |
total: 39596, | |
sellerMerchantInstallments: [{ | |
id: "COREBIZ", | |
count: 12, | |
hasInterestRate: !1, | |
interestRate: 0, | |
value: 3299, | |
total: 39596 | |
}] | |
}] | |
}, { | |
paymentSystem: "16", | |
bin: null, | |
paymentName: null, | |
paymentGroupName: null, | |
value: 39596, | |
installments: [{ | |
count: 1, | |
hasInterestRate: !1, | |
interestRate: 0, | |
value: 39596, | |
total: 39596, | |
sellerMerchantInstallments: [{ | |
id: "COREBIZ", | |
count: 1, | |
hasInterestRate: !1, | |
interestRate: 0, | |
value: 39596, | |
total: 39596 | |
}] | |
}] | |
}, { | |
paymentSystem: "201", | |
bin: null, | |
paymentName: null, | |
paymentGroupName: null, | |
value: 39596, | |
installments: [{ | |
count: 1, | |
hasInterestRate: !1, | |
interestRate: 0, | |
value: 39596, | |
total: 39596, | |
sellerMerchantInstallments: [{ | |
id: "COREBIZ", | |
count: 1, | |
hasInterestRate: !1, | |
interestRate: 0, | |
value: 39596, | |
total: 39596 | |
}] | |
}] | |
}], | |
paymentSystems: [{ | |
id: 201, | |
name: "Nome da Promissรณria", | |
groupName: "custom201PaymentGroupPaymentGroup", | |
validator: { | |
regex: null, | |
mask: null, | |
cardCodeRegex: null, | |
cardCodeMask: null, | |
weights: null, | |
useCvv: !1, | |
useExpirationDate: !1, | |
useCardHolderName: !1, | |
useBillingAddress: !1 | |
}, | |
stringId: "201", | |
template: "custom201PaymentGroupPaymentGroup-template", | |
requiresDocument: !1, | |
isCustom: !0, | |
description: "Descriรงรฃo da Promissรณria", | |
requiresAuthentication: !1, | |
dueDate: "2017-05-08T02:13:57.026031Z" | |
}, { | |
id: 16, | |
name: "Vale", | |
groupName: "giftCardPaymentGroup", | |
validator: { | |
regex: null, | |
mask: null, | |
cardCodeRegex: null, | |
cardCodeMask: null, | |
weights: null, | |
useCvv: !1, | |
useExpirationDate: !1, | |
useCardHolderName: !1, | |
useBillingAddress: !1 | |
}, | |
stringId: "16", | |
template: "giftCardPaymentGroup-template", | |
requiresDocument: !1, | |
isCustom: !1, | |
description: null, | |
requiresAuthentication: !1, | |
dueDate: "2017-05-02T02:13:57.0572039Z" | |
}, { | |
id: 2, | |
name: "Visa", | |
groupName: "creditCardPaymentGroup", | |
validator: { | |
regex: "^4", | |
mask: "9999 9999 9999 9999", | |
cardCodeRegex: "^[0-9]{3}$", | |
cardCodeMask: "999", | |
weights: [2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2], | |
useCvv: !0, | |
useExpirationDate: !0, | |
useCardHolderName: !0, | |
useBillingAddress: !0 | |
}, | |
stringId: "2", | |
template: "creditCardPaymentGroup-template", | |
requiresDocument: !1, | |
isCustom: !1, | |
description: null, | |
requiresAuthentication: !1, | |
dueDate: "2017-05-04T02:13:57.0728322Z" | |
}, { | |
id: 4, | |
name: "Mastercard", | |
groupName: "creditCardPaymentGroup", | |
validator: { | |
regex: "^((5(1(0(0(0([0-9])|[1-9][0-9])|[1-9][0-9]{0})|[1-9][0-9]{0})|3(0(4(0([0-9]))|[0-3][0-9]{0}))|2[0-9]{0})|^5(3(0(4(2([0-9])|[3-9][0-9])|[5-9][0-9]{0})|[1-9][0-9]{0})|5(9(9(9([0-9])|[0-8][0-9])|[0-8][0-9]{0})|[0-8][0-9]{0})|4[0-9]{0}))|((508116)\\d{0,10})|((502121)\\d{0,10})|((589916)\\d{0,10})|(2[0-9]{15}))", | |
mask: "9999 9999 9999 9999", | |
cardCodeRegex: "^[0-9]{3}$", | |
cardCodeMask: "999", | |
weights: [2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2], | |
useCvv: !0, | |
useExpirationDate: !0, | |
useCardHolderName: !0, | |
useBillingAddress: !0 | |
}, | |
stringId: "4", | |
template: "creditCardPaymentGroup-template", | |
requiresDocument: !1, | |
isCustom: !1, | |
description: null, | |
requiresAuthentication: !1, | |
dueDate: "2017-05-04T02:13:57.1040339Z" | |
}], | |
payments: [], | |
giftCards: [], | |
giftCardMessages: [], | |
availableAccounts: [], | |
availableTokens: [] | |
}, | |
marketingData: null, | |
sellers: [], | |
clientPreferencesData: { | |
attachmentId: "clientPreferencesData", | |
locale: "pt-BR", | |
optinNewsLetter: null | |
}, | |
storePreferencesData: { | |
countryCode: "BRA", | |
checkToSavePersonDataByDefault: !0, | |
templateOptions: { | |
toggleCorporate: !1 | |
}, | |
timeZone: "E. South America Standard Time", | |
currencyCode: "BRL", | |
currencyLocale: 1046, | |
currencySymbol: "R$", | |
currencyFormatInfo: { | |
currencyDecimalDigits: 2, | |
currencyDecimalSeparator: ",", | |
currencyGroupSeparator: ".", | |
currencyGroupSize: 3, | |
startsWithCurrencySymbol: !0 | |
} | |
}, | |
giftRegistryData: null, | |
openTextField: { | |
attachmentId: "openTextField", | |
value: null | |
}, | |
customData: null, | |
hooksData: null, | |
ratesAndBenefitsData: null, | |
itemsOrdination: null | |
}) : t.getJSON(n.url_order_form, function(t) { | |
o && e(t) | |
}, function(t) { | |
o && r(t) | |
}) | |
}, | |
clear: function() { | |
this.list(function(t) { | |
t.orderFormId && (window.location.href = n.url_orderform_clear + t.orderFormId) | |
}, function(t) { | |
error_fn(t) | |
}) | |
} | |
} | |
} | |
, | |
o.prototype.checkout = function() { | |
var t = this; | |
return { | |
saveAttachments: function(e, r, i, o, a) { | |
var s = "function" == typeof o && "function" == typeof a; | |
if (e && i && r) | |
return t.ajax(n.url_order_form + "/" + i + "/attachments/" + r, "POST", e, function(t) { | |
s && o(t) | |
}, function(t) { | |
s && a(t) | |
}, !0), | |
null | |
}, | |
handleAddAttachmentsOpenTextField: function(r, i, o, a) { | |
var s = "function" == typeof o && "function" == typeof a; | |
if (r) { | |
var l = { | |
value: r, | |
expectedOrderFormSections: e | |
}; | |
return t.ajax(n.url_order_form + "/" + i + n.url_attachments_openTextField, "POST", l, function(t) { | |
s && o(t) | |
}, function(t) { | |
s && a(t) | |
}, !0), | |
null | |
} | |
}, | |
addAttachmentsOpenTextField: function(e, n, r) { | |
if (e) { | |
var i = "function" == typeof n && "function" == typeof r; | |
t.orderForm().list(function(t) { | |
this.handleAddAttachmentsOpenTextField(e, t.orderFormId, function(t) { | |
i && n(t) | |
}, function(t) { | |
i && r(t) | |
}) | |
} | |
.bind(this), function(t) { | |
r(t) | |
}) | |
} | |
}, | |
handleAddItemAttachment: function(r, i, o, a, s, l) { | |
var c = "function" == typeof s && "function" == typeof l; | |
if (r) { | |
var u = { | |
content: r, | |
expectedOrderFormSections: e, | |
noSplitItem: !1 | |
}; | |
return t.ajax(n.url_order_form + "/" + a + "/items/" + o + "/attachments/" + i, "POST", u, function(t) { | |
c && s(t) | |
}, function(t) { | |
c && l(t) | |
}, !0), | |
null | |
} | |
}, | |
addItemAttachment: function(e, n, r, i, o) { | |
if (e && n && "" !== r) { | |
var a = "function" == typeof i && "function" == typeof o; | |
t.orderForm().list(function(t) { | |
this.handleAddItemAttachment(e, n, r, t.orderFormId, function(t) { | |
a && i(t) | |
}, function(t) { | |
a && o(t) | |
}) | |
} | |
.bind(this), function(t) { | |
o(t) | |
}) | |
} | |
}, | |
saveClientProfileData: function(e, n, r) { | |
if (e) { | |
var i = "function" == typeof n && "function" == typeof r; | |
t.orderForm().list(function(t) { | |
void 0 !== e.homePhone && (e.homePhone = "+55" + e.homePhone), | |
void 0 !== e.phone && (e.phone = "+55" + e.phone), | |
this.saveAttachments(e, "clientProfileData", t.orderFormId, function(t) { | |
i && n(t) | |
}, function(t) { | |
i && r(t) | |
}) | |
} | |
.bind(this), function(t) { | |
r(t) | |
}) | |
} | |
}, | |
saveShippingData: function(n, i, o) { | |
if (n && n.postalCode) { | |
var a = "function" == typeof i && "function" == typeof o; | |
t.orderForm().list(function(s) { | |
n.addressName = n.addressName || r.getTime(), | |
n.addressId = n.addressId || n.addressName; | |
var l = { | |
clearAddressIfPostalCodeNotFound: !0, | |
address: n, | |
expectedOrderFormSections: e | |
} | |
, c = this; | |
c.saveAttachments(l, "shippingData", s.orderFormId, function(r) { | |
a && t.orderForm().list(function(t) { | |
t.shippingData.address.street ? a && i(r) : (l = { | |
logisticsInfo: t.shippingData.logisticsInfo, | |
address: n, | |
expectedOrderFormSections: e | |
}, | |
c.saveAttachments(l, "shippingData", r.orderFormId, function(t) { | |
a && i(t) | |
}, function(t) { | |
a && o(t) | |
})) | |
}, function(t) { | |
a && o(t) | |
}) | |
}, function(t) { | |
a && o(t) | |
}) | |
} | |
.bind(this), function(t) { | |
o(t) | |
}) | |
} | |
}, | |
getDeliveryShipping: function(e, n) { | |
var r = "function" == typeof e && "function" == typeof n; | |
t.orderForm().list(function(t) { | |
r && e(t.shippingData.logisticsInfo[0]) | |
} | |
.bind(this), function(t) { | |
n(t) | |
}) | |
}, | |
chooseDeliveryShipping: function(e, n, r) { | |
var i = "function" == typeof n && "function" == typeof r; | |
"" !== e && t.orderForm().list(function(t) { | |
if (t.shippingData.logisticsInfo[0]) { | |
var o = t.shippingData.logisticsInfo[0].slas[e]; | |
if (o) { | |
var a = { | |
address: Object.assign({}, t.shippingData.address), | |
logisticsInfo: t.items.map(function(t, e) { | |
return { | |
itemIndex: e, | |
selectedSla: o.id | |
} | |
}) | |
} | |
, s = { | |
attachmentId: "shippingData", | |
address: a.address, | |
logisticsInfo: a.logisticsInfo | |
}; | |
this.saveAttachments(s, "shippingData", t.orderFormId, function(t) { | |
i && n(t) | |
}, function(t) { | |
i && r(t) | |
}) | |
} else | |
i && n(!1) | |
} | |
i && n(t.shippingData.logisticsInfo[0]) | |
} | |
.bind(this), function(t) { | |
r(t) | |
}) | |
} | |
} | |
} | |
, | |
o.prototype.masterData = function() { | |
var e = this; | |
return { | |
request: function(r, i, o, a, s) { | |
a && (n.header["REST-range"] = "resources=" + a); | |
var l = n.apiMasterData + i; | |
t.ajax({ | |
url: l, | |
data: Object.keys(r).length ? JSON.stringify(r) : "", | |
type: o, | |
headers: n.header, | |
success: function(t) { | |
s(t), | |
e.log("OK " + o + " -- " + l), | |
e.log(t) | |
}, | |
error: function(t) { | |
s(!1, t), | |
e.error("Error " + o + " -- " + l), | |
e.error(t) | |
} | |
}) | |
}, | |
insert: function(t, e, n, r) { | |
if (!t || !Object.keys(t).length) | |
return void console.info("O objeto de dados esta vazio"); | |
var i = "function" == typeof n && "function" == typeof r; | |
return this.request(t, e, "POST", "0-1", function(t, e) { | |
i && (t ? n(t || !0) : r(e)) | |
}), | |
null | |
}, | |
select: function(t, n, r, i, o) { | |
var a = "function" == typeof i && "function" == typeof o; | |
return this.request({}, n + e.parameters(t), "GET", r, function(t, e) { | |
a && (t ? i(t || !0) : o(e)) | |
}), | |
null | |
}, | |
update: function(t, e, n, r) { | |
if (!t || !Object.keys(t).length) | |
return void console.info("O objeto de dados esta vazio"); | |
var i = "function" == typeof n && "function" == typeof r; | |
return this.request(t, e, "PATCH", "0-1", function(t, e) { | |
i && (t ? n(t || !0) : r(e)) | |
}), | |
null | |
}, | |
delete: function(t, e, n) { | |
var r = "function" == typeof e && "function" == typeof n; | |
return this.request({}, t, "DELETE", "0-1", function(t, i) { | |
r && (t ? e(t || !0) : n(i)) | |
}), | |
null | |
} | |
} | |
} | |
, | |
o.prototype.newslatter = function() { | |
return { | |
send: function(e, r, o) { | |
var a = "function" == typeof r && "function" == typeof o; | |
if (e) { | |
var s = {}; | |
s.newsletterClientName = i.upperAllFirstLetter(e.name), | |
s.newsletterClientEmail = e.email, | |
s.newsInternalPage = "_newsletter-vtex", | |
s.newsInternalPart = "newsletter", | |
s.newsInternalCampaign = "newsletter:opt-in", | |
t.ajax({ | |
url: n.url_api_newsletter, | |
type: "POST", | |
data: s, | |
success: function(t) { | |
"true" === t ? a && r(!0) : r(!1) | |
}, | |
error: function(t) { | |
a && o(t) | |
} | |
}) | |
} | |
} | |
} | |
} | |
, | |
o.prototype.vtex = function() { | |
return { | |
dataserver: function(e, r) { | |
var o = "function" == typeof e && "function" == typeof r; | |
t.ajax({ | |
url: n.url_api_dataserver, | |
type: "GET", | |
success: function(t) { | |
o && (console.log(t), | |
e(i.formatData(t))) | |
}, | |
error: function(t) { | |
o && r(t) | |
} | |
}) | |
} | |
} | |
} | |
; | |
var a, s = new o, l = {}; | |
for (var c in s) | |
"function" == typeof s[c] && ("config" != c ? (a = s[c](), | |
l[c] = a || s[c]) : l[c] = s[c]); | |
window.corebiz = l | |
}($), | |
function(t, e, n, r) { | |
function i(e, n) { | |
this.settings = null, | |
this.options = t.extend({}, i.Defaults, n), | |
this.$element = t(e), | |
this._handlers = {}, | |
this._plugins = {}, | |
this._supress = {}, | |
this._current = null, | |
this._speed = null, | |
this._coordinates = [], | |
this._breakpoint = null, | |
this._width = null, | |
this._items = [], | |
this._clones = [], | |
this._mergers = [], | |
this._widths = [], | |
this._invalidated = {}, | |
this._pipe = [], | |
this._drag = { | |
time: null, | |
target: null, | |
pointer: null, | |
stage: { | |
start: null, | |
current: null | |
}, | |
direction: null | |
}, | |
this._states = { | |
current: {}, | |
tags: { | |
initializing: ["busy"], | |
animating: ["busy"], | |
dragging: ["interacting"] | |
} | |
}, | |
t.each(["onResize", "onThrottledResize"], t.proxy(function(e, n) { | |
this._handlers[n] = t.proxy(this[n], this) | |
}, this)), | |
t.each(i.Plugins, t.proxy(function(t, e) { | |
this._plugins[t.charAt(0).toLowerCase() + t.slice(1)] = new e(this) | |
}, this)), | |
t.each(i.Workers, t.proxy(function(e, n) { | |
this._pipe.push({ | |
filter: n.filter, | |
run: t.proxy(n.run, this) | |
}) | |
}, this)), | |
this.setup(), | |
this.initialize() | |
} | |
i.Defaults = { | |
items: 3, | |
loop: !1, | |
center: !1, | |
rewind: !1, | |
mouseDrag: !0, | |
touchDrag: !0, | |
pullDrag: !0, | |
freeDrag: !1, | |
margin: 0, | |
stagePadding: 0, | |
merge: !1, | |
mergeFit: !0, | |
autoWidth: !1, | |
startPosition: 0, | |
rtl: !1, | |
smartSpeed: 250, | |
fluidSpeed: !1, | |
dragEndSpeed: !1, | |
responsive: {}, | |
responsiveRefreshRate: 200, | |
responsiveBaseElement: e, | |
fallbackEasing: "swing", | |
info: !1, | |
nestedItemSelector: !1, | |
itemElement: "div", | |
stageElement: "div", | |
refreshClass: "owl-refresh", | |
loadedClass: "owl-loaded", | |
loadingClass: "owl-loading", | |
rtlClass: "owl-rtl", | |
responsiveClass: "owl-responsive", | |
dragClass: "owl-drag", | |
itemClass: "owl-item", | |
stageClass: "owl-stage", | |
stageOuterClass: "owl-stage-outer", | |
grabClass: "owl-grab" | |
}, | |
i.Width = { | |
Default: "default", | |
Inner: "inner", | |
Outer: "outer" | |
}, | |
i.Type = { | |
Event: "event", | |
State: "state" | |
}, | |
i.Plugins = {}, | |
i.Workers = [{ | |
filter: ["width", "settings"], | |
run: function() { | |
this._width = this.$element.width() | |
} | |
}, { | |
filter: ["width", "items", "settings"], | |
run: function(t) { | |
t.current = this._items && this._items[this.relative(this._current)] | |
} | |
}, { | |
filter: ["items", "settings"], | |
run: function() { | |
this.$stage.children(".cloned").remove() | |
} | |
}, { | |
filter: ["width", "items", "settings"], | |
run: function(t) { | |
var e = this.settings.margin || "" | |
, n = !this.settings.autoWidth | |
, r = this.settings.rtl | |
, i = { | |
width: "auto", | |
"margin-left": r ? e : "", | |
"margin-right": r ? "" : e | |
}; | |
!n && this.$stage.children().css(i), | |
t.css = i | |
} | |
}, { | |
filter: ["width", "items", "settings"], | |
run: function(t) { | |
var e = (this.width() / this.settings.items).toFixed(3) - this.settings.margin | |
, n = null | |
, r = this._items.length | |
, i = !this.settings.autoWidth | |
, o = []; | |
for (t.items = { | |
merge: !1, | |
width: e | |
}; r--; ) | |
n = this._mergers[r], | |
n = this.settings.mergeFit && Math.min(n, this.settings.items) || n, | |
t.items.merge = n > 1 || t.items.merge, | |
o[r] = i ? e * n : this._items[r].width(); | |
this._widths = o | |
} | |
}, { | |
filter: ["items", "settings"], | |
run: function() { | |
var e = [] | |
, n = this._items | |
, r = this.settings | |
, i = Math.max(2 * r.items, 4) | |
, o = 2 * Math.ceil(n.length / 2) | |
, a = r.loop && n.length ? r.rewind ? i : Math.max(i, o) : 0 | |
, s = "" | |
, l = ""; | |
for (a /= 2; a--; ) | |
e.push(this.normalize(e.length / 2, !0)), | |
s += n[e[e.length - 1]][0].outerHTML, | |
e.push(this.normalize(n.length - 1 - (e.length - 1) / 2, !0)), | |
l = n[e[e.length - 1]][0].outerHTML + l; | |
this._clones = e, | |
t(s).addClass("cloned").appendTo(this.$stage), | |
t(l).addClass("cloned").prependTo(this.$stage) | |
} | |
}, { | |
filter: ["width", "items", "settings"], | |
run: function() { | |
for (var t = this.settings.rtl ? 1 : -1, e = this._clones.length + this._items.length, n = -1, r = 0, i = 0, o = []; ++n < e; ) | |
r = o[n - 1] || 0, | |
i = this._widths[this.relative(n)] + this.settings.margin, | |
o.push(r + i * t); | |
this._coordinates = o | |
} | |
}, { | |
filter: ["width", "items", "settings"], | |
run: function() { | |
var t = this.settings.stagePadding | |
, e = this._coordinates | |
, n = { | |
width: Math.ceil(Math.abs(e[e.length - 1])) + 2 * t, | |
"padding-left": t || "", | |
"padding-right": t || "" | |
}; | |
this.$stage.css(n) | |
} | |
}, { | |
filter: ["width", "items", "settings"], | |
run: function(t) { | |
var e = this._coordinates.length | |
, n = !this.settings.autoWidth | |
, r = this.$stage.children(); | |
if (n && t.items.merge) | |
for (; e--; ) | |
t.css.width = this._widths[this.relative(e)], | |
r.eq(e).css(t.css); | |
else | |
n && (t.css.width = t.items.width, | |
r.css(t.css)) | |
} | |
}, { | |
filter: ["items"], | |
run: function() { | |
this._coordinates.length < 1 && this.$stage.removeAttr("style") | |
} | |
}, { | |
filter: ["width", "items", "settings"], | |
run: function(t) { | |
t.current = t.current ? this.$stage.children().index(t.current) : 0, | |
t.current = Math.max(this.minimum(), Math.min(this.maximum(), t.current)), | |
this.reset(t.current) | |
} | |
}, { | |
filter: ["position"], | |
run: function() { | |
this.animate(this.coordinates(this._current)) | |
} | |
}, { | |
filter: ["width", "position", "items", "settings"], | |
run: function() { | |
var t, e, n, r, i = this.settings.rtl ? 1 : -1, o = 2 * this.settings.stagePadding, a = this.coordinates(this.current()) + o, s = a + this.width() * i, l = []; | |
for (n = 0, | |
r = this._coordinates.length; r > n; n++) | |
t = this._coordinates[n - 1] || 0, | |
e = Math.abs(this._coordinates[n]) + o * i, | |
(this.op(t, "<=", a) && this.op(t, ">", s) || this.op(e, "<", a) && this.op(e, ">", s)) && l.push(n); | |
this.$stage.children(".active").removeClass("active"), | |
this.$stage.children(":eq(" + l.join("), :eq(") + ")").addClass("active"), | |
this.settings.center && (this.$stage.children(".center").removeClass("center"), | |
this.$stage.children().eq(this.current()).addClass("center")) | |
} | |
}], | |
i.prototype.initialize = function() { | |
if (this.enter("initializing"), | |
this.trigger("initialize"), | |
this.$element.toggleClass(this.settings.rtlClass, this.settings.rtl), | |
this.settings.autoWidth && !this.is("pre-loading")) { | |
var e, n, i; | |
e = this.$element.find("img"), | |
n = this.settings.nestedItemSelector ? "." + this.settings.nestedItemSelector : r, | |
i = this.$element.children(n).width(), | |
e.length && 0 >= i && this.preloadAutoWidthImages(e) | |
} | |
this.$element.addClass(this.options.loadingClass), | |
this.$stage = t("<" + this.settings.stageElement + ' class="' + this.settings.stageClass + '"/>').wrap('<div class="' + this.settings.stageOuterClass + '"/>'), | |
this.$element.append(this.$stage.parent()), | |
this.replace(this.$element.children().not(this.$stage.parent())), | |
this.$element.is(":visible") ? this.refresh() : this.invalidate("width"), | |
this.$element.removeClass(this.options.loadingClass).addClass(this.options.loadedClass), | |
this.registerEventHandlers(), | |
this.leave("initializing"), | |
this.trigger("initialized") | |
} | |
, | |
i.prototype.setup = function() { | |
var e = this.viewport() | |
, n = this.options.responsive | |
, r = -1 | |
, i = null; | |
n ? (t.each(n, function(t) { | |
e >= t && t > r && (r = Number(t)) | |
}), | |
i = t.extend({}, this.options, n[r]), | |
"function" == typeof i.stagePadding && (i.stagePadding = i.stagePadding()), | |
delete i.responsive, | |
i.responsiveClass && this.$element.attr("class", this.$element.attr("class").replace(new RegExp("(" + this.options.responsiveClass + "-)\\S+\\s","g"), "$1" + r))) : i = t.extend({}, this.options), | |
this.trigger("change", { | |
property: { | |
name: "settings", | |
value: i | |
} | |
}), | |
this._breakpoint = r, | |
this.settings = i, | |
this.invalidate("settings"), | |
this.trigger("changed", { | |
property: { | |
name: "settings", | |
value: this.settings | |
} | |
}) | |
} | |
, | |
i.prototype.optionsLogic = function() { | |
this.settings.autoWidth && (this.settings.stagePadding = !1, | |
this.settings.merge = !1) | |
} | |
, | |
i.prototype.prepare = function(e) { | |
var n = this.trigger("prepare", { | |
content: e | |
}); | |
return n.data || (n.data = t("<" + this.settings.itemElement + "/>").addClass(this.options.itemClass).append(e)), | |
this.trigger("prepared", { | |
content: n.data | |
}), | |
n.data | |
} | |
, | |
i.prototype.update = function() { | |
for (var e = 0, n = this._pipe.length, r = t.proxy(function(t) { | |
return this[t] | |
}, this._invalidated), i = {}; n > e; ) | |
(this._invalidated.all || t.grep(this._pipe[e].filter, r).length > 0) && this._pipe[e].run(i), | |
e++; | |
this._invalidated = {}, | |
!this.is("valid") && this.enter("valid") | |
} | |
, | |
i.prototype.width = function(t) { | |
switch (t = t || i.Width.Default) { | |
case i.Width.Inner: | |
case i.Width.Outer: | |
return this._width; | |
default: | |
return this._width - 2 * this.settings.stagePadding + this.settings.margin | |
} | |
} | |
, | |
i.prototype.refresh = function() { | |
this.enter("refreshing"), | |
this.trigger("refresh"), | |
this.setup(), | |
this.optionsLogic(), | |
this.$element.addClass(this.options.refreshClass), | |
this.update(), | |
this.$element.removeClass(this.options.refreshClass), | |
this.leave("refreshing"), | |
this.trigger("refreshed") | |
} | |
, | |
i.prototype.onThrottledResize = function() { | |
e.clearTimeout(this.resizeTimer), | |
this.resizeTimer = e.setTimeout(this._handlers.onResize, this.settings.responsiveRefreshRate) | |
} | |
, | |
i.prototype.onResize = function() { | |
return !!this._items.length && (this._width !== this.$element.width() && (!!this.$element.is(":visible") && (this.enter("resizing"), | |
this.trigger("resize").isDefaultPrevented() ? (this.leave("resizing"), | |
!1) : (this.invalidate("width"), | |
this.refresh(), | |
this.leave("resizing"), | |
void this.trigger("resized"))))) | |
} | |
, | |
i.prototype.registerEventHandlers = function() { | |
t.support.transition && this.$stage.on(t.support.transition.end + ".owl.core", t.proxy(this.onTransitionEnd, this)), | |
!1 !== this.settings.responsive && this.on(e, "resize", this._handlers.onThrottledResize), | |
this.settings.mouseDrag && (this.$element.addClass(this.options.dragClass), | |
this.$stage.on("mousedown.owl.core", t.proxy(this.onDragStart, this)), | |
this.$stage.on("dragstart.owl.core selectstart.owl.core", function() { | |
return !1 | |
})), | |
this.settings.touchDrag && (this.$stage.on("touchstart.owl.core", t.proxy(this.onDragStart, this)), | |
this.$stage.on("touchcancel.owl.core", t.proxy(this.onDragEnd, this))) | |
} | |
, | |
i.prototype.onDragStart = function(e) { | |
var r = null; | |
3 !== e.which && (t.support.transform ? (r = this.$stage.css("transform").replace(/.*\(|\)| /g, "").split(","), | |
r = { | |
x: r[16 === r.length ? 12 : 4], | |
y: r[16 === r.length ? 13 : 5] | |
}) : (r = this.$stage.position(), | |
r = { | |
x: this.settings.rtl ? r.left + this.$stage.width() - this.width() + this.settings.margin : r.left, | |
y: r.top | |
}), | |
this.is("animating") && (t.support.transform ? this.animate(r.x) : this.$stage.stop(), | |
this.invalidate("position")), | |
this.$element.toggleClass(this.options.grabClass, "mousedown" === e.type), | |
this.speed(0), | |
this._drag.time = (new Date).getTime(), | |
this._drag.target = t(e.target), | |
this._drag.stage.start = r, | |
this._drag.stage.current = r, | |
this._drag.pointer = this.pointer(e), | |
t(n).on("mouseup.owl.core touchend.owl.core", t.proxy(this.onDragEnd, this)), | |
t(n).one("mousemove.owl.core touchmove.owl.core", t.proxy(function(e) { | |
var r = this.difference(this._drag.pointer, this.pointer(e)); | |
t(n).on("mousemove.owl.core touchmove.owl.core", t.proxy(this.onDragMove, this)), | |
Math.abs(r.x) < Math.abs(r.y) && this.is("valid") || (e.preventDefault(), | |
this.enter("dragging"), | |
this.trigger("drag")) | |
}, this))) | |
} | |
, | |
i.prototype.onDragMove = function(t) { | |
var e = null | |
, n = null | |
, r = null | |
, i = this.difference(this._drag.pointer, this.pointer(t)) | |
, o = this.difference(this._drag.stage.start, i); | |
this.is("dragging") && (t.preventDefault(), | |
this.settings.loop ? (e = this.coordinates(this.minimum()), | |
n = this.coordinates(this.maximum() + 1) - e, | |
o.x = ((o.x - e) % n + n) % n + e) : (e = this.settings.rtl ? this.coordinates(this.maximum()) : this.coordinates(this.minimum()), | |
n = this.settings.rtl ? this.coordinates(this.minimum()) : this.coordinates(this.maximum()), | |
r = this.settings.pullDrag ? -1 * i.x / 5 : 0, | |
o.x = Math.max(Math.min(o.x, e + r), n + r)), | |
this._drag.stage.current = o, | |
this.animate(o.x)) | |
} | |
, | |
i.prototype.onDragEnd = function(e) { | |
var r = this.difference(this._drag.pointer, this.pointer(e)) | |
, i = this._drag.stage.current | |
, o = r.x > 0 ^ this.settings.rtl ? "left" : "right"; | |
t(n).off(".owl.core"), | |
this.$element.removeClass(this.options.grabClass), | |
(0 !== r.x && this.is("dragging") || !this.is("valid")) && (this.speed(this.settings.dragEndSpeed || this.settings.smartSpeed), | |
this.current(this.closest(i.x, 0 !== r.x ? o : this._drag.direction)), | |
this.invalidate("position"), | |
this.update(), | |
this._drag.direction = o, | |
(Math.abs(r.x) > 3 || (new Date).getTime() - this._drag.time > 300) && this._drag.target.one("click.owl.core", function() { | |
return !1 | |
})), | |
this.is("dragging") && (this.leave("dragging"), | |
this.trigger("dragged")) | |
} | |
, | |
i.prototype.closest = function(e, n) { | |
var r = -1 | |
, i = 30 | |
, o = this.width() | |
, a = this.coordinates(); | |
return this.settings.freeDrag || t.each(a, t.proxy(function(t, s) { | |
return "left" === n && e > s - i && s + i > e ? r = t : "right" === n && e > s - o - i && s - o + i > e ? r = t + 1 : this.op(e, "<", s) && this.op(e, ">", a[t + 1] || s - o) && (r = "left" === n ? t + 1 : t), | |
-1 === r | |
}, this)), | |
this.settings.loop || (this.op(e, ">", a[this.minimum()]) ? r = e = this.minimum() : this.op(e, "<", a[this.maximum()]) && (r = e = this.maximum())), | |
r | |
} | |
, | |
i.prototype.animate = function(e) { | |
var n = this.speed() > 0; | |
this.is("animating") && this.onTransitionEnd(), | |
n && (this.enter("animating"), | |
this.trigger("translate")), | |
t.support.transform3d && t.support.transition ? this.$stage.css({ | |
transform: "translate3d(" + e + "px,0px,0px)", | |
transition: this.speed() / 1e3 + "s" | |
}) : n ? this.$stage.animate({ | |
left: e + "px" | |
}, this.speed(), this.settings.fallbackEasing, t.proxy(this.onTransitionEnd, this)) : this.$stage.css({ | |
left: e + "px" | |
}) | |
} | |
, | |
i.prototype.is = function(t) { | |
return this._states.current[t] && this._states.current[t] > 0 | |
} | |
, | |
i.prototype.current = function(t) { | |
if (t === r) | |
return this._current; | |
if (0 === this._items.length) | |
return r; | |
if (t = this.normalize(t), | |
this._current !== t) { | |
var e = this.trigger("change", { | |
property: { | |
name: "position", | |
value: t | |
} | |
}); | |
e.data !== r && (t = this.normalize(e.data)), | |
this._current = t, | |
this.invalidate("position"), | |
this.trigger("changed", { | |
property: { | |
name: "position", | |
value: this._current | |
} | |
}) | |
} | |
return this._current | |
} | |
, | |
i.prototype.invalidate = function(e) { | |
return "string" === t.type(e) && (this._invalidated[e] = !0, | |
this.is("valid") && this.leave("valid")), | |
t.map(this._invalidated, function(t, e) { | |
return e | |
}) | |
} | |
, | |
i.prototype.reset = function(t) { | |
(t = this.normalize(t)) !== r && (this._speed = 0, | |
this._current = t, | |
this.suppress(["translate", "translated"]), | |
this.animate(this.coordinates(t)), | |
this.release(["translate", "translated"])) | |
} | |
, | |
i.prototype.normalize = function(t, e) { | |
var n = this._items.length | |
, i = e ? 0 : this._clones.length; | |
return !this.isNumeric(t) || 1 > n ? t = r : (0 > t || t >= n + i) && (t = ((t - i / 2) % n + n) % n + i / 2), | |
t | |
} | |
, | |
i.prototype.relative = function(t) { | |
return t -= this._clones.length / 2, | |
this.normalize(t, !0) | |
} | |
, | |
i.prototype.maximum = function(t) { | |
var e, n, r, i = this.settings, o = this._coordinates.length; | |
if (i.loop) | |
o = this._clones.length / 2 + this._items.length - 1; | |
else if (i.autoWidth || i.merge) { | |
for (e = this._items.length, | |
n = this._items[--e].width(), | |
r = this.$element.width(); e-- && !((n += this._items[e].width() + this.settings.margin) > r); ) | |
; | |
o = e + 1 | |
} else | |
o = i.center ? this._items.length - 1 : this._items.length - i.items; | |
return t && (o -= this._clones.length / 2), | |
Math.max(o, 0) | |
} | |
, | |
i.prototype.minimum = function(t) { | |
return t ? 0 : this._clones.length / 2 | |
} | |
, | |
i.prototype.items = function(t) { | |
return t === r ? this._items.slice() : (t = this.normalize(t, !0), | |
this._items[t]) | |
} | |
, | |
i.prototype.mergers = function(t) { | |
return t === r ? this._mergers.slice() : (t = this.normalize(t, !0), | |
this._mergers[t]) | |
} | |
, | |
i.prototype.clones = function(e) { | |
var n = this._clones.length / 2 | |
, i = n + this._items.length | |
, o = function(t) { | |
return t % 2 == 0 ? i + t / 2 : n - (t + 1) / 2 | |
}; | |
return e === r ? t.map(this._clones, function(t, e) { | |
return o(e) | |
}) : t.map(this._clones, function(t, n) { | |
return t === e ? o(n) : null | |
}) | |
} | |
, | |
i.prototype.speed = function(t) { | |
return t !== r && (this._speed = t), | |
this._speed | |
} | |
, | |
i.prototype.coordinates = function(e) { | |
var n, i = 1, o = e - 1; | |
return e === r ? t.map(this._coordinates, t.proxy(function(t, e) { | |
return this.coordinates(e) | |
}, this)) : (this.settings.center ? (this.settings.rtl && (i = -1, | |
o = e + 1), | |
n = this._coordinates[e], | |
n += (this.width() - n + (this._coordinates[o] || 0)) / 2 * i) : n = this._coordinates[o] || 0, | |
n = Math.ceil(n)) | |
} | |
, | |
i.prototype.duration = function(t, e, n) { | |
return 0 === n ? 0 : Math.min(Math.max(Math.abs(e - t), 1), 6) * Math.abs(n || this.settings.smartSpeed) | |
} | |
, | |
i.prototype.to = function(t, e) { | |
var n = this.current() | |
, r = null | |
, i = t - this.relative(n) | |
, o = (i > 0) - (0 > i) | |
, a = this._items.length | |
, s = this.minimum() | |
, l = this.maximum(); | |
this.settings.loop ? (!this.settings.rewind && Math.abs(i) > a / 2 && (i += -1 * o * a), | |
t = n + i, | |
(r = ((t - s) % a + a) % a + s) !== t && l >= r - i && r - i > 0 && (n = r - i, | |
t = r, | |
this.reset(n))) : this.settings.rewind ? (l += 1, | |
t = (t % l + l) % l) : t = Math.max(s, Math.min(l, t)), | |
this.speed(this.duration(n, t, e)), | |
this.current(t), | |
this.$element.is(":visible") && this.update() | |
} | |
, | |
i.prototype.next = function(t) { | |
t = t || !1, | |
this.to(this.relative(this.current()) + 1, t) | |
} | |
, | |
i.prototype.prev = function(t) { | |
t = t || !1, | |
this.to(this.relative(this.current()) - 1, t) | |
} | |
, | |
i.prototype.onTransitionEnd = function(t) { | |
return (t === r || (t.stopPropagation(), | |
(t.target || t.srcElement || t.originalTarget) === this.$stage.get(0))) && (this.leave("animating"), | |
void this.trigger("translated")) | |
} | |
, | |
i.prototype.viewport = function() { | |
var r; | |
if (this.options.responsiveBaseElement !== e) | |
r = t(this.options.responsiveBaseElement).width(); | |
else if (e.innerWidth) | |
r = e.innerWidth; | |
else { | |
if (!n.documentElement || !n.documentElement.clientWidth) | |
throw "Can not detect viewport width."; | |
r = n.documentElement.clientWidth | |
} | |
return r | |
} | |
, | |
i.prototype.replace = function(e) { | |
this.$stage.empty(), | |
this._items = [], | |
e && (e = e instanceof jQuery ? e : t(e)), | |
this.settings.nestedItemSelector && (e = e.find("." + this.settings.nestedItemSelector)), | |
e.filter(function() { | |
return 1 === this.nodeType | |
}).each(t.proxy(function(t, e) { | |
e = this.prepare(e), | |
this.$stage.append(e), | |
this._items.push(e), | |
this._mergers.push(1 * e.find("[data-merge]").addBack("[data-merge]").attr("data-merge") || 1) | |
}, this)), | |
this.reset(this.isNumeric(this.settings.startPosition) ? this.settings.startPosition : 0), | |
this.invalidate("items") | |
} | |
, | |
i.prototype.add = function(e, n) { | |
var i = this.relative(this._current); | |
n = n === r ? this._items.length : this.normalize(n, !0), | |
e = e instanceof jQuery ? e : t(e), | |
this.trigger("add", { | |
content: e, | |
position: n | |
}), | |
e = this.prepare(e), | |
0 === this._items.length || n === this._items.length ? (0 === this._items.length && this.$stage.append(e), | |
0 !== this._items.length && this._items[n - 1].after(e), | |
this._items.push(e), | |
this._mergers.push(1 * e.find("[data-merge]").addBack("[data-merge]").attr("data-merge") || 1)) : (this._items[n].before(e), | |
this._items.splice(n, 0, e), | |
this._mergers.splice(n, 0, 1 * e.find("[data-merge]").addBack("[data-merge]").attr("data-merge") || 1)), | |
this._items[i] && this.reset(this._items[i].index()), | |
this.invalidate("items"), | |
this.trigger("added", { | |
content: e, | |
position: n | |
}) | |
} | |
, | |
i.prototype.remove = function(t) { | |
(t = this.normalize(t, !0)) !== r && (this.trigger("remove", { | |
content: this._items[t], | |
position: t | |
}), | |
this._items[t].remove(), | |
this._items.splice(t, 1), | |
this._mergers.splice(t, 1), | |
this.invalidate("items"), | |
this.trigger("removed", { | |
content: null, | |
position: t | |
})) | |
} | |
, | |
i.prototype.preloadAutoWidthImages = function(e) { | |
e.each(t.proxy(function(e, n) { | |
this.enter("pre-loading"), | |
n = t(n), | |
t(new Image).one("load", t.proxy(function(t) { | |
n.attr("src", t.target.src), | |
n.css("opacity", 1), | |
this.leave("pre-loading"), | |
!this.is("pre-loading") && !this.is("initializing") && this.refresh() | |
}, this)).attr("src", n.attr("src") || n.attr("data-src") || n.attr("data-src-retina")) | |
}, this)) | |
} | |
, | |
i.prototype.destroy = function() { | |
this.$element.off(".owl.core"), | |
this.$stage.off(".owl.core"), | |
t(n).off(".owl.core"), | |
!1 !== this.settings.responsive && (e.clearTimeout(this.resizeTimer), | |
this.off(e, "resize", this._handlers.onThrottledResize)); | |
for (var r in this._plugins) | |
this._plugins[r].destroy(); | |
this.$stage.children(".cloned").remove(), | |
this.$stage.unwrap(), | |
this.$stage.children().contents().unwrap(), | |
this.$stage.children().unwrap(), | |
this.$element.removeClass(this.options.refreshClass).removeClass(this.options.loadingClass).removeClass(this.options.loadedClass).removeClass(this.options.rtlClass).removeClass(this.options.dragClass).removeClass(this.options.grabClass).attr("class", this.$element.attr("class").replace(new RegExp(this.options.responsiveClass + "-\\S+\\s","g"), "")).removeData("owl.carousel") | |
} | |
, | |
i.prototype.op = function(t, e, n) { | |
var r = this.settings.rtl; | |
switch (e) { | |
case "<": | |
return r ? t > n : n > t; | |
case ">": | |
return r ? n > t : t > n; | |
case ">=": | |
return r ? n >= t : t >= n; | |
case "<=": | |
return r ? t >= n : n >= t | |
} | |
} | |
, | |
i.prototype.on = function(t, e, n, r) { | |
t.addEventListener ? t.addEventListener(e, n, r) : t.attachEvent && t.attachEvent("on" + e, n) | |
} | |
, | |
i.prototype.off = function(t, e, n, r) { | |
t.removeEventListener ? t.removeEventListener(e, n, r) : t.detachEvent && t.detachEvent("on" + e, n) | |
} | |
, | |
i.prototype.trigger = function(e, n, r, o, a) { | |
var s = { | |
item: { | |
count: this._items.length, | |
index: this.current() | |
} | |
} | |
, l = t.camelCase(t.grep(["on", e, r], function(t) { | |
return t | |
}).join("-").toLowerCase()) | |
, c = t.Event([e, "owl", r || "carousel"].join(".").toLowerCase(), t.extend({ | |
relatedTarget: this | |
}, s, n)); | |
return this._supress[e] || (t.each(this._plugins, function(t, e) { | |
e.onTrigger && e.onTrigger(c) | |
}), | |
this.register({ | |
type: i.Type.Event, | |
name: e | |
}), | |
this.$element.trigger(c), | |
this.settings && "function" == typeof this.settings[l] && this.settings[l].call(this, c)), | |
c | |
} | |
, | |
i.prototype.enter = function(e) { | |
t.each([e].concat(this._states.tags[e] || []), t.proxy(function(t, e) { | |
this._states.current[e] === r && (this._states.current[e] = 0), | |
this._states.current[e]++ | |
}, this)) | |
} | |
, | |
i.prototype.leave = function(e) { | |
t.each([e].concat(this._states.tags[e] || []), t.proxy(function(t, e) { | |
this._states.current[e]-- | |
}, this)) | |
} | |
, | |
i.prototype.register = function(e) { | |
if (e.type === i.Type.Event) { | |
if (t.event.special[e.name] || (t.event.special[e.name] = {}), | |
!t.event.special[e.name].owl) { | |
var n = t.event.special[e.name]._default; | |
t.event.special[e.name]._default = function(t) { | |
return !n || !n.apply || t.namespace && -1 !== t.namespace.indexOf("owl") ? t.namespace && t.namespace.indexOf("owl") > -1 : n.apply(this, arguments) | |
} | |
, | |
t.event.special[e.name].owl = !0 | |
} | |
} else | |
e.type === i.Type.State && (this._states.tags[e.name] ? this._states.tags[e.name] = this._states.tags[e.name].concat(e.tags) : this._states.tags[e.name] = e.tags, | |
this._states.tags[e.name] = t.grep(this._states.tags[e.name], t.proxy(function(n, r) { | |
return t.inArray(n, this._states.tags[e.name]) === r | |
}, this))) | |
} | |
, | |
i.prototype.suppress = function(e) { | |
t.each(e, t.proxy(function(t, e) { | |
this._supress[e] = !0 | |
}, this)) | |
} | |
, | |
i.prototype.release = function(e) { | |
t.each(e, t.proxy(function(t, e) { | |
delete this._supress[e] | |
}, this)) | |
} | |
, | |
i.prototype.pointer = function(t) { | |
var n = { | |
x: null, | |
y: null | |
}; | |
return t = t.originalEvent || t || e.event, | |
t = t.touches && t.touches.length ? t.touches[0] : t.changedTouches && t.changedTouches.length ? t.changedTouches[0] : t, | |
t.pageX ? (n.x = t.pageX, | |
n.y = t.pageY) : (n.x = t.clientX, | |
n.y = t.clientY), | |
n | |
} | |
, | |
i.prototype.isNumeric = function(t) { | |
return !isNaN(parseFloat(t)) | |
} | |
, | |
i.prototype.difference = function(t, e) { | |
return { | |
x: t.x - e.x, | |
y: t.y - e.y | |
} | |
} | |
, | |
t.fn.owlCarousel = function(e) { | |
var n = Array.prototype.slice.call(arguments, 1); | |
return this.each(function() { | |
var r = t(this) | |
, o = r.data("owl.carousel"); | |
o || (o = new i(this,"object" == typeof e && e), | |
r.data("owl.carousel", o), | |
t.each(["next", "prev", "to", "destroy", "refresh", "replace", "add", "remove"], function(e, n) { | |
o.register({ | |
type: i.Type.Event, | |
name: n | |
}), | |
o.$element.on(n + ".owl.carousel.core", t.proxy(function(t) { | |
t.namespace && t.relatedTarget !== this && (this.suppress([n]), | |
o[n].apply(this, [].slice.call(arguments, 1)), | |
this.release([n])) | |
}, o)) | |
})), | |
"string" == typeof e && "_" !== e.charAt(0) && o[e].apply(o, n) | |
}) | |
} | |
, | |
t.fn.owlCarousel.Constructor = i | |
}(window.Zepto || window.jQuery, window, document), | |
function(t, e, n, r) { | |
var i = function(e) { | |
this._core = e, | |
this._interval = null, | |
this._visible = null, | |
this._handlers = { | |
"initialized.owl.carousel": t.proxy(function(t) { | |
t.namespace && this._core.settings.autoRefresh && this.watch() | |
}, this) | |
}, | |
this._core.options = t.extend({}, i.Defaults, this._core.options), | |
this._core.$element.on(this._handlers) | |
}; | |
i.Defaults = { | |
autoRefresh: !0, | |
autoRefreshInterval: 500 | |
}, | |
i.prototype.watch = function() { | |
this._interval || (this._visible = this._core.$element.is(":visible"), | |
this._interval = e.setInterval(t.proxy(this.refresh, this), this._core.settings.autoRefreshInterval)) | |
} | |
, | |
i.prototype.refresh = function() { | |
this._core.$element.is(":visible") !== this._visible && (this._visible = !this._visible, | |
this._core.$element.toggleClass("owl-hidden", !this._visible), | |
this._visible && this._core.invalidate("width") && this._core.refresh()) | |
} | |
, | |
i.prototype.destroy = function() { | |
var t, n; | |
e.clearInterval(this._interval); | |
for (t in this._handlers) | |
this._core.$element.off(t, this._handlers[t]); | |
for (n in Object.getOwnPropertyNames(this)) | |
"function" != typeof this[n] && (this[n] = null) | |
} | |
, | |
t.fn.owlCarousel.Constructor.Plugins.AutoRefresh = i | |
}(window.Zepto || window.jQuery, window, document), | |
function(t, e, n, r) { | |
var i = function(e) { | |
this._core = e, | |
this._loaded = [], | |
this._handlers = { | |
"initialized.owl.carousel change.owl.carousel resized.owl.carousel": t.proxy(function(e) { | |
if (e.namespace && this._core.settings && this._core.settings.lazyLoad && (e.property && "position" == e.property.name || "initialized" == e.type)) | |
for (var n = this._core.settings, i = n.center && Math.ceil(n.items / 2) || n.items, o = n.center && -1 * i || 0, a = (e.property && e.property.value !== r ? e.property.value : this._core.current()) + o, s = this._core.clones().length, l = t.proxy(function(t, e) { | |
this.load(e) | |
}, this); o++ < i; ) | |
this.load(s / 2 + this._core.relative(a)), | |
s && t.each(this._core.clones(this._core.relative(a)), l), | |
a++ | |
}, this) | |
}, | |
this._core.options = t.extend({}, i.Defaults, this._core.options), | |
this._core.$element.on(this._handlers) | |
}; | |
i.Defaults = { | |
lazyLoad: !1 | |
}, | |
i.prototype.load = function(n) { | |
var r = this._core.$stage.children().eq(n) | |
, i = r && r.find(".owl-lazy"); | |
!i || t.inArray(r.get(0), this._loaded) > -1 || (i.each(t.proxy(function(n, r) { | |
var i, o = t(r), a = e.devicePixelRatio > 1 && o.attr("data-src-retina") || o.attr("data-src"); | |
this._core.trigger("load", { | |
element: o, | |
url: a | |
}, "lazy"), | |
o.is("img") ? o.one("load.owl.lazy", t.proxy(function() { | |
o.css("opacity", 1), | |
this._core.trigger("loaded", { | |
element: o, | |
url: a | |
}, "lazy") | |
}, this)).attr("src", a) : (i = new Image, | |
i.onload = t.proxy(function() { | |
o.css({ | |
"background-image": "url(" + a + ")", | |
opacity: "1" | |
}), | |
this._core.trigger("loaded", { | |
element: o, | |
url: a | |
}, "lazy") | |
}, this), | |
i.src = a) | |
}, this)), | |
this._loaded.push(r.get(0))) | |
} | |
, | |
i.prototype.destroy = function() { | |
var t, e; | |
for (t in this.handlers) | |
this._core.$element.off(t, this.handlers[t]); | |
for (e in Object.getOwnPropertyNames(this)) | |
"function" != typeof this[e] && (this[e] = null) | |
} | |
, | |
t.fn.owlCarousel.Constructor.Plugins.Lazy = i | |
}(window.Zepto || window.jQuery, window, document), | |
function(t, e, n, r) { | |
var i = function(e) { | |
this._core = e, | |
this._handlers = { | |
"initialized.owl.carousel refreshed.owl.carousel": t.proxy(function(t) { | |
t.namespace && this._core.settings.autoHeight && this.update() | |
}, this), | |
"changed.owl.carousel": t.proxy(function(t) { | |
t.namespace && this._core.settings.autoHeight && "position" == t.property.name && this.update() | |
}, this), | |
"loaded.owl.lazy": t.proxy(function(t) { | |
t.namespace && this._core.settings.autoHeight && t.element.closest("." + this._core.settings.itemClass).index() === this._core.current() && this.update() | |
}, this) | |
}, | |
this._core.options = t.extend({}, i.Defaults, this._core.options), | |
this._core.$element.on(this._handlers) | |
}; | |
i.Defaults = { | |
autoHeight: !1, | |
autoHeightClass: "owl-height" | |
}, | |
i.prototype.update = function() { | |
var e = this._core._current | |
, n = e + this._core.settings.items | |
, r = this._core.$stage.children().toArray().slice(e, n) | |
, i = [] | |
, o = 0; | |
t.each(r, function(e, n) { | |
i.push(t(n).height()) | |
}), | |
o = Math.max.apply(null, i), | |
this._core.$stage.parent().height(o).addClass(this._core.settings.autoHeightClass) | |
} | |
, | |
i.prototype.destroy = function() { | |
var t, e; | |
for (t in this._handlers) | |
this._core.$element.off(t, this._handlers[t]); | |
for (e in Object.getOwnPropertyNames(this)) | |
"function" != typeof this[e] && (this[e] = null) | |
} | |
, | |
t.fn.owlCarousel.Constructor.Plugins.AutoHeight = i | |
}(window.Zepto || window.jQuery, window, document), | |
function(t, e, n, r) { | |
var i = function(e) { | |
this._core = e, | |
this._videos = {}, | |
this._playing = null, | |
this._handlers = { | |
"initialized.owl.carousel": t.proxy(function(t) { | |
t.namespace && this._core.register({ | |
type: "state", | |
name: "playing", | |
tags: ["interacting"] | |
}) | |
}, this), | |
"resize.owl.carousel": t.proxy(function(t) { | |
t.namespace && this._core.settings.video && this.isInFullScreen() && t.preventDefault() | |
}, this), | |
"refreshed.owl.carousel": t.proxy(function(t) { | |
t.namespace && this._core.is("resizing") && this._core.$stage.find(".cloned .owl-video-frame").remove() | |
}, this), | |
"changed.owl.carousel": t.proxy(function(t) { | |
t.namespace && "position" === t.property.name && this._playing && this.stop() | |
}, this), | |
"prepared.owl.carousel": t.proxy(function(e) { | |
if (e.namespace) { | |
var n = t(e.content).find(".owl-video"); | |
n.length && (n.css("display", "none"), | |
this.fetch(n, t(e.content))) | |
} | |
}, this) | |
}, | |
this._core.options = t.extend({}, i.Defaults, this._core.options), | |
this._core.$element.on(this._handlers), | |
this._core.$element.on("click.owl.video", ".owl-video-play-icon", t.proxy(function(t) { | |
this.play(t) | |
}, this)) | |
}; | |
i.Defaults = { | |
video: !1, | |
videoHeight: !1, | |
videoWidth: !1 | |
}, | |
i.prototype.fetch = function(t, e) { | |
var n = function() { | |
return t.attr("data-vimeo-id") ? "vimeo" : t.attr("data-vzaar-id") ? "vzaar" : "youtube" | |
}() | |
, r = t.attr("data-vimeo-id") || t.attr("data-youtube-id") || t.attr("data-vzaar-id") | |
, i = t.attr("data-width") || this._core.settings.videoWidth | |
, o = t.attr("data-height") || this._core.settings.videoHeight | |
, a = t.attr("href"); | |
if (!a) | |
throw new Error("Missing video URL."); | |
if (r = a.match(/(http:|https:|)\/\/(player.|www.|app.)?(vimeo\.com|youtu(be\.com|\.be|be\.googleapis\.com)|vzaar\.com)\/(video\/|videos\/|embed\/|channels\/.+\/|groups\/.+\/|watch\?v=|v\/)?([A-Za-z0-9._%-]*)(\&\S+)?/), | |
r[3].indexOf("youtu") > -1) | |
n = "youtube"; | |
else if (r[3].indexOf("vimeo") > -1) | |
n = "vimeo"; | |
else { | |
if (!(r[3].indexOf("vzaar") > -1)) | |
throw new Error("Video URL not supported."); | |
n = "vzaar" | |
} | |
r = r[6], | |
this._videos[a] = { | |
type: n, | |
id: r, | |
width: i, | |
height: o | |
}, | |
e.attr("data-video", a), | |
this.thumbnail(t, this._videos[a]) | |
} | |
, | |
i.prototype.thumbnail = function(e, n) { | |
var r, i, o, a = n.width && n.height ? 'style="width:' + n.width + "px;height:" + n.height + 'px;"' : "", s = e.find("img"), l = "src", c = "", u = this._core.settings, p = function(t) { | |
i = '<div class="owl-video-play-icon"></div>', | |
r = u.lazyLoad ? '<div class="owl-video-tn ' + c + '" ' + l + '="' + t + '"></div>' : '<div class="owl-video-tn" style="opacity:1;background-image:url(' + t + ')"></div>', | |
e.after(r), | |
e.after(i) | |
}; | |
return e.wrap('<div class="owl-video-wrapper"' + a + "></div>"), | |
this._core.settings.lazyLoad && (l = "data-src", | |
c = "owl-lazy"), | |
s.length ? (p(s.attr(l)), | |
s.remove(), | |
!1) : void ("youtube" === n.type ? (o = "//img.youtube.com/vi/" + n.id + "/hqdefault.jpg", | |
p(o)) : "vimeo" === n.type ? t.ajax({ | |
type: "GET", | |
url: "//vimeo.com/api/v2/video/" + n.id + ".json", | |
jsonp: "callback", | |
dataType: "jsonp", | |
success: function(t) { | |
o = t[0].thumbnail_large, | |
p(o) | |
} | |
}) : "vzaar" === n.type && t.ajax({ | |
type: "GET", | |
url: "//vzaar.com/api/videos/" + n.id + ".json", | |
jsonp: "callback", | |
dataType: "jsonp", | |
success: function(t) { | |
o = t.framegrab_url, | |
p(o) | |
} | |
})) | |
} | |
, | |
i.prototype.stop = function() { | |
this._core.trigger("stop", null, "video"), | |
this._playing.find(".owl-video-frame").remove(), | |
this._playing.removeClass("owl-video-playing"), | |
this._playing = null, | |
this._core.leave("playing"), | |
this._core.trigger("stopped", null, "video") | |
} | |
, | |
i.prototype.play = function(e) { | |
var n, r = t(e.target), i = r.closest("." + this._core.settings.itemClass), o = this._videos[i.attr("data-video")], a = o.width || "100%", s = o.height || this._core.$stage.height(); | |
this._playing || (this._core.enter("playing"), | |
this._core.trigger("play", null, "video"), | |
i = this._core.items(this._core.relative(i.index())), | |
this._core.reset(i.index()), | |
"youtube" === o.type ? n = '<iframe width="' + a + '" height="' + s + '" src="//www.youtube.com/embed/' + o.id + "?autoplay=1&v=" + o.id + '" frameborder="0" allowfullscreen></iframe>' : "vimeo" === o.type ? n = '<iframe src="//player.vimeo.com/video/' + o.id + '?autoplay=1" width="' + a + '" height="' + s + '" frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe>' : "vzaar" === o.type && (n = '<iframe frameborder="0"height="' + s + '"width="' + a + '" allowfullscreen mozallowfullscreen webkitAllowFullScreen src="//view.vzaar.com/' + o.id + '/player?autoplay=true"></iframe>'), | |
t('<div class="owl-video-frame">' + n + "</div>").insertAfter(i.find(".owl-video")), | |
this._playing = i.addClass("owl-video-playing")) | |
} | |
, | |
i.prototype.isInFullScreen = function() { | |
var e = n.fullscreenElement || n.mozFullScreenElement || n.webkitFullscreenElement; | |
return e && t(e).parent().hasClass("owl-video-frame") | |
} | |
, | |
i.prototype.destroy = function() { | |
var t, e; | |
this._core.$element.off("click.owl.video"); | |
for (t in this._handlers) | |
this._core.$element.off(t, this._handlers[t]); | |
for (e in Object.getOwnPropertyNames(this)) | |
"function" != typeof this[e] && (this[e] = null) | |
} | |
, | |
t.fn.owlCarousel.Constructor.Plugins.Video = i | |
}(window.Zepto || window.jQuery, window, document), | |
function(t, e, n, r) { | |
var i = function(e) { | |
this.core = e, | |
this.core.options = t.extend({}, i.Defaults, this.core.options), | |
this.swapping = !0, | |
this.previous = r, | |
this.next = r, | |
this.handlers = { | |
"change.owl.carousel": t.proxy(function(t) { | |
t.namespace && "position" == t.property.name && (this.previous = this.core.current(), | |
this.next = t.property.value) | |
}, this), | |
"drag.owl.carousel dragged.owl.carousel translated.owl.carousel": t.proxy(function(t) { | |
t.namespace && (this.swapping = "translated" == t.type) | |
}, this), | |
"translate.owl.carousel": t.proxy(function(t) { | |
t.namespace && this.swapping && (this.core.options.animateOut || this.core.options.animateIn) && this.swap() | |
}, this) | |
}, | |
this.core.$element.on(this.handlers) | |
}; | |
i.Defaults = { | |
animateOut: !1, | |
animateIn: !1 | |
}, | |
i.prototype.swap = function() { | |
if (1 === this.core.settings.items && t.support.animation && t.support.transition) { | |
this.core.speed(0); | |
var e, n = t.proxy(this.clear, this), r = this.core.$stage.children().eq(this.previous), i = this.core.$stage.children().eq(this.next), o = this.core.settings.animateIn, a = this.core.settings.animateOut; | |
this.core.current() !== this.previous && (a && (e = this.core.coordinates(this.previous) - this.core.coordinates(this.next), | |
r.one(t.support.animation.end, n).css({ | |
left: e + "px" | |
}).addClass("animated owl-animated-out").addClass(a)), | |
o && i.one(t.support.animation.end, n).addClass("animated owl-animated-in").addClass(o)) | |
} | |
} | |
, | |
i.prototype.clear = function(e) { | |
t(e.target).css({ | |
left: "" | |
}).removeClass("animated owl-animated-out owl-animated-in").removeClass(this.core.settings.animateIn).removeClass(this.core.settings.animateOut), | |
this.core.onTransitionEnd() | |
} | |
, | |
i.prototype.destroy = function() { | |
var t, e; | |
for (t in this.handlers) | |
this.core.$element.off(t, this.handlers[t]); | |
for (e in Object.getOwnPropertyNames(this)) | |
"function" != typeof this[e] && (this[e] = null) | |
} | |
, | |
t.fn.owlCarousel.Constructor.Plugins.Animate = i | |
}(window.Zepto || window.jQuery, window, document), | |
function(t, e, n, r) { | |
var i = function(e) { | |
this._core = e, | |
this._timeout = null, | |
this._paused = !1, | |
this._handlers = { | |
"changed.owl.carousel": t.proxy(function(t) { | |
t.namespace && "settings" === t.property.name ? this._core.settings.autoplay ? this.play() : this.stop() : t.namespace && "position" === t.property.name && this._core.settings.autoplay && this._setAutoPlayInterval() | |
}, this), | |
"initialized.owl.carousel": t.proxy(function(t) { | |
t.namespace && this._core.settings.autoplay && this.play() | |
}, this), | |
"play.owl.autoplay": t.proxy(function(t, e, n) { | |
t.namespace && this.play(e, n) | |
}, this), | |
"stop.owl.autoplay": t.proxy(function(t) { | |
t.namespace && this.stop() | |
}, this), | |
"mouseover.owl.autoplay": t.proxy(function() { | |
this._core.settings.autoplayHoverPause && this._core.is("rotating") && this.pause() | |
}, this), | |
"mouseleave.owl.autoplay": t.proxy(function() { | |
this._core.settings.autoplayHoverPause && this._core.is("rotating") && this.play() | |
}, this), | |
"touchstart.owl.core": t.proxy(function() { | |
this._core.settings.autoplayHoverPause && this._core.is("rotating") && this.pause() | |
}, this), | |
"touchend.owl.core": t.proxy(function() { | |
this._core.settings.autoplayHoverPause && this.play() | |
}, this) | |
}, | |
this._core.$element.on(this._handlers), | |
this._core.options = t.extend({}, i.Defaults, this._core.options) | |
}; | |
i.Defaults = { | |
autoplay: !1, | |
autoplayTimeout: 5e3, | |
autoplayHoverPause: !1, | |
autoplaySpeed: !1 | |
}, | |
i.prototype.play = function(t, e) { | |
this._paused = !1, | |
this._core.is("rotating") || (this._core.enter("rotating"), | |
this._setAutoPlayInterval()) | |
} | |
, | |
i.prototype._getNextTimeout = function(r, i) { | |
return this._timeout && e.clearTimeout(this._timeout), | |
e.setTimeout(t.proxy(function() { | |
this._paused || this._core.is("busy") || this._core.is("interacting") || n.hidden || this._core.next(i || this._core.settings.autoplaySpeed) | |
}, this), r || this._core.settings.autoplayTimeout) | |
} | |
, | |
i.prototype._setAutoPlayInterval = function() { | |
this._timeout = this._getNextTimeout() | |
} | |
, | |
i.prototype.stop = function() { | |
this._core.is("rotating") && (e.clearTimeout(this._timeout), | |
this._core.leave("rotating")) | |
} | |
, | |
i.prototype.pause = function() { | |
this._core.is("rotating") && (this._paused = !0) | |
} | |
, | |
i.prototype.destroy = function() { | |
var t, e; | |
this.stop(); | |
for (t in this._handlers) | |
this._core.$element.off(t, this._handlers[t]); | |
for (e in Object.getOwnPropertyNames(this)) | |
"function" != typeof this[e] && (this[e] = null) | |
} | |
, | |
t.fn.owlCarousel.Constructor.Plugins.autoplay = i | |
}(window.Zepto || window.jQuery, window, document), | |
function(t, e, n, r) { | |
"use strict"; | |
var i = function(e) { | |
this._core = e, | |
this._initialized = !1, | |
this._pages = [], | |
this._controls = {}, | |
this._templates = [], | |
this.$element = this._core.$element, | |
this._overrides = { | |
next: this._core.next, |