@finsweet/attributes-cmsload
Advanced tools
Comparing version 1.8.3 to 1.9.0
@@ -1,1 +0,1 @@ | ||
[{"version":"v1.7.1","date":"03 May 2022","markdown":"- Selector for Collection List updated in schema.\n"},{"version":"v1.7.0","date":"19 April 2022","markdown":"- Added support wizard and publishing new schema version\n"},{"version":"v1.6.3","date":"10 April 2022","markdown":"- Added missing `await` to `infinite` and `load-under` modes to make sure that the `window.fsAttributes.push()` callbacks don't run until all items have been loaded.\n"},{"version":"v1.6.2","date":"10 April 2022","markdown":"- Added [API docs](https://www.npmjs.com/package/@finsweet/attributes-cmsload).\n"},{"version":"v1.6.1","date":"03 March 2022","markdown":"- Renamed `fs-cmsload-element=\"page-count\"` to `fs-cmsload-element=\"visible-count\"` to be more descriptive.\n"},{"version":"v1.6.0","date":"03 March 2022","markdown":"- Added new `fs-cmsload-element=\"page-count\"`.\n When defined, this element will display the amount of items currently displayed on the screen.\n This is very useful in setups with `fs-cmsload-mode=\"load-under\"`, as now users are able to display how many items have been loaded so far.\n- Cleaned some old deprecated checks.\n"},{"version":"v1.5.2","date":"10 February 2022","markdown":"Included a new `window.fsAttributes.push()` method in the developer API that provides a standarized way to safely access any Attribute internals once it has fully loaded.\nIt can be used like:\n\n```html\n<script>\n window.fsAttributes = window.fsAttributes || [];\n window.fsAttributes.push([\n 'cmsload',\n (cmsLists) => {\n console.log('Attribute has successfully loaded!');\n console.log(cmsLists);\n },\n ]);\n</script>\n```\n"},{"version":"v1.5.1","date":"01 February 2022","markdown":"- Fixed `commerce` and `lightbox` modules sometimes not being correctly restarted as `cmsload` was running before Webflow wasn't ready.\n This should fix any existing issue when using Lightbox and Add to Cart elements inside paginated Collection List Items.\n- Released `v1.5.1-beta.0`.\n"},{"version":"v1.5.1-beta.0","date":"24 January 2022","markdown":"- Internal: improvements in pagination conditions in `schema.json`.\n"},{"version":"v1.5.0","date":"8 December 2021","markdown":"- Added support to use Webflow's native pagination query params with `fs-cmsload-mode=\"pagination\"`:\n - If a user loads a URL that contains a paginated query (example: `https://example.com/path?34ac1605_page=2`), the list will automatically switch to that page.\n - Supports multiple paginated lists on the same page. A query like `https://example.com/path?5f7457b3_page=2&a4c81382_page=2` is completely valid as long as all queried lists are using the `pagination` mode.\n- Added new `fs-cmsload-showquery=\"true\"` attribute.\n If applied to the `list` element, the URL in the navigation bar will be updated with the corresponding page parameters when switching pages.\n This attribute only works in conjunction with `fs-cmsload-mode=\"pagination\"`.\n- Improved UX and Accessibility by dynamically setting the correspondent page query to the `Previous`/`Next` buttons as well as all `page-button` elements.\n This way, users can right click on any pagination button and open that page in a new Tab, or copy the link to that specific page to share it with other people.\n- Updated the `schema.json` API to include this new functionalities.\n"},{"version":"v1.4.0","date":"2 December 2021","markdown":"- Released `v1.4.0-beta.0`.\n"},{"version":"v1.4.0-beta.0","date":"2 December 2021","markdown":"- Implemented an important speed optimization when loading new items on the list.\n If users activate the native [Page Count](https://university.webflow.com/lesson/paginate-collection-lists#configure-pagination-settings) element (it can be set to `display: none`, no need to have it visible), `cmsload` will optimize the loading of the pages.\n Enabling this feature improves loading speed by `100%` every 4 pages in total on average.\n- Improved support to use `cmsfilter` + `load-under` or `infinite` modes.\n- Improved `fs-cmsload-element=\"items-count\"` when using `load-under` and `infinite` modes. Now the lists will always show the correct total amount of items, not just the loaded items so far.\n"},{"version":"v1.3.3","date":"1 December 2021","markdown":"- Added support for creating `list` instances that have no items.\n"},{"version":"v1.3.2","date":"29 November 2021","markdown":"- Published `v1.3.2-beta.0` to NPM.\n"},{"version":"v1.3.2-beta.0","date":"28 November 2021","markdown":"- Created `changesets.json` API.\n"},{"version":"v1.3.1","date":"26 November 2021","markdown":"- Fixed `fs-cmsload-duration` being incorrectly applied.\n"},{"version":"v1.3.0","date":"23 November 2021","markdown":"- Added support for using `Lightbox` elements inside `Collection List Items` when using `cmsload`.\n The script will now detect if any newly rendered item contains a `.w-lightbox` trigger and restart the Webflow `lightbox` module.\n- Improved support for loading items when `E-Commerce` is enabled.\n Now the Webflow `commerce` module will only be restarted if if any newly rendered has an `Add To Cart` form.\n"},{"version":"v1.2.2","date":"17 November 2021","markdown":"- Fixed `examples.json` not being available on NPM.\n"},{"version":"v1.2.1","date":"17 November 2021","markdown":"- Added support to override default list animation duration when it was already set by other `cms` packages.\n"},{"version":"v1.2.0","date":"17 November 2021","markdown":"- Added support for `cmscore` versioning.\n"},{"version":"v1.1.5","date":"16 November 2021","markdown":"- Updated `cmscore` import.\n"},{"version":"v1.1.4","date":"16 November 2021","markdown":"- Updated `cmscore` import.\n"},{"version":"v1.1.3","date":"12 November 2021","markdown":"- Fixed `pagination` issues when narrowing down the total amount of pages after using `cmsfilter`.\n"},{"version":"v1.1.2","date":"11 November 2021","markdown":"- Updated `cmscore` import.\n"},{"version":"v1.1.1","date":"11 November 2021","markdown":"- Updated `cmscore` import.\n"},{"version":"v1.1.0","date":"11 November 2021","markdown":"- Improved accessibility for `fs-cmsload-element=\"page-button\"` elements by adding [aria-current=\"page\"](https://www.aditus.io/aria/aria-current/#aria-current-page) to the current active button.\n"},{"version":"v1.0.2","date":"11 November 2021","markdown":"- Improved `inifinite` threshold calculations to load more items.\n Now it covers situations where the list is not long enough to reach the threshold target.\n"},{"version":"v1.0.1","date":"10 November 2021","markdown":"- Updated `cmscore` import.\n"},{"version":"v1.0.0","date":"30 September 2021","markdown":"- Created the attribute package.\n"}] | ||
[{"version":"1.9.0","markdown":"- e4b3b680: Created new `window.fsAttributes.destroy()` method to support SPA environments.\n This new method allows users to destroy all Attributes instances, cleaning up event listeners, observers, states, global variables, etc.\n\n Websites that use a client-side router that simulates an SPA environment like [barba.js](https://barba.js.org/) or [Swup](https://swup.js.org/) can now properly init and destroy Attributes.\n After destroying, Attributes can be manually re-initted by calling `window.fsAttribute[ATTRIBUTE_KEY].init()`.\n\n Updated changesets system, now all updates will be correctly reflected in [the official updates page](https://www.finsweet.com/attributes/updates)."},{"version":"1.8.3","markdown":"- Updated dependencies [4792998a]\n- Updated dependencies [4792998a]\n - @global/constants@1.2.0\n - @finsweet/attributes-cmscore@1.8.0\n - @global/factory@1.1.5\n - @global/import@1.0.4"},{"version":"1.8.2","markdown":"- Updated dependencies [07f32375]\n - @global/constants@1.1.0\n - @global/factory@1.1.4\n - @global/import@1.0.3\n - @finsweet/attributes-cmscore@1.7.2"},{"version":"1.8.1","markdown":"- Updated dependencies [d8a4bf6f]\n - @finsweet/attributes-cmscore@1.7.1"},{"version":"1.8.0","markdown":"- ef56d454: Added new `fs-cmsload-element=\"visible-count-from\"` and `fs-cmsload-element=\"visible-count-to\"` Attributes.- Updated dependencies [ef56d454]\n - @finsweet/attributes-cmscore@1.7.0"},{"version":"1.7.8","markdown":"- Updated dependencies [299fd136]\n - @finsweet/attributes-cmscore@1.6.10"},{"version":"1.7.7","markdown":"- Updated dependencies [7542dcdb]\n - @global/constants@1.0.2\n - @global/factory@1.1.3\n - @global/import@1.0.2\n - @finsweet/attributes-cmscore@1.6.9"},{"version":"1.7.6","markdown":"- Updated dependencies [bdd1a78]\n - @global/constants@1.0.1\n - @global/factory@1.1.2\n - @global/import@1.0.1\n - @finsweet/attributes-cmscore@1.6.8"},{"version":"1.7.5","markdown":"- Updated dependencies [13c3e23]\n - @global/factory@1.1.1\n - @finsweet/attributes-cmscore@1.6.7"},{"version":"1.7.4","markdown":"- Updated dependencies [627bf25]\n - @global/factory@1.1.0\n - @finsweet/attributes-cmscore@1.6.7"},{"version":"1.7.3","markdown":"- 8f9d08d: Added `fs-cmsload-element=\"empty\"` attribute.\n Defines the Empty State element for when there are no elements to show."},{"version":"1.7.2","markdown":"- 7f509db: Fixed typo in the API docs"},{"version":"1.7.1","markdown":"- Selector for Collection List updated in schema."},{"version":"1.7.0","markdown":"- Added support wizard and publishing new schema version"},{"version":"1.6.3","markdown":"- Added missing `await` to `infinite` and `load-under` modes to make sure that the `window.fsAttributes.push()` callbacks don't run until all items have been loaded."},{"version":"1.6.2","markdown":"- Added [API docs](https://www.npmjs.com/package/@finsweet/attributes-cmsload)."},{"version":"1.6.1","markdown":"- Renamed `fs-cmsload-element=\"page-count\"` to `fs-cmsload-element=\"visible-count\"` to be more descriptive."},{"version":"1.6.0","markdown":"- Added new `fs-cmsload-element=\"page-count\"`.\n When defined, this element will display the amount of items currently displayed on the screen.\n This is very useful in setups with `fs-cmsload-mode=\"load-under\"`, as now users are able to display how many items have been loaded so far.\n- Cleaned some old deprecated checks."},{"version":"1.5.2","markdown":"Included a new `window.fsAttributes.push()` method in the developer API that provides a standarized way to safely access any Attribute internals once it has fully loaded.\nIt can be used like:\n\n```html\n<script>\n window.fsAttributes = window.fsAttributes || [];\n window.fsAttributes.push([\n 'cmsload',\n (cmsLists) => {\n console.log('Attribute has successfully loaded!');\n console.log(cmsLists);\n },\n ]);\n</script>\n```"},{"version":"1.5.1","markdown":"- Fixed `commerce` and `lightbox` modules sometimes not being correctly restarted as `cmsload` was running before Webflow wasn't ready.\n This should fix any existing issue when using Lightbox and Add to Cart elements inside paginated Collection List Items.\n- Released `v1.5.1-beta.0`."},{"version":"1.5.0","markdown":"- Added support to use Webflow's native pagination query params with `fs-cmsload-mode=\"pagination\"`:\n - If a user loads a URL that contains a paginated query (example: `https://example.com/path?34ac1605_page=2`), the list will automatically switch to that page.\n - Supports multiple paginated lists on the same page. A query like `https://example.com/path?5f7457b3_page=2&a4c81382_page=2` is completely valid as long as all queried lists are using the `pagination` mode.\n- Added new `fs-cmsload-showquery=\"true\"` attribute.\n If applied to the `list` element, the URL in the navigation bar will be updated with the corresponding page parameters when switching pages.\n This attribute only works in conjunction with `fs-cmsload-mode=\"pagination\"`.\n- Improved UX and Accessibility by dynamically setting the correspondent page query to the `Previous`/`Next` buttons as well as all `page-button` elements.\n This way, users can right click on any pagination button and open that page in a new Tab, or copy the link to that specific page to share it with other people.\n- Updated the `schema.json` API to include this new functionalities."},{"version":"1.4.0","markdown":"- Released `v1.4.0-beta.0`."},{"version":"1.3.3","markdown":"- Added support for creating `list` instances that have no items."},{"version":"1.3.2","markdown":"- Published `v1.3.2-beta.0` to NPM."},{"version":"1.3.1","markdown":"- Fixed `fs-cmsload-duration` being incorrectly applied."},{"version":"1.3.0","markdown":"- Added support for using `Lightbox` elements inside `Collection List Items` when using `cmsload`.\n The script will now detect if any newly rendered item contains a `.w-lightbox` trigger and restart the Webflow `lightbox` module.\n- Improved support for loading items when `E-Commerce` is enabled.\n Now the Webflow `commerce` module will only be restarted if if any newly rendered has an `Add To Cart` form."},{"version":"1.2.2","markdown":"- Fixed `examples.json` not being available on NPM."},{"version":"1.2.1","markdown":"- Added support to override default list animation duration when it was already set by other `cms` packages."},{"version":"1.2.0","markdown":"- Added support for `cmscore` versioning."},{"version":"1.1.5","markdown":"- Updated `cmscore` import."},{"version":"1.1.4","markdown":"- Updated `cmscore` import."},{"version":"1.1.3","markdown":"- Fixed `pagination` issues when narrowing down the total amount of pages after using `cmsfilter`."},{"version":"1.1.2","markdown":"- Updated `cmscore` import."},{"version":"1.1.1","markdown":"- Updated `cmscore` import."},{"version":"1.1.0","markdown":"- Improved accessibility for `fs-cmsload-element=\"page-button\"` elements by adding [aria-current=\"page\"](https://www.aditus.io/aria/aria-current/#aria-current-page) to the current active button."},{"version":"1.0.2","markdown":"- Improved `inifinite` threshold calculations to load more items.\n Now it covers situations where the list is not long enough to reach the threshold target."},{"version":"1.0.1","markdown":"- Updated `cmscore` import."},{"version":"1.0.0","markdown":"- Created the attribute package."}] |
@@ -1,1 +0,1 @@ | ||
"use strict";(()=>{var $e=Object.create;var V=Object.defineProperty,De=Object.defineProperties,Ve=Object.getOwnPropertyDescriptor,Fe=Object.getOwnPropertyDescriptors,He=Object.getOwnPropertyNames,re=Object.getOwnPropertySymbols,Ge=Object.getPrototypeOf,ne=Object.prototype.hasOwnProperty,Ye=Object.prototype.propertyIsEnumerable;var D=(e,t,o)=>t in e?V(e,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[t]=o,F=(e,t)=>{for(var o in t||(t={}))ne.call(t,o)&&D(e,o,t[o]);if(re)for(var o of re(t))Ye.call(t,o)&&D(e,o,t[o]);return e},H=(e,t)=>De(e,Fe(t));var We=(e=>typeof require!="undefined"?require:typeof Proxy!="undefined"?new Proxy(e,{get:(t,o)=>(typeof require!="undefined"?require:t)[o]}):e)(function(e){if(typeof require!="undefined")return require.apply(this,arguments);throw new Error('Dynamic require of "'+e+'" is not supported')});var qe=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var je=(e,t,o,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of He(t))!ne.call(e,r)&&r!==o&&V(e,r,{get:()=>t[r],enumerable:!(i=Ve(t,r))||i.enumerable});return e};var ie=(e,t,o)=>(o=e!=null?$e(Ge(e)):{},je(t||!e||!e.__esModule?V(o,"default",{value:e,enumerable:!0}):o,e));var se=(e,t,o)=>(D(e,typeof t!="symbol"?t+"":t,o),o);var he=qe((Vr,Le)=>{Le.exports=$t;function $t(e,t,o,i){var r,n,s;return function(){if(s=this,n=Array.prototype.slice.call(arguments),r&&(o||i))return;if(!o)return c(),r=setTimeout(m,t),r;r=setTimeout(c,t),e.apply(s,n);function m(){c(),e.apply(s,n)}function c(){clearTimeout(r),r=null}}}});var y=class{static activateAlerts(){this.alertsActivated=!0}static alert(t,o){if(this.alertsActivated&&window.alert(t),o==="error")throw new Error(t)}};se(y,"alertsActivated",!1);var B="w--current";var P={wrapper:"w-dyn-list",list:"w-dyn-items",item:"w-dyn-item",paginationWrapper:"w-pagination-wrapper",paginationNext:"w-pagination-next",paginationPrevious:"w-pagination-previous",pageCount:"w-page-count",emptyState:"w-dyn-empty"};var ae={addToCartForm:"w-commerce-commerceaddtocartform"},ce={trigger:"w-lightbox"};var N=(e,t=!0)=>e.cloneNode(t);var w=(e,t)=>!!e&&t.includes(e);function O(e,t,o,i=!0){let r=o?[o]:[];if(!e)return r;let n=e.split(",").reduce((s,a)=>{let m=a.trim();return(!i||m)&&s.push(m),s},[]);if(t){let s=n.filter(a=>w(a,t));return s.length?s:r}return n}var G=e=>Object.keys(e);var Y=e=>e!=null;var me=new Map([["tiny","(max-width: 479px)"],["small","(max-width: 767px)"],["medium","(max-width: 991px)"],["main","(min-width: 992px)"]]);var{wrapper:Xe,list:Qe,paginationWrapper:ze,paginationNext:Je,paginationPrevious:Ze,emptyState:et,pageCount:tt}=P;function b(e,t,o=document){let i=typeof e=="string"?o.querySelector(e):e;if(!i)return;let r=i.closest(`.${Xe}`);if(!r)return;let n=r.querySelector(`.${Qe}`);return t==="wrapper"?r:t==="list"?n:t==="items"?[...(n==null?void 0:n.children)||[]]:t==="pageCount"?r.querySelector(`.${tt}`):t==="empty"?r.querySelector(`:scope > .${et}`):t==="pagination"?r.querySelector(`.${ze}`):r.querySelector(`.${t==="next"?Je:Ze}`)}var W=(e,t=document)=>{e=e.filter(n=>n);let o=e.join(", ")||`.${P.wrapper}`;return[...t.querySelectorAll(o)].reduce((n,s)=>{if(!s)return n;let a=b(s,"wrapper");return!a||n.includes(a)||n.push(a),n},[])};var q=()=>{for(let[e,t]of me)if(window.matchMedia(t).matches)return e;return"main"};var ot=new DOMParser,h=async e=>{let o=await(await fetch(e)).text();return ot.parseFromString(o,"text/html")};var v=async()=>{let{fsAttributes:e}=window;e.cms||(e.cms={});let{cms:t}=e;if(t.coreImport)return t.coreImport;try{let o=import("https://cdn.jsdelivr.net/npm/@finsweet/attributes-cmscore@1/cmscore.js");return t.coreImport=o,o.then(i=>{i&&(t.coreVersion||(t.coreVersion=i.version))}),o}catch(o){y.alert(`${o}`,"error");return}};var j=(e,t)=>{let{coreVersion:o}=window.fsAttributes.cms;if(!o)return!1;let i={numeric:!0,sensitivity:"base"},r=t.localeCompare(o,void 0,i);return r===0||(e===">="?r<0:r>0)};var rt="https://cdn.jsdelivr.net/npm/@finsweet/attributes-animation@1/functions.js",M=async()=>{let{fsAttributes:e}=window;if(e.animationImport)return e.animationImport;try{let t=import(rt);return e.animationImport=t,t}catch(t){y.alert(`${t}`,"error");return}};var L="fs-attributes";var C="cmsload";var nt=`${L}-support`,it="https://cdn.jsdelivr.net/npm/@finsweet/attributes-support@1/support.js",le=async()=>{let{fsAttributes:e,location:t}=window,{host:o,searchParams:i}=new URL(t.href);if(!o.includes("webflow.io")||!i.has(nt))return!1;if(e.supportImport)return e.supportImport;try{e.supportImport=new Promise((r,n)=>{let s=document.createElement("script");s.src=it,s.onload=()=>r(!0),s.onerror=n,document.head.append(s)})}catch(r){return!1}return e.supportImport};var X=async(e,{durationKey:t,easingKey:o})=>{let i=await M();if(!i)return;let{animations:{fade:r},easings:n}=i,{listAnimation:s}=e,a=e.getAttribute(t),m=e.getAttribute(o);if(s&&!a&&!m)return;let c=w(m,n)?m:void 0,u=a?parseFloat(a)/2e3:.1;if(!s){e.listAnimation=H(F({},r),{options:{easing:c,duration:u}});return}let{options:l}=s;if(!l){s.options={easing:c,duration:u};return}l.easing||(l.easing=c),a&&(l.duration=u)},Q=async(e,{animationKey:t,durationKey:o,easingKey:i,staggerKey:r})=>{let n=await M();if(!n)return;let{animations:s,easings:a}=n,m=e.getAttribute(t),c=w(m,G(s))?s[m]:s.fade,u=e.getAttribute(o),l=e.getAttribute(i),f=e.getAttribute(r);e.itemsAnimation=H(F({},c),{options:{easing:w(l,a)?l:void 0,duration:u?parseFloat(u)/1e3:void 0,stagger:f?parseFloat(f):void 0}})};var x=e=>t=>`${e}${t?`-${t}`:""}`,U=e=>{let t=(i,r,n)=>{let s=e[i],{key:a,values:m}=s,c;if(!r)return`[${a}]`;let u=m==null?void 0:m[r];typeof u=="string"?c=u:c=u(n&&"instanceIndex"in n?n.instanceIndex:void 0);let l=n&&"caseInsensitive"in n&&n.caseInsensitive?"i":"";if(!(n!=null&&n.operator))return`[${a}="${c}"${l}]`;switch(n.operator){case"prefixed":return`[${a}^="${c}"${l}]`;case"suffixed":return`[${a}$="${c}"${l}]`;case"contains":return`[${a}*="${c}"${l}]`}};function o(i,r){let n=t("element",i,r),s=(r==null?void 0:r.scope)||document;return r!=null&&r.all?s.querySelectorAll(n):s.querySelector(n)}return[t,o]};var I={preventLoad:{key:`${L}-preventload`},debugMode:{key:`${L}-debug`},src:{key:"src",values:{finsweet:"@finsweet/attributes"}},dev:{key:`${L}-dev`}},[z,ar]=U(I);var ue=e=>{let{currentScript:t}=document,o={};if(!t)return{attributes:o,preventsLoad:!1};let r={preventsLoad:typeof t.getAttribute(I.preventLoad.key)=="string",attributes:o};for(let n in e){let s=t.getAttribute(e[n]);r.attributes[n]=s}return r};var pe=()=>{if(window.fsAttributes&&!Array.isArray(window.fsAttributes))return;let e={cms:{},push(...t){var o,i;for(let[r,n]of t)(i=(o=this[r])==null?void 0:o.loading)==null||i.then(n)}};st(e),at(e),window.fsAttributes=e,window.FsAttributes=window.fsAttributes,le()},st=e=>{let t=z("src","finsweet",{operator:"contains"}),o=z("dev"),r=[...document.querySelectorAll(`script${t}, script${o}`)].reduce((n,s)=>{var m;let a=s.getAttribute(I.dev.key)||((m=s.src.match(/[\w-. ]+(?=(\.js)$)/))==null?void 0:m[0]);return a&&!n.includes(a)&&n.push(a),n},[]);for(let n of r){e[n]={};let s=e[n];s.loading=new Promise(a=>{s.resolve=m=>{a(m),delete s.resolve}})}},at=e=>{let t=Array.isArray(window.fsAttributes)?window.fsAttributes:[];e.push(...t)};var de="1.8.3";var fe=({textContent:e})=>{if(!e)return;let[,t]=e.split("/");return t?parseInt(t.trim()):void 0},k=async(e,t,o,i)=>{i==null||i.preventDefault();let{items:r,itemsPerPage:n}=e;if(!(!t&&n===r.length)){if(n+o<=r.length)e.itemsPerPage=n+o;else if(t){let s=await e.once("renderitems");e.itemsPerPage=n+s.length}else e.itemsPerPage+=r.length-n;await e.renderItems(!0)}},ge=e=>{let{pagesQuery:t,currentPage:o,totalPages:i,paginationNext:r,paginationPrevious:n}=e;!o||(n&&(n.style.display=o!==1?"":"none",n.href=`?${t}=${o-1}`),r&&(r.style.display=o!==i?"":"none",r.href=`?${t}=${o+1}`))},Ee=(e,{currentPage:t,totalPages:o})=>{e.setAttribute("aria-label",`Page ${t} of ${o}`),e.textContent=`${t} / ${o}`};var K=async(e,t,o)=>{var l;let{index:i,paginationNext:r,paginationPrevious:n,originalItemsPerPage:s}=t,a=W([],e)[i];if(!a)return;if(!n||!r){let f=b(a,"pagination"),d=b(a,"previous"),p=b(a,"next");if(d){let g=[...(f==null?void 0:f.children)||[]].indexOf(d);t.addPaginationButton(d,"paginationPrevious",g)}if(p){let g=[...(f==null?void 0:f.children)||[]].indexOf(p);d||(g+=1),t.addPaginationButton(p,"paginationNext",g)}}let m=(l=b(a,"next"))==null?void 0:l.href,c=b(a,"items"),{length:u}=c;return m&&s!==u&&(t.originalItemsPerPage=t.itemsPerPage=u),await t.addItems(c,o),m};var A=async e=>{let{paginationNext:t,paginationPrevious:o,paginationCount:i,extractingPaginationData:r}=e;if(!t&&!o)return;await r;let n=i?fe(i):void 0;await e.displayElement("loader"),n?await Se(e,n):await mt(e),await e.emit("finishload"),await e.displayElement("loader",!1)},mt=async e=>{let{paginationNext:t,currentPage:o}=e;if(o&&await Se(e,o),!t)return;let{href:i}=t,r=[i],n=async s=>{try{let a=await h(s),m=await K(a,e);if(!m||r.includes(m))return;r.push(m),await n(m)}catch(a){return}};await n(i)},Se=async(e,t)=>{let{paginationNext:o,paginationPrevious:i}=e;if(!o&&!i)return;let{pagesQuery:r,currentPage:n}=e;if(!r||!n)return;let{origin:s,pathname:a}=window.location;for(let c=n-1;c>=1;c--)try{let u=await h(`${s}${a}?${r}=${c}`);await K(u,e,"unshift")}catch(u){return}let m=[];for(let c=n+1;c<=t;c++)m[c]=(async()=>{let u=m[c-1];try{let l=await h(`${s}${a}?${r}=${c}`);await u,await K(l,e)}catch(l){await u;return}})();await Promise.all(m)};var Te=async e=>{let{paginationNext:t,paginationPrevious:o,paginationCount:i,itemsPerPage:r}=e;if(!t)return;o&&(o.style.display="none"),i==null||i.remove();let n=!0,s=!1;e.initPagination(),e.on("renderitems",()=>{let{validItems:c,items:u,itemsPerPage:l}=e;if(!n&&u.length===l){m();return}t.style.display=c.length>l?"":"none"});let a=async c=>{c.preventDefault(),!s&&(s=!0,await k(e,n,r,c),s=!1)},m=()=>{t.removeEventListener("click",a),t.style.display="none"};t.addEventListener("click",a),await A(e),n=!1};var be=lt;function lt(e,t,o){var i=null,r=null,n=o&&o.leading,s=o&&o.trailing;n==null&&(n=!0),s==null&&(s=!n),n==!0&&(s=!1);var a=function(){i&&(clearTimeout(i),i=null)},m=function(){var u=r;a(),u&&u()},c=function(){var u=n&&!i,l=this,f=arguments;if(r=function(){return e.apply(l,f)},i||(i=setTimeout(function(){if(i=null,s)return r()},t)),u)return u=!1,r()};return c.cancel=a,c.flush=m,c}var S=`fs-${C}`,ut="list",pt="loader",dt="items-count",ft="visible-count",gt="visible-count-from",Et="visible-count-to",St="scroll-anchor",Tt="page-button",bt="page-dots",xt="empty",yt="mode",At={loadUnder:"load-under",renderAll:"render-all",pagination:"pagination",infinite:"infinite"},wt="threshold",Ct="pagesiblings",_t="pageboundary",Pt="animation",Lt="easing",ht="duration",vt="stagger",Mt="resetix",It={true:"true"},Rt="showquery",Bt={true:"true"},R={element:{key:`${S}-element`,values:{list:x(ut),loader:x(pt),itemsCount:x(dt),visibleCount:x(ft),visibleCountFrom:x(gt),visibleCountTo:x(Et),scrollAnchor:x(St),empty:x(xt),pageButton:Tt,pageDots:bt}},mode:{key:`${S}-${yt}`,values:At},threshold:{key:`${S}-${wt}`},pageSiblings:{key:`${S}-${Ct}`},pageBoundary:{key:`${S}-${_t}`},animation:{key:`${S}-${Pt}`},easing:{key:`${S}-${Lt}`},duration:{key:`${S}-${ht}`},stagger:{key:`${S}-${vt}`},resetIx:{key:`${S}-${Mt}`,values:It},showQuery:{key:`${S}-${Rt}`,values:Bt}},[$,T]=U(R),xe="-20",ye=1,Ae=1,we={main:0,medium:1,small:2,tiny:3};var{pageSiblings:{key:Nt},pageBoundary:{key:Ot},threshold:{key:Ut},showQuery:{key:kt,values:Kt}}=R,Ce=e=>{let{paginationWrapper:t,paginationCount:o}=e;if(!t)return;let i=T("pageButton",{operator:"prefixed",scope:t}),r=T("pageDots",{operator:"prefixed",scope:t});r?r.remove():(r=document.createElement("div"),r.textContent="...");let n=e.getAttribute(Ot),s=(n?O(n):[]).map(d=>parseInt(d)),a=e.getAttribute(Nt),m=(a?O(a):[]).map(d=>parseInt(d)),[c,u]=J(s,m),l=[s,m].some(({length:d})=>d>1),f=e.getAttribute(kt)===Kt.true;return{paginationWrapper:t,pageButtonTemplate:i,pageDotsTemplate:r,paginationCount:o,pageBoundary:c,pageBoundaryValues:s,pageSiblings:u,pageSiblingsValues:m,hasBreakpoints:l,showQueryParams:f}},J=(e,t)=>{let o=q(),i=we[o],r=[];[e,t].forEach((a,m)=>{for(let c=i;c>=0;c--){let u=a[c];if(typeof u=="number"){r[m]=u;break}}});let[n,s]=r;return n!=null||(n=Ae),s!=null||(s=ye),[n,s]},_e=e=>{let t=parseInt(e.getAttribute(Ut)||xe);return 1-t/100};var Pe=async e=>{let{list:t,paginationNext:o,paginationPrevious:i,paginationCount:r,itemsPerPage:n}=e;if(!t||!o)return;i&&(i.style.display="none"),r==null||r.remove();let s=_e(e),a=!0,m=!1;e.initPagination(),e.on("renderitems",()=>{let{validItems:d,items:p,itemsPerPage:g}=e;if(!a&&p.length===g){f();return}o.style.display=d.length>g?"":"none"});let c=async d=>{d.preventDefault()},u=be(async()=>{if(m)return;let{innerHeight:d}=window,{bottom:p}=t.getBoundingClientRect(),g=s*d;p>0&&p<=g&&(m=!0,await k(e,a,n),m=!1)},100),l=new IntersectionObserver(d=>{for(let{isIntersecting:p}of d)window[p?"addEventListener":"removeEventListener"]("scroll",u)}),f=()=>{window.removeEventListener("scroll",u),o.removeEventListener("click",c),o.style.display="none",l.disconnect()};o.addEventListener("click",c),l.observe(t),await A(e),a=!1};var ve=ie(he(),1);var{paginationNext:Dt,paginationPrevious:Vt}=P,Me=async e=>{let t=Ce(e);if(!t)return;let{paginationWrapper:o,pageButtonTemplate:i,pageDotsTemplate:r,paginationCount:n,pageBoundary:s,pageBoundaryValues:a,pageSiblings:m,pageSiblingsValues:c,hasBreakpoints:u,showQueryParams:l}=t,f;if(i){let{parentElement:d}=i;i.remove(),d&&(f={parentElement:d,pageButtonTemplate:i,pageDotsTemplate:r,pageBoundary:s,pageSiblings:m,renderedElements:new Map([])})}e.initPagination(l),e.on("renderitems",()=>Ft(e,f,n)),o.addEventListener("click",d=>Yt(d,f,e)),f&&u&&window.addEventListener("resize",(0,ve.default)(()=>{Wt(f,e,a,c)},100)),await A(e)},Ft=(e,t,o,i=!0)=>{t&&Ie(t,e),o&&Ee(o,e),i&&ge(e)},Ie=(e,t)=>{let{currentPage:o,totalPages:i}=t;if(!o)return;let{parentElement:r,renderedElements:n,pageBoundary:s,pageSiblings:a}=e,m=[...n],c=a*2+1,l=s*2+c+2,f=o-1<l-c,d=i-o<l-c;for(let p=1;p<=l;p++){let[g,ee]=m[p-1]||[],[te]=m[p-2]||[];if(p>i){g&&(g.remove(),m[p-1]=void 0);continue}let E;i<=l?E=p:f?p>l-s?E=i-(l-p):p===l-s?E=null:E=p:d?p<s+1?E=p:p===s+1?E=null:E=i-(l-p):p<s+1?E=p:p>l-s?E=i-(l-p):p===s+1||p===l-s?E=null:E=o+(p-(s+1)-(1+a));let _;ee!==E&&(g==null||g.remove(),_=Ht(e,E,t),m[p-1]=[_,E],te?r.insertBefore(_,te.nextSibling):r.appendChild(_),_.style.opacity="");let oe=_||g;!oe||Gt(oe,E===o)}e.renderedElements=new Map([...m.filter(Y)])},Ht=({pageButtonTemplate:e,pageDotsTemplate:t},o,{pagesQuery:i})=>{if(!o)return N(t);let r=N(e);return r.classList.remove(B),r.textContent=`${o}`,r instanceof HTMLAnchorElement&&i&&(r.href=`?${i}=${o}`),r},Gt=(e,t)=>{t?(e.classList.add(B),e.setAttribute("aria-current","page")):(e.classList.remove(B),e.removeAttribute("aria-current"))},Yt=(e,t,o)=>{let{target:i}=e;if(!(i instanceof Element))return;let r=i.closest($("element","pageButton",{operator:"prefixed"})),n=i.closest(`.${Dt}`),s=i.closest(`.${Vt}`);if(!r&&!n&&!s)return;e.preventDefault();let{currentPage:a,totalPages:m}=o;if(!a)return;let c;n&&(c=a+1),s&&(c=a-1),r&&(c=t==null?void 0:t.renderedElements.get(r)),!!c&&c>=1&&c<=m&&o.switchPage(c)},Wt=(e,t,...o)=>{let{pageBoundary:i,pageSiblings:r,renderedElements:n}=e,[s,a]=J(...o);if(!(i===s&&r===a)){e.pageBoundary=s,e.pageSiblings=a;for(let[m]of n)m.remove();n.clear(),Ie(e,t)}};var Re=async e=>{let{paginationNext:t,paginationPrevious:o,paginationCount:i}=e;!t||(t.style.display="none",o&&(o.style.display="none"),i==null||i.remove(),await A(e))};var{element:{key:qt},mode:{key:jt,values:{renderAll:Xt,infinite:Qt,pagination:zt}},animation:{key:Jt},duration:{key:Be},easing:{key:Ne},stagger:{key:Zt},resetIx:{key:eo,values:to}}=R,Oe=async e=>{let t=e.getInstanceIndex(qt),{items:o}=e,{Webflow:i}=window,r=!!i&&"require"in i;Q(e,{animationKey:Jt,durationKey:Be,easingKey:Ne,staggerKey:Zt}),X(e,{durationKey:Be,easingKey:Ne});let n=r&&!!i.require("commerce")&&o.some(({element:l})=>l.querySelector(`.${ae.addToCartForm}`));n&&(e.restartCommerce=n);let s=r&&!!i.require("lightbox")&&o.some(({element:l})=>l.querySelector(`.${ce.trigger}`));s&&(e.restartLightbox=s);let a=e.getAttribute(eo)===to.true;a&&(e.restartIx=a);let m=T("loader",{instanceIndex:t});m&&e.addLoader(m);let c=T("empty",{instanceIndex:t});if(c&&e.addEmptyElement(c),!e.itemsCount){let l=T("itemsCount",{instanceIndex:t});l&&e.addItemsCount(l)}if(!e.visibleCount||!e.visibleCountFrom||!e.visibleCountTo){let l=T("visibleCount",{instanceIndex:t}),f=T("visibleCountFrom",{instanceIndex:t}),d=T("visibleCountTo",{instanceIndex:t});j(">=","1.7.0")?e.addVisibleCount(l,f,d):l&&e.addVisibleCount(l)}if(!e.scrollAnchor){let l=T("scrollAnchor",{instanceIndex:t});l&&(e.scrollAnchor=l)}let u=e.getAttribute(jt);return u===Xt?await Re(e):u===Qt?await Pe(e):u===zt?await Me(e):await Te(e),e};var Z=async()=>{var o,i;let e=await v();if(!e)return[];let t=e.createCMSListInstances([$("element","list",{operator:"prefixed"})]);return await Promise.all(t.map(Oe)),(i=(o=window.fsAttributes[C]).resolve)==null||i.call(o,t),t};pe();v();M();var Ue,ke;(Ue=window.fsAttributes)[ke=C]||(Ue[ke]={});var{preventsLoad:oo}=ue(),Ke=window.fsAttributes[C];Ke.version=de;oo?Ke.init=Z:(window.Webflow||(window.Webflow=[]),window.Webflow.push(Z));})(); | ||
"use strict";(()=>{var Me=Object.create;var K=Object.defineProperty;var Ie=Object.getOwnPropertyDescriptor;var Be=Object.getOwnPropertyNames;var Ne=Object.getPrototypeOf,Ue=Object.prototype.hasOwnProperty;var ke=(e,t,o)=>t in e?K(e,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[t]=o;var Oe=(e=>typeof require!="undefined"?require:typeof Proxy!="undefined"?new Proxy(e,{get:(t,o)=>(typeof require!="undefined"?require:t)[o]}):e)(function(e){if(typeof require!="undefined")return require.apply(this,arguments);throw new Error('Dynamic require of "'+e+'" is not supported')});var $e=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var Ke=(e,t,o,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of Be(t))!Ue.call(e,r)&&r!==o&&K(e,r,{get:()=>t[r],enumerable:!(n=Ie(t,r))||n.enumerable});return e};var j=(e,t,o)=>(o=e!=null?Me(Ne(e)):{},Ke(t||!e||!e.__esModule?K(o,"default",{value:e,enumerable:!0}):o,e));var X=(e,t,o)=>(ke(e,typeof t!="symbol"?t+"":t,o),o);var Ae=$e((br,be)=>{be.exports=Rt;function Rt(e,t,o,n){var r,i,s;return function(){if(s=this,i=Array.prototype.slice.call(arguments),r&&(o||n))return;if(!o)return c(),r=setTimeout(l,t),r;r=setTimeout(c,t),e.apply(s,i);function l(){c(),e.apply(s,i)}function c(){clearTimeout(r),r=null}}}});var _="fs-attributes";var C="cmsload";var b=class{static activateAlerts(){this.alertsActivated=!0}static alert(t,o){if(this.alertsActivated&&window.alert(t),o==="error")throw new Error(t)}};X(b,"alertsActivated",!1);var h=()=>{};function P(e,t,o,n){return e?(e.addEventListener(t,o,n),()=>e.removeEventListener(t,o,n)):h}var M="w--current";var L={wrapper:"w-dyn-list",list:"w-dyn-items",item:"w-dyn-item",paginationWrapper:"w-pagination-wrapper",paginationNext:"w-pagination-next",paginationPrevious:"w-pagination-previous",pageCount:"w-page-count",emptyState:"w-dyn-empty"};var Q={addToCartForm:"w-commerce-commerceaddtocartform"},z={trigger:"w-lightbox"};var I=(e,t=!0)=>e.cloneNode(t);var J=(e,t)=>!!e&&t.includes(e);function B(e,t,o,n=!0){let r=o?[o]:[];if(!e)return r;let i=e.split(",").reduce((s,a)=>{let l=a.trim();return(!n||l)&&s.push(l),s},[]);if(t){let s=i.filter(a=>J(a,t));return s.length?s:r}return i}var D=e=>e!=null;var Z=new Map([["tiny","(max-width: 479px)"],["small","(max-width: 767px)"],["medium","(max-width: 991px)"],["main","(min-width: 992px)"]]);var{wrapper:De,list:Ve,paginationWrapper:Fe,paginationNext:He,paginationPrevious:Ge,emptyState:Ye,pageCount:We}=L;function y(e,t,o=document){let n=typeof e=="string"?o.querySelector(e):e;if(!n)return;let r=n.closest(`.${De}`);if(!r)return;let i=r.querySelector(`.${Ve}`);return t==="wrapper"?r:t==="list"?i:t==="items"?[...(i==null?void 0:i.children)||[]]:t==="pageCount"?r.querySelector(`.${We}`):t==="empty"?r.querySelector(`:scope > .${Ye}`):t==="pagination"?r.querySelector(`.${Fe}`):r.querySelector(`.${t==="next"?He:Ge}`)}var V=(e,t=document)=>{e=e.filter(i=>i);let o=e.join(", ")||`.${L.wrapper}`;return[...t.querySelectorAll(o)].reduce((i,s)=>{if(!s)return i;let a=y(s,"wrapper");return!a||i.includes(a)||i.push(a),i},[])};var F=()=>{for(let[e,t]of Z)if(window.matchMedia(t).matches)return e;return"main"};function ee(e,t,o){var r;let n=window.fsAttributes[e];return n.destroy=o||h,(r=n.resolve)==null||r.call(n,t),t}var qe="https://cdn.jsdelivr.net/npm/@finsweet/attributes-animation@1/functions.js",te=async()=>{let{fsAttributes:e}=window;e.animation||(e.animation={});let{animation:t}=e;if(t.import)return t.import;try{return t.import=import(qe),t.import}catch(o){b.alert(`${o}`,"error");return}};var oe=async()=>{let{fsAttributes:e}=window;e.cmscore||(e.cmscore={});let{cmscore:t}=e;if(t.import)return t.import;try{return t.import=import("https://cdn.jsdelivr.net/npm/@finsweet/attributes-cmscore@1/cmscore.js"),t.import.then(o=>{o&&(t.version||(t.version=o.version))}),t.import}catch(o){b.alert(`${o}`,"error");return}};var je=`${_}-support`,Xe="https://cdn.jsdelivr.net/npm/@finsweet/attributes-support@1/support.js",re=async()=>{let{fsAttributes:e,location:t}=window,{host:o,searchParams:n}=new URL(t.href);e.support||(e.support={});let{support:r}=e;if(!o.includes("webflow.io")||!n.has(je))return!1;if(r.import)return r.import;try{r.import=new Promise((i,s)=>{let a=document.createElement("script");a.src=Xe,a.onload=()=>i(!0),a.onerror=s,document.head.append(a)})}catch(i){return!1}return r.import};var x=e=>t=>`${e}${t?`-${t}`:""}`,N=e=>{let t=(n,r,i)=>{let s=e[n],{key:a,values:l}=s,c;if(!r)return`[${a}]`;let m=l==null?void 0:l[r];typeof m=="string"?c=m:c=m(i&&"instanceIndex"in i?i.instanceIndex:void 0);let p=i&&"caseInsensitive"in i&&i.caseInsensitive?"i":"";if(!(i!=null&&i.operator))return`[${a}="${c}"${p}]`;switch(i.operator){case"prefixed":return`[${a}^="${c}"${p}]`;case"suffixed":return`[${a}$="${c}"${p}]`;case"contains":return`[${a}*="${c}"${p}]`}};function o(n,r){let i=t("element",n,r),s=(r==null?void 0:r.scope)||document;return r!=null&&r.all?[...s.querySelectorAll(i)]:s.querySelector(i)}return[t,o]};var v={preventLoad:{key:`${_}-preventload`},debugMode:{key:`${_}-debug`},src:{key:"src",values:{finsweet:"@finsweet/attributes"}},dev:{key:`${_}-dev`}},[H,Fo]=N(v);var ne=e=>{let{currentScript:t}=document,o={};if(!t)return{attributes:o,preventsLoad:!1};let r={preventsLoad:typeof t.getAttribute(v.preventLoad.key)=="string",attributes:o};for(let i in e){let s=t.getAttribute(e[i]);r.attributes[i]=s}return r};var se=({scriptAttributes:e,attributeKey:t,version:o,init:n})=>{var a;Qe(),(a=window.fsAttributes)[t]||(a[t]={});let{preventsLoad:r,attributes:i}=ne(e),s=window.fsAttributes[t];s.version=o,s.init=n,r||(window.Webflow||(window.Webflow=[]),window.Webflow.push(()=>n(i)))},Qe=()=>{let e=ze();if(window.fsAttributes&&!Array.isArray(window.fsAttributes)){ie(window.fsAttributes,e);return}let t={cms:{},push(...o){var n,r;for(let[i,s]of o)(r=(n=this[i])==null?void 0:n.loading)==null||r.then(s)},destroy(){var o,n;for(let r of e)(n=(o=window.fsAttributes[r])==null?void 0:o.destroy)==null||n.call(o)}};ie(t,e),Je(t),window.fsAttributes=t,window.FsAttributes=window.fsAttributes,re()},ze=()=>{let e=H("src","finsweet",{operator:"contains"}),t=H("dev");return[...document.querySelectorAll(`script${e}, script${t}`)].reduce((r,i)=>{var a;let s=i.getAttribute(v.dev.key)||((a=i.src.match(/[\w-. ]+(?=(\.js)$)/))==null?void 0:a[0]);return s&&!r.includes(s)&&r.push(s),r},[])},ie=(e,t)=>{for(let o of t){if(e[o])continue;e[o]={};let n=e[o];n.loading=new Promise(r=>{n.resolve=i=>{r(i),delete n.resolve}})}},Je=e=>{let t=Array.isArray(window.fsAttributes)?window.fsAttributes:[];e.push(...t)};var ae="1.9.0";var U=async e=>{let o=await(await fetch(e)).text();return new DOMParser().parseFromString(o,"text/html")};var ce=({textContent:e})=>{if(!e)return;let[,t]=e.split("/");return t?parseInt(t.trim()):void 0},k=async(e,t,o,n)=>{n==null||n.preventDefault();let{items:r,itemsPerPage:i}=e;if(!(!t&&i===r.length)){if(i+o<=r.length)e.itemsPerPage=i+o;else if(t){let s=await e.once("renderitems");e.itemsPerPage=i+s.length}else e.itemsPerPage+=r.length-i;await e.renderItems(!0)}},le=e=>{let{pagesQuery:t,currentPage:o,totalPages:n,paginationNext:r,paginationPrevious:i}=e;!o||(i&&(i.style.display=o!==1?"":"none",i.href=`?${t}=${o-1}`),r&&(r.style.display=o!==n?"":"none",r.href=`?${t}=${o+1}`))},ue=(e,{currentPage:t,totalPages:o})=>{e.setAttribute("aria-label",`Page ${t} of ${o}`),e.textContent=`${t} / ${o}`};var O=async(e,t,o)=>{var p;let{index:n,paginationNext:r,paginationPrevious:i,originalItemsPerPage:s}=t,a=V([],e)[n];if(!a)return;if(!i||!r){let f=y(a,"pagination"),d=y(a,"previous"),u=y(a,"next");if(d){let g=[...(f==null?void 0:f.children)||[]].indexOf(d);t.addPaginationButton(d,"paginationPrevious",g)}if(u){let g=[...(f==null?void 0:f.children)||[]].indexOf(u);d||(g+=1),t.addPaginationButton(u,"paginationNext",g)}}let l=(p=y(a,"next"))==null?void 0:p.href,c=y(a,"items"),{length:m}=c;return l&&s!==m&&(t.originalItemsPerPage=t.itemsPerPage=m),await t.addItems(c,o),l};var A=async e=>{let{paginationNext:t,paginationPrevious:o,paginationCount:n,extractingPaginationData:r}=e;if(!t&&!o)return;await r;let i=n?ce(n):void 0;await e.displayElement("loader"),i?await me(e,i):await et(e),await e.emit("finishload"),await e.displayElement("loader",!1)},et=async e=>{let{paginationNext:t,currentPage:o}=e;if(o&&await me(e,o),!t)return;let{href:n}=t,r=[n],i=async s=>{try{let a=await U(s),l=await O(a,e);if(!l||r.includes(l))return;r.push(l),await i(l)}catch(a){return}};await i(n)},me=async(e,t)=>{let{paginationNext:o,paginationPrevious:n}=e;if(!o&&!n)return;let{pagesQuery:r,currentPage:i}=e;if(!r||!i)return;let{origin:s,pathname:a}=window.location;for(let c=i-1;c>=1;c--)try{let m=await U(`${s}${a}?${r}=${c}`);await O(m,e,"unshift")}catch(m){return}let l=[];for(let c=i+1;c<=t;c++)l[c]=(async()=>{let m=l[c-1];try{let p=await U(`${s}${a}?${r}=${c}`);await m,await O(p,e)}catch(p){await m;return}})();await Promise.all(l)};var pe=async e=>{let{paginationNext:t,paginationPrevious:o,paginationCount:n,itemsPerPage:r}=e;if(!t)return;o&&(o.style.display="none"),n==null||n.remove();let i=!0,s=!1;e.initPagination(),e.on("renderitems",()=>{let{validItems:m,items:p,itemsPerPage:f}=e;if(!i&&p.length===f)return c();t.style.display=m.length>f?"":"none"});let l=P(t,"click",async m=>{m.preventDefault(),!s&&(s=!0,await k(e,i,r,m),s=!1)}),c=()=>{l(),t.style.display="none"};return await A(e),i=!1,c};var de=tt;function tt(e,t,o){var n=null,r=null,i=o&&o.leading,s=o&&o.trailing;i==null&&(i=!0),s==null&&(s=!i),i==!0&&(s=!1);var a=function(){n&&(clearTimeout(n),n=null)},l=function(){var m=r;a(),m&&m()},c=function(){var m=i&&!n,p=this,f=arguments;if(r=function(){return e.apply(p,f)},n||(n=setTimeout(function(){if(n=null,s)return r()},t)),m)return m=!1,r()};return c.cancel=a,c.flush=l,c}var T=`fs-${C}`,ot="list",rt="loader",nt="items-count",it="visible-count",st="visible-count-from",at="visible-count-to",ct="scroll-anchor",lt="page-button",ut="page-dots",mt="empty",pt="mode",dt={loadUnder:"load-under",renderAll:"render-all",pagination:"pagination",infinite:"infinite"},ft="threshold",gt="pagesiblings",Et="pageboundary",Tt="animation",St="easing",yt="duration",xt="stagger",bt="resetix",At={true:"true"},wt="showquery",_t={true:"true"},R={element:{key:`${T}-element`,values:{list:x(ot),loader:x(rt),itemsCount:x(nt),visibleCount:x(it),visibleCountFrom:x(st),visibleCountTo:x(at),scrollAnchor:x(ct),empty:x(mt),pageButton:lt,pageDots:ut}},mode:{key:`${T}-${pt}`,values:dt},threshold:{key:`${T}-${ft}`},pageSiblings:{key:`${T}-${gt}`},pageBoundary:{key:`${T}-${Et}`},animation:{key:`${T}-${Tt}`},easing:{key:`${T}-${St}`},duration:{key:`${T}-${yt}`},stagger:{key:`${T}-${xt}`},resetIx:{key:`${T}-${bt}`,values:At},showQuery:{key:`${T}-${wt}`,values:_t}},[$,S]=N(R),fe="-20",ge=1,Ee=1,Te={main:0,medium:1,small:2,tiny:3};var{pageSiblings:{key:Ct},pageBoundary:{key:Pt},threshold:{key:Lt},showQuery:{key:ht,values:vt}}=R,Se=e=>{let{paginationWrapper:t,paginationCount:o}=e;if(!t)return;let n=S("pageButton",{operator:"prefixed",scope:t}),r=S("pageDots",{operator:"prefixed",scope:t});r?r.remove():(r=document.createElement("div"),r.textContent="...");let i=e.getAttribute(Pt),s=(i?B(i):[]).map(d=>parseInt(d)),a=e.getAttribute(Ct),l=(a?B(a):[]).map(d=>parseInt(d)),[c,m]=G(s,l),p=[s,l].some(({length:d})=>d>1),f=e.getAttribute(ht)===vt.true;return{paginationWrapper:t,pageButtonTemplate:n,pageDotsTemplate:r,paginationCount:o,pageBoundary:c,pageBoundaryValues:s,pageSiblings:m,pageSiblingsValues:l,hasBreakpoints:p,showQueryParams:f}},G=(e,t)=>{let o=F(),n=Te[o],r=[];[e,t].forEach((a,l)=>{for(let c=n;c>=0;c--){let m=a[c];if(typeof m=="number"){r[l]=m;break}}});let[i,s]=r;return i!=null||(i=Ee),s!=null||(s=ge),[i,s]},ye=e=>{let t=parseInt(e.getAttribute(Lt)||fe);return 1-t/100};var xe=async e=>{let{list:t,paginationNext:o,paginationPrevious:n,paginationCount:r,itemsPerPage:i}=e;if(!t||!o)return;n&&(n.style.display="none"),r==null||r.remove();let s=ye(e),a=!0,l=!1;e.initPagination(),e.on("renderitems",()=>{let{validItems:d,items:u,itemsPerPage:g}=e;if(!a&&u.length===g){f();return}o.style.display=d.length>g?"":"none"});let c=async d=>{d.preventDefault()},m=de(async()=>{if(l)return;let{innerHeight:d}=window,{bottom:u}=t.getBoundingClientRect(),g=s*d;u>0&&u<=g&&(l=!0,await k(e,a,i),l=!1)},100),p=new IntersectionObserver(d=>{for(let{isIntersecting:u}of d)window[u?"addEventListener":"removeEventListener"]("scroll",m)}),f=()=>{window.removeEventListener("scroll",m),o.removeEventListener("click",c),o.style.display="none",p.disconnect()};return o.addEventListener("click",c),p.observe(t),await A(e),a=!1,f};var we=j(Ae(),1);var{paginationNext:Mt,paginationPrevious:It}=L,_e=async e=>{let t=Se(e);if(!t)return;let{paginationWrapper:o,pageButtonTemplate:n,pageDotsTemplate:r,paginationCount:i,pageBoundary:s,pageBoundaryValues:a,pageSiblings:l,pageSiblingsValues:c,hasBreakpoints:m,showQueryParams:p}=t,f;if(n){let{parentElement:g}=n;n.remove(),g&&(f={parentElement:g,pageButtonTemplate:n,pageDotsTemplate:r,pageBoundary:s,pageSiblings:l,renderedElements:new Map([])})}e.initPagination(p),e.on("renderitems",()=>Bt(e,f,i));let d=P(o,"click",g=>kt(g,f,e)),u;return f&&m&&(u=P(window,"resize",(0,we.default)(()=>{Ot(f,e,a,c)},100))),await A(e),()=>{d(),u==null||u()}},Bt=(e,t,o,n=!0)=>{t&&Ce(t,e),o&&ue(o,e),n&&le(e)},Ce=(e,t)=>{let{currentPage:o,totalPages:n}=t;if(!o)return;let{parentElement:r,renderedElements:i,pageBoundary:s,pageSiblings:a}=e,l=[...i],c=a*2+1,p=s*2+c+2,f=o-1<p-c,d=n-o<p-c;for(let u=1;u<=p;u++){let[g,Y]=l[u-1]||[],[W]=l[u-2]||[];if(u>n){g&&(g.remove(),l[u-1]=void 0);continue}let E;n<=p?E=u:f?u>p-s?E=n-(p-u):u===p-s?E=null:E=u:d?u<s+1?E=u:u===s+1?E=null:E=n-(p-u):u<s+1?E=u:u>p-s?E=n-(p-u):u===s+1||u===p-s?E=null:E=o+(u-(s+1)-(1+a));let w;Y!==E&&(g==null||g.remove(),w=Nt(e,E,t),l[u-1]=[w,E],W?r.insertBefore(w,W.nextSibling):r.appendChild(w),w.style.opacity="");let q=w||g;!q||Ut(q,E===o)}e.renderedElements=new Map([...l.filter(D)])},Nt=({pageButtonTemplate:e,pageDotsTemplate:t},o,{pagesQuery:n})=>{if(!o)return I(t);let r=I(e);return r.classList.remove(M),r.textContent=`${o}`,r instanceof HTMLAnchorElement&&n&&(r.href=`?${n}=${o}`),r},Ut=(e,t)=>{t?(e.classList.add(M),e.setAttribute("aria-current","page")):(e.classList.remove(M),e.removeAttribute("aria-current"))},kt=(e,t,o)=>{let{target:n}=e;if(!(n instanceof Element))return;let r=n.closest($("element","pageButton",{operator:"prefixed"})),i=n.closest(`.${Mt}`),s=n.closest(`.${It}`);if(!r&&!i&&!s)return;e.preventDefault();let{currentPage:a,totalPages:l}=o;if(!a)return;let c;i&&(c=a+1),s&&(c=a-1),r&&(c=t==null?void 0:t.renderedElements.get(r)),!!c&&c>=1&&c<=l&&o.switchPage(c)},Ot=(e,t,...o)=>{let{pageBoundary:n,pageSiblings:r,renderedElements:i}=e,[s,a]=G(...o);if(!(n===s&&r===a)){e.pageBoundary=s,e.pageSiblings=a;for(let[l]of i)l.remove();i.clear(),Ce(e,t)}};var Pe=async e=>{let{paginationNext:t,paginationPrevious:o,paginationCount:n}=e;!t||(t.style.display="none",o&&(o.style.display="none"),n==null||n.remove(),await A(e))};var{element:{key:$t},mode:{key:Kt,values:{renderAll:Dt,infinite:Vt,pagination:Ft}},animation:{key:Ht},duration:{key:Le},easing:{key:he},stagger:{key:Gt},resetIx:{key:Yt,values:Wt}}=R,ve=async(e,t)=>{let o=e.getInstanceIndex($t),{items:n}=e,{Webflow:r}=window,i=!!r&&"require"in r;t.addItemsAnimation(e,{animationKey:Ht,durationKey:Le,easingKey:he,staggerKey:Gt}),t.addListAnimation(e,{durationKey:Le,easingKey:he});let s=i&&!!r.require("commerce")&&n.some(({element:d})=>d.querySelector(`.${Q.addToCartForm}`));s&&(e.restartCommerce=s);let a=i&&!!r.require("lightbox")&&n.some(({element:d})=>d.querySelector(`.${z.trigger}`));a&&(e.restartLightbox=a);let l=e.getAttribute(Yt)===Wt.true;l&&(e.restartIx=l);let c=S("loader",{instanceIndex:o});c&&e.addLoader(c);let m=S("empty",{instanceIndex:o});if(m&&e.addEmptyElement(m),!e.itemsCount){let d=S("itemsCount",{instanceIndex:o});d&&e.addItemsCount(d)}if(!e.visibleCount||!e.visibleCountFrom||!e.visibleCountTo){let d=S("visibleCount",{instanceIndex:o}),u=S("visibleCountFrom",{instanceIndex:o}),g=S("visibleCountTo",{instanceIndex:o});e.addVisibleCount(d,u,g)}if(!e.scrollAnchor){let d=S("scrollAnchor",{instanceIndex:o});d&&(e.scrollAnchor=d)}let p=e.getAttribute(Kt);return p===Dt?await Pe(e):p===Vt?await xe(e):p===Ft?await _e(e):await pe(e)};var Re=async()=>{let e=await oe();if(!e)return[];let t=e.createCMSListInstances([$("element","list",{operator:"prefixed"})]),o=await Promise.all(t.map(n=>ve(n,e)));return ee(C,t,()=>{var n;for(let r of t)(n=r.destroy)==null||n.call(r);for(let r of o)r==null||r()})};se({init:Re,version:ae,attributeKey:C});te();})(); |
{ | ||
"name": "@finsweet/attributes-cmsload", | ||
"version": "1.8.3", | ||
"version": "1.9.0", | ||
"description": "Load More Webflow CMS items on the page after the page has loaded.", | ||
@@ -31,13 +31,3 @@ "homepage": "https://www.finsweet.com/attributes", | ||
}, | ||
"devDependencies": { | ||
"@global/build": "1.0.0", | ||
"@global/tests": "1.0.0", | ||
"@global/types": "1.0.0" | ||
}, | ||
"dependencies": { | ||
"@finsweet/attributes-cmscore": "1.8.0", | ||
"@finsweet/ts-utils": "^0.33.1", | ||
"@global/constants": "1.2.0", | ||
"@global/factory": "1.1.5", | ||
"@global/import": "1.0.4", | ||
"just-debounce": "^1.1.0", | ||
@@ -48,2 +38,3 @@ "just-throttle": "^4.0.1" | ||
"dev": "cross-env NODE_ENV=development node ./bin/build.js", | ||
"build:dev": "cross-env NODE_ENV=test node ./bin/build.js", | ||
"build": "cross-env NODE_ENV=production node ./bin/build.js", | ||
@@ -50,0 +41,0 @@ "lint": "eslint ./src && prettier --check ./src", |
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
2
0
34724
64
2
- Removed@finsweet/attributes-cmscore@1.8.0
- Removed@finsweet/ts-utils@^0.33.1
- Removed@global/constants@1.2.0
- Removed@global/factory@1.1.5
- Removed@global/import@1.0.4
- Removed@finsweet/attributes-cmscore@1.8.0(transitive)
- Removed@finsweet/ts-utils@0.33.2(transitive)
- Removedemittery@0.11.0(transitive)