index of
/
home
/
thefkyzp
/
hulmvisaadvisor.com
/
wp-content
/
plugins
/
surecart
/
dist
/
File: /home/thefkyzp/hulmvisaadvisor.com/wp-content/plugins/surecart/dist/758.js
"use strict";(self.webpackChunk_surecart_surecart=self.webpackChunk_surecart_surecart||[]).push([[758],{4805:function(e,r,n){n.d(r,{a:function(){return l},b:function(){return s},g:function(){return f}});var t=n(4467),o=n(296);function i(e,r){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(e);r&&(t=t.filter((function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable}))),n.push.apply(n,t)}return n}function a(e){for(var r=1;r<arguments.length;r++){var n=null!=arguments[r]?arguments[r]:{};r%2?i(Object(n),!0).forEach((function(r){(0,t.A)(e,r,n[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):i(Object(n)).forEach((function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))}))}return e}function u(e,r){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,r){if(e){if("string"==typeof e)return c(e,r);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?c(e,r):void 0}}(e))||r&&e&&"number"==typeof e.length){n&&(e=n);var _n=0,t=function(){};return{s:t,n:function(){return _n>=e.length?{done:!0}:{done:!1,value:e[_n++]}},e:function(e){throw e},f:t}}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 o,i=!0,a=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return i=e.done,e},e:function(e){a=!0,o=e},f:function(){try{i||null==n.return||n.return()}finally{if(a)throw o}}}}function c(e,r){(null==r||r>e.length)&&(r=e.length);for(var n=0,t=Array(r);n<r;n++)t[n]=e[n];return t}function s(e){for(var r,n="",t=Object.entries(e);r=t.shift();){var i=r,a=(0,o.A)(i,2),c=a[0],s=a[1];if(Array.isArray(s)||s&&s.constructor===Object){var d,f=u(Object.entries(s).reverse());try{for(f.s();!(d=f.n()).done;){var l=(0,o.A)(d.value,2),p=l[0],h=l[1];t.unshift(["".concat(c,"[").concat(p,"]"),h])}}catch(e){f.e(e)}finally{f.f()}}else void 0!==s&&(null===s&&(s=""),n+="&"+[c,s].map(encodeURIComponent).join("="))}return n.substr(1)}function d(e){try{return decodeURIComponent(e)}catch(r){return e}}function f(e){return(function(e){var r;try{r=new URL(e,"http://example.com").search.substring(1)}catch(e){}if(r)return r}(e)||"").replace(/\+/g,"%20").split("&").reduce((function(e,r){var n=r.split("=").filter(Boolean).map(d),t=(0,o.A)(n,2),i=t[0],u=t[1],c=void 0===u?"":u;return i&&function(e,r,n){for(var t=r.length,o=t-1,i=0;i<t;i++){var u=r[i];!u&&Array.isArray(e)&&(u=e.length.toString()),u=["__proto__","constructor","prototype"].includes(u)?u.toUpperCase():u;var c=!isNaN(Number(r[i+1]));e[u]=i===o?n:e[u]||(c?[]:{}),Array.isArray(e[u])&&!c&&(e[u]=a({},e[u])),e=e[u]}}(e,i.replace(/\]/g,"").split("["),c),e}),Object.create(null))}function l(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",r=arguments.length>1?arguments[1]:void 0;if(!r||!Object.keys(r).length)return e;var n=e,t=e.indexOf("?");return-1!==t&&(r=Object.assign(f(e),r),n=n.substr(0,t)),n+"?"+s(r)}},3:function(e,r,n){n.d(r,{a:function(){return J},h:function(){return G}});var t=n(467),o=n(45),i=n(296),a=n(4467),u=n(9280),c=n.n(u),s=n(4805),d=n(3506),f=["rest_route"],l=["path","url"],p=["url","path","data","parse"];function h(e,r){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(e);r&&(t=t.filter((function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable}))),n.push.apply(n,t)}return n}function v(e){for(var r=1;r<arguments.length;r++){var n=null!=arguments[r]?arguments[r]:{};r%2?h(Object(n),!0).forEach((function(r){(0,a.A)(e,r,n[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):h(Object(n)).forEach((function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))}))}return e}function w(e,r){return void 0!==(0,d.g)(e,r)}function m(e){var r=e.split("?"),n=r[1],t=r[0];return n?t+"?"+n.split("&").map((function(e){return e.split("=")})).map((function(e){return e.map(decodeURIComponent)})).sort((function(e,r){return e[0].localeCompare(r[0])})).map((function(e){return e.map(encodeURIComponent)})).map((function(e){return e.join("=")})).join("&"):t}var g=function(e,r){var n,t,o=e.path;return"string"==typeof e.namespace&&"string"==typeof e.endpoint&&(n=e.namespace.replace(/^\/|\/$/g,""),o=(t=e.endpoint.replace(/^\//,""))?n+"/"+t:n),delete e.namespace,delete e.endpoint,r(v(v({},e),{},{path:o}))};function b(e,r){return Promise.resolve(r?e.body:new window.Response(JSON.stringify(e.body),{status:200,statusText:"OK",headers:e.headers}))}var y=function(e){return e.json?e.json():Promise.reject(e)},_=function(e){return function(e){if(!e)return{};var r=e.match(/<([^>]+)>; rel="next"/);return r?{next:r[1]}:{}}(e.headers.get("link")).next},O=function(e){var r=!!e.path&&-1!==e.path.indexOf("per_page=-1"),n=!!e.url&&-1!==e.url.indexOf("per_page=-1");return r||n},j=function(){var e=(0,t.A)(c().mark((function e(r,n){var t,i,a,u,d,f;return c().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!1!==r.parse){e.next=2;break}return e.abrupt("return",n(r));case 2:if(O(r)){e.next=4;break}return e.abrupt("return",n(r));case 4:return e.next=6,J(v(v({},(p={per_page:100},void 0,void 0,h=(c=r).path,w=c.url,v(v({},(0,o.A)(c,l)),{},{url:w&&(0,s.a)(w,p),path:h&&(0,s.a)(h,p)}))),{},{parse:!1}));case 6:return t=e.sent,e.next=9,y(t);case 9:if(i=e.sent,Array.isArray(i)){e.next=12;break}return e.abrupt("return",i);case 12:if(a=_(t)){e.next=15;break}return e.abrupt("return",i);case 15:u=[].concat(i);case 16:if(!a){e.next=27;break}return e.next=19,J(v(v({},r),{},{path:void 0,url:a,parse:!1}));case 19:return d=e.sent,e.next=22,y(d);case 22:f=e.sent,u=u.concat(f),a=_(d),e.next=16;break;case 27:return e.abrupt("return",u);case 28:case"end":return e.stop()}var c,p,h,w}),e)})));return function(_x,r){return e.apply(this,arguments)}}(),x=new Set(["PATCH","PUT","DELETE"]),P=function(e){var r=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return Promise.resolve(function(e){return arguments.length>1&&void 0!==arguments[1]&&!arguments[1]?e:204===e.status?null:e.json?e.json():Promise.reject(e)}(e,r)).catch((function(e){return A(e,r)}))};function A(e){if(arguments.length>1&&void 0!==arguments[1]&&!arguments[1])throw e;return function(e){var r={code:"invalid_json",message:wp.i18n.__("The response is not a valid JSON response.")};if(!e||!e.json)throw r;return e.json().catch((function(){throw r}))}(e).then((function(e){var r={code:"unknown_error",message:wp.i18n.__("An unknown error occurred.")};throw e||r}))}var k,S,E,T,D,I,M,C={Accept:"application/json, */*;q=0.1"},N={credentials:"include"},R=[function(e,r){return"string"!=typeof e.url||w(e.url,"_locale")||(e.url=(0,s.a)(e.url,{_locale:"user"})),"string"!=typeof e.path||w(e.path,"_locale")||(e.path=(0,s.a)(e.path,{_locale:"user"})),r(e)},g,function(e,r){var n=e.method,t=void 0===n?"GET":n;return x.has(t.toUpperCase())&&(e=v(v({},e),{},{headers:v(v({},e.headers),{},{"X-HTTP-Method-Override":t,"Content-Type":"application/json"}),method:"POST"})),r(e)},j],U=function(e){if(e.status>=200&&e.status<300)return e;throw e},L=function(e){var r=e.url,n=e.path,t=e.data,i=e.parse,a=void 0===i||i,u=(0,o.A)(e,p),c=e.body,s=e.headers;return s=v(v({},C),s),t&&(c=JSON.stringify(t),s["Content-Type"]="application/json"),window.fetch(r||n||window.location.href,v(v(v({},N),u),{},{body:c,headers:s})).then((function(e){return Promise.resolve(e).then(U).catch((function(e){return A(e,a)})).then((function(e){return P(e,a)}))}),(function(e){if(e&&"AbortError"===e.name)throw e;throw{code:"fetch_error",message:wp.i18n.__("You are probably offline.")}}))};function J(e){return R.reduceRight((function(e,r){return function(n){return r(n,e)}}),L)(e).catch((function(r){return"rest_cookie_invalid_nonce"!==r.code?Promise.reject(r):window.fetch(J.nonceEndpoint).then(U).then((function(e){return e.text()})).then((function(r){return J.nonceMiddleware.nonce=r,J(e)}))}))}J.use=function(e){R.unshift(e)},J.setFetchHandler=function(e){L=e},J.createNonceMiddleware=function(e){var r=function e(r,n){var t=r.headers,o=void 0===t?{}:t;for(var i in o)if("x-wp-nonce"===i.toLowerCase()&&o[i]===e.nonce)return n(r);return n(v(v({},r),{},{headers:v(v({},o),{},{"X-WP-Nonce":e.nonce})}))};return r.nonce=e,r},J.createPreloadingMiddleware=function(e){var r=Object.fromEntries(Object.entries(e).map((function(e){var r=(0,i.A)(e,2),n=r[0],t=r[1];return[m(n),t]})));return function(e,n){var t=e.parse,i=void 0===t||t,a=e.path;if(!a&&e.url){var u=(0,s.g)(e.url),c=u.rest_route,d=(0,o.A)(u,f);"string"==typeof c&&(a=(0,s.a)(c,d))}if("string"!=typeof a)return n(e);var l=e.method||"GET",p=m(a);if("GET"===l&&r[p]){var h=r[p];return delete r[p],b(h,!!i)}if("OPTIONS"===l&&r[l]&&r[l][p]){var v=r[l][p];return delete r[l][p],b(v,!!i)}return n(e)}},J.createRootURLMiddleware=function(e){return function(r,n){return g(r,(function(r){var t,o=r.url,i=r.path;return"string"==typeof i&&(t=e,-1!==e.indexOf("?")&&(i=i.replace("?","&")),i=i.replace(/^\//,""),"string"==typeof t&&-1!==t.indexOf("?")&&(i=i.replace("?","&")),o=t+i),n(v(v({},r),{},{url:o}))}))}},J.fetchAllMiddleware=j,J.mediaUploadMiddleware=function(e,r){if(!function(e){var r=!!e.method&&"POST"===e.method;return(!!e.path&&-1!==e.path.indexOf("/wp/v2/media")||!!e.url&&-1!==e.url.indexOf("/wp/v2/media"))&&r}(e))return r(e);var n=0,t=function e(t){return n++,r({path:"/wp/v2/media/".concat(t,"/post-process"),method:"POST",data:{action:"create-image-subsizes"},parse:!1}).catch((function(){return n<5?e(t):(r({path:"/wp/v2/media/".concat(t,"?force=true"),method:"DELETE"}),Promise.reject())}))};return r(v(v({},e),{},{parse:!1})).catch((function(r){var n=r.headers.get("x-wp-upload-attachment-id");return r.status>=500&&r.status<600&&n?t(n).catch((function(){return!1!==e.parse?Promise.reject({code:"post_process",message:wp.i18n.__("Media upload failed. If this is a photo or a large image, please scale it down and try again.")}):Promise.reject(r)})):A(r,e.parse)})).then((function(r){return P(r,e.parse)}))},J.createThemePreviewMiddleware=function(e){return function(r,n){if("string"==typeof r.url){var t=(0,d.g)(r.url,"wp_theme_preview");void 0===t?r.url=(0,s.a)(r.url,{wp_theme_preview:e}):""===t&&(r.url=(0,d.r)(r.url,"wp_theme_preview"))}if("string"==typeof r.path){var o=(0,d.g)(r.path,"wp_theme_preview");void 0===o?r.path=(0,s.a)(r.path,{wp_theme_preview:e}):""===o&&(r.path=(0,d.r)(r.path,"wp_theme_preview"))}return n(r)}},J.fetchAllMiddleware=null,J.use(J.createRootURLMiddleware((null===(S=null===(k=null===window||void 0===window?void 0:window.parent)||void 0===k?void 0:k.scData)||void 0===S?void 0:S.root_url)||(null===(E=null===window||void 0===window?void 0:window.scData)||void 0===E?void 0:E.root_url))),(null===(T=null===window||void 0===window?void 0:window.scData)||void 0===T?void 0:T.nonce)&&(J.nonceMiddleware=J.createNonceMiddleware(null===(D=null===window||void 0===window?void 0:window.scData)||void 0===D?void 0:D.nonce),J.use(J.nonceMiddleware)),(null===(I=null===window||void 0===window?void 0:window.scData)||void 0===I?void 0:I.nonce_endpoint)&&(J.nonceEndpoint=null===(M=null===window||void 0===window?void 0:window.scData)||void 0===M?void 0:M.nonce_endpoint),J.use((function(e,r){return e.path=(0,s.a)(e.path,{t:Date.now()}),r(e)})),J.use((function(e,r){var n=r(e);return n.catch((function(e){return"invalid_json"===e.code&&(e.message=wp.i18n.__("The response is not a valid JSON response.","surecart"),e.additional_errors=[{code:"invalid_json",message:wp.i18n.sprintf(/* translators: %s: URL to debug settings page */ wp.i18n.__("Please ensure that your site is not in debug mode as this may interfere with API responses. %s","surecart"),'<a href="'.concat("https://surecart.com/docs/is-not-a-valid-json-response/",'" target="_blank" rel="noopener noreferrer">').concat(wp.i18n.__("More Information","surecart"),"</a>"))}]),"checkout.finalize_error"===e.code&&(e.additional_errors=[{code:"checkout.finalize_error",message:e.message}],e.message=wp.i18n.__("We were not able to process this order","surecart")),Promise.reject(e)})),n}));var z=function(e){var r={code:"invalid_json",message:wp.i18n.__("The response is not a valid JSON response.","surecart")};if((null==e?void 0:e.code)&&(null==e?void 0:e.message))throw e;if(!e||!e.json)throw r;return e.json().catch((function(){throw r}))},G=function(){var e=(0,t.A)(c().mark((function e(r){var n;return c().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,z(r);case 2:if("rest_cookie_invalid_nonce"===(n=e.sent).code){e.next=5;break}throw n;case 5:return e.abrupt("return",window.fetch(J.nonceEndpoint).then((function(e){if(e.status>=200&&e.status<300)return e;throw e})).then((function(e){return e.text()})).then((function(e){J.nonceMiddleware.nonce=e})));case 6:case"end":return e.stop()}}),e)})));return function(r){return e.apply(this,arguments)}}()},2942:function(e,r,n){n.d(r,{o:function(){return t}});var t=function(e,r){new window.IntersectionObserver((function(e,n){e[0].intersectionRatio>0&&(r(),n.unobserve(e[0].target))})).observe(e)}},3506:function(e,r,n){n.d(r,{g:function(){return o},r:function(){return i}});var t=n(4805);function o(e,r){return(0,t.g)(e)[r]}function i(e){var r=e.indexOf("?");if(-1===r)return e;for(var n=(0,t.g)(e),o=e.substr(0,r),i=arguments.length,a=new Array(i>1?i-1:0),u=1;u<i;u++)a[u-1]=arguments[u];a.forEach((function(e){return delete n[e]}));var c=(0,t.b)(n);return c?o+"?"+c:o}},758:function(e,r,n){n.r(r),n.d(r,{sc_dashboard_customer_details:function(){return l}});var t=n(467),o=n(3029),i=n(2901),a=n(9280),u=n.n(a),c=n(1346),s=n(3),d=n(2942),f=n(4805),l=function(){return(0,i.A)((function e(r){(0,o.A)(this,e),(0,c.r)(this,r),this.customerId=void 0,this.heading=void 0,this.customer=void 0,this.loading=void 0,this.error=void 0}),[{key:"componentWillLoad",value:function(){var e=this;(0,d.o)(this.el,(function(){e.fetch()}))}},{key:"fetch",value:(e=(0,t.A)(u().mark((function e(){return u().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(""!==this.customerId){e.next=2;break}return e.abrupt("return");case 2:return e.prev=2,this.loading=!0,e.next=6,(0,s.a)({path:(0,f.a)("surecart/v1/customers/".concat(this.customerId),{expand:["shipping_address","billing_address","tax_identifier"]})});case 6:return e.next=8,e.sent;case 8:this.customer=e.sent,e.next=15;break;case 11:e.prev=11,e.t0=e.catch(2),(null===e.t0||void 0===e.t0?void 0:e.t0.message)?this.error=e.t0.message:this.error=wp.i18n.__("Something went wrong","surecart"),console.error(this.error);case 15:return e.prev=15,this.loading=!1,e.finish(15);case 18:case"end":return e.stop()}}),e,this,[[2,11,15,18]])}))),function(){return e.apply(this,arguments)})},{key:"render",value:function(){return(0,c.h)("sc-customer-details",{key:"1896331a0ec0570d43006588d70ed8bfa9d85b99",customer:this.customer,loading:this.loading,error:this.error,heading:this.heading,"edit-link":(0,f.a)(window.location.href,{action:"edit",model:"customer",id:this.customerId})})}},{key:"el",get:function(){return(0,c.a)(this)}}]);var e}();l.style=":host{display:block;position:relative}.customer-details{display:grid;gap:0.75em}"},45:function(e,r,n){n.d(r,{A:function(){return o}});var t=n(8587);function o(e,r){if(null==e)return{};var n,o,i=(0,t.A)(e,r);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(o=0;o<a.length;o++)n=a[o],r.indexOf(n)>=0||{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}},8587:function(e,r,n){function t(e,r){if(null==e)return{};var n={};for(var t in e)if({}.hasOwnProperty.call(e,t)){if(r.indexOf(t)>=0)continue;n[t]=e[t]}return n}n.d(r,{A:function(){return t}})}}]);