geno/wp-content/plugins/mailpoet/assets/dist/js/vendor.js

1 line
4.8 KiB
JavaScript
Raw Normal View History

2024-02-01 17:24:18 +05:30
"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[736],{62685:function(e,r,n){var i=n(76721),a=n.n(i);a().registerHelper("concat",(function(){var e,r=arguments.length-1,n="";for(e=0;e<r;e+=1)n+=arguments[e];return n})),a().registerHelper("number_format",(function(e){return Number(e).toLocaleString()})),a().registerHelper("date_format",(function(e,r){var n;if(window.moment){if(void 0===e||Number.isNaN(e)||e<=0)return;return n=r.hash.format||"MMM Do, YYYY",/^\s*\d+\s*$/.test(e)?window.moment.unix(e).format(n):window.moment.utc(e).format(n)}return e})),a().registerHelper("cycle",(function(e,r){var n=e.split(" ");return n[r.data.index%(n.length+1)]})),a().registerHelper("ifCond",(function(e,r,n,i){switch(r){case"==":return e==n?i.fn(this):i.inverse(this);case"===":return e===n?i.fn(this):i.inverse(this);case"!=":return e!=n?i.fn(this):i.inverse(this);case"!==":return e!==n?i.fn(this):i.inverse(this);case"<":return e<n?i.fn(this):i.inverse(this);case"<=":return e<=n?i.fn(this):i.inverse(this);case">":return e>n?i.fn(this):i.inverse(this);case">=":return e>=n?i.fn(this):i.inverse(this);case"&&":return e&&n?i.fn(this):i.inverse(this);case"||":return e||n?i.fn(this):i.inverse(this);case"in":return-1!==n.indexOf(e)?i.fn(this):i.inverse(this);default:return i.inverse(this)}})),a().registerHelper("nl2br",(function(e){return e.gsub("\n","<br />")})),a().registerHelper("json_encode",(function(e){return JSON.stringify(e)})),a().registerHelper("json_decode",(function(e){return JSON.parse(e)})),a().registerHelper("url",(function(e){return window.location.protocol+"//"+window.location.host+window.location.pathname+e})),a().registerHelper("emailFromMailto",(function(e){var r=/^mailto:/i;return"string"==typeof e&&e.match(r)?e.replace(r,""):e})),a().registerHelper("lookup",(function(e,r){return e&&e[r]})),a().registerHelper("rsa_key",(function(e){var r;return void 0===e?"":((r=e.trim().split("\n")).shift(),r.pop(),r.join(""))})),a().registerHelper("trim",(function(e){return null==e?"":e.trim()})),a().registerHelper("ellipsis",(function(e,r,n){var i=n,a=e.replace(/(<([^>]+)>)/g,"");return void 0===i&&(i=""),a.length>r?a.substr(0,r-i.length)+i:a})),a().registerHelper("getNumber",(function(e){return parseInt(e,10)})),a().registerHelper("escapeURL",(function(e){if(!e)return"";try{const r=new URL(e);return"javascript:"===r.protocol||"vbscript:"===r.protocol||"data:"===r.protocol?"":r.href}catch(e){return""}})),a().registerHelper("fontWithFallback",(function(e){switch(e){case"Arial":return new(a().SafeString)("Arial, 'Helvetica Neue', Helvetica, sans-serif");case"Comic Sans MS":return new(a().SafeString)("'Comic Sans MS', 'Marker Felt-Thin', Arial, sans-serif");case"Courier New":return new(a().SafeString)("'Courier New', Courier, 'Lucida Sans Typewriter', 'Lucida Typewriter', monospace");case"Georgia":return new(a().SafeString)("Georgia, Times, 'Times New Roman', serif");case"Lucida":return new(a().SafeString)("'Lucida Sans Unicode', 'Lucida Grande', sans-serif");case"Tahoma":return new(a().SafeString)("Tahoma, Verdana, Segoe, sans-serif");case"Times New Roman":return new(a().SafeString)("'Times New Roman', Times, Baskerville, Georgia, serif");case"Trebuchet MS":return new(a().SafeString)("'Trebuchet MS', 'Lucida Grande', 'Lucida Sans Unicode', 'Lucida Sans', Tahoma, sans-serif");case"Verdana":return new(a().SafeString)("Verdana, Geneva, sans-serif");case"Arvo":return new(a().SafeString)("arvo, courier, georgia, serif");case"Lato":return new(a().SafeString)("lato, 'helvetica neue', helvetica, arial, sans-serif");case"Lora":return new(a().SafeString)("lora, georgia, 'times new roman', serif");case"Merriweather":return new(a().SafeString)("merriweather, georgia, 'times new roman', serif");case"Merriweather Sans":return new(a().SafeString)("'merriweather sans', 'helvetica neue', helvetica, arial, sans-serif");case"Noticia Text":return new(a().SafeString)("'noticia text', georgia, 'times new roman', serif");case"Open Sans":return new(a().SafeString)("'open sans', 'helvetica neue', helvetica, arial, sans-serif");case"Playfair Display":ret