{"version":3,"file":"ShopifyCollectionGrid.BOYFYnXx.mjs","names":["useState","useCallback","useRef","useMemo","__esmMin","init_ssg_sandbox_shims","ne","_e","pe","p","ce","init_npm_react_18_3_1","ee","de","window","init_framer_Bf4_tcb2","addPropertyControls","ControlType","clampPageSize","pageSize","MAX_PAGE_SIZE","MIN_PAGE_SIZE","DEFAULT_PAGE_SIZE","createScopeKey","storefrontAccessToken","collectionHandle","sortKey","reverse","filters","createPaginationVariables","cursor","createCacheKey","SESSION_CACHE_KEY_PREFIX","SHOPIFY_API_VERSION","operationName","variables","readSessionCache","memoryResult","memoryCache","cacheKey","serializedResult","cachedResult","writeSessionCache","result","fetchStorefrontQuery","startedAt","response","STOREFRONT_ENDPOINT","queryTimeMs","payload","message","fetchCollectionProducts","COLLECTION_PRODUCTS_QUERY","signal","fetchCollectionFilters","COLLECTION_FILTERS_QUERY","formatPrice","amount","money","getSpannedAspectRatio","width","height","aspectRatio","columnSpan","getCompareAtPrice","compareAtPrice","sellingPrice","getDiscountLabel","sellingAmount","compareAtAmount","discount","getErrorMessage","error","scrollElementIntoView","element","prefersReducedMotion","targetTop","offset","getSortOption","SORT_OPTIONS","option","value","parsePriceRangeBounds","filterValue","parsed","buildProductFilters","parsedInputs","selectedFilterInputs","input","priceFilter","useCollection","scopeKey","paginationState","setPaginationState","INITIAL_PAGINATION_STATE","collectionTitle","setCollectionTitle","products","setProducts","pageInfo","setPageInfo","EMPTY_PAGE_INFO","loading","setLoading","setError","notFound","setNotFound","setQueryTimeMs","fromCache","setFromCache","availableFilters","setAvailableFilters","EMPTY_FILTERS","filtersLoading","setFiltersLoading","retryCount","setRetryCount","activeState","currentCursor","normalizedHandle","abortController","collection","node","requestError","retry","currentCount","goToPage","targetIndex","page","state","current","isAtFrontier","isNextFrontierPage","LoadingGrid","placeholderCount","imageAspectRatio","LIGHT_GRAY","index","ErrorState","stateContainerStyle","onRetry","buttonStyle","EmptyState","getVariantGallons","match","title","Pagination","hasPreviousPage","currentPage","knownPageCount","pageButtonCount","hasNextPage","onGoToPage","isCurrent","FilterGroup","filter","bounds","event","onPriceChange","onToggle","DebugPanel","OFF_WHITE","ShopifyCollectionGrid","DEFAULT_GAP","DEFAULT_IMAGE_ASPECT_RATIO","DEFAULT_IMAGE_FIT","DEFAULT_SHOW_COMPARE_AT_PRICE","DEFAULT_SHOW_PAGINATION","DEFAULT_SHOW_SORT_CONTROL","DEFAULT_SORT_OPTION_VALUE","DEFAULT_SHOW_FILTERS","DEFAULT_DEBUG_MODE","selectedSortValue","setSelectedSortValue","defaultSortOption","setSelectedFilterInputs","setPriceFilter","toggleFilterInput","next","clearFilters","rootRef","sortOption","productFilters","hasActiveFilters","useCollectionOrder","pendingScrollRef","handleGoToPage","PAGINATION_SCROLL_OFFSET","gridStyle","gap","rootStyle","style","configurationMessage","COMPONENT_STYLES","showSortControl","showFilters","ProductCard","product","showPagination","debugMode","PRODUCT_PATH_PREFIX","BRAND_BLUE","BRAND_BLUE_RGB","RICH_BLACK","STONE_GRAY","BULK_SIZE_MIN_GALLONS","init_ShopifyCollectionGrid","init_jsx_runtime","productUrl","productDescription","isDouble","tag","cardImageAspectRatio","variants","all","hideBulkSizes","retail","gallons","variant","hasMoreSizes","selectedVariantId","setSelectedVariantId","selectedVariant","cardImage","showCompareAtPrice","imageFit","isSelected","props"],"sources":["https:/framerusercontent.com/modules/r0uc5mNTFAuQ66lJTGTO/Z8cAxDfLBk51xUZAbCLO/ShopifyCollectionGrid.js"],"sourcesContent":["//////////////////////////////////////////////////\n// 1. Imports\n//////////////////////////////////////////////////\nimport{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{memo,useCallback,useEffect,useMemo,useRef,useState}from\"react\";import{addPropertyControls,ControlType}from\"framer\";//////////////////////////////////////////////////\n// 2. Constants\n//////////////////////////////////////////////////\nconst SHOPIFY_API_VERSION=\"2026-07\";const SHOPIFY_STORE_DOMAIN=\"business.rcpamerica.com\";const STOREFRONT_ENDPOINT=`https://${SHOPIFY_STORE_DOMAIN}/api/${SHOPIFY_API_VERSION}/graphql.json`;// Numbered pagination only ever moves forward (first/after) — each visited\n// page's end cursor is cached client-side so jumping back to an earlier page\n// number is an instant \"after: <cached cursor>\" request. There is no last/before\n// branch: the Storefront API doesn't support jumping to an arbitrary page, so\n// going past the furthest-visited page still means advancing one page at a time.\nconst COLLECTION_PRODUCTS_QUERY=`#graphql\n    query CollectionProducts(\n        $handle: String!\n        $first: Int!\n        $after: String\n        $sortKey: ProductCollectionSortKeys\n        $reverse: Boolean\n        $filters: [ProductFilter!]\n    ) {\n        collection(handle: $handle) {\n            id\n            title\n            products(\n                first: $first\n                after: $after\n                sortKey: $sortKey\n                reverse: $reverse\n                filters: $filters\n            ) {\n                edges {\n                    cursor\n                    node {\n                        id\n                        handle\n                        title\n                        tags\n                        availableForSale\n                        snippet: metafield(namespace: \"custom\", key: \"snippet\") {\n                            value\n                        }\n                        featuredImage {\n                            url\n                            altText\n                            width\n                            height\n                        }\n                        priceRange {\n                            minVariantPrice {\n                                amount\n                                currencyCode\n                            }\n                            maxVariantPrice {\n                                amount\n                                currencyCode\n                            }\n                        }\n                        compareAtPriceRange {\n                            minVariantPrice {\n                                amount\n                                currencyCode\n                            }\n                            maxVariantPrice {\n                                amount\n                                currencyCode\n                            }\n                        }\n                        variants(first: 4) {\n                            edges {\n                                node {\n                                    id\n                                    title\n                                    availableForSale\n                                    image {\n                                        url\n                                        altText\n                                        width\n                                        height\n                                    }\n                                    price {\n                                        amount\n                                        currencyCode\n                                    }\n                                    compareAtPrice {\n                                        amount\n                                        currencyCode\n                                    }\n                                }\n                            }\n                            pageInfo {\n                                hasNextPage\n                            }\n                        }\n                    }\n                }\n                pageInfo {\n                    hasNextPage\n                    hasPreviousPage\n                    startCursor\n                    endCursor\n                }\n            }\n        }\n    }\n`;// Fetched on its own, decoupled from pagination: facet aggregation is expensive\n// (Shopify scans the whole matching set, not just the current page), so it should\n// only be refetched when the collection or the active filter selection changes —\n// never on a plain next/previous page click.\nconst COLLECTION_FILTERS_QUERY=`#graphql\n    query CollectionFilters(\n        $handle: String!\n        $filters: [ProductFilter!]\n    ) {\n        collection(handle: $handle) {\n            id\n            products(first: 1, filters: $filters) {\n                filters {\n                    id\n                    label\n                    type\n                    values {\n                        id\n                        label\n                        count\n                        input\n                    }\n                }\n            }\n        }\n    }\n`;const DEFAULT_PAGE_SIZE=24;const MIN_PAGE_SIZE=1;const MAX_PAGE_SIZE=100;const DEFAULT_GAP=24;const DEFAULT_IMAGE_ASPECT_RATIO=\"4 / 5\";const DEFAULT_IMAGE_FIT=\"cover\";const DEFAULT_SHOW_COMPARE_AT_PRICE=true;const DEFAULT_SHOW_PAGINATION=true;// Keeps the grid's top edge clear of a sticky site header when pagination\n// scrolls the page back up.\nconst PAGINATION_SCROLL_OFFSET=80;const DEFAULT_DEBUG_MODE=false;const DEFAULT_SHOW_SORT_CONTROL=true;const DEFAULT_SHOW_FILTERS=true;const SORT_OPTIONS=[{value:\"featured\",label:\"Featured\",sortKey:\"COLLECTION_DEFAULT\",reverse:false},{value:\"best-selling\",label:\"Best Selling\",sortKey:\"BEST_SELLING\",reverse:false},{value:\"price-asc\",label:\"Price: Low to High\",sortKey:\"PRICE\",reverse:false},{value:\"price-desc\",label:\"Price: High to Low\",sortKey:\"PRICE\",reverse:true},{value:\"newest\",label:\"Newest\",sortKey:\"CREATED\",reverse:true},{value:\"title-asc\",label:\"Alphabetical: A-Z\",sortKey:\"TITLE\",reverse:false},{value:\"title-desc\",label:\"Alphabetical: Z-A\",sortKey:\"TITLE\",reverse:true}];const DEFAULT_SORT_OPTION_VALUE=SORT_OPTIONS[0].value;const PRODUCT_PATH_PREFIX=\"/products\";const SESSION_CACHE_KEY_PREFIX=\"shopify-collection-grid:v7\";// RCP America brand palette (digital/graphic use — see Brand Identity Guide).\n// Product Blue (#009FDF / Pantone 801C) is print/packaging-only and must never\n// appear here; Brand Blue is the correct blue for all web and graphic work.\nconst BRAND_BLUE=\"#009FDA\";const BRAND_BLUE_RGB=\"0, 159, 218\";const RICH_BLACK=\"#0A0A0A\";const OFF_WHITE=\"#F5F2ED\";const STONE_GRAY=\"#8A8A8A\";const LIGHT_GRAY=\"#E8E8E8\";const COMPONENT_STYLES=`\n    .scg-controls {\n        display: flex;\n        flex-wrap: wrap;\n        align-items: flex-start;\n        justify-content: space-between;\n        gap: 16px;\n    }\n\n    .scg-filters {\n        display: flex;\n        flex-wrap: wrap;\n        align-items: flex-start;\n        gap: 8px;\n    }\n\n    .scg-filter-group {\n        border: 1px solid ${LIGHT_GRAY};\n        border-radius: 6px;\n        padding: 8px 12px;\n    }\n\n    .scg-filter-group summary {\n        cursor: pointer;\n        font-family: Inter, ui-sans-serif, system-ui, sans-serif;\n        font-size: 14px;\n        font-weight: 600;\n    }\n\n    .scg-filter-group__list {\n        display: flex;\n        flex-direction: column;\n        gap: 6px;\n        margin: 10px 0 0;\n        padding: 0;\n        list-style: none;\n        font-family: Inter, ui-sans-serif, system-ui, sans-serif;\n        font-size: 14px;\n    }\n\n    .scg-filter-group__list label {\n        display: flex;\n        align-items: center;\n        gap: 6px;\n        cursor: pointer;\n    }\n\n    .scg-filter-group__count {\n        color: ${STONE_GRAY};\n    }\n\n    .scg-filter-group__price-inputs {\n        display: flex;\n        gap: 8px;\n        margin-top: 10px;\n    }\n\n    .scg-filter-group__price-inputs label {\n        display: flex;\n        flex-direction: column;\n        gap: 4px;\n        font-family: Inter, ui-sans-serif, system-ui, sans-serif;\n        font-size: 12px;\n    }\n\n    .scg-filter-group__price-inputs input {\n        width: 80px;\n        padding: 6px 8px;\n        border: 1px solid ${LIGHT_GRAY};\n        border-radius: 4px;\n        font: inherit;\n    }\n\n    .scg-filters__clear {\n        align-self: center;\n        border: 0;\n        background: transparent;\n        color: ${BRAND_BLUE};\n        font-family: Inter, ui-sans-serif, system-ui, sans-serif;\n        font-size: 14px;\n        font-weight: 600;\n        text-decoration: underline;\n        cursor: pointer;\n        padding: 8px 0;\n    }\n\n    .scg-sort {\n        display: flex;\n        align-items: center;\n        gap: 8px;\n        font-family: Inter, ui-sans-serif, system-ui, sans-serif;\n        font-size: 14px;\n    }\n\n    .scg-sort__select {\n        padding: 8px 10px;\n        border: 1px solid ${LIGHT_GRAY};\n        border-radius: 6px;\n        background: #ffffff;\n        font: inherit;\n        color: inherit;\n    }\n\n    .scg-product-grid {\n        display: grid;\n        grid-template-columns: repeat(2, minmax(0, 1fr));\n    }\n\n    @container (min-width: 700px) {\n        .scg-product-grid {\n            grid-template-columns: repeat(3, minmax(0, 1fr));\n        }\n    }\n\n    @container (min-width: 1100px) {\n        .scg-product-grid {\n            grid-template-columns: repeat(4, minmax(0, 1fr));\n        }\n    }\n\n    .scg-product-card {\n        position: relative;\n        display: flex;\n        flex-direction: column;\n        height: 100%;\n        overflow: hidden;\n        border: 0;\n        border-radius: 0;\n        background: #ffffff;\n        box-shadow: none;\n        color: ${RICH_BLACK};\n    }\n\n    .scg-product-card--kit {\n        grid-column: span 2;\n    }\n\n    .scg-product-card__image-link {\n        position: relative;\n        display: block;\n        overflow: hidden;\n        background: #ffffff;\n        color: inherit;\n        text-decoration: none;\n    }\n\n    .scg-product-card__image {\n        display: block;\n        width: 100%;\n        height: 100%;\n        transition: transform 240ms ease;\n    }\n\n    @media (hover: hover) {\n        .scg-product-card:hover .scg-product-card__image {\n            transform: scale(1.075);\n        }\n    }\n\n    .scg-product-card__badge {\n        position: absolute;\n        top: 12px;\n        left: 12px;\n        z-index: 1;\n        padding: 6px 10px;\n        border-radius: 999px;\n        background: ${BRAND_BLUE};\n        color: #ffffff;\n        font-family: Anton, Impact, \"Arial Narrow\", sans-serif;\n        font-size: 13px;\n        font-weight: 400;\n        line-height: 1;\n        letter-spacing: 0.04em;\n        text-transform: uppercase;\n    }\n\n    .scg-product-card__content {\n        display: flex;\n        flex: 1;\n        flex-direction: column;\n        align-items: stretch;\n        gap: 8px;\n        padding: 10px 4px 4px;\n    }\n\n    .scg-product-card__title {\n        display: -webkit-box;\n        overflow: hidden;\n        color: ${BRAND_BLUE};\n        font-family: Anton, Impact, \"Arial Narrow\", sans-serif;\n        font-size: 23px;\n        font-weight: 400;\n        line-height: 1.15;\n        text-align: center;\n        text-decoration: none;\n        text-transform: uppercase;\n        -webkit-box-orient: vertical;\n        -webkit-line-clamp: 1;\n    }\n\n    .scg-product-card__description {\n        display: -webkit-box;\n        overflow: hidden;\n        color: ${RICH_BLACK};\n        font-family: Inter, ui-sans-serif, system-ui, sans-serif;\n        font-size: 16px;\n        font-weight: 500;\n        line-height: 1.3;\n        text-align: center;\n        text-decoration: none;\n        -webkit-box-orient: vertical;\n        -webkit-line-clamp: 2;\n        text-transform: capitalize;\n    }\n\n    .scg-product-card__variants {\n        display: flex;\n        flex-wrap: wrap;\n        justify-content: center;\n        gap: 6px;\n    }\n\n    .scg-product-card__variant {\n        border: 1px solid ${RICH_BLACK};\n        border-radius: 0;\n        background: #ffffff;\n        color: ${RICH_BLACK};\n        font-family: Inter, ui-sans-serif, system-ui, sans-serif;\n        font-size: 13px;\n        font-weight: 500;\n        line-height: 1;\n        padding: 6px 10px;\n        cursor: pointer;\n        transition: background 160ms ease, color 160ms ease, border-color 160ms ease;\n    }\n\n    @media (hover: hover) {\n        .scg-product-card__variant:hover:not(:disabled) {\n            border-color: ${BRAND_BLUE};\n            background: ${BRAND_BLUE};\n            color: #ffffff;\n        }\n    }\n\n    .scg-product-card__variant--selected {\n        border-color: ${BRAND_BLUE};\n        background: ${BRAND_BLUE};\n        color: #ffffff;\n    }\n\n    .scg-product-card__variant:disabled {\n        border-color: ${LIGHT_GRAY};\n        color: ${STONE_GRAY};\n        text-decoration: line-through;\n        cursor: not-allowed;\n    }\n\n    .scg-product-card__more-sizes {\n        display: inline-flex;\n        align-items: center;\n        font-family: Inter, ui-sans-serif, system-ui, sans-serif;\n        font-size: 13px;\n        font-weight: 600;\n        line-height: 1;\n        padding: 6px 2px;\n        color: ${BRAND_BLUE};\n        text-decoration: underline;\n    }\n\n    @media (hover: hover) {\n        .scg-product-card__more-sizes:hover {\n            color: ${RICH_BLACK};\n        }\n    }\n\n    @media (prefers-reduced-motion: reduce) {\n        .scg-product-card__variant {\n            transition: none;\n        }\n    }\n\n    .scg-product-card__price-row {\n        display: flex;\n        flex-wrap: wrap;\n        align-items: baseline;\n        justify-content: center;\n        gap: 7px;\n        min-height: 20px;\n        font-family: Inter, ui-sans-serif, system-ui, sans-serif;\n        font-size: 16px;\n        font-weight: 700;\n        line-height: 1.25;\n        text-align: center;\n    }\n\n    .scg-product-card__compare-price {\n        color: ${STONE_GRAY};\n        font-weight: 500;\n    }\n\n    .scg-product-card a:focus-visible {\n        outline: 3px solid rgba(${BRAND_BLUE_RGB}, 0.35);\n        outline-offset: 3px;\n    }\n\n    @media (prefers-reduced-motion: reduce) {\n        .scg-product-card,\n        .scg-product-card__image {\n            transition: none;\n        }\n    }\n\n    .scg-pagination {\n        display: flex;\n        align-items: center;\n        justify-content: center;\n        gap: 8px;\n    }\n\n    .scg-pagination__list {\n        display: flex;\n        align-items: center;\n        gap: 6px;\n        margin: 0;\n        padding: 0;\n        list-style: none;\n    }\n\n    .scg-pagination__arrow {\n        display: inline-flex;\n        align-items: center;\n        justify-content: center;\n        width: 40px;\n        height: 40px;\n        border: 1px solid ${LIGHT_GRAY};\n        border-radius: 50%;\n        background: transparent;\n        color: inherit;\n        font-size: 18px;\n        line-height: 1;\n        cursor: pointer;\n    }\n\n    .scg-pagination__arrow:disabled {\n        opacity: 0.35;\n        cursor: default;\n    }\n\n    .scg-pagination__page {\n        display: inline-flex;\n        align-items: center;\n        justify-content: center;\n        min-width: 36px;\n        height: 36px;\n        padding: 0 4px;\n        border: 1px solid ${LIGHT_GRAY};\n        border-radius: 50%;\n        background: transparent;\n        color: ${RICH_BLACK};\n        font-family: Inter, ui-sans-serif, system-ui, sans-serif;\n        font-size: 14px;\n        font-weight: 600;\n        cursor: pointer;\n    }\n\n    .scg-pagination__page:disabled {\n        cursor: default;\n    }\n\n    .scg-pagination__page--current {\n        border-color: ${BRAND_BLUE};\n        background: ${BRAND_BLUE};\n        color: #ffffff;\n    }\n`;//////////////////////////////////////////////////\n// 4. Utility Functions\n//////////////////////////////////////////////////\nconst memoryCache=new Map;function clampPageSize(pageSize){if(!Number.isFinite(pageSize))return DEFAULT_PAGE_SIZE;return Math.min(MAX_PAGE_SIZE,Math.max(MIN_PAGE_SIZE,Math.round(pageSize)));}function createScopeKey(storefrontAccessToken,collectionHandle,pageSize,sortKey,reverse,filters){return`${storefrontAccessToken}:${collectionHandle.trim()}:${clampPageSize(pageSize)}:${sortKey}:${reverse}:${JSON.stringify(filters)}`;}function createPaginationVariables(handle,pageSize,sortKey,reverse,filters,cursor){return{handle,first:clampPageSize(pageSize),after:cursor,sortKey,reverse,filters};}function createCacheKey(operationName,variables){return`${SESSION_CACHE_KEY_PREFIX}:${SHOPIFY_API_VERSION}:${operationName}:${JSON.stringify(variables)}`;}function readSessionCache(cacheKey){const memoryResult=memoryCache.get(cacheKey);if(memoryResult)return memoryResult;if(typeof window===\"undefined\")return null;try{const serializedResult=window.sessionStorage.getItem(cacheKey);if(!serializedResult)return null;const cachedResult=JSON.parse(serializedResult);memoryCache.set(cacheKey,cachedResult);return cachedResult;}catch{return null;}}function writeSessionCache(cacheKey,result){memoryCache.set(cacheKey,result);if(typeof window===\"undefined\")return;try{window.sessionStorage.setItem(cacheKey,JSON.stringify(result));}catch{// The in-memory cache remains available when sessionStorage is blocked or full.\n}}async function fetchStorefrontQuery(operationName,query,storefrontAccessToken,variables,signal){const cacheKey=createCacheKey(operationName,variables);const cachedResult=readSessionCache(cacheKey);if(cachedResult){return{...cachedResult,fromCache:true};}const startedAt=performance.now();const response=await fetch(STOREFRONT_ENDPOINT,{method:\"POST\",headers:{\"Content-Type\":\"application/json\",\"X-Shopify-Storefront-Access-Token\":storefrontAccessToken},body:JSON.stringify({query,variables}),signal});const queryTimeMs=Math.round(performance.now()-startedAt);if(!response.ok){throw new Error(`Shopify request failed (${response.status})`);}const payload=await response.json();if(payload.errors?.length){throw new Error(payload.errors.map(({message})=>message).join(\"; \"));}if(!payload.data){throw new Error(\"Shopify returned an empty response\");}const result={data:payload.data,queryTimeMs};// Never cache a \"collection not found\" response: a collection published\n// to the storefront later must show up without the visitor closing the tab.\nif(payload.data.collection!==null){writeSessionCache(cacheKey,result);}return{...result,fromCache:false};}function fetchCollectionProducts(storefrontAccessToken,variables,signal){return fetchStorefrontQuery(\"CollectionProducts\",COLLECTION_PRODUCTS_QUERY,storefrontAccessToken,variables,signal);}function fetchCollectionFilters(storefrontAccessToken,variables,signal){return fetchStorefrontQuery(\"CollectionFilters\",COLLECTION_FILTERS_QUERY,storefrontAccessToken,variables,signal);}function formatPrice(money){const amount=Number(money.amount);if(!Number.isFinite(amount))return money.amount;try{return new Intl.NumberFormat(undefined,{style:\"currency\",currency:money.currencyCode}).format(amount);}catch{return`${money.currencyCode} ${money.amount}`;}}function getSpannedAspectRatio(aspectRatio,columnSpan){const[width,height]=aspectRatio.split(\"/\").map(Number);if(!Number.isFinite(width)||!Number.isFinite(height)||width<=0||height<=0){return aspectRatio;}return`${width*columnSpan} / ${height}`;}function getCompareAtPrice(sellingPrice,compareAtPrice){if(!compareAtPrice)return null;if(sellingPrice.currencyCode!==compareAtPrice.currencyCode)return null;return Number(compareAtPrice.amount)>Number(sellingPrice.amount)?compareAtPrice:null;}function getDiscountLabel(sellingPrice,compareAtPrice){const sellingAmount=Number(sellingPrice.amount);const compareAtAmount=Number(compareAtPrice.amount);const discount=Math.round((1-sellingAmount/compareAtAmount)*100);return discount>0?`Up to ${discount}% OFF`:\"Sale\";}function getErrorMessage(error){if(error instanceof Error&&error.message)return error.message;return\"We couldn't load this collection. Please try again.\";}function scrollElementIntoView(element,offset=0){if(!element||typeof window===\"undefined\")return;const prefersReducedMotion=window.matchMedia(\"(prefers-reduced-motion: reduce)\").matches;const targetTop=element.getBoundingClientRect().top+window.scrollY-offset;window.scrollTo({top:targetTop,behavior:prefersReducedMotion?\"auto\":\"smooth\"});}function getSortOption(value){return SORT_OPTIONS.find(option=>option.value===value)??SORT_OPTIONS[0];}function parsePriceRangeBounds(filterValue){if(!filterValue)return{min:null,max:null};try{const parsed=JSON.parse(filterValue.input);return{min:typeof parsed.price?.min===\"number\"?parsed.price.min:null,max:typeof parsed.price?.max===\"number\"?parsed.price.max:null};}catch{return{min:null,max:null};}}function buildProductFilters(selectedFilterInputs,priceFilter){const parsedInputs=Array.from(selectedFilterInputs).flatMap(input=>{try{return[JSON.parse(input)];}catch{return[];}});if(priceFilter.min!==null||priceFilter.max!==null){parsedInputs.push({price:{...priceFilter.min!==null?{min:priceFilter.min}:{},...priceFilter.max!==null?{max:priceFilter.max}:{}}});}return parsedInputs;}//////////////////////////////////////////////////\n// 5. React Hooks\n//////////////////////////////////////////////////\nconst EMPTY_PAGE_INFO={hasNextPage:false,hasPreviousPage:false,startCursor:null,endCursor:null};const EMPTY_FILTERS=[];const INITIAL_PAGINATION_STATE={pageIndex:0,pageCursors:[null]};function useCollection({storefrontAccessToken,collectionHandle,pageSize,sortKey,reverse,filters}){const scopeKey=createScopeKey(storefrontAccessToken,collectionHandle,pageSize,sortKey,reverse,filters);const[paginationState,setPaginationState]=useState({scopeKey,...INITIAL_PAGINATION_STATE});const[collectionTitle,setCollectionTitle]=useState(null);const[products,setProducts]=useState([]);const[pageInfo,setPageInfo]=useState(EMPTY_PAGE_INFO);const[loading,setLoading]=useState(true);const[error,setError]=useState(null);const[notFound,setNotFound]=useState(false);const[queryTimeMs,setQueryTimeMs]=useState(null);const[fromCache,setFromCache]=useState(false);const[availableFilters,setAvailableFilters]=useState(EMPTY_FILTERS);const[filtersLoading,setFiltersLoading]=useState(true);const[retryCount,setRetryCount]=useState(0);const activeState=paginationState.scopeKey===scopeKey?paginationState:{scopeKey,...INITIAL_PAGINATION_STATE};const currentCursor=activeState.pageCursors[activeState.pageIndex]??null;useEffect(()=>{const normalizedHandle=collectionHandle.trim();if(!storefrontAccessToken.trim()||!normalizedHandle){setCollectionTitle(null);setProducts([]);setPageInfo(EMPTY_PAGE_INFO);setLoading(false);setError(null);setNotFound(false);setQueryTimeMs(null);setFromCache(false);return;}const abortController=new AbortController;const variables=createPaginationVariables(normalizedHandle,pageSize,sortKey,reverse,filters,currentCursor);setLoading(true);setError(null);setNotFound(false);void fetchCollectionProducts(storefrontAccessToken.trim(),variables,abortController.signal).then(result=>{if(abortController.signal.aborted)return;const collection=result.data.collection;setCollectionTitle(collection?.title??null);setProducts(collection?.products.edges.map(({node})=>node)??[]);setPageInfo(collection?.products.pageInfo??EMPTY_PAGE_INFO);setNotFound(collection===null);setQueryTimeMs(result.queryTimeMs);setFromCache(result.fromCache);}).catch(requestError=>{if(abortController.signal.aborted)return;setCollectionTitle(null);setProducts([]);setPageInfo(EMPTY_PAGE_INFO);setError(getErrorMessage(requestError));setQueryTimeMs(null);setFromCache(false);}).finally(()=>{if(!abortController.signal.aborted)setLoading(false);});return()=>abortController.abort();},[currentCursor,activeState.pageIndex,collectionHandle,pageSize,JSON.stringify(filters),retryCount,reverse,scopeKey,sortKey,storefrontAccessToken]);// Deliberately excludes cursor/pageSize/sortKey: facet counts don't depend on\n// page or sort order, so a plain next/previous click or sort change must not\n// re-trigger this (more expensive) request.\nuseEffect(()=>{const normalizedHandle=collectionHandle.trim();if(!storefrontAccessToken.trim()||!normalizedHandle){setAvailableFilters(EMPTY_FILTERS);setFiltersLoading(false);return;}const abortController=new AbortController;setFiltersLoading(true);void fetchCollectionFilters(storefrontAccessToken.trim(),{handle:normalizedHandle,filters},abortController.signal).then(result=>{if(abortController.signal.aborted)return;setAvailableFilters(result.data.collection?.products.filters??EMPTY_FILTERS);}).catch(()=>{if(abortController.signal.aborted)return;setAvailableFilters(EMPTY_FILTERS);}).finally(()=>{if(!abortController.signal.aborted)setFiltersLoading(false);});return()=>abortController.abort();},[collectionHandle,JSON.stringify(filters),retryCount,storefrontAccessToken]);const retry=useCallback(()=>{setRetryCount(currentCount=>currentCount+1);},[]);// Jumping to an already-visited page (targetIndex < known length) is instant —\n// its cursor is cached. Jumping exactly one past the furthest-visited page\n// extends the frontier using the current page's end cursor, but only when\n// the current page IS that frontier (guards against a stale/mismatched\n// pageInfo being mistaken for the target page's cursor). Anything else\n// (skipping ahead further, or extending with no next page) is a no-op.\nconst goToPage=useCallback(page=>{const targetIndex=page-1;if(targetIndex<0)return;setPaginationState(current=>{const state=current.scopeKey===scopeKey?current:{scopeKey,...INITIAL_PAGINATION_STATE};if(targetIndex<state.pageCursors.length){return{...state,pageIndex:targetIndex};}const isAtFrontier=state.pageIndex===state.pageCursors.length-1;const isNextFrontierPage=targetIndex===state.pageCursors.length;if(isAtFrontier&&isNextFrontierPage&&pageInfo.hasNextPage&&pageInfo.endCursor){return{scopeKey,pageIndex:targetIndex,pageCursors:[...state.pageCursors,pageInfo.endCursor]};}return state;});},[pageInfo.endCursor,pageInfo.hasNextPage,scopeKey]);return{collectionTitle,products,pageInfo,loading,error,notFound,queryTimeMs,fromCache,availableFilters,filtersLoading,currentPage:activeState.pageIndex+1,knownPageCount:activeState.pageCursors.length,hasNextPage:pageInfo.hasNextPage,retry,goToPage};}const stateContainerStyle={display:\"flex\",flexDirection:\"column\",alignItems:\"center\",justifyContent:\"center\",gap:12,minHeight:240,padding:24,textAlign:\"center\"};const buttonStyle={display:\"inline-flex\",alignItems:\"center\",justifyContent:\"center\",minHeight:40,padding:\"8px 16px\",border:\"1px solid currentColor\",borderRadius:6,background:\"transparent\",color:\"inherit\",font:\"inherit\",cursor:\"pointer\",textDecoration:\"none\"};function LoadingGrid({pageSize,gap,imageAspectRatio}){const placeholderCount=Math.min(pageSize,12);return /*#__PURE__*/_jsx(\"div\",{\"aria-busy\":\"true\",\"aria-label\":\"Loading products\",className:\"scg-product-grid\",style:{gap},children:Array.from({length:placeholderCount},(_,index)=>/*#__PURE__*/_jsxs(\"div\",{style:{display:\"grid\",gap:8},children:[/*#__PURE__*/_jsx(\"div\",{style:{width:\"100%\",aspectRatio:imageAspectRatio,background:LIGHT_GRAY}}),/*#__PURE__*/_jsx(\"div\",{style:{width:\"75%\",height:18,borderRadius:4,background:LIGHT_GRAY}}),/*#__PURE__*/_jsx(\"div\",{style:{width:\"40%\",height:16,borderRadius:4,background:LIGHT_GRAY}})]},index))});}function ErrorState({error,onRetry}){return /*#__PURE__*/_jsxs(\"div\",{role:\"alert\",style:stateContainerStyle,children:[/*#__PURE__*/_jsx(\"strong\",{children:\"We couldn't load this collection.\"}),/*#__PURE__*/_jsx(\"span\",{children:error}),/*#__PURE__*/_jsx(\"button\",{type:\"button\",onClick:onRetry,style:buttonStyle,children:\"Try again\"})]});}function EmptyState({notFound}){return /*#__PURE__*/_jsxs(\"div\",{style:stateContainerStyle,children:[/*#__PURE__*/_jsx(\"strong\",{children:notFound?\"Collection not found\":\"No products found\"}),/*#__PURE__*/_jsx(\"span\",{children:notFound?\"Check the collection handle and try again.\":\"This collection does not contain any products yet.\"})]});}// Gallon size parsed from a variant title (\"5 Gallon\", \"55 gal\"); null when not a gallon size.\nfunction getVariantGallons(title){const match=title.match(/(\\d+(?:\\.\\d+)?)\\s*-?\\s*(?:gallons?|gal)\\b/i);if(!match)return null;const value=Number.parseFloat(match[1]);return Number.isFinite(value)?value:null;}const BULK_SIZE_MIN_GALLONS=5;const ProductCard=/*#__PURE__*/memo(function ProductCard({product,imageAspectRatio,imageFit,showCompareAtPrice,hideBulkSizes}){const productUrl=`${PRODUCT_PATH_PREFIX}/${encodeURIComponent(product.handle)}`;const productDescription=product.snippet?.value.trim();const isDouble=product.tags?.some(tag=>tag.trim().toLocaleLowerCase()===\"double\")??false;const cardImageAspectRatio=isDouble?getSpannedAspectRatio(imageAspectRatio,2):imageAspectRatio;const variants=useMemo(()=>{const all=product.variants.edges.map(({node})=>node);if(!hideBulkSizes)return all;const retail=all.filter(variant=>{const gallons=getVariantGallons(variant.title);return gallons===null||gallons<BULK_SIZE_MIN_GALLONS;});// Keep the product purchasable if it only comes in bulk sizes.\nreturn retail.length>0?retail:all;},[product.variants,hideBulkSizes]);const hasMoreSizes=!hideBulkSizes&&(product.variants.pageInfo?.hasNextPage??false);const[selectedVariantId,setSelectedVariantId]=useState(()=>variants[0]?.id??null);const selectedVariant=variants.find(variant=>variant.id===selectedVariantId)??null;const cardImage=selectedVariant?.image??product.featuredImage;const sellingPrice=selectedVariant?.price??product.priceRange.minVariantPrice;const compareAtPrice=showCompareAtPrice?getCompareAtPrice(sellingPrice,selectedVariant?selectedVariant.compareAtPrice:product.compareAtPriceRange.minVariantPrice):null;return /*#__PURE__*/_jsxs(\"article\",{className:`scg-product-card${isDouble?\" scg-product-card--kit\":\"\"}`,children:[/*#__PURE__*/_jsxs(\"a\",{href:productUrl,\"aria-label\":`View ${product.title}`,className:\"scg-product-card__image-link\",style:{aspectRatio:cardImageAspectRatio},children:[compareAtPrice?/*#__PURE__*/_jsx(\"span\",{className:\"scg-product-card__badge\",children:getDiscountLabel(sellingPrice,compareAtPrice)}):null,cardImage?/*#__PURE__*/_jsx(\"img\",{className:\"scg-product-card__image\",src:cardImage.url,alt:cardImage.altText??product.title,width:cardImage.width,height:cardImage.height,loading:\"lazy\",decoding:\"async\",style:{objectFit:imageFit}}):null]}),/*#__PURE__*/_jsxs(\"div\",{className:\"scg-product-card__content\",children:[/*#__PURE__*/_jsx(\"a\",{href:productUrl,className:\"scg-product-card__title\",children:product.title}),productDescription?/*#__PURE__*/_jsx(\"a\",{href:productUrl,className:\"scg-product-card__description\",children:productDescription}):null,variants.length>1?/*#__PURE__*/_jsxs(\"div\",{className:\"scg-product-card__variants\",role:\"group\",\"aria-label\":\"Select a size\",children:[variants.map(variant=>{const isSelected=variant.id===selectedVariantId;return /*#__PURE__*/_jsx(\"button\",{type:\"button\",className:`scg-product-card__variant${isSelected?\" scg-product-card__variant--selected\":\"\"}`,\"aria-pressed\":isSelected,disabled:!variant.availableForSale,onClick:()=>setSelectedVariantId(variant.id),children:variant.title},variant.id);}),hasMoreSizes?/*#__PURE__*/_jsx(\"a\",{href:productUrl,className:\"scg-product-card__more-sizes\",children:\"See More Sizes\"}):null]}):null,/*#__PURE__*/_jsxs(\"div\",{className:\"scg-product-card__price-row\",children:[/*#__PURE__*/_jsxs(\"span\",{children:[formatPrice(sellingPrice),\" \",sellingPrice.currencyCode]}),compareAtPrice?/*#__PURE__*/_jsxs(\"s\",{className:\"scg-product-card__compare-price\",children:[formatPrice(compareAtPrice),\" \",compareAtPrice.currencyCode]}):null]})]})]});});function Pagination({currentPage,knownPageCount,hasNextPage,loading,onGoToPage}){const hasPreviousPage=currentPage>1;// Only the page immediately past the furthest one visited can ever be\n// fetched (the Storefront API can't jump to an arbitrary page) — so a\n// number button for it only appears while standing on that frontier page.\nconst isAtFrontier=currentPage===knownPageCount;const canExtend=isAtFrontier&&hasNextPage;const pageButtonCount=knownPageCount+(canExtend?1:0);if(pageButtonCount<=1&&!hasPreviousPage)return null;return /*#__PURE__*/_jsxs(\"nav\",{\"aria-label\":\"Collection pagination\",className:\"scg-pagination\",children:[/*#__PURE__*/_jsx(\"button\",{type:\"button\",\"aria-label\":\"Previous page\",onClick:()=>onGoToPage(currentPage-1),disabled:loading||!hasPreviousPage,className:\"scg-pagination__arrow\",children:\"‹\"}),/*#__PURE__*/_jsx(\"ol\",{className:\"scg-pagination__list\",children:Array.from({length:pageButtonCount},(_,index)=>{const page=index+1;const isCurrent=page===currentPage;return /*#__PURE__*/_jsx(\"li\",{children:/*#__PURE__*/_jsx(\"button\",{type:\"button\",\"aria-current\":isCurrent?\"page\":undefined,\"aria-label\":`Page ${page}`,onClick:()=>onGoToPage(page),disabled:loading||isCurrent,className:`scg-pagination__page${isCurrent?\" scg-pagination__page--current\":\"\"}`,children:page})},page);})}),/*#__PURE__*/_jsx(\"button\",{type:\"button\",\"aria-label\":\"Next page\",onClick:()=>onGoToPage(currentPage+1),disabled:loading||isAtFrontier&&!hasNextPage,className:\"scg-pagination__arrow\",children:\"›\"})]});}function FilterGroup({filter,selectedFilterInputs,priceFilter,onToggle,onPriceChange}){if(filter.type===\"PRICE_RANGE\"){const bounds=parsePriceRangeBounds(filter.values[0]);return /*#__PURE__*/_jsxs(\"details\",{className:\"scg-filter-group\",children:[/*#__PURE__*/_jsx(\"summary\",{children:filter.label}),/*#__PURE__*/_jsxs(\"div\",{className:\"scg-filter-group__price-inputs\",children:[/*#__PURE__*/_jsxs(\"label\",{children:[/*#__PURE__*/_jsx(\"span\",{children:\"Min\"}),/*#__PURE__*/_jsx(\"input\",{type:\"number\",inputMode:\"decimal\",placeholder:bounds.min!==null?String(bounds.min):undefined,value:priceFilter.min??\"\",onChange:event=>{const value=event.target.value;onPriceChange({...priceFilter,min:value===\"\"?null:Number(value)});}})]}),/*#__PURE__*/_jsxs(\"label\",{children:[/*#__PURE__*/_jsx(\"span\",{children:\"Max\"}),/*#__PURE__*/_jsx(\"input\",{type:\"number\",inputMode:\"decimal\",placeholder:bounds.max!==null?String(bounds.max):undefined,value:priceFilter.max??\"\",onChange:event=>{const value=event.target.value;onPriceChange({...priceFilter,max:value===\"\"?null:Number(value)});}})]})]})]});}return /*#__PURE__*/_jsxs(\"details\",{className:\"scg-filter-group\",children:[/*#__PURE__*/_jsx(\"summary\",{children:filter.label}),/*#__PURE__*/_jsx(\"ul\",{className:\"scg-filter-group__list\",children:filter.values.map(value=>/*#__PURE__*/_jsx(\"li\",{children:/*#__PURE__*/_jsxs(\"label\",{children:[/*#__PURE__*/_jsx(\"input\",{type:\"checkbox\",checked:selectedFilterInputs.has(value.input),onChange:()=>onToggle(value.input)}),/*#__PURE__*/_jsx(\"span\",{children:value.label}),/*#__PURE__*/_jsxs(\"span\",{className:\"scg-filter-group__count\",children:[\"(\",value.count,\")\"]})]})},value.id))})]});}function DebugPanel({collectionHandle,productCount,queryTimeMs,fromCache,pageInfo,availableFilters,filtersLoading}){return /*#__PURE__*/_jsx(\"pre\",{style:{margin:0,padding:12,overflow:\"auto\",borderRadius:6,background:OFF_WHITE,fontSize:12,whiteSpace:\"pre-wrap\"},children:JSON.stringify({collectionHandle,productCount,queryTimeMs,fromCache,startCursor:pageInfo.startCursor,endCursor:pageInfo.endCursor,hasPreviousPage:pageInfo.hasPreviousPage,hasNextPage:pageInfo.hasNextPage,apiVersion:SHOPIFY_API_VERSION,filtersLoading,availableFilters:availableFilters.map(filter=>({id:filter.id,label:filter.label,type:filter.type,values:filter.values.map(value=>`${value.label} (${value.count})`)}))},null,2)});}//////////////////////////////////////////////////\n// 7. Main Component\n//////////////////////////////////////////////////\nexport default function ShopifyCollectionGrid({storefrontAccessToken=\"\",collectionHandle=\"\",pageSize=DEFAULT_PAGE_SIZE,gap=DEFAULT_GAP,imageAspectRatio=DEFAULT_IMAGE_ASPECT_RATIO,imageFit=DEFAULT_IMAGE_FIT,showCompareAtPrice=DEFAULT_SHOW_COMPARE_AT_PRICE,showPagination=DEFAULT_SHOW_PAGINATION,showSortControl=DEFAULT_SHOW_SORT_CONTROL,defaultSortOption=DEFAULT_SORT_OPTION_VALUE,showFilters=DEFAULT_SHOW_FILTERS,debugMode=DEFAULT_DEBUG_MODE,hideBulkSizes=false,useCollectionOrder=false,style}){const[selectedSortValue,setSelectedSortValue]=useState(defaultSortOption);const[selectedFilterInputs,setSelectedFilterInputs]=useState(()=>new Set);const[priceFilter,setPriceFilter]=useState({min:null,max:null});// Keeps the designer's \"Default Sort\" property control in sync while editing\n// in Framer. Safe at runtime too, since the prop never changes during a\n// visitor's session — only a visitor's own dropdown interaction should stick.\nuseEffect(()=>{setSelectedSortValue(defaultSortOption);},[defaultSortOption]);// A new collection page shouldn't inherit filter selections from whatever\n// page the visitor was previously browsing.\nuseEffect(()=>{setSelectedFilterInputs(new Set);setPriceFilter({min:null,max:null});},[collectionHandle]);const toggleFilterInput=useCallback(input=>{setSelectedFilterInputs(current=>{const next=new Set(current);if(next.has(input)){next.delete(input);}else{next.add(input);}return next;});},[]);const clearFilters=useCallback(()=>{setSelectedFilterInputs(new Set);setPriceFilter({min:null,max:null});},[]);const rootRef=useRef(null);const sortOption=getSortOption(selectedSortValue);const productFilters=buildProductFilters(selectedFilterInputs,priceFilter);const hasActiveFilters=selectedFilterInputs.size>0||priceFilter.min!==null||priceFilter.max!==null;const{products,pageInfo,loading,error,notFound,queryTimeMs,fromCache,availableFilters,filtersLoading,currentPage,knownPageCount,hasNextPage,retry,goToPage}=useCollection({storefrontAccessToken,collectionHandle,pageSize,// \"Use Shopify Order\" follows the collection's own sort order (e.g. a\n// manual order set in Shopify admin) until the visitor picks a sort.\nsortKey:useCollectionOrder&&selectedSortValue===defaultSortOption?\"COLLECTION_DEFAULT\":sortOption.sortKey,reverse:useCollectionOrder&&selectedSortValue===defaultSortOption?false:sortOption.reverse,filters:productFilters});// Scrolling inline in the click handler fired even when goToPage's guards\n// silently rejected the jump (e.g. a stale frontier), so \"page changed\" and\n// \"we scrolled\" could drift apart. Gating on this ref and firing from an\n// effect keyed on currentPage ties the scroll to an actual committed page\n// change instead of the click itself, so it fires exactly once per real\n// pagination transition — never on the initial mount, never on a no-op click.\nconst pendingScrollRef=useRef(false);const handleGoToPage=useCallback(page=>{pendingScrollRef.current=true;goToPage(page);},[goToPage]);useEffect(()=>{if(!pendingScrollRef.current)return;pendingScrollRef.current=false;scrollElementIntoView(rootRef.current,PAGINATION_SCROLL_OFFSET);},[currentPage]);const gridStyle=useMemo(()=>({gap:Math.max(0,gap)}),[gap]);const rootStyle=useMemo(()=>({width:\"100%\",display:\"flex\",flexDirection:\"column\",containerType:\"inline-size\",gap:Math.max(16,gap),color:\"inherit\",font:\"inherit\",...style}),[gap,style]);const configurationMessage=!storefrontAccessToken.trim()?\"Add a public Shopify Storefront access token in the component properties.\":!collectionHandle.trim()?\"Add a Shopify collection handle in the component properties.\":null;return /*#__PURE__*/_jsxs(\"section\",{ref:rootRef,style:rootStyle,children:[/*#__PURE__*/_jsx(\"style\",{children:COMPONENT_STYLES}),!configurationMessage&&!notFound&&(showSortControl||showFilters&&availableFilters.length>0)?/*#__PURE__*/_jsxs(\"div\",{className:\"scg-controls\",children:[showFilters&&availableFilters.length>0?/*#__PURE__*/_jsxs(\"div\",{className:\"scg-filters\",children:[availableFilters.map(filter=>/*#__PURE__*/_jsx(FilterGroup,{filter:filter,selectedFilterInputs:selectedFilterInputs,priceFilter:priceFilter,onToggle:toggleFilterInput,onPriceChange:setPriceFilter},filter.id)),hasActiveFilters?/*#__PURE__*/_jsx(\"button\",{type:\"button\",className:\"scg-filters__clear\",onClick:clearFilters,children:\"Clear filters\"}):null]}):null,showSortControl?/*#__PURE__*/_jsxs(\"label\",{className:\"scg-sort\",children:[/*#__PURE__*/_jsx(\"span\",{children:\"Sort by\"}),/*#__PURE__*/_jsx(\"select\",{className:\"scg-sort__select\",value:selectedSortValue,onChange:event=>setSelectedSortValue(event.target.value),children:SORT_OPTIONS.map(option=>/*#__PURE__*/_jsx(\"option\",{value:option.value,children:option.label},option.value))})]}):null]}):null,configurationMessage?/*#__PURE__*/_jsx(\"div\",{style:stateContainerStyle,children:configurationMessage}):loading?/*#__PURE__*/_jsx(LoadingGrid,{pageSize:clampPageSize(pageSize),gap:gap,imageAspectRatio:imageAspectRatio}):error?/*#__PURE__*/_jsx(ErrorState,{error:error,onRetry:retry}):products.length===0?/*#__PURE__*/_jsx(EmptyState,{notFound:notFound}):/*#__PURE__*/_jsx(\"div\",{className:\"scg-product-grid\",style:gridStyle,children:products.map(product=>/*#__PURE__*/_jsx(ProductCard,{product:product,imageAspectRatio:imageAspectRatio,imageFit:imageFit,showCompareAtPrice:showCompareAtPrice,hideBulkSizes:hideBulkSizes},product.id))}),showPagination&&!error&&products.length>0?/*#__PURE__*/_jsx(Pagination,{currentPage:currentPage,knownPageCount:knownPageCount,hasNextPage:hasNextPage,loading:loading,onGoToPage:handleGoToPage}):null,debugMode?/*#__PURE__*/_jsx(DebugPanel,{collectionHandle:collectionHandle,productCount:products.length,queryTimeMs:queryTimeMs,fromCache:fromCache,pageInfo:pageInfo,availableFilters:availableFilters,filtersLoading:filtersLoading}):null]});}//////////////////////////////////////////////////\n// 8. Framer Property Controls\n//////////////////////////////////////////////////\naddPropertyControls(ShopifyCollectionGrid,{storefrontAccessToken:{type:ControlType.String,title:\"Storefront Token\",description:\"Use a public Storefront API token. Never use a Shopify Admin API token.\",defaultValue:\"\"},collectionHandle:{type:ControlType.String,title:\"Collection\",defaultValue:\"\",placeholder:\"collection-handle\"},pageSize:{type:ControlType.Number,title:\"Page Size\",defaultValue:DEFAULT_PAGE_SIZE,min:MIN_PAGE_SIZE,max:MAX_PAGE_SIZE,step:1,displayStepper:true},gap:{type:ControlType.Number,title:\"Gap\",defaultValue:DEFAULT_GAP,min:0,max:100,step:1,unit:\"px\"},imageAspectRatio:{type:ControlType.Enum,title:\"Image Ratio\",options:[\"1 / 1\",\"4 / 5\",\"3 / 4\",\"16 / 9\"],optionTitles:[\"Square\",\"Portrait 4:5\",\"Portrait 3:4\",\"Landscape\"],defaultValue:DEFAULT_IMAGE_ASPECT_RATIO},imageFit:{type:ControlType.Enum,title:\"Image Fit\",options:[\"cover\",\"contain\"],optionTitles:[\"Cover\",\"Contain\"],defaultValue:DEFAULT_IMAGE_FIT},showCompareAtPrice:{type:ControlType.Boolean,title:\"Compare Price\",defaultValue:DEFAULT_SHOW_COMPARE_AT_PRICE},showPagination:{type:ControlType.Boolean,title:\"Pagination\",defaultValue:DEFAULT_SHOW_PAGINATION},showSortControl:{type:ControlType.Boolean,title:\"Sort Control\",defaultValue:DEFAULT_SHOW_SORT_CONTROL},defaultSortOption:{type:ControlType.Enum,title:\"Default Sort\",options:SORT_OPTIONS.map(option=>option.value),optionTitles:SORT_OPTIONS.map(option=>option.label),defaultValue:DEFAULT_SORT_OPTION_VALUE,hidden:props=>!props.showSortControl},showFilters:{type:ControlType.Boolean,title:\"Filters\",defaultValue:DEFAULT_SHOW_FILTERS},debugMode:{type:ControlType.Boolean,title:\"Debug Mode\",defaultValue:DEFAULT_DEBUG_MODE},hideBulkSizes:{type:ControlType.Boolean,title:\"Hide Bulk Sizes\",description:\"Hide 5 gallon and larger size options.\",defaultValue:false},useCollectionOrder:{type:ControlType.Boolean,title:\"Shopify Order\",description:\"Show products in the collection's Shopify sort order.\",defaultValue:false}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"ShopifyCollectionGrid\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./ShopifyCollectionGrid.map"],"mappings":"A,wNAggB0B,SAASkB,EAAc,EAAS,CAAwD,OAAnD,OAAO,SAASC,CAAQ,EAAkC,KAAK,IAAIC,EAAc,KAAK,IAAIC,EAAc,KAAK,MAAMF,CAAQ,CAAC,CAAC,EAA5FG,CAA8F,CAAC,SAASC,EAAe,EAAsB,EAAiB,EAAS,EAAQ,EAAQ,EAAQ,CAAC,MAAM,GAAGC,EAAsB,GAAGC,EAAiB,KAAK,EAAE,GAAGP,EAAcC,CAAQ,EAAE,GAAGO,EAAQ,GAAGC,EAAQ,GAAG,KAAK,UAAUC,CAAO,GAAI,CAAC,SAASC,EAA0B,EAAO,EAAS,EAAQ,EAAQ,EAAQ,EAAO,CAAC,MAAM,CAAC,SAAO,MAAMX,EAAcC,CAAQ,EAAE,MAAMW,EAAO,UAAQ,UAAQ,SAAO,CAAE,CAAC,SAASC,EAAe,EAAc,EAAU,CAAC,MAAM,GAAGC,GAAyB,GAAGC,EAAoB,GAAGC,EAAc,GAAG,KAAK,UAAUC,CAAS,GAAI,CAAC,SAASC,EAAiB,EAAS,CAAC,IAAMC,EAAaC,EAAY,IAAIC,CAAQ,EAAE,GAAGF,EAAa,OAAOA,EAAa,GAAUvB,IAAS,OAAY,OAAO,KAAK,GAAG,CAAC,IAAM0B,EAAiB1B,EAAO,eAAe,QAAQyB,CAAQ,EAAE,GAAG,CAACC,EAAiB,OAAO,KAAK,IAAMC,EAAa,KAAK,MAAMD,CAAgB,EAAyC,OAAvCF,EAAY,IAAIC,EAASE,CAAY,EAASA,CAAa,MAAM,CAAC,OAAO,IAAK,CAAC,CA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