PageSourceSearch

https://obermeyer.com/cdn/shopifycloud/checkout-web/assets/c1/4b77f49a.D76Bkiba.js

js obermeyer.com collected 2026-10-02 11:34:44 UTC 15,141 bytes, 1 lines download raw bytes

1import{r as e,s as t,b as s,c as n,i as o,d as r}from"./60a453ce.CkhHeRBc.js";import{dS as i,b8 as a,dT as c,bL as l,dU as d,dV as p,dW as h,dX as f}from"./4c290a1e.C6TDJ9Fn.js";import{E as u}from"./66338e00.Df-ivAxs.js";import{e as y,S as x,m}from"./9c384ce8.CFjjgE6K.js";import{E as b,c as w,a as g,r as k}from"./24fcbaf6.D_Bnb16m.js";import{p as P,a3 as S,a4 as E,r as I,a5 as v,a6 as A}from"./2c1ab0fe.GMbxnz74.js";import{s as T}from"./6a2fc6d6.Cw2cQrl7.js";import"./app.CepNJbvh.js";import"./ac5a19ff.CRrh5Bdw.js";import"./bb728e1c.iawBHR84.js";import"./cf29e63b.ByW6Fn7D.js";import"./cb38e5c2.DHRUgYmP.js";import"./413b21e2.Bib5DUlj.js";import"./e477f96c.BxtSUGa4.js";import"./2255f8fa.BCU-NIF_.js";import"./b8733b27.B0VmlfYu.js";import"./e39bc11c.BPwkTsU-.js";import"./08a3b809.BxtDOfoo.js";import"./bff2ff9b.Wb1R3ZbF.js";import"./5fda1420.KYpufQ--.js";function j(e){if("function"==typeof e||e instanceof AbortSignal)return;if("object"!=typeof e||null==e)return e;const t={};for(const s in e)t[s]=j(e[s]);return t}const U=/^\/api\/.+\/graphql\.json$/,F=/^(\/\/)?(\/)?storefront\/api\/(.+\/)?graphql\.json$/;function _({appId:s,extensionType:n,storefrontTokens:o,storefrontUrl:r,myshopifyDomain:i,allowApiAccess:l,apiVersion:d}){return async function(p){const h=e(p.url,{storefront:t(r,d)});let f;try{f=new Request(h,p)}catch(y){throw new a(`Invalid API request: ${y}`)}const u=function(e,t,s){const n=new URL(e),o=new URL(t),r=new URL(`https://${s}`),i=U.test(n.pathname)&&(n.host===o.host||n.host===r.host);return F.test(n.pathname)||i}(f.url,r,i);if(!u)return async function(){throw new b("invalid request URL for storefront API. View the docs for more information:\n\nhttps://shopify.dev/docs/api/storefront#endpoints")}();if(l){const e=await o.get(s,n,"apiFetch");let t;e&&f.headers.set("Shopify-Storefront-Extension-Token",e);try{t=await fetch(f)}catch(y){if(y instanceof TypeError&&y.message.includes("Failed to fetch"))throw new c("Failed to query Storefront API",{cause:y});throw y}const r=await t.text();return{...j(t),headers:t.headers?Array.from(t.headers.entries()):[],body:r}}return async function(){throw new b('permission to access the storefront API must be specified under [capabilities] with flag "api_access = true"; this can be done within your extension\'s configuration. View the docs for more information:\n\nhttps://shopify.dev/docs/api/checkout-ui-extensions/configuration#api-access')}()}}new Proxy({},{get:(e,t)=>Promise.reject(new Error(`Called ${String(t)} on dummyWorker. Methods are not executable in dummyWorker.`))});const D=S("/cdn/shopifycloud/checkout-web/assets/c1/sandbox.DNKTFXG1.worker.js"),C=S("/cdn/shopifycloud/checkout-web/assets/c1/sandbox-2025-07.BNlrLTFV.worker.js"),R=S("/cdn/shopifycloud/checkout-web/assets/c1/sandbox-2023-04.Dcy5t5AR.worker.js");function q(e){const t=new Set;return e.aborted?{aborted:!0}:(e.addEventListener("abort",()=>{for(const s of t)s(e.aborted),E(s);t.clear()},{once:!0}),{aborted:!1,start(s){e.aborted?s(!0):(I(s),t.add(s))}})}const M={id:"19a6a28598862a756fd845752b04b4eed5d189eed0b08c3a5033847732004301",type:"query",name:"ExtensionTokens",source:""};class N{#e;#t;#s;#n;#o;#r;#i;#a;#c;constructor({options:e,activatedExtensions:t,isCheckoutEditor:a,extensions:c,metafields:f,afterHydrate:b}){const{client:S,shop:E,observability:I,persistence:T,proposal:j,serializedReceipt:U,graphql:F,source:M}=e;this.#t=c,this.#s=f,this.#n=E,this.#o=T,this.#r=j,this.#i=U,this.#a=M,this.#e=new r,this.syncPermissions(c.value),this.sandboxCache=function(e,t){const r=e.assets.isBaselineBrowser?"/cdn/shopifycloud/checkout-web/assets/c1/polyfills-entry-legacy.DwFClagF.worker.js":"/cdn/shopifycloud/checkout-web/assets/c1/polyfills-entry-modern.70q66_NX.worker.js",a=w({extensionsPublicPath:e.assets.extensionsBase,isPostPurchase:!1,observability:t.observability,getPolyfills:()=>async function(e,t){const{observability:s}=t;let n="",o=0;y.markStarted(x,{type:"sandbox-fetch"});try{const{response:t,text:r}=await P(async()=>{const t=o>0?{cache:"reload"}:{},r=await fetch(e,t);if(!r.ok)throw new l(`Failed to fetch sandbox polyfills: ${r.status}`);const i=await r.text();if(n=i,!i.slice(-256).includes("SANDBOX_EOF"))throw o++,s.leaveErrorBreadcrumb("truncated_sandbox_polyfill_fetch",{scriptUrl:e,httpStatus:r.status,contentLengthHeader:r.headers.get("content-length"),scriptBodyLength:i.length,scriptEnd:i.slice(-50)},"error"),new d("Polyfill script does not have expected end of file marker, likely truncated");return o>0&&s.log("successful_retry_truncated_sandbox_polyfill_fetch","Successful retry of truncated sandbox polyfill fetch",{scriptUrl:e,truncatedPolyfillCounter:o}),{response:r,text:i}},{maxAttempts:2,initialRetryDelay:.5});return y.markFinished(x,{type:"sandbox-fetch",transferredBundleSize:Number(t.headers.get("content-length")),bundleSize:r.length}),r}catch(r){if(r instanceof d&&n.length>0)return n;if(r instanceof l)throw r;throw new l(r instanceof Error&&r.message.length>0?r.message:"Failed to fetch sandbox polyfills",{cause:r})}}(k(r,e.assets.extensionsBase),{observability:t.observability}),appSandboxPermissions:t.appSandboxPermissions}),c=new Map,f=new Map,b=new Set,S=[],E=[];let I=!1;const T=h(function(){I=!0;const e=E.splice(0);for(const t of e)requestIdleCallback(()=>U(t))},500);function j(e){A(e.worker),e.worker=null,e.extensionPreloads.clear(),e.loadedExtensions.clear()}return{get:e=>c.get(e),on(e,t){b.add(t);for(const s of S.splice(0))t(s);return()=>{b.delete(t)}},getOrCreate({extension:e,storefrontUrl:s,myshopifyDomain:n}){const o=U({extension:e,storefrontUrl:s,myshopifyDomain:n,appSandboxPermissions:t.appSandboxPermissions});return f.get(o).userCount+=1,o},release(e){const t=f.get(e);return null==t?Promise.reject(new p("Could not release the provided sandbox, which usually means the sandbox has already been destroyed.")):(t.userCount-=1,t.userCount>0||(t.listeners.clear(),j(t),f.delete(e),c.delete(t.id)),Promise.resolve())},preload({extensions:e,storefrontUrl:n,myshopifyDomain:o}){const r=e=>t.deferThankYouPreloads&&!s(e.extensionPoint.target)&&!I;for(const s of e)r(s)?E.push({extension:s,storefrontUrl:n,myshopifyDomain:o,appSandboxPermissions:t.appSandboxPermissions}):U({extension:s,storefrontUrl:n,myshopifyDomain:o,appSandboxPermissions:t.appSandboxPermissions});e.length>0&&e.every(r)&&T()}};function U({extension:e,storefrontUrl:s,myshopifyDomain:r,appSandboxPermissions:l}){const{capabilities:d,scriptUrl:h,id:x,extensionPoint:w,apiVersion:k}
1=e,P=g({extension:e,appSandboxPermissions:l,observability:t.observability}),E=function({target:e,publicId:t,apiVersion:s,sandboxConfig:n}){return n.isShared?n.cacheKey():`${t}:${e}:${s}`}({target:w.target,publicId:x,apiVersion:k,sandboxConfig:P});if(c.has(E)){const s=c.get(E);return P.isShared&&(s.loadExtension(e),t.observability.log("extension_loaded_in_shared_sandbox","Extension loaded into shared sandbox",{appId:e.appId,extensionId:e.id,sandboxCacheKey:E})),s}const I=new Map,A={id:E,userCount:0,scriptUrl:h,extensionPreloads:new Map,loadedExtensions:new Map,listeners:I,worker:null,workerReady:void 0},U={allowNetworkAccess:P.isShared?P.hasSharedNetworkAccess:n(e)};async function F(e){const t=A.loadedExtensions.get(e.id);if(t&&t.scriptUrl===e.scriptUrl)return;y.markStarted("js-loading",{extension:e,instanceId:null,type:"extension"}),A.loadedExtensions.set(e.id,e);const s=async function(e){const{scriptUrl:t}=e;try{y.markStarted("partner-js-fetch",{extension:e,instanceId:null,type:"extension"});const s=await fetch(t);if(!s.ok)throw new Error(`Failed to fetch extension asset, received http status ${s.status}`);const n=await s.text();return y.markFinished("partner-js-fetch",{extension:e,instanceId:null,type:"extension",transferredBundleSize:Number(s.headers.get("content-length")),bundleSize:n.length}),{scriptBody:n,scriptUrl:t,extensionId:e.id}}catch(s){const e=s instanceof Error&&"string"==typeof s.message&&s.message.length>0?s.message:"Failed to fetch extension asset";throw new i(e,{cause:s})}}(e),n=(async()=>{let t;await A.workerReady;try{t=await s}catch(n){throw A.loadedExtensions.delete(e.id),A.extensionPreloads.delete(e.id),y.markFinished("js-loading",{extension:e,instanceId:null,type:"extension"}),n}null!=A.worker?(await A.worker.load(t),y.markFinished("js-loading",{extension:e,instanceId:null,type:"extension"})):y.markFinished("js-loading",{extension:e,instanceId:null,type:"extension"})})();A.extensionPreloads.set(e.id,n)}async function M(){let n=null;n="2023-04"===k?R({createMessenger:a(e=>{I.get("error")?.forEach(t=>t(e))},U,e)}):o(k)?D({createMessenger:a(e=>{I.get("error")?.forEach(t=>t(e))},U,e)}):C({createMessenger:a(e=>{I.get("error")?.forEach(t=>t(e))},U,e)}),A.worker=n,v(n,{reload:()=>{},extensionPerformanceMarkStarted:(e,t)=>{e in m&&y.markStarted(e,{type:"extension",extension:N(t.extensionId),...t})},extensionPerformanceMarkFinished:(e,t)=>{e in m&&y.markFinished(e,{type:"extension",extension:N(t.extensionId),...t})},reportSandboxError:(e,s)=>{const n=new u(`${e?.name??"Error"}: ${e?.message??"Unknown sandbox error"}`);e?.stack&&(n.stack=e.stack),t.observability.error(n,{severity:"error",metadata:{sandbox:$(s?.scriptUrl)}})},reportApiRead:(t,s)=>{if(!Array.isArray(t))return;const n="string"==typeof s?.extensionId?s.extensionId:void 0,o=null==n?e:N(n);if("local"===o.type)return;const r=[];for(const e of t)"string"==typeof e&&""!==e&&r.push(e);r.length>0&&function(e){if(b.size>0)for(const t of b)t(e);else S.push(e),S.length>200&&S.shift()}({apiPropertyNames:r,extension:o,initialLoad:y.initialLoad,timestamp:new Date})}}),o(k)||await n.sandbox({allowNetworkAccess:U.allowNetworkAccess,allowApiAccess:d.apiAccess,storefrontUrl:s,myshopifyDomain:r})}function N(t){return A.loadedExtensions.get(t)??e}function $(t){const{appId:s,appName:n}=e,o=null==t?!P.isShared&&e||void 0:[...A.loadedExtensions.values()].find(e=>e.scriptUrl===t);return{appId:s,appName:n,extensionId:o?.extensionId,extensionName:o?.name}}function L(){const e=A.worker;if(null==e)throw new p("You attempted to call a function on a terminated web worker after its extension sandbox was released.");return e}A.workerReady=M(),F(e);const B={async render(e,t,i,a,c,l,d,p,h,f){const u=N(d);return v(L(),{apiFetch:_({appId:P.isShared?P.appId:u.appId,storefrontTokens:c,storefrontUrl:s,myshopifyDomain:r,extensionType:P.isShared?P.extensionType:u.type,allowApiAccess:P.isShared?P.hasSharedApiAccess:u.capabilities.apiAccess,apiVersion:k})}),await A.extensionPreloads.get(u.id),T(),y.markStarted("execution",{extension:u,instanceId:l,type:"extension"}),o(k)?L().render({connection:t,target:u.extensionPoint.target,translations:u.translations,extensionType:u.type,scriptUrl:u.scriptUrl,api:a,instanceId:l,extensionId:u.id,allowNetworkAccess:n(u),allowApiAccess:u.capabilities.apiAccess,storefrontUrl:s,myshopifyDomain:r,initialValues:h,relayApi:f}).then(({output:e,teardown:t})=>({output:e,teardown:t})):L().render(e,t,i,a,u.translations,u.type,l,p).then(({output:e,teardown:t})=>({output:e,teardown:t}))},async run(e,t,i,a,c,l){const d=N(a);return function(e){"signal"in e&&Object.assign(e,{signal:q(e.signal)}
1)}(t),await A.extensionPreloads.get(d.id),T(),o(k)?L().run({target:d.extensionPoint.target,translations:d.translations,extensionType:d.type,scriptUrl:d.scriptUrl,api:t,instanceId:i,extensionId:d.id,allowNetworkAccess:n(d),allowApiAccess:d.capabilities.apiAccess,storefrontUrl:s,myshopifyDomain:r,initialValues:l}).then(({output:e,teardown:t})=>({output:e,teardown:t})):L().run(e,t,d.translations,d.type,i,c).then(({output:e,teardown:t})=>({output:e,teardown:t}))},async restart(){const e=[...A.loadedExtensions.values()];j(A),A.workerReady=M();for(const t of e)F(t);I.get("restart")?.forEach(e=>e())},on:(e,t)=>(I.has(e)?I.get(e)?.add(t):I.set(e,new Set([t])),()=>{I.get(e)?.delete(t)}),getUserCount:()=>A.userCount,isWorkerAvailable:()=>null!==A.worker,loadExtension(e){F(e)}};return c.set(E,B),f.set(B,A),B}}(S,{observability:I,appSandboxPermissions:this.#e,deferThankYouPreloads:!a}),this.storefrontTokens=new $({activatedExtensions:t,globalExtensions:E.globalUIExtensions,graphql:F,observability:I,source:M}),b.then(()=>this.#l()).catch(()=>{})}registerExtensionsManager(e){this.#c=e}syncPermissions(e){for(const t of e)t.appId&&this.#e.app(t.appId).syncExtension(t)}removePermissions(e){for(const t of e)t.appId&&this.#e.app(t.appId).removeExtension(t.id)}destroyExtensions(e,t){e.forEach(e=>{this.#c?.findAll({id:e.id,target:e.extensionPoint.target}).forEach(e=>{e.destroy({reason:t})})})}refreshStorefrontTokens(e){e.forEach(e=>{e.apiTokens?.storefrontApi&&this.storefrontTokens.cache.set(this.storefrontTokens.cacheKey(e.extension.appId,"persisted"),e.apiTokens.storefrontApi)})}#l(){T({metafields:this.#s,persistence:this.#o,proposal:this.#r,serializedReceipt:this.#i,source:this.#a}),this.#t.subscribe(e=>{this.sandboxCache.preload({extensions:e,storefrontUrl:this.#n.storefrontUrl??"",myshopifyDomain:this.#n.myshopifyDomain})})}}class ${#d;#p;#h;#a;constructor({activatedExtensions:e,globalExtensions:t=[],graphql:s,observability:n,source:o}){this.#p=s,this.#h=n,this.#a=o,this.#d=new Map;for(const r of e){const e=this.cacheKey(r.extension.appId,"persisted");r.apiTokens?.storefrontApi&&this.#d.set(e,r.apiTokens.storefrontApi)}for(const r of t){const e=this.cacheKey(r.extension.appId,"global");r.apiTokens?.storefrontApi&&this.#d.set(e,r.apiTokens.storefrontApi)}}async get(e,t,s){const n=this.cacheKey(e,t),o=this.#d.get(n);if(o){if(!this.#f(o.expiresAt))return this.#u(t),o.token;this.#d.delete(n)}try{const{data:o,error:r}=await this.#p.staticQuery(M,{cache:!1,variables:{appId:e,extensionType:t}});if(r)return this.#y(r,e,t),null;const i=o?.extensionApiTokens?.storefrontApi;return i?(this.#d.set(n,i),this.#u(t),i.token):(this.#h.log("use_ensure_storefront_token_not_found_in_response","Extension storefront token not found in API response",{appId:e,extensionType:t,sourceType:this.#a.type,reason:s}),null)}catch(r){return this.#y(r,e,t),null}}get cache(){return this.#d}cacheKey(e,t){return`${e}-${t}`}#y(e,t,s){const n=e instanceof Error?e:new f(`Failed to fetch extension storefront token for app ${t}: ${String(e)}`);this.#h.error(n,{severity:"error",metadata:{graphQL:{name:"ExtensionTokensQuery",appId:t,extensionType:s},source:{type:this.#a.type}}}),this.#h.log("use_ensure_storefront_token_fetch_failed","Failed to fetch extension storefront token",{appId:t,extensionType:s,sourceType:this.#a.type,error:e instanceof Error?e.message:String(e),errorType:e instanceof Error?e.constructor.name:typeof e})}#f(e){return Date.now()>new Date(e).getTime()-6e4}#u(e){"local"===e&&"draftOrder"===this.#a.type&&console.warn("Queries to the storefront API might not return data for certain products. The extension is currently using the online store channel for product availability. This is because the extension is in development mode, the extension is not published to the checkout configuration, and the current checkout is a draft order invoice. Install the app and add the extension in order to use draft order product availability.")}}export{$ as StorefrontTokensForBrowser,N as UIExtensibilityBrowserEngine};

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.