!function(){"use strict";function t(e){return t="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},t(e)}function e(e,n,r){return(n=function(e){var n=function(e){if("object"!=t(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=t(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==t(n)?n:n+""}(n))in e?Object.defineProperty(e,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[n]=r,e}function n(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}var r=window.wp.hooks,i=window.wp.data,o=window.wp.components,a=window.wp.i18n,l=window.ReactJSXRuntime;function c(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,r)}return n}function p(t){for(var n=1;n<arguments.length;n++){var r=null!=arguments[n]?arguments[n]:{};n%2?c(Object(r),!0).forEach(function(n){e(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):c(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}return t}(0,r.addFilter)("wp_travel_payment_gateway_fields_knit_pay","wp-travel",function(t){return[].concat(function(t){if(Array.isArray(t))return n(t)}(e=t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(e)||function(t,e){if(t){if("string"==typeof t)return n(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?n(t,e):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),[(0,l.jsx)(u,{})]);var e});var u=function(){var t=(0,i.dispatch)("WPTravel/Admin").updateSettings,n=(0,i.useSelect)(function(t){return t("WPTravel/Admin").getAllStore()},[]),r=n.payment_option_knit_pay,c=n.wp_travel_knit_pay_settings,u=function(r,i,o){t(p(p({},n),{},e({},r,p(p({},n[r]),{},e({},i,o)))))};return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)(o.PanelRow,{children:[(0,l.jsx)("label",{children:(0,a.__)("Enable Knit Pay","knit-pay-lang")}),(0,l.jsxs)("div",{className:"wp-travel-field-value",children:[(0,l.jsx)(o.ToggleControl,{checked:"yes"===r,onChange:function(){t(p(p({},n),{},{payment_option_knit_pay:"yes"===r?"no":"yes"}))}}),(0,l.jsx)("p",{className:"description",children:(0,a.__)("Check to enable Knit Pay","knit-pay-lang")})]})]}),(0,l.jsx)(o.TextControl,{label:(0,a.__)("Title","knit-pay-lang"),help:(0,a.__)('This controls the title which the user sees during checkout. Default: "Online Payment"',"knit-pay-lang"),value:c.title,onChange:function(t){return u("wp_travel_knit_pay_settings","title",t)},type:"text"}),(0,l.jsx)(o.TextControl,{label:(0,a.__)("Payment Description","knit-pay-lang"),value:c.payment_description,onChange:function(t){return u("wp_travel_knit_pay_settings","payment_description",t)},type:"text",help:window.knit_pay_wp_travel.payment_description_help}),(0,l.jsx)(o.SelectControl,{label:(0,a.__)("Configuration","knit-pay-lang"),onChange:function(t){return u("wp_travel_knit_pay_settings","config_id",t)},options:window.knit_pay_wp_travel.configs,value:c.config_id,help:'Configurations can be created in Knit Pay gateway configurations page at "Knit Pay >> Configurations"'})]})}}();