index of
/
home
/
thefkyzp
/
hulmvisaadvisor.com
/
wp-content
/
plugins
/
surecart
/
dist
/
File: /home/thefkyzp/hulmvisaadvisor.com/wp-content/plugins/surecart/dist/1399.js
"use strict";(self.webpackChunk_surecart_surecart=self.webpackChunk_surecart_surecart||[]).push([[1399],{448:function(e,t,r){r.d(t,{a:function(){return f},b:function(){return s},g:function(){return l}});var n=r(4942),o=r(885);function i(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function a(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?i(Object(r),!0).forEach((function(t){(0,n.Z)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):i(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function u(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(e){if("string"==typeof e)return c(e,t);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,t):void 0}}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,o=function(){};return{s:o,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},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,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function s(e){for(var t,r="",n=Object.entries(e);t=n.shift();){var i=t,a=(0,o.Z)(i,2),c=a[0],s=a[1];if(Array.isArray(s)||s&&s.constructor===Object){var l,f=u(Object.entries(s).reverse());try{for(f.s();!(l=f.n()).done;){var p=(0,o.Z)(l.value,2),d=p[0],h=p[1];n.unshift(["".concat(c,"[").concat(d,"]"),h])}}catch(e){f.e(e)}finally{f.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 t;try{t=new URL(e,"http://example.com").search.substring(1)}catch(e){}if(t)return t}(e)||"").replace(/\+/g,"%20").split("&").reduce((function(e,t){var r=t.split("=").filter(Boolean).map(decodeURIComponent),n=(0,o.Z)(r,2),i=n[0],u=n[1],c=void 0===u?"":u;return i&&function(e,t,r){for(var n=t.length,o=n-1,i=0;i<n;i++){var u=t[i];!u&&Array.isArray(e)&&(u=e.length.toString());var c=!isNaN(Number(t[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 f(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1?arguments[1]:void 0;if(!t||!Object.keys(t).length)return e;var r=e,n=e.indexOf("?");return-1!==n&&(t=Object.assign(l(e),t),r=r.substr(0,n)),r+"?"+s(t)}},930:function(e,t,r){r.d(t,{a:function(){return G},h:function(){return $}});var n=r(5861),o=r(5987),i=r(885),a=r(4942),u=r(1284),c=r.n(u),s=r(448),l=["rest_route"],f=["path","url"],p=["url","path","data","parse"];function d(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(e){if("string"==typeof e)return h(e,t);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)?h(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,o=function(){};return{s:o,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},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 h(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function v(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function w(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?v(Object(r),!0).forEach((function(t){(0,a.Z)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):v(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var g=function(e,t){var r,n,o=e.path;return"string"==typeof e.namespace&&"string"==typeof e.endpoint&&(r=e.namespace.replace(/^\/|\/$/g,""),o=(n=e.endpoint.replace(/^\//,""))?r+"/"+n:r),delete e.namespace,delete e.endpoint,t(w(w({},e),{},{path:o}))};function y(e){for(var t,r="",n=Object.entries(e);t=n.shift();){var o=t,a=(0,i.Z)(o,2),u=a[0],c=a[1];if(Array.isArray(c)||c&&c.constructor===Object){var s,l=d(Object.entries(c).reverse());try{for(l.s();!(s=l.n()).done;){var f=(0,i.Z)(s.value,2),p=f[0],h=f[1];n.unshift(["".concat(u,"[").concat(p,"]"),h])}}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 t;try{t=new URL(e,"http://example.com").search.substring(1)}catch(e){}if(t)return t}(e)||"").replace(/\+/g,"%20").split("&").reduce((function(e,t){var r=t.split("=").filter(Boolean).map(decodeURIComponent),n=(0,i.Z)(r,2),o=n[0],a=n[1],u=void 0===a?"":a;return o&&function(e,t,r){for(var n=t.length,o=n-1,i=0;i<n;i++){var a=t[i];!a&&Array.isArray(e)&&(a=e.length.toString()),a=["__proto__","constructor","prototype"].includes(a)?a.toUpperCase():a;var u=!isNaN(Number(t[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 m(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1?arguments[1]:void 0;if(!t||!Object.keys(t).length)return e;var r=e,n=e.indexOf("?");return-1!==n&&(t=Object.assign(b(e),t),r=r.substr(0,n)),r+"?"+y(t)}function O(e,t){return void 0!==function(e,t){return b(e)[t]}(e,t)}function j(e){var t=e.split("?"),r=t[1],n=t[0];return r?n+"?"+r.split("&").map((function(e){return e.split("=")})).map((function(e){return e.map(decodeURIComponent)})).sort((function(e,t){return e[0].localeCompare(t[0])})).map((function(e){return e.map(encodeURIComponent)})).map((function(e){return e.join("=")})).join("&"):n}function _(e,t){return Promise.resolve(t?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 t=e.match(/<([^>]+)>; rel="next"/);return t?{next:t[1]}:{}}(e.headers.get("link")).next},k=function(e){var t=!!e.path&&-1!==e.path.indexOf("per_page=-1"),r=!!e.url&&-1!==e.url.indexOf("per_page=-1");return t||r},S=function(){var e=(0,n.Z)(c().mark((function e(t,r){var n,i,a,u,s,l;return c().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!1!==t.parse){e.next=2;break}return e.abrupt("return",r(t));case 2:if(k(t)){e.next=4;break}return e.abrupt("return",r(t));case 4:return e.next=6,G(w(w({},(p={per_page:100},void 0,void 0,d=(c=t).path,h=c.url,w(w({},(0,o.Z)(c,f)),{},{url:h&&m(h,p),path:d&&m(d,p)}))),{},{parse:!1}));case 6:return n=e.sent,e.next=9,P(n);case 9:if(i=e.sent,Array.isArray(i)){e.next=12;break}return e.abrupt("return",i);case 12:if(a=x(n)){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,G(w(w({},t),{},{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,p,d,h}),e)})));return function(_x,t){return e.apply(this,arguments)}}(),A=new Set(["PATCH","PUT","DELETE"]),I=function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return t?204===e.status?null:e.json?e.json():Promise.reject(e):e},Z=function(e){var t={code:"invalid_json",message:wp.i18n.__("The response is not a valid JSON response.")};if(!e||!e.json)throw t;return e.json().catch((function(){throw t}))},E=function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return Promise.resolve(I(e,t)).catch((function(e){return D(e,t)}))};function D(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(!t)throw e;return Z(e).then((function(e){var t={code:"unknown_error",message:wp.i18n.__("An unknown error occurred.")};throw e||t}))}var T,C,N,M,U,R,q,L={Accept:"application/json, */*;q=0.1"},J={credentials:"include"},W=[function(e,t){return"string"!=typeof e.url||O(e.url,"_locale")||(e.url=m(e.url,{_locale:"user"})),"string"!=typeof e.path||O(e.path,"_locale")||(e.path=m(e.path,{_locale:"user"})),t(e)},g,function(e,t){var r=e.method,n=void 0===r?"GET":r;return A.has(n.toUpperCase())&&(e=w(w({},e),{},{headers:w(w({},e.headers),{},{"X-HTTP-Method-Override":n,"Content-Type":"application/json"}),method:"POST"})),t(e)},S],X=function(e){if(e.status>=200&&e.status<300)return e;throw e},F=function(e){var t=e.url,r=e.path,n=e.data,i=e.parse,a=void 0===i||i,u=(0,o.Z)(e,p),c=e.body,s=e.headers;return s=w(w({},L),s),n&&(c=JSON.stringify(n),s["Content-Type"]="application/json"),window.fetch(t||r||window.location.href,w(w(w({},J),u),{},{body:c,headers:s})).then((function(e){return Promise.resolve(e).then(X).catch((function(e){return D(e,a)})).then((function(e){return E(e,a)}))}),(function(e){if(e&&"AbortError"===e.name)throw e;throw{code:"fetch_error",message:wp.i18n.__("You are probably offline.")}}))};function G(e){return W.reduceRight((function(e,t){return function(r){return t(r,e)}}),F)(e).catch((function(t){return"rest_cookie_invalid_nonce"!==t.code?Promise.reject(t):window.fetch(G.nonceEndpoint).then(X).then((function(e){return e.text()})).then((function(t){return G.nonceMiddleware.nonce=t,G(e)}))}))}G.use=function(e){W.unshift(e)},G.setFetchHandler=function(e){F=e},G.createNonceMiddleware=function(e){var t=function e(t,r){var n=t.headers,o=void 0===n?{}:n;for(var i in o)if("x-wp-nonce"===i.toLowerCase()&&o[i]===e.nonce)return r(t);return r(w(w({},t),{},{headers:w(w({},o),{},{"X-WP-Nonce":e.nonce})}))};return t.nonce=e,t},G.createPreloadingMiddleware=function(e){var t=Object.fromEntries(Object.entries(e).map((function(e){var t=(0,i.Z)(e,2),r=t[0],n=t[1];return[j(r),n]})));return function(e,r){var n=e.parse,i=void 0===n||n,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=m(c,s))}if("string"!=typeof a)return r(e);var f=e.method||"GET",p=j(a);if("GET"===f&&t[p]){var d=t[p];return delete t[p],_(d,!!i)}if("OPTIONS"===f&&t[f]&&t[f][p]){var h=t[f][p];return delete t[f][p],_(h,!!i)}return r(e)}},G.createRootURLMiddleware=function(e){return function(t,r){return g(t,(function(t){var n,o=t.url,i=t.path;return"string"==typeof i&&(n=e,-1!==e.indexOf("?")&&(i=i.replace("?","&")),i=i.replace(/^\//,""),"string"==typeof n&&-1!==n.indexOf("?")&&(i=i.replace("?","&")),o=n+i),r(w(w({},t),{},{url:o}))}))}},G.fetchAllMiddleware=S,G.mediaUploadMiddleware=function(e,t){if(!function(e){var t=!!e.method&&"POST"===e.method;return(!!e.path&&-1!==e.path.indexOf("/wp/v2/media")||!!e.url&&-1!==e.url.indexOf("/wp/v2/media"))&&t}(e))return t(e);var r=0,n=function e(n){return r++,t({path:"/wp/v2/media/".concat(n,"/post-process"),method:"POST",data:{action:"create-image-subsizes"},parse:!1}).catch((function(){return r<5?e(n):(t({path:"/wp/v2/media/".concat(n,"?force=true"),method:"DELETE"}),Promise.reject())}))};return t(w(w({},e),{},{parse:!1})).catch((function(t){var r=t.headers.get("x-wp-upload-attachment-id");return t.status>=500&&t.status<600&&r?n(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(t)})):D(t,e.parse)})).then((function(t){return E(t,e.parse)}))},G.fetchAllMiddleware=null,G.use(G.createRootURLMiddleware((null===(C=null===(T=null===window||void 0===window?void 0:window.parent)||void 0===T?void 0:T.scData)||void 0===C?void 0:C.root_url)||(null===(N=null===window||void 0===window?void 0:window.scData)||void 0===N?void 0:N.root_url))),(null===(M=null===window||void 0===window?void 0:window.scData)||void 0===M?void 0:M.nonce)&&(G.nonceMiddleware=G.createNonceMiddleware(null===(U=null===window||void 0===window?void 0:window.scData)||void 0===U?void 0:U.nonce),G.use(G.nonceMiddleware)),(null===(R=null===window||void 0===window?void 0:window.scData)||void 0===R?void 0:R.nonce_endpoint)&&(G.nonceEndpoint=null===(q=null===window||void 0===window?void 0:window.scData)||void 0===q?void 0:q.nonce_endpoint),G.use((function(e,t){return e.path=(0,s.a)(e.path,{t:Date.now()}),t(e)}));var H=function(e){var t={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 t;return e.json().catch((function(){throw t}))},$=function(){var e=(0,n.Z)(c().mark((function e(t){var r;return c().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,H(t);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(G.nonceEndpoint).then((function(e){if(e.status>=200&&e.status<300)return e;throw e})).then((function(e){return e.text()})).then((function(e){G.nonceMiddleware.nonce=e})));case 6:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()},6455:function(e,t,r){r.d(t,{o:function(){return n}});var n=function(e,t){new window.IntersectionObserver((function(e,r){e[0].intersectionRatio>0&&(t(),r.unobserve(e[0].target))})).observe(e)}},1399:function(e,t,r){r.r(t),r.d(t,{sc_dashboard_downloads_list:function(){return v}});var n=r(4942),o=r(5861),i=r(5671),a=r(3144),u=r(1284),c=r.n(u),s=r(8860),l=r(930),f=r(6455),p=r(448);function d(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function h(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?d(Object(r),!0).forEach((function(t){(0,n.Z)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):d(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var v=function(){function e(t){(0,i.Z)(this,e),(0,s.r)(this,t),this.query={page:1,per_page:10},this.allLink=void 0,this.heading=void 0,this.isCustomer=void 0,this.requestNonce=void 0,this.purchases=[],this.loading=void 0,this.busy=void 0,this.error=void 0,this.pagination={total:0,total_pages:0}}var t,r,n;return(0,a.Z)(e,[{key:"componentWillLoad",value:function(){var e=this;(0,f.o)(this.el,(function(){e.initialFetch()}))}},{key:"initialFetch",value:(n=(0,o.Z)(c().mark((function e(){return c().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.isCustomer){e.next=2;break}return e.abrupt("return");case 2:return e.prev=2,this.loading=!0,e.next=6,this.getItems();case 6:e.next=12;break;case 8:e.prev=8,e.t0=e.catch(2),console.error(this.error),this.error=(null===e.t0||void 0===e.t0?void 0:e.t0.message)||wp.i18n.__("Something went wrong","surecart");case 12:return e.prev=12,this.loading=!1,e.finish(12);case 15:case"end":return e.stop()}}),e,this,[[2,8,12,15]])}))),function(){return n.apply(this,arguments)})},{key:"fetchItems",value:(r=(0,o.Z)(c().mark((function e(){return c().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.isCustomer){e.next=2;break}return e.abrupt("return");case 2:return e.prev=2,this.busy=!0,e.next=6,this.getItems();case 6:e.next=12;break;case 8:e.prev=8,e.t0=e.catch(2),console.error(this.error),this.error=(null===e.t0||void 0===e.t0?void 0:e.t0.message)||wp.i18n.__("Something went wrong","surecart");case 12:return e.prev=12,this.busy=!1,e.finish(12);case 15:case"end":return e.stop()}}),e,this,[[2,8,12,15]])}))),function(){return r.apply(this,arguments)})},{key:"getItems",value:(t=(0,o.Z)(c().mark((function e(){var t;return c().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,l.a)({path:(0,p.a)("surecart/v1/purchases/",h({expand:["product","product.downloads","download.media"],downloadable:!0,revoked:!1},this.query)),parse:!1});case 2:return e.next=4,e.sent;case 4:return t=e.sent,this.pagination={total:parseInt(t.headers.get("X-WP-Total")),total_pages:parseInt(t.headers.get("X-WP-TotalPages"))},e.next=8,t.json();case 8:return this.purchases=e.sent,e.abrupt("return",this.purchases);case 10:case"end":return e.stop()}}),e,this)}))),function(){return t.apply(this,arguments)})},{key:"nextPage",value:function(){this.query.page=this.query.page+1,this.fetchItems()}},{key:"prevPage",value:function(){this.query.page=this.query.page-1,this.fetchItems()}},{key:"render",value:function(){var e,t=this;return(0,s.h)("sc-purchase-downloads-list",{heading:this.heading,allLink:this.allLink&&this.pagination.total_pages>1?this.allLink:"",loading:this.loading,busy:this.busy,requestNonce:this.requestNonce,error:this.error,purchases:this.purchases},(0,s.h)("span",{slot:"heading"},(0,s.h)("slot",{name:"heading"},this.heading||wp.i18n.__("Downloads","surecart"))),(0,s.h)("sc-pagination",{slot:"after",page:this.query.page,perPage:this.query.per_page,total:this.pagination.total,totalPages:this.pagination.total_pages,totalShowing:null===(e=null==this?void 0:this.purchases)||void 0===e?void 0:e.length,onScNextPage:function(){return t.nextPage()},onScPrevPage:function(){return t.prevPage()}}))}},{key:"el",get:function(){return(0,s.a)(this)}}]),e}();v.style=":host{display:block}.download__details{opacity:0.75}"},4942:function(e,t,r){function n(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}r.d(t,{Z:function(){return n}})},5987:function(e,t,r){r.d(t,{Z:function(){return o}});var n=r(3366);function o(e,t){if(null==e)return{};var r,o,i=(0,n.Z)(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(o=0;o<a.length;o++)r=a[o],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}},3366:function(e,t,r){function n(e,t){if(null==e)return{};var r,n,o={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(o[r]=e[r]);return o}r.d(t,{Z:function(){return n}})}}]);