import{Ht as e,Lt as t,Mt as n,Ut as r,Vt as a,ln as i,zt as o}from"./630ba094.L_X-5TXi.js";var s=["Load failed","Failed to fetch","when attempting to fetch resource","SystemJS https://github.com/systemjs/systemjs/blob/main/docs/errors.md#3"],c=["Importing a module script failed.","Failed to fetch dynamically imported module","error loading dynamically imported module","Cannot load script due to integrity mismatch"],u=["TranslationNotStringError","MissingReplacementError","CardFieldsSetupError","CardFieldsLoadError","IFrameNotFoundError","CardFieldsFetchFailureError","CardFieldsOperationalError","PayPalAPIError","WalletProviderFailureError","AbortedSessionError","AbortError","GraphQLFetchNetworkError","MonorailRequestError","BreadcrumbsPluginFetchError","OpenTelemetryClientError","InsecurePageError","UnsafeURLError","GraphQLFetchHttpBadRequestError","GraphQLFetchHttpStatusError","GraphQLFetchHttpContentTypeError","GraphQLFetchJsonParseError","SettingsCreateError","MerchantCommunicationError","PostPurchase::ClientJsonParseError","MissingAppContextError","MissingContextError"];function l(e){return"TypeError"===e.name&&c.some(t=>e.message.includes(t))||e instanceof n&&0===e.exports?.length}function d(e){return s.some(t=>e.message.includes(t))}var p=class extends Error{constructor(e,t={}){super(e,t),this.metadata=t.metadata??{},this.instanceGroupingHash=t.groupingHash,this.unactionable=!1,"captureStackTrace"in Error&&Error.captureStackTrace(this,this.constructor)}get groupingHash(){return this.instanceGroupingHash??this.defaultGroupingHash??this.name}isUnactionable(){return this.unactionable}},h=class extends p{constructor(e,t={}){super(e,t)}},m="fast-thank-you-progress-root",f="shop_pay_order",y=class{#e;#t;constructor({progress:e}={}){this.#e=r("pending"),this.phase=this.#e,this.#t=r(!1),this.isHeld=this.#t,this.isRevealing=t(()=>"revealing"===this.#e.value),this.progress=e}hold(){"pending"===this.#e.peek()&&(this.#t.value=!0)}reveal(){this.#n("pending","revealing")}settle(){this.#n("revealing","settled")}skip(){this.#n("pending","settled")}replay(){"settled"===this.#e.peek()&&a(()=>{this.#t.value=!1,this.#e.value="pending"})}#n(e,t){this.#e.peek()===e&&(this.#e.value=t)}},g=class{#r;#e;#a;#i;#o;constructor({context:e}){this.#e=r("loading"),this.phase=this.#e,this.#i=new Promise(e=>{this.#a=e}),this.#r=e}complete(){this.#s("completing")}cancel(e){this.#s("cancelled")&&this.#c(e)}fill(){let e=this.#o;return null==e&&(e=this.#u(),this.#o=e),e}async#u(){if(await this.#i,"completing"!==this.#e.peek())return;const e=document.getElementById(m)?.querySelector(".FastThankYouReceiptProgressBar");e&&await Promise.race([b(e),P(2e3)]),this.#e.value="complete",this.#c("completed")}#s(e){return"loading"===this.#e.peek()&&(this.#e.value=e,this.#a(),!0)}#c(e){this.#r.observability.histogram({name:"thank_you_page_fast_progress_ms",value:Math.round(performance.now()),unit:"ms",attributes:{outcome:e}})}},v=.3,E=.6;async function b(e){if("hidden"!==document.visibilityState){const t=function(){let e=()=>{};return{promise:new Promise(t=>{const n=()=>{"hidden"===document.visibilityState&&t()};document.addEventListener("visibilitychange",n),e=()=>document.removeEventListener("visibilitychange",n)}),dispose:e}}();try{await Promise.race([t.promise,w(e)])}finally{t.dispose()}}"hidden"===document.visibilityState&&S(e)}async function w(e){window.matchMedia("(prefers-reduced-motion: reduce)").matches||"function"!=typeof e.animate?S(e):(await async function(e){const t=await F(e),n=await F(e),r=n.time-t.time,a=r>0?Math.max(0,(n.scale-t.scale)/r):0,i=Math.min(1,v*a*1e3);e.style.animation="none",T(e);const o=e.animate([{transform:n.transform},{transform:"scaleX(1)"}],{duration:1e3*Math.max(0,1-n.scale),easing:`cubic-bezier(${v}, ${i}, ${E}, 1)`,fill:"forwards"});o.startTime=n.time,await o.finished.catch(()=>{})}(e),await P(150)),await k(),await k()}function S(e){e.style.animation="none",T(e),e.style.transform="scaleX(1)"}function P(e){return new Promise(t=>{setTimeout(t,e)})}function T(e){const t=e.querySelector(".FastThankYouReceiptProgressSheenBand");t?.setAttribute("data-progress-sheen-stopped",""),t?.getAnimations?.().forEach(e=>e.cancel())}async function F(e){const t=await k(),{transform:n}=getComputedStyle(e),r=parseFloat(n.slice(n.indexOf("(")+1));return{time:t,transform:n,scale:Number.isFinite(r)?r:1}}function k(){return new Promise(e=>{requestAnimationFrame(e)})}function C(){document.getElementById("app")?.removeAttribute("inert"),document.querySelectorAll(".LoadingShellMainContentPrimary, .LoadingShellOrderSummaryContentPrimary").forEach(e=>e.removeAttribute("aria-hidden")),document.querySelectorAll(".LoadingShell-fastThankYouProgressCover").forEach(e=>e.classList.remove("LoadingShell-fastThankYouProgressCover")),document.getElementById(m)?.remove()}function _(){return null!==document.getElementById(m)}function L(t,{currentUrl:n,latestReceipt:r}){const a=setTimeout(()=>t.cancel("timeout"),1e4),i=e(function(){const e=t.phase.value,{normalizedPath:i}=n.value,s=r.value?.status;o(()=>{const n="loading"===e?function(e,t){return"/processing"!==e&&"/thank-you"!==e?"left_receipt_route":void 0===t?"no_receipt":"action_required"===t||"failed"===t||"abandoned"===t?t:void 0}(i,s):void 0;("loading"!==e||n)&&(this.dispose(),clearTimeout(a),n&&t.cancel(n),document.getElementById("app")?.removeAttribute("inert"))})});return()=>{clearTimeout(a),i()}}var H,M=Symbol("unreadable"),O=i,x=new WeakMap;function A(){if("undefined"==typeof window)return()=>{};if(H)return H;const e=O.__e;function t(...t){return function(e,t){if("undefined"!=typeof window)try{if(!(e instanceof TypeError)||x.has(e))return;const n=Object.getOwnPropertyDescriptor(e,"message");if(!n||!("value"in n)||"Cannot convert object to primitive value"!==n.value)return;const r={reported:!1};x.set(e,r),r.metadata=function(e){const t={version:1,inspectedNodeCount:0,candidateCount:0,scanTruncated:!1,candidatesTruncated:!1,inspectionFailed:!1,outputTruncated:!1,catchVNode:{type:{category:"unreadable"},ancestry:{},ancestryTruncated:!1},candidates:{}};t.catchVNode=Q(e,t);const n=[e],r=new Set;for(const o of n){if(!j(o)||r.has(o))continue;r.add(o),t.inspectedNodeCount++;const e=q(o,"type",t);e!==M&&null!=e&&"string"!=typeof e&&"function"!=typeof e&&(t.candidateCount<4?t.candidates[t.candidateCount++]=Q(o,t):t.candidatesTruncated=!0);try{const e=q(o,"__k",t);if(!Array.isArray(e))continue;const r=q(e,"length",t);if("number"!=typeof r)continue;const a=Math.min(r,32-n.length);a=0;o--)for(const e of a){if(i.encode(JSON.stringify(t)).byteLength<=8192)return t;e.ancestry[o]&&(delete e.ancestry[o],e.ancestryTruncated=!0,t.outputTruncated=!0)}return t}(t)}catch{}}(t[0],t[1]),e.apply(this,t)}function n(){"undefined"!=typeof window&&O.__e===t&&(O.__e=e,H=void 0)}return O.__e=t,H=n,n}function N(e){if("undefined"==typeof window)return;const t=x.get(e);return t&&!t.reported?(t.reported=!0,t.metadata):void 0}function j(e){return"object"==typeof e&&null!==e||"function"==typeof e}function B(e){return e===M?"unreadable":null===e?"null":typeof e}function I(e,t,n){try{return Object.getOwnPropertyDescriptor(e,t)}catch{return n.inspectionFailed=!0,M}}function q(e,t,n){if(!j(e))return;const r=I(e,t,n);return r?r!==M&&"value"in r?r.value:(n.inspectionFailed=!0,M):void 0}function G(e,t,n){const r=I(e,t,n);return r===M?{kind:"unreadable"}:r?"value"in r?{kind:"data",valueType:B(r.value)}:{kind:"accessor"}:{kind:"absent"}}function R(e,t){const n={category:B(e)};if(!j(e)||"function"==typeof e)return n;try{n.nullPrototype=null===Object.getPrototypeOf(e)}catch{t.inspectionFailed=!0}const r=I(e,Symbol.toStringTag,t);return n.moduleLike=r!==M&&void 0!==r&&"value"in r&&"Module"===r.value,n.defaultProperty=G(e,"default",t),n.toStringProperty=G(e,"toString",t),n.valueOfProperty=G(e,"valueOf",t),n}function Q(e,t){const n=[],r=new Set;let a=e;for(;j(a)&&n.length<10&&!r.has(a);){r.add(a);const e=q(a,"type",t),i={category:B(e)};if("function"==typeof e){const n=q(e,"displayName",t),r="string"==typeof n&&n.length>0?n:q(e,"name",t);"string"==typeof r&&(i.name=r.slice(0,100),i.nameTruncated=r.length>100)}n.push(i),a=q(a,"__",t)}return{type:R(q(e,"type",t),t),ancestry:Object.fromEntries(n.map((e,t)=>[t,e])),ancestryTruncated:j(a)}}export{C as a,y as c,c as d,u as f,d as h,_ as i,p as l,l as m,A as n,L as o,s as p,g as r,f as s,N as t,h as u};