File Editor
Directories:
.. (Back)
admin
packages
Files:
addons-page.js
bootstrap-multiselect.js
bootstrap.min.js
form-templates.js
formidable.js
formidable.min.js
formidable_admin.js
formidable_admin_global.js
formidable_blocks.js
formidable_dashboard.js
formidable_overlay.js
formidable_styles.js
onboarding-wizard.js
plugin-search.js
popper.min.js
Create New File
Create
Edit File: form-templates.js
/*! For license information please see form-templates.js.LICENSE.txt */ !function(){var t={616:function(t){t.exports=function(t,e){var r,n,o=0;function a(){var a,i,c=r,l=arguments.length;t:for(;c;){if(c.args.length===arguments.length){for(i=0;i<l;i++)if(c.args[i]!==arguments[i]){c=c.next;continue t}return c!==r&&(c===n&&(n=c.prev),c.prev.next=c.next,c.next&&(c.next.prev=c.prev),c.next=r,c.prev=null,r.prev=c,r=c),c.val}c=c.next}for(a=new Array(l),i=0;i<l;i++)a[i]=arguments[i];return c={args:a,val:t.apply(null,a)},r?(r.prev=c,c.next=r):n=c,o===e.maxSize?(n=n.prev).next=null:o++,r=c,c.val}return e=e||{},a.clear=function(){r=null,n=null,o=0},a}},604:function(t,e,r){var n;!function(){"use strict";var o={not_string:/[^s]/,not_bool:/[^t]/,not_type:/[^T]/,not_primitive:/[^v]/,number:/[diefg]/,numeric_arg:/[bcdiefguxX]/,json:/[j]/,not_json:/[^j]/,text:/^[^\x25]+/,modulo:/^\x25{2}/,placeholder:/^\x25(?:([1-9]\d*)\$|\(([^)]+)\))?(\+)?(0|'[^$])?(-)?(\d+)?(?:\.(\d+))?([b-gijostTuvxX])/,key:/^([a-z_][a-z_\d]*)/i,key_access:/^\.([a-z_][a-z_\d]*)/i,index_access:/^\[(\d+)\]/,sign:/^[+-]/};function a(t){return function(t,e){var r,n,i,c,l,u,s,f,p,m=1,d=t.length,h="";for(n=0;n<d;n++)if("string"==typeof t[n])h+=t[n];else if("object"==typeof t[n]){if((c=t[n]).keys)for(r=e[m],i=0;i<c.keys.length;i++){if(null==r)throw new Error(a('[sprintf] Cannot access property "%s" of undefined value "%s"',c.keys[i],c.keys[i-1]));r=r[c.keys[i]]}else r=c.param_no?e[c.param_no]:e[m++];if(o.not_type.test(c.type)&&o.not_primitive.test(c.type)&&r instanceof Function&&(r=r()),o.numeric_arg.test(c.type)&&"number"!=typeof r&&isNaN(r))throw new TypeError(a("[sprintf] expecting number but found %T",r));switch(o.number.test(c.type)&&(f=r>=0),c.type){case"b":r=parseInt(r,10).toString(2);break;case"c":r=String.fromCharCode(parseInt(r,10));break;case"d":case"i":r=parseInt(r,10);break;case"j":r=JSON.stringify(r,null,c.width?parseInt(c.width):0);break;case"e":r=c.precision?parseFloat(r).toExponential(c.precision):parseFloat(r).toExponential();break;case"f":r=c.precision?parseFloat(r).toFixed(c.precision):parseFloat(r);break;case"g":r=c.precision?String(Number(r.toPrecision(c.precision))):parseFloat(r);break;case"o":r=(parseInt(r,10)>>>0).toString(8);break;case"s":r=String(r),r=c.precision?r.substring(0,c.precision):r;break;case"t":r=String(!!r),r=c.precision?r.substring(0,c.precision):r;break;case"T":r=Object.prototype.toString.call(r).slice(8,-1).toLowerCase(),r=c.precision?r.substring(0,c.precision):r;break;case"u":r=parseInt(r,10)>>>0;break;case"v":r=r.valueOf(),r=c.precision?r.substring(0,c.precision):r;break;case"x":r=(parseInt(r,10)>>>0).toString(16);break;case"X":r=(parseInt(r,10)>>>0).toString(16).toUpperCase()}o.json.test(c.type)?h+=r:(!o.number.test(c.type)||f&&!c.sign?p="":(p=f?"+":"-",r=r.toString().replace(o.sign,"")),u=c.pad_char?"0"===c.pad_char?"0":c.pad_char.charAt(1):" ",s=c.width-(p+r).length,l=c.width&&s>0?u.repeat(s):"",h+=c.align?p+r+l:"0"===u?p+l+r:l+p+r)}return h}(function(t){if(c[t])return c[t];for(var e,r=t,n=[],a=0;r;){if(null!==(e=o.text.exec(r)))n.push(e[0]);else if(null!==(e=o.modulo.exec(r)))n.push("%");else{if(null===(e=o.placeholder.exec(r)))throw new SyntaxError("[sprintf] unexpected placeholder");if(e[2]){a|=1;var i=[],l=e[2],u=[];if(null===(u=o.key.exec(l)))throw new SyntaxError("[sprintf] failed to parse named argument key");for(i.push(u[1]);""!==(l=l.substring(u[0].length));)if(null!==(u=o.key_access.exec(l)))i.push(u[1]);else{if(null===(u=o.index_access.exec(l)))throw new SyntaxError("[sprintf] failed to parse named argument key");i.push(u[1])}e[2]=i}else a|=2;if(3===a)throw new Error("[sprintf] mixing positional and named placeholders is not (yet) supported");n.push({placeholder:e[0],param_no:e[1],keys:e[2],sign:e[3],pad_char:e[4],align:e[5],width:e[6],precision:e[7],type:e[8]})}r=r.substring(e[0].length)}return c[t]=n}(t),arguments)}function i(t,e){return a.apply(null,[t].concat(e||[]))}var c=Object.create(null);e.sprintf=a,e.vsprintf=i,"undefined"!=typeof window&&(window.sprintf=a,window.vsprintf=i,void 0===(n=function(){return{sprintf:a,vsprintf:i}}.call(e,r,e,t))||(t.exports=n))}()}},e={};function r(n){var o=e[n];if(void 0!==o)return o.exports;var a=e[n]={exports:{}};return t[n](a,a.exports,r),a.exports}r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,{a:e}),e},r.d=function(t,e){for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},function(){"use strict";var t=window.frmGlobal,e=t.canAccessApplicationDashboard,n=t.applicationsUrl,o=window.frmFormTemplatesVars,a=o.FEATURED_TEMPLATES_KEYS,i=o.upgradeLink,c="frm-form-templates",l="available-templates",u="free-templates",s="favorites",f="custom",p="search",m="440px",d="550px",h="frm-page-skeleton",y="all-items";function v(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function g(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?v(Object(r),!0).forEach((function(e){b(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):v(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function b(t,e,r){return(e=function(t){var e=function(t){if("object"!=w(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=w(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==w(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function w(t){return w="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},w(t)}var x,E,S,_,T=r(616),L=r.n(T),k=r(604),O=r.n(k),j=L()(console.error);function I(t){return I="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},I(t)}function A(t){var e=function(t){if("object"!=I(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=I(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==I(e)?e:e+""}x={"(":9,"!":8,"*":7,"/":7,"%":7,"+":6,"-":6,"<":5,"<=":5,">":5,">=":5,"==":4,"!=":4,"&&":3,"||":2,"?":1,"?:":1},E=["(","?"],S={")":["("],":":["?","?:"]},_=/<=|>=|==|!=|&&|\|\||\?:|\(|!|\*|\/|%|\+|-|<|>|\?|\)|:/;var C={"!":function(t){return!t},"*":function(t,e){return t*e},"/":function(t,e){return t/e},"%":function(t,e){return t%e},"+":function(t,e){return t+e},"-":function(t,e){return t-e},"<":function(t,e){return t<e},"<=":function(t,e){return t<=e},">":function(t,e){return t>e},">=":function(t,e){return t>=e},"==":function(t,e){return t===e},"!=":function(t,e){return t!==e},"&&":function(t,e){return t&&e},"||":function(t,e){return t||e},"?:":function(t,e,r){if(t)throw e;return r}};var P={contextDelimiter:"",onMissingKey:null};function F(t,e){var r;for(r in this.data=t,this.pluralForms={},this.options={},P)this.options[r]=void 0!==e&&r in e?e[r]:P[r]}function B(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function N(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?B(Object(r),!0).forEach((function(e){var n,o,a;n=t,o=e,a=r[e],(o=A(o))in n?Object.defineProperty(n,o,{value:a,enumerable:!0,configurable:!0,writable:!0}):n[o]=a})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):B(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}F.prototype.getPluralForm=function(t,e){var r,n,o,a,i=this.pluralForms[t];return i||("function"!=typeof(o=(r=this.data[t][""])["Plural-Forms"]||r["plural-forms"]||r.plural_forms)&&(n=function(t){var e,r,n;for(e=t.split(";"),r=0;r<e.length;r++)if(0===(n=e[r].trim()).indexOf("plural="))return n.substr(7)}(r["Plural-Forms"]||r["plural-forms"]||r.plural_forms),a=function(t){var e=function(t){for(var e,r,n,o,a=[],i=[];e=t.match(_);){for(r=e[0],(n=t.substr(0,e.index).trim())&&a.push(n);o=i.pop();){if(S[r]){if(S[r][0]===o){r=S[r][1]||r;break}}else if(E.indexOf(o)>=0||x[o]<x[r]){i.push(o);break}a.push(o)}S[r]||i.push(r),t=t.substr(e.index+r.length)}return(t=t.trim())&&a.push(t),a.concat(i.reverse())}(t);return function(t){return function(t,e){var r,n,o,a,i,c,l=[];for(r=0;r<t.length;r++){if(i=t[r],a=C[i]){for(n=a.length,o=Array(n);n--;)o[n]=l.pop();try{c=a.apply(null,o)}catch(t){return t}}else c=e.hasOwnProperty(i)?e[i]:+i;l.push(c)}return l[0]}(e,t)}}(n),o=function(t){return+a({n:t})}),i=this.pluralForms[t]=o),i(e)},F.prototype.dcnpgettext=function(t,e,r,n,o){var a,i,c;return a=void 0===o?0:this.getPluralForm(t,o),i=r,e&&(i=e+this.options.contextDelimiter+r),(c=this.data[t][i])&&c[a]?c[a]:(this.options.onMissingKey&&this.options.onMissingKey(r,t),0===a?r:n)};var D={"":{plural_forms:function(t){return 1===t?0:1}}},M=/^i18n\.(n?gettext|has_translation)(_|$)/,q=function(t){return"string"!=typeof t||""===t?(console.error("The namespace must be a non-empty string."),!1):!!/^[a-zA-Z][a-zA-Z0-9_.\-\/]*$/.test(t)||(console.error("The namespace can only contain numbers, letters, dashes, periods, underscores and slashes."),!1)},G=function(t){return"string"!=typeof t||""===t?(console.error("The hook name must be a non-empty string."),!1):/^__/.test(t)?(console.error("The hook name cannot begin with `__`."),!1):!!/^[a-zA-Z][a-zA-Z0-9_.-]*$/.test(t)||(console.error("The hook name can only contain numbers, letters, dashes, periods and underscores."),!1)},R=function(t,e){return function(r,n,o){var a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:10,i=t[e];if(G(r)&&q(n))if("function"==typeof o)if("number"==typeof a){var c={callback:o,priority:a,namespace:n};if(i[r]){var l,u=i[r].handlers;for(l=u.length;l>0&&!(a>=u[l-1].priority);l--);l===u.length?u[l]=c:u.splice(l,0,c),i.__current.forEach((function(t){t.name===r&&t.currentIndex>=l&&t.currentIndex++}))}else i[r]={handlers:[c],runs:0};"hookAdded"!==r&&t.doAction("hookAdded",r,n,o,a)}else console.error("If specified, the hook priority must be a number.");else console.error("The hook callback must be a function.")}},z=function(t,e){var r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return function(n,o){var a=t[e];if(G(n)&&(r||q(o))){if(!a[n])return 0;var i=0;if(r)i=a[n].handlers.length,a[n]={runs:a[n].runs,handlers:[]};else for(var c=a[n].handlers,l=function(t){c[t].namespace===o&&(c.splice(t,1),i++,a.__current.forEach((function(e){e.name===n&&e.currentIndex>=t&&e.currentIndex--})))},u=c.length-1;u>=0;u--)l(u);return"hookRemoved"!==n&&t.doAction("hookRemoved",n,o),i}}},Y=function(t,e){return function(r,n){var o=t[e];return void 0!==n?r in o&&o[r].handlers.some((function(t){return t.namespace===n})):r in o}},H=function(t,e){var r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return function(n){var o=t[e];o[n]||(o[n]={handlers:[],runs:0}),o[n].runs++;for(var a=o[n].handlers,i=arguments.length,c=new Array(i>1?i-1:0),l=1;l<i;l++)c[l-1]=arguments[l];if(!a||!a.length)return r?c[0]:void 0;var u={name:n,currentIndex:0};for(o.__current.push(u);u.currentIndex<a.length;){var s=a[u.currentIndex].callback.apply(null,c);r&&(c[0]=s),u.currentIndex++}return o.__current.pop(),r?c[0]:void 0}},$=function(t,e){return function(){var r,n,o=t[e];return null!==(r=null===(n=o.__current[o.__current.length-1])||void 0===n?void 0:n.name)&&void 0!==r?r:null}},U=function(t,e){return function(r){var n=t[e];return void 0===r?void 0!==n.__current[0]:!!n.__current[0]&&r===n.__current[0].name}},Z=function(t,e){return function(r){var n=t[e];if(G(r))return n[r]&&n[r].runs?n[r].runs:0}},K=function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.actions=Object.create(null),this.actions.__current=[],this.filters=Object.create(null),this.filters.__current=[],this.addAction=R(this,"actions"),this.addFilter=R(this,"filters"),this.removeAction=z(this,"actions"),this.removeFilter=z(this,"filters"),this.hasAction=Y(this,"actions"),this.hasFilter=Y(this,"filters"),this.removeAllActions=z(this,"actions",!0),this.removeAllFilters=z(this,"filters",!0),this.doAction=H(this,"actions"),this.applyFilters=H(this,"filters",!0),this.currentAction=$(this,"actions"),this.currentFilter=$(this,"filters"),this.doingAction=U(this,"actions"),this.doingFilter=U(this,"filters"),this.didAction=Z(this,"actions"),this.didFilter=Z(this,"filters")},V=new K,J=(V.addAction,V.addFilter,V.removeAction,V.removeFilter,V.hasAction,V.hasFilter,V.removeAllActions,V.removeAllFilters,V.doAction,V.applyFilters,V.currentAction,V.currentFilter,V.doingAction,V.doingFilter,V.didAction,V.didFilter,V.actions,V.filters,function(t,e,r){var n=new F({}),o=new Set,a=function(){o.forEach((function(t){return t()}))},i=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"default";n.data[e]=N(N(N({},D),n.data[e]),t),n.data[e][""]=N(N({},D[""]),n.data[e][""])},c=function(t,e){i(t,e),a()},l=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"default",e=arguments.length>1?arguments[1]:void 0,r=arguments.length>2?arguments[2]:void 0,o=arguments.length>3?arguments[3]:void 0,a=arguments.length>4?arguments[4]:void 0;return n.data[t]||i(void 0,t),n.dcnpgettext(t,e,r,o,a)},u=function(){return arguments.length>0&&void 0!==arguments[0]?arguments[0]:"default"},s=function(t,e,n){var o=l(n,e,t);return r?(o=r.applyFilters("i18n.gettext_with_context",o,t,e,n),r.applyFilters("i18n.gettext_with_context_"+u(n),o,t,e,n)):o};if(r){var f=function(t){M.test(t)&&a()};r.addAction("hookAdded","core/i18n",f),r.addAction("hookRemoved","core/i18n",f)}return{getLocaleData:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"default";return n.data[t]},setLocaleData:c,resetLocaleData:function(t,e){n.data={},n.pluralForms={},c(t,e)},subscribe:function(t){return o.add(t),function(){return o.delete(t)}},__:function(t,e){var n=l(e,void 0,t);return r?(n=r.applyFilters("i18n.gettext",n,t,e),r.applyFilters("i18n.gettext_"+u(e),n,t,e)):n},_x:s,_n:function(t,e,n,o){var a=l(o,void 0,t,e,n);return r?(a=r.applyFilters("i18n.ngettext",a,t,e,n,o),r.applyFilters("i18n.ngettext_"+u(o),a,t,e,n,o)):a},_nx:function(t,e,n,o,a){var i=l(a,o,t,e,n);return r?(i=r.applyFilters("i18n.ngettext_with_context",i,t,e,n,o,a),r.applyFilters("i18n.ngettext_with_context_"+u(a),i,t,e,n,o,a)):i},isRTL:function(){return"rtl"===s("ltr","text direction")},hasTranslation:function(t,e,o){var a,i,c=e?e+""+t:t,l=!(null===(a=n.data)||void 0===a||null===(i=a[null!=o?o:"default"])||void 0===i||!i[c]);return r&&(l=r.applyFilters("i18n.has_translation",l,t,e,o),l=r.applyFilters("i18n.has_translation_"+u(o),l,t,e,o)),l}}}(0,0,V)),X=(J.getLocaleData.bind(J),J.setLocaleData.bind(J),J.resetLocaleData.bind(J),J.subscribe.bind(J),J.__.bind(J)),W=(J._x.bind(J),J._n.bind(J),J._nx.bind(J),J.isRTL.bind(J),J.hasTranslation.bind(J),window.frmGlobal),Q=W.url,tt=W.nonce,et="frm_hidden",rt="frm-hide-js",nt="frm-current",ot=window.frmDom,at=ot.tag,it=ot.div,ct=ot.a,lt=ot.img;function ut(t){return ut="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ut(t)}function st(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function ft(t,e,r){return(e=function(t){var e=function(t){if("object"!=ut(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=ut(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==ut(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var pt,mt=document.getElementById("post-body-content"),dt=document.getElementById("".concat(h,"-sidebar")),ht=((pt=ct({className:"button button-primary frm-button-primary"})).setAttribute("role","button"),it({id:"".concat(h,"-empty-state"),className:"frm-flex-col frm-flex-center frm-gap-md ".concat(et),children:[lt({src:"".concat(Q,"/images/page-skeleton/empty-state.svg"),alt:X("Empty State","formidable")}),it({className:"frmcenter",children:[at("h2",{className:"".concat(h,"-title frm-mb-0")}),at("p",{className:"".concat(h,"-text frm-mb-0")})]}),pt]}));null==mt||mt.appendChild(ht);var yt=function(){var t=document.querySelector("#".concat(h,"-empty-state"));return{emptyState:t,emptyStateTitle:null==t?void 0:t.querySelector(".".concat(h,"-title")),emptyStateText:null==t?void 0:t.querySelector(".".concat(h,"-text")),emptyStateButton:null==t?void 0:t.querySelector(".button")}}(),vt=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if("object"!==w(t)||null===t)throw new Error("createPageElements: initialElements must be a non-null object");var e=t;return{getElements:function(){return e},addElements:function(t){if("object"!==w(t)||null===t)throw new Error("addElements: newElements must be a non-null object");e=g(g({},e),t)}}}(function(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?st(Object(r),!0).forEach((function(e){ft(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):st(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}({bodyContent:mt,sidebar:dt,searchInput:dt.querySelector(".frm-search-input"),categoryItems:dt.querySelectorAll(".".concat(h,"-cat")),allItemsCategory:dt.querySelector(".".concat(h,'-cat[data-category="').concat(y,'"]'))},yt)),gt=vt.getElements,bt=vt.addElements;function wt(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function xt(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?wt(Object(r),!0).forEach((function(e){Et(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):wt(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function Et(t,e,r){return(e=function(t){var e=function(t){if("object"!=St(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=St(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==St(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function St(t){return St="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},St(t)}var _t=gt().allItemsCategory,Tt=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if("object"!==St(t)||null===t)throw new Error("createPageState: initialState must be a non-null object");var e=t;return{getState:function(){return e},getSingleState:function(t){var r=Reflect.get(e,t);return void 0===r?null:r},setState:function(t){if("object"!==St(t)||null===t)throw new Error("setState: newState must be a non-null object");e=xt(xt({},e),t)},setSingleState:function(t,r){Reflect.has(e,t)&&Reflect.set(e,t,r)}}}({notEmptySearchText:!1,selectedCategory:y,selectedCategoryEl:_t}),Lt=Tt.getState,kt=Tt.getSingleState,Ot=Tt.setState,jt=Tt.setSingleState;function It(t){return It="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},It(t)}function At(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,Ct(n.key),n)}}function Ct(t){var e=function(t){if("object"!=It(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=It(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==It(e)?e:e+""}var Pt,Ft=function(){return t=function t(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"default";!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.elements=e,this.type=r,this.prepareElements()},e=[{key:"fadeIn",value:function(){var t=this;this.applyStyleToElements((function(e){e.classList.add("frm-fadein-up"),e.addEventListener("animationend",(function(){t.resetOpacity(),e.classList.remove("frm-fadein-up")}),{once:!0})}))}},{key:"cascadeFadeIn",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:.03;setTimeout((function(){t.applyStyleToElements((function(t,r){t.classList.remove("frm-animate"),t.style.transitionDelay=(r+1)*e+"s"}))}),200)}},{key:"prepareElements",value:function(){var t=this;this.applyStyleToElements((function(e){"default"===t.type&&(e.style.opacity="0.0"),"cascade"===t.type&&e.classList.add("frm-init-cascade-animation"),"cascade-3d"===t.type&&e.classList.add("frm-init-fadein-3d"),e.classList.add("frm-animate")}))}},{key:"resetOpacity",value:function(){this.applyStyleToElements((function(t){return t.style.opacity="1.0"}))}},{key:"applyStyleToElements",value:function(t){this.elements instanceof Element?t(this.elements,0):0<this.elements.length&&this.elements.forEach((function(e,r){return t(e,r)}))}}],e&&At(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e}(),Bt=Promise.resolve(),Nt=function(t,e,r,n){var o=document.querySelector(t),a=document.querySelector(e);if(o&&a){if(n){var i=a.querySelector('span[frm-error="'.concat(r,'"]'));i&&(i.textContent=n)}a.setAttribute("frm-error",r),$t(a),o.addEventListener("keyup",(function(){Ut(a)}),{once:!0})}else console.warn("showFormError: Unable to find input or error element.")},Dt=window.frmDom.util.onClickPreventDefault,Mt=new URL(window.location.href),qt=Mt.searchParams,Gt=function(t){return qt.has(t)},Rt=function(t){return"string"==typeof t&&/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/i.test(t)},zt=function(t){return t instanceof HTMLElement||console.warn("Invalid argument: Element must be an instance of HTMLElement")||!1},Yt=function(t){var e;return null===(e=Array.from(t))||void 0===e?void 0:e.forEach((function(t){return $t(t)}))},Ht=function(t){var e;return null===(e=Array.from(t))||void 0===e?void 0:e.forEach((function(t){return Ut(t)}))},$t=function(t){return null==t?void 0:t.classList.remove(et)},Ut=function(t){return null==t?void 0:t.classList.add(et)},Zt=function(t){var e=t.currentTarget,r=e.getAttribute("data-category"),n=Lt(),o=n.selectedCategory,a=n.selectedCategoryEl,i=n.notEmptySearchText;if(o!==r){o=wp.hooks.applyFilters("frmPage.selectedCategory",r),a.classList.remove(nt),(a=e).classList.add(nt),Ot({selectedCategory:o,selectedCategoryEl:a}),i&&Vt(),wp.hooks.doAction("frmPage.onCategoryClick",o);var c=gt().bodyContent;new Ft(c).fadeIn()}};function Kt(t){"Enter"!==t.key&&" "!==t.key||(t.preventDefault(),Zt(t))}function Vt(){var t=gt().searchInput;t.value="",t.dispatchEvent(new Event("input",{bubbles:!0}))}var Jt=gt().bodyContent,Xt=document.getElementById("".concat(c,"-list")),Wt=document.getElementById("".concat(c,"-custom-list-section")),Qt=document.querySelector(".".concat(h,'-cat[data-category="').concat(s,'"]')),te=document.getElementById("".concat(c,"-modal"));bt({headerCancelButton:null===(Pt=document.getElementById("frm-publishing"))||void 0===Pt?void 0:Pt.querySelector("a"),createFormButton:document.getElementById("".concat(c,"-create-form")),pageTitle:document.getElementById("".concat(c,"-page-title")),pageTitleText:document.getElementById("".concat(c,"-page-title-text")),pageTitleDivider:document.getElementById("".concat(c,"-page-title-divider")),upsellBanner:document.getElementById("".concat(c,"-upsell-banner")),extraTemplateCountElements:document.querySelectorAll(".".concat(c,"-extra-templates-count")),templatesList:Xt,templateItems:Xt.querySelectorAll(".frm-card-item"),availableTemplateItems:Xt.querySelectorAll(".frm-card-item:not(.".concat(c,"-locked-item)")),freeTemplateItems:Xt.querySelectorAll(".frm-card-item.frm-free-template"),twinFeaturedTemplateItems:Xt.querySelectorAll(".".concat(c,"-featured-item")),firstLockedFreeTemplate:Xt.querySelector(".frm-free-template"),featuredTemplatesList:document.getElementById("".concat(c,"-featured-list")),customTemplatesSection:Wt,customTemplateItems:Wt.querySelectorAll(".frm-card-item"),customTemplatesTitle:document.getElementById("".concat(c,"-custom-list-title")),customTemplatesList:document.getElementById("".concat(c,"-custom-list")),favoritesCategory:Qt,favoritesCategoryCountEl:null==Qt?void 0:Qt.querySelector(".".concat(h,"-cat-count")),availableTemplatesCategory:document.querySelector(".".concat(h,'-cat[data-category="').concat(l,'"]')),freeTemplatesCategory:document.querySelector(".".concat(h,'-cat[data-category="').concat(u,'"]')),modal:te,modalItems:null==te?void 0:te.querySelectorAll(".".concat(c,"-modal-item")),showCreateTemplateModalButton:document.getElementById("frm-show-create-template-modal"),createTemplateModal:document.getElementById("frm-create-template-modal"),createTemplateFormsDropdown:document.getElementById("frm-create-template-modal-forms-select"),createTemplateName:document.getElementById("frm_create_template_name"),createTemplateDescription:document.getElementById("frm_create_template_description"),createTemplateButton:document.getElementById("frm-create-template-button"),renewAccountModal:document.getElementById("frm-renew-modal"),leaveEmailModal:document.getElementById("frm-leave-email-modal"),leaveEmailModalInput:document.getElementById("frm_leave_email"),leaveEmailModalApiEmailForm:document.getElementById("frmapi-email-form"),leaveEmailModalGetCodeButton:document.getElementById("frm-get-code-button"),codeFromEmailModal:document.getElementById("frm-code-from-email-modal"),codeFromEmailModalInput:document.getElementById("frm_code_from_email"),upgradeModal:document.getElementById("frm-form-upgrade-modal"),upgradeModalTemplateNames:null==te?void 0:te.querySelectorAll(".frm-upgrade-modal-template-name"),upgradeModalPlansIcons:null==te?void 0:te.querySelectorAll(".frm-upgrade-modal-plan-icon"),upgradeModalLink:document.getElementById("frm-upgrade-modal-link"),newTemplateForm:document.getElementById("frm-new-template"),newTemplateNameInput:document.getElementById("frm_template_name"),newTemplateDescriptionInput:document.getElementById("frm_template_desc"),newTemplateLinkInput:document.getElementById("frm_link"),newTemplateActionInput:document.getElementById("frm_action_type"),bodyContentChildren:null==Jt?void 0:Jt.children});var ee,re=window.frmDom,ne=re.tag,oe=re.div,ae=re.span,ie=re.a,ce=re.img,le="".concat(Q,"/images/applications/thumbnails");var ue=window.frmFormTemplatesVars,se=ue.templatesCount,fe=ue.favoritesCount,pe=ue.customCount,me=gt(),de=me.availableTemplateItems,he=me.freeTemplateItems,ye=me.firstLockedFreeTemplate,ve=de.length;Ot({availableTemplatesCount:ve,customCount:Number(pe),extraTemplatesCount:se-ve,favoritesCount:fe,freeTemplatesCount:he.length,selectedTemplate:ye});function ge(t){return ge="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ge(t)}function be(){be=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(t,e,r){t[e]=r.value},a="function"==typeof Symbol?Symbol:{},i=a.iterator||"@@iterator",c=a.asyncIterator||"@@asyncIterator",l=a.toStringTag||"@@toStringTag";function u(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{u({},"")}catch(t){u=function(t,e,r){return t[e]=r}}function s(t,e,r,n){var a=e&&e.prototype instanceof v?e:v,i=Object.create(a.prototype),c=new I(n||[]);return o(i,"_invoke",{value:L(t,r,c)}),i}function f(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=s;var p="suspendedStart",m="suspendedYield",d="executing",h="completed",y={};function v(){}function g(){}function b(){}var w={};u(w,i,(function(){return this}));var x=Object.getPrototypeOf,E=x&&x(x(A([])));E&&E!==r&&n.call(E,i)&&(w=E);var S=b.prototype=v.prototype=Object.create(w);function _(t){["next","throw","return"].forEach((function(e){u(t,e,(function(t){return this._invoke(e,t)}))}))}function T(t,e){function r(o,a,i,c){var l=f(t[o],t,a);if("throw"!==l.type){var u=l.arg,s=u.value;return s&&"object"==ge(s)&&n.call(s,"__await")?e.resolve(s.__await).then((function(t){r("next",t,i,c)}),(function(t){r("throw",t,i,c)})):e.resolve(s).then((function(t){u.value=t,i(u)}),(function(t){return r("throw",t,i,c)}))}c(l.arg)}var a;o(this,"_invoke",{value:function(t,n){function o(){return new e((function(e,o){r(t,n,e,o)}))}return a=a?a.then(o,o):o()}})}function L(e,r,n){var o=p;return function(a,i){if(o===d)throw Error("Generator is already running");if(o===h){if("throw"===a)throw i;return{value:t,done:!0}}for(n.method=a,n.arg=i;;){var c=n.delegate;if(c){var l=k(c,n);if(l){if(l===y)continue;return l}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===p)throw o=h,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=d;var u=f(e,r,n);if("normal"===u.type){if(o=n.done?h:m,u.arg===y)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(o=h,n.method="throw",n.arg=u.arg)}}}function k(e,r){var n=r.method,o=e.iterator[n];if(o===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,k(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),y;var a=f(o,e.iterator,r.arg);if("throw"===a.type)return r.method="throw",r.arg=a.arg,r.delegate=null,y;var i=a.arg;return i?i.done?(r[e.resultName]=i.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,y):i:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,y)}function O(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function j(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function I(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(O,this),this.reset(!0)}function A(e){if(e||""===e){var r=e[i];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,a=function r(){for(;++o<e.length;)if(n.call(e,o))return r.value=e[o],r.done=!1,r;return r.value=t,r.done=!0,r};return a.next=a}}throw new TypeError(ge(e)+" is not iterable")}return g.prototype=b,o(S,"constructor",{value:b,configurable:!0}),o(b,"constructor",{value:g,configurable:!0}),g.displayName=u(b,l,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===g||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,b):(t.__proto__=b,u(t,l,"GeneratorFunction")),t.prototype=Object.create(S),t},e.awrap=function(t){return{__await:t}},_(T.prototype),u(T.prototype,c,(function(){return this})),e.AsyncIterator=T,e.async=function(t,r,n,o,a){void 0===a&&(a=Promise);var i=new T(s(t,r,n,o),a);return e.isGeneratorFunction(r)?i:i.next().then((function(t){return t.done?t.value:i.next()}))},_(S),u(S,l,"Generator"),u(S,i,(function(){return this})),u(S,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},e.values=A,I.prototype={constructor:I,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(j),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function o(n,o){return c.type="throw",c.arg=e,r.next=n,o&&(r.method="next",r.arg=t),!!o}for(var a=this.tryEntries.length-1;a>=0;--a){var i=this.tryEntries[a],c=i.completion;if("root"===i.tryLoc)return o("end");if(i.tryLoc<=this.prev){var l=n.call(i,"catchLoc"),u=n.call(i,"finallyLoc");if(l&&u){if(this.prev<i.catchLoc)return o(i.catchLoc,!0);if(this.prev<i.finallyLoc)return o(i.finallyLoc)}else if(l){if(this.prev<i.catchLoc)return o(i.catchLoc,!0)}else{if(!u)throw Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return o(i.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var a=o;break}}a&&("break"===t||"continue"===t)&&a.tryLoc<=e&&e<=a.finallyLoc&&(a=null);var i=a?a.completion:{};return i.type=t,i.arg=e,a?(this.method="next",this.next=a.finallyLoc,y):this.complete(i)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),y},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),j(r),y}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;j(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:A(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),y}},e}function we(t,e,r,n,o,a,i){try{var c=t[a](i),l=c.value}catch(t){return void r(t)}c.done?e(l):Promise.resolve(l).then(n,o)}function xe(t){return function(){var e=this,r=arguments;return new Promise((function(n,o){var a=t.apply(e,r);function i(t){we(a,n,o,i,c,"next",t)}function c(t){we(a,n,o,i,c,"throw",t)}i(void 0)}))}}var Ee=null;function Se(){return(Se=xe(be().mark((function t(){var e,r,n;return be().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:e=window.frmAdminBuild,r=e.initModal,n=e.offsetModalY,(Ee=r("#frm-form-templates-modal",m))&&n(Ee,"103px"),Gt("free-templates")&&(gt().leaveEmailModal&&yr()),Te(),wp.hooks.addAction("frmAdmin.beforeOpenConfirmModal","frmFormTemplates",(function(t){var e=t.$info;e.dialog("option","width",d),n(e,"103px")}));case 6:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function _e(){return Ee}function Te(){return Le.apply(this,arguments)}function Le(){return Le=xe(be().mark((function t(){var e,r,n,o,a,i,c,l,u;return be().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e=gt(),r=e.leaveEmailModalApiEmailForm){t.next=3;break}return t.abrupt("return");case 3:return n=r.getAttribute("data-url"),t.prev=4,t.next=7,fetch(n);case 7:return a=t.sent,t.next=10,a.json();case 10:o=t.sent,t.next=17;break;case 13:return t.prev=13,t.t0=t.catch(4),console.error("An error occurred:",t.t0),t.abrupt("return");case 17:if(o.renderedHtml){t.next=20;break}return console.warn("renderedHtml is not available."),t.abrupt("return");case 20:i=o.renderedHtml,c=/<link\b[^>]*(formidableforms.css|action=frmpro_css)[^>]*>/gi,i=i.replace(c,""),r.innerHTML=i,l=r.querySelector("form"),u=l.querySelector('[type="email"]:not(.frm_verify)'),bt({leaveEmailModalHiddenForm:l,leaveEmailModalHiddenInput:u});case 27:case"end":return t.stop()}}),t,null,[[4,13]])}))),Le.apply(this,arguments)}function ke(t){var e=gt().pageTitleText,r=t||kt("selectedCategoryEl").querySelector(".".concat(h,"-cat-text")).textContent;e.textContent=r}var Oe=function(t){return!!zt(t)&&t.classList.contains("".concat(c,"-favorite-item"))},je=function(t){return!!zt(t)&&t.classList.contains("".concat(c,"-custom-item"))},Ie={},Ae=function(){var t=gt(),e=t.createFormButton,r=t.newTemplateForm,n=t.newTemplateNameInput,o=t.newTemplateActionInput,a=window.frmAdminBuild.installNewForm;n.value="",o.value="frm_install_form",a(r,"frm_install_form",e)},Ce=".".concat(c,"-item-favorite-button"),Pe="".concat(Ce," use"),Fe="#frm_heart_solid_icon",Be="#frm_heart_icon",Ne=function(t){var e,r=t.currentTarget,n=gt(),o=n.templatesList,i=n.featuredTemplatesList,l=n.favoritesCategoryCountEl,u=n.customTemplatesTitle,f=r.closest(".frm-card-item"),p=f.dataset.id,m=Oe(f),d=je(f),h=function(t){return!!zt(t)&&a.includes(Number(t.dataset.id))}(f),y=null;if(f.classList.toggle("".concat(c,"-favorite-item"),!m),h){var v=f.closest("#".concat(c,"-list"))?i:o;v&&(y=v.querySelector('.frm-card-item[data-id="'.concat(p,'"]'))).classList.toggle("".concat(c,"-favorite-item"),!m)}var g,b=Lt(),w=b.selectedCategory,x=b.favoritesCount,E=m?"remove":"add",S=f.querySelector(Pe),_=null===(e=y)||void 0===e?void 0:e.querySelector(Pe);"add"===E?(++x.total,d?++x.custom:++x.default,S.setAttribute("xlink:href",Fe),null==_||_.setAttribute("xlink:href",Fe)):(--x.total,d?--x.custom:--x.default,S.setAttribute("xlink:href",Be),null==_||_.setAttribute("xlink:href",Be)),l.textContent=x.total,jt("favoritesCount",x),s===w&&(0===x.total&&ir(),Ut(f),0===x.default&&Ut(o),0!==x.custom&&0!==x.default||Ut(u)),g=function(){return t=p,e=E,r=d,n=new FormData,o=frmDom.ajax.doJsonPost,n.append("template_id",t),n.append("operation",e),n.append("is_custom_template",r),o("add_or_remove_favorite_template",n);var t,e,r,n,o},Bt=Bt.then(g).catch(g)},De=function(t){var e=t.currentTarget,r=e.closest(".frm-card-item"),n=function(t){return!!zt(t)&&t.classList.contains("".concat(c,"-locked-item"))}(r),o=je(r);if(n||!o)if(t.preventDefault(),jt("selectedTemplate",r),n)!function(t){var e=t.dataset.requiredPlan;switch(e){case"basic":case"plus":case"business":case"elite":dr(e,t);break;case"renew":hr();break;case"free":yr()}}(r);else{var a=gt(),i=a.newTemplateForm,l=a.newTemplateNameInput,u=a.newTemplateDescriptionInput,s=a.newTemplateLinkInput,f=a.newTemplateActionInput,p=window.frmAdminBuild.installNewForm,m=r.querySelector(".frm-form-template-name").textContent.trim(),d=r.querySelector(".frm-form-templates-item-description").textContent.trim(),h="frm_install_template";l.value=m,u.value=d,f.value=h,s.value=e.href,p(i,h,e)}},Me=window.frmDom.search.init;function qe(t,e){var r=t.foundSomething,n=t.notEmptySearchText;if(!e||"search"!==e.type||""!==e.target.value){var o=Lt(),a=gt().allItemsCategory;jt("notEmptySearchText",n),o.notEmptySearchText||o.selectedCategory?(o.selectedCategory&&(function(t){var e=gt(),r=e.bodyContent,n=e.bodyContentChildren,o=e.pageTitle,a=e.templatesList,i=e.applicationTemplates,c=new Ft(r);t&&kt("selectedCategoryEl").classList.remove(nt),Ht(n),ke(X("Search Result","formidable")),Yt([o,a,i]),c.fadeIn()}(n),n&&jt("selectedCategory","")),function(t){if(t){var e,r=gt().emptyState;if(e=r,"none"!==window.getComputedStyle(e).getPropertyValue("display")){var n=gt().pageTitle;Ut(r),$t(n)}var o=gt(),a=o.templatesList,i=o.applicationTemplates,c=o.applicationTemplatesTitle,l=o.applicationTemplatesList;Yt([a,i,c]),0===a.offsetHeight&&Ht([a,c]),0===(null==l?void 0:l.offsetHeight)&&Ut(i)}else!function(){var t,e=Lt().notEmptySearchText,r=gt(),n=r.pageTitle,o=r.emptyState,a=r.emptyStateButton,i=r.applicationTemplates;if(p!==(null===(t=o.dataset)||void 0===t?void 0:t.view)){o.setAttribute("data-view",p);var c=gt(),l=c.emptyStateTitle,u=c.emptyStateText;l.textContent=X("No templates found","formidable"),u.textContent=X("Sorry, we didn't find any templates that match your criteria.","formidable"),a.textContent=X("Start from Scratch","formidable"),Ht([n,i]),Yt([o,a])}else e?($t(o),Ht([n,i])):(Ut(o),o.removeAttribute("data-view"))}()}(r)):a.dispatchEvent(new Event("click",{bubbles:!0}))}}var Ge=function(){var t,e=gt().emptyState;p===(null===(t=e.dataset)||void 0===t?void 0:t.view)&&(jt("selectedCategory",""),Vt(),gt().searchInput.focus())},Re=function(){var t=Lt().selectedCategory;f===t&&gr()},ze=function(){var t=gt().createTemplateFormsDropdown,e=t.value;if(e&&"no-forms"!==e){Ye(!1);var r=t.options[t.selectedIndex],n=r.dataset.description.trim(),o=r.dataset.name.trim(),a=" ".concat(X("Template","formidable"));o.endsWith(a)||(o+=a);var i=gt(),c=i.createTemplateName,l=i.createTemplateDescription;c.value=o,l.value=n}else Ye(!0)},Ye=function(t){var e=gt(),r=e.createTemplateName,n=e.createTemplateDescription,o=e.createTemplateButton;[r,n].forEach((function(e){e.disabled=t,t&&(e.value="")})),o.classList.toggle("disabled",t)},He=function(){var t=window.frmAdminBuild.installNewForm,e="frm_create_template",r=gt(),n=r.newTemplateForm,o=r.newTemplateActionInput,a=r.newTemplateNameInput,i=r.newTemplateDescriptionInput,c=r.newTemplateLinkInput,l=r.createTemplateName,u=r.createTemplateDescription,s=r.createTemplateFormsDropdown,f=r.createTemplateButton;o.value=e,a.value=l.value.trim(),i.value=u.value.trim(),c.value=s.value,t(n,e,f)};function $e(t){return $e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},$e(t)}function Ue(){Ue=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(t,e,r){t[e]=r.value},a="function"==typeof Symbol?Symbol:{},i=a.iterator||"@@iterator",c=a.asyncIterator||"@@asyncIterator",l=a.toStringTag||"@@toStringTag";function u(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{u({},"")}catch(t){u=function(t,e,r){return t[e]=r}}function s(t,e,r,n){var a=e&&e.prototype instanceof v?e:v,i=Object.create(a.prototype),c=new I(n||[]);return o(i,"_invoke",{value:L(t,r,c)}),i}function f(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=s;var p="suspendedStart",m="suspendedYield",d="executing",h="completed",y={};function v(){}function g(){}function b(){}var w={};u(w,i,(function(){return this}));var x=Object.getPrototypeOf,E=x&&x(x(A([])));E&&E!==r&&n.call(E,i)&&(w=E);var S=b.prototype=v.prototype=Object.create(w);function _(t){["next","throw","return"].forEach((function(e){u(t,e,(function(t){return this._invoke(e,t)}))}))}function T(t,e){function r(o,a,i,c){var l=f(t[o],t,a);if("throw"!==l.type){var u=l.arg,s=u.value;return s&&"object"==$e(s)&&n.call(s,"__await")?e.resolve(s.__await).then((function(t){r("next",t,i,c)}),(function(t){r("throw",t,i,c)})):e.resolve(s).then((function(t){u.value=t,i(u)}),(function(t){return r("throw",t,i,c)}))}c(l.arg)}var a;o(this,"_invoke",{value:function(t,n){function o(){return new e((function(e,o){r(t,n,e,o)}))}return a=a?a.then(o,o):o()}})}function L(e,r,n){var o=p;return function(a,i){if(o===d)throw Error("Generator is already running");if(o===h){if("throw"===a)throw i;return{value:t,done:!0}}for(n.method=a,n.arg=i;;){var c=n.delegate;if(c){var l=k(c,n);if(l){if(l===y)continue;return l}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===p)throw o=h,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=d;var u=f(e,r,n);if("normal"===u.type){if(o=n.done?h:m,u.arg===y)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(o=h,n.method="throw",n.arg=u.arg)}}}function k(e,r){var n=r.method,o=e.iterator[n];if(o===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,k(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),y;var a=f(o,e.iterator,r.arg);if("throw"===a.type)return r.method="throw",r.arg=a.arg,r.delegate=null,y;var i=a.arg;return i?i.done?(r[e.resultName]=i.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,y):i:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,y)}function O(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function j(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function I(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(O,this),this.reset(!0)}function A(e){if(e||""===e){var r=e[i];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,a=function r(){for(;++o<e.length;)if(n.call(e,o))return r.value=e[o],r.done=!1,r;return r.value=t,r.done=!0,r};return a.next=a}}throw new TypeError($e(e)+" is not iterable")}return g.prototype=b,o(S,"constructor",{value:b,configurable:!0}),o(b,"constructor",{value:g,configurable:!0}),g.displayName=u(b,l,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===g||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,b):(t.__proto__=b,u(t,l,"GeneratorFunction")),t.prototype=Object.create(S),t},e.awrap=function(t){return{__await:t}},_(T.prototype),u(T.prototype,c,(function(){return this})),e.AsyncIterator=T,e.async=function(t,r,n,o,a){void 0===a&&(a=Promise);var i=new T(s(t,r,n,o),a);return e.isGeneratorFunction(r)?i:i.next().then((function(t){return t.done?t.value:i.next()}))},_(S),u(S,l,"Generator"),u(S,i,(function(){return this})),u(S,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},e.values=A,I.prototype={constructor:I,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(j),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function o(n,o){return c.type="throw",c.arg=e,r.next=n,o&&(r.method="next",r.arg=t),!!o}for(var a=this.tryEntries.length-1;a>=0;--a){var i=this.tryEntries[a],c=i.completion;if("root"===i.tryLoc)return o("end");if(i.tryLoc<=this.prev){var l=n.call(i,"catchLoc"),u=n.call(i,"finallyLoc");if(l&&u){if(this.prev<i.catchLoc)return o(i.catchLoc,!0);if(this.prev<i.finallyLoc)return o(i.finallyLoc)}else if(l){if(this.prev<i.catchLoc)return o(i.catchLoc,!0)}else{if(!u)throw Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return o(i.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var a=o;break}}a&&("break"===t||"continue"===t)&&a.tryLoc<=e&&e<=a.finallyLoc&&(a=null);var i=a?a.completion:{};return i.type=t,i.arg=e,a?(this.method="next",this.next=a.finallyLoc,y):this.complete(i)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),y},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),j(r),y}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;j(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:A(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),y}},e}function Ze(t,e,r,n,o,a,i){try{var c=t[a](i),l=c.value}catch(t){return void r(t)}c.done?e(l):Promise.resolve(l).then(n,o)}var Ke=function(){var t,e=(t=Ue().mark((function t(){var e,r,n,o,a,i,c,l,u,s,f,p,m;return Ue().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r=gt(),n=r.leaveEmailModalInput,o=n.value.trim()){t.next=5;break}return br("empty"),t.abrupt("return");case 5:if(Rt(o)){t.next=8;break}return br("invalid"),t.abrupt("return");case 8:if(a=gt(),i=a.leaveEmailModalHiddenForm,c=a.leaveEmailModalHiddenInput,i){t.next=11;break}return t.abrupt("return");case 11:return c.value=o,(l=new FormData(i)).append("action","frm_forms_preview"),t.prev=14,t.next=17,fetch(i.getAttribute("action"),{method:"POST",body:l});case 17:return s=t.sent,t.next=20,s.text();case 20:f=t.sent,p=new DOMParser,u=p.parseFromString(f,"text/html"),t.next=29;break;case 25:return t.prev=25,t.t0=t.catch(14),console.error("An error occurred:",t.t0),t.abrupt("return");case 29:(m=null===(e=u.querySelector(".frm_message"))||void 0===e?void 0:e.textContent.trim())&&m.indexOf("Thanks!")>=0?vr():br("invalid");case 31:case"end":return t.stop()}}),t,null,[[14,25]])})),function(){var e=this,r=arguments;return new Promise((function(n,o){var a=t.apply(e,r);function i(t){Ze(a,n,o,i,c,"next",t)}function c(t){Ze(a,n,o,i,c,"throw",t)}i(void 0)}))});return function(){return e.apply(this,arguments)}}();function Ve(t){return Ve="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ve(t)}function Je(){Je=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(t,e,r){t[e]=r.value},a="function"==typeof Symbol?Symbol:{},i=a.iterator||"@@iterator",c=a.asyncIterator||"@@asyncIterator",l=a.toStringTag||"@@toStringTag";function u(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{u({},"")}catch(t){u=function(t,e,r){return t[e]=r}}function s(t,e,r,n){var a=e&&e.prototype instanceof v?e:v,i=Object.create(a.prototype),c=new I(n||[]);return o(i,"_invoke",{value:L(t,r,c)}),i}function f(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=s;var p="suspendedStart",m="suspendedYield",d="executing",h="completed",y={};function v(){}function g(){}function b(){}var w={};u(w,i,(function(){return this}));var x=Object.getPrototypeOf,E=x&&x(x(A([])));E&&E!==r&&n.call(E,i)&&(w=E);var S=b.prototype=v.prototype=Object.create(w);function _(t){["next","throw","return"].forEach((function(e){u(t,e,(function(t){return this._invoke(e,t)}))}))}function T(t,e){function r(o,a,i,c){var l=f(t[o],t,a);if("throw"!==l.type){var u=l.arg,s=u.value;return s&&"object"==Ve(s)&&n.call(s,"__await")?e.resolve(s.__await).then((function(t){r("next",t,i,c)}),(function(t){r("throw",t,i,c)})):e.resolve(s).then((function(t){u.value=t,i(u)}),(function(t){return r("throw",t,i,c)}))}c(l.arg)}var a;o(this,"_invoke",{value:function(t,n){function o(){return new e((function(e,o){r(t,n,e,o)}))}return a=a?a.then(o,o):o()}})}function L(e,r,n){var o=p;return function(a,i){if(o===d)throw Error("Generator is already running");if(o===h){if("throw"===a)throw i;return{value:t,done:!0}}for(n.method=a,n.arg=i;;){var c=n.delegate;if(c){var l=k(c,n);if(l){if(l===y)continue;return l}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===p)throw o=h,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=d;var u=f(e,r,n);if("normal"===u.type){if(o=n.done?h:m,u.arg===y)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(o=h,n.method="throw",n.arg=u.arg)}}}function k(e,r){var n=r.method,o=e.iterator[n];if(o===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,k(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),y;var a=f(o,e.iterator,r.arg);if("throw"===a.type)return r.method="throw",r.arg=a.arg,r.delegate=null,y;var i=a.arg;return i?i.done?(r[e.resultName]=i.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,y):i:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,y)}function O(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function j(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function I(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(O,this),this.reset(!0)}function A(e){if(e||""===e){var r=e[i];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,a=function r(){for(;++o<e.length;)if(n.call(e,o))return r.value=e[o],r.done=!1,r;return r.value=t,r.done=!0,r};return a.next=a}}throw new TypeError(Ve(e)+" is not iterable")}return g.prototype=b,o(S,"constructor",{value:b,configurable:!0}),o(b,"constructor",{value:g,configurable:!0}),g.displayName=u(b,l,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===g||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,b):(t.__proto__=b,u(t,l,"GeneratorFunction")),t.prototype=Object.create(S),t},e.awrap=function(t){return{__await:t}},_(T.prototype),u(T.prototype,c,(function(){return this})),e.AsyncIterator=T,e.async=function(t,r,n,o,a){void 0===a&&(a=Promise);var i=new T(s(t,r,n,o),a);return e.isGeneratorFunction(r)?i:i.next().then((function(t){return t.done?t.value:i.next()}))},_(S),u(S,l,"Generator"),u(S,i,(function(){return this})),u(S,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},e.values=A,I.prototype={constructor:I,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(j),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function o(n,o){return c.type="throw",c.arg=e,r.next=n,o&&(r.method="next",r.arg=t),!!o}for(var a=this.tryEntries.length-1;a>=0;--a){var i=this.tryEntries[a],c=i.completion;if("root"===i.tryLoc)return o("end");if(i.tryLoc<=this.prev){var l=n.call(i,"catchLoc"),u=n.call(i,"finallyLoc");if(l&&u){if(this.prev<i.catchLoc)return o(i.catchLoc,!0);if(this.prev<i.finallyLoc)return o(i.finallyLoc)}else if(l){if(this.prev<i.catchLoc)return o(i.catchLoc,!0)}else{if(!u)throw Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return o(i.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var a=o;break}}a&&("break"===t||"continue"===t)&&a.tryLoc<=e&&e<=a.finallyLoc&&(a=null);var i=a?a.completion:{};return i.type=t,i.arg=e,a?(this.method="next",this.next=a.finallyLoc,y):this.complete(i)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),y},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),j(r),y}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;j(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:A(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),y}},e}function Xe(t,e,r,n,o,a,i){try{var c=t[a](i),l=c.value}catch(t){return void r(t)}c.done?e(l):Promise.resolve(l).then(n,o)}var We=function(){var t,e=(t=Je().mark((function t(){var e,r,n,o,a,i,l,u,s,f,p,m;return Je().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e=gt(),r=e.codeFromEmailModalInput,n=r.value.trim()){t.next=5;break}return wr("empty"),t.abrupt("return");case 5:return o=Lt(),a=o.selectedTemplate,(i=new FormData).append("action","template_api_signup"),i.append("nonce",tt),i.append("code",n),i.append("key",a.dataset.key),t.prev=11,t.next=14,fetch(ajaxurl,{method:"POST",body:i});case 14:return u=t.sent,t.next=17,u.json();case 17:l=t.sent,t.next=24;break;case 20:return t.prev=20,t.t0=t.catch(11),console.error("An error occurred:",t.t0),t.abrupt("return");case 24:if(l.success){t.next=30;break}return f=(null===(s=l)||void 0===s||null===(s=s.data)||void 0===s?void 0:s[0])||{},p=f.message,wr(p?"custom":"invalid",p),$t(document.getElementById("frm_code_from_email_options")),t.abrupt("return");case 30:if(!Gt("free-templates")){t.next=33;break}return window.location.href=(qt.delete("free-templates"),Mt.search=qt.toString(),Mt.toString()),t.abrupt("return");case 33:if(l.data&&l.data.url){t.next=35;break}return t.abrupt("return");case 35:a.classList.remove("".concat(c,"-locked-item")),(m=a.querySelector(".frm-form-templates-use-template-button")).setAttribute("href",l.data.url),m.dispatchEvent(new Event("click",{bubbles:!0}));case 39:case"end":return t.stop()}}),t,null,[[11,20]])})),function(){var e=this,r=arguments;return new Promise((function(n,o){var a=t.apply(e,r);function i(t){Xe(a,n,o,i,c,"next",t)}function c(t){Xe(a,n,o,i,c,"throw",t)}i(void 0)}))});return function(){return e.apply(this,arguments)}}(),Qe=function(){var t=gt(),e=t.leaveEmailModal,r=t.codeFromEmailModal;Ut(r),$t(e)},tr=function(){var t=gt(),e=t.codeFromEmailModalInput,r=t.leaveEmailModalGetCodeButton;e.value="",Ht(document.querySelectorAll("#frm_code_from_email_options, #frm_code_from_email_error")),r.dispatchEvent(new Event("click",{bubbles:!0}))},er=function(t){if(!t.target.closest("a")){var e=t.currentTarget;window.location.href=e.dataset.href}};function rr(){var t,e,r,n,o,a,i,p,m;gt().categoryItems.forEach((function(t){Dt(t,Zt),t.addEventListener("keydown",Kt)})),wp.hooks.addAction("frmPage.onCategoryClick","frmFormTemplates",(function(t){!function(t){var e=gt(),r=e.bodyContentChildren,n=e.pageTitle,o=e.showCreateTemplateModalButton,a=e.templatesList,i=e.templateItems;switch(y!==t&&Ht(r),ke(),Ut(o),$t(n),t){case y:!function(){var t=gt(),e=t.bodyContentChildren,r=t.pageTitleDivider,n=t.templateItems,o=t.twinFeaturedTemplateItems,a=t.customTemplatesSection,i=t.emptyState,c=t.applicationTemplates;Yt([].concat(or(e),or(n))),Ht([r].concat(or(o),[a,i,c]))}();break;case l:!function(){if(0!==Lt().availableTemplatesCount){var t=gt(),e=t.templatesList,r=t.templateItems,n=t.availableTemplateItems;Ht(r),Yt([e].concat(or(n)))}else!function(){var t=gt(),e=t.pageTitle,r=t.emptyState,n=t.emptyStateButton;r.setAttribute("data-view",l);var o=gt(),a=o.emptyStateTitle,i=o.emptyStateText,c=Lt().extraTemplatesCount;a.textContent=X("No Templates Available","formidable"),i.textContent=function(t){try{for(var e=arguments.length,r=new Array(e>1?e-1:0),n=1;n<e;n++)r[n-1]=arguments[n];return O().sprintf.apply(O(),[t].concat(r))}catch(e){return j("sprintf error: \n\n"+e.toString()),t}}(X("Upgrade to PRO for %s+ options or explore Free Templates.","formidable"),c),Ht([e,n]),$t(r)}()}();break;case u:!function(){var t=gt(),e=t.templatesList,r=t.templateItems,n=t.freeTemplateItems;Ht(r),Yt([e].concat(or(n)))}();break;case s:!function(){var t=Lt().favoritesCount;if(0!==t.total){var e=gt(),r=e.bodyContent,n=e.templatesList,o=e.templateItems,a=e.customTemplatesSection,i=e.customTemplatesTitle,l=e.customTemplatesList,u=e.customTemplateItems;Ht(o);var s=[],f=r.querySelectorAll(".".concat(c,"-favorite-item"));if(s.push.apply(s,or(f)),t.default>0&&s.push(n),t.custom>0){var p=Array.from(u).filter((function(t){return!Oe(t)}));Ht(p),s.push(a),s.push(l),0===t.default?Ut(i):s.push(i)}Yt(s)}else ir()}();break;case f:!function(){if(0!==Lt().customCount){var t=gt(),e=t.showCreateTemplateModalButton,r=t.pageTitleDivider,n=t.customTemplatesSection,o=t.customTemplatesList,a=t.customTemplatesTitle,i=t.customTemplateItems;Ut(a),Yt([e,r,n,o].concat(or(i)))}else!function(){var t=gt(),e=t.pageTitle,r=t.emptyState,n=t.emptyStateButton;r.setAttribute("data-view",f);var o=gt(),a=o.emptyStateTitle,i=o.emptyStateText;a.textContent=X("You currently have no templates.","formidable"),i.textContent=X("You haven't created any form templates. Begin now to simplify your workflow and save time.","formidable"),n.textContent=X("Create Template","formidable"),Ut(e),Yt([r,n])}()}();break;default:Ht(i),Yt([a].concat(or(Ie[t])))}}(t)})),m=gt().createFormButton,Dt(m,Ae),document.querySelectorAll(Ce).forEach((function(t){return Dt(t,Ne)})),document.querySelectorAll(".".concat(c,"-use-template-button")).forEach((function(t){return t.addEventListener("click",De)})),a=gt(),i=a.searchInput,p=a.emptyStateButton,Me(i,"frm-card-item",{handleSearchResult:qe}),Dt(p,Ge),function(){var t=gt(),e=t.createTemplateFormsDropdown,r=t.createTemplateButton,n=t.showCreateTemplateModalButton,o=t.emptyStateButton;Dt(n,Re),Dt(o,Re),e.addEventListener("change",ze),Dt(r,He)}(),o=gt().leaveEmailModalGetCodeButton,Dt(o,Ke),t=document.getElementById("frm-confirm-email-address"),e=document.getElementById("frm-code-modal-back-button"),r=document.getElementById("frm-change-email-address"),n=document.getElementById("frm-resend-code"),Dt(t,We),Dt(e,Qe),Dt(r,Qe),Dt(n,tr)}function nr(t){var e,r;(function(t){if(t&&t.length){var e=t.map((function(t){return function(t){var e=t.name,r=t.key,o=t.hasLiteThumbnail,a=t.isWebp,i=o?a?"".concat(le,"/").concat(r,".webp"):"".concat(le,"/").concat(r,".png"):"".concat(le,"/placeholder.svg");return ne("li",{className:"frm-card-item",data:{href:"".concat(n,"&triggerViewApplicationModal=1&template=").concat(r),"frm-search-text":e.toLowerCase()},children:[oe({className:"".concat(c,"-item-icon"),child:ce({src:i})}),oe({className:"".concat(c,"-item-body"),children:[ae({text:X("Ready Made Solution","formidable"),className:"frm-meta-tag frm-orange-tag frm-text-xs"}),ne("h3",{text:e,className:"frm-text-sm frm-font-medium frm-m-0"}),ie({text:X("See all applications","formidable"),className:"frm-text-xs frm-font-semibold",href:n})]})]})}(t)}));ee=oe({id:"".concat(c,"-applications"),className:et,children:[ne("h2",{text:X("Application Templates"),className:"frm-text-sm frm-mb-sm"}),ne("ul",{className:"".concat(c,"-list frm-list-grid-layout"),children:e})]})}})(t.templates),(e=gt()).applicationTemplates||void 0===ee||(e.bodyContent.appendChild(ee),bt({applicationTemplates:ee,applicationTemplatesTitle:ee.querySelector("h2"),applicationTemplatesList:ee.querySelector(".".concat(c,"-list")),applicationTemplateItems:ee.querySelectorAll(".frm-card-item")})),void 0!==(r=gt().applicationTemplateItems)&&r.forEach((function(t){t.addEventListener("click",er)}))}function or(t){return function(t){if(Array.isArray(t))return ar(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(t){if("string"==typeof t)return ar(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?ar(t,e):void 0}}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function ar(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function ir(){var t=gt(),e=t.pageTitle,r=t.emptyState,n=t.emptyStateButton;r.setAttribute("data-view",s);var o=gt(),a=o.emptyStateTitle,i=o.emptyStateText;a.textContent=X("No favorites","formidable"),i.textContent=X("You haven't added any templates to your favorites yet.","formidable"),Ht([e,n]),$t(r)}function cr(t){return cr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},cr(t)}function lr(){lr=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(t,e,r){t[e]=r.value},a="function"==typeof Symbol?Symbol:{},i=a.iterator||"@@iterator",c=a.asyncIterator||"@@asyncIterator",l=a.toStringTag||"@@toStringTag";function u(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{u({},"")}catch(t){u=function(t,e,r){return t[e]=r}}function s(t,e,r,n){var a=e&&e.prototype instanceof v?e:v,i=Object.create(a.prototype),c=new I(n||[]);return o(i,"_invoke",{value:L(t,r,c)}),i}function f(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=s;var p="suspendedStart",m="suspendedYield",d="executing",h="completed",y={};function v(){}function g(){}function b(){}var w={};u(w,i,(function(){return this}));var x=Object.getPrototypeOf,E=x&&x(x(A([])));E&&E!==r&&n.call(E,i)&&(w=E);var S=b.prototype=v.prototype=Object.create(w);function _(t){["next","throw","return"].forEach((function(e){u(t,e,(function(t){return this._invoke(e,t)}))}))}function T(t,e){function r(o,a,i,c){var l=f(t[o],t,a);if("throw"!==l.type){var u=l.arg,s=u.value;return s&&"object"==cr(s)&&n.call(s,"__await")?e.resolve(s.__await).then((function(t){r("next",t,i,c)}),(function(t){r("throw",t,i,c)})):e.resolve(s).then((function(t){u.value=t,i(u)}),(function(t){return r("throw",t,i,c)}))}c(l.arg)}var a;o(this,"_invoke",{value:function(t,n){function o(){return new e((function(e,o){r(t,n,e,o)}))}return a=a?a.then(o,o):o()}})}function L(e,r,n){var o=p;return function(a,i){if(o===d)throw Error("Generator is already running");if(o===h){if("throw"===a)throw i;return{value:t,done:!0}}for(n.method=a,n.arg=i;;){var c=n.delegate;if(c){var l=k(c,n);if(l){if(l===y)continue;return l}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===p)throw o=h,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=d;var u=f(e,r,n);if("normal"===u.type){if(o=n.done?h:m,u.arg===y)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(o=h,n.method="throw",n.arg=u.arg)}}}function k(e,r){var n=r.method,o=e.iterator[n];if(o===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,k(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),y;var a=f(o,e.iterator,r.arg);if("throw"===a.type)return r.method="throw",r.arg=a.arg,r.delegate=null,y;var i=a.arg;return i?i.done?(r[e.resultName]=i.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,y):i:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,y)}function O(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function j(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function I(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(O,this),this.reset(!0)}function A(e){if(e||""===e){var r=e[i];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,a=function r(){for(;++o<e.length;)if(n.call(e,o))return r.value=e[o],r.done=!1,r;return r.value=t,r.done=!0,r};return a.next=a}}throw new TypeError(cr(e)+" is not iterable")}return g.prototype=b,o(S,"constructor",{value:b,configurable:!0}),o(b,"constructor",{value:g,configurable:!0}),g.displayName=u(b,l,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===g||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,b):(t.__proto__=b,u(t,l,"GeneratorFunction")),t.prototype=Object.create(S),t},e.awrap=function(t){return{__await:t}},_(T.prototype),u(T.prototype,c,(function(){return this})),e.AsyncIterator=T,e.async=function(t,r,n,o,a){void 0===a&&(a=Promise);var i=new T(s(t,r,n,o),a);return e.isGeneratorFunction(r)?i:i.next().then((function(t){return t.done?t.value:i.next()}))},_(S),u(S,l,"Generator"),u(S,i,(function(){return this})),u(S,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},e.values=A,I.prototype={constructor:I,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(j),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function o(n,o){return c.type="throw",c.arg=e,r.next=n,o&&(r.method="next",r.arg=t),!!o}for(var a=this.tryEntries.length-1;a>=0;--a){var i=this.tryEntries[a],c=i.completion;if("root"===i.tryLoc)return o("end");if(i.tryLoc<=this.prev){var l=n.call(i,"catchLoc"),u=n.call(i,"finallyLoc");if(l&&u){if(this.prev<i.catchLoc)return o(i.catchLoc,!0);if(this.prev<i.finallyLoc)return o(i.finallyLoc)}else if(l){if(this.prev<i.catchLoc)return o(i.catchLoc,!0)}else{if(!u)throw Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return o(i.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var a=o;break}}a&&("break"===t||"continue"===t)&&a.tryLoc<=e&&e<=a.finallyLoc&&(a=null);var i=a?a.completion:{};return i.type=t,i.arg=e,a?(this.method="next",this.next=a.finallyLoc,y):this.complete(i)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),y},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),j(r),y}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;j(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:A(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),y}},e}function ur(t,e,r,n,o,a,i){try{var c=t[a](i),l=c.value}catch(t){return void r(t)}c.done?e(l):Promise.resolve(l).then(n,o)}function sr(t){return function(){var e=this,r=arguments;return new Promise((function(n,o){var a=t.apply(e,r);function i(t){ur(a,n,o,i,c,"next",t)}function c(t){ur(a,n,o,i,c,"throw",t)}i(void 0)}))}}var fr,pr=function(t){return sr(lr().mark((function e(){var r,n,o,a,i,c,l=arguments;return lr().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=_e()){e.next=3;break}return e.abrupt("return");case 3:for(n=gt(),o=n.modalItems,Ht(o),r.dialog("option","width",m),a=l.length,i=new Array(a),c=0;c<a;c++)i[c]=l[c];return e.next=9,null==t?void 0:t.apply(void 0,i);case 9:r.dialog("open");case 10:case"end":return e.stop()}}),e)})))},mr={basic:["basic","plus","business","elite"],plus:["plus","business","elite"],business:["business","elite"],elite:["elite"]},dr=pr((function(t,e){var r=e.querySelector(".frm-form-template-name").textContent.trim(),n=gt(),o=n.upgradeModal,a=n.upgradeModalTemplateNames,c=n.upgradeModalPlansIcons,l=n.upgradeModalLink;a.forEach((function(t){return t.textContent=r})),c.forEach((function(e){var r=e.dataset.plan,n=mr[t].includes(r);e.classList.toggle("frm_green",n),e.querySelector("svg > use").setAttribute("xlink:href",n?"#frm_checkmark_icon":"#frm_close_icon")}));var u=e.dataset.slug?"-".concat(e.dataset.slug):"";l.href=i+u,$t(o)})),hr=pr((function(){var t=gt().renewAccountModal;$t(t)})),yr=pr((function(){var t=gt().leaveEmailModal;$t(t)})),vr=pr((function(){var t=gt().codeFromEmailModal;$t(t)})),gr=pr((function(){_e().dialog("option","width",d);var t=gt().createTemplateModal;$t(t)})),br=function(t){Nt("#frm_leave_email","#frm_leave_email_error",t)},wr=function(t,e){Nt("#frm_code_from_email","#frm_code_from_email_error",t,e)},xr=function(){e&&(0,frmDom.ajax.doJsonFetch)("get_applications_data&view=templates").then(nr),function(){Se.apply(this,arguments)}(),gt().templateItems.forEach((function(t){t.getAttribute("data-categories").split(",").forEach((function(e){Ie[e]||(Ie[e]=[]),Ie[e].push(t)}))})),function(){var t=gt(),e=t.sidebar,r=t.searchInput,n=t.bodyContent,o=t.twinFeaturedTemplateItems,a=t.availableTemplatesCategory,i=t.freeTemplatesCategory,c=new Ft(n);if(r.value="",Ht(o),a){var l=Lt().availableTemplatesCount;a.querySelector(".".concat(h,"-cat-count")).textContent=l}var u=Lt().freeTemplatesCount;i.querySelector(".".concat(h,"-cat-count")).textContent=u,0===u&&Ut(i);var s,f=gt().extraTemplateCountElements,p=Lt().extraTemplatesCount;f.forEach((function(t){return t.textContent=p})),n.classList.remove(rt),e.classList.remove(rt),c.fadeIn(),$t(e),Gt("return_page")&&(s=gt().headerCancelButton,new Ft(s).fadeIn())}(),rr()};fr=function(){wp.hooks.doAction("frmFormTemplates.beforeInitialize",{getState:Lt,setState:Ot}),xr(),wp.hooks.doAction("frmFormTemplates.afterInitialize",{getState:Lt,setState:Ot}),wp.hooks.doAction("frm_new_form_modal_form",jQuery("#frm-new-template"))},"undefined"!=typeof document&&("complete"!==document.readyState&&"interactive"!==document.readyState?document.addEventListener("DOMContentLoaded",fr):fr())}()}();
Save Changes
Rename File
Rename