1import{u as e,S as n,f as o}from"./2c1ab0fe.D_oO1jU7.js";import{C as i,L as t,ce as r,J as d}from"./164ad2e3.DgUUtBtV.js";import{O as a,ck as s,bx as c,P as u,b0 as l,dC as f,ar as p}from"./4c290a1e.D9lE9kmU.js";const w=d("legal-link-modal");function m({handle:o,tone:d}){const{embed:u,i18n:l,shop:{merchantPolicies:f}}=a(),p=l.translate("shop_policies",{scope:o.replace(/-/g,"_")}),{localPolicies:m}=s(),h=f.some((e=>e.handle===o))?m.find((e=>e.handle===o)):void 0,b=i(void 0,w);return h?.url&&c(u?.embedder)?e(t,{tone:d,"aria-haspopup":"dialog",onClick:()=>{u?.client?.windowOpenRequest(h.url)},children:p}):e(n,h?{children:[e(t,{commandFor:b,tone:d,children:p}),e(r,{id:b,defaultPolicy:h})]}:{children:p})}function h(){const e=u().buyerIdentity,{shop:n,source:i}=a();return o((()=>Boolean(n.customerAccountLocationsUrl&&"draftOrder"!==i.type&&!l(i)&&f(e.value?.purchasingCompany))))}const b=/Shop App\/[^/]+\/(?:iOS|Android)\//i;function g(e){return/Android/i.test(e)?"android":"ios"}function v(e=("undefined"==typeof window?"":window.navigator.userAgent),n,o){return o&&"web"!==o?g(e):n&&"WEB"!==n?/android/i.test(n)?"android":"ios":b.test(e)||"undefined"!=typeof window&&window.ReactNativeWebView?g(e):"web"}function y(e){return/iPad/i.test(e)||/Android/i.test(e)&&!/Mobile/i.test(e)||function(e){if(!/Macintosh/i.test(e))return!1;if("undefined"==typeof window||!window.navigator)return!1;const n=window.navigator.maxTouchPoints;return"number"==typeof n&&n>1}(e)}function A(e=("undefined"==typeof window?"":window.navigator.userAgent),n,o){return"web"!==v(e,n,o)?function(e){return/iPad|Macintosh|Linux; Android/i.test(e)}(e)&&y(e)?"tablet":"mobile":y(e)?"tablet":function(e){return/iPhone|iPod/i.test(e)||/Android/i.test(e)&&/Mobile/i.test(e)}(e)?"mobile":"desktop"}function P(e,n,o,i={}){const{embedPlatform:t,shopAppSurface:r}=i;return{...p(e,n,o),platform:v(void 0,t,r),deviceType:A(void 0,t,r)}}export{m as L,P as g,h as u};
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.