1(window.webpackJsonp=window.webpackJsonp||[]).push([[31],{150:function(e,t,r){ 2/*! 3 * accounting.js v0.4.1 4 * Copyright 2014 Open Exchange Rates 5 * 6 * Freely distributable under the MIT license. 7 * Portions of accounting.js are inspired or borrowed from underscore.js 8 * 9 * Full details and documentation: 10 * http://openexchangerates.github.io/accounting.js/ 11 */ 12!function(r,n){var a={version:"0.4.1",settings:{currency:{symbol:"$",format:"%s%v",decimal:".",thousand:",",precision:2,grouping:3},number:{precision:0,grouping:3,thousand:",",decimal:"."}}},i=Array.prototype.map,s=Array.isArray,o=Object.prototype.toString;function c(e){return!!(""===e||e&&e.charCodeAt&&e.substr)}function u(e){return s?s(e):"[object Array]"===o.call(e)}function l(e){return e&&"[object Object]"===o.call(e)}function d(e,t){var r;for(r in e=e||{},t=t||{})t.hasOwnProperty(r)&&null==e[r]&&(e[r]=t[r]);return e}function f(e,t,r){var n,a,s=[];if(!e)return s;if(i&&e.map===i)return e.map(t,r);for(n=0,a=e.length;n<a;n++)s[n]=t.call(r,e[n],n,e);return s}function h(e,t){return e=Math.round(Math.abs(e)),isNaN(e)?t:e}function m(e){var t=a.settings.currency.format;return"function"==typeof e&&(e=e()),c(e)&&e.match("%v")?{pos:e,neg:e.replace("-","").replace("%v","-%v"),zero:e}:e&&e.pos&&e.pos.match("%v")?e:c(t)?a.settings.currency.format={pos:t,neg:t.replace("%v","-%v"),zero:t}:t}var y=a.unformat=a.parse=function(e,t){if(u(e))return f(e,(function(e){return y(e,t)}));if("number"==typeof(e=e||0))return e;t=t||a.settings.number.decimal;var r=new RegExp("[^0-9-"+t+"]",["g"]),n=parseFloat((""+e).replace(/\((.*)\)/,"-$1").replace(r,"").replace(t,"."));return isNaN(n)?0:n},p=a.toFixed=function(e,t){t=h(t,a.settings.number.precision);var r=Math.pow(10,t);return(Math.round(a.unformat(e)*r)/r).toFixed(t)},g=a.formatNumber=a.format=function(e,t,r,n){if(u(e))return f(e,(function(e){return g(e,t,r,n)}));e=y(e);var i=d(l(t)?t:{precision:t,thousand:r,decimal:n},a.settings.number),s=h(i.precision),o=e<0?"-":"",c=parseInt(p(Math.abs(e||0),s),10)+"",m=c.length>3?c.length%3:0;return o+(m?c.substr(0,m)+i.thousand:"")+c.substr(m).replace(/(\d{3})(?=\d)/g,"$1"+i.thousand)+(s?i.decimal+p(Math.abs(e),s).split(".")[1]:"")},v=a.formatMoney=function(e,t,r,n,i,s){if(u(e))return f(e,(function(e){return v(e,t,r,n,i,s)}));e=y(e);var o=d(l(t)?t:{symbol:t,precision:r,thousand:n,decimal:i,format:s},a.settings.currency),c=m(o.format);return(e>0?c.pos:e<0?c.neg:c.zero).replace("%s",o.symbol).replace("%v",g(Math.abs(e),h(o.precision),o.thousand,o.decimal))};a.formatColumn=function(e,t,r,n,i,s){if(!e)return[];var o=d(l(t)?t:{symbol:t,precision:r,thousand:n,decimal:i,format:s},a.settings.currency),p=m(o.format),v=p.pos.indexOf("%s")<p.pos.indexOf("%v"),C=0,b=f(e,(function(e,t){if(u(e))return a.formatColumn(e,o);var r=((e=y(e))>0?p.pos:e<0?p.neg:p.zero).replace("%s",o.symbol).replace("%v",g(Math.abs(e),h(o.precision),o.thousand,o.decimal));return r.length>C&&(C=r.length),r}));return f(b,(function(e,t){return c(e)&&e.length<C?v?e.replace(o.symbol,o.symbol+new Array(C-e.length+1).join(" ")):new Array(C-e.length+1).join(" ")+e:e}))},e.exports&&(t=e.exports=a),t.accounting=a}()},20:function(e,t,r){"use strict";r.d(t,"c",(function(){return n})),r.d(t,"a",(function(){return a})),r.d(t,"b",(function(){return i})),r.d(t,"d",(function(){return o}));var n,a,i,s=r(3);!function(e){e.Calculator="calculator",e.Booking="booking"}(n||(n={})),function(e){e.In="in",e.Out="out"}(a||(a={})),function(e){e.Sell="sell",e.Buy="buy"}(i||(i={}));class o{constructor(e,t,r,n){this.siteCurrencyCode="",this.converterFee=0,this.converterSellFee=0,this.roundingStep=.01,this.siteCurrencyCode=e,this.converterFee=t,this.converterSellFee=r,this.roundingStep=n}getResult(e){if(this.siteCurrencyCode===e.inCurrencyCode)return this.calculateSaleResult(e);if(this.siteCurrencyCode===e.outCurrencyCode)return this.calculatePurchaseResult(e);throw new Error("Wrong currencies given")}calculateSaleResult(e){let t=e.outAmountRequested,r=e.inAmountRequested,c=e.inAmountRequested,u=null;if("in"===e.calculationDirection){const s=o.getRateFromPricelist(e.sellPricelist,1),l=this.getTotalAmount(e.inAmountRequested,s.price,e.calculationDirection,i.Sell);if(u=o.getRateFromPricelist(e.sellPricelist,l),r=e.inAmountRequested-this.converterFee,t=this.getTotalAmount(r,u.price,e.calculationDirection,i.Sell),(r<0||t>=1/0||u.price<=0)&&(r=0,t=0),e.calculationDestination===n.Booking){let n=this.getValidAmount(t,e);n!==t&&(t=n,r=this.getTotalAmount(t,u.price,a.Out,i.Sell),c=r+this.converterFee),(r<0||t>=1/0||u.price<=0)&&(r=0,t=0,c=0)}}else{if("out"!==e.calculationDirection)throw new Error("Unknown preferred amount");if(e.calculationDestination===n.Booking){let r=this.getValidAmount(t,e);r!==t&&(t=r)}u=o.getRateFromPricelist(e.sellPricelist,t),r=this.getTotalAmount(t,u.price,e.calculationDirection,i.Sell),c=r+this.converterFee,(u.price<=0||r<=0)&&(r=0,t=0,c=0)}const l=this.getRounding(r);return{totalSum:s.default.formatPriceWithCurrency(c+l,e.inCurrencyCode),totalSumNumber:Number(s.default.roundToFixed(c,2)),totalGet:s.default.formatPriceWithCurrency(t,e.outCurrencyCode),totalGetNumber:Number(s.default.roundToFixed(t,2)),rounding:s.default.formatPriceWithCurrency(l,e.inCurrencyCode),fee:s.default.formatPriceWithCurrency(this.converterFee,e.inCurrencyCode),feeNumber:this.converterFee,exchangeRate:s.default.roundToFixed(u.price,4),exchangeRateDisplay:s.default.roundToFixed(this.getDisplayRate(u.price,e),4),amountIn:s.default.roundToFixed(r,2),amountInNumber:r,amountInCurrency:e.inCurrencyCode,amountOut:s.default.roundToFixed(t,2),amountOutCurrency:e.outCurrencyCode}}calculatePurchaseResult(e){let t=e.outAmountRequested,r=e.inAmountRequested,n=e.outAmountRequested,a=null;if("in"===e.calculationDirection)a=o.getRateFromPricelist(e.buyPricelist,e.inAmountRequested),t=this.getTotalAmount(e.inAmountRequested,a.price,e.calculationDirection,i.Buy),n=t-this.converterSellFee,(n<0||t>=1/0||a.price<=0)&&(n=0,t=0);else{if("out"!==e.calculationDirection)throw new Error("Unknown preferred amount");{const s=o.getRateFromPricelist(e.buyPricelist,1),c=e.outAmountRequested+this.converterSellFee,u=this.getTotalAmount(c,s.price,e.calculationDirection,i.Buy);a=o.getRateFromPricelist(e.buyPricelist,u),r=this.getTotalAmount(c,a.price,e.calculationDirection,i.Buy),t=e.outAmountRequested+this.converterSellFee,(r>=1/0||a.price<=0)&&(r=0,t=0,n=0)}}const c=this.getRounding(t);return{totalSum:s.default.formatPriceWithCurrency(r,e.inCurrencyCode),totalSumNumber:Number(s.default.roundToFixed(r,2)),totalGet:s.default.formatPriceWithCurrency(n+c,e.outCurrencyCode),totalGetNumber:Number(s.default.roundToFixed(n,2)),rounding:s.default.formatPriceWithCurrency(c,e.outCurrencyCode),fee:s.default.formatPriceWithCurrency(this.converterSellFee,e.outCurrencyCode),feeNumber:this.converterSellFee,exchangeRate:s.default.roundToFixed(a.price,4),exchangeRateDisplay:s.default.roundToFixed(this.getDisplayRate(a.price,e),4),amountIn:s.default.roundToFixed(r,2),amountInNumber:r,amountInCurrency:e.inCurrencyCode,amountOut:s.default.roundToFixed(t,2),amountOutCurrency:e.outCurrencyCode}}getValidAmount(e,t){return null!==t.outCurrencyMinBanknote&&t.outCurrencyMinBanknote>0&&(e=Math.ceil(e/t.outCurrencyMinBanknote)*t.outCurrencyMinBanknote,t.outCurrencyMinBanknote>e&&(e=t.outCurrencyMinBanknote)),e<t.outCurrencyMinQuantity&&(e=t.outCurrencyMinQuantity),e}getTotalAmount(e,t,r,n){return s.default.isCurrencyBase(this.siteCurrencyCode)?n===i.Sell?r===a.In?e*t:e/t:r===a.In?e/t:e*t:n===i.Sell?r===a.In?e/t:e*t:r===a.In?e*t:e/t}getDisplayRate(e,t){return t.isMultiplied?s.default.isCurrencyBase(this.siteCurrencyCode)?e/t.multipliedAmount:e*t.multipliedAmount:e}static getRateFromPricelist(e,t){let r=null;for(let n in e){if(e[n].quantityFrom<=t&&(0==e[n].quantityTo||e[n].quantityTo>=t))return e[n];r=e[n]}return r||{price:null,vatRate:null,vat:null,noVatPrice:null,rate:null,quantityFrom:null,quantityTo:null}}getRounding(e){if(this.roundingStep<=.01)return 0;const t=1/this.roundingStep;return Math.round(e*t)/t-e}}},261:function(e,t,r){e.exports=r(262)},262:function(e,t,r){"use strict";r.r(t),function(e){r.d(t,"Transfer",(function(){return f}));
12var n,a=r(150),i=r(3),s=r(6),o=r(23),c=r(45),u=r(51),l=r(20);!function(e){e[e.From=0]="From",e[e.To=1]="To"}(n||(n={}));class d{constructor(){this.calculatorTimeout=null,this.currencyCalculator=null,this.currencyCalculator=new l.d(gotoAndPlay.siteCurrency,Number(gotoAndPlay.converterFee),Number(gotoAndPlay.converterSellFee),gotoAndPlay.roundingStep),e(document).on("change keyup",".js-converter-from-amount input",e=>this.triggerCalculate(e,l.a.In)),e(document).on("change keyup",".js-converter-to-amount input",e=>this.triggerCalculate(e,l.a.Out)),e(document).on("change",".js-converter-from-currency select",e=>this.changeCurrency(e,l.b.Sell)),e(document).on("change",".js-converter-to-currency select",e=>this.changeCurrency(e,l.b.Buy)),e(document).on("click",".calculator__switch",this.swap.bind(this)),e(document).on("click",".js-apply-currency",this.applyPair.bind(this)),e(document).on("click",".js-buy-currency",this.onBuyClick.bind(this)),e(document).on("submit",".js-converter-form",e=>{e.preventDefault()}),e(document).on("click",".js-submit-rates",t=>{t.preventDefault(),e(".js-converter-modal").trigger("click")}),e(document).on("submit",".js-converter-modal-form",e=>this.submitConverterModalForm(e));const t=e(".js-converter-from-currency select"),r=e(".js-converter-to-currency select"),n=e(".js-converter-form");let a=d.getSelectValue(t),i=d.getSelectValue(r);t.val(a).data("value",a),r.val(i).data("value",i),n.data("type",e(".js-converter-from-amount input").val()>0?"sell":"buy"),this.swapFunction=e=>this.triggerCalculate(e,l.a.In),this.calculate(n)}submitConverterModalForm(t){t.preventDefault();let r=e(t.currentTarget);if(o.default.validate(r)){let t=i.default.objectifyForm(r);t.calculator_in_currency=e(".js-transfer-from").text(),t.calculator_out_currency=e(".js-transfer-to").text(),t.calculator_in_amount_requested=e(".js-transfer-send").data("raw-value"),t.calculator_out_amount_requested=e(".js-transfer-receive").data("raw-value"),t.calculator_input_direction=e(".js-transfer-rate").data("preferred"),i.default.validateReCaptcha("tvx_convert").then(n=>{t.reCaptchaKey=n,s.a.submit(r,{action:"tvx-convert",data:t}).then(t=>{t&&t.success&&(e(".js-converter-office").text(r.find('[name="office"] option:selected').text()),e(".js-converter-email").text(""+r.find('[name="email"]').val()),e(".js-transfer-success-btn").attr("href",t.officeLink).attr("target","_blank"),e(".js-price-locked-until").text(t.lockedUntil),r.addClass("h-hidden"),e(".js-transfer-success").removeClass("h-hidden"))})})}}static getSelectValue(e){return e.find("option:selected").length?e.val():e.siblings(".dropdown__text .dropdown__menu-item-abbr").text().trim()}onBuyClick(t=null){t.preventDefault(),u.a.showHeader(),e(".header__actions").removeClass("-loaded-cart").addClass("-loading-cart");const r=e(t.currentTarget);if(r.hasClass("is-success")||r.is(":disabled"))return;const n=r.parents(".js-converter-form"),a=""+n.find(".js-converter-to-currency select").val(),i={action:"tvx-cart-add",id:a,amount:parseInt(""+n.find(".js-converter-to-amount input").val()),officeId:this.getSelectedOffice(a)},o=s.a.post(i);s.a.addLoader(e(".js-cart-popup")),r.addClass("is-success"),o.then(e=>{e.success&&c.cart.showMiniCart(),setTimeout(()=>{r.removeClass("is-success")},900)})}swap(t){t.preventDefault();const r=e(t.currentTarget).parents(".js-converter-form");"in"===r.data("swap")?r.data("swap","out"):r.data("swap","in"),d.swapCurrenciesSelect(r),d.updateCurrencySelectValues(r),this.swapFunction(t)}applyPair(t){t.preventDefault();const r=e(t.currentTarget).parents(".js-converter-form");let n=e(t.currentTarget),a=r.find(".js-converter-from-currency select"),i=r.find(".js-converter-to-currency select");a.val(n.data("from")).trigger("change"),i.val(n.data("to")).trigger("change")}changeCurrency(t,r){let n=e(t.currentTarget).parents(".js-converter-form");d.updateSelectValuesBasedOnDirection(n,r,gotoAndPlay.siteCurrency),d.updateCurrencySelectValues(n),this.calculate(n)}static updateCurrencySelectValues(e){let t=e.find(".js-converter-from-currency select"),r=e.find(".js-converter-to-currency select");r.data("value",r.val()),t.data("value",t.val())}static updateSelectValuesBasedOnDirection(e,t,r){let n=e.find(".js-converter-from-currency select"),a=e.find(".js-converter-to-currency select");switch(t){case l.b.Sell:n.val()==r&&a.val()==r?a.val(n.data("value")).trigger("change"):n.val()!=r&&a.val(r).trigger("change");break;case l.b.Buy:n.val()==r&&a.val()==r?n.val(a.data("value")).trigger("change"):a.val()!=r&&n.val(r).trigger("change")}}static swapCurrenciesSelect(e){let t=e.find(".js-converter-from-currency select"),r=e.find(".js-converter-to-currency select"),n=e.find(".js-converter-from-amount input"),a=e.find(".js-converter-to-amount input");const i=n.val(),s=a.val();switch(e.data("type")){default:case l.b.Sell:n.val(s);break;case l.b.Buy:a.val(i)}t.val()==gotoAndPlay.siteCurrency?r.val(gotoAndPlay.siteCurrency).trigger("change"):t.val(gotoAndPlay.siteCurrency).trigger("change"),"in"===e.data("swap")?a.val(i).trigger("change"):n.val(s).trigger("change")}triggerCalculate(t,r){null!==this.calculatorTimeout&&clearTimeout(this.calculatorTimeout),e('[href="#modaal-transfer"]').attr("disabled","disabled"),this.calculatorTimeout=setTimeout(()=>{this.calculatorTimeout=null;let n=e(t.target).parents(".js-converter-form");n.data("swap",d.getFlippedDirection(r)),n.data("preferred",r),n.data("type",d.getTypeFromDirection(r)),this.swapFunction=e=>this.triggerCalculate(e,d.getFlippedDirection(r)),this.calculate(n),e('[href="#modaal-transfer"]').removeAttr("disabled")},500)}static getFlippedDirection(e){return e===l.a.In?l.a.Out:l.a.In}static getTypeFromDirection(e){return e===l.a.In?l.b.Sell:l.b.Buy}changeOffice(t){d.selectedOffice=parseInt(e(t.target).val().toString()),this.calculate(e(".js-converter-form"))}findPricelist(e,t){return JSON.parse(calculatorPriceList[e.toLowerCase()][t])}getSelectedOffice(t){if(d.selectedOffice)return d.selectedOffice;try{let r=new URLSearchParams(window.location.search);if(r.has("officeId")){let e=parseInt(r.get("officeId").toString());if(this.isOfficeInPricelist(t,e))return d.selectedOffice=e}let n=e(".js-currency-special-tab #office, .js-converter-form #office");if(n.length>0&&n.val()){let e=new URL(n.val().toString());if(e&&e.searchParams&&e.searchParams.has("officeId")){let r=parseInt(e.searchParams.get("officeId").toString());if(this.isOfficeInPricelist(t,r))return d.selectedOffice=r}}if("undefined"==typeof calculatorPriceList||!calculatorPriceList)return null;if(gotoAndPlay.headOfficeId&&this.isOfficeInPricelist(t,gotoAndPlay.headOfficeId))return d.selectedOffice=gotoAndPlay.headOfficeId;const a=Object.keys(calculatorPriceList);let i=parseInt(Object.keys(calculatorPriceList[a[0]])[0]);if(this.isOfficeInPricelist(t,i))return d.selectedOffice=i}catch(e){return null}}isOfficeInPricelist(e,t){return"undefined"==typeof calculatorPriceList||!calculatorPriceList||Object.keys(calculatorPriceList[e.toLowerCase()]).includes(t.toString())}calculate(t){var r,n;if(!t.length)return;let a,s,o=t.find(".js-converter-from-amount input"),c=t.find(".js-converter-to-amount input"),u=t.find(".js-converter-from-currency select"),f=t.find(".js-converter-to-currency select"),h=t.find(".js-buy-currency"),m=t.find("#isMultipleAmount"),y=t.find("#multipleAmount"),p=!1;u.val()==gotoAndPlay.siteCurrency?(a=f,p=!0):a=u,s="undefined"!=typeof calculatorPriceList&&calculatorPriceList?this.findPricelist(a.val(),this.get
12SelectedOffice(a.val())):a.find("option:selected").data("pricelist");const g=a.find("option:selected").data("minquantity"),v=a.find("option:selected").val(),C=a.find("option:selected").data("minbanknote");let b=l.a.In;t.data("preferred")?b=t.data("preferred"):(Number(o.val())>0?b=l.a.In:Number(c.val())>0&&(b=l.a.Out),t.data("preferred",b));const j={inCurrencyCode:String(u.val()),outCurrencyCode:String(f.val()),inAmountRequested:i.default.numeric(o.val()),outAmountRequested:i.default.numeric(c.val()),buyPricelist:null!==(r=s.buy)&&void 0!==r?r:[],sellPricelist:null!==(n=s.sell)&&void 0!==n?n:[],isMultiplied:1==m.val(),multipliedAmount:Number(y.val()),outCurrencyMinQuantity:Number(g),outCurrencyMinBanknote:Number(C),calculationDirection:b,calculationDestination:l.c.Calculator},P=this.currencyCalculator.getResult(j);c.val(P.totalGetNumber),o.val(P.totalSumNumber),j.calculationDestination=l.c.Booking;const A=this.currencyCalculator.getResult(j),D=A.totalGet!==P.totalGet||A.totalSum!==P.totalSum;if(e(".product-poster__min-quantity-value").html(g),e(".product-poster__min-quantity-currency").html(v),!gotoAndPlay.hasDualCurrencies||P.amountInCurrency!=gotoAndPlay.siteCurrency&&P.amountOutCurrency!=gotoAndPlay.siteCurrency)t.find(".js-converter-rate").text(P.exchangeRateDisplay);else{let r=e(".product-poster").length>0?"<br />":" | ";if(0==parseFloat(P.exchangeRateDisplay))t.find(".js-converter-rate").html(P.exchangeRateDisplay+r+P.exchangeRateDisplay+" "+gotoAndPlay.dualCurrencySymbol);else if(gotoAndPlay.hasDualCurrenciesEur){let e=i.default.roundToFixed(1/(parseFloat(P.exchangeRateDisplay)*gotoAndPlay.dualCurrencyRate),4);t.find(".js-converter-rate").html(P.exchangeRateDisplay+r+e+" "+gotoAndPlay.dualCurrencySymbol)}else{let e=i.default.roundToFixed(parseFloat(P.exchangeRateDisplay)/gotoAndPlay.dualCurrencyRate,4);t.find(".js-converter-rate").html(P.exchangeRateDisplay+" "+gotoAndPlay.siteCurrencySign+r+e+" "+gotoAndPlay.dualCurrencySymbol)}}if(t.find(".js-converter-fee").text(P.fee),t.find(".js-multiply-quantity-value").html(d.getMultiplyQuantityText(f.val(),1==m.val(),y.val())),e(".js-transfer-rate").data("preferred",b).text(P.exchangeRate),e(".js-transfer-from").text(P.amountInCurrency),e(".js-transfer-to").text(P.amountOutCurrency),e(".js-transfer-fee").text(P.fee),e(".js-transfer-rounding").text(A.rounding),e(".js-transfer-send").data("raw-value",A.amountInNumber).text(A.amountIn),e(".js-transfer-receive").data("raw-value",A.amountOut).text(A.amountOut),e(".js-transfer-totalSend").text(A.totalSum),e(".js-transfer-totalReceive").text(A.totalGet),D?e(".js-transfer-modal-alert").addClass("is-active").find(".js-alert-content > span").text(gotoAndPlay.strings.currencyCalculator.alertContent.replace("%s",A.amountOutCurrency)):e(".js-transfer-modal-alert").removeClass("is-active"),i.default.numeric(o.val())>0&&i.default.numeric(c.val())>0?e(".js-submit-rates, .js-fix-rates").removeClass("is-disabled").removeAttr("disabled"):e(".js-submit-rates, .js-fix-rates").addClass("is-disabled").attr("disabled","disabled"),P.feeNumber>0?t.find(".js-converter-fee-container").show():t.find(".js-converter-fee-container").hide(),h.length){let e=(""+h.data("buy-max")).replace(",",".");p&&c.val()>0&&("0"==e||o.val()<parseFloat(e))?h.removeAttr("disabled"):h.attr("disabled","disabled")}}static getMultiplyQuantityText(e,t,r){return t?"("+r+" "+e+")</span>":""}}d.selectedOffice=null;class f{constructor(t){this.lockRateDisabled=!1,this.element=e(t),this.currencies=gotoAndPlay.transferData.currencies,this.countries=gotoAndPlay.transferData.countries,this.euCountryList=gotoAndPlay.transferData.euCountries,this.agents={send:gotoAndPlay.transferData.sendAgents,receive:gotoAndPlay.transferData.receiveAgents},this.bdoTypes=gotoAndPlay.transferData.bdoTypes,this.times={BB:"24h",BC:"24h",CB:"24h",CC:"5 min"},this.transferDirection=(""+e("#sendType").val()).split(""),this.transferDirection||(this.transferDirection=["B","B"]),this.preInit=!1,this.current={agent:{send:{code:gotoAndPlay.transferData.defaults.countryFrom.default},receive:{code:gotoAndPlay.transferData.defaults.countryTo.default}},currency:{send:gotoAndPlay.transferData.defaults.currencyFrom.default,receive:gotoAndPlay.transferData.defaults.currencyTo.default},active:{send:"countries",receive:"countries"}},this.calculationData={},this.init()}init(){this.bindEvents(),this.preInit=!0,this.setCountries(this.transferDirection[n.From],"send"),this.setCountries(this.transferDirection[n.To],"receive"),e(".js-input-amount input").trigger("blur"),setTimeout(()=>{this.preInit=!1,this.update("IN"),this.element.removeClass(i.LOADING_CLASS)}
12,1),e(".js-expire-rates").modaal({background:"#1d052a",overlay_opacity:.75,after_close:()=>{this.update("IN")}}),this.setPrivat()}bindEvents(){e(document).on("change focus blur",".js-input-amount input",this.formatValue.bind(this)),e(document).on("change","#sendType",this.typeChangeUpdate.bind(this)),e(document).on("keyup","#sendAmount",{direction:"send"},this.amountChangeUpdate.bind(this)),e(document).on("keyup","#receiveAmount",{direction:"receive"},this.amountChangeUpdate.bind(this)),e(document).on("change","#fromCountry",{direction:"send"},this.countryChangeUpdate.bind(this)),e(document).on("change","#toCountry",{direction:"receive"},this.countryChangeUpdate.bind(this)),e(document).on("change","#fromCurrency",{direction:"send"},this.currencyChangeUpdate.bind(this)),e(document).on("change","#toCurrency",{direction:"receive"},this.currencyChangeUpdate.bind(this)),e(document).on("click",".js-transfer-submit",this.submitRateLock.bind(this)),e(document).on("click",".js-expire-close",()=>{e(".js-expire-rates").modaal("close")}),e(document).on("change","#selectBdo, #selectPrivat",()=>{this.setCurrencies(this.current.agent.receive,this.transferDirection[n.To],"receive"),this.update("IN")})}updateSelects(){i.default.isMobileDevice||this.element.find("select").dropdown()}buildList(e,t,r,n){let a="",i="";for(let r=0;r<e.length;r++){let s=e[r],o=e[r];"object"==typeof o&&(o=e[r].code),i=s,t&&(s=e[r][t],i="string"==typeof e[r][t+"_"+gotoAndPlay.lang]?e[r][t+"_"+gotoAndPlay.lang]:s),n==o?(a+='<option value="'+o+'" label="'+s+'" selected="selected">'+i+"</option>",i=s):a+='<option value="'+o+'" label="'+s+'">'+i+"</option>"}let s=r.parents(".form-select");s.data("html")?(s.html(s.data("html")),r=s.find("select")):s.data("html",s.html()),r.empty().append(a)}setCountries(t,r){let n=[];"C"==t?(n=this.agents[r],this.current.active[r]="agents"):"B"==t&&(n=this.countries,this.current.active[r]="countries");let a=!1,i="";const s=[];for(let t=0;t<gotoAndPlay.transferData.mainCountryList.length;t++){const r=e.grep(n,(function(e){return e.name==gotoAndPlay.transferData.mainCountryList[t]}));1==r.length&&(s.push(r[0]),n=e.grep(n,(function(e){return e.name!=gotoAndPlay.transferData.mainCountryList[t]})))}n=s.concat(n);for(let e=0;e<n.length;e++)if(n[e].code==this.current.agent[r].code){this.current.agent[r]=n[e],a=!0,i=n[e].code;break}a||(this.current.agent[r]=n[0]);const o=e("send"==r?"#fromCountry":"#toCountry");this.buildList(n,"name",o,i),this.setCurrencies(this.current.agent[r],t,r)}setCurrencies(t,r,n){const a="send"==n?"IN":"OUT";let i,s=[],o="";"C"==r?(s=this.currencies[a].cash[t.code]?this.currencies[a].cash[t.code]:this.currencies[a].cash.EE,i=this.selectDefaultCurrency(n),o=i&&e.inArray(i,s)?i:s[0]):"B"==r&&(s="OUT"===a&&"UA"===t.code?this.currencies[a].privat:this.currencies[a].bank,i=this.selectDefaultCurrency(n),o=i&&-1!=e.inArray(i,s)?i:e.inArray(this.current.currency[n],s)?this.current.currency[n]:s[0]),this.current.currency[n]=o;const c=e("send"==n?"#fromCurrency":"#toCurrency");this.buildList(s,null,c,o)}setBdo(){"PH"==this.current.agent.receive.code&&"C"==this.transferDirection[n.To]?e(".js-row-bdo").removeClass("h-hidden"):e(".js-row-bdo").addClass("h-hidden")}setPrivat(){"UA"==this.current.agent.receive.code&&"B"==this.transferDirection[n.To]?e(".js-row-privat").removeClass("h-hidden"):e(".js-row-privat").addClass("h-hidden")}selectDefaultCurrency(t){let r="";switch(e("send"==t?"#fromCountry":"#toCountry").find("option:selected").val()){case"EE":case"Estonia":r="EUR";break;case"SE":case"Sweden":r="SEK";break;case"DK":case"Denmark":r="DKK";break;case"FI":case"Finland":r="EUR";break;case"LV":case"Latvia":r="EUR";break;case"PL":case"Poland":r="PLN";break;case"NO":case"Norway":r="NOK";break;case"BG":case"Bulgaria":r="EUR";break;case"PH":case"Philippines":r="PHP";break;case"UA":case"Ukraine":r="EUR";break;case"US":r="USD";break;case"HU":r="HUF";break;default:r="EUR"}return r}getParsedNumber(e){return e=(e=" "===gotoAndPlay.thousandSeparator?e.replace(/ /g,""):e.replace(gotoAndPlay.thousandSeparator,"")).replace(gotoAndPlay.decimalSeparator,".")}update(t){if(this.preInit)return!1;s.a.addLoader(e(".js-transfer-widget")),this.updateSelects(),clearTimeout(this.expires);let r=e("#sendAmount").val()+"";"0"!=r&&""!=r&&null!=r&&(r=this.getParsedNumber(r));let a=e("#receiveAmount").val()+"";"0"!=a&&""!=a&&null!=a&&(a=this.getParsedNumber(a));
12let o=parseFloat(r),c=parseFloat(a);"IN"==t&&(c=0),"OUT"==t&&(o=0);let u="";u="PH"==this.current.agent.receive.code&&"PHP"==this.current.currency.receive?"BDO":"UA"==this.current.agent.receive.code?"PRIVAT_MONEY":"EUR"==this.current.currency.send&&"EUR"==this.current.currency.receive&&-1!=e.inArray(this.current.agent.send.code,this.euCountryList)&&-1!=e.inArray(this.current.agent.receive.code,this.euCountryList)?"SEPA":"SWIFT";let l=this.current.agent.send;if(void 0===l.id)for(let e=0;e<this.agents.send.length;e++)if(l.code==this.agents.send[e].code){l=this.agents.send[e];break}const d={amountDirection:t,baseCurrency:l.id?l.currency:gotoAndPlay.transferData.defaults.sendAgent.currency,agentId:l.id?parseInt(l.id):gotoAndPlay.transferData.defaults.sendAgent.id,in:{type:"C"==this.transferDirection[n.From]?"CASH":"TRANSFER",currency:this.current.currency.send,country:l.code},out:{type:"C"==this.transferDirection[n.To]?"CASH":u,currency:this.current.currency.receive}};"IN"==t?d.in.amount=o:"OUT"==t&&(d.out.amount=c),"BDO"==u?(d.out.type="BDO","B"==this.transferDirection[n.To]?d.out.subType="CREDIT_TO_BDO_ACCOUNT":d.out.subType=e("#selectBdo").val()):"PRIVAT_MONEY"==u?(d.out.type="PRIVAT_MONEY","C"==this.transferDirection[n.To]?d.out.subType="WILL_CALL":(d.out.subType=e("#selectPrivat").val(),"SWIFT"===d.out.subType&&(d.out.subType=null,d.out.type="SWIFT",d.out.speed="REGULAR",d.out.feeParty="SHARED"))):"C"==this.transferDirection[n.To]?d.out.country=this.current.agent.receive.code:"B"==this.transferDirection[n.To]&&(d.out.speed="REGULAR",d.out.feeParty="SHARED"),this.expires=window.setTimeout(()=>{e(".js-expire-rates").trigger("click")},36e5),e(".js-submit-rates, .js-fix-rates").addClass("is-disabled").attr("disabled","disabled");const f=e("#fromCountry").find("option:selected").text(),h=e("#toCountry").find("option:selected").text();e(".js-transfer-from").html(f),e(".js-transfer-to").html(h),e.ajax({type:"POST",url:"/wp-json/tvx-api/v1/tavexwise/calculate",headers:{"X-WP-Nonce":gotoAndPlay.wpRestNonce},data:d,dataType:"json"}).then(t=>{if("SUCCESS"==t.calculatorStatus.type){e(".js-submit-rates, .js-fix-rates").removeClass("is-disabled").removeAttr("disabled"),(""==t.in.amount||t.in.amount<0)&&(t.in.amount=0);const r=t.in.amount;e("#sendAmount").val(r),(""==t.out.amount||t.out.amount<0)&&(t.out.amount=0);const n=t.out.amount;e("#receiveAmount").val(n);let a=t.fee.amount;""!=a&&null!=a||(a=0),e(".js-calc-fee").html(i.default.numberFormat(a)+" "+this.current.currency.send);let s=t.rate.amount;"EUR"!=d.baseCurrency&&"EUR"!=d.in.currency||"BDO"!=d.out.type||(s=t.rate.amountAppliedReverse),""!=s&&null!=s||(s=0),e(".js-calc-rate").html(s),this.calculationData={transfer_type:e('.js-send-type option[value="'+e("#sendAmount").val()+'"]').text(),send_amount:r,send_country:f,send_currency:this.current.currency.send,receive_amount:n,receive_country:h,receive_currency:this.current.currency.receive,fee:t.fee.amount,exchange_rate:t.rate.amount,delivery_time:this.times[""+e("#sendType").val()]},e(".js-transfer-table").find(".js-transfer-send").html(i.default.numberFormat(r)+" "+this.current.currency.send),e(".js-transfer-table").find(".js-transfer-receive").html(i.default.numberFormat(n)+" "+this.current.currency.receive),e(".js-transfer-table").find(".js-transfer-totalSend").html(i.default.numberFormat(r)+" "+this.current.currency.send),e(".js-transfer-table").find(".js-transfer-totalReceive").html(i.default.numberFormat(n)+" "+this.current.currency.receive),e(".js-transfer-table").find(".js-transfer-rate").html(s),e(".js-transfer-table").find(".js-transfer-fee").html(i.default.numberFormat(a)+" "+this.current.currency.send),e(".js-transfer-table").find(".js-transfer-form").removeClass("h-hidden"),e(".js-transfer-table").find(".js-transfer-success").addClass("h-hidden"),e(".js-input-amount input").not(".js-keep-focus").trigger("blur")}else"ERROR"==t.calculatorStatus.type&&(e(".js-submit-rates, .js-fix-rates").addClass("is-disabled").attr("disabled"),e("#receiveAmount").val(" - "),e(".js-calc-rate").html(" - "),e(".js-calc-fee").html(" - "));s.a.removeLoader(e(".js-transfer-widget"))}).fail(()=>{s.a.removeLoader(e(".js-transfer-widget"))})}formatValue(t){const r=e(t.target);if(r.is(":focus"))r.addClass("js-keep-focus");else{let e=2;const t=parseFloat(this.getParsedNumber(r.val()+""));t%1==0&&(e=0),r.val(a.formatNumber(t,e,gotoAndPlay.thousandSeparator,gotoAndPlay.decimalSeparator)),r.removeClass("js-keep-focus")}}typeChangeUpdate(t){const r=(e("#sendType").val()+"").split("");r[n.From]!=this.transferDirection[n.From]&&this.setCountries(r[n.From],"send"),r[n.To]!=this.transferDirection[n.To]&&this.setCountries(r[n.To],"receive"),this.transferDirection=r,this.setBdo(),this.setPrivat(),this.update("IN")}amountChangeUpdate(e){const t="send"==e.data.direction?"IN":"OUT";window.clearTimeout(this.inputDelay),this.inputDelay=window.setTimeout(()=>{this.update(t)},1e3)}countryChangeUpdate(t){const r=t.data.direction;let a={},i=e(t.target).val();if("agents"==this.current.active[r])for(let e=0;e<this.agents[r].length;e++)this.agents[r][e].code==i&&(a=this.agents[r][e]);else a=this.getCountryByCode(i);this.current.agent[r]=a;const s="send"==r?n.From:n.To;this.setCurrencies(a,this.transferDirection[s],r),this.setBdo(),this.setPrivat(),this.update("IN")}currencyChangeUpdate(t){const r=t.data.direction;let a=e(t.target).val();if(this.current.currency[r]!=a){const e="send"==r?"IN":"OUT",t="send"==r?n.From:n.To;if("C"==this.transferDirection[t])for(let t=0;t<this.currencies[e].cash[this.current.agent[r].code].length;t++)this.currencies[e].cash[this.current.agent[r].code][t]==a&&(this.current.currency[r]=this.currencies[e].cash[this.current.agent[r].code][t]);else if("B"==this.transferDirection[t])for(let t=0;t<this.currencies[e].bank.length;t++)this.currencies[e].bank[t]==a&&(this.current.currency[r]=this.currencies[e].bank[t]);this.update("IN")}}submitRateLock(t){t.preventDefault();const r=e(".js-modal-transfer"),n=e(".js-transfer-form");o.default.validate(n)&&!1===this.lockRateDisabled&&(this.lockRateDisabled=!0,i.default.validateReCaptcha("tvx_submit_calculator").then(t=>{const n={reCaptchaKey:t,email:e("#dealEmail").val(),phone:e("#dealPhone").val(),office:e("#dealOffice").val(),calculation:this.calculationData,amount_in_currency:e(".js-transfer-table").find(".js-transfer-send").text(),amount_out_currency:e(".js-transfer-table").find(".js-transfer-receive").text(),transfer_type:e("#sendType option:selected").text(),ex_rate:e(".js-transfer-table").find(".js-transfer-rate").text(),fee:e(".js-transfer-table").find(".js-transfer-fee").text(),total_sum:e(".js-transfer-table").find(".js-transfer-totalSend").text(),total_get:e(".js-transfer-table").find(".js-transfer-totalReceive").text()};s.a.post({action:"tvx-submit-calculator",data:n}).then(t=>{t.messages||(r.find(".js-transfer-form").addClass("h-hidden"),r.find(".js-transfer-success").removeClass("h-hidden"),t?(e(".js-price-locked-until").text(t.lockedUntil),t.officeLink&&(e(".js-transfer-success-btn").attr("href",t.officeLink),e(".js-transfer-success-btn").attr("target","_blank"))):e(".js-price-locked-until").hide()),this.lockRateDisabled=!1})}))}getCountryByCode(e){for(let t=0;t<this.countries.length;t++)if(this.countries[t].code==e)return this.countries[t];return{}}}e((function(){e(".js-transfer-widget").each((function(){new f(this)}));new d}))}.call(this,r(8))}},[[261,0,1]]]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.