PageSourceSearch

https://omwboards.com/cdn/shopifycloud/checkout-web/assets/c1/page-Throttle.D9uedmi3.js

js omwboards.com collected 2026-09-29 00:17:59 UTC 10,681 bytes, 1 lines download raw bytes

1import{k as q,h as S,a0 as ie,M as oe,l as J,f as w,A as x,u as e,g as se,T as ce,o as ue,i as T}from"./esnext-vendor.DDpcaSqU.js";import{cU as X,cV as L,n as M,P as m,L as de,k as f,B as A,a0 as Z,C as he,l as E,W as me,I as K,aa as pe,e as fe,q as ge,$ as ve,G as U,cW as be,b as ye,ar as _e,ao as Te,ap as z,aq as we,al as xe,ai as G,am as Se,cX as Ie}from"./hydrate.BcfGVx0L.js";import{S as ke}from"./Section-SectionStyleOverride.CdNufRZ0.js";import{a5 as Y,T as v,I as Ae,cI as Ee,bG as Pe}from"./utilities-previous.Cnwy8G2v.js";import{u as Re,S as Ve}from"./CalloutHeader.DC7jgv42.js";import{S as ee}from"./app.DdDscdWN.js";import{d as qe}from"./shared-report-graphql-error.BIbaQJ6B.js";import"./graphql-PaymentSessionMutation.C-nDEOnn.js";import"./shared-permissions.B59tuyWB.js";import"./hooks-useShopPayExternalAppContext.R6pnDxYu.js";import"./shop-pay-experiments.BdHRV-Vf.js";function te(){const[t,n]=q(typeof document>"u"?"visible":document.visibilityState);return S(()=>{const r=()=>n(document.visibilityState);return window.addEventListener("visibilitychange",r,!1),()=>{window.removeEventListener("visibilitychange",r)}},[]),t}function Le(t){return t.length===0?"empty":t.every(H)?"unavailable":t.some(H)?"partially_available":"available"}function H(t){return t.available===!1}const Me={id:"186ea50e2b37f36013ff760cddcee64b27d2785edc79d3078d8bb95e4186410b",type:"query",name:"ThrottlePoll",source:"query ThrottlePoll($token:String!,$variantIdsV2:[Int!]){poll(token:$token,variantIdsV2:$variantIdsV2){...on PollContinue{token pollAfter queueEtaSeconds productVariantAvailabilityV2{available id __typename}__typename}...on PollComplete{token __typename}__typename}}"};class k extends ee{constructor(){super(...arguments),this.name="ThrottleError",this.defaultGroupingHash="ThrottleError::Exiting::Status"}}class W extends ee{constructor(){super(...arguments),this.name="UnactionableThrottleError",this.unactionable=!0}}function Be(){const[t,n]=q(null),r=X(),a=ie(),[i,o]=q(),{throttle:s,setThrottle:_}=L(),{value:I}=Y().merchandiseLines,{graphql:{throttleGraphql:b},observability:P}=v();if(S(()=>{n(u=>u??new Date)},[]),Ce(async()=>{if(s.status==="queued")try{const u=I?I.lines.filter(h=>h.variantId).map(h=>re(h.variantId)):[],{data:d,error:g}=await b.staticQuery(Me,{cache:!1,variables:{token:s.token,variantIdsV2:u}});if(!r.current)return;if(g)throw g;if(!d)throw new k("Throttle poll did not return data",{groupingHash:"ThrottleError::PollMissingReturnData"});const c=$e(d,s);c.status==="queued"&&s?.pollAfter===c.pollAfter&&(c.pollAfter=Date.now()+1e3),_(c),n(new Date),a.reset()}catch(u){const d=a.next(),g=d.done,c=qe(u),h=u instanceof oe?u.response.status:void 0;if(g){o(new(c.actionable?k:W)("Throttle exited on maximum retries",{cause:u})),P.counter({name:"throttle_exited_on_maximum_retries",value:1});return}else if(h&&h<500){o(new(c.actionable?k:W)(`Throttle exiting on ${h} status`,{cause:u}));return}_({...s,pollAfter:Date.now()+d.value})}},s.status==="queued"?s.pollAfter:void 0),i)throw i;return{throttle:s,lastUpdated:t}}function Ce(t,n){const r=x(t);r.current=t;const a=te();S(()=>{if(!n)return;const i=Math.max(n-Date.now(),0);if(i===0)r.current();else{const o=setTimeout(r.current,i);return()=>clearTimeout(o)}},[n,a])}function $e({poll:t},n){if(t.__typename==="PollContinue")return{status:"queued",pollAfter:new Date(t.pollAfter).getTime(),token:t.token,queueEtaSeconds:t.queueEtaSeconds??void 0,productVariantAvailabilityV2:t.productVariantAvailabilityV2,pollUrl:n.pollUrl};if(t.__typename==="PollComplete")return{status:"complete",token:t.token,productVariantAvailabilityV2:n.productVariantAvailabilityV2};throw new k("unable to handle Throttle type",{groupingHash:"ThrottleError::ThrottleType"})}function De(){const{throttle:t}=L(),n=J(t),r=Y().merchandiseLines;return w(()=>{const a=n.value;if(a.status==="inactive"||a.status==="loading"||!r.value)return[];const i=new Map(a.productVariantAvailabilityV2.map(({id:o,available:s})=>[o,s]));return r.value.lines.filter(o=>o.variantId).map(o=>({...o,available:i.get(re(o.variantId))}))})}function re(t){return parseInt(Ae(t),10)}function O({inventoryStatus:t}){const{i18n:n,shop:{hasStorefront:r},url:a,checkout:{configuration:i}}=v(),o=t==="empty"?n.translate("stock.empty_cart_label"):n.translate("throttle.inventory.sold_out.heading"),s=t==="empty"?n.translate("stock.return_to_store_label"):n.translate("throttle.inventory.sold_out.link");return e(f,{gap:"small-200",alignItems:"center",padding:"large-300",children:[e(M,{level:1,children:o}),r&&t==="unavailable"&&e(m,{size:"large",textAlign:"center",children:n.translate("throttle.inventory.sold_out.storefront_body")}),r&&i.allowRedirectToStorefront&&e(m,{textAlign:"center",children:e(de,{href:a.storefront(),children:s})}),!r&&t==="unavailable"&&e(m,{size:"large",textAlign:"center",children:n.translate("throttle.inventory.sold_out.no_storefront_body")})]})}function Ne({heading:t,details:n,children:r}){return e(Z,{borderRadius:"base",border:"base",children:[e(A,{padding:"large-200",accessibilityRole:"header",children:e(f,{direction:"inline",gap:"small-200",alignItems:"baseline",children:[e(M,{level:2,children:t}),n?e(m,{color:"subdued",type:"small",children:n}):null]})}),e(A,{borderWidth:"base none none none",padding:"large-200",children:r})]})}function Fe(){const{i18n:t}=v();return e(me,{tone:"warning",errorType:he.InventoryError,children:e(m,{type:"small",children:e(E,{type:"strong",children:t.translate("throttle.inventory.partial_inventory_banner")})})})}const Ue="NMORO",Q={ProgressBar:Ue,"ProgressBar-line":"zetxR"};function ze({barCount:t=7}){const r={"--ProgressBar-width":`${t*13}px`},a=[];for(let i=0;i<t;i++)a.push(e("div",{className:se(Q["ProgressBar-line"])},i));return e("div",{className:Q.ProgressBar,style:r,children:a})}const j=60;function Ge(){const{i18n:t}=v(),{throttle:n}=L(),r=n.status==="queued"?n.queueEtaSeconds:0,a=ce(()=>r==null?t.translate("throttle.estimated_wait_time.calculating"):r<j?t.translate("throttle.estimated_wait_time.less_than_one"):t.translate("throttle.estimated_wait_time",{count:Math.round(r/j)}),[r,t]);return e(f,{alignItems:"center",gap:"large-200",padding:"large-200",children:[e(ze,{}),e(f,{gap:"small-200",alignItems:"center",children:[e(M,{level:1,textAlign:"center",children:t.translate("throttle.line_to_check_out")}),e(m,{size:"base",children:a})]})]})}const He="broxv",We={Text:He};function Oe(){const{i18n:t}=v(),n=t.translate("throttle.merchandise.available").trim();return n.length===0?null:e(m,{children:e(f,{direction:"inline",gap:"small-400",alignItems:"center",children:[e(K,{size:"small-200",tone:"success",type:"check"}),e(E,{type:"strong",tone:"success",size:"small",children:e("span",{className:We.Text,children:n})})]})})}const Qe="hG8Tu",je={Text:Qe};function Je(){const{i18n:t}=v(),n=t.translate("throttle.merchandise.sold_out").trim();return n.length===0?null:e(pe,{children:e(f,{direction:"inline",gap:"small-400",alignItems:"center",children:[e(K,{size:"small-200",tone:"critical",type:"disabled"}),e(E,{size:"small",children:e("span",{className:je.Text,children:n})})]})})}function Xe(t){return t.endsWith("status: 429")}function ut(){const{progress:t}=fe(),n=J(Be()),{i18n:r,shop:a,url:i,observability:o,embed:s,router:_}=v(),I=te(),b=De(),P=w(()=>b.value.length>0?b.value:null),u=X(),d=w(()=>n.value.throttle.status),g=w(()=>n.value.lastUpdated),c=w(()=>d.value==="complete"||d.value==="queued"?Le(b.value):null),h=x(t),{currentPage:ne}=ge().value;h.current=t;const B=x(!1);ue(()=>{if(B.current)return;const y=c.value;if(!y)return;const p=b.value;o.counter({name:"throttle_rendered",value:1,attributes:{throttle_status:d.value,inventory_status:y,merchandise_available:p.filter(({available:l})=>l).length,merchandise_unavailable:p.filter(({available:l})=>!l).length,has_storefront:a.hasStorefront}}),B.current=!0});const C=x(!1);S(()=>{C.current||(C.current=!0,Pe(s,"throttle"))},[s]),Ee(d.value==="complete"&&I==="hidden"?r.translate("throttle.time_to_checkout_title",{shopName:a.name}):d.value==="loading"?r.translate("general.loading_title",{shopName:a.name}):r.translate("general.full_title",{pageTitle:r.translate("throttle.title"),shopName:a.name}));const R=ne?.route,V=x(!1);S(()=>{function y(l){return l.status==="fetch_failed"&&Xe(l.reason)&&!V.current&&u.current}function p(){h.current("throttle-run",l=>{l.status==="throttled"&&u.current?(V.current=!1,p()):y(l)?(V.current=!0,p()):(l.status==="error"||l.status==="fetch_failed")&&(R?_.navigate(R,{replace:!0}):window.location.assign(i.cart()))})}p()},[h,u,i,R,_]),Re({stage:Ve.Usable,id:"Throttle"});const{header:{logo:$}}=ve();return d.value==="inactive"?null:e(U,{placeItems:"center",minBlockSize:"100vh",background:"base",children:e(A,{maxInlineSize:"450px",padding:"base",children:e(ke,{target:"card",children:e(Z,{accessibilityLabel:r.translate("throttle.title"),children:e(f,{gap:"base",children:[$&&e(U,{gridAutoFlow:"column",gridTemplateColumns:"minmax(0, 1fr)",gridTemplateRows:"minmax(0, 1fr)",justifyContent:"center",justifyItems:"center",children:e(be,{width:$.maxWidth})}),e(T,{when:()=>c.value==="empty",fallback:e(T,{when:()=>c.value==="unavailable",fallback:e(Ge,{}),children:e(O,{inventoryStatus:"unavailable"})}),children:e(O,{inventoryStatus:"empty"})}),e(T,{when:P,children:y=>e(Ne,{heading:r.translate("throttle.cart_summary_heading"),details:g.value?r.translate("throttle.last_checked",{time:r.formatDate(g.value,{hour:"numeric",minute:"numeric",timeZoneName:"short"})}):void 0,children:[e(T,{when:()=>c.value==="partially_available",children:[e(Fe,{}),e(ye,{blockSize:"large-200"})]}),e(_e,{children:[e(Te,{hidden:!0,children:[e(z,{hidden:!0,children:r.translate("order_summary.product_image_label")}),e(z,{hidden:!0,children:r.translate("order_summary.description_label")})]}),e(we,{children:y.map(({digest:p,image:l,available:D,title:ae,subtitle:N,quantity:le,properties:F})=>e(xe,{children:[e(G,{children:e(Se,{src:l?.one,srcSet:l?`${l.one} 1x, ${l.two} 2x, ${l.four} 4x`:void 0,alt:l?.altText,totalItems:le})}),e(G,{primary:!0,children:[e(m,{children:e(E,{type:"strong",children:ae})}),N?e(m,{color:"subdued",children:N}):null,F?e(Ie,{properties:F}):null,D==null?null:e(Ze,{available:D})]})]},p))})]})]})}),e(T,{when:()=>c.value!=="empty"&&c.value!=="unavailable",children:e(A,{padding:"large-200 none",children:e(f,{alignItems:"center",gap:"small-200",accessibilityRole:"footer",children:[e(m,{color:"subdued",textAlign:"center",children:r.translate("throttle.footer.heading")}),e(m,{color:"subdued",textAlign:"center",children:r.translate("throttle.footer.body")})]})})})]})})})})})}function Ze({available:t}){return t?e(Oe,{}):e(Je,{})}export{ut as default};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.