Current File : /home/kelaby89/onlycnc.com.au/wp-content/plugins/gutenverse-form/assets/js/dashboard.js |
(()=>{"use strict";function e(t){return e="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},e(t)}function t(t,r,n){return(r=function(t){var r=function(t){if("object"!=e(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!=e(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==e(r)?r:r+""}(r))in t?Object.defineProperty(t,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[r]=n,t}const r=window.wp.i18n,n=window.wp.hooks;function i(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}const o=window.wp.element,a=gutenverseCore.backend,s=window.ReactJSXRuntime;function u(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function l(e){for(var r=1;r<arguments.length;r++){var n=null!=arguments[r]?arguments[r]:{};r%2?u(Object(n),!0).forEach((function(r){t(e,r,n[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):u(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var c=function(e){var t=e.settingValues,n=e.updateSettingValues,i=e.saving,o=e.saveData,u=t.form_confirmation,l=void 0===u?{}:u,c=function(e,t){n("form_confirmation",e,t)};return(0,s.jsxs)("div",{className:"form-tab-body",children:[(0,s.jsx)("h2",{children:(0,r.__)("Confirmation Mail to User (Default Setting)","gutenverse-form")}),(0,s.jsx)("span",{children:(0,r.__)('This setting will be the default for "confirmation email to user" when you create a new form.',"gutenverse-form")}),(0,s.jsx)(a.ControlCheckbox,{id:"user_confirm",title:(0,r.__)("Confirmation Mail to User","gutenverse-form"),description:(0,r.__)("Send confirmation email to user. (To be able to send email, please make sure you've setup SMTP correctly).","gutenverse-form"),value:l.user_confirm,updateValue:c}),l.user_confirm&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(a.ControlCheckbox,{id:"auto_select_email",title:(0,r.__)("Auto Select Email","gutenverse-form"),description:(0,r.__)("This will automatically select emails inputted from email's fields.","gutenverse-form"),value:l.auto_select_email,updateValue:c}),!l.auto_select_email&&(0,s.jsx)(a.ControlText,{id:"email_input_name",title:(0,r.__)("Use Input's Name","gutenverse-form"),description:(0,r.__)("Only the selected input name will be sent email. (e.g : input-email).","gutenverse-form"),defaultValue:"input-email",value:l.email_input_name,updateValue:c}),(0,s.jsx)(a.ControlText,{id:"user_email_subject",title:(0,r.__)("Email's Subject","gutenverse-form"),description:(0,r.__)("This will be your email's subject or title.","gutenverse-form"),value:l.user_email_subject,updateValue:c}),(0,s.jsx)(a.ControlText,{id:"user_email_form",title:(0,r.__)("Email's Sender","gutenverse-form"),description:(0,r.__)("Enter the sender email by which you want to send email to user. (Please make sure you use the same email in your SMTP setup).","gutenverse-form"),value:l.user_email_form,updateValue:c}),(0,s.jsx)(a.ControlText,{id:"user_email_reply_to",title:(0,r.__)("Email's Reply Target","gutenverse-form"),description:(0,r.__)("Enter email where user can reply/ you want to get reply.","gutenverse-form"),value:l.user_email_reply_to,updateValue:c}),(0,s.jsx)(a.ControlTextarea,{id:"user_email_body",title:(0,r.__)("Messages to User","gutenverse-form"),description:(0,r.__)("Enter your messages to include it in email's body which will be send to user.","gutenverse-form"),value:l.user_email_body,updateValue:c})]}),(0,s.jsx)("div",{className:"actions",children:i?(0,s.jsx)("div",{className:"gutenverse-button",children:(0,r.__)("Saving...","gutenverse-form")}):(0,s.jsx)("div",{className:"gutenverse-button",onClick:function(){return o(["form_confirmation","form_notification","form_paypal_payment","form_stripe_payment","form_captcha_settings"])},children:(0,r.__)("Save Changes","gutenverse-form")})})]})},m=function(e){var t=e.settingValues,n=e.updateSettingValues,i=e.saving,o=e.saveData,u=t.form_notification,l=void 0===u?{}:u,c=function(e,t){n("form_notification",e,t)};return(0,s.jsxs)("div",{className:"form-tab-body",children:[(0,s.jsx)("h2",{children:(0,r.__)("Notification Mail to Admin (Default Setting)","gutenverse-form")}),(0,s.jsx)("span",{children:(0,r.__)('This setting will be the default for "admin notification" when you create a new form.',"gutenverse-form")}),(0,s.jsx)(a.ControlCheckbox,{id:"admin_confirm",title:(0,r.__)("Notification Mail to Admin","gutenverse-form"),description:(0,r.__)("Send notification email to you or your admin. (To be able to send email, please make sure you've setup SMTP correctly).","gutenverse-form"),value:l.admin_confirm,updateValue:c}),l.admin_confirm&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(a.ControlText,{id:"admin_email_subject",title:(0,r.__)("Email Subject","gutenverse-form"),description:(0,r.__)("This will be your email's subject or title.","gutenverse-form"),value:l.admin_email_subject,updateValue:c}),(0,s.jsx)(a.ControlText,{id:"admin_email_to",title:(0,r.__)("Email's Recipient","gutenverse-form"),description:(0,r.__)('Enter admin email where you want to send mail (For multiple email addresses please use "," as separator).',"gutenverse-form"),value:l.admin_email_to,updateValue:c}),(0,s.jsx)(a.ControlText,{id:"admin_email_from",title:(0,r.__)("Email's Sender","gutenverse-form"),description:(0,r.__)("Enter the sender email by which you want to send email to admin. (Please make sure you use the same email in your SMTP setup).","gutenverse-form"),value:l.admin_email_from,updateValue:c}),(0,s.jsx)(a.ControlText,{id:"admin_email_reply_to",title:(0,r.__)("Email's Reply Target","gutenverse-form"),description:(0,r.__)("Enter email where admin can reply/ you want to get reply.","gutenverse-form"),value:l.admin_email_reply_to,updateValue:c}),(0,s.jsx)(a.ControlTextarea,{id:"admin_note",title:(0,r.__)("Messages to Admin","gutenverse-form"),description:(0,r.__)("Enter your messages to include it in email's body which will be send to admin.","gutenverse-form"),value:l.admin_note,updateValue:c})]}),(0,s.jsx)("div",{className:"actions",children:i?(0,s.jsx)("div",{className:"gutenverse-button",children:(0,r.__)("Saving...","gutenverse-form")}):(0,s.jsx)("div",{className:"gutenverse-button",onClick:function(){return o(["form_confirmation","form_notification","form_paypal_payment","form_stripe_payment","form_captcha_settings"])},children:(0,r.__)("Save Changes","gutenverse-form")})})]})},d=function(e){var t=e.settingValues,n=e.updateSettingValues,i=e.saving,o=e.saveData,u=t.form_captcha_settings,l=void 0===u?{}:u;return(0,s.jsxs)("div",{className:"form-captcha",children:[(0,s.jsx)("h2",{children:(0,r.__)("Form Captcha Settings","gutenverse-form")}),(0,s.jsx)("span",{children:(0,r.__)("This setting will be used in form reCaptcha feature","gutenverse-form")}),(0,s.jsx)(a.ControlText,{id:"captcha_key",title:(0,r.__)("Captcha Secret Key","gutenverse-form"),description:(0,r.__)("Enter your captcha secret here.","gutenverse-form"),value:l.captcha_key,updateValue:function(e,t){n("form_captcha_settings",e,t)}}),(0,s.jsx)("div",{className:"actions",children:i?(0,s.jsx)("div",{className:"gutenverse-button",children:(0,r.__)("Saving...","gutenverse-form")}):(0,s.jsx)("div",{className:"gutenverse-button",onClick:function(){return o(["form_confirmation","form_notification","form_paypal_payment","form_stripe_payment","form_captcha_settings"])},children:(0,r.__)("Save Changes","gutenverse-form")})})]})};const f=function(e){var t,a,u=(t=(0,o.useState)("confirmation"),a=2,function(e){if(Array.isArray(e))return e}(t)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,i,o,a,s=[],u=!0,l=!1;try{if(o=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=o.call(r)).done)&&(s.push(n.value),s.length!==t);u=!0);}catch(e){l=!0,i=e}finally{try{if(!u&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(l)throw i}}return s}}(t,a)||function(e,t){if(e){if("string"==typeof e)return i(e,t);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?i(e,t):void 0}}(t,a)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),f=u[0],_=u[1],v="";switch(f){case"confirmation":v=(0,s.jsx)(c,l({},e));break;case"notification":v=(0,s.jsx)(m,l({},e));break;default:v=null}return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(d,l({},e)),(0,s.jsxs)("div",{className:"form-setting",children:[(0,s.jsx)("div",{className:"".concat("confirmation"===f?"active":""),onClick:function(){return _("confirmation")},children:(0,r.__)("User Confirmation","gutenverse-form")}),(0,s.jsx)("div",{className:"".concat("notification"===f?"active":""),onClick:function(){return _("notification")},children:(0,r.__)("Admin Notification","gutenverse-form")})]}),(0,s.jsx)("div",{children:v}),(0,n.applyFilters)("gutenverse.dashboard.form.body",[],e)]})};function _(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function v(e){for(var r=1;r<arguments.length;r++){var n=null!=arguments[r]?arguments[r]:{};r%2?_(Object(n),!0).forEach((function(r){t(e,r,n[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):_(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var p=function(){var e=window.GutenverseDashboard.gutenverseFormAssetURL;return(0,s.jsxs)("div",{className:"custom-notice-header",children:[(0,s.jsx)("img",{src:"".concat(e,"/img/update-notice-form-v1.0.0-header.png")}),(0,s.jsxs)("h3",{className:"upgrade-notice-title",children:[(0,r.__)("Gutenverse Form","gutenverse-form")," ",(0,s.jsx)("span",{children:(0,r.__)("Version 1.0.0","gutenverse-form")})]})]})},g=function(){return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("h2",{className:"update-title",children:(0,r.__)("What's New","gutenverse")}),(0,s.jsx)("p",{className:"update-desc",children:(0,r.__)("Gutenverse Form now is a separate plugin from Gutenverse.","gutenverse")}),(0,s.jsxs)("ol",{children:[(0,s.jsx)("li",{children:(0,r.__)("Robust Framework","gutenverse")}),(0,s.jsx)("p",{children:(0,r.__)("Gutenverse Form uses Gutenverse Core framework which is more robust and make Gutenverse Form can stand alone and access all Gutenverse features, such as Library Templates without Gutenverse plugin.","gutenverse")}),(0,s.jsx)("li",{children:(0,r.__)("Compatibility with Gutenverse PRO","gutenverse")}),(0,s.jsx)("p",{children:(0,r.__)("Add compatibility for Gutenverse PRO, which gives you much more advanced options for designing an amazing form.","gutenverse")}),(0,s.jsx)("li",{children:(0,r.__)("Future Possibility","gutenverse")}),(0,s.jsx)("p",{children:(0,r.__)("More possibility in the future to add more features for form only without burdening the website.","gutenverse")})]})]})};(0,n.addFilter)("gutenverse.dashboard.notice.header","gutenverse/dashboard/notice/header",(function(e,t,r){return"gutenverse-form"===t&&"1.0.0"===r&&(e=(0,s.jsx)(p,{})),e})),(0,n.addFilter)("gutenverse.dashboard.notice.content","gutenverse/dashboard/notice/content",(function(e,t,r){return"gutenverse-form"===t&&"1.0.0"===r&&(e=(0,s.jsx)(g,{})),e})),(0,n.addFilter)("gutenverse.dashboard.settings.navigation","gutenverse/dashboard/settings/navigation",(function(e){return v(v({},e),{},{form:{title:(0,r.__)("Form","gutenverse-form"),pro:!1}})})),(0,n.addFilter)("gutenverse.dashboard.settings.body","gutenverse/dashboard/settings/body",(function(e,t,r){return"form"===t&&(e=(0,s.jsx)(f,v({},r))),e}))})();