index of
/
home
/
thefkyzp
/
hulmvisaadvisor.com
/
wp-content
/
plugins
/
surecart
/
dist
/
File: /home/thefkyzp/hulmvisaadvisor.com/wp-content/plugins/surecart/dist/2578.js
"use strict";(self.webpackChunk_surecart_surecart=self.webpackChunk_surecart_surecart||[]).push([[2578],{448:function(e,n,r){r.d(n,{a:function(){return d},b:function(){return s},g:function(){return l}});var t=r(4942),o=r(885);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.Z)(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=Object.prototype.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 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(){r=r.call(e)},n:function(){var e=r.next();return a=e.done,e},e:function(e){u=!0,i=e},f:function(){try{a||null==r.return||r.return()}finally{if(u)throw i}}}}function c(e,n){(null==n||n>e.length)&&(n=e.length);for(var r=0,t=new 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.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],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){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(decodeURIComponent),t=(0,o.Z)(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());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}),{})}function d(){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(l(e),n),r=r.substr(0,t)),r+"?"+s(n)}},930:function(e,n,r){r.d(n,{a:function(){return $},h:function(){return X}});var t=r(5861),o=r(5987),i=r(885),a=r(4942),u=r(1284),c=r.n(u),s=r(448),l=["rest_route"],d=["path","url"],f=["url","path","data","parse"];function p(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 v(e,n);var r=Object.prototype.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)?v(e,n):void 0}}(e))||n&&e&&"number"==typeof e.length){r&&(e=r);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(){r=r.call(e)},n:function(){var e=r.next();return a=e.done,e},e:function(e){u=!0,i=e},f:function(){try{a||null==r.return||r.return()}finally{if(u)throw i}}}}function v(e,n){(null==n||n>e.length)&&(n=e.length);for(var r=0,t=new Array(n);r<n;r++)t[r]=e[r];return t}function h(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 w(e){for(var n=1;n<arguments.length;n++){var r=null!=arguments[n]?arguments[n]:{};n%2?h(Object(r),!0).forEach((function(n){(0,a.Z)(e,n,r[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):h(Object(r)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))}))}return e}var m=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(w(w({},e),{},{path:o}))};function y(e){for(var n,r="",t=Object.entries(e);n=t.shift();){var o=n,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],v=d[1];t.unshift(["".concat(u,"[").concat(f,"]"),v])}}catch(e){l.e(e)}finally{l.f()}}else void 0!==c&&(null===c&&(c=""),r+="&"+[u,c].map(encodeURIComponent).join("="))}return r.substr(1)}function b(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(decodeURIComponent),t=(0,i.Z)(r,2),o=t[0],a=t[1],u=void 0===a?"":a;return o&&function(e,n,r){for(var t=n.length,o=t-1,i=0;i<t;i++){var a=n[i];!a&&Array.isArray(e)&&(a=e.length.toString()),a=["__proto__","constructor","prototype"].includes(a)?a.toUpperCase():a;var u=!isNaN(Number(n[i+1]));e[a]=i===o?r: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]:"",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(b(e),n),r=r.substr(0,t)),r+"?"+y(n)}function O(e,n){return void 0!==function(e,n){return b(e)[n]}(e,n)}function j(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}function _(e,n){return Promise.resolve(n?e.body:new window.Response(JSON.stringify(e.body),{status:200,statusText:"OK",headers:e.headers}))}var x=function(e){return e.json?e.json():Promise.reject(e)},k=function(e){return function(e){if(!e)return{};var n=e.match(/<([^>]+)>; rel="next"/);return n?{next:n[1]}:{}}(e.headers.get("link")).next},P=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},A=function(){var e=(0,t.Z)(c().mark((function e(n,r){var t,i,a,u,s,l;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(P(n)){e.next=4;break}return e.abrupt("return",r(n));case 4:return e.next=6,$(w(w({},(f={per_page:100},void 0,void 0,p=(c=n).path,v=c.url,w(w({},(0,o.Z)(c,d)),{},{url:v&&g(v,f),path:p&&g(p,f)}))),{},{parse:!1}));case 6:return t=e.sent,e.next=9,x(t);case 9:if(i=e.sent,Array.isArray(i)){e.next=12;break}return e.abrupt("return",i);case 12:if(a=k(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,$(w(w({},n),{},{path:void 0,url:a,parse:!1}));case 19:return s=e.sent,e.next=22,x(s);case 22:l=e.sent,u=u.concat(l),a=k(s),e.next=16;break;case 27:return e.abrupt("return",u);case 28:case"end":return e.stop()}var c,f,p,v}),e)})));return function(_x,n){return e.apply(this,arguments)}}(),S=new Set(["PATCH","PUT","DELETE"]),E=function(e){var n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return n?204===e.status?null:e.json?e.json():Promise.reject(e):e},C=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}))},I=function(e){var n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return Promise.resolve(E(e,n)).catch((function(e){return T(e,n)}))};function T(e){var n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(!n)throw e;return C(e).then((function(e){var n={code:"unknown_error",message:wp.i18n.__("An unknown error occurred.")};throw e||n}))}var Z,D,U,M,R,N,L,F={Accept:"application/json, */*;q=0.1"},z={credentials:"include"},J=[function(e,n){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"})),n(e)},m,function(e,n){var r=e.method,t=void 0===r?"GET":r;return S.has(t.toUpperCase())&&(e=w(w({},e),{},{headers:w(w({},e.headers),{},{"X-HTTP-Method-Override":t,"Content-Type":"application/json"}),method:"POST"})),n(e)},A],G=function(e){if(e.status>=200&&e.status<300)return e;throw e},H=function(e){var n=e.url,r=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({},F),s),t&&(c=JSON.stringify(t),s["Content-Type"]="application/json"),window.fetch(n||r||window.location.href,w(w(w({},z),u),{},{body:c,headers:s})).then((function(e){return Promise.resolve(e).then(G).catch((function(e){return T(e,a)})).then((function(e){return I(e,a)}))}),(function(e){if(e&&"AbortError"===e.name)throw e;throw{code:"fetch_error",message:wp.i18n.__("You are probably offline.")}}))};function $(e){return J.reduceRight((function(e,n){return function(r){return n(r,e)}}),H)(e).catch((function(n){return"rest_cookie_invalid_nonce"!==n.code?Promise.reject(n):window.fetch($.nonceEndpoint).then(G).then((function(e){return e.text()})).then((function(n){return $.nonceMiddleware.nonce=n,$(e)}))}))}$.use=function(e){J.unshift(e)},$.setFetchHandler=function(e){H=e},$.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(w(w({},n),{},{headers:w(w({},o),{},{"X-WP-Nonce":e.nonce})}))};return n.nonce=e,n},$.createPreloadingMiddleware=function(e){var n=Object.fromEntries(Object.entries(e).map((function(e){var n=(0,i.Z)(e,2),r=n[0],t=n[1];return[j(r),t]})));return function(e,r){var t=e.parse,i=void 0===t||t,a=e.path;if(!a&&e.url){var u=b(e.url),c=u.rest_route,s=(0,o.Z)(u,l);"string"==typeof c&&(a=g(c,s))}if("string"!=typeof a)return r(e);var d=e.method||"GET",f=j(a);if("GET"===d&&n[f]){var p=n[f];return delete n[f],_(p,!!i)}if("OPTIONS"===d&&n[d]&&n[d][f]){var v=n[d][f];return delete n[d][f],_(v,!!i)}return r(e)}},$.createRootURLMiddleware=function(e){return function(n,r){return m(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(w(w({},n),{},{url:o}))}))}},$.fetchAllMiddleware=A,$.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(w(w({},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)})):T(n,e.parse)})).then((function(n){return I(n,e.parse)}))},$.fetchAllMiddleware=null,$.use($.createRootURLMiddleware((null===(D=null===(Z=null===window||void 0===window?void 0:window.parent)||void 0===Z?void 0:Z.scData)||void 0===D?void 0:D.root_url)||(null===(U=null===window||void 0===window?void 0:window.scData)||void 0===U?void 0:U.root_url))),(null===(M=null===window||void 0===window?void 0:window.scData)||void 0===M?void 0:M.nonce)&&($.nonceMiddleware=$.createNonceMiddleware(null===(R=null===window||void 0===window?void 0:window.scData)||void 0===R?void 0:R.nonce),$.use($.nonceMiddleware)),(null===(N=null===window||void 0===window?void 0:window.scData)||void 0===N?void 0:N.nonce_endpoint)&&($.nonceEndpoint=null===(L=null===window||void 0===window?void 0:window.scData)||void 0===L?void 0:L.nonce_endpoint),$.use((function(e,n){return e.path=(0,s.a)(e.path,{t:Date.now()}),n(e)}));var B=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}))},X=function(){var e=(0,t.Z)(c().mark((function e(n){var r;return c().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,B(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($.nonceEndpoint).then((function(e){if(e.status>=200&&e.status<300)return e;throw e})).then((function(e){return e.text()})).then((function(e){$.nonceMiddleware.nonce=e})));case 6:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}()},2578:function(e,n,r){r.r(n),r.d(n,{sc_downloads_list:function(){return d}});var t=r(5861),o=r(5671),i=r(3144),a=r(1284),u=r.n(a),c=r(8860),s=r(930),l=r(448),d=function(){function e(n){(0,o.Z)(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}var n;return(0,i.Z)(e,[{key:"downloadItem",value:(n=(0,t.Z)(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 n.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",{class:"purchase",part:"base",heading:wp.i18n.__("Downloads","surecart")},(0,c.h)("span",{slot:"heading"},(0,c.h)("slot",{name:"heading"},this.heading||wp.i18n.__("Downloads","surecart"))),(0,c.h)("sc-card",{"no-padding":!0},(0,c.h)("sc-stacked-list",null,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")))})))))}}]),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}"},4942:function(e,n,r){function t(e,n,r){return n in e?Object.defineProperty(e,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[n]=r,e}r.d(n,{Z:function(){return t}})},5987:function(e,n,r){r.d(n,{Z:function(){return o}});var t=r(3366);function o(e,n){if(null==e)return{};var r,o,i=(0,t.Z)(e,n);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(o=0;o<a.length;o++)r=a[o],n.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}},3366:function(e,n,r){function t(e,n){if(null==e)return{};var r,t,o={},i=Object.keys(e);for(t=0;t<i.length;t++)r=i[t],n.indexOf(r)>=0||(o[r]=e[r]);return o}r.d(n,{Z:function(){return t}})}}]);