efficient-storefront-blocks 0.133.4 → 0.133.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +63 -0
- package/dist/chunks/{CustomHtmlCodeWindow-ZPYYAXIT.js → CustomHtmlCodeWindow-2CJO3FRG.js} +1 -1
- package/dist/chunks/{EditorPreviewCheckout-BYCGH5HR.js → EditorPreviewCheckout-524ZFYDR.js} +1 -1
- package/dist/chunks/{SiteEditorProvider-WZHTXNWZ.js → SiteEditorProvider-E53DXAEH.js} +1 -1
- package/dist/chunks/{chunk-RG2VEZZ7.js → chunk-5W6M2F4B.js} +1 -1
- package/dist/chunks/chunk-6JIG2WYA.js +1 -0
- package/dist/chunks/{chunk-MJ4NDWP7.js → chunk-LUHOZIHO.js} +1 -1
- package/dist/editor/components/ProductHeroSource.js +1 -1
- package/dist/editor/lib/document/blocks/commerce/GalleryB/fields.js +1 -1
- package/dist/editor/lib/document/blocks/commerce/ProductGallery/fields.js +1 -1
- package/dist/editor/lib/document/blocks/commerce/ProductHero/fields.js +1 -1
- package/dist/editor/lib/document/blocks/commerce/ProductName/fields.js +1 -1
- package/dist/editor/lib/document/blocks/commerce/SpecTable/fields.js +1 -1
- package/dist/editor/lib/document/blocks/commerce/index.d.ts +1 -1
- package/dist/editor/lib/storefront-editor-words.d.ts +19 -6
- package/dist/editor/lib/storefront-editor-words.js +1 -1
- package/dist/index.js +27 -27
- package/dist/links.js +1 -1
- package/dist/render/components/GalleryGrid.d.ts +2 -1
- package/dist/render/components/GalleryGrid.js +2 -2
- package/dist/render/components/PopupHost.js +1 -1
- package/dist/render/components/ProductGallery.d.ts +2 -1
- package/dist/render/components/ProductGallery.js +1 -1
- package/dist/render/components/ProductHeroPanel.d.ts +2 -1
- package/dist/render/components/ProductHeroPanel.js +1 -1
- package/dist/render/components/QuoteLink.d.ts +5 -0
- package/dist/render/components/QuoteLink.js +1 -1
- package/dist/render/components/card-pieces/CardBuyButton.js +1 -1
- package/dist/render/components/card-pieces/CardName.d.ts +3 -1
- package/dist/render/components/card-pieces/CardName.js +1 -1
- package/dist/render/components/card-pieces/HeadlineName.d.ts +3 -1
- package/dist/render/components/card-pieces/HeadlineName.js +1 -1
- package/dist/render/components/card-pieces/ProductCardState.d.ts +1 -0
- package/dist/render/components/pdp-dynamic/DynamicProductGallery.d.ts +2 -1
- package/dist/render/components/pdp-dynamic/DynamicProductGallery.js +1 -1
- package/dist/render/components/product-hero/SpinLayer.js +1 -1
- package/dist/render/components/product-hero/WheelHeroFitment.js +1 -1
- package/dist/render/components/product-hero/hero-view.d.ts +1 -0
- package/dist/render/components/product-hero/hero-view.js +1 -1
- package/dist/render/components/useProductSelection.d.ts +1 -0
- package/dist/render/components/useProductSelection.js +1 -1
- package/dist/render/lib/catalog/start-picks.d.ts +2 -0
- package/dist/render/lib/catalog/start-picks.js +1 -0
- package/dist/render/lib/content/title-look.d.ts +4 -0
- package/dist/render/lib/content/title-look.js +1 -1
- package/dist/render/lib/document/blocks/commerce/GalleryB/render.js +1 -1
- package/dist/render/lib/document/blocks/commerce/ProductGallery/meta.js +1 -1
- package/dist/render/lib/document/blocks/commerce/ProductGallery/render.js +1 -1
- package/dist/render/lib/document/blocks/commerce/ProductHero/render.js +1 -1
- package/dist/render/lib/document/blocks/commerce/ProductName/render.js +1 -1
- package/dist/render/lib/document/blocks/commerce/ProductSku/render.js +1 -1
- package/dist/render/lib/popup/site-popup-opens.d.ts +9 -0
- package/dist/render/lib/popup/site-popup-opens.js +1 -0
- package/dist/render/lib/sections/gallery-product-sets.d.ts +11 -0
- package/dist/render/lib/sections/gallery-product-sets.js +1 -0
- package/dist/render/lib/sections/hero-gallery.d.ts +2 -0
- package/dist/render/lib/sections/hero-gallery.js +1 -1
- package/dist/render/lib/sections/hero-option-looks.d.ts +2 -0
- package/dist/render/lib/sections/hero-option-looks.js +1 -1
- package/dist/render/lib/sections/spin-sets.d.ts +8 -0
- package/dist/render/lib/sections/spin-sets.js +1 -1
- package/dist/render/lib/wheels/plp-hydrate.js +1 -1
- package/dist/render/lib/wheels/price-display.d.ts +9 -0
- package/dist/render/lib/wheels/price-display.js +1 -1
- package/dist/render/lib/wheels/spec-sheet.d.ts +44 -4
- package/dist/render/lib/wheels/spec-sheet.js +1 -1
- package/dist/routine-index.json +1 -1
- package/dist/value-index.json +1 -1
- package/dist/words.d.ts +19 -6
- package/dist/words.js +1 -1
- package/package.json +1 -1
- package/dist/chunks/chunk-JBFEQFNX.js +0 -1
- /package/dist/chunks/{chunk-MJ4NDWP7.js.LEGAL.txt → chunk-LUHOZIHO.js.LEGAL.txt} +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{S as Q,X as Yt,_ as Xt,aa as Qt,ba as jt,da as U,g as Vt}from"./chunk-NQZ3O6A3.js";import{O as Wt,aa as st,ba as at,da as Bt,ka as ut,la as Gt}from"./chunk-UQDOJWLM.js";import{j as q}from"./chunk-LN6M3FAM.js";import{Hi as ve,Ii as Kt,ji as Be,pi as qt,vf as $t,wi as lt}from"./chunk-I4IY2GTB.js";import{c as zt}from"./chunk-454ZVMST.js";import{createContext as pr,useContext as an,useEffect as mr,useMemo as Pe,useState as on}from"react";function Jt(e,t){return e.map(n=>({partNumber:n.partNumber,quantity:n.wheels*t}))}function he(e,t){if(e.length===0)return null;let n=0;for(let r of e){let o=r.prices?.[t];if(typeof o!="number"||!Number.isFinite(o)||o<=0)return null;n+=o*r.wheels}return n}var ct=4,si=1;function ur(e){return e.spareAxle??"front"}var ai={unit:"set",spares:0,spareSide:"left"};function en(e){return e.unit==="single"?1:ct+e.spares}function tn(e,t){return[{partNumber:e.partNumber,wheels:en(t),prices:e.prices}]}function nn(e,t){let n=en(t)-ct;if(n<=0||e.length===0)return e;let r=cr(e),o=r?null:dr(e),i=r?r[t.spareSide]:o?o[t.spareSide][ur(t)]:0;return e.map((s,a)=>a===i?{...s,wheels:s.wheels+n}:s)}function cr(e){let t,n;for(let r=0;r<e.length;r+=1){let o=e[r].hand;if(o!=="left"&&o!=="right")continue;if((o==="left"?t:n)!==void 0)return null;o==="left"?t=r:n=r}return t!==void 0&&n!==void 0?{left:t,right:n}:null}function dr(e){let t={};for(let s=0;s<e.length;s+=1){let{hand:a,axle:c}=e[s];if(a!=="left"&&a!=="right"||c!=="front"&&c!=="rear")return null;let u=`${a}-${c}`;if(t[u]!==void 0)return null;t[u]=s}let{"left-front":n,"left-rear":r,"right-front":o,"right-rear":i}=t;return n!==void 0&&r!==void 0&&o!==void 0&&i!==void 0?{left:{front:n,rear:r},right:{front:o,rear:i}}:null}function dt(e){let t=typeof e.spares=="number"?e.spares:e.spare?1:0;return{unit:e.unit,spares:t,spareSide:e.spareSide??"left",...e.spareAxle?{spareAxle:e.spareAxle}:{}}}function ft(e,t){return t.spares>0?`${e} + spare`:e}function rn(e){return e.unit==="single"?"Single":ft(`Set of ${ct}`,e)}var li="data-add-to-basket",pt=9,fr="en",Zt=new Map;function ze(e,t,n){let r=`${e}|${t??""}|${n??""}`,o=Zt.get(r);return o||(o=new Intl.NumberFormat(fr,{style:"currency",currency:e,...t===void 0?{}:{minimumFractionDigits:t},...n===void 0?{}:{maximumFractionDigits:n}}),Zt.set(r,o)),o}function te(e,t,n=0){return ze(t,0,n).format(e)}function ui(e,t){return ze(t).format(e)}function ci(e,t){let n=e.savings[t];if(n===void 0)return null;let r=te(n,t);return e.savingIsFrom?`Save from ${r}`:`Save ${r}`}import{jsx as br}from"react/jsx-runtime";var gr="storefront-country",sn=gr,mt=pr(null);function yr(e){return ln(e,"catalogue")}function hr(e){return ln(e,"money")}function ln(e,t){let n=new Map(e.map(r=>[r.code,r.decimalPlaces]));return(r,o)=>{if(!o)return"";let i=n.get(o)??0;return ze(o,t==="money"?i:0,i).format(r)}}function gi({children:e,currencies:t,countries:n,defaultCurrency:r,defaultCountry:o}){let i=Pe(()=>t??[],[t]),s=Pe(()=>n??[],[n]),a=Pe(()=>r||i.find(g=>g.isDefault)?.code||i[0]?.code||"",[r,i]),c=Pe(()=>o||s.find(g=>g.isDefault)?.code||s[0]?.code||"",[o,s]),[u,m]=on(c),[C,p]=on(!1);mr(()=>{let g=q.getItem(sn);g&&s.some(L=>L.code===g)&&m(g),p(!0)},[s]);function A(g){m(g),q.setItem(sn,g)}let k=Pe(()=>{let g=s.find(b=>b.code===u)??null,L=g?.currency,w=L&&i.some(b=>b.code===L)?L:a,D=yr(i),E=hr(i);return{country:u,currency:w,setCountry:A,currencies:i,countries:s,activeCountry:g,formatPrice:(b,F)=>D(b,F??w),formatMoney:(b,F)=>E(b,F??w),ready:C}},[u,i,s,a,C]);return br(mt.Provider,{value:k,children:e})}function un(e){let t=an(mt);if(!t&&!e?.optional)throw new Error("useCurrency must be used within a CurrencyProvider");return t}function yi(){return an(mt)?.country??""}import{createContext as Gr,useCallback as _,useContext as Vr,useEffect as $,useMemo as Ln,useRef as j,useState as v}from"react";function cn(){return"/edit"}function fn(e,t){return e.valid?!1:e.reason==="firstOrderOnly"?!0:e.reason==="notEligible"&&!t}var pn="We'll confirm this discount when you place your order.",Si="Confirmed at checkout";function Ei(e){return e&&(e.valid||e.deferred)?e.code:void 0}var dn="coupon_code: ";function vi(e){return!(e instanceof Q)||e.status!==400||!e.message.startsWith(dn)?null:e.message.slice(dn.length)}function gt(e,t){return e.map(n=>({qty:n.qty,slug:n.slug,name:`${n.name.lead}${n.name.accent}`.trim(),finish:n.finishName,size:n.size,kind:n.kind,sku:n.sku,pack:n.pack,priceLabel:t(n)}))}var Cr=["width","profile","rim"],_i={width:"Width",profile:"Profile",rim:"Rim"},xr=/^\s*(\d{2,3})\s*\/\s*(\d{2,3})\s*[A-Za-z]*\s*(\d{2}(?:\.\d+)?)\s*$/,Sr={width:[100,500],profile:[20,100],rim:[10,30]};function yt(e){let t=xr.exec(e??"");if(!t)return null;let n={width:Number(t[1]),profile:Number(t[2]),rim:Number(t[3])};return Cr.every(o=>{let[i,s]=Sr[o];return n[o]>=i&&n[o]<=s})?n:null}function be(e){if(e.width==null)return"";if(e.profile==null)return String(e.width);let t=`${e.width}/${e.profile}`;return e.rim==null?t:`${t} R${e.rim}`}function Ai(e){return[be({width:e.width}),be({width:e.width,profile:e.profile}),be(e)]}function Li(e){if(!e||e.year===null)return null;let{make:t,model:n,year:r,modification:o}=e;return!t||!n||!o?null:{make:t,model:n,year:r,modification:o}}function vr(e,t){let n=new URLSearchParams({make:t.make,model:t.model,year:String(t.year),modification:t.modification});return`/api/v1/tyres/${encodeURIComponent(e)}/fitment?${n.toString()}`}function Te(e,t=""){return{vehicle:{...e,region:t},status:"unknown",oemSizes:[],variants:[]}}function Pr(e,t){if(typeof t!="object"||t===null)return Te(e);let n=t,r=typeof n.vehicle=="object"&&n.vehicle!==null?n.vehicle:{},o=typeof r.region=="string"?r.region:"",i=n.status;if(i!=="fits"&&i!=="doesNotFit")return Te(e,o);let s=Array.isArray(n.variants)?n.variants.filter(a=>typeof a=="object"&&a!==null&&typeof a.sku=="string"&&typeof a.fits=="boolean"):[];return s.length===0?Te(e,o):{vehicle:{make:typeof r.make=="string"?r.make:e.make,model:typeof r.model=="string"?r.model:e.model,year:typeof r.year=="number"?r.year:e.year,modification:typeof r.modification=="string"?r.modification:e.modification,region:o},status:i,oemSizes:Array.isArray(n.oemSizes)?n.oemSizes.filter(a=>typeof a=="string"):[],variants:s.map(a=>({sku:a.sku,size:typeof a.size=="string"?a.size:"",fits:a.fits}))}}async function Ni(e,t){try{let n=await Yt(vr(e,t),{baseUrl:""});return Pr(t,n)}catch(n){return n instanceof Q&&n.status>=400&&n.status<500?Te(t):{...Te(t),failed:!0}}}function Ii(e){if(!e)return[];let t=[];for(let n of[...e.frontTyres,...e.rearTyres]){let r=yt(n);if(!r)continue;let o=be(r);t.includes(o)||t.push(o)}return t}function Oi(e,t){if(t.length===0)return null;for(let n of e){let r=yt(n);if(!r)continue;let o=be(r);if(t.includes(o))return o}return null}function Tr(e,t){if(!e||e.status==="unknown")return"unknown";let n=e.variants.find(r=>r.sku===t);return n?n.fits?"fits":"doesNotFit":"unknown"}var _r="/tyres";function mn(e){return e?`${_r}/${e}`:null}function qe(e){let t=e.lastIndexOf(" ");return t===-1?{lead:"",accent:e}:{lead:e.slice(0,t+1),accent:e.slice(t+1)}}function Ar(e,t){return tn({partNumber:e.sku,prices:e.prices},t)}var Rr="Tyre";function gn(e,t,n,r){return{id:`${e.slug}|${t.sku}|${n.unit}|${n.spares>0?"spare":"no-spare"}`,slug:e.slug,name:qe(e.name),process:e.brand||Rr,positionNo:"01",config:[{label:t.size},{label:rn(n)}],finishName:"",size:t.size,components:Ar(t,n),qty:r,href:mn(e.slug)??void 0,kind:"tyre",sku:t.sku,pack:n}}function Bi(e){return e.kind==="tyre"}function zi(e,t){let n=e.prices?.[t];return typeof n!="number"||!Number.isFinite(n)||n<=0?!1:e.inStock}var kr="dually";function bt(e){let t=e.components.reduce((o,i)=>o+i.wheels,0)||4,n=e.kind,r=[n==="staggered"?"Staggered":n===kr?"Dually":""].filter(Boolean);return r.length?`${r.join(" ")} set of ${t}`:`Set of ${t}`}function wr(e,t){return[...new Set(e.filter(n=>!t||n.finishName===t).map(n=>n.size))]}function yn(e,t,n){if(!(!t||!n))return e.find(r=>r.finishName===t&&r.size===n)}function Lr(e){return e!=null&&e.inStock===!1}function Gi(e,t){return t?e.filter(n=>n.finishName===t&&Lr(n)):[]}function Vi(e,t,n){return t.findIndex((r,o)=>n[o]!==!1&&wr(e,r).length>0)}function Yi(e){let t=new Set((e.sizePairs??[]).map(o=>`${o.diameter}x${o.width}`)),n=e.spec?.pcds??[],r=e.spec?.etRange??[];return t.size===1&&n.length<=1&&(r.length===0||r[0]===r[r.length-1])}var bn="alloy-wheel",Nr="tyre";function Ke(e){return e.name||e.slug||"An item from your cart"}async function Cn(e,t){let n=[],r=new Map;for(let s of e){if(!s.slug){n.push(Ke(s));continue}let a=s.kind??bn,c=`${a}\0${s.slug}`,u=r.get(c);u?u.snaps.push(s):r.set(c,{kind:a,slug:s.slug,snaps:[s]})}let o=await Promise.all([...r.values()].map(s=>Ir(s,t))),i=[];for(let s of o)for(let a of s)a.ok?i.push(a.line):n.push(a.name);return{lines:i,dropped:n}}function hn(e){if(e instanceof Q&&e.status===404)return null;throw e}async function Ir(e,t){let n=e.snaps.map(r=>({ok:!1,name:Ke(r)}));if(e.kind===bn){let r=await t.getWheel(e.slug).catch(hn);return r?e.snaps.map(o=>Or(e.slug,r,o)):n}if(e.kind===Nr){let r=await t.getTyre(e.slug).catch(hn);return r?e.snaps.map(o=>Dr(r,o)):n}return n}function Or(e,t,n){let r=yn(t.variants,n.finish,n.size);if(!r)return{ok:!1,name:Ke(n)};let o=n.pack?dt(n.pack):void 0,i=(o?.spares??0)>0;return{ok:!0,line:{id:`${e}|${r.finishName}|${r.size}${i?"|spare":""}|restored`,slug:e,name:qe(t.name),process:t.process,positionNo:"01",config:[{label:r.size},{label:r.finishName,gold:!0},{label:o?ft(bt(r),o):bt(r)}],finishName:r.finishName,size:r.size,components:o&&i?nn(r.components,o):r.components,qty:n.qty,...i?{pack:o}:{}}}}function Dr(e,t){let n={ok:!1,name:Ke(t)};if(!t.pack||!t.sku)return n;let r=dt(t.pack),o=e.variants.find(i=>i.sku===t.sku);return o?{ok:!0,line:gn(e,o,r,t.qty)}:n}var Ge="Price on request",rs="Request a quote",xn="from ",os="From ",is="each",Sn="Free",ss="Updating";function Ct(e){return typeof e=="number"&&Number.isFinite(e)&&e>0}function xt(e,t){let n=e?.[t];return Ct(n)?n:null}function as(e,t,n,r){let o=xt(e,n),i=xt(t,n);return o===null&&i===null?0:o===null?1:i===null?-1:r==="asc"?o-i:i-o}function ls(e,t,n,r){if(n==null&&r==null)return!0;let o=xt(e,t);return!(o===null||n!=null&&o<n||r!=null&&o>r)}var Fr={priced:!1,unit:null,was:null,onSale:!1,setTotal:null};function Mr(e,t,n){if(!Ct(e))return Fr;let r=Ct(t)&&t>e?t:null;return{priced:!0,unit:e,was:r,onSale:r!==null,setTotal:n!=null?e*n:null}}function us(e,t,n=""){return!e.priced||e.unit==null?Ge:`${n}${te(e.unit,t)}`}function cs(e,t){return e.was==null?null:te(e.was,t)}function En(e,t,n=1){let r=he(e,t);if(r===null)return{priced:!1,unit:null,isFrom:!1,setTotal:null};let o=e.reduce((s,a)=>s+a.wheels,0),i=Math.min(...e.map(s=>s.prices[t]));return{priced:!0,unit:i,isFrom:i*o!==r,setTotal:r*n}}var Hr={priced:!1,unit:null,isFrom:!1,was:null,onSale:!1,setTotal:null};function ds(e,t,n,r=1){let o=Mr(e.prices[n],e.msrpPrices?.[n],4),i=o.setTotal==null?null:o.setTotal*r;if(!t)return{priced:o.priced,unit:o.unit,isFrom:!0,was:o.was,onSale:o.onSale,setTotal:null,fromSetTotal:i};let s=En(t.components,n,r);return s.priced?{priced:!0,unit:s.unit,isFrom:s.isFrom,was:null,onSale:!1,setTotal:s.setTotal,fromSetTotal:i}:{...Hr,fromSetTotal:i}}function fs(e,t,n=1){let r=e.map(s=>En(s,t,n)),o=r[0];return!o||o.unit==null||o.setTotal==null?null:r.every(s=>s.priced&&!s.isFrom&&s.unit===o.unit&&s.setTotal===o.setTotal)?{unit:o.unit,setTotal:o.setTotal}:null}function ps(e,t){let n=e.setTotal==null?e.openSettled:null;return`+${Ur(n?{...e,unit:n.unit,isFrom:!1}:e,t)}`}function Ur(e,t){return!e.priced||e.unit==null?Ge:`${e.isFrom?xn:""}${te(e.unit,t)}`}function ms(e,t){return e.was==null?null:te(e.was,t)}function gs(e,t){let n=e.savings[t];if(n===void 0||e.components.length===0)return null;let r=0;for(let i of e.components){let s=i.prices?.[t];if(typeof s!="number")return null;r+=s*i.quantity}let o=te(r-n,t);return{was:te(r,t),amount:e.savingIsFrom?`${xn}${o}`:o}}var $r=/^[^@\s]+@[^@\s]+\.[^@\s]+$/;function vn(e){return $r.test(e.trim())}var Pn="sf:ga-purchases",Wr=20;function _n(){return typeof window>"u"||window.parent!==window}function _e(...e){try{if(_n()||typeof window.gtag!="function")return;window.gtag(...e)}catch{}}function Br(e,t){let n=e.config.find(r=>r.gold)?.label;return{item_id:`${e.slug}|${e.finishName}|${e.size}`,item_name:`${e.name.lead}${e.name.accent}`.trim(),...n?{item_variant:n}:{},price:he(e.components,t)??0,quantity:e.qty}}function St(e,t){return e.filter(Ae).map(n=>Br(n,t))}function Ss(e){_e("event","view_item",{currency:e.currency,value:e.pricePerSet,items:[{item_id:e.itemId,item_name:e.itemName,...e.variant?{item_variant:e.variant}:{},price:e.pricePerSet,quantity:1}]})}function An(e,t){let n=St([e],t);n.length!==0&&_e("event","add_to_cart",{currency:t,value:n[0].price*n[0].quantity,items:n})}function Es(e){let t=St(e.lines,e.currency);t.length!==0&&_e("event","begin_checkout",{currency:e.currency,value:e.value,...e.coupon?{coupon:e.coupon}:{},items:t})}var Tn=new Set;function zr(e){if(Tn.has(e))return!1;Tn.add(e);try{let t=JSON.parse(q.getItem(Pn)??"[]");if(t.includes(e))return!1;q.setItem(Pn,JSON.stringify([...t,e].slice(-Wr)))}catch{}return!0}function vs(e){let t=e.confirmation;if(_n()||!zr(t.orderNumber))return;let n=t.currency,r=Number(t.grandTotal);_e("event","purchase",{transaction_id:t.orderNumber,currency:n,value:r,shipping:Number(t.freightCharge),...t.couponCode?{coupon:t.couponCode}:{},items:St(e.lines,n)}),e.adsSendTo&&_e("event","conversion",{send_to:e.adsSendTo,transaction_id:t.orderNumber,currency:n,value:r})}var qr="Arranged after review",Rn="Calculated at checkout",Kr=Rn,_s=Rn;function kn({quoted:e,optionCount:t,chosenAmount:n,couponWaivesFreight:r}){return e&&t===0?"arranged":r?"free":n===void 0?"pending":n===0?"free":"charged"}function wn(e,t){return e*(100-t)/100}function As({discount:e,deliverySaving:t},n){return[e>0?`\u2212 ${n(e)}`:null,t>0?`${n(t)} off delivery`:null].filter(Boolean).join(" \xB7 ")}function Rs(e){switch(e){case"arranged":return qr;case"pending":return Kr;case"free":return Sn;case"charged":return null}}import{jsx as jr}from"react/jsx-runtime";var Yr=400,Xr=400,Qr=1500,Et="storefront-cart";function Ae(e){return(e.components?.length??0)>0}function Nn(e,t){return{code:e,valid:t.valid,deferred:fn(t,t.askedAsShopper),message:t.message||void 0,effects:t.effects??void 0}}function On(e,t){return he(e.components,t)}function vt(e,t){let n=On(e,t);return n===null?null:n*e.qty}function In(e){return e!=="tyre"}var Dn=Gr(null);function zs({children:e,preview:t=!1}){let{currency:n,country:r,formatMoney:o}=un(),[i,s]=v(t),[a,c]=v([]),[u,m]=v([]),[C,p]=v([]),[A,k]=v(!1),g=j(new Set),[L,w]=v([]),[D,E]=v(!1),[b,F]=v(null),[K,oe]=v(null),[fe,h]=v(null),[P,x]=v(0),M=_(()=>x(l=>l+1),[]),[Z,Ce]=v(void 0),[G,Ne]=v(null),[T,H]=v(null),[V,ie]=v(!1),[O,pe]=v(null),se=j(void 0),Y=_(()=>s(!0),[]),J=_(()=>s(!1),[]),Ie=_(()=>s(l=>!l),[]);$(()=>{t||typeof window>"u"||new URLSearchParams(window.location.search).get("cart")==="open"&&Y()},[Y,t]);let W=cn(),X=j(W);$(()=>{X.current!==W&&(X.current=W,t||J())},[W,t,J]);let Oe=_(l=>{Ne(f=>f?.country===l?.country&&f?.subdivision===l?.subdivision&&f?.postcode===l?.postcode?f:l)},[]),I=_((l,f)=>{E(!0),!(!f||!In(l))&&w(d=>d.includes(f)?d:[...d,f])},[]),De=D||a.length>0,ae=j(!0);$(()=>(ae.current=!0,()=>{ae.current=!1}),[]),$(()=>{if(t)return;let l=[...L,...a.filter(d=>In(d.kind)).map(d=>d.slug)],f=[...new Set(l)].filter(d=>d&&!g.current.has(d));if(f.length!==0){for(let d of f)g.current.add(d);U.listWheelsBySlug(f).then(d=>{if(!ae.current||d.length===0)return;let y=new Set(d.map(S=>S.slug));m(S=>[...S.filter(ce=>!y.has(ce.slug)),...d])})}},[t,L,a]),$(()=>{if(t||!De||A)return;let l=!0;return U.listBundles().then(f=>{l&&(p(f),k(!0))}),()=>{l=!1}},[t,De,A]);let B=b?.deliveryOptions??[],xe=b?.courier??null;$(()=>{b&&pe(l=>l&&B.some(f=>f.id===l)?l:B[0]?.id??null)},[b]);let le=_(()=>a.filter(Ae).flatMap(l=>Jt(l.components,l.qty)),[a]),Se=_(async(l,f)=>{let d=l.trim().toUpperCase();if(!d)return;let y=le();if(y.length===0){H({code:d,valid:!1,message:"Add a wheel to the cart first."});return}ie(!0),se.current=f;try{let S=await U.validateCoupon({code:d,items:y,currency:n,shippingMethodId:O??void 0,customerEmail:f});H(Nn(d,S))}catch{H({code:d,valid:!1,unchecked:!0,message:"Could not check that code. Please try again."})}finally{ie(!1)}},[le,n,O]),me=_(()=>{H(null),se.current=void 0},[]),Fe=_(l=>{if(!T)return;let{code:f}=T;H(d=>d&&d.code===f?{code:f,valid:!1,refused:!0,message:l}:d)},[T]);$(()=>{if(!T||T.refused)return;let l=T.code,f=y=>y!==null&&y.code===l&&!y.refused,d=setTimeout(async()=>{let y=le();if(y.length===0){H(S=>f(S)?{code:l,valid:!1,message:"Add a wheel to the cart first."}:S);return}ie(!0);try{let S=await U.validateCoupon({code:l,items:y,currency:n,shippingMethodId:O??void 0,customerEmail:se.current});H(ce=>f(ce)?Nn(l,S):ce)}catch{}finally{ie(!1)}},Yr);return()=>clearTimeout(d)},[a,n,O]);let ue=T&&!T.refused?T.code:void 0;$(()=>{if(t)return;let l=!0,f=a,d=setTimeout(async()=>{let y=le();if(y.length===0){F(null),oe(null),Ce(void 0);return}try{let S=await U.quoteCart({items:y,currency:n,shippingMethodId:O??void 0,couponCode:ue,customerEmail:se.current||void 0,country:G?.country||r||void 0,subdivision:G?.country&&G.subdivision||void 0,postcode:G?.country&&G.postcode||void 0});if(!l)return;F(S),oe(f),h(null)}catch{if(!l)return;h(f)}Ce(ue)},Xr);return()=>{l=!1,clearTimeout(d)}},[a,n,O,ue,r,G,P]);let R=_(l=>{c(f=>{let d=f.findIndex(y=>y.id===l.id);return d===-1?[...f,l]:f.map((y,S)=>S===d?{...y,qty:Math.min(pt,y.qty+l.qty)}:y)}),An(l,n)},[n]),ee=_(l=>{c(f=>f.filter(d=>d.id!==l))},[]),Me=_((l,f)=>{let d=Math.max(1,Math.min(pt,f));c(y=>y.map(S=>S.id===l?{...S,qty:d}:S))},[]),He=_(l=>{c(l)},[]),[wt,et]=v(!1),[Lt,er]=v([]),Nt=j(a);Nt.current=a,$(()=>{if(t)return;let l=[];try{let d=JSON.parse(q.getItem(Et)??"[]");Array.isArray(d)&&(l=d)}catch{}if(l.length===0){et(!0);return}let f=!0;return Cn(l,U).then(({lines:d,dropped:y})=>{f&&(Nt.current.length===0&&(He(d),er(y)),et(!0))},d=>{f&&et(!0)}),()=>{f=!1}},[t,He]),$(()=>{if(t||!wt)return;let l=a.filter(Ae);if(l.length===0){q.removeItem(Et);return}q.setItem(Et,JSON.stringify(gt(l,()=>"")))},[a,t,wt]);let[Ee,tr]=v(null),It=j(null);It.current=Ee;let z=j(null),tt=j(""),Ot=_((l,f)=>{let d=l.trim().toLowerCase();vn(d)&&tr(y=>y&&y.email===d&&y.firstName===(f??"")?y:{email:d,firstName:f??""})},[]);$(()=>{if(t||!Ee)return;let l=gt(a.filter(Ae),y=>vt(y,n)===null?Ge:o(vt(y,n),n)),f={email:Ee.email,firstName:Ee.firstName,currency:n,items:l},d=JSON.stringify(f);if(d!==tt.current)return z.current&&clearTimeout(z.current),z.current=setTimeout(()=>{z.current=null,tt.current=d,U.captureCart(f).catch(y=>{})},Qr),()=>{z.current&&(clearTimeout(z.current),z.current=null)}},[a,Ee,n,t]);let Dt=_(()=>{z.current&&(clearTimeout(z.current),z.current=null);let l=It.current;l&&(tt.current="",U.captureCart({email:l.email,firstName:l.firstName,currency:n,items:[]}).catch(f=>{}))},[n]),Ft=Ln(()=>{let l=a.reduce((N,ye)=>{let We=vt(ye,n);return We===null?N:N+We},0),f=a.some(N=>On(N,n)===null),d=a.reduce((N,ye)=>N+ye.qty,0),y=T?.valid?T.effects:void 0,S=y?Math.min(l,Number(y.discountAmount)):0,ce=b?.bundleDiscount??0,rr=b?.appliedBundles??[],Ue=!!y?.freeShipping,ge=B.find(N=>N.id===O),nt=Number(y?.deliveryDiscountPercent??0),$e=!Ue&&nt>0&&nt<100?nt:0,rt=$e>0&&ge?wn(ge.amount,$e):void 0,ot=Ue?0:rt!==void 0&&Z!==ue?rt:b?.shipping??rt??ge?.amount??0,or=$e>0&&ge?Math.max(0,ge.amount-ot):0,ir=kn({quoted:b!==null,optionCount:B.length,chosenAmount:ge?.amount,couponWaivesFreight:Ue}),it={};for(let N of y?.freeUnits??[])it[N.partNumber]=(it[N.partNumber]??0)+N.quantity;let sr=b?.tax??null,ar=b?b.grandTotal:l-S-ce+ot;return{sets:d,units:a.reduce((N,ye)=>N+(ye.components??[]).reduce((We,lr)=>We+lr.wheels*ye.qty,0),0),subtotal:l,hasUnpricedLine:f,discount:S,bundleDiscount:ce,appliedBundles:rr,shipping:ot,freeShipping:Ue,deliveryDiscountPercent:$e,deliverySaving:or,shippingStatus:ir,freeUnitsByPartNumber:it,tax:sr,grand:ar,repricing:!!T?.refused&&b!==null&&Z===T?.code,quoted:b!==null&&K===a,serverSubtotal:b?.subtotal??null,quoteFailed:fe===a,currency:n}},[a,n,T,ue,B,O,b,Z,K,fe]),Mt=j(!0),Ht=_(l=>{Mt.current=l},[]),Ut=_(l=>{R(l),Mt.current&&Y()},[R,Y]),nr=Ln(()=>({isOpen:i,preview:t,open:Y,close:J,toggle:Ie,items:a,catalog:u,bundles:C,warmCatalog:I,add:R,addAndOpen:Ut,setAutoOpen:Ht,remove:ee,setQty:Me,replaceItems:He,restoreDropped:Lt,identify:Ot,clearCapturedCart:Dt,coupon:T,applyCoupon:Se,removeCoupon:me,refuseCoupon:Fe,couponBusy:V,deliveryOptions:B,setQuoteDestination:Oe,courier:xe,requote:M,shippingMethodId:O,setShippingMethodId:pe,totals:Ft}),[i,t,Y,J,Ie,a,u,C,I,R,Ut,Ht,ee,Me,He,Lt,Ot,Dt,T,Se,me,Fe,V,B,Oe,xe,M,O,Ft]);return jr(Dn.Provider,{value:nr,children:e})}function Fn(){let e=Vr(Dn);if(!e)throw new Error("useCart() must be called inside <CartProvider>. Mount the provider in app/layout.tsx.");return e}import{cache as ao}from"react";function Mn(e){return/(?:^|\|)(?:slug|xhost):/.test(e)}function Hn(e,t,n,r){for(;e.size>=t;){let o,i;for(let[a,c]of e){if(c.expiresAt<=r){o=a;break}i===void 0&&n(a)&&(i=a)}let s=o??i??e.keys().next().value;if(s===void 0)return;e.delete(s)}}var Zr=6e4,Jr=5e3,eo=500,Ve=new Map;async function to(e){let{host:t,matchesRequestHost:n}=await Xt();if(!t)return"";let r=await Qt();return r?`${e}|slug:${encodeURIComponent(t)}/${encodeURIComponent(r)}`:n?`${e}|host:${t}`:`${e}|xhost:${t}`}async function Un(e,t){if(await jt()!==null)return t();let n=await to(e);if(!n)return t();let r=Date.now(),o=Ve.get(n);if(o&&o.expiresAt>r)return o.load;let i=await t(),s=i.outcome.state==="failed",a=s?Jr:Zr,c=Ve.get(n)?.lastGood,u=i.outcome.state==="ok"?i:s?c:void 0,m=s&&u?u:i;return Hn(Ve,eo,Mn,r),Ve.set(n,{load:m,expiresAt:r+a,lastGood:u}),m}var no=404;function ro(e){if(e instanceof Q&&e.status===no)return{state:"absent"};let t=e instanceof Q?e.status:-1,n=e instanceof Error?e.message:String(e);return{state:"failed",status:t,detail:n}}var oo="[storefront:chrome-load-failed]";function io(e,t){console.error(`${oo} ${e} status=${t.status} \u2014 serving fallback chrome`,t.detail)}async function $n(e,t,n,r){try{let o=await t();return r?.(o)?{value:o,outcome:{state:"absent"}}:{value:o,outcome:{state:"ok"}}}catch(o){let i=ro(o);return i.state==="failed"&&io(e,i),{value:n,outcome:i}}}function so(e){return e==="production"?"silent":"banner"}var js=so("production");function lo(e,t){return e?.trim()||t}function ia({legalName:e,foundedYear:t,siteName:n},r=new Date().getFullYear()){let o=lo(e,n);return`\xA9 ${t&&t<r?`${t}\u2013${r}`:`${r}`} ${o}`}var uo={name:ve,legalName:null,foundedYear:null,faviconUrl:null,currencies:[],defaultCurrency:null,countries:[],defaultCountry:null,commerceEnabled:!0,cardPayments:!1,paymentMethods:[],paypalClientId:null,paypalEnvironment:null,squareApplicationId:null,squareLocationId:null,squareEnvironment:null,ga4MeasurementId:null,googleAdsId:null,googleAdsConversionLabel:null,metaPixelId:null,consentEnabled:!1,consentPrivacyPage:null,consentNoticeOptOut:!1,privacyPage:null,termsPage:null,footerCookieSettings:!0,footerSitemap:!0,socialLinks:ut},sa=ao(async()=>Un("site",()=>$n("site",async()=>{let e=await U.getSite();return{name:Kt(e.name),legalName:e.legalName?.trim()||null,foundedYear:e.foundedYear??null,faviconUrl:e.faviconUrl??null,currencies:e.currencies??[],defaultCurrency:e.defaultCurrency??null,countries:e.countries??[],defaultCountry:e.defaultCountry??null,commerceEnabled:e.commerceEnabled??!0,cardPayments:e.cardPayments??!1,paymentMethods:e.paymentMethods??(e.cardPayments?["card"]:[]),paypalClientId:e.paypalClientId??null,paypalEnvironment:e.paypalEnvironment??null,squareApplicationId:e.squareApplicationId??null,squareLocationId:e.squareLocationId??null,squareEnvironment:e.squareEnvironment??null,ga4MeasurementId:e.ga4MeasurementId??null,googleAdsId:e.googleAdsId??null,googleAdsConversionLabel:(e.googleAdsId?e.googleAdsConversionLabel:null)??null,metaPixelId:e.metaPixelId??null,consentEnabled:e.consentEnabled??!1,consentPrivacyPage:e.consentPrivacyPage??null,consentNoticeOptOut:e.consentNoticeOptOut??!1,privacyPage:e.privacyPage??null,termsPage:e.termsPage??null,footerCookieSettings:e.footerCookieSettings??!0,footerSitemap:e.footerSitemap??!0,socialLinks:Gt(e.socialLinks)}},uo)));var aa={name:ve,legalName:null,foundedYear:null,faviconUrl:null,currencies:[{code:"USD",symbol:"$",decimalPlaces:2,isDefault:!0}],defaultCurrency:"USD",countries:[{code:"US",name:"United States",currency:"USD",url:"",isDefault:!0,chargeTax:!1,taxDisplay:"none",taxName:"",taxRate:null,postalLabel:"Zip Code"}],defaultCountry:"US",commerceEnabled:!0,cardPayments:!0,paymentMethods:["card"],paypalClientId:null,paypalEnvironment:null,squareApplicationId:null,squareLocationId:null,squareEnvironment:null,ga4MeasurementId:null,googleAdsId:null,googleAdsConversionLabel:null,metaPixelId:null,consentEnabled:!1,consentPrivacyPage:null,consentNoticeOptOut:!1,privacyPage:null,termsPage:null,footerCookieSettings:!0,footerSitemap:!0,socialLinks:ut};import{jsx as co}from"react/jsx-runtime";function ua({tone:e="bad",role:t,children:n}){return co("div",{role:t,className:["border bg-surface px-4 py-3 text-[14px] leading-relaxed text-fg",e==="good"?"border-accent":e==="bad"?"border-alert":"border-line"].join(" "),children:n})}import{jsx as ke,jsxs as Pt}from"react/jsx-runtime";import{useEffect as Ye,useId as go,useRef as Bn,useState as Xe}from"react";import{useRootIsDark as yo}from"efficient-shell/theme";import{efficientClientOpen as fo}from"efficient-easel/screen/lib/session";var Re=new Map,po=64;async function mo(e){if(!fo())return null;try{let t=await fetch(`${zt()}/logo-analysis.json?url=${encodeURIComponent(e)}`);if(!t.ok)return null;let n=await t.json();if(!n||typeof n!="object")return null;let{reversed:r,inkIsDark:o}=n;return typeof r!="string"?null:{reversed:r,inkIsDark:typeof o=="boolean"?o:null}}catch{return null}}function Wn(e){let t=Re.get(e);if(t)return t;let n=mo(e);if(Re.set(e,n),Re.size>po){let r=Re.keys().next();r.done||Re.delete(r.value)}return n}var ho=202/22,bo=.88,Ra=16,Co="invert(1)";function ka({variant:e="header",scrolled:t=!0,src:n,reverse:r=!1,color:o=null,onLightSurface:i,reversedSrc:s,inkIsDark:a,size:c="medium",sizePx:u,sizeUnit:m,wordmark:C,siteName:p=ve,fitToContainer:A=!1,fitWordmarkToContainer:k=!1,fitFloorPx:g,hideClass:L,hideAttrs:w,part:D}){let E=C&&C.trim()?C.trim():p,[b,F]=Xe(null),K=Bn(null),oe=R=>{K.current=R};Ye(()=>{F(K.current?.ownerDocument??null)},[]);let fe=!yo({doc:b,whenUnset:!0}),h=n&&n.trim()?n.trim():null,P=!!h&&Vt(h),x=i??(fe&&t),M=o&&o.trim()?o.trim():null,Z=r&&!M,Ce=`logo-color-${go().replace(/[^A-Za-z0-9_-]/g,"")}`,G=Z&&P&&h&&s!=null?{reversed:s,inkIsDark:a??null}:null,Ne=G!==null,[T,H]=Xe(null);Ye(()=>{if(!Z||!h||!P||Ne){H(null);return}let R=!1;return H(null),Wn(h).then(ee=>{R||H(ee)}),()=>{R=!0}},[Z,h,P,Ne]);let V=G??T,ie=!!V&&V.inkIsDark!==null&&(x?!V.inkIsDark:V.inkIsDark),O=Z&&!!h&&!P&&!x,pe=ie&&V?V.reversed:h,se=pe?[pe]:[],[Y,J]=Xe(0);Ye(()=>{J(0)},[h,ie]);let Ie=e==="footer"?at:st[c],W=u&&u>0?u:Ie,X=(u&&u>0?$t(u,m,"size",Bt):null)??`${W}px`,Oe=Math.round(W*ho),I=Y<se.length?se[Y]:null,[De,ae]=Xe(pe),B=I!==null&&I===De,xe=Bn(null);Ye(()=>{let R=xe.current;if(!R||!R.complete)return;if(R.naturalWidth>0||R.naturalHeight>0){ae(I);return}let ee=!1;return R.decode().then(()=>!ee&&ae(I),()=>!ee&&J(Me=>Me+1)),()=>{ee=!0}},[I]);let le=A||k,Se=`calc(100cqi / ${((E.length+1)*bo).toFixed(2)})`,me=le&&g&&g>0?X===`${W}px`?`${Math.min(g,W)}px`:`min(${g}px, ${X})`:null,Fe=le?me===null?`min(${X}, ${Se})`:`clamp(${me}, ${Se}, ${X})`:X,ue=Pt("span",{className:`font-display font-bold tracking-[0.18em] ${me===null?"whitespace-nowrap":"whitespace-normal"}`,style:{fontSize:Fe,lineHeight:1,...M?{color:M}:{}},"aria-label":E,children:[E,ke("span",{className:"text-accent",style:M?{color:M}:void 0,children:"."})]});return Pt("span",{ref:oe,className:Wt("inline-flex items-center",L??""),...w,...D,children:[!B&&ue,M&&I&&ke("svg",{"aria-hidden":"true",focusable:"false",width:"0",height:"0",style:{position:"absolute"},children:Pt("filter",{id:Ce,colorInterpolationFilters:"sRGB",children:[ke("feFlood",{style:{floodColor:M}}),ke("feComposite",{in2:"SourceAlpha",operator:"in"})]})}),I&&ke("img",{ref:xe,src:I,alt:E,width:Oe,height:W,className:"shrink-0 object-contain",style:{...B?{height:X,width:"auto",...A?{maxWidth:"100cqi"}:{}}:{display:"none"},...O?{filter:Co}:{},...M?{filter:`url(#${Ce})`}:{}},onLoad:()=>ae(I),onError:()=>J(R=>R+1)},I)]})}import{parseOption as Qe}from"efficient-shell/format";function Ia(e){return typeof e=="number"&&Number.isInteger(e)&&e>=Be.min&&e<=Be.max?e:Be.default}var Oa="fixed inset-x-0 bottom-0 top-[var(--sf-header-h,88px)]",Da=e=>!!e&&e.startsWith("/wheels/")&&e!=="/wheels",xo="data-site-main",So="shared";function Fa(e){if(!e)return!1;if(e.querySelector(`.${qt}, [${lt}="own"]`))return!0;let t=e.querySelector(`main[${xo}]`);return t!=null&&t.querySelector(`[${lt}="${So}"]`)==null}var Ma=(e,t)=>!e&&t?"var(--section-bg)":"var(--bg)",Eo=[{label:"Uppercase",value:"uppercase"},{label:"Capitalised",value:"capitalised"}],vo="uppercase",Ha=e=>Qe(Eo,vo,e),Po=[{label:"Icon",value:"icon"},{label:"Text",value:"text"}],To="icon",Ua=e=>Qe(Po,To,e),$a=[{label:"Own row",value:"top"},{label:"Same row",value:"inline"}],Wa="top",Ba=e=>e==="inline"?"inline":e==="top"||e==="bottom"?"top":null,_o="custom";function za(e,t){return e!==_o||typeof t!="string"?null:t.trim()||null}var qa=80,Ao=0,Ro=100,Ka="data-header-link-opacity",Ga="--sf-header-link-opacity";function Va(e){if(!(typeof e!="number"||!Number.isFinite(e)))return Math.min(Ro,Math.max(Ao,Math.round(e)))}var ko=[{label:"Medium",value:"medium"},{label:"Large",value:"large"}],wo="medium",Lo={medium:{size:18,stroke:1.6},large:{size:20,stroke:1.4}},No=[{label:"Cart",value:"cart"},{label:"Bag",value:"bag"}],Io="cart",Ya=e=>({cart:Qe(No,Io,e.cartIcon),glyph:Lo[Qe(ko,wo,e.iconSize)]});var Qa="w-full border-2 border-line bg-bg px-4 py-4 font-display text-[17px] tracking-[-0.005em] text-fg outline-none transition-colors placeholder:text-fg-dim hover:border-fg-dim focus:border-accent",zn="w-0 min-w-0 flex-1",ja="w-0 min-w-[7rem] flex-1";import{jsx as we,jsxs as Do}from"react/jsx-runtime";function Oo({spokes:e,mesh:t=!1,className:n}){let s=c=>Math.round(c*1e3)/1e3,a=[];for(let c=0;c<e;c++){let u=c/e*Math.PI*2-Math.PI/2;if(a.push({x1:s(100+Math.cos(u)*22),y1:s(100+Math.sin(u)*22),x2:s(100+Math.cos(u)*86),y2:s(100+Math.sin(u)*86),main:!0}),t){let m=u+Math.PI/e;a.push({x1:s(100+Math.cos(m)*22*1.4),y1:s(100+Math.sin(m)*22*1.4),x2:s(100+Math.cos(m)*78),y2:s(100+Math.sin(m)*78),main:!1})}}return Do("svg",{viewBox:"0 0 200 200",fill:"none",stroke:"currentColor",className:n??"block h-[70%] w-[70%] transition-transform duration-700 [transition-timing-function:cubic-bezier(.2,.6,.2,1)]",children:[we("circle",{cx:100,cy:100,r:92,strokeWidth:2}),we("circle",{cx:100,cy:100,r:84,strokeWidth:1,opacity:.4}),we("circle",{cx:100,cy:100,r:22,strokeWidth:2}),we("circle",{cx:100,cy:100,r:6,fill:"currentColor"}),a.map((c,u)=>we("line",{x1:c.x1,y1:c.y1,x2:c.x2,y2:c.y2,stroke:"currentColor",strokeWidth:c.main?6:3,strokeLinecap:"round",opacity:c.main?1:.5},u))]})}var tl="#c9a461",qn=[{f:"black",label:"Black",hex:"#171717"},{f:"silver",label:"Silver",hex:"#cccccc"},{f:"bronze",label:"Bronze",hex:"#8a6438"},{f:"graphite",label:"Graphite",hex:"#3a3c3f"},{f:"red",label:"Candy Red",hex:"#7a0f14"}],nl={name:"",color:"var(--fg)",family:"silver",src:""};function Fo(e,t){let n=r=>{let o=qn.findIndex(i=>i.f===r);return o===-1?qn.length:o};return n(e)-n(t)||e.localeCompare(t)}function rl(e){let t=new Set;for(let n of e)for(let r of n.finishes??[])r?.family&&t.add(r.family);return[...t].sort(Fo)}import{useEffect as Mo,useRef as Kn,useState as Ho}from"react";import{jsx as de,jsxs as Tt}from"react/jsx-runtime";function Uo({customerEmail:e,disabled:t=!1}){let{coupon:n,applyCoupon:r,removeCoupon:o,couponBusy:i}=Fn(),[s,a]=Ho(""),c=Kn(!1),u=Kn(null);Mo(()=>{!c.current||n===null||(c.current=!1,u.current?.focus())},[n]);async function m(){t||i||!s.trim()||(c.current=!0,await r(s,e),a(""))}return Tt("div",{className:"flex flex-col gap-2",children:[n===null?Tt("div",{className:"flex border border-line",children:[de("input",{type:"text",value:s,onChange:C=>a(C.target.value),onKeyDown:C=>{C.key==="Enter"&&(C.preventDefault(),m())},placeholder:"Coupon code","aria-label":"Coupon code",disabled:t,className:`${zn} bg-transparent px-4 py-4 font-mono text-[11px] uppercase tracking-[0.18em] text-fg outline-none placeholder:text-fg-dim`}),de("button",{type:"button",onClick:()=>{m()},disabled:i||t,className:"border-l border-line px-4 font-mono text-[10px] uppercase tracking-[0.26em] text-btn transition-colors hover:bg-btn hover:text-btn-ink disabled:cursor-wait disabled:opacity-60",children:i?"\u2026":"Apply"})]}):Tt("div",{className:["flex items-center justify-between gap-3 border px-4 py-3",n.valid?"border-accent":"border-line"].join(" "),style:n.valid?{background:"color-mix(in oklab, var(--accent) 8%, transparent)"}:void 0,children:[de("span",{className:["font-mono text-[11px] uppercase tracking-[0.22em]",n.valid?"text-accent":n.deferred||n.unchecked?"text-fg":"text-fg-dim line-through"].join(" "),children:n.code}),n.unchecked&&de("button",{type:"button",onClick:()=>{r(n.code,e)},disabled:i||t,className:"ml-auto font-mono text-[10px] uppercase tracking-[0.26em] text-btn transition-colors hover:text-fg disabled:cursor-wait disabled:opacity-60",children:i?"\u2026":"Try again"}),!t&&de("button",{ref:u,type:"button",onClick:o,"aria-label":`Remove coupon ${n.code}`,className:"font-mono text-[12px] text-fg-dim transition-colors hover:text-fg",children:"\u2715"})]}),n?.deferred?de("p",{className:"font-mono text-[10px] uppercase tracking-[0.18em] text-fg-dim",children:pn}):n&&!n.valid&&n.message&&de("p",{role:"alert",className:"font-mono text-[10px] uppercase tracking-[0.18em] text-alert",children:n.message})]})}var _t="Ads on. Shopper can opt out.",je="Ads and analytics off until Accept",$o={us:{region:"us",name:"United States",model:"opt-out",law:"California CCPA / CPRA, other state laws",beforeChoice:_t,footerLink:"Do Not Sell or Share My Personal Information",panelEyebrow:"Do not sell or share",adsRowName:"Sale or sharing for ads"},ca:{region:"ca",name:"Canada",model:"opt-in",law:"PIPEDA, Quebec Law 25",beforeChoice:je,footerLink:"Privacy choices",panelEyebrow:"Privacy choices",adsRowName:"Advertising"},au:{region:"au",name:"Australia",model:"opt-out",law:"Privacy Act 1988 (APPs)",beforeChoice:_t,footerLink:"Privacy choices",panelEyebrow:"Privacy choices",adsRowName:"Advertising"},nz:{region:"nz",name:"New Zealand",model:"opt-out",law:"Privacy Act 2020",beforeChoice:_t,footerLink:"Privacy choices",panelEyebrow:"Privacy choices",adsRowName:"Advertising"},uk:{region:"uk",name:"United Kingdom",model:"opt-in",law:"PECR, UK GDPR",beforeChoice:je,footerLink:"Cookie settings",panelEyebrow:"Cookie settings",adsRowName:"Advertising"},eu:{region:"eu",name:"European Union",model:"opt-in",law:"ePrivacy Directive, GDPR",beforeChoice:je,footerLink:"Cookie settings",panelEyebrow:"Cookie settings",adsRowName:"Advertising"},other:{region:"other",name:"All other countries",model:"opt-in",law:"Safe default",beforeChoice:je,footerLink:"Cookie settings",panelEyebrow:"Cookie settings",adsRowName:"Advertising"}};function Wo(e){let t=[...e.googleAds?["Google"]:[],...e.meta?["Facebook","Instagram"]:[]];return t.length<=1?t.join(""):`${t.slice(0,-1).join(", ")} and ${t[t.length-1]}`}function dl(e,t,n){let r=Wo(n),o=r?`We use cookies to count visits and to show you ${t} ads on ${r}.`:"We use cookies to count visits.";return e.model==="opt-in"?{heading:r?"Cookies and ads":"Cookies",before:`${o} Nothing loads until you choose. You can change this at any time with `,link:e.footerLink,after:" at the bottom of every page."}:{heading:r?"Cookies and ads":"Cookies",before:`${o} You can say no at any time: choose Privacy choices, or use `,link:e.footerLink,after:" at the bottom of every page."}}var fl={accept:"Accept all",reject:"Reject all",choose:"Choose",save:"Save",ok:"OK",privacyChoices:"Privacy choices",privacyPolicy:"Privacy Policy",alwaysOn:"Always on",close:"Close",cookieSettings:"Cookie settings"};var Bo={asked:!1,region:"other",model:"opt-in",analytics:!0,ads:!0,chosen:!0,gpc:!1};var zo=Bo;function yl(e=zo){if(e.asked)return e.ads?"granted":"denied"}function bl(){let e=typeof crypto<"u"?crypto:void 0;if(typeof e?.randomUUID=="function")return e.randomUUID();let t=new Uint8Array(16);if(typeof e?.getRandomValues=="function")e.getRandomValues(t);else for(let r=0;r<t.length;r++)t[r]=Math.floor(Math.random()*256);t[6]=t[6]&15|64,t[8]=t[8]&63|128;let n=Array.from(t,r=>r.toString(16).padStart(2,"0")).join("");return`${n.slice(0,8)}-${n.slice(8,12)}-${n.slice(12,16)}-${n.slice(16,20)}-${n.slice(20)}`}import{Children as Ko,isValidElement as Go,useEffect as Vn,useId as Vo,useLayoutEffect as Qn,useRef as ne,useState as Yn}from"react";var Ze=(e,t)=>!!e[t]&&!e[t].disabled;function At(e,t,n){let r=e.length;for(let o=1;o<=r;o++){let i=((t+n*o)%r+r)%r;if(Ze(e,i))return i}return t}function Rt(e,t){return At(e,t===1?-1:e.length,t)}function kt(e,t){return Ze(e,t)?t:Math.max(Rt(e,1),0)}function Gn(e,t,n){let{open:r,focus:o}=e,i=s=>({...e,...s});if(t.length===1&&/\S/.test(t)){let s=e.typed+t.toLowerCase(),a=n.findIndex((c,u)=>Ze(n,u)&&c.label.toLowerCase().startsWith(s));return{state:i({open:!0,typed:s,focus:a>=0?a:o}),handled:!0}}if(!r)return t==="ArrowDown"||t==="ArrowUp"||t==="Enter"||t===" "?{state:i({open:!0,typed:""}),handled:!0}:{state:e,handled:!1};switch(t){case"ArrowDown":return{state:i({focus:At(n,o,1)}),handled:!0};case"ArrowUp":return{state:i({focus:At(n,o,-1)}),handled:!0};case"Home":return{state:i({focus:Rt(n,1)}),handled:!0};case"End":return{state:i({focus:Rt(n,-1)}),handled:!0};case"Enter":case" ":return Ze(n,o)?{state:i({open:!1,typed:""}),commit:o,refocus:!0,handled:!0}:{state:e,handled:!0};case"Escape":return{state:i({open:!1,typed:""}),refocus:!0,handled:!0};case"Tab":return{state:i({open:!1,typed:""}),handled:!1};default:return{state:e,handled:!1}}}import{placeMenu as Yo}from"efficient-shell/ui";import{Fragment as ti,jsx as re,jsxs as jn}from"react/jsx-runtime";var Xn={body:"text-[length:var(--size-body,14px)]",label:"text-[length:var(--size-label,13px)]"};function Xo({items:e,value:t,onPick:n,open:r,onOpen:o,onClose:i}){let[s,a]=Yn(!1),c=r!==void 0,u=c?r:s,[m,C]=Yn(0),p=ne({text:"",timer:0}),A=ne(null),k=ne(null),g=ne(null),L=Vo(),w=ne(null),D=e.findIndex(h=>h.value===t),E=h=>{h!==u&&(c||a(h),h?o?.():i?.())},b=h=>{let P=e[h];!P||P.disabled||(n(P.value),E(!1),k.current?.focus())},F=h=>{let P={open:u,focus:u?m:kt(e,D),typed:p.current.text},x=Gn(P,h,e);return!x.handled&&x.state.open===u?!1:(x.state.typed!==P.typed&&(p.current.text=x.state.typed,window.clearTimeout(p.current.timer),p.current.timer=window.setTimeout(()=>{p.current.text=""},500)),C(x.state.focus),x.commit!==void 0?b(x.commit):E(x.state.open),x.refocus&&k.current?.focus(),x.handled)},K=ne(F);K.current=F;let oe=ne(()=>E(!1));oe.current=()=>E(!1);let fe=h=>{u||(w.current=h.nativeEvent,K.current(h.key)&&h.preventDefault())};return Vn(()=>{if(!u)return;let h=x=>{A.current?.contains(x.target)||oe.current()},P=x=>{x!==w.current&&K.current(x.key)&&x.preventDefault()};return document.addEventListener("mousedown",h),document.addEventListener("keydown",P),()=>{document.removeEventListener("mousedown",h),document.removeEventListener("keydown",P)}},[u]),Vn(()=>{u&&(p.current.text||C(kt(e,D)))},[u]),Qn(()=>{if(!u||!g.current)return;g.current.children.item(m)?.scrollIntoView({block:"nearest"})},[m,u]),{open:u,toggle:()=>E(!u),close:()=>E(!1),focusIdx:m,setFocusIdx:C,pick:h=>b(e.findIndex(P=>P.value===h)),wrapRef:A,triggerRef:k,listRef:g,listId:L,onTriggerKeyDown:fe,activeId:u?`${L}-${m}`:void 0}}var Qo={select:{list:"absolute left-0 top-full z-50 mt-1 max-h-[280px] w-max min-w-full overflow-y-auto border-2 border-accent bg-bg shadow-xl",item:(e,t,n)=>["px-3 py-3 font-mono text-[13px] font-semibold uppercase tracking-[0.1em] transition-colors whitespace-nowrap",n?"cursor-not-allowed opacity-40":"cursor-pointer",e&&!n?"bg-accent text-bg":"bg-bg text-fg"].join(" ")},cell:{list:"absolute left-0 top-full z-50 mt-1 max-h-[320px] w-max min-w-full overflow-y-auto border-2 border-accent bg-bg shadow-xl",item:e=>[`cursor-pointer whitespace-nowrap px-6 py-3 font-mono ${Xn.label} font-semibold uppercase tracking-[0.1em] transition-colors`,e?"bg-accent text-bg":"bg-bg text-fg"].join(" "),pickerMarker:!0},hairline:{list:"absolute left-0 top-full z-50 max-h-[320px] w-full overflow-y-auto border border-line bg-bg shadow-[0_6px_20px_rgba(0,0,0,0.10)]",item:(e,t)=>[`flex cursor-pointer items-center justify-between gap-4 border-b border-line px-4 py-3 text-left ${Xn.body} transition-colors last:border-b-0`,t?"border-fg font-medium text-fg":e?"border-fg text-fg":"text-fg-dim"].join(" "),pickerMarker:!0},region:{list:"absolute right-0 top-full z-[200] mt-2 flex min-w-[240px] flex-col border border-line bg-surface text-fg",item:(e,t,n,r)=>["flex w-full cursor-pointer items-center gap-3 px-4 py-3 text-left transition-colors","font-mono text-[13px] uppercase tracking-[0.18em]",e?"bg-surface-2 text-fg":"",r?"":"border-b border-line",t?"text-accent":""].join(" "),itemStyle:e=>e?void 0:{color:"color-mix(in oklab, currentColor 80%, transparent)"}}};function jo(e,t){Qn(()=>{let n=e.current,r=n?.ownerDocument.defaultView;if(!n||!r)return;let o=()=>{let i=n.style;i.top=i.bottom=i.marginTop=i.marginBottom=i.maxHeight=i.overflowY=i.translate="";let s=n.offsetParent??n.parentElement;if(!s)return;let a=s.getBoundingClientRect(),c=n.getBoundingClientRect(),u=Math.abs(c.right-a.right)<Math.abs(c.left-a.left)?"end":"start",m=Yo({trigger:{left:a.left,right:a.right,top:a.top,bottom:a.bottom},menu:{width:c.width,height:c.height},bounds:{left:0,top:0,right:r.innerWidth,bottom:r.innerHeight},align:u,side:"bottom"});if(m.side==="top"){i.top="auto",i.bottom="100%",i.marginTop="0px";let p=m.top+Math.min(c.height,m.maxHeight);i.marginBottom=`${Math.max(0,a.top-p)}px`}m.maxHeight<c.height&&(i.maxHeight=`${m.maxHeight}px`,i.overflowY="auto");let C=m.left-c.left;C&&(i.translate=`${C}px`)};return o(),r.addEventListener("resize",o),r.addEventListener("scroll",o,!0),()=>{r.removeEventListener("resize",o),r.removeEventListener("scroll",o,!0)}},[e,t])}function Zo(e){return e.split(" ").map(t=>t==="left-0"?"right-0":t).join(" ")}function Jo({id:e,tone:t,items:n,value:r,focusIdx:o,onFocus:i,onPick:s,listRef:a,ariaLabel:c,align:u="start"}){let m=Qo[t],C=ne(null);return jo(C,n.length),re("ul",{ref:p=>{C.current=p,a&&(a.current=p)},id:e,role:"listbox","aria-label":c,...m.pickerMarker?{"data-picker-menu":""}:{},className:u==="end"?Zo(m.list):m.list,children:n.map((p,A)=>{let k=p.value===r;return re("li",{id:`${e}-${A}`,role:"option","aria-selected":k,"aria-disabled":p.disabled||void 0,onMouseEnter:()=>!p.disabled&&i(A),onMouseDown:g=>{g.preventDefault(),p.disabled||s(p.value)},className:m.item(A===o,k&&p.value!=="",!!p.disabled,A===n.length-1),style:m.itemStyle?.(k),children:p.meta===void 0?p.label:jn(ti,{children:[p.lead,re("span",{className:"flex-1 whitespace-nowrap",children:p.label}),re("span",{className:"ml-auto text-[12px] opacity-50",children:p.meta})]})},`${p.value}_${A}`)})})}function ei({value:e,onChange:t,disabled:n,children:r,className:o,style:i,name:s,id:a,"aria-label":c,align:u}){let m=Ko.toArray(r).flatMap(g=>{if(!Go(g))return[];if(g.type!=="option")return[];let w=g.props,D=w.value!==void 0?String(w.value):"",E=w.children,b=typeof E=="string"||typeof E=="number"?String(E):D;return[{value:D,label:b,disabled:!!w.disabled}]}),C=e??"",p=Xo({items:m,value:C,onPick:g=>t?.({target:{value:g}})}),k=m.find(g=>g.value===C)?.label??m[0]?.label??"";return jn("div",{ref:p.wrapRef,className:"relative",children:[s&&re("input",{type:"hidden",name:s,value:C}),re("button",{ref:g=>{p.triggerRef.current=g},type:"button",disabled:n,"aria-haspopup":"listbox","aria-expanded":p.open,"aria-controls":p.open?p.listId:void 0,"aria-activedescendant":p.activeId,"aria-label":c,id:a,onClick:()=>!n&&p.toggle(),onKeyDown:g=>!n&&p.onTriggerKeyDown(g),className:`block w-full ${o??""}`,style:i,children:re("span",{className:"block w-full truncate text-left",children:k})}),p.open&&re(Jo,{id:p.listId,tone:"select",items:m,value:C,focusIdx:p.focusIdx,onFocus:p.setFocusIdx,onPick:p.pick,listRef:p.listRef,align:u})]})}import{jsx as Le,jsxs as Je}from"react/jsx-runtime";var ni="font-mono text-[length:var(--size-label,12px)]",ri="font-semibold uppercase tracking-[0.22em] text-fg";function Zn(e){return`${e??ni} ${ri}`}function Jn(){return Le("span",{className:"text-accent",children:" *"})}function oi({children:e,required:t,labelFace:n}){return Je("span",{className:Zn(n),children:[e,t?Le(Jn,{}):null]})}function ii({label:e,required:t,hint:n,separate:r,htmlFor:o,labelFace:i,className:s,children:a}){let c=s?`flex flex-col gap-2 ${s}`:"flex flex-col gap-2",u=n?Le("span",{className:"font-mono text-[11px] uppercase tracking-[0.22em] text-fg-dim",children:n}):null;return r||n?Je("div",{className:c,children:[Je("label",{htmlFor:o,className:Zn(i),children:[e,t?Le(Jn,{}):null]}),a,u]}):Je("label",{htmlFor:o,className:c,children:[Le(oi,{required:t,labelFace:i,children:e}),a]})}export{cn as a,Si as b,Ei as c,vi as d,Jt as e,ct as f,si as g,ur as h,ai as i,nn as j,cr as k,dr as l,ft as m,rn as n,li as o,pt as p,ze as q,te as r,ui as s,ci as t,Cr as u,_i as v,yt as w,be as x,Ai as y,Li as z,Te as A,Ni as B,Ii as C,Oi as D,Tr as E,mn as F,qe as G,Ar as H,gn as I,Bi as J,zi as K,bt as L,yn as M,Lr as N,Gi as O,Vi as P,Yi as Q,Ge as R,rs as S,xn as T,os as U,is as V,Sn as W,ss as X,xt as Y,as as Z,ls as _,Mr as $,us as aa,cs as ba,En as ca,ds as da,fs as ea,ps as fa,Ur as ga,ms as ha,gs as ia,vn as ja,Ss as ka,Es as la,vs as ma,_s as na,wn as oa,As as pa,Rs as qa,gi as ra,un as sa,yi as ta,Ae as ua,vt as va,zs as wa,Fn as xa,ia as ya,uo as za,aa as Aa,Ia as Ba,Oa as Ca,Da,Fa as Ea,Ma as Fa,Eo as Ga,vo as Ha,Ha as Ia,Po as Ja,Ua as Ka,$a as La,Wa as Ma,Ba as Na,_o as Oa,za as Pa,qa as Qa,Ao as Ra,Ro as Sa,Ka as Ta,Ga as Ua,Va,ko as Wa,wo as Xa,No as Ya,Io as Za,Ya as _a,Qa as $a,zn as ab,ja as bb,Oo as cb,tl as db,qn as eb,nl as fb,Fo as gb,rl as hb,Uo as ib,ua as jb,Ra as kb,ka as lb,$o as mb,dl as nb,fl as ob,Bo as pb,yl as qb,bl as rb,Xo as sb,Jo as tb,ei as ub,oi as vb,ii as wb};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{$ as sf,D as Ak,E as Fk,F as of,G as Bk,H as Wk,I as Or,J as $k,K as zk,L as Uk,M as nt,N as tf,O as ko,P as fe,R as rf,S as Er,T as af,X as jk,Y as nf,Z as _r,_ as Gk,a as Xo,b as Ys,ba as tP,c as jd,d as yn,e as Xs,f as ik,fa as uP,g as Sn,h as Gd,ha as mP,ia as Nf,ja as $T,ka as zT,r as tl,t as _k}from"./chunk-UQDOJWLM.js";import{a as yP,d as Sf,e as st,f as bf,g as wf,h as Pf,l as Kx}from"./chunk-LN6M3FAM.js";import{$ as ix,$a as Qs,$b as Zk,$c as kv,$d as Br,$f as On,$g as fT,$i as ST,A as kC,Aa as ZC,Ab as hx,Ac as lv,Ad as Cx,Ae as gf,Ag as tT,Aj as fl,Ak as Ux,B as vC,Ba as px,Bb as el,Bc as iv,Bd as $v,Be as cP,Bg as Lx,Bk as NT,C as PC,Ca as JC,Cb as zt,Cc as dv,Cd as zv,Ce as pP,Cg as dr,Ck as ua,D as rt,Da as QC,Db as wn,Dc as fv,Dd as Uv,Dg as Rx,Dj as _n,Dk as MT,E as TC,Ea as ek,Eb as ol,Ec as jt,Ed as jv,Ee as kt,Eg as Ef,Ek as HT,F as OC,Fa as ok,Fc as Ue,Fd as Gv,Fg as rT,Fj as PT,Fk as WT,G as EC,Ga as tk,Gc as Ar,Gd as kx,Ge as je,Gf as HP,Gg as aT,H as _C,Ha as rk,Hb as Ix,Hc as Sx,Hd as Kv,He as vt,Hf as WP,Hg as nT,Hk as UT,I as AC,Ia as vr,Ib as na,Ic as cv,Id as vx,Ie as Oe,If as $P,Ig as sT,Ik as jx,J as FC,Ja as ak,Jb as ef,Jc as pv,Jd as qv,Je as IP,Jf as zP,Jg as lT,K as BC,Kb as Tk,Kc as uv,Kd as Vv,Kf as Ax,Kk as jT,La as nk,Lb as Ok,Lc as mf,Ld as Yv,Lf as UP,Lk as GT,M as LC,Ma as Kd,Mb as Ek,Mc as al,Md as Gt,Mf as jP,Mg as iT,Mk as KT,N as RC,Na as Zs,Nb as lf,Nc as mv,Nd as Xv,Ne as Px,Nf as Fx,Ng as dT,Nj as TT,Nk as qT,O as DC,Oa as qd,Ob as Vk,Oc as xv,Od as da,Oj as Wx,Ok as VT,P as Md,Pa as dk,Pb as df,Pc as hv,Pj as OT,Pk as YT,Q as NC,Qb as yx,Qc as xf,Qd as Zv,Qe as il,Qi as pa,Qj as ET,R as MC,Rb as ff,Rc as Iv,Rd as Pn,Rf as ir,Sc as gv,Si as fr,Sj as Rf,Ta as fk,Tc as bx,Td as lr,Tf as Tn,Tj as An,Ua as ck,Uc as yv,Ud as Jv,Ue as gP,Uh as hT,Uj as Fn,Va as Js,Vc as vn,Vd as ll,Ve as Tx,Vf as GP,Vg as _f,Vh as IT,Vj as cl,W as lx,Wb as Cn,Wd as Qv,We as SP,Wf as KP,Wj as Bn,Xa as bn,Xc as Sv,Xd as fa,Xe as kf,Xf as Tf,Xj as _T,Y as qs,Ya as pk,Yc as bv,Yd as eP,Yf as Lr,Z as Hd,Za as Vd,Zb as Yk,Zc as wv,Ze as OP,Zf as Of,Zi as Bf,_ as Ao,_a as uk,_b as Xk,_c as Cv,_d as hf,a as _o,aa as hn,ab as mk,ac as rl,ad as sa,ae as oP,af as Ex,b as un,ba as HC,bb as xk,bd as vv,bh as cT,ca as WC,cb as mx,cd as wx,ck as AT,d as sC,da as $C,db as hk,dd as Pv,di as gT,dk as FT,e as rx,ea as zC,eb as Yd,ed as Tv,ei as yT,el as Gx,f as lC,fa as UC,fb as Ik,fd as Ov,ff as EP,g as c,ga as dx,gb as xx,gd as Ev,gf as _P,h as $t,hd as _v,hf as vf,i as xn,ia as jC,ib as gk,id as Fr,ie as rP,if as AP,ig as Rr,j as Gs,ja as Wd,jb as yk,jd as nl,jf as FP,jg as qP,k as No,kd as la,kg as VP,kk as $x,l as Ks,lb as Xd,lc as kn,ld as Av,le as aP,lg as YP,lh as Dx,lj as bT,mb as Sk,mc as Ut,me as nP,mh as Af,mk as BT,ml as XT,n as xC,nb as bk,nc as Jk,nd as ia,ne as sP,nh as ca,nk as LT,nl as ZT,o as hC,ob as wk,oc as Qk,od as sl,oh as Ff,oj as wT,ok as RT,ol as Mf,p as IC,pb as Ck,pc as ev,pd as Fv,pj as Lf,pl as JT,q as gC,qb as Zd,qc as ov,qd as Bv,qf as BP,qg as XP,qh as pT,qj as Nx,qk as DT,r as yC,rb as kk,rc as tv,rf as _x,rh as uT,rj as CT,rl as Ln,s as SC,sc as cf,sd as Lv,se as Mo,sf as LP,sh as mT,sj as kT,sk as zx,sl as Hf,t as bC,tc as pf,td as Rv,te as ao,tf as RP,th as xT,tj as Mx,u as wC,ub as vk,uc as rv,ud as Dv,uf as DP,ug as ZP,v as Nd,vb as Pr,ve as If,vf as NP,vg as JP,vj as En,w as kr,wb as Jd,wc as av,wd as Nv,we as lP,wg as QP,wj as vT,xa as VC,xb as Qd,xc as nv,xd as Mv,xe as iP,xf as MP,xg as eT,y as sx,ya as YC,yb as Pk,yc as sv,yd as Hv,ye as dP,yg as oT,yk as pl,z as CC,za as XC,zb as ho,zc as uf,zd as Wv,ze as fP,zg as Bx,zj as Hx,zk as Df}from"./chunk-RG2VEZZ7.js";import{a as uC,b as Dd,c as mC,g as Kk,h as gx,i as qk}from"./chunk-DO5FAI7I.js";import{$ as Ib,$a as Mb,$c as R,$e as Jm,$g as cC,A as io,Ab as Jb,Ad as pw,B as on,Be as Xm,Bf as ox,Ca as ye,Cb as Ws,Cd as Vm,Ce as ww,Ci as vo,D as Ns,Db as Qb,E as id,Ed as uw,Ee as Zm,F as Nt,Fd as bd,G as tn,Ga as ot,Gg as Jw,Gi as dl,H as ze,Ha as bt,Hb as gd,Hd as tt,Hg as Qw,I as Xe,Ia as Em,Ic as nw,Id as Do,Ie as kd,If as Dw,Ig as eC,J as rn,Ja as _m,Jd as ro,Je as vd,Jg as oC,K as dd,Kc as Um,Kd as Ht,Ke as Cw,Kh as ux,L as fb,La as Am,Ld as nr,Le as Pd,Lf as sr,Lh as In,M as cb,Ma as Fm,Mb as ew,Md as Ct,Me as Td,Mg as tC,Mh as sk,Nd as dn,Ne as kw,Nh as at,O as pb,Od as mw,Oe as vw,Oh as Yo,P as fd,Pd as fn,Pe as Od,Pg as rC,Ph as Ud,Q as ub,Qa as Bm,Qd as xw,Qe as Ed,Qg as aC,Qh as lk,R as ea,Ra as _b,Rb as yd,Rc as sw,Re as aa,Rf as Nw,Rh as gn,S as mb,Sa as Ab,Se as Pw,Sg as nC,T as xb,Ta as Ke,U as Ms,Ua as Fb,Ub as ow,Ud as ra,Ug as iC,Uh as Lk,V as Tm,Va as xd,Vb as tw,Vd as hw,Vg as dC,W as Ce,Wa as Bb,Wd as Iw,We as Tw,X as q,Xa as Lb,Xb as rw,Xd as cn,Xf as Mw,Xg as Cr,Y as hb,Ya as Rb,Yc as U,Yd as zs,Yf as Hw,Yh as Rk,Za as Db,Zb as Wm,Zc as oe,Zd as Us,Ze as Wt,Zf as Ww,Zg as fC,_ as cd,_a as Nb,_c as jm,_d as Ym,_e as js,_f as $w,_g as ax,a as en,ab as Hb,ad as Co,ae as gw,af as Qm,ah as nx,b as xo,ba as gb,bb as Wb,bd as rr,be as yw,bf as Ow,bh as Rd,c as lo,ca as pd,cb as hd,cd as lw,ce as Sw,cf as Ew,cg as zw,d as or,da as yb,db as Id,dd as H,df as _d,dg as Uw,dh as pC,di as Dk,ea as Sb,eb as $b,ed as Sd,ee as bw,ef as _w,ei as Tr,f as Vo,fa as Om,fb as zb,fd as Ro,fg as jw,g as Ds,ga as bb,gc as $m,gd as iw,ge as wd,gg as Gw,gi as Nk,h as tb,ha as wb,hb as Ub,hd as wt,hf as Aw,hg as Bd,hi as Mk,i as rb,ia as Cb,ib as jb,id as Mt,ie as Cd,if as Ad,ig as Kw,ii as Hk,j as ab,jb as Lm,jd as Gm,jf as Fw,jg as Ld,k as nb,kb as Gb,kd as br,kf as ex,kg as tx,la as kb,lb as Kb,ld as ar,lf as Bw,ma as vb,mb as Rm,md as dw,mf as Lw,na as Pb,nb as nn,nf as Fd,ng as qw,o as sb,od as Be,of as pn,og as Vw,pa as Tb,pb as oa,pd as ta,pf as mn,pi as bP,qb as Dm,qd as $s,qf as wr,qi as wP,ra as Ob,rb as Nm,rd as sn,rg as Yw,rh as fx,ri as Cf,s as lb,sa as ud,sb as Mm,sd as fw,sg as Xw,sh as $d,si as CP,ta as Eb,tb as qb,td as Km,th as GC,ti as Ox,u as Me,ua as md,ub as Vb,ud as ln,uf as Rw,uh as cx,ui as kP,v as ib,vb as Yb,vc as zm,vd as qm,vg as Zw,vh as KC,w as ld,wb as Hm,wi as vP,x as db,xb as Xb,xc as aw,xh as zd,xi as PP,ya as Hs,yb as tr,yh as qC,yi as TP,z as Te,za as an,zb as Zb,zd as cw,zh as Vs}from"./chunk-I4IY2GTB.js";import{a as z,b as eo}from"./chunk-IHBF4FM5.js";import{c as xP,d as hP,e as yf}from"./chunk-454ZVMST.js";import{jsx as qx,Fragment as u6,jsxs as m6}from"react/jsx-runtime";import{createContext as x6,useContext as h6}from"react";var I6={mirrorHostStyles:!0,css:null,fontHrefs:[]},QT=x6(I6);function Jne({value:e,children:o}){return qx(QT.Provider,{value:e,children:o})}function ul(){return h6(QT)}function e0(){let{css:e,fontHrefs:o}=ul();return m6(u6,{children:[o.map(t=>qx("link",{rel:"stylesheet",href:t},t)),e?qx("style",{"data-sf-canvas-css":"",children:e}):null]})}import{jsx as g6}from"react/jsx-runtime";import{createContext as y6,useContext as S6}from"react";var o0=y6(void 0);function tse({metadata:e,children:o}){return g6(o0.Provider,{value:e,children:o})}var t0=()=>S6(o0);import{jsx as uo,Fragment as e6,jsxs as od}from"react/jsx-runtime";import{useCallback as _s,useEffect as Zt,useRef as kne,useState as X4}from"react";import{SettingsSwitch as vne}from"efficient-easel/panel";import{PagesIcon as Pne,StylesIcon as Tne}from"efficient-easel/rail";import{PaletteIcon as One}from"efficient-shell/icons/efficient";import{Subtree as Ene,TreeRow as o6}from"efficient-easel/tree";import{useEasel as t6}from"efficient-easel/easel";import{toItemSelector as _ne}from"efficient-easel/node-ops";import{useEaselStrings as r6}from"efficient-easel/strings";import{createContext as b6,useContext as w6}from"react";var Vx=b6(!1),nse=()=>w6(Vx);import{useMemo as C6,useRef as k6}from"react";import{useEaselApi as v6}from"efficient-easel/easel";import{useSectionOps as P6}from"efficient-easel/screen/lib/document/use-section-ops";function Wf(){let e=v6(),o=P6(),t=k6(o);return t.current=o,C6(()=>({getItemById:r=>e.getState().getItemById(r),getSelectorForId:r=>e.getState().getSelectorForId(r),get components(){return e.getState().config.components},replace:(r,a,n)=>t.current.replaceComponent(r,a,n)}),[e])}import{encodePartId as q6}from"efficient-easel/draw";import{insertAt as V6,moveTo as Y6,removeAt as X6}from"efficient-easel/fields";import{useSyncExternalStore as W6}from"react";import{isNodeList as r0}from"efficient-easel/data";var a0="Flex";function Rn(e,o){return Wt(e)?typeof e?.[Vo]=="string"?Yx(o?.[Vo]):"":Yx(e?.[Vo])}var Yx=e=>typeof e=="string"?e.trim():"",T6=e=>e.type===io&&Array.isArray(e.props?.[Zm])&&e.props[Zm].some(o=>Yx(o?.[Vo])!==""),O6=new Intl.NumberFormat("en-US");function E6(e){return/^\d+$/.test(e)?O6.format(Number(e)):e}function xse(e,o){let t=o?o.find(r=>r.key===e)?.value:lb(Ds).find(r=>r.key===e)?.value;return t===void 0?null:E6(t)}var _6={[Vo]:"any"};function Xx(e,o=!1){let t=e.props;if(!t)return{node:e,names:!1};let r=e.type==="Text"&&(Rn(t)!==""||o&&Rn(t,_6)!==""),a=o||T6(e),n=Xe(e,l=>ze(l,i=>{let d=Xx(i,a);return d.names&&(r=!0),d.node})).props;if(e.type!==a0)return{node:n===t?e:{...e,props:n},names:r};let s=Me(n);if(r&&!s&&(n={...n,[lo]:Ds}),!r&&s===Ds){let{[lo]:l,...i}=n;n=i}return{node:n===t?e:{...e,props:n},names:!1}}function n0(e,o,t){for(let r of e){if(r?.props?.id===o)return t;for(let a of tn(r??{})){let n=n0(a,o,r.type===a0?r:t);if(n!==void 0)return n}}}function hse(e,o){if(!r0(e))return!0;let t=n0(e,o,null);if(t===void 0)return!0;if(t===null)return!1;let r=Me(t.props);return!r||r===Ds}function s0(e){let o=e?.content;if(!r0(o))return e;let t=o.map(r=>Xx(r));return t.every((r,a)=>r.node===o[a])?e:{...e,content:t.map(r=>r.node)}}function l0(e){return Xx(e).node}import{decodePartId as $6}from"efficient-easel/draw";function Dn(e,o){let t=nv(e);return t?.control==="textList"?o.rowKey===(t.itemKey??"text")?LT(t,o.index):null:sv(e)?.[o.rowKey]??null}function $f(e,o,t){let r=e.node.props,{key:a,row:n}=Ut(e.propKey),s=n?iv(r,a,n,e.kind,o):av(r,a,e.kind,o);return s?(t(e.zone,e.index,{...e.node,props:s}),!0):!1}import{readHidable as f0}from"efficient-easel/draw";import{parseOption as A6}from"efficient-shell/format";var Zx=e=>String(e+1).padStart(2,"0"),F6=[{label:"01 \xB7",value:"two-digit"},{label:"1.",value:"plain"}],Jx="two-digit",i0=e=>A6(F6,Jx,e),zf=(e,o)=>e==="plain"?`${o+1}.`:Zx(o);var oh="Contents",Qx="Flex",d0="Text",B6="numberForm",L6="_contentsEntries",R6="_kickerNumber",c0="data-sf-kicker-number",D6=e=>f0(e).text.trim(),p0=e=>fa(e?.anchor),eh=e=>String(e.props?.id??""),N6=e=>!f0(e.props?.text).hidden&&!Rn(e.props)&&!Wt(e.props),ml=e=>tn(e);function u0(e){for(let o of ml(e))for(let t of o){if(lr(t.props??{}))continue;if(t.type===d0&&N6(t))return t;if(t.type===d0)continue;let r=u0(t);if(r)return r}}function m0(e){return ml(e).some(o=>o.some(t=>t&&!lr(t.props??{})&&(t.type===oh||m0(t))))}var x0=e=>e.type===Qx&&Tn(Qx,e.props?.direction)==="row";function h0(e){return ml(e).some(o=>o.some(t=>t&&!lr(t.props??{})&&(t.type===oh||!x0(t)&&h0(t))))}function M6(e){let o=[],t=(r,a)=>{for(let n of r){if(!n||lr(n.props??{}))continue;if(n.type===oh){a.open={contents:n,sections:a.waiting??[]},a.waiting=null,o.push(a.open);continue}if(x0(n)&&h0(n)){let l={inRow:!0,open:null,waiting:[]};for(let i of ml(n))t(i,l);a.inRow||(a.open=null);continue}let s=a.open?.sections??a.waiting;if(n.type===Qx&&p0(n.props)&&s&&!m0(n)){s.push({box:n,kicker:u0(n)});continue}for(let l of ml(n))t(l,a)}};return t(e,{inRow:!1,open:null,waiting:null}),o}function H6(e){return e.map(o=>({label:o.kicker?an(D6(o.kicker.props?.text)):"",anchor:p0(o.box.props)}))}function th(e){let o=e?.length?M6(e):[];if(!o.length)return null;let t=new Map,r=new Map;for(let a of o){let n=eh(a.contents);n&&t.set(n,H6(a.sections));let s=i0(a.contents.props?.[B6]);a.sections.forEach((l,i)=>{let d=l.kicker?eh(l.kicker):"";d&&r.set(d,zf(s,i))})}return{entries:t,numbers:r}}var Rse=e=>e.endsWith(".")?`${e} `:`${e} \xB7 `;function I0(e){let o=e;if(!o?.content?.length)return e;let t=th(o.content);if(!t)return e;let{entries:r,numbers:a}=t,n=s=>{let l=Xe(s,h=>ze(h,n)),i=l.props??{},d=l!==s,f=eh(s),m=f?r.get(f):void 0;m&&(i={...i,[L6]:m},d=!0);let u=f?a.get(f):void 0;return u&&(i={...i,[R6]:u},d=!0),d?{...s,props:i}:s};return{...o,content:o.content.map(n)}}var z6=`[${c0}]`,U6=["bold","italic","underline","strike","link","sup","sub"],j6=["bullet","number"];function nh(e,o){return e?[...U6,...o?j6:[]]:[]}function g0(e,o){let t=$6(e);if(!t?.propKey)return null;let{nodeId:r,propKey:a}=t,n=o.getItemById(r),s=o.getSelectorForId(r);if(!n||!s)return null;let{key:l,row:i}=Ut(a),d=o.components[n.type]?.fields?.[l],f=i?Dn(d,i):d,m=cf(f);if(!m)return null;let u=n.props??{};if(hT(u)!==null||!i&&_d(n.type,u,l)||n.type==="Text"&&l==="text"&&Rn(u)||i&&!(Array.isArray(u[l])&&i.index<u[l].length))return null;let h=i?uf(u[l],i):u[l];return{node:n,selector:s,propKey:a,kind:m,stored:h,offPage:Bf(f),panelOnly:tv(f)}}function Uf(e,o){let t=g0(e,o);if(!t)return null;let{text:r,hidden:a}=pa(t.stored);if(!gv({offPage:t.offPage,hidden:!!a,panelOnly:t.panelOnly}))return null;let n=pf(t.kind);return{partId:e,value:r,rules:ud,multiline:n,skip:z6,offered:nh(t.kind!=="plainText",n),write:s=>{let l=g0(e,o);l&&$f({node:l.node,propKey:l.propKey,kind:l.kind,zone:l.selector.zone,index:l.selector.index},s,o.replace)}}}function sh(e,o,t){return e?.isConnected&&e.getAttribute(Ue)===t?e:o?.querySelector(`[${Ue}="${jf(t)}"]`)??null}function jf(e){return e.replace(/["\\]/g,"\\$&")}function y0(e){let o=e.activeElement;return o?o.tagName==="IFRAME"||!!o.closest(".es-canvas"):!1}var rh=null,ah=new Set;function G6(){return rh}function lh(e){if(e!==rh){rh=e;for(let o of ah)o()}}function K6(e){return ah.add(e),()=>{ah.delete(e)}}function S0(){return W6(K6,G6,()=>null)}function b0(e,o){if(e.outer)return null;let t=o.getItemById(e.ownerId);if(!t)return null;let r=kw(t.type);return!r||Me(t.props)?null:{node:t,rows:r}}function Z6(e,o){let t=b0(e,o),r=o.getItemById(e.nodeId);if(!t||!r)return null;let a=_w(r.type,r.props,e.key);if(!a)return null;let n=t.node.props[t.rows];return!Array.isArray(n)||e.index<0||e.index>=n.length?null:q6(e.ownerId,kn(t.rows,{index:e.index,rowKey:a}))}function Gf(e,o){let t=Z6(e,o);return t?Uf(t,o):null}function w0(e,o){return Gf(e,o)?.value}function C0(e,o){let t=Gf(e,o);return t?(t.write(e.text),!0):!1}function k0(e,o){let t=b0(e,o),r=t&&o.getSelectorForId(e.ownerId);if(!t||!r)return!1;let a=t.node.props,n=a[t.rows],s=e.index;if(!Array.isArray(n)||s<0||s>=n.length)return!1;let l;switch(e.action){case"addAfter":{let i=o.components[t.node.type]?.fields?.[t.rows];l=V6(n,s+1,{...i?.defaultItemProps??{}});break}case"moveEarlier":case"moveLater":{let i=e.action==="moveEarlier"?s-1:s+1;if(i<0||i>=n.length)return!1;l=Y6(n,s,i);break}case"delete":l=X6(n,s);break;default:return!1}return o.replace(r.zone,r.index,{...t.node,props:{...a,[t.rows]:l}}),!0}import{jsx as Pe,Fragment as MJ,jsxs as Wu}from"react/jsx-runtime";import{Fragment as HJ,useEffect as yH,useMemo as SH,useRef as WJ,useState as za}from"react";import{useScreenDocument as vH}from"efficient-easel/screen/components/ScreenDocumentContext";import{UiIcon as Wy}from"efficient-easel/draw/client";import $J from"efficient-easel/screen/components/SidePanelHead";import{InspectorIconButton as zJ}from"efficient-easel/chrome";import{Input as UJ,LoadingSpinner as jJ,PopupMenu as GJ,PopupMenuItem as bH,toast as wH}from"efficient-shell/ui";import{LayersTree as KJ,TreeGroupLabel as qJ,TreeRow as CH,TreeRowAction as $u}from"efficient-easel/tree";import{AddIcon as VJ,DuplicateIcon as YJ,PageIcon as XJ,SettingsIcon as ZJ}from"efficient-easel/icons";import{PagesIcon as JJ}from"efficient-easel/rail";import{useEaselHost as QJ}from"efficient-easel/screen/lib/host";import{useEaselSession as $y}from"efficient-easel/screen/lib/session-context";import{useCallback as Kf,useEffect as J6,useSyncExternalStore as Q6}from"react";import{useScreenDocument as O0}from"efficient-easel/screen/components/ScreenDocumentContext";var v0=new WeakMap;function xl(e){let o=v0.get(e);return o||(o={rows:null,loading:null,listeners:new Set},v0.set(e,o)),o}function ih(e,o){e.rows=o;for(let t of e.listeners)t()}var qf=new Set;function Vf(e,o){o?qf.add(e):qf.delete(e)}function P0(e){let o=xl(e),t=e.listPages().then(r=>ih(o,qf.size?r.filter(a=>!qf.has(a.id)):r),()=>ih(o,[])).finally(()=>{o.loading===t&&(o.loading=null)});return o.loading=t,t}var T0=()=>null,e3=()=>()=>{};function hl(){let{adapter:e,ready:o}=O0(),t=Kf(l=>{let{listeners:i}=xl(e);return i.add(l),()=>i.delete(l)},[e]),r=Kf(()=>xl(e).rows,[e]),a=Q6(o?t:e3,o?r:T0,T0);J6(()=>{if(!o)return;let l=xl(e);l.rows===null&&!l.loading&&P0(e)},[e,o]);let n=Kf(()=>o?P0(e):Promise.resolve(),[e,o]),s=Kf(l=>ih(xl(e),l),[e]);return{rows:a,reload:n,setRows:s,getRows:r}}function o3(e,o){return e?.find(t=>t.slug===o)?.label?.trim()||`/${o}`}function E0(){let{currentSlug:e}=O0(),{rows:o}=hl();return o3(o,e)}import{canDuplicatePage as eQ,DuplicatePageDialog as oQ}from"efficient-easel/page-copy";import{jsx as Oo,jsxs as cH}from"react/jsx-runtime";import{useEffect as bJ,useId as wJ,useMemo as CJ,useRef as kJ,useState as Ny}from"react";import{useScreenDocument as vJ}from"efficient-easel/screen/components/ScreenDocumentContext";import{useEaselSession as PJ}from"efficient-easel/screen/lib/session-context";import{uniqueSlug as pH}from"efficient-easel/page-copy";import{AddIcon as TJ}from"efficient-easel/icons";import{Button as OJ,Dialog as EJ,EmptyState as _J,LoadingSpinner as AJ,Paragraph as FJ,SidebarLayout as BJ,SidebarNavItem as My,Title as LJ,toast as uH}from"efficient-shell/ui";import{jsx as Ot,jsxs as OR}from"react/jsx-runtime";import{useEffect as bq,useState as Ag}from"react";import{CanvasFrame as wq}from"efficient-easel/easel";import{Button as Cq,Card as kq,FitFrame as vq,Text as Pq}from"efficient-shell/ui";import{jsx as L0,Fragment as u3,jsxs as m3}from"react/jsx-runtime";import{useEffect as R0,useLayoutEffect as x3}from"react";var Yf="data-theme",_0="light";function t3(e){return e.getAttribute(Yf)===_0?"light":"dark"}function r3(e,o){return t3(e)===o?!1:(o==="light"?e.setAttribute(Yf,_0):e.removeAttribute(Yf),!0)}function a3(e){return Kx(e).getItem(ox)}function fle(e,o){Kx(e).setItem(ox,o)}function n3(e,o,t=new Date().getHours()){return Dw({mode:o.mode,override:a3(e),switchShown:o.switchShown,hour:t})}function A0(e,o){let t=e.documentElement;if(!t)return()=>{};let r=()=>r3(t,n3(e,o));r();let a=e.defaultView?.MutationObserver;if(!a)return()=>{};let n=new a(r);return n.observe(t,{attributes:!0,attributeFilter:[Yf]}),()=>n.disconnect()}var s3="style";function l3(e,o){let t=Ld(o),r=!1;for(let a of Kw){let n=t[a]??"";e.style.getPropertyValue(a)!==n&&(n?e.style.setProperty(a,n):e.style.removeProperty(a),r=!0)}return r}function F0(e,o){let t=e.body;if(!t)return()=>{};let r=()=>l3(t,o);r();let a=e.defaultView?.MutationObserver;if(!a)return()=>{};let n=new a(r);return n.observe(t,{attributes:!0,attributeFilter:[s3]}),()=>n.disconnect()}import{VIEW_DESKTOP_MIN as i3,VIEW_TABLET_MIN as d3}from"efficient-easel/screen/lib/content/view-tiers";var cr={fit:"data-fit",fitTablet:"data-fit-tablet",fitPhone:"data-fit-phone",min:"data-fit-min",minTablet:"data-fit-min-tablet",minPhone:"data-fit-min-phone",edge:"data-fit-edge"},Zo=cr,f3=e=>e.flatMap(o=>[`[${o}] p`,`[${o}] li`]).join(","),c3=String.raw`(function (doc) {
|
|
1
|
+
import{$ as sf,D as Ak,E as Fk,F as of,G as Bk,H as Wk,I as Or,J as $k,K as zk,L as Uk,M as nt,N as tf,O as ko,P as fe,R as rf,S as Er,T as af,X as jk,Y as nf,Z as _r,_ as Gk,a as Xo,b as Ys,ba as tP,c as jd,d as yn,e as Xs,f as ik,fa as uP,g as Sn,h as Gd,ha as mP,ia as Nf,ja as $T,ka as zT,r as tl,t as _k}from"./chunk-UQDOJWLM.js";import{a as yP,d as Sf,e as st,f as bf,g as wf,h as Pf,l as Kx}from"./chunk-LN6M3FAM.js";import{$ as ix,$a as Qs,$b as Zk,$c as kv,$d as Br,$f as On,A as kC,Aa as ZC,Ab as hx,Ac as lv,Ad as Cx,Ae as gf,Ag as tT,Aj as Hx,Ak as Df,B as vC,Ba as px,Bb as el,Bc as iv,Bd as $v,Be as cP,Bg as Lx,Bj as fl,Bk as Ux,C as PC,Ca as JC,Cb as zt,Cc as dv,Cd as zv,Ce as pP,Cg as dr,Ck as NT,D as rt,Da as QC,Db as wn,Dc as fv,Dd as Uv,Dg as Rx,Dk as ua,E as TC,Ea as ek,Eb as ol,Ec as jt,Ed as jv,Ee as kt,Eg as Ef,Ej as _n,Ek as MT,F as OC,Fa as ok,Fc as Ue,Fd as Gv,Fg as rT,Fk as HT,G as EC,Ga as tk,Gc as Ar,Gd as kx,Ge as je,Gf as HP,Gg as aT,Gj as PT,Gk as WT,H as _C,Ha as rk,Hb as Ix,Hc as Sx,Hd as Kv,He as vt,Hf as WP,Hg as nT,I as AC,Ia as vr,Ib as na,Ic as cv,Id as vx,Ie as Oe,If as $P,Ig as sT,Ik as UT,J as FC,Ja as ak,Jb as ef,Jc as pv,Jd as qv,Je as IP,Jf as zP,Jg as lT,Jk as jx,K as BC,Kb as Tk,Kc as uv,Kd as Vv,Kf as Ax,La as nk,Lb as Ok,Lc as mf,Ld as Yv,Lf as UP,Lk as jT,M as LC,Ma as Kd,Mb as Ek,Mc as al,Md as Gt,Mf as jP,Mg as iT,Mk as GT,N as RC,Na as Zs,Nb as lf,Nc as mv,Nd as Xv,Ne as Px,Nf as Fx,Ng as dT,Nk as KT,O as DC,Oa as qd,Ob as Vk,Oc as xv,Od as da,Oj as TT,Ok as qT,P as Md,Pa as dk,Pb as df,Pc as hv,Pj as Wx,Pk as VT,Q as NC,Qb as yx,Qc as xf,Qd as Zv,Qe as il,Qj as OT,Qk as YT,R as MC,Rb as ff,Rc as Iv,Rd as Pn,Rf as ir,Ri as pa,Rj as ET,Sc as gv,Ta as fk,Tc as bx,Td as lr,Tf as Tn,Ti as fr,Tj as Rf,Ua as ck,Uc as yv,Ud as Jv,Ue as gP,Uj as An,Va as Js,Vc as vn,Vd as ll,Ve as Tx,Vf as GP,Vh as hT,Vj as Fn,W as lx,Wb as Cn,Wd as Qv,We as SP,Wf as KP,Wg as _f,Wh as IT,Wj as cl,Xa as bn,Xc as Sv,Xd as fa,Xe as kf,Xf as Tf,Xj as Bn,Y as qs,Ya as pk,Yc as bv,Yd as eP,Yf as Lr,Yj as _T,Z as Hd,Za as Vd,Zb as Yk,Zc as wv,Ze as OP,Zf as Of,_ as Ao,_a as uk,_b as Xk,_c as Cv,_d as hf,_i as Bf,a as _o,aa as hn,ab as mk,ac as rl,ad as sa,ae as oP,af as Ex,ah as fT,aj as ST,b as un,ba as HC,bb as xk,bd as vv,ca as WC,cb as mx,cd as wx,ch as cT,d as sC,da as $C,db as hk,dd as Pv,dk as AT,e as rx,ea as zC,eb as Yd,ed as Tv,ei as gT,ek as FT,f as lC,fa as UC,fb as Ik,fd as Ov,ff as EP,fi as yT,fl as Gx,g as c,ga as dx,gb as xx,gd as Ev,gf as _P,h as $t,hd as _v,hf as vf,i as xn,ia as jC,ib as gk,id as Fr,ie as rP,if as AP,ig as Rr,j as Gs,ja as Wd,jb as yk,jd as nl,jf as FP,jg as qP,k as No,kd as la,kg as VP,l as Ks,lb as Xd,lc as kn,ld as Av,le as aP,lg as YP,lk as $x,mb as Sk,mc as Ut,me as nP,mh as Dx,mj as bT,n as xC,nb as bk,nc as Jk,nd as ia,ne as sP,nh as Af,nk as BT,nl as XT,o as hC,ob as wk,oc as Qk,od as sl,oh as ca,ok as LT,ol as ZT,p as IC,pb as Ck,pc as ev,pd as Fv,ph as Ff,pj as wT,pk as RT,pl as Mf,q as gC,qb as Zd,qc as ov,qd as Bv,qf as BP,qg as XP,qj as Lf,ql as JT,r as yC,rb as kk,rc as tv,rf as _x,rh as pT,rj as Nx,rk as DT,s as SC,sc as cf,sd as Lv,se as Mo,sf as LP,sh as uT,sj as CT,sl as Ln,t as bC,tc as pf,td as Rv,te as ao,tf as RP,th as mT,tj as kT,tk as zx,tl as Hf,u as wC,ub as vk,uc as rv,ud as Dv,uf as DP,ug as ZP,uh as xT,uj as Mx,v as Nd,vb as Pr,ve as If,vf as NP,vg as JP,w as kr,wb as Jd,wc as av,wd as Nv,we as lP,wg as QP,wj as En,xa as VC,xb as Qd,xc as nv,xd as Mv,xe as iP,xf as MP,xg as eT,xj as vT,y as sx,ya as YC,yb as Pk,yc as sv,yd as Hv,ye as dP,yg as oT,z as CC,za as XC,zb as ho,zc as uf,zd as Wv,ze as fP,zg as Bx,zk as pl}from"./chunk-5W6M2F4B.js";import{a as uC,b as Dd,c as mC,g as Kk,h as gx,i as qk}from"./chunk-DO5FAI7I.js";import{$ as Ib,$a as Mb,$c as R,$e as Jm,$g as cC,A as io,Ab as Jb,Ad as pw,B as on,Be as Xm,Bf as ox,Ca as ye,Cb as Ws,Cd as Vm,Ce as ww,Ci as vo,D as Ns,Db as Qb,E as id,Ed as uw,Ee as Zm,F as Nt,Fd as bd,G as tn,Ga as ot,Gg as Jw,Gi as dl,H as ze,Ha as bt,Hb as gd,Hd as tt,Hg as Qw,I as Xe,Ia as Em,Ic as nw,Id as Do,Ie as kd,If as Dw,Ig as eC,J as rn,Ja as _m,Jd as ro,Je as vd,Jg as oC,K as dd,Kc as Um,Kd as Ht,Ke as Cw,Kh as ux,L as fb,La as Am,Ld as nr,Le as Pd,Lf as sr,Lh as In,M as cb,Ma as Fm,Mb as ew,Md as Ct,Me as Td,Mg as tC,Mh as sk,Nd as dn,Ne as kw,Nh as at,O as pb,Od as mw,Oe as vw,Oh as Yo,P as fd,Pd as fn,Pe as Od,Pg as rC,Ph as Ud,Q as ub,Qa as Bm,Qd as xw,Qe as Ed,Qg as aC,Qh as lk,R as ea,Ra as _b,Rb as yd,Rc as sw,Re as aa,Rf as Nw,Rh as gn,S as mb,Sa as Ab,Se as Pw,Sg as nC,T as xb,Ta as Ke,U as Ms,Ua as Fb,Ub as ow,Ud as ra,Ug as iC,Uh as Lk,V as Tm,Va as xd,Vb as tw,Vd as hw,Vg as dC,W as Ce,Wa as Bb,Wd as Iw,We as Tw,X as q,Xa as Lb,Xb as rw,Xd as cn,Xf as Mw,Xg as Cr,Y as hb,Ya as Rb,Yc as U,Yd as zs,Yf as Hw,Yh as Rk,Za as Db,Zb as Wm,Zc as oe,Zd as Us,Ze as Wt,Zf as Ww,Zg as fC,_ as cd,_a as Nb,_c as jm,_d as Ym,_e as js,_f as $w,_g as ax,a as en,ab as Hb,ad as Co,ae as gw,af as Qm,ah as nx,b as xo,ba as gb,bb as Wb,bd as rr,be as yw,bf as Ow,bh as Rd,c as lo,ca as pd,cb as hd,cd as lw,ce as Sw,cf as Ew,cg as zw,d as or,da as yb,db as Id,dd as H,df as _d,dg as Uw,dh as pC,di as Dk,ea as Sb,eb as $b,ed as Sd,ee as bw,ef as _w,ei as Tr,f as Vo,fa as Om,fb as zb,fd as Ro,fg as jw,g as Ds,ga as bb,gc as $m,gd as iw,ge as wd,gg as Gw,gi as Nk,h as tb,ha as wb,hb as Ub,hd as wt,hf as Aw,hg as Bd,hi as Mk,i as rb,ia as Cb,ib as jb,id as Mt,ie as Cd,if as Ad,ig as Kw,ii as Hk,j as ab,jb as Lm,jd as Gm,jf as Fw,jg as Ld,k as nb,kb as Gb,kd as br,kf as ex,kg as tx,la as kb,lb as Kb,ld as ar,lf as Bw,ma as vb,mb as Rm,md as dw,mf as Lw,na as Pb,nb as nn,nf as Fd,ng as qw,o as sb,od as Be,of as pn,og as Vw,pa as Tb,pb as oa,pd as ta,pf as mn,pi as bP,qb as Dm,qd as $s,qf as wr,qi as wP,ra as Ob,rb as Nm,rd as sn,rg as Yw,rh as fx,ri as Cf,s as lb,sa as ud,sb as Mm,sd as fw,sg as Xw,sh as $d,si as CP,ta as Eb,tb as qb,td as Km,th as GC,ti as Ox,u as Me,ua as md,ub as Vb,ud as ln,uf as Rw,uh as cx,ui as kP,v as ib,vb as Yb,vc as zm,vd as qm,vg as Zw,vh as KC,w as ld,wb as Hm,wi as vP,x as db,xb as Xb,xc as aw,xh as zd,xi as PP,ya as Hs,yb as tr,yh as qC,yi as TP,z as Te,za as an,zb as Zb,zd as cw,zh as Vs}from"./chunk-I4IY2GTB.js";import{a as z,b as eo}from"./chunk-IHBF4FM5.js";import{c as xP,d as hP,e as yf}from"./chunk-454ZVMST.js";import{jsx as qx,Fragment as u6,jsxs as m6}from"react/jsx-runtime";import{createContext as x6,useContext as h6}from"react";var I6={mirrorHostStyles:!0,css:null,fontHrefs:[]},QT=x6(I6);function Jne({value:e,children:o}){return qx(QT.Provider,{value:e,children:o})}function ul(){return h6(QT)}function e0(){let{css:e,fontHrefs:o}=ul();return m6(u6,{children:[o.map(t=>qx("link",{rel:"stylesheet",href:t},t)),e?qx("style",{"data-sf-canvas-css":"",children:e}):null]})}import{jsx as g6}from"react/jsx-runtime";import{createContext as y6,useContext as S6}from"react";var o0=y6(void 0);function tse({metadata:e,children:o}){return g6(o0.Provider,{value:e,children:o})}var t0=()=>S6(o0);import{jsx as uo,Fragment as e6,jsxs as od}from"react/jsx-runtime";import{useCallback as _s,useEffect as Zt,useRef as kne,useState as X4}from"react";import{SettingsSwitch as vne}from"efficient-easel/panel";import{PagesIcon as Pne,StylesIcon as Tne}from"efficient-easel/rail";import{PaletteIcon as One}from"efficient-shell/icons/efficient";import{Subtree as Ene,TreeRow as o6}from"efficient-easel/tree";import{useEasel as t6}from"efficient-easel/easel";import{toItemSelector as _ne}from"efficient-easel/node-ops";import{useEaselStrings as r6}from"efficient-easel/strings";import{createContext as b6,useContext as w6}from"react";var Vx=b6(!1),nse=()=>w6(Vx);import{useMemo as C6,useRef as k6}from"react";import{useEaselApi as v6}from"efficient-easel/easel";import{useSectionOps as P6}from"efficient-easel/screen/lib/document/use-section-ops";function Wf(){let e=v6(),o=P6(),t=k6(o);return t.current=o,C6(()=>({getItemById:r=>e.getState().getItemById(r),getSelectorForId:r=>e.getState().getSelectorForId(r),get components(){return e.getState().config.components},replace:(r,a,n)=>t.current.replaceComponent(r,a,n)}),[e])}import{encodePartId as q6}from"efficient-easel/draw";import{insertAt as V6,moveTo as Y6,removeAt as X6}from"efficient-easel/fields";import{useSyncExternalStore as W6}from"react";import{isNodeList as r0}from"efficient-easel/data";var a0="Flex";function Rn(e,o){return Wt(e)?typeof e?.[Vo]=="string"?Yx(o?.[Vo]):"":Yx(e?.[Vo])}var Yx=e=>typeof e=="string"?e.trim():"",T6=e=>e.type===io&&Array.isArray(e.props?.[Zm])&&e.props[Zm].some(o=>Yx(o?.[Vo])!==""),O6=new Intl.NumberFormat("en-US");function E6(e){return/^\d+$/.test(e)?O6.format(Number(e)):e}function xse(e,o){let t=o?o.find(r=>r.key===e)?.value:lb(Ds).find(r=>r.key===e)?.value;return t===void 0?null:E6(t)}var _6={[Vo]:"any"};function Xx(e,o=!1){let t=e.props;if(!t)return{node:e,names:!1};let r=e.type==="Text"&&(Rn(t)!==""||o&&Rn(t,_6)!==""),a=o||T6(e),n=Xe(e,l=>ze(l,i=>{let d=Xx(i,a);return d.names&&(r=!0),d.node})).props;if(e.type!==a0)return{node:n===t?e:{...e,props:n},names:r};let s=Me(n);if(r&&!s&&(n={...n,[lo]:Ds}),!r&&s===Ds){let{[lo]:l,...i}=n;n=i}return{node:n===t?e:{...e,props:n},names:!1}}function n0(e,o,t){for(let r of e){if(r?.props?.id===o)return t;for(let a of tn(r??{})){let n=n0(a,o,r.type===a0?r:t);if(n!==void 0)return n}}}function hse(e,o){if(!r0(e))return!0;let t=n0(e,o,null);if(t===void 0)return!0;if(t===null)return!1;let r=Me(t.props);return!r||r===Ds}function s0(e){let o=e?.content;if(!r0(o))return e;let t=o.map(r=>Xx(r));return t.every((r,a)=>r.node===o[a])?e:{...e,content:t.map(r=>r.node)}}function l0(e){return Xx(e).node}import{decodePartId as $6}from"efficient-easel/draw";function Dn(e,o){let t=nv(e);return t?.control==="textList"?o.rowKey===(t.itemKey??"text")?LT(t,o.index):null:sv(e)?.[o.rowKey]??null}function $f(e,o,t){let r=e.node.props,{key:a,row:n}=Ut(e.propKey),s=n?iv(r,a,n,e.kind,o):av(r,a,e.kind,o);return s?(t(e.zone,e.index,{...e.node,props:s}),!0):!1}import{readHidable as f0}from"efficient-easel/draw";import{parseOption as A6}from"efficient-shell/format";var Zx=e=>String(e+1).padStart(2,"0"),F6=[{label:"01 \xB7",value:"two-digit"},{label:"1.",value:"plain"}],Jx="two-digit",i0=e=>A6(F6,Jx,e),zf=(e,o)=>e==="plain"?`${o+1}.`:Zx(o);var oh="Contents",Qx="Flex",d0="Text",B6="numberForm",L6="_contentsEntries",R6="_kickerNumber",c0="data-sf-kicker-number",D6=e=>f0(e).text.trim(),p0=e=>fa(e?.anchor),eh=e=>String(e.props?.id??""),N6=e=>!f0(e.props?.text).hidden&&!Rn(e.props)&&!Wt(e.props),ml=e=>tn(e);function u0(e){for(let o of ml(e))for(let t of o){if(lr(t.props??{}))continue;if(t.type===d0&&N6(t))return t;if(t.type===d0)continue;let r=u0(t);if(r)return r}}function m0(e){return ml(e).some(o=>o.some(t=>t&&!lr(t.props??{})&&(t.type===oh||m0(t))))}var x0=e=>e.type===Qx&&Tn(Qx,e.props?.direction)==="row";function h0(e){return ml(e).some(o=>o.some(t=>t&&!lr(t.props??{})&&(t.type===oh||!x0(t)&&h0(t))))}function M6(e){let o=[],t=(r,a)=>{for(let n of r){if(!n||lr(n.props??{}))continue;if(n.type===oh){a.open={contents:n,sections:a.waiting??[]},a.waiting=null,o.push(a.open);continue}if(x0(n)&&h0(n)){let l={inRow:!0,open:null,waiting:[]};for(let i of ml(n))t(i,l);a.inRow||(a.open=null);continue}let s=a.open?.sections??a.waiting;if(n.type===Qx&&p0(n.props)&&s&&!m0(n)){s.push({box:n,kicker:u0(n)});continue}for(let l of ml(n))t(l,a)}};return t(e,{inRow:!1,open:null,waiting:null}),o}function H6(e){return e.map(o=>({label:o.kicker?an(D6(o.kicker.props?.text)):"",anchor:p0(o.box.props)}))}function th(e){let o=e?.length?M6(e):[];if(!o.length)return null;let t=new Map,r=new Map;for(let a of o){let n=eh(a.contents);n&&t.set(n,H6(a.sections));let s=i0(a.contents.props?.[B6]);a.sections.forEach((l,i)=>{let d=l.kicker?eh(l.kicker):"";d&&r.set(d,zf(s,i))})}return{entries:t,numbers:r}}var Rse=e=>e.endsWith(".")?`${e} `:`${e} \xB7 `;function I0(e){let o=e;if(!o?.content?.length)return e;let t=th(o.content);if(!t)return e;let{entries:r,numbers:a}=t,n=s=>{let l=Xe(s,h=>ze(h,n)),i=l.props??{},d=l!==s,f=eh(s),m=f?r.get(f):void 0;m&&(i={...i,[L6]:m},d=!0);let u=f?a.get(f):void 0;return u&&(i={...i,[R6]:u},d=!0),d?{...s,props:i}:s};return{...o,content:o.content.map(n)}}var z6=`[${c0}]`,U6=["bold","italic","underline","strike","link","sup","sub"],j6=["bullet","number"];function nh(e,o){return e?[...U6,...o?j6:[]]:[]}function g0(e,o){let t=$6(e);if(!t?.propKey)return null;let{nodeId:r,propKey:a}=t,n=o.getItemById(r),s=o.getSelectorForId(r);if(!n||!s)return null;let{key:l,row:i}=Ut(a),d=o.components[n.type]?.fields?.[l],f=i?Dn(d,i):d,m=cf(f);if(!m)return null;let u=n.props??{};if(hT(u)!==null||!i&&_d(n.type,u,l)||n.type==="Text"&&l==="text"&&Rn(u)||i&&!(Array.isArray(u[l])&&i.index<u[l].length))return null;let h=i?uf(u[l],i):u[l];return{node:n,selector:s,propKey:a,kind:m,stored:h,offPage:Bf(f),panelOnly:tv(f)}}function Uf(e,o){let t=g0(e,o);if(!t)return null;let{text:r,hidden:a}=pa(t.stored);if(!gv({offPage:t.offPage,hidden:!!a,panelOnly:t.panelOnly}))return null;let n=pf(t.kind);return{partId:e,value:r,rules:ud,multiline:n,skip:z6,offered:nh(t.kind!=="plainText",n),write:s=>{let l=g0(e,o);l&&$f({node:l.node,propKey:l.propKey,kind:l.kind,zone:l.selector.zone,index:l.selector.index},s,o.replace)}}}function sh(e,o,t){return e?.isConnected&&e.getAttribute(Ue)===t?e:o?.querySelector(`[${Ue}="${jf(t)}"]`)??null}function jf(e){return e.replace(/["\\]/g,"\\$&")}function y0(e){let o=e.activeElement;return o?o.tagName==="IFRAME"||!!o.closest(".es-canvas"):!1}var rh=null,ah=new Set;function G6(){return rh}function lh(e){if(e!==rh){rh=e;for(let o of ah)o()}}function K6(e){return ah.add(e),()=>{ah.delete(e)}}function S0(){return W6(K6,G6,()=>null)}function b0(e,o){if(e.outer)return null;let t=o.getItemById(e.ownerId);if(!t)return null;let r=kw(t.type);return!r||Me(t.props)?null:{node:t,rows:r}}function Z6(e,o){let t=b0(e,o),r=o.getItemById(e.nodeId);if(!t||!r)return null;let a=_w(r.type,r.props,e.key);if(!a)return null;let n=t.node.props[t.rows];return!Array.isArray(n)||e.index<0||e.index>=n.length?null:q6(e.ownerId,kn(t.rows,{index:e.index,rowKey:a}))}function Gf(e,o){let t=Z6(e,o);return t?Uf(t,o):null}function w0(e,o){return Gf(e,o)?.value}function C0(e,o){let t=Gf(e,o);return t?(t.write(e.text),!0):!1}function k0(e,o){let t=b0(e,o),r=t&&o.getSelectorForId(e.ownerId);if(!t||!r)return!1;let a=t.node.props,n=a[t.rows],s=e.index;if(!Array.isArray(n)||s<0||s>=n.length)return!1;let l;switch(e.action){case"addAfter":{let i=o.components[t.node.type]?.fields?.[t.rows];l=V6(n,s+1,{...i?.defaultItemProps??{}});break}case"moveEarlier":case"moveLater":{let i=e.action==="moveEarlier"?s-1:s+1;if(i<0||i>=n.length)return!1;l=Y6(n,s,i);break}case"delete":l=X6(n,s);break;default:return!1}return o.replace(r.zone,r.index,{...t.node,props:{...a,[t.rows]:l}}),!0}import{jsx as Pe,Fragment as MJ,jsxs as Wu}from"react/jsx-runtime";import{Fragment as HJ,useEffect as yH,useMemo as SH,useRef as WJ,useState as za}from"react";import{useScreenDocument as vH}from"efficient-easel/screen/components/ScreenDocumentContext";import{UiIcon as Wy}from"efficient-easel/draw/client";import $J from"efficient-easel/screen/components/SidePanelHead";import{InspectorIconButton as zJ}from"efficient-easel/chrome";import{Input as UJ,LoadingSpinner as jJ,PopupMenu as GJ,PopupMenuItem as bH,toast as wH}from"efficient-shell/ui";import{LayersTree as KJ,TreeGroupLabel as qJ,TreeRow as CH,TreeRowAction as $u}from"efficient-easel/tree";import{AddIcon as VJ,DuplicateIcon as YJ,PageIcon as XJ,SettingsIcon as ZJ}from"efficient-easel/icons";import{PagesIcon as JJ}from"efficient-easel/rail";import{useEaselHost as QJ}from"efficient-easel/screen/lib/host";import{useEaselSession as $y}from"efficient-easel/screen/lib/session-context";import{useCallback as Kf,useEffect as J6,useSyncExternalStore as Q6}from"react";import{useScreenDocument as O0}from"efficient-easel/screen/components/ScreenDocumentContext";var v0=new WeakMap;function xl(e){let o=v0.get(e);return o||(o={rows:null,loading:null,listeners:new Set},v0.set(e,o)),o}function ih(e,o){e.rows=o;for(let t of e.listeners)t()}var qf=new Set;function Vf(e,o){o?qf.add(e):qf.delete(e)}function P0(e){let o=xl(e),t=e.listPages().then(r=>ih(o,qf.size?r.filter(a=>!qf.has(a.id)):r),()=>ih(o,[])).finally(()=>{o.loading===t&&(o.loading=null)});return o.loading=t,t}var T0=()=>null,e3=()=>()=>{};function hl(){let{adapter:e,ready:o}=O0(),t=Kf(l=>{let{listeners:i}=xl(e);return i.add(l),()=>i.delete(l)},[e]),r=Kf(()=>xl(e).rows,[e]),a=Q6(o?t:e3,o?r:T0,T0);J6(()=>{if(!o)return;let l=xl(e);l.rows===null&&!l.loading&&P0(e)},[e,o]);let n=Kf(()=>o?P0(e):Promise.resolve(),[e,o]),s=Kf(l=>ih(xl(e),l),[e]);return{rows:a,reload:n,setRows:s,getRows:r}}function o3(e,o){return e?.find(t=>t.slug===o)?.label?.trim()||`/${o}`}function E0(){let{currentSlug:e}=O0(),{rows:o}=hl();return o3(o,e)}import{canDuplicatePage as eQ,DuplicatePageDialog as oQ}from"efficient-easel/page-copy";import{jsx as Oo,jsxs as cH}from"react/jsx-runtime";import{useEffect as bJ,useId as wJ,useMemo as CJ,useRef as kJ,useState as Ny}from"react";import{useScreenDocument as vJ}from"efficient-easel/screen/components/ScreenDocumentContext";import{useEaselSession as PJ}from"efficient-easel/screen/lib/session-context";import{uniqueSlug as pH}from"efficient-easel/page-copy";import{AddIcon as TJ}from"efficient-easel/icons";import{Button as OJ,Dialog as EJ,EmptyState as _J,LoadingSpinner as AJ,Paragraph as FJ,SidebarLayout as BJ,SidebarNavItem as My,Title as LJ,toast as uH}from"efficient-shell/ui";import{jsx as Ot,jsxs as OR}from"react/jsx-runtime";import{useEffect as bq,useState as Ag}from"react";import{CanvasFrame as wq}from"efficient-easel/easel";import{Button as Cq,Card as kq,FitFrame as vq,Text as Pq}from"efficient-shell/ui";import{jsx as L0,Fragment as u3,jsxs as m3}from"react/jsx-runtime";import{useEffect as R0,useLayoutEffect as x3}from"react";var Yf="data-theme",_0="light";function t3(e){return e.getAttribute(Yf)===_0?"light":"dark"}function r3(e,o){return t3(e)===o?!1:(o==="light"?e.setAttribute(Yf,_0):e.removeAttribute(Yf),!0)}function a3(e){return Kx(e).getItem(ox)}function fle(e,o){Kx(e).setItem(ox,o)}function n3(e,o,t=new Date().getHours()){return Dw({mode:o.mode,override:a3(e),switchShown:o.switchShown,hour:t})}function A0(e,o){let t=e.documentElement;if(!t)return()=>{};let r=()=>r3(t,n3(e,o));r();let a=e.defaultView?.MutationObserver;if(!a)return()=>{};let n=new a(r);return n.observe(t,{attributes:!0,attributeFilter:[Yf]}),()=>n.disconnect()}var s3="style";function l3(e,o){let t=Ld(o),r=!1;for(let a of Kw){let n=t[a]??"";e.style.getPropertyValue(a)!==n&&(n?e.style.setProperty(a,n):e.style.removeProperty(a),r=!0)}return r}function F0(e,o){let t=e.body;if(!t)return()=>{};let r=()=>l3(t,o);r();let a=e.defaultView?.MutationObserver;if(!a)return()=>{};let n=new a(r);return n.observe(t,{attributes:!0,attributeFilter:[s3]}),()=>n.disconnect()}import{VIEW_DESKTOP_MIN as i3,VIEW_TABLET_MIN as d3}from"efficient-easel/screen/lib/content/view-tiers";var cr={fit:"data-fit",fitTablet:"data-fit-tablet",fitPhone:"data-fit-phone",min:"data-fit-min",minTablet:"data-fit-min-tablet",minPhone:"data-fit-min-phone",edge:"data-fit-edge"},Zo=cr,f3=e=>e.flatMap(o=>[`[${o}] p`,`[${o}] li`]).join(","),c3=String.raw`(function (doc) {
|
|
2
2
|
if (doc.__sfFitWords) return;
|
|
3
3
|
var win = doc.defaultView;
|
|
4
4
|
var SELECTOR = "h1,h2,h3,h4,h5,h6,[class*='font-heading'],[class*='font-display']";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as b,jsxs as H}from"react/jsx-runtime";import{useEffect as I,useMemo as L,useState as $}from"react";import{useEaselHost as z}from"efficient-easel/screen/lib/host";import{formatPrice as N}from"../../render/lib/commerce.js";import{resolveWheelPrice as K}from"../../render/lib/wheels/price-display.js";import{isRenderableFinish as O}from"../../render/lib/wheels/renderable-finishes.js";import{loadUnifiedProductCatalog as _}from"../../render/components/useProductCatalog.js";import{loadStorefrontCategories as w}from"./useStorefrontCategories.js";import{filterByCategory as M,useCategoryFilter as U}from"./useCategoryFilter.js";import{CategoryField as V}from"./CategoryProductFields.js";import{useSnapshotSource as q}from"efficient-web-builder/editor/components/useSnapshotSource";import{useCurrency as D}from"../../render/components/CurrencyContext.js";import G from"efficient-web-builder/editor/components/SearchSelectField";import J from"efficient-web-builder/editor/components/SourceStatus";import{say as n,sayCount as Q}from"efficient-web-builder/format/lib/editor-words";const R=e=>e.kind==="tyre"?"tyre":"alloy-wheel",m=e=>`${e.kind}:${e.slug}`;function E(e){return e.kind==="tyre"?{kind:"tyre",slug:e.slug,name:e.name,description:e.description??"",eyebrow:e.brand??"",image:e.coverImage??null,finishes:[],prices:e.prices,href:`/tyres/${e.slug}`}:{kind:"wheel",slug:e.slug,name:e.name,description:e.description??"",eyebrow:e.process,image:e.coverImage??null,finishes:e.finishes.filter(O).map(o=>({name:o.name,color:o.color,src:o.src})),prices:e.prices,href:`/wheels/${e.slug}`}}function C(e,o){const s=R(o);return e.find(t=>t.kind===s&&t.slug===o.slug)}function X(e){return T(e)?n("Category — wheels only"):n("Category")}const T=e=>!!(e?.some(o=>o.kind==="tyre")&&e.some(o=>o.kind==="alloy-wheel")),Y=e=>Q("{n} size","{n} sizes",e);function Z({rows:e,category:o,value:s,loading:t,currency:l}){const a=e??[],u=a.filter(r=>r.kind==="alloy-wheel"),p=a.filter(r=>r.kind==="tyre"),h=u.length>0&&p.length>0,S={value:"",label:t?n("Loading…"):n("Pick a product…")},g=s&&!(e!==null&&C(e,s))?[{value:m({kind:R(s),slug:s.slug}),label:t?s.name:n("{name} (unavailable)",{name:s.name})}]:[],c=M(u,o),d=s&&e!==null?C(e,s):void 0,x=[...d&&d.kind==="alloy-wheel"&&!c.includes(d)?[d]:[],...c].map(r=>{const y=K(r.prices[l],r.msrpPrices?.[l]);return{value:m({kind:"alloy-wheel",slug:r.slug}),label:r.name,...h?{group:n("Wheels")}:{},thumb:r.coverImage??null,...y.priced?{meta:N(y.unit,l)}:{}}}),P=p.map(r=>({value:m(r),label:r.name,...h?{group:n("Tyres")}:{},thumb:r.coverImage??null,meta:Y(r.variantCount)}));return[S,...g,...x,...P]}function v({value:e,onChange:o}){const s=z(),{rows:t,loading:l,refreshing:a,errored:u,refresh:p}=q({load:_,resolve:C,snapshot:E,value:e,onChange:o}),[h,S]=$(null);I(()=>{let i=!1;return w().then(k=>{i||S(k)}),()=>{i=!0}},[]);const{currency:g}=D(),c=L(()=>t&&e?C(t,e)??null:null,[t,e]),d=L(()=>(t??[]).filter(i=>i.kind==="alloy-wheel"),[t]),{category:f,setCategory:x,categoryNames:P}=U(d,h,c?.kind==="alloy-wheel"?c:null),r=!!e?.slug&&t!==null&&!c,y=L(()=>Z({rows:t,category:f,value:e,loading:l,currency:g}),[t,f,e,l,g]),W=i=>{if(!i){o(null);return}const k=(t??[]).find(F=>m(F)===i);k&&o(E(k))},j=()=>{e?.slug&&s.send("storefront-editor:open-product",{slug:e.slug,name:e.name})},A=u?"error":a?"loading":"idle",B=u?n("Couldn’t reach the product catalog."):a?n("Syncing from the catalog…"):r?n("Linked to “{name}” — no longer in the catalog.",{name:e?.name??""}):n("Linked to “{name}” · title, description, category, price & image follow the product.",{name:e?.name??""});return H("div",{children:[b(G,{label:"Product",options:y,fallback:"",value:e?m({kind:R(e),slug:e.slug}):"",onChange:W,placeholder:"Search products…"}),b(V,{label:X(t),allLabel:T(t)?n("All wheel categories"):n("All products"),category:f,onChange:x,categoryNames:P,readOnly:l}),e?.slug?b(J,{status:A,statusText:B,onRefresh:p,busy:a,edit:{label:n("Edit product ✎"),onClick:j},hint:n("The whole hero comes from the product record — title, price, pictures, options and Add to
|
|
1
|
+
"use client";import{jsx as b,jsxs as H}from"react/jsx-runtime";import{useEffect as I,useMemo as L,useState as $}from"react";import{useEaselHost as z}from"efficient-easel/screen/lib/host";import{formatPrice as N}from"../../render/lib/commerce.js";import{resolveWheelPrice as K}from"../../render/lib/wheels/price-display.js";import{isRenderableFinish as O}from"../../render/lib/wheels/renderable-finishes.js";import{loadUnifiedProductCatalog as _}from"../../render/components/useProductCatalog.js";import{loadStorefrontCategories as w}from"./useStorefrontCategories.js";import{filterByCategory as M,useCategoryFilter as U}from"./useCategoryFilter.js";import{CategoryField as V}from"./CategoryProductFields.js";import{useSnapshotSource as q}from"efficient-web-builder/editor/components/useSnapshotSource";import{useCurrency as D}from"../../render/components/CurrencyContext.js";import G from"efficient-web-builder/editor/components/SearchSelectField";import J from"efficient-web-builder/editor/components/SourceStatus";import{say as n,sayCount as Q}from"efficient-web-builder/format/lib/editor-words";const R=e=>e.kind==="tyre"?"tyre":"alloy-wheel",m=e=>`${e.kind}:${e.slug}`;function E(e){return e.kind==="tyre"?{kind:"tyre",slug:e.slug,name:e.name,description:e.description??"",eyebrow:e.brand??"",image:e.coverImage??null,finishes:[],prices:e.prices,href:`/tyres/${e.slug}`}:{kind:"wheel",slug:e.slug,name:e.name,description:e.description??"",eyebrow:e.process,image:e.coverImage??null,finishes:e.finishes.filter(O).map(o=>({name:o.name,color:o.color,src:o.src})),prices:e.prices,href:`/wheels/${e.slug}`}}function C(e,o){const s=R(o);return e.find(t=>t.kind===s&&t.slug===o.slug)}function X(e){return T(e)?n("Category — wheels only"):n("Category")}const T=e=>!!(e?.some(o=>o.kind==="tyre")&&e.some(o=>o.kind==="alloy-wheel")),Y=e=>Q("{n} size","{n} sizes",e);function Z({rows:e,category:o,value:s,loading:t,currency:l}){const a=e??[],u=a.filter(r=>r.kind==="alloy-wheel"),p=a.filter(r=>r.kind==="tyre"),h=u.length>0&&p.length>0,S={value:"",label:t?n("Loading…"):n("Pick a product…")},g=s&&!(e!==null&&C(e,s))?[{value:m({kind:R(s),slug:s.slug}),label:t?s.name:n("{name} (unavailable)",{name:s.name})}]:[],c=M(u,o),d=s&&e!==null?C(e,s):void 0,x=[...d&&d.kind==="alloy-wheel"&&!c.includes(d)?[d]:[],...c].map(r=>{const y=K(r.prices[l],r.msrpPrices?.[l]);return{value:m({kind:"alloy-wheel",slug:r.slug}),label:r.name,...h?{group:n("Wheels")}:{},thumb:r.coverImage??null,...y.priced?{meta:N(y.unit,l)}:{}}}),P=p.map(r=>({value:m(r),label:r.name,...h?{group:n("Tyres")}:{},thumb:r.coverImage??null,meta:Y(r.variantCount)}));return[S,...g,...x,...P]}function v({value:e,onChange:o}){const s=z(),{rows:t,loading:l,refreshing:a,errored:u,refresh:p}=q({load:_,resolve:C,snapshot:E,value:e,onChange:o}),[h,S]=$(null);I(()=>{let i=!1;return w().then(k=>{i||S(k)}),()=>{i=!0}},[]);const{currency:g}=D(),c=L(()=>t&&e?C(t,e)??null:null,[t,e]),d=L(()=>(t??[]).filter(i=>i.kind==="alloy-wheel"),[t]),{category:f,setCategory:x,categoryNames:P}=U(d,h,c?.kind==="alloy-wheel"?c:null),r=!!e?.slug&&t!==null&&!c,y=L(()=>Z({rows:t,category:f,value:e,loading:l,currency:g}),[t,f,e,l,g]),W=i=>{if(!i){o(null);return}const k=(t??[]).find(F=>m(F)===i);k&&o(E(k))},j=()=>{e?.slug&&s.send("storefront-editor:open-product",{slug:e.slug,name:e.name})},A=u?"error":a?"loading":"idle",B=u?n("Couldn’t reach the product catalog."):a?n("Syncing from the catalog…"):r?n("Linked to “{name}” — no longer in the catalog.",{name:e?.name??""}):n("Linked to “{name}” · title, description, category, price & image follow the product.",{name:e?.name??""});return H("div",{children:[b(G,{label:"Product",options:y,fallback:"",value:e?m({kind:R(e),slug:e.slug}):"",onChange:W,placeholder:"Search products…"}),b(V,{label:X(t),allLabel:T(t)?n("All wheel categories"):n("All products"),category:f,onChange:x,categoryNames:P,readOnly:l}),e?.slug?b(J,{status:A,statusText:B,onRefresh:p,busy:a,edit:{label:n("Edit product ✎"),onClick:j},hint:n("The whole hero comes from the product record — title, price, pictures, options and Add to cart. Edit the product in the Products database and this hero updates to match.")}):b("p",{className:"es-field-hint",children:n("This hero always shows a real product. Pick one to fill the title, price, pictures, options and Add to cart from the catalog.")})]})}export{v as default,X as heroCategoryLabel,Z as heroPickerOptions,C as heroResolve,E as heroSnapshot};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as
|
|
1
|
+
import{jsx as e}from"react/jsx-runtime";import{ProductFieldIcon as g,ImageIcon as t,EyeIcon as R,HashIcon as E}from"efficient-easel/icons";import{toggle as r,text as m,textarea as L,linkField as n,galleryLayoutField as O,galleryLayoutPhoneField as A,containerGapRows as T,displayFields as I,sourceField as P}from"efficient-web-builder/editor/lib/document/controls";import{deviceField as D}from"efficient-easel/screen/lib/document/device-fields";import{group as o}from"efficient-easel/screen/lib/document/box-fields";import{select as d,slider as G}from"efficient-web-builder/editor/lib/document/box-fields";import{blockSourceField as h,blockSourceFields as F,NO_BLOCK_SOURCE as c}from"efficient-web-builder/editor/lib/document/block-source-fields";import{GALLERY_TILE_PARTS as H}from"../../../../../../render/components/GalleryItem.js";import k,{GALLERY_MEDIA_ZONES as C}from"../../../../../components/GalleryPicturesSource.js";import{PRODUCT_PICTURES_SOURCE as a}from"../../../../../../render/lib/sections/product-pictures.js";import{headFieldsForPlacement as B,SPLITTABLE_SECTIONS as Y}from"efficient-web-builder/format/lib/sections/section-head-placement";import{slotRowsField as v}from"efficient-web-builder/editor/lib/document/blocks/shared-fields";import{withRowRules as U}from"efficient-web-builder/render/lib/document/show-when";import{GALLERY_LAYOUT_KEYS as b}from"efficient-web-builder/format/lib/content/gallery-layout";import{CARD_TEMPLATE_SLOT as w}from"efficient-web-builder/format/lib/content/card-template";import{PRODUCT_SETS_PROP as _}from"../../../../../../render/lib/sections/gallery-product-sets.js";import{BOUND_TO_THE_RECORD as l,BOUND_TO_THE_RECORD_ROW as N,DRAWS_OTHER_RECORD as W,ON_DYNAMIC_PAGE_ROW as p,PAGE_FACTS as x}from"../page-rules.js";import{GALLERY_B_PH as i,GalleryBSlots as u}from"../../../../../../render/lib/document/blocks/commerce/GalleryB/meta.js";const f=I(H),j={any:[{not:{field:w,set:!0}},{field:"dataSource",is:a}]},y={field:"layout",in:b},M=[{label:"Group covers",value:"covers"},{label:"Every photo",value:"all"},{label:"Auto (covers if 4+ groups)",value:"auto"}],de={fields:U({_gDynamic:o("Product page"),dynamic:r("Connect to product data",!1,e(g,{})),[_]:r("This product's sets",!1,e(t,{})),mediaZone:d("Images from",e(t,{}),C,"all"),photoDisplay:d("Show",e(R,{}),M,"covers"),_gHeader:o("Header"),num:m("Section number",i.num),title:L("Heading",i.title),_gHeaderLink:o("Header link"),linkText:m("Header button",i.link),linkHref:n("Header link"),_gImages:o("Images"),imageList:v("GalleryB"),items:u.items,template:u.template,...f,sets:r("Image sets",!1,e(t,{})),dataSource:h("Image source","Images typed here"),dataSourceOptions:P(k),limit:G("Images to show",e(E,{}),1,24,1,24),_gGalleryLink:o("Gallery link"),galleryHref:n("“See gallery” link"),_gArrangement:o("Arrangement"),layout:D("desktop",O()),layoutPhone:A(),...T("GalleryB")},[[["_gDynamic","dynamic"],p],[[_],{all:[p,{not:l}]}],[["mediaZone","photoDisplay"],{all:[N,{not:W}]}],[["_gImages"],{not:l}],[["items","imageList"],{all:[{not:l},c]}],[["limit"],{field:"dataSource",set:!0}],[Object.keys(f),j],[["dataSourceOptions"],{field:"dataSource",is:a}],[["layoutPhone"],{all:[{not:l},{any:[{all:[c,y]},{all:[{field:"dataSource",is:a},{any:[y,{not:{field:"columns",set:!0}}]}]}]}]}]]),resolveFields:(s,{fields:S,parent:Z})=>B(F("GalleryB",S,s.props),s.props.headPlacement,Y.GalleryB.headRows),showWhenFacts:x};export{de as GalleryBFields};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as o}from"react/jsx-runtime";import{IMAGE_FIT_ROW_LABEL as
|
|
1
|
+
import{jsx as o}from"react/jsx-runtime";import{IMAGE_FIT_ROW_LABEL as a}from"efficient-web-builder/format/lib/content/image-fit";import{BackgroundIcon as l,CaptionIcon as t,CropIcon as E,GapIcon as L,GridIcon as i,HandIcon as m,ImageIcon as n,ImagesIcon as R,RotateIcon as A}from"efficient-easel/icons";import{group as O}from"efficient-easel/screen/lib/document/box-fields";import{segmented as s,select as _,slider as I}from"efficient-web-builder/editor/lib/document/box-fields";import{toggle as e}from"efficient-web-builder/editor/lib/document/controls";import{shownForOption as p,withRowRules as G}from"efficient-web-builder/render/lib/document/show-when";import{DEFAULT_SPIN_AUTO_TURN as g,DEFAULT_SPIN_HINT as u}from"../../../../../../render/lib/sections/spin-sets.js";import{DEFAULT_HERO_CLOSE_UPS_FILL as H,DEFAULT_HERO_GALLERY_GAP as T,DEFAULT_HERO_GALLERY_MARKS as d,DEFAULT_HERO_GALLERY_MODE as r,DEFAULT_HERO_GALLERY_SHOW as c,HERO_GALLERY_GAP_MAX as F,HERO_GALLERY_GAP_MIN as U,HERO_GALLERY_MODES as D,HERO_GALLERY_SHOWS as S,DEFAULT_HERO_IMAGE_FIT as f,DEFAULT_HERO_PHOTO_GROUND as M,HERO_PHOTO_GROUNDS as h,heroImageFitOptions as P}from"../../../../../../render/lib/sections/hero-gallery.js";const W={fields:G({_gImageGallery:O("Image gallery"),galleryMode:_("Gallery",o(i,{}),[{label:"Main only",value:"main"},{label:"Main + thumbs",value:"thumbs"},{label:"Tiled",value:"tiled"},{label:"Stacked",value:"stacked"}],r),imageFit:s(a,o(n,{}),P(),f),ground:_("Image ground",o(l,{}),[...h],M),show:_("Show",o(R,{}),[...S],c),marks:e("Labels and arrows",d,o(t,{})),closeUpsFill:e("Close-ups fill the tile",H,o(E,{})),gap:I("Gap",o(L,{}),U,F,1,T,"px"),autoTurn:e("Auto turn",g,o(A,{})),turnHint:e("Turn hint",u,o(m,{}))},[[["gap"],p("galleryMode",D,r,["stacked"])]])};export{W as ProductGalleryFields};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as
|
|
1
|
+
import{jsx as e}from"react/jsx-runtime";import{EDITOR_ONLY_GROUP as g,LAYOUT_FIELD_KEYS as h,SECTION_THEME_FIELD_KEYS as A,SECTION_SHAPE_FIELD_KEYS as f,SECTION_ANIM_FIELD_KEYS as F}from"efficient-web-builder/editor/lib/document/field-groups";import{PREVIEWABLE_KINDS as H}from"../../../../../../render/components/pdp-dynamic/useSampleProduct.js";import w from"../../../../../components/ProductHeroSource.js";import N from"../../../../../components/PreviewProductPicker.js";import{BreadcrumbIcon as k,CarIcon as K,CheckCircleIcon as C,LinkIcon as D,CaseIcon as v,LayoutIcon as P,ColumnWidthsIcon as b,FullWidthIcon as y,SpecTableIcon as U,StickyIcon as Y,FinishIcon as B,ProductSizeIcon as M}from"efficient-easel/icons";import{plainText as x,sourceField as V,toggle as r}from"efficient-web-builder/editor/lib/document/controls";import{alignmentField as W,group as i}from"efficient-easel/screen/lib/document/box-fields";import{select as O,segmented as G,slider as j}from"efficient-web-builder/editor/lib/document/box-fields";import{isEditorOnDynamicPage as Z,editorTemplateProductKind as z}from"efficient-web-builder/format/lib/document/editor-page-context";import{DEFAULT_HERO_LAYOUT as a,HERO_LAYOUTS as l,HERO_RATIO_MIN as X,HERO_RATIO_MAX as q,DEFAULT_HERO_RATIO as J,DEFAULT_HERO_TEXT_ALIGN as Q}from"../../../../../../render/lib/sections/hero-arrangement.js";import{shownForOption as p,withRowRules as u}from"efficient-web-builder/render/lib/document/show-when";import{OFF_DYNAMIC_PAGE as $,ON_DYNAMIC_PAGE_ROW as ee,PAGE_FACTS as oe}from"../page-rules.js";import{HERO_BUY_SLOT as I}from"../../../../../../render/lib/content/hero-buy-seed.js";import{ProductHeroSlots as s}from"../../../../../../render/lib/document/blocks/commerce/ProductHero/meta.js";import{HERO_OPTION_SLOT as c,HERO_TILE_SLOT as n}from"../../../../../../render/lib/content/hero-option-seed.js";import{heroTemplateFollowsArrangement as te}from"../../../../../../render/lib/content/hero-seed.js";import{DEFAULT_HERO_FINISH_LOOK as re,DEFAULT_HERO_PICKER_LOOK as ie,DEFAULT_HERO_SIZE_LOOK as _e,DEFAULT_HERO_SPARE_LOOK as Oe,HERO_FINISH_LOOK_OPTIONS as le,HERO_FINISH_LOOK_PROP as R,HERO_PICKER_LOOK_OPTIONS as se,HERO_PICKER_LOOK_PROP as E,HERO_SIZE_LOOK_OPTIONS as ae,HERO_SIZE_LOOK_PROP as S,HERO_SPARE_LOOK_OPTIONS as ce,HERO_SPARE_LOOK_PROP as T,HERO_SPARE_WORDS_PROP as L,HERO_SPECS_LINK_PROP as m}from"../../../../../../render/lib/sections/hero-option-looks.js";const ne=()=>({type:"custom",render:()=>e(N,{})});function Ee(o){const t=o?.data?.root;return H.includes(z(t?.props))}const me={not:{context:"previewsNoTemplateProduct",is:!0}},Pe=new Set([...h,...A,...f,...F,"_gPreview","previewPick","_gBehaviour","showVehicleFitment",m,"startChosen","showSpecTable","showBreadcrumb","_gArrangement","heroLayout","imageRatio","stickyColumns","stageToEdge","textAlign","_gOptions",R,S,E,T,L,"template",c,n]),Ce={fields:u({_gSource:i("Product"),source:V(w),_gPreview:i(g),previewPick:ne(),_gBehaviour:i("Behavior"),showVehicleFitment:r("Vehicle fitment",!0,e(K,{})),[m]:r("Specs link",!0,e(D,{})),startChosen:r("Preselect options",!1,e(C,{})),showSpecTable:r("Spec table",!0,e(U,{})),showBreadcrumb:r("Breadcrumb",!0,e(k,{})),_gArrangement:i("Arrangement"),heroLayout:G("Layout",e(P,{}),[{label:"Split",value:"split"},{label:"Image right",value:"imageRight"},{label:"Stacked",value:"stacked"}],a),imageRatio:j("Image / buy ratio",e(b,{}),X,q,1,J,"%"),textAlign:W({allow:["left","center"],fallback:Q}),stickyColumns:r("Pin columns while scrolling",!1,e(Y,{})),stageToEdge:r("Images to the edge",!1,e(y,{})),_gOptions:i("Options"),[R]:O("Finish look",e(B,{}),le,re),[S]:O("Size look",e(M,{}),ae,_e),[E]:O("Picker look",e(P,{}),se,ie),[T]:O("Spare look",e(v,{}),ce,Oe),[L]:x("Spare label"),template:s.template,[c]:s[c],[n]:s[n],[I]:s[I]},[[["imageRatio","stickyColumns"],p("heroLayout",l,a,l.filter(o=>o!=="stacked"))],[["stageToEdge"],p("heroLayout",l,a,l.filter(o=>o!=="stacked"))],[["_gPreview","previewPick"],{all:[ee,me]}],[[E],{field:"showVehicleFitment",is:!0,default:!0}],[[m],{field:"showVehicleFitment",is:!0,default:!0}]]),resolveData:(o,{changed:t})=>{const _=te(o.props,t);return _===o.props?o:{...o,props:_}},resolveFields:(o,{fields:t})=>{if(!Z())return t;const _=Object.keys(t).filter(d=>!Pe.has(d));return u(t,[[_,$]])},showWhenFacts:{...oe,previewsNoTemplateProduct:(o,{appState:t})=>!Ee(t)}};export{Ce as ProductHeroFields};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as
|
|
1
|
+
import{jsx as e}from"react/jsx-runtime";import{AccentIcon as s,HeightIcon as n}from"efficient-easel/icons";import{segmented as h,select as _}from"efficient-web-builder/editor/lib/document/box-fields";import{FieldGlyph as T}from"efficient-web-builder/editor/components/FieldGlyph";import{toggle as f}from"efficient-web-builder/editor/lib/document/controls";import{say as o}from"efficient-web-builder/format/lib/editor-words";import{shownForOption as i,withRowRules as E}from"efficient-web-builder/render/lib/document/show-when";import{withHint as c}from"../controls.js";import{DEFAULT_HERO_NAME_TAG as d,DEFAULT_TITLE_LOOK as r,NAME_ACCENT_PROP as a,NAME_TAG_PROP as m,TITLE_LOOK_PROP as t,TITLE_LOOKS as l}from"../../../../../../render/lib/content/title-look.js";import{HERO_TEMPLATE_FACTS as p,IN_HERO_TEMPLATE_ROW as A}from"../hero-template-row.js";import{titleLookRow as O}from"../title-look-row.js";import{TextFields as w}from"efficient-web-builder/editor/lib/document/blocks/general/Text/fields";const L=w.fields.tag.options,v={fields:E({[t]:O({label:"Card name",value:"card"}),fixedHeight:c(h("Name height",e(n,{}),[{label:"Always 2 lines",value:!0},{label:"Fit the name",value:!1}],!0),o("Always 2 lines keeps every name in a row the same height. Fit the name uses only the lines the name needs.")),[a]:f("Accent last word",!1,e(s,{}),o("Shows the last word in italic, in the accent color.")),[m]:_("HTML tag",e(T,{noun:"heading"}),L,d)},[[["fixedHeight"],i(t,l,r,["card"])],[[a],i(t,l,r,["headline"])],[[m],A]]),showWhenFacts:p};export{v as ProductNameFields};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as a}from"react/jsx-runtime";import{headerKeysOfPlace as L,LAYOUT_FIELD_KEYS as b,SECTION_THEME_FIELD_KEYS as A,SECTION_SHAPE_FIELD_KEYS as F,SECTION_ANIM_FIELD_KEYS as I}from"efficient-web-builder/editor/lib/document/field-groups";import{getWheelBySlug as C}from"../../../../../../render/lib/wheels/wheels.js";import{SPEC_EMPTY_ROWS as N,
|
|
1
|
+
import{jsx as a}from"react/jsx-runtime";import{headerKeysOfPlace as L,LAYOUT_FIELD_KEYS as b,SECTION_THEME_FIELD_KEYS as A,SECTION_SHAPE_FIELD_KEYS as F,SECTION_ANIM_FIELD_KEYS as I}from"efficient-web-builder/editor/lib/document/field-groups";import{getWheelBySlug as C}from"../../../../../../render/lib/wheels/wheels.js";import{SPEC_EMPTY_ROWS as N,SPEC_ROW_LINES as H,SPEC_SHEET_ROWS as W}from"../../../../../../render/lib/wheels/spec-sheet.js";import Y from"../../../../../components/SpecTableSource.js";import{ProductFieldIcon as B,FinishIcon as h,DiagramIcon as M}from"efficient-easel/icons";import{DisplayRow as g,toggle as T,text as x,textarea as P,sourceField as U,plainText as w,useSelectedPatch as K,useSelectedProps as v}from"efficient-web-builder/editor/lib/document/controls";import{group as l}from"efficient-easel/screen/lib/document/box-fields";import{select as D}from"efficient-web-builder/editor/lib/document/box-fields";import{isEditorOnDynamicPage as j}from"efficient-web-builder/format/lib/document/editor-page-context";import{HEAD_ROWS_SHOW_WHEN as z,headFieldsForPlacement as k,SPLITTABLE_SECTIONS as G}from"efficient-web-builder/format/lib/sections/section-head-placement";import{truthy as p,withRowRules as R}from"efficient-web-builder/render/lib/document/show-when";import{BOUND_TO_THE_RECORD as V,BOUND_TO_THE_RECORD_ROW as S,OFF_TYRE_TEMPLATE_FACTS as Z,ON_DYNAMIC_PAGE_ROW as q,ON_TYRE_TEMPLATE as J,ON_TYRE_TEMPLATE_ROW as Q,PAGE_FACTS as X,TYRE_TEMPLATE_FACTS as $}from"../page-rules.js";import{SPECTABLE_PH as d,SpecTableSlots as ee}from"../../../../../../render/lib/document/blocks/commerce/SpecTable/meta.js";const oe="Size (blank = none selected)",se=[{id:"euLabel",label:"EU tyre label"}],c=[...W,H,N];function te(){const o=v(),s=K(),u=c.some(e=>o[e.prop]===!1);return a(g,{parts:c,changed:u,shown:e=>o[c.find(i=>i.id===e)?.prop??""]!==!1,onPress:(e,i)=>{const m=c.find(t=>t.id===e);m&&s({[m.prop]:i?void 0:!1})},onReset:()=>s(Object.fromEntries(c.map(e=>[e.prop,void 0])))})}const ae=new Set([...L("Content"),"_gDynamic","dynamic","_gHeader","num","title","description","_gDiagram","showDiagram","showEuLabel","showSelectionRow","template",...b,...A,...F,...I]),re={not:V},E={any:[{all:[p("source.slug"),p("source.spec")]},{all:[{not:p("source.slug")},p("wheel")]}]},ie={any:[{all:[S,{not:J}]},E]},Pe={fields:R({...ee,_gDynamic:l("Product page"),dynamic:T("Connect to product data",!1,a(B,{})),_gHeader:l("Header"),num:x("Number",d.num),title:P("Heading",d.title),description:P("Body",d.description),_gData:l("Product"),source:U(Y),finish:D("Finish",a(h,{}),[],""),size:{type:"text",label:oe},_gDiagram:l("Diagram"),showDiagram:T("Dimension diagram",!0,a(M,{})),showEuLabel:{type:"custom",render:({value:o,onChange:s})=>a(g,{parts:se,changed:o===!0,shown:()=>o===!0,onPress:(u,e)=>s(e),onReset:()=>s(!1)})},showSelectionRow:{type:"custom",render:()=>a(te,{})},_gRows:l("Rows"),rows:{type:"array",label:"Rows",arrayFields:{label:w("Label"),value:w("Value")},defaultItemProps:{label:"Label",value:""},getItemSummary:o=>o?.label||o?.value||"Row"}},[[["_gDynamic","dynamic"],q],[["finish","size"],E],[["_gDiagram","showDiagram"],{any:[S,E]}],[["_gRows","rows"],{not:E}],[["showEuLabel"],{all:[S,Q]}],[["showSelectionRow"],ie],[["_gDiagram","showDiagram","showEuLabel"],z]]),resolveFields:(o,{fields:s,parent:u})=>{const e=o.props,i=j(),m=n=>k(n,o.props.headPlacement,G.SpecTable.headRows),t=e.source,f=!t?.slug&&typeof e.wheel=="string"?e.wheel:"";let _=s;if(!(i&&e.dynamic)&&(t?.slug&&t.spec||f)){const n=t?.slug?t.finishes.map(r=>r.name):(C(f)?.finishes??[]).map(r=>r.name),y=[{value:"",label:"Default (first finish)"},...n.map(r=>({value:r,label:r}))];_={..._,finish:D("Finish",a(h,{}),y,"")}}const O=Object.keys(_).filter(n=>!ae.has(n));return m(R(_,[[O,re]]))},showWhenFacts:{...X,...Z,...$}};export{Pe as SpecTableFields};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const commerceBlocks: Record<"FilterBlock" | "FilterChipsBlock" | "ProductGrid" | "ProductHero" | "AlloyWheelsListing" | "StockFitment" | "ProductEyebrow" | "ProductName" | "Gallery" | "GalleryB" | "CatalogFilterBar" | "Header" | "ProductPicture" | "ProductSpecs" | "ProductBuy" | "ProductPrice" | "ProductColour" | "ProductSize" | "ProductSku" | "ProductGallery" | "ProductBuyButton" | "Collections" | "SpecTable" | "DetailRows" | "RelatedProducts" | "BundleOffer" | "FitmentTable" | "SearchBlock" | "CountrySwitchBlock" | "ThemeSwitchBlock" | "AccountBlock" | "CartBlock" | "CollectionCard" | "ProductRef" | "
|
|
1
|
+
export declare const commerceBlocks: Record<"FilterBlock" | "FilterChipsBlock" | "ProductGrid" | "ProductHero" | "AlloyWheelsListing" | "StockFitment" | "ProductEyebrow" | "ProductName" | "Gallery" | "GalleryB" | "CatalogFilterBar" | "Header" | "GalleryItem" | "ProductPicture" | "ProductSpecs" | "ProductBuy" | "ProductPrice" | "ProductColour" | "ProductSize" | "ProductSku" | "ProductGallery" | "ProductBuyButton" | "Collections" | "SpecTable" | "DetailRows" | "RelatedProducts" | "BundleOffer" | "FitmentTable" | "SearchBlock" | "CountrySwitchBlock" | "ThemeSwitchBlock" | "AccountBlock" | "CartBlock" | "CollectionCard" | "ProductRef" | "EuTyreLabelBlock" | "WheelDiagram" | "CheckoutCTA" | "CompatibleTyres" | "DeliveryOptions" | "FitmentFinder" | "TyreFitment" | "TyreSizes" | "EuTyreLabel" | "FitmentPicker", import("efficient-easel/blocks").ComponentConfig<any, any, Omit<import("efficient-easel/blocks").ComponentData<any, string, Record<string, import("efficient-easel/blocks").DefaultComponentProps>>, "type">>>;
|
|
@@ -81,7 +81,6 @@ export declare const STOREFRONT_BLOCKS_WORDS: {
|
|
|
81
81
|
readonly Blocks: "Blocks";
|
|
82
82
|
readonly "Blog post title": "Blog post title";
|
|
83
83
|
readonly "Blog posts": "Blog posts";
|
|
84
|
-
readonly "Bolt Pattern": "Bolt Pattern";
|
|
85
84
|
readonly "Bolt pattern": "Bolt pattern";
|
|
86
85
|
readonly "Booking box": "Booking box";
|
|
87
86
|
readonly "Border thickness": "Border thickness";
|
|
@@ -115,9 +114,10 @@ export declare const STOREFRONT_BLOCKS_WORDS: {
|
|
|
115
114
|
readonly "Cart, checkout, your country and currency, sign-in, and this choice. The site cannot work without them.": "Cart, checkout, your country and currency, sign-in, and this choice. The site cannot work without them.";
|
|
116
115
|
readonly "Category \u2014 wheels only": "Category — wheels only";
|
|
117
116
|
readonly "Cell height": "Cell height";
|
|
117
|
+
readonly "Center bore": "Center bore";
|
|
118
118
|
readonly "Center the row": "Center the row";
|
|
119
119
|
readonly Centered: "Centered";
|
|
120
|
-
readonly "Centre
|
|
120
|
+
readonly "Centre bore": "Centre bore";
|
|
121
121
|
readonly Channel: "Channel";
|
|
122
122
|
readonly "Channel row": "Channel row";
|
|
123
123
|
readonly Channels: "Channels";
|
|
@@ -131,6 +131,7 @@ export declare const STOREFRONT_BLOCKS_WORDS: {
|
|
|
131
131
|
readonly "Clear all": "Clear all";
|
|
132
132
|
readonly "Close button": "Close button";
|
|
133
133
|
readonly "Close popup": "Close popup";
|
|
134
|
+
readonly "Close-ups fill the tile": "Close-ups fill the tile";
|
|
134
135
|
readonly "Code and currency": "Code and currency";
|
|
135
136
|
readonly "Collect from the warehouse.": "Collect from the warehouse.";
|
|
136
137
|
readonly Collection: "Collection";
|
|
@@ -399,7 +400,7 @@ export declare const STOREFRONT_BLOCKS_WORDS: {
|
|
|
399
400
|
readonly "Logo fills its column on {view}": "Logo fills its column on {view}";
|
|
400
401
|
readonly "Logo fills its row": "Logo fills its row";
|
|
401
402
|
readonly "Logo fills its row on {view}": "Logo fills its row on {view}";
|
|
402
|
-
readonly "Lug
|
|
403
|
+
readonly "Lug count": "Lug count";
|
|
403
404
|
readonly Lugs: "Lugs";
|
|
404
405
|
readonly M: "M";
|
|
405
406
|
readonly "Main + thumbs": "Main + thumbs";
|
|
@@ -477,7 +478,6 @@ export declare const STOREFRONT_BLOCKS_WORDS: {
|
|
|
477
478
|
readonly "OEM rear": "OEM rear";
|
|
478
479
|
readonly "OEM rear tyres": "OEM rear tyres";
|
|
479
480
|
readonly Offset: "Offset";
|
|
480
|
-
readonly "Offset (ET)": "Offset (ET)";
|
|
481
481
|
readonly "On an article page, the post it shows is not listed.": "On an article page, the post it shows is not listed.";
|
|
482
482
|
readonly "On scroll up": "On scroll up";
|
|
483
483
|
readonly "On the photo": "On the photo";
|
|
@@ -529,6 +529,7 @@ export declare const STOREFRONT_BLOCKS_WORDS: {
|
|
|
529
529
|
readonly Popups: "Popups";
|
|
530
530
|
readonly "Portrait (4:5)": "Portrait (4:5)";
|
|
531
531
|
readonly "Posts to display": "Posts to display";
|
|
532
|
+
readonly "Preselect options": "Preselect options";
|
|
532
533
|
readonly "Price and details come from the product record \u2014 edit them in the Products database and this block updates to match. The name follows the product\u2019s design name unless it\u2019s overridden per storefront in {place}.": "Price and details come from the product record — edit them in the Products database and this block updates to match. The name follows the product’s design name unless it’s overridden per storefront in {place}.";
|
|
533
534
|
readonly "Price on request": "Price on request";
|
|
534
535
|
readonly "Price word": "Price word";
|
|
@@ -693,6 +694,7 @@ export declare const STOREFRONT_BLOCKS_WORDS: {
|
|
|
693
694
|
readonly "Spare look": "Spare look";
|
|
694
695
|
readonly "Spec table": "Spec table";
|
|
695
696
|
readonly "Specifications *table.*": "Specifications *table.*";
|
|
697
|
+
readonly "Specs link": "Specs link";
|
|
696
698
|
readonly "Speed rating": "Speed rating";
|
|
697
699
|
readonly "Staggered spread": "Staggered spread";
|
|
698
700
|
readonly "Starts after the posts the list above shows.": "Starts after the posts the list above shows.";
|
|
@@ -751,7 +753,7 @@ export declare const STOREFRONT_BLOCKS_WORDS: {
|
|
|
751
753
|
readonly "The vehicle question appears here on a tyre product page, with one verdict per size.": "The vehicle question appears here on a tyre product page, with one verdict per size.";
|
|
752
754
|
readonly "The website\u2019s pictures appear here, in the order they are put in. A website with no pictures draws nothing.": "The website’s pictures appear here, in the order they are put in. A website with no pictures draws nothing.";
|
|
753
755
|
readonly "The week": "The week";
|
|
754
|
-
readonly "The whole hero comes from the product record \u2014 title, price, pictures, options and Add to
|
|
756
|
+
readonly "The whole hero comes from the product record \u2014 title, price, pictures, options and Add to cart. Edit the product in the Products database and this hero updates to match.": "The whole hero comes from the product record — title, price, pictures, options and Add to cart. Edit the product in the Products database and this hero updates to match.";
|
|
755
757
|
readonly "Third card": "Third card";
|
|
756
758
|
readonly "Third category": "Third category";
|
|
757
759
|
readonly "Third detail": "Third detail";
|
|
@@ -760,11 +762,12 @@ export declare const STOREFRONT_BLOCKS_WORDS: {
|
|
|
760
762
|
readonly "This form has no fields yet, so there is nothing for a visitor to fill in.": "This form has no fields yet, so there is nothing for a visitor to fill in.";
|
|
761
763
|
readonly "This form is switched off, so it won\u2019t appear on the published page. Turn it back on in {place}.": "This form is switched off, so it won’t appear on the published page. Turn it back on in {place}.";
|
|
762
764
|
readonly "This header uses the old layout": "This header uses the old layout";
|
|
763
|
-
readonly "This hero always shows a real product. Pick one to fill the title, price, pictures, options and Add to
|
|
765
|
+
readonly "This hero always shows a real product. Pick one to fill the title, price, pictures, options and Add to cart from the catalog.": "This hero always shows a real product. Pick one to fill the title, price, pictures, options and Add to cart from the catalog.";
|
|
764
766
|
readonly "This menu draws no links: its card template is empty. Undo the delete, or delete this Menu and add it again.": "This menu draws no links: its card template is empty. Undo the delete, or delete this Menu and add it again.";
|
|
765
767
|
readonly "This menu has no links yet \u2014 add them in {place}.": "This menu has no links yet — add them in {place}.";
|
|
766
768
|
readonly "This product": "This product";
|
|
767
769
|
readonly "This product has no finishes yet, so its card falls back to the product image \u2014 or an empty placeholder when it has none. Add finishes to the product record, then give each one an image.": "This product has no finishes yet, so its card falls back to the product image — or an empty placeholder when it has none. Add finishes to the product record, then give each one an image.";
|
|
770
|
+
readonly "This product's sets": "This product's sets";
|
|
768
771
|
readonly "This product\u2019s photos appear here on a product page. Add media groups in the product\u2019s Media tab.": "This product’s photos appear here on a product page. Add media groups in the product’s Media tab.";
|
|
769
772
|
readonly "This product\u2019s sizes appear here on a product page.": "This product’s sizes appear here on a product page.";
|
|
770
773
|
readonly "This record\u2019s pictures appear here on its page. A record with no pictures draws nothing.": "This record’s pictures appear here on its page. A record with no pictures draws nothing.";
|
|
@@ -847,7 +850,17 @@ export declare const STOREFRONT_BLOCKS_WORDS: {
|
|
|
847
850
|
readonly "items per row": "items per row";
|
|
848
851
|
readonly lastName: "lastName";
|
|
849
852
|
readonly paypal: "paypal";
|
|
853
|
+
readonly showBoltPatternRow: "showBoltPatternRow";
|
|
854
|
+
readonly showBumpProfileRow: "showBumpProfileRow";
|
|
855
|
+
readonly showCapCodeRow: "showCapCodeRow";
|
|
856
|
+
readonly showCenterBoreRow: "showCenterBoreRow";
|
|
850
857
|
readonly showEmptyRows: "showEmptyRows";
|
|
858
|
+
readonly showFinishRow: "showFinishRow";
|
|
859
|
+
readonly showLoadRatingRow: "showLoadRatingRow";
|
|
860
|
+
readonly showLugCountRow: "showLugCountRow";
|
|
861
|
+
readonly showOffsetRow: "showOffsetRow";
|
|
862
|
+
readonly showProcessRow: "showProcessRow";
|
|
863
|
+
readonly showRimProfileRow: "showRimProfileRow";
|
|
851
864
|
readonly showRowLines: "showRowLines";
|
|
852
865
|
readonly showSelectionRow: "showSelectionRow";
|
|
853
866
|
readonly showSizeRow: "showSizeRow";
|