Ubuntu

­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­ !function(a,b,c,d){a(b).on("click.imagify",".imagify-tab",function(b){var c,d=a(this);b.preventDefault(),d.hasClass("imagify-current")||(c=d.find("a").attr("href")||"#"+d.find("a").attr("aria-controls"),d.closest(".imagify-tabs").next(".imagify-tabs-contents").find(".imagify-tab-content").hide().attr("aria-hidden","true"),a(c).fadeIn(275).attr("aria-hidden","false"),d.closest(".imagify-tabs").find(".imagify-tab").removeClass("imagify-current").attr("aria-selected","false"),d.addClass("imagify-current").attr("aria-selected","true"))})}(jQuery,document,window),function(a,b,c,d){var e={};a("#imagify-pricing-modal").length&&(e={$modal:a("#imagify-pricing-modal"),$checkboxes:a(".imagify-offer-line .imagify-checkbox"),$radios:a(".imagify-payment-modal .imagify-radio-line input"),$preView:a("#imagify-pre-checkout-view"),$plansView:a("#imagify-plans-selection-view").hide(),$paymentView:a("#imagify-payment-process-view").hide(),$successView:a("#imagify-success-view").hide(),$anotherBtn:a(".imagify-choose-another-plan"),speedFadeIn:300,getHtmlPrice:function(a,b){var c,d,e,f,g;return b||(b=null),"object"!=typeof a?(a+="",a=a.split("."),a[1]=1===a[1].length?a[1]+"0":(""+a[1]).substring(0,2),g=''+a[0]+" ",g+='.'+a[1]+""):(c=a.monthly+"",d=a.yearly+"",e="0"===c?["0","00"]:c.split("."),f="0"===d?["0","00"]:d.split("."),g='',g+='',g+=''+e[0]+" ",g+='.'+(1===e[1].length?e[1]+"0":(""+e[1]).substring(0,2))+"",g+=" ",g+='',g+=''+f[0]+" ",g+='.'+(1===f[1].length?f[1]+"0":(""+f[1]).substring(0,2))+"",g+="",g+="")},getHtmlDiscountPrice:function(a,b){var c,d,e="";return b||(b=null),"object"==typeof a?(c=a.monthly+"",d=a.yearly+"",e+='',e+='$',e+='',e+='',e+=''+c+"",e+="",e+='',e+=''+d+"",e+="",e+="",e+=""):(a+="",e+='',e+='$',e+=''+a+"",e+=""),e},populateOffer:function(a,b,d,f){var g,h,i,j=c.imagify_discount_datas,k=b.additional_gb,l=b.annual_cost,m=b.id,n=b.label,o=b.monthly_cost,p=b.quota,q=b.cost,r=-1===p?"Unlimited":p>=1e3?p/1e3+" GB":p+" MB",s="monthly"===d?{monthly:o,yearly:Math.round(l/12*100)/100}:q,t=s,u=[];return u=e.getPromoAppliesTo(j),j.is_active&&"percentage"===j.coupon_type&&"monthly"===d&&0

'+imagifyPricingModal.labels.errorPriceAPI+"

"),e.$modal.find(".imagify-modal-loader").fadeOut(300),void e.$modal.removeClass("imagify-modal-loading");if(c.imagify_discount_datas=i,i.is_active){if(i.applies_to instanceof Array){u=[];for(var A=[],B=0;B2)return!0;b===l.mo.index&&(f=a(".imagify-pre-checkout-offers .imagify-offer-monthly"),l.mo.selected&&(g=" imagify-offer-selected",f.addClass("imagify-offer-selected").find(".imagify-checkbox").prop("checked",!0)),e.populateOffer(f,c,"monthly")),d=a(p).clone(),d=e.populateOffer(d,c,"monthly",g),z+=d[0].outerHTML}),0===j.ot.length?(a(".imagify-pre-checkout-offers .imagify-offer-onetime").remove(),a(".imagify-tabs").remove(),a(".imagify-pricing-tab-onetime").remove()):a.each(j.ot,function(b,c){var d,f,g="";b===l.ot.index&&(f=a(".imagify-pre-checkout-offers .imagify-offer-onetime"),l.ot.selected&&(g=" imagify-offer-selected",f.addClass("imagify-offer-selected").find(".imagify-checkbox").prop("checked",!0)),e.populateOffer(f,c,"onetime")),d=a(o).clone(),d=e.populateOffer(d,c,"onetime",g),y+=d[0].outerHTML}),i){var C=e.getPromoAppliesTo(i);(C.includes(l.mo.plan_label)||C.includes(l.ot.plan_label)||"all"===C[0])&&a("#imagify-coupon-code").val(i.label),i.is_active&&e.checkCoupon()}m.parent().find(".imagify-offer-line")&&m.parent().find(".imagify-offer-line").remove(),m.before(z),n.parent().find(".imagify-offer-line")&&n.parent().find(".imagify-offer-line").remove(),n.before(y),e.$modal.find(".imagify-modal-loader").fadeOut(300),e.$modal.removeClass("imagify-modal-loading")}})}),e.populatePayBtn()})},getSuggestedOffers:function(b,c,d){var e,f,g=c.total+c.month,h={quota:0},i={mo:!1,ot:!1};if(0>b.ot.length)var j=b.ot[b.ot.length-1].id,k=b.ot[b.ot.length-1].label;if(0>b.ot.length)var l=b.mo[b.mo.length-1].id,m=b.mo[b.mo.length-1].label;return a.each(b.mo,function(a,b){return 0>b.quota&&(f={index:a,selected:1,plan_id:b.id,plan_label:b.label}),b.quota>h.quota&&(h={index:a,selected:1,quota:b.quota,plan_id:b.id,plan_label:b.label}),0===b.monthly_cost&&0===b.annual_cost||(0>=b.quota&&c.month>b.quota||c.total>b.quota||(!(0<=b.quota&&c.monthb.quota)&&(e=b,i.mo={index:a,selected:d>c.month&&d>c.total?0:1,plan_id:b.id,plan_label:b.label}),!0)))}),!1===i.mo&&(i.mo=void 0!==f?f:h),g-=b.mo[i.mo.index].quota,0===b.ot.length?i:g<=0?(a.each(b.ot,function(a,b){return b.quota=3?c.closest(".imagify-coupon-input").addClass("imagify-canbe-validate"):c.closest(".imagify-coupon-input").removeClass("imagify-canbe-validate"))}),a("#imagify-coupon-validate").on("click.imagify",function(){e.checkCoupon(),a(this).closest(".imagify-canbe-validate").removeClass("imagify-canbe-validate")}),e.$anotherBtn.on("click.imagify",function(b){var c=a(this).data("imagify-choose"),d="imagify-pricing-tab-"+("plan"===c?"monthly":"onetime");b.preventDefault(),e.switchToView(e.$plansView,{tab:d})}),e.$modal.on("click.imagify",".imagify-payment-btn-select-plan",function(b){var d=a(this),f=d.closest(".imagify-offer-line"),g=d.data("offer"),h=d.attr("data-offer"),i="imagify-pricing-tab-monthly"!==d.closest(".imagify-tab-content").attr("id"),j=i?e.$preView.find(".imagify-offer-onetime"):e.$preView.find(".imagify-offer-monthly"),k=i?null:d.closest(".imagify-pricing-table").hasClass("imagify-month-selected")?"monthly":"yearly",l=i?e.getHtmlPrice(g[Object.keys(g)[0]].price):e.getHtmlPrice(g[Object.keys(g)[0]].prices,k),m=i?"":''+f.find(".imagify-price-by").text()+"",n=f.find(".imagify-price-discount").html(),o=f.find(".imagify-approx-nb").text(),p=f.find(".imagify-offer-size").text(),q=a("#imagify-coupon-code");if(b.preventDefault(),e.switchToView(e.$preView),j.find(".imagify-number-block").html(l+m),n?(j.find(".imagify-price-discount").length<=0&&j.find(".imagify-col-price").prepend(''),j.find(".imagify-price-discount").html(n),j.find(".imagify-price-discount").show()):j.find(".imagify-price-discount").hide(),j.find(".imagify-approx-nb").text(o),j.find(".imagify-offer-size").text(p),j.attr("data-offer",h),i||(j.find(".imagify-price-add-data").text(f.find(".imagify-price-add-data").text()),"monthly"===k?j.find("#imagify-subscription-monthly").trigger("click.imagify"):j.find("#imagify-subscription-yearly").trigger("click.imagify"),j.find(".imagify-inline-options").find("input:radio:checked").trigger("change.imagify")),q=a("#imagify-coupon-code"),q.val(""),c.imagify_discount_datas){var r=e.getPromoAppliesTo(c.imagify_discount_datas);(r.includes(g[Object.keys(g)[0]].label)||"all"===r[0])&&q.val(c.imagify_discount_datas.label)}e.checkCoupon(),e.populatePayBtn()}),a("#imagify-modal-checkout-btn").on("click.imagify",function(b){var c,d,f;b.preventDefault(),a(this).hasClass("imagify-button-disabled")||(c=a(".imagify-offer-monthly"),d=a(".imagify-offer-onetime"),f={},c.hasClass("imagify-offer-selected")&&(f.monthly=JSON.parse(c.attr("data-offer"))),d.hasClass("imagify-offer-selected")&&(f.onetime=JSON.parse(d.attr("data-offer"))),imagifyPricingModal.userDataCache&&a.post(ajaxurl,{action:imagifyPricingModal.userDataCache.deleteAction,_wpnonce:imagifyPricingModal.userDataCache.deleteNonce}),e.switchToView(e.$paymentView),f.period=e.getPeriod(),e.iframeSetSrc(f))}),a(".imagify-back-to-plans").on("click.imagify",function(b){var c=a(this),d=c.closest(".imagify-cart-item").hasClass("imagify-cart-item-onetime");b.preventDefault(),d?a(".imagify-offer-onetime").find(".imagify-choose-another-plan").trigger("click.imagify"):a(".imagify-offer-monthly").find(".imagify-choose-another-plan").trigger("click.imagify")}),c.addEventListener("message",e.checkPluginMessage,!0))}(jQuery,document,window);