index of
/
home
/
thefkyzp
/
hulmvisaadvisor.com
/
wp-content
/
plugins
/
surecart
/
dist
/
File: /home/thefkyzp/hulmvisaadvisor.com/wp-content/plugins/surecart/dist/9450.js
"use strict";(self.webpackChunk_surecart_surecart=self.webpackChunk_surecart_surecart||[]).push([[9450],{9450:function(t,e,r){r.r(e),r.d(e,{sc_form:function(){return m}});var n=r(9062),a=r(5861),i=r(5671),o=r(3144),s=r(1284),u=r.n(s),c=r(8860);function f(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(t){if("string"==typeof t)return l(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?l(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,a=function(){};return{s:a,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:a}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,o=!0,s=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return o=t.done,t},e:function(t){s=!0,i=t},f:function(){try{o||null==r.return||r.return()}finally{if(s)throw i}}}}function l(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function h(t){var e=new FormData(t),r={};return e.forEach((function(t,e){r[e]=t})),r}var m=function(){function t(e){(0,i.Z)(this,t),(0,c.r)(this,e),this.scSubmit=(0,c.c)(this,"scSubmit",7),this.scFormSubmit=(0,c.c)(this,"scFormSubmit",7),this.scFormChange=(0,c.c)(this,"scFormChange",7),this.novalidate=!1}var e,r,s,l,m;return(0,o.Z)(t,[{key:"getFormData",value:(m=(0,a.Z)(u().mark((function t(){return u().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",new FormData(this.formElement));case 1:case"end":return t.stop()}}),t,this)}))),function(){return m.apply(this,arguments)})},{key:"getFormJson",value:(l=(0,a.Z)(u().mark((function t(){return u().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",h(this.formElement));case 1:case"end":return t.stop()}}),t,this)}))),function(){return l.apply(this,arguments)})},{key:"handleChange",value:(s=(0,a.Z)(u().mark((function t(){return u().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:this.scFormChange.emit(h(this.formElement));case 1:case"end":return t.stop()}}),t,this)}))),function(){return s.apply(this,arguments)})},{key:"submit",value:(r=(0,a.Z)(u().mark((function t(){return u().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",this.submitForm());case 1:case"end":return t.stop()}}),t,this)}))),function(){return r.apply(this,arguments)})},{key:"getFormControls",value:function(){return(0,n.Z)(this.form.querySelectorAll("*"))}},{key:"validate",value:(e=(0,a.Z)(u().mark((function t(){var e,r,n,a,i;return u().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e=this.getFormControls(),r=e.filter((function(t){return"function"==typeof t.reportValidity})),this.novalidate){t.next=25;break}n=f(r),t.prev=4,n.s();case 6:if((a=n.n()).done){t.next=17;break}if((i=a.value).offsetWidth||i.offsetHeight||i.getClientRects().length){t.next=10;break}return t.abrupt("continue",15);case 10:return t.next=12,i.reportValidity();case 12:if(t.sent){t.next=15;break}return t.abrupt("return",!1);case 15:t.next=6;break;case 17:t.next=22;break;case 19:t.prev=19,t.t0=t.catch(4),n.e(t.t0);case 22:return t.prev=22,n.f(),t.finish(22);case 25:return t.abrupt("return",!0);case 26:case"end":return t.stop()}}),t,this,[[4,19,22,25]])}))),function(){return e.apply(this,arguments)})},{key:"submitForm",value:function(){var t=document.createElement("button");this.formElement&&(t.type="submit",t.style.position="absolute",t.style.width="0",t.style.height="0",t.style.clip="rect(0 0 0 0)",t.style.clipPath="inset(50%)",t.style.overflow="hidden",t.style.whiteSpace="nowrap",this.formElement.append(t),t.click(),t.remove())}},{key:"render",value:function(){var t,e=this;return(0,c.h)("div",{part:"base",class:"form",role:"form"},(0,c.h)("form",{part:"form",ref:function(t){return e.formElement=t},class:"test",onSubmit:(t=(0,a.Z)(u().mark((function t(r){return u().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r.preventDefault(),t.next=3,e.validate();case 3:if(t.sent){t.next=6;break}return t.abrupt("return",!1);case 6:e.scSubmit.emit(),e.scFormSubmit.emit();case 8:case"end":return t.stop()}}),t)}))),function(_x){return t.apply(this,arguments)}),novalidate:this.novalidate},(0,c.h)("slot",null)))}},{key:"form",get:function(){return(0,c.a)(this)}}]),t}();m.style=":host{display:block}::slotted(*:not(:last-child)){margin-bottom:var(--sc-form-row-spacing, 0.75em)}::slotted(*:not(:last-child)).wp-block-spacer{margin-bottom:0}::slotted(*:focus-within),::slotted(*:active){position:relative;z-index:var(--sc-form-focus-within-z-index, auto);}"}}]);