@finsweet/attributes-cmscore
Advanced tools
Comparing version 1.6.0 to 1.6.1
@@ -1,1 +0,1 @@ | ||
[{"version":"v1.6.0","date":"03 March 2022","markdown":"- Added `CMSList.pageCount` and `CMSList.addPageCount()` helpers.\r\n This sets the bases for the new `fs-cmsload-element=\"page-count\"` attribute.\r\n"},{"version":"v1.5.7","date":"13 February 2022","markdown":"- Added some extra rendering logic to ensure all images are loaded correctly on `iOS` devices.\r\n"},{"version":"v1.5.6","date":"19 January 2022","markdown":"- Internal: updated `@finsweet/ts-utils` to fix an issue with the `restartWebflow` helper.\r\n Now the 'ix2' state dispatch is awaited, as it was conflicting with other modules restart.\r\n"},{"version":"v1.5.5","date":"19 December 2021","markdown":"- Fixed Webflow modules not restarting correctly.\r\n"},{"version":"v1.5.4","date":"19 December 2021","markdown":"- Added `CMSList.restartSliders` and `CMSList.restartTabs` props to use the built-in `Webflow.require('slider' | 'tabs').redraw()` methods from Webflow instead of restarting the whole instance.\r\n"},{"version":"v1.5.3","date":"15 December 2021","markdown":"- Removed deprecated `CMSList.addPaginationPrevious()` method in favor of `CMSList.addPaginationButton()`.\r\n- Added new `animateList` param to `CMSList.renderItems()` to allow further control over the list animation.\r\n- Set `CMSList.emptyState` prop to `false` on component instantiation.\r\n"},{"version":"v1.5.2","date":"9 December 2021","markdown":"- Added new `CMSList.initialElement` prop.\n- Made sure items are set to `opacity: 1` when using `CMSList.displayElement` without animations.\n"},{"version":"v1.5.1","date":"8 December 2021","markdown":"- Fixed `Empty State` element potentially being retrieved from a native empty Nested Collection, causing the `empty` element from `cmsfilter` not working correctly.\n"},{"version":"v1.5.0","date":"8 December 2021","markdown":"- Added support to use pagination query params.\n Now `cmscore` will extract each `CMSList` pages query (example: `5f7457b3_page`) to be able to consume it with other packages like `cmsload`.\n This has involved several internal changes:\n - Added new `storePaginationData` util. The method is `async` and while running it stores a Promise in `CMSList.extractingPaginationData`.\n - Added new `CMSList.originalItemsPerPage`, `CMSList.pagesQuery` and `CMSList.showPaginationQuery` props.\n - Now `CMSList.currentPage` will no longer be used as the reference to slice rendered items. Instead, a new `CMSList.paginationActive` is used as the reference.\n - Modified `CMSList.switchPage()` to define if it should trigger a rendering cycle.\n - Added new `CMSList.initPagination()` method.\n - Deprecated `CMSList.addPaginationPrevious()` in favor of a new `CMSList.addPaginationButton()` method.\n- Refactored: Moved `CMSList.updateItemsCount()` to be an external util.\n"},{"version":"v1.4.2","date":"1 December 2021","markdown":"- Renamed `window.fsAttributes.cms.lists` to `window.fsAttributes.cms.listInstances` to keep consistency.\n"},{"version":"v1.4.1","date":"1 December 2021","markdown":"- Added support for creating `list` instances that have no items.\n Some users were trying to instantiate lists that were at `Empty State`, causing `cmscore` to crash in some ocasions.\n"},{"version":"v1.4.0","date":"29 November 2021","markdown":"- Added `CMSList.originalItemsOrder` prop.\n- Added `CMSList.clearItems()` method.\n"},{"version":"v1.3.1","date":"23 November 2021","markdown":"- Updated `restartWebflow` from `@finsweet/ts-utils` to include `lightbox` module support.\n"},{"version":"v1.3.0","date":"23 November 2021","markdown":"- Replaced `CMSItem.needsXXXRestart` props to a single `CMSItem.needsWebflowRestart`, as they were redundant.\n- Added `CMSList.restartWebflow` prop.\n- Improved `restartWebflowModules` and added support for `CMSList.restartWebflow`.\n"},{"version":"v1.2.0","date":"17 November 2021","markdown":"- Included the `package.version` in the exports.\n- Forced `trim` and `toLowerCase` to all prop field keys.\n- Added support for `cmscore` versioning.\n"},{"version":"v1.1.2","date":"15 November 2021","markdown":"- Updated `restartWebflow` from `@finsweet/ts-utils` to support persisting state after reinitializing the `ix2` module.\n"},{"version":"v1.1.1","date":"11 November 2021","markdown":"- Added a `100ms` timeout to the `CMSList.scrollToAnchor` method to avoid it being cancelled by the browser's smoo scrolling.\n"},{"version":"v1.1.0","date":"11 November 2021","markdown":"- Switched `CMSList.validItems` prop from `boolean` to an array of the valid `CMSItem` instanced.\n- Internal refactors.\n"},{"version":"v1.0.24","date":"11 November 2021","markdown":"- Fixed rendering issues caused by the `Empty State` not being correctly displayed in some situations.\n"},{"version":"v1.0.23","date":"9 November 2021","markdown":"- Improved Webflow Modules restarting in the `render` workflow.\n"},{"version":"v1.0.22","date":"9 November 2021","markdown":"- Updated `ts-utils` to add support for `commerce` sites.\n"},{"version":"v1.0.21","date":"9 November 2021","markdown":"- Added `highlightValues` optional prop in each `CMSItemProp` object. Used for `fs-cmsfilter-highlight`.\n"},{"version":"v1.0.20","date":"9 November 2021","markdown":"- Now the `originalHTML` is stored in each `CMSItemProp.elements` record. Used to reset the elements after having mutated them in actions like `fs-cmsfilter-highlight`.\n"},{"version":"v1.0.19","date":"9 November 2021","markdown":"- Refactored `CMSList.itemsCount` usage.\n"},{"version":"v1.0.18","date":"9 November 2021","markdown":"- Added `CMSItemProp.elements` property that stores the value holders.\n"},{"version":"v1.0.17","date":"9 November 2021","markdown":"- Added optional `scrollToAnchor` param to the `CMSList.switchPage()` method.\n"},{"version":"v1.0.16","date":"9 November 2021","markdown":"- Added `CMSList.itemsCount` and `CMSList.addItemsCount()` to display the amount of items of the list.\n"},{"version":"v1.0.15","date":"9 November 2021","markdown":"- `CMSList.switchPage()` now triggers a `scrollToAnchor` action, if the anchor element exists.\n"},{"version":"v1.0.14","date":"8 November 2021","markdown":"- Fixed `renderitems` and `additems` events fire order.\n- Added `CMSList.resetIx` prop that is used in the `render` function.\n"},{"version":"v1.0.13","date":"8 November 2021","markdown":"- Added `CMSList.totalPages` prop.\n"},{"version":"v1.0.12","date":"8 November 2021","markdown":"- Added optional `animate` param to `CMSList.renderItems`.\n"},{"version":"v1.0.11","date":"5 November 2021","markdown":"- Awaited `renderitems` event emit on `CMSList.renderItems`.\n"},{"version":"v1.0.10","date":"5 November 2021","markdown":"- Added `CMSList.paginationCount` prop.\n"},{"version":"v1.0.9","date":"5 November 2021","markdown":"- Added `CMSList.scrollAnchor` prop + `CMSList.scrollToAnchor()` method.\n"},{"version":"v1.0.8","date":"27 October 2021","markdown":"- Added new methods to `CMSList`.\n"},{"version":"v1.0.7","date":"27 October 2021","markdown":"- Published missing updates.\n"},{"version":"v1.0.6","date":"27 October 2021","markdown":"- Improved rendering logic.\n"},{"version":"v1.0.5","date":"27 October 2021","markdown":"- `cmscore`: Removed `CMSList.initialItems` prop.\n"},{"version":"v1.0.4","date":"27 October 2021","markdown":"- `cmscore`: Added `CMSList.initialItems` prop.\n"},{"version":"v1.0.3","date":"26 October 2021","markdown":"- Changed `CMSItemProps.mode` to `CMSItemProps.range`.\n"},{"version":"v1.0.2","date":"26 October 2021","markdown":"- Modified `CMSItem.props` value type to a `Set` instead of `Array`.\n"},{"version":"v1.0.1","date":"26 October 2021","markdown":"- `CMSItem`: Added `mode` in `props` property.\n"},{"version":"v1.0.0","date":"25 October 2021","markdown":"- Created Attribute package.\n"}] | ||
[{"version":"v1.6.1","date":"03 March 2022","markdown":"- Renamed `CMSList.pageCount` and `CMSList.addPageCount()` to `CMSList.visibleCount` and `CMSList.addVisibleCount()`.\r\n"},{"version":"v1.6.0","date":"03 March 2022","markdown":"- Added `CMSList.pageCount` and `CMSList.addPageCount()` helpers.\r\n This sets the bases for the new `fs-cmsload-element=\"page-count\"` attribute.\r\n"},{"version":"v1.5.7","date":"13 February 2022","markdown":"- Added some extra rendering logic to ensure all images are loaded correctly on `iOS` devices.\r\n"},{"version":"v1.5.6","date":"19 January 2022","markdown":"- Internal: updated `@finsweet/ts-utils` to fix an issue with the `restartWebflow` helper.\r\n Now the 'ix2' state dispatch is awaited, as it was conflicting with other modules restart.\r\n"},{"version":"v1.5.5","date":"19 December 2021","markdown":"- Fixed Webflow modules not restarting correctly.\r\n"},{"version":"v1.5.4","date":"19 December 2021","markdown":"- Added `CMSList.restartSliders` and `CMSList.restartTabs` props to use the built-in `Webflow.require('slider' | 'tabs').redraw()` methods from Webflow instead of restarting the whole instance.\r\n"},{"version":"v1.5.3","date":"15 December 2021","markdown":"- Removed deprecated `CMSList.addPaginationPrevious()` method in favor of `CMSList.addPaginationButton()`.\r\n- Added new `animateList` param to `CMSList.renderItems()` to allow further control over the list animation.\r\n- Set `CMSList.emptyState` prop to `false` on component instantiation.\r\n"},{"version":"v1.5.2","date":"9 December 2021","markdown":"- Added new `CMSList.initialElement` prop.\n- Made sure items are set to `opacity: 1` when using `CMSList.displayElement` without animations.\n"},{"version":"v1.5.1","date":"8 December 2021","markdown":"- Fixed `Empty State` element potentially being retrieved from a native empty Nested Collection, causing the `empty` element from `cmsfilter` not working correctly.\n"},{"version":"v1.5.0","date":"8 December 2021","markdown":"- Added support to use pagination query params.\n Now `cmscore` will extract each `CMSList` pages query (example: `5f7457b3_page`) to be able to consume it with other packages like `cmsload`.\n This has involved several internal changes:\n - Added new `storePaginationData` util. The method is `async` and while running it stores a Promise in `CMSList.extractingPaginationData`.\n - Added new `CMSList.originalItemsPerPage`, `CMSList.pagesQuery` and `CMSList.showPaginationQuery` props.\n - Now `CMSList.currentPage` will no longer be used as the reference to slice rendered items. Instead, a new `CMSList.paginationActive` is used as the reference.\n - Modified `CMSList.switchPage()` to define if it should trigger a rendering cycle.\n - Added new `CMSList.initPagination()` method.\n - Deprecated `CMSList.addPaginationPrevious()` in favor of a new `CMSList.addPaginationButton()` method.\n- Refactored: Moved `CMSList.updateItemsCount()` to be an external util.\n"},{"version":"v1.4.2","date":"1 December 2021","markdown":"- Renamed `window.fsAttributes.cms.lists` to `window.fsAttributes.cms.listInstances` to keep consistency.\n"},{"version":"v1.4.1","date":"1 December 2021","markdown":"- Added support for creating `list` instances that have no items.\n Some users were trying to instantiate lists that were at `Empty State`, causing `cmscore` to crash in some ocasions.\n"},{"version":"v1.4.0","date":"29 November 2021","markdown":"- Added `CMSList.originalItemsOrder` prop.\n- Added `CMSList.clearItems()` method.\n"},{"version":"v1.3.1","date":"23 November 2021","markdown":"- Updated `restartWebflow` from `@finsweet/ts-utils` to include `lightbox` module support.\n"},{"version":"v1.3.0","date":"23 November 2021","markdown":"- Replaced `CMSItem.needsXXXRestart` props to a single `CMSItem.needsWebflowRestart`, as they were redundant.\n- Added `CMSList.restartWebflow` prop.\n- Improved `restartWebflowModules` and added support for `CMSList.restartWebflow`.\n"},{"version":"v1.2.0","date":"17 November 2021","markdown":"- Included the `package.version` in the exports.\n- Forced `trim` and `toLowerCase` to all prop field keys.\n- Added support for `cmscore` versioning.\n"},{"version":"v1.1.2","date":"15 November 2021","markdown":"- Updated `restartWebflow` from `@finsweet/ts-utils` to support persisting state after reinitializing the `ix2` module.\n"},{"version":"v1.1.1","date":"11 November 2021","markdown":"- Added a `100ms` timeout to the `CMSList.scrollToAnchor` method to avoid it being cancelled by the browser's smoo scrolling.\n"},{"version":"v1.1.0","date":"11 November 2021","markdown":"- Switched `CMSList.validItems` prop from `boolean` to an array of the valid `CMSItem` instanced.\n- Internal refactors.\n"},{"version":"v1.0.24","date":"11 November 2021","markdown":"- Fixed rendering issues caused by the `Empty State` not being correctly displayed in some situations.\n"},{"version":"v1.0.23","date":"9 November 2021","markdown":"- Improved Webflow Modules restarting in the `render` workflow.\n"},{"version":"v1.0.22","date":"9 November 2021","markdown":"- Updated `ts-utils` to add support for `commerce` sites.\n"},{"version":"v1.0.21","date":"9 November 2021","markdown":"- Added `highlightValues` optional prop in each `CMSItemProp` object. Used for `fs-cmsfilter-highlight`.\n"},{"version":"v1.0.20","date":"9 November 2021","markdown":"- Now the `originalHTML` is stored in each `CMSItemProp.elements` record. Used to reset the elements after having mutated them in actions like `fs-cmsfilter-highlight`.\n"},{"version":"v1.0.19","date":"9 November 2021","markdown":"- Refactored `CMSList.itemsCount` usage.\n"},{"version":"v1.0.18","date":"9 November 2021","markdown":"- Added `CMSItemProp.elements` property that stores the value holders.\n"},{"version":"v1.0.17","date":"9 November 2021","markdown":"- Added optional `scrollToAnchor` param to the `CMSList.switchPage()` method.\n"},{"version":"v1.0.16","date":"9 November 2021","markdown":"- Added `CMSList.itemsCount` and `CMSList.addItemsCount()` to display the amount of items of the list.\n"},{"version":"v1.0.15","date":"9 November 2021","markdown":"- `CMSList.switchPage()` now triggers a `scrollToAnchor` action, if the anchor element exists.\n"},{"version":"v1.0.14","date":"8 November 2021","markdown":"- Fixed `renderitems` and `additems` events fire order.\n- Added `CMSList.resetIx` prop that is used in the `render` function.\n"},{"version":"v1.0.13","date":"8 November 2021","markdown":"- Added `CMSList.totalPages` prop.\n"},{"version":"v1.0.12","date":"8 November 2021","markdown":"- Added optional `animate` param to `CMSList.renderItems`.\n"},{"version":"v1.0.11","date":"5 November 2021","markdown":"- Awaited `renderitems` event emit on `CMSList.renderItems`.\n"},{"version":"v1.0.10","date":"5 November 2021","markdown":"- Added `CMSList.paginationCount` prop.\n"},{"version":"v1.0.9","date":"5 November 2021","markdown":"- Added `CMSList.scrollAnchor` prop + `CMSList.scrollToAnchor()` method.\n"},{"version":"v1.0.8","date":"27 October 2021","markdown":"- Added new methods to `CMSList`.\n"},{"version":"v1.0.7","date":"27 October 2021","markdown":"- Published missing updates.\n"},{"version":"v1.0.6","date":"27 October 2021","markdown":"- Improved rendering logic.\n"},{"version":"v1.0.5","date":"27 October 2021","markdown":"- `cmscore`: Removed `CMSList.initialItems` prop.\n"},{"version":"v1.0.4","date":"27 October 2021","markdown":"- `cmscore`: Added `CMSList.initialItems` prop.\n"},{"version":"v1.0.3","date":"26 October 2021","markdown":"- Changed `CMSItemProps.mode` to `CMSItemProps.range`.\n"},{"version":"v1.0.2","date":"26 October 2021","markdown":"- Modified `CMSItem.props` value type to a `Set` instead of `Array`.\n"},{"version":"v1.0.1","date":"26 October 2021","markdown":"- `CMSItem`: Added `mode` in `props` property.\n"},{"version":"v1.0.0","date":"25 October 2021","markdown":"- Created Attribute package.\n"}] |
@@ -1,2 +0,2 @@ | ||
var xe=Object.create;var W=Object.defineProperty,Ee=Object.defineProperties,Ce=Object.getOwnPropertyDescriptor,Pe=Object.getOwnPropertyDescriptors,Le=Object.getOwnPropertyNames,v=Object.getOwnPropertySymbols,Me=Object.getPrototypeOf,j=Object.prototype.hasOwnProperty,N=Object.prototype.propertyIsEnumerable;var k=(r,e,t)=>e in r?W(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,O=(r,e)=>{for(var t in e||(e={}))j.call(e,t)&&k(r,t,e[t]);if(v)for(var t of v(e))N.call(e,t)&&k(r,t,e[t]);return r},ee=(r,e)=>Ee(r,Pe(e)),Ie=r=>W(r,"__esModule",{value:!0});var te=(r,e)=>{var t={};for(var i in r)j.call(r,i)&&e.indexOf(i)<0&&(t[i]=r[i]);if(r!=null&&v)for(var i of v(r))e.indexOf(i)<0&&N.call(r,i)&&(t[i]=r[i]);return t};var Ae=(r,e)=>()=>(e||r((e={exports:{}}).exports,e),e.exports);var Te=(r,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of Le(e))!j.call(r,n)&&(t||n!=="default")&&W(r,n,{get:()=>e[n],enumerable:!(i=Ce(e,n))||i.enumerable});return r},We=(r,e)=>Te(Ie(W(r!=null?xe(Me(r)):{},"default",!e&&r&&r.__esModule?{get:()=>r.default,enumerable:!0}:{value:r,enumerable:!0})),r);var re=(r,e,t)=>(k(r,typeof e!="symbol"?e+"":e,t),t);var c=(r,e,t)=>new Promise((i,n)=>{var o=l=>{try{a(t.next(l))}catch(f){n(f)}},s=l=>{try{a(t.throw(l))}catch(f){n(f)}},a=l=>l.done?i(l.value):Promise.resolve(l.value).then(o,s);a((t=t.apply(r,e)).next())});var le=Ae((Pt,ae)=>{"use strict";var y=new WeakMap,_=new WeakMap,M=new WeakMap,z=Symbol("anyProducer"),ie=Promise.resolve(),q=Symbol("listenerAdded"),H=Symbol("listenerRemoved"),U=!1;function E(r){if(typeof r!="string"&&typeof r!="symbol")throw new TypeError("eventName must be a string or a symbol")}function $(r){if(typeof r!="function")throw new TypeError("listener must be a function")}function C(r,e){let t=_.get(r);return t.has(e)||t.set(e,new Set),t.get(e)}function I(r,e){let t=typeof e=="string"||typeof e=="symbol"?e:z,i=M.get(r);return i.has(t)||i.set(t,new Set),i.get(t)}function ke(r,e,t){let i=M.get(r);if(i.has(e))for(let n of i.get(e))n.enqueue(t);if(i.has(z)){let n=Promise.all([e,t]);for(let o of i.get(z))o.enqueue(n)}}function ne(r,e){e=Array.isArray(e)?e:[e];let t=!1,i=()=>{},n=[],o={enqueue(s){n.push(s),i()},finish(){t=!0,i()}};for(let s of e)I(r,s).add(o);return{next(){return c(this,null,function*(){return n?n.length===0?t?(n=void 0,this.next()):(yield new Promise(s=>{i=s}),this.next()):{done:!1,value:yield n.shift()}:{done:!0}})},return(a){return c(this,arguments,function*(s){n=void 0;for(let l of e)I(r,l).delete(o);return i(),arguments.length>0?{done:!0,value:yield s}:{done:!0}})},[Symbol.asyncIterator](){return this}}}function oe(r){if(r===void 0)return se;if(!Array.isArray(r))throw new TypeError("`methodNames` must be an array of strings");for(let e of r)if(!se.includes(e))throw typeof e!="string"?new TypeError("`methodNames` element must be a string"):new Error(`${e} is not Emittery method`);return r}var G=r=>r===q||r===H,w=class{static mixin(e,t){return t=oe(t),i=>{if(typeof i!="function")throw new TypeError("`target` must be function");for(let s of t)if(i.prototype[s]!==void 0)throw new Error(`The property \`${s}\` already exists on \`target\``);function n(){return Object.defineProperty(this,e,{enumerable:!1,value:new w}),this[e]}Object.defineProperty(i.prototype,e,{enumerable:!1,get:n});let o=s=>function(...a){return this[e][s](...a)};for(let s of t)Object.defineProperty(i.prototype,s,{enumerable:!1,value:o(s)});return i}}static get isDebugEnabled(){if(typeof process!="object")return U;let{env:e}=process||{env:{}};return e.DEBUG==="emittery"||e.DEBUG==="*"||U}static set isDebugEnabled(e){U=e}constructor(e={}){y.set(this,new Set),_.set(this,new Map),M.set(this,new Map),this.debug=e.debug||{},this.debug.enabled===void 0&&(this.debug.enabled=!1),this.debug.logger||(this.debug.logger=(t,i,n,o)=>{o=JSON.stringify(o),typeof n=="symbol"&&(n=n.toString());let s=new Date,a=`${s.getHours()}:${s.getMinutes()}:${s.getSeconds()}.${s.getMilliseconds()}`;console.log(`[${a}][emittery:${t}][${i}] Event Name: ${n} | ||
data: ${o}`)})}logIfDebugEnabled(e,t,i){(w.isDebugEnabled||this.debug.enabled)&&this.debug.logger(e,this.debug.name,t,i)}on(e,t){$(t),e=Array.isArray(e)?e:[e];for(let i of e)E(i),C(this,i).add(t),this.logIfDebugEnabled("subscribe",i,void 0),G(i)||this.emit(q,{eventName:i,listener:t});return this.off.bind(this,e,t)}off(e,t){$(t),e=Array.isArray(e)?e:[e];for(let i of e)E(i),C(this,i).delete(t),this.logIfDebugEnabled("unsubscribe",i,void 0),G(i)||this.emit(H,{eventName:i,listener:t})}once(e){return new Promise(t=>{let i=this.on(e,n=>{i(),t(n)})})}events(e){e=Array.isArray(e)?e:[e];for(let t of e)E(t);return ne(this,e)}emit(e,t){return c(this,null,function*(){E(e),this.logIfDebugEnabled("emit",e,t),ke(this,e,t);let i=C(this,e),n=y.get(this),o=[...i],s=G(e)?[]:[...n];yield ie,yield Promise.all([...o.map(a=>c(this,null,function*(){if(i.has(a))return a(t)})),...s.map(a=>c(this,null,function*(){if(n.has(a))return a(e,t)}))])})}emitSerial(e,t){return c(this,null,function*(){E(e),this.logIfDebugEnabled("emitSerial",e,t);let i=C(this,e),n=y.get(this),o=[...i],s=[...n];yield ie;for(let a of o)i.has(a)&&(yield a(t));for(let a of s)n.has(a)&&(yield a(e,t))})}onAny(e){return $(e),this.logIfDebugEnabled("subscribeAny",void 0,void 0),y.get(this).add(e),this.emit(q,{listener:e}),this.offAny.bind(this,e)}anyEvent(){return ne(this)}offAny(e){$(e),this.logIfDebugEnabled("unsubscribeAny",void 0,void 0),this.emit(H,{listener:e}),y.get(this).delete(e)}clearListeners(e){e=Array.isArray(e)?e:[e];for(let t of e)if(this.logIfDebugEnabled("clear",t,void 0),typeof t=="string"||typeof t=="symbol"){C(this,t).clear();let i=I(this,t);for(let n of i)n.finish();i.clear()}else{y.get(this).clear();for(let i of _.get(this).values())i.clear();for(let i of M.get(this).values()){for(let n of i)n.finish();i.clear()}}}listenerCount(e){e=Array.isArray(e)?e:[e];let t=0;for(let i of e){if(typeof i=="string"){t+=y.get(this).size+C(this,i).size+I(this,i).size+I(this).size;continue}typeof i!="undefined"&&E(i),t+=y.get(this).size;for(let n of _.get(this).values())t+=n.size;for(let n of M.get(this).values())t+=n.size}return t}bindMethods(e,t){if(typeof e!="object"||e===null)throw new TypeError("`target` must be an object");t=oe(t);for(let i of t){if(e[i]!==void 0)throw new Error(`The property \`${i}\` already exists on \`target\``);Object.defineProperty(e,i,{enumerable:!1,value:this[i].bind(this)})}}},se=Object.getOwnPropertyNames(w.prototype).filter(r=>r!=="constructor");Object.defineProperty(w,"listenerAdded",{value:q,writable:!1,enumerable:!0,configurable:!1});Object.defineProperty(w,"listenerRemoved",{value:H,writable:!1,enumerable:!0,configurable:!1});ae.exports=w});var Oe="1.6.0";var P=class{static activateAlerts(){this.alertsActivated=!0}static alert(e,t){if(this.alertsActivated&&window.alert(e),t==="error")throw new Error(e)}};re(P,"alertsActivated",!1);var x={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 B=r=>{let e=r.split("-"),t=parseInt(e[e.length-1]);if(!isNaN(t))return t};var F=r=>new Promise(e=>setTimeout(e,r));var Q=r=>r!=null;var{wrapper:De,list:_e,paginationWrapper:qe,paginationNext:He,paginationPrevious:$e,emptyState:Re,pageCount:je}=x;function d(r,e,t=document){let i=typeof r=="string"?t.querySelector(r):r;if(!i)return;let n=i.closest(`.${De}`);if(!n)return;let o=n.querySelector(`.${_e}`);return e==="wrapper"?n:e==="list"?o:e==="items"?[...(o==null?void 0:o.children)||[]]:e==="pageCount"?n.querySelector(`.${je}`):e==="empty"?n.querySelector(`:scope > .${Re}`):e==="pagination"?n.querySelector(`.${qe}`):n.querySelector(`.${e==="next"?He:$e}`)}var L=(r,e=document)=>{r=r.filter(o=>o);let t=r.join(", ")||`.${x.wrapper}`;return[...e.querySelectorAll(t)].reduce((o,s)=>{if(!s)return o;let a=d(s,"wrapper");return!a||o.includes(a)||o.push(a),o},[])};var V=()=>document.documentElement.getAttribute("data-wf-site");var D=r=>c(void 0,null,function*(){var t,i,n;let{Webflow:e}=window;if(!(!e||!("destroy"in e)||!("ready"in e)||!("require"in e))&&!(r&&!r.length)){if(r||(e.destroy(),e.ready()),!r||r.includes("ix2")){let o=e.require("ix2");if(o){let{store:s,actions:a}=o,{eventState:l}=s.getState().ixSession,f=Object.entries(l);r||o.destroy(),o.init(),yield Promise.all(f.map(m=>s.dispatch(a.eventStateChanged(...m))))}}if(!r||r.includes("commerce")){let o=e.require("commerce"),s=V();o&&s&&(o.destroy(),o.init({siteId:s,apiUrl:"https://render.webflow.com"}))}return(r==null?void 0:r.includes("lightbox"))&&((t=e.require("lightbox"))==null||t.ready()),(r==null?void 0:r.includes("slider"))&&((i=e.require("slider"))==null||i.redraw()),(r==null?void 0:r.includes("tabs"))&&((n=e.require("tabs"))==null||n.redraw()),new Promise(o=>e.push(()=>o(void 0)))}});var we=We(le(),1);var J=(r,e)=>{let t=r.getAttribute(e);return t?B(t):void 0};function ce(r){return r==null?void 0:r.trim().toLowerCase()}var A=class{constructor(e,t,i){this.element=e;this.list=t;this.currentIndex=i;this.props={};this.valid=!0;var o;this.href=(o=e.querySelector("a"))==null?void 0:o.href;let n=typeof i=="number";this.needsWebflowRestart=!n}collectProps({fieldKey:e,typeKey:t,rangeKey:i}){let{element:n,props:o}=this,s=[...n.querySelectorAll(`[${e}]`)];for(let a of s){let l=ce(a.getAttribute(e));if(!l)return;let{textContent:f,innerHTML:m}=a;if(!f)continue;let b=t?a.getAttribute(t):void 0,u=i?a.getAttribute(i):void 0;o[l]||(o[l]={type:b,range:u,values:new Set,elements:new Map});let g=o[l],{values:p,elements:h}=g;if(u==="from"||u==="to"){let S=[...p];S[u==="from"?0:1]=f,g.values=new Set(S)}p.add(f),h.has(f)||h.set(f,{element:a,originalHTML:m})}}};var K=(r,e)=>{r.textContent=`${e}`};var Be=new DOMParser,ue=r=>c(void 0,null,function*(){let t=yield(yield fetch(r)).text();return Be.parseFromString(t,"text/html")});var{location:pe,history:Fe}=window,fe,me=r=>{if(!r)return;let{href:e}=r,{searchParams:t}=new URL(e);return[...t.entries()]},Qe=i=>c(void 0,[i],function*({paginationNext:r,paginationPrevious:e,index:t}){let n=me(r||e);if(!n||!n.length)return;let o,s;if(n.length===1){let[l]=n;if(!l)return;[o,s]=l}else try{let{origin:l,pathname:f}=pe;fe||(fe=ue(l+f));let m=yield fe,u=L([],m)[t];if(!u)return;let g=d(u,"next"),[p]=me(g)||[];if(!p)return;[o]=p,[,s]=n.find(([h])=>h===o)||[]}catch(l){return}if(!o||!s)return;let a=parseInt(s);return[o,a]}),de=r=>{let{paginationNext:e}=r;r.extractingPaginationData=new Promise(t=>c(void 0,null,function*(){let i=yield Qe(r);if(!i){t();return}let[n,o]=i;r.pagesQuery=n,r.currentPage=e?o-1:o+1,t()}))},ge=({currentPage:r,pagesQuery:e})=>{if(!e||!r)return;let t=new URL(pe.href),{searchParams:i}=t;i.set(e,`${r}`),Fe.replaceState(null,"",t.toString())};var he=(l,f)=>c(void 0,[l,f],function*(r,{items:e,restartWebflow:t,restartIx:i,restartCommerce:n,restartLightbox:o,restartSliders:s,restartTabs:a}){let m=[[i,"ix2"],[n,"commerce"],[o,"lightbox"],[s,"slider"],[a,"tabs"]];if(!t&&!m.some(([u])=>u)||!r.some(({needsWebflowRestart:u})=>u))return;for(let u of e){let g=r.includes(u);u.needsWebflowRestart=!g}if(t){yield D();return}let b=m.reduce((u,[g,p])=>(g&&u.push(p),u),[]);yield D(b)});var be=(r,e=!1,t=!0)=>c(void 0,null,function*(){let{items:i,itemsPerPage:n,paginationActive:o,currentPage:s,emptyState:a}=r,l=[],f=[],m=[];for(let p of i){let{valid:h,currentIndex:S}=p,T=typeof S=="number";if(h){if(l.push(p),!o||!s){m.push(p);continue}l.length>(s-1)*n&&l.length<=s*n?m.push(p):T&&f.push(p)}else T&&f.push(p)}r.validItems=l,r.totalPages=Math.ceil(l.length/n)||1;let b=!l.length;r.emptyState=b;let u=[];m.forEach((p,h)=>{p.currentIndex!==h&&u.push([p,h,m[h-1]])});let g=t&&!e||a!==b;g&&(yield r.displayElement(a?"emptyElement":"list",!1)),yield Promise.all([...Ve(f,r,e),...ze(u,r,e)]),yield r.emitSerial("renderitems",m),yield he(m,r),g&&(yield r.displayElement(b?"emptyElement":"list"))}),Ve=(r,{itemsAnimation:e},t)=>r.map(i=>c(void 0,null,function*(){let{element:n}=i;if(t&&e){let{animateOut:o,options:s}=e;yield o(n,O({remove:!0},s))}else n.remove();i.currentIndex=void 0})),ze=(r,{list:e,itemsAnimation:t},i)=>e?r.map((l,f)=>c(void 0,[l,f],function*([n,o,s],a){n.animating=new Promise(m=>c(void 0,null,function*(){n.rendering=new Promise(b=>c(void 0,null,function*(){yield s==null?void 0:s.rendering;let{element:u,currentIndex:g}=n,p=(s==null?void 0:s.element)||null;if(typeof g!="number"&&i&&t){let{prepareIn:S,animateIn:T,options:X}=t,h=X||{},{stagger:Y}=h,Se=te(h,["stagger"]),Z=O({target:e,insertAfter:p},Se);S(u,Z),ye(u),b(),Y&&(yield F(Y*a)),yield T(u,ee(O({},Z),{prepared:!0}))}else p?e.insertBefore(u,p.nextSibling):e.prepend(u),ye(u),b();m()}))})),yield n.rendering,n.currentIndex=o})):[],ye=r=>{if(!/apple/i.test(navigator.vendor))return;let e=r.querySelectorAll("img");for(let t of e)t.outerHTML=t.outerHTML};var R=class extends we.default{constructor(e,t){super();this.wrapper=e;this.index=t;this.emptyState=!1;this.paginationActive=!1;this.showPaginationQuery=!1;this.restartWebflow=!1;this.restartIx=!1;this.restartCommerce=!1;this.restartLightbox=!1;this.restartSliders=!1;this.restartTabs=!1;let i=d(e,"list");this.list=i,this.paginationWrapper=d(e,"pagination"),this.paginationNext=d(e,"next"),this.paginationPrevious=d(e,"previous"),this.paginationCount=d(e,"pageCount"),this.emptyElement=d(e,"empty");let n=d(e,"items");this.itemsPerPage=this.originalItemsPerPage=n.length,this.totalPages=1,de(this);let o=[];i&&o.push(...n.map((s,a)=>new A(s,i,a))),this.items=o,this.validItems=o,this.originalItemsOrder=[...o]}addItems(e,t="push"){return c(this,null,function*(){let{items:i,list:n,originalItemsOrder:o}=this;if(!n)return;let s=e.map(a=>new A(a,n));for(let a of[i,o])a[t](...s);yield this.emit("shouldnest",s),yield this.emit("shouldcollectprops",s),yield this.emit("shouldsort",s),yield this.emit("shouldfilter"),yield this.renderItems(!0),yield this.emit("additems",s)})}restoreItemsOrder(){this.items=[...this.originalItemsOrder]}clearItems(e){if(e)for(let{element:t}of this.items)t.remove();this.items=[],this.originalItemsOrder=[]}renderItems(e,t){return c(this,null,function*(){return yield this.renderingQueue,new Promise(i=>c(this,null,function*(){let n=be(this,e,t);this.renderingQueue=n,yield n,i()}))})}displayElement(e,t=!0,i=!0){return c(this,null,function*(){let{listAnimation:n}=this,o=this[e];if(!!o)if(n&&i){let{animateIn:s,animateOut:a,options:l}=n;yield(t?s:a)(o,l)}else o.style.display=t?"":"none",o.style.opacity=t?"1":"0"})}switchPage(e,t=!0){return c(this,null,function*(){let{currentPage:i,showPaginationQuery:n}=this;e!==i&&(yield this.emit("switchpage",e),this.currentPage=e,this.scrollToAnchor(),n&&ge(this),t&&(yield this.renderItems()))})}initPagination(e){this.paginationActive=!0,this.showPaginationQuery=!!e}addPaginationButton(e,t,i){let{paginationWrapper:n}=this;!n||this[t]||i<0||(e.style.display="none",n.insertBefore(e,n.children[i]),this[t]=e)}addEmptyElement(e){let{wrapper:t,list:i,emptyElement:n}=this;n||(e.style.display="none",t.insertBefore(e,(i==null?void 0:i.nextSibling)||null),this.emptyElement=e)}addLoader(e){let{loader:t}=this;t||(e.style.display="none",this.loader=e)}addItemsCount(e){if(this.itemsCount)return;this.itemsCount=e;let t=()=>K(e,this.items.length);t(),this.on("additems",t)}addPageCount(e){if(this.pageCount)return;this.pageCount=e;let t=()=>K(e,Math.min(this.itemsPerPage,this.validItems.length));t(),this.on("renderitems",t)}scrollToAnchor(){let{scrollAnchor:e}=this;!e||window.setTimeout(()=>e.scrollIntoView({behavior:"smooth"}),100)}getAttribute(e){let{wrapper:t,list:i}=this;return t.getAttribute(e)||(i==null?void 0:i.getAttribute(e))}getInstanceIndex(e){let{wrapper:t,list:i}=this;return J(t,e)||(i?J(i,e):void 0)}};var Ue=r=>L(r).map(Ge).filter(Q),Ge=r=>{var s,a;let e=d(r,"wrapper");if(!e){P.alert("The element is not a Collection List.","error");return}let{fsAttributes:t}=window;(s=t.cms).listInstances||(s.listInstances=[]),(a=t.cms).listElements||(a.listElements=[...document.querySelectorAll(`.${x.wrapper}`)]);let{listInstances:i,listElements:n}=t.cms,o=n.indexOf(e);if(o!==-1)return i[o]||(i[o]=new R(e,o)),i[o]};export{A as CMSItem,R as CMSList,Ue as createCMSListInstances,Oe as version}; | ||
var xe=Object.create;var v=Object.defineProperty,Ee=Object.defineProperties,Ce=Object.getOwnPropertyDescriptor,Pe=Object.getOwnPropertyDescriptors,Le=Object.getOwnPropertyNames,W=Object.getOwnPropertySymbols,Me=Object.getPrototypeOf,j=Object.prototype.hasOwnProperty,N=Object.prototype.propertyIsEnumerable;var k=(r,e,t)=>e in r?v(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,O=(r,e)=>{for(var t in e||(e={}))j.call(e,t)&&k(r,t,e[t]);if(W)for(var t of W(e))N.call(e,t)&&k(r,t,e[t]);return r},ee=(r,e)=>Ee(r,Pe(e)),Ie=r=>v(r,"__esModule",{value:!0});var te=(r,e)=>{var t={};for(var i in r)j.call(r,i)&&e.indexOf(i)<0&&(t[i]=r[i]);if(r!=null&&W)for(var i of W(r))e.indexOf(i)<0&&N.call(r,i)&&(t[i]=r[i]);return t};var Ae=(r,e)=>()=>(e||r((e={exports:{}}).exports,e),e.exports);var Te=(r,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of Le(e))!j.call(r,n)&&(t||n!=="default")&&v(r,n,{get:()=>e[n],enumerable:!(i=Ce(e,n))||i.enumerable});return r},ve=(r,e)=>Te(Ie(v(r!=null?xe(Me(r)):{},"default",!e&&r&&r.__esModule?{get:()=>r.default,enumerable:!0}:{value:r,enumerable:!0})),r);var re=(r,e,t)=>(k(r,typeof e!="symbol"?e+"":e,t),t);var c=(r,e,t)=>new Promise((i,n)=>{var o=l=>{try{a(t.next(l))}catch(f){n(f)}},s=l=>{try{a(t.throw(l))}catch(f){n(f)}},a=l=>l.done?i(l.value):Promise.resolve(l.value).then(o,s);a((t=t.apply(r,e)).next())});var le=Ae((Pt,ae)=>{"use strict";var y=new WeakMap,_=new WeakMap,M=new WeakMap,z=Symbol("anyProducer"),ie=Promise.resolve(),q=Symbol("listenerAdded"),H=Symbol("listenerRemoved"),U=!1;function E(r){if(typeof r!="string"&&typeof r!="symbol")throw new TypeError("eventName must be a string or a symbol")}function $(r){if(typeof r!="function")throw new TypeError("listener must be a function")}function C(r,e){let t=_.get(r);return t.has(e)||t.set(e,new Set),t.get(e)}function I(r,e){let t=typeof e=="string"||typeof e=="symbol"?e:z,i=M.get(r);return i.has(t)||i.set(t,new Set),i.get(t)}function ke(r,e,t){let i=M.get(r);if(i.has(e))for(let n of i.get(e))n.enqueue(t);if(i.has(z)){let n=Promise.all([e,t]);for(let o of i.get(z))o.enqueue(n)}}function ne(r,e){e=Array.isArray(e)?e:[e];let t=!1,i=()=>{},n=[],o={enqueue(s){n.push(s),i()},finish(){t=!0,i()}};for(let s of e)I(r,s).add(o);return{next(){return c(this,null,function*(){return n?n.length===0?t?(n=void 0,this.next()):(yield new Promise(s=>{i=s}),this.next()):{done:!1,value:yield n.shift()}:{done:!0}})},return(a){return c(this,arguments,function*(s){n=void 0;for(let l of e)I(r,l).delete(o);return i(),arguments.length>0?{done:!0,value:yield s}:{done:!0}})},[Symbol.asyncIterator](){return this}}}function oe(r){if(r===void 0)return se;if(!Array.isArray(r))throw new TypeError("`methodNames` must be an array of strings");for(let e of r)if(!se.includes(e))throw typeof e!="string"?new TypeError("`methodNames` element must be a string"):new Error(`${e} is not Emittery method`);return r}var G=r=>r===q||r===H,w=class{static mixin(e,t){return t=oe(t),i=>{if(typeof i!="function")throw new TypeError("`target` must be function");for(let s of t)if(i.prototype[s]!==void 0)throw new Error(`The property \`${s}\` already exists on \`target\``);function n(){return Object.defineProperty(this,e,{enumerable:!1,value:new w}),this[e]}Object.defineProperty(i.prototype,e,{enumerable:!1,get:n});let o=s=>function(...a){return this[e][s](...a)};for(let s of t)Object.defineProperty(i.prototype,s,{enumerable:!1,value:o(s)});return i}}static get isDebugEnabled(){if(typeof process!="object")return U;let{env:e}=process||{env:{}};return e.DEBUG==="emittery"||e.DEBUG==="*"||U}static set isDebugEnabled(e){U=e}constructor(e={}){y.set(this,new Set),_.set(this,new Map),M.set(this,new Map),this.debug=e.debug||{},this.debug.enabled===void 0&&(this.debug.enabled=!1),this.debug.logger||(this.debug.logger=(t,i,n,o)=>{o=JSON.stringify(o),typeof n=="symbol"&&(n=n.toString());let s=new Date,a=`${s.getHours()}:${s.getMinutes()}:${s.getSeconds()}.${s.getMilliseconds()}`;console.log(`[${a}][emittery:${t}][${i}] Event Name: ${n} | ||
data: ${o}`)})}logIfDebugEnabled(e,t,i){(w.isDebugEnabled||this.debug.enabled)&&this.debug.logger(e,this.debug.name,t,i)}on(e,t){$(t),e=Array.isArray(e)?e:[e];for(let i of e)E(i),C(this,i).add(t),this.logIfDebugEnabled("subscribe",i,void 0),G(i)||this.emit(q,{eventName:i,listener:t});return this.off.bind(this,e,t)}off(e,t){$(t),e=Array.isArray(e)?e:[e];for(let i of e)E(i),C(this,i).delete(t),this.logIfDebugEnabled("unsubscribe",i,void 0),G(i)||this.emit(H,{eventName:i,listener:t})}once(e){return new Promise(t=>{let i=this.on(e,n=>{i(),t(n)})})}events(e){e=Array.isArray(e)?e:[e];for(let t of e)E(t);return ne(this,e)}emit(e,t){return c(this,null,function*(){E(e),this.logIfDebugEnabled("emit",e,t),ke(this,e,t);let i=C(this,e),n=y.get(this),o=[...i],s=G(e)?[]:[...n];yield ie,yield Promise.all([...o.map(a=>c(this,null,function*(){if(i.has(a))return a(t)})),...s.map(a=>c(this,null,function*(){if(n.has(a))return a(e,t)}))])})}emitSerial(e,t){return c(this,null,function*(){E(e),this.logIfDebugEnabled("emitSerial",e,t);let i=C(this,e),n=y.get(this),o=[...i],s=[...n];yield ie;for(let a of o)i.has(a)&&(yield a(t));for(let a of s)n.has(a)&&(yield a(e,t))})}onAny(e){return $(e),this.logIfDebugEnabled("subscribeAny",void 0,void 0),y.get(this).add(e),this.emit(q,{listener:e}),this.offAny.bind(this,e)}anyEvent(){return ne(this)}offAny(e){$(e),this.logIfDebugEnabled("unsubscribeAny",void 0,void 0),this.emit(H,{listener:e}),y.get(this).delete(e)}clearListeners(e){e=Array.isArray(e)?e:[e];for(let t of e)if(this.logIfDebugEnabled("clear",t,void 0),typeof t=="string"||typeof t=="symbol"){C(this,t).clear();let i=I(this,t);for(let n of i)n.finish();i.clear()}else{y.get(this).clear();for(let i of _.get(this).values())i.clear();for(let i of M.get(this).values()){for(let n of i)n.finish();i.clear()}}}listenerCount(e){e=Array.isArray(e)?e:[e];let t=0;for(let i of e){if(typeof i=="string"){t+=y.get(this).size+C(this,i).size+I(this,i).size+I(this).size;continue}typeof i!="undefined"&&E(i),t+=y.get(this).size;for(let n of _.get(this).values())t+=n.size;for(let n of M.get(this).values())t+=n.size}return t}bindMethods(e,t){if(typeof e!="object"||e===null)throw new TypeError("`target` must be an object");t=oe(t);for(let i of t){if(e[i]!==void 0)throw new Error(`The property \`${i}\` already exists on \`target\``);Object.defineProperty(e,i,{enumerable:!1,value:this[i].bind(this)})}}},se=Object.getOwnPropertyNames(w.prototype).filter(r=>r!=="constructor");Object.defineProperty(w,"listenerAdded",{value:q,writable:!1,enumerable:!0,configurable:!1});Object.defineProperty(w,"listenerRemoved",{value:H,writable:!1,enumerable:!0,configurable:!1});ae.exports=w});var Oe="1.6.1";var P=class{static activateAlerts(){this.alertsActivated=!0}static alert(e,t){if(this.alertsActivated&&window.alert(e),t==="error")throw new Error(e)}};re(P,"alertsActivated",!1);var x={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 B=r=>{let e=r.split("-"),t=parseInt(e[e.length-1]);if(!isNaN(t))return t};var F=r=>new Promise(e=>setTimeout(e,r));var V=r=>r!=null;var{wrapper:De,list:_e,paginationWrapper:qe,paginationNext:He,paginationPrevious:$e,emptyState:Re,pageCount:je}=x;function d(r,e,t=document){let i=typeof r=="string"?t.querySelector(r):r;if(!i)return;let n=i.closest(`.${De}`);if(!n)return;let o=n.querySelector(`.${_e}`);return e==="wrapper"?n:e==="list"?o:e==="items"?[...(o==null?void 0:o.children)||[]]:e==="pageCount"?n.querySelector(`.${je}`):e==="empty"?n.querySelector(`:scope > .${Re}`):e==="pagination"?n.querySelector(`.${qe}`):n.querySelector(`.${e==="next"?He:$e}`)}var L=(r,e=document)=>{r=r.filter(o=>o);let t=r.join(", ")||`.${x.wrapper}`;return[...e.querySelectorAll(t)].reduce((o,s)=>{if(!s)return o;let a=d(s,"wrapper");return!a||o.includes(a)||o.push(a),o},[])};var Q=()=>document.documentElement.getAttribute("data-wf-site");var D=r=>c(void 0,null,function*(){var t,i,n;let{Webflow:e}=window;if(!(!e||!("destroy"in e)||!("ready"in e)||!("require"in e))&&!(r&&!r.length)){if(r||(e.destroy(),e.ready()),!r||r.includes("ix2")){let o=e.require("ix2");if(o){let{store:s,actions:a}=o,{eventState:l}=s.getState().ixSession,f=Object.entries(l);r||o.destroy(),o.init(),yield Promise.all(f.map(m=>s.dispatch(a.eventStateChanged(...m))))}}if(!r||r.includes("commerce")){let o=e.require("commerce"),s=Q();o&&s&&(o.destroy(),o.init({siteId:s,apiUrl:"https://render.webflow.com"}))}return(r==null?void 0:r.includes("lightbox"))&&((t=e.require("lightbox"))==null||t.ready()),(r==null?void 0:r.includes("slider"))&&((i=e.require("slider"))==null||i.redraw()),(r==null?void 0:r.includes("tabs"))&&((n=e.require("tabs"))==null||n.redraw()),new Promise(o=>e.push(()=>o(void 0)))}});var we=ve(le(),1);var J=(r,e)=>{let t=r.getAttribute(e);return t?B(t):void 0};function ce(r){return r==null?void 0:r.trim().toLowerCase()}var A=class{constructor(e,t,i){this.element=e;this.list=t;this.currentIndex=i;this.props={};this.valid=!0;var o;this.href=(o=e.querySelector("a"))==null?void 0:o.href;let n=typeof i=="number";this.needsWebflowRestart=!n}collectProps({fieldKey:e,typeKey:t,rangeKey:i}){let{element:n,props:o}=this,s=[...n.querySelectorAll(`[${e}]`)];for(let a of s){let l=ce(a.getAttribute(e));if(!l)return;let{textContent:f,innerHTML:m}=a;if(!f)continue;let h=t?a.getAttribute(t):void 0,u=i?a.getAttribute(i):void 0;o[l]||(o[l]={type:h,range:u,values:new Set,elements:new Map});let g=o[l],{values:p,elements:b}=g;if(u==="from"||u==="to"){let S=[...p];S[u==="from"?0:1]=f,g.values=new Set(S)}p.add(f),b.has(f)||b.set(f,{element:a,originalHTML:m})}}};var K=(r,e)=>{r.textContent=`${e}`};var Be=new DOMParser,ue=r=>c(void 0,null,function*(){let t=yield(yield fetch(r)).text();return Be.parseFromString(t,"text/html")});var{location:pe,history:Fe}=window,fe,me=r=>{if(!r)return;let{href:e}=r,{searchParams:t}=new URL(e);return[...t.entries()]},Ve=i=>c(void 0,[i],function*({paginationNext:r,paginationPrevious:e,index:t}){let n=me(r||e);if(!n||!n.length)return;let o,s;if(n.length===1){let[l]=n;if(!l)return;[o,s]=l}else try{let{origin:l,pathname:f}=pe;fe||(fe=ue(l+f));let m=yield fe,u=L([],m)[t];if(!u)return;let g=d(u,"next"),[p]=me(g)||[];if(!p)return;[o]=p,[,s]=n.find(([b])=>b===o)||[]}catch(l){return}if(!o||!s)return;let a=parseInt(s);return[o,a]}),de=r=>{let{paginationNext:e}=r;r.extractingPaginationData=new Promise(t=>c(void 0,null,function*(){let i=yield Ve(r);if(!i){t();return}let[n,o]=i;r.pagesQuery=n,r.currentPage=e?o-1:o+1,t()}))},ge=({currentPage:r,pagesQuery:e})=>{if(!e||!r)return;let t=new URL(pe.href),{searchParams:i}=t;i.set(e,`${r}`),Fe.replaceState(null,"",t.toString())};var be=(l,f)=>c(void 0,[l,f],function*(r,{items:e,restartWebflow:t,restartIx:i,restartCommerce:n,restartLightbox:o,restartSliders:s,restartTabs:a}){let m=[[i,"ix2"],[n,"commerce"],[o,"lightbox"],[s,"slider"],[a,"tabs"]];if(!t&&!m.some(([u])=>u)||!r.some(({needsWebflowRestart:u})=>u))return;for(let u of e){let g=r.includes(u);u.needsWebflowRestart=!g}if(t){yield D();return}let h=m.reduce((u,[g,p])=>(g&&u.push(p),u),[]);yield D(h)});var he=(r,e=!1,t=!0)=>c(void 0,null,function*(){let{items:i,itemsPerPage:n,paginationActive:o,currentPage:s,emptyState:a}=r,l=[],f=[],m=[];for(let p of i){let{valid:b,currentIndex:S}=p,T=typeof S=="number";if(b){if(l.push(p),!o||!s){m.push(p);continue}l.length>(s-1)*n&&l.length<=s*n?m.push(p):T&&f.push(p)}else T&&f.push(p)}r.validItems=l,r.totalPages=Math.ceil(l.length/n)||1;let h=!l.length;r.emptyState=h;let u=[];m.forEach((p,b)=>{p.currentIndex!==b&&u.push([p,b,m[b-1]])});let g=t&&!e||a!==h;g&&(yield r.displayElement(a?"emptyElement":"list",!1)),yield Promise.all([...Qe(f,r,e),...ze(u,r,e)]),yield r.emitSerial("renderitems",m),yield be(m,r),g&&(yield r.displayElement(h?"emptyElement":"list"))}),Qe=(r,{itemsAnimation:e},t)=>r.map(i=>c(void 0,null,function*(){let{element:n}=i;if(t&&e){let{animateOut:o,options:s}=e;yield o(n,O({remove:!0},s))}else n.remove();i.currentIndex=void 0})),ze=(r,{list:e,itemsAnimation:t},i)=>e?r.map((l,f)=>c(void 0,[l,f],function*([n,o,s],a){n.animating=new Promise(m=>c(void 0,null,function*(){n.rendering=new Promise(h=>c(void 0,null,function*(){yield s==null?void 0:s.rendering;let{element:u,currentIndex:g}=n,p=(s==null?void 0:s.element)||null;if(typeof g!="number"&&i&&t){let{prepareIn:S,animateIn:T,options:X}=t,b=X||{},{stagger:Y}=b,Se=te(b,["stagger"]),Z=O({target:e,insertAfter:p},Se);S(u,Z),ye(u),h(),Y&&(yield F(Y*a)),yield T(u,ee(O({},Z),{prepared:!0}))}else p?e.insertBefore(u,p.nextSibling):e.prepend(u),ye(u),h();m()}))})),yield n.rendering,n.currentIndex=o})):[],ye=r=>{if(!/apple/i.test(navigator.vendor))return;let e=r.querySelectorAll("img");for(let t of e)t.outerHTML=t.outerHTML};var R=class extends we.default{constructor(e,t){super();this.wrapper=e;this.index=t;this.emptyState=!1;this.paginationActive=!1;this.showPaginationQuery=!1;this.restartWebflow=!1;this.restartIx=!1;this.restartCommerce=!1;this.restartLightbox=!1;this.restartSliders=!1;this.restartTabs=!1;let i=d(e,"list");this.list=i,this.paginationWrapper=d(e,"pagination"),this.paginationNext=d(e,"next"),this.paginationPrevious=d(e,"previous"),this.paginationCount=d(e,"pageCount"),this.emptyElement=d(e,"empty");let n=d(e,"items");this.itemsPerPage=this.originalItemsPerPage=n.length,this.totalPages=1,de(this);let o=[];i&&o.push(...n.map((s,a)=>new A(s,i,a))),this.items=o,this.validItems=o,this.originalItemsOrder=[...o]}addItems(e,t="push"){return c(this,null,function*(){let{items:i,list:n,originalItemsOrder:o}=this;if(!n)return;let s=e.map(a=>new A(a,n));for(let a of[i,o])a[t](...s);yield this.emit("shouldnest",s),yield this.emit("shouldcollectprops",s),yield this.emit("shouldsort",s),yield this.emit("shouldfilter"),yield this.renderItems(!0),yield this.emit("additems",s)})}restoreItemsOrder(){this.items=[...this.originalItemsOrder]}clearItems(e){if(e)for(let{element:t}of this.items)t.remove();this.items=[],this.originalItemsOrder=[]}renderItems(e,t){return c(this,null,function*(){return yield this.renderingQueue,new Promise(i=>c(this,null,function*(){let n=he(this,e,t);this.renderingQueue=n,yield n,i()}))})}displayElement(e,t=!0,i=!0){return c(this,null,function*(){let{listAnimation:n}=this,o=this[e];if(!!o)if(n&&i){let{animateIn:s,animateOut:a,options:l}=n;yield(t?s:a)(o,l)}else o.style.display=t?"":"none",o.style.opacity=t?"1":"0"})}switchPage(e,t=!0){return c(this,null,function*(){let{currentPage:i,showPaginationQuery:n}=this;e!==i&&(yield this.emit("switchpage",e),this.currentPage=e,this.scrollToAnchor(),n&&ge(this),t&&(yield this.renderItems()))})}initPagination(e){this.paginationActive=!0,this.showPaginationQuery=!!e}addPaginationButton(e,t,i){let{paginationWrapper:n}=this;!n||this[t]||i<0||(e.style.display="none",n.insertBefore(e,n.children[i]),this[t]=e)}addEmptyElement(e){let{wrapper:t,list:i,emptyElement:n}=this;n||(e.style.display="none",t.insertBefore(e,(i==null?void 0:i.nextSibling)||null),this.emptyElement=e)}addLoader(e){let{loader:t}=this;t||(e.style.display="none",this.loader=e)}addItemsCount(e){if(this.itemsCount)return;this.itemsCount=e;let t=()=>K(e,this.items.length);t(),this.on("additems",t)}addVisibleCount(e){if(this.visibleCount)return;this.visibleCount=e;let t=()=>K(e,Math.min(this.itemsPerPage,this.validItems.length));t(),this.on("renderitems",t)}scrollToAnchor(){let{scrollAnchor:e}=this;!e||window.setTimeout(()=>e.scrollIntoView({behavior:"smooth"}),100)}getAttribute(e){let{wrapper:t,list:i}=this;return t.getAttribute(e)||(i==null?void 0:i.getAttribute(e))}getInstanceIndex(e){let{wrapper:t,list:i}=this;return J(t,e)||(i?J(i,e):void 0)}};var Ue=r=>L(r).map(Ge).filter(V),Ge=r=>{var s,a;let e=d(r,"wrapper");if(!e){P.alert("The element is not a Collection List.","error");return}let{fsAttributes:t}=window;(s=t.cms).listInstances||(s.listInstances=[]),(a=t.cms).listElements||(a.listElements=[...document.querySelectorAll(`.${x.wrapper}`)]);let{listInstances:i,listElements:n}=t.cms,o=n.indexOf(e);if(o!==-1)return i[o]||(i[o]=new R(e,o)),i[o]};export{A as CMSItem,R as CMSList,Ue as createCMSListInstances,Oe as version}; |
{ | ||
"name": "@finsweet/attributes-cmscore", | ||
"version": "1.6.0", | ||
"version": "1.6.1", | ||
"description": "Core functionalities of all cms Attributes.", | ||
@@ -5,0 +5,0 @@ "main": "cmscore.js", |
25394