From c3aa326017cd7e0ea2a7efe353d02c4e159b15fa Mon Sep 17 00:00:00 2001 From: Gravity Forms Date: Mon, 22 Apr 2024 18:42:50 +0000 Subject: [PATCH] Updates to 1.1.0 --- assets/css/dist/admin.css | 25 + assets/css/dist/admin.min.css | 1 + assets/css/dist/assets.php | 1 + assets/css/dist/theme-foundation.css | 35 + assets/css/dist/theme-foundation.min.css | 0 assets/css/dist/theme-framework.css | 33 + assets/css/dist/theme-framework.min.css | 0 assets/css/dist/theme.css | 38 ++ assets/css/dist/theme.min.css | 0 assets/img/cloudflare.svg | 4 + assets/img/preview-dark.svg | 15 + assets/img/preview-light.svg | 15 + assets/js/dist/assets.php | 1 + assets/js/dist/scripts-admin.js | 2 + assets/js/dist/scripts-admin.min.js | 1 + assets/js/dist/scripts-theme.js | 2 + assets/js/dist/scripts-theme.min.js | 1 + assets/js/dist/vendor-admin.js | 2 + assets/js/dist/vendor-admin.min.js | 1 + assets/js/dist/vendor-theme.js | 2 + assets/js/dist/vendor-theme.min.js | 1 + change_log.txt | 7 + class-gf-turnstile.php | 811 +++++++++++++++++++++++ includes/class-gf-field-turnstile.php | 324 +++++++++ languages/gravityformsturnstile.pot | 134 ++++ turnstile.php | 76 +++ 26 files changed, 1532 insertions(+) create mode 100644 assets/css/dist/admin.css create mode 100644 assets/css/dist/admin.min.css create mode 100644 assets/css/dist/assets.php create mode 100644 assets/css/dist/theme-foundation.css create mode 100644 assets/css/dist/theme-foundation.min.css create mode 100644 assets/css/dist/theme-framework.css create mode 100644 assets/css/dist/theme-framework.min.css create mode 100644 assets/css/dist/theme.css create mode 100644 assets/css/dist/theme.min.css create mode 100644 assets/img/cloudflare.svg create mode 100644 assets/img/preview-dark.svg create mode 100644 assets/img/preview-light.svg create mode 100644 assets/js/dist/assets.php create mode 100644 assets/js/dist/scripts-admin.js create mode 100644 assets/js/dist/scripts-admin.min.js create mode 100644 assets/js/dist/scripts-theme.js create mode 100644 assets/js/dist/scripts-theme.min.js create mode 100644 assets/js/dist/vendor-admin.js create mode 100644 assets/js/dist/vendor-admin.min.js create mode 100644 assets/js/dist/vendor-theme.js create mode 100644 assets/js/dist/vendor-theme.min.js create mode 100644 change_log.txt create mode 100644 class-gf-turnstile.php create mode 100644 includes/class-gf-field-turnstile.php create mode 100644 languages/gravityformsturnstile.pot create mode 100644 turnstile.php diff --git a/assets/css/dist/admin.css b/assets/css/dist/admin.css new file mode 100644 index 0000000..c51e93d --- /dev/null +++ b/assets/css/dist/admin.css @@ -0,0 +1,25 @@ +/* +---------------------------------------------------------------- + +admin.css +Gravity Forms Administration Styles +For the Turnstile Add-On +https://www.gravityforms.com + +Gravity Forms is a Rocketgenius project +copyright 2008-2023 Rocketgenius Inc. +https://www.rocketgenius.com +this may not be re-distributed without the +express written permission of the author. + +NOTE: DO NOT EDIT THIS FILE! +THIS FILE IS REPLACED DURING AUTO UPGRADE +AND ANY CHANGES MADE HERE WILL BE OVERWRITTEN. + +---------------------------------------------------------------- +*/ + +.gform-compact-view .gfield--turnstile-message, .gform-compact-view .gfield--turnstile-preview { + display: none; + } +/*# sourceMappingURL=admin.css.map */ diff --git a/assets/css/dist/admin.min.css b/assets/css/dist/admin.min.css new file mode 100644 index 0000000..328bc09 --- /dev/null +++ b/assets/css/dist/admin.min.css @@ -0,0 +1 @@ +.gform-compact-view .gfield--turnstile-message,.gform-compact-view .gfield--turnstile-preview{display:none} \ No newline at end of file diff --git a/assets/css/dist/assets.php b/assets/css/dist/assets.php new file mode 100644 index 0000000..a930dad --- /dev/null +++ b/assets/css/dist/assets.php @@ -0,0 +1 @@ + array('admin.css' => array('version' => '7f13ab7c6cda88879e6c12d6fcfa496d', 'file' => 'admin.css'), 'theme-foundation.css' => array('version' => 'b00f7568f4a57bcfec5fedf2de154d8a', 'file' => 'theme-foundation.css'), 'theme-framework.css' => array('version' => 'f677f687672ce6c37be17cc28cae00b9', 'file' => 'theme-framework.css'), 'theme.css' => array('version' => '772606f5d781debc2a769d1963348aba', 'file' => 'theme.css'))); \ No newline at end of file diff --git a/assets/css/dist/theme-foundation.css b/assets/css/dist/theme-foundation.css new file mode 100644 index 0000000..b40942b --- /dev/null +++ b/assets/css/dist/theme-foundation.css @@ -0,0 +1,35 @@ +/* +---------------------------------------------------------------- + +theme-foundation.css +Gravity Forms Theme Foundation Styles & CSS API +For the Stripe Add-On +A Gravity Forms theme framework foundation responsible for layout, +out-of-the-box enhanced ui, and other basic required styles for +the Stripe Add-on. +https://www.gravityforms.com + +Theme dependencies: +- Gravity Forms Theme Reset: gravity-forms-theme-reset.css +- Gravity Forms Theme Foundation: gravity-forms-theme-foundation.css + +Gravity Forms is a Rocketgenius project +copyright 2008-2023 Rocketgenius Inc. +https://www.rocketgenius.com +this may not be re-distributed without the +express written permission of the author. + +NOTE: DO NOT EDIT THIS FILE! +THIS FILE IS REPLACED DURING AUTO UPGRADE +AND ANY CHANGES MADE HERE WILL BE OVERWRITTEN. + +---------------------------------------------------------------- +*/ + +/* +.gform-theme--foundation .gfield--type-turnstile { + +} +*/ + +/*# sourceMappingURL=theme-foundation.css.map */ diff --git a/assets/css/dist/theme-foundation.min.css b/assets/css/dist/theme-foundation.min.css new file mode 100644 index 0000000..e69de29 diff --git a/assets/css/dist/theme-framework.css b/assets/css/dist/theme-framework.css new file mode 100644 index 0000000..4197eda --- /dev/null +++ b/assets/css/dist/theme-framework.css @@ -0,0 +1,33 @@ +/* +---------------------------------------------------------------- + +theme-framework.css +Gravity Forms Theme Framework & CSS API +For the Stripe Add-On +https://www.gravityforms.com + +Theme dependencies: +- Gravity Forms Theme Reset: gravity-forms-theme-reset.css +- Gravity Forms Theme Foundation: gravity-forms-theme-foundation.css +- Gravity Forms Theme Foundation for the Stripe Add-On: theme-foundation.css + +Gravity Forms is a Rocketgenius project +copyright 2008-2023 Rocketgenius Inc. +https://www.rocketgenius.com +this may not be re-distributed without the +express written permission of the author. + +NOTE: DO NOT EDIT THIS FILE! +THIS FILE IS REPLACED DURING AUTO UPGRADE +AND ANY CHANGES MADE HERE WILL BE OVERWRITTEN. + +---------------------------------------------------------------- +*/ + +/* +.gform-theme--framework .gfield--type-turnstile { + +} +*/ + +/*# sourceMappingURL=theme-framework.css.map */ diff --git a/assets/css/dist/theme-framework.min.css b/assets/css/dist/theme-framework.min.css new file mode 100644 index 0000000..e69de29 diff --git a/assets/css/dist/theme.css b/assets/css/dist/theme.css new file mode 100644 index 0000000..097c913 --- /dev/null +++ b/assets/css/dist/theme.css @@ -0,0 +1,38 @@ +/* +---------------------------------------------------------------- + +theme.css +Gravity Forms Gravity Theme Styles +For the Stripe Add-On +A light theme for the frontend engineered to get reasonably +nice look and feel in all our standard theme targets. +https://www.gravityforms.com + +Theme dependencies: +- Gravity Forms Basic Theme: basic.css + +Gravity Forms is a Rocketgenius project +copyright 2008-2023 Rocketgenius Inc. +https://www.rocketgenius.com +this may not be re-distributed without the +express written permission of the author. + +NOTE: DO NOT EDIT THIS FILE! +THIS FILE IS REPLACED DURING AUTO UPGRADE +AND ANY CHANGES MADE HERE WILL BE OVERWRITTEN. + +---------------------------------------------------------------- +*/ + +/* +.gravity-theme, +.gform_legacy_markup_wrapper { +} + +html[dir="rtl"] .gravity-theme, +html[dir="rtl"] .gform_legacy_markup_wrapper { + +} +*/ + +/*# sourceMappingURL=theme.css.map */ diff --git a/assets/css/dist/theme.min.css b/assets/css/dist/theme.min.css new file mode 100644 index 0000000..e69de29 diff --git a/assets/img/cloudflare.svg b/assets/img/cloudflare.svg new file mode 100644 index 0000000..695b4cc --- /dev/null +++ b/assets/img/cloudflare.svg @@ -0,0 +1,4 @@ + + + + diff --git a/assets/img/preview-dark.svg b/assets/img/preview-dark.svg new file mode 100644 index 0000000..4761767 --- /dev/null +++ b/assets/img/preview-dark.svg @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + diff --git a/assets/img/preview-light.svg b/assets/img/preview-light.svg new file mode 100644 index 0000000..7caa7a5 --- /dev/null +++ b/assets/img/preview-light.svg @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + diff --git a/assets/js/dist/assets.php b/assets/js/dist/assets.php new file mode 100644 index 0000000..23d08b2 --- /dev/null +++ b/assets/js/dist/assets.php @@ -0,0 +1 @@ + array('scripts-admin.js' => array('version' => '929a63252012f58b36a9936a29424f2c', 'file' => 'scripts-admin.js'), 'scripts-admin.min.js' => array('version' => '962cc0fe0fd5e66e96abc549a17e5591', 'file' => 'scripts-admin.min.js'), 'scripts-theme.js' => array('version' => '1d94bcbec13e553c7962f5779f3b0609', 'file' => 'scripts-theme.js'), 'scripts-theme.min.js' => array('version' => 'b1d3dcbc3fdd1a32447b4c4c11b79ebd', 'file' => 'scripts-theme.min.js'), 'vendor-admin.js' => array('version' => '14df23cc93325f8b9387510d6bd0ea09', 'file' => 'vendor-admin.js'), 'vendor-admin.min.js' => array('version' => '658d07a2f09cecbd827befcc922a673d', 'file' => 'vendor-admin.min.js'), 'vendor-theme.js' => array('version' => 'b14d50aa9f0d6f5fd66ce1e37eb01002', 'file' => 'vendor-theme.js'), 'vendor-theme.min.js' => array('version' => '89f58fdda96bf36c0f7a05b20d92e7bc', 'file' => 'vendor-theme.min.js'))); \ No newline at end of file diff --git a/assets/js/dist/scripts-admin.js b/assets/js/dist/scripts-admin.js new file mode 100644 index 0000000..cfd7b47 --- /dev/null +++ b/assets/js/dist/scripts-admin.js @@ -0,0 +1,2 @@ +!function(){"use strict";var e,t={5154:function(e,t,n){var r,i,o,l,d,a,u,f=gform.utils,s=window.turnstile||{},c=(null===(r=window)||void 0===r?void 0:r.gform_turnstile_config)||{},v=function(){var e;(0,f.trigger)({event:"gform/turnstile/before_render_preview",el:document,data:(null==c?void 0:c.data)||{},native:!1}),s.render("#gform_turnstile_preview",{sitekey:(null==c||null===(e=c.data)||void 0===e?void 0:e.site_key)||""})},g=function(e){var t,n;if(e.target.src&&-1!==e.target.src.indexOf("challenges.cloudflare")){var r;(0,f.trigger)({event:"gform/turnstile/after_render_preview",el:document,data:(null==c?void 0:c.data)||{},native:!1}),(0,f.getNodes)('#gform_turnstile_preview iframe[style*="display: none"]',!0,document,!0).length&&(document.getElementById("gform_turnstile_preview").innerHTML='\n\t
\n\t \n\t
\n\t

'.concat((null==c||null===(r=c.i18n)||void 0===r?void 0:r.render_error)||"","

\n\t
\n\t
"));var i=e.target.src,o=new FormData;o.append("url",i),o.append("secret",(null==c||null===(t=c.data)||void 0===t?void 0:t.save_url_nonce)||""),fetch((null==c||null===(n=c.endpoints)||void 0===n?void 0:n.save_url)||"",{method:"POST",body:o})}},m=n(4381),_=(null===(i=window)||void 0===i||null===(o=i.gform)||void 0===o?void 0:o.addAction)||{},p=(null===(l=window)||void 0===l||null===(d=l.gform)||void 0===d?void 0:d.addFilter)||{},w=(null===(a=window)||void 0===a?void 0:a.gform_turnstile_config)||{},h=(null===(u=window)||void 0===u?void 0:u.GetFieldsByType)||{},y=function(e){var t=(0,m.Z)(e,1)[0],n=document.getElementById("field_turnstile_widget_theme");n&&(n.value=void 0===t.turnstileWidgetTheme?"":t.turnstileWidgetTheme)},b=function(e){var t=e.target.selectedOptions[0].value;window.SetFieldProperty("turnstileWidgetTheme",t),window.RefreshSelectedFieldPreview()},O=function(e,t){return"turnstile"!==t?e:h(["turnstile"]).length?(alert(w.i18n.unique_error),!1):e},T=function(){document.getElementById("gform_turnstile_preview")&&(document.addEventListener("load",g,!0),s.ready(v),(0,f.consoleInfo)("Gravity Forms Turnstile Admin: Initialized Javascript for widget preview.")),_("gform_post_load_field_settings",y),p("gform_form_editor_can_field_be_added",O),document.getElementById("field_turnstile_widget_theme")&&document.getElementById("field_turnstile_widget_theme").addEventListener("change",b),(0,f.consoleInfo)("Gravity Forms Turnstile Admin: Initialized all javascript that targeted document ready.")};(0,f.ready)(T)}},n={};function r(e){var i=n[e];if(void 0!==i)return i.exports;var o=n[e]={exports:{}};return t[e](o,o.exports,r),o.exports}r.m=t,e=[],r.O=function(t,n,i,o){if(!n){var l=1/0;for(f=0;f=o)&&Object.keys(r.O).every((function(e){return r.O[e](n[a])}))?n.splice(a--,1):(d=!1,o0&&e[f-1][2]>o;f--)e[f]=e[f-1];e[f]=[n,i,o]},r.d=function(e,t){for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},function(){var e={223:0};r.O.j=function(t){return 0===e[t]};var t=function(t,n){var i,o,l=n[0],d=n[1],a=n[2],u=0;if(l.some((function(t){return 0!==e[t]}))){for(i in d)r.o(d,i)&&(r.m[i]=d[i]);if(a)var f=a(r)}for(t&&t(n);u\n\t \n\t"));var i=e.target.src,o=new FormData;o.append("url",i),o.append("secret",(null==c||null===(t=c.data)||void 0===t?void 0:t.save_url_nonce)||""),fetch((null==c||null===(n=c.endpoints)||void 0===n?void 0:n.save_url)||"",{method:"POST",body:o})}},m=function(){document.getElementById("gform_turnstile_preview")&&(document.addEventListener("load",g,!0),s.ready(v),(0,f.consoleInfo)("Gravity Forms Turnstile Admin: Initialized Javascript for widget preview."))},_=n(4381),p=(null===(i=window)||void 0===i||null===(o=i.gform)||void 0===o?void 0:o.addAction)||{},w=(null===(l=window)||void 0===l||null===(d=l.gform)||void 0===d?void 0:d.addFilter)||{},h=(null===(u=window)||void 0===u?void 0:u.gform_turnstile_config)||{},y=(null===(a=window)||void 0===a?void 0:a.GetFieldsByType)||{},b=function(e){var t=(0,_.Z)(e,1)[0],n=document.getElementById("field_turnstile_widget_theme");n&&(n.value=void 0===t.turnstileWidgetTheme?"":t.turnstileWidgetTheme)},O=function(e){var t=e.target.selectedOptions[0].value;window.SetFieldProperty("turnstileWidgetTheme",t),window.RefreshSelectedFieldPreview()},T=function(e,t){return"turnstile"!==t?e:y(["turnstile"]).length?(alert(h.i18n.unique_error),!1):e},I=function(){p("gform_post_load_field_settings",b),w("gform_form_editor_can_field_be_added",T),document.getElementById("field_turnstile_widget_theme")&&document.getElementById("field_turnstile_widget_theme").addEventListener("change",O)},E=function(){m(),I(),(0,f.consoleInfo)("Gravity Forms Turnstile Admin: Initialized all javascript that targeted document ready.")};(function(){(0,f.ready)(E)})()}},n={};function r(e){var i=n[e];if(void 0!==i)return i.exports;var o=n[e]={exports:{}};return t[e](o,o.exports,r),o.exports}r.m=t,e=[],r.O=function(t,n,i,o){if(!n){var l=1/0;for(f=0;f=o)&&Object.keys(r.O).every((function(e){return r.O[e](n[u])}))?n.splice(u--,1):(d=!1,o0&&e[f-1][2]>o;f--)e[f]=e[f-1];e[f]=[n,i,o]},r.d=function(e,t){for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},function(){var e={223:0};r.O.j=function(t){return 0===e[t]};var t=function(t,n){var i,o,l=n[0],d=n[1],u=n[2],a=0;if(l.some((function(t){return 0!==e[t]}))){for(i in d)r.o(d,i)&&(r.m[i]=d[i]);if(u)var f=u(r)}for(t&&t(n);a=i)&&Object.keys(e.O).every((function(r){return e.O[r](n[a])}))?n.splice(a--,1):(c=!1,i0&&r[l-1][2]>i;l--)r[l]=r[l-1];r[l]=[n,o,i]},e.n=function(r){var t=r&&r.__esModule?function(){return r.default}:function(){return r};return e.d(t,{a:t}),t},e.d=function(r,t){for(var n in t)e.o(t,n)&&!e.o(r,n)&&Object.defineProperty(r,n,{enumerable:!0,get:t[n]})},e.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(r){if("object"==typeof window)return window}}(),e.o=function(r,t){return Object.prototype.hasOwnProperty.call(r,t)},function(){var r;e.g.importScripts&&(r=e.g.location+"");var t=e.g.document;if(!r&&t&&(t.currentScript&&(r=t.currentScript.src),!r)){var n=t.getElementsByTagName("script");n.length&&(r=n[n.length-1].src)}if(!r)throw new Error("Automatic publicPath is not supported in this browser");r=r.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),e.p=r}(),function(){var r={415:0};e.O.j=function(t){return 0===r[t]};var t=function(t,n){var o,i,u=n[0],c=n[1],a=n[2],f=0;if(u.some((function(t){return 0!==r[t]}))){for(o in c)e.o(c,o)&&(e.m[o]=c[o]);if(a)var l=a(e)}for(t&&t(n);f=i)&&Object.keys(e.O).every((function(r){return e.O[r](t[f])}))?t.splice(f--,1):(c=!1,i0&&r[l-1][2]>i;l--)r[l]=r[l-1];r[l]=[t,o,i]},e.n=function(r){var n=r&&r.__esModule?function(){return r.default}:function(){return r};return e.d(n,{a:n}),n},e.d=function(r,n){for(var t in n)e.o(n,t)&&!e.o(r,t)&&Object.defineProperty(r,t,{enumerable:!0,get:n[t]})},e.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(r){if("object"==typeof window)return window}}(),e.o=function(r,n){return Object.prototype.hasOwnProperty.call(r,n)},function(){var r;e.g.importScripts&&(r=e.g.location+"");var n=e.g.document;if(!r&&n&&(n.currentScript&&(r=n.currentScript.src),!r)){var t=n.getElementsByTagName("script");t.length&&(r=t[t.length-1].src)}if(!r)throw new Error("Automatic publicPath is not supported in this browser");r=r.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),e.p=r}(),function(){var r={415:0};e.O.j=function(n){return 0===r[n]};var n=function(n,t){var o,i,u=t[0],c=t[1],f=t[2],a=0;if(u.some((function(n){return 0!==r[n]}))){for(o in c)e.o(c,o)&&(e.m[o]=c[o]);if(f)var l=f(e)}for(n&&n(t);as;)if((c=a[s++])!=c)return!0}else for(;f>s;s++)if((t||s in a)&&a[s]===n)return t||s||0;return!t&&-1}};t.exports={includes:u(!0),indexOf:u(!1)}},6446:function(t,r,n){var e=n(8087),o=e({}.toString),i=e("".slice);t.exports=function(t){return i(o(t),8,-1)}},4574:function(t,r,n){var e=n(2256),o=n(4731),i=n(5245),u=n(3567);t.exports=function(t,r,n){for(var c=o(r),a=u.f,f=i.f,s=0;s0&&e[0]<4?1:+(e[0]+e[1])),!o&&u&&(!(e=u.match(/Edge\/(\d+)/))||e[1]>=74)&&(e=u.match(/Chrome\/(\d+)/))&&(o=+e[1]),t.exports=o},64:function(t){t.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},9458:function(t,r,n){var e=n(419),o=n(5245).f,i=n(4845),u=n(8173),c=n(4289),a=n(4574),f=n(5698);t.exports=function(t,r){var n,s,p,l,v,y=t.target,b=t.global,h=t.stat;if(n=b?e:h?e[y]||c(y,{}):(e[y]||{}).prototype)for(s in r){if(l=r[s],p=t.dontCallGetSet?(v=o(n,s))&&v.value:n[s],!f(b?s:y+(h?".":"#")+s,t.forced)&&void 0!==p){if(typeof l==typeof p)continue;a(l,p)}(t.sham||p&&p.sham)&&i(l,"sham",!0),u(n,s,l,t)}}},6862:function(t){t.exports=function(t){try{return!!t()}catch(t){return!0}}},4555:function(t,r,n){var e=n(6862);t.exports=!e((function(){var t=function(){}.bind();return"function"!=typeof t||t.hasOwnProperty("prototype")}))},2797:function(t,r,n){var e=n(4555),o=Function.prototype.call;t.exports=e?o.bind(o):function(){return o.apply(o,arguments)}},5502:function(t,r,n){var e=n(7891),o=n(2256),i=Function.prototype,u=e&&Object.getOwnPropertyDescriptor,c=o(i,"name"),a=c&&"something"===function(){}.name,f=c&&(!e||e&&u(i,"name").configurable);t.exports={EXISTS:c,PROPER:a,CONFIGURABLE:f}},7661:function(t,r,n){var e=n(8087),o=n(4627);t.exports=function(t,r,n){try{return e(o(Object.getOwnPropertyDescriptor(t,r)[n]))}catch(t){}}},8087:function(t,r,n){var e=n(4555),o=Function.prototype,i=o.call,u=e&&o.bind.bind(i,i);t.exports=e?u:function(t){return function(){return i.apply(t,arguments)}}},80:function(t,r,n){var e=n(419),o=n(7373);t.exports=function(t,r){return arguments.length<2?(n=e[t],o(n)?n:void 0):e[t]&&e[t][r];var n}},8648:function(t,r,n){var e=n(4627),o=n(7039);t.exports=function(t,r){var n=t[r];return o(n)?void 0:e(n)}},419:function(t,r,n){var e=function(t){return t&&t.Math==Math&&t};t.exports=e("object"==typeof globalThis&&globalThis)||e("object"==typeof window&&window)||e("object"==typeof self&&self)||e("object"==typeof n.g&&n.g)||function(){return this}()||Function("return this")()},2256:function(t,r,n){var e=n(8087),o=n(5151),i=e({}.hasOwnProperty);t.exports=Object.hasOwn||function(t,r){return i(o(t),r)}},6789:function(t){t.exports={}},2944:function(t,r,n){var e=n(80);t.exports=e("document","documentElement")},5793:function(t,r,n){var e=n(7891),o=n(6862),i=n(3751);t.exports=!e&&!o((function(){return 7!=Object.defineProperty(i("div"),"a",{get:function(){return 7}}).a}))},79:function(t,r,n){var e=n(8087),o=n(6862),i=n(6446),u=Object,c=e("".split);t.exports=o((function(){return!u("z").propertyIsEnumerable(0)}))?function(t){return"String"==i(t)?c(t,""):u(t)}:u},3303:function(t,r,n){var e=n(8087),o=n(7373),i=n(3230),u=e(Function.toString);o(i.inspectSource)||(i.inspectSource=function(t){return u(t)}),t.exports=i.inspectSource},1259:function(t,r,n){var e,o,i,u=n(4665),c=n(419),a=n(1218),f=n(4845),s=n(2256),p=n(3230),l=n(9355),v=n(6789),y="Object already initialized",b=c.TypeError,h=c.WeakMap;if(u||p.state){var g=p.state||(p.state=new h);g.get=g.get,g.has=g.has,g.set=g.set,e=function(t,r){if(g.has(t))throw b(y);return r.facade=t,g.set(t,r),r},o=function(t){return g.get(t)||{}},i=function(t){return g.has(t)}}else{var m=l("state");v[m]=!0,e=function(t,r){if(s(t,m))throw b(y);return r.facade=t,f(t,m,r),r},o=function(t){return s(t,m)?t[m]:{}},i=function(t){return s(t,m)}}t.exports={set:e,get:o,has:i,enforce:function(t){return i(t)?o(t):e(t,{})},getterFor:function(t){return function(r){var n;if(!a(r)||(n=o(r)).type!==t)throw b("Incompatible receiver, "+t+" required");return n}}}},7373:function(t,r,n){var e=n(7461),o=e.all;t.exports=e.IS_HTMLDDA?function(t){return"function"==typeof t||t===o}:function(t){return"function"==typeof t}},5698:function(t,r,n){var e=n(6862),o=n(7373),i=/#|\.prototype\./,u=function(t,r){var n=a[c(t)];return n==s||n!=f&&(o(r)?e(r):!!r)},c=u.normalize=function(t){return String(t).replace(i,".").toLowerCase()},a=u.data={},f=u.NATIVE="N",s=u.POLYFILL="P";t.exports=u},7039:function(t){t.exports=function(t){return null==t}},1218:function(t,r,n){var e=n(7373),o=n(7461),i=o.all;t.exports=o.IS_HTMLDDA?function(t){return"object"==typeof t?null!==t:e(t)||t===i}:function(t){return"object"==typeof t?null!==t:e(t)}},4943:function(t){t.exports=!1},8898:function(t,r,n){var e=n(80),o=n(7373),i=n(5853),u=n(2696),c=Object;t.exports=u?function(t){return"symbol"==typeof t}:function(t){var r=e("Symbol");return o(r)&&i(r.prototype,c(t))}},1389:function(t,r,n){"use strict";var e=n(1198).IteratorPrototype,o=n(2091),i=n(5392),u=n(6535),c=n(9047),a=function(){return this};t.exports=function(t,r,n,f){var s=r+" Iterator";return t.prototype=o(e,{next:i(+!f,n)}),u(t,s,!1,!0),c[s]=a,t}},5291:function(t,r,n){"use strict";var e=n(9458),o=n(2797),i=n(4943),u=n(5502),c=n(7373),a=n(1389),f=n(8313),s=n(4476),p=n(6535),l=n(4845),v=n(8173),y=n(2712),b=n(9047),h=n(1198),g=u.PROPER,m=u.CONFIGURABLE,d=h.IteratorPrototype,x=h.BUGGY_SAFARI_ITERATORS,O=y("iterator"),S="keys",w="values",j="entries",P=function(){return this};t.exports=function(t,r,n,u,y,h,A){a(n,r,u);var E,I,_,T=function(t){if(t===y&&M)return M;if(!x&&t in F)return F[t];switch(t){case S:case w:case j:return function(){return new n(this,t)}}return function(){return new n(this)}},k=r+" Iterator",C=!1,F=t.prototype,R=F[O]||F["@@iterator"]||y&&F[y],M=!x&&R||T(y),D="Array"==r&&F.entries||R;if(D&&(E=f(D.call(new t)))!==Object.prototype&&E.next&&(i||f(E)===d||(s?s(E,d):c(E[O])||v(E,O,P)),p(E,k,!0,!0),i&&(b[k]=P)),g&&y==w&&R&&R.name!==w&&(!i&&m?l(F,"name",w):(C=!0,M=function(){return o(R,this)})),y)if(I={values:T(w),keys:h?M:T(S),entries:T(j)},A)for(_ in I)(x||C||!(_ in F))&&v(F,_,I[_]);else e({target:r,proto:!0,forced:x||C},I);return i&&!A||F[O]===M||v(F,O,M,{name:y}),b[r]=M,I}},1198:function(t,r,n){"use strict";var e,o,i,u=n(6862),c=n(7373),a=n(1218),f=n(2091),s=n(8313),p=n(8173),l=n(2712),v=n(4943),y=l("iterator"),b=!1;[].keys&&("next"in(i=[].keys())?(o=s(s(i)))!==Object.prototype&&(e=o):b=!0),!a(e)||u((function(){var t={};return e[y].call(t)!==t}))?e={}:v&&(e=f(e)),c(e[y])||p(e,y,(function(){return this})),t.exports={IteratorPrototype:e,BUGGY_SAFARI_ITERATORS:b}},9047:function(t){t.exports={}},6702:function(t,r,n){var e=n(5319);t.exports=function(t){return e(t.length)}},1069:function(t,r,n){var e=n(8087),o=n(6862),i=n(7373),u=n(2256),c=n(7891),a=n(5502).CONFIGURABLE,f=n(3303),s=n(1259),p=s.enforce,l=s.get,v=String,y=Object.defineProperty,b=e("".slice),h=e("".replace),g=e([].join),m=c&&!o((function(){return 8!==y((function(){}),"length",{value:8}).length})),d=String(String).split("String"),x=t.exports=function(t,r,n){"Symbol("===b(v(r),0,7)&&(r="["+h(v(r),/^Symbol\(([^)]*)\)/,"$1")+"]"),n&&n.getter&&(r="get "+r),n&&n.setter&&(r="set "+r),(!u(t,"name")||a&&t.name!==r)&&(c?y(t,"name",{value:r,configurable:!0}):t.name=r),m&&n&&u(n,"arity")&&t.length!==n.arity&&y(t,"length",{value:n.arity});try{n&&u(n,"constructor")&&n.constructor?c&&y(t,"prototype",{writable:!1}):t.prototype&&(t.prototype=void 0)}catch(t){}var e=p(t);return u(e,"source")||(e.source=g(d,"string"==typeof r?r:"")),t};Function.prototype.toString=x((function(){return i(this)&&l(this).source||f(this)}),"toString")},6614:function(t){var r=Math.ceil,n=Math.floor;t.exports=Math.trunc||function(t){var e=+t;return(e>0?n:r)(e)}},2091:function(t,r,n){var e,o=n(9223),i=n(8915),u=n(64),c=n(6789),a=n(2944),f=n(3751),s=n(9355),p="prototype",l="script",v=s("IE_PROTO"),y=function(){},b=function(t){return"<"+l+">"+t+""},h=function(t){t.write(b("")),t.close();var r=t.parentWindow.Object;return t=null,r},g=function(){try{e=new ActiveXObject("htmlfile")}catch(t){}var t,r,n;g="undefined"!=typeof document?document.domain&&e?h(e):(r=f("iframe"),n="java"+l+":",r.style.display="none",a.appendChild(r),r.src=String(n),(t=r.contentWindow.document).open(),t.write(b("document.F=Object")),t.close(),t.F):h(e);for(var o=u.length;o--;)delete g[p][u[o]];return g()};c[v]=!0,t.exports=Object.create||function(t,r){var n;return null!==t?(y[p]=o(t),n=new y,y[p]=null,n[v]=t):n=g(),void 0===r?n:i.f(n,r)}},8915:function(t,r,n){var e=n(7891),o=n(3015),i=n(3567),u=n(9223),c=n(6867),a=n(7333);r.f=e&&!o?Object.defineProperties:function(t,r){u(t);for(var n,e=c(r),o=a(r),f=o.length,s=0;f>s;)i.f(t,n=o[s++],e[n]);return t}},3567:function(t,r,n){var e=n(7891),o=n(5793),i=n(3015),u=n(9223),c=n(8113),a=TypeError,f=Object.defineProperty,s=Object.getOwnPropertyDescriptor,p="enumerable",l="configurable",v="writable";r.f=e?i?function(t,r,n){if(u(t),r=c(r),u(n),"function"==typeof t&&"prototype"===r&&"value"in n&&v in n&&!n[v]){var e=s(t,r);e&&e[v]&&(t[r]=n.value,n={configurable:l in n?n[l]:e[l],enumerable:p in n?n[p]:e[p],writable:!1})}return f(t,r,n)}:f:function(t,r,n){if(u(t),r=c(r),u(n),o)try{return f(t,r,n)}catch(t){}if("get"in n||"set"in n)throw a("Accessors not supported");return"value"in n&&(t[r]=n.value),t}},5245:function(t,r,n){var e=n(7891),o=n(2797),i=n(2741),u=n(5392),c=n(6867),a=n(8113),f=n(2256),s=n(5793),p=Object.getOwnPropertyDescriptor;r.f=e?p:function(t,r){if(t=c(t),r=a(r),s)try{return p(t,r)}catch(t){}if(f(t,r))return u(!o(i.f,t,r),t[r])}},9871:function(t,r,n){var e=n(6252),o=n(64).concat("length","prototype");r.f=Object.getOwnPropertyNames||function(t){return e(t,o)}},7857:function(t,r){r.f=Object.getOwnPropertySymbols},8313:function(t,r,n){var e=n(2256),o=n(7373),i=n(5151),u=n(9355),c=n(747),a=u("IE_PROTO"),f=Object,s=f.prototype;t.exports=c?f.getPrototypeOf:function(t){var r=i(t);if(e(r,a))return r[a];var n=r.constructor;return o(n)&&r instanceof n?n.prototype:r instanceof f?s:null}},5853:function(t,r,n){var e=n(8087);t.exports=e({}.isPrototypeOf)},6252:function(t,r,n){var e=n(8087),o=n(2256),i=n(6867),u=n(6148).indexOf,c=n(6789),a=e([].push);t.exports=function(t,r){var n,e=i(t),f=0,s=[];for(n in e)!o(c,n)&&o(e,n)&&a(s,n);for(;r.length>f;)o(e,n=r[f++])&&(~u(s,n)||a(s,n));return s}},7333:function(t,r,n){var e=n(6252),o=n(64);t.exports=Object.keys||function(t){return e(t,o)}},2741:function(t,r){"use strict";var n={}.propertyIsEnumerable,e=Object.getOwnPropertyDescriptor,o=e&&!n.call({1:2},1);r.f=o?function(t){var r=e(this,t);return!!r&&r.enumerable}:n},4476:function(t,r,n){var e=n(7661),o=n(9223),i=n(4768);t.exports=Object.setPrototypeOf||("__proto__"in{}?function(){var t,r=!1,n={};try{(t=e(Object.prototype,"__proto__","set"))(n,[]),r=n instanceof Array}catch(t){}return function(n,e){return o(n),i(e),r?t(n,e):n.__proto__=e,n}}():void 0)},4946:function(t,r,n){var e=n(2797),o=n(7373),i=n(1218),u=TypeError;t.exports=function(t,r){var n,c;if("string"===r&&o(n=t.toString)&&!i(c=e(n,t)))return c;if(o(n=t.valueOf)&&!i(c=e(n,t)))return c;if("string"!==r&&o(n=t.toString)&&!i(c=e(n,t)))return c;throw u("Can't convert object to primitive value")}},4731:function(t,r,n){var e=n(80),o=n(8087),i=n(9871),u=n(7857),c=n(9223),a=o([].concat);t.exports=e("Reflect","ownKeys")||function(t){var r=i.f(c(t)),n=u.f;return n?a(r,n(t)):r}},8846:function(t,r,n){var e=n(7039),o=TypeError;t.exports=function(t){if(e(t))throw o("Can't call method on "+t);return t}},6535:function(t,r,n){var e=n(3567).f,o=n(2256),i=n(2712)("toStringTag");t.exports=function(t,r,n){t&&!n&&(t=t.prototype),t&&!o(t,i)&&e(t,i,{configurable:!0,value:r})}},9355:function(t,r,n){var e=n(2017),o=n(6303),i=e("keys");t.exports=function(t){return i[t]||(i[t]=o(t))}},3230:function(t,r,n){var e=n(419),o=n(4289),i="__core-js_shared__",u=e[i]||o(i,{});t.exports=u},2017:function(t,r,n){var e=n(4943),o=n(3230);(t.exports=function(t,r){return o[t]||(o[t]=void 0!==r?r:{})})("versions",[]).push({version:"3.30.1",mode:e?"pure":"global",copyright:"© 2014-2023 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.30.1/LICENSE",source:"https://github.com/zloirock/core-js"})},9245:function(t,r,n){var e=n(2437),o=n(6862);t.exports=!!Object.getOwnPropertySymbols&&!o((function(){var t=Symbol();return!String(t)||!(Object(t)instanceof Symbol)||!Symbol.sham&&e&&e<41}))},6912:function(t,r,n){var e=n(8150),o=Math.max,i=Math.min;t.exports=function(t,r){var n=e(t);return n<0?o(n+r,0):i(n,r)}},6867:function(t,r,n){var e=n(79),o=n(8846);t.exports=function(t){return e(o(t))}},8150:function(t,r,n){var e=n(6614);t.exports=function(t){var r=+t;return r!=r||0===r?0:e(r)}},5319:function(t,r,n){var e=n(8150),o=Math.min;t.exports=function(t){return t>0?o(e(t),9007199254740991):0}},5151:function(t,r,n){var e=n(8846),o=Object;t.exports=function(t){return o(e(t))}},3926:function(t,r,n){var e=n(2797),o=n(1218),i=n(8898),u=n(8648),c=n(4946),a=n(2712),f=TypeError,s=a("toPrimitive");t.exports=function(t,r){if(!o(t)||i(t))return t;var n,a=u(t,s);if(a){if(void 0===r&&(r="default"),n=e(a,t,r),!o(n)||i(n))return n;throw f("Can't convert object to primitive value")}return void 0===r&&(r="number"),c(t,r)}},8113:function(t,r,n){var e=n(3926),o=n(8898);t.exports=function(t){var r=e(t,"string");return o(r)?r:r+""}},6927:function(t){var r=String;t.exports=function(t){try{return r(t)}catch(t){return"Object"}}},6303:function(t,r,n){var e=n(8087),o=0,i=Math.random(),u=e(1..toString);t.exports=function(t){return"Symbol("+(void 0===t?"":t)+")_"+u(++o+i,36)}},2696:function(t,r,n){var e=n(9245);t.exports=e&&!Symbol.sham&&"symbol"==typeof Symbol.iterator},3015:function(t,r,n){var e=n(7891),o=n(6862);t.exports=e&&o((function(){return 42!=Object.defineProperty((function(){}),"prototype",{value:42,writable:!1}).prototype}))},4665:function(t,r,n){var e=n(419),o=n(7373),i=e.WeakMap;t.exports=o(i)&&/native code/.test(String(i))},2712:function(t,r,n){var e=n(419),o=n(2017),i=n(2256),u=n(6303),c=n(9245),a=n(2696),f=e.Symbol,s=o("wks"),p=a?f.for||f:f&&f.withoutSetter||u;t.exports=function(t){return i(s,t)||(s[t]=c&&i(f,t)?f[t]:p("Symbol."+t)),s[t]}},9553:function(t,r,n){"use strict";var e=n(6867),o=n(7713),i=n(9047),u=n(1259),c=n(3567).f,a=n(5291),f=n(1439),s=n(4943),p=n(7891),l="Array Iterator",v=u.set,y=u.getterFor(l);t.exports=a(Array,"Array",(function(t,r){v(this,{type:l,target:e(t),index:0,kind:r})}),(function(){var t=y(this),r=t.target,n=t.kind,e=t.index++;return!r||e>=r.length?(t.target=void 0,f(void 0,!0)):f("keys"==n?e:"values"==n?r[e]:[e,r[e]],!1)}),"values");var b=i.Arguments=i.Array;if(o("keys"),o("values"),o("entries"),!s&&p&&"values"!==b.name)try{c(b,"name",{value:"values"})}catch(t){}},4381:function(t,r,n){"use strict";function e(t,r){(null==r||r>t.length)&&(r=t.length);for(var n=0,e=new Array(r);ns;)if((c=a[s++])!=c)return!0}else for(;f>s;s++)if((t||s in a)&&a[s]===n)return t||s||0;return!t&&-1}};t.exports={includes:u(!0),indexOf:u(!1)}},6446:function(t,r,n){var e=n(8087),o=e({}.toString),i=e("".slice);t.exports=function(t){return i(o(t),8,-1)}},4574:function(t,r,n){var e=n(2256),o=n(4731),i=n(5245),u=n(3567);t.exports=function(t,r,n){for(var c=o(r),a=u.f,f=i.f,s=0;s0&&e[0]<4?1:+(e[0]+e[1])),!o&&u&&(!(e=u.match(/Edge\/(\d+)/))||e[1]>=74)&&(e=u.match(/Chrome\/(\d+)/))&&(o=+e[1]),t.exports=o},64:function(t){t.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},9458:function(t,r,n){var e=n(419),o=n(5245).f,i=n(4845),u=n(8173),c=n(4289),a=n(4574),f=n(5698);t.exports=function(t,r){var n,s,p,l,v,y=t.target,b=t.global,h=t.stat;if(n=b?e:h?e[y]||c(y,{}):(e[y]||{}).prototype)for(s in r){if(l=r[s],p=t.dontCallGetSet?(v=o(n,s))&&v.value:n[s],!f(b?s:y+(h?".":"#")+s,t.forced)&&void 0!==p){if(typeof l==typeof p)continue;a(l,p)}(t.sham||p&&p.sham)&&i(l,"sham",!0),u(n,s,l,t)}}},6862:function(t){t.exports=function(t){try{return!!t()}catch(t){return!0}}},4555:function(t,r,n){var e=n(6862);t.exports=!e((function(){var t=function(){}.bind();return"function"!=typeof t||t.hasOwnProperty("prototype")}))},2797:function(t,r,n){var e=n(4555),o=Function.prototype.call;t.exports=e?o.bind(o):function(){return o.apply(o,arguments)}},5502:function(t,r,n){var e=n(7891),o=n(2256),i=Function.prototype,u=e&&Object.getOwnPropertyDescriptor,c=o(i,"name"),a=c&&"something"===function(){}.name,f=c&&(!e||e&&u(i,"name").configurable);t.exports={EXISTS:c,PROPER:a,CONFIGURABLE:f}},7661:function(t,r,n){var e=n(8087),o=n(4627);t.exports=function(t,r,n){try{return e(o(Object.getOwnPropertyDescriptor(t,r)[n]))}catch(t){}}},8087:function(t,r,n){var e=n(4555),o=Function.prototype,i=o.call,u=e&&o.bind.bind(i,i);t.exports=e?u:function(t){return function(){return i.apply(t,arguments)}}},80:function(t,r,n){var e=n(419),o=n(7373);t.exports=function(t,r){return arguments.length<2?(n=e[t],o(n)?n:void 0):e[t]&&e[t][r];var n}},8648:function(t,r,n){var e=n(4627),o=n(7039);t.exports=function(t,r){var n=t[r];return o(n)?void 0:e(n)}},419:function(t,r,n){var e=function(t){return t&&t.Math==Math&&t};t.exports=e("object"==typeof globalThis&&globalThis)||e("object"==typeof window&&window)||e("object"==typeof self&&self)||e("object"==typeof n.g&&n.g)||function(){return this}()||Function("return this")()},2256:function(t,r,n){var e=n(8087),o=n(5151),i=e({}.hasOwnProperty);t.exports=Object.hasOwn||function(t,r){return i(o(t),r)}},6789:function(t){t.exports={}},2944:function(t,r,n){var e=n(80);t.exports=e("document","documentElement")},5793:function(t,r,n){var e=n(7891),o=n(6862),i=n(3751);t.exports=!e&&!o((function(){return 7!=Object.defineProperty(i("div"),"a",{get:function(){return 7}}).a}))},79:function(t,r,n){var e=n(8087),o=n(6862),i=n(6446),u=Object,c=e("".split);t.exports=o((function(){return!u("z").propertyIsEnumerable(0)}))?function(t){return"String"==i(t)?c(t,""):u(t)}:u},3303:function(t,r,n){var e=n(8087),o=n(7373),i=n(3230),u=e(Function.toString);o(i.inspectSource)||(i.inspectSource=function(t){return u(t)}),t.exports=i.inspectSource},1259:function(t,r,n){var e,o,i,u=n(4665),c=n(419),a=n(1218),f=n(4845),s=n(2256),p=n(3230),l=n(9355),v=n(6789),y="Object already initialized",b=c.TypeError,h=c.WeakMap;if(u||p.state){var g=p.state||(p.state=new h);g.get=g.get,g.has=g.has,g.set=g.set,e=function(t,r){if(g.has(t))throw b(y);return r.facade=t,g.set(t,r),r},o=function(t){return g.get(t)||{}},i=function(t){return g.has(t)}}else{var m=l("state");v[m]=!0,e=function(t,r){if(s(t,m))throw b(y);return r.facade=t,f(t,m,r),r},o=function(t){return s(t,m)?t[m]:{}},i=function(t){return s(t,m)}}t.exports={set:e,get:o,has:i,enforce:function(t){return i(t)?o(t):e(t,{})},getterFor:function(t){return function(r){var n;if(!a(r)||(n=o(r)).type!==t)throw b("Incompatible receiver, "+t+" required");return n}}}},7373:function(t,r,n){var e=n(7461),o=e.all;t.exports=e.IS_HTMLDDA?function(t){return"function"==typeof t||t===o}:function(t){return"function"==typeof t}},5698:function(t,r,n){var e=n(6862),o=n(7373),i=/#|\.prototype\./,u=function(t,r){var n=a[c(t)];return n==s||n!=f&&(o(r)?e(r):!!r)},c=u.normalize=function(t){return String(t).replace(i,".").toLowerCase()},a=u.data={},f=u.NATIVE="N",s=u.POLYFILL="P";t.exports=u},7039:function(t){t.exports=function(t){return null==t}},1218:function(t,r,n){var e=n(7373),o=n(7461),i=o.all;t.exports=o.IS_HTMLDDA?function(t){return"object"==typeof t?null!==t:e(t)||t===i}:function(t){return"object"==typeof t?null!==t:e(t)}},4943:function(t){t.exports=!1},8898:function(t,r,n){var e=n(80),o=n(7373),i=n(5853),u=n(2696),c=Object;t.exports=u?function(t){return"symbol"==typeof t}:function(t){var r=e("Symbol");return o(r)&&i(r.prototype,c(t))}},1389:function(t,r,n){"use strict";var e=n(1198).IteratorPrototype,o=n(2091),i=n(5392),u=n(6535),c=n(9047),a=function(){return this};t.exports=function(t,r,n,f){var s=r+" Iterator";return t.prototype=o(e,{next:i(+!f,n)}),u(t,s,!1,!0),c[s]=a,t}},5291:function(t,r,n){"use strict";var e=n(9458),o=n(2797),i=n(4943),u=n(5502),c=n(7373),a=n(1389),f=n(8313),s=n(4476),p=n(6535),l=n(4845),v=n(8173),y=n(2712),b=n(9047),h=n(1198),g=u.PROPER,m=u.CONFIGURABLE,d=h.IteratorPrototype,x=h.BUGGY_SAFARI_ITERATORS,O=y("iterator"),S="keys",w="values",j="entries",P=function(){return this};t.exports=function(t,r,n,u,y,h,A){a(n,r,u);var E,I,_,T=function(t){if(t===y&&M)return M;if(!x&&t in F)return F[t];switch(t){case S:case w:case j:return function(){return new n(this,t)}}return function(){return new n(this)}},k=r+" Iterator",C=!1,F=t.prototype,R=F[O]||F["@@iterator"]||y&&F[y],M=!x&&R||T(y),D="Array"==r&&F.entries||R;if(D&&(E=f(D.call(new t)))!==Object.prototype&&E.next&&(i||f(E)===d||(s?s(E,d):c(E[O])||v(E,O,P)),p(E,k,!0,!0),i&&(b[k]=P)),g&&y==w&&R&&R.name!==w&&(!i&&m?l(F,"name",w):(C=!0,M=function(){return o(R,this)})),y)if(I={values:T(w),keys:h?M:T(S),entries:T(j)},A)for(_ in I)(x||C||!(_ in F))&&v(F,_,I[_]);else e({target:r,proto:!0,forced:x||C},I);return i&&!A||F[O]===M||v(F,O,M,{name:y}),b[r]=M,I}},1198:function(t,r,n){"use strict";var e,o,i,u=n(6862),c=n(7373),a=n(1218),f=n(2091),s=n(8313),p=n(8173),l=n(2712),v=n(4943),y=l("iterator"),b=!1;[].keys&&("next"in(i=[].keys())?(o=s(s(i)))!==Object.prototype&&(e=o):b=!0),!a(e)||u((function(){var t={};return e[y].call(t)!==t}))?e={}:v&&(e=f(e)),c(e[y])||p(e,y,(function(){return this})),t.exports={IteratorPrototype:e,BUGGY_SAFARI_ITERATORS:b}},9047:function(t){t.exports={}},6702:function(t,r,n){var e=n(5319);t.exports=function(t){return e(t.length)}},1069:function(t,r,n){var e=n(8087),o=n(6862),i=n(7373),u=n(2256),c=n(7891),a=n(5502).CONFIGURABLE,f=n(3303),s=n(1259),p=s.enforce,l=s.get,v=String,y=Object.defineProperty,b=e("".slice),h=e("".replace),g=e([].join),m=c&&!o((function(){return 8!==y((function(){}),"length",{value:8}).length})),d=String(String).split("String"),x=t.exports=function(t,r,n){"Symbol("===b(v(r),0,7)&&(r="["+h(v(r),/^Symbol\(([^)]*)\)/,"$1")+"]"),n&&n.getter&&(r="get "+r),n&&n.setter&&(r="set "+r),(!u(t,"name")||a&&t.name!==r)&&(c?y(t,"name",{value:r,configurable:!0}):t.name=r),m&&n&&u(n,"arity")&&t.length!==n.arity&&y(t,"length",{value:n.arity});try{n&&u(n,"constructor")&&n.constructor?c&&y(t,"prototype",{writable:!1}):t.prototype&&(t.prototype=void 0)}catch(t){}var e=p(t);return u(e,"source")||(e.source=g(d,"string"==typeof r?r:"")),t};Function.prototype.toString=x((function(){return i(this)&&l(this).source||f(this)}),"toString")},6614:function(t){var r=Math.ceil,n=Math.floor;t.exports=Math.trunc||function(t){var e=+t;return(e>0?n:r)(e)}},2091:function(t,r,n){var e,o=n(9223),i=n(8915),u=n(64),c=n(6789),a=n(2944),f=n(3751),s=n(9355),p="prototype",l="script",v=s("IE_PROTO"),y=function(){},b=function(t){return"<"+l+">"+t+""},h=function(t){t.write(b("")),t.close();var r=t.parentWindow.Object;return t=null,r},g=function(){try{e=new ActiveXObject("htmlfile")}catch(t){}var t,r,n;g="undefined"!=typeof document?document.domain&&e?h(e):(r=f("iframe"),n="java"+l+":",r.style.display="none",a.appendChild(r),r.src=String(n),(t=r.contentWindow.document).open(),t.write(b("document.F=Object")),t.close(),t.F):h(e);for(var o=u.length;o--;)delete g[p][u[o]];return g()};c[v]=!0,t.exports=Object.create||function(t,r){var n;return null!==t?(y[p]=o(t),n=new y,y[p]=null,n[v]=t):n=g(),void 0===r?n:i.f(n,r)}},8915:function(t,r,n){var e=n(7891),o=n(3015),i=n(3567),u=n(9223),c=n(6867),a=n(7333);r.f=e&&!o?Object.defineProperties:function(t,r){u(t);for(var n,e=c(r),o=a(r),f=o.length,s=0;f>s;)i.f(t,n=o[s++],e[n]);return t}},3567:function(t,r,n){var e=n(7891),o=n(5793),i=n(3015),u=n(9223),c=n(8113),a=TypeError,f=Object.defineProperty,s=Object.getOwnPropertyDescriptor,p="enumerable",l="configurable",v="writable";r.f=e?i?function(t,r,n){if(u(t),r=c(r),u(n),"function"==typeof t&&"prototype"===r&&"value"in n&&v in n&&!n[v]){var e=s(t,r);e&&e[v]&&(t[r]=n.value,n={configurable:l in n?n[l]:e[l],enumerable:p in n?n[p]:e[p],writable:!1})}return f(t,r,n)}:f:function(t,r,n){if(u(t),r=c(r),u(n),o)try{return f(t,r,n)}catch(t){}if("get"in n||"set"in n)throw a("Accessors not supported");return"value"in n&&(t[r]=n.value),t}},5245:function(t,r,n){var e=n(7891),o=n(2797),i=n(2741),u=n(5392),c=n(6867),a=n(8113),f=n(2256),s=n(5793),p=Object.getOwnPropertyDescriptor;r.f=e?p:function(t,r){if(t=c(t),r=a(r),s)try{return p(t,r)}catch(t){}if(f(t,r))return u(!o(i.f,t,r),t[r])}},9871:function(t,r,n){var e=n(6252),o=n(64).concat("length","prototype");r.f=Object.getOwnPropertyNames||function(t){return e(t,o)}},7857:function(t,r){r.f=Object.getOwnPropertySymbols},8313:function(t,r,n){var e=n(2256),o=n(7373),i=n(5151),u=n(9355),c=n(747),a=u("IE_PROTO"),f=Object,s=f.prototype;t.exports=c?f.getPrototypeOf:function(t){var r=i(t);if(e(r,a))return r[a];var n=r.constructor;return o(n)&&r instanceof n?n.prototype:r instanceof f?s:null}},5853:function(t,r,n){var e=n(8087);t.exports=e({}.isPrototypeOf)},6252:function(t,r,n){var e=n(8087),o=n(2256),i=n(6867),u=n(6148).indexOf,c=n(6789),a=e([].push);t.exports=function(t,r){var n,e=i(t),f=0,s=[];for(n in e)!o(c,n)&&o(e,n)&&a(s,n);for(;r.length>f;)o(e,n=r[f++])&&(~u(s,n)||a(s,n));return s}},7333:function(t,r,n){var e=n(6252),o=n(64);t.exports=Object.keys||function(t){return e(t,o)}},2741:function(t,r){"use strict";var n={}.propertyIsEnumerable,e=Object.getOwnPropertyDescriptor,o=e&&!n.call({1:2},1);r.f=o?function(t){var r=e(this,t);return!!r&&r.enumerable}:n},4476:function(t,r,n){var e=n(7661),o=n(9223),i=n(4768);t.exports=Object.setPrototypeOf||("__proto__"in{}?function(){var t,r=!1,n={};try{(t=e(Object.prototype,"__proto__","set"))(n,[]),r=n instanceof Array}catch(t){}return function(n,e){return o(n),i(e),r?t(n,e):n.__proto__=e,n}}():void 0)},4946:function(t,r,n){var e=n(2797),o=n(7373),i=n(1218),u=TypeError;t.exports=function(t,r){var n,c;if("string"===r&&o(n=t.toString)&&!i(c=e(n,t)))return c;if(o(n=t.valueOf)&&!i(c=e(n,t)))return c;if("string"!==r&&o(n=t.toString)&&!i(c=e(n,t)))return c;throw u("Can't convert object to primitive value")}},4731:function(t,r,n){var e=n(80),o=n(8087),i=n(9871),u=n(7857),c=n(9223),a=o([].concat);t.exports=e("Reflect","ownKeys")||function(t){var r=i.f(c(t)),n=u.f;return n?a(r,n(t)):r}},8846:function(t,r,n){var e=n(7039),o=TypeError;t.exports=function(t){if(e(t))throw o("Can't call method on "+t);return t}},6535:function(t,r,n){var e=n(3567).f,o=n(2256),i=n(2712)("toStringTag");t.exports=function(t,r,n){t&&!n&&(t=t.prototype),t&&!o(t,i)&&e(t,i,{configurable:!0,value:r})}},9355:function(t,r,n){var e=n(2017),o=n(6303),i=e("keys");t.exports=function(t){return i[t]||(i[t]=o(t))}},3230:function(t,r,n){var e=n(419),o=n(4289),i="__core-js_shared__",u=e[i]||o(i,{});t.exports=u},2017:function(t,r,n){var e=n(4943),o=n(3230);(t.exports=function(t,r){return o[t]||(o[t]=void 0!==r?r:{})})("versions",[]).push({version:"3.30.1",mode:e?"pure":"global",copyright:"© 2014-2023 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.30.1/LICENSE",source:"https://github.com/zloirock/core-js"})},9245:function(t,r,n){var e=n(2437),o=n(6862);t.exports=!!Object.getOwnPropertySymbols&&!o((function(){var t=Symbol();return!String(t)||!(Object(t)instanceof Symbol)||!Symbol.sham&&e&&e<41}))},6912:function(t,r,n){var e=n(8150),o=Math.max,i=Math.min;t.exports=function(t,r){var n=e(t);return n<0?o(n+r,0):i(n,r)}},6867:function(t,r,n){var e=n(79),o=n(8846);t.exports=function(t){return e(o(t))}},8150:function(t,r,n){var e=n(6614);t.exports=function(t){var r=+t;return r!=r||0===r?0:e(r)}},5319:function(t,r,n){var e=n(8150),o=Math.min;t.exports=function(t){return t>0?o(e(t),9007199254740991):0}},5151:function(t,r,n){var e=n(8846),o=Object;t.exports=function(t){return o(e(t))}},3926:function(t,r,n){var e=n(2797),o=n(1218),i=n(8898),u=n(8648),c=n(4946),a=n(2712),f=TypeError,s=a("toPrimitive");t.exports=function(t,r){if(!o(t)||i(t))return t;var n,a=u(t,s);if(a){if(void 0===r&&(r="default"),n=e(a,t,r),!o(n)||i(n))return n;throw f("Can't convert object to primitive value")}return void 0===r&&(r="number"),c(t,r)}},8113:function(t,r,n){var e=n(3926),o=n(8898);t.exports=function(t){var r=e(t,"string");return o(r)?r:r+""}},6927:function(t){var r=String;t.exports=function(t){try{return r(t)}catch(t){return"Object"}}},6303:function(t,r,n){var e=n(8087),o=0,i=Math.random(),u=e(1..toString);t.exports=function(t){return"Symbol("+(void 0===t?"":t)+")_"+u(++o+i,36)}},2696:function(t,r,n){var e=n(9245);t.exports=e&&!Symbol.sham&&"symbol"==typeof Symbol.iterator},3015:function(t,r,n){var e=n(7891),o=n(6862);t.exports=e&&o((function(){return 42!=Object.defineProperty((function(){}),"prototype",{value:42,writable:!1}).prototype}))},4665:function(t,r,n){var e=n(419),o=n(7373),i=e.WeakMap;t.exports=o(i)&&/native code/.test(String(i))},2712:function(t,r,n){var e=n(419),o=n(2017),i=n(2256),u=n(6303),c=n(9245),a=n(2696),f=e.Symbol,s=o("wks"),p=a?f.for||f:f&&f.withoutSetter||u;t.exports=function(t){return i(s,t)||(s[t]=c&&i(f,t)?f[t]:p("Symbol."+t)),s[t]}},9553:function(t,r,n){"use strict";var e=n(6867),o=n(7713),i=n(9047),u=n(1259),c=n(3567).f,a=n(5291),f=n(1439),s=n(4943),p=n(7891),l="Array Iterator",v=u.set,y=u.getterFor(l);t.exports=a(Array,"Array",(function(t,r){v(this,{type:l,target:e(t),index:0,kind:r})}),(function(){var t=y(this),r=t.target,n=t.kind,e=t.index++;return!r||e>=r.length?(t.target=void 0,f(void 0,!0)):f("keys"==n?e:"values"==n?r[e]:[e,r[e]],!1)}),"values");var b=i.Arguments=i.Array;if(o("keys"),o("values"),o("entries"),!s&&p&&"values"!==b.name)try{c(b,"name",{value:"values"})}catch(t){}},4381:function(t,r,n){"use strict";function e(t,r){(null==r||r>t.length)&&(r=t.length);for(var n=0,e=new Array(r);ns;)if((c=a[s++])!=c)return!0}else for(;f>s;s++)if((t||s in a)&&a[s]===r)return t||s||0;return!t&&-1}};t.exports={includes:u(!0),indexOf:u(!1)}},6446:function(t,n,r){var e=r(8087),o=e({}.toString),i=e("".slice);t.exports=function(t){return i(o(t),8,-1)}},4574:function(t,n,r){var e=r(2256),o=r(4731),i=r(5245),u=r(3567);t.exports=function(t,n,r){for(var c=o(n),a=u.f,f=i.f,s=0;s0&&e[0]<4?1:+(e[0]+e[1])),!o&&u&&(!(e=u.match(/Edge\/(\d+)/))||e[1]>=74)&&(e=u.match(/Chrome\/(\d+)/))&&(o=+e[1]),t.exports=o},64:function(t){t.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},9458:function(t,n,r){var e=r(419),o=r(5245).f,i=r(4845),u=r(8173),c=r(4289),a=r(4574),f=r(5698);t.exports=function(t,n){var r,s,p,l,v,y=t.target,b=t.global,g=t.stat;if(r=b?e:g?e[y]||c(y,{}):(e[y]||{}).prototype)for(s in n){if(l=n[s],p=t.dontCallGetSet?(v=o(r,s))&&v.value:r[s],!f(b?s:y+(g?".":"#")+s,t.forced)&&void 0!==p){if(typeof l==typeof p)continue;a(l,p)}(t.sham||p&&p.sham)&&i(l,"sham",!0),u(r,s,l,t)}}},6862:function(t){t.exports=function(t){try{return!!t()}catch(t){return!0}}},4555:function(t,n,r){var e=r(6862);t.exports=!e((function(){var t=function(){}.bind();return"function"!=typeof t||t.hasOwnProperty("prototype")}))},2797:function(t,n,r){var e=r(4555),o=Function.prototype.call;t.exports=e?o.bind(o):function(){return o.apply(o,arguments)}},5502:function(t,n,r){var e=r(7891),o=r(2256),i=Function.prototype,u=e&&Object.getOwnPropertyDescriptor,c=o(i,"name"),a=c&&"something"===function(){}.name,f=c&&(!e||e&&u(i,"name").configurable);t.exports={EXISTS:c,PROPER:a,CONFIGURABLE:f}},7661:function(t,n,r){var e=r(8087),o=r(4627);t.exports=function(t,n,r){try{return e(o(Object.getOwnPropertyDescriptor(t,n)[r]))}catch(t){}}},8087:function(t,n,r){var e=r(4555),o=Function.prototype,i=o.call,u=e&&o.bind.bind(i,i);t.exports=e?u:function(t){return function(){return i.apply(t,arguments)}}},80:function(t,n,r){var e=r(419),o=r(7373);t.exports=function(t,n){return arguments.length<2?(r=e[t],o(r)?r:void 0):e[t]&&e[t][n];var r}},8648:function(t,n,r){var e=r(4627),o=r(7039);t.exports=function(t,n){var r=t[n];return o(r)?void 0:e(r)}},419:function(t,n,r){var e=function(t){return t&&t.Math==Math&&t};t.exports=e("object"==typeof globalThis&&globalThis)||e("object"==typeof window&&window)||e("object"==typeof self&&self)||e("object"==typeof r.g&&r.g)||function(){return this}()||Function("return this")()},2256:function(t,n,r){var e=r(8087),o=r(5151),i=e({}.hasOwnProperty);t.exports=Object.hasOwn||function(t,n){return i(o(t),n)}},6789:function(t){t.exports={}},2944:function(t,n,r){var e=r(80);t.exports=e("document","documentElement")},5793:function(t,n,r){var e=r(7891),o=r(6862),i=r(3751);t.exports=!e&&!o((function(){return 7!=Object.defineProperty(i("div"),"a",{get:function(){return 7}}).a}))},79:function(t,n,r){var e=r(8087),o=r(6862),i=r(6446),u=Object,c=e("".split);t.exports=o((function(){return!u("z").propertyIsEnumerable(0)}))?function(t){return"String"==i(t)?c(t,""):u(t)}:u},3303:function(t,n,r){var e=r(8087),o=r(7373),i=r(3230),u=e(Function.toString);o(i.inspectSource)||(i.inspectSource=function(t){return u(t)}),t.exports=i.inspectSource},1259:function(t,n,r){var e,o,i,u=r(4665),c=r(419),a=r(1218),f=r(4845),s=r(2256),p=r(3230),l=r(9355),v=r(6789),y="Object already initialized",b=c.TypeError,g=c.WeakMap;if(u||p.state){var h=p.state||(p.state=new g);h.get=h.get,h.has=h.has,h.set=h.set,e=function(t,n){if(h.has(t))throw b(y);return n.facade=t,h.set(t,n),n},o=function(t){return h.get(t)||{}},i=function(t){return h.has(t)}}else{var x=l("state");v[x]=!0,e=function(t,n){if(s(t,x))throw b(y);return n.facade=t,f(t,x,n),n},o=function(t){return s(t,x)?t[x]:{}},i=function(t){return s(t,x)}}t.exports={set:e,get:o,has:i,enforce:function(t){return i(t)?o(t):e(t,{})},getterFor:function(t){return function(n){var r;if(!a(n)||(r=o(n)).type!==t)throw b("Incompatible receiver, "+t+" required");return r}}}},7373:function(t,n,r){var e=r(7461),o=e.all;t.exports=e.IS_HTMLDDA?function(t){return"function"==typeof t||t===o}:function(t){return"function"==typeof t}},5698:function(t,n,r){var e=r(6862),o=r(7373),i=/#|\.prototype\./,u=function(t,n){var r=a[c(t)];return r==s||r!=f&&(o(n)?e(n):!!n)},c=u.normalize=function(t){return String(t).replace(i,".").toLowerCase()},a=u.data={},f=u.NATIVE="N",s=u.POLYFILL="P";t.exports=u},7039:function(t){t.exports=function(t){return null==t}},1218:function(t,n,r){var e=r(7373),o=r(7461),i=o.all;t.exports=o.IS_HTMLDDA?function(t){return"object"==typeof t?null!==t:e(t)||t===i}:function(t){return"object"==typeof t?null!==t:e(t)}},4943:function(t){t.exports=!1},8898:function(t,n,r){var e=r(80),o=r(7373),i=r(5853),u=r(2696),c=Object;t.exports=u?function(t){return"symbol"==typeof t}:function(t){var n=e("Symbol");return o(n)&&i(n.prototype,c(t))}},1389:function(t,n,r){"use strict";var e=r(1198).IteratorPrototype,o=r(2091),i=r(5392),u=r(6535),c=r(9047),a=function(){return this};t.exports=function(t,n,r,f){var s=n+" Iterator";return t.prototype=o(e,{next:i(+!f,r)}),u(t,s,!1,!0),c[s]=a,t}},5291:function(t,n,r){"use strict";var e=r(9458),o=r(2797),i=r(4943),u=r(5502),c=r(7373),a=r(1389),f=r(8313),s=r(4476),p=r(6535),l=r(4845),v=r(8173),y=r(2712),b=r(9047),g=r(1198),h=u.PROPER,x=u.CONFIGURABLE,m=g.IteratorPrototype,d=g.BUGGY_SAFARI_ITERATORS,O=y("iterator"),w="keys",S="values",j="entries",P=function(){return this};t.exports=function(t,n,r,u,y,g,_){a(r,n,u);var E,I,A,T=function(t){if(t===y&&M)return M;if(!d&&t in R)return R[t];switch(t){case w:case S:case j:return function(){return new r(this,t)}}return function(){return new r(this)}},k=n+" Iterator",F=!1,R=t.prototype,C=R[O]||R["@@iterator"]||y&&R[y],M=!d&&C||T(y),D="Array"==n&&R.entries||C;if(D&&(E=f(D.call(new t)))!==Object.prototype&&E.next&&(i||f(E)===m||(s?s(E,m):c(E[O])||v(E,O,P)),p(E,k,!0,!0),i&&(b[k]=P)),h&&y==S&&C&&C.name!==S&&(!i&&x?l(R,"name",S):(F=!0,M=function(){return o(C,this)})),y)if(I={values:T(S),keys:g?M:T(w),entries:T(j)},_)for(A in I)(d||F||!(A in R))&&v(R,A,I[A]);else e({target:n,proto:!0,forced:d||F},I);return i&&!_||R[O]===M||v(R,O,M,{name:y}),b[n]=M,I}},1198:function(t,n,r){"use strict";var e,o,i,u=r(6862),c=r(7373),a=r(1218),f=r(2091),s=r(8313),p=r(8173),l=r(2712),v=r(4943),y=l("iterator"),b=!1;[].keys&&("next"in(i=[].keys())?(o=s(s(i)))!==Object.prototype&&(e=o):b=!0),!a(e)||u((function(){var t={};return e[y].call(t)!==t}))?e={}:v&&(e=f(e)),c(e[y])||p(e,y,(function(){return this})),t.exports={IteratorPrototype:e,BUGGY_SAFARI_ITERATORS:b}},9047:function(t){t.exports={}},6702:function(t,n,r){var e=r(5319);t.exports=function(t){return e(t.length)}},1069:function(t,n,r){var e=r(8087),o=r(6862),i=r(7373),u=r(2256),c=r(7891),a=r(5502).CONFIGURABLE,f=r(3303),s=r(1259),p=s.enforce,l=s.get,v=String,y=Object.defineProperty,b=e("".slice),g=e("".replace),h=e([].join),x=c&&!o((function(){return 8!==y((function(){}),"length",{value:8}).length})),m=String(String).split("String"),d=t.exports=function(t,n,r){"Symbol("===b(v(n),0,7)&&(n="["+g(v(n),/^Symbol\(([^)]*)\)/,"$1")+"]"),r&&r.getter&&(n="get "+n),r&&r.setter&&(n="set "+n),(!u(t,"name")||a&&t.name!==n)&&(c?y(t,"name",{value:n,configurable:!0}):t.name=n),x&&r&&u(r,"arity")&&t.length!==r.arity&&y(t,"length",{value:r.arity});try{r&&u(r,"constructor")&&r.constructor?c&&y(t,"prototype",{writable:!1}):t.prototype&&(t.prototype=void 0)}catch(t){}var e=p(t);return u(e,"source")||(e.source=h(m,"string"==typeof n?n:"")),t};Function.prototype.toString=d((function(){return i(this)&&l(this).source||f(this)}),"toString")},6614:function(t){var n=Math.ceil,r=Math.floor;t.exports=Math.trunc||function(t){var e=+t;return(e>0?r:n)(e)}},2091:function(t,n,r){var e,o=r(9223),i=r(8915),u=r(64),c=r(6789),a=r(2944),f=r(3751),s=r(9355),p="prototype",l="script",v=s("IE_PROTO"),y=function(){},b=function(t){return"<"+l+">"+t+""},g=function(t){t.write(b("")),t.close();var n=t.parentWindow.Object;return t=null,n},h=function(){try{e=new ActiveXObject("htmlfile")}catch(t){}var t,n,r;h="undefined"!=typeof document?document.domain&&e?g(e):(n=f("iframe"),r="java"+l+":",n.style.display="none",a.appendChild(n),n.src=String(r),(t=n.contentWindow.document).open(),t.write(b("document.F=Object")),t.close(),t.F):g(e);for(var o=u.length;o--;)delete h[p][u[o]];return h()};c[v]=!0,t.exports=Object.create||function(t,n){var r;return null!==t?(y[p]=o(t),r=new y,y[p]=null,r[v]=t):r=h(),void 0===n?r:i.f(r,n)}},8915:function(t,n,r){var e=r(7891),o=r(3015),i=r(3567),u=r(9223),c=r(6867),a=r(7333);n.f=e&&!o?Object.defineProperties:function(t,n){u(t);for(var r,e=c(n),o=a(n),f=o.length,s=0;f>s;)i.f(t,r=o[s++],e[r]);return t}},3567:function(t,n,r){var e=r(7891),o=r(5793),i=r(3015),u=r(9223),c=r(8113),a=TypeError,f=Object.defineProperty,s=Object.getOwnPropertyDescriptor,p="enumerable",l="configurable",v="writable";n.f=e?i?function(t,n,r){if(u(t),n=c(n),u(r),"function"==typeof t&&"prototype"===n&&"value"in r&&v in r&&!r[v]){var e=s(t,n);e&&e[v]&&(t[n]=r.value,r={configurable:l in r?r[l]:e[l],enumerable:p in r?r[p]:e[p],writable:!1})}return f(t,n,r)}:f:function(t,n,r){if(u(t),n=c(n),u(r),o)try{return f(t,n,r)}catch(t){}if("get"in r||"set"in r)throw a("Accessors not supported");return"value"in r&&(t[n]=r.value),t}},5245:function(t,n,r){var e=r(7891),o=r(2797),i=r(2741),u=r(5392),c=r(6867),a=r(8113),f=r(2256),s=r(5793),p=Object.getOwnPropertyDescriptor;n.f=e?p:function(t,n){if(t=c(t),n=a(n),s)try{return p(t,n)}catch(t){}if(f(t,n))return u(!o(i.f,t,n),t[n])}},9871:function(t,n,r){var e=r(6252),o=r(64).concat("length","prototype");n.f=Object.getOwnPropertyNames||function(t){return e(t,o)}},7857:function(t,n){n.f=Object.getOwnPropertySymbols},8313:function(t,n,r){var e=r(2256),o=r(7373),i=r(5151),u=r(9355),c=r(747),a=u("IE_PROTO"),f=Object,s=f.prototype;t.exports=c?f.getPrototypeOf:function(t){var n=i(t);if(e(n,a))return n[a];var r=n.constructor;return o(r)&&n instanceof r?r.prototype:n instanceof f?s:null}},5853:function(t,n,r){var e=r(8087);t.exports=e({}.isPrototypeOf)},6252:function(t,n,r){var e=r(8087),o=r(2256),i=r(6867),u=r(6148).indexOf,c=r(6789),a=e([].push);t.exports=function(t,n){var r,e=i(t),f=0,s=[];for(r in e)!o(c,r)&&o(e,r)&&a(s,r);for(;n.length>f;)o(e,r=n[f++])&&(~u(s,r)||a(s,r));return s}},7333:function(t,n,r){var e=r(6252),o=r(64);t.exports=Object.keys||function(t){return e(t,o)}},2741:function(t,n){"use strict";var r={}.propertyIsEnumerable,e=Object.getOwnPropertyDescriptor,o=e&&!r.call({1:2},1);n.f=o?function(t){var n=e(this,t);return!!n&&n.enumerable}:r},4476:function(t,n,r){var e=r(7661),o=r(9223),i=r(4768);t.exports=Object.setPrototypeOf||("__proto__"in{}?function(){var t,n=!1,r={};try{(t=e(Object.prototype,"__proto__","set"))(r,[]),n=r instanceof Array}catch(t){}return function(r,e){return o(r),i(e),n?t(r,e):r.__proto__=e,r}}():void 0)},4946:function(t,n,r){var e=r(2797),o=r(7373),i=r(1218),u=TypeError;t.exports=function(t,n){var r,c;if("string"===n&&o(r=t.toString)&&!i(c=e(r,t)))return c;if(o(r=t.valueOf)&&!i(c=e(r,t)))return c;if("string"!==n&&o(r=t.toString)&&!i(c=e(r,t)))return c;throw u("Can't convert object to primitive value")}},4731:function(t,n,r){var e=r(80),o=r(8087),i=r(9871),u=r(7857),c=r(9223),a=o([].concat);t.exports=e("Reflect","ownKeys")||function(t){var n=i.f(c(t)),r=u.f;return r?a(n,r(t)):n}},8846:function(t,n,r){var e=r(7039),o=TypeError;t.exports=function(t){if(e(t))throw o("Can't call method on "+t);return t}},6535:function(t,n,r){var e=r(3567).f,o=r(2256),i=r(2712)("toStringTag");t.exports=function(t,n,r){t&&!r&&(t=t.prototype),t&&!o(t,i)&&e(t,i,{configurable:!0,value:n})}},9355:function(t,n,r){var e=r(2017),o=r(6303),i=e("keys");t.exports=function(t){return i[t]||(i[t]=o(t))}},3230:function(t,n,r){var e=r(419),o=r(4289),i="__core-js_shared__",u=e[i]||o(i,{});t.exports=u},2017:function(t,n,r){var e=r(4943),o=r(3230);(t.exports=function(t,n){return o[t]||(o[t]=void 0!==n?n:{})})("versions",[]).push({version:"3.30.1",mode:e?"pure":"global",copyright:"© 2014-2023 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.30.1/LICENSE",source:"https://github.com/zloirock/core-js"})},9245:function(t,n,r){var e=r(2437),o=r(6862);t.exports=!!Object.getOwnPropertySymbols&&!o((function(){var t=Symbol();return!String(t)||!(Object(t)instanceof Symbol)||!Symbol.sham&&e&&e<41}))},6912:function(t,n,r){var e=r(8150),o=Math.max,i=Math.min;t.exports=function(t,n){var r=e(t);return r<0?o(r+n,0):i(r,n)}},6867:function(t,n,r){var e=r(79),o=r(8846);t.exports=function(t){return e(o(t))}},8150:function(t,n,r){var e=r(6614);t.exports=function(t){var n=+t;return n!=n||0===n?0:e(n)}},5319:function(t,n,r){var e=r(8150),o=Math.min;t.exports=function(t){return t>0?o(e(t),9007199254740991):0}},5151:function(t,n,r){var e=r(8846),o=Object;t.exports=function(t){return o(e(t))}},3926:function(t,n,r){var e=r(2797),o=r(1218),i=r(8898),u=r(8648),c=r(4946),a=r(2712),f=TypeError,s=a("toPrimitive");t.exports=function(t,n){if(!o(t)||i(t))return t;var r,a=u(t,s);if(a){if(void 0===n&&(n="default"),r=e(a,t,n),!o(r)||i(r))return r;throw f("Can't convert object to primitive value")}return void 0===n&&(n="number"),c(t,n)}},8113:function(t,n,r){var e=r(3926),o=r(8898);t.exports=function(t){var n=e(t,"string");return o(n)?n:n+""}},6927:function(t){var n=String;t.exports=function(t){try{return n(t)}catch(t){return"Object"}}},6303:function(t,n,r){var e=r(8087),o=0,i=Math.random(),u=e(1..toString);t.exports=function(t){return"Symbol("+(void 0===t?"":t)+")_"+u(++o+i,36)}},2696:function(t,n,r){var e=r(9245);t.exports=e&&!Symbol.sham&&"symbol"==typeof Symbol.iterator},3015:function(t,n,r){var e=r(7891),o=r(6862);t.exports=e&&o((function(){return 42!=Object.defineProperty((function(){}),"prototype",{value:42,writable:!1}).prototype}))},4665:function(t,n,r){var e=r(419),o=r(7373),i=e.WeakMap;t.exports=o(i)&&/native code/.test(String(i))},2712:function(t,n,r){var e=r(419),o=r(2017),i=r(2256),u=r(6303),c=r(9245),a=r(2696),f=e.Symbol,s=o("wks"),p=a?f.for||f:f&&f.withoutSetter||u;t.exports=function(t){return i(s,t)||(s[t]=c&&i(f,t)?f[t]:p("Symbol."+t)),s[t]}},9553:function(t,n,r){"use strict";var e=r(6867),o=r(7713),i=r(9047),u=r(1259),c=r(3567).f,a=r(5291),f=r(1439),s=r(4943),p=r(7891),l="Array Iterator",v=u.set,y=u.getterFor(l);t.exports=a(Array,"Array",(function(t,n){v(this,{type:l,target:e(t),index:0,kind:n})}),(function(){var t=y(this),n=t.target,r=t.kind,e=t.index++;return!n||e>=n.length?(t.target=void 0,f(void 0,!0)):f("keys"==r?e:"values"==r?n[e]:[e,n[e]],!1)}),"values");var b=i.Arguments=i.Array;if(o("keys"),o("values"),o("entries"),!s&&p&&"values"!==b.name)try{c(b,"name",{value:"values"})}catch(t){}}}]); +//# sourceMappingURL=vendor-theme.js.map \ No newline at end of file diff --git a/assets/js/dist/vendor-theme.min.js b/assets/js/dist/vendor-theme.min.js new file mode 100644 index 0000000..8fc0d85 --- /dev/null +++ b/assets/js/dist/vendor-theme.min.js @@ -0,0 +1 @@ +(self.webpackChunkgform_turnstile=self.webpackChunkgform_turnstile||[]).push([[499],{4627:function(t,n,r){var e=r(7373),o=r(6927),i=TypeError;t.exports=function(t){if(e(t))return t;throw i(o(t)+" is not a function")}},4768:function(t,n,r){var e=r(7373),o=String,i=TypeError;t.exports=function(t){if("object"==typeof t||e(t))return t;throw i("Can't set "+o(t)+" as a prototype")}},7713:function(t,n,r){var e=r(2712),o=r(2091),i=r(3567).f,u=e("unscopables"),c=Array.prototype;null==c[u]&&i(c,u,{configurable:!0,value:o(null)}),t.exports=function(t){c[u][t]=!0}},9223:function(t,n,r){var e=r(1218),o=String,i=TypeError;t.exports=function(t){if(e(t))return t;throw i(o(t)+" is not an object")}},6148:function(t,n,r){var e=r(6867),o=r(6912),i=r(6702),u=function(t){return function(n,r,u){var c,a=e(n),f=i(a),s=o(u,f);if(t&&r!=r){for(;f>s;)if((c=a[s++])!=c)return!0}else for(;f>s;s++)if((t||s in a)&&a[s]===r)return t||s||0;return!t&&-1}};t.exports={includes:u(!0),indexOf:u(!1)}},6446:function(t,n,r){var e=r(8087),o=e({}.toString),i=e("".slice);t.exports=function(t){return i(o(t),8,-1)}},4574:function(t,n,r){var e=r(2256),o=r(4731),i=r(5245),u=r(3567);t.exports=function(t,n,r){for(var c=o(n),a=u.f,f=i.f,s=0;s0&&e[0]<4?1:+(e[0]+e[1])),!o&&u&&(!(e=u.match(/Edge\/(\d+)/))||e[1]>=74)&&(e=u.match(/Chrome\/(\d+)/))&&(o=+e[1]),t.exports=o},64:function(t){t.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},9458:function(t,n,r){var e=r(419),o=r(5245).f,i=r(4845),u=r(8173),c=r(4289),a=r(4574),f=r(5698);t.exports=function(t,n){var r,s,p,l,v,y=t.target,b=t.global,g=t.stat;if(r=b?e:g?e[y]||c(y,{}):(e[y]||{}).prototype)for(s in n){if(l=n[s],p=t.dontCallGetSet?(v=o(r,s))&&v.value:r[s],!f(b?s:y+(g?".":"#")+s,t.forced)&&void 0!==p){if(typeof l==typeof p)continue;a(l,p)}(t.sham||p&&p.sham)&&i(l,"sham",!0),u(r,s,l,t)}}},6862:function(t){t.exports=function(t){try{return!!t()}catch(t){return!0}}},4555:function(t,n,r){var e=r(6862);t.exports=!e((function(){var t=function(){}.bind();return"function"!=typeof t||t.hasOwnProperty("prototype")}))},2797:function(t,n,r){var e=r(4555),o=Function.prototype.call;t.exports=e?o.bind(o):function(){return o.apply(o,arguments)}},5502:function(t,n,r){var e=r(7891),o=r(2256),i=Function.prototype,u=e&&Object.getOwnPropertyDescriptor,c=o(i,"name"),a=c&&"something"===function(){}.name,f=c&&(!e||e&&u(i,"name").configurable);t.exports={EXISTS:c,PROPER:a,CONFIGURABLE:f}},7661:function(t,n,r){var e=r(8087),o=r(4627);t.exports=function(t,n,r){try{return e(o(Object.getOwnPropertyDescriptor(t,n)[r]))}catch(t){}}},8087:function(t,n,r){var e=r(4555),o=Function.prototype,i=o.call,u=e&&o.bind.bind(i,i);t.exports=e?u:function(t){return function(){return i.apply(t,arguments)}}},80:function(t,n,r){var e=r(419),o=r(7373);t.exports=function(t,n){return arguments.length<2?(r=e[t],o(r)?r:void 0):e[t]&&e[t][n];var r}},8648:function(t,n,r){var e=r(4627),o=r(7039);t.exports=function(t,n){var r=t[n];return o(r)?void 0:e(r)}},419:function(t,n,r){var e=function(t){return t&&t.Math==Math&&t};t.exports=e("object"==typeof globalThis&&globalThis)||e("object"==typeof window&&window)||e("object"==typeof self&&self)||e("object"==typeof r.g&&r.g)||function(){return this}()||Function("return this")()},2256:function(t,n,r){var e=r(8087),o=r(5151),i=e({}.hasOwnProperty);t.exports=Object.hasOwn||function(t,n){return i(o(t),n)}},6789:function(t){t.exports={}},2944:function(t,n,r){var e=r(80);t.exports=e("document","documentElement")},5793:function(t,n,r){var e=r(7891),o=r(6862),i=r(3751);t.exports=!e&&!o((function(){return 7!=Object.defineProperty(i("div"),"a",{get:function(){return 7}}).a}))},79:function(t,n,r){var e=r(8087),o=r(6862),i=r(6446),u=Object,c=e("".split);t.exports=o((function(){return!u("z").propertyIsEnumerable(0)}))?function(t){return"String"==i(t)?c(t,""):u(t)}:u},3303:function(t,n,r){var e=r(8087),o=r(7373),i=r(3230),u=e(Function.toString);o(i.inspectSource)||(i.inspectSource=function(t){return u(t)}),t.exports=i.inspectSource},1259:function(t,n,r){var e,o,i,u=r(4665),c=r(419),a=r(1218),f=r(4845),s=r(2256),p=r(3230),l=r(9355),v=r(6789),y="Object already initialized",b=c.TypeError,g=c.WeakMap;if(u||p.state){var h=p.state||(p.state=new g);h.get=h.get,h.has=h.has,h.set=h.set,e=function(t,n){if(h.has(t))throw b(y);return n.facade=t,h.set(t,n),n},o=function(t){return h.get(t)||{}},i=function(t){return h.has(t)}}else{var x=l("state");v[x]=!0,e=function(t,n){if(s(t,x))throw b(y);return n.facade=t,f(t,x,n),n},o=function(t){return s(t,x)?t[x]:{}},i=function(t){return s(t,x)}}t.exports={set:e,get:o,has:i,enforce:function(t){return i(t)?o(t):e(t,{})},getterFor:function(t){return function(n){var r;if(!a(n)||(r=o(n)).type!==t)throw b("Incompatible receiver, "+t+" required");return r}}}},7373:function(t,n,r){var e=r(7461),o=e.all;t.exports=e.IS_HTMLDDA?function(t){return"function"==typeof t||t===o}:function(t){return"function"==typeof t}},5698:function(t,n,r){var e=r(6862),o=r(7373),i=/#|\.prototype\./,u=function(t,n){var r=a[c(t)];return r==s||r!=f&&(o(n)?e(n):!!n)},c=u.normalize=function(t){return String(t).replace(i,".").toLowerCase()},a=u.data={},f=u.NATIVE="N",s=u.POLYFILL="P";t.exports=u},7039:function(t){t.exports=function(t){return null==t}},1218:function(t,n,r){var e=r(7373),o=r(7461),i=o.all;t.exports=o.IS_HTMLDDA?function(t){return"object"==typeof t?null!==t:e(t)||t===i}:function(t){return"object"==typeof t?null!==t:e(t)}},4943:function(t){t.exports=!1},8898:function(t,n,r){var e=r(80),o=r(7373),i=r(5853),u=r(2696),c=Object;t.exports=u?function(t){return"symbol"==typeof t}:function(t){var n=e("Symbol");return o(n)&&i(n.prototype,c(t))}},1389:function(t,n,r){"use strict";var e=r(1198).IteratorPrototype,o=r(2091),i=r(5392),u=r(6535),c=r(9047),a=function(){return this};t.exports=function(t,n,r,f){var s=n+" Iterator";return t.prototype=o(e,{next:i(+!f,r)}),u(t,s,!1,!0),c[s]=a,t}},5291:function(t,n,r){"use strict";var e=r(9458),o=r(2797),i=r(4943),u=r(5502),c=r(7373),a=r(1389),f=r(8313),s=r(4476),p=r(6535),l=r(4845),v=r(8173),y=r(2712),b=r(9047),g=r(1198),h=u.PROPER,x=u.CONFIGURABLE,m=g.IteratorPrototype,d=g.BUGGY_SAFARI_ITERATORS,O=y("iterator"),w="keys",S="values",j="entries",P=function(){return this};t.exports=function(t,n,r,u,y,g,_){a(r,n,u);var E,I,A,T=function(t){if(t===y&&M)return M;if(!d&&t in R)return R[t];switch(t){case w:case S:case j:return function(){return new r(this,t)}}return function(){return new r(this)}},k=n+" Iterator",F=!1,R=t.prototype,C=R[O]||R["@@iterator"]||y&&R[y],M=!d&&C||T(y),D="Array"==n&&R.entries||C;if(D&&(E=f(D.call(new t)))!==Object.prototype&&E.next&&(i||f(E)===m||(s?s(E,m):c(E[O])||v(E,O,P)),p(E,k,!0,!0),i&&(b[k]=P)),h&&y==S&&C&&C.name!==S&&(!i&&x?l(R,"name",S):(F=!0,M=function(){return o(C,this)})),y)if(I={values:T(S),keys:g?M:T(w),entries:T(j)},_)for(A in I)(d||F||!(A in R))&&v(R,A,I[A]);else e({target:n,proto:!0,forced:d||F},I);return i&&!_||R[O]===M||v(R,O,M,{name:y}),b[n]=M,I}},1198:function(t,n,r){"use strict";var e,o,i,u=r(6862),c=r(7373),a=r(1218),f=r(2091),s=r(8313),p=r(8173),l=r(2712),v=r(4943),y=l("iterator"),b=!1;[].keys&&("next"in(i=[].keys())?(o=s(s(i)))!==Object.prototype&&(e=o):b=!0),!a(e)||u((function(){var t={};return e[y].call(t)!==t}))?e={}:v&&(e=f(e)),c(e[y])||p(e,y,(function(){return this})),t.exports={IteratorPrototype:e,BUGGY_SAFARI_ITERATORS:b}},9047:function(t){t.exports={}},6702:function(t,n,r){var e=r(5319);t.exports=function(t){return e(t.length)}},1069:function(t,n,r){var e=r(8087),o=r(6862),i=r(7373),u=r(2256),c=r(7891),a=r(5502).CONFIGURABLE,f=r(3303),s=r(1259),p=s.enforce,l=s.get,v=String,y=Object.defineProperty,b=e("".slice),g=e("".replace),h=e([].join),x=c&&!o((function(){return 8!==y((function(){}),"length",{value:8}).length})),m=String(String).split("String"),d=t.exports=function(t,n,r){"Symbol("===b(v(n),0,7)&&(n="["+g(v(n),/^Symbol\(([^)]*)\)/,"$1")+"]"),r&&r.getter&&(n="get "+n),r&&r.setter&&(n="set "+n),(!u(t,"name")||a&&t.name!==n)&&(c?y(t,"name",{value:n,configurable:!0}):t.name=n),x&&r&&u(r,"arity")&&t.length!==r.arity&&y(t,"length",{value:r.arity});try{r&&u(r,"constructor")&&r.constructor?c&&y(t,"prototype",{writable:!1}):t.prototype&&(t.prototype=void 0)}catch(t){}var e=p(t);return u(e,"source")||(e.source=h(m,"string"==typeof n?n:"")),t};Function.prototype.toString=d((function(){return i(this)&&l(this).source||f(this)}),"toString")},6614:function(t){var n=Math.ceil,r=Math.floor;t.exports=Math.trunc||function(t){var e=+t;return(e>0?r:n)(e)}},2091:function(t,n,r){var e,o=r(9223),i=r(8915),u=r(64),c=r(6789),a=r(2944),f=r(3751),s=r(9355),p="prototype",l="script",v=s("IE_PROTO"),y=function(){},b=function(t){return"<"+l+">"+t+""},g=function(t){t.write(b("")),t.close();var n=t.parentWindow.Object;return t=null,n},h=function(){try{e=new ActiveXObject("htmlfile")}catch(t){}var t,n,r;h="undefined"!=typeof document?document.domain&&e?g(e):(n=f("iframe"),r="java"+l+":",n.style.display="none",a.appendChild(n),n.src=String(r),(t=n.contentWindow.document).open(),t.write(b("document.F=Object")),t.close(),t.F):g(e);for(var o=u.length;o--;)delete h[p][u[o]];return h()};c[v]=!0,t.exports=Object.create||function(t,n){var r;return null!==t?(y[p]=o(t),r=new y,y[p]=null,r[v]=t):r=h(),void 0===n?r:i.f(r,n)}},8915:function(t,n,r){var e=r(7891),o=r(3015),i=r(3567),u=r(9223),c=r(6867),a=r(7333);n.f=e&&!o?Object.defineProperties:function(t,n){u(t);for(var r,e=c(n),o=a(n),f=o.length,s=0;f>s;)i.f(t,r=o[s++],e[r]);return t}},3567:function(t,n,r){var e=r(7891),o=r(5793),i=r(3015),u=r(9223),c=r(8113),a=TypeError,f=Object.defineProperty,s=Object.getOwnPropertyDescriptor,p="enumerable",l="configurable",v="writable";n.f=e?i?function(t,n,r){if(u(t),n=c(n),u(r),"function"==typeof t&&"prototype"===n&&"value"in r&&v in r&&!r[v]){var e=s(t,n);e&&e[v]&&(t[n]=r.value,r={configurable:l in r?r[l]:e[l],enumerable:p in r?r[p]:e[p],writable:!1})}return f(t,n,r)}:f:function(t,n,r){if(u(t),n=c(n),u(r),o)try{return f(t,n,r)}catch(t){}if("get"in r||"set"in r)throw a("Accessors not supported");return"value"in r&&(t[n]=r.value),t}},5245:function(t,n,r){var e=r(7891),o=r(2797),i=r(2741),u=r(5392),c=r(6867),a=r(8113),f=r(2256),s=r(5793),p=Object.getOwnPropertyDescriptor;n.f=e?p:function(t,n){if(t=c(t),n=a(n),s)try{return p(t,n)}catch(t){}if(f(t,n))return u(!o(i.f,t,n),t[n])}},9871:function(t,n,r){var e=r(6252),o=r(64).concat("length","prototype");n.f=Object.getOwnPropertyNames||function(t){return e(t,o)}},7857:function(t,n){n.f=Object.getOwnPropertySymbols},8313:function(t,n,r){var e=r(2256),o=r(7373),i=r(5151),u=r(9355),c=r(747),a=u("IE_PROTO"),f=Object,s=f.prototype;t.exports=c?f.getPrototypeOf:function(t){var n=i(t);if(e(n,a))return n[a];var r=n.constructor;return o(r)&&n instanceof r?r.prototype:n instanceof f?s:null}},5853:function(t,n,r){var e=r(8087);t.exports=e({}.isPrototypeOf)},6252:function(t,n,r){var e=r(8087),o=r(2256),i=r(6867),u=r(6148).indexOf,c=r(6789),a=e([].push);t.exports=function(t,n){var r,e=i(t),f=0,s=[];for(r in e)!o(c,r)&&o(e,r)&&a(s,r);for(;n.length>f;)o(e,r=n[f++])&&(~u(s,r)||a(s,r));return s}},7333:function(t,n,r){var e=r(6252),o=r(64);t.exports=Object.keys||function(t){return e(t,o)}},2741:function(t,n){"use strict";var r={}.propertyIsEnumerable,e=Object.getOwnPropertyDescriptor,o=e&&!r.call({1:2},1);n.f=o?function(t){var n=e(this,t);return!!n&&n.enumerable}:r},4476:function(t,n,r){var e=r(7661),o=r(9223),i=r(4768);t.exports=Object.setPrototypeOf||("__proto__"in{}?function(){var t,n=!1,r={};try{(t=e(Object.prototype,"__proto__","set"))(r,[]),n=r instanceof Array}catch(t){}return function(r,e){return o(r),i(e),n?t(r,e):r.__proto__=e,r}}():void 0)},4946:function(t,n,r){var e=r(2797),o=r(7373),i=r(1218),u=TypeError;t.exports=function(t,n){var r,c;if("string"===n&&o(r=t.toString)&&!i(c=e(r,t)))return c;if(o(r=t.valueOf)&&!i(c=e(r,t)))return c;if("string"!==n&&o(r=t.toString)&&!i(c=e(r,t)))return c;throw u("Can't convert object to primitive value")}},4731:function(t,n,r){var e=r(80),o=r(8087),i=r(9871),u=r(7857),c=r(9223),a=o([].concat);t.exports=e("Reflect","ownKeys")||function(t){var n=i.f(c(t)),r=u.f;return r?a(n,r(t)):n}},8846:function(t,n,r){var e=r(7039),o=TypeError;t.exports=function(t){if(e(t))throw o("Can't call method on "+t);return t}},6535:function(t,n,r){var e=r(3567).f,o=r(2256),i=r(2712)("toStringTag");t.exports=function(t,n,r){t&&!r&&(t=t.prototype),t&&!o(t,i)&&e(t,i,{configurable:!0,value:n})}},9355:function(t,n,r){var e=r(2017),o=r(6303),i=e("keys");t.exports=function(t){return i[t]||(i[t]=o(t))}},3230:function(t,n,r){var e=r(419),o=r(4289),i="__core-js_shared__",u=e[i]||o(i,{});t.exports=u},2017:function(t,n,r){var e=r(4943),o=r(3230);(t.exports=function(t,n){return o[t]||(o[t]=void 0!==n?n:{})})("versions",[]).push({version:"3.30.1",mode:e?"pure":"global",copyright:"© 2014-2023 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.30.1/LICENSE",source:"https://github.com/zloirock/core-js"})},9245:function(t,n,r){var e=r(2437),o=r(6862);t.exports=!!Object.getOwnPropertySymbols&&!o((function(){var t=Symbol();return!String(t)||!(Object(t)instanceof Symbol)||!Symbol.sham&&e&&e<41}))},6912:function(t,n,r){var e=r(8150),o=Math.max,i=Math.min;t.exports=function(t,n){var r=e(t);return r<0?o(r+n,0):i(r,n)}},6867:function(t,n,r){var e=r(79),o=r(8846);t.exports=function(t){return e(o(t))}},8150:function(t,n,r){var e=r(6614);t.exports=function(t){var n=+t;return n!=n||0===n?0:e(n)}},5319:function(t,n,r){var e=r(8150),o=Math.min;t.exports=function(t){return t>0?o(e(t),9007199254740991):0}},5151:function(t,n,r){var e=r(8846),o=Object;t.exports=function(t){return o(e(t))}},3926:function(t,n,r){var e=r(2797),o=r(1218),i=r(8898),u=r(8648),c=r(4946),a=r(2712),f=TypeError,s=a("toPrimitive");t.exports=function(t,n){if(!o(t)||i(t))return t;var r,a=u(t,s);if(a){if(void 0===n&&(n="default"),r=e(a,t,n),!o(r)||i(r))return r;throw f("Can't convert object to primitive value")}return void 0===n&&(n="number"),c(t,n)}},8113:function(t,n,r){var e=r(3926),o=r(8898);t.exports=function(t){var n=e(t,"string");return o(n)?n:n+""}},6927:function(t){var n=String;t.exports=function(t){try{return n(t)}catch(t){return"Object"}}},6303:function(t,n,r){var e=r(8087),o=0,i=Math.random(),u=e(1..toString);t.exports=function(t){return"Symbol("+(void 0===t?"":t)+")_"+u(++o+i,36)}},2696:function(t,n,r){var e=r(9245);t.exports=e&&!Symbol.sham&&"symbol"==typeof Symbol.iterator},3015:function(t,n,r){var e=r(7891),o=r(6862);t.exports=e&&o((function(){return 42!=Object.defineProperty((function(){}),"prototype",{value:42,writable:!1}).prototype}))},4665:function(t,n,r){var e=r(419),o=r(7373),i=e.WeakMap;t.exports=o(i)&&/native code/.test(String(i))},2712:function(t,n,r){var e=r(419),o=r(2017),i=r(2256),u=r(6303),c=r(9245),a=r(2696),f=e.Symbol,s=o("wks"),p=a?f.for||f:f&&f.withoutSetter||u;t.exports=function(t){return i(s,t)||(s[t]=c&&i(f,t)?f[t]:p("Symbol."+t)),s[t]}},9553:function(t,n,r){"use strict";var e=r(6867),o=r(7713),i=r(9047),u=r(1259),c=r(3567).f,a=r(5291),f=r(1439),s=r(4943),p=r(7891),l="Array Iterator",v=u.set,y=u.getterFor(l);t.exports=a(Array,"Array",(function(t,n){v(this,{type:l,target:e(t),index:0,kind:n})}),(function(){var t=y(this),n=t.target,r=t.kind,e=t.index++;return!n||e>=n.length?(t.target=void 0,f(void 0,!0)):f("keys"==r?e:"values"==r?n[e]:[e,n[e]],!1)}),"values");var b=i.Arguments=i.Array;if(o("keys"),o("values"),o("entries"),!s&&p&&"values"!==b.name)try{c(b,"name",{value:"values"})}catch(t){}}}]); \ No newline at end of file diff --git a/change_log.txt b/change_log.txt new file mode 100644 index 0000000..5ce6eda --- /dev/null +++ b/change_log.txt @@ -0,0 +1,7 @@ +### 1.1.0 | 2023-11-22 +- Added support for the Gravity Forms 2.8 form editor compact view. +- Updated the theme framework variables to be compatible with Gravity Forms 2.8. +- Fixed a bug where an invisible Turnstile field always fails validation in a Conversational Form. + +### 1.0.0 | 2023-06-21 +- All new! diff --git a/class-gf-turnstile.php b/class-gf-turnstile.php new file mode 100644 index 0000000..67fd313 --- /dev/null +++ b/class-gf-turnstile.php @@ -0,0 +1,811 @@ +is_gravityforms_supported() ) { + return; + } + + require_once 'includes/class-gf-field-turnstile.php'; + } + + /** + * Initialize required hooks for admin and theme. + * + * @since 1.0 + * + * @return void + */ + public function init() { + parent::init(); + + add_action( 'gform_get_form_filter', array( $this, 'add_ajax_script_to_form' ), 10, 2 ); + add_action( 'wp_enqueue_scripts', array( $this, 'handle_no_conflict' ), 999, 0 ); + add_action( 'wp_ajax_store_api_url', array( $this, 'store_api_url' ), 10, 0 ); + add_filter( 'gform_pre_validation', array( $this, 'move_turnstile_field_to_last' ), 999, 1 ); + add_filter( 'gform_validation', array( $this, 'reset_turnstile_field_position' ), 999, 1 ); + } + + /** + * Initialize AJAX functions. + * + * @since 1.0 + * + * @return void + */ + public function init_ajax() { + parent::init_ajax(); + + add_filter( 'gform_duplicate_field_link', array( $this, 'prevent_duplication' ) ); + } + + /** + * Initialize hooks required for admin. + * + * @since 1.0 + * + * @return void + */ + public function init_admin() { + parent::init_admin(); + + add_action( 'admin_footer', array( $this, 'localize_config_data' ), 10, 0 ); + add_action( 'gform_field_appearance_settings', array( $this, 'render_widget_theme_field_setting' ), 0, 1 ); + add_filter( 'gform_duplicate_field_link', array( $this, 'prevent_duplication' ) ); + } + + // -------------------------------------------------------------- + // # Assets ----------------------------------------------------- + // -------------------------------------------------------------- + + /*** + * Returns the styles to be enqueued. + * + * @since 1.1 + * + * @return array + */ + public function styles() { + $min = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG || isset( $_GET['gform_debug'] ) ? '' : '.min'; + + $styles = array( + array( + 'handle' => 'gform_turnstile_form_editor', + 'src' => $this->get_base_url() . "/assets/css/dist/admin{$min}.css", + 'version' => $this->_version, + 'enqueue' => array( + array( + 'admin_page' => array( 'form_editor' ), + ), + ), + ), + ); + + return array_merge( parent::styles(), $styles ); + + } + + /** + * Enqueue scripts for theme and admin. + * + * @since 1.0 + * + * @return array[] + */ + public function scripts() { + $enqueue_condition = ! is_admin() ? array( array( $this, 'frontend_script_callback' ) ) : array( array( $this, 'admin_script_callback' ) ); + $min = $this->get_min(); + $vendor_src = 'https://challenges.cloudflare.com/turnstile/v0/api.js'; + + if ( is_admin() ) { + $vendor_src = add_query_arg( array( 'render' => 'explicit' ), $vendor_src ); + } + + return array( + array( + 'handle' => 'gform_turnstile_vendor_script', + 'src' => $vendor_src, + 'version' => null, + 'deps' => array(), + 'in_footer' => true, + 'enqueue' => $enqueue_condition, + ), + array( + 'handle' => 'gform_turnstile_admin', + 'src' => trailingslashit( $this->get_base_url() ) . "assets/js/dist/scripts-admin{$min}.js", + 'version' => $this->_version, + 'deps' => array(), + 'in_footer' => true, + 'enqueue' => array( array( $this, 'admin_script_callback' ) ), + ), + array( + 'handle' => 'gform_turnstile_vendor_admin', + 'src' => trailingslashit( $this->get_base_url() ) . "assets/js/dist/vendor-admin{$min}.js", + 'version' => $this->_version, + 'deps' => array(), + 'in_footer' => true, + 'enqueue' => array( array( $this, 'admin_script_callback' ) ), + ), + ); + } + + /** + * Localize config data needed for turnstile admin. + * + * @since 1.0 + * + * @action admin_footer 10, 2 + * + * @return void + */ + public function localize_config_data() { + wp_localize_script( 'gform_turnstile_admin', 'gform_turnstile_config', array( + 'data' => array( + 'site_key' => $this->get_plugin_setting( 'site_key' ), + 'save_url_nonce' => wp_create_nonce( 'save_api_url' ), + ), + 'i18n' => array( + 'render_error' => esc_html__( 'There was an error rendering the field. This typically means your site key is incorrect. Please check your credentials and try again.', 'gravityformsturnstile' ), + 'unique_error' => esc_html__( 'Only one Turnstile field may be added to a form.', 'gravityformsturnstile' ), + ), + 'endpoints' => array( + 'save_url' => admin_url( 'admin-ajax.php?action=store_api_url' ), + ) + ) ); + } + + /** + * Determine if scripts should be enqueued on the frontend. + * + * @since 1.0 + * + * @param array $form The form being evaluated. + * + * @return bool + */ + public function frontend_script_callback( $form ) { + return $this->has_turnstile_field( $form ); + } + + /** + * Determine if scripts should be enqueued on admin. + * + * @since 1.0 + * + * @param array $form The form being evaluated. + * + * @return bool + */ + public function admin_script_callback( $form ) { + $page = rgget( 'page' ); + $subview = rgget( 'subview' ); + + if ( $page !== 'gf_edit_forms' && ( $page !== 'gf_settings' || $subview !== $this->_slug ) ) { + return false; + } + + return true; + } + + /** + * Register the plugin settings fields needed to render Turnstile. + * + * @since 1.0 + * + * @return array[] + */ + public function plugin_settings_fields() { + return array( + // Credentials group + array( + 'title' => esc_html__( 'Turnstile Credentials', 'gravityformsturnstile' ), + // translators: %1 is an opening tag, and %2 is a closing tag. %3 is a paragraph tag, and %4 and %5 are strong tags. %6 and %7 are opening and closing a tags. + 'description' => sprintf( esc_html__( 'To connect your site to Turnstile, create a site on your %1$sCloudflare Dashboard%2$s and enter the associated Site Key and Site Secret below.%3$s %4$sNote%5$s: the Turnstile API is %6$scurrently in beta%7$s and may change without notice.', 'gravityformsturnstile' ), '', '', '

', '', '', '', '' ), + 'fields' => array( + array( + 'name' => 'site_key', + 'type' => 'text', + 'label' => esc_html__( 'Site Key', 'gravityformsturnstile' ), + ), + array( + 'name' => 'site_secret', + 'type' => 'text', + 'label' => esc_html__( 'Site Secret', 'gravityformsturnstile' ), + ), + ), + ), + + // Options Group + array( + 'title' => esc_html__( 'Field Options', 'gravityformsturnstile' ), + 'description' => esc_html__( 'Choose between a Light or Dark theme to tailor the field\'s appearance to your website, or select Auto to allow the field to inherit its theme from the user\'s system.', 'gravityformsturnstile' ), + 'fields' => array( + array( + 'name' => 'theme', + 'label' => esc_html__( 'Theme', 'gravityformsturnstile' ), + 'type' => 'select', + 'default_value' => 'auto', + 'choices' => array( + array( + 'label' => __( 'Auto', 'gravityformsturnstile' ), + 'value' => 'auto', + ), + array( + 'label' => __( 'Light', 'gravityformsturnstile' ), + 'value' => 'light', + ), + array( + 'label' => __( 'Dark', 'gravityformsturnstile' ), + 'value' => 'dark', + ), + ) + ), + ), + ), + + // Preview group + array( + 'title' => esc_html__( 'Field Preview', 'gravityformsturnstile' ), + 'description' => '

' . esc_html__( 'Below is a preview of how the field will appear in your forms. If you see an error message, check your credentials and try again.', 'gravityformsturnstile' ) . '

' . esc_html__( 'Note: ', 'gravityformsturnstile' ) . '' . esc_html__( 'If your field is set to the "Invisible" type in Cloudflare, this preview will appear empty.', 'gravityformsturnstile' ), + 'dependency' => array( + 'live' => false, + 'fields' => array( + array( 'field' => 'site_key' ), + array( 'field' => 'site_secret' ), + ), + ), + 'fields' => array( + array( + 'name' => 'preview', + 'type' => 'html', + 'html' => array( $this, 'get_preview_html' ), + ), + ), + ), + ); + } + + /** + * Dequeue other captcha scripts if no-conflict is enabled. + * + * @since 1.0 + * + * @action wp_enqueue_scripts 999, 0 + * + * @return void + */ + public function handle_no_conflict() { + /** + * Allows users to enable a No-Conflict mode for turnstile, which dequeues any other popular captcha + * scripts to avoid conflicts. Should only be used at support's direction. + * + * Example: add_filter( 'gform_turnstile_enable_no_conflict', '__return_true' ); + * + * @since 1.0 + * + * @param bool $enabled Whether no-conflict is enabled. + * + * @return bool + */ + $enabled = apply_filters( 'gform_turnstile_enable_no_conflict', false ); + + if ( ! $enabled ) { + return; + } + + $this->log_debug( __METHOD__ . '(): Beginning Turnstile no-conflict process.' ); + + $scripts = wp_scripts(); + $urls_to_check = array( + 'google.com/recaptcha', + 'gstatic.com/recaptcha', + 'hcaptcha.com/1' + ); + + foreach ( $scripts->queue as $script ) { + $src = $scripts->registered[ $script ]->src; + + foreach ( $urls_to_check as $check ) { + if ( strpos( $src, $check ) === false ) { + continue; + } + + $this->log_debug( __METHOD__ . '(): Turnstile no-conflict is dequeueing script: ' . $script ); + + wp_deregister_script( $script ); + wp_dequeue_script( $script ); + } + } + } + + /** + * Store the API URL from the field preview for checking credentials on load. + * + * @since 1.0 + * + * @return void + */ + public function store_api_url() { + check_ajax_referer( 'save_api_url', 'secret' ); + + $url = filter_input( INPUT_POST, 'url', FILTER_SANITIZE_URL ); + + update_option( 'gf_turnstile_api_url', $url ); + + wp_send_json_success( array( 'url' => $url ) ); + } + + /** + * Moves the turnstile field to be the last field of the form. + * + * Turnstile field must be the last field to be validated, because if another field failed validation after turnstile passed, this means turnstile validation will run again during the next request, consuming the frontend verification token again, which should be verified only once. + * + * @since 1.0 + * + * @param array $form The current form being validated. + * + * @return array. + */ + public function move_turnstile_field_to_last( $form ) { + if ( ! $this->has_turnstile_field( $form ) ) { + return $form; + } + + $idx = null; + $fields = $form['fields']; + + foreach ( $fields as $i => $field ) { + if ( $field->type === 'turnstile' ) { + $form['turnstile_original_position'] = $i; + $idx = $i; + break; + } + } + + if ( is_null( $idx ) ) { + return $form; + } + + unset( $fields[ $idx ] ); + $fields[] = $field; + + $form['fields'] = $fields; + + return $form; + } + + /** + * Put the turnstile field back to its original position. + * + * We put the field at the end of the form fields array to make sure it gets validated after all other fields passed validation. + * If one of the fields fails validation we postpone sending a request to verify the turnstile token. + * + * @see GFTurnstile::move_turnstile_field_to_last() + * + * @since 1.0 + * + * @param array $validation_result the validation result after all the fields in the form have been validated. + * + * @return array The validation result that contains the form after resetting the turnstile position. + */ + public function reset_turnstile_field_position( $validation_result ) { + $form = $validation_result['form']; + + if ( ! $this->has_turnstile_field( $form ) ) { + return $validation_result; + } + + $field_position = $validation_result['form']['turnstile_original_position']; + unset( $form['turnstile_original_position'] ); + if ( $field_position !== 0 && ! $field_position ) { + return $validation_result; + } + + $fields = $form['fields']; + $turnstile_field = array_pop( $fields ); + + // Put the field back to its original index. + $fields = array_merge( + array_slice( + $fields, + 0, + $field_position + ), + array( $turnstile_field ), + array_slice( $fields, $field_position ) + ); + + $form['fields'] = $fields; + $validation_result['form'] = $form; + + return $validation_result; + } + + /** + * Checks if any of the form fields has failed validation so we can postpone turnstile validation to the next request if so. + * + * @param array $form The current form being validated. + * + * @return bool whether any of the form fields failed validation or not. + */ + public function form_has_errors( $form ) { + foreach ( $form['fields'] as $field ) { + if ( $field->failed_validation ) { + return true; + } + } + + return false; + } + + // -------------------------------------------------------------- + // # Markup ----------------------------------------------------- + // -------------------------------------------------------------- + + /** + * Get the HTML to display when previewing the widget on the settings page. + * + * @since 1.0 + * + * @return string + */ + public function get_preview_html() { + $key = $this->get_plugin_setting( 'site_key' ); + $secret = $this->get_plugin_setting( 'site_secret' ); + $theme = $this->get_plugin_setting( 'theme' ); + + if ( empty( $key ) || empty( $secret ) ) { + $this->log_debug( __METHOD__ . '(): Missing secret or key values, returning empty preview.' ); + return ''; + } + + return '

'; + } + + /** + * Render the setting field for choosing a Widget Theme. + * + * @since 1.0 + * + * @action gform_field_appearance_settings 0, 1 + * + * @param int $position The current position being rendered in the sidebar. + * + * @return void + */ + public function render_widget_theme_field_setting( $position ) { + if ( (int) $position !== 20 ) { + return; + } + + ?> +
  • + + +
  • + has_turnstile_field( $form ) ) { + return $form_string; + } + + ob_start(); ?> + + get_plugin_setting( 'site_key' ) ) || empty( $this->get_plugin_setting( 'site_secret' ) ) ) { + $this->log_debug( __METHOD__ . '(): Missing Turnstile credentials, aborting render.' ); + return false; + } + + // Static caching to avoid multiple calls. + static $server_response; + + if ( ! empty( $server_response ) ) { + return $server_response === 200; + } + + $api_url = get_option( 'gf_turnstile_api_url' ); + + // If we don't have an API URL stored for some reason, bail. + if ( empty( $api_url ) ) { + $this->log_debug( __METHOD__ . '(): No Turnstile API URL stored, aborting render.' ); + return false; + } + + $response = wp_remote_get( $api_url ); + + // Something went wrong with the request. + if ( is_wp_error( $response ) ) { + $this->log_debug( __METHOD__ . '(): Could not reach turnstile API server, aborting render.' ); + + return false; + } + + $server_response = (int) wp_remote_retrieve_response_code( $response ); + + // Invalid credentials will return a 400 when hitting the API endpoint. + return $server_response === 200; + } + + /** + * Determine if a given form has a turnstile field. + * + * @since 1.0 + * + * @param array $form The form being evaluated. + * + * @return bool + */ + public function has_turnstile_field( $form ) { + $fields = \GFAPI::get_fields_by_type( $form, array( 'turnstile' ) ); + + return ! empty( $fields ); + } + + /** + * Get the min string for enqueued assets. + * + * @since 1.0 + * + * @return string + */ + private function get_min() { + return defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG || isset( $_GET['gform_debug'] ) ? '' : '.min'; + } + + /** + * Return the plugin's icon for the plugin/form settings menu. + * + * @since 1.0 + * + * @return string + */ + public function get_menu_icon() { + return $this->is_gravityforms_supported( '2.7.8.1' ) ? 'gform-icon--cloudflare-turnstile' : file_get_contents( $this->get_base_path() . '/assets/img/cloudflare.svg' ); + } +} diff --git a/includes/class-gf-field-turnstile.php b/includes/class-gf-field-turnstile.php new file mode 100644 index 0000000..d7473ae --- /dev/null +++ b/includes/class-gf-field-turnstile.php @@ -0,0 +1,324 @@ +is_gravityforms_supported( '2.7.8.1' ) ? 'gform-icon--cloudflare-turnstile' : gf_turnstile()->get_base_url() . '/assets/img/cloudflare.svg'; + } + + /** + * Returns the field's form editor description. + * + * @since 1.0 + * + * @return string + */ + public function get_form_editor_field_description() { + return esc_attr__( 'Protects your form from spam submissions using Cloudflare\'s Turnstile system.', 'gravityformsturnstile' ); + } + + /** + * Get field settings in the form editor. + * + * @since 1.0 + * + * @return array + */ + public function get_form_editor_field_settings() { + return array( + 'error_message_setting', + 'turnstile_widget_theme_setting', + 'label_setting', + ); + } + + /** + * Get form editor button. + * + * @since 1.0 + * + * @return array + */ + public function get_form_editor_button() { + return array( + 'group' => 'advanced_fields', + 'text' => $this->get_form_editor_field_title(), + ); + } + + /** + * Returns the warning message to be displayed in the form editor sidebar. + * + * @since 1.1 + * + * @return string + */ + public function get_field_sidebar_messages() { + if ( ! empty( gf_turnstile()->get_plugin_setting( 'site_key' ) ) && ! empty( gf_turnstile()->get_plugin_setting( 'site_secret' ) ) ) { + return ''; + } + + // Translators: 1. Opening tag with link to the Forms > Settings > Cloudflare Turnstile page. 2. closing tag. + return sprintf( __( 'To use Turnstile you must configure the site and secret keys on the %1$sTurnstile Settings%2$s page.', 'gravityformsturnstile' ), "", '' ); + } + + /** + * Get the field input markup. + * + * @since 1.0 + * + * @return string + */ + public function field_input_markup() { + if ( ! $this->failed_validation && ! empty( $this->get_value_submission( array() ) ) ) { + return ''; + } + + $key = gf_turnstile()->get_plugin_setting( 'site_key' ); + $theme = $this->turnstileWidgetTheme; + + if ( empty( $theme ) ) { + $theme = gf_turnstile()->get_plugin_setting( 'theme' ); + } + + $div = '
    '; + + return sprintf( "
    %s
    ", $div ); + } + + /** + * Get field input. + * + * @since 1.0 + * + * @param array $form The Form Object currently being processed. + * @param array $value The field value. From default/dynamic population, $_POST, or a resumed incomplete submission. + * @param null|array $entry Null or the Entry Object currently being edited. + * + * @return string + */ + public function get_field_input( $form, $value = array(), $entry = null ) { + $response = $this->field_input_markup(); + + if ( $this->failed_validation ) { + $response .= sprintf( '
    %1$s
    ', $this->validation_message ); + } + + return $response; + } + + /** + * Returns the field markup; including field label, description, validation, and the form editor admin buttons. + * + * The {FIELD} placeholder will be replaced in GFFormDisplay::get_field_content with the markup returned by GF_Field::get_field_input(). + * + * @since 1.0 + * + * @param string|array $value The field value. From default/dynamic population, $_POST, or a resumed incomplete submission. + * @param bool $force_frontend_label Should the frontend label be displayed in the admin even if an admin label is configured. + * @param array $form The Form Object currently being processed. + * + * @return string + */ + public function get_field_content( $value, $force_frontend_label, $form ) { + $form_id = $form['id']; + $admin_buttons = $this->get_admin_buttons(); + $is_entry_detail = $this->is_entry_detail(); + $is_form_editor = $this->is_form_editor(); + $is_admin = $is_entry_detail || $is_form_editor || ( rgget( 'context' ) === 'edit' && ! empty( rgget( 'post_id' ) ) ); + $field_label = $this->get_field_label( $force_frontend_label, $value ); + $field_id = $is_admin || $form_id == 0 ? "input_{$this->id}" : 'input_' . $form_id . "_{$this->id}"; + $admin_hidden_markup = ( $this->visibility == 'hidden' ) ? $this->get_hidden_admin_markup() : ''; + $field_content = ! $is_admin ? '{FIELD}' : sprintf( "%s%s
    %s
    ", $admin_buttons, $admin_hidden_markup, $field_id, esc_html( $field_label ), $this->get_editor_field_content() ); + + if ( ! $is_admin && ! gf_turnstile()->has_valid_credentials() ) { + return null; + } + + return $field_content; + } + + private function get_editor_field_content() { + $site_key = gf_turnstile()->get_plugin_setting( 'site_key' ); + $site_secret = gf_turnstile()->get_plugin_setting( 'site_secret' ); + + if ( empty( $site_key ) || empty( $site_secret ) ) { + return "
    " . __( 'To use the Turnstile field you must do the following:', 'gravityforms' ) . "
    2 - " . sprintf( __( 'Enter your Turnstile site and secret keys in the %1$sTurnstile Settings%2$s.', 'gravityformsturnstile' ), "", '' ) . '
    '; + } + + $theme = empty( $this->turnstileWidgetTheme ) ? gf_turnstile()->get_plugin_setting( 'theme' ) : $this->turnstileWidgetTheme; + $preview = $theme === 'dark' ? 'preview-dark.svg' : 'preview-light.svg'; + + return sprintf( "", gf_turnstile()->get_base_url() . "/assets/img/{$preview}" ); + } + + /** + * Get the correct value to evaluate on submission. + * + * @since 1.0 + * + * @param array $field_values The current field values. + * @param bool $get_from_post_global_var Whether to draw value from POST + * + * @return mixed + */ + public function get_value_submission( $field_values, $get_from_post_global_var = true ) { + return rgpost( 'cf-turnstile-response' ); + } + + /** + * Validate the Turnstile field value. + * + * @since 1.0 + * + * @param string $value The current value. + * @param array $form The form being evaluated. + * + * @return void + */ + public function validate( $value, $form ) { + + // Don't validate until the form is submitted, or the validation will happen twice and fail as a duplicate. + if ( rgpost( 'action' ) === 'gfcf_validate_field' ) { + return; + } + + if ( ! gf_turnstile()->has_valid_credentials() ) { + gf_turnstile()->log_debug( __METHOD__ . '(): Invalid credentials detected. Not running validation.' ); + return; + } + + gf_turnstile()->log_debug( __METHOD__ . '(): Beginning Turnstile field validation with value: ' . $value ); + + $has_pages = \GFCommon::has_pages( $form ); + $target_page = rgpost( 'gform_target_page_number_' . $form['id'] ); + + if ( gf_turnstile()->form_has_errors( $form ) ) { + gf_turnstile()->log_debug( __METHOD__ . '(): Form failed validation, postpone Turnstile challenge.' ); + return; + } + + if ( $has_pages && (int) $target_page !== 0 && ! empty( $value ) ) { + gf_turnstile()->log_debug( __METHOD__ . '(): Turnstile field submitted as part of pagination request, deferring until submission.' ); + return; + } + + if ( empty( $value ) ) { + gf_turnstile()->log_debug( __METHOD__ . '(): Turnstile field was empty, failing validation.' ); + $this->failed_validation = true; + $this->validation_message = $this->errorMessage ? $this->errorMessage : __( 'Invalid Turnstile captcha response.', 'gravityformsturnstile' ); + return; + } + + $challenge_result = $this->make_turnstile_challenge( $value ); + + if ( $challenge_result ) { + gf_turnstile()->log_debug( __METHOD__ . '(): Turnstile challenge successfully passed validation.' ); + return; + } + + gf_turnstile()->log_debug( __METHOD__ . '(): Turnstile challenge failed validation.' ); + + $this->failed_validation = true; + $this->validation_message = $this->errorMessage ? $this->errorMessage :__( 'Invalid Turnstile captcha response.', 'gravityformsturnstile' ); + } + + /** + * Make a POST request to perform the Turnstile challenge. + * + * @since 1.0 + * + * @param string $value The submitted field value to verify. + * + * @return bool + */ + private function make_turnstile_challenge( $value ) { + $url = 'https://challenges.cloudflare.com/turnstile/v0/siteverify'; + $result = wp_remote_post( $url, array( + 'body' => array( + 'secret' => gf_turnstile()->get_plugin_setting( 'site_secret' ), + 'response' => $value, + 'remoteip' => $_SERVER['REMOTE_ADDR'], + ) + )); + + if ( is_wp_error( $result ) ) { + gf_turnstile()->log_debug( __METHOD__ . '(): Request to Turnstile encountered an error: ' . $result->get_error_message() ); + return false; + } + + if ( wp_remote_retrieve_response_code( $result ) !== 200 ) { + gf_turnstile()->log_debug( __METHOD__ . '(): Turnstile challenge API encountered a server error.' ); + return false; + } + + $body = json_decode( wp_remote_retrieve_body( $result ), true ); + + return $body['success'] == true; + } + + /** + * Set some defaults for the field via JS hooks. + * + * @since 1.0 + * + * @return string + */ + public function get_form_editor_inline_script_on_page_render() { + // set the default field label for the field + $script = sprintf( "function SetDefaultValues_%s(field) {field.label = '%s';}", $this->type, $this->get_form_editor_field_title() ) . PHP_EOL; + + return $script; + } +} + +GF_Fields::register( new GF_Field_Turnstile() ); diff --git a/languages/gravityformsturnstile.pot b/languages/gravityformsturnstile.pot new file mode 100644 index 0000000..855d01b --- /dev/null +++ b/languages/gravityformsturnstile.pot @@ -0,0 +1,134 @@ +# Copyright (C) 2023 Gravity Forms +# This file is distributed under the GPL-2.0+. +msgid "" +msgstr "" +"Project-Id-Version: Gravity Forms Cloudflare Turnstile Add-On 1.1.0\n" +"Report-Msgid-Bugs-To: https://gravityforms.com/support\n" +"Last-Translator: Gravity Forms \n" +"Language-Team: Gravity Forms \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"POT-Creation-Date: 2023-11-22T14:42:04+00:00\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"X-Generator: WP-CLI 2.8.1\n" +"X-Domain: gravityformsturnstile\n" + +#. Plugin Name of the plugin +msgid "Gravity Forms Cloudflare Turnstile Add-On" +msgstr "" + +#. Plugin URI of the plugin +#. Author URI of the plugin +msgid "https://gravityforms.com" +msgstr "" + +#. Description of the plugin +msgid "Integrates Gravity Forms with Turnstile, a reCAPTCHA replacement from Cloudflare." +msgstr "" + +#. Author of the plugin +msgid "Gravity Forms" +msgstr "" + +#: class-gf-turnstile.php:321 +msgid "There was an error rendering the field. This typically means your site key is incorrect. Please check your credentials and try again." +msgstr "" + +#: class-gf-turnstile.php:322 +msgid "Only one Turnstile field may be added to a form." +msgstr "" + +#: class-gf-turnstile.php:374 +msgid "Turnstile Credentials" +msgstr "" + +#. translators: %1 is an opening tag, and %2 is a closing tag. %3 is a paragraph tag, and %4 and %5 are strong tags. %6 and %7 are opening and closing a tags. +#: class-gf-turnstile.php:376 +msgid "To connect your site to Turnstile, create a site on your %1$sCloudflare Dashboard%2$s and enter the associated Site Key and Site Secret below.%3$s %4$sNote%5$s: the Turnstile API is %6$scurrently in beta%7$s and may change without notice." +msgstr "" + +#: class-gf-turnstile.php:381 +msgid "Site Key" +msgstr "" + +#: class-gf-turnstile.php:386 +msgid "Site Secret" +msgstr "" + +#: class-gf-turnstile.php:393 +msgid "Field Options" +msgstr "" + +#: class-gf-turnstile.php:394 +msgid "Choose between a Light or Dark theme to tailor the field's appearance to your website, or select Auto to allow the field to inherit its theme from the user's system." +msgstr "" + +#: class-gf-turnstile.php:398 +msgid "Theme" +msgstr "" + +#: class-gf-turnstile.php:403 +#: class-gf-turnstile.php:662 +msgid "Auto" +msgstr "" + +#: class-gf-turnstile.php:407 +#: class-gf-turnstile.php:663 +msgid "Light" +msgstr "" + +#: class-gf-turnstile.php:411 +#: class-gf-turnstile.php:664 +msgid "Dark" +msgstr "" + +#: class-gf-turnstile.php:421 +msgid "Field Preview" +msgstr "" + +#: class-gf-turnstile.php:422 +msgid "Below is a preview of how the field will appear in your forms. If you see an error message, check your credentials and try again." +msgstr "" + +#: class-gf-turnstile.php:422 +msgid "Note: " +msgstr "" + +#: class-gf-turnstile.php:422 +msgid "If your field is set to the \"Invisible\" type in Cloudflare, this preview will appear empty." +msgstr "" + +#: class-gf-turnstile.php:658 +msgid "Select a theme for this instance of the Turnstile field. This value will override the theme selected in your Cloudflare Turnstile plugin settings." +msgstr "" + +#: class-gf-turnstile.php:661 +msgid "Select a Theme" +msgstr "" + +#: includes/class-gf-field-turnstile.php:42 +msgid "Turnstile" +msgstr "" + +#: includes/class-gf-field-turnstile.php:66 +msgid "Protects your form from spam submissions using Cloudflare's Turnstile system." +msgstr "" + +#. Translators: 1. Opening tag with link to the Forms > Settings > Cloudflare Turnstile page. 2. closing tag. +#: includes/class-gf-field-turnstile.php:111 +msgid "To use Turnstile you must configure the site and secret keys on the %1$sTurnstile Settings%2$s page." +msgstr "" + +#: includes/class-gf-field-turnstile.php:195 +msgid "Create%s a Turnstile key pair for your site." +msgstr "" + +#: includes/class-gf-field-turnstile.php:195 +msgid "Enter your Turnstile site and secret keys in the %1$sTurnstile Settings%2$s." +msgstr "" + +#: includes/class-gf-field-turnstile.php:258 +#: includes/class-gf-field-turnstile.php:272 +msgid "Invalid Turnstile captcha response." +msgstr "" diff --git a/turnstile.php b/turnstile.php new file mode 100644 index 0000000..4060157 --- /dev/null +++ b/turnstile.php @@ -0,0 +1,76 @@ +