%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /var/www/html/buggydubrovnik.com/wp-content/plugins/imagify/assets/js/
Upload File :
Create Path :
Current File : /var/www/html/buggydubrovnik.com/wp-content/plugins/imagify/assets/js/pricing-modal.min.js

!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='<span class="imagify-price-big">'+a[0]+"</span> ",g+='<span class="imagify-price-mini">.'+a[1]+"</span>"):(c=a.monthly+"",d=a.yearly+"",e="0"===c?["0","00"]:c.split("."),f="0"===d?["0","00"]:d.split("."),g='<span class="imagify-switch-my">',g+='<span aria-hidden="'+("monthly"===b?"false":"true")+'" class="imagify-monthly">',g+='<span class="imagify-price-big">'+e[0]+"</span> ",g+='<span class="imagify-price-mini">.'+(1===e[1].length?e[1]+"0":(""+e[1]).substring(0,2))+"</span>",g+="</span> ",g+='<span aria-hidden="'+("yearly"===b?"false":"true")+'" class="imagify-yearly">',g+='<span class="imagify-price-big">'+f[0]+"</span> ",g+='<span class="imagify-price-mini">.'+(1===f[1].length?f[1]+"0":(""+f[1]).substring(0,2))+"</span>",g+="</span>",g+="</span>")},getHtmlDiscountPrice:function(a,b){var c,d,e="";return b||(b=null),"object"==typeof a?(c=a.monthly+"",d=a.yearly+"",e+='<span class="imagify-price-discount">',e+='<span class="imagify-price-discount-dollar">$</span>',e+='<span class="imagify-switch-my">',e+='<span aria-hidden="'+("monthly"===b?"false":"true")+'" class="imagify-monthly">',e+='<span class="imagify-price-discount-number">'+c+"</span>",e+="</span>",e+='<span aria-hidden="'+("yearly"===b?"false":"true")+'" class="imagify-yearly">',e+='<span class="imagify-price-discount-number">'+d+"</span>",e+="</span>",e+="</span>",e+="</span>"):(a+="",e+='<span class="imagify-price-discount">',e+='<span class="imagify-price-discount-dollar">$</span>',e+='<span class="imagify-price-discount-number">'+a+"</span>",e+="</span>"),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<o&&(u.includes(n)||"all"===u[0])&&(g=(100-j.coupon_value)/100,s="monthly"===d?{monthly:o*g,yearly:Math.round(l*g/12*100)/100}:q*g),void 0!==f&&a.addClass("imagify-"+d+"-"+n+f),a.find(".imagify-offer-size").text(r),a.find(".imagify-number-block").html(e.getHtmlPrice(s,"monthly")),a.find(".imagify-price-block").prev(".imagify-price-discount").remove(),j.is_active&&"percentage"===j.coupon_type&&"monthly"===d&&0<o&&(u.includes(n)||"all"===u[0])&&a.find(".imagify-price-block").before(e.getHtmlDiscountPrice(t,"monthly")),a.find(".imagify-approx-nb").text(5*p),"monthly"===d&&a.find(".imagify-price-add-data").text("$"+k),h=a.find(".imagify-payment-btn-select-plan").length?a.find(".imagify-payment-btn-select-plan"):a,i="monthly"===d?'{"'+n+'":{"id":'+m+',"name":"'+r+'","label":"'+n+'","data":'+p+',"dataf":"'+r+'","imgs":'+5*p+',"prices":{"monthly":'+s.monthly+',"yearly":'+s.yearly+',"add":'+k+"}}}":'{"ot'+n+'":{"id":'+m+',"name":"'+r+'","label":"'+n+'","data":'+p+',"dataf":"'+r+'","imgs":'+5*p+',"price":'+s+"}}",h.attr("data-offer",i),a},populatePayBtn:function(){var b,c,d=a(".imagify-offer-monthly"),e=a(".imagify-offer-onetime"),f=0,g=0,h=0;d.length&&(b=JSON.parse(d.attr("data-offer")),d.hasClass("imagify-offer-selected")&&(g=a("#imagify-subscription-monthly").filter(":checked").length?b[Object.keys(b)[0]].prices.monthly:12*b[Object.keys(b)[0]].prices.yearly)),e.length&&(c=JSON.parse(e.attr("data-offer")),e.hasClass("imagify-offer-selected")&&(h=c[Object.keys(c)[0]].price)),f=parseFloat(h+g).toFixed(2),"0.00"===f||0===f?a("#imagify-modal-checkout-btn").prop("disabled",!0).addClass("imagify-button-disabled"):a("#imagify-modal-checkout-btn").prop("disabled",!1).removeClass("imagify-button-disabled")},checkCoupon:function(){var b,c,d,f,g=a("#imagify-coupon-code").val();if(b=a(".imagify-coupon-text"),c=b.find("label"),d=a(".imagify-coupon-section"),""===g)return d.removeClass("validated").removeClass("invalid"),void c.html(imagifyPricingModal.labels.defaultCouponLabel);f=a("#imagify-get-pricing-modal").data("nonce"),b.addClass("checking"),a.post(ajaxurl,{action:"imagify_check_coupon",coupon:g,imagifynonce:f},function(f){var h;if(b.removeClass("checking"),f.success)if(f.data.success){h="percentage"===f.data.coupon_type?f.data.value+"%":"$"+f.data.value;var i=a(".imagify-pre-checkout-view .imagify-pre-checkout-offers .imagify-offer-line"),j=JSON.parse(i.attr("data-offer")),k=e.getPromoAppliesTo(f.data);k.includes(j[Object.keys(j)[0]].label)||"all"===k[0]?(d.removeClass("invalid").addClass("validated"),c.html(imagifyPricingModal.labels.successCouponAPI),c.find(".imagify-coupon-offer").text(h),c.find(".imagify-coupon-word").text(g)):(d.removeClass("validated").addClass("invalid"),c.html(imagifyPricingModal.labels.errorCouponPlan),a("#imagify-coupon-code").val(""))}else d.removeClass("validated").addClass("invalid"),c.text(f.data.detail);else d.removeClass("validated").addClass("invalid"),c.text(imagifyPricingModal.labels.errorCouponAPI)})},getPricing:function(b){var d=b.data("nonce"),f={action:"imagify_get_prices",imagifynonce:d},g={action:"imagify_get_images_counts",imagifynonce:d},h={action:"imagify_get_discount",imagifynonce:d};e.$modal.find(".imagify-modal-loader").hide().show(),e.$modal.addClass("imagify-modal-loading"),a.post(ajaxurl,f,function(b){if(!b.success)return void e.populatePayBtn();a.post(ajaxurl,g,function(d){d.success&&a.post(ajaxurl,h,function(f){var g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x=25,y="",z="";if(f.success){if(g=d.data,h=b.data,i=f.data,j={mo:[],ot:[]},k={month:g.average_month_size.raw/Math.pow(1024,2),total:g.total_library_size.raw/Math.pow(1024,2)},m=a("#imagify-offer-monthly-template"),n=a("#imagify-offer-onetime-template"),o=n.html(),p=m.html(),q=a(".imagify-estimation-block"),a.each(h.monthlies,function(a,b){(void 0===b.active||void 0!==b.active&&!0===b.active)&&("free"===b.label&&(x=b.quota),j.mo.push(b))}),a.each(h.onetimes,function(a,b){(void 0===b.active||void 0!==b.active&&!0===b.active)&&j.ot.push(b)}),q.removeClass("imagify-analyzing"),q.find(".average-month-size").text(g.average_month_size.human),q.find(".total-library-size").text(g.total_library_size.human),k.total+k.month<x?a(".imagify-pre-checkout-offers .imagify-modal-title").addClass("imagify-enough-free"):a(".imagify-enough-free").removeClass("imagify-enough-free"),a(".imagify-offer-selected").removeClass("imagify-offer-selected").find(".imagify-checkbox").prop("checked",!1),null===j.mo||null===j.ot)return r=a(".imagify-pre-checkout-offers"),r.hide().attr("aria-hidden",!0),r.closest(".imagify-modal-views").find(".imagify-popin-message").remove(),r.after('<div class="imagify-popin-message imagify-error"><p>'+imagifyPricingModal.labels.errorPriceAPI+"</p></div>"),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;B<i.applies_to.length;B++)A.push(i.applies_to[B].plan_name);A.forEach(function(a){u.includes(a)||u.push(a)}),u=u.join(", ")}else u=i.applies_to;s=a(".imagify-modal-promotion"),t=i.date_end.split("T")[0],v=i.coupon_value,w="percentage"===i.coupon_type?v+"%":"$"+v,s.addClass("active").attr("aria-hidden","false"),s.find(".imagify-promotion-number").text(w),s.find(".imagify-promotion-plan-name").text(u),s.find(".imagify-promotion-date").text(t)}if(l=e.getSuggestedOffers(j,k,x),0===j.mo.length?(a(".imagify-pre-checkout-offers .imagify-offer-monthly").remove(),a(".imagify-tabs").remove(),a(".imagify-pricing-tab-monthly").remove()):a.each(j.mo,function(b,c){var d,f,g="";if(b-l.mo.index>2)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.month<b.quota&&c.total<b.quota)||((void 0===e||e.quota>b.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<c.total||(i.ot={index:a,selected:0,plan_id:b.id,plan_label:b.label},!1)}),!1===i.ot&&(i.ot={index:b.ot.length-1,selected:0,plan_id:j,plan_label:k}),i):(a.each(b.ot,function(a,b){return b.quota<g||(i.ot={index:a,selected:1,plan_id:b.id,plan_label:b.label},!1)}),!1!==i.ot?i:(i.ot={index:b.ot.length-1,selected:1,plan_id:j,plan_label:k},i.mo=!1,g=c.total+c.month-b.ot[i.ot.index].quota,a.each(b.mo,function(a,b){return b.quota<g||(i.mo={index:a,selected:1,plan_id:b.id,plan_label:b.label},!1)}),!1===i.mo&&(i.mo={index:b.mo.length-1,selected:1,plan_id:l,plan_label:m}),i))},checkCheckbox:function(b){b.each(function(){var b=a(this);b.is(":checked")?b.closest(".imagify-offer-line").addClass("imagify-offer-selected"):b.closest(".imagify-offer-line").removeClass("imagify-offer-selected")}),e.populatePayBtn()},checkRadio:function(b){return b.each(function(){var b,c,d=a(this);b=d.parent(".imagify-cart-list-switcher").length?d.closest(".imagify-cart"):d.parent(".imagify-small-options").length?d.parent(".imagify-small-options").next(".imagify-pricing-table"):d.closest(".imagify-offer-line"),c=b.find(".imagify-switch-my"),"yearly"===d.val()?(b.addClass("imagify-year-selected").removeClass("imagify-month-selected"),c.find(".imagify-monthly").attr("aria-hidden","true"),c.find(".imagify-yearly").attr("aria-hidden","false")):(b.addClass("imagify-month-selected").removeClass("imagify-year-selected"),c.find(".imagify-monthly").attr("aria-hidden","false"),c.find(".imagify-yearly").attr("aria-hidden","true"))}),e.populatePayBtn(),b},populateBtnPrice:setInterval(function(){e.populatePayBtn()},1e3),getPeriod:function(){return a(".imagify-offer-monthly").hasClass("imagify-month-selected")?"monthly":"yearly"},getApiKey:function(){return a("#imagify-payment-iframe").data("imagify-api")},switchToView:function(a,b){var c=a.attr("id"),d=e.$modal.children(".imagify-modal-content");a.siblings(".imagify-modal-views").hide().attr("aria-hidden","true"),b&&b.tab&&a.find('a[href="#'+b.tab+'"]').trigger("click.imagify"),"imagify-payment-process-view"===c?d.addClass("imagify-iframe-viewing"):d.removeClass("imagify-iframe-viewing"),"imagify-success-view"===c?(d.addClass("imagify-success-viewing"),e.$modal.attr("aria-labelledby","imagify-success-view")):(d.removeClass("imagify-success-viewing"),e.$modal.removeAttr("aria-labelledby")),a.fadeIn(e.speedFadeIn).attr("aria-hidden","false")},iframeSetSrc:function(b){var d,f,g,h,i,j,k,l=a("#imagify-payment-iframe"),m=l.attr("src"),n=l.data("src"),o=0,p=0;if("string"==typeof b&&""!==m)return k="monthly"===b?"yearly":"monthly",m=m.replace(k,b),void l.attr("src",m);if("object"==typeof b){if(b.monthly&&(o=b.monthly[Object.keys(b.monthly)[0]].id),b.onetime&&(p=b.onetime[Object.keys(b.onetime)[0]].id,p=p+""=="999"?b.onetime[Object.keys(b.onetime)[0]].data:p),!b.period)return void c.imagify.info("No period defined");e.getApiKey(),d=p,f="yearly"===b.period?o:0,g="monthly"===b.period?o:0,h=a("#imagify-coupon-code").val(),i=""===h?"none":h,parseFloat(a(".imagify-global-amount").text()).toFixed(2),n=n+d+"/"+g+"/"+f+"/"+i+"/",j=l.remove().attr("src",n),e.$paymentView.html(j)}},paymentClose:function(){a(".imagify-iframe-viewing .close-btn").trigger("click.imagify"),a(".imagify-iframe-viewing").removeClass("imagify-iframe-viewing")},paymentBack:function(){e.switchToView(e.$preView)},paymentSuccess:function(){e.switchToView(e.$successView)},checkPluginMessage:function(a){var b=a.origin||a.originalEvent.origin;if(imagifyPricingModal.imagify_app_domain===b)switch(a.data){case"cancel":e.paymentClose();break;case"back":e.paymentBack();break;case"success":e.paymentSuccess()}},getPromoAppliesTo:function(a){var b=[];if(a.applies_to instanceof Array){for(var c=[],d=0;d<a.applies_to.length;d++)c.push(a.applies_to[d].plan_name);c.forEach(function(a){b.includes(a)||b.push(a)})}else b=[a.applies_to];return b}},e.checkCheckbox(e.$checkboxes),e.checkRadio(e.$radios.filter(":checked")),e.checkCoupon(),e.$checkboxes.on("change.imagify",function(){e.checkCheckbox(a(this))}),e.$radios.on("change.imagify",function(){e.checkRadio(a(this))}),a("#imagify-get-pricing-modal").on("click.imagify-ajax",function(){e.getPricing(a(this))}),a(b).on("modalClosed.imagify",".imagify-payment-modal",function(){a("#imagify-coupon-code").val(""),a(this).find(".imagify-modal-content").removeClass("imagify-success-viewing imagify-iframe-viewing"),setTimeout(function(){a(".imagify-modal-views").hide(),a("#imagify-pre-checkout-view").show()},300),setTimeout(function(){a(".imagify-payment-modal").find(".imagify-modal-content").scrollTop(0)},400)}),a("#imagify-coupon-code").on("blur.imagify",function(){a(this).attr("readonly")||e.checkCoupon()}).on("keydown.imagify",function(b){var c=a(this);if(!c.attr("readonly"))return 13===b.keyCode||32===b.keyCode?(e.checkCoupon(),!1):void(c.val().length>=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?"":'<span class="imagify-price-by">'+f.find(".imagify-price-by").text()+"</span>",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('<span class="imagify-price-discount"></span>'),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);

Zerion Mini Shell 1.0