index of
/
home
/
thefkyzp
/
hulmvisaadvisor.com
/
wp-content
/
plugins
/
surecart
/
dist
/
File: /home/thefkyzp/hulmvisaadvisor.com/wp-content/plugins/surecart/dist/4498.js
"use strict";(self.webpackChunk_surecart_surecart=self.webpackChunk_surecart_surecart||[]).push([[4498],{4805:function(e,n,r){r.d(n,{a:function(){return f},b:function(){return s},g:function(){return d}});var t=r(4467),o=r(296);function i(e,n){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(e);n&&(t=t.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),r.push.apply(r,t)}return r}function a(e){for(var n=1;n<arguments.length;n++){var r=null!=arguments[n]?arguments[n]:{};n%2?i(Object(r),!0).forEach((function(n){(0,t.A)(e,n,r[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):i(Object(r)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))}))}return e}function u(e,n){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,n){if(e){if("string"==typeof e)return c(e,n);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?c(e,n):void 0}}(e))||n&&e&&"number"==typeof e.length){r&&(e=r);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(){r=r.call(e)},n:function(){var e=r.next();return i=e.done,e},e:function(e){a=!0,o=e},f:function(){try{i||null==r.return||r.return()}finally{if(a)throw o}}}}function c(e,n){(null==n||n>e.length)&&(n=e.length);for(var r=0,t=Array(n);r<n;r++)t[r]=e[r];return t}function s(e){for(var n,r="",t=Object.entries(e);n=t.shift();){var i=n,a=(0,o.A)(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.A)(l.value,2),p=f[0],v=f[1];t.unshift(["".concat(c,"[").concat(p,"]"),v])}}catch(e){d.e(e)}finally{d.f()}}else void 0!==s&&(null===s&&(s=""),r+="&"+[c,s].map(encodeURIComponent).join("="))}return r.substr(1)}function l(e){try{return decodeURIComponent(e)}catch(n){return e}}function d(e){return(function(e){var n;try{n=new URL(e,"http://example.com").search.substring(1)}catch(e){}if(n)return n}(e)||"").replace(/\+/g,"%20").split("&").reduce((function(e,n){var r=n.split("=").filter(Boolean).map(l),t=(0,o.A)(r,2),i=t[0],u=t[1],c=void 0===u?"":u;return i&&function(e,n,r){for(var t=n.length,o=t-1,i=0;i<t;i++){var u=n[i];!u&&Array.isArray(e)&&(u=e.length.toString()),u=["__proto__","constructor","prototype"].includes(u)?u.toUpperCase():u;var c=!isNaN(Number(n[i+1]));e[u]=i===o?r: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 f(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",n=arguments.length>1?arguments[1]:void 0;if(!n||!Object.keys(n).length)return e;var r=e,t=e.indexOf("?");return-1!==t&&(n=Object.assign(d(e),n),r=r.substr(0,t)),r+"?"+s(n)}},3:function(e,n,r){r.d(n,{a:function(){return L},h:function(){return J}});var t=r(467),o=r(45),i=r(296),a=r(4467),u=r(9280),c=r.n(u),s=r(4805),l=r(3506),d=["rest_route"],f=["path","url"],p=["url","path","data","parse"];function v(e,n){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(e);n&&(t=t.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),r.push.apply(r,t)}return r}function h(e){for(var n=1;n<arguments.length;n++){var r=null!=arguments[n]?arguments[n]:{};n%2?v(Object(r),!0).forEach((function(n){(0,a.A)(e,n,r[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):v(Object(r)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))}))}return e}function w(e,n){return void 0!==(0,l.g)(e,n)}function m(e){var n=e.split("?"),r=n[1],t=n[0];return r?t+"?"+r.split("&").map((function(e){return e.split("=")})).map((function(e){return e.map(decodeURIComponent)})).sort((function(e,n){return e[0].localeCompare(n[0])})).map((function(e){return e.map(encodeURIComponent)})).map((function(e){return e.join("=")})).join("&"):t}var b=function(e,n){var r,t,o=e.path;return"string"==typeof e.namespace&&"string"==typeof e.endpoint&&(r=e.namespace.replace(/^\/|\/$/g,""),o=(t=e.endpoint.replace(/^\//,""))?r+"/"+t:r),delete e.namespace,delete e.endpoint,n(h(h({},e),{},{path:o}))};function y(e,n){return Promise.resolve(n?e.body:new window.Response(JSON.stringify(e.body),{status:200,statusText:"OK",headers:e.headers}))}var g=function(e){return e.json?e.json():Promise.reject(e)},_=function(e){return function(e){if(!e)return{};var n=e.match(/<([^>]+)>; rel="next"/);return n?{next:n[1]}:{}}(e.headers.get("link")).next},O=function(e){var n=!!e.path&&-1!==e.path.indexOf("per_page=-1"),r=!!e.url&&-1!==e.url.indexOf("per_page=-1");return n||r},j=function(){var e=(0,t.A)(c().mark((function e(n,r){var t,i,a,u,l,d;return c().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!1!==n.parse){e.next=2;break}return e.abrupt("return",r(n));case 2:if(O(n)){e.next=4;break}return e.abrupt("return",r(n));case 4:return e.next=6,L(h(h({},(p={per_page:100},void 0,void 0,v=(c=n).path,w=c.url,h(h({},(0,o.A)(c,f)),{},{url:w&&(0,s.a)(w,p),path:v&&(0,s.a)(v,p)}))),{},{parse:!1}));case 6:return t=e.sent,e.next=9,g(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,L(h(h({},n),{},{path:void 0,url:a,parse:!1}));case 19:return l=e.sent,e.next=22,g(l);case 22:d=e.sent,u=u.concat(d),a=_(l),e.next=16;break;case 27:return e.abrupt("return",u);case 28:case"end":return e.stop()}var c,p,v,w}),e)})));return function(_x,n){return e.apply(this,arguments)}}(),x=new Set(["PATCH","PUT","DELETE"]),k=function(e){var n=!(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,n)).catch((function(e){return P(e,n)}))};function P(e){if(arguments.length>1&&void 0!==arguments[1]&&!arguments[1])throw e;return function(e){var n={code:"invalid_json",message:wp.i18n.__("The response is not a valid JSON response.")};if(!e||!e.json)throw n;return e.json().catch((function(){throw n}))}(e).then((function(e){var n={code:"unknown_error",message:wp.i18n.__("An unknown error occurred.")};throw e||n}))}var A,E,S,T,C,D,I,M={Accept:"application/json, */*;q=0.1"},U={credentials:"include"},N=[function(e,n){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"})),n(e)},b,function(e,n){var r=e.method,t=void 0===r?"GET":r;return x.has(t.toUpperCase())&&(e=h(h({},e),{},{headers:h(h({},e.headers),{},{"X-HTTP-Method-Override":t,"Content-Type":"application/json"}),method:"POST"})),n(e)},j],R=function(e){if(e.status>=200&&e.status<300)return e;throw e},z=function(e){var n=e.url,r=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=h(h({},M),s),t&&(c=JSON.stringify(t),s["Content-Type"]="application/json"),window.fetch(n||r||window.location.href,h(h(h({},U),u),{},{body:c,headers:s})).then((function(e){return Promise.resolve(e).then(R).catch((function(e){return P(e,a)})).then((function(e){return k(e,a)}))}),(function(e){if(e&&"AbortError"===e.name)throw e;throw{code:"fetch_error",message:wp.i18n.__("You are probably offline.")}}))};function L(e){return N.reduceRight((function(e,n){return function(r){return n(r,e)}}),z)(e).catch((function(n){return"rest_cookie_invalid_nonce"!==n.code?Promise.reject(n):window.fetch(L.nonceEndpoint).then(R).then((function(e){return e.text()})).then((function(n){return L.nonceMiddleware.nonce=n,L(e)}))}))}L.use=function(e){N.unshift(e)},L.setFetchHandler=function(e){z=e},L.createNonceMiddleware=function(e){var n=function e(n,r){var t=n.headers,o=void 0===t?{}:t;for(var i in o)if("x-wp-nonce"===i.toLowerCase()&&o[i]===e.nonce)return r(n);return r(h(h({},n),{},{headers:h(h({},o),{},{"X-WP-Nonce":e.nonce})}))};return n.nonce=e,n},L.createPreloadingMiddleware=function(e){var n=Object.fromEntries(Object.entries(e).map((function(e){var n=(0,i.A)(e,2),r=n[0],t=n[1];return[m(r),t]})));return function(e,r){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,l=(0,o.A)(u,d);"string"==typeof c&&(a=(0,s.a)(c,l))}if("string"!=typeof a)return r(e);var f=e.method||"GET",p=m(a);if("GET"===f&&n[p]){var v=n[p];return delete n[p],y(v,!!i)}if("OPTIONS"===f&&n[f]&&n[f][p]){var h=n[f][p];return delete n[f][p],y(h,!!i)}return r(e)}},L.createRootURLMiddleware=function(e){return function(n,r){return b(n,(function(n){var t,o=n.url,i=n.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),r(h(h({},n),{},{url:o}))}))}},L.fetchAllMiddleware=j,L.mediaUploadMiddleware=function(e,n){if(!function(e){var n=!!e.method&&"POST"===e.method;return(!!e.path&&-1!==e.path.indexOf("/wp/v2/media")||!!e.url&&-1!==e.url.indexOf("/wp/v2/media"))&&n}(e))return n(e);var r=0,t=function e(t){return r++,n({path:"/wp/v2/media/".concat(t,"/post-process"),method:"POST",data:{action:"create-image-subsizes"},parse:!1}).catch((function(){return r<5?e(t):(n({path:"/wp/v2/media/".concat(t,"?force=true"),method:"DELETE"}),Promise.reject())}))};return n(h(h({},e),{},{parse:!1})).catch((function(n){var r=n.headers.get("x-wp-upload-attachment-id");return n.status>=500&&n.status<600&&r?t(r).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(n)})):P(n,e.parse)})).then((function(n){return k(n,e.parse)}))},L.createThemePreviewMiddleware=function(e){return function(n,r){if("string"==typeof n.url){var t=(0,l.g)(n.url,"wp_theme_preview");void 0===t?n.url=(0,s.a)(n.url,{wp_theme_preview:e}):""===t&&(n.url=(0,l.r)(n.url,"wp_theme_preview"))}if("string"==typeof n.path){var o=(0,l.g)(n.path,"wp_theme_preview");void 0===o?n.path=(0,s.a)(n.path,{wp_theme_preview:e}):""===o&&(n.path=(0,l.r)(n.path,"wp_theme_preview"))}return r(n)}},L.fetchAllMiddleware=null,L.use(L.createRootURLMiddleware((null===(E=null===(A=null===window||void 0===window?void 0:window.parent)||void 0===A?void 0:A.scData)||void 0===E?void 0:E.root_url)||(null===(S=null===window||void 0===window?void 0:window.scData)||void 0===S?void 0:S.root_url))),(null===(T=null===window||void 0===window?void 0:window.scData)||void 0===T?void 0:T.nonce)&&(L.nonceMiddleware=L.createNonceMiddleware(null===(C=null===window||void 0===window?void 0:window.scData)||void 0===C?void 0:C.nonce),L.use(L.nonceMiddleware)),(null===(D=null===window||void 0===window?void 0:window.scData)||void 0===D?void 0:D.nonce_endpoint)&&(L.nonceEndpoint=null===(I=null===window||void 0===window?void 0:window.scData)||void 0===I?void 0:I.nonce_endpoint),L.use((function(e,n){return e.path=(0,s.a)(e.path,{t:Date.now()}),n(e)})),L.use((function(e,n){var r=n(e);return r.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)})),r}));var F=function(e){var n={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 n;return e.json().catch((function(){throw n}))},J=function(){var e=(0,t.A)(c().mark((function e(n){var r;return c().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,F(n);case 2:if("rest_cookie_invalid_nonce"===(r=e.sent).code){e.next=5;break}throw r;case 5:return e.abrupt("return",window.fetch(L.nonceEndpoint).then((function(e){if(e.status>=200&&e.status<300)return e;throw e})).then((function(e){return e.text()})).then((function(e){L.nonceMiddleware.nonce=e})));case 6:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}()},3506:function(e,n,r){r.d(n,{g:function(){return o},r:function(){return i}});var t=r(4805);function o(e,n){return(0,t.g)(e)[n]}function i(e){var n=e.indexOf("?");if(-1===n)return e;for(var r=(0,t.g)(e),o=e.substr(0,n),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 r[e]}));var c=(0,t.b)(r);return c?o+"?"+c:o}},4498:function(e,n,r){r.r(n),r.d(n,{sc_downloads_list:function(){return d}});var t=r(467),o=r(3029),i=r(2901),a=r(9280),u=r.n(a),c=r(1346),s=r(3),l=r(4805),d=function(){return(0,i.A)((function e(n){(0,o.A)(this,e),(0,c.r)(this,n),this.renderFileExt=function(e){var n,r,t,o,i,a,u,s,l;if(null===(n=null==e?void 0:e.media)||void 0===n?void 0:n.filename)return null===(i=null===(o=null===(t=(r=e.media.filename).split)||void 0===t?void 0:t.call(r,"."))||void 0===o?void 0:o.pop)||void 0===i?void 0:i.call(o);if(null==e?void 0:e.url)try{var d=new URL(e.url);if(d.pathname.includes("."))return null===(l=null===(s=null===(u=(a=d.pathname).split)||void 0===u?void 0:u.call(a,"."))||void 0===s?void 0:s.pop)||void 0===l?void 0:l.call(s)}catch(e){console.error(e)}return(0,c.h)("sc-icon",{name:"file"})},this.downloads=void 0,this.customerId=void 0,this.heading=void 0,this.busy=void 0,this.error=void 0}),[{key:"downloadItem",value:(e=(0,t.A)(u().mark((function e(n){var r,t,o,i;return u().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(null==n?void 0:n.url)){e.next=3;break}return this.downloadFile(n.url,null!==(r=null==n?void 0:n.name)&&void 0!==r?r:"file"),e.abrupt("return");case 3:if(o=null===(t=null==n?void 0:n.media)||void 0===t?void 0:t.id){e.next=6;break}return e.abrupt("return");case 6:return e.prev=6,this.busy=o,e.next=10,(0,s.a)({path:(0,l.a)("surecart/v1/customers/".concat(this.customerId,"/expose/").concat(o),{expose_for:60})});case 10:if(null==(i=e.sent)?void 0:i.url){e.next=13;break}throw{message:wp.i18n.__("Could not download the file.","surecart")};case 13:this.downloadFile(null==i?void 0:i.url,i.filename),e.next=20;break;case 16:e.prev=16,e.t0=e.catch(6),console.error(e.t0),this.error=(null===e.t0||void 0===e.t0?void 0:e.t0.message)||wp.i18n.__("Something went wrong","surecart");case 20:return e.prev=20,this.busy=null,e.finish(20);case 23:case"end":return e.stop()}}),e,this,[[6,16,20,23]])}))),function(_x){return e.apply(this,arguments)})},{key:"downloadFile",value:function(e,n){var r=document.createElement("a");r.href=e,r.download=n,document.body.appendChild(r),r.click(),setTimeout((function(){document.body.removeChild(r)}),0)}},{key:"render",value:function(){var e=this,n=this.downloads||[];return(0,c.h)("sc-dashboard-module",{key:"7ef3dca046fbcd55ff81c5ab92f52b2dd8630f3b",class:"purchase",part:"base",heading:wp.i18n.__("Downloads","surecart")},(0,c.h)("span",{key:"d3d95afb070f1fb26319c1002d02e5d075e196f0",slot:"heading"},(0,c.h)("slot",{key:"c35e1ad0ffa901edab292c0f10c9bd489e406478",name:"heading"},this.heading||wp.i18n.__("Downloads","surecart"))),(0,c.h)("sc-card",{key:"8152d989ca16d8c791cb2fc5ace95d4211c56ad2","no-padding":!0},(0,c.h)("sc-stacked-list",{key:"413b8f5775ea4f611adf3e513f6b2941fed45ca1"},n.map((function(n){var r,t,o,i,a=null==n?void 0:n.media;return(0,c.h)("sc-stacked-list-row",{style:{"--columns":"1"}},(0,c.h)("sc-flex",{class:"single-download",justifyContent:"flex-start",alignItems:"center"},(0,c.h)("div",{class:"single-download__preview"},e.renderFileExt(n)),(0,c.h)("div",null,(0,c.h)("div",null,(0,c.h)("strong",null,null!==(t=null!==(r=null==a?void 0:a.filename)&&void 0!==r?r:null==n?void 0:n.name)&&void 0!==t?t:"")),(0,c.h)("sc-flex",{justifyContent:"flex-start",alignItems:"center",style:{gap:"0.5em"}},(null==a?void 0:a.byte_size)&&(0,c.h)("sc-format-bytes",{value:a.byte_size}),!!(null===(o=null==a?void 0:a.release_json)||void 0===o?void 0:o.version)&&(0,c.h)("sc-tag",{type:"primary",size:"small",style:{"--sc-tag-primary-background-color":"#f3e8ff","--sc-tag-primary-color":"#6b21a8"}},"v",null===(i=null==a?void 0:a.release_json)||void 0===i?void 0:i.version)))),(0,c.h)("sc-button",{size:"small",slot:"suffix",onClick:function(){return e.downloadItem(n)},busy:!!(null==a?void 0:a.id)&&e.busy==(null==a?void 0:a.id),disabled:!!(null==a?void 0:a.id)&&e.busy==(null==a?void 0:a.id)},wp.i18n.__("Download","surecart")))})))))}}]);var e}();d.style=":host{display:block}.purchase{display:flex;flex-direction:column;gap:var(--sc-spacing-large)}.single-download .single-download__preview{display:flex;align-items:center;justify-content:center;background:var(--sc-color-gray-200);border-radius:var(--sc-border-radius-small);height:4rem;min-width:4rem;width:4rem}"},45:function(e,n,r){r.d(n,{A:function(){return o}});var t=r(8587);function o(e,n){if(null==e)return{};var r,o,i=(0,t.A)(e,n);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(o=0;o<a.length;o++)r=a[o],n.indexOf(r)>=0||{}.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}},8587:function(e,n,r){function t(e,n){if(null==e)return{};var r={};for(var t in e)if({}.hasOwnProperty.call(e,t)){if(n.indexOf(t)>=0)continue;r[t]=e[t]}return r}r.d(n,{A:function(){return t}})}}]);