index of
/
home
/
thefkyzp
/
hulmvisaadvisor.com
/
wp-content
/
plugins
/
surecart
/
dist
/
File: /home/thefkyzp/hulmvisaadvisor.com/wp-content/plugins/surecart/dist/9451.js
"use strict";(self.webpackChunk_surecart_surecart=self.webpackChunk_surecart_surecart||[]).push([[9451],{448:function(e,r,n){n.d(r,{a:function(){return d},b:function(){return s},g:function(){return l}});var t=n(4942),o=n(885);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.Z)(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=Object.prototype.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 t=0,o=function(){};return{s:o,n:function(){return t>=e.length?{done:!0}:{done:!1,value:e[t++]}},e:function(e){throw e},f:o}}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,a=!0,u=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){u=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function c(e,r){(null==r||r>e.length)&&(r=e.length);for(var n=0,t=new 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.Z)(i,2),c=a[0],s=a[1];if(Array.isArray(s)||s&&s.constructor===Object){var l,d=u(Object.entries(s).reverse());try{for(d.s();!(l=d.n()).done;){var f=(0,o.Z)(l.value,2),p=f[0],h=f[1];t.unshift(["".concat(c,"[").concat(p,"]"),h])}}catch(e){d.e(e)}finally{d.f()}}else void 0!==s&&(null===s&&(s=""),n+="&"+[c,s].map(encodeURIComponent).join("="))}return n.substr(1)}function l(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(decodeURIComponent),t=(0,o.Z)(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());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}),{})}function d(){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(l(e),r),n=n.substr(0,t)),n+"?"+s(r)}},930:function(e,r,n){n.d(r,{a:function(){return V},h:function(){return B}});var t=n(5861),o=n(5987),i=n(885),a=n(4942),u=n(1284),c=n.n(u),s=n(448),l=["rest_route"],d=["path","url"],f=["url","path","data","parse"];function p(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 h(e,r);var n=Object.prototype.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)?h(e,r):void 0}}(e))||r&&e&&"number"==typeof e.length){n&&(e=n);var t=0,o=function(){};return{s:o,n:function(){return t>=e.length?{done:!0}:{done:!1,value:e[t++]}},e:function(e){throw e},f:o}}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,a=!0,u=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){u=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function h(e,r){(null==r||r>e.length)&&(r=e.length);for(var n=0,t=new Array(r);n<r;n++)t[n]=e[n];return t}function v(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 w(e){for(var r=1;r<arguments.length;r++){var n=null!=arguments[r]?arguments[r]:{};r%2?v(Object(n),!0).forEach((function(r){(0,a.Z)(e,r,n[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):v(Object(n)).forEach((function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))}))}return e}var b=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(w(w({},e),{},{path:o}))};function m(e){for(var r,n="",t=Object.entries(e);r=t.shift();){var o=r,a=(0,i.Z)(o,2),u=a[0],c=a[1];if(Array.isArray(c)||c&&c.constructor===Object){var s,l=p(Object.entries(c).reverse());try{for(l.s();!(s=l.n()).done;){var d=(0,i.Z)(s.value,2),f=d[0],h=d[1];t.unshift(["".concat(u,"[").concat(f,"]"),h])}}catch(e){l.e(e)}finally{l.f()}}else void 0!==c&&(null===c&&(c=""),n+="&"+[u,c].map(encodeURIComponent).join("="))}return n.substr(1)}function y(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(decodeURIComponent),t=(0,i.Z)(n,2),o=t[0],a=t[1],u=void 0===a?"":a;return o&&function(e,r,n){for(var t=r.length,o=t-1,i=0;i<t;i++){var a=r[i];!a&&Array.isArray(e)&&(a=e.length.toString()),a=["__proto__","constructor","prototype"].includes(a)?a.toUpperCase():a;var u=!isNaN(Number(r[i+1]));e[a]=i===o?n:e[a]||(u?[]:{}),Array.isArray(e[a])&&!u&&(e[a]=w({},e[a])),e=e[a]}}(e,o.replace(/\]/g,"").split("["),u),e}),Object.create(null))}function g(){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(y(e),r),n=n.substr(0,t)),n+"?"+m(r)}function O(e,r){return void 0!==function(e,r){return y(e)[r]}(e,r)}function j(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}function _(e,r){return Promise.resolve(r?e.body:new window.Response(JSON.stringify(e.body),{status:200,statusText:"OK",headers:e.headers}))}var P=function(e){return e.json?e.json():Promise.reject(e)},x=function(e){return function(e){if(!e)return{};var r=e.match(/<([^>]+)>; rel="next"/);return r?{next:r[1]}:{}}(e.headers.get("link")).next},A=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},S=function(){var e=(0,t.Z)(c().mark((function e(r,n){var t,i,a,u,s,l;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(A(r)){e.next=4;break}return e.abrupt("return",n(r));case 4:return e.next=6,V(w(w({},(f={per_page:100},void 0,void 0,p=(c=r).path,h=c.url,w(w({},(0,o.Z)(c,d)),{},{url:h&&g(h,f),path:p&&g(p,f)}))),{},{parse:!1}));case 6:return t=e.sent,e.next=9,P(t);case 9:if(i=e.sent,Array.isArray(i)){e.next=12;break}return e.abrupt("return",i);case 12:if(a=x(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,V(w(w({},r),{},{path:void 0,url:a,parse:!1}));case 19:return s=e.sent,e.next=22,P(s);case 22:l=e.sent,u=u.concat(l),a=x(s),e.next=16;break;case 27:return e.abrupt("return",u);case 28:case"end":return e.stop()}var c,f,p,h}),e)})));return function(_x,r){return e.apply(this,arguments)}}(),k=new Set(["PATCH","PUT","DELETE"]),E=function(e){var r=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return r?204===e.status?null:e.json?e.json():Promise.reject(e):e},U=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}))},T=function(e){var r=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return Promise.resolve(E(e,r)).catch((function(e){return Z(e,r)}))};function Z(e){var r=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(!r)throw e;return U(e).then((function(e){var r={code:"unknown_error",message:wp.i18n.__("An unknown error occurred.")};throw e||r}))}var C,D,M,I,N,R,L,J={Accept:"application/json, */*;q=0.1"},$={credentials:"include"},H=[function(e,r){return"string"!=typeof e.url||O(e.url,"_locale")||(e.url=g(e.url,{_locale:"user"})),"string"!=typeof e.path||O(e.path,"_locale")||(e.path=g(e.path,{_locale:"user"})),r(e)},b,function(e,r){var n=e.method,t=void 0===n?"GET":n;return k.has(t.toUpperCase())&&(e=w(w({},e),{},{headers:w(w({},e.headers),{},{"X-HTTP-Method-Override":t,"Content-Type":"application/json"}),method:"POST"})),r(e)},S],F=function(e){if(e.status>=200&&e.status<300)return e;throw e},G=function(e){var r=e.url,n=e.path,t=e.data,i=e.parse,a=void 0===i||i,u=(0,o.Z)(e,f),c=e.body,s=e.headers;return s=w(w({},J),s),t&&(c=JSON.stringify(t),s["Content-Type"]="application/json"),window.fetch(r||n||window.location.href,w(w(w({},$),u),{},{body:c,headers:s})).then((function(e){return Promise.resolve(e).then(F).catch((function(e){return Z(e,a)})).then((function(e){return T(e,a)}))}),(function(e){if(e&&"AbortError"===e.name)throw e;throw{code:"fetch_error",message:wp.i18n.__("You are probably offline.")}}))};function V(e){return H.reduceRight((function(e,r){return function(n){return r(n,e)}}),G)(e).catch((function(r){return"rest_cookie_invalid_nonce"!==r.code?Promise.reject(r):window.fetch(V.nonceEndpoint).then(F).then((function(e){return e.text()})).then((function(r){return V.nonceMiddleware.nonce=r,V(e)}))}))}V.use=function(e){H.unshift(e)},V.setFetchHandler=function(e){G=e},V.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(w(w({},r),{},{headers:w(w({},o),{},{"X-WP-Nonce":e.nonce})}))};return r.nonce=e,r},V.createPreloadingMiddleware=function(e){var r=Object.fromEntries(Object.entries(e).map((function(e){var r=(0,i.Z)(e,2),n=r[0],t=r[1];return[j(n),t]})));return function(e,n){var t=e.parse,i=void 0===t||t,a=e.path;if(!a&&e.url){var u=y(e.url),c=u.rest_route,s=(0,o.Z)(u,l);"string"==typeof c&&(a=g(c,s))}if("string"!=typeof a)return n(e);var d=e.method||"GET",f=j(a);if("GET"===d&&r[f]){var p=r[f];return delete r[f],_(p,!!i)}if("OPTIONS"===d&&r[d]&&r[d][f]){var h=r[d][f];return delete r[d][f],_(h,!!i)}return n(e)}},V.createRootURLMiddleware=function(e){return function(r,n){return b(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(w(w({},r),{},{url:o}))}))}},V.fetchAllMiddleware=S,V.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(w(w({},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)})):Z(r,e.parse)})).then((function(r){return T(r,e.parse)}))},V.fetchAllMiddleware=null,V.use(V.createRootURLMiddleware((null===(D=null===(C=null===window||void 0===window?void 0:window.parent)||void 0===C?void 0:C.scData)||void 0===D?void 0:D.root_url)||(null===(M=null===window||void 0===window?void 0:window.scData)||void 0===M?void 0:M.root_url))),(null===(I=null===window||void 0===window?void 0:window.scData)||void 0===I?void 0:I.nonce)&&(V.nonceMiddleware=V.createNonceMiddleware(null===(N=null===window||void 0===window?void 0:window.scData)||void 0===N?void 0:N.nonce),V.use(V.nonceMiddleware)),(null===(R=null===window||void 0===window?void 0:window.scData)||void 0===R?void 0:R.nonce_endpoint)&&(V.nonceEndpoint=null===(L=null===window||void 0===window?void 0:window.scData)||void 0===L?void 0:L.nonce_endpoint),V.use((function(e,r){return e.path=(0,s.a)(e.path,{t:Date.now()}),r(e)}));var q=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}))},B=function(){var e=(0,t.Z)(c().mark((function e(r){var n;return c().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,q(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(V.nonceEndpoint).then((function(e){if(e.status>=200&&e.status<300)return e;throw e})).then((function(e){return e.text()})).then((function(e){V.nonceMiddleware.nonce=e})));case 6:case"end":return e.stop()}}),e)})));return function(r){return e.apply(this,arguments)}}()},9451:function(e,r,n){n.r(r),n.d(r,{sc_wordpress_password_edit:function(){return l}});var t=n(5861),o=n(5671),i=n(3144),a=n(1284),u=n.n(a),c=n(8860),s=n(930),l=function(){function e(r){(0,o.Z)(this,e),(0,c.r)(this,r),this.heading=void 0,this.successUrl=void 0,this.user=void 0,this.loading=void 0,this.error=void 0,this.enableValidation=!0}var r;return(0,i.Z)(e,[{key:"renderEmpty",value:function(){return(0,c.h)("slot",{name:"empty"},wp.i18n.__("User not found.","surecart"))}},{key:"validatePassword",value:function(e){return!!new RegExp("^(?=.*?[#?!@$%^&*-]).{6,}$").test(e)}},{key:"handleSubmit",value:(r=(0,t.Z)(u().mark((function e(r){var n,t;return u().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.loading=!0,this.error="",e.prev=2,e.next=5,r.target.getFormJson();case 5:return n=e.sent,t=n.password,e.next=9,(0,s.a)({path:"wp/v2/users/me",method:"PATCH",data:{password:t,meta:{default_password_nag:!1}}});case 9:this.successUrl?window.location.assign(this.successUrl):this.loading=!1,e.next=16;break;case 12:e.prev=12,e.t0=e.catch(2),this.error=(null===e.t0||void 0===e.t0?void 0:e.t0.message)||wp.i18n.__("Something went wrong","surecart"),this.loading=!1;case 16:case"end":return e.stop()}}),e,this,[[2,12]])}))),function(_x){return r.apply(this,arguments)})},{key:"render",value:function(){var e=this;return(0,c.h)("sc-dashboard-module",{class:"customer-details",error:this.error},(0,c.h)("span",{slot:"heading"},this.heading||wp.i18n.__("Update Password","surecart")," "),(0,c.h)("slot",{name:"end",slot:"end"}),(0,c.h)("sc-card",null,(0,c.h)("sc-form",{onScFormSubmit:function(r){return e.handleSubmit(r)}},(0,c.h)("sc-password",{enableValidation:this.enableValidation,label:wp.i18n.__("New Password","surecart"),name:"password",confirmation:!0,required:!0}),(0,c.h)("div",null,(0,c.h)("sc-button",{type:"primary",full:!0,submit:!0},wp.i18n.__("Update Password","surecart"))))),this.loading&&(0,c.h)("sc-block-ui",{spinner:!0}))}}]),e}();l.style=":host{display:block;position:relative}"},4942:function(e,r,n){function t(e,r,n){return r in e?Object.defineProperty(e,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[r]=n,e}n.d(r,{Z:function(){return t}})},5987:function(e,r,n){n.d(r,{Z:function(){return o}});var t=n(3366);function o(e,r){if(null==e)return{};var n,o,i=(0,t.Z)(e,r);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(o=0;o<a.length;o++)n=a[o],r.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}},3366:function(e,r,n){function t(e,r){if(null==e)return{};var n,t,o={},i=Object.keys(e);for(t=0;t<i.length;t++)n=i[t],r.indexOf(n)>=0||(o[n]=e[n]);return o}n.d(r,{Z:function(){return t}})}}]);