Plugin Directory

Changeset 2514969


Ignore:
Timestamp:
04/14/2021 03:22:31 PM (5 years ago)
Author:
jamesros161
Message:

V 1.6.6 Release

Location:
weforms
Files:
10 added
5 deleted
28 edited
20 copied

Legend:

Unmodified
Added
Removed
  • weforms/tags/1.6.6/assets/js/spa-app.js

    r2477338 r2514969  
    11'use strict';
    22
    3 var _typeof9 = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
     3var _typeof11 = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
     4
     5var _typeof10 = typeof Symbol === "function" && _typeof11(Symbol.iterator) === "symbol" ? function (obj) {
     6    return typeof obj === "undefined" ? "undefined" : _typeof11(obj);
     7} : function (obj) {
     8    return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj === "undefined" ? "undefined" : _typeof11(obj);
     9};
     10
     11var _typeof9 = typeof Symbol === "function" && _typeof10(Symbol.iterator) === "symbol" ? function (obj) {
     12    return typeof obj === "undefined" ? "undefined" : _typeof10(obj);
     13} : function (obj) {
     14    return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj === "undefined" ? "undefined" : _typeof10(obj);
     15};
    416
    517var _typeof8 = typeof Symbol === "function" && _typeof9(Symbol.iterator) === "symbol" ? function (obj) {
  • weforms/tags/1.6.6/assets/js/spa-app.min.js

    r2477338 r2514969  
    1 "use strict";var _typeof9="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},_typeof8="function"==typeof Symbol&&"symbol"===_typeof9(Symbol.iterator)?function(e){return void 0===e?"undefined":_typeof9(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":void 0===e?"undefined":_typeof9(e)},_typeof7="function"==typeof Symbol&&"symbol"===_typeof8(Symbol.iterator)?function(e){return void 0===e?"undefined":_typeof8(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":void 0===e?"undefined":_typeof8(e)},_typeof6="function"==typeof Symbol&&"symbol"===_typeof7(Symbol.iterator)?function(e){return void 0===e?"undefined":_typeof7(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":void 0===e?"undefined":_typeof7(e)},_typeof5="function"==typeof Symbol&&"symbol"===_typeof6(Symbol.iterator)?function(e){return void 0===e?"undefined":_typeof6(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":void 0===e?"undefined":_typeof6(e)},_typeof4="function"==typeof Symbol&&"symbol"===_typeof5(Symbol.iterator)?function(e){return void 0===e?"undefined":_typeof5(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":void 0===e?"undefined":_typeof5(e)},_typeof3="function"==typeof Symbol&&"symbol"===_typeof4(Symbol.iterator)?function(e){return void 0===e?"undefined":_typeof4(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":void 0===e?"undefined":_typeof4(e)},_typeof2="function"==typeof Symbol&&"symbol"===_typeof3(Symbol.iterator)?function(e){return void 0===e?"undefined":_typeof3(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":void 0===e?"undefined":_typeof3(e)},_typeof="function"==typeof Symbol&&"symbol"===_typeof2(Symbol.iterator)?function(e){return void 0===e?"undefined":_typeof2(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":void 0===e?"undefined":_typeof2(e)};!function(s){Vue.component("wpuf-table",{template:"#tmpl-wpuf-component-table",mixins:[weForms.mixins.Loading,weForms.mixins.Paginate,weForms.mixins.BulkAction],props:{has_export:String,action:String,delete:String,id:[String,Number],status:[String]},data:function(){return{loading:!1,columns:[],items:[],ajaxAction:this.action,nonce:weForms.nonce,index:"id",bulkDeleteAction:this.delete?this.delete:"weforms_form_entry_trash_bulk"}},created:function(){this.fetchData()},computed:{columnLength:function(){return Object.keys(this.columns).length}},methods:{fetchData:function(){var t=this;this.loading=!0,wp.ajax.send(t.action,{data:{id:t.id,page:t.currentPage,status:t.status,_wpnonce:weForms.nonce},success:function(e){t.loading=!1,t.columns=e.columns,t.items=e.entries,t.form_title=e.form_title,t.totalItems=e.pagination.total,t.perPage=e.pagination.per_page,t.totalPage=e.pagination.pages,t.$emit("ajaxsuccess",e)},error:function(e){t.loading=!1,alert(e)}})},handleBulkAction:function(){if("-1"!==this.bulkAction){if("delete"===this.bulkAction){if(!this.checkedItems.length)return void alert("Please select atleast one entry to delete.");confirm("Are you sure to delete the entries?")&&this.deleteBulk()}if("restore"===this.bulkAction){if(!this.checkedItems.length)return void alert("Please select atleast one entry to restore.");this.restoreBulk()}}else alert("Please chose a bulk action to perform")},restore:function(e){var t=this;t.loading=!0,wp.ajax.send("weforms_form_entry_restore",{data:{entry_id:e,_wpnonce:weForms.nonce},success:function(e){t.loading=!1,t.fetchData()},error:function(e){t.loading=!1,alert(e)}})},deletePermanently:function(e){if(confirm("Are you sure to delete this entry?")){var t=this;t.loading=!0,wp.ajax.send("weforms_form_entry_delete",{data:{entry_id:e,_wpnonce:weForms.nonce},success:function(e){t.loading=!1,t.fetchData()},error:function(e){t.loading=!1,alert(e)}})}}},watch:{id:function(){this.fetchData()},status:function(){this.currentPage=1,this.bulkAction=-1,this.fetchData()}}}),weForms.routeComponents.Entries={template:"#tmpl-wpuf-entries",data:function(){return{selected:0,forms:{},form_title:"Loading...",status:"publish",total:0,totalTrash:0}},created:function(){this.get_forms()},methods:{get_forms:function(){var t=this;wp.ajax.send("weforms_form_list",{data:{_wpnonce:weForms.nonce,page:t.currentPage,posts_per_page:-1,filter:"entries"},success:function(e){Object.keys(e.forms).length?(t.forms=e.forms,t.selected=t.forms[Object.keys(t.forms)[0]].id):t.form_title="No entry found"},error:function(e){alert(e)}})}}},weForms.routeComponents.FormEditComponent={template:"#tmpl-wpuf-form-builder",mixins:wpuf_form_builder_mixins(wpuf_mixins.root),data:function(){return{is_form_saving:!1,is_form_saved:!1,is_form_switcher:!1,post_title_editing:!1,loading:!1,activeTab:"editor",activeSettingsTab:"form",activePaymentTab:"paypal"}},watch:{loading:function(e){e?(NProgress.configure({parent:"#wpadminbar"}),NProgress.start()):NProgress.done()},form_fields:{handler:function(){window.weFormsBuilderisDirty=!0},deep:!0},notifications:{handler:function(){window.weFormsBuilderisDirty=!0},deep:!0},integrations:{handler:function(){window.weFormsBuilderisDirty=!0},deep:!0},settings:{handler:function(){window.weFormsBuilderisDirty=!0},deep:!0},payment:{handler:function(){window.weFormsBuilderisDirty=!0},deep:!0}},created:function(){this.set_current_panel("form-fields"),this.fetchForm(),this.$store.commit("panel_add_show_prop"),wpuf_form_builder.event_hub=new Vue},computed:{current_panel:function(){return this.$store.state.current_panel},post:function(){return this.$store.state.post},form_fields_count:function(){return this.$store.state.form_fields.length},form_fields:function(){return this.$store.state.form_fields},notifications:function(){return this.$store.state.notifications},integrations:function(){return this.$store.state.integrations},settings:function(){return this.$store.state.settings},payment:function(){return this.$store.state.payment}},mounted:function(){var e=new window.Clipboard(".form-id");s(".form-id").tooltip();var t=this;this.started=!0,e.on("success",function(e){s(e.trigger).attr("data-original-title","Copied!").tooltip("show"),setTimeout(function(){s(e.trigger).tooltip("hide").attr("data-original-title",t.i18n.copy_shortcode)},1e3),e.clearSelection()}),this.initSharingClipBoard(),setTimeout(function(){window.weFormsBuilderisDirty=!1},500),window.onbeforeunload=function(){if(window.weFormsBuilderisDirty)return t.i18n.unsaved_changes}},methods:{makeActive:function(e){this.activeTab=e},isActiveTab:function(e){return this.activeTab===e},isActiveSettingsTab:function(e){return this.activeSettingsTab===e},makeActiveSettingsTab:function(e){this.activeSettingsTab=e},isActivePaymentTab:function(e){return this.activePaymentTab===e},makeActivePaymentTab:function(e){this.activePaymentTab=e},fetchForm:function(){var t=this;t.loading=!0,wp.ajax.send("weforms_get_form",{data:{form_id:this.$route.params.id,_wpnonce:weForms.nonce},success:function(e){t.$store.commit("set_form_post",e.post),t.$store.commit("set_form_fields",e.form_fields),t.$store.commit("set_form_notification",e.notifications),t.$store.commit("set_form_settings",e.settings),void 0!==e.integrations.length?t.$store.commit("set_form_integrations",{}):t.$store.commit("set_form_integrations",e.integrations)},error:function(e){alert(e)},complete:function(){t.loading=!1}})},set_current_panel:function(e){this.$store.commit("set_current_panel",e)},save_form_builder:function(){var t=this;!_.isFunction(this.validate_form_before_submit)||this.validate_form_before_submit()?(t.is_form_saving=!0,t.set_current_panel("form-fields"),wp.ajax.send("wpuf_form_builder_save_form",{data:{form_data:s("#wpuf-form-builder").serialize(),form_fields:JSON.stringify(t.form_fields),notifications:JSON.stringify(t.notifications),settings:JSON.stringify(t.settings),payment:JSON.stringify(t.payment),integrations:JSON.stringify(t.integrations)},success:function(e){e.form_fields&&t.$store.commit("set_form_fields",e.form_fields),t.is_form_saving=!1,t.is_form_saved=!0,setTimeout(function(){window.weFormsBuilderisDirty=!1},500),toastr.success(t.i18n.saved_form_data)},error:function(){t.is_form_saving=!1}})):this.warn({text:this.validation_error_msg})},save_settings:function(){toastr.options.preventDuplicates=!0,this.save_form_builder()},shareForm:function(e,t){var n=this;if("on"===n.settings.sharing_on){var o=e+"?weforms="+btoa(n.getSharingHash()+"_"+Math.floor(Date.now()/1e3)+"_"+t.ID);swal({title:n.i18n.shareYourForm,html:"<p>"+n.i18n.shareYourFormText+'</p> <p><input onClick="this.setSelectionRange(0, this.value.length)" type="text" class="regular-text" value="'+o+'"/> <button class="anonymous-share-btn button button-primary" title="Copy URL" data-clipboard-text="'+o+'"><i class="fa fa-clipboard" aria-hidden="true"></i></button></p>',showCloseButton:!0,showCancelButton:!0,confirmButtonClass:"btn btn-success",cancelButtonClass:"btn btn-danger",confirmButtonColor:"#d54e21",confirmButtonText:n.i18n.disableSharing,cancelButtonText:n.i18n.close,focusCancel:!0}).then(function(){swal({title:n.i18n.areYouSure,html:"<p>"+n.i18n.areYouSureDesc+"</p>",type:"info",confirmButtonColor:"#d54e21",showCancelButton:!0,confirmButtonText:n.i18n.disable,cancelButtonText:n.i18n.cancel}).then(function(){n.disableSharing()})})}else swal({title:n.i18n.shareYourForm,html:n.i18n.shareYourFormDesc,type:"info",showCancelButton:!0,confirmButtonText:"Enable",cancelButtonText:"Cancel"}).then(function(){n.enableSharing(e,t)})},enableSharing:function(e,t){this.settings.sharing_on="on",this.save_settings(),this.shareForm(e,t)},disableSharing:function(){this.settings.sharing_on=!1,this.save_settings()},getSharingHash:function(){return this.settings.sharing_hash||(this.settings.sharing_hash=this.makeRandomString(8),this.save_settings()),this.settings.sharing_hash},makeRandomString:function(e){e=e||8;for(var t="",n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",o=0;o<e;o++)t+=n.charAt(Math.floor(Math.random()*n.length));return t},initSharingClipBoard:function(e){var t=new window.Clipboard(".anonymous-share-btn");s(".anonymous-share-btn").tooltip(),t.on("success",function(e){s(e.trigger).attr("data-original-title","Copied!").tooltip("show"),setTimeout(function(){s(e.trigger).tooltip("hide").attr("data-original-title","Copy URL")},1e3),e.clearSelection()})}}},weForms.routeComponents.FormEntries={props:{id:[String,Number]},template:"#tmpl-wpuf-form-entries",data:function(){return{selected:0,form_title:"Loading...",status:"publish",total:0,totalTrash:0}}},weForms.routeComponents.FormEntriesSingle={template:"#tmpl-wpuf-form-entry-single",mixins:[weForms.mixins.Loading,weForms.mixins.Cookie],data:function(){return{loading:!1,hideEmpty:!0,hasEmpty:!1,show_payment_data:!1,entry:{form_fields:{},meta_data:{},payment_data:{}},form_settings:{},respondent_points:0,answers:{},countries:weForms.countries}},created:function(){this.hideEmpty=this.hideEmptyStatus(),this.fetchData()},computed:{hasFormFields:function(){return Object.keys(this.entry.form_fields).length}},methods:{fetchData:function(){var t=this;this.loading=!0,wp.ajax.send("weforms_form_entry_details",{data:{entry_id:t.$route.params.entryid,form_id:t.$route.params.id,_wpnonce:weForms.nonce},success:function(e){t.loading=!1,t.entry=e,t.hasEmpty=e.has_empty,t.form_settings=e.form_settings,t.respondent_points=e.respondent_points,t.answers=e.answers},error:function(e){t.loading=!1,alert(e)}})},trashEntry:function(){var t=this;confirm(weForms.confirm)&&wp.ajax.send("weforms_form_entry_trash",{data:{entry_id:t.$route.params.entryid,_wpnonce:weForms.nonce},success:function(){t.loading=!1,t.$router.push({name:"formEntries",params:{id:t.$route.params.id}})},error:function(e){t.loading=!1,alert(e)}})},hideEmptyStatus:function(){return"false"!==this.getCookie("weFormsEntryHideEmpty")},findCountry:function(t){return this.countries.find(function(e){return e.code===t})},getCountryName:function(e){if(this.findCountry(e))return this.findCountry(e).name},getAddressFieldValue:function(e){var t=e.match(/Country Select:(\s([A-Z])\w+)/g);if(null===t)return e;var n=t[0].substring(15,t[0].length).trim(),o=this.getCountryName(n),i=n;return e.replace(i,o)}},watch:{hideEmpty:function(e){this.setCookie("weFormsEntryHideEmpty",e,356)}}},Vue.component("form-list-table",{template:"#tmpl-wpuf-form-list-table",mixins:[weForms.mixins.Loading,weForms.mixins.Paginate,weForms.mixins.BulkAction],data:function(){return{loading:!1,index:"ID",items:[],bulkDeleteAction:"weforms_form_delete_bulk"}},created:function(){this.fetchData()},computed:{is_pro:function(){return"true"===weForms.is_pro},has_payment:function(){return"true"===weForms.has_payment}},methods:{fetchData:function(){var t=this;this.loading=!0,wp.ajax.send("weforms_form_list",{data:{_wpnonce:weForms.nonce,page:t.currentPage},success:function(e){t.loading=!1,t.items=e.forms,t.totalItems=e.meta.total,t.totalPage=e.meta.pages},error:function(e){t.loading=!1,alert(e)}})},deleteForm:function(t){var n=this;confirm("Are you sure?")&&(n.loading=!0,wp.ajax.send("weforms_form_delete",{data:{form_id:this.items[t].id,_wpnonce:weForms.nonce},success:function(e){n.items.splice(t,1),n.loading=!1},error:function(e){alert(e),n.loading=!1}}))},duplicate:function(e,t){var n=this;this.loading=!0,wp.ajax.send("weforms_form_duplicate",{data:{form_id:e,_wpnonce:weForms.nonce},success:function(e){n.items.splice(0,0,e),n.loading=!1},error:function(e){alert(e),n.loading=!1}})},handleBulkAction:function(){if("-1"!==this.bulkAction){if("delete"===this.bulkAction){if(!this.checkedItems.length)return void alert("Please select atleast one form to delete.");confirm("Are you sure to delete the forms?")&&this.deleteBulk()}}else alert("Please chose a bulk action to perform")},isPendingForm:function(e){return Math.round((new Date).getTime()/1e3)<Math.round(new Date(e).getTime()/1e3)},isExpiredForm:function(e){var t=Math.round((new Date).getTime()/1e3);return Math.round(new Date(e).getTime()/1e3)<t},isOpenForm:function(e,t){var n=Math.round((new Date).getTime()/1e3),o=Math.round(new Date(e).getTime()/1e3),i=Math.round(new Date(t).getTime()/1e3);return o<n&&n<i},isFormStatusClosed:function(e,t){return!("true"!==e.schedule_form||!this.isPendingForm(e.schedule_start))||(!("true"!==e.schedule_form||!this.isExpiredForm(e.schedule_end))||("true"===e.limit_entries&&t>=e.limit_number||void 0))},formatTime:function(e){var t=new Date(e);return t.toLocaleString("en-us",{month:"short"})+" "+t.getDate()+", "+t.getFullYear()}}}),weForms.routeComponents.FormPayments={props:{id:[String,Number]},template:"#tmpl-wpuf-form-payments",data:function(){return{form_title:"Loading..."}}},weForms.routeComponents.Home={template:"#tmpl-wpuf-home-page",data:function(){return{showTemplateModal:!1}},methods:{displayModal:function(){this.showTemplateModal=!0},closeModal:function(){this.showTemplateModal=!1}}},weForms.routeComponents.Tools={template:"#tmpl-wpuf-tools",mixins:[weForms.mixins.Tabs,weForms.mixins.Loading],data:function(){return{activeTab:"export",exportType:"all",loading:!1,forms:[],importButton:"Import",currentStatus:0,responseMessage:"",logs:[],ximport:{current:"",title:"",action:"",message:"",type:"updated",refs:{}}}},computed:{isInitial:function(){return 0===this.currentStatus},isSaving:function(){return 1===this.currentStatus},isSuccess:function(){return 2===this.currentStatus},isFailed:function(){return 3===this.currentStatus},hasRefs:function(){return Object.keys(this.ximport.refs).length},hasLogs:function(){return Object.keys(this.logs).length}},created:function(){this.fetchData(),this.fetchLogs()},methods:{fetchLogs:function(t){var n=this;n.startLoading(t),wp.ajax.send("weforms_read_logs",{data:{_wpnonce:weForms.nonce},success:function(e){n.stopLoading(t),n.logs=e},error:function(){n.stopLoading(t),n.logs=[]}})},deleteLogs:function(t){var n=this;confirm("Are you sure to clear the log file?")&&(n.startLoading(t),wp.ajax.send("weforms_delete_logs",{data:{_wpnonce:weForms.nonce},success:function(e){n.logs=[],n.stopLoading(t),n.fetchLogs()},error:function(e){n.logs=[],n.stopLoading(t),n.fetchLogs()}}))},stopLoading:function(e){(e=s(e)).is("button")?e.removeClass("updating-message").find("span").show():e.is("span")&&e.show().parent().removeClass("updating-message")},startLoading:function(e){(e=s(e)).is("button")?e.addClass("updating-message").find("span").hide():e.is("span")&&e.hide().parent().addClass("updating-message")},fetchData:function(){var t=this;this.loading=!0,wp.ajax.send("weforms_form_names",{data:{_wpnonce:weForms.nonce},success:function(e){t.loading=!1,t.forms=e},error:function(e){t.loading=!1,alert(e)}})},importForm:function(e,t,n){if(t.length){var o=new FormData,i=this;o.append(e,t[0],t[0].name),o.append("action","weforms_import_form"),o.append("_wpnonce",weForms.nonce),i.currentStatus=1,s.ajax({type:"POST",url:window.ajaxurl,data:o,processData:!1,contentType:!1,success:function(e){i.responseMessage=e.data,e.success?i.currentStatus=2:i.currentStatus=3,s(n.target).val("")},error:function(e){console.log(e),i.currentStatus=3},complete:function(){s(n.target).val("")}})}},importx:function(e,t){var n=s(e),o=this;o.ximport.current=t,n.addClass("updating-message").text(n.data("importing")),wp.ajax.send("weforms_import_xforms_"+t,{data:{_wpnonce:weForms.nonce},success:function(e){o.ximport.title=e.title,o.ximport.message=e.message,o.ximport.action=e.action,o.ximport.refs=e.refs},error:function(e){alert(e.message)},complete:function(){n.removeClass("updating-message").text(n.data("original"))}})},replaceX:function(e,t){var n=s(e),o=this;n.addClass("updating-message"),wp.ajax.send("weforms_import_xreplace_"+o.ximport.current,{data:{type:t,_wpnonce:weForms.nonce},success:function(e){"replace"===n.data("type")&&alert(e)},error:function(e){alert(e)},complete:function(){o.ximport.current="",o.ximport.title=""}})}}},weForms.routeComponents.Transactions={template:"#tmpl-wpuf-transactions",data:function(){return{selected:0,no_transactions:!1,forms:{},form_title:"Loading..."}},created:function(){this.get_forms()},methods:{get_forms:function(){var t=this;wp.ajax.send("weforms_form_list",{data:{_wpnonce:weForms.nonce,page:t.currentPage,filter:"transactions"},success:function(e){Object.keys(e.forms).length?(t.forms=e.forms,t.selected=t.forms[Object.keys(t.forms)[0]].id):(t.form_title="No transaction found",t.no_transactions=!0)},error:function(e){alert(e)}})}}},weForms.routeComponents.Help={template:"#tmpl-wpuf-weforms-page-help"},weForms.routeComponents.Privacy={template:"#tmpl-wpuf-weforms-page-privacy"},weForms.routeComponents.Premium={template:"#tmpl-wpuf-weforms-premium",data:function(){return{showModal:!1}}},weForms.routeComponents.Settings={template:"#tmpl-wpuf-weforms-settings",mixins:[weForms.mixins.Loading,weForms.mixins.Cookie],data:function(){return{loading:!1,settings:{email_gateway:"wordpress",credit:!1,permission:"manage_options",gateways:{sendgrid:"",mailgun:"",sparkpost:""},recaptcha:{type:"v2",key:"",secret:""}},activeTab:"general"}},computed:{is_pro:function(){return"true"===weForms.is_pro}},created:function(){this.fetchSettings(),this.getCookie("weforms_settings_active_tab")&&(this.activeTab=this.getCookie("weforms_settings_active_tab"))},methods:{makeActive:function(e){this.activeTab=e},isActiveTab:function(e){return this.activeTab===e},fetchSettings:function(){var e=this;e.loading=!0,wp.ajax.send("weforms_get_settings",{data:{_wpnonce:weForms.nonce},success:function(n){void 0!==n&&(s.each(e.settings,function(e,t){void 0===n[e]&&(n[e]=t)}),e.settings=n)},complete:function(){e.loading=!1}})},saveSettings:function(e){s(e).addClass("updating-message"),wp.ajax.send("weforms_save_settings",{data:{settings:JSON.stringify(this.settings),_wpnonce:weForms.nonce},success:function(e){toastr.options.timeOut=1e3,toastr.success("Settings has been updated"),weForms.settings=e},error:function(e){console.log(e)},complete:function(){s(e).removeClass("updating-message")}})},post:function(e,t,n){n=n||function(){},(t=t||{})._wpnonce=weForms.nonce,wp.ajax.send(e,{data:t,success:function(e){n(e)},error:function(e){console.log(e)},complete:function(){}})}},watch:{activeTab:function(e){this.setCookie("weforms_settings_active_tab",e,"365")}}},Array.prototype.hasOwnProperty("swap")||(Array.prototype.swap=function(e,t){this.splice(t,0,this.splice(e,1)[0])}),Vue.component("datepicker",{template:'<input type="text" v-bind:value="value" />',props:["value"],mounted:function(){s(this.$el).datetimepicker({dateFormat:"yy-mm-dd",timeFormat:"HH:mm:ss",onClose:this.onClose})},methods:{onClose:function(e){this.$emit("input",e)}}}),Vue.component("weforms-colorpicker",{template:'<input type="text" v-bind:value="value" />',props:["value"],mounted:function(){s(this.$el).wpColorPicker({change:this.onChange})},methods:{onChange:function(e,t){this.$emit("input",t.color.toString())}}});var e=new Vuex.Store({state:{post:{},form_fields:[],panel_sections:wpuf_form_builder.panel_sections,field_settings:wpuf_form_builder.field_settings,notifications:[],settings:{},integrations:{},current_panel:"form-fields",editing_field_id:0},mutations:{set_form_fields:function(e,t){Vue.set(e,"form_fields",t)},set_form_post:function(e,t){Vue.set(e,"post",t)},set_form_notification:function(e,t){Vue.set(e,"notifications",t)},set_form_integrations:function(e,t){Vue.set(e,"integrations",t)},set_form_settings:function(e,t){Vue.set(e,"settings",t)},set_current_panel:function(e,t){"field-options"!==e.current_panel&&"field-options"===t&&e.form_fields.length&&(e.editing_field_id=e.form_fields[0].id),"form-fields"===(e.current_panel=t)&&(e.editing_field_id=0)},panel_add_show_prop:function(n){n.panel_sections.map(function(e,t){e.hasOwnProperty("show")||Vue.set(n.panel_sections[t],"show",!0)})},panel_toggle:function(e,t){e.panel_sections[t].show=!e.panel_sections[t].show},open_field_settings:function(e,t){var n=e.form_fields.filter(function(e){return parseInt(t)===parseInt(e.id)});"field-options"===e.current_panel&&n[0].id===e.editing_field_id||n.length&&(e.editing_field_id=0,e.current_panel="field-options",setTimeout(function(){e.editing_field_id=n[0].id},400))},update_editing_form_field:function(e,t){var n=0;for(n=0;n<e.form_fields.length;n++)if(e.form_fields[n].id===parseInt(t.editing_field_id)&&(e.form_fields[n][t.field_name]=t.value),"column_field"===e.form_fields[n].template){var o=e.form_fields[n].inner_fields;for(var i in o)if(o.hasOwnProperty(i))for(var r=0;r<o[i].length;)o[i][r].id===parseInt(t.editing_field_id)&&(o[i][r][t.field_name]=t.value),r++}},add_form_field_element:function(e,t){e.form_fields.splice(t.toIndex,0,t.field),Vue.nextTick(function(){var e=s("#form-preview-stage .wpuf-form .field-items").eq(t.toIndex);e&&!function(e){"function"==typeof jQuery&&e instanceof jQuery&&(e=e[0]);var t=e.getBoundingClientRect();return 0<=t.top&&0<=t.left&&t.bottom<=(window.innerHeight||document.documentElement.clientHeight)&&t.right<=(window.innerWidth||document.documentElement.clientWidth)}(e.get(0))&&s("#builder-stage section").scrollTo(e,800,{offset:-50})})},swap_form_field_elements:function(e,t){e.form_fields.swap(t.fromIndex,t.toIndex)},clone_form_field_element:function(e,t){var n=_.find(e.form_fields,function(e){return parseInt(e.id)===parseInt(t.field_id)}),o=s.extend(!0,{},n),i=parseInt(t.index)+1;o.id=t.new_id,o.name=o.name+"_copy",o.is_new=!0,e.form_fields.splice(i,0,o)},delete_form_field_element:function(e,t){e.current_panel="form-fields",e.form_fields.splice(t,1)},set_panel_section_fields:function(e,t){_.find(e.panel_sections,function(e){return e.id===t.id}).fields=t.fields},addNotification:function(e,t){e.notifications.push(_.clone(t))},deleteNotification:function(e,t){e.notifications.splice(t,1)},cloneNotification:function(e,t){var n=s.extend(!0,{},e.notifications[t]);t=parseInt(t)+1,e.notifications.splice(t,0,n)},updateNotificationProperty:function(e,t){e.notifications[t.index][t.property]=t.value},updateNotification:function(e,t){e.notifications[t.index]=t.value},updateIntegration:function(e,t){Vue.set(e.integrations,t.index,t.value)},add_column_inner_field_element:function(e,t){var n=e.form_fields.findIndex(function(e){return e.id===t.toWhichColumnField});(void 0===e.form_fields[n].inner_fields[t.toWhichColumn]&&(e.form_fields[n].inner_fields[t.toWhichColumn]=[]),void 0!==e.form_fields[n].inner_fields[t.toWhichColumn])&&(e.form_fields[n].inner_fields[t.toWhichColumn].filter(function(e){return e.name===t.field.name}).length<=0&&e.form_fields[n].inner_fields[t.toWhichColumn].splice(t.toIndex,0,t.field))},move_column_inner_fields:function(t,n){var o=t.form_fields.findIndex(function(e){return e.id===n.field_id}),i=n.inner_fields,r=[];Object.keys(i).forEach(function(e){"column-1"===n.move_to&&(i[e].forEach(function(e){r.push(e)}),t.form_fields[o].inner_fields[e].splice(0,i[e].length)),"column-2"===n.move_to&&("column-2"!==e&&"column-3"!==e||(i[e].forEach(function(e){r.push(e)}),t.form_fields[o].inner_fields[e].splice(0,i[e].length)))}),0!==r.length&&r.forEach(function(e){t.form_fields[o].inner_fields[n.move_to].splice(0,0,e)})},swap_column_field_elements:function(e,t){var n=e.form_fields.findIndex(function(e){return e.id===t.field_id}),o=e.form_fields[n].inner_fields[t.fromColumn][t.fromIndex];t.fromColumn!==t.toColumn?(e.form_fields[n].inner_fields[t.toColumn].splice(t.toIndex,0,o),e.form_fields[n].inner_fields[t.fromColumn].splice(t.fromIndex,1)):e.form_fields[n].inner_fields[t.toColumn].swap(t.fromIndex,t.toIndex)},open_column_field_settings:function(e,t){var n=t.column_field;"field-options"===e.current_panel&&n.id===e.editing_field_id||n&&(e.editing_field_id=0,e.current_panel="field-options",e.editing_field_type="column_field",e.editing_column_field_id=t.field_id,e.edting_field_column=t.column,e.editing_inner_field_index=t.index,setTimeout(function(){e.editing_field_id=n.id},400))},clone_column_field_element:function(e,t){var n=e.form_fields.findIndex(function(e){return e.id===t.field_id}),o=_.find(e.form_fields[n].inner_fields[t.toColumn],function(e){return parseInt(e.id)===parseInt(t.column_field_id)}),i=s.extend(!0,{},o),r=parseInt(t.index)+1;i.id=t.new_id,i.name=i.name+"_copy",i.is_new=!0,e.form_fields[n].inner_fields[t.toColumn].splice(r,0,i)},delete_column_field_element:function(e,t){var n=e.form_fields.findIndex(function(e){return e.id===t.field_id});e.current_panel="form-fields",e.form_fields[n].inner_fields[t.fromColumn].splice(t.index,1)}}});weForms.routeComponents.FormHome={template:'<div><router-view class="child"></router-view></div>'},weForms.routeComponents.SingleForm={template:"#tmpl-wpuf-form-editor"},weForms.routeComponents.FormEntriesHome={template:'<div><router-view class="grand-child"></router-view></div>'},function e(t){for(var n=0;n<t.length;n++)"object"===_typeof(t[n].children)?(e(t[n].children),void 0!==t[n].component&&(t[n].component=weForms.routeComponents[t[n].component])):t[n].component=weForms.routeComponents[t[n].component]}(weForms.routes);var t=new VueRouter({routes:weForms.routes,scrollBehavior:function(e,t,n){return n||{x:0,y:0}}});window.weFormsBuilderisDirty=!1,t.beforeEach(function(e,t,n){if(window.weFormsBuilderisDirty){if(!confirm(wpuf_form_builder.i18n.unsaved_changes+" "+wpuf_form_builder.i18n.areYouSureToLeave))return n(t.path),!1;window.weFormsBuilderisDirty=!1}n()}),weForms.validators={is_recaptcha_v2:function(){return"v2"===weForms.settings.recaptcha.type}};new Vue({router:t,store:e}).$mount("#wpuf-contact-form-app");var o=s("#toplevel_page_weforms");o.on("click","a",function(){var e=s(this);s("ul.wp-submenu li",o).removeClass("current"),e.hasClass("wp-has-submenu")?s("li.wp-first-item",o).addClass("current"):e.parents("li").addClass("current")}),s(function(){var e=window.location.href,n=e.substr(e.indexOf("admin.php"));s("ul.wp-submenu a",o).each(function(e,t){s(t).attr("href")!==n||s(t).parent().addClass("current")})})}(jQuery);
     1"use strict";var _typeof11="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},_typeof10="function"==typeof Symbol&&"symbol"===_typeof11(Symbol.iterator)?function(t){return void 0===t?"undefined":_typeof11(t)}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":void 0===t?"undefined":_typeof11(t)},_typeof9="function"==typeof Symbol&&"symbol"===_typeof10(Symbol.iterator)?function(t){return void 0===t?"undefined":_typeof10(t)}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":void 0===t?"undefined":_typeof10(t)},_typeof8="function"==typeof Symbol&&"symbol"===_typeof9(Symbol.iterator)?function(t){return void 0===t?"undefined":_typeof9(t)}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":void 0===t?"undefined":_typeof9(t)},_typeof7="function"==typeof Symbol&&"symbol"===_typeof8(Symbol.iterator)?function(t){return void 0===t?"undefined":_typeof8(t)}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":void 0===t?"undefined":_typeof8(t)},_typeof6="function"==typeof Symbol&&"symbol"===_typeof7(Symbol.iterator)?function(t){return void 0===t?"undefined":_typeof7(t)}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":void 0===t?"undefined":_typeof7(t)},_typeof5="function"==typeof Symbol&&"symbol"===_typeof6(Symbol.iterator)?function(t){return void 0===t?"undefined":_typeof6(t)}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":void 0===t?"undefined":_typeof6(t)},_typeof4="function"==typeof Symbol&&"symbol"===_typeof5(Symbol.iterator)?function(t){return void 0===t?"undefined":_typeof5(t)}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":void 0===t?"undefined":_typeof5(t)},_typeof3="function"==typeof Symbol&&"symbol"===_typeof4(Symbol.iterator)?function(t){return void 0===t?"undefined":_typeof4(t)}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":void 0===t?"undefined":_typeof4(t)},_typeof2="function"==typeof Symbol&&"symbol"===_typeof3(Symbol.iterator)?function(t){return void 0===t?"undefined":_typeof3(t)}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":void 0===t?"undefined":_typeof3(t)},_typeof="function"==typeof Symbol&&"symbol"===_typeof2(Symbol.iterator)?function(t){return void 0===t?"undefined":_typeof2(t)}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":void 0===t?"undefined":_typeof2(t)};!function(s){Vue.component("wpuf-table",{template:"#tmpl-wpuf-component-table",mixins:[weForms.mixins.Loading,weForms.mixins.Paginate,weForms.mixins.BulkAction],props:{has_export:String,action:String,delete:String,id:[String,Number],status:[String]},data:function(){return{loading:!1,columns:[],items:[],ajaxAction:this.action,nonce:weForms.nonce,index:"id",bulkDeleteAction:this.delete?this.delete:"weforms_form_entry_trash_bulk"}},created:function(){this.fetchData()},computed:{columnLength:function(){return Object.keys(this.columns).length}},methods:{fetchData:function(){var e=this;this.loading=!0,wp.ajax.send(e.action,{data:{id:e.id,page:e.currentPage,status:e.status,_wpnonce:weForms.nonce},success:function(t){e.loading=!1,e.columns=t.columns,e.items=t.entries,e.form_title=t.form_title,e.totalItems=t.pagination.total,e.perPage=t.pagination.per_page,e.totalPage=t.pagination.pages,e.$emit("ajaxsuccess",t)},error:function(t){e.loading=!1,alert(t)}})},handleBulkAction:function(){if("-1"!==this.bulkAction){if("delete"===this.bulkAction){if(!this.checkedItems.length)return void alert("Please select atleast one entry to delete.");confirm("Are you sure to delete the entries?")&&this.deleteBulk()}if("restore"===this.bulkAction){if(!this.checkedItems.length)return void alert("Please select atleast one entry to restore.");this.restoreBulk()}}else alert("Please chose a bulk action to perform")},restore:function(t){var e=this;e.loading=!0,wp.ajax.send("weforms_form_entry_restore",{data:{entry_id:t,_wpnonce:weForms.nonce},success:function(t){e.loading=!1,e.fetchData()},error:function(t){e.loading=!1,alert(t)}})},deletePermanently:function(t){if(confirm("Are you sure to delete this entry?")){var e=this;e.loading=!0,wp.ajax.send("weforms_form_entry_delete",{data:{entry_id:t,_wpnonce:weForms.nonce},success:function(t){e.loading=!1,e.fetchData()},error:function(t){e.loading=!1,alert(t)}})}}},watch:{id:function(){this.fetchData()},status:function(){this.currentPage=1,this.bulkAction=-1,this.fetchData()}}}),weForms.routeComponents.Entries={template:"#tmpl-wpuf-entries",data:function(){return{selected:0,forms:{},form_title:"Loading...",status:"publish",total:0,totalTrash:0}},created:function(){this.get_forms()},methods:{get_forms:function(){var e=this;wp.ajax.send("weforms_form_list",{data:{_wpnonce:weForms.nonce,page:e.currentPage,posts_per_page:-1,filter:"entries"},success:function(t){Object.keys(t.forms).length?(e.forms=t.forms,e.selected=e.forms[Object.keys(e.forms)[0]].id):e.form_title="No entry found"},error:function(t){alert(t)}})}}},weForms.routeComponents.FormEditComponent={template:"#tmpl-wpuf-form-builder",mixins:wpuf_form_builder_mixins(wpuf_mixins.root),data:function(){return{is_form_saving:!1,is_form_saved:!1,is_form_switcher:!1,post_title_editing:!1,loading:!1,activeTab:"editor",activeSettingsTab:"form",activePaymentTab:"paypal"}},watch:{loading:function(t){t?(NProgress.configure({parent:"#wpadminbar"}),NProgress.start()):NProgress.done()},form_fields:{handler:function(){window.weFormsBuilderisDirty=!0},deep:!0},notifications:{handler:function(){window.weFormsBuilderisDirty=!0},deep:!0},integrations:{handler:function(){window.weFormsBuilderisDirty=!0},deep:!0},settings:{handler:function(){window.weFormsBuilderisDirty=!0},deep:!0},payment:{handler:function(){window.weFormsBuilderisDirty=!0},deep:!0}},created:function(){this.set_current_panel("form-fields"),this.fetchForm(),this.$store.commit("panel_add_show_prop"),wpuf_form_builder.event_hub=new Vue},computed:{current_panel:function(){return this.$store.state.current_panel},post:function(){return this.$store.state.post},form_fields_count:function(){return this.$store.state.form_fields.length},form_fields:function(){return this.$store.state.form_fields},notifications:function(){return this.$store.state.notifications},integrations:function(){return this.$store.state.integrations},settings:function(){return this.$store.state.settings},payment:function(){return this.$store.state.payment}},mounted:function(){var t=new window.Clipboard(".form-id");s(".form-id").tooltip();var e=this;this.started=!0,t.on("success",function(t){s(t.trigger).attr("data-original-title","Copied!").tooltip("show"),setTimeout(function(){s(t.trigger).tooltip("hide").attr("data-original-title",e.i18n.copy_shortcode)},1e3),t.clearSelection()}),this.initSharingClipBoard(),setTimeout(function(){window.weFormsBuilderisDirty=!1},500),window.onbeforeunload=function(){if(window.weFormsBuilderisDirty)return e.i18n.unsaved_changes}},methods:{makeActive:function(t){this.activeTab=t},isActiveTab:function(t){return this.activeTab===t},isActiveSettingsTab:function(t){return this.activeSettingsTab===t},makeActiveSettingsTab:function(t){this.activeSettingsTab=t},isActivePaymentTab:function(t){return this.activePaymentTab===t},makeActivePaymentTab:function(t){this.activePaymentTab=t},fetchForm:function(){var e=this;e.loading=!0,wp.ajax.send("weforms_get_form",{data:{form_id:this.$route.params.id,_wpnonce:weForms.nonce},success:function(t){e.$store.commit("set_form_post",t.post),e.$store.commit("set_form_fields",t.form_fields),e.$store.commit("set_form_notification",t.notifications),e.$store.commit("set_form_settings",t.settings),void 0!==t.integrations.length?e.$store.commit("set_form_integrations",{}):e.$store.commit("set_form_integrations",t.integrations)},error:function(t){alert(t)},complete:function(){e.loading=!1}})},set_current_panel:function(t){this.$store.commit("set_current_panel",t)},save_form_builder:function(){var e=this;!_.isFunction(this.validate_form_before_submit)||this.validate_form_before_submit()?(e.is_form_saving=!0,e.set_current_panel("form-fields"),wp.ajax.send("wpuf_form_builder_save_form",{data:{form_data:s("#wpuf-form-builder").serialize(),form_fields:JSON.stringify(e.form_fields),notifications:JSON.stringify(e.notifications),settings:JSON.stringify(e.settings),payment:JSON.stringify(e.payment),integrations:JSON.stringify(e.integrations)},success:function(t){t.form_fields&&e.$store.commit("set_form_fields",t.form_fields),e.is_form_saving=!1,e.is_form_saved=!0,setTimeout(function(){window.weFormsBuilderisDirty=!1},500),toastr.success(e.i18n.saved_form_data)},error:function(){e.is_form_saving=!1}})):this.warn({text:this.validation_error_msg})},save_settings:function(){toastr.options.preventDuplicates=!0,this.save_form_builder()},shareForm:function(t,e){var n=this;if("on"===n.settings.sharing_on){var o=t+"?weforms="+btoa(n.getSharingHash()+"_"+Math.floor(Date.now()/1e3)+"_"+e.ID);swal({title:n.i18n.shareYourForm,html:"<p>"+n.i18n.shareYourFormText+'</p> <p><input onClick="this.setSelectionRange(0, this.value.length)" type="text" class="regular-text" value="'+o+'"/> <button class="anonymous-share-btn button button-primary" title="Copy URL" data-clipboard-text="'+o+'"><i class="fa fa-clipboard" aria-hidden="true"></i></button></p>',showCloseButton:!0,showCancelButton:!0,confirmButtonClass:"btn btn-success",cancelButtonClass:"btn btn-danger",confirmButtonColor:"#d54e21",confirmButtonText:n.i18n.disableSharing,cancelButtonText:n.i18n.close,focusCancel:!0}).then(function(){swal({title:n.i18n.areYouSure,html:"<p>"+n.i18n.areYouSureDesc+"</p>",type:"info",confirmButtonColor:"#d54e21",showCancelButton:!0,confirmButtonText:n.i18n.disable,cancelButtonText:n.i18n.cancel}).then(function(){n.disableSharing()})})}else swal({title:n.i18n.shareYourForm,html:n.i18n.shareYourFormDesc,type:"info",showCancelButton:!0,confirmButtonText:"Enable",cancelButtonText:"Cancel"}).then(function(){n.enableSharing(t,e)})},enableSharing:function(t,e){this.settings.sharing_on="on",this.save_settings(),this.shareForm(t,e)},disableSharing:function(){this.settings.sharing_on=!1,this.save_settings()},getSharingHash:function(){return this.settings.sharing_hash||(this.settings.sharing_hash=this.makeRandomString(8),this.save_settings()),this.settings.sharing_hash},makeRandomString:function(t){t=t||8;for(var e="",n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",o=0;o<t;o++)e+=n.charAt(Math.floor(Math.random()*n.length));return e},initSharingClipBoard:function(t){var e=new window.Clipboard(".anonymous-share-btn");s(".anonymous-share-btn").tooltip(),e.on("success",function(t){s(t.trigger).attr("data-original-title","Copied!").tooltip("show"),setTimeout(function(){s(t.trigger).tooltip("hide").attr("data-original-title","Copy URL")},1e3),t.clearSelection()})}}},weForms.routeComponents.FormEntries={props:{id:[String,Number]},template:"#tmpl-wpuf-form-entries",data:function(){return{selected:0,form_title:"Loading...",status:"publish",total:0,totalTrash:0}}},weForms.routeComponents.FormEntriesSingle={template:"#tmpl-wpuf-form-entry-single",mixins:[weForms.mixins.Loading,weForms.mixins.Cookie],data:function(){return{loading:!1,hideEmpty:!0,hasEmpty:!1,show_payment_data:!1,entry:{form_fields:{},meta_data:{},payment_data:{}},form_settings:{},respondent_points:0,answers:{},countries:weForms.countries}},created:function(){this.hideEmpty=this.hideEmptyStatus(),this.fetchData()},computed:{hasFormFields:function(){return Object.keys(this.entry.form_fields).length}},methods:{fetchData:function(){var e=this;this.loading=!0,wp.ajax.send("weforms_form_entry_details",{data:{entry_id:e.$route.params.entryid,form_id:e.$route.params.id,_wpnonce:weForms.nonce},success:function(t){e.loading=!1,e.entry=t,e.hasEmpty=t.has_empty,e.form_settings=t.form_settings,e.respondent_points=t.respondent_points,e.answers=t.answers},error:function(t){e.loading=!1,alert(t)}})},trashEntry:function(){var e=this;confirm(weForms.confirm)&&wp.ajax.send("weforms_form_entry_trash",{data:{entry_id:e.$route.params.entryid,_wpnonce:weForms.nonce},success:function(){e.loading=!1,e.$router.push({name:"formEntries",params:{id:e.$route.params.id}})},error:function(t){e.loading=!1,alert(t)}})},hideEmptyStatus:function(){return"false"!==this.getCookie("weFormsEntryHideEmpty")},findCountry:function(e){return this.countries.find(function(t){return t.code===e})},getCountryName:function(t){if(this.findCountry(t))return this.findCountry(t).name},getAddressFieldValue:function(t){var e=t.match(/Country Select:(\s([A-Z])\w+)/g);if(null===e)return t;var n=e[0].substring(15,e[0].length).trim(),o=this.getCountryName(n),i=n;return t.replace(i,o)}},watch:{hideEmpty:function(t){this.setCookie("weFormsEntryHideEmpty",t,356)}}},Vue.component("form-list-table",{template:"#tmpl-wpuf-form-list-table",mixins:[weForms.mixins.Loading,weForms.mixins.Paginate,weForms.mixins.BulkAction],data:function(){return{loading:!1,index:"ID",items:[],bulkDeleteAction:"weforms_form_delete_bulk"}},created:function(){this.fetchData()},computed:{is_pro:function(){return"true"===weForms.is_pro},has_payment:function(){return"true"===weForms.has_payment}},methods:{fetchData:function(){var e=this;this.loading=!0,wp.ajax.send("weforms_form_list",{data:{_wpnonce:weForms.nonce,page:e.currentPage},success:function(t){e.loading=!1,e.items=t.forms,e.totalItems=t.meta.total,e.totalPage=t.meta.pages},error:function(t){e.loading=!1,alert(t)}})},deleteForm:function(e){var n=this;confirm("Are you sure?")&&(n.loading=!0,wp.ajax.send("weforms_form_delete",{data:{form_id:this.items[e].id,_wpnonce:weForms.nonce},success:function(t){n.items.splice(e,1),n.loading=!1},error:function(t){alert(t),n.loading=!1}}))},duplicate:function(t,e){var n=this;this.loading=!0,wp.ajax.send("weforms_form_duplicate",{data:{form_id:t,_wpnonce:weForms.nonce},success:function(t){n.items.splice(0,0,t),n.loading=!1},error:function(t){alert(t),n.loading=!1}})},handleBulkAction:function(){if("-1"!==this.bulkAction){if("delete"===this.bulkAction){if(!this.checkedItems.length)return void alert("Please select atleast one form to delete.");confirm("Are you sure to delete the forms?")&&this.deleteBulk()}}else alert("Please chose a bulk action to perform")},isPendingForm:function(t){return Math.round((new Date).getTime()/1e3)<Math.round(new Date(t).getTime()/1e3)},isExpiredForm:function(t){var e=Math.round((new Date).getTime()/1e3);return Math.round(new Date(t).getTime()/1e3)<e},isOpenForm:function(t,e){var n=Math.round((new Date).getTime()/1e3),o=Math.round(new Date(t).getTime()/1e3),i=Math.round(new Date(e).getTime()/1e3);return o<n&&n<i},isFormStatusClosed:function(t,e){return!("true"!==t.schedule_form||!this.isPendingForm(t.schedule_start))||(!("true"!==t.schedule_form||!this.isExpiredForm(t.schedule_end))||("true"===t.limit_entries&&e>=t.limit_number||void 0))},formatTime:function(t){var e=new Date(t);return e.toLocaleString("en-us",{month:"short"})+" "+e.getDate()+", "+e.getFullYear()}}}),weForms.routeComponents.FormPayments={props:{id:[String,Number]},template:"#tmpl-wpuf-form-payments",data:function(){return{form_title:"Loading..."}}},weForms.routeComponents.Home={template:"#tmpl-wpuf-home-page",data:function(){return{showTemplateModal:!1}},methods:{displayModal:function(){this.showTemplateModal=!0},closeModal:function(){this.showTemplateModal=!1}}},weForms.routeComponents.Tools={template:"#tmpl-wpuf-tools",mixins:[weForms.mixins.Tabs,weForms.mixins.Loading],data:function(){return{activeTab:"export",exportType:"all",loading:!1,forms:[],importButton:"Import",currentStatus:0,responseMessage:"",logs:[],ximport:{current:"",title:"",action:"",message:"",type:"updated",refs:{}}}},computed:{isInitial:function(){return 0===this.currentStatus},isSaving:function(){return 1===this.currentStatus},isSuccess:function(){return 2===this.currentStatus},isFailed:function(){return 3===this.currentStatus},hasRefs:function(){return Object.keys(this.ximport.refs).length},hasLogs:function(){return Object.keys(this.logs).length}},created:function(){this.fetchData(),this.fetchLogs()},methods:{fetchLogs:function(e){var n=this;n.startLoading(e),wp.ajax.send("weforms_read_logs",{data:{_wpnonce:weForms.nonce},success:function(t){n.stopLoading(e),n.logs=t},error:function(){n.stopLoading(e),n.logs=[]}})},deleteLogs:function(e){var n=this;confirm("Are you sure to clear the log file?")&&(n.startLoading(e),wp.ajax.send("weforms_delete_logs",{data:{_wpnonce:weForms.nonce},success:function(t){n.logs=[],n.stopLoading(e),n.fetchLogs()},error:function(t){n.logs=[],n.stopLoading(e),n.fetchLogs()}}))},stopLoading:function(t){(t=s(t)).is("button")?t.removeClass("updating-message").find("span").show():t.is("span")&&t.show().parent().removeClass("updating-message")},startLoading:function(t){(t=s(t)).is("button")?t.addClass("updating-message").find("span").hide():t.is("span")&&t.hide().parent().addClass("updating-message")},fetchData:function(){var e=this;this.loading=!0,wp.ajax.send("weforms_form_names",{data:{_wpnonce:weForms.nonce},success:function(t){e.loading=!1,e.forms=t},error:function(t){e.loading=!1,alert(t)}})},importForm:function(t,e,n){if(e.length){var o=new FormData,i=this;o.append(t,e[0],e[0].name),o.append("action","weforms_import_form"),o.append("_wpnonce",weForms.nonce),i.currentStatus=1,s.ajax({type:"POST",url:window.ajaxurl,data:o,processData:!1,contentType:!1,success:function(t){i.responseMessage=t.data,t.success?i.currentStatus=2:i.currentStatus=3,s(n.target).val("")},error:function(t){console.log(t),i.currentStatus=3},complete:function(){s(n.target).val("")}})}},importx:function(t,e){var n=s(t),o=this;o.ximport.current=e,n.addClass("updating-message").text(n.data("importing")),wp.ajax.send("weforms_import_xforms_"+e,{data:{_wpnonce:weForms.nonce},success:function(t){o.ximport.title=t.title,o.ximport.message=t.message,o.ximport.action=t.action,o.ximport.refs=t.refs},error:function(t){alert(t.message)},complete:function(){n.removeClass("updating-message").text(n.data("original"))}})},replaceX:function(t,e){var n=s(t),o=this;n.addClass("updating-message"),wp.ajax.send("weforms_import_xreplace_"+o.ximport.current,{data:{type:e,_wpnonce:weForms.nonce},success:function(t){"replace"===n.data("type")&&alert(t)},error:function(t){alert(t)},complete:function(){o.ximport.current="",o.ximport.title=""}})}}},weForms.routeComponents.Transactions={template:"#tmpl-wpuf-transactions",data:function(){return{selected:0,no_transactions:!1,forms:{},form_title:"Loading..."}},created:function(){this.get_forms()},methods:{get_forms:function(){var e=this;wp.ajax.send("weforms_form_list",{data:{_wpnonce:weForms.nonce,page:e.currentPage,filter:"transactions"},success:function(t){Object.keys(t.forms).length?(e.forms=t.forms,e.selected=e.forms[Object.keys(e.forms)[0]].id):(e.form_title="No transaction found",e.no_transactions=!0)},error:function(t){alert(t)}})}}},weForms.routeComponents.Help={template:"#tmpl-wpuf-weforms-page-help"},weForms.routeComponents.Privacy={template:"#tmpl-wpuf-weforms-page-privacy"},weForms.routeComponents.Premium={template:"#tmpl-wpuf-weforms-premium",data:function(){return{showModal:!1}}},weForms.routeComponents.Settings={template:"#tmpl-wpuf-weforms-settings",mixins:[weForms.mixins.Loading,weForms.mixins.Cookie],data:function(){return{loading:!1,settings:{email_gateway:"wordpress",credit:!1,permission:"manage_options",gateways:{sendgrid:"",mailgun:"",sparkpost:""},recaptcha:{type:"v2",key:"",secret:""}},activeTab:"general"}},computed:{is_pro:function(){return"true"===weForms.is_pro}},created:function(){this.fetchSettings(),this.getCookie("weforms_settings_active_tab")&&(this.activeTab=this.getCookie("weforms_settings_active_tab"))},methods:{makeActive:function(t){this.activeTab=t},isActiveTab:function(t){return this.activeTab===t},fetchSettings:function(){var t=this;t.loading=!0,wp.ajax.send("weforms_get_settings",{data:{_wpnonce:weForms.nonce},success:function(n){void 0!==n&&(s.each(t.settings,function(t,e){void 0===n[t]&&(n[t]=e)}),t.settings=n)},complete:function(){t.loading=!1}})},saveSettings:function(t){s(t).addClass("updating-message"),wp.ajax.send("weforms_save_settings",{data:{settings:JSON.stringify(this.settings),_wpnonce:weForms.nonce},success:function(t){toastr.options.timeOut=1e3,toastr.success("Settings has been updated"),weForms.settings=t},error:function(t){console.log(t)},complete:function(){s(t).removeClass("updating-message")}})},post:function(t,e,n){n=n||function(){},(e=e||{})._wpnonce=weForms.nonce,wp.ajax.send(t,{data:e,success:function(t){n(t)},error:function(t){console.log(t)},complete:function(){}})}},watch:{activeTab:function(t){this.setCookie("weforms_settings_active_tab",t,"365")}}},Array.prototype.hasOwnProperty("swap")||(Array.prototype.swap=function(t,e){this.splice(e,0,this.splice(t,1)[0])}),Vue.component("datepicker",{template:'<input type="text" v-bind:value="value" />',props:["value"],mounted:function(){s(this.$el).datetimepicker({dateFormat:"yy-mm-dd",timeFormat:"HH:mm:ss",onClose:this.onClose})},methods:{onClose:function(t){this.$emit("input",t)}}}),Vue.component("weforms-colorpicker",{template:'<input type="text" v-bind:value="value" />',props:["value"],mounted:function(){s(this.$el).wpColorPicker({change:this.onChange})},methods:{onChange:function(t,e){this.$emit("input",e.color.toString())}}});var t=new Vuex.Store({state:{post:{},form_fields:[],panel_sections:wpuf_form_builder.panel_sections,field_settings:wpuf_form_builder.field_settings,notifications:[],settings:{},integrations:{},current_panel:"form-fields",editing_field_id:0},mutations:{set_form_fields:function(t,e){Vue.set(t,"form_fields",e)},set_form_post:function(t,e){Vue.set(t,"post",e)},set_form_notification:function(t,e){Vue.set(t,"notifications",e)},set_form_integrations:function(t,e){Vue.set(t,"integrations",e)},set_form_settings:function(t,e){Vue.set(t,"settings",e)},set_current_panel:function(t,e){"field-options"!==t.current_panel&&"field-options"===e&&t.form_fields.length&&(t.editing_field_id=t.form_fields[0].id),"form-fields"===(t.current_panel=e)&&(t.editing_field_id=0)},panel_add_show_prop:function(n){n.panel_sections.map(function(t,e){t.hasOwnProperty("show")||Vue.set(n.panel_sections[e],"show",!0)})},panel_toggle:function(t,e){t.panel_sections[e].show=!t.panel_sections[e].show},open_field_settings:function(t,e){var n=t.form_fields.filter(function(t){return parseInt(e)===parseInt(t.id)});"field-options"===t.current_panel&&n[0].id===t.editing_field_id||n.length&&(t.editing_field_id=0,t.current_panel="field-options",setTimeout(function(){t.editing_field_id=n[0].id},400))},update_editing_form_field:function(t,e){var n=0;for(n=0;n<t.form_fields.length;n++)if(t.form_fields[n].id===parseInt(e.editing_field_id)&&(t.form_fields[n][e.field_name]=e.value),"column_field"===t.form_fields[n].template){var o=t.form_fields[n].inner_fields;for(var i in o)if(o.hasOwnProperty(i))for(var r=0;r<o[i].length;)o[i][r].id===parseInt(e.editing_field_id)&&(o[i][r][e.field_name]=e.value),r++}},add_form_field_element:function(t,e){t.form_fields.splice(e.toIndex,0,e.field),Vue.nextTick(function(){var t=s("#form-preview-stage .wpuf-form .field-items").eq(e.toIndex);t&&!function(t){"function"==typeof jQuery&&t instanceof jQuery&&(t=t[0]);var e=t.getBoundingClientRect();return 0<=e.top&&0<=e.left&&e.bottom<=(window.innerHeight||document.documentElement.clientHeight)&&e.right<=(window.innerWidth||document.documentElement.clientWidth)}(t.get(0))&&s("#builder-stage section").scrollTo(t,800,{offset:-50})})},swap_form_field_elements:function(t,e){t.form_fields.swap(e.fromIndex,e.toIndex)},clone_form_field_element:function(t,e){var n=_.find(t.form_fields,function(t){return parseInt(t.id)===parseInt(e.field_id)}),o=s.extend(!0,{},n),i=parseInt(e.index)+1;o.id=e.new_id,o.name=o.name+"_copy",o.is_new=!0,t.form_fields.splice(i,0,o)},delete_form_field_element:function(t,e){t.current_panel="form-fields",t.form_fields.splice(e,1)},set_panel_section_fields:function(t,e){_.find(t.panel_sections,function(t){return t.id===e.id}).fields=e.fields},addNotification:function(t,e){t.notifications.push(_.clone(e))},deleteNotification:function(t,e){t.notifications.splice(e,1)},cloneNotification:function(t,e){var n=s.extend(!0,{},t.notifications[e]);e=parseInt(e)+1,t.notifications.splice(e,0,n)},updateNotificationProperty:function(t,e){t.notifications[e.index][e.property]=e.value},updateNotification:function(t,e){t.notifications[e.index]=e.value},updateIntegration:function(t,e){Vue.set(t.integrations,e.index,e.value)},add_column_inner_field_element:function(t,e){var n=t.form_fields.findIndex(function(t){return t.id===e.toWhichColumnField});(void 0===t.form_fields[n].inner_fields[e.toWhichColumn]&&(t.form_fields[n].inner_fields[e.toWhichColumn]=[]),void 0!==t.form_fields[n].inner_fields[e.toWhichColumn])&&(t.form_fields[n].inner_fields[e.toWhichColumn].filter(function(t){return t.name===e.field.name}).length<=0&&t.form_fields[n].inner_fields[e.toWhichColumn].splice(e.toIndex,0,e.field))},move_column_inner_fields:function(e,n){var o=e.form_fields.findIndex(function(t){return t.id===n.field_id}),i=n.inner_fields,r=[];Object.keys(i).forEach(function(t){"column-1"===n.move_to&&(i[t].forEach(function(t){r.push(t)}),e.form_fields[o].inner_fields[t].splice(0,i[t].length)),"column-2"===n.move_to&&("column-2"!==t&&"column-3"!==t||(i[t].forEach(function(t){r.push(t)}),e.form_fields[o].inner_fields[t].splice(0,i[t].length)))}),0!==r.length&&r.forEach(function(t){e.form_fields[o].inner_fields[n.move_to].splice(0,0,t)})},swap_column_field_elements:function(t,e){var n=t.form_fields.findIndex(function(t){return t.id===e.field_id}),o=t.form_fields[n].inner_fields[e.fromColumn][e.fromIndex];e.fromColumn!==e.toColumn?(t.form_fields[n].inner_fields[e.toColumn].splice(e.toIndex,0,o),t.form_fields[n].inner_fields[e.fromColumn].splice(e.fromIndex,1)):t.form_fields[n].inner_fields[e.toColumn].swap(e.fromIndex,e.toIndex)},open_column_field_settings:function(t,e){var n=e.column_field;"field-options"===t.current_panel&&n.id===t.editing_field_id||n&&(t.editing_field_id=0,t.current_panel="field-options",t.editing_field_type="column_field",t.editing_column_field_id=e.field_id,t.edting_field_column=e.column,t.editing_inner_field_index=e.index,setTimeout(function(){t.editing_field_id=n.id},400))},clone_column_field_element:function(t,e){var n=t.form_fields.findIndex(function(t){return t.id===e.field_id}),o=_.find(t.form_fields[n].inner_fields[e.toColumn],function(t){return parseInt(t.id)===parseInt(e.column_field_id)}),i=s.extend(!0,{},o),r=parseInt(e.index)+1;i.id=e.new_id,i.name=i.name+"_copy",i.is_new=!0,t.form_fields[n].inner_fields[e.toColumn].splice(r,0,i)},delete_column_field_element:function(t,e){var n=t.form_fields.findIndex(function(t){return t.id===e.field_id});t.current_panel="form-fields",t.form_fields[n].inner_fields[e.fromColumn].splice(e.index,1)}}});weForms.routeComponents.FormHome={template:'<div><router-view class="child"></router-view></div>'},weForms.routeComponents.SingleForm={template:"#tmpl-wpuf-form-editor"},weForms.routeComponents.FormEntriesHome={template:'<div><router-view class="grand-child"></router-view></div>'},function t(e){for(var n=0;n<e.length;n++)"object"===_typeof(e[n].children)?(t(e[n].children),void 0!==e[n].component&&(e[n].component=weForms.routeComponents[e[n].component])):e[n].component=weForms.routeComponents[e[n].component]}(weForms.routes);var e=new VueRouter({routes:weForms.routes,scrollBehavior:function(t,e,n){return n||{x:0,y:0}}});window.weFormsBuilderisDirty=!1,e.beforeEach(function(t,e,n){if(window.weFormsBuilderisDirty){if(!confirm(wpuf_form_builder.i18n.unsaved_changes+" "+wpuf_form_builder.i18n.areYouSureToLeave))return n(e.path),!1;window.weFormsBuilderisDirty=!1}n()}),weForms.validators={is_recaptcha_v2:function(){return"v2"===weForms.settings.recaptcha.type}};new Vue({router:e,store:t}).$mount("#wpuf-contact-form-app");var o=s("#toplevel_page_weforms");o.on("click","a",function(){var t=s(this);s("ul.wp-submenu li",o).removeClass("current"),t.hasClass("wp-has-submenu")?s("li.wp-first-item",o).addClass("current"):t.parents("li").addClass("current")}),s(function(){var t=window.location.href,n=t.substr(t.indexOf("admin.php"));s("ul.wp-submenu a",o).each(function(t,e){s(e).attr("href")!==n||s(e).parent().addClass("current")})})}(jQuery);
  • weforms/tags/1.6.6/assets/wpuf/css/wpuf-form-builder.css

    r2403226 r2514969  
    219219  filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#660073aa', endColorstr='#ff0073aa', GradientType=0);
    220220}
     221.fa.fa-humanpresence {
     222  width: 1em;
     223  height: 1em;
     224  background: no-repeat url('images/hp-shield.svg') left top;
     225  background-size: cover;
     226}
    221227#wpuf-form-builder {
    222228  width: calc(100% - 200px);
  • weforms/tags/1.6.6/assets/wpuf/js-templates/form-components.php

    r2403226 r2514969  
    1717            :data-index="index"
    1818            data-source="stage"
     19            v-if="'humanpresence' !== field.template"
    1920        >
    2021            <div v-if="!is_full_width(field.template)" class="wpuf-label">
     
    5960                :class="['field-items', parseInt(editing_form_id) === parseInt(field.id) ? 'current-editing' : '']"
    6061            >
    61                 <strong><?php esc_html_e( 'key', 'wp-user-frontend' ); ?></strong>: {{ field.name }} | <strong><?php esc_html_e( 'value', 'wp-user-frontend' ); ?></strong>: {{ field.meta_value }}
     62                <span v-if="'humanpresence' !== field.template"><strong><?php esc_html_e( 'key', 'wp-user-frontend' ); ?></strong>: {{ field.name }} | <strong><?php esc_html_e( 'value', 'wp-user-frontend' ); ?></strong>: {{ field.meta_value }}</span>
     63
     64                <span v-if="'humanpresence' === field.template"><component v-if="is_template_available(field)" :is="'form-' + field.template" :field="field"></component></span>
    6265
    6366                <div class="control-buttons">
     
    350353    <div v-if="'logged_in' === selected" class="condiotional-logic-container">
    351354
    352         <?php $roles = get_editable_roles(); ?>
    353 
    354         <ul>
    355             <?php
     355        <?php $roles = get_editable_roles(); ?>
     356
     357        <ul>
     358            <?php
    356359                foreach ( $roles as $role => $value ) {
    357360                    $role_name = $value['name'];
     
    364367                }
    365368            ?>
    366         </ul>
     369        </ul>
    367370    </div>
    368371
    369372    <div v-if="'subscribed_users' === selected" class="condiotional-logic-container">
    370373
    371         <ul>
    372             <?php
     374        <ul>
     375            <?php
    373376
    374377                if ( class_exists( 'WPUF_Subscription' ) ) {
     
    388391                }
    389392            ?>
    390         </ul>
     393        </ul>
    391394
    392395    </div>
     
    709712
    710713    <template v-else>
    711         <div v-if="'invisible_recaptcha' != field.recaptcha_type">
    712             <img class="wpuf-recaptcha-placeholder" src="<?php echo WPUF_ASSET_URI . '/images/recaptcha-placeholder.png'; ?>" alt="">
     714        <div v-if="'invisible_recaptcha' != field.recaptcha_type">
     715            <img class="wpuf-recaptcha-placeholder" src="<?php echo WPUF_ASSET_URI . '/images/recaptcha-placeholder.png'; ?>" alt="">
    713716        </div>
    714717        <div v-else><p><?php _e( 'Invisible reCaptcha', 'wp-user-frontend' ); ?></p></div>
     718    </template>
     719</div>
     720</script>
     721
     722<script type="text/x-template" id="tmpl-wpuf-form-humanpresence">
     723<div class="wpuf-fields">
     724    <template v-if="!has_humanpresence_installed">
     725        <p v-html="no_humanpresence_installed_msg"></p>
     726    </template>
     727
     728    <template v-else>
     729        <div><p><i aria-hidden="true" class="fa fa-humanpresence"></i> <?php _e( 'Human Presence Anti-Spam Enabled (only visible to you).', 'wp-user-frontend' ); ?></p></div>
    715730    </template>
    716731</div>
  • weforms/tags/1.6.6/assets/wpuf/js/wpuf-form-builder-components.js

    r2416759 r2514969  
    2020            hidden_fields: function hidden_fields() {
    2121                return this.$store.state.form_fields.filter(function (item) {
    22                     return 'custom_hidden_field' === item.template;
     22                    return 'custom_hidden_field' === item.template || 'humanpresence' === item.template;
    2323                });
    2424            },
     
    3131                return wpuf_form_builder.pro_link;
    3232            }
     33        },
     34
     35        created: function created() {
     36            var self = this,
     37                humanpresence_field_id = 0,
     38                i = 0;
     39            for (i = 0; i < self.$store.state.form_fields.length; i++) {
     40                if (self.$store.state.form_fields[i].template === 'humanpresence') {
     41                    humanpresence_field_id = self.$store.state.form_fields[i].id;
     42                }
     43            }
     44
     45            wpuf_form_builder.event_hub.$on('humanpresence-changed', this.humanpresence_changed);
     46            wpuf_form_builder.event_hub.$on('humanpresence-disabled', this.delete_humanpresence_field);
    3347        },
    3448
     
    154168            },
    155169
     170            delete_field_no_confirm: function delete_field_no_confirm(index) {
     171                this.$store.commit('delete_form_field_element', index);
     172            },
     173
    156174            delete_hidden_field: function delete_hidden_field(field_id) {
    157175                var i = 0;
     
    159177                for (i = 0; i < this.form_fields.length; i++) {
    160178                    if (parseInt(field_id) === parseInt(this.form_fields[i].id)) {
    161                         this.delete_field(i);
    162                     }
     179                        if (this.form_fields[i].template === 'humanpresence') {
     180                            this.delete_field_no_confirm(i);
     181                            this.disable_humanpresence_setting();
     182                        } else {
     183                            this.delete_field(i);
     184                        }
     185                    }
     186                }
     187            },
     188
     189            delete_humanpresence_field: function delete_humanpresence_field(data) {
     190                var i = 0;
     191                if (data.$store.state.form_fields.length) {
     192                    for (i = 0; i < data.$store.state.form_fields.length; i++) {
     193                        if (data.$store.state.form_fields[i].template === 'humanpresence') {
     194                            this.delete_field_no_confirm(i);
     195                            this.disable_humanpresence_setting();
     196                        }
     197                    }
     198                }
     199            },
     200
     201            disable_humanpresence_setting: function disable_humanpresence_setting() {
     202                var settings = this.$store.state.settings;
     203                settings.humanpresence_enabled = false;
     204                this.$store.commit('set_form_settings', settings);
     205            },
     206
     207            humanpresence_changed: function humanpresence_changed(e, data) {
     208                if (data.$store.state.settings.humanpresence_enabled === 'true') {
     209                    wpuf_form_builder.event_hub.$emit('humanpresence-enabled', data);
     210                } else {
     211                    wpuf_form_builder.event_hub.$emit('humanpresence-disabled', data);
    163212                }
    164213            },
     
    428477                show_basic_settings: true,
    429478                show_advanced_settings: false,
    430                 show_quiz_settings: false
     479                show_quiz_settings: false,
     480                show_humanpresence_settings: false
    431481            };
    432482        },
     
    437487                this.show_advanced_settings = false;
    438488                this.show_quiz_settings = false;
     489                this.show_humanpresence_settings = false;
    439490
    440491                return parseInt(this.$store.state.editing_field_id);
     
    504555            },
    505556
     557            humanpresence_settings: function humanpresence_settings() {
     558                return this.settings.filter(function (item) {
     559                    return 'humanpresence' === item.section;
     560                });
     561            },
     562
    506563            form_field_type_title: function form_field_type_title() {
    507564                var template = this.editing_form_field.template;
     
    791848                scroll: true,
    792849                stop: function stop(event, ui) {
    793                     var data_source = ui.item.context.attributes['data-source'].value;
     850                    var data_source = $(ui.item).attr('data-source');
    794851
    795852                    if ('panel' === data_source) {
    796853                        var payload = {
    797854                            toIndex: parseInt($(ui.item).index()),
    798                             field_template: ui.item.context.attributes['data-form-field'].value,
    799                             to_column: $(this).context.parentElement.classList[0]
     855                            field_template: $(ui.item).attr('data-form-field'),
     856                            to_column: $(this).parent()[0].classList[0]
    800857                        };
    801858
     
    810867                        data = item.dataset,
    811868                        source = data.source,
    812                         toIndex = parseInt($(ui.item).index()),
     869                        toIndex = parseInt($(item).index()),
    813870                        payload = {
    814871                        toIndex: toIndex
     
    817874                    if ('column-field-stage' === source) {
    818875                        payload.field_id = self.field.id;
    819                         payload.fromIndex = parseInt(ui.item.context.attributes['column-field-index'].value);
    820                         payload.fromColumn = ui.item.context.attributes['in-column'].value;
    821                         payload.toColumn = ui.item.context.parentElement.parentElement.classList[0];
     876                        payload.fromIndex = parseInt($(item).attr('column-field-index'));
     877                        payload.fromColumn = $(item).attr('in-column');
     878                        payload.toColumn = $(item).parent().parent()[0].classList[0];
    822879
    823880                        // when drag field one column to another column, sortable event trigger twice and try to swap field twice.
     
    10271084            resizeColumns: function resizeColumns(columnsNumber) {
    10281085                var self = this;
    1029 
    10301086                (function () {
    10311087                    var columnElement;
    10321088                    var startOffset;
    1033                     var columnField = $(self.$el).context.parentElement;
     1089                    var columnField = $(self.$el).parent();
    10341090                    var total_width = parseInt($(columnField).width());
    10351091
     
    11971253        },
    11981254
     1255        created: function created() {
     1256            wpuf_form_builder.event_hub.$on('humanpresence-enabled', this.add_humanpresence_field);
     1257        },
     1258
    11991259        mounted: function mounted() {
    12001260            // bind jquery ui draggable
    1201             $(this.$el).find('.panel-form-field-buttons .button').draggable({
     1261            $(this.$el).find('.panel-form-field-buttons .button').not('[data-form-field="humanpresence"]').draggable({
    12021262                connectToSortable: '#form-preview-stage .wpuf-form, .wpuf-column-inner-fields .wpuf-column-fields-sortable-list',
    12031263                helper: 'clone',
     
    12421302                }
    12431303
     1304                if (field_template === 'humanpresence') {
     1305                    var settings = this.$store.state.settings;
     1306                    settings.humanpresence_enabled = true;
     1307                    this.$store.commit('set_form_settings', settings);
     1308                }
     1309
    12441310                payload.field = field;
    12451311
    12461312                // add new form element
    12471313                this.$store.commit('add_form_field_element', payload);
     1314            },
     1315
     1316            add_humanpresence_field: function add_humanpresence_field(data) {
     1317                if (!this.containsField('humanpresence')) {
     1318                    this.add_form_field('humanpresence');
     1319                }
    12481320            },
    12491321
     
    13741446
    13751447    /**
     1448     * Field template: HumanPresence
     1449     */
     1450    Vue.component('form-humanpresence', {
     1451        template: '#tmpl-wpuf-form-humanpresence',
     1452
     1453        mixins: [wpuf_mixins.form_field_mixin],
     1454
     1455        computed: {
     1456            has_humanpresence_installed: function has_humanpresence_installed() {
     1457                return wpuf_form_builder.humanpresence_installed;
     1458            },
     1459
     1460            no_humanpresence_installed_msg: function no_humanpresence_installed_msg() {
     1461                return wpuf_form_builder.field_settings.humanpresence.validator.msg;
     1462            }
     1463        }
     1464
     1465    });
     1466
     1467    /**
    13761468     * Field template: Section Break
    13771469     */
  • weforms/tags/1.6.6/assets/wpuf/js/wpuf-form-builder-components.min.js

    r2416759 r2514969  
    1 "use strict";!function(d){Vue.component("builder-stage",{template:"#tmpl-wpuf-builder-stage",mixins:wpuf_form_builder_mixins(wpuf_mixins.builder_stage),computed:{form_fields:function(){return this.$store.state.form_fields},field_settings:function(){return this.$store.state.field_settings},hidden_fields:function(){return this.$store.state.form_fields.filter(function(e){return"custom_hidden_field"===e.template})},editing_form_id:function(){return this.$store.state.editing_field_id},pro_link:function(){return wpuf_form_builder.pro_link}},mounted:function(){var f=this,r=!1;d("#form-preview-stage .wpuf-form.sortable-list").sortable({placeholder:"form-preview-stage-dropzone",items:".field-items",handle:".control-buttons .move",scroll:!0,over:function(){r=!1,d(".wpuf-column-inner-fields").on("drop",function(e){var t=e.currentTarget.classList;d.inArray(".wpuf-column-inner-fields",t)&&(r=!0)})},update:function(e,t){var i=t.item[0].dataset,n=i.source,o={toIndex:parseInt(d(t.item).index())};if("panel"===n){var l=t.item[0].dataset.formField,s=d.extend(!0,{},f.field_settings[l].field_props);if(f.isSingleInstance(l)&&f.containsField(l))return swal({title:"Oops...",text:"You already have this field in the form"}),void d(this).find(".button.ui-draggable.ui-draggable-handle").remove();s.id=f.get_random_id(),"yes"!==s.is_meta||s.name||(s.name=s.label.replace(/\W/g,"_").toLowerCase()+"_"+s.id),o.field=s,r||f.$store.commit("add_form_field_element",o),d(this).find(".button.ui-draggable.ui-draggable-handle").remove()}else"stage"===n&&(o.fromIndex=parseInt(i.index),f.$store.commit("swap_form_field_elements",o))}})},methods:{open_field_settings:function(e){this.$store.commit("open_field_settings",e)},clone_field:function(e,t){var i={field_id:e,index:t,new_id:this.get_random_id()},n=_.find(this.$store.state.form_fields,function(e){return parseInt(e.id)===parseInt(i.field_id)});this.isSingleInstance(n.template)&&this.containsField(n.template)?swal({title:"Oops...",text:"You already have this field in the form"}):this.$store.commit("clone_form_field_element",i)},delete_field:function(e){var t=this;swal({text:t.i18n.delete_field_warn_msg,type:"warning",showCancelButton:!0,confirmButtonColor:"#d54e21",confirmButtonText:t.i18n.yes_delete_it,cancelButtonText:t.i18n.no_cancel_it,confirmButtonClass:"btn btn-success",cancelButtonClass:"btn btn-danger"}).then(function(){t.$store.commit("delete_form_field_element",e)},function(){})},delete_hidden_field:function(e){var t=0;for(t=0;t<this.form_fields.length;t++)parseInt(e)===parseInt(this.form_fields[t].id)&&this.delete_field(t)},is_pro_feature:function(e){return!(!this.field_settings[e]||!this.field_settings[e].pro_feature)},is_template_available:function(e){var t=e.template;return this.field_settings[t]?!this.is_pro_feature(t):!!_.isFunction(this["is_"+t+"_template_available"])&&this["is_"+t+"_template_available"].call(this,e)},is_full_width:function(e){return!(!this.field_settings[e]||!this.field_settings[e].is_full_width)},is_invisible:function(e){return!(!e.recaptcha_type||"invisible_recaptcha"!==e.recaptcha_type)},get_field_name:function(e){return this.field_settings[e].title}}}),Vue.component("field-checkbox",{template:"#tmpl-wpuf-field-checkbox",mixins:[wpuf_mixins.option_field_mixin],computed:{value:{get:function(){var e=this.editing_form_field[this.option_field.name];return this.option_field.is_single_opt?e===Object.keys(this.option_field.options)[0]:this.editing_form_field[this.option_field.name]},set:function(e){this.option_field.is_single_opt&&(e=e?Object.keys(this.option_field.options)[0]:""),this.$store.commit("update_editing_form_field",{editing_field_id:this.editing_form_field.id,field_name:this.option_field.name,value:e})}}}}),Vue.component("field-html_help_text",{template:"#tmpl-wpuf-field-html_help_text",mixins:[wpuf_mixins.option_field_mixin]}),Vue.component("field-multiselect",{template:"#tmpl-wpuf-field-multiselect",mixins:[wpuf_mixins.option_field_mixin],computed:{value:{get:function(){return this.editing_form_field[this.option_field.name]},set:function(e){this.$store.commit("update_editing_form_field",{editing_field_id:this.editing_form_field.id,field_name:this.option_field.name,value:e})}}},mounted:function(){this.bind_selectize()},methods:{bind_selectize:function(){var t=this;d(this.$el).find(".term-list-selector").selectize({}).on("change",function(){var e=d(this).val();t.value=e})}}}),Vue.component("field-option-data",{template:"#tmpl-wpuf-field-option-data",mixins:[wpuf_mixins.option_field_mixin],data:function(){return{show_value:!1,options:[],selected:[]}},computed:{field_options:function(){return this.editing_form_field.options},field_selected:function(){return this.editing_form_field.selected}},mounted:function(){var l=this;this.set_options(),d(this.$el).find(".option-field-option-chooser").sortable({items:".option-field-option",handle:".sort-handler",update:function(e,t){var i=t.item[0].dataset,n=parseInt(d(t.item).index()),o=parseInt(i.index);l.options.swap(o,n)}})},methods:{set_options:function(){var i=this,e=d.extend(!0,{},this.editing_form_field.options);_.each(e,function(e,t){i.options.push({label:e,value:t,id:i.get_random_id()})}),this.option_field.is_multiple&&!_.isArray(this.field_selected)?this.selected=[this.field_selected]:this.selected=this.field_selected},clear_selection:function(){this.selected=null},add_option:function(){var e=this.options.length,t=this.i18n.option+"-"+(e+1);this.options.push({label:t,value:t,id:this.get_random_id()})},delete_option:function(e){1!==this.options.length?this.options.splice(e,1):this.warn({text:this.i18n.last_choice_warn_msg,showCancelButton:!1,confirmButtonColor:"#46b450"})},set_option_label:function(e,t){this.options[e].value=t.toLocaleLowerCase().replace(/\s/g,"_")}},watch:{options:{deep:!0,handler:function(e){var t={},i=0;for(i=0;i<e.length;i++)t[e[i].value]=e[i].label;this.update_value("options",t)}},selected:function(e){this.update_value("selected",e)}}}),Vue.component("field-option-pro-feature-alert",{template:"#tmpl-wpuf-field-option-pro-feature-alert",mixins:[wpuf_mixins.option_field_mixin],computed:{pro_link:function(){return wpuf_form_builder.pro_link}}}),Vue.component("field-options",{template:"#tmpl-wpuf-field-options",mixins:wpuf_form_builder_mixins(wpuf_mixins.field_options),data:function(){return{show_basic_settings:!0,show_advanced_settings:!1,show_quiz_settings:!1}},computed:{editing_field_id:function(){return this.show_basic_settings=!0,this.show_advanced_settings=!1,this.show_quiz_settings=!1,parseInt(this.$store.state.editing_field_id)},editing_form_field:function(){var e=this,t=0;for(t=0;t<e.$store.state.form_fields.length;t++){if(e.$store.state.form_fields[t].id===parseInt(e.editing_field_id))return e.$store.state.form_fields[t];if("column_field"===e.$store.state.form_fields[t].template){var i=e.$store.state.form_fields[t].inner_fields;for(var n in i)if(i.hasOwnProperty(n))for(var o=0;o<i[n].length;){if(i[n][o].id===e.editing_field_id)return i[n][o];o++}}}},settings:function(){var e=[],t=this.editing_form_field.template;return e=_.isFunction(this["settings_"+t])?this["settings_"+t].call(this,this.editing_form_field):this.$store.state.field_settings[t].settings,_.sortBy(e,function(e){return parseInt(e.priority)})},basic_settings:function(){return this.settings.filter(function(e){return"basic"===e.section})},advanced_settings:function(){return this.settings.filter(function(e){return"advanced"===e.section})},quiz_settings:function(){return this.settings.filter(function(e){return"quiz"===e.section})},form_field_type_title:function(){var e=this.editing_form_field.template;return _.isFunction(this["form_field_"+e+"_title"])?this["form_field_"+e+"_title"].call(this,this.editing_form_field):this.$store.state.field_settings[e].title},form_settings:function(){return this.$store.state.settings}},watch:{form_settings:function(){return this.$store.state.settings}}}),Vue.component("field-radio",{template:"#tmpl-wpuf-field-radio",mixins:[wpuf_mixins.option_field_mixin],computed:{value:{get:function(){return this.editing_form_field[this.option_field.name]},set:function(e){this.$store.commit("update_editing_form_field",{editing_field_id:this.editing_form_field.id,field_name:this.option_field.name,value:e})}}}}),Vue.component("field-range",{template:"#tmpl-wpuf-field-range",mixins:[wpuf_mixins.option_field_mixin],computed:{value:{get:function(){return this.editing_form_field[this.option_field.name]},set:function(e){this.update_value(this.option_field.name,e)}},minColumn:function(){return this.editing_form_field.min_column},maxColumn:function(){return this.editing_form_field.max_column}},methods:{}}),Vue.component("field-select",{template:"#tmpl-wpuf-field-select",mixins:[wpuf_mixins.option_field_mixin],computed:{value:{get:function(){return this.editing_form_field[this.option_field.name]},set:function(e){this.$store.commit("update_editing_form_field",{editing_field_id:this.editing_form_field.id,field_name:this.option_field.name,value:e})}}}}),Vue.component("field-text",{template:"#tmpl-wpuf-field-text",mixins:[wpuf_mixins.option_field_mixin],computed:{value:{get:function(){return this.editing_form_field[this.option_field.name]},set:function(e){this.update_value(this.option_field.name,e)}}},methods:{on_focusout:function(e){wpuf_form_builder.event_hub.$emit("field-text-focusout",e,this)},on_keyup:function(e){wpuf_form_builder.event_hub.$emit("field-text-keyup",e,this)}}}),Vue.component("field-text-meta",{template:"#tmpl-wpuf-field-text-meta",mixins:[wpuf_mixins.option_field_mixin],computed:{value:{get:function(){return this.editing_form_field[this.option_field.name]},set:function(e){this.update_value(this.option_field.name,e)}}},created:function(){"yes"===this.editing_form_field.is_meta&&(this.value||(this.value=this.editing_form_field.label.replace(/\W/g,"_").toLowerCase()),wpuf_form_builder.event_hub.$on("field-text-keyup",this.meta_key_autocomplete))},methods:{meta_key_autocomplete:function(e,t){"label"===t.option_field.name&&parseInt(this.editing_form_field.id)===parseInt(t.editing_form_field.id)&&(this.value=t.value.replace(/\W/g,"_").toLowerCase())}}}),Vue.component("field-textarea",{template:"#tmpl-wpuf-field-textarea",mixins:[wpuf_mixins.option_field_mixin],computed:{value:{get:function(){return this.editing_form_field[this.option_field.name]},set:function(e){this.update_value(this.option_field.name,e)}}}}),Vue.component("field-visibility",{template:"#tmpl-wpuf-field-visibility",mixins:[wpuf_mixins.option_field_mixin],computed:{selected:{get:function(){return this.editing_form_field[this.option_field.name].selected},set:function(e){this.$store.commit("update_editing_form_field",{editing_field_id:this.editing_form_field.id,field_name:this.option_field.name,value:{selected:e,choices:[]}})}},choices:{get:function(){return this.editing_form_field[this.option_field.name].choices},set:function(e){this.$store.commit("update_editing_form_field",{editing_field_id:this.editing_form_field.id,field_name:this.option_field.name,value:{selected:this.selected,choices:e}})}}},methods:{},watch:{selected:function(e){this.update_value("selected",e)}}}),Vue.component("form-checkbox_field",{template:"#tmpl-wpuf-form-checkbox_field",mixins:[wpuf_mixins.form_field_mixin]});var e=[wpuf_mixins.form_field_mixin];window.wpuf_forms_mixin_builder_stage&&e.push(window.wpuf_forms_mixin_builder_stage),window.weforms_mixin_builder_stage&&e.push(window.weforms_mixin_builder_stage),Vue.component("form-column_field",{template:"#tmpl-wpuf-form-column_field",mixins:e,data:function(){return{columnClasses:["column-1","column-2","column-3"]}},mounted:function(){this.resizeColumns(this.field.columns);var o=this,e=d(o.$el).find(".wpuf-column-inner-fields .wpuf-column-fields-sortable-list"),l=1,t=d(".wpuf-field-columns"),i=d(o.$el).find(".wpuf-column-field-inner-columns .wpuf-column-inner-fields");t.mouseenter(function(){o.resizeColumns(o.field.columns)}),t.mouseleave(function(){i.unbind("mouseup"),i.unbind("mousemove")}),d(e).sortable({placeholder:"form-preview-stage-dropzone",connectWith:e,items:".column-field-items",handle:".wpuf-column-field-control-buttons .move",scroll:!0,stop:function(e,t){if("panel"===t.item.context.attributes["data-source"].value){var i={toIndex:parseInt(d(t.item).index()),field_template:t.item.context.attributes["data-form-field"].value,to_column:d(this).context.parentElement.classList[0]};o.add_column_inner_field(i),d(this).find(".button.ui-draggable.ui-draggable-handle").remove()}},update:function(e,t){var i=t.item[0].dataset.source,n={toIndex:parseInt(d(t.item).index())};"column-field-stage"===i&&(n.field_id=o.field.id,n.fromIndex=parseInt(t.item.context.attributes["column-field-index"].value),n.fromColumn=t.item.context.attributes["in-column"].value,n.toColumn=t.item.context.parentElement.parentElement.classList[0],n.fromColumn!==n.toColumn&&1===l?l=0:l++,n.fromColumn===n.toColumn&&(l=1),1===l&&o.$store.commit("swap_column_field_elements",n))}})},computed:{column_fields:function(){return this.field.inner_fields},innerColumns:function(){return this.field.columns},editing_form_id:function(){return this.$store.state.editing_field_id},field_settings:function(){return this.$store.state.field_settings}},methods:{is_template_available:function(e){var t=e.template;return this.field_settings[t]?!this.is_pro_feature(t):!!_.isFunction(this["is_"+t+"_template_available"])&&this["is_"+t+"_template_available"].call(this,e)},is_pro_feature:function(e){return!(!this.field_settings[e]||!this.field_settings[e].pro_feature)},get_field_name:function(e){return this.field_settings[e].title},is_full_width:function(e){return!(!this.field_settings[e]||!this.field_settings[e].is_full_width)},is_invisible:function(e){return!(!e.recaptcha_type||"invisible_recaptcha"!==e.recaptcha_type)},isAllowedInClolumnField:function(e){return 0<=d.inArray(e,["column_field","custom_hidden_field","step_start"])},add_column_inner_field:function(e){var t={toWhichColumnField:this.field.id,toWhichColumnFieldMeta:this.field.name,toIndex:e.toIndex,toWhichColumn:e.to_column};if(this.isAllowedInClolumnField(e.field_template))swal({title:"Oops...",text:"You cannot add this field as inner column field"});else if(this.isSingleInstance(e.field_template)&&this.containsField(e.field_template))swal({title:"Oops...",text:"You already have this field in the form"});else{var i=d.extend(!0,{},this.$store.state.field_settings[e.field_template].field_props),n=this.$store.state.form_fields;if(i.id=this.get_random_id(),"yes"===i.is_meta&&!i.name&&i.label)i.name=i.label.replace(/\W/g,"_").toLowerCase(),n.filter(function(e){return e.template===i.template})&&(i.name+="_"+this.get_random_id());t.field=i,this.$store.commit("add_column_inner_field_element",t)}},moveFieldsTo:function(e){var t={field_id:this.field.id,move_to:e,inner_fields:this.getInnerFields()};this.$store.commit("move_column_inner_fields",t)},getInnerFields:function(){return this.field.inner_fields},open_column_field_settings:function(e,t,i){var n={field_id:this.field.id,column_field:e,index:t,column:i};this.$store.commit("open_column_field_settings",n)},clone_column_field:function(e,t,i){var n={field_id:this.field.id,column_field_id:e.id,index:t,toColumn:i,new_id:this.get_random_id()};this.isSingleInstance(e.template)?swal({title:"Oops...",text:"You already have this field in the form"}):this.$store.commit("clone_column_field_element",n)},delete_column_field:function(e,t){var i=this,n={field_id:i.field.id,index:e,fromColumn:t};swal({text:i.i18n.delete_field_warn_msg,type:"warning",showCancelButton:!0,confirmButtonColor:"#d54e21",confirmButtonText:i.i18n.yes_delete_it,cancelButtonText:i.i18n.no_cancel_it,confirmButtonClass:"btn btn-success",cancelButtonClass:"btn btn-danger"}).then(function(){i.$store.commit("delete_column_field_element",n)},function(){})},resizeColumns:function(n){var o,i,l,s,f=this;l=d(f.$el).context.parentElement,s=parseInt(d(l).width()),Array.prototype.forEach.call(d(f.$el).find(".wpuf-column-field-inner-columns .wpuf-column-inner-fields"),function(t){t.style.position="relative";var e=document.createElement("div");e.innerHTML="&nbsp;",e.style.top=0,e.style.right=0,e.style.bottom=0,e.style.width="5px",e.style.position="absolute",e.style.cursor="col-resize",e.addEventListener("mousedown",function(e){i=(o=t).offsetWidth-e.pageX}),t.appendChild(e)}),d(f.$el).find(".wpuf-column-field-inner-columns .wpuf-column-inner-fields").mousemove(function(e){if(o){var t=i+e.pageX;o.style.width=100*t/s+"%"}}),d(f.$el).find(".wpuf-column-field-inner-columns .wpuf-column-inner-fields").mouseup(function(){var e=0,t=0,i=0;i=3===n?t=e=100/n:(t=2===n?e=100/n:(e=d(l).find(".column-1").width(),d(l).find(".column-2").width()),0),f.field.inner_columns_size["column-1"]=e+"%",f.field.inner_columns_size["column-2"]=t+"%",f.field.inner_columns_size["column-3"]=i+"%",o=void 0})}},watch:{innerColumns:function(e){var t=parseInt(e),i=this.field.inner_columns_size;Object.keys(i).forEach(function(e){1===t&&(i[e]="100%"),2===t&&(i[e]="50%"),3===t&&(i[e]="33.33%")}),1===t&&this.moveFieldsTo("column-1"),2===t&&this.moveFieldsTo("column-2"),this.resizeColumns(t)}}}),Vue.component("form-custom_hidden_field",{template:"#tmpl-wpuf-form-custom_hidden_field",mixins:[wpuf_mixins.form_field_mixin]}),Vue.component("form-custom_html",{template:"#tmpl-wpuf-form-custom_html",mixins:[wpuf_mixins.form_field_mixin],data:function(){return{raw_html:"<p>from data</p>"}}}),Vue.component("form-dropdown_field",{template:"#tmpl-wpuf-form-dropdown_field",mixins:[wpuf_mixins.form_field_mixin]}),Vue.component("form-email_address",{template:"#tmpl-wpuf-form-email_address",mixins:[wpuf_mixins.form_field_mixin]}),Vue.component("form-featured_image",{template:"#tmpl-wpuf-form-featured_image",mixins:[wpuf_mixins.form_field_mixin]}),Vue.component("form-fields",{template:"#tmpl-wpuf-form-fields",mixins:wpuf_form_builder_mixins(wpuf_mixins.form_fields),computed:{panel_sections:function(){return this.$store.state.panel_sections},field_settings:function(){return this.$store.state.field_settings},form_fields:function(){return this.$store.state.form_fields}},mounted:function(){d(this.$el).find(".panel-form-field-buttons .button").draggable({connectToSortable:"#form-preview-stage .wpuf-form, .wpuf-column-inner-fields .wpuf-column-fields-sortable-list",helper:"clone",revert:"invalid",cancel:".button-faded"}).disableSelection()},methods:{panel_toggle:function(e){this.$store.commit("panel_toggle",e)},add_form_field:function(e){var t={toIndex:this.$store.state.form_fields.length};if(this.isSingleInstance(e)&&this.containsField(e))swal({title:"Oops...",text:"You already have this field in the form"});else{var i=d.extend(!0,{},this.$store.state.field_settings[e].field_props);if(i.id=this.get_random_id(),!i.name&&i.label){i.name=i.label.replace(/\W/g,"_").toLowerCase();var n=this.form_fields.filter(function(e){return e.template===i.template});n.length&&(i.name+="_"+n.length)}t.field=i,this.$store.commit("add_form_field_element",t)}},is_pro_feature:function(e){return this.field_settings[e].pro_feature},alert_pro_feature:function(e){var t=this.field_settings[e].title;swal({title:'<i class="fa fa-lock"></i> '+t+" <br>"+this.i18n.is_a_pro_feature,text:this.i18n.pro_feature_msg,type:"",showCancelButton:!0,cancelButtonText:this.i18n.close,confirmButtonColor:"#46b450",confirmButtonText:this.i18n.upgrade_to_pro}).then(function(e){e&&window.open(wpuf_form_builder.pro_link,"_blank")},function(){})},alert_invalidate_msg:function(e){var t=this.field_settings[e].validator;t&&t.msg&&this.warn({title:t.msg_title||"",html:t.msg,type:"warning",showCancelButton:!1,confirmButtonColor:"#46b450",confirmButtonText:this.i18n.ok})},get_invalidate_btn_class:function(e){return this.field_settings[e].validator.button_class}}}),Vue.component("form-image_upload",{template:"#tmpl-wpuf-form-image_upload",mixins:[wpuf_mixins.form_field_mixin]}),Vue.component("form-multiple_select",{template:"#tmpl-wpuf-form-multiple_select",mixins:[wpuf_mixins.form_field_mixin]}),Vue.component("form-post_content",{template:"#tmpl-wpuf-form-post_content",mixins:[wpuf_mixins.form_field_mixin]}),Vue.component("form-post_excerpt",{template:"#tmpl-wpuf-form-post_excerpt",mixins:[wpuf_mixins.form_field_mixin]}),Vue.component("form-post_tags",{template:"#tmpl-wpuf-form-post_tags",mixins:[wpuf_mixins.form_field_mixin]}),Vue.component("form-post_title",{template:"#tmpl-wpuf-form-post_title",mixins:[wpuf_mixins.form_field_mixin]}),Vue.component("form-radio_field",{template:"#tmpl-wpuf-form-radio_field",mixins:[wpuf_mixins.form_field_mixin]}),Vue.component("form-recaptcha",{template:"#tmpl-wpuf-form-recaptcha",mixins:[wpuf_mixins.form_field_mixin],computed:{has_recaptcha_api_keys:function(){return!(!wpuf_form_builder.recaptcha_site||!wpuf_form_builder.recaptcha_secret)},no_api_keys_msg:function(){return wpuf_form_builder.field_settings.recaptcha.validator.msg}}}),Vue.component("form-section_break",{template:"#tmpl-wpuf-form-section_break",mixins:[wpuf_mixins.form_field_mixin]}),Vue.component("form-taxonomy",{template:"#tmpl-wpuf-form-taxonomy",mixins:[wpuf_mixins.form_field_mixin],computed:{terms:function(){var e;for(e in wpuf_form_builder.wp_post_types){var t=wpuf_form_builder.wp_post_types[e];if(t.hasOwnProperty(this.field.name)){var i=t[this.field.name];if(i.terms)return i.terms}}return[]},sorted_terms:function(){var t=this,i=d.extend(!0,[],this.terms);if(this.field.exclude_type&&this.field.exclude){if(1<this.field.exclude.length)var n=this.field.exclude.split(",").map(function(e){return e=e.trim(),e=parseInt(e)}).filter(function(e){return isFinite(e)});i=i.filter(function(e){switch(t.field.exclude_type){case"exclude":return _.indexOf(n,e.term_id)<0;case"include":return 0<=_.indexOf(n,e.term_id);case"child_of":return 0<=_.indexOf(n,parseInt(e.parent))}})}i=_.sortBy(i,function(e){return e[t.field.orderby]}),"DESC"===this.field.order&&(i=i.reverse());var e=i.filter(function(e){return!e.parent});return e.map(function(e){e.children=t.get_child_terms(e.term_id,i)}),e.length?e:i}},methods:{get_child_terms:function(t,i){var n=this,e=i.filter(function(e){return parseInt(e.parent)===parseInt(t)});return e.map(function(e){e.children=n.get_child_terms(e.term_id,i)}),e},get_term_dropdown_options:function(){var t=this,i="";return"select"===this.field.type&&(i='<option value="">'+this.field.first+"</option>"),_.each(t.sorted_terms,function(e){i+=t.get_term_dropdown_options_children(e,0)}),i},get_term_dropdown_options_children:function(e,t){var i=this,n="",o="",l=0;for(l=0;l<t;l++)o+="&nbsp;&nbsp;";return n+='<option value="'+e.id+'">'+o+e.name+"</option>",e.children.length&&_.each(e.children,function(e){n+=i.get_term_dropdown_options_children(e,t+1)}),n},get_term_checklist:function(){var t=this,i="";return i+='<ul class="wpuf-category-checklist">',_.each(this.sorted_terms,function(e){i+=t.get_term_checklist_li(e)}),i+="</ul>"},get_term_checklist_li:function(e){var t=this,i="";return i+='<li><label class="selectit"><input type="checkbox"> '+e.name+"</label></li>",e.children.length&&(i+='<ul class="children">',_.each(e.children,function(e){i+=t.get_term_checklist_li(e)}),i+="</ul>"),i},get_term_checklist_inline:function(){var t=this,i="";return _.each(this.sorted_terms,function(e){i+=t.get_term_checklist_li_inline(e)}),i},get_term_checklist_li_inline:function(e){var t=this,i="";return i+='<label class="wpuf-checkbox-inline"><input type="checkbox"> '+e.name+"</label>",e.children.length&&_.each(e.children,function(e){i+=t.get_term_checklist_li_inline(e)}),i}}}),Vue.component("form-text_field",{template:"#tmpl-wpuf-form-text_field",mixins:[wpuf_mixins.form_field_mixin]}),Vue.component("form-textarea_field",{template:"#tmpl-wpuf-form-textarea_field",mixins:[wpuf_mixins.form_field_mixin]}),Vue.component("form-website_url",{template:"#tmpl-wpuf-form-website_url",mixins:[wpuf_mixins.form_field_mixin]}),Vue.component("help-text",{template:"#tmpl-wpuf-help-text",props:{text:{type:String,default:""}},mounted:function(){d(".wpuf-tooltip").tooltip()}}),Vue.component("text-editor",{template:"#tmpl-wpuf-text-editor",props:["rich","default_text"],computed:{site_url:function(){return wpuf_form_builder.site_url},is_full:function(){return"yes"===this.rich}}})}(jQuery);
     1"use strict";!function(d){Vue.component("builder-stage",{template:"#tmpl-wpuf-builder-stage",mixins:wpuf_form_builder_mixins(wpuf_mixins.builder_stage),computed:{form_fields:function(){return this.$store.state.form_fields},field_settings:function(){return this.$store.state.field_settings},hidden_fields:function(){return this.$store.state.form_fields.filter(function(e){return"custom_hidden_field"===e.template||"humanpresence"===e.template})},editing_form_id:function(){return this.$store.state.editing_field_id},pro_link:function(){return wpuf_form_builder.pro_link}},created:function(){var e=this,t=0;for(t=0;t<e.$store.state.form_fields.length;t++)"humanpresence"===e.$store.state.form_fields[t].template&&e.$store.state.form_fields[t].id;wpuf_form_builder.event_hub.$on("humanpresence-changed",this.humanpresence_changed),wpuf_form_builder.event_hub.$on("humanpresence-disabled",this.delete_humanpresence_field)},mounted:function(){var f=this,r=!1;d("#form-preview-stage .wpuf-form.sortable-list").sortable({placeholder:"form-preview-stage-dropzone",items:".field-items",handle:".control-buttons .move",scroll:!0,over:function(){r=!1,d(".wpuf-column-inner-fields").on("drop",function(e){var t=e.currentTarget.classList;d.inArray(".wpuf-column-inner-fields",t)&&(r=!0)})},update:function(e,t){var i=t.item[0].dataset,n=i.source,o={toIndex:parseInt(d(t.item).index())};if("panel"===n){var s=t.item[0].dataset.formField,l=d.extend(!0,{},f.field_settings[s].field_props);if(f.isSingleInstance(s)&&f.containsField(s))return swal({title:"Oops...",text:"You already have this field in the form"}),void d(this).find(".button.ui-draggable.ui-draggable-handle").remove();l.id=f.get_random_id(),"yes"!==l.is_meta||l.name||(l.name=l.label.replace(/\W/g,"_").toLowerCase()+"_"+l.id),o.field=l,r||f.$store.commit("add_form_field_element",o),d(this).find(".button.ui-draggable.ui-draggable-handle").remove()}else"stage"===n&&(o.fromIndex=parseInt(i.index),f.$store.commit("swap_form_field_elements",o))}})},methods:{open_field_settings:function(e){this.$store.commit("open_field_settings",e)},clone_field:function(e,t){var i={field_id:e,index:t,new_id:this.get_random_id()},n=_.find(this.$store.state.form_fields,function(e){return parseInt(e.id)===parseInt(i.field_id)});this.isSingleInstance(n.template)&&this.containsField(n.template)?swal({title:"Oops...",text:"You already have this field in the form"}):this.$store.commit("clone_form_field_element",i)},delete_field:function(e){var t=this;swal({text:t.i18n.delete_field_warn_msg,type:"warning",showCancelButton:!0,confirmButtonColor:"#d54e21",confirmButtonText:t.i18n.yes_delete_it,cancelButtonText:t.i18n.no_cancel_it,confirmButtonClass:"btn btn-success",cancelButtonClass:"btn btn-danger"}).then(function(){t.$store.commit("delete_form_field_element",e)},function(){})},delete_field_no_confirm:function(e){this.$store.commit("delete_form_field_element",e)},delete_hidden_field:function(e){var t=0;for(t=0;t<this.form_fields.length;t++)parseInt(e)===parseInt(this.form_fields[t].id)&&("humanpresence"===this.form_fields[t].template?(this.delete_field_no_confirm(t),this.disable_humanpresence_setting()):this.delete_field(t))},delete_humanpresence_field:function(e){var t=0;if(e.$store.state.form_fields.length)for(t=0;t<e.$store.state.form_fields.length;t++)"humanpresence"===e.$store.state.form_fields[t].template&&(this.delete_field_no_confirm(t),this.disable_humanpresence_setting())},disable_humanpresence_setting:function(){var e=this.$store.state.settings;e.humanpresence_enabled=!1,this.$store.commit("set_form_settings",e)},humanpresence_changed:function(e,t){"true"===t.$store.state.settings.humanpresence_enabled?wpuf_form_builder.event_hub.$emit("humanpresence-enabled",t):wpuf_form_builder.event_hub.$emit("humanpresence-disabled",t)},is_pro_feature:function(e){return!(!this.field_settings[e]||!this.field_settings[e].pro_feature)},is_template_available:function(e){var t=e.template;return this.field_settings[t]?!this.is_pro_feature(t):!!_.isFunction(this["is_"+t+"_template_available"])&&this["is_"+t+"_template_available"].call(this,e)},is_full_width:function(e){return!(!this.field_settings[e]||!this.field_settings[e].is_full_width)},is_invisible:function(e){return!(!e.recaptcha_type||"invisible_recaptcha"!==e.recaptcha_type)},get_field_name:function(e){return this.field_settings[e].title}}}),Vue.component("field-checkbox",{template:"#tmpl-wpuf-field-checkbox",mixins:[wpuf_mixins.option_field_mixin],computed:{value:{get:function(){var e=this.editing_form_field[this.option_field.name];return this.option_field.is_single_opt?e===Object.keys(this.option_field.options)[0]:this.editing_form_field[this.option_field.name]},set:function(e){this.option_field.is_single_opt&&(e=e?Object.keys(this.option_field.options)[0]:""),this.$store.commit("update_editing_form_field",{editing_field_id:this.editing_form_field.id,field_name:this.option_field.name,value:e})}}}}),Vue.component("field-html_help_text",{template:"#tmpl-wpuf-field-html_help_text",mixins:[wpuf_mixins.option_field_mixin]}),Vue.component("field-multiselect",{template:"#tmpl-wpuf-field-multiselect",mixins:[wpuf_mixins.option_field_mixin],computed:{value:{get:function(){return this.editing_form_field[this.option_field.name]},set:function(e){this.$store.commit("update_editing_form_field",{editing_field_id:this.editing_form_field.id,field_name:this.option_field.name,value:e})}}},mounted:function(){this.bind_selectize()},methods:{bind_selectize:function(){var t=this;d(this.$el).find(".term-list-selector").selectize({}).on("change",function(){var e=d(this).val();t.value=e})}}}),Vue.component("field-option-data",{template:"#tmpl-wpuf-field-option-data",mixins:[wpuf_mixins.option_field_mixin],data:function(){return{show_value:!1,options:[],selected:[]}},computed:{field_options:function(){return this.editing_form_field.options},field_selected:function(){return this.editing_form_field.selected}},mounted:function(){var s=this;this.set_options(),d(this.$el).find(".option-field-option-chooser").sortable({items:".option-field-option",handle:".sort-handler",update:function(e,t){var i=t.item[0].dataset,n=parseInt(d(t.item).index()),o=parseInt(i.index);s.options.swap(o,n)}})},methods:{set_options:function(){var i=this,e=d.extend(!0,{},this.editing_form_field.options);_.each(e,function(e,t){i.options.push({label:e,value:t,id:i.get_random_id()})}),this.option_field.is_multiple&&!_.isArray(this.field_selected)?this.selected=[this.field_selected]:this.selected=this.field_selected},clear_selection:function(){this.selected=null},add_option:function(){var e=this.options.length,t=this.i18n.option+"-"+(e+1);this.options.push({label:t,value:t,id:this.get_random_id()})},delete_option:function(e){1!==this.options.length?this.options.splice(e,1):this.warn({text:this.i18n.last_choice_warn_msg,showCancelButton:!1,confirmButtonColor:"#46b450"})},set_option_label:function(e,t){this.options[e].value=t.toLocaleLowerCase().replace(/\s/g,"_")}},watch:{options:{deep:!0,handler:function(e){var t={},i=0;for(i=0;i<e.length;i++)t[e[i].value]=e[i].label;this.update_value("options",t)}},selected:function(e){this.update_value("selected",e)}}}),Vue.component("field-option-pro-feature-alert",{template:"#tmpl-wpuf-field-option-pro-feature-alert",mixins:[wpuf_mixins.option_field_mixin],computed:{pro_link:function(){return wpuf_form_builder.pro_link}}}),Vue.component("field-options",{template:"#tmpl-wpuf-field-options",mixins:wpuf_form_builder_mixins(wpuf_mixins.field_options),data:function(){return{show_basic_settings:!0,show_advanced_settings:!1,show_quiz_settings:!1,show_humanpresence_settings:!1}},computed:{editing_field_id:function(){return this.show_basic_settings=!0,this.show_advanced_settings=!1,this.show_quiz_settings=!1,this.show_humanpresence_settings=!1,parseInt(this.$store.state.editing_field_id)},editing_form_field:function(){var e=this,t=0;for(t=0;t<e.$store.state.form_fields.length;t++){if(e.$store.state.form_fields[t].id===parseInt(e.editing_field_id))return e.$store.state.form_fields[t];if("column_field"===e.$store.state.form_fields[t].template){var i=e.$store.state.form_fields[t].inner_fields;for(var n in i)if(i.hasOwnProperty(n))for(var o=0;o<i[n].length;){if(i[n][o].id===e.editing_field_id)return i[n][o];o++}}}},settings:function(){var e=[],t=this.editing_form_field.template;return e=_.isFunction(this["settings_"+t])?this["settings_"+t].call(this,this.editing_form_field):this.$store.state.field_settings[t].settings,_.sortBy(e,function(e){return parseInt(e.priority)})},basic_settings:function(){return this.settings.filter(function(e){return"basic"===e.section})},advanced_settings:function(){return this.settings.filter(function(e){return"advanced"===e.section})},quiz_settings:function(){return this.settings.filter(function(e){return"quiz"===e.section})},humanpresence_settings:function(){return this.settings.filter(function(e){return"humanpresence"===e.section})},form_field_type_title:function(){var e=this.editing_form_field.template;return _.isFunction(this["form_field_"+e+"_title"])?this["form_field_"+e+"_title"].call(this,this.editing_form_field):this.$store.state.field_settings[e].title},form_settings:function(){return this.$store.state.settings}},watch:{form_settings:function(){return this.$store.state.settings}}}),Vue.component("field-radio",{template:"#tmpl-wpuf-field-radio",mixins:[wpuf_mixins.option_field_mixin],computed:{value:{get:function(){return this.editing_form_field[this.option_field.name]},set:function(e){this.$store.commit("update_editing_form_field",{editing_field_id:this.editing_form_field.id,field_name:this.option_field.name,value:e})}}}}),Vue.component("field-range",{template:"#tmpl-wpuf-field-range",mixins:[wpuf_mixins.option_field_mixin],computed:{value:{get:function(){return this.editing_form_field[this.option_field.name]},set:function(e){this.update_value(this.option_field.name,e)}},minColumn:function(){return this.editing_form_field.min_column},maxColumn:function(){return this.editing_form_field.max_column}},methods:{}}),Vue.component("field-select",{template:"#tmpl-wpuf-field-select",mixins:[wpuf_mixins.option_field_mixin],computed:{value:{get:function(){return this.editing_form_field[this.option_field.name]},set:function(e){this.$store.commit("update_editing_form_field",{editing_field_id:this.editing_form_field.id,field_name:this.option_field.name,value:e})}}}}),Vue.component("field-text",{template:"#tmpl-wpuf-field-text",mixins:[wpuf_mixins.option_field_mixin],computed:{value:{get:function(){return this.editing_form_field[this.option_field.name]},set:function(e){this.update_value(this.option_field.name,e)}}},methods:{on_focusout:function(e){wpuf_form_builder.event_hub.$emit("field-text-focusout",e,this)},on_keyup:function(e){wpuf_form_builder.event_hub.$emit("field-text-keyup",e,this)}}}),Vue.component("field-text-meta",{template:"#tmpl-wpuf-field-text-meta",mixins:[wpuf_mixins.option_field_mixin],computed:{value:{get:function(){return this.editing_form_field[this.option_field.name]},set:function(e){this.update_value(this.option_field.name,e)}}},created:function(){"yes"===this.editing_form_field.is_meta&&(this.value||(this.value=this.editing_form_field.label.replace(/\W/g,"_").toLowerCase()),wpuf_form_builder.event_hub.$on("field-text-keyup",this.meta_key_autocomplete))},methods:{meta_key_autocomplete:function(e,t){"label"===t.option_field.name&&parseInt(this.editing_form_field.id)===parseInt(t.editing_form_field.id)&&(this.value=t.value.replace(/\W/g,"_").toLowerCase())}}}),Vue.component("field-textarea",{template:"#tmpl-wpuf-field-textarea",mixins:[wpuf_mixins.option_field_mixin],computed:{value:{get:function(){return this.editing_form_field[this.option_field.name]},set:function(e){this.update_value(this.option_field.name,e)}}}}),Vue.component("field-visibility",{template:"#tmpl-wpuf-field-visibility",mixins:[wpuf_mixins.option_field_mixin],computed:{selected:{get:function(){return this.editing_form_field[this.option_field.name].selected},set:function(e){this.$store.commit("update_editing_form_field",{editing_field_id:this.editing_form_field.id,field_name:this.option_field.name,value:{selected:e,choices:[]}})}},choices:{get:function(){return this.editing_form_field[this.option_field.name].choices},set:function(e){this.$store.commit("update_editing_form_field",{editing_field_id:this.editing_form_field.id,field_name:this.option_field.name,value:{selected:this.selected,choices:e}})}}},methods:{},watch:{selected:function(e){this.update_value("selected",e)}}}),Vue.component("form-checkbox_field",{template:"#tmpl-wpuf-form-checkbox_field",mixins:[wpuf_mixins.form_field_mixin]});var e=[wpuf_mixins.form_field_mixin];window.wpuf_forms_mixin_builder_stage&&e.push(window.wpuf_forms_mixin_builder_stage),window.weforms_mixin_builder_stage&&e.push(window.weforms_mixin_builder_stage),Vue.component("form-column_field",{template:"#tmpl-wpuf-form-column_field",mixins:e,data:function(){return{columnClasses:["column-1","column-2","column-3"]}},mounted:function(){this.resizeColumns(this.field.columns);var s=this,e=d(s.$el).find(".wpuf-column-inner-fields .wpuf-column-fields-sortable-list"),l=1,t=d(".wpuf-field-columns"),i=d(s.$el).find(".wpuf-column-field-inner-columns .wpuf-column-inner-fields");t.mouseenter(function(){s.resizeColumns(s.field.columns)}),t.mouseleave(function(){i.unbind("mouseup"),i.unbind("mousemove")}),d(e).sortable({placeholder:"form-preview-stage-dropzone",connectWith:e,items:".column-field-items",handle:".wpuf-column-field-control-buttons .move",scroll:!0,stop:function(e,t){if("panel"===d(t.item).attr("data-source")){var i={toIndex:parseInt(d(t.item).index()),field_template:d(t.item).attr("data-form-field"),to_column:d(this).parent()[0].classList[0]};s.add_column_inner_field(i),d(this).find(".button.ui-draggable.ui-draggable-handle").remove()}},update:function(e,t){var i=t.item[0],n=i.dataset.source,o={toIndex:parseInt(d(i).index())};"column-field-stage"===n&&(o.field_id=s.field.id,o.fromIndex=parseInt(d(i).attr("column-field-index")),o.fromColumn=d(i).attr("in-column"),o.toColumn=d(i).parent().parent()[0].classList[0],o.fromColumn!==o.toColumn&&1===l?l=0:l++,o.fromColumn===o.toColumn&&(l=1),1===l&&s.$store.commit("swap_column_field_elements",o))}})},computed:{column_fields:function(){return this.field.inner_fields},innerColumns:function(){return this.field.columns},editing_form_id:function(){return this.$store.state.editing_field_id},field_settings:function(){return this.$store.state.field_settings}},methods:{is_template_available:function(e){var t=e.template;return this.field_settings[t]?!this.is_pro_feature(t):!!_.isFunction(this["is_"+t+"_template_available"])&&this["is_"+t+"_template_available"].call(this,e)},is_pro_feature:function(e){return!(!this.field_settings[e]||!this.field_settings[e].pro_feature)},get_field_name:function(e){return this.field_settings[e].title},is_full_width:function(e){return!(!this.field_settings[e]||!this.field_settings[e].is_full_width)},is_invisible:function(e){return!(!e.recaptcha_type||"invisible_recaptcha"!==e.recaptcha_type)},isAllowedInClolumnField:function(e){return 0<=d.inArray(e,["column_field","custom_hidden_field","step_start"])},add_column_inner_field:function(e){var t={toWhichColumnField:this.field.id,toWhichColumnFieldMeta:this.field.name,toIndex:e.toIndex,toWhichColumn:e.to_column};if(this.isAllowedInClolumnField(e.field_template))swal({title:"Oops...",text:"You cannot add this field as inner column field"});else if(this.isSingleInstance(e.field_template)&&this.containsField(e.field_template))swal({title:"Oops...",text:"You already have this field in the form"});else{var i=d.extend(!0,{},this.$store.state.field_settings[e.field_template].field_props),n=this.$store.state.form_fields;if(i.id=this.get_random_id(),"yes"===i.is_meta&&!i.name&&i.label)i.name=i.label.replace(/\W/g,"_").toLowerCase(),n.filter(function(e){return e.template===i.template})&&(i.name+="_"+this.get_random_id());t.field=i,this.$store.commit("add_column_inner_field_element",t)}},moveFieldsTo:function(e){var t={field_id:this.field.id,move_to:e,inner_fields:this.getInnerFields()};this.$store.commit("move_column_inner_fields",t)},getInnerFields:function(){return this.field.inner_fields},open_column_field_settings:function(e,t,i){var n={field_id:this.field.id,column_field:e,index:t,column:i};this.$store.commit("open_column_field_settings",n)},clone_column_field:function(e,t,i){var n={field_id:this.field.id,column_field_id:e.id,index:t,toColumn:i,new_id:this.get_random_id()};this.isSingleInstance(e.template)?swal({title:"Oops...",text:"You already have this field in the form"}):this.$store.commit("clone_column_field_element",n)},delete_column_field:function(e,t){var i=this,n={field_id:i.field.id,index:e,fromColumn:t};swal({text:i.i18n.delete_field_warn_msg,type:"warning",showCancelButton:!0,confirmButtonColor:"#d54e21",confirmButtonText:i.i18n.yes_delete_it,cancelButtonText:i.i18n.no_cancel_it,confirmButtonClass:"btn btn-success",cancelButtonClass:"btn btn-danger"}).then(function(){i.$store.commit("delete_column_field_element",n)},function(){})},resizeColumns:function(n){var o,i,s,l,f=this;s=d(f.$el).parent(),l=parseInt(d(s).width()),Array.prototype.forEach.call(d(f.$el).find(".wpuf-column-field-inner-columns .wpuf-column-inner-fields"),function(t){t.style.position="relative";var e=document.createElement("div");e.innerHTML="&nbsp;",e.style.top=0,e.style.right=0,e.style.bottom=0,e.style.width="5px",e.style.position="absolute",e.style.cursor="col-resize",e.addEventListener("mousedown",function(e){i=(o=t).offsetWidth-e.pageX}),t.appendChild(e)}),d(f.$el).find(".wpuf-column-field-inner-columns .wpuf-column-inner-fields").mousemove(function(e){if(o){var t=i+e.pageX;o.style.width=100*t/l+"%"}}),d(f.$el).find(".wpuf-column-field-inner-columns .wpuf-column-inner-fields").mouseup(function(){var e=0,t=0,i=0;i=3===n?t=e=100/n:(t=2===n?e=100/n:(e=d(s).find(".column-1").width(),d(s).find(".column-2").width()),0),f.field.inner_columns_size["column-1"]=e+"%",f.field.inner_columns_size["column-2"]=t+"%",f.field.inner_columns_size["column-3"]=i+"%",o=void 0})}},watch:{innerColumns:function(e){var t=parseInt(e),i=this.field.inner_columns_size;Object.keys(i).forEach(function(e){1===t&&(i[e]="100%"),2===t&&(i[e]="50%"),3===t&&(i[e]="33.33%")}),1===t&&this.moveFieldsTo("column-1"),2===t&&this.moveFieldsTo("column-2"),this.resizeColumns(t)}}}),Vue.component("form-custom_hidden_field",{template:"#tmpl-wpuf-form-custom_hidden_field",mixins:[wpuf_mixins.form_field_mixin]}),Vue.component("form-custom_html",{template:"#tmpl-wpuf-form-custom_html",mixins:[wpuf_mixins.form_field_mixin],data:function(){return{raw_html:"<p>from data</p>"}}}),Vue.component("form-dropdown_field",{template:"#tmpl-wpuf-form-dropdown_field",mixins:[wpuf_mixins.form_field_mixin]}),Vue.component("form-email_address",{template:"#tmpl-wpuf-form-email_address",mixins:[wpuf_mixins.form_field_mixin]}),Vue.component("form-featured_image",{template:"#tmpl-wpuf-form-featured_image",mixins:[wpuf_mixins.form_field_mixin]}),Vue.component("form-fields",{template:"#tmpl-wpuf-form-fields",mixins:wpuf_form_builder_mixins(wpuf_mixins.form_fields),computed:{panel_sections:function(){return this.$store.state.panel_sections},field_settings:function(){return this.$store.state.field_settings},form_fields:function(){return this.$store.state.form_fields}},created:function(){wpuf_form_builder.event_hub.$on("humanpresence-enabled",this.add_humanpresence_field)},mounted:function(){d(this.$el).find(".panel-form-field-buttons .button").not('[data-form-field="humanpresence"]').draggable({connectToSortable:"#form-preview-stage .wpuf-form, .wpuf-column-inner-fields .wpuf-column-fields-sortable-list",helper:"clone",revert:"invalid",cancel:".button-faded"}).disableSelection()},methods:{panel_toggle:function(e){this.$store.commit("panel_toggle",e)},add_form_field:function(e){var t={toIndex:this.$store.state.form_fields.length};if(this.isSingleInstance(e)&&this.containsField(e))swal({title:"Oops...",text:"You already have this field in the form"});else{var i=d.extend(!0,{},this.$store.state.field_settings[e].field_props);if(i.id=this.get_random_id(),!i.name&&i.label){i.name=i.label.replace(/\W/g,"_").toLowerCase();var n=this.form_fields.filter(function(e){return e.template===i.template});n.length&&(i.name+="_"+n.length)}if("humanpresence"===e){var o=this.$store.state.settings;o.humanpresence_enabled=!0,this.$store.commit("set_form_settings",o)}t.field=i,this.$store.commit("add_form_field_element",t)}},add_humanpresence_field:function(e){this.containsField("humanpresence")||this.add_form_field("humanpresence")},is_pro_feature:function(e){return this.field_settings[e].pro_feature},alert_pro_feature:function(e){var t=this.field_settings[e].title;swal({title:'<i class="fa fa-lock"></i> '+t+" <br>"+this.i18n.is_a_pro_feature,text:this.i18n.pro_feature_msg,type:"",showCancelButton:!0,cancelButtonText:this.i18n.close,confirmButtonColor:"#46b450",confirmButtonText:this.i18n.upgrade_to_pro}).then(function(e){e&&window.open(wpuf_form_builder.pro_link,"_blank")},function(){})},alert_invalidate_msg:function(e){var t=this.field_settings[e].validator;t&&t.msg&&this.warn({title:t.msg_title||"",html:t.msg,type:"warning",showCancelButton:!1,confirmButtonColor:"#46b450",confirmButtonText:this.i18n.ok})},get_invalidate_btn_class:function(e){return this.field_settings[e].validator.button_class}}}),Vue.component("form-image_upload",{template:"#tmpl-wpuf-form-image_upload",mixins:[wpuf_mixins.form_field_mixin]}),Vue.component("form-multiple_select",{template:"#tmpl-wpuf-form-multiple_select",mixins:[wpuf_mixins.form_field_mixin]}),Vue.component("form-post_content",{template:"#tmpl-wpuf-form-post_content",mixins:[wpuf_mixins.form_field_mixin]}),Vue.component("form-post_excerpt",{template:"#tmpl-wpuf-form-post_excerpt",mixins:[wpuf_mixins.form_field_mixin]}),Vue.component("form-post_tags",{template:"#tmpl-wpuf-form-post_tags",mixins:[wpuf_mixins.form_field_mixin]}),Vue.component("form-post_title",{template:"#tmpl-wpuf-form-post_title",mixins:[wpuf_mixins.form_field_mixin]}),Vue.component("form-radio_field",{template:"#tmpl-wpuf-form-radio_field",mixins:[wpuf_mixins.form_field_mixin]}),Vue.component("form-recaptcha",{template:"#tmpl-wpuf-form-recaptcha",mixins:[wpuf_mixins.form_field_mixin],computed:{has_recaptcha_api_keys:function(){return!(!wpuf_form_builder.recaptcha_site||!wpuf_form_builder.recaptcha_secret)},no_api_keys_msg:function(){return wpuf_form_builder.field_settings.recaptcha.validator.msg}}}),Vue.component("form-humanpresence",{template:"#tmpl-wpuf-form-humanpresence",mixins:[wpuf_mixins.form_field_mixin],computed:{has_humanpresence_installed:function(){return wpuf_form_builder.humanpresence_installed},no_humanpresence_installed_msg:function(){return wpuf_form_builder.field_settings.humanpresence.validator.msg}}}),Vue.component("form-section_break",{template:"#tmpl-wpuf-form-section_break",mixins:[wpuf_mixins.form_field_mixin]}),Vue.component("form-taxonomy",{template:"#tmpl-wpuf-form-taxonomy",mixins:[wpuf_mixins.form_field_mixin],computed:{terms:function(){var e;for(e in wpuf_form_builder.wp_post_types){var t=wpuf_form_builder.wp_post_types[e];if(t.hasOwnProperty(this.field.name)){var i=t[this.field.name];if(i.terms)return i.terms}}return[]},sorted_terms:function(){var t=this,i=d.extend(!0,[],this.terms);if(this.field.exclude_type&&this.field.exclude){if(1<this.field.exclude.length)var n=this.field.exclude.split(",").map(function(e){return e=e.trim(),e=parseInt(e)}).filter(function(e){return isFinite(e)});i=i.filter(function(e){switch(t.field.exclude_type){case"exclude":return _.indexOf(n,e.term_id)<0;case"include":return 0<=_.indexOf(n,e.term_id);case"child_of":return 0<=_.indexOf(n,parseInt(e.parent))}})}i=_.sortBy(i,function(e){return e[t.field.orderby]}),"DESC"===this.field.order&&(i=i.reverse());var e=i.filter(function(e){return!e.parent});return e.map(function(e){e.children=t.get_child_terms(e.term_id,i)}),e.length?e:i}},methods:{get_child_terms:function(t,i){var n=this,e=i.filter(function(e){return parseInt(e.parent)===parseInt(t)});return e.map(function(e){e.children=n.get_child_terms(e.term_id,i)}),e},get_term_dropdown_options:function(){var t=this,i="";return"select"===this.field.type&&(i='<option value="">'+this.field.first+"</option>"),_.each(t.sorted_terms,function(e){i+=t.get_term_dropdown_options_children(e,0)}),i},get_term_dropdown_options_children:function(e,t){var i=this,n="",o="",s=0;for(s=0;s<t;s++)o+="&nbsp;&nbsp;";return n+='<option value="'+e.id+'">'+o+e.name+"</option>",e.children.length&&_.each(e.children,function(e){n+=i.get_term_dropdown_options_children(e,t+1)}),n},get_term_checklist:function(){var t=this,i="";return i+='<ul class="wpuf-category-checklist">',_.each(this.sorted_terms,function(e){i+=t.get_term_checklist_li(e)}),i+="</ul>"},get_term_checklist_li:function(e){var t=this,i="";return i+='<li><label class="selectit"><input type="checkbox"> '+e.name+"</label></li>",e.children.length&&(i+='<ul class="children">',_.each(e.children,function(e){i+=t.get_term_checklist_li(e)}),i+="</ul>"),i},get_term_checklist_inline:function(){var t=this,i="";return _.each(this.sorted_terms,function(e){i+=t.get_term_checklist_li_inline(e)}),i},get_term_checklist_li_inline:function(e){var t=this,i="";return i+='<label class="wpuf-checkbox-inline"><input type="checkbox"> '+e.name+"</label>",e.children.length&&_.each(e.children,function(e){i+=t.get_term_checklist_li_inline(e)}),i}}}),Vue.component("form-text_field",{template:"#tmpl-wpuf-form-text_field",mixins:[wpuf_mixins.form_field_mixin]}),Vue.component("form-textarea_field",{template:"#tmpl-wpuf-form-textarea_field",mixins:[wpuf_mixins.form_field_mixin]}),Vue.component("form-website_url",{template:"#tmpl-wpuf-form-website_url",mixins:[wpuf_mixins.form_field_mixin]}),Vue.component("help-text",{template:"#tmpl-wpuf-help-text",props:{text:{type:String,default:""}},mounted:function(){d(".wpuf-tooltip").tooltip()}}),Vue.component("text-editor",{template:"#tmpl-wpuf-text-editor",props:["rich","default_text"],computed:{site_url:function(){return wpuf_form_builder.site_url},is_full:function(){return"yes"===this.rich}}})}(jQuery);
  • weforms/tags/1.6.6/assets/wpuf/js/wpuf-form-builder-mixins.js

    r2403226 r2514969  
    102102        },
    103103
     104        has_humanpresence_installed: function () {
     105            return wpuf_form_builder.humanpresence_installed;
     106        },
     107
     108        no_humanpresence_installed_msg: function no_humanpresence_installed_msg() {
     109            return wpuf_form_builder.field_settings.humanpresence.validator.msg;
     110        },
     111
     112        change_humanpresence: function change_humanpresence(e) {
     113            wpuf_form_builder.event_hub.$emit('humanpresence-changed', e, this);
     114        },
     115
    104116        containsField: function(field_name) {
    105117            var self = this,
     
    138150            var singleInstance = ['post_title', 'post_content', 'post_excerpt', 'featured_image',
    139151                'user_login', 'first_name', 'last_name', 'nickname', 'user_email', 'user_url',
    140                 'user_bio', 'password', 'user_avatar', 'taxonomy'];
     152                'user_bio', 'password', 'user_avatar', 'taxonomy', 'humanpresence'];
    141153
    142154            if ( $.inArray(field_name, singleInstance) >= 0 ) {
  • weforms/tags/1.6.6/includes/admin/class-admin.php

    r2477338 r2514969  
    2222        add_action( 'weforms_settings_tab_content_recaptcha', [ $this, 'settings_tab_recaptcha' ] );
    2323        add_action( 'weforms_settings_tab_content_secure-database', [ $this, 'settings_tab_secure_database' ] );
     24        add_action( 'weforms_settings_tab_content_humanpresence', [ $this, 'settings_tab_humanpresence' ] );
    2425        add_action( 'weforms_settings_tab_content_privacy', [ $this, 'settings_tab_privacy' ] );
    2526    }
     
    338339        ];
    339340
     341        $tabs['humanpresence'] = [
     342            'label' => __( 'Human Presence', 'weforms' ),
     343            'icon'  => WEFORMS_ASSET_URI . '/images/integrations/hp-shield.svg',
     344        ];
     345
    340346        /* TODO:  Refactor this block when more options are added in privacy settings*/
    341347        if ( class_exists( 'WeForms_Pro' ) ) {
     
    379385    public function settings_tab_secure_database( $tab ) {
    380386        include __DIR__ . '/views/weforms-settings-secure-database.php';
     387    }
     388    /**
     389     * Human Presence tab content
     390     *
     391     * @param array $tab
     392     *
     393     * @return void
     394     */
     395    public function settings_tab_humanpresence( $tab ) {
     396        include __DIR__ . '/views/weforms-settings-humanpresence.php';
    381397    }
    382398    /**
  • weforms/tags/1.6.6/includes/admin/class-form-builder-assets.php

    r2477338 r2514969  
    1111
    1212    public function init_actions() {
     13        add_action( 'in_admin_header', [ $this, 'remove_admin_notices' ] );
    1314        add_action( 'admin_enqueue_scripts', [ $this, 'builder_enqueue_scripts' ], 2000 );
    1415        add_action( 'admin_print_scripts', [ $this, 'builder_mixins_script' ] );
     
    3233
    3334        $recaptcha = weforms_get_settings( 'recaptcha' );
     35        $humanpresence = get_option( 'wp-human-presence', array() );
    3436
    3537        $wpuf_form_builder = apply_filters( 'wpuf-form-builder-localize-script', [
     
    6567                ],
    6668            ],
    67             'integrations'     => weforms()->integrations->get_integration_js_settings(),
    68             'recaptcha_site'   => isset( $recaptcha->key ) ? $recaptcha->key : '',
    69             'recaptcha_secret' => isset( $recaptcha->secret ) ? $recaptcha->secret : '',
     69            'integrations'              => weforms()->integrations->get_integration_js_settings(),
     70            'recaptcha_site'            => isset( $recaptcha->key ) ? $recaptcha->key : '',
     71            'recaptcha_secret'          => isset( $recaptcha->secret ) ? $recaptcha->secret : '',
     72            'humanpresence_installed'   => (
     73                class_exists( 'HumanPresenceWEFormsIntegration' ) &&
     74                isset( $humanpresence['wp_hp_premium_license'] ) &&
     75                $humanpresence['wp_hp_premium_license'] )
     76                ? true : false,
    7077        ] );
    7178
     
    9097            'shortcodes'      => $this->shortcodes(),
    9198            'settings'        => [
    92                 'recaptcha' => weforms_get_settings( 'recaptcha' ),
     99                'recaptcha'     => weforms_get_settings( 'recaptcha' ),
    93100            ],
    94101        ] );
     
    340347            <a href="#" :class="['nav-tab', isActiveSettingsTab( 'restriction' ) ? 'nav-tab-active' : '']" v-on:click.prevent="makeActiveSettingsTab( 'restriction' )" class="nav-tab"><?php esc_html_e( 'Submission Restriction', 'weforms' ); ?></a>
    341348            <a href="#" :class="['nav-tab', isActiveSettingsTab( 'display' ) ? 'nav-tab-active' : '']" v-on:click.prevent="makeActiveSettingsTab( 'display' )" class="nav-tab"><?php esc_html_e( 'Display Settings', 'weforms' ); ?></a>
     349            <a href="#" :class="['nav-tab', isActiveSettingsTab( 'humanpresence' ) ? 'nav-tab-active' : '']" v-on:click.prevent="makeActiveSettingsTab( 'humanpresence' )" class="nav-tab"><i aria-hidden="true" class="fa fa-humanpresence"></i> <?php esc_html_e( 'HP Anti-Spam', 'weforms' ); ?></a>
    342350
    343351            <?php do_action( 'wpuf_contact_form_settings_tab' ); ?>
     
    365373            </div>
    366374
     375            <div id="wpuf-metabox-settings-humanpresence" class="tab-content" v-show="isActiveSettingsTab('humanpresence')">
     376                <?php include_once __DIR__ . '/views/humanpresence-settings.php'; ?>
     377            </div>
     378
    367379            <?php do_action( 'wpuf_contact_form_settings_tab_content' ); ?>
    368380
  • weforms/tags/1.6.6/includes/class-field-manager.php

    r2403226 r2514969  
    5959        require_once __DIR__ . '/fields/class-field-image.php';
    6060        require_once __DIR__ . '/fields/class-field-recaptcha.php';
     61        require_once __DIR__ . '/fields/class-field-humanpresence.php';
    6162        require_once __DIR__ . '/fields/class-field-date.php';
    6263
     
    7879            'image_upload'        => new WeForms_Form_Field_Image(),
    7980            'recaptcha'           => new WeForms_Form_Field_reCaptcha(),
     81            'humanpresence'       => new WeForms_Form_Field_HumanPresence(),
    8082        ];
    8183
     
    119121                        'custom_html',
    120122                        'recaptcha',
     123                        'humanpresence'
    121124                    ]
    122125                  ),
  • weforms/tags/1.6.6/includes/class-form-entry.php

    r2403226 r2514969  
    354354                        }
    355355                    } elseif ( $field['type'] == 'signature_field' ) {
    356                         $url   = content_url() . $value;
    357                         $value = $url;
     356                        $url   =  $value;
    358357
    359358                        if ( isset( $_REQUEST['action'] ) != 'weforms_pdf_download' ) {
     359                            $url   = content_url() . '/' . $value;
    360360                            $value = sprintf( '<img src="%s">', $url );
    361361                            $value .= sprintf( '<a style="margin-left: -200px" href="%s">Download</a>', $url );
     362                        }
     363                        else{
     364                            $value = sprintf( '<img src="%s">', $url );
    362365                        }
    363366                    }
  • weforms/tags/1.6.6/includes/class-form-manager.php

    r2403226 r2514969  
    183183        update_post_meta( $data['form_id'], '_weforms_version', WEFORMS_VERSION );
    184184
     185        do_action( 'weforms_after_save_form', $data['form_id'], $data['form_fields'], $data['form_settings'] );
     186
    185187        return $saved_wpuf_inputs;
    186188    }
  • weforms/tags/1.6.6/includes/class-form.php

    r2403226 r2514969  
    140140            }
    141141
    142             $form_fields[] = apply_filters( 'weforms-get-form-field', $field );
    143         }
    144 
    145         $this->form_fields = apply_filters( 'weforms-get-form-fields', $form_fields );
     142            $form_fields[] = apply_filters( 'weforms-get-form-field', $field, $this->id );
     143        }
     144
     145        $this->form_fields = apply_filters( 'weforms-get-form-fields', $form_fields, $this->id );
    146146
    147147        return $this->form_fields;
     
    272272        $default  = weforms_get_default_form_settings();
    273273
    274         return array_merge( $default, $settings );
     274        return apply_filters( 'weforms-get-form-settings', array_merge( $default, $settings ), $this->id );
    275275    }
    276276
  • weforms/tags/1.6.6/includes/functions.php

    r2445228 r2514969  
    11161116            'enable_multistep'           => false,
    11171117            'multistep_progressbar_type' => 'progressive',
     1118            'humanpresence_enabled'      => false,
    11181119
    11191120            // payment
  • weforms/tags/1.6.6/includes/importer/class-importer-abstract.php

    r2403226 r2514969  
    895895    public function get_default_form_settings() {
    896896        $form_settings = [
    897             'redirect_to'        => 'same',
    898             'message'            => __( 'Thanks for contacting us! We will get in touch with you shortly.', 'weforms' ),
    899             'page_id'            => '',
    900             'url'                => '',
    901             'submit_text'        => __( 'Submit Query', 'weforms' ),
    902             'schedule_form'      => 'false',
    903             'schedule_start'     => '',
    904             'schedule_end'       => '',
    905             'sc_pending_message' => __( 'Form submission hasn\'t been started yet', 'weforms' ),
    906             'sc_expired_message' => __( 'Form submission is now closed.', 'weforms' ),
    907             'require_login'      => 'false',
    908             'req_login_message'  => __( 'You need to login to submit a query.', 'weforms' ),
    909             'limit_entries'      => 'false',
    910             'limit_number'       => '1000',
    911             'limit_message'      => __( 'Sorry, we have reached the maximum number of submissions.', 'weforms' ),
    912             'label_position'     => 'above',
     897            'redirect_to'           => 'same',
     898            'message'               => __( 'Thanks for contacting us! We will get in touch with you shortly.', 'weforms' ),
     899            'page_id'               => '',
     900            'url'                   => '',
     901            'submit_text'           => __( 'Submit Query', 'weforms' ),
     902            'schedule_form'         => 'false',
     903            'schedule_start'        => '',
     904            'schedule_end'          => '',
     905            'humanpresence_enabled' => false,
     906            'sc_pending_message'    => __( 'Form submission hasn\'t been started yet', 'weforms' ),
     907            'sc_expired_message'    => __( 'Form submission is now closed.', 'weforms' ),
     908            'require_login'         => 'false',
     909            'req_login_message'     => __( 'You need to login to submit a query.', 'weforms' ),
     910            'limit_entries'         => 'false',
     911            'limit_number'          => '1000',
     912            'limit_message'         => __( 'Sorry, we have reached the maximum number of submissions.', 'weforms' ),
     913            'label_position'        => 'above',
    913914        ];
    914915
  • weforms/tags/1.6.6/languages/weforms.pot

    r2477338 r2514969  
    55"Project-Id-Version: weForms 1.6.5\n"
    66"Report-Msgid-Bugs-To: https://wedevs.com/contact/\n"
    7 "POT-Creation-Date: 2021-02-18 21:24:28+00:00\n"
     7"POT-Creation-Date: 2021-04-14 15:13:35+00:00\n"
    88"MIME-Version: 1.0\n"
    99"Content-Type: text/plain; charset=utf-8\n"
     
    5959msgstr ""
    6060
    61 #: includes/admin/class-admin.php:36 includes/admin/class-admin.php:58
     61#: includes/admin/class-admin.php:37 includes/admin/class-admin.php:59
    6262msgid "Contact Forms"
    6363msgstr ""
    6464
    65 #: includes/admin/class-admin.php:56
     65#: includes/admin/class-admin.php:57
    6666msgid "Forms"
    6767msgstr ""
    6868
    69 #: includes/admin/class-admin.php:57 includes/class-form-widget.php:49
     69#: includes/admin/class-admin.php:58 includes/class-form-widget.php:49
    7070#: includes/functions.php:753
    7171msgid "Form"
    7272msgstr ""
    7373
    74 #: includes/admin/class-admin.php:59
     74#: includes/admin/class-admin.php:60
    7575msgid "Add Form"
    7676msgstr ""
    7777
    78 #: includes/admin/class-admin.php:60
     78#: includes/admin/class-admin.php:61
    7979msgid "Add New Form"
    8080msgstr ""
    8181
    82 #: includes/admin/class-admin.php:61
     82#: includes/admin/class-admin.php:62
    8383msgid "Edit"
    8484msgstr ""
    8585
    86 #: includes/admin/class-admin.php:62
     86#: includes/admin/class-admin.php:63
    8787msgid "Edit Form"
    8888msgstr ""
    8989
    90 #: includes/admin/class-admin.php:63
     90#: includes/admin/class-admin.php:64
    9191msgid "New Form"
    9292msgstr ""
    9393
    94 #: includes/admin/class-admin.php:64 includes/admin/class-admin.php:65
     94#: includes/admin/class-admin.php:65 includes/admin/class-admin.php:66
    9595msgid "View Form"
    9696msgstr ""
    9797
    98 #: includes/admin/class-admin.php:66
     98#: includes/admin/class-admin.php:67
    9999msgid "Search Form"
    100100msgstr ""
    101101
    102 #: includes/admin/class-admin.php:67
     102#: includes/admin/class-admin.php:68
    103103msgid "No Form Found"
    104104msgstr ""
    105105
    106 #: includes/admin/class-admin.php:68
     106#: includes/admin/class-admin.php:69
    107107msgid "No Form Found in Trash"
    108108msgstr ""
    109109
    110 #: includes/admin/class-admin.php:69
     110#: includes/admin/class-admin.php:70
    111111msgid "Parent Form"
    112112msgstr ""
    113113
    114 #: includes/admin/class-admin.php:84
     114#: includes/admin/class-admin.php:85
    115115msgid "weForms - The Best Contact Form"
    116116msgstr ""
    117117
    118 #: includes/admin/class-admin.php:87
     118#: includes/admin/class-admin.php:88
    119119msgid "All Forms"
    120120msgstr ""
    121121
    122 #: includes/admin/class-admin.php:88
     122#: includes/admin/class-admin.php:89
    123123msgid "Entries"
    124124msgstr ""
    125125
    126 #: includes/admin/class-admin.php:89
     126#: includes/admin/class-admin.php:90
    127127msgid "Tools"
    128128msgstr ""
    129129
    130 #: includes/admin/class-admin.php:93
     130#: includes/admin/class-admin.php:94
    131131msgid "Modules"
    132132msgstr ""
    133133
    134 #: includes/admin/class-admin.php:96
     134#: includes/admin/class-admin.php:97
    135135#: includes/admin/views/weforms-settings-general.php:14
    136136#: includes/admin/views/weforms-settings-general.php:15
     
    139139msgstr ""
    140140
    141 #: includes/admin/class-admin.php:101
     141#: includes/admin/class-admin.php:102
    142142msgid "<span style=\"color:#f18500\">Help</span>"
    143143msgstr ""
    144144
    145 #: includes/admin/class-admin.php:102 includes/admin/class-admin.php:343
     145#: includes/admin/class-admin.php:103 includes/admin/class-admin.php:349
    146146#: includes/admin/views/weforms-settings-privacy.php:1
    147147msgid "Privacy"
    148148msgstr ""
    149149
    150 #: includes/admin/class-admin.php:107 weforms.php:394
     150#: includes/admin/class-admin.php:108 weforms.php:394
    151151msgid "Settings"
    152152msgstr ""
    153153
    154 #: includes/admin/class-admin.php:186
     154#: includes/admin/class-admin.php:187
    155155#: includes/api/class-weforms-forms-controller.php:1368
    156156#: includes/functions.php:773
     
    158158msgstr ""
    159159
    160 #: includes/admin/class-admin.php:187
     160#: includes/admin/class-admin.php:188
    161161#: includes/api/class-weforms-forms-controller.php:1369
    162162#: includes/functions.php:764
     
    165165msgstr ""
    166166
    167 #: includes/admin/class-admin.php:308
     167#: includes/admin/class-admin.php:309
    168168msgid "If you like %1$s please leave us a %2$s rating."
    169169msgstr ""
     
    173173msgstr ""
    174174
    175 #: includes/admin/class-admin.php:326
     175#: includes/admin/class-admin.php:327
    176176#: includes/admin/views/weforms-settings-general.php:1
    177177msgid "General Settings"
    178178msgstr ""
    179179
    180 #: includes/admin/class-admin.php:331
     180#: includes/admin/class-admin.php:332
    181181#: includes/admin/views/weforms-settings-recaptcha.php:1
    182182#: includes/fields/class-field-recaptcha.php:9
     
    184184msgstr ""
    185185
    186 #: includes/admin/class-admin.php:336
     186#: includes/admin/class-admin.php:337
    187187#: includes/admin/views/weforms-settings-secure-database.php:1
    188188msgid "Secure Database"
    189189msgstr ""
    190190
    191 #: includes/admin/class-admin.php:409
     191#: includes/admin/class-admin.php:342
     192#: includes/admin/views/humanpresence-settings.php:3
     193#: includes/admin/views/weforms-settings-humanpresence.php:1
     194msgid "Human Presence"
     195msgstr ""
     196
     197#: includes/admin/class-admin.php:425
    192198msgid ""
    193199"You&#39;re using weForms Free. For more features, modules and more consider "
     
    195201msgstr ""
    196202
    197 #: includes/admin/class-admin.php:412
     203#: includes/admin/class-admin.php:428
    198204msgid "UPGRADE NOW!"
    199205msgstr ""
    200206
    201 #: includes/admin/class-form-builder-assets.php:45 includes/functions.php:1167
    202 #: includes/functions.php:1170
     207#: includes/admin/class-form-builder-assets.php:47 includes/functions.php:1168
     208#: includes/functions.php:1171
    203209msgid "New Form Submission"
    204210msgstr ""
    205211
    206 #: includes/admin/class-form-builder-assets.php:82
    207 #: includes/admin/class-form-builder-assets.php:291
     212#: includes/admin/class-form-builder-assets.php:89
     213#: includes/admin/class-form-builder-assets.php:298
    208214#: includes/class-scripts-styles.php:426
    209215msgid "Are you sure?"
    210216msgstr ""
    211217
    212 #: includes/admin/class-form-builder-assets.php:261
     218#: includes/admin/class-form-builder-assets.php:268
    213219msgid "Advanced Options"
    214220msgstr ""
    215221
    216 #: includes/admin/class-form-builder-assets.php:262
     222#: includes/admin/class-form-builder-assets.php:269
    217223msgid "Quiz Options"
    218224msgstr ""
    219225
    220 #: includes/admin/class-form-builder-assets.php:263
     226#: includes/admin/class-form-builder-assets.php:270
    221227msgid "Are you sure you want to delete this field?"
    222228msgstr ""
    223229
    224 #: includes/admin/class-form-builder-assets.php:264
     230#: includes/admin/class-form-builder-assets.php:271
    225231#: includes/class-scripts-styles.php:427
    226232msgid "Yes, delete it"
    227233msgstr ""
    228234
    229 #: includes/admin/class-form-builder-assets.php:265
     235#: includes/admin/class-form-builder-assets.php:272
    230236#: includes/class-scripts-styles.php:428
    231237msgid "No, cancel it"
    232238msgstr ""
    233239
    234 #: includes/admin/class-form-builder-assets.php:266
     240#: includes/admin/class-form-builder-assets.php:273
    235241msgid "OK"
    236242msgstr ""
    237243
    238 #: includes/admin/class-form-builder-assets.php:267
     244#: includes/admin/class-form-builder-assets.php:274
    239245#: includes/library/appsero/Insights.php:677
    240246msgid "Cancel"
    241247msgstr ""
    242248
    243 #: includes/admin/class-form-builder-assets.php:268
     249#: includes/admin/class-form-builder-assets.php:275
    244250#: includes/admin/class-shortcode-button.php:84
    245251msgid "Close"
    246252msgstr ""
    247253
    248 #: includes/admin/class-form-builder-assets.php:269
     254#: includes/admin/class-form-builder-assets.php:276
    249255msgid "Disable"
    250256msgstr ""
    251257
    252 #: includes/admin/class-form-builder-assets.php:270
     258#: includes/admin/class-form-builder-assets.php:277
    253259msgid "This field must contain at least one choice"
    254260msgstr ""
    255261
    256 #: includes/admin/class-form-builder-assets.php:271
     262#: includes/admin/class-form-builder-assets.php:278
    257263#: includes/fields/class-field-checkbox.php:90
    258264#: includes/fields/class-field-dropdown.php:93
     
    262268msgstr ""
    263269
    264 #: includes/admin/class-form-builder-assets.php:272
     270#: includes/admin/class-form-builder-assets.php:279
    265271msgid "Row"
    266272msgstr ""
    267273
    268 #: includes/admin/class-form-builder-assets.php:273
     274#: includes/admin/class-form-builder-assets.php:280
    269275msgid "Column"
    270276msgstr ""
    271277
    272 #: includes/admin/class-form-builder-assets.php:274
     278#: includes/admin/class-form-builder-assets.php:281
    273279msgid "This field must contain at least one column"
    274280msgstr ""
    275281
    276 #: includes/admin/class-form-builder-assets.php:275
     282#: includes/admin/class-form-builder-assets.php:282
    277283msgid "is available in Pro version"
    278284msgstr ""
    279285
    280 #: includes/admin/class-form-builder-assets.php:276
     286#: includes/admin/class-form-builder-assets.php:283
    281287msgid "Please upgrade to the Pro version to unlock all these awesome features"
    282288msgstr ""
    283289
    284 #: includes/admin/class-form-builder-assets.php:277
     290#: includes/admin/class-form-builder-assets.php:284
    285291msgid "Get the Pro version"
    286292msgstr ""
    287293
    288 #: includes/admin/class-form-builder-assets.php:278
     294#: includes/admin/class-form-builder-assets.php:285
    289295msgid "Select"
    290296msgstr ""
    291297
    292 #: includes/admin/class-form-builder-assets.php:279
     298#: includes/admin/class-form-builder-assets.php:286
    293299msgid "Saved form data"
    294300msgstr ""
    295301
    296 #: includes/admin/class-form-builder-assets.php:280
     302#: includes/admin/class-form-builder-assets.php:287
    297303msgid "You have unsaved changes."
    298304msgstr ""
    299305
    300 #: includes/admin/class-form-builder-assets.php:281
     306#: includes/admin/class-form-builder-assets.php:288
    301307msgid "Are you sure to leave this page?"
    302308msgstr ""
    303309
    304 #: includes/admin/class-form-builder-assets.php:282
     310#: includes/admin/class-form-builder-assets.php:289
    305311msgid "Click to copy shortcode"
    306312msgstr ""
    307313
    308 #: includes/admin/class-form-builder-assets.php:284
     314#: includes/admin/class-form-builder-assets.php:291
    309315msgid "Select an image"
    310316msgstr ""
    311317
    312 #: includes/admin/class-form-builder-assets.php:285
     318#: includes/admin/class-form-builder-assets.php:292
    313319msgid "Please select an image"
    314320msgstr ""
    315321
    316 #: includes/admin/class-form-builder-assets.php:286
     322#: includes/admin/class-form-builder-assets.php:293
    317323msgid "Upload an image"
    318324msgstr ""
    319325
    320 #: includes/admin/class-form-builder-assets.php:288
     326#: includes/admin/class-form-builder-assets.php:295
    321327msgid "Share Your Form"
    322328msgstr ""
    323329
    324 #: includes/admin/class-form-builder-assets.php:289
     330#: includes/admin/class-form-builder-assets.php:296
    325331msgid ""
    326332"Sharing your form enables <strong>anyone</strong> to view and submit the "
     
    328334msgstr ""
    329335
    330 #: includes/admin/class-form-builder-assets.php:290
     336#: includes/admin/class-form-builder-assets.php:297
    331337msgid "Anyone with this URL will be able to view and submit this form."
    332338msgstr ""
    333339
    334 #: includes/admin/class-form-builder-assets.php:292
     340#: includes/admin/class-form-builder-assets.php:299
    335341msgid "You must select a notification"
    336342msgstr ""
    337343
    338 #: includes/admin/class-form-builder-assets.php:293
     344#: includes/admin/class-form-builder-assets.php:300
    339345msgid "Anyone with existing URL won't be able to view and submit the form anymore."
    340346msgstr ""
    341347
    342 #: includes/admin/class-form-builder-assets.php:294
     348#: includes/admin/class-form-builder-assets.php:301
    343349msgid "Disable Sharing"
    344350msgstr ""
    345351
    346 #: includes/admin/class-form-builder-assets.php:316
     352#: includes/admin/class-form-builder-assets.php:323
    347353msgid "Notifications"
    348354msgstr ""
    349355
    350 #: includes/admin/class-form-builder-assets.php:317
     356#: includes/admin/class-form-builder-assets.php:324
    351357msgid "Integrations"
    352358msgstr ""
    353359
    354 #: includes/admin/class-form-builder-assets.php:339
     360#: includes/admin/class-form-builder-assets.php:346
    355361msgid "Form Settings"
    356362msgstr ""
    357363
    358 #: includes/admin/class-form-builder-assets.php:340
     364#: includes/admin/class-form-builder-assets.php:347
    359365msgid "Submission Restriction"
    360366msgstr ""
    361367
    362 #: includes/admin/class-form-builder-assets.php:341
     368#: includes/admin/class-form-builder-assets.php:348
    363369msgid "Display Settings"
    364370msgstr ""
    365371
    366 #: includes/admin/class-form-builder-assets.php:376
     372#: includes/admin/class-form-builder-assets.php:349
     373#: includes/fields/class-field-humanpresence.php:9
     374msgid "HP Anti-Spam"
     375msgstr ""
     376
     377#: includes/admin/class-form-builder-assets.php:388
    367378#: includes/admin/class-privacy.php:242 includes/functions.php:771
    368379msgid "User"
    369380msgstr ""
    370381
    371 #: includes/admin/class-form-builder-assets.php:378 includes/functions.php:775
     382#: includes/admin/class-form-builder-assets.php:390 includes/functions.php:775
    372383#: includes/integrations/mailpoet/component/template.php:38
    373384#: includes/templates/class-template-conference-proposal.php:33
     
    10971108msgstr ""
    10981109
     1110#: includes/admin/views/humanpresence-settings.php:8
     1111msgid "Enable HP Anti-Spam"
     1112msgstr ""
     1113
    10991114#: includes/admin/views/submission-restriction.php:4
    11001115msgid "Schedule form"
     
    12681283#: includes/admin/views/weforms-settings-recaptcha.php:34
    12691284msgid "Save Changes"
     1285msgstr ""
     1286
     1287#: includes/admin/views/weforms-settings-humanpresence.php:5
     1288msgid ""
     1289"Human Presence takes a revolutionary approach to BOT detection and website "
     1290"security that utilizes \"human-centered\" learning algorithms to protect "
     1291"against suspicious activity."
     1292msgstr ""
     1293
     1294#: includes/admin/views/weforms-settings-humanpresence.php:8
     1295msgid "Ready to protect your forms? "
     1296msgstr ""
     1297
     1298#: includes/admin/views/weforms-settings-humanpresence.php:8
     1299msgid "Click here to receive a special discount on Human Presence for weForms"
    12701300msgstr ""
    12711301
     
    16581688msgstr ""
    16591689
    1660 #: includes/class-field-manager.php:93
     1690#: includes/class-field-manager.php:95
    16611691msgid "Custom Fields"
    16621692msgstr ""
    16631693
    1664 #: includes/class-field-manager.php:113
     1694#: includes/class-field-manager.php:115
    16651695msgid "Others"
    16661696msgstr ""
     
    20712101msgstr ""
    20722102
     2103#: includes/fields/class-field-humanpresence.php:35
     2104msgid "Human Presence Anti-Spam Required"
     2105msgstr ""
     2106
     2107#: includes/fields/class-field-humanpresence.php:37
     2108msgid ""
     2109"To enable Human Presence Anti-Spam on weForms, <a href=\"%s\" "
     2110"target=\"_blank\">Install and activate the plugin</a> on your site. Once "
     2111"installed, toggle on the weForms form you want to protect."
     2112msgstr ""
     2113
    20732114#: includes/fields/class-field-image.php:9
    20742115msgid "Image Upload"
     
    24042445
    24052446#: includes/functions.php:1102
    2406 #: includes/importer/class-importer-abstract.php:905
     2447#: includes/importer/class-importer-abstract.php:906
    24072448msgid "Form submission hasn't been started yet"
    24082449msgstr ""
    24092450
    24102451#: includes/functions.php:1103
    2411 #: includes/importer/class-importer-abstract.php:906
     2452#: includes/importer/class-importer-abstract.php:907
    24122453msgid "Form submission is now closed."
    24132454msgstr ""
    24142455
    24152456#: includes/functions.php:1105
    2416 #: includes/importer/class-importer-abstract.php:908
     2457#: includes/importer/class-importer-abstract.php:909
    24172458msgid "You need to login to submit a query."
    24182459msgstr ""
    24192460
    24202461#: includes/functions.php:1108
    2421 #: includes/importer/class-importer-abstract.php:911
     2462#: includes/importer/class-importer-abstract.php:912
    24222463msgid "Sorry, we have reached the maximum number of submissions."
    24232464msgstr ""
    24242465
    2425 #: includes/functions.php:1122
     2466#: includes/functions.php:1123
    24262467msgid "PayPal"
    24272468msgstr ""
    24282469
    2429 #: includes/functions.php:1123
     2470#: includes/functions.php:1124
    24302471msgid "Credit Card"
    24312472msgstr ""
    24322473
    2433 #: includes/functions.php:1169
     2474#: includes/functions.php:1170
    24342475msgid "Admin Notification"
    24352476msgstr ""
  • weforms/tags/1.6.6/readme.txt

    r2477338 r2514969  
    44Requires at least: 4.4
    55Requires PHP: 5.6.20
    6 Tested up to: 5.6
    7 Stable tag: 1.6.5
     6Tested up to: 5.7
     7Stable tag: 1.6.6
    88License: GPLv2 or later
    99License URI: https://www.gnu.org/licenses/gpl-2.0.html
     
    250250== Changelog ==
    251251
     252= Version 1.6.6 (13 April, 2021) =
     253* **Fix:** Front End report link fixes
     254* **Fix:** Signature Displays in Entries
     255* **Update:** jQuery updates for Columns
     256
     257
    252258= Version 1.6.5 (18 February, 2021) =
    253259* **Fix:** Updated admin notices to better conform to WordPress design standards, and configured them to only show on WeForms pages.
  • weforms/tags/1.6.6/weforms.php

    r2477338 r2514969  
    66 * Author: weForms
    77 * Author URI: https://weformspro.com/
    8  * Version: 1.6.5
     8 * Version: 1.6.6
    99 * License: GPL2 or later
    1010 * License URI: https://www.gnu.org/licenses/gpl-2.0.html
     
    5656     * @var string
    5757     */
    58     public $version = '1.6.5';
     58    public $version = '1.6.6';
    5959
    6060    /**
  • weforms/trunk/assets/js/spa-app.js

    r2477338 r2514969  
    11'use strict';
    22
    3 var _typeof9 = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
     3var _typeof11 = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
     4
     5var _typeof10 = typeof Symbol === "function" && _typeof11(Symbol.iterator) === "symbol" ? function (obj) {
     6    return typeof obj === "undefined" ? "undefined" : _typeof11(obj);
     7} : function (obj) {
     8    return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj === "undefined" ? "undefined" : _typeof11(obj);
     9};
     10
     11var _typeof9 = typeof Symbol === "function" && _typeof10(Symbol.iterator) === "symbol" ? function (obj) {
     12    return typeof obj === "undefined" ? "undefined" : _typeof10(obj);
     13} : function (obj) {
     14    return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj === "undefined" ? "undefined" : _typeof10(obj);
     15};
    416
    517var _typeof8 = typeof Symbol === "function" && _typeof9(Symbol.iterator) === "symbol" ? function (obj) {
  • weforms/trunk/assets/js/spa-app.min.js

    r2477338 r2514969  
    1 "use strict";var _typeof9="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},_typeof8="function"==typeof Symbol&&"symbol"===_typeof9(Symbol.iterator)?function(e){return void 0===e?"undefined":_typeof9(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":void 0===e?"undefined":_typeof9(e)},_typeof7="function"==typeof Symbol&&"symbol"===_typeof8(Symbol.iterator)?function(e){return void 0===e?"undefined":_typeof8(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":void 0===e?"undefined":_typeof8(e)},_typeof6="function"==typeof Symbol&&"symbol"===_typeof7(Symbol.iterator)?function(e){return void 0===e?"undefined":_typeof7(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":void 0===e?"undefined":_typeof7(e)},_typeof5="function"==typeof Symbol&&"symbol"===_typeof6(Symbol.iterator)?function(e){return void 0===e?"undefined":_typeof6(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":void 0===e?"undefined":_typeof6(e)},_typeof4="function"==typeof Symbol&&"symbol"===_typeof5(Symbol.iterator)?function(e){return void 0===e?"undefined":_typeof5(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":void 0===e?"undefined":_typeof5(e)},_typeof3="function"==typeof Symbol&&"symbol"===_typeof4(Symbol.iterator)?function(e){return void 0===e?"undefined":_typeof4(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":void 0===e?"undefined":_typeof4(e)},_typeof2="function"==typeof Symbol&&"symbol"===_typeof3(Symbol.iterator)?function(e){return void 0===e?"undefined":_typeof3(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":void 0===e?"undefined":_typeof3(e)},_typeof="function"==typeof Symbol&&"symbol"===_typeof2(Symbol.iterator)?function(e){return void 0===e?"undefined":_typeof2(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":void 0===e?"undefined":_typeof2(e)};!function(s){Vue.component("wpuf-table",{template:"#tmpl-wpuf-component-table",mixins:[weForms.mixins.Loading,weForms.mixins.Paginate,weForms.mixins.BulkAction],props:{has_export:String,action:String,delete:String,id:[String,Number],status:[String]},data:function(){return{loading:!1,columns:[],items:[],ajaxAction:this.action,nonce:weForms.nonce,index:"id",bulkDeleteAction:this.delete?this.delete:"weforms_form_entry_trash_bulk"}},created:function(){this.fetchData()},computed:{columnLength:function(){return Object.keys(this.columns).length}},methods:{fetchData:function(){var t=this;this.loading=!0,wp.ajax.send(t.action,{data:{id:t.id,page:t.currentPage,status:t.status,_wpnonce:weForms.nonce},success:function(e){t.loading=!1,t.columns=e.columns,t.items=e.entries,t.form_title=e.form_title,t.totalItems=e.pagination.total,t.perPage=e.pagination.per_page,t.totalPage=e.pagination.pages,t.$emit("ajaxsuccess",e)},error:function(e){t.loading=!1,alert(e)}})},handleBulkAction:function(){if("-1"!==this.bulkAction){if("delete"===this.bulkAction){if(!this.checkedItems.length)return void alert("Please select atleast one entry to delete.");confirm("Are you sure to delete the entries?")&&this.deleteBulk()}if("restore"===this.bulkAction){if(!this.checkedItems.length)return void alert("Please select atleast one entry to restore.");this.restoreBulk()}}else alert("Please chose a bulk action to perform")},restore:function(e){var t=this;t.loading=!0,wp.ajax.send("weforms_form_entry_restore",{data:{entry_id:e,_wpnonce:weForms.nonce},success:function(e){t.loading=!1,t.fetchData()},error:function(e){t.loading=!1,alert(e)}})},deletePermanently:function(e){if(confirm("Are you sure to delete this entry?")){var t=this;t.loading=!0,wp.ajax.send("weforms_form_entry_delete",{data:{entry_id:e,_wpnonce:weForms.nonce},success:function(e){t.loading=!1,t.fetchData()},error:function(e){t.loading=!1,alert(e)}})}}},watch:{id:function(){this.fetchData()},status:function(){this.currentPage=1,this.bulkAction=-1,this.fetchData()}}}),weForms.routeComponents.Entries={template:"#tmpl-wpuf-entries",data:function(){return{selected:0,forms:{},form_title:"Loading...",status:"publish",total:0,totalTrash:0}},created:function(){this.get_forms()},methods:{get_forms:function(){var t=this;wp.ajax.send("weforms_form_list",{data:{_wpnonce:weForms.nonce,page:t.currentPage,posts_per_page:-1,filter:"entries"},success:function(e){Object.keys(e.forms).length?(t.forms=e.forms,t.selected=t.forms[Object.keys(t.forms)[0]].id):t.form_title="No entry found"},error:function(e){alert(e)}})}}},weForms.routeComponents.FormEditComponent={template:"#tmpl-wpuf-form-builder",mixins:wpuf_form_builder_mixins(wpuf_mixins.root),data:function(){return{is_form_saving:!1,is_form_saved:!1,is_form_switcher:!1,post_title_editing:!1,loading:!1,activeTab:"editor",activeSettingsTab:"form",activePaymentTab:"paypal"}},watch:{loading:function(e){e?(NProgress.configure({parent:"#wpadminbar"}),NProgress.start()):NProgress.done()},form_fields:{handler:function(){window.weFormsBuilderisDirty=!0},deep:!0},notifications:{handler:function(){window.weFormsBuilderisDirty=!0},deep:!0},integrations:{handler:function(){window.weFormsBuilderisDirty=!0},deep:!0},settings:{handler:function(){window.weFormsBuilderisDirty=!0},deep:!0},payment:{handler:function(){window.weFormsBuilderisDirty=!0},deep:!0}},created:function(){this.set_current_panel("form-fields"),this.fetchForm(),this.$store.commit("panel_add_show_prop"),wpuf_form_builder.event_hub=new Vue},computed:{current_panel:function(){return this.$store.state.current_panel},post:function(){return this.$store.state.post},form_fields_count:function(){return this.$store.state.form_fields.length},form_fields:function(){return this.$store.state.form_fields},notifications:function(){return this.$store.state.notifications},integrations:function(){return this.$store.state.integrations},settings:function(){return this.$store.state.settings},payment:function(){return this.$store.state.payment}},mounted:function(){var e=new window.Clipboard(".form-id");s(".form-id").tooltip();var t=this;this.started=!0,e.on("success",function(e){s(e.trigger).attr("data-original-title","Copied!").tooltip("show"),setTimeout(function(){s(e.trigger).tooltip("hide").attr("data-original-title",t.i18n.copy_shortcode)},1e3),e.clearSelection()}),this.initSharingClipBoard(),setTimeout(function(){window.weFormsBuilderisDirty=!1},500),window.onbeforeunload=function(){if(window.weFormsBuilderisDirty)return t.i18n.unsaved_changes}},methods:{makeActive:function(e){this.activeTab=e},isActiveTab:function(e){return this.activeTab===e},isActiveSettingsTab:function(e){return this.activeSettingsTab===e},makeActiveSettingsTab:function(e){this.activeSettingsTab=e},isActivePaymentTab:function(e){return this.activePaymentTab===e},makeActivePaymentTab:function(e){this.activePaymentTab=e},fetchForm:function(){var t=this;t.loading=!0,wp.ajax.send("weforms_get_form",{data:{form_id:this.$route.params.id,_wpnonce:weForms.nonce},success:function(e){t.$store.commit("set_form_post",e.post),t.$store.commit("set_form_fields",e.form_fields),t.$store.commit("set_form_notification",e.notifications),t.$store.commit("set_form_settings",e.settings),void 0!==e.integrations.length?t.$store.commit("set_form_integrations",{}):t.$store.commit("set_form_integrations",e.integrations)},error:function(e){alert(e)},complete:function(){t.loading=!1}})},set_current_panel:function(e){this.$store.commit("set_current_panel",e)},save_form_builder:function(){var t=this;!_.isFunction(this.validate_form_before_submit)||this.validate_form_before_submit()?(t.is_form_saving=!0,t.set_current_panel("form-fields"),wp.ajax.send("wpuf_form_builder_save_form",{data:{form_data:s("#wpuf-form-builder").serialize(),form_fields:JSON.stringify(t.form_fields),notifications:JSON.stringify(t.notifications),settings:JSON.stringify(t.settings),payment:JSON.stringify(t.payment),integrations:JSON.stringify(t.integrations)},success:function(e){e.form_fields&&t.$store.commit("set_form_fields",e.form_fields),t.is_form_saving=!1,t.is_form_saved=!0,setTimeout(function(){window.weFormsBuilderisDirty=!1},500),toastr.success(t.i18n.saved_form_data)},error:function(){t.is_form_saving=!1}})):this.warn({text:this.validation_error_msg})},save_settings:function(){toastr.options.preventDuplicates=!0,this.save_form_builder()},shareForm:function(e,t){var n=this;if("on"===n.settings.sharing_on){var o=e+"?weforms="+btoa(n.getSharingHash()+"_"+Math.floor(Date.now()/1e3)+"_"+t.ID);swal({title:n.i18n.shareYourForm,html:"<p>"+n.i18n.shareYourFormText+'</p> <p><input onClick="this.setSelectionRange(0, this.value.length)" type="text" class="regular-text" value="'+o+'"/> <button class="anonymous-share-btn button button-primary" title="Copy URL" data-clipboard-text="'+o+'"><i class="fa fa-clipboard" aria-hidden="true"></i></button></p>',showCloseButton:!0,showCancelButton:!0,confirmButtonClass:"btn btn-success",cancelButtonClass:"btn btn-danger",confirmButtonColor:"#d54e21",confirmButtonText:n.i18n.disableSharing,cancelButtonText:n.i18n.close,focusCancel:!0}).then(function(){swal({title:n.i18n.areYouSure,html:"<p>"+n.i18n.areYouSureDesc+"</p>",type:"info",confirmButtonColor:"#d54e21",showCancelButton:!0,confirmButtonText:n.i18n.disable,cancelButtonText:n.i18n.cancel}).then(function(){n.disableSharing()})})}else swal({title:n.i18n.shareYourForm,html:n.i18n.shareYourFormDesc,type:"info",showCancelButton:!0,confirmButtonText:"Enable",cancelButtonText:"Cancel"}).then(function(){n.enableSharing(e,t)})},enableSharing:function(e,t){this.settings.sharing_on="on",this.save_settings(),this.shareForm(e,t)},disableSharing:function(){this.settings.sharing_on=!1,this.save_settings()},getSharingHash:function(){return this.settings.sharing_hash||(this.settings.sharing_hash=this.makeRandomString(8),this.save_settings()),this.settings.sharing_hash},makeRandomString:function(e){e=e||8;for(var t="",n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",o=0;o<e;o++)t+=n.charAt(Math.floor(Math.random()*n.length));return t},initSharingClipBoard:function(e){var t=new window.Clipboard(".anonymous-share-btn");s(".anonymous-share-btn").tooltip(),t.on("success",function(e){s(e.trigger).attr("data-original-title","Copied!").tooltip("show"),setTimeout(function(){s(e.trigger).tooltip("hide").attr("data-original-title","Copy URL")},1e3),e.clearSelection()})}}},weForms.routeComponents.FormEntries={props:{id:[String,Number]},template:"#tmpl-wpuf-form-entries",data:function(){return{selected:0,form_title:"Loading...",status:"publish",total:0,totalTrash:0}}},weForms.routeComponents.FormEntriesSingle={template:"#tmpl-wpuf-form-entry-single",mixins:[weForms.mixins.Loading,weForms.mixins.Cookie],data:function(){return{loading:!1,hideEmpty:!0,hasEmpty:!1,show_payment_data:!1,entry:{form_fields:{},meta_data:{},payment_data:{}},form_settings:{},respondent_points:0,answers:{},countries:weForms.countries}},created:function(){this.hideEmpty=this.hideEmptyStatus(),this.fetchData()},computed:{hasFormFields:function(){return Object.keys(this.entry.form_fields).length}},methods:{fetchData:function(){var t=this;this.loading=!0,wp.ajax.send("weforms_form_entry_details",{data:{entry_id:t.$route.params.entryid,form_id:t.$route.params.id,_wpnonce:weForms.nonce},success:function(e){t.loading=!1,t.entry=e,t.hasEmpty=e.has_empty,t.form_settings=e.form_settings,t.respondent_points=e.respondent_points,t.answers=e.answers},error:function(e){t.loading=!1,alert(e)}})},trashEntry:function(){var t=this;confirm(weForms.confirm)&&wp.ajax.send("weforms_form_entry_trash",{data:{entry_id:t.$route.params.entryid,_wpnonce:weForms.nonce},success:function(){t.loading=!1,t.$router.push({name:"formEntries",params:{id:t.$route.params.id}})},error:function(e){t.loading=!1,alert(e)}})},hideEmptyStatus:function(){return"false"!==this.getCookie("weFormsEntryHideEmpty")},findCountry:function(t){return this.countries.find(function(e){return e.code===t})},getCountryName:function(e){if(this.findCountry(e))return this.findCountry(e).name},getAddressFieldValue:function(e){var t=e.match(/Country Select:(\s([A-Z])\w+)/g);if(null===t)return e;var n=t[0].substring(15,t[0].length).trim(),o=this.getCountryName(n),i=n;return e.replace(i,o)}},watch:{hideEmpty:function(e){this.setCookie("weFormsEntryHideEmpty",e,356)}}},Vue.component("form-list-table",{template:"#tmpl-wpuf-form-list-table",mixins:[weForms.mixins.Loading,weForms.mixins.Paginate,weForms.mixins.BulkAction],data:function(){return{loading:!1,index:"ID",items:[],bulkDeleteAction:"weforms_form_delete_bulk"}},created:function(){this.fetchData()},computed:{is_pro:function(){return"true"===weForms.is_pro},has_payment:function(){return"true"===weForms.has_payment}},methods:{fetchData:function(){var t=this;this.loading=!0,wp.ajax.send("weforms_form_list",{data:{_wpnonce:weForms.nonce,page:t.currentPage},success:function(e){t.loading=!1,t.items=e.forms,t.totalItems=e.meta.total,t.totalPage=e.meta.pages},error:function(e){t.loading=!1,alert(e)}})},deleteForm:function(t){var n=this;confirm("Are you sure?")&&(n.loading=!0,wp.ajax.send("weforms_form_delete",{data:{form_id:this.items[t].id,_wpnonce:weForms.nonce},success:function(e){n.items.splice(t,1),n.loading=!1},error:function(e){alert(e),n.loading=!1}}))},duplicate:function(e,t){var n=this;this.loading=!0,wp.ajax.send("weforms_form_duplicate",{data:{form_id:e,_wpnonce:weForms.nonce},success:function(e){n.items.splice(0,0,e),n.loading=!1},error:function(e){alert(e),n.loading=!1}})},handleBulkAction:function(){if("-1"!==this.bulkAction){if("delete"===this.bulkAction){if(!this.checkedItems.length)return void alert("Please select atleast one form to delete.");confirm("Are you sure to delete the forms?")&&this.deleteBulk()}}else alert("Please chose a bulk action to perform")},isPendingForm:function(e){return Math.round((new Date).getTime()/1e3)<Math.round(new Date(e).getTime()/1e3)},isExpiredForm:function(e){var t=Math.round((new Date).getTime()/1e3);return Math.round(new Date(e).getTime()/1e3)<t},isOpenForm:function(e,t){var n=Math.round((new Date).getTime()/1e3),o=Math.round(new Date(e).getTime()/1e3),i=Math.round(new Date(t).getTime()/1e3);return o<n&&n<i},isFormStatusClosed:function(e,t){return!("true"!==e.schedule_form||!this.isPendingForm(e.schedule_start))||(!("true"!==e.schedule_form||!this.isExpiredForm(e.schedule_end))||("true"===e.limit_entries&&t>=e.limit_number||void 0))},formatTime:function(e){var t=new Date(e);return t.toLocaleString("en-us",{month:"short"})+" "+t.getDate()+", "+t.getFullYear()}}}),weForms.routeComponents.FormPayments={props:{id:[String,Number]},template:"#tmpl-wpuf-form-payments",data:function(){return{form_title:"Loading..."}}},weForms.routeComponents.Home={template:"#tmpl-wpuf-home-page",data:function(){return{showTemplateModal:!1}},methods:{displayModal:function(){this.showTemplateModal=!0},closeModal:function(){this.showTemplateModal=!1}}},weForms.routeComponents.Tools={template:"#tmpl-wpuf-tools",mixins:[weForms.mixins.Tabs,weForms.mixins.Loading],data:function(){return{activeTab:"export",exportType:"all",loading:!1,forms:[],importButton:"Import",currentStatus:0,responseMessage:"",logs:[],ximport:{current:"",title:"",action:"",message:"",type:"updated",refs:{}}}},computed:{isInitial:function(){return 0===this.currentStatus},isSaving:function(){return 1===this.currentStatus},isSuccess:function(){return 2===this.currentStatus},isFailed:function(){return 3===this.currentStatus},hasRefs:function(){return Object.keys(this.ximport.refs).length},hasLogs:function(){return Object.keys(this.logs).length}},created:function(){this.fetchData(),this.fetchLogs()},methods:{fetchLogs:function(t){var n=this;n.startLoading(t),wp.ajax.send("weforms_read_logs",{data:{_wpnonce:weForms.nonce},success:function(e){n.stopLoading(t),n.logs=e},error:function(){n.stopLoading(t),n.logs=[]}})},deleteLogs:function(t){var n=this;confirm("Are you sure to clear the log file?")&&(n.startLoading(t),wp.ajax.send("weforms_delete_logs",{data:{_wpnonce:weForms.nonce},success:function(e){n.logs=[],n.stopLoading(t),n.fetchLogs()},error:function(e){n.logs=[],n.stopLoading(t),n.fetchLogs()}}))},stopLoading:function(e){(e=s(e)).is("button")?e.removeClass("updating-message").find("span").show():e.is("span")&&e.show().parent().removeClass("updating-message")},startLoading:function(e){(e=s(e)).is("button")?e.addClass("updating-message").find("span").hide():e.is("span")&&e.hide().parent().addClass("updating-message")},fetchData:function(){var t=this;this.loading=!0,wp.ajax.send("weforms_form_names",{data:{_wpnonce:weForms.nonce},success:function(e){t.loading=!1,t.forms=e},error:function(e){t.loading=!1,alert(e)}})},importForm:function(e,t,n){if(t.length){var o=new FormData,i=this;o.append(e,t[0],t[0].name),o.append("action","weforms_import_form"),o.append("_wpnonce",weForms.nonce),i.currentStatus=1,s.ajax({type:"POST",url:window.ajaxurl,data:o,processData:!1,contentType:!1,success:function(e){i.responseMessage=e.data,e.success?i.currentStatus=2:i.currentStatus=3,s(n.target).val("")},error:function(e){console.log(e),i.currentStatus=3},complete:function(){s(n.target).val("")}})}},importx:function(e,t){var n=s(e),o=this;o.ximport.current=t,n.addClass("updating-message").text(n.data("importing")),wp.ajax.send("weforms_import_xforms_"+t,{data:{_wpnonce:weForms.nonce},success:function(e){o.ximport.title=e.title,o.ximport.message=e.message,o.ximport.action=e.action,o.ximport.refs=e.refs},error:function(e){alert(e.message)},complete:function(){n.removeClass("updating-message").text(n.data("original"))}})},replaceX:function(e,t){var n=s(e),o=this;n.addClass("updating-message"),wp.ajax.send("weforms_import_xreplace_"+o.ximport.current,{data:{type:t,_wpnonce:weForms.nonce},success:function(e){"replace"===n.data("type")&&alert(e)},error:function(e){alert(e)},complete:function(){o.ximport.current="",o.ximport.title=""}})}}},weForms.routeComponents.Transactions={template:"#tmpl-wpuf-transactions",data:function(){return{selected:0,no_transactions:!1,forms:{},form_title:"Loading..."}},created:function(){this.get_forms()},methods:{get_forms:function(){var t=this;wp.ajax.send("weforms_form_list",{data:{_wpnonce:weForms.nonce,page:t.currentPage,filter:"transactions"},success:function(e){Object.keys(e.forms).length?(t.forms=e.forms,t.selected=t.forms[Object.keys(t.forms)[0]].id):(t.form_title="No transaction found",t.no_transactions=!0)},error:function(e){alert(e)}})}}},weForms.routeComponents.Help={template:"#tmpl-wpuf-weforms-page-help"},weForms.routeComponents.Privacy={template:"#tmpl-wpuf-weforms-page-privacy"},weForms.routeComponents.Premium={template:"#tmpl-wpuf-weforms-premium",data:function(){return{showModal:!1}}},weForms.routeComponents.Settings={template:"#tmpl-wpuf-weforms-settings",mixins:[weForms.mixins.Loading,weForms.mixins.Cookie],data:function(){return{loading:!1,settings:{email_gateway:"wordpress",credit:!1,permission:"manage_options",gateways:{sendgrid:"",mailgun:"",sparkpost:""},recaptcha:{type:"v2",key:"",secret:""}},activeTab:"general"}},computed:{is_pro:function(){return"true"===weForms.is_pro}},created:function(){this.fetchSettings(),this.getCookie("weforms_settings_active_tab")&&(this.activeTab=this.getCookie("weforms_settings_active_tab"))},methods:{makeActive:function(e){this.activeTab=e},isActiveTab:function(e){return this.activeTab===e},fetchSettings:function(){var e=this;e.loading=!0,wp.ajax.send("weforms_get_settings",{data:{_wpnonce:weForms.nonce},success:function(n){void 0!==n&&(s.each(e.settings,function(e,t){void 0===n[e]&&(n[e]=t)}),e.settings=n)},complete:function(){e.loading=!1}})},saveSettings:function(e){s(e).addClass("updating-message"),wp.ajax.send("weforms_save_settings",{data:{settings:JSON.stringify(this.settings),_wpnonce:weForms.nonce},success:function(e){toastr.options.timeOut=1e3,toastr.success("Settings has been updated"),weForms.settings=e},error:function(e){console.log(e)},complete:function(){s(e).removeClass("updating-message")}})},post:function(e,t,n){n=n||function(){},(t=t||{})._wpnonce=weForms.nonce,wp.ajax.send(e,{data:t,success:function(e){n(e)},error:function(e){console.log(e)},complete:function(){}})}},watch:{activeTab:function(e){this.setCookie("weforms_settings_active_tab",e,"365")}}},Array.prototype.hasOwnProperty("swap")||(Array.prototype.swap=function(e,t){this.splice(t,0,this.splice(e,1)[0])}),Vue.component("datepicker",{template:'<input type="text" v-bind:value="value" />',props:["value"],mounted:function(){s(this.$el).datetimepicker({dateFormat:"yy-mm-dd",timeFormat:"HH:mm:ss",onClose:this.onClose})},methods:{onClose:function(e){this.$emit("input",e)}}}),Vue.component("weforms-colorpicker",{template:'<input type="text" v-bind:value="value" />',props:["value"],mounted:function(){s(this.$el).wpColorPicker({change:this.onChange})},methods:{onChange:function(e,t){this.$emit("input",t.color.toString())}}});var e=new Vuex.Store({state:{post:{},form_fields:[],panel_sections:wpuf_form_builder.panel_sections,field_settings:wpuf_form_builder.field_settings,notifications:[],settings:{},integrations:{},current_panel:"form-fields",editing_field_id:0},mutations:{set_form_fields:function(e,t){Vue.set(e,"form_fields",t)},set_form_post:function(e,t){Vue.set(e,"post",t)},set_form_notification:function(e,t){Vue.set(e,"notifications",t)},set_form_integrations:function(e,t){Vue.set(e,"integrations",t)},set_form_settings:function(e,t){Vue.set(e,"settings",t)},set_current_panel:function(e,t){"field-options"!==e.current_panel&&"field-options"===t&&e.form_fields.length&&(e.editing_field_id=e.form_fields[0].id),"form-fields"===(e.current_panel=t)&&(e.editing_field_id=0)},panel_add_show_prop:function(n){n.panel_sections.map(function(e,t){e.hasOwnProperty("show")||Vue.set(n.panel_sections[t],"show",!0)})},panel_toggle:function(e,t){e.panel_sections[t].show=!e.panel_sections[t].show},open_field_settings:function(e,t){var n=e.form_fields.filter(function(e){return parseInt(t)===parseInt(e.id)});"field-options"===e.current_panel&&n[0].id===e.editing_field_id||n.length&&(e.editing_field_id=0,e.current_panel="field-options",setTimeout(function(){e.editing_field_id=n[0].id},400))},update_editing_form_field:function(e,t){var n=0;for(n=0;n<e.form_fields.length;n++)if(e.form_fields[n].id===parseInt(t.editing_field_id)&&(e.form_fields[n][t.field_name]=t.value),"column_field"===e.form_fields[n].template){var o=e.form_fields[n].inner_fields;for(var i in o)if(o.hasOwnProperty(i))for(var r=0;r<o[i].length;)o[i][r].id===parseInt(t.editing_field_id)&&(o[i][r][t.field_name]=t.value),r++}},add_form_field_element:function(e,t){e.form_fields.splice(t.toIndex,0,t.field),Vue.nextTick(function(){var e=s("#form-preview-stage .wpuf-form .field-items").eq(t.toIndex);e&&!function(e){"function"==typeof jQuery&&e instanceof jQuery&&(e=e[0]);var t=e.getBoundingClientRect();return 0<=t.top&&0<=t.left&&t.bottom<=(window.innerHeight||document.documentElement.clientHeight)&&t.right<=(window.innerWidth||document.documentElement.clientWidth)}(e.get(0))&&s("#builder-stage section").scrollTo(e,800,{offset:-50})})},swap_form_field_elements:function(e,t){e.form_fields.swap(t.fromIndex,t.toIndex)},clone_form_field_element:function(e,t){var n=_.find(e.form_fields,function(e){return parseInt(e.id)===parseInt(t.field_id)}),o=s.extend(!0,{},n),i=parseInt(t.index)+1;o.id=t.new_id,o.name=o.name+"_copy",o.is_new=!0,e.form_fields.splice(i,0,o)},delete_form_field_element:function(e,t){e.current_panel="form-fields",e.form_fields.splice(t,1)},set_panel_section_fields:function(e,t){_.find(e.panel_sections,function(e){return e.id===t.id}).fields=t.fields},addNotification:function(e,t){e.notifications.push(_.clone(t))},deleteNotification:function(e,t){e.notifications.splice(t,1)},cloneNotification:function(e,t){var n=s.extend(!0,{},e.notifications[t]);t=parseInt(t)+1,e.notifications.splice(t,0,n)},updateNotificationProperty:function(e,t){e.notifications[t.index][t.property]=t.value},updateNotification:function(e,t){e.notifications[t.index]=t.value},updateIntegration:function(e,t){Vue.set(e.integrations,t.index,t.value)},add_column_inner_field_element:function(e,t){var n=e.form_fields.findIndex(function(e){return e.id===t.toWhichColumnField});(void 0===e.form_fields[n].inner_fields[t.toWhichColumn]&&(e.form_fields[n].inner_fields[t.toWhichColumn]=[]),void 0!==e.form_fields[n].inner_fields[t.toWhichColumn])&&(e.form_fields[n].inner_fields[t.toWhichColumn].filter(function(e){return e.name===t.field.name}).length<=0&&e.form_fields[n].inner_fields[t.toWhichColumn].splice(t.toIndex,0,t.field))},move_column_inner_fields:function(t,n){var o=t.form_fields.findIndex(function(e){return e.id===n.field_id}),i=n.inner_fields,r=[];Object.keys(i).forEach(function(e){"column-1"===n.move_to&&(i[e].forEach(function(e){r.push(e)}),t.form_fields[o].inner_fields[e].splice(0,i[e].length)),"column-2"===n.move_to&&("column-2"!==e&&"column-3"!==e||(i[e].forEach(function(e){r.push(e)}),t.form_fields[o].inner_fields[e].splice(0,i[e].length)))}),0!==r.length&&r.forEach(function(e){t.form_fields[o].inner_fields[n.move_to].splice(0,0,e)})},swap_column_field_elements:function(e,t){var n=e.form_fields.findIndex(function(e){return e.id===t.field_id}),o=e.form_fields[n].inner_fields[t.fromColumn][t.fromIndex];t.fromColumn!==t.toColumn?(e.form_fields[n].inner_fields[t.toColumn].splice(t.toIndex,0,o),e.form_fields[n].inner_fields[t.fromColumn].splice(t.fromIndex,1)):e.form_fields[n].inner_fields[t.toColumn].swap(t.fromIndex,t.toIndex)},open_column_field_settings:function(e,t){var n=t.column_field;"field-options"===e.current_panel&&n.id===e.editing_field_id||n&&(e.editing_field_id=0,e.current_panel="field-options",e.editing_field_type="column_field",e.editing_column_field_id=t.field_id,e.edting_field_column=t.column,e.editing_inner_field_index=t.index,setTimeout(function(){e.editing_field_id=n.id},400))},clone_column_field_element:function(e,t){var n=e.form_fields.findIndex(function(e){return e.id===t.field_id}),o=_.find(e.form_fields[n].inner_fields[t.toColumn],function(e){return parseInt(e.id)===parseInt(t.column_field_id)}),i=s.extend(!0,{},o),r=parseInt(t.index)+1;i.id=t.new_id,i.name=i.name+"_copy",i.is_new=!0,e.form_fields[n].inner_fields[t.toColumn].splice(r,0,i)},delete_column_field_element:function(e,t){var n=e.form_fields.findIndex(function(e){return e.id===t.field_id});e.current_panel="form-fields",e.form_fields[n].inner_fields[t.fromColumn].splice(t.index,1)}}});weForms.routeComponents.FormHome={template:'<div><router-view class="child"></router-view></div>'},weForms.routeComponents.SingleForm={template:"#tmpl-wpuf-form-editor"},weForms.routeComponents.FormEntriesHome={template:'<div><router-view class="grand-child"></router-view></div>'},function e(t){for(var n=0;n<t.length;n++)"object"===_typeof(t[n].children)?(e(t[n].children),void 0!==t[n].component&&(t[n].component=weForms.routeComponents[t[n].component])):t[n].component=weForms.routeComponents[t[n].component]}(weForms.routes);var t=new VueRouter({routes:weForms.routes,scrollBehavior:function(e,t,n){return n||{x:0,y:0}}});window.weFormsBuilderisDirty=!1,t.beforeEach(function(e,t,n){if(window.weFormsBuilderisDirty){if(!confirm(wpuf_form_builder.i18n.unsaved_changes+" "+wpuf_form_builder.i18n.areYouSureToLeave))return n(t.path),!1;window.weFormsBuilderisDirty=!1}n()}),weForms.validators={is_recaptcha_v2:function(){return"v2"===weForms.settings.recaptcha.type}};new Vue({router:t,store:e}).$mount("#wpuf-contact-form-app");var o=s("#toplevel_page_weforms");o.on("click","a",function(){var e=s(this);s("ul.wp-submenu li",o).removeClass("current"),e.hasClass("wp-has-submenu")?s("li.wp-first-item",o).addClass("current"):e.parents("li").addClass("current")}),s(function(){var e=window.location.href,n=e.substr(e.indexOf("admin.php"));s("ul.wp-submenu a",o).each(function(e,t){s(t).attr("href")!==n||s(t).parent().addClass("current")})})}(jQuery);
     1"use strict";var _typeof11="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},_typeof10="function"==typeof Symbol&&"symbol"===_typeof11(Symbol.iterator)?function(t){return void 0===t?"undefined":_typeof11(t)}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":void 0===t?"undefined":_typeof11(t)},_typeof9="function"==typeof Symbol&&"symbol"===_typeof10(Symbol.iterator)?function(t){return void 0===t?"undefined":_typeof10(t)}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":void 0===t?"undefined":_typeof10(t)},_typeof8="function"==typeof Symbol&&"symbol"===_typeof9(Symbol.iterator)?function(t){return void 0===t?"undefined":_typeof9(t)}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":void 0===t?"undefined":_typeof9(t)},_typeof7="function"==typeof Symbol&&"symbol"===_typeof8(Symbol.iterator)?function(t){return void 0===t?"undefined":_typeof8(t)}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":void 0===t?"undefined":_typeof8(t)},_typeof6="function"==typeof Symbol&&"symbol"===_typeof7(Symbol.iterator)?function(t){return void 0===t?"undefined":_typeof7(t)}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":void 0===t?"undefined":_typeof7(t)},_typeof5="function"==typeof Symbol&&"symbol"===_typeof6(Symbol.iterator)?function(t){return void 0===t?"undefined":_typeof6(t)}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":void 0===t?"undefined":_typeof6(t)},_typeof4="function"==typeof Symbol&&"symbol"===_typeof5(Symbol.iterator)?function(t){return void 0===t?"undefined":_typeof5(t)}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":void 0===t?"undefined":_typeof5(t)},_typeof3="function"==typeof Symbol&&"symbol"===_typeof4(Symbol.iterator)?function(t){return void 0===t?"undefined":_typeof4(t)}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":void 0===t?"undefined":_typeof4(t)},_typeof2="function"==typeof Symbol&&"symbol"===_typeof3(Symbol.iterator)?function(t){return void 0===t?"undefined":_typeof3(t)}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":void 0===t?"undefined":_typeof3(t)},_typeof="function"==typeof Symbol&&"symbol"===_typeof2(Symbol.iterator)?function(t){return void 0===t?"undefined":_typeof2(t)}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":void 0===t?"undefined":_typeof2(t)};!function(s){Vue.component("wpuf-table",{template:"#tmpl-wpuf-component-table",mixins:[weForms.mixins.Loading,weForms.mixins.Paginate,weForms.mixins.BulkAction],props:{has_export:String,action:String,delete:String,id:[String,Number],status:[String]},data:function(){return{loading:!1,columns:[],items:[],ajaxAction:this.action,nonce:weForms.nonce,index:"id",bulkDeleteAction:this.delete?this.delete:"weforms_form_entry_trash_bulk"}},created:function(){this.fetchData()},computed:{columnLength:function(){return Object.keys(this.columns).length}},methods:{fetchData:function(){var e=this;this.loading=!0,wp.ajax.send(e.action,{data:{id:e.id,page:e.currentPage,status:e.status,_wpnonce:weForms.nonce},success:function(t){e.loading=!1,e.columns=t.columns,e.items=t.entries,e.form_title=t.form_title,e.totalItems=t.pagination.total,e.perPage=t.pagination.per_page,e.totalPage=t.pagination.pages,e.$emit("ajaxsuccess",t)},error:function(t){e.loading=!1,alert(t)}})},handleBulkAction:function(){if("-1"!==this.bulkAction){if("delete"===this.bulkAction){if(!this.checkedItems.length)return void alert("Please select atleast one entry to delete.");confirm("Are you sure to delete the entries?")&&this.deleteBulk()}if("restore"===this.bulkAction){if(!this.checkedItems.length)return void alert("Please select atleast one entry to restore.");this.restoreBulk()}}else alert("Please chose a bulk action to perform")},restore:function(t){var e=this;e.loading=!0,wp.ajax.send("weforms_form_entry_restore",{data:{entry_id:t,_wpnonce:weForms.nonce},success:function(t){e.loading=!1,e.fetchData()},error:function(t){e.loading=!1,alert(t)}})},deletePermanently:function(t){if(confirm("Are you sure to delete this entry?")){var e=this;e.loading=!0,wp.ajax.send("weforms_form_entry_delete",{data:{entry_id:t,_wpnonce:weForms.nonce},success:function(t){e.loading=!1,e.fetchData()},error:function(t){e.loading=!1,alert(t)}})}}},watch:{id:function(){this.fetchData()},status:function(){this.currentPage=1,this.bulkAction=-1,this.fetchData()}}}),weForms.routeComponents.Entries={template:"#tmpl-wpuf-entries",data:function(){return{selected:0,forms:{},form_title:"Loading...",status:"publish",total:0,totalTrash:0}},created:function(){this.get_forms()},methods:{get_forms:function(){var e=this;wp.ajax.send("weforms_form_list",{data:{_wpnonce:weForms.nonce,page:e.currentPage,posts_per_page:-1,filter:"entries"},success:function(t){Object.keys(t.forms).length?(e.forms=t.forms,e.selected=e.forms[Object.keys(e.forms)[0]].id):e.form_title="No entry found"},error:function(t){alert(t)}})}}},weForms.routeComponents.FormEditComponent={template:"#tmpl-wpuf-form-builder",mixins:wpuf_form_builder_mixins(wpuf_mixins.root),data:function(){return{is_form_saving:!1,is_form_saved:!1,is_form_switcher:!1,post_title_editing:!1,loading:!1,activeTab:"editor",activeSettingsTab:"form",activePaymentTab:"paypal"}},watch:{loading:function(t){t?(NProgress.configure({parent:"#wpadminbar"}),NProgress.start()):NProgress.done()},form_fields:{handler:function(){window.weFormsBuilderisDirty=!0},deep:!0},notifications:{handler:function(){window.weFormsBuilderisDirty=!0},deep:!0},integrations:{handler:function(){window.weFormsBuilderisDirty=!0},deep:!0},settings:{handler:function(){window.weFormsBuilderisDirty=!0},deep:!0},payment:{handler:function(){window.weFormsBuilderisDirty=!0},deep:!0}},created:function(){this.set_current_panel("form-fields"),this.fetchForm(),this.$store.commit("panel_add_show_prop"),wpuf_form_builder.event_hub=new Vue},computed:{current_panel:function(){return this.$store.state.current_panel},post:function(){return this.$store.state.post},form_fields_count:function(){return this.$store.state.form_fields.length},form_fields:function(){return this.$store.state.form_fields},notifications:function(){return this.$store.state.notifications},integrations:function(){return this.$store.state.integrations},settings:function(){return this.$store.state.settings},payment:function(){return this.$store.state.payment}},mounted:function(){var t=new window.Clipboard(".form-id");s(".form-id").tooltip();var e=this;this.started=!0,t.on("success",function(t){s(t.trigger).attr("data-original-title","Copied!").tooltip("show"),setTimeout(function(){s(t.trigger).tooltip("hide").attr("data-original-title",e.i18n.copy_shortcode)},1e3),t.clearSelection()}),this.initSharingClipBoard(),setTimeout(function(){window.weFormsBuilderisDirty=!1},500),window.onbeforeunload=function(){if(window.weFormsBuilderisDirty)return e.i18n.unsaved_changes}},methods:{makeActive:function(t){this.activeTab=t},isActiveTab:function(t){return this.activeTab===t},isActiveSettingsTab:function(t){return this.activeSettingsTab===t},makeActiveSettingsTab:function(t){this.activeSettingsTab=t},isActivePaymentTab:function(t){return this.activePaymentTab===t},makeActivePaymentTab:function(t){this.activePaymentTab=t},fetchForm:function(){var e=this;e.loading=!0,wp.ajax.send("weforms_get_form",{data:{form_id:this.$route.params.id,_wpnonce:weForms.nonce},success:function(t){e.$store.commit("set_form_post",t.post),e.$store.commit("set_form_fields",t.form_fields),e.$store.commit("set_form_notification",t.notifications),e.$store.commit("set_form_settings",t.settings),void 0!==t.integrations.length?e.$store.commit("set_form_integrations",{}):e.$store.commit("set_form_integrations",t.integrations)},error:function(t){alert(t)},complete:function(){e.loading=!1}})},set_current_panel:function(t){this.$store.commit("set_current_panel",t)},save_form_builder:function(){var e=this;!_.isFunction(this.validate_form_before_submit)||this.validate_form_before_submit()?(e.is_form_saving=!0,e.set_current_panel("form-fields"),wp.ajax.send("wpuf_form_builder_save_form",{data:{form_data:s("#wpuf-form-builder").serialize(),form_fields:JSON.stringify(e.form_fields),notifications:JSON.stringify(e.notifications),settings:JSON.stringify(e.settings),payment:JSON.stringify(e.payment),integrations:JSON.stringify(e.integrations)},success:function(t){t.form_fields&&e.$store.commit("set_form_fields",t.form_fields),e.is_form_saving=!1,e.is_form_saved=!0,setTimeout(function(){window.weFormsBuilderisDirty=!1},500),toastr.success(e.i18n.saved_form_data)},error:function(){e.is_form_saving=!1}})):this.warn({text:this.validation_error_msg})},save_settings:function(){toastr.options.preventDuplicates=!0,this.save_form_builder()},shareForm:function(t,e){var n=this;if("on"===n.settings.sharing_on){var o=t+"?weforms="+btoa(n.getSharingHash()+"_"+Math.floor(Date.now()/1e3)+"_"+e.ID);swal({title:n.i18n.shareYourForm,html:"<p>"+n.i18n.shareYourFormText+'</p> <p><input onClick="this.setSelectionRange(0, this.value.length)" type="text" class="regular-text" value="'+o+'"/> <button class="anonymous-share-btn button button-primary" title="Copy URL" data-clipboard-text="'+o+'"><i class="fa fa-clipboard" aria-hidden="true"></i></button></p>',showCloseButton:!0,showCancelButton:!0,confirmButtonClass:"btn btn-success",cancelButtonClass:"btn btn-danger",confirmButtonColor:"#d54e21",confirmButtonText:n.i18n.disableSharing,cancelButtonText:n.i18n.close,focusCancel:!0}).then(function(){swal({title:n.i18n.areYouSure,html:"<p>"+n.i18n.areYouSureDesc+"</p>",type:"info",confirmButtonColor:"#d54e21",showCancelButton:!0,confirmButtonText:n.i18n.disable,cancelButtonText:n.i18n.cancel}).then(function(){n.disableSharing()})})}else swal({title:n.i18n.shareYourForm,html:n.i18n.shareYourFormDesc,type:"info",showCancelButton:!0,confirmButtonText:"Enable",cancelButtonText:"Cancel"}).then(function(){n.enableSharing(t,e)})},enableSharing:function(t,e){this.settings.sharing_on="on",this.save_settings(),this.shareForm(t,e)},disableSharing:function(){this.settings.sharing_on=!1,this.save_settings()},getSharingHash:function(){return this.settings.sharing_hash||(this.settings.sharing_hash=this.makeRandomString(8),this.save_settings()),this.settings.sharing_hash},makeRandomString:function(t){t=t||8;for(var e="",n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",o=0;o<t;o++)e+=n.charAt(Math.floor(Math.random()*n.length));return e},initSharingClipBoard:function(t){var e=new window.Clipboard(".anonymous-share-btn");s(".anonymous-share-btn").tooltip(),e.on("success",function(t){s(t.trigger).attr("data-original-title","Copied!").tooltip("show"),setTimeout(function(){s(t.trigger).tooltip("hide").attr("data-original-title","Copy URL")},1e3),t.clearSelection()})}}},weForms.routeComponents.FormEntries={props:{id:[String,Number]},template:"#tmpl-wpuf-form-entries",data:function(){return{selected:0,form_title:"Loading...",status:"publish",total:0,totalTrash:0}}},weForms.routeComponents.FormEntriesSingle={template:"#tmpl-wpuf-form-entry-single",mixins:[weForms.mixins.Loading,weForms.mixins.Cookie],data:function(){return{loading:!1,hideEmpty:!0,hasEmpty:!1,show_payment_data:!1,entry:{form_fields:{},meta_data:{},payment_data:{}},form_settings:{},respondent_points:0,answers:{},countries:weForms.countries}},created:function(){this.hideEmpty=this.hideEmptyStatus(),this.fetchData()},computed:{hasFormFields:function(){return Object.keys(this.entry.form_fields).length}},methods:{fetchData:function(){var e=this;this.loading=!0,wp.ajax.send("weforms_form_entry_details",{data:{entry_id:e.$route.params.entryid,form_id:e.$route.params.id,_wpnonce:weForms.nonce},success:function(t){e.loading=!1,e.entry=t,e.hasEmpty=t.has_empty,e.form_settings=t.form_settings,e.respondent_points=t.respondent_points,e.answers=t.answers},error:function(t){e.loading=!1,alert(t)}})},trashEntry:function(){var e=this;confirm(weForms.confirm)&&wp.ajax.send("weforms_form_entry_trash",{data:{entry_id:e.$route.params.entryid,_wpnonce:weForms.nonce},success:function(){e.loading=!1,e.$router.push({name:"formEntries",params:{id:e.$route.params.id}})},error:function(t){e.loading=!1,alert(t)}})},hideEmptyStatus:function(){return"false"!==this.getCookie("weFormsEntryHideEmpty")},findCountry:function(e){return this.countries.find(function(t){return t.code===e})},getCountryName:function(t){if(this.findCountry(t))return this.findCountry(t).name},getAddressFieldValue:function(t){var e=t.match(/Country Select:(\s([A-Z])\w+)/g);if(null===e)return t;var n=e[0].substring(15,e[0].length).trim(),o=this.getCountryName(n),i=n;return t.replace(i,o)}},watch:{hideEmpty:function(t){this.setCookie("weFormsEntryHideEmpty",t,356)}}},Vue.component("form-list-table",{template:"#tmpl-wpuf-form-list-table",mixins:[weForms.mixins.Loading,weForms.mixins.Paginate,weForms.mixins.BulkAction],data:function(){return{loading:!1,index:"ID",items:[],bulkDeleteAction:"weforms_form_delete_bulk"}},created:function(){this.fetchData()},computed:{is_pro:function(){return"true"===weForms.is_pro},has_payment:function(){return"true"===weForms.has_payment}},methods:{fetchData:function(){var e=this;this.loading=!0,wp.ajax.send("weforms_form_list",{data:{_wpnonce:weForms.nonce,page:e.currentPage},success:function(t){e.loading=!1,e.items=t.forms,e.totalItems=t.meta.total,e.totalPage=t.meta.pages},error:function(t){e.loading=!1,alert(t)}})},deleteForm:function(e){var n=this;confirm("Are you sure?")&&(n.loading=!0,wp.ajax.send("weforms_form_delete",{data:{form_id:this.items[e].id,_wpnonce:weForms.nonce},success:function(t){n.items.splice(e,1),n.loading=!1},error:function(t){alert(t),n.loading=!1}}))},duplicate:function(t,e){var n=this;this.loading=!0,wp.ajax.send("weforms_form_duplicate",{data:{form_id:t,_wpnonce:weForms.nonce},success:function(t){n.items.splice(0,0,t),n.loading=!1},error:function(t){alert(t),n.loading=!1}})},handleBulkAction:function(){if("-1"!==this.bulkAction){if("delete"===this.bulkAction){if(!this.checkedItems.length)return void alert("Please select atleast one form to delete.");confirm("Are you sure to delete the forms?")&&this.deleteBulk()}}else alert("Please chose a bulk action to perform")},isPendingForm:function(t){return Math.round((new Date).getTime()/1e3)<Math.round(new Date(t).getTime()/1e3)},isExpiredForm:function(t){var e=Math.round((new Date).getTime()/1e3);return Math.round(new Date(t).getTime()/1e3)<e},isOpenForm:function(t,e){var n=Math.round((new Date).getTime()/1e3),o=Math.round(new Date(t).getTime()/1e3),i=Math.round(new Date(e).getTime()/1e3);return o<n&&n<i},isFormStatusClosed:function(t,e){return!("true"!==t.schedule_form||!this.isPendingForm(t.schedule_start))||(!("true"!==t.schedule_form||!this.isExpiredForm(t.schedule_end))||("true"===t.limit_entries&&e>=t.limit_number||void 0))},formatTime:function(t){var e=new Date(t);return e.toLocaleString("en-us",{month:"short"})+" "+e.getDate()+", "+e.getFullYear()}}}),weForms.routeComponents.FormPayments={props:{id:[String,Number]},template:"#tmpl-wpuf-form-payments",data:function(){return{form_title:"Loading..."}}},weForms.routeComponents.Home={template:"#tmpl-wpuf-home-page",data:function(){return{showTemplateModal:!1}},methods:{displayModal:function(){this.showTemplateModal=!0},closeModal:function(){this.showTemplateModal=!1}}},weForms.routeComponents.Tools={template:"#tmpl-wpuf-tools",mixins:[weForms.mixins.Tabs,weForms.mixins.Loading],data:function(){return{activeTab:"export",exportType:"all",loading:!1,forms:[],importButton:"Import",currentStatus:0,responseMessage:"",logs:[],ximport:{current:"",title:"",action:"",message:"",type:"updated",refs:{}}}},computed:{isInitial:function(){return 0===this.currentStatus},isSaving:function(){return 1===this.currentStatus},isSuccess:function(){return 2===this.currentStatus},isFailed:function(){return 3===this.currentStatus},hasRefs:function(){return Object.keys(this.ximport.refs).length},hasLogs:function(){return Object.keys(this.logs).length}},created:function(){this.fetchData(),this.fetchLogs()},methods:{fetchLogs:function(e){var n=this;n.startLoading(e),wp.ajax.send("weforms_read_logs",{data:{_wpnonce:weForms.nonce},success:function(t){n.stopLoading(e),n.logs=t},error:function(){n.stopLoading(e),n.logs=[]}})},deleteLogs:function(e){var n=this;confirm("Are you sure to clear the log file?")&&(n.startLoading(e),wp.ajax.send("weforms_delete_logs",{data:{_wpnonce:weForms.nonce},success:function(t){n.logs=[],n.stopLoading(e),n.fetchLogs()},error:function(t){n.logs=[],n.stopLoading(e),n.fetchLogs()}}))},stopLoading:function(t){(t=s(t)).is("button")?t.removeClass("updating-message").find("span").show():t.is("span")&&t.show().parent().removeClass("updating-message")},startLoading:function(t){(t=s(t)).is("button")?t.addClass("updating-message").find("span").hide():t.is("span")&&t.hide().parent().addClass("updating-message")},fetchData:function(){var e=this;this.loading=!0,wp.ajax.send("weforms_form_names",{data:{_wpnonce:weForms.nonce},success:function(t){e.loading=!1,e.forms=t},error:function(t){e.loading=!1,alert(t)}})},importForm:function(t,e,n){if(e.length){var o=new FormData,i=this;o.append(t,e[0],e[0].name),o.append("action","weforms_import_form"),o.append("_wpnonce",weForms.nonce),i.currentStatus=1,s.ajax({type:"POST",url:window.ajaxurl,data:o,processData:!1,contentType:!1,success:function(t){i.responseMessage=t.data,t.success?i.currentStatus=2:i.currentStatus=3,s(n.target).val("")},error:function(t){console.log(t),i.currentStatus=3},complete:function(){s(n.target).val("")}})}},importx:function(t,e){var n=s(t),o=this;o.ximport.current=e,n.addClass("updating-message").text(n.data("importing")),wp.ajax.send("weforms_import_xforms_"+e,{data:{_wpnonce:weForms.nonce},success:function(t){o.ximport.title=t.title,o.ximport.message=t.message,o.ximport.action=t.action,o.ximport.refs=t.refs},error:function(t){alert(t.message)},complete:function(){n.removeClass("updating-message").text(n.data("original"))}})},replaceX:function(t,e){var n=s(t),o=this;n.addClass("updating-message"),wp.ajax.send("weforms_import_xreplace_"+o.ximport.current,{data:{type:e,_wpnonce:weForms.nonce},success:function(t){"replace"===n.data("type")&&alert(t)},error:function(t){alert(t)},complete:function(){o.ximport.current="",o.ximport.title=""}})}}},weForms.routeComponents.Transactions={template:"#tmpl-wpuf-transactions",data:function(){return{selected:0,no_transactions:!1,forms:{},form_title:"Loading..."}},created:function(){this.get_forms()},methods:{get_forms:function(){var e=this;wp.ajax.send("weforms_form_list",{data:{_wpnonce:weForms.nonce,page:e.currentPage,filter:"transactions"},success:function(t){Object.keys(t.forms).length?(e.forms=t.forms,e.selected=e.forms[Object.keys(e.forms)[0]].id):(e.form_title="No transaction found",e.no_transactions=!0)},error:function(t){alert(t)}})}}},weForms.routeComponents.Help={template:"#tmpl-wpuf-weforms-page-help"},weForms.routeComponents.Privacy={template:"#tmpl-wpuf-weforms-page-privacy"},weForms.routeComponents.Premium={template:"#tmpl-wpuf-weforms-premium",data:function(){return{showModal:!1}}},weForms.routeComponents.Settings={template:"#tmpl-wpuf-weforms-settings",mixins:[weForms.mixins.Loading,weForms.mixins.Cookie],data:function(){return{loading:!1,settings:{email_gateway:"wordpress",credit:!1,permission:"manage_options",gateways:{sendgrid:"",mailgun:"",sparkpost:""},recaptcha:{type:"v2",key:"",secret:""}},activeTab:"general"}},computed:{is_pro:function(){return"true"===weForms.is_pro}},created:function(){this.fetchSettings(),this.getCookie("weforms_settings_active_tab")&&(this.activeTab=this.getCookie("weforms_settings_active_tab"))},methods:{makeActive:function(t){this.activeTab=t},isActiveTab:function(t){return this.activeTab===t},fetchSettings:function(){var t=this;t.loading=!0,wp.ajax.send("weforms_get_settings",{data:{_wpnonce:weForms.nonce},success:function(n){void 0!==n&&(s.each(t.settings,function(t,e){void 0===n[t]&&(n[t]=e)}),t.settings=n)},complete:function(){t.loading=!1}})},saveSettings:function(t){s(t).addClass("updating-message"),wp.ajax.send("weforms_save_settings",{data:{settings:JSON.stringify(this.settings),_wpnonce:weForms.nonce},success:function(t){toastr.options.timeOut=1e3,toastr.success("Settings has been updated"),weForms.settings=t},error:function(t){console.log(t)},complete:function(){s(t).removeClass("updating-message")}})},post:function(t,e,n){n=n||function(){},(e=e||{})._wpnonce=weForms.nonce,wp.ajax.send(t,{data:e,success:function(t){n(t)},error:function(t){console.log(t)},complete:function(){}})}},watch:{activeTab:function(t){this.setCookie("weforms_settings_active_tab",t,"365")}}},Array.prototype.hasOwnProperty("swap")||(Array.prototype.swap=function(t,e){this.splice(e,0,this.splice(t,1)[0])}),Vue.component("datepicker",{template:'<input type="text" v-bind:value="value" />',props:["value"],mounted:function(){s(this.$el).datetimepicker({dateFormat:"yy-mm-dd",timeFormat:"HH:mm:ss",onClose:this.onClose})},methods:{onClose:function(t){this.$emit("input",t)}}}),Vue.component("weforms-colorpicker",{template:'<input type="text" v-bind:value="value" />',props:["value"],mounted:function(){s(this.$el).wpColorPicker({change:this.onChange})},methods:{onChange:function(t,e){this.$emit("input",e.color.toString())}}});var t=new Vuex.Store({state:{post:{},form_fields:[],panel_sections:wpuf_form_builder.panel_sections,field_settings:wpuf_form_builder.field_settings,notifications:[],settings:{},integrations:{},current_panel:"form-fields",editing_field_id:0},mutations:{set_form_fields:function(t,e){Vue.set(t,"form_fields",e)},set_form_post:function(t,e){Vue.set(t,"post",e)},set_form_notification:function(t,e){Vue.set(t,"notifications",e)},set_form_integrations:function(t,e){Vue.set(t,"integrations",e)},set_form_settings:function(t,e){Vue.set(t,"settings",e)},set_current_panel:function(t,e){"field-options"!==t.current_panel&&"field-options"===e&&t.form_fields.length&&(t.editing_field_id=t.form_fields[0].id),"form-fields"===(t.current_panel=e)&&(t.editing_field_id=0)},panel_add_show_prop:function(n){n.panel_sections.map(function(t,e){t.hasOwnProperty("show")||Vue.set(n.panel_sections[e],"show",!0)})},panel_toggle:function(t,e){t.panel_sections[e].show=!t.panel_sections[e].show},open_field_settings:function(t,e){var n=t.form_fields.filter(function(t){return parseInt(e)===parseInt(t.id)});"field-options"===t.current_panel&&n[0].id===t.editing_field_id||n.length&&(t.editing_field_id=0,t.current_panel="field-options",setTimeout(function(){t.editing_field_id=n[0].id},400))},update_editing_form_field:function(t,e){var n=0;for(n=0;n<t.form_fields.length;n++)if(t.form_fields[n].id===parseInt(e.editing_field_id)&&(t.form_fields[n][e.field_name]=e.value),"column_field"===t.form_fields[n].template){var o=t.form_fields[n].inner_fields;for(var i in o)if(o.hasOwnProperty(i))for(var r=0;r<o[i].length;)o[i][r].id===parseInt(e.editing_field_id)&&(o[i][r][e.field_name]=e.value),r++}},add_form_field_element:function(t,e){t.form_fields.splice(e.toIndex,0,e.field),Vue.nextTick(function(){var t=s("#form-preview-stage .wpuf-form .field-items").eq(e.toIndex);t&&!function(t){"function"==typeof jQuery&&t instanceof jQuery&&(t=t[0]);var e=t.getBoundingClientRect();return 0<=e.top&&0<=e.left&&e.bottom<=(window.innerHeight||document.documentElement.clientHeight)&&e.right<=(window.innerWidth||document.documentElement.clientWidth)}(t.get(0))&&s("#builder-stage section").scrollTo(t,800,{offset:-50})})},swap_form_field_elements:function(t,e){t.form_fields.swap(e.fromIndex,e.toIndex)},clone_form_field_element:function(t,e){var n=_.find(t.form_fields,function(t){return parseInt(t.id)===parseInt(e.field_id)}),o=s.extend(!0,{},n),i=parseInt(e.index)+1;o.id=e.new_id,o.name=o.name+"_copy",o.is_new=!0,t.form_fields.splice(i,0,o)},delete_form_field_element:function(t,e){t.current_panel="form-fields",t.form_fields.splice(e,1)},set_panel_section_fields:function(t,e){_.find(t.panel_sections,function(t){return t.id===e.id}).fields=e.fields},addNotification:function(t,e){t.notifications.push(_.clone(e))},deleteNotification:function(t,e){t.notifications.splice(e,1)},cloneNotification:function(t,e){var n=s.extend(!0,{},t.notifications[e]);e=parseInt(e)+1,t.notifications.splice(e,0,n)},updateNotificationProperty:function(t,e){t.notifications[e.index][e.property]=e.value},updateNotification:function(t,e){t.notifications[e.index]=e.value},updateIntegration:function(t,e){Vue.set(t.integrations,e.index,e.value)},add_column_inner_field_element:function(t,e){var n=t.form_fields.findIndex(function(t){return t.id===e.toWhichColumnField});(void 0===t.form_fields[n].inner_fields[e.toWhichColumn]&&(t.form_fields[n].inner_fields[e.toWhichColumn]=[]),void 0!==t.form_fields[n].inner_fields[e.toWhichColumn])&&(t.form_fields[n].inner_fields[e.toWhichColumn].filter(function(t){return t.name===e.field.name}).length<=0&&t.form_fields[n].inner_fields[e.toWhichColumn].splice(e.toIndex,0,e.field))},move_column_inner_fields:function(e,n){var o=e.form_fields.findIndex(function(t){return t.id===n.field_id}),i=n.inner_fields,r=[];Object.keys(i).forEach(function(t){"column-1"===n.move_to&&(i[t].forEach(function(t){r.push(t)}),e.form_fields[o].inner_fields[t].splice(0,i[t].length)),"column-2"===n.move_to&&("column-2"!==t&&"column-3"!==t||(i[t].forEach(function(t){r.push(t)}),e.form_fields[o].inner_fields[t].splice(0,i[t].length)))}),0!==r.length&&r.forEach(function(t){e.form_fields[o].inner_fields[n.move_to].splice(0,0,t)})},swap_column_field_elements:function(t,e){var n=t.form_fields.findIndex(function(t){return t.id===e.field_id}),o=t.form_fields[n].inner_fields[e.fromColumn][e.fromIndex];e.fromColumn!==e.toColumn?(t.form_fields[n].inner_fields[e.toColumn].splice(e.toIndex,0,o),t.form_fields[n].inner_fields[e.fromColumn].splice(e.fromIndex,1)):t.form_fields[n].inner_fields[e.toColumn].swap(e.fromIndex,e.toIndex)},open_column_field_settings:function(t,e){var n=e.column_field;"field-options"===t.current_panel&&n.id===t.editing_field_id||n&&(t.editing_field_id=0,t.current_panel="field-options",t.editing_field_type="column_field",t.editing_column_field_id=e.field_id,t.edting_field_column=e.column,t.editing_inner_field_index=e.index,setTimeout(function(){t.editing_field_id=n.id},400))},clone_column_field_element:function(t,e){var n=t.form_fields.findIndex(function(t){return t.id===e.field_id}),o=_.find(t.form_fields[n].inner_fields[e.toColumn],function(t){return parseInt(t.id)===parseInt(e.column_field_id)}),i=s.extend(!0,{},o),r=parseInt(e.index)+1;i.id=e.new_id,i.name=i.name+"_copy",i.is_new=!0,t.form_fields[n].inner_fields[e.toColumn].splice(r,0,i)},delete_column_field_element:function(t,e){var n=t.form_fields.findIndex(function(t){return t.id===e.field_id});t.current_panel="form-fields",t.form_fields[n].inner_fields[e.fromColumn].splice(e.index,1)}}});weForms.routeComponents.FormHome={template:'<div><router-view class="child"></router-view></div>'},weForms.routeComponents.SingleForm={template:"#tmpl-wpuf-form-editor"},weForms.routeComponents.FormEntriesHome={template:'<div><router-view class="grand-child"></router-view></div>'},function t(e){for(var n=0;n<e.length;n++)"object"===_typeof(e[n].children)?(t(e[n].children),void 0!==e[n].component&&(e[n].component=weForms.routeComponents[e[n].component])):e[n].component=weForms.routeComponents[e[n].component]}(weForms.routes);var e=new VueRouter({routes:weForms.routes,scrollBehavior:function(t,e,n){return n||{x:0,y:0}}});window.weFormsBuilderisDirty=!1,e.beforeEach(function(t,e,n){if(window.weFormsBuilderisDirty){if(!confirm(wpuf_form_builder.i18n.unsaved_changes+" "+wpuf_form_builder.i18n.areYouSureToLeave))return n(e.path),!1;window.weFormsBuilderisDirty=!1}n()}),weForms.validators={is_recaptcha_v2:function(){return"v2"===weForms.settings.recaptcha.type}};new Vue({router:e,store:t}).$mount("#wpuf-contact-form-app");var o=s("#toplevel_page_weforms");o.on("click","a",function(){var t=s(this);s("ul.wp-submenu li",o).removeClass("current"),t.hasClass("wp-has-submenu")?s("li.wp-first-item",o).addClass("current"):t.parents("li").addClass("current")}),s(function(){var t=window.location.href,n=t.substr(t.indexOf("admin.php"));s("ul.wp-submenu a",o).each(function(t,e){s(e).attr("href")!==n||s(e).parent().addClass("current")})})}(jQuery);
  • weforms/trunk/assets/wpuf/css/wpuf-form-builder.css

    r2403226 r2514969  
    219219  filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#660073aa', endColorstr='#ff0073aa', GradientType=0);
    220220}
     221.fa.fa-humanpresence {
     222  width: 1em;
     223  height: 1em;
     224  background: no-repeat url('images/hp-shield.svg') left top;
     225  background-size: cover;
     226}
    221227#wpuf-form-builder {
    222228  width: calc(100% - 200px);
  • weforms/trunk/assets/wpuf/js-templates/form-components.php

    r2403226 r2514969  
    1717            :data-index="index"
    1818            data-source="stage"
     19            v-if="'humanpresence' !== field.template"
    1920        >
    2021            <div v-if="!is_full_width(field.template)" class="wpuf-label">
     
    5960                :class="['field-items', parseInt(editing_form_id) === parseInt(field.id) ? 'current-editing' : '']"
    6061            >
    61                 <strong><?php esc_html_e( 'key', 'wp-user-frontend' ); ?></strong>: {{ field.name }} | <strong><?php esc_html_e( 'value', 'wp-user-frontend' ); ?></strong>: {{ field.meta_value }}
     62                <span v-if="'humanpresence' !== field.template"><strong><?php esc_html_e( 'key', 'wp-user-frontend' ); ?></strong>: {{ field.name }} | <strong><?php esc_html_e( 'value', 'wp-user-frontend' ); ?></strong>: {{ field.meta_value }}</span>
     63
     64                <span v-if="'humanpresence' === field.template"><component v-if="is_template_available(field)" :is="'form-' + field.template" :field="field"></component></span>
    6265
    6366                <div class="control-buttons">
     
    350353    <div v-if="'logged_in' === selected" class="condiotional-logic-container">
    351354
    352         <?php $roles = get_editable_roles(); ?>
    353 
    354         <ul>
    355             <?php
     355        <?php $roles = get_editable_roles(); ?>
     356
     357        <ul>
     358            <?php
    356359                foreach ( $roles as $role => $value ) {
    357360                    $role_name = $value['name'];
     
    364367                }
    365368            ?>
    366         </ul>
     369        </ul>
    367370    </div>
    368371
    369372    <div v-if="'subscribed_users' === selected" class="condiotional-logic-container">
    370373
    371         <ul>
    372             <?php
     374        <ul>
     375            <?php
    373376
    374377                if ( class_exists( 'WPUF_Subscription' ) ) {
     
    388391                }
    389392            ?>
    390         </ul>
     393        </ul>
    391394
    392395    </div>
     
    709712
    710713    <template v-else>
    711         <div v-if="'invisible_recaptcha' != field.recaptcha_type">
    712             <img class="wpuf-recaptcha-placeholder" src="<?php echo WPUF_ASSET_URI . '/images/recaptcha-placeholder.png'; ?>" alt="">
     714        <div v-if="'invisible_recaptcha' != field.recaptcha_type">
     715            <img class="wpuf-recaptcha-placeholder" src="<?php echo WPUF_ASSET_URI . '/images/recaptcha-placeholder.png'; ?>" alt="">
    713716        </div>
    714717        <div v-else><p><?php _e( 'Invisible reCaptcha', 'wp-user-frontend' ); ?></p></div>
     718    </template>
     719</div>
     720</script>
     721
     722<script type="text/x-template" id="tmpl-wpuf-form-humanpresence">
     723<div class="wpuf-fields">
     724    <template v-if="!has_humanpresence_installed">
     725        <p v-html="no_humanpresence_installed_msg"></p>
     726    </template>
     727
     728    <template v-else>
     729        <div><p><i aria-hidden="true" class="fa fa-humanpresence"></i> <?php _e( 'Human Presence Anti-Spam Enabled (only visible to you).', 'wp-user-frontend' ); ?></p></div>
    715730    </template>
    716731</div>
  • weforms/trunk/assets/wpuf/js/wpuf-form-builder-components.js

    r2416759 r2514969  
    2020            hidden_fields: function hidden_fields() {
    2121                return this.$store.state.form_fields.filter(function (item) {
    22                     return 'custom_hidden_field' === item.template;
     22                    return 'custom_hidden_field' === item.template || 'humanpresence' === item.template;
    2323                });
    2424            },
     
    3131                return wpuf_form_builder.pro_link;
    3232            }
     33        },
     34
     35        created: function created() {
     36            var self = this,
     37                humanpresence_field_id = 0,
     38                i = 0;
     39            for (i = 0; i < self.$store.state.form_fields.length; i++) {
     40                if (self.$store.state.form_fields[i].template === 'humanpresence') {
     41                    humanpresence_field_id = self.$store.state.form_fields[i].id;
     42                }
     43            }
     44
     45            wpuf_form_builder.event_hub.$on('humanpresence-changed', this.humanpresence_changed);
     46            wpuf_form_builder.event_hub.$on('humanpresence-disabled', this.delete_humanpresence_field);
    3347        },
    3448
     
    154168            },
    155169
     170            delete_field_no_confirm: function delete_field_no_confirm(index) {
     171                this.$store.commit('delete_form_field_element', index);
     172            },
     173
    156174            delete_hidden_field: function delete_hidden_field(field_id) {
    157175                var i = 0;
     
    159177                for (i = 0; i < this.form_fields.length; i++) {
    160178                    if (parseInt(field_id) === parseInt(this.form_fields[i].id)) {
    161                         this.delete_field(i);
    162                     }
     179                        if (this.form_fields[i].template === 'humanpresence') {
     180                            this.delete_field_no_confirm(i);
     181                            this.disable_humanpresence_setting();
     182                        } else {
     183                            this.delete_field(i);
     184                        }
     185                    }
     186                }
     187            },
     188
     189            delete_humanpresence_field: function delete_humanpresence_field(data) {
     190                var i = 0;
     191                if (data.$store.state.form_fields.length) {
     192                    for (i = 0; i < data.$store.state.form_fields.length; i++) {
     193                        if (data.$store.state.form_fields[i].template === 'humanpresence') {
     194                            this.delete_field_no_confirm(i);
     195                            this.disable_humanpresence_setting();
     196                        }
     197                    }
     198                }
     199            },
     200
     201            disable_humanpresence_setting: function disable_humanpresence_setting() {
     202                var settings = this.$store.state.settings;
     203                settings.humanpresence_enabled = false;
     204                this.$store.commit('set_form_settings', settings);
     205            },
     206
     207            humanpresence_changed: function humanpresence_changed(e, data) {
     208                if (data.$store.state.settings.humanpresence_enabled === 'true') {
     209                    wpuf_form_builder.event_hub.$emit('humanpresence-enabled', data);
     210                } else {
     211                    wpuf_form_builder.event_hub.$emit('humanpresence-disabled', data);
    163212                }
    164213            },
     
    428477                show_basic_settings: true,
    429478                show_advanced_settings: false,
    430                 show_quiz_settings: false
     479                show_quiz_settings: false,
     480                show_humanpresence_settings: false
    431481            };
    432482        },
     
    437487                this.show_advanced_settings = false;
    438488                this.show_quiz_settings = false;
     489                this.show_humanpresence_settings = false;
    439490
    440491                return parseInt(this.$store.state.editing_field_id);
     
    504555            },
    505556
     557            humanpresence_settings: function humanpresence_settings() {
     558                return this.settings.filter(function (item) {
     559                    return 'humanpresence' === item.section;
     560                });
     561            },
     562
    506563            form_field_type_title: function form_field_type_title() {
    507564                var template = this.editing_form_field.template;
     
    791848                scroll: true,
    792849                stop: function stop(event, ui) {
    793                     var data_source = ui.item.context.attributes['data-source'].value;
     850                    var data_source = $(ui.item).attr('data-source');
    794851
    795852                    if ('panel' === data_source) {
    796853                        var payload = {
    797854                            toIndex: parseInt($(ui.item).index()),
    798                             field_template: ui.item.context.attributes['data-form-field'].value,
    799                             to_column: $(this).context.parentElement.classList[0]
     855                            field_template: $(ui.item).attr('data-form-field'),
     856                            to_column: $(this).parent()[0].classList[0]
    800857                        };
    801858
     
    810867                        data = item.dataset,
    811868                        source = data.source,
    812                         toIndex = parseInt($(ui.item).index()),
     869                        toIndex = parseInt($(item).index()),
    813870                        payload = {
    814871                        toIndex: toIndex
     
    817874                    if ('column-field-stage' === source) {
    818875                        payload.field_id = self.field.id;
    819                         payload.fromIndex = parseInt(ui.item.context.attributes['column-field-index'].value);
    820                         payload.fromColumn = ui.item.context.attributes['in-column'].value;
    821                         payload.toColumn = ui.item.context.parentElement.parentElement.classList[0];
     876                        payload.fromIndex = parseInt($(item).attr('column-field-index'));
     877                        payload.fromColumn = $(item).attr('in-column');
     878                        payload.toColumn = $(item).parent().parent()[0].classList[0];
    822879
    823880                        // when drag field one column to another column, sortable event trigger twice and try to swap field twice.
     
    10271084            resizeColumns: function resizeColumns(columnsNumber) {
    10281085                var self = this;
    1029 
    10301086                (function () {
    10311087                    var columnElement;
    10321088                    var startOffset;
    1033                     var columnField = $(self.$el).context.parentElement;
     1089                    var columnField = $(self.$el).parent();
    10341090                    var total_width = parseInt($(columnField).width());
    10351091
     
    11971253        },
    11981254
     1255        created: function created() {
     1256            wpuf_form_builder.event_hub.$on('humanpresence-enabled', this.add_humanpresence_field);
     1257        },
     1258
    11991259        mounted: function mounted() {
    12001260            // bind jquery ui draggable
    1201             $(this.$el).find('.panel-form-field-buttons .button').draggable({
     1261            $(this.$el).find('.panel-form-field-buttons .button').not('[data-form-field="humanpresence"]').draggable({
    12021262                connectToSortable: '#form-preview-stage .wpuf-form, .wpuf-column-inner-fields .wpuf-column-fields-sortable-list',
    12031263                helper: 'clone',
     
    12421302                }
    12431303
     1304                if (field_template === 'humanpresence') {
     1305                    var settings = this.$store.state.settings;
     1306                    settings.humanpresence_enabled = true;
     1307                    this.$store.commit('set_form_settings', settings);
     1308                }
     1309
    12441310                payload.field = field;
    12451311
    12461312                // add new form element
    12471313                this.$store.commit('add_form_field_element', payload);
     1314            },
     1315
     1316            add_humanpresence_field: function add_humanpresence_field(data) {
     1317                if (!this.containsField('humanpresence')) {
     1318                    this.add_form_field('humanpresence');
     1319                }
    12481320            },
    12491321
     
    13741446
    13751447    /**
     1448     * Field template: HumanPresence
     1449     */
     1450    Vue.component('form-humanpresence', {
     1451        template: '#tmpl-wpuf-form-humanpresence',
     1452
     1453        mixins: [wpuf_mixins.form_field_mixin],
     1454
     1455        computed: {
     1456            has_humanpresence_installed: function has_humanpresence_installed() {
     1457                return wpuf_form_builder.humanpresence_installed;
     1458            },
     1459
     1460            no_humanpresence_installed_msg: function no_humanpresence_installed_msg() {
     1461                return wpuf_form_builder.field_settings.humanpresence.validator.msg;
     1462            }
     1463        }
     1464
     1465    });
     1466
     1467    /**
    13761468     * Field template: Section Break
    13771469     */
  • weforms/trunk/assets/wpuf/js/wpuf-form-builder-components.min.js

    r2416759 r2514969  
    1 "use strict";!function(d){Vue.component("builder-stage",{template:"#tmpl-wpuf-builder-stage",mixins:wpuf_form_builder_mixins(wpuf_mixins.builder_stage),computed:{form_fields:function(){return this.$store.state.form_fields},field_settings:function(){return this.$store.state.field_settings},hidden_fields:function(){return this.$store.state.form_fields.filter(function(e){return"custom_hidden_field"===e.template})},editing_form_id:function(){return this.$store.state.editing_field_id},pro_link:function(){return wpuf_form_builder.pro_link}},mounted:function(){var f=this,r=!1;d("#form-preview-stage .wpuf-form.sortable-list").sortable({placeholder:"form-preview-stage-dropzone",items:".field-items",handle:".control-buttons .move",scroll:!0,over:function(){r=!1,d(".wpuf-column-inner-fields").on("drop",function(e){var t=e.currentTarget.classList;d.inArray(".wpuf-column-inner-fields",t)&&(r=!0)})},update:function(e,t){var i=t.item[0].dataset,n=i.source,o={toIndex:parseInt(d(t.item).index())};if("panel"===n){var l=t.item[0].dataset.formField,s=d.extend(!0,{},f.field_settings[l].field_props);if(f.isSingleInstance(l)&&f.containsField(l))return swal({title:"Oops...",text:"You already have this field in the form"}),void d(this).find(".button.ui-draggable.ui-draggable-handle").remove();s.id=f.get_random_id(),"yes"!==s.is_meta||s.name||(s.name=s.label.replace(/\W/g,"_").toLowerCase()+"_"+s.id),o.field=s,r||f.$store.commit("add_form_field_element",o),d(this).find(".button.ui-draggable.ui-draggable-handle").remove()}else"stage"===n&&(o.fromIndex=parseInt(i.index),f.$store.commit("swap_form_field_elements",o))}})},methods:{open_field_settings:function(e){this.$store.commit("open_field_settings",e)},clone_field:function(e,t){var i={field_id:e,index:t,new_id:this.get_random_id()},n=_.find(this.$store.state.form_fields,function(e){return parseInt(e.id)===parseInt(i.field_id)});this.isSingleInstance(n.template)&&this.containsField(n.template)?swal({title:"Oops...",text:"You already have this field in the form"}):this.$store.commit("clone_form_field_element",i)},delete_field:function(e){var t=this;swal({text:t.i18n.delete_field_warn_msg,type:"warning",showCancelButton:!0,confirmButtonColor:"#d54e21",confirmButtonText:t.i18n.yes_delete_it,cancelButtonText:t.i18n.no_cancel_it,confirmButtonClass:"btn btn-success",cancelButtonClass:"btn btn-danger"}).then(function(){t.$store.commit("delete_form_field_element",e)},function(){})},delete_hidden_field:function(e){var t=0;for(t=0;t<this.form_fields.length;t++)parseInt(e)===parseInt(this.form_fields[t].id)&&this.delete_field(t)},is_pro_feature:function(e){return!(!this.field_settings[e]||!this.field_settings[e].pro_feature)},is_template_available:function(e){var t=e.template;return this.field_settings[t]?!this.is_pro_feature(t):!!_.isFunction(this["is_"+t+"_template_available"])&&this["is_"+t+"_template_available"].call(this,e)},is_full_width:function(e){return!(!this.field_settings[e]||!this.field_settings[e].is_full_width)},is_invisible:function(e){return!(!e.recaptcha_type||"invisible_recaptcha"!==e.recaptcha_type)},get_field_name:function(e){return this.field_settings[e].title}}}),Vue.component("field-checkbox",{template:"#tmpl-wpuf-field-checkbox",mixins:[wpuf_mixins.option_field_mixin],computed:{value:{get:function(){var e=this.editing_form_field[this.option_field.name];return this.option_field.is_single_opt?e===Object.keys(this.option_field.options)[0]:this.editing_form_field[this.option_field.name]},set:function(e){this.option_field.is_single_opt&&(e=e?Object.keys(this.option_field.options)[0]:""),this.$store.commit("update_editing_form_field",{editing_field_id:this.editing_form_field.id,field_name:this.option_field.name,value:e})}}}}),Vue.component("field-html_help_text",{template:"#tmpl-wpuf-field-html_help_text",mixins:[wpuf_mixins.option_field_mixin]}),Vue.component("field-multiselect",{template:"#tmpl-wpuf-field-multiselect",mixins:[wpuf_mixins.option_field_mixin],computed:{value:{get:function(){return this.editing_form_field[this.option_field.name]},set:function(e){this.$store.commit("update_editing_form_field",{editing_field_id:this.editing_form_field.id,field_name:this.option_field.name,value:e})}}},mounted:function(){this.bind_selectize()},methods:{bind_selectize:function(){var t=this;d(this.$el).find(".term-list-selector").selectize({}).on("change",function(){var e=d(this).val();t.value=e})}}}),Vue.component("field-option-data",{template:"#tmpl-wpuf-field-option-data",mixins:[wpuf_mixins.option_field_mixin],data:function(){return{show_value:!1,options:[],selected:[]}},computed:{field_options:function(){return this.editing_form_field.options},field_selected:function(){return this.editing_form_field.selected}},mounted:function(){var l=this;this.set_options(),d(this.$el).find(".option-field-option-chooser").sortable({items:".option-field-option",handle:".sort-handler",update:function(e,t){var i=t.item[0].dataset,n=parseInt(d(t.item).index()),o=parseInt(i.index);l.options.swap(o,n)}})},methods:{set_options:function(){var i=this,e=d.extend(!0,{},this.editing_form_field.options);_.each(e,function(e,t){i.options.push({label:e,value:t,id:i.get_random_id()})}),this.option_field.is_multiple&&!_.isArray(this.field_selected)?this.selected=[this.field_selected]:this.selected=this.field_selected},clear_selection:function(){this.selected=null},add_option:function(){var e=this.options.length,t=this.i18n.option+"-"+(e+1);this.options.push({label:t,value:t,id:this.get_random_id()})},delete_option:function(e){1!==this.options.length?this.options.splice(e,1):this.warn({text:this.i18n.last_choice_warn_msg,showCancelButton:!1,confirmButtonColor:"#46b450"})},set_option_label:function(e,t){this.options[e].value=t.toLocaleLowerCase().replace(/\s/g,"_")}},watch:{options:{deep:!0,handler:function(e){var t={},i=0;for(i=0;i<e.length;i++)t[e[i].value]=e[i].label;this.update_value("options",t)}},selected:function(e){this.update_value("selected",e)}}}),Vue.component("field-option-pro-feature-alert",{template:"#tmpl-wpuf-field-option-pro-feature-alert",mixins:[wpuf_mixins.option_field_mixin],computed:{pro_link:function(){return wpuf_form_builder.pro_link}}}),Vue.component("field-options",{template:"#tmpl-wpuf-field-options",mixins:wpuf_form_builder_mixins(wpuf_mixins.field_options),data:function(){return{show_basic_settings:!0,show_advanced_settings:!1,show_quiz_settings:!1}},computed:{editing_field_id:function(){return this.show_basic_settings=!0,this.show_advanced_settings=!1,this.show_quiz_settings=!1,parseInt(this.$store.state.editing_field_id)},editing_form_field:function(){var e=this,t=0;for(t=0;t<e.$store.state.form_fields.length;t++){if(e.$store.state.form_fields[t].id===parseInt(e.editing_field_id))return e.$store.state.form_fields[t];if("column_field"===e.$store.state.form_fields[t].template){var i=e.$store.state.form_fields[t].inner_fields;for(var n in i)if(i.hasOwnProperty(n))for(var o=0;o<i[n].length;){if(i[n][o].id===e.editing_field_id)return i[n][o];o++}}}},settings:function(){var e=[],t=this.editing_form_field.template;return e=_.isFunction(this["settings_"+t])?this["settings_"+t].call(this,this.editing_form_field):this.$store.state.field_settings[t].settings,_.sortBy(e,function(e){return parseInt(e.priority)})},basic_settings:function(){return this.settings.filter(function(e){return"basic"===e.section})},advanced_settings:function(){return this.settings.filter(function(e){return"advanced"===e.section})},quiz_settings:function(){return this.settings.filter(function(e){return"quiz"===e.section})},form_field_type_title:function(){var e=this.editing_form_field.template;return _.isFunction(this["form_field_"+e+"_title"])?this["form_field_"+e+"_title"].call(this,this.editing_form_field):this.$store.state.field_settings[e].title},form_settings:function(){return this.$store.state.settings}},watch:{form_settings:function(){return this.$store.state.settings}}}),Vue.component("field-radio",{template:"#tmpl-wpuf-field-radio",mixins:[wpuf_mixins.option_field_mixin],computed:{value:{get:function(){return this.editing_form_field[this.option_field.name]},set:function(e){this.$store.commit("update_editing_form_field",{editing_field_id:this.editing_form_field.id,field_name:this.option_field.name,value:e})}}}}),Vue.component("field-range",{template:"#tmpl-wpuf-field-range",mixins:[wpuf_mixins.option_field_mixin],computed:{value:{get:function(){return this.editing_form_field[this.option_field.name]},set:function(e){this.update_value(this.option_field.name,e)}},minColumn:function(){return this.editing_form_field.min_column},maxColumn:function(){return this.editing_form_field.max_column}},methods:{}}),Vue.component("field-select",{template:"#tmpl-wpuf-field-select",mixins:[wpuf_mixins.option_field_mixin],computed:{value:{get:function(){return this.editing_form_field[this.option_field.name]},set:function(e){this.$store.commit("update_editing_form_field",{editing_field_id:this.editing_form_field.id,field_name:this.option_field.name,value:e})}}}}),Vue.component("field-text",{template:"#tmpl-wpuf-field-text",mixins:[wpuf_mixins.option_field_mixin],computed:{value:{get:function(){return this.editing_form_field[this.option_field.name]},set:function(e){this.update_value(this.option_field.name,e)}}},methods:{on_focusout:function(e){wpuf_form_builder.event_hub.$emit("field-text-focusout",e,this)},on_keyup:function(e){wpuf_form_builder.event_hub.$emit("field-text-keyup",e,this)}}}),Vue.component("field-text-meta",{template:"#tmpl-wpuf-field-text-meta",mixins:[wpuf_mixins.option_field_mixin],computed:{value:{get:function(){return this.editing_form_field[this.option_field.name]},set:function(e){this.update_value(this.option_field.name,e)}}},created:function(){"yes"===this.editing_form_field.is_meta&&(this.value||(this.value=this.editing_form_field.label.replace(/\W/g,"_").toLowerCase()),wpuf_form_builder.event_hub.$on("field-text-keyup",this.meta_key_autocomplete))},methods:{meta_key_autocomplete:function(e,t){"label"===t.option_field.name&&parseInt(this.editing_form_field.id)===parseInt(t.editing_form_field.id)&&(this.value=t.value.replace(/\W/g,"_").toLowerCase())}}}),Vue.component("field-textarea",{template:"#tmpl-wpuf-field-textarea",mixins:[wpuf_mixins.option_field_mixin],computed:{value:{get:function(){return this.editing_form_field[this.option_field.name]},set:function(e){this.update_value(this.option_field.name,e)}}}}),Vue.component("field-visibility",{template:"#tmpl-wpuf-field-visibility",mixins:[wpuf_mixins.option_field_mixin],computed:{selected:{get:function(){return this.editing_form_field[this.option_field.name].selected},set:function(e){this.$store.commit("update_editing_form_field",{editing_field_id:this.editing_form_field.id,field_name:this.option_field.name,value:{selected:e,choices:[]}})}},choices:{get:function(){return this.editing_form_field[this.option_field.name].choices},set:function(e){this.$store.commit("update_editing_form_field",{editing_field_id:this.editing_form_field.id,field_name:this.option_field.name,value:{selected:this.selected,choices:e}})}}},methods:{},watch:{selected:function(e){this.update_value("selected",e)}}}),Vue.component("form-checkbox_field",{template:"#tmpl-wpuf-form-checkbox_field",mixins:[wpuf_mixins.form_field_mixin]});var e=[wpuf_mixins.form_field_mixin];window.wpuf_forms_mixin_builder_stage&&e.push(window.wpuf_forms_mixin_builder_stage),window.weforms_mixin_builder_stage&&e.push(window.weforms_mixin_builder_stage),Vue.component("form-column_field",{template:"#tmpl-wpuf-form-column_field",mixins:e,data:function(){return{columnClasses:["column-1","column-2","column-3"]}},mounted:function(){this.resizeColumns(this.field.columns);var o=this,e=d(o.$el).find(".wpuf-column-inner-fields .wpuf-column-fields-sortable-list"),l=1,t=d(".wpuf-field-columns"),i=d(o.$el).find(".wpuf-column-field-inner-columns .wpuf-column-inner-fields");t.mouseenter(function(){o.resizeColumns(o.field.columns)}),t.mouseleave(function(){i.unbind("mouseup"),i.unbind("mousemove")}),d(e).sortable({placeholder:"form-preview-stage-dropzone",connectWith:e,items:".column-field-items",handle:".wpuf-column-field-control-buttons .move",scroll:!0,stop:function(e,t){if("panel"===t.item.context.attributes["data-source"].value){var i={toIndex:parseInt(d(t.item).index()),field_template:t.item.context.attributes["data-form-field"].value,to_column:d(this).context.parentElement.classList[0]};o.add_column_inner_field(i),d(this).find(".button.ui-draggable.ui-draggable-handle").remove()}},update:function(e,t){var i=t.item[0].dataset.source,n={toIndex:parseInt(d(t.item).index())};"column-field-stage"===i&&(n.field_id=o.field.id,n.fromIndex=parseInt(t.item.context.attributes["column-field-index"].value),n.fromColumn=t.item.context.attributes["in-column"].value,n.toColumn=t.item.context.parentElement.parentElement.classList[0],n.fromColumn!==n.toColumn&&1===l?l=0:l++,n.fromColumn===n.toColumn&&(l=1),1===l&&o.$store.commit("swap_column_field_elements",n))}})},computed:{column_fields:function(){return this.field.inner_fields},innerColumns:function(){return this.field.columns},editing_form_id:function(){return this.$store.state.editing_field_id},field_settings:function(){return this.$store.state.field_settings}},methods:{is_template_available:function(e){var t=e.template;return this.field_settings[t]?!this.is_pro_feature(t):!!_.isFunction(this["is_"+t+"_template_available"])&&this["is_"+t+"_template_available"].call(this,e)},is_pro_feature:function(e){return!(!this.field_settings[e]||!this.field_settings[e].pro_feature)},get_field_name:function(e){return this.field_settings[e].title},is_full_width:function(e){return!(!this.field_settings[e]||!this.field_settings[e].is_full_width)},is_invisible:function(e){return!(!e.recaptcha_type||"invisible_recaptcha"!==e.recaptcha_type)},isAllowedInClolumnField:function(e){return 0<=d.inArray(e,["column_field","custom_hidden_field","step_start"])},add_column_inner_field:function(e){var t={toWhichColumnField:this.field.id,toWhichColumnFieldMeta:this.field.name,toIndex:e.toIndex,toWhichColumn:e.to_column};if(this.isAllowedInClolumnField(e.field_template))swal({title:"Oops...",text:"You cannot add this field as inner column field"});else if(this.isSingleInstance(e.field_template)&&this.containsField(e.field_template))swal({title:"Oops...",text:"You already have this field in the form"});else{var i=d.extend(!0,{},this.$store.state.field_settings[e.field_template].field_props),n=this.$store.state.form_fields;if(i.id=this.get_random_id(),"yes"===i.is_meta&&!i.name&&i.label)i.name=i.label.replace(/\W/g,"_").toLowerCase(),n.filter(function(e){return e.template===i.template})&&(i.name+="_"+this.get_random_id());t.field=i,this.$store.commit("add_column_inner_field_element",t)}},moveFieldsTo:function(e){var t={field_id:this.field.id,move_to:e,inner_fields:this.getInnerFields()};this.$store.commit("move_column_inner_fields",t)},getInnerFields:function(){return this.field.inner_fields},open_column_field_settings:function(e,t,i){var n={field_id:this.field.id,column_field:e,index:t,column:i};this.$store.commit("open_column_field_settings",n)},clone_column_field:function(e,t,i){var n={field_id:this.field.id,column_field_id:e.id,index:t,toColumn:i,new_id:this.get_random_id()};this.isSingleInstance(e.template)?swal({title:"Oops...",text:"You already have this field in the form"}):this.$store.commit("clone_column_field_element",n)},delete_column_field:function(e,t){var i=this,n={field_id:i.field.id,index:e,fromColumn:t};swal({text:i.i18n.delete_field_warn_msg,type:"warning",showCancelButton:!0,confirmButtonColor:"#d54e21",confirmButtonText:i.i18n.yes_delete_it,cancelButtonText:i.i18n.no_cancel_it,confirmButtonClass:"btn btn-success",cancelButtonClass:"btn btn-danger"}).then(function(){i.$store.commit("delete_column_field_element",n)},function(){})},resizeColumns:function(n){var o,i,l,s,f=this;l=d(f.$el).context.parentElement,s=parseInt(d(l).width()),Array.prototype.forEach.call(d(f.$el).find(".wpuf-column-field-inner-columns .wpuf-column-inner-fields"),function(t){t.style.position="relative";var e=document.createElement("div");e.innerHTML="&nbsp;",e.style.top=0,e.style.right=0,e.style.bottom=0,e.style.width="5px",e.style.position="absolute",e.style.cursor="col-resize",e.addEventListener("mousedown",function(e){i=(o=t).offsetWidth-e.pageX}),t.appendChild(e)}),d(f.$el).find(".wpuf-column-field-inner-columns .wpuf-column-inner-fields").mousemove(function(e){if(o){var t=i+e.pageX;o.style.width=100*t/s+"%"}}),d(f.$el).find(".wpuf-column-field-inner-columns .wpuf-column-inner-fields").mouseup(function(){var e=0,t=0,i=0;i=3===n?t=e=100/n:(t=2===n?e=100/n:(e=d(l).find(".column-1").width(),d(l).find(".column-2").width()),0),f.field.inner_columns_size["column-1"]=e+"%",f.field.inner_columns_size["column-2"]=t+"%",f.field.inner_columns_size["column-3"]=i+"%",o=void 0})}},watch:{innerColumns:function(e){var t=parseInt(e),i=this.field.inner_columns_size;Object.keys(i).forEach(function(e){1===t&&(i[e]="100%"),2===t&&(i[e]="50%"),3===t&&(i[e]="33.33%")}),1===t&&this.moveFieldsTo("column-1"),2===t&&this.moveFieldsTo("column-2"),this.resizeColumns(t)}}}),Vue.component("form-custom_hidden_field",{template:"#tmpl-wpuf-form-custom_hidden_field",mixins:[wpuf_mixins.form_field_mixin]}),Vue.component("form-custom_html",{template:"#tmpl-wpuf-form-custom_html",mixins:[wpuf_mixins.form_field_mixin],data:function(){return{raw_html:"<p>from data</p>"}}}),Vue.component("form-dropdown_field",{template:"#tmpl-wpuf-form-dropdown_field",mixins:[wpuf_mixins.form_field_mixin]}),Vue.component("form-email_address",{template:"#tmpl-wpuf-form-email_address",mixins:[wpuf_mixins.form_field_mixin]}),Vue.component("form-featured_image",{template:"#tmpl-wpuf-form-featured_image",mixins:[wpuf_mixins.form_field_mixin]}),Vue.component("form-fields",{template:"#tmpl-wpuf-form-fields",mixins:wpuf_form_builder_mixins(wpuf_mixins.form_fields),computed:{panel_sections:function(){return this.$store.state.panel_sections},field_settings:function(){return this.$store.state.field_settings},form_fields:function(){return this.$store.state.form_fields}},mounted:function(){d(this.$el).find(".panel-form-field-buttons .button").draggable({connectToSortable:"#form-preview-stage .wpuf-form, .wpuf-column-inner-fields .wpuf-column-fields-sortable-list",helper:"clone",revert:"invalid",cancel:".button-faded"}).disableSelection()},methods:{panel_toggle:function(e){this.$store.commit("panel_toggle",e)},add_form_field:function(e){var t={toIndex:this.$store.state.form_fields.length};if(this.isSingleInstance(e)&&this.containsField(e))swal({title:"Oops...",text:"You already have this field in the form"});else{var i=d.extend(!0,{},this.$store.state.field_settings[e].field_props);if(i.id=this.get_random_id(),!i.name&&i.label){i.name=i.label.replace(/\W/g,"_").toLowerCase();var n=this.form_fields.filter(function(e){return e.template===i.template});n.length&&(i.name+="_"+n.length)}t.field=i,this.$store.commit("add_form_field_element",t)}},is_pro_feature:function(e){return this.field_settings[e].pro_feature},alert_pro_feature:function(e){var t=this.field_settings[e].title;swal({title:'<i class="fa fa-lock"></i> '+t+" <br>"+this.i18n.is_a_pro_feature,text:this.i18n.pro_feature_msg,type:"",showCancelButton:!0,cancelButtonText:this.i18n.close,confirmButtonColor:"#46b450",confirmButtonText:this.i18n.upgrade_to_pro}).then(function(e){e&&window.open(wpuf_form_builder.pro_link,"_blank")},function(){})},alert_invalidate_msg:function(e){var t=this.field_settings[e].validator;t&&t.msg&&this.warn({title:t.msg_title||"",html:t.msg,type:"warning",showCancelButton:!1,confirmButtonColor:"#46b450",confirmButtonText:this.i18n.ok})},get_invalidate_btn_class:function(e){return this.field_settings[e].validator.button_class}}}),Vue.component("form-image_upload",{template:"#tmpl-wpuf-form-image_upload",mixins:[wpuf_mixins.form_field_mixin]}),Vue.component("form-multiple_select",{template:"#tmpl-wpuf-form-multiple_select",mixins:[wpuf_mixins.form_field_mixin]}),Vue.component("form-post_content",{template:"#tmpl-wpuf-form-post_content",mixins:[wpuf_mixins.form_field_mixin]}),Vue.component("form-post_excerpt",{template:"#tmpl-wpuf-form-post_excerpt",mixins:[wpuf_mixins.form_field_mixin]}),Vue.component("form-post_tags",{template:"#tmpl-wpuf-form-post_tags",mixins:[wpuf_mixins.form_field_mixin]}),Vue.component("form-post_title",{template:"#tmpl-wpuf-form-post_title",mixins:[wpuf_mixins.form_field_mixin]}),Vue.component("form-radio_field",{template:"#tmpl-wpuf-form-radio_field",mixins:[wpuf_mixins.form_field_mixin]}),Vue.component("form-recaptcha",{template:"#tmpl-wpuf-form-recaptcha",mixins:[wpuf_mixins.form_field_mixin],computed:{has_recaptcha_api_keys:function(){return!(!wpuf_form_builder.recaptcha_site||!wpuf_form_builder.recaptcha_secret)},no_api_keys_msg:function(){return wpuf_form_builder.field_settings.recaptcha.validator.msg}}}),Vue.component("form-section_break",{template:"#tmpl-wpuf-form-section_break",mixins:[wpuf_mixins.form_field_mixin]}),Vue.component("form-taxonomy",{template:"#tmpl-wpuf-form-taxonomy",mixins:[wpuf_mixins.form_field_mixin],computed:{terms:function(){var e;for(e in wpuf_form_builder.wp_post_types){var t=wpuf_form_builder.wp_post_types[e];if(t.hasOwnProperty(this.field.name)){var i=t[this.field.name];if(i.terms)return i.terms}}return[]},sorted_terms:function(){var t=this,i=d.extend(!0,[],this.terms);if(this.field.exclude_type&&this.field.exclude){if(1<this.field.exclude.length)var n=this.field.exclude.split(",").map(function(e){return e=e.trim(),e=parseInt(e)}).filter(function(e){return isFinite(e)});i=i.filter(function(e){switch(t.field.exclude_type){case"exclude":return _.indexOf(n,e.term_id)<0;case"include":return 0<=_.indexOf(n,e.term_id);case"child_of":return 0<=_.indexOf(n,parseInt(e.parent))}})}i=_.sortBy(i,function(e){return e[t.field.orderby]}),"DESC"===this.field.order&&(i=i.reverse());var e=i.filter(function(e){return!e.parent});return e.map(function(e){e.children=t.get_child_terms(e.term_id,i)}),e.length?e:i}},methods:{get_child_terms:function(t,i){var n=this,e=i.filter(function(e){return parseInt(e.parent)===parseInt(t)});return e.map(function(e){e.children=n.get_child_terms(e.term_id,i)}),e},get_term_dropdown_options:function(){var t=this,i="";return"select"===this.field.type&&(i='<option value="">'+this.field.first+"</option>"),_.each(t.sorted_terms,function(e){i+=t.get_term_dropdown_options_children(e,0)}),i},get_term_dropdown_options_children:function(e,t){var i=this,n="",o="",l=0;for(l=0;l<t;l++)o+="&nbsp;&nbsp;";return n+='<option value="'+e.id+'">'+o+e.name+"</option>",e.children.length&&_.each(e.children,function(e){n+=i.get_term_dropdown_options_children(e,t+1)}),n},get_term_checklist:function(){var t=this,i="";return i+='<ul class="wpuf-category-checklist">',_.each(this.sorted_terms,function(e){i+=t.get_term_checklist_li(e)}),i+="</ul>"},get_term_checklist_li:function(e){var t=this,i="";return i+='<li><label class="selectit"><input type="checkbox"> '+e.name+"</label></li>",e.children.length&&(i+='<ul class="children">',_.each(e.children,function(e){i+=t.get_term_checklist_li(e)}),i+="</ul>"),i},get_term_checklist_inline:function(){var t=this,i="";return _.each(this.sorted_terms,function(e){i+=t.get_term_checklist_li_inline(e)}),i},get_term_checklist_li_inline:function(e){var t=this,i="";return i+='<label class="wpuf-checkbox-inline"><input type="checkbox"> '+e.name+"</label>",e.children.length&&_.each(e.children,function(e){i+=t.get_term_checklist_li_inline(e)}),i}}}),Vue.component("form-text_field",{template:"#tmpl-wpuf-form-text_field",mixins:[wpuf_mixins.form_field_mixin]}),Vue.component("form-textarea_field",{template:"#tmpl-wpuf-form-textarea_field",mixins:[wpuf_mixins.form_field_mixin]}),Vue.component("form-website_url",{template:"#tmpl-wpuf-form-website_url",mixins:[wpuf_mixins.form_field_mixin]}),Vue.component("help-text",{template:"#tmpl-wpuf-help-text",props:{text:{type:String,default:""}},mounted:function(){d(".wpuf-tooltip").tooltip()}}),Vue.component("text-editor",{template:"#tmpl-wpuf-text-editor",props:["rich","default_text"],computed:{site_url:function(){return wpuf_form_builder.site_url},is_full:function(){return"yes"===this.rich}}})}(jQuery);
     1"use strict";!function(d){Vue.component("builder-stage",{template:"#tmpl-wpuf-builder-stage",mixins:wpuf_form_builder_mixins(wpuf_mixins.builder_stage),computed:{form_fields:function(){return this.$store.state.form_fields},field_settings:function(){return this.$store.state.field_settings},hidden_fields:function(){return this.$store.state.form_fields.filter(function(e){return"custom_hidden_field"===e.template||"humanpresence"===e.template})},editing_form_id:function(){return this.$store.state.editing_field_id},pro_link:function(){return wpuf_form_builder.pro_link}},created:function(){var e=this,t=0;for(t=0;t<e.$store.state.form_fields.length;t++)"humanpresence"===e.$store.state.form_fields[t].template&&e.$store.state.form_fields[t].id;wpuf_form_builder.event_hub.$on("humanpresence-changed",this.humanpresence_changed),wpuf_form_builder.event_hub.$on("humanpresence-disabled",this.delete_humanpresence_field)},mounted:function(){var f=this,r=!1;d("#form-preview-stage .wpuf-form.sortable-list").sortable({placeholder:"form-preview-stage-dropzone",items:".field-items",handle:".control-buttons .move",scroll:!0,over:function(){r=!1,d(".wpuf-column-inner-fields").on("drop",function(e){var t=e.currentTarget.classList;d.inArray(".wpuf-column-inner-fields",t)&&(r=!0)})},update:function(e,t){var i=t.item[0].dataset,n=i.source,o={toIndex:parseInt(d(t.item).index())};if("panel"===n){var s=t.item[0].dataset.formField,l=d.extend(!0,{},f.field_settings[s].field_props);if(f.isSingleInstance(s)&&f.containsField(s))return swal({title:"Oops...",text:"You already have this field in the form"}),void d(this).find(".button.ui-draggable.ui-draggable-handle").remove();l.id=f.get_random_id(),"yes"!==l.is_meta||l.name||(l.name=l.label.replace(/\W/g,"_").toLowerCase()+"_"+l.id),o.field=l,r||f.$store.commit("add_form_field_element",o),d(this).find(".button.ui-draggable.ui-draggable-handle").remove()}else"stage"===n&&(o.fromIndex=parseInt(i.index),f.$store.commit("swap_form_field_elements",o))}})},methods:{open_field_settings:function(e){this.$store.commit("open_field_settings",e)},clone_field:function(e,t){var i={field_id:e,index:t,new_id:this.get_random_id()},n=_.find(this.$store.state.form_fields,function(e){return parseInt(e.id)===parseInt(i.field_id)});this.isSingleInstance(n.template)&&this.containsField(n.template)?swal({title:"Oops...",text:"You already have this field in the form"}):this.$store.commit("clone_form_field_element",i)},delete_field:function(e){var t=this;swal({text:t.i18n.delete_field_warn_msg,type:"warning",showCancelButton:!0,confirmButtonColor:"#d54e21",confirmButtonText:t.i18n.yes_delete_it,cancelButtonText:t.i18n.no_cancel_it,confirmButtonClass:"btn btn-success",cancelButtonClass:"btn btn-danger"}).then(function(){t.$store.commit("delete_form_field_element",e)},function(){})},delete_field_no_confirm:function(e){this.$store.commit("delete_form_field_element",e)},delete_hidden_field:function(e){var t=0;for(t=0;t<this.form_fields.length;t++)parseInt(e)===parseInt(this.form_fields[t].id)&&("humanpresence"===this.form_fields[t].template?(this.delete_field_no_confirm(t),this.disable_humanpresence_setting()):this.delete_field(t))},delete_humanpresence_field:function(e){var t=0;if(e.$store.state.form_fields.length)for(t=0;t<e.$store.state.form_fields.length;t++)"humanpresence"===e.$store.state.form_fields[t].template&&(this.delete_field_no_confirm(t),this.disable_humanpresence_setting())},disable_humanpresence_setting:function(){var e=this.$store.state.settings;e.humanpresence_enabled=!1,this.$store.commit("set_form_settings",e)},humanpresence_changed:function(e,t){"true"===t.$store.state.settings.humanpresence_enabled?wpuf_form_builder.event_hub.$emit("humanpresence-enabled",t):wpuf_form_builder.event_hub.$emit("humanpresence-disabled",t)},is_pro_feature:function(e){return!(!this.field_settings[e]||!this.field_settings[e].pro_feature)},is_template_available:function(e){var t=e.template;return this.field_settings[t]?!this.is_pro_feature(t):!!_.isFunction(this["is_"+t+"_template_available"])&&this["is_"+t+"_template_available"].call(this,e)},is_full_width:function(e){return!(!this.field_settings[e]||!this.field_settings[e].is_full_width)},is_invisible:function(e){return!(!e.recaptcha_type||"invisible_recaptcha"!==e.recaptcha_type)},get_field_name:function(e){return this.field_settings[e].title}}}),Vue.component("field-checkbox",{template:"#tmpl-wpuf-field-checkbox",mixins:[wpuf_mixins.option_field_mixin],computed:{value:{get:function(){var e=this.editing_form_field[this.option_field.name];return this.option_field.is_single_opt?e===Object.keys(this.option_field.options)[0]:this.editing_form_field[this.option_field.name]},set:function(e){this.option_field.is_single_opt&&(e=e?Object.keys(this.option_field.options)[0]:""),this.$store.commit("update_editing_form_field",{editing_field_id:this.editing_form_field.id,field_name:this.option_field.name,value:e})}}}}),Vue.component("field-html_help_text",{template:"#tmpl-wpuf-field-html_help_text",mixins:[wpuf_mixins.option_field_mixin]}),Vue.component("field-multiselect",{template:"#tmpl-wpuf-field-multiselect",mixins:[wpuf_mixins.option_field_mixin],computed:{value:{get:function(){return this.editing_form_field[this.option_field.name]},set:function(e){this.$store.commit("update_editing_form_field",{editing_field_id:this.editing_form_field.id,field_name:this.option_field.name,value:e})}}},mounted:function(){this.bind_selectize()},methods:{bind_selectize:function(){var t=this;d(this.$el).find(".term-list-selector").selectize({}).on("change",function(){var e=d(this).val();t.value=e})}}}),Vue.component("field-option-data",{template:"#tmpl-wpuf-field-option-data",mixins:[wpuf_mixins.option_field_mixin],data:function(){return{show_value:!1,options:[],selected:[]}},computed:{field_options:function(){return this.editing_form_field.options},field_selected:function(){return this.editing_form_field.selected}},mounted:function(){var s=this;this.set_options(),d(this.$el).find(".option-field-option-chooser").sortable({items:".option-field-option",handle:".sort-handler",update:function(e,t){var i=t.item[0].dataset,n=parseInt(d(t.item).index()),o=parseInt(i.index);s.options.swap(o,n)}})},methods:{set_options:function(){var i=this,e=d.extend(!0,{},this.editing_form_field.options);_.each(e,function(e,t){i.options.push({label:e,value:t,id:i.get_random_id()})}),this.option_field.is_multiple&&!_.isArray(this.field_selected)?this.selected=[this.field_selected]:this.selected=this.field_selected},clear_selection:function(){this.selected=null},add_option:function(){var e=this.options.length,t=this.i18n.option+"-"+(e+1);this.options.push({label:t,value:t,id:this.get_random_id()})},delete_option:function(e){1!==this.options.length?this.options.splice(e,1):this.warn({text:this.i18n.last_choice_warn_msg,showCancelButton:!1,confirmButtonColor:"#46b450"})},set_option_label:function(e,t){this.options[e].value=t.toLocaleLowerCase().replace(/\s/g,"_")}},watch:{options:{deep:!0,handler:function(e){var t={},i=0;for(i=0;i<e.length;i++)t[e[i].value]=e[i].label;this.update_value("options",t)}},selected:function(e){this.update_value("selected",e)}}}),Vue.component("field-option-pro-feature-alert",{template:"#tmpl-wpuf-field-option-pro-feature-alert",mixins:[wpuf_mixins.option_field_mixin],computed:{pro_link:function(){return wpuf_form_builder.pro_link}}}),Vue.component("field-options",{template:"#tmpl-wpuf-field-options",mixins:wpuf_form_builder_mixins(wpuf_mixins.field_options),data:function(){return{show_basic_settings:!0,show_advanced_settings:!1,show_quiz_settings:!1,show_humanpresence_settings:!1}},computed:{editing_field_id:function(){return this.show_basic_settings=!0,this.show_advanced_settings=!1,this.show_quiz_settings=!1,this.show_humanpresence_settings=!1,parseInt(this.$store.state.editing_field_id)},editing_form_field:function(){var e=this,t=0;for(t=0;t<e.$store.state.form_fields.length;t++){if(e.$store.state.form_fields[t].id===parseInt(e.editing_field_id))return e.$store.state.form_fields[t];if("column_field"===e.$store.state.form_fields[t].template){var i=e.$store.state.form_fields[t].inner_fields;for(var n in i)if(i.hasOwnProperty(n))for(var o=0;o<i[n].length;){if(i[n][o].id===e.editing_field_id)return i[n][o];o++}}}},settings:function(){var e=[],t=this.editing_form_field.template;return e=_.isFunction(this["settings_"+t])?this["settings_"+t].call(this,this.editing_form_field):this.$store.state.field_settings[t].settings,_.sortBy(e,function(e){return parseInt(e.priority)})},basic_settings:function(){return this.settings.filter(function(e){return"basic"===e.section})},advanced_settings:function(){return this.settings.filter(function(e){return"advanced"===e.section})},quiz_settings:function(){return this.settings.filter(function(e){return"quiz"===e.section})},humanpresence_settings:function(){return this.settings.filter(function(e){return"humanpresence"===e.section})},form_field_type_title:function(){var e=this.editing_form_field.template;return _.isFunction(this["form_field_"+e+"_title"])?this["form_field_"+e+"_title"].call(this,this.editing_form_field):this.$store.state.field_settings[e].title},form_settings:function(){return this.$store.state.settings}},watch:{form_settings:function(){return this.$store.state.settings}}}),Vue.component("field-radio",{template:"#tmpl-wpuf-field-radio",mixins:[wpuf_mixins.option_field_mixin],computed:{value:{get:function(){return this.editing_form_field[this.option_field.name]},set:function(e){this.$store.commit("update_editing_form_field",{editing_field_id:this.editing_form_field.id,field_name:this.option_field.name,value:e})}}}}),Vue.component("field-range",{template:"#tmpl-wpuf-field-range",mixins:[wpuf_mixins.option_field_mixin],computed:{value:{get:function(){return this.editing_form_field[this.option_field.name]},set:function(e){this.update_value(this.option_field.name,e)}},minColumn:function(){return this.editing_form_field.min_column},maxColumn:function(){return this.editing_form_field.max_column}},methods:{}}),Vue.component("field-select",{template:"#tmpl-wpuf-field-select",mixins:[wpuf_mixins.option_field_mixin],computed:{value:{get:function(){return this.editing_form_field[this.option_field.name]},set:function(e){this.$store.commit("update_editing_form_field",{editing_field_id:this.editing_form_field.id,field_name:this.option_field.name,value:e})}}}}),Vue.component("field-text",{template:"#tmpl-wpuf-field-text",mixins:[wpuf_mixins.option_field_mixin],computed:{value:{get:function(){return this.editing_form_field[this.option_field.name]},set:function(e){this.update_value(this.option_field.name,e)}}},methods:{on_focusout:function(e){wpuf_form_builder.event_hub.$emit("field-text-focusout",e,this)},on_keyup:function(e){wpuf_form_builder.event_hub.$emit("field-text-keyup",e,this)}}}),Vue.component("field-text-meta",{template:"#tmpl-wpuf-field-text-meta",mixins:[wpuf_mixins.option_field_mixin],computed:{value:{get:function(){return this.editing_form_field[this.option_field.name]},set:function(e){this.update_value(this.option_field.name,e)}}},created:function(){"yes"===this.editing_form_field.is_meta&&(this.value||(this.value=this.editing_form_field.label.replace(/\W/g,"_").toLowerCase()),wpuf_form_builder.event_hub.$on("field-text-keyup",this.meta_key_autocomplete))},methods:{meta_key_autocomplete:function(e,t){"label"===t.option_field.name&&parseInt(this.editing_form_field.id)===parseInt(t.editing_form_field.id)&&(this.value=t.value.replace(/\W/g,"_").toLowerCase())}}}),Vue.component("field-textarea",{template:"#tmpl-wpuf-field-textarea",mixins:[wpuf_mixins.option_field_mixin],computed:{value:{get:function(){return this.editing_form_field[this.option_field.name]},set:function(e){this.update_value(this.option_field.name,e)}}}}),Vue.component("field-visibility",{template:"#tmpl-wpuf-field-visibility",mixins:[wpuf_mixins.option_field_mixin],computed:{selected:{get:function(){return this.editing_form_field[this.option_field.name].selected},set:function(e){this.$store.commit("update_editing_form_field",{editing_field_id:this.editing_form_field.id,field_name:this.option_field.name,value:{selected:e,choices:[]}})}},choices:{get:function(){return this.editing_form_field[this.option_field.name].choices},set:function(e){this.$store.commit("update_editing_form_field",{editing_field_id:this.editing_form_field.id,field_name:this.option_field.name,value:{selected:this.selected,choices:e}})}}},methods:{},watch:{selected:function(e){this.update_value("selected",e)}}}),Vue.component("form-checkbox_field",{template:"#tmpl-wpuf-form-checkbox_field",mixins:[wpuf_mixins.form_field_mixin]});var e=[wpuf_mixins.form_field_mixin];window.wpuf_forms_mixin_builder_stage&&e.push(window.wpuf_forms_mixin_builder_stage),window.weforms_mixin_builder_stage&&e.push(window.weforms_mixin_builder_stage),Vue.component("form-column_field",{template:"#tmpl-wpuf-form-column_field",mixins:e,data:function(){return{columnClasses:["column-1","column-2","column-3"]}},mounted:function(){this.resizeColumns(this.field.columns);var s=this,e=d(s.$el).find(".wpuf-column-inner-fields .wpuf-column-fields-sortable-list"),l=1,t=d(".wpuf-field-columns"),i=d(s.$el).find(".wpuf-column-field-inner-columns .wpuf-column-inner-fields");t.mouseenter(function(){s.resizeColumns(s.field.columns)}),t.mouseleave(function(){i.unbind("mouseup"),i.unbind("mousemove")}),d(e).sortable({placeholder:"form-preview-stage-dropzone",connectWith:e,items:".column-field-items",handle:".wpuf-column-field-control-buttons .move",scroll:!0,stop:function(e,t){if("panel"===d(t.item).attr("data-source")){var i={toIndex:parseInt(d(t.item).index()),field_template:d(t.item).attr("data-form-field"),to_column:d(this).parent()[0].classList[0]};s.add_column_inner_field(i),d(this).find(".button.ui-draggable.ui-draggable-handle").remove()}},update:function(e,t){var i=t.item[0],n=i.dataset.source,o={toIndex:parseInt(d(i).index())};"column-field-stage"===n&&(o.field_id=s.field.id,o.fromIndex=parseInt(d(i).attr("column-field-index")),o.fromColumn=d(i).attr("in-column"),o.toColumn=d(i).parent().parent()[0].classList[0],o.fromColumn!==o.toColumn&&1===l?l=0:l++,o.fromColumn===o.toColumn&&(l=1),1===l&&s.$store.commit("swap_column_field_elements",o))}})},computed:{column_fields:function(){return this.field.inner_fields},innerColumns:function(){return this.field.columns},editing_form_id:function(){return this.$store.state.editing_field_id},field_settings:function(){return this.$store.state.field_settings}},methods:{is_template_available:function(e){var t=e.template;return this.field_settings[t]?!this.is_pro_feature(t):!!_.isFunction(this["is_"+t+"_template_available"])&&this["is_"+t+"_template_available"].call(this,e)},is_pro_feature:function(e){return!(!this.field_settings[e]||!this.field_settings[e].pro_feature)},get_field_name:function(e){return this.field_settings[e].title},is_full_width:function(e){return!(!this.field_settings[e]||!this.field_settings[e].is_full_width)},is_invisible:function(e){return!(!e.recaptcha_type||"invisible_recaptcha"!==e.recaptcha_type)},isAllowedInClolumnField:function(e){return 0<=d.inArray(e,["column_field","custom_hidden_field","step_start"])},add_column_inner_field:function(e){var t={toWhichColumnField:this.field.id,toWhichColumnFieldMeta:this.field.name,toIndex:e.toIndex,toWhichColumn:e.to_column};if(this.isAllowedInClolumnField(e.field_template))swal({title:"Oops...",text:"You cannot add this field as inner column field"});else if(this.isSingleInstance(e.field_template)&&this.containsField(e.field_template))swal({title:"Oops...",text:"You already have this field in the form"});else{var i=d.extend(!0,{},this.$store.state.field_settings[e.field_template].field_props),n=this.$store.state.form_fields;if(i.id=this.get_random_id(),"yes"===i.is_meta&&!i.name&&i.label)i.name=i.label.replace(/\W/g,"_").toLowerCase(),n.filter(function(e){return e.template===i.template})&&(i.name+="_"+this.get_random_id());t.field=i,this.$store.commit("add_column_inner_field_element",t)}},moveFieldsTo:function(e){var t={field_id:this.field.id,move_to:e,inner_fields:this.getInnerFields()};this.$store.commit("move_column_inner_fields",t)},getInnerFields:function(){return this.field.inner_fields},open_column_field_settings:function(e,t,i){var n={field_id:this.field.id,column_field:e,index:t,column:i};this.$store.commit("open_column_field_settings",n)},clone_column_field:function(e,t,i){var n={field_id:this.field.id,column_field_id:e.id,index:t,toColumn:i,new_id:this.get_random_id()};this.isSingleInstance(e.template)?swal({title:"Oops...",text:"You already have this field in the form"}):this.$store.commit("clone_column_field_element",n)},delete_column_field:function(e,t){var i=this,n={field_id:i.field.id,index:e,fromColumn:t};swal({text:i.i18n.delete_field_warn_msg,type:"warning",showCancelButton:!0,confirmButtonColor:"#d54e21",confirmButtonText:i.i18n.yes_delete_it,cancelButtonText:i.i18n.no_cancel_it,confirmButtonClass:"btn btn-success",cancelButtonClass:"btn btn-danger"}).then(function(){i.$store.commit("delete_column_field_element",n)},function(){})},resizeColumns:function(n){var o,i,s,l,f=this;s=d(f.$el).parent(),l=parseInt(d(s).width()),Array.prototype.forEach.call(d(f.$el).find(".wpuf-column-field-inner-columns .wpuf-column-inner-fields"),function(t){t.style.position="relative";var e=document.createElement("div");e.innerHTML="&nbsp;",e.style.top=0,e.style.right=0,e.style.bottom=0,e.style.width="5px",e.style.position="absolute",e.style.cursor="col-resize",e.addEventListener("mousedown",function(e){i=(o=t).offsetWidth-e.pageX}),t.appendChild(e)}),d(f.$el).find(".wpuf-column-field-inner-columns .wpuf-column-inner-fields").mousemove(function(e){if(o){var t=i+e.pageX;o.style.width=100*t/l+"%"}}),d(f.$el).find(".wpuf-column-field-inner-columns .wpuf-column-inner-fields").mouseup(function(){var e=0,t=0,i=0;i=3===n?t=e=100/n:(t=2===n?e=100/n:(e=d(s).find(".column-1").width(),d(s).find(".column-2").width()),0),f.field.inner_columns_size["column-1"]=e+"%",f.field.inner_columns_size["column-2"]=t+"%",f.field.inner_columns_size["column-3"]=i+"%",o=void 0})}},watch:{innerColumns:function(e){var t=parseInt(e),i=this.field.inner_columns_size;Object.keys(i).forEach(function(e){1===t&&(i[e]="100%"),2===t&&(i[e]="50%"),3===t&&(i[e]="33.33%")}),1===t&&this.moveFieldsTo("column-1"),2===t&&this.moveFieldsTo("column-2"),this.resizeColumns(t)}}}),Vue.component("form-custom_hidden_field",{template:"#tmpl-wpuf-form-custom_hidden_field",mixins:[wpuf_mixins.form_field_mixin]}),Vue.component("form-custom_html",{template:"#tmpl-wpuf-form-custom_html",mixins:[wpuf_mixins.form_field_mixin],data:function(){return{raw_html:"<p>from data</p>"}}}),Vue.component("form-dropdown_field",{template:"#tmpl-wpuf-form-dropdown_field",mixins:[wpuf_mixins.form_field_mixin]}),Vue.component("form-email_address",{template:"#tmpl-wpuf-form-email_address",mixins:[wpuf_mixins.form_field_mixin]}),Vue.component("form-featured_image",{template:"#tmpl-wpuf-form-featured_image",mixins:[wpuf_mixins.form_field_mixin]}),Vue.component("form-fields",{template:"#tmpl-wpuf-form-fields",mixins:wpuf_form_builder_mixins(wpuf_mixins.form_fields),computed:{panel_sections:function(){return this.$store.state.panel_sections},field_settings:function(){return this.$store.state.field_settings},form_fields:function(){return this.$store.state.form_fields}},created:function(){wpuf_form_builder.event_hub.$on("humanpresence-enabled",this.add_humanpresence_field)},mounted:function(){d(this.$el).find(".panel-form-field-buttons .button").not('[data-form-field="humanpresence"]').draggable({connectToSortable:"#form-preview-stage .wpuf-form, .wpuf-column-inner-fields .wpuf-column-fields-sortable-list",helper:"clone",revert:"invalid",cancel:".button-faded"}).disableSelection()},methods:{panel_toggle:function(e){this.$store.commit("panel_toggle",e)},add_form_field:function(e){var t={toIndex:this.$store.state.form_fields.length};if(this.isSingleInstance(e)&&this.containsField(e))swal({title:"Oops...",text:"You already have this field in the form"});else{var i=d.extend(!0,{},this.$store.state.field_settings[e].field_props);if(i.id=this.get_random_id(),!i.name&&i.label){i.name=i.label.replace(/\W/g,"_").toLowerCase();var n=this.form_fields.filter(function(e){return e.template===i.template});n.length&&(i.name+="_"+n.length)}if("humanpresence"===e){var o=this.$store.state.settings;o.humanpresence_enabled=!0,this.$store.commit("set_form_settings",o)}t.field=i,this.$store.commit("add_form_field_element",t)}},add_humanpresence_field:function(e){this.containsField("humanpresence")||this.add_form_field("humanpresence")},is_pro_feature:function(e){return this.field_settings[e].pro_feature},alert_pro_feature:function(e){var t=this.field_settings[e].title;swal({title:'<i class="fa fa-lock"></i> '+t+" <br>"+this.i18n.is_a_pro_feature,text:this.i18n.pro_feature_msg,type:"",showCancelButton:!0,cancelButtonText:this.i18n.close,confirmButtonColor:"#46b450",confirmButtonText:this.i18n.upgrade_to_pro}).then(function(e){e&&window.open(wpuf_form_builder.pro_link,"_blank")},function(){})},alert_invalidate_msg:function(e){var t=this.field_settings[e].validator;t&&t.msg&&this.warn({title:t.msg_title||"",html:t.msg,type:"warning",showCancelButton:!1,confirmButtonColor:"#46b450",confirmButtonText:this.i18n.ok})},get_invalidate_btn_class:function(e){return this.field_settings[e].validator.button_class}}}),Vue.component("form-image_upload",{template:"#tmpl-wpuf-form-image_upload",mixins:[wpuf_mixins.form_field_mixin]}),Vue.component("form-multiple_select",{template:"#tmpl-wpuf-form-multiple_select",mixins:[wpuf_mixins.form_field_mixin]}),Vue.component("form-post_content",{template:"#tmpl-wpuf-form-post_content",mixins:[wpuf_mixins.form_field_mixin]}),Vue.component("form-post_excerpt",{template:"#tmpl-wpuf-form-post_excerpt",mixins:[wpuf_mixins.form_field_mixin]}),Vue.component("form-post_tags",{template:"#tmpl-wpuf-form-post_tags",mixins:[wpuf_mixins.form_field_mixin]}),Vue.component("form-post_title",{template:"#tmpl-wpuf-form-post_title",mixins:[wpuf_mixins.form_field_mixin]}),Vue.component("form-radio_field",{template:"#tmpl-wpuf-form-radio_field",mixins:[wpuf_mixins.form_field_mixin]}),Vue.component("form-recaptcha",{template:"#tmpl-wpuf-form-recaptcha",mixins:[wpuf_mixins.form_field_mixin],computed:{has_recaptcha_api_keys:function(){return!(!wpuf_form_builder.recaptcha_site||!wpuf_form_builder.recaptcha_secret)},no_api_keys_msg:function(){return wpuf_form_builder.field_settings.recaptcha.validator.msg}}}),Vue.component("form-humanpresence",{template:"#tmpl-wpuf-form-humanpresence",mixins:[wpuf_mixins.form_field_mixin],computed:{has_humanpresence_installed:function(){return wpuf_form_builder.humanpresence_installed},no_humanpresence_installed_msg:function(){return wpuf_form_builder.field_settings.humanpresence.validator.msg}}}),Vue.component("form-section_break",{template:"#tmpl-wpuf-form-section_break",mixins:[wpuf_mixins.form_field_mixin]}),Vue.component("form-taxonomy",{template:"#tmpl-wpuf-form-taxonomy",mixins:[wpuf_mixins.form_field_mixin],computed:{terms:function(){var e;for(e in wpuf_form_builder.wp_post_types){var t=wpuf_form_builder.wp_post_types[e];if(t.hasOwnProperty(this.field.name)){var i=t[this.field.name];if(i.terms)return i.terms}}return[]},sorted_terms:function(){var t=this,i=d.extend(!0,[],this.terms);if(this.field.exclude_type&&this.field.exclude){if(1<this.field.exclude.length)var n=this.field.exclude.split(",").map(function(e){return e=e.trim(),e=parseInt(e)}).filter(function(e){return isFinite(e)});i=i.filter(function(e){switch(t.field.exclude_type){case"exclude":return _.indexOf(n,e.term_id)<0;case"include":return 0<=_.indexOf(n,e.term_id);case"child_of":return 0<=_.indexOf(n,parseInt(e.parent))}})}i=_.sortBy(i,function(e){return e[t.field.orderby]}),"DESC"===this.field.order&&(i=i.reverse());var e=i.filter(function(e){return!e.parent});return e.map(function(e){e.children=t.get_child_terms(e.term_id,i)}),e.length?e:i}},methods:{get_child_terms:function(t,i){var n=this,e=i.filter(function(e){return parseInt(e.parent)===parseInt(t)});return e.map(function(e){e.children=n.get_child_terms(e.term_id,i)}),e},get_term_dropdown_options:function(){var t=this,i="";return"select"===this.field.type&&(i='<option value="">'+this.field.first+"</option>"),_.each(t.sorted_terms,function(e){i+=t.get_term_dropdown_options_children(e,0)}),i},get_term_dropdown_options_children:function(e,t){var i=this,n="",o="",s=0;for(s=0;s<t;s++)o+="&nbsp;&nbsp;";return n+='<option value="'+e.id+'">'+o+e.name+"</option>",e.children.length&&_.each(e.children,function(e){n+=i.get_term_dropdown_options_children(e,t+1)}),n},get_term_checklist:function(){var t=this,i="";return i+='<ul class="wpuf-category-checklist">',_.each(this.sorted_terms,function(e){i+=t.get_term_checklist_li(e)}),i+="</ul>"},get_term_checklist_li:function(e){var t=this,i="";return i+='<li><label class="selectit"><input type="checkbox"> '+e.name+"</label></li>",e.children.length&&(i+='<ul class="children">',_.each(e.children,function(e){i+=t.get_term_checklist_li(e)}),i+="</ul>"),i},get_term_checklist_inline:function(){var t=this,i="";return _.each(this.sorted_terms,function(e){i+=t.get_term_checklist_li_inline(e)}),i},get_term_checklist_li_inline:function(e){var t=this,i="";return i+='<label class="wpuf-checkbox-inline"><input type="checkbox"> '+e.name+"</label>",e.children.length&&_.each(e.children,function(e){i+=t.get_term_checklist_li_inline(e)}),i}}}),Vue.component("form-text_field",{template:"#tmpl-wpuf-form-text_field",mixins:[wpuf_mixins.form_field_mixin]}),Vue.component("form-textarea_field",{template:"#tmpl-wpuf-form-textarea_field",mixins:[wpuf_mixins.form_field_mixin]}),Vue.component("form-website_url",{template:"#tmpl-wpuf-form-website_url",mixins:[wpuf_mixins.form_field_mixin]}),Vue.component("help-text",{template:"#tmpl-wpuf-help-text",props:{text:{type:String,default:""}},mounted:function(){d(".wpuf-tooltip").tooltip()}}),Vue.component("text-editor",{template:"#tmpl-wpuf-text-editor",props:["rich","default_text"],computed:{site_url:function(){return wpuf_form_builder.site_url},is_full:function(){return"yes"===this.rich}}})}(jQuery);
  • weforms/trunk/assets/wpuf/js/wpuf-form-builder-mixins.js

    r2403226 r2514969  
    102102        },
    103103
     104        has_humanpresence_installed: function () {
     105            return wpuf_form_builder.humanpresence_installed;
     106        },
     107
     108        no_humanpresence_installed_msg: function no_humanpresence_installed_msg() {
     109            return wpuf_form_builder.field_settings.humanpresence.validator.msg;
     110        },
     111
     112        change_humanpresence: function change_humanpresence(e) {
     113            wpuf_form_builder.event_hub.$emit('humanpresence-changed', e, this);
     114        },
     115
    104116        containsField: function(field_name) {
    105117            var self = this,
     
    138150            var singleInstance = ['post_title', 'post_content', 'post_excerpt', 'featured_image',
    139151                'user_login', 'first_name', 'last_name', 'nickname', 'user_email', 'user_url',
    140                 'user_bio', 'password', 'user_avatar', 'taxonomy'];
     152                'user_bio', 'password', 'user_avatar', 'taxonomy', 'humanpresence'];
    141153
    142154            if ( $.inArray(field_name, singleInstance) >= 0 ) {
  • weforms/trunk/includes/admin/class-admin.php

    r2477338 r2514969  
    2222        add_action( 'weforms_settings_tab_content_recaptcha', [ $this, 'settings_tab_recaptcha' ] );
    2323        add_action( 'weforms_settings_tab_content_secure-database', [ $this, 'settings_tab_secure_database' ] );
     24        add_action( 'weforms_settings_tab_content_humanpresence', [ $this, 'settings_tab_humanpresence' ] );
    2425        add_action( 'weforms_settings_tab_content_privacy', [ $this, 'settings_tab_privacy' ] );
    2526    }
     
    338339        ];
    339340
     341        $tabs['humanpresence'] = [
     342            'label' => __( 'Human Presence', 'weforms' ),
     343            'icon'  => WEFORMS_ASSET_URI . '/images/integrations/hp-shield.svg',
     344        ];
     345
    340346        /* TODO:  Refactor this block when more options are added in privacy settings*/
    341347        if ( class_exists( 'WeForms_Pro' ) ) {
     
    379385    public function settings_tab_secure_database( $tab ) {
    380386        include __DIR__ . '/views/weforms-settings-secure-database.php';
     387    }
     388    /**
     389     * Human Presence tab content
     390     *
     391     * @param array $tab
     392     *
     393     * @return void
     394     */
     395    public function settings_tab_humanpresence( $tab ) {
     396        include __DIR__ . '/views/weforms-settings-humanpresence.php';
    381397    }
    382398    /**
  • weforms/trunk/includes/admin/class-form-builder-assets.php

    r2477338 r2514969  
    1111
    1212    public function init_actions() {
     13        add_action( 'in_admin_header', [ $this, 'remove_admin_notices' ] );
    1314        add_action( 'admin_enqueue_scripts', [ $this, 'builder_enqueue_scripts' ], 2000 );
    1415        add_action( 'admin_print_scripts', [ $this, 'builder_mixins_script' ] );
     
    3233
    3334        $recaptcha = weforms_get_settings( 'recaptcha' );
     35        $humanpresence = get_option( 'wp-human-presence', array() );
    3436
    3537        $wpuf_form_builder = apply_filters( 'wpuf-form-builder-localize-script', [
     
    6567                ],
    6668            ],
    67             'integrations'     => weforms()->integrations->get_integration_js_settings(),
    68             'recaptcha_site'   => isset( $recaptcha->key ) ? $recaptcha->key : '',
    69             'recaptcha_secret' => isset( $recaptcha->secret ) ? $recaptcha->secret : '',
     69            'integrations'              => weforms()->integrations->get_integration_js_settings(),
     70            'recaptcha_site'            => isset( $recaptcha->key ) ? $recaptcha->key : '',
     71            'recaptcha_secret'          => isset( $recaptcha->secret ) ? $recaptcha->secret : '',
     72            'humanpresence_installed'   => (
     73                class_exists( 'HumanPresenceWEFormsIntegration' ) &&
     74                isset( $humanpresence['wp_hp_premium_license'] ) &&
     75                $humanpresence['wp_hp_premium_license'] )
     76                ? true : false,
    7077        ] );
    7178
     
    9097            'shortcodes'      => $this->shortcodes(),
    9198            'settings'        => [
    92                 'recaptcha' => weforms_get_settings( 'recaptcha' ),
     99                'recaptcha'     => weforms_get_settings( 'recaptcha' ),
    93100            ],
    94101        ] );
     
    340347            <a href="#" :class="['nav-tab', isActiveSettingsTab( 'restriction' ) ? 'nav-tab-active' : '']" v-on:click.prevent="makeActiveSettingsTab( 'restriction' )" class="nav-tab"><?php esc_html_e( 'Submission Restriction', 'weforms' ); ?></a>
    341348            <a href="#" :class="['nav-tab', isActiveSettingsTab( 'display' ) ? 'nav-tab-active' : '']" v-on:click.prevent="makeActiveSettingsTab( 'display' )" class="nav-tab"><?php esc_html_e( 'Display Settings', 'weforms' ); ?></a>
     349            <a href="#" :class="['nav-tab', isActiveSettingsTab( 'humanpresence' ) ? 'nav-tab-active' : '']" v-on:click.prevent="makeActiveSettingsTab( 'humanpresence' )" class="nav-tab"><i aria-hidden="true" class="fa fa-humanpresence"></i> <?php esc_html_e( 'HP Anti-Spam', 'weforms' ); ?></a>
    342350
    343351            <?php do_action( 'wpuf_contact_form_settings_tab' ); ?>
     
    365373            </div>
    366374
     375            <div id="wpuf-metabox-settings-humanpresence" class="tab-content" v-show="isActiveSettingsTab('humanpresence')">
     376                <?php include_once __DIR__ . '/views/humanpresence-settings.php'; ?>
     377            </div>
     378
    367379            <?php do_action( 'wpuf_contact_form_settings_tab_content' ); ?>
    368380
  • weforms/trunk/includes/class-field-manager.php

    r2403226 r2514969  
    5959        require_once __DIR__ . '/fields/class-field-image.php';
    6060        require_once __DIR__ . '/fields/class-field-recaptcha.php';
     61        require_once __DIR__ . '/fields/class-field-humanpresence.php';
    6162        require_once __DIR__ . '/fields/class-field-date.php';
    6263
     
    7879            'image_upload'        => new WeForms_Form_Field_Image(),
    7980            'recaptcha'           => new WeForms_Form_Field_reCaptcha(),
     81            'humanpresence'       => new WeForms_Form_Field_HumanPresence(),
    8082        ];
    8183
     
    119121                        'custom_html',
    120122                        'recaptcha',
     123                        'humanpresence'
    121124                    ]
    122125                  ),
  • weforms/trunk/includes/class-form-entry.php

    r2403226 r2514969  
    354354                        }
    355355                    } elseif ( $field['type'] == 'signature_field' ) {
    356                         $url   = content_url() . $value;
    357                         $value = $url;
     356                        $url   =  $value;
    358357
    359358                        if ( isset( $_REQUEST['action'] ) != 'weforms_pdf_download' ) {
     359                            $url   = content_url() . '/' . $value;
    360360                            $value = sprintf( '<img src="%s">', $url );
    361361                            $value .= sprintf( '<a style="margin-left: -200px" href="%s">Download</a>', $url );
     362                        }
     363                        else{
     364                            $value = sprintf( '<img src="%s">', $url );
    362365                        }
    363366                    }
  • weforms/trunk/includes/class-form-manager.php

    r2403226 r2514969  
    183183        update_post_meta( $data['form_id'], '_weforms_version', WEFORMS_VERSION );
    184184
     185        do_action( 'weforms_after_save_form', $data['form_id'], $data['form_fields'], $data['form_settings'] );
     186
    185187        return $saved_wpuf_inputs;
    186188    }
  • weforms/trunk/includes/class-form.php

    r2403226 r2514969  
    140140            }
    141141
    142             $form_fields[] = apply_filters( 'weforms-get-form-field', $field );
    143         }
    144 
    145         $this->form_fields = apply_filters( 'weforms-get-form-fields', $form_fields );
     142            $form_fields[] = apply_filters( 'weforms-get-form-field', $field, $this->id );
     143        }
     144
     145        $this->form_fields = apply_filters( 'weforms-get-form-fields', $form_fields, $this->id );
    146146
    147147        return $this->form_fields;
     
    272272        $default  = weforms_get_default_form_settings();
    273273
    274         return array_merge( $default, $settings );
     274        return apply_filters( 'weforms-get-form-settings', array_merge( $default, $settings ), $this->id );
    275275    }
    276276
  • weforms/trunk/includes/functions.php

    r2445228 r2514969  
    11161116            'enable_multistep'           => false,
    11171117            'multistep_progressbar_type' => 'progressive',
     1118            'humanpresence_enabled'      => false,
    11181119
    11191120            // payment
  • weforms/trunk/includes/importer/class-importer-abstract.php

    r2403226 r2514969  
    895895    public function get_default_form_settings() {
    896896        $form_settings = [
    897             'redirect_to'        => 'same',
    898             'message'            => __( 'Thanks for contacting us! We will get in touch with you shortly.', 'weforms' ),
    899             'page_id'            => '',
    900             'url'                => '',
    901             'submit_text'        => __( 'Submit Query', 'weforms' ),
    902             'schedule_form'      => 'false',
    903             'schedule_start'     => '',
    904             'schedule_end'       => '',
    905             'sc_pending_message' => __( 'Form submission hasn\'t been started yet', 'weforms' ),
    906             'sc_expired_message' => __( 'Form submission is now closed.', 'weforms' ),
    907             'require_login'      => 'false',
    908             'req_login_message'  => __( 'You need to login to submit a query.', 'weforms' ),
    909             'limit_entries'      => 'false',
    910             'limit_number'       => '1000',
    911             'limit_message'      => __( 'Sorry, we have reached the maximum number of submissions.', 'weforms' ),
    912             'label_position'     => 'above',
     897            'redirect_to'           => 'same',
     898            'message'               => __( 'Thanks for contacting us! We will get in touch with you shortly.', 'weforms' ),
     899            'page_id'               => '',
     900            'url'                   => '',
     901            'submit_text'           => __( 'Submit Query', 'weforms' ),
     902            'schedule_form'         => 'false',
     903            'schedule_start'        => '',
     904            'schedule_end'          => '',
     905            'humanpresence_enabled' => false,
     906            'sc_pending_message'    => __( 'Form submission hasn\'t been started yet', 'weforms' ),
     907            'sc_expired_message'    => __( 'Form submission is now closed.', 'weforms' ),
     908            'require_login'         => 'false',
     909            'req_login_message'     => __( 'You need to login to submit a query.', 'weforms' ),
     910            'limit_entries'         => 'false',
     911            'limit_number'          => '1000',
     912            'limit_message'         => __( 'Sorry, we have reached the maximum number of submissions.', 'weforms' ),
     913            'label_position'        => 'above',
    913914        ];
    914915
  • weforms/trunk/languages/weforms.pot

    r2477338 r2514969  
    55"Project-Id-Version: weForms 1.6.5\n"
    66"Report-Msgid-Bugs-To: https://wedevs.com/contact/\n"
    7 "POT-Creation-Date: 2021-02-18 21:24:28+00:00\n"
     7"POT-Creation-Date: 2021-04-14 15:13:35+00:00\n"
    88"MIME-Version: 1.0\n"
    99"Content-Type: text/plain; charset=utf-8\n"
     
    5959msgstr ""
    6060
    61 #: includes/admin/class-admin.php:36 includes/admin/class-admin.php:58
     61#: includes/admin/class-admin.php:37 includes/admin/class-admin.php:59
    6262msgid "Contact Forms"
    6363msgstr ""
    6464
    65 #: includes/admin/class-admin.php:56
     65#: includes/admin/class-admin.php:57
    6666msgid "Forms"
    6767msgstr ""
    6868
    69 #: includes/admin/class-admin.php:57 includes/class-form-widget.php:49
     69#: includes/admin/class-admin.php:58 includes/class-form-widget.php:49
    7070#: includes/functions.php:753
    7171msgid "Form"
    7272msgstr ""
    7373
    74 #: includes/admin/class-admin.php:59
     74#: includes/admin/class-admin.php:60
    7575msgid "Add Form"
    7676msgstr ""
    7777
    78 #: includes/admin/class-admin.php:60
     78#: includes/admin/class-admin.php:61
    7979msgid "Add New Form"
    8080msgstr ""
    8181
    82 #: includes/admin/class-admin.php:61
     82#: includes/admin/class-admin.php:62
    8383msgid "Edit"
    8484msgstr ""
    8585
    86 #: includes/admin/class-admin.php:62
     86#: includes/admin/class-admin.php:63
    8787msgid "Edit Form"
    8888msgstr ""
    8989
    90 #: includes/admin/class-admin.php:63
     90#: includes/admin/class-admin.php:64
    9191msgid "New Form"
    9292msgstr ""
    9393
    94 #: includes/admin/class-admin.php:64 includes/admin/class-admin.php:65
     94#: includes/admin/class-admin.php:65 includes/admin/class-admin.php:66
    9595msgid "View Form"
    9696msgstr ""
    9797
    98 #: includes/admin/class-admin.php:66
     98#: includes/admin/class-admin.php:67
    9999msgid "Search Form"
    100100msgstr ""
    101101
    102 #: includes/admin/class-admin.php:67
     102#: includes/admin/class-admin.php:68
    103103msgid "No Form Found"
    104104msgstr ""
    105105
    106 #: includes/admin/class-admin.php:68
     106#: includes/admin/class-admin.php:69
    107107msgid "No Form Found in Trash"
    108108msgstr ""
    109109
    110 #: includes/admin/class-admin.php:69
     110#: includes/admin/class-admin.php:70
    111111msgid "Parent Form"
    112112msgstr ""
    113113
    114 #: includes/admin/class-admin.php:84
     114#: includes/admin/class-admin.php:85
    115115msgid "weForms - The Best Contact Form"
    116116msgstr ""
    117117
    118 #: includes/admin/class-admin.php:87
     118#: includes/admin/class-admin.php:88
    119119msgid "All Forms"
    120120msgstr ""
    121121
    122 #: includes/admin/class-admin.php:88
     122#: includes/admin/class-admin.php:89
    123123msgid "Entries"
    124124msgstr ""
    125125
    126 #: includes/admin/class-admin.php:89
     126#: includes/admin/class-admin.php:90
    127127msgid "Tools"
    128128msgstr ""
    129129
    130 #: includes/admin/class-admin.php:93
     130#: includes/admin/class-admin.php:94
    131131msgid "Modules"
    132132msgstr ""
    133133
    134 #: includes/admin/class-admin.php:96
     134#: includes/admin/class-admin.php:97
    135135#: includes/admin/views/weforms-settings-general.php:14
    136136#: includes/admin/views/weforms-settings-general.php:15
     
    139139msgstr ""
    140140
    141 #: includes/admin/class-admin.php:101
     141#: includes/admin/class-admin.php:102
    142142msgid "<span style=\"color:#f18500\">Help</span>"
    143143msgstr ""
    144144
    145 #: includes/admin/class-admin.php:102 includes/admin/class-admin.php:343
     145#: includes/admin/class-admin.php:103 includes/admin/class-admin.php:349
    146146#: includes/admin/views/weforms-settings-privacy.php:1
    147147msgid "Privacy"
    148148msgstr ""
    149149
    150 #: includes/admin/class-admin.php:107 weforms.php:394
     150#: includes/admin/class-admin.php:108 weforms.php:394
    151151msgid "Settings"
    152152msgstr ""
    153153
    154 #: includes/admin/class-admin.php:186
     154#: includes/admin/class-admin.php:187
    155155#: includes/api/class-weforms-forms-controller.php:1368
    156156#: includes/functions.php:773
     
    158158msgstr ""
    159159
    160 #: includes/admin/class-admin.php:187
     160#: includes/admin/class-admin.php:188
    161161#: includes/api/class-weforms-forms-controller.php:1369
    162162#: includes/functions.php:764
     
    165165msgstr ""
    166166
    167 #: includes/admin/class-admin.php:308
     167#: includes/admin/class-admin.php:309
    168168msgid "If you like %1$s please leave us a %2$s rating."
    169169msgstr ""
     
    173173msgstr ""
    174174
    175 #: includes/admin/class-admin.php:326
     175#: includes/admin/class-admin.php:327
    176176#: includes/admin/views/weforms-settings-general.php:1
    177177msgid "General Settings"
    178178msgstr ""
    179179
    180 #: includes/admin/class-admin.php:331
     180#: includes/admin/class-admin.php:332
    181181#: includes/admin/views/weforms-settings-recaptcha.php:1
    182182#: includes/fields/class-field-recaptcha.php:9
     
    184184msgstr ""
    185185
    186 #: includes/admin/class-admin.php:336
     186#: includes/admin/class-admin.php:337
    187187#: includes/admin/views/weforms-settings-secure-database.php:1
    188188msgid "Secure Database"
    189189msgstr ""
    190190
    191 #: includes/admin/class-admin.php:409
     191#: includes/admin/class-admin.php:342
     192#: includes/admin/views/humanpresence-settings.php:3
     193#: includes/admin/views/weforms-settings-humanpresence.php:1
     194msgid "Human Presence"
     195msgstr ""
     196
     197#: includes/admin/class-admin.php:425
    192198msgid ""
    193199"You&#39;re using weForms Free. For more features, modules and more consider "
     
    195201msgstr ""
    196202
    197 #: includes/admin/class-admin.php:412
     203#: includes/admin/class-admin.php:428
    198204msgid "UPGRADE NOW!"
    199205msgstr ""
    200206
    201 #: includes/admin/class-form-builder-assets.php:45 includes/functions.php:1167
    202 #: includes/functions.php:1170
     207#: includes/admin/class-form-builder-assets.php:47 includes/functions.php:1168
     208#: includes/functions.php:1171
    203209msgid "New Form Submission"
    204210msgstr ""
    205211
    206 #: includes/admin/class-form-builder-assets.php:82
    207 #: includes/admin/class-form-builder-assets.php:291
     212#: includes/admin/class-form-builder-assets.php:89
     213#: includes/admin/class-form-builder-assets.php:298
    208214#: includes/class-scripts-styles.php:426
    209215msgid "Are you sure?"
    210216msgstr ""
    211217
    212 #: includes/admin/class-form-builder-assets.php:261
     218#: includes/admin/class-form-builder-assets.php:268
    213219msgid "Advanced Options"
    214220msgstr ""
    215221
    216 #: includes/admin/class-form-builder-assets.php:262
     222#: includes/admin/class-form-builder-assets.php:269
    217223msgid "Quiz Options"
    218224msgstr ""
    219225
    220 #: includes/admin/class-form-builder-assets.php:263
     226#: includes/admin/class-form-builder-assets.php:270
    221227msgid "Are you sure you want to delete this field?"
    222228msgstr ""
    223229
    224 #: includes/admin/class-form-builder-assets.php:264
     230#: includes/admin/class-form-builder-assets.php:271
    225231#: includes/class-scripts-styles.php:427
    226232msgid "Yes, delete it"
    227233msgstr ""
    228234
    229 #: includes/admin/class-form-builder-assets.php:265
     235#: includes/admin/class-form-builder-assets.php:272
    230236#: includes/class-scripts-styles.php:428
    231237msgid "No, cancel it"
    232238msgstr ""
    233239
    234 #: includes/admin/class-form-builder-assets.php:266
     240#: includes/admin/class-form-builder-assets.php:273
    235241msgid "OK"
    236242msgstr ""
    237243
    238 #: includes/admin/class-form-builder-assets.php:267
     244#: includes/admin/class-form-builder-assets.php:274
    239245#: includes/library/appsero/Insights.php:677
    240246msgid "Cancel"
    241247msgstr ""
    242248
    243 #: includes/admin/class-form-builder-assets.php:268
     249#: includes/admin/class-form-builder-assets.php:275
    244250#: includes/admin/class-shortcode-button.php:84
    245251msgid "Close"
    246252msgstr ""
    247253
    248 #: includes/admin/class-form-builder-assets.php:269
     254#: includes/admin/class-form-builder-assets.php:276
    249255msgid "Disable"
    250256msgstr ""
    251257
    252 #: includes/admin/class-form-builder-assets.php:270
     258#: includes/admin/class-form-builder-assets.php:277
    253259msgid "This field must contain at least one choice"
    254260msgstr ""
    255261
    256 #: includes/admin/class-form-builder-assets.php:271
     262#: includes/admin/class-form-builder-assets.php:278
    257263#: includes/fields/class-field-checkbox.php:90
    258264#: includes/fields/class-field-dropdown.php:93
     
    262268msgstr ""
    263269
    264 #: includes/admin/class-form-builder-assets.php:272
     270#: includes/admin/class-form-builder-assets.php:279
    265271msgid "Row"
    266272msgstr ""
    267273
    268 #: includes/admin/class-form-builder-assets.php:273
     274#: includes/admin/class-form-builder-assets.php:280
    269275msgid "Column"
    270276msgstr ""
    271277
    272 #: includes/admin/class-form-builder-assets.php:274
     278#: includes/admin/class-form-builder-assets.php:281
    273279msgid "This field must contain at least one column"
    274280msgstr ""
    275281
    276 #: includes/admin/class-form-builder-assets.php:275
     282#: includes/admin/class-form-builder-assets.php:282
    277283msgid "is available in Pro version"
    278284msgstr ""
    279285
    280 #: includes/admin/class-form-builder-assets.php:276
     286#: includes/admin/class-form-builder-assets.php:283
    281287msgid "Please upgrade to the Pro version to unlock all these awesome features"
    282288msgstr ""
    283289
    284 #: includes/admin/class-form-builder-assets.php:277
     290#: includes/admin/class-form-builder-assets.php:284
    285291msgid "Get the Pro version"
    286292msgstr ""
    287293
    288 #: includes/admin/class-form-builder-assets.php:278
     294#: includes/admin/class-form-builder-assets.php:285
    289295msgid "Select"
    290296msgstr ""
    291297
    292 #: includes/admin/class-form-builder-assets.php:279
     298#: includes/admin/class-form-builder-assets.php:286
    293299msgid "Saved form data"
    294300msgstr ""
    295301
    296 #: includes/admin/class-form-builder-assets.php:280
     302#: includes/admin/class-form-builder-assets.php:287
    297303msgid "You have unsaved changes."
    298304msgstr ""
    299305
    300 #: includes/admin/class-form-builder-assets.php:281
     306#: includes/admin/class-form-builder-assets.php:288
    301307msgid "Are you sure to leave this page?"
    302308msgstr ""
    303309
    304 #: includes/admin/class-form-builder-assets.php:282
     310#: includes/admin/class-form-builder-assets.php:289
    305311msgid "Click to copy shortcode"
    306312msgstr ""
    307313
    308 #: includes/admin/class-form-builder-assets.php:284
     314#: includes/admin/class-form-builder-assets.php:291
    309315msgid "Select an image"
    310316msgstr ""
    311317
    312 #: includes/admin/class-form-builder-assets.php:285
     318#: includes/admin/class-form-builder-assets.php:292
    313319msgid "Please select an image"
    314320msgstr ""
    315321
    316 #: includes/admin/class-form-builder-assets.php:286
     322#: includes/admin/class-form-builder-assets.php:293
    317323msgid "Upload an image"
    318324msgstr ""
    319325
    320 #: includes/admin/class-form-builder-assets.php:288
     326#: includes/admin/class-form-builder-assets.php:295
    321327msgid "Share Your Form"
    322328msgstr ""
    323329
    324 #: includes/admin/class-form-builder-assets.php:289
     330#: includes/admin/class-form-builder-assets.php:296
    325331msgid ""
    326332"Sharing your form enables <strong>anyone</strong> to view and submit the "
     
    328334msgstr ""
    329335
    330 #: includes/admin/class-form-builder-assets.php:290
     336#: includes/admin/class-form-builder-assets.php:297
    331337msgid "Anyone with this URL will be able to view and submit this form."
    332338msgstr ""
    333339
    334 #: includes/admin/class-form-builder-assets.php:292
     340#: includes/admin/class-form-builder-assets.php:299
    335341msgid "You must select a notification"
    336342msgstr ""
    337343
    338 #: includes/admin/class-form-builder-assets.php:293
     344#: includes/admin/class-form-builder-assets.php:300
    339345msgid "Anyone with existing URL won't be able to view and submit the form anymore."
    340346msgstr ""
    341347
    342 #: includes/admin/class-form-builder-assets.php:294
     348#: includes/admin/class-form-builder-assets.php:301
    343349msgid "Disable Sharing"
    344350msgstr ""
    345351
    346 #: includes/admin/class-form-builder-assets.php:316
     352#: includes/admin/class-form-builder-assets.php:323
    347353msgid "Notifications"
    348354msgstr ""
    349355
    350 #: includes/admin/class-form-builder-assets.php:317
     356#: includes/admin/class-form-builder-assets.php:324
    351357msgid "Integrations"
    352358msgstr ""
    353359
    354 #: includes/admin/class-form-builder-assets.php:339
     360#: includes/admin/class-form-builder-assets.php:346
    355361msgid "Form Settings"
    356362msgstr ""
    357363
    358 #: includes/admin/class-form-builder-assets.php:340
     364#: includes/admin/class-form-builder-assets.php:347
    359365msgid "Submission Restriction"
    360366msgstr ""
    361367
    362 #: includes/admin/class-form-builder-assets.php:341
     368#: includes/admin/class-form-builder-assets.php:348
    363369msgid "Display Settings"
    364370msgstr ""
    365371
    366 #: includes/admin/class-form-builder-assets.php:376
     372#: includes/admin/class-form-builder-assets.php:349
     373#: includes/fields/class-field-humanpresence.php:9
     374msgid "HP Anti-Spam"
     375msgstr ""
     376
     377#: includes/admin/class-form-builder-assets.php:388
    367378#: includes/admin/class-privacy.php:242 includes/functions.php:771
    368379msgid "User"
    369380msgstr ""
    370381
    371 #: includes/admin/class-form-builder-assets.php:378 includes/functions.php:775
     382#: includes/admin/class-form-builder-assets.php:390 includes/functions.php:775
    372383#: includes/integrations/mailpoet/component/template.php:38
    373384#: includes/templates/class-template-conference-proposal.php:33
     
    10971108msgstr ""
    10981109
     1110#: includes/admin/views/humanpresence-settings.php:8
     1111msgid "Enable HP Anti-Spam"
     1112msgstr ""
     1113
    10991114#: includes/admin/views/submission-restriction.php:4
    11001115msgid "Schedule form"
     
    12681283#: includes/admin/views/weforms-settings-recaptcha.php:34
    12691284msgid "Save Changes"
     1285msgstr ""
     1286
     1287#: includes/admin/views/weforms-settings-humanpresence.php:5
     1288msgid ""
     1289"Human Presence takes a revolutionary approach to BOT detection and website "
     1290"security that utilizes \"human-centered\" learning algorithms to protect "
     1291"against suspicious activity."
     1292msgstr ""
     1293
     1294#: includes/admin/views/weforms-settings-humanpresence.php:8
     1295msgid "Ready to protect your forms? "
     1296msgstr ""
     1297
     1298#: includes/admin/views/weforms-settings-humanpresence.php:8
     1299msgid "Click here to receive a special discount on Human Presence for weForms"
    12701300msgstr ""
    12711301
     
    16581688msgstr ""
    16591689
    1660 #: includes/class-field-manager.php:93
     1690#: includes/class-field-manager.php:95
    16611691msgid "Custom Fields"
    16621692msgstr ""
    16631693
    1664 #: includes/class-field-manager.php:113
     1694#: includes/class-field-manager.php:115
    16651695msgid "Others"
    16661696msgstr ""
     
    20712101msgstr ""
    20722102
     2103#: includes/fields/class-field-humanpresence.php:35
     2104msgid "Human Presence Anti-Spam Required"
     2105msgstr ""
     2106
     2107#: includes/fields/class-field-humanpresence.php:37
     2108msgid ""
     2109"To enable Human Presence Anti-Spam on weForms, <a href=\"%s\" "
     2110"target=\"_blank\">Install and activate the plugin</a> on your site. Once "
     2111"installed, toggle on the weForms form you want to protect."
     2112msgstr ""
     2113
    20732114#: includes/fields/class-field-image.php:9
    20742115msgid "Image Upload"
     
    24042445
    24052446#: includes/functions.php:1102
    2406 #: includes/importer/class-importer-abstract.php:905
     2447#: includes/importer/class-importer-abstract.php:906
    24072448msgid "Form submission hasn't been started yet"
    24082449msgstr ""
    24092450
    24102451#: includes/functions.php:1103
    2411 #: includes/importer/class-importer-abstract.php:906
     2452#: includes/importer/class-importer-abstract.php:907
    24122453msgid "Form submission is now closed."
    24132454msgstr ""
    24142455
    24152456#: includes/functions.php:1105
    2416 #: includes/importer/class-importer-abstract.php:908
     2457#: includes/importer/class-importer-abstract.php:909
    24172458msgid "You need to login to submit a query."
    24182459msgstr ""
    24192460
    24202461#: includes/functions.php:1108
    2421 #: includes/importer/class-importer-abstract.php:911
     2462#: includes/importer/class-importer-abstract.php:912
    24222463msgid "Sorry, we have reached the maximum number of submissions."
    24232464msgstr ""
    24242465
    2425 #: includes/functions.php:1122
     2466#: includes/functions.php:1123
    24262467msgid "PayPal"
    24272468msgstr ""
    24282469
    2429 #: includes/functions.php:1123
     2470#: includes/functions.php:1124
    24302471msgid "Credit Card"
    24312472msgstr ""
    24322473
    2433 #: includes/functions.php:1169
     2474#: includes/functions.php:1170
    24342475msgid "Admin Notification"
    24352476msgstr ""
  • weforms/trunk/readme.txt

    r2477338 r2514969  
    44Requires at least: 4.4
    55Requires PHP: 5.6.20
    6 Tested up to: 5.6
    7 Stable tag: 1.6.5
     6Tested up to: 5.7
     7Stable tag: 1.6.6
    88License: GPLv2 or later
    99License URI: https://www.gnu.org/licenses/gpl-2.0.html
     
    250250== Changelog ==
    251251
     252= Version 1.6.6 (13 April, 2021) =
     253* **Fix:** Front End report link fixes
     254* **Fix:** Signature Displays in Entries
     255* **Update:** jQuery updates for Columns
     256
     257
    252258= Version 1.6.5 (18 February, 2021) =
    253259* **Fix:** Updated admin notices to better conform to WordPress design standards, and configured them to only show on WeForms pages.
  • weforms/trunk/weforms.php

    r2477338 r2514969  
    66 * Author: weForms
    77 * Author URI: https://weformspro.com/
    8  * Version: 1.6.5
     8 * Version: 1.6.6
    99 * License: GPL2 or later
    1010 * License URI: https://www.gnu.org/licenses/gpl-2.0.html
     
    5656     * @var string
    5757     */
    58     public $version = '1.6.5';
     58    public $version = '1.6.6';
    5959
    6060    /**
Note: See TracChangeset for help on using the changeset viewer.