var _____WB$wombat$assign$function_____=function(name){return (self._wb_wombat && self._wb_wombat.local_init && self._wb_wombat.local_init(name))||self[name];};if(!self.__WB_pmw){self.__WB_pmw=function(obj){this.__WB_source=obj;return this;}}{
let window = _____WB$wombat$assign$function_____("window");
let self = _____WB$wombat$assign$function_____("self");
let document = _____WB$wombat$assign$function_____("document");
let location = _____WB$wombat$assign$function_____("location");
let top = _____WB$wombat$assign$function_____("top");
let parent = _____WB$wombat$assign$function_____("parent");
let frames = _____WB$wombat$assign$function_____("frames");
let opens = _____WB$wombat$assign$function_____("opens");
/*! For license information please see app.js.LICENSE.txt */
!function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t(require("_"));else if("function"==typeof define&&define.amd)define(["_"],t);else{var r="object"==typeof exports?t(require("_")):t(e._);for(var n in r)("object"==typeof exports?exports:e)[n]=r[n]}}("undefined"!=typeof self?self:this,(e=>(()=>{var t,r,n={6957:(e,t,r)=>{const n=r(9479).mapValues,o=r(9479).mapKeys,{Maybe:a}=r(3882),i={AddressInput:{viewerType:["wixui.AddressInput"],sdkType:"$w.AddressInput"},Text:{viewerType:["wysiwyg.viewer.components.WRichText"],sdkType:"$w.Text"},Image:{viewerType:["wysiwyg.viewer.components.WPhoto","wixui.ImageX"],sdkType:"$w.Image"},TextInput:{viewerType:["wysiwyg.viewer.components.inputs.TextInput"],sdkType:"$w.TextInput"},TimePicker:{viewerType:["wixui.TimePicker"],sdkType:"$w.TimePicker"},Button:{viewerType:["wysiwyg.viewer.components.SiteButton"],sdkType:"$w.Button"},IconButton:{viewerType:["wysiwyg.common.components.imagebutton.viewer.ImageButton"],sdkType:"$w.IconButton"},RatingsDisplay:{viewerType:["wixui.RatingsDisplay"],sdkType:"$w.RatingsDisplay"},RatingsInput:{viewerType:["wixui.RatingsInput"],sdkType:"$w.RatingsInput"},VerticalMenu:{viewerType:["wysiwyg.common.components.verticalmenu.viewer.VerticalMenu"],sdkType:"$w.VerticalMenu"},Checkbox:{viewerType:["wysiwyg.viewer.components.inputs.Checkbox"],sdkType:"$w.Checkbox"},Gallery:{viewerType:["wysiwyg.viewer.components.MatrixGallery","wysiwyg.viewer.components.SliderGallery","wysiwyg.viewer.components.SlideShowGallery","wysiwyg.viewer.components.PaginatedGridGallery","wysiwyg.viewer.components.tpapps.TPAWidget"],sdkType:"$w.Gallery"},Dropdown:{viewerType:["wysiwyg.viewer.components.inputs.ComboBoxInput","wixui.Dropdown"],sdkType:"$w.Dropdown"},TextBox:{viewerType:["wysiwyg.viewer.components.inputs.TextAreaInput"],sdkType:"$w.TextBox"},RichTextBox:{viewerType:["wixui.RichTextBox"],sdkType:"$w.RichTextBox"},Table:{viewerType:["wysiwyg.viewer.components.Grid"],sdkType:"$w.Table"},DatePicker:{viewerType:["wysiwyg.viewer.components.inputs.DatePicker"],sdkType:"$w.DatePicker"},RadioButtonGroup:{viewerType:["wysiwyg.viewer.components.inputs.RadioGroup"],sdkType:"$w.RadioButtonGroup"},UploadButton:{viewerType:["wysiwyg.viewer.components.inputs.UploadButton","wixui.FileUploaderNew","wysiwyg.viewer.components.inputs.FileUploader"],sdkType:"$w.UploadButton"},ClassicSection:{viewerType:["wysiwyg.viewer.components.ClassicSection"],sdkType:"$w.Section"},Column:{viewerType:["wysiwyg.viewer.components.Column"],sdkType:"$w.Column"},Video:{viewerType:["wysiwyg.viewer.components.Video"],sdkType:"$w.Video"},VideoPlayer:{viewerType:["wixui.VideoPlayer"],sdkType:"$w.VideoPlayer"},VideoBox:{viewerType:["wysiwyg.viewer.components.MediaPlayer"],sdkType:"$w.VideoBox"},MusicPlayer:{viewerType:["wixui.MusicPlayer"],sdkType:"$w.AudioPlayer"},Repeater:{viewerType:["wysiwyg.viewer.components.Repeater"],sdkType:"$w.Repeater"},Pagination:{viewerType:["wixui.Pagination"],sdkType:"$w.Pagination"},Page:{viewerType:["mobile.core.components.Page"],sdkType:"$w.Page"},Document:{viewerType:["fake-document-type"],sdkType:"$w.Document"},MediaContainer:{viewerType:["wysiwyg.viewer.components.MediaContainer"],sdkType:"$w.Container"},StripColumnsContainer:{viewerType:["wysiwyg.viewer.components.StripColumnsContainer"],sdkType:"$w.ColumnStrip"},ToggleSwitch:{viewerType:["wixui.ToggleSwitch"],sdkType:"$w.Switch"},Slider:{viewerType:["wixui.Slider"],sdkType:"$w.Slider"},RangeSlider:{viewerType:["wixui.RangeSlider"],sdkType:"$w.RangeSlider"},StylableButton:{viewerType:["wixui.StylableButton"],sdkType:"$w.StylableButton"},GoogleMap:{viewerType:["wysiwyg.viewer.components.GoogleMap"],sdkType:"$w.GoogleMap"},CheckboxGroup:{viewerType:["wysiwyg.viewer.components.inputs.CheckboxGroup"],sdkType:"$w.CheckboxGroup"},ProgressBar:{viewerType:["wixui.ProgressBar"],sdkType:"$w.ProgressBar"},VectorImage:{viewerType:["wysiwyg.viewer.components.VectorImage","wysiwyg.viewer.components.svgshape.SvgShape"],sdkType:"$w.VectorImage"},SelectionTags:{viewerType:["wixui.SelectionTagsList"],sdkType:"$w.SelectionTags"},Section:{viewerType:["responsive.components.Section"],sdkType:"$w.Section"},SignatureInput:{viewerType:["wixui.SignatureInput"],sdkType:"$w.SignatureInput"},RefComponent:{viewerType:["wysiwyg.viewer.components.RefComponent"],sdkType:"$w.RefComponent"},RichContent:{viewerType:["wysiwyg.viewer.components.tpapps.TPAWidget"],sdkType:"$w.RichContent"}};e.exports=n(i,(e=>{let{sdkType:t}=e;return t})),e.exports.getSdkTypeByViewerType=e=>a.fromNullable(Object.keys(i).filter((t=>i[t].viewerType.indexOf(e)>=0)).map((e=>i[e].sdkType))[0]),e.exports.getViewerTypeBySdkType=e=>a.fromNullable(Object.keys(i).filter((t=>i[t].sdkType===e)).map((e=>i[e].viewerType[0]))[0]),e.exports.getViewerTypes=Object.keys(i).reduce(((e,t)=>(e.concat(i[t].viewerType),e)),[]),e.exports.viewerTypes=Object.keys(i).map((e=>i[e].viewerType)).reduce(((e,t)=>e.concat(t)),[]).reduce(((e,t)=>(e[t.split(".").reverse()[0]]=t,e)),{}),e.exports.sdkTypes=Object.keys(i).map((e=>i[e].sdkType)),e.exports.isSdkTypeSupported=e=>!!o(i,(e=>{let{sdkType:t}=e;return t}))[e]},5546:e=>{e.exports.CMEditor={dsn:"https://e788f1b6d7b54d3482c54d1e27b95f38@sentry.wixpress.com/165"},e.exports.CMMyAccount={dsn:"https://bd7df26433634b41b7e711922156bff7@sentry.wixpress.com/166"},e.exports.DBSMEditor={dsn:"https://adc03f08d1814b5a835f586aaba9d8ff@sentry.wixpress.com/159"},e.exports.DBSMViewer={dsn:"https://27180ecd50484e4eafe543b40d29866d@sentry.wixpress.com/89"},e.exports.UserErrors={dsn:"https://73a0410004ae41b7b60ca1c4b4684996@sentry.wixpress.com/183"},e.exports.WixData={dsn:"https://9653fbb3e48143d890dba8a09a5a98c6@sentry.wixpress.com/184"},e.exports.DBSMEditorNext={dsn:"https://7d36178c8efe4cfb8804450a183c5453@sentry-next.wixpress.com/299"}},4698:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.actions=void 0,t.actions=[{collectionId:"Stores/Products",name:"tpa/addProductToCart",label:"Connect_Panel_Connect_Link_Dropdown_Options_Actions_Tpa_AddProductToCart",experiment:"spec.wixDataClient.AddToCartActions",supportedInsideRepeater:!0},{collectionId:"Stores/Products",name:"tpa/quicklyViewProduct",label:"Connect_Panel_Connect_Link_Dropdown_Options_Actions_Tpa_QuicklyViewProduct",experiment:"spec.wixDataClient.QuicklyViewProductAction"},{collectionId:"Stores/Variants",name:"tpa/addVariantToCart",label:"Connect_Panel_Connect_Link_Dropdown_Options_Actions_Tpa_AddVariantToCart",experiment:"spec.wixDataClient.AddToCartActions",supportedInsideRepeater:!0},{collectionId:"PaidPlans/Plans",name:"tpa/purchasePricingPlan",label:"Connect_Panel_Connect_Link_Dropdown_Options_Actions_Tpa_PurchasePricingPlan",experiment:"spec.wixDataClient.PurchasePricingPlanAction",supportedInsideRepeater:!0}]},4374:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(o,a){function i(e){try{c(n.next(e))}catch(e){a(e)}}function s(e){try{c(n.throw(e))}catch(e){a(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(i,s)}c((n=n.apply(e,t||[])).next())}))},o=this&&this.__generator||function(e,t){var r,n,o,a,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return a={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(a){return function(s){return function(a){if(r)throw new TypeError("Generator is already executing.");for(;i;)try{if(r=1,n&&(o=2&a[0]?n.return:a[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,a[1])).done)return o;switch(n=0,o&&(a=[2&a[0],o.value]),a[0]){case 0:case 1:o=a;break;case 4:return i.label++,{value:a[1],done:!1};case 5:i.label++,n=a[1],a=[0];continue;case 7:a=i.ops.pop(),i.trys.pop();continue;default:if(!((o=(o=i.trys).length>0&&o[o.length-1])||6!==a[0]&&2!==a[0])){i=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]<o[3])){i.label=a[1];break}if(6===a[0]&&i.label<o[1]){i.label=o[1],o=a;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(a);break}o[2]&&i.ops.pop(),i.trys.pop();continue}a=t.call(e,i)}catch(e){a=[6,e],n=0}finally{r=o=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,s])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.actions=void 0;var a=r(7892);t.actions={"tpa/addVariantToCart":function(e){var t=e.wixSdk,r=e.currentItem;return n(void 0,void 0,void 0,(function(){return o(this,(function(e){switch(e.label){case 0:return[4,t.site.getPublicAPI(a.WIX_STORES)];case 1:return[4,e.sent().cart.addProducts([{productId:r.productId,quantity:1}])];case 2:return e.sent(),[2]}}))}))},"tpa/addProductToCart":function(e){var t=e.wixSdk,r=e.currentItem;return n(void 0,void 0,void 0,(function(){return o(this,(function(e){switch(e.label){case 0:return[4,t.site.getPublicAPI(a.WIX_STORES)];case 1:return[4,e.sent().cart.addProducts([{productId:r._id,quantity:1}])];case 2:return e.sent(),[2]}}))}))},"tpa/quicklyViewProduct":function(e){var t=e.wixSdk,r=e.currentItem;return n(void 0,void 0,void 0,(function(){return o(this,(function(e){switch(e.label){case 0:return[4,t.site.getPublicAPI(a.WIX_STORES)];case 1:return[4,e.sent().product.openQuickView(r._id)];case 2:return e.sent(),[2]}}))}))},"tpa/purchasePricingPlan":function(e){var t=e.wixSdk,r=e.currentItem;return n(void 0,void 0,void 0,(function(){return o(this,(function(e){switch(e.label){case 0:return[4,t["pricing-plans"].checkout.startOnlinePurchase(r._id)];case 1:return e.sent(),[2]}}))}))}}},124:(e,t,r)=>{"use strict";t.O4=t.GU=void 0;var n=r(4374);Object.defineProperty(t,"GU",{enumerable:!0,get:function(){return n.actions}}),r(4698),t.O4="tpa/"},7892:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.getAppDependencies=t.WIX_FILE_SHARE=t.RICH_CONTENT=t.WIX_GROUPS=t.WIX_CHALLENGES=t.WIX_FORMS=t.WIX_FAQ=t.WIX_SITE_SEARCH=t.WIX_MUSIC=t.BANDSINTOWN=t.WIX_PORTFOLIO=t.WIX_PRO_GALLERY=t.WIX_PHOTO_ALBUMS=t.WIX_VIDEO=t.WIX_GET_SUBSCRIBERS=t.INSTAGRAM_FEED=t.DEVIANTART_FEED=t.WIX_CHAT=t.WIX_RESTAURANTS_MENUS=t.WIX_RESTAURANTS_ORDERS=t.WIX_RESERVATIONS=t.NOTIFICATIONS=t.META_SITE=t.MEMBERS=t.MEMBERS_AREA=t.WIX_NEW_STORES=t.WIX_STORES=t.WIX_ECOM=t.PRICING_PLANS=t.WIX_FORUM=t.WIX_BOOKINGS=t.WIX_EVENTS=t.WIX_BLOG=t.WIX_HOTELS=t.DASHBOARD_SALES=t.DASHBOARD_SUGGESTIONS=t.DASHBOARD_SETUP=t.BUSINESS_DASHBOARD=t.WIX_CODE_PLATFORM_VISIBILITY=t.WIX_ACCESSIBILITY_WIZARD=t.WIX_CODE_SITE_MONITORING=t.WIX_CODE_SECRETS_MANAGER=t.WIX_CODE_RELEASE_MANAGER=t.CLOUD_DATA_SCHEMA_NOTIFIER=t.OLD_BLOG=t.SITE_MEMBERS=t.DATA_BINDING=t.WIX_CODE_DUPLEXER=t.WIX_CODE_SITE_EXTENSION=t.WIX_CODE=void 0,t.WIX_CODE="wix-code",t.WIX_CODE_SITE_EXTENSION="CloudSiteExtension",t.WIX_CODE_DUPLEXER="af6d536e-0fc6-428b-a7f9-1d8cd6aa3703",t.DATA_BINDING="dataBinding",t.SITE_MEMBERS="SiteMembers",t.OLD_BLOG="79f391eb-7dfc-4adf-be6e-64434c4838d9",t.CLOUD_DATA_SCHEMA_NOTIFIER="f1fbeff1-05c3-4121-bdb5-75e74b6e9e51",t.WIX_CODE_RELEASE_MANAGER="8c41f3a6-47f7-40be-ad77-02a72cb2ddb3",t.WIX_CODE_SECRETS_MANAGER="4b10fcce-732d-4be3-9d46-801d271acda9",t.WIX_CODE_SITE_MONITORING="675bbcef-18d8-41f5-800e-131ec9e08762",t.WIX_ACCESSIBILITY_WIZARD="9699c03d-5c19-4a7c-a454-e8109a6e43fc",t.WIX_CODE_PLATFORM_VISIBILITY="8048f115-449b-4dab-b0e6-e09d5ffc8199",t.BUSINESS_DASHBOARD="a7597ab5-1ed4-458f-a5c1-5884d5e14281",t.DASHBOARD_SETUP="0750d046-d599-4cfc-9f6b-e9f4af169aa9",t.DASHBOARD_SUGGESTIONS="cead4297-02ee-4c0f-ae07-461f4ba71b3b",t.DASHBOARD_SALES="f95c72b1-84de-48ec-a61b-d96d61315ffe",t.WIX_HOTELS="135aad86-9125-6074-7346-29dc6a3c9bcf",t.WIX_BLOG="14bcded7-0066-7c35-14d7-466cb3f09103",t.WIX_EVENTS="140603ad-af8d-84a5-2c80-a0f60cb47351",t.WIX_BOOKINGS="13d21c63-b5ec-5912-8397-c3a5ddb27a97",t.WIX_FORUM="14724f35-6794-cd1a-0244-25fd138f9242",t.PRICING_PLANS="1522827f-c56c-a5c9-2ac9-00f9e6ae12d3",t.WIX_ECOM="1380b703-ce81-ff05-f115-39571d94dfcd",t.WIX_STORES="1380b703-ce81-ff05-f115-39571d94dfcd",t.WIX_NEW_STORES="215238eb-22a5-4c36-9e7b-e7c08025e04e",t.MEMBERS_AREA="14cc59bc-f0b7-15b8-e1c7-89ce41d0e0c9",t.MEMBERS="14dbefd2-01b4-fb61-32a7-3abd44da4908",t.META_SITE="22bef345-3c5b-4c18-b782-74d4085112ff",t.NOTIFICATIONS="14f25924-5664-31b2-9568-f9c5ed98c9b1",t.WIX_RESERVATIONS="1475ab65-206b-d79a-856d-fa10bdb479ea",t.WIX_RESTAURANTS_ORDERS="13e8d036-5516-6104-b456-c8466db39542",t.WIX_RESTAURANTS_MENUS="13c1402c-27f2-d4ab-7463-ee7c89e07578",t.WIX_CHAT="14517e1a-3ff0-af98-408e-2bd6953c36a2",t.DEVIANTART_FEED="7d297b79-baed-46d7-ac58-4bd68dcb70d0",t.INSTAGRAM_FEED="14635256-b183-1c71-a4d2-f55179b80e8a",t.WIX_GET_SUBSCRIBERS="1375baa8-8eca-5659-ce9d-455b2009250d",t.WIX_VIDEO="14409595-f076-4753-8303-9a86f9f71469",t.WIX_PHOTO_ALBUMS="13ff8629-c1fc-e289-e81f-bc8c8968e9d6",t.WIX_PRO_GALLERY="14271d6f-ba62-d045-549b-ab972ae1f70e",t.WIX_PORTFOLIO="d90652a2-f5a1-4c7c-84c4-d4cdcc41f130",t.BANDSINTOWN="1405ef82-0ee0-65fb-88a1-2f172aa3573c",t.WIX_MUSIC="13bb5d67-1add-e770-a71f-001277e17c57",t.WIX_SITE_SEARCH="1484cb44-49cd-5b39-9681-75188ab429de",t.WIX_FAQ="14c92d28-031e-7910-c9a8-a670011e062d",t.WIX_FORMS="14ce1214-b278-a7e4-1373-00cebd1bef7c",t.WIX_CHALLENGES="2936472a-a1ed-4ae5-9f71-614313a9f4e7",t.WIX_GROUPS="148c2287-c669-d849-d153-463c7486a694",t.RICH_CONTENT="949cfcc9-2a3f-4a96-bd6c-11d9d82763a4",t.WIX_FILE_SHARE="1537b24e-29d1-6d8f-b8e1-d6860f2f70b9";var r={};t.getAppDependencies=function(e){return r[e]||[]}},1802:e=>{"use strict";function t(e){return t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},t(e)}var r="User",n="Error",o="EDM",a=function(e,r){e&&"object"===t(e)&&(e.errorGroup=r)};e.exports={markUserError:function(e){return a(e,r)},isUserError:function(e){return e&&e.errorGroup===r},markAppError:function(e){return a(e,n)},isAppError:function(e){return e&&e.errorGroup===n},markEdmError:function(e){return a(e,o)},isEdmError:function(e){return e&&e.errorGroup===o},markError:a,isMarked:function(e){return!!e&&void 0!==e.errorGroup},USER_ERROR_GROUP:r,APP_ERROR_GROUP:n,EDM_ERROR_GROUP:o,UNKNOWN_ERROR_GROUP:"Unknown"}},1410:(e,t,r)=>{"use strict";function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){return a=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},a(e,t)}function i(e,t){if(t&&("object"===n(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return s(e)}function s(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function c(e){return c=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},c(e)}var l=r(1802),u=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&a(e,t)}(d,e);var t,r,n,u=(r=d,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=c(r);if(n){var o=c(this).constructor;e=Reflect.construct(t,arguments,o)}else e=t.apply(this,arguments);return i(this,e)});function d(){var e;o(this,d);for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return e=u.call.apply(u,[this].concat(r)),Error.captureStackTrace&&Error.captureStackTrace(s(e),e.constructor),e.name=d.name,l.markUserError(s(e)),e}return t=d,Object.defineProperty(t,"prototype",{writable:!1}),t}(function(e){function t(){var t=Reflect.construct(e,Array.from(arguments));return Object.setPrototypeOf(t,Object.getPrototypeOf(this)),t}return t.prototype=Object.create(e.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e,t}(Error));e.exports={UserCodeError:u}},7736:(e,t,r)=>{"use strict";function n(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function o(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?n(Object(r),!0).forEach((function(t){a(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):n(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function a(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var i=r(1802),s=r(1410);e.exports=o(o({},s),i)},3844:(e,t,r)=>{"use strict";t.PL=t.ah=void 0;var n=r(7448);Object.defineProperty(t,"ah",{enumerable:!0,get:function(){return n.convertToCustomFormat}}),Object.defineProperty(t,"PL",{enumerable:!0,get:function(){return n.convertFromCustomFormat}}),r(4230)},5209:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ConvertersComposer=void 0;var n=r(5872),o=function(e){return null!==e&&"object"==typeof e},a=function(){function e(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this._converters=e}return e.prototype.convertToCustomFormat=function(e,t,r){var n;if(void 0===t&&(t=new Set),void 0===r&&(r=!1),o(e)){if(t.has(e))throw new TypeError("Converting circular structure to JSON");t.add(e)}if(Array.isArray(e))return this._convertArray(e,t);var a=null===(n=this._findConverterToCustomFormat(e))||void 0===n?void 0:n.convertToCustomFormat(e,r);return o(e)?this._convertObject(a,e,t):a},e.prototype.convertFromCustomFormat=function(e){var t,r=this,a=e;return Array.isArray(e)?a=e.map((function(e){return r.convertFromCustomFormat(e)})):o(e)&&(a=(0,n.mapValues)(e,this.convertFromCustomFormat.bind(this))),null===(t=this._findConverterFromCustomFormat(a))||void 0===t?void 0:t.convertFromCustomFormat(a)},e.prototype._convertObject=function(e,t,r){var o,a=this;return o="function"==typeof e.toJSON?(0,n.mapValues)(e.toJSON(),(function(e){return a.convertToCustomFormat(e,r)})):(0,n.mapValues)(e,(function(e){return a.convertToCustomFormat(e,r)})),r.delete(t),o},e.prototype._convertArray=function(e,t){var r=this,n=e.map((function(e){return r.convertToCustomFormat(e,t,!0)}));return t.delete(e),n},e.prototype._findConverterFromCustomFormat=function(e){return this._converters.find((function(t){return t.canConvertFromCustomFormat(e)}))},e.prototype._findConverterToCustomFormat=function(e){return this._converters.find((function(t){return t.canConvertToCustomFormat(e)}))},e}();t.ConvertersComposer=a},4273:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DateConverter=void 0;var r=function(){function e(){}return e.prototype.canConvertToCustomFormat=function(e){return e instanceof Date},e.prototype.convertToCustomFormat=function(e){return{$date:e.toISOString()}},e.prototype.canConvertFromCustomFormat=function(e){return this._isObjectWith$Date(e)&&"string"==typeof e.$date&&(t=e.$date,!Number.isNaN(Date.parse(t)));var t},e.prototype.convertFromCustomFormat=function(e){return new Date(e.$date)},e.prototype._isObjectWith$Date=function(e){return!!e&&"object"==typeof e&&"$date"in e},e}();t.DateConverter=r},1799:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DefaultConverter=void 0;var r=function(){function e(){}return e.prototype.canConvertToCustomFormat=function(){return!0},e.prototype.convertToCustomFormat=function(e,t){return t&&void 0===e?null:e},e.prototype.canConvertFromCustomFormat=function(){return!0},e.prototype.convertFromCustomFormat=function(e){return e},e}();t.DefaultConverter=r},7448:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.convertFromCustomFormat=t.convertToCustomFormat=void 0;var n=r(5209),o=r(4273),a=r(1799),i=new n.ConvertersComposer(new o.DateConverter,new a.DefaultConverter);t.convertToCustomFormat=function(e){return i.convertToCustomFormat(e)},t.convertFromCustomFormat=function(e){return i.convertFromCustomFormat(e)}},5872:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.mapValues=void 0,t.mapValues=function(e,t){var r={};return Object.keys(e).forEach((function(n){var o=t(e[n]);void 0!==o&&(r[n]=o)})),r}},4230:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.generateBackendPackageWebMethodUrl=t.generatePackageWebMethodUrl=t.exceptionToWebMethodPayload=t.resultToWebMethodPayload=void 0;var n=r(7448);t.resultToWebMethodPayload=function(e,t){var r=t?JSON.parse(JSON.stringify(e,t)):(0,n.convertToCustomFormat)(e);return void 0===r?{}:{result:r}},t.exceptionToWebMethodPayload=function(e,t,r){return void 0===t&&(t=function(e){return e}),void 0===r&&(r=function(e){return""}),{result:e instanceof Error?{message:t(e.message),name:e.name,stack:r(e.stack),code:e.code,_elementoryError:!0}:e,exception:!0}};var o=function(e,t){return"/_webMethods/packages/".concat(encodeURIComponent(e),"/").concat(t,".ajax")};t.generatePackageWebMethodUrl=o,t.generateBackendPackageWebMethodUrl=function(e,t){return o("".concat(e,"-backend"),t)}},7077:e=>{"use strict";e.exports={ERROR:1,UNHANDLED_REJECTION:2,DATASET_FAILED_TO_LOAD:3,CONNECTION_CONFIG_FAILED_TO_LOAD:4,FILTER_PANEL_FAILED_TO_LOAD:5,SORT_PANEL_FAILED_TO_LOAD:6,ADD_COLUMN_PANEL_FAILED_TO_LOAD:7,CHANGE_COLLECTION_PANEL_FAILED_TO_LOAD:8,CREATE_DATASET_PANEL_FAILED_TO_LOAD:9,NEW_DYNAMIC_PAGE_PANEL_FAILED_TO_LOAD:10,DELETE_DYNAMIC_PAGE_PANEL_FAILED_TO_LOAD:11,DYNAMIC_PAGE_INFO_PANEL_FAILED_TO_LOAD:12,DYNAMIC_PAGE_SEO_PANEL_FAILED_TO_LOAD:13,DYNAMIC_PAGES_HOOKS_PANEL_FAILED_TO_LOAD:14,ERROR_PANEL_FAILED_TO_LOAD:15,ADD_PRESET_PANEL_FAILED_TO_LOAD:16,ADD_FIELD_PANEL_FAILED_TO_LOAD:17,NEW_DYNAMIC_PAGE_PANEL_V3_FAILED_TO_LOAD:18,CREATE_COLLECTION_PANEL_FAILED_TO_LOAD:19,CONNECT_PAGE_FAILED_TO_LOAD:21,DELETE_PAGE_FAILED_TO_LOAD:22,NEW_PAGE_FAILED_TO_LOAD:23,PAGE_INFO_FAILED_TO_LOAD:24,PAGE_SEO_FAILED_TO_LOAD:25,UPDATE_PREFIX_FAILED_TO_LOAD:26,WEB_MODULES_PERMISSONS_FAILED_TO_LOAD:27,DELETE_ROUTERS_JS_FAILED_TO_LOAD:28,NPM_MODULES_MANAGEMENT_PANEL_FAILED_TO_LOAD:79,REMOVE_NPM_PACKAGE_PANEL_FAILED_TO_LOAD:79}},6167:e=>{"use strict";e.exports.Z3="platform",e.exports._W="platform-viewer",e.exports.rH="trg",e.exports.Jg=79},2472:(e,t,r)=>{"use strict";const n=r(9479).isPlainObject,o=r(4095);e.exports.X=e=>n(e)&&"currentUser"===e[o]},1212:(e,t,r)=>{"use strict";const n=r(9479).isPlainObject,{DATA_BINDING:o}=r(7892),a=r(4095),i=o;e.exports.X=e=>n(e)&&e[a]===i},4095:e=>{"use strict";e.exports="@resolver"},3728:(e,t,r)=>{"use strict";const n=r(9479).isPlainObject,o=r(4095);e.exports.X=e=>n(e)&&"userInput"===e[o]},476:e=>{"use strict";e.exports=(e,t)=>t.reduce(((e,t)=>e.chain((e=>t.map((t=>Array.isArray(t)?e.concat([t]):e.concat(t)))))),e.of([]))},6951:e=>{"use strict";const t="unknown",r=e=>{const t=e.split("/"),r=t[t.length-3],n=t[t.length-2];if(!/^\d+\.\d+\.\d+$/.test(n))throw Error("Invalid version string ".concat(n));return{appName:r,version:n}};e.exports=e=>{try{const{appName:t,version:n}=r(e);return"".concat(t,"@").concat(n)}catch(e){return t}},e.exports.getAppVersion=e=>{try{const{version:t}=r(e);return t}catch(e){return t}},e.exports.UNKNOWN_VERSION=t},6918:e=>{"use strict";e.exports={maxUrlLength:1e3}},4970:(e,t,r)=>{"use strict";const n=r(9479).identity,{Result:o}=r(3882),a=r(6830),{isLocalhost:i}=r(102),s=e=>o.try(e).getOrElse("unknown"),c=e=>o.try(e).fold((e=>e.message),(e=>e)),l=e=>({referrer:c((()=>e["wix-window"].referrer)),workerUrl:c((()=>e.location.href))}),u=e=>({renderMode:s((()=>e["wix-window"].rendering.env)),viewMode:s((()=>e["wix-window"].viewMode)),santaVersion:s((()=>(e=>{const t=e.match(/santa\/([^/]*)/);return t?t[1]:"unknown"})(e.location.href)))});e.exports.S=e=>{let{Raven:t,globalScope:r,dsn:o,params:c={},appName:d}=e;i()||(a({Raven:t,appName:d,browserUrlGetter:()=>s((()=>r["wix-location"].url)),dsn:o,params:c}),t.setDataCallback((function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:n;return e.extra=Object.assign(e.extra||{},l(r)),e.tags=Object.assign(e.tags||{},c.tags||{},u(r)),t(e)})))}},6830:(e,t,r)=>{"use strict";const n=r(9479).identity,o=r(6918),a=r(6951),{getAppUrl:i}=r(102),s=r(2170);e.exports=e=>{let{Raven:t,appName:r,browserUrlGetter:c,dsn:l,params:u}=e;const d=i(r),p=a(d);return t.config(l,Object.assign({},o,{captureUnhandledRejections:!1,autoBreadcrumbs:{dom:!1}})),t.setRelease(u.release||p),t.setShouldSendCallback(u.shouldSendCallback||s),t.setDataCallback((function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:n;return e.request=Object.assign(e.request||{},{url:c()}),t(e)})),()=>{t.setDataCallback(n)}}},2170:(e,t,r)=>{"use strict";const{extract:n,parse:o}=r(9102),a=r(9479).get,i=r(9479).includes,s=r(9479).identity,{Result:c,Maybe:l}=r(3882),u=["ReactSource","EditorSource","experiments","petri_ovr","WixCodeRuntimeSource","js-wixcode-sdk-override","debug"],d=e=>l.fromNullable(e).chain((e=>c.try((()=>o(n(e)))))).map((e=>(e=>"true"===e.forceReportSentry)(e)||(e=>Object.keys(e).every((e=>!i(u,e))))(e))).getOrElse(!0),p=[e=>(e=>[a(e,["request","headers","Referer"]),a(e,["request","url"])])(e).every(d)];e.exports=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:s;return p.concat(t).every((t=>t(e)))}},7788:(e,t,r)=>{"use strict";r(9479).last,r(9479).head,r(9479).includes,e.exports.De="."},845:e=>{e.exports.l={COMPONENT:"COMPONENT_SCOPE",GLOBAL:"GLOBAL_SCOPE"}},102:e=>{const t=()=>{const e=new Error;return e.stack?e.stack.toString():""};e.exports.getAppUrl=e=>{const r=t().match(new RegExp("https?://.*?".concat(e,".*?.js")));return r?r[0]:""},e.exports.isLocalhost=()=>/https?:\/\/localhost/.test(t())},3882:(e,t,r)=>{const n=r(1423),o=r(7139),a=r(7444);e.exports={union:n,Result:o,Maybe:a}},7444:e=>{"use strict";const t=e=>({map:r=>t(r(e)),chain:t=>t(e),fold:(t,r)=>r(e),getOrElse:()=>e,orElse:()=>t(e),filter:n=>n(e)?t(e):r()}),r=()=>({map:()=>r(),chain:()=>r(),fold:e=>e(),getOrElse:e=>e,orElse:e=>e(),filter:()=>r()}),n={Just:t,Nothing:r,fromNullable:e=>null!=e?t(e):r(),of:e=>t(e)};e.exports=n},7139:e=>{"use strict";const t=e=>({map:r=>t(r(e)),chain:t=>t(e),fold:(t,r)=>r(e),getOrElse:()=>e,merge:()=>e}),r=e=>({map:()=>r(e),chain:()=>r(e),fold:t=>t(e),getOrElse:e=>e,merge:()=>e}),n={Ok:t,Error:r,try:e=>{try{return t(e())}catch(e){return r(e)}},fromNullable:(e,n)=>null!=e?t(e):r(n),fromMaybe:(e,n)=>e.fold((()=>r(n)),(e=>t(e))),of:e=>t(e)};e.exports=n},1423:e=>{const t=Symbol.for("union-type-any-symbol"),r=e=>r=>{const n=Object.keys(r);for(const t of n)if(t===e.name)return r[t](e.payload);if(r[t])return r[t]();throw new Error('Variant "'.concat(e.name,'" not covered in pattern with keys [').concat(n,"].\nThis could mean you did not include all variants in your Union's matchWith function."))},n=(e,t,n,o)=>{const a=Symbol("[".concat(e,":").concat(t,"]")),i=function(){const e=n(...arguments),i={matchWith:r({name:t,payload:e}),toString:()=>t,[a]:!0};return Object.keys(o).forEach((e=>{i[e]=o[e](i)})),i};return i.hasInstance=e=>e&&!0===e[a],i},o=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return Object.keys(t).reduce(((o,a)=>(o[a]=n(e,a,t[a],r),o)),{})};o.any=t,e.exports=o},1142:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DefaultMaxPageSize=void 0;const n=r(4465);t.DefaultMaxPageSize={[n.PagingMode.Offset]:1e3,[n.PagingMode.Cursor]:100}},3864:(e,t)=>{"use strict";var r,n;Object.defineProperty(t,"__esModule",{value:!0}),t.AllowedFilterOperator=t.FieldType=void 0,(n=t.FieldType||(t.FieldType={})).number="number",n.text="text",n.image="image",n.boolean="boolean",n.document="document",n.url="url",n.richText="richtext",n.date="date",n.dateTime="datetime",n.video="video",n.reference="reference",n.multiReference="multi-reference",n.pageLink="pagelink",n.object="object",n.mediaGallery="media-gallery",n.address="address",n.stringArray="array<string>",n.color="color",n.audio="audio",n.time="time",n.array="array",n.richContent="rich-content",n.language="language",n.documentArray="array<document>",n.any="any",(r=t.AllowedFilterOperator||(t.AllowedFilterOperator={})).eq="eq",r.ne="ne",r.lt="lt",r.lte="lte",r.gt="gt",r.gte="gte",r.hasSome="hasSome",r.hasAll="hasAll",r.contains="contains",r.startsWith="startsWith",r.endsWith="endsWith",r.urlized="urlized"},9666:(e,t)=>{"use strict";var r;Object.defineProperty(t,"__esModule",{value:!0}),t.Operator=void 0,(r=t.Operator||(t.Operator={})).and="$and",r.or="$or",r.not="$not",r.eq="$eq",r.ne="$ne",r.lt="$lt",r.lte="$lte",r.gt="$gt",r.gte="$gte",r.hasSome="$hasSome",r.hasAll="$hasAll",r.contains="$contains",r.startsWith="$startsWith",r.endsWith="$endsWith",r.urlized="$urlized"},1460:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),o=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||t.hasOwnProperty(r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),o(r(3943),t),o(r(9666),t),o(r(3864),t),o(r(6839),t),o(r(4465),t),o(r(1142),t)},3943:(e,t)=>{"use strict";var r;Object.defineProperty(t,"__esModule",{value:!0}),t.Direction=void 0,(r=t.Direction||(t.Direction={})).asc="asc",r.desc="desc"},4465:(e,t)=>{"use strict";var r;Object.defineProperty(t,"__esModule",{value:!0}),t.PagingMode=void 0,(r=t.PagingMode||(t.PagingMode={})).Offset="OFFSET",r.Cursor="CURSOR"},6839:(e,t)=>{"use strict";var r,n,o;Object.defineProperty(t,"__esModule",{value:!0}),t.Storage=t.PermissionRole=t.DataOperation=void 0,(o=t.DataOperation||(t.DataOperation={})).aggregate="aggregate",o.bulkInsert="bulkInsert",o.bulkRemove="bulkRemove",o.bulkSave="bulkSave",o.bulkUpdate="bulkUpdate",o.count="count",o.distinct="distinct",o.find="find",o.get="get",o.insert="insert",o.insertReference="insertReference",o.isReferenced="isReferenced",o.queryReferenced="queryReferenced",o.remove="remove",o.removeReference="removeReference",o.replaceReferences="replaceReferences",o.save="save",o.truncate="truncate",o.update="update",(n=t.PermissionRole||(t.PermissionRole={})).anyone="anyone",n.siteMember="siteMember",n.siteMemberAuthor="siteMemberAuthor",n.admin="admin",(r=t.Storage||(t.Storage={})).driver="driver",r.docstore="docstore",r.app="app",r.expernal="external",r.dynamicApplication="dynamicApplication",r.staticAppSchema="staticAppSchema"},711:e=>{var t=Object.prototype.toString;e.exports=function(e){var r=typeof e;return"undefined"===r?"undefined":null===e?"null":!0===e||!1===e||e instanceof Boolean?"boolean":"string"===r||e instanceof String?"string":"number"===r||e instanceof Number?"number":"function"===r||e instanceof Function?void 0!==e.constructor.name&&"Generator"===e.constructor.name.slice(0,9)?"generatorfunction":"function":void 0!==Array.isArray&&Array.isArray(e)?"array":e instanceof RegExp?"regexp":e instanceof Date?"date":"[object RegExp]"===(r=t.call(e))?"regexp":"[object Date]"===r?"date":"[object Arguments]"===r?"arguments":"[object Error]"===r?"error":"[object Promise]"===r?"promise":function(e){return e.constructor&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)}(e)?"buffer":"[object Set]"===r?"set":"[object WeakSet]"===r?"weakset":"[object Map]"===r?"map":"[object WeakMap]"===r?"weakmap":"[object Symbol]"===r?"symbol":"[object Map Iterator]"===r?"mapiterator":"[object Set Iterator]"===r?"setiterator":"[object String Iterator]"===r?"stringiterator":"[object Array Iterator]"===r?"arrayiterator":"[object Int8Array]"===r?"int8array":"[object Uint8Array]"===r?"uint8array":"[object Uint8ClampedArray]"===r?"uint8clampedarray":"[object Int16Array]"===r?"int16array":"[object Uint16Array]"===r?"uint16array":"[object Int32Array]"===r?"int32array":"[object Uint32Array]"===r?"uint32array":"[object Float32Array]"===r?"float32array":"[object Float64Array]"===r?"float64array":"object"}},2820:e=>{"use strict";var t="%[a-f0-9]{2}",r=new RegExp(t,"gi"),n=new RegExp("("+t+")+","gi");function o(e,t){try{return decodeURIComponent(e.join(""))}catch(e){}if(1===e.length)return e;t=t||1;var r=e.slice(0,t),n=e.slice(t);return Array.prototype.concat.call([],o(r),o(n))}function a(e){try{return decodeURIComponent(e)}catch(a){for(var t=e.match(r),n=1;n<t.length;n++)t=(e=o(t,n).join("")).match(r);return e}}e.exports=function(e){if("string"!=typeof e)throw new TypeError("Expected `encodedURI` to be of type `string`, got `"+typeof e+"`");try{return e=e.replace(/\+/g," "),decodeURIComponent(e)}catch(t){return function(e){for(var t={"%FE%FF":"��","%FF%FE":"��"},r=n.exec(e);r;){try{t[r[0]]=decodeURIComponent(r[0])}catch(e){var o=a(r[0]);o!==r[0]&&(t[r[0]]=o)}r=n.exec(e)}t["%C2"]="�";for(var i=Object.keys(t),s=0;s<i.length;s++){var c=i[s];e=e.replace(new RegExp(c,"g"),t[c])}return e}(e)}}},3896:e=>{"use strict";var t=Object.getOwnPropertySymbols,r=Object.prototype.hasOwnProperty,n=Object.prototype.propertyIsEnumerable;function o(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}e.exports=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},r=0;r<10;r++)t["_"+String.fromCharCode(r)]=r;if("0123456789"!==Object.getOwnPropertyNames(t).map((function(e){return t[e]})).join(""))return!1;var n={};return"abcdefghijklmnopqrst".split("").forEach((function(e){n[e]=e})),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},n)).join("")}catch(e){return!1}}()?Object.assign:function(e,a){for(var i,s,c=o(e),l=1;l<arguments.length;l++){for(var u in i=Object(arguments[l]))r.call(i,u)&&(c[u]=i[u]);if(t){s=t(i);for(var d=0;d<s.length;d++)n.call(i,s[d])&&(c[s[d]]=i[s[d]])}}return c}},9102:(e,t,r)=>{"use strict";var n=r(3410),o=r(3896),a=r(2820);function i(e,t){return t.encode?t.strict?n(e):encodeURIComponent(e):e}function s(e){return Array.isArray(e)?e.sort():"object"==typeof e?s(Object.keys(e)).sort((function(e,t){return Number(e)-Number(t)})).map((function(t){return e[t]})):e}function c(e){var t=e.indexOf("?");return-1===t?"":e.slice(t+1)}function l(e,t){var r=function(e){var t;switch(e.arrayFormat){case"index":return function(e,r,n){t=/\[(\d*)\]$/.exec(e),e=e.replace(/\[\d*\]$/,""),t?(void 0===n[e]&&(n[e]={}),n[e][t[1]]=r):n[e]=r};case"bracket":return function(e,r,n){t=/(\[\])$/.exec(e),e=e.replace(/\[\]$/,""),t?void 0!==n[e]?n[e]=[].concat(n[e],r):n[e]=[r]:n[e]=r};default:return function(e,t,r){void 0!==r[e]?r[e]=[].concat(r[e],t):r[e]=t}}}(t=o({arrayFormat:"none"},t)),n=Object.create(null);return"string"!=typeof e?n:(e=e.trim().replace(/^[?#&]/,""))?(e.split("&").forEach((function(e){var t=e.replace(/\+/g," ").split("="),o=t.shift(),i=t.length>0?t.join("="):void 0;i=void 0===i?null:a(i),r(a(o),i,n)})),Object.keys(n).sort().reduce((function(e,t){var r=n[t];return Boolean(r)&&"object"==typeof r&&!Array.isArray(r)?e[t]=s(r):e[t]=r,e}),Object.create(null))):n}t.extract=c,t.parse=l,t.stringify=function(e,t){!1===(t=o({encode:!0,strict:!0,arrayFormat:"none"},t)).sort&&(t.sort=function(){});var r=function(e){switch(e.arrayFormat){case"index":return function(t,r,n){return null===r?[i(t,e),"[",n,"]"].join(""):[i(t,e),"[",i(n,e),"]=",i(r,e)].join("")};case"bracket":return function(t,r){return null===r?i(t,e):[i(t,e),"[]=",i(r,e)].join("")};default:return function(t,r){return null===r?i(t,e):[i(t,e),"=",i(r,e)].join("")}}}(t);return e?Object.keys(e).sort(t.sort).map((function(n){var o=e[n];if(void 0===o)return"";if(null===o)return i(n,t);if(Array.isArray(o)){var a=[];return o.slice().forEach((function(e){void 0!==e&&a.push(r(n,e,a.length))})),a.join("&")}return i(n,t)+"="+i(o,t)})).filter((function(e){return e.length>0})).join("&"):""},t.parseUrl=function(e,t){return{url:e.split("?")[0]||"",query:l(c(e),t)}}},8745:(e,t)=>{"use strict";var r=Object.prototype.hasOwnProperty;function n(e){try{return decodeURIComponent(e.replace(/\+/g," "))}catch(e){return null}}function o(e){try{return encodeURIComponent(e)}catch(e){return null}}t.stringify=function(e,t){t=t||"";var n,a,i=[];for(a in"string"!=typeof t&&(t="?"),e)if(r.call(e,a)){if((n=e[a])||null!=n&&!isNaN(n)||(n=""),a=o(a),n=o(n),null===a||null===n)continue;i.push(a+"="+n)}return i.length?t+i.join("&"):""},t.parse=function(e){for(var t,r=/([^=?#&]+)=?([^&]*)/g,o={};t=r.exec(e);){var a=n(t[1]),i=n(t[2]);null===a||null===i||a in o||(o[a]=i)}return o}},8152:e=>{"use strict";var t=function(e){return null!=e&&"function"==typeof e.run&&"boolean"==typeof e.isQueued&&(!e.resultActionCreator||"function"==typeof e.resultActionCreator)};e.exports={isEffect:t,isImmediateEffect:function(e){return t(e)&&!e.isQueued},isQueuedEffect:function(e){return t(e)&&e.isQueued}}},729:(e,t,r)=>{"use strict";var n=r(5330);e.exports={createMiddleware:n}},5330:(e,t,r)=>{"use strict";var n=r(2067).isPromise,o=r(24),a=o.sequence,i=o.try_,s=r(7081),c=r(8152),l=c.isEffect,u=c.isImmediateEffect,d=c.isQueuedEffect,p=function(e){return function(t){return e.push(t),function(){var r=e.indexOf(t);r>=0&&e.splice(r,1)}}};e.exports=function(){var e=[],t=[],r=Promise.resolve();return{middleware:function(o){return function(c){return function(p){var f=function(e){var t=i((function(){return e.run()}));return t.fold((function(r){var n=e.resultActionCreator?o.dispatch(e.resultActionCreator(!0,r)):Promise.resolve();return[t,n]}),(function(r){if(n(r)){var a=r.then((function(t){return e.resultActionCreator?o.dispatch(e.resultActionCreator(!1,t)):Promise.resolve()}),(function(t){throw e.resultActionCreator&&o.dispatch(e.resultActionCreator(!0,t)).catch((function(){})),t}));return[t,a]}var i=e.resultActionCreator?o.dispatch(e.resultActionCreator(!1,r)):Promise.resolve();return[t,i]}))},h=o.getState(),g=c(p),m=o.getState();if(h!==m){var y=s(h,m);return a(e.slice().map((function(e){return i((function(){return e(y)||[]}))}))).fold((function(e){throw e}),(function(e){return function(e){var n=function(){var e=void 0,n=new Promise((function(t){return e=t})),o=new Promise((function(e,o){var a=r=r.then((function(){return n})).then(function(e,t){return function(r){if(r.length>0){var n=r.filter(d).map(f);return Promise.all(n.map((function(e){return e[1]}))).then((function(){return e()}),t),Promise.all(n.map((function(e){return e[0]})).map((function(e){return e.fold((function(e){return Promise.reject(e)}),(function(e){return e}))}))).catch(t)}return e(),Promise.resolve()}}(e,o),o).catch(o).then((function(){a===r&&t.slice().forEach((function(e){return e()}))}))}));return{promise:o,trigger:e}}(),o=n.promise,a=n.trigger;return i((function(){return function(e){var t=e.filter(u).map(f);return t.map((function(e){return e[0]})).map((function(e){return e.fold((function(e){throw e}),(function(e){return e}))})),t.map((function(e){return e[1]})).map((function(e){return e.catch((function(){}))})),e.filter(d)}(e)})).fold((function(e){throw a([]),e}),(function(e){return a(e),o}))}(e.filter(l))}))}return Promise.resolve(g)}}},subscribe:p(e),onIdle:p(t)}}},24:e=>{"use strict";var t=function(){},r=function(e,r){return e.fold(r.Error||t,r.Ok||t)},n=function(e){return{map:function(e){return this},fold:function(t,r){return t(e)},chain:function(e){return this},match:function(e){return r(this,e)},value:e}},o=function e(t){return{map:function(r){return e(r(t))},fold:function(e,r){return r(t)},chain:function(e){return e(t)},match:function(e){return r(this,e)},value:t}},a={Left:n,Right:o};e.exports={Either:a,sequence:function(e){return e.reduce((function(e,t){return e.chain((function(e){return t.map((function(t){return e.concat(t)}))}))}),o([]))},try_:function(e){try{return o(e())}catch(e){return n(e)}}}},2067:e=>{"use strict";e.exports.isPromise=function(e){return null!=e&&"function"==typeof e.then}},7081:e=>{"use strict";e.exports=function(e,t){var r={from:e,to:t,hasChanged:function(r){return r(e)!==r(t)},hasChangedToMatch:function(e,n){return r.hasChanged(e)&&n(e(t))},hasChangedToTrue:function(e){return r.hasChangedToMatch(e,(function(e){return!0===e}))},hasChangedToFalse:function(e){return r.hasChangedToMatch(e,(function(e){return!1===e}))},hasChangedToNull:function(e){return r.hasChangedToMatch(e,(function(e){return null===e}))},hasChangedToNotNull:function(e){return r.hasChangedToMatch(e,(function(e){return null!==e}))}};return r}},9711:e=>{"use strict";e.exports=function(e,t){if(t=t.split(":")[0],!(e=+e))return!1;switch(t){case"http":case"ws":return 80!==e;case"https":case"wss":return 443!==e;case"ftp":return 21!==e;case"gopher":return 70!==e;case"file":return!1}return 0!==e}},4312:e=>{var t=Object.prototype.hasOwnProperty;function r(e){return"[Throws: "+(e?e.message:"?")+"]"}function n(e){var n=[];return function e(o){if(null===o||"object"!=typeof o)return o;if(-1!==n.indexOf(o))return"[Circular]";if(n.push(o),"function"==typeof o.toJSON)try{var a=e(o.toJSON());return n.pop(),a}catch(e){return r(e)}if(Array.isArray(o)){var i=o.map(e);return n.pop(),i}var s=Object.keys(o).reduce((function(n,a){return n[a]=e(function(e,n){if(t.call(e,n))try{return e[n]}catch(e){return r(e)}return e[n]}(o,a)),n}),{});return n.pop(),s}(e)}e.exports=function(e,t,r){return JSON.stringify(n(e),t,r)},e.exports.ensureProperties=n},3410:e=>{"use strict";e.exports=function(e){return encodeURIComponent(e).replace(/[!'()*]/g,(function(e){return"%"+e.charCodeAt(0).toString(16).toUpperCase()}))}},3424:(e,t,r)=>{"use strict";r.d(t,{Z:()=>n}),e=r.hmd(e);const n=function(e){var t,r=e.Symbol;return"function"==typeof r?r.observable?t=r.observable:(t=r("observable"),r.observable=t):t="@@observable",t}("undefined"!=typeof self?self:"undefined"!=typeof window?window:void 0!==r.g?r.g:e)},2988:(e,t,r)=>{"use strict";var n=r(9711),o=r(8745),a=/^[\x00-\x20\u00a0\u1680\u2000-\u200a\u2028\u2029\u202f\u205f\u3000\ufeff]+/,i=/[\n\r\t]/g,s=/^[A-Za-z][A-Za-z0-9+-.]*:\/\//,c=/:\d+$/,l=/^([a-z][a-z0-9.+-]*:)?(\/\/)?([\\/]+)?([\S\s]*)/i,u=/^[a-zA-Z]:/;function d(e){return(e||"").toString().replace(a,"")}var p=[["#","hash"],["?","query"],function(e,t){return g(t.protocol)?e.replace(/\\/g,"/"):e},["/","pathname"],["@","auth",1],[NaN,"host",void 0,1,1],[/:(\d*)$/,"port",void 0,1],[NaN,"hostname",void 0,1,1]],f={hash:1,query:1};function h(e){var t,n=("undefined"!=typeof window?window:void 0!==r.g?r.g:"undefined"!=typeof self?self:{}).location||{},o={},a=typeof(e=e||n);if("blob:"===e.protocol)o=new y(unescape(e.pathname),{});else if("string"===a)for(t in o=new y(e,{}),f)delete o[t];else if("object"===a){for(t in e)t in f||(o[t]=e[t]);void 0===o.slashes&&(o.slashes=s.test(e.href))}return o}function g(e){return"file:"===e||"ftp:"===e||"http:"===e||"https:"===e||"ws:"===e||"wss:"===e}function m(e,t){e=(e=d(e)).replace(i,""),t=t||{};var r,n=l.exec(e),o=n[1]?n[1].toLowerCase():"",a=!!n[2],s=!!n[3],c=0;return a?s?(r=n[2]+n[3]+n[4],c=n[2].length+n[3].length):(r=n[2]+n[4],c=n[2].length):s?(r=n[3]+n[4],c=n[3].length):r=n[4],"file:"===o?c>=2&&(r=r.slice(2)):g(o)?r=n[4]:o?a&&(r=r.slice(2)):c>=2&&g(t.protocol)&&(r=n[4]),{protocol:o,slashes:a||g(o),slashesCount:c,rest:r}}function y(e,t,r){if(e=(e=d(e)).replace(i,""),!(this instanceof y))return new y(e,t,r);var a,s,c,l,f,v,w=p.slice(),b=typeof t,O=this,I=0;for("object"!==b&&"string"!==b&&(r=t,t=null),r&&"function"!=typeof r&&(r=o.parse),a=!(s=m(e||"",t=h(t))).protocol&&!s.slashes,O.slashes=s.slashes||a&&t.slashes,O.protocol=s.protocol||t.protocol||"",e=s.rest,("file:"===s.protocol&&(2!==s.slashesCount||u.test(e))||!s.slashes&&(s.protocol||s.slashesCount<2||!g(O.protocol)))&&(w[3]=[/(.*)/,"pathname"]);I<w.length;I++)"function"!=typeof(l=w[I])?(c=l[0],v=l[1],c!=c?O[v]=e:"string"==typeof c?~(f="@"===c?e.lastIndexOf(c):e.indexOf(c))&&("number"==typeof l[2]?(O[v]=e.slice(0,f),e=e.slice(f+l[2])):(O[v]=e.slice(f),e=e.slice(0,f))):(f=c.exec(e))&&(O[v]=f[1],e=e.slice(0,f.index)),O[v]=O[v]||a&&l[3]&&t[v]||"",l[4]&&(O[v]=O[v].toLowerCase())):e=l(e,O);r&&(O.query=r(O.query)),a&&t.slashes&&"/"!==O.pathname.charAt(0)&&(""!==O.pathname||""!==t.pathname)&&(O.pathname=function(e,t){if(""===e)return t;for(var r=(t||"/").split("/").slice(0,-1).concat(e.split("/")),n=r.length,o=r[n-1],a=!1,i=0;n--;)"."===r[n]?r.splice(n,1):".."===r[n]?(r.splice(n,1),i++):i&&(0===n&&(a=!0),r.splice(n,1),i--);return a&&r.unshift(""),"."!==o&&".."!==o||r.push(""),r.join("/")}(O.pathname,t.pathname)),"/"!==O.pathname.charAt(0)&&g(O.protocol)&&(O.pathname="/"+O.pathname),n(O.port,O.protocol)||(O.host=O.hostname,O.port=""),O.username=O.password="",O.auth&&(~(f=O.auth.indexOf(":"))?(O.username=O.auth.slice(0,f),O.username=encodeURIComponent(decodeURIComponent(O.username)),O.password=O.auth.slice(f+1),O.password=encodeURIComponent(decodeURIComponent(O.password))):O.username=encodeURIComponent(decodeURIComponent(O.auth)),O.auth=O.password?O.username+":"+O.password:O.username),O.origin="file:"!==O.protocol&&g(O.protocol)&&O.host?O.protocol+"//"+O.host:"null",O.href=O.toString()}y.prototype={set:function(e,t,r){var a=this;switch(e){case"query":"string"==typeof t&&t.length&&(t=(r||o.parse)(t)),a[e]=t;break;case"port":a[e]=t,n(t,a.protocol)?t&&(a.host=a.hostname+":"+t):(a.host=a.hostname,a[e]="");break;case"hostname":a[e]=t,a.port&&(t+=":"+a.port),a.host=t;break;case"host":a[e]=t,c.test(t)?(t=t.split(":"),a.port=t.pop(),a.hostname=t.join(":")):(a.hostname=t,a.port="");break;case"protocol":a.protocol=t.toLowerCase(),a.slashes=!r;break;case"pathname":case"hash":if(t){var i="pathname"===e?"/":"#";a[e]=t.charAt(0)!==i?i+t:t}else a[e]=t;break;case"username":case"password":a[e]=encodeURIComponent(t);break;case"auth":var s=t.indexOf(":");~s?(a.username=t.slice(0,s),a.username=encodeURIComponent(decodeURIComponent(a.username)),a.password=t.slice(s+1),a.password=encodeURIComponent(decodeURIComponent(a.password))):a.username=encodeURIComponent(decodeURIComponent(t))}for(var l=0;l<p.length;l++){var u=p[l];u[4]&&(a[u[1]]=a[u[1]].toLowerCase())}return a.auth=a.password?a.username+":"+a.password:a.username,a.origin="file:"!==a.protocol&&g(a.protocol)&&a.host?a.protocol+"//"+a.host:"null",a.href=a.toString(),a},toString:function(e){e&&"function"==typeof e||(e=o.stringify);var t,r=this,n=r.host,a=r.protocol;a&&":"!==a.charAt(a.length-1)&&(a+=":");var i=a+(r.protocol&&r.slashes||g(r.protocol)?"//":"");return r.username?(i+=r.username,r.password&&(i+=":"+r.password),i+="@"):r.password?(i+=":"+r.password,i+="@"):"file:"!==r.protocol&&g(r.protocol)&&!n&&"/"!==r.pathname&&(i+="@"),(":"===n[n.length-1]||c.test(r.hostname)&&!r.port)&&(n+=":"),i+=n+r.pathname,(t="object"==typeof r.query?e(r.query):r.query)&&(i+="?"!==t.charAt(0)?"?"+t:t),r.hash&&(i+=r.hash),i}},y.extractProtocol=m,y.location=h,y.trimLeft=d,y.qs=o,e.exports=y},5197:(e,t,r)=>{var n=r(1873),o=r(9009),a=o;a.v1=n,a.v4=o,e.exports=a},9114:e=>{for(var t=[],r=0;r<256;++r)t[r]=(r+256).toString(16).substr(1);e.exports=function(e,r){var n=r||0,o=t;return[o[e[n++]],o[e[n++]],o[e[n++]],o[e[n++]],"-",o[e[n++]],o[e[n++]],"-",o[e[n++]],o[e[n++]],"-",o[e[n++]],o[e[n++]],"-",o[e[n++]],o[e[n++]],o[e[n++]],o[e[n++]],o[e[n++]],o[e[n++]]].join("")}},1707:e=>{var t="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof window.msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto);if(t){var r=new Uint8Array(16);e.exports=function(){return t(r),r}}else{var n=new Array(16);e.exports=function(){for(var e,t=0;t<16;t++)0==(3&t)&&(e=4294967296*Math.random()),n[t]=e>>>((3&t)<<3)&255;return n}}},1873:(e,t,r)=>{var n,o,a=r(1707),i=r(9114),s=0,c=0;e.exports=function(e,t,r){var l=t&&r||0,u=t||[],d=(e=e||{}).node||n,p=void 0!==e.clockseq?e.clockseq:o;if(null==d||null==p){var f=a();null==d&&(d=n=[1|f[0],f[1],f[2],f[3],f[4],f[5]]),null==p&&(p=o=16383&(f[6]<<8|f[7]))}var h=void 0!==e.msecs?e.msecs:(new Date).getTime(),g=void 0!==e.nsecs?e.nsecs:c+1,m=h-s+(g-c)/1e4;if(m<0&&void 0===e.clockseq&&(p=p+1&16383),(m<0||h>s)&&void 0===e.nsecs&&(g=0),g>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");s=h,c=g,o=p;var y=(1e4*(268435455&(h+=122192928e5))+g)%4294967296;u[l++]=y>>>24&255,u[l++]=y>>>16&255,u[l++]=y>>>8&255,u[l++]=255&y;var v=h/4294967296*1e4&268435455;u[l++]=v>>>8&255,u[l++]=255&v,u[l++]=v>>>24&15|16,u[l++]=v>>>16&255,u[l++]=p>>>8|128,u[l++]=255&p;for(var w=0;w<6;++w)u[l+w]=d[w];return t||i(u)}},9009:(e,t,r)=>{var n=r(1707),o=r(9114);e.exports=function(e,t,r){var a=t&&r||0;"string"==typeof e&&(t="binary"===e?new Array(16):null,e=null);var i=(e=e||{}).random||(e.rng||n)();if(i[6]=15&i[6]|64,i[8]=63&i[8]|128,t)for(var s=0;s<16;++s)t[a+s]=i[s];return t||o(i)}},4786:e=>{"use strict";function t(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function r(e){for(var r=1;r<arguments.length;r++){var o=null!=arguments[r]?arguments[r]:{};r%2?t(Object(o),!0).forEach((function(t){n(e,t,o[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(o)):t(Object(o)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(o,t))}))}return e}function n(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const o={SHORT_DATE:"SHORT_DATE",MEDIUM_DATE:"MEDIUM_DATE",LONG_DATE:"LONG_DATE",FULL_DATE:"FULL_DATE",SHORT_DATE_TIME:"SHORT_DATE_TIME",LONG_DATE_TIME:"LONG_DATE_TIME",FULL_DATE_TIME:"FULL_DATE_TIME",MEDIUM_TIME_12:"MEDIUM_TIME_12",MEDIUM_TIME_24:"MEDIUM_TIME_24",LONG_TIME_12:"LONG_TIME_12",LONG_TIME_24:"LONG_TIME_24",HOUR_ONLY:"HOUR_ONLY",MINUTE_ONLY:"MINUTE_ONLY",YEAR_ONLY:"YEAR_ONLY",MONTH_ONLY:"MONTH_ONLY",SHORT_MONTH_ONLY:"SHORT_MONTH_ONLY",DAY_ONLY:"DAY_ONLY"},a=new Set([o.SHORT_DATE_TIME,o.LONG_DATE_TIME,o.FULL_DATE_TIME,o.MEDIUM_TIME_12,o.MEDIUM_TIME_24,o.LONG_TIME_12,o.LONG_TIME_24,o.HOUR_ONLY,o.MINUTE_ONLY]),i={[o.SHORT_DATE]:{day:"numeric",month:"numeric",year:"2-digit"},[o.MEDIUM_DATE]:{day:"numeric",month:"short",year:"numeric"},[o.LONG_DATE]:{day:"numeric",month:"long",year:"numeric"},[o.FULL_DATE]:{day:"numeric",month:"long",year:"numeric",weekday:"long"},[o.SHORT_DATE_TIME]:{day:"numeric",month:"numeric",year:"2-digit",hour:"numeric",minute:"numeric"},[o.LONG_DATE_TIME]:{day:"numeric",month:"long",year:"numeric",hour:"numeric",minute:"numeric",second:"numeric"},[o.FULL_DATE_TIME]:{day:"numeric",month:"long",year:"numeric",hour:"numeric",minute:"numeric",second:"numeric",weekday:"long",timeZoneName:"short"},[o.MEDIUM_TIME_12]:{minute:"numeric",hour:"numeric",hour12:!0},[o.MEDIUM_TIME_24]:{minute:"numeric",hour:"numeric",hour12:!1},[o.LONG_TIME_12]:{minute:"numeric",hour:"numeric",second:"numeric",hour12:!0},[o.LONG_TIME_24]:{minute:"numeric",hour:"numeric",second:"numeric",hour12:!1},[o.HOUR_ONLY]:{hour:"numeric"},[o.MINUTE_ONLY]:{minute:"numeric"},[o.YEAR_ONLY]:{year:"numeric"},[o.MONTH_ONLY]:{month:"long"},[o.SHORT_MONTH_ONLY]:{month:"short"},[o.DAY_ONLY]:{weekday:"long"}};e.exports=function(){let{locale:e,timeZone:t}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!e)throw new Error('A "locale" parameter is required for wixFormatting');return{formatDateTime(n,o){let{locale:a,timeZone:s}=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const c=r(r({},i[o]),{},{timeZone:s||t});return new Intl.DateTimeFormat(a||e,c).format(n)},dateFormats:o}},e.exports.dateFormats=o,e.exports.setOfDateFormatsWithTime=a},9479:t=>{"use strict";t.exports=e}},o={};function a(e){var t=o[e];if(void 0!==t)return t.exports;var r=o[e]={id:e,loaded:!1,exports:{}};return n[e].call(r.exports,r,r.exports,a),r.loaded=!0,r.exports}a.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return a.d(t,{a:t}),t},r=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,a.t=function(e,n){if(1&n&&(e=this(e)),8&n)return e;if("object"==typeof e&&e){if(4&n&&e.__esModule)return e;if(16&n&&"function"==typeof e.then)return e}var o=Object.create(null);a.r(o);var i={};t=t||[null,r({}),r([]),r(r)];for(var s=2&n&&e;"object"==typeof s&&!~t.indexOf(s);s=r(s))Object.getOwnPropertyNames(s).forEach((t=>i[t]=()=>e[t]));return i.default=()=>e,a.d(o,i),o},a.d=(e,t)=>{for(var r in t)a.o(t,r)&&!a.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},a.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),a.hmd=e=>((e=Object.create(e)).children||(e.children=[]),Object.defineProperty(e,"exports",{enumerable:!0,set:()=>{throw new Error("ES Modules may not assign module.exports or exports.*, Use ESM export syntax, instead: "+e.id)}}),e),a.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),a.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var i={};return(()=>{"use strict";a.r(i),a.d(i,{createControllers:()=>Wh,initAppForPage:()=>Uh});var e={};a.r(e),a.d(e,{READ:()=>rt,READ_WRITE:()=>tt,WRITE:()=>nt});var t={};a.r(t),a.d(t,{collectionName:()=>xt,deferred:()=>Wt,filter:()=>Mt,includes:()=>kt,nested:()=>Lt,pageSize:()=>Ut,readWriteType:()=>Nt,sort:()=>Ft});var r={};a.r(r),a.d(r,{DATASET:()=>Dr,ROUTER_DATASET:()=>Ar});var n=a(124);if("function"!=typeof self.queueMicrotask&&(self.queueMicrotask=function(e){Promise.resolve().then(e).catch((e=>setTimeout((()=>{throw e}))))}),"function"!=typeof Array.prototype.at){function Vh(e){if((e=Math.trunc(e)||0)<0&&(e+=this.length),!(e<0||e>=this.length))return this[e]}const Gh=Reflect.getPrototypeOf(Int8Array);for(const Bh of[Array,String,Gh])Object.defineProperty(Bh.prototype,"at",{value:Vh,writable:!0,enumerable:!1,configurable:!0})}var o=a(2988),s=a(1460);const{text:c,boolean:l,number:u,dateTime:d,date:p,richText:f,url:h,reference:g,stringArray:m}=s.FieldType,y=[c,f,l,d,p,g,u,h,m];var v=a(5197);const w=e=>{let{httpClient:t}=e;return{reportFormEventToAutomationCreator:()=>async e=>{let{detailedEventPayload:r,eventUTCTime:n}=e;const o={eventIdentifier:{eventUniqueId:v.v4(),eventType:"form/form/code",sourceUniqueId:"675bbcef-18d8-41f5-800e-131ec9e08762"},eventUTCTime:n,detailedEventPayload:r};await t.post("/_api/action-triggers-server/v1/report-event",o)}}},b=["cause"],O=["code"],I=["code"];function E(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r,n,o={},a=Object.keys(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)>=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}function S(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function _(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?S(Object(r),!0).forEach((function(t){P(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):S(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function P(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}class T extends Error{static withMessage(e){return class extends(this){constructor(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];super(e,...r)}}}static with(e){let{message:t,options:r}=e;return class extends(this){constructor(e){super(t||e instanceof String&&e,_(_({},r),e instanceof Object?e:{}))}}}constructor(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"DataBindingError";super(e,t);const n=t||{},{cause:o}=n,a=E(n,b);this.name=r,this.options=a,this.cause||(this.cause=o)}toString(){return this.cause?"".concat(super.toString(),"\nCaused by ").concat(this.cause.toString()):super.toString()}}P(T,"scopes",{USER_SCOPE:"userCodeZone",APPLICATION_SCOPE:"applicationCodeZone",SERVER_SCOPE:"wixDataCodeZone"});class R extends T{constructor(e,t){super(e,t,"AppError"),this.scope=T.scopes.APPLICATION_SCOPE}}class C extends T{constructor(e,t){super(e,t,arguments.length>2&&void 0!==arguments[2]?arguments[2]:"UserError"),this.scope=T.scopes.USER_SCOPE}}class D extends C{constructor(e,t){const{code:r}=t;super(e,E(t,O),"DatasetError"),this.code=r}}class A extends C{constructor(e,t){super(e,t,"ServerValidationError")}}P(A,"codes",["WD_SITE_IN_TEMPLATE_MODE","WD_PERMISSION_DENIED","WD_COLLECTION_DELETED","WD_VALIDATION_FAILED"]);class j extends T{constructor(e,t){const{code:r}=t;super(e,E(t,I),"ServerError"),this.scope=T.scopes.SERVER_SCOPE,this.code=r}}class x extends T{constructor(e){super("Async operation error wasn't handled",e,"UnhandledPromiseRejection")}}function N(e,t){var r=function(e,t,r){if(!t.has(e))throw new TypeError("attempted to get private field on non-instance");return t.get(e)}(e,t);return function(e,t){return t.get?t.get.call(e):t.value}(e,r)}var M=new WeakMap;const F=new class{constructor(){var e,t;e=M,t={writable:!0,value:new Proxy({},{get(e,t){if(e[t])return e[t];throw new ReferenceError("There is no ".concat(t," in context. Check if the context has been already set"))}})},function(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}(this,e),e.set(this,t)}set(e){Object.entries(e).forEach((e=>{let[t,r]=e;return N(this,M)[t]=r}))}get(){return N(this,M)}},k=F.get();function L(e,t,r){!function(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}(e,t),t.set(e,r)}function U(e,t){return function(e,t){return t.get?t.get.call(e):t.value}(e,W(e,t,"get"))}function W(e,t,r){if(!t.has(e))throw new TypeError("attempted to "+r+" private field on non-instance");return t.get(e)}var V=new WeakMap,G=new WeakMap;class B{constructor(e){var t;L(this,V,{writable:!0,value:void 0}),L(this,G,{writable:!0,value:new X}),t=e,function(e,t,r){if(t.set)t.set.call(e,r);else{if(!t.writable)throw new TypeError("attempted to set read only private field");t.value=r}}(this,W(this,V,"set"),t)}dispatch(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];return U(this,G).has(e)?U(this,G).get(e).reduce(((t,n)=>[...t,k.errorReporting(n,R.with({message:"".concat(e," listener failed"),options:{extra:U(this,V)}}))(U(this,V),...r)]),[]):void 0}subscribe(e,t){return e.constructor===Object?Object.entries(e).reduce(((e,t)=>{let[r,n]=t;return[...e,this.subscribe(r,n)]}),[]):(U(this,G).getOrDefault(e,new Y).add(t),()=>this.unsubscribe(e,t))}unsubscribe(e,t){return U(this,G).has(e)&&U(this,G).get(e).delete(t)}}class q{constructor(){const e={};return e.promise=new Promise(((t,r)=>{e.resolve=function(){return t(...arguments),e.promise},e.reject=function(){return r(...arguments),e.promise}})),e}}const z=(e,t)=>function(){for(var r=arguments.length,n=new Array(r),o=0;o<r;o++)n[o]=arguments[o];try{const r=e(...n);return(null==r?void 0:r.catch)instanceof Function?r.catch((e=>t(e,...n))):r}catch(e){return t(e,...n)}},H=e=>z((function(t){for(var r=arguments.length,n=new Array(r>1?r-1:0),o=1;o<r;o++)n[o-1]=arguments[o];return Promise.resolve(e(t,...n))}),(e=>Promise.reject(e)));class ${constructor(e){return null!=e&&e.then?e:{then:t=>t(e)}}}class X extends Map{getOrDefault(e,t){return this.has(e)?this.get(e):this.set(e,t).get(e)}find(e){const[,t]=Array.from(this).find((t=>{let[r,n]=t;return e(n,r,this)}))||[];return t}}class Y extends Set{reduce(e,t){return Array.from(this).reduce(((t,r,n)=>e(t,r,n,this)),t)}}var K=a(6167),Z=a(102),Q=a(6951);const J="detailsRepeaterRole",ee="detailsDatasetRole",te="filterInputRole",re="galleryRole",ne="mediaGalleryRole",oe="ratingsDisplayRole",ae="dropdownRole",ie="dropdownOptionsRole",se="gridRole",ce="datepickerRole",le="radioGroupRole",ue="uploadButtonRole",de="repeaterRole",pe="pageRole",fe="paginationRole",he="addressInputRole",ge="googleMapRole",me="timePickerRole",ye="progressBarRole",ve="selectionTagsOptionsRole",we="signatureInputRole",be="richContentRole",Oe="userInputFilterDropdownRole",Ie="userInputFilterCheckboxRole",Ee="userInputFilterRadioGroupRole",Se="userInputFilterCheckboxGroupRole",_e="userInputFilterSelectionTagsRole",Pe="userInputFilterRangeSliderRole";var Te=a(7892);const Re="dbsm-viewer-app",Ce=new Map([["new","add"]]),De=[Oe,Ie,Ee,Se,_e,Pe],Ae=[Oe,Ee,Se,_e];var je=a(7077);function xe(e,t,r){if(!t.has(e))throw new TypeError("attempted to get private field on non-instance");return r}function Ne(e,t,r){Me(e,t),t.set(e,r)}function Me(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Fe(e,t,r){return function(e,t,r){if(t.set)t.set.call(e,r);else{if(!t.writable)throw new TypeError("attempted to set read only private field");t.value=r}}(e,Le(e,t,"set"),r),r}function ke(e,t){return function(e,t){return t.get?t.get.call(e):t.value}(e,Le(e,t,"get"))}function Le(e,t,r){if(!t.has(e))throw new TypeError("attempted to "+r+" private field on non-instance");return t.get(e)}function Ue(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function We(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Ue(Object(r),!0).forEach((function(t){Ve(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Ue(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function Ve(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}class Ge{constructor(e){let{collectionId:t,componentType:r,datasetId:n,datasetMode:o,datasetType:a,fieldType:i,filteredBy:s,id:c,numberOfResults:l,pageId:u,pageUrl:d,sessionId:p,viewMode:f}=e;Ve(this,"type",Ge.types.EVENT),Ve(this,"event",void 0),this.event=We({pageId:u,src:K.Jg,ver:Q((0,Z.getAppUrl)(Re)),app_name:Re,app_id:Te.DATA_BINDING,evid:c,ds_id:n,ds_type:a,mode:o,collection_name:t,component_type:r,filtered_by:s,field_type:i,number_of_results:l,viewmode:f,page_url:d},p?{vsi:p}:{})}}Ve(Ge,"types",{EVENT:"event",ERROR:"error"});class Be extends Ge{constructor(e){let{message:t,code:r}=e;super({}),Ve(this,"type",Ge.types.ERROR),this.event={evid:10,dsc:t,errn:t,errc:r||je.ERROR}}}var qe=new WeakMap,ze=new WeakMap,He=new WeakMap;class $e{constructor(e,t,r){Ve(this,"onStart",(e=>Fe(this,qe,e))),Ve(this,"onEnd",(e=>Fe(this,ze,e))),Ne(this,qe,{writable:!0,value:()=>{}}),Ne(this,ze,{writable:!0,value:()=>{}}),Ne(this,He,{writable:!0,value:{[$e.types.TRACE]:e=>(ke(this,qe).call(this),new $(e()).then((e=>(ke(this,ze).call(this),e)))),[$e.types.START]:()=>ke(this,qe).call(this),[$e.types.END]:()=>ke(this,ze).call(this)}});const{type:n,fn:o}=t instanceof Function?{type:$e.types.TRACE,fn:t}:{type:t};this.name=e,this.params=r,this.run=()=>ke(this,He)[n](o)}}Ve($e,"types",{START:"START",END:"END",TRACE:"TRACE"});class Xe{static with(e){let{category:t,message:r,level:n,data:o}=e;return class extends(this){constructor(e){let{category:a=t,message:i=r,level:s=n,data:c}=e;super({category:a,message:i,level:s,data:c||o?We(We({},c),o):void 0})}}}constructor(e){let{category:t,message:r,level:n="info",data:o}=e;this.event={category:t,message:r,level:n,data:o}}}var Ye=new WeakMap,Ke=new WeakMap,Ze=new WeakSet;class Qe{static with(e){return class extends(this){constructor(t){let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};super(t,We(We({},e),r))}}}constructor(e,t){var r;Me(this,r=Ze),r.add(this),Ve(this,"messages",[]),Ne(this,Ye,{writable:!0,value:{[Qe.types.COMPONENT.BOUND]:e=>{let{collectionId:t,description:r}=e;return r?["[Dataset - Connected] '".concat(t,"' collection to element '").concat(xe(this,Ze,Je).call(this),"':"),r]:["[Dataset - Connected] '".concat(t,"' collection to element '").concat(xe(this,Ze,Je).call(this),"'")]},[Qe.types.COMPONENT.FILLED]:e=>{let{collectionId:t,description:r}=e;return["[Dataset - Populated] '".concat(t,"' collection into element '").concat(xe(this,Ze,Je).call(this),"':"),r]},[Qe.types.DS_API.CALLED]:e=>{let{methodName:t,args:r}=e;return 0===r.length?["[wix-dataset.".concat(t,"] called")]:["[wix-dataset.".concat(t,"] called with ("),JSON.stringify(r),")"]},[Qe.types.DS_API.SUCCED]:e=>{let{methodName:t,result:r}=e;return void 0===r?["[wix-dataset.".concat(t,"] returned")]:["[wix-dataset.".concat(t,"] returned with ("),JSON.stringify(r),")"]},[Qe.types.DS_API.DEPRECATED]:e=>{let{methodName:t,replacementMethodName:r}=e;const n=r?"; use [wix-dataset.".concat(r,"] instead"):"";return["[wix-dataset.".concat(t,"] is deprecated").concat(n)]},[Qe.types.DS_API.REGISTERED]:e=>{let{methodName:t}=e;return["[".concat(t," callback registered] on wix-dataset")]},[Qe.types.DS_API.TRIGGERED]:e=>{let{eventName:t,eventArgs:r=[]}=e;if(r.length){const e=r.map((e=>e instanceof Error?e.toString():e));return["[".concat(t," event] triggered on wix-dataset with ("),JSON.stringify(e),")"]}return["[".concat(t," event] triggered on wix-dataset")]}}}),Ne(this,Ke,{writable:!0,value:{}}),Fe(this,Ke,t),this.messages=ke(this,Ye)[e](t)}}function Je(){const{component:{nickname:e,parentRepeater:t}}=ke(this,Ke);return t?"#".concat(t.nickname,".#").concat(e):"#".concat(e)}Ve(Qe,"types",{COMPONENT:{BOUND:"COMPONENT_BOUND",FILLED:"COMPONENT_FILLED"},DS_API:{CALLED:"DS_API_CALLED",SUCCED:"DS_API_SUCCED",DEPRECATED:"DS_API_DEPRECATED",REGISTERED:"DS_API_REGISTERED",TRIGGERED:"DS_API_TRIGGERED"}});class et{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"log";Ve(this,"message",void 0),Ve(this,"level",void 0),this.message=e,this.level=t}}const tt="READ_WRITE",rt="READ",nt="WRITE";var ot=a(9479),at=a(6957);const it=[{type:at.AddressInput,role:he},{type:at.RatingsInput,role:"ratingsInputRole"},{type:at.TextInput,role:"textInputRole"},{type:at.TextBox,role:"textAreaRole"},{type:at.RichTextBox,role:"richTextBoxRole"},{type:at.Checkbox,role:"checkboxRole"},{type:at.DatePicker,role:ce},{type:at.RadioButtonGroup,role:le},{type:at.Dropdown,role:ae},{type:at.UploadButton,role:ue},{type:at.ToggleSwitch,role:"toggleSwitchRole"},{type:at.Slider,role:"sliderRole"},{type:at.TimePicker,role:me},{type:at.CheckboxGroup,role:"checkboxGroupRole"},{type:at.SelectionTags,role:"selectionTagsRole"},{type:at.SignatureInput,role:we}],st=(it.map((e=>e.type)),it.map((e=>e.role))),ct=(e,t)=>(e=>[nt,tt].includes(e))(e)&&(e=>e.some((e=>"save"===(0,ot.get)(e,"config.events.onClick.action"))))(t)&&(e=>e.some((e=>{return t=(0,ot.get)(e,"role"),st.includes(t);var t})))(t),lt="object"==typeof global&&global&&global.Object===Object&&global;var ut="object"==typeof self&&self&&self.Object===Object&&self;const dt=(lt||ut||Function("return this")()).Symbol;var pt=Object.prototype,ft=pt.hasOwnProperty,ht=pt.toString,gt=dt?dt.toStringTag:void 0,mt=Object.prototype.toString,yt=dt?dt.toStringTag:void 0;const vt=(wt=Object.getPrototypeOf,bt=Object,function(e){return wt(bt(e))});var wt,bt,Ot=Function.prototype,It=Object.prototype,Et=Ot.toString,St=It.hasOwnProperty,_t=Et.call(Object),Pt=a(3424),Tt="@@redux/INIT";function Rt(e,t,r){var n;if("function"==typeof t&&void 0===r&&(r=t,t=void 0),void 0!==r){if("function"!=typeof r)throw new Error("Expected the enhancer to be a function.");return r(Rt)(e,t)}if("function"!=typeof e)throw new Error("Expected the reducer to be a function.");var o=e,a=t,i=[],s=i,c=!1;function l(){s===i&&(s=i.slice())}function u(){return a}function d(e){if("function"!=typeof e)throw new Error("Expected listener to be a function.");var t=!0;return l(),s.push(e),function(){if(t){t=!1,l();var r=s.indexOf(e);s.splice(r,1)}}}function p(e){if(!function(e){if(!function(e){return null!=e&&"object"==typeof e}(e)||"[object Object]"!=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":yt&&yt in Object(e)?function(e){var t=ft.call(e,gt),r=e[gt];try{e[gt]=void 0;var n=!0}catch(e){}var o=ht.call(e);return n&&(t?e[gt]=r:delete e[gt]),o}(e):function(e){return mt.call(e)}(e)}(e))return!1;var t=vt(e);if(null===t)return!0;var r=St.call(t,"constructor")&&t.constructor;return"function"==typeof r&&r instanceof r&&Et.call(r)==_t}(e))throw new Error("Actions must be plain objects. Use custom middleware for async actions.");if(void 0===e.type)throw new Error('Actions may not have an undefined "type" property. Have you misspelled a constant?');if(c)throw new Error("Reducers may not dispatch actions.");try{c=!0,a=o(a,e)}finally{c=!1}for(var t=i=s,r=0;r<t.length;r++)(0,t[r])();return e}return p({type:Tt}),(n={dispatch:p,subscribe:d,getState:u,replaceReducer:function(e){if("function"!=typeof e)throw new Error("Expected the nextReducer to be a function.");o=e,p({type:Tt})}})[Pt.Z]=function(){var e,t=d;return(e={subscribe:function(e){if("object"!=typeof e)throw new TypeError("Expected the observer to be an object.");function r(){e.next&&e.next(u())}return r(),{unsubscribe:t(r)}}})[Pt.Z]=function(){return this},e},n}function Ct(e,t){var r=t&&t.type;return"Given action "+(r&&'"'+r.toString()+'"'||"an action")+', reducer "'+e+'" returned undefined. To ignore an action, you must explicitly return the previous state. If you want this reducer to hold no value, you can return null instead of undefined.'}function Dt(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];return 0===t.length?function(e){return e}:1===t.length?t[0]:t.reduce((function(e,t){return function(){return e(t.apply(void 0,arguments))}}))}var At=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},jt=a(3882);const xt=null,Nt=rt,Mt=null,Ft=null,kt=null,Lt=[],Ut=12,Wt=!1,Vt="SET_CURRENT_RECORD",Gt="UPDATE_FIELDS",Bt="REFRESH_CURRENT_RECORD",qt="REFRESH_CURRENT_VIEW",zt="INCREMENT_NUM_PAGES_TO_SHOW",Ht="SET_DEFAULT_RECORD",$t="GO_TO_INDEX",Xt="GO_TO_NEXT_PAGE",Yt="GO_TO_PREVIOUS_PAGE",Kt="LOAD_PAGE",Zt="GET_RECORD_BY_INDEX_RESULT",Qt="CURRENT_VIEW_UPDATED",Jt="REVERT_CHANGES",er="RECORD_REVERTED",tr="SAVE_RECORD",rr="SAVE_RECORD_RESULT",nr="REMOVE_CURRENT_RECORD",or="REMOVE_CURRENT_RECORD_RESULT",ar="NEW_RECORD",ir="NEW_RECORD_RESULT",sr="REFRESH",cr="SET_USER_INPUT_OPTION_VALUES",lr={INIT:"INIT",SET_PAGINATION_DATA:"SET_PAGINATION_DATA"},ur=lr,dr="SET_FILTER",pr="SET_SORT",fr="SET_IS_DATASET_READY",hr="SET_FIXED_FILTER_ITEM",gr=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return e.readWriteType},mr=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return e.pageSize},yr=gr;function vr(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function wr(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?vr(Object(r),!0).forEach((function(t){br(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):vr(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function br(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Or=e=>{let{error:t,payload:r}=e;return t?jt.Result.Error(r):jt.Result.Ok(r)},Ir={currentRecord:{index:void 0,data:void 0,fieldsToUpdate:void 0,updateSource:void 0},lastSavedRecord:{index:void 0,data:void 0},desiredIndex:void 0,refreshCurrentRecord:!1,removeCurrentRecord:!1,newRecordIndex:null,refreshCurrentView:!1,refreshController:!1,revertChanges:!1,saveRecord:!1,defaultRecord:void 0,isForm:void 0,page:{numPagesToShow:1,offset:0,size:Ut},schema:void 0,userFilterInitialData:null},Er=e=>((e,t)=>(0,ot.inRange)(e,Tr(t).offset,Tr(t).offset+Tr(t).size))(Rr(e),e),Sr=(e,t,r,n)=>{const o=wr(wr({},e),{},{currentRecord:{index:t,data:r,updateSource:n},desiredIndex:t,refreshCurrentRecord:!1,refreshController:!1});return Er(o)?o:wr(wr({},o),{},{page:wr(wr({},o.page),{},{offset:Math.floor(o.currentRecord.index/o.page.size)*o.page.size,numPagesToShow:1})})},_r=e=>e.page.size,Pr=e=>e.currentRecord.data,Tr=e=>e.page,Rr=e=>e.currentRecord.index,Cr={reducer:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Ir,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case Vt:{const{recordIndex:r,record:n,updateSource:o}=t;return Sr(e,r,n,o)}case ar:return wr(wr({},e),{},{newRecordIndex:t.atIndex});case ir:return Or(t).fold((()=>wr(wr({},e),{},{newRecordIndex:null})),(t=>wr(wr({},Sr(e,e.newRecordIndex,t)),{},{newRecordIndex:null})));case Gt:{const{fieldsToUpdate:r,updateSource:n}=t;return wr(wr({},e),{},{currentRecord:wr(wr({},e.currentRecord),{},{fieldsToUpdate:r,updateSource:n})})}case $t:return wr(wr({},e),{},{desiredIndex:t.index});case Zt:return Or(t).fold((()=>wr(wr({},e),{},{desiredIndex:e.currentRecord.index,refreshCurrentRecord:!1,refreshController:!1})),(t=>t.matchWith({Record:t=>{let{index:r,record:n}=t;return Sr(e,r,n)},InvalidIndex:()=>wr(wr({},e),{},{desiredIndex:e.currentRecord.index,refreshCurrentRecord:!1}),NoRecord:()=>Sr(e,null,null)})));case Bt:return wr(wr({},e),{},{refreshCurrentRecord:!0});case nr:return wr(wr({},e),{},{removeCurrentRecord:!0});case or:return Or(t).fold((()=>wr(wr({},e),{},{removeCurrentRecord:!1})),(()=>wr(wr({},e),{},{removeCurrentRecord:!1,refreshCurrentRecord:!0})));case qt:return wr(wr({},e),{},{refreshCurrentView:!0});case Qt:return wr(wr({},e),{},{refreshCurrentView:!1});case Jt:return wr(wr({},e),{},{revertChanges:!0});case er:return wr(wr({},e),{},{revertChanges:!1});case Ht:{const{record:r}=t;return wr(wr({},e),{},{defaultRecord:r})}case ur.INIT:{const{datasetConfig:r,connections:n}=t,o=mr(r),a=yr(r);return wr(wr({},e),{},{isForm:ct(a,n),page:wr(wr({},e.page),{},{size:o||e.page.size})})}case ur.SET_PAGINATION_DATA:{const r=wr(wr({},e),{},{page:wr(wr({},e.page),t.paginationData)});return Er(r)?r:wr(wr({},r),{},{desiredIndex:r.page.offset})}case Xt:{const t=Tr(e),r=_r(e),n=t.offset+r,o=wr(wr({},e),{},{page:wr(wr({},e.page),{},{numPagesToShow:1,offset:n})});return Er(o)?o:wr(wr({},o),{},{desiredIndex:o.page.offset})}case Yt:{const t=Tr(e),r=Math.max(0,t.offset-t.size),n=wr(wr({},e),{},{page:wr(wr({},e.page),{},{numPagesToShow:1,offset:r})});return Er(n)?n:wr(wr({},n),{},{desiredIndex:n.page.offset})}case Kt:{const{size:r}=Tr(e),n=wr(wr({},e),{},{page:wr(wr({},e.page),{},{numPagesToShow:1,offset:r*(t.pageNumber-1)})});return Er(n)?n:wr(wr({},n),{},{desiredIndex:n.page.offset})}case zt:return wr(wr({},e),{},{page:wr(wr({},e.page),{},{numPagesToShow:e.page.numPagesToShow+1})});case tr:return wr(wr({},e),{},{saveRecord:!0,lastSavedRecord:{index:void 0,data:void 0}});case rr:return Or(t).fold((()=>wr(wr({},e),{},{saveRecord:!1})),(t=>wr(wr({},e),{},{saveRecord:!1,lastSavedRecord:{index:e.currentRecord.index,data:t}})));case dr:case pr:case sr:return wr(wr({},e),{},{refreshController:!0});case cr:return wr(wr({},e),{},{userFilterInitialData:t.userFilterInitialData});default:return e}},getPaginationData:Tr,hasCurrentRecord:e=>!!Pr(e),selectDefaultDraft:e=>wr({},e.defaultRecord),selectCurrentRecord:Pr,selectCurrentRecordIndex:Rr,selectDesiredRecordIndex:e=>e.desiredIndex,selectFieldsToUpdate:e=>e.currentRecord.fieldsToUpdate,selectLastSavedRecord:e=>e.lastSavedRecord.data,selectLastSavedRecordIndex:e=>e.lastSavedRecord.index,selectRefreshCurrentRecord:e=>e.refreshCurrentRecord,selectRemoveCurrentRecord:e=>e.removeCurrentRecord,selectRefreshController:e=>e.refreshController,selectRefreshCurrentView:e=>e.refreshCurrentView,selectRevertChanges:e=>e.revertChanges,selectSaveRecord:e=>e.saveRecord,selectUpdateSource:e=>e.currentRecord.updateSource,selectNewRecordIndex:e=>e.newRecordIndex,isDuringSave:e=>e.saveRecord,isForm:e=>e.isForm,getUserFilterInitialData:e=>e.userFilterInitialData},Dr="dataset",Ar="router_dataset";function jr(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function xr(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?jr(Object(r),!0).forEach((function(t){Nr(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):jr(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function Nr(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const{WRITE:Mr}=e,{ROUTER_DATASET:Fr}=r,kr=["collectionName","readWriteType","includes","cursor"],Lr=["filter","sort"],Ur=e=>(0,ot.pick)(e,kr),Wr=e=>(0,ot.pick)(e,Lr),Vr=e=>{let{datasetConfig:t,connections:r,isScoped:n,datasetType:o}=e;const a=o===Fr,i=r.some((e=>{let{role:t}=e;return t===ee})),s=n,c=!n,l=t.readWriteType===Mr;return{datasetIsRouter:a,datasetIsMaster:i,datasetIsVirtual:s,datasetIsReal:c,datasetIsDeferred:Boolean(t.deferred)&&!(s||i||a||l),dynamicPageNavComponentsShouldBeLinked:a&&c,userFilterConnectionProps:r.filter((e=>{let{role:t}=e;return De.includes(t)})).map((e=>{let{config:{userInputFilter:t},role:r}=e;return xr(xr({},t),{},{role:r})}))}},Gr=(e,t)=>xr(xr({},e),{},{transientData:xr(xr({},e.transientData),t)}),Br={canonicalData:Ur(t),canonicalCalculatedData:{},transientData:xr({isDatasetReady:!1},Wr(t))},qr={reducer:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Br,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case ur.INIT:{const{datasetConfig:r,connections:n,isScoped:o,datasetType:a}=t;return xr(xr({},e),{},{canonicalData:xr(xr({},e.canonicalData),Ur(t.datasetConfig)),canonicalCalculatedData:Vr({datasetConfig:r,connections:n,isScoped:o,datasetType:a}),transientData:xr(xr({},e.transientData),Wr(t.datasetConfig))})}case dr:{const{filter:r}=t;return Gr(e,{filter:r})}case pr:{const{sort:r}=t;return Gr(e,{sort:r})}case fr:{const{isDatasetReady:r}=t;return Gr(e,{isDatasetReady:r})}case hr:{const{fixedFilterItem:r}=t;return Gr(e,{fixedFilterItem:r})}default:return e}},isWriteOnly:e=>(0,ot.get)(e,["canonicalData","readWriteType"])===nt,isReadOnly:e=>(0,ot.get)(e,["canonicalData","readWriteType"])===rt,getReadWriteMode:e=>(0,ot.get)(e,["canonicalData","readWriteType"]),isDatasetReady:e=>(0,ot.get)(e,["transientData","isDatasetReady"]),isDatasetConfigured:e=>!!(0,ot.get)(e,["canonicalData","collectionName"]),isCursorPagingRequired:e=>!!(0,ot.get)(e,["canonicalData","cursor"]),isDatasetRouter:e=>{let{canonicalCalculatedData:{datasetIsRouter:t}}=e;return t},isDatasetMaster:e=>{let{canonicalCalculatedData:{datasetIsMaster:t}}=e;return t},isDatasetVirtual:e=>{let{canonicalCalculatedData:{datasetIsVirtual:t}}=e;return t},isDatasetReal:e=>{let{canonicalCalculatedData:{datasetIsReal:t}}=e;return t},isDatasetDeferred:e=>{let{canonicalCalculatedData:{datasetIsDeferred:t}}=e;return t},shouldLinkDynamicPageNavComponents:e=>{let{canonicalCalculatedData:{dynamicPageNavComponentsShouldBeLinked:t}}=e;return t},getUserFilterConnectionProps:e=>{let{canonicalCalculatedData:{userFilterConnectionProps:t}}=e;return t},getFixedFilterItem:e=>(0,ot.get)(e,["transientData","fixedFilterItem"]),getFilter:e=>(0,ot.get)(e,["transientData","filter"]),getSort:e=>(0,ot.get)(e,["transientData","sort"]),getIncludes:e=>(0,ot.get)(e,["canonicalData","includes"])||[],getCollectionName:e=>(0,ot.get)(e,["canonicalData","collectionName"])},zr="NEXT_DYNAMIC_PAGE_URL_RESULT",Hr="PREVIOUS_DYNAMIC_PAGE_URL_RESULT",$r="INITIALIZE",Xr=(0,jt.union)("DynamicPageUrlLoadState",{Empty(){},Loading(){},Loaded:e=>{if(!e)throw new Error("url must exist");return{url:e}}},{hasUrl:e=>()=>e.matchWith({Empty:()=>!1,Loading:()=>!1,Loaded:()=>!0}),shouldLoadUrl:e=>()=>e.matchWith({Empty:()=>!1,Loading:()=>!0,Loaded:()=>!1})});Xr.fromUrl=e=>e?Xr.Loaded(e):Xr.Empty();const Yr=Xr,{fromUrl:Kr}=Xr;function Zr(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Qr(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Zr(Object(r),!0).forEach((function(t){Jr(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Zr(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function Jr(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const en={nextDynamicPageUrl:Yr.Empty(),previousDynamicPageUrl:Yr.Empty()},tn=e=>{const t=(e=>{const t=e.filter((e=>!!(0,ot.get)(e,"config.events.onClick.action")));return new Set(t.map((e=>(0,ot.get)(e,"config.events.onClick.action"))))})(e),r=e=>e?Yr.Loading():Yr.Empty();return{nextDynamicPageUrl:r(t.has("nextDynamicPage")),previousDynamicPageUrl:r(t.has("previousDynamicPage"))}},rn={reducer:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:en,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case $r:return Qr(Qr({},e),tn(t.connections));case zr:return Qr(Qr({},e),{},{nextDynamicPageUrl:Yr.fromUrl(t.payload)});case Hr:return Qr(Qr({},e),{},{previousDynamicPageUrl:Yr.fromUrl(t.payload)});default:return e}},selectNextDynamicPageUrl:e=>e.nextDynamicPageUrl,selectPreviousDynamicPageUrl:e=>e.previousDynamicPageUrl},nn=function(e){for(var t=Object.keys(e),r={},n=0;n<t.length;n++){var o=t[n];"function"==typeof e[o]&&(r[o]=e[o])}var a=Object.keys(r),i=void 0;try{!function(e){Object.keys(e).forEach((function(t){var r=e[t];if(void 0===r(void 0,{type:Tt}))throw new Error('Reducer "'+t+"\" returned undefined during initialization. If the state passed to the reducer is undefined, you must explicitly return the initial state. The initial state may not be undefined. If you don't want to set a value for this reducer, you can use null instead of undefined.");if(void 0===r(void 0,{type:"@@redux/PROBE_UNKNOWN_ACTION_"+Math.random().toString(36).substring(7).split("").join(".")}))throw new Error('Reducer "'+t+'" returned undefined when probed with a random type. Don\'t try to handle @@redux/INIT or other actions in "redux/*" namespace. They are considered private. Instead, you must return the current state for any unknown actions, unless it is undefined, in which case you must return the initial state, regardless of the action type. The initial state may not be undefined, but can be null.')}))}(r)}catch(e){i=e}return function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments[1];if(i)throw i;for(var n=!1,o={},s=0;s<a.length;s++){var c=a[s],l=r[c],u=e[c],d=l(u,t);if(void 0===d){var p=Ct(c,t);throw new Error(p)}o[c]=d,n=n||d!==u}return n?o:e}}({records:Cr.reducer,config:qr.reducer,dynamicPages:rn.reducer}),on=e=>qr.getCollectionName(e.config),an=e=>qr.getFilter(e.config),sn=e=>qr.getSort(e.config),cn=e=>Cr.getPaginationData(e.records),ln=e=>qr.getReadWriteMode(e.config),un=e=>qr.isDatasetConfigured(e.config),dn=e=>qr.isDatasetReady(e.config),pn=e=>qr.isReadOnly(e.config),fn=e=>qr.isWriteOnly(e.config),hn=e=>(e=>Cr.hasCurrentRecord(e.records))(e)&&!pn(e),gn=e=>qr.isDatasetRouter(e.config),mn=e=>qr.isDatasetMaster(e.config),yn=e=>qr.isDatasetVirtual(e.config),vn=e=>qr.isDatasetReal(e.config),wn=e=>qr.isDatasetDeferred(e.config),bn=e=>qr.shouldLinkDynamicPageNavComponents(e.config),On=e=>Cr.selectCurrentRecord(e.records),In=e=>Cr.selectCurrentRecordIndex(e.records),En=e=>Cr.selectDefaultDraft(e.records),Sn=e=>Cr.selectDesiredRecordIndex(e.records),_n=e=>Cr.selectFieldsToUpdate(e.records),Pn=e=>Cr.selectUpdateSource(e.records),Tn=e=>Cr.selectNewRecordIndex(e.records),Rn=e=>rn.selectNextDynamicPageUrl(e.dynamicPages),Cn=e=>rn.selectPreviousDynamicPageUrl(e.dynamicPages),Dn=e=>Cr.selectRefreshController(e.records),An=e=>Cr.selectRefreshCurrentRecord(e.records),jn=e=>Cr.selectRefreshCurrentView(e.records),xn=e=>Cr.selectRemoveCurrentRecord(e.records),Nn=e=>Cr.selectRevertChanges(e.records),Mn=e=>Cr.selectSaveRecord(e.records),Fn=e=>Cr.getUserFilterInitialData(e.records),{READ_WRITE:kn,READ:Ln}=e;function Un(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Wn(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Vn(e,t){Bn(e,t),t.add(e)}function Gn(e,t,r){Bn(e,t),t.set(e,r)}function Bn(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}function qn(e,t){return function(e,t){return t.get?t.get.call(e):t.value}(e,Hn(e,t,"get"))}function zn(e,t,r){if(!t.has(e))throw new TypeError("attempted to get private field on non-instance");return r}function Hn(e,t,r){if(!t.has(e))throw new TypeError("attempted to "+r+" private field on non-instance");return t.get(e)}var $n=new WeakMap,Xn=new WeakMap,Yn=new WeakSet,Kn=new WeakSet,Zn=new WeakSet;class Qn{constructor(e,t){var r;Vn(this,Zn),Vn(this,Kn),Vn(this,Yn),Gn(this,$n,{writable:!0,value:void 0}),Gn(this,Xn,{writable:!0,value:new X([[Ge,e=>{let{mode:t,env:r}=e;return t.csr&&!r.dev}],[Qe,e=>{let{mode:t,env:r}=e;return t.verbose&&r.preview}]])}),r=e,function(e,t,r){if(t.set)t.set.call(e,r);else{if(!t.writable)throw new TypeError("attempted to set read only private field");t.value=r}}(this,Hn(this,$n,"set"),r),zn(this,Zn,to).call(this,t)}log(e){if(zn(this,Kn,eo).call(this,e)&&qn(this,$n).log(e,new Be(e.cause||e)),zn(this,Yn,Jn).call(this,e))return qn(this,$n).log(e)}logError(e,t,r){this.log(e instanceof T?e:new R(t,function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Un(Object(r),!0).forEach((function(t){Wn(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Un(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}({cause:e},r)))}}function Jn(e){return(qn(this,Xn).find(((t,r)=>e instanceof r))||(()=>!0))(k.platform.settings)}function eo(e){return e instanceof T&&!(e instanceof C)&&qn(this,Xn).get(Ge)(k.platform.settings)}function to(e){e.addEventListener("unhandledrejection",(e=>{e.reason instanceof T&&(e.preventDefault(),qn(this,$n).log(new x({cause:e.reason})))}))}const ro=e=>(t,r)=>z(t,(t=>e.log(new r({cause:t})))),no=e=>(t,r)=>z((function(){for(var n=arguments.length,o=new Array(n),a=0;a<n;a++)o[a]=arguments[a];const i=t(...o);return e.log(new r({data:{args:o,result:i}})),i}),(t=>{throw e.log(new r({data:{exception:t},level:"error"})),t})),oo=e=>(t,r)=>function(){for(var n=arguments.length,o=new Array(n),a=0;a<n;a++)o[a]=arguments[a];if(r.startsWith("on"))return e.log(new Qe(Qe.types.DS_API.REGISTERED,{methodName:r})),t(...o);if(e.log(new Qe(Qe.types.DS_API.CALLED,{methodName:r,args:o})),Ce.has(r)){const t=Ce.get(r);e.log(new Qe(Qe.types.DS_API.DEPRECATED,{methodName:r,replacementMethodName:t}))}return new $(t(...o)).then((t=>(e.log(new Qe(Qe.types.DS_API.SUCCED,{methodName:r,result:t})),t)))};class ao{constructor(e){let{id:t,collectionId:r,datasetId:n,datasetType:o,datasetMode:a,numberOfResults:i,filteredBy:s,componentType:c,fieldType:l}=e;const{platform:{location:{pageId:u,pageUrl:d},settings:{sessionId:p,env:f}}}=k;return new Ge({id:t,collectionId:r,datasetId:n,datasetType:o,datasetMode:a,viewMode:f.name,pageId:u,pageUrl:d,sessionId:f.live&&p,numberOfResults:i,filteredBy:s,componentType:c,fieldType:l})}}var io=a(3844);const so=["items"];function co(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function lo(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?co(Object(r),!0).forEach((function(t){uo(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):co(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function uo(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}class po{constructor(e){let{message:t,code:r}=e;const n=new Error(t);return n.code=r,n}}class fo{constructor(e){let{getRequestParams:t,httpClient:r}=e;this.getRequestParams=t,this.httpClient=r}async _makeRequestTo(e,t){const{instance:r,gridAppId:n}=this.getRequestParams();return(await this.httpClient.post("/_serverless/data-binding-server/".concat(e),t,{params:{gridAppId:n},headers:{Authorization:r,"Content-Type":"application/json"}})).data}async fetchBulkData(e){const{recordsByCollectionId:t,recordsInfoByDataset:r}=await this._makeRequestTo("fetch-initial-data",e);return{recordsInfoByDataset:r.reduce(((e,t)=>{let{itemIds:r=[],totalCount:n=0,error:o}=t;return[...e,{itemIds:r,totalCount:n,error:o?new po(o):void 0}]}),[]),recordsByCollectionId:Object.entries(t).reduce(((e,t)=>{let[r,n]=t;return lo(lo({},e),{},{[r]:Object.entries(n).reduce(((e,t)=>{let[r,n]=t;return lo(lo({},e),{},{[r]:(0,io.PL)(n)})}),{})})}),{})}}async fetchData(e){const t=await this._makeRequestTo("fetch-data",e),{items:r}=t;return lo(lo({},function(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r,n,o={},a=Object.keys(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)>=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}(t,so)),{},{items:r.map((e=>(0,io.PL)(e)))})}async remove(e){return this._makeRequestTo("remove",e)}async save(e){const{item:t}=await this._makeRequestTo("save",e);return(0,io.PL)(t)}}var ho=a(7788);function go(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function mo(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?go(Object(r),!0).forEach((function(t){yo(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):go(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function yo(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const vo=e=>(0,ot.isPlainObject)(e)&&(0,ot.has)(e,"_id"),wo=(e,t)=>e!==t&&vo(e)&&!vo(t)?e:t,bo=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};for(const r of e){const e=t[r._id];t[r._id]=(0,ot.mergeWith)(e,r,wo)}return t},Oo=(e,t)=>{const r=t.flatMap((e=>["fields",e])).concat("type");return(0,ot.get)(e,r)},Io=(e,t)=>r=>{const n=r.split(ho.De);if(((e,t)=>t.length>=2&&Oo(e,[t[0]])===s.FieldType.reference)(e,n)){const[r,...o]=n,a=e&&e.fields[r]?e.fields[r].referencedCollection:null,i=t&&a?t[a]:null;return Oo(i,o)}return Oo(e,n)},Eo=(e,t)=>null!=t&&null!=t.fields[e]?t.fields[e].referencedCollection:null,So=e=>null!=e?e.displayField:null,_o=e=>null!=e?e.maxPageSize:void 0,Po="RESET_ALL";function To(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Ro(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?To(Object(r),!0).forEach((function(t){Co(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):To(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function Co(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Do(e,t,r){Ao(e,t),t.set(e,r)}function Ao(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}function jo(e,t){return function(e,t){return t.get?t.get.call(e):t.value}(e,No(e,t,"get"))}function xo(e,t,r){return function(e,t,r){if(t.set)t.set.call(e,r);else{if(!t.writable)throw new TypeError("attempted to set read only private field");t.value=r}}(e,No(e,t,"set"),r),r}function No(e,t,r){if(!t.has(e))throw new TypeError("attempted to "+r+" private field on non-instance");return t.get(e)}var Mo=new WeakMap,Fo=new WeakMap,ko=new WeakSet;class Lo{constructor(e){let{wixData:t,wixDataSchemas:r}=e;var n;Ao(this,n=ko),n.add(this),Do(this,Mo,{writable:!0,value:void 0}),Do(this,Fo,{writable:!0,value:void 0}),xo(this,Mo,Wo.reduce(((e,r)=>(e[r]=function(){const e=t[r](...arguments);return e.catch instanceof Function?e.catch((e=>{throw new Ho(e)})):e},e)),Ro({},t))),xo(this,Fo,r)}async fetchBulkData(e){const t=await Promise.all(e.map((e=>{let{collectionId:t,filter:r,sort:n,offset:o,cursor:a,length:i,includes:s,uniqueFieldValues:c}=e;return this.fetchData({collectionId:t,filter:r,sort:n,offset:o,cursor:a,length:i,includes:s,uniqueFieldValues:c}).catch((e=>({error:e})))})));return((e,t)=>t.reduce(((t,r,n)=>{let{items:o,nextCursor:a,totalCount:i,uniqueFieldValues:s,error:c}=r;if(c)return t.recordInfosInDatasetOrder.push({error:c}),t;t.recordInfosInDatasetOrder.push({itemIds:o.map((e=>{let{_id:t}=e;return t})),totalCount:i,nextCursor:a});const l=e[n].collectionId,u=t.recordsByCollectionId[l];return t.recordsByCollectionId[l]=bo(o,u),t.uniqueFieldValuesByCollection[l]=mo(mo({},t.uniqueFieldValuesByCollection[l]),s),t}),{recordInfosInDatasetOrder:[],recordsByCollectionId:{},uniqueFieldValuesByCollection:{}}))(e,t)}async fetchData(e){let{collectionId:t,filter:r,sort:n,offset:o=0,includes:a,cursor:i,length:s,uniqueFieldValues:c}=e;const l=i?jo(this,Mo).fetch(t,i,s):(()=>{let e=jo(this,Mo).query(t).setFilterModel(r).setSortModel(n).skip(o).limit(s);return null==a||a.forEach((t=>{e=e.include(t)})),e.find()})(),u=c.length>0?function(e,t,r){if(!t.has(e))throw new TypeError("attempted to get private field on non-instance");return r}(this,ko,Uo).call(this,{collectionId:t,fieldKeys:c}):Promise.resolve({}),[d,p]=await Promise.all([l,u]),{items:f,totalCount:h}=d;let g;try{g=d.nextCursor}catch(e){}return{items:f,nextCursor:g,totalCount:h||0,uniqueFieldValues:p}}async fetchUserFilterInitialData(e){let{collectionId:t,filter:r,userFilterConnectionProps:n}=e;const o=[Pe],a=(0,ot.uniqBy)(n.filter((e=>{let{role:t}=e;return o.includes(t)})),"fieldName"),i=(0,ot.uniqWith)(n.filter((e=>{let{role:t}=e;return Ae.includes(t)})),((e,t)=>e.fieldName===t.fieldName));return Promise.all([...a.map((async e=>{let{fieldName:n,role:o}=e;const a={fieldName:n,role:o},i=jo(this,Mo).filter().setFilterModel(r),{items:[{min:s,max:c}]}=await jo(this,Mo).aggregate(t).filter(i).max(n,"max").min(n,"min").run();return Ro(Ro({},a),{},{min:s,max:c})})),...i.map((async e=>{let{fieldName:n,role:o}=e;const a={fieldName:n,role:o},i=jo(this,Mo).sort().ascending(n).getSortModel(),{items:s}=await jo(this,Mo).query(t).setFilterModel(r).setSortModel(i).limit(50).distinct(n);return Ro(Ro({},a),{},{options:s})}))])}async remove(e){let{collectionId:t,recordId:r}=e;return jo(this,Mo).remove(t,r)}async save(e){let{collectionId:t,record:r,includeReferences:n}=e;return jo(this,Mo).save(t,r,{includeReferences:n})}async getSibling(e){let{collectionName:t,filter:r,sort:n,fieldValues:o,sortFields:a,directionTowardSibling:i}=e;const s=jo(this,Mo).query(t).setFilterModel(r),{items:[c]}=await Vo({sort:n,sortFields:a,fieldValues:o,baseQuery:s,directionTowardSibling:i}).find();return c}fetchSchemas(e){return jo(this,Fo).bulkGet(e,{referencedCollectionsDepth:1})}createSimpleFilter(e,t){return jo(this,Mo).filter().eq(e,t).getFilterModel()}}async function Uo(e){let{collectionId:t,fieldKeys:r}=e;return(await Promise.all(r.map((e=>jo(this,Mo).query(t).distinct(e))))).reduce(((e,t,n)=>{let{_items:o}=t;return e[r[n]]=o,e}),{})}const Wo=["save","remove","find","sort","filter","query","fetch","aggregate"],Vo=e=>{let{sort:t,sortFields:r,directionTowardSibling:n,fieldValues:o,baseQuery:a}=e;return Go({sort:t,sortFields:r,directionTowardSibling:n,fieldValues:o,baseQuery:a})(r.length-1).reduce(((e,t)=>e.or(t)))},Go=e=>{let{baseQuery:t,sortFields:r,sort:n,directionTowardSibling:o,fieldValues:a}=e;return function e(i){if(-1===i)return[];const s=r[i];return[(0,ot.flow)(Bo(n,o),qo(n[s],o,s,a[s]),zo(i,r,a))(t),...e(i-1)]}},Bo=(e,t)=>r=>Object.entries(e).reduce(((e,r)=>{let[n,o]=r;return o===t?e.ascending(n):e.descending(n)}),r),qo=(e,t,r,n)=>o=>e===t?o.gt(r,n):o.lt(r,n),zo=(e,t,r)=>n=>(0,ot.range)(e).reduce(((e,n)=>e.eq(t[n],r[t[n]])),n).limit(1);class Ho{constructor(e){if(!e.stack){const{message:t,code:r}="string"==typeof e?{message:e,code:"WD_VALIDATION_FAILED"}:e,n=new Error(t);return n.code=r,n}return e}}function $o(e,t){return function(e,t){return t.get?t.get.call(e):t.value}(e,Xo(e,t,"get"))}function Xo(e,t,r){if(!t.has(e))throw new TypeError("attempted to "+r+" private field on non-instance");return t.get(e)}var Yo=new WeakMap;class Ko{constructor(e){var t,r;r={writable:!0,value:void 0},function(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}(this,t=Yo),t.set(this,r),function(e,t,r){!function(e,t,r){if(t.set)t.set.call(e,r);else{if(!t.writable)throw new TypeError("attempted to set read only private field");t.value=r}}(e,Xo(e,t,"set"),r)}(this,Yo,e)}getSchemas(){return $o(this,Yo).get("schemas")}setSchemas(e){$o(this,Yo).set("schemas",e)}getDataStore(){return $o(this,Yo).get("dataStore")}setDataStore(e){$o(this,Yo).set("dataStore",e)}}function Zo(e,t,r){!function(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}(e,t),t.set(e,r)}function Qo(e,t){return function(e,t){return t.get?t.get.call(e):t.value}(e,ea(e,t,"get"))}function Jo(e,t,r){return function(e,t,r){if(t.set)t.set.call(e,r);else{if(!t.writable)throw new TypeError("attempted to set read only private field");t.value=r}}(e,ea(e,t,"set"),r),r}function ea(e,t,r){if(!t.has(e))throw new TypeError("attempted to "+r+" private field on non-instance");return t.get(e)}var ta=new WeakMap,ra=new WeakMap,na=new WeakMap,oa=new WeakMap;class aa{constructor(e){if(Zo(this,ta,{writable:!0,value:void 0}),Zo(this,ra,{writable:!0,value:void 0}),Zo(this,na,{writable:!0,value:void 0}),Zo(this,oa,{writable:!0,value:void 0}),e&&e.config){Jo(this,ta,e.config.dataset.collectionName),Jo(this,ra,e.items),Jo(this,na,e.schemas);const t=e.nextCursor||void 0,r=e.totalCount||0,n=(e.items||[]).length;Jo(this,oa,{cursor:t,total:r,loaded:n})}}getSchemas(){return Qo(this,na)}getDataStore(){if(Qo(this,ra))return(e=>{let{items:t,datasetSize:r,collectionId:n}=e;return{recordInfosInDatasetOrder:[{itemIds:t.map((e=>{let{_id:t}=e;return t})),datasetSize:r,collectionId:n}],recordsByCollectionId:{[n]:bo(t,{})}}})({items:Qo(this,ra),datasetSize:Qo(this,oa),collectionId:Qo(this,ta)})}getItems(){return Qo(this,ra)}}class ia{constructor(e){let{experiments:t,settings:{env:r}}=e;return{get fes(){return t.enabled("specs.wixDataViewer.EnableFES")},get warmupData(){return t.enabled("specs.wixDataViewer.UseWarmupData")&&r.live},get dropdownOptionsDistinct(){return t.enabled("specs.wixDataViewer.DropdownDistinctOptions")}}}}var sa=a(5546),ca=a(4970);const la=["extra"];function ua(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function da(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ua(Object(r),!0).forEach((function(t){pa(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ua(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function pa(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function fa(e,t){ga(e,t),t.add(e)}function ha(e,t,r){ga(e,t),t.set(e,r)}function ga(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}function ma(e,t){return function(e,t){return t.get?t.get.call(e):t.value}(e,wa(e,t,"get"))}function ya(e,t,r){if(!t.has(e))throw new TypeError("attempted to get private field on non-instance");return r}function va(e,t,r){return function(e,t,r){if(t.set)t.set.call(e,r);else{if(!t.writable)throw new TypeError("attempted to set read only private field");t.value=r}}(e,wa(e,t,"set"),r),r}function wa(e,t,r){if(!t.has(e))throw new TypeError("attempted to "+r+" private field on non-instance");return t.get(e)}const{USER_SCOPE:ba,APPLICATION_SCOPE:Oa,SERVER_SCOPE:Ia}=T.scopes,{DBSMViewer:{dsn:Ea},UserErrors:{dsn:Sa},WixData:{dsn:_a}}=sa,Pa={[Oa]:Ea,[ba]:Sa,[Ia]:_a};let Ta=function(e,t){return r=>{var n;return this.mode.dev?(e===Error&&(this.console.error(r),r.cause&&this.console.error("Caused by:",r.cause)),null===(n=r.run)||void 0===n?void 0:n.call(r)):t(r)}};var Ra=new WeakMap,Ca=new WeakMap,Da=new WeakMap,Aa=new WeakMap,ja=new WeakMap,xa=new WeakMap,Na=new WeakSet,Ma=new WeakSet,Fa=new WeakSet,ka=new WeakSet;class La{constructor(e){let{fedops:t,bi:r,monitor:n,verbose:o,console:a,global:i,settings:s}=e;fa(this,ka),fa(this,Fa),fa(this,Ma),fa(this,Na),ha(this,Ra,{writable:!0,value:void 0}),ha(this,Ca,{writable:!0,value:void 0}),ha(this,Da,{writable:!0,value:void 0}),ha(this,Aa,{writable:!0,value:void 0}),ha(this,ja,{writable:!0,value:void 0}),ha(this,xa,{writable:!0,value:void 0});const c=a.factory();Ta=Ta.bind({mode:s.mode,console:c}),va(this,Ra,ya(this,Na,Ua).call(this)),va(this,Ca,ya(this,Ma,Wa).call(this,t)),va(this,Da,ya(this,Fa,Va).call(this,{bi:r,settings:s})),va(this,Aa,ya(this,ka,Ga).call(this,{monitor:n,global:i,settings:s})),va(this,ja,o.factory()),va(this,xa,c)}log(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];if(t.length>1)return t.map((e=>this.log(e)));const[n]=t,[,o]=Array.from(ma(this,Ra)).find((e=>{let[t]=e;return t.prototype.isPrototypeOf(n)}))||[];return o?o(n):ma(this,xa).error("Oj-vej! This event is not supported by logger",n)}}function Ua(){return new Map([[Error,Ta(Error,(e=>{if(e instanceof x)ma(this,xa).warn("You have unhandled error in async operation. Consider catching it and handling accordingly.\n",e.cause);else{const{scope:t,cause:r,options:{extra:n}={}}=e,o=function(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r,n,o={},a=Object.keys(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)>=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}(e.options,la);e instanceof C&&(ma(this,xa).error(e),r&&ma(this,xa).error("Caused by:",r)),ma(this,Aa)[t].captureException(e,da({zone:t,extra:da({cause:r},n)},o))}}))],[Ge,Ta(Ge,(e=>{let{event:t,type:r}=e;return r===Ge.types.ERROR?ma(this,Da).errorLogger.log(t):ma(this,Da).logger.log(t)}))],[$e,Ta($e,(e=>{let{name:t,params:r,run:n,onStart:o,onEnd:a}=e;return o((()=>ma(this,Ca).interactionStarted(t,r))),a((()=>ma(this,Ca).interactionEnded(t,r))),n()}))],[Xe,Ta(Xe,(e=>{let{event:t}=e;return ma(this,Aa)[Oa].captureBreadcrumb(t)}))],[Qe,e=>{let{messages:t}=e;return ma(this,ja).log(...t)}],[et,e=>{let{message:t,level:r}=e;return ma(this,xa)[r](t)}]])}function Wa(e){let{factory:t,hooks:{start:r,end:n}}=e;return t.getLoggerForWidget({appId:"databinding",appName:"databinding",startHook:r,endHook:n})}function Va(e){let{bi:{factory:t},settings:{env:r}}=e;return{logger:t().logger({endpoint:r.editor?K.Z3:K._W}),errorLogger:t().logger({endpoint:K.rH})}}function Ga(e){let{monitor:{factory:t},global:r,settings:{metaSiteId:n,userId:o}}=e;return Object.entries(Pa).reduce(((e,a)=>{let[i,s]=a;const c=t(s);return e[i]=c,(0,ca.S)({dsn:s,Raven:c,globalScope:r,appName:Re,user:{id:o},params:{tags:{msid:n}}}),e}),{})}function Ba(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function qa(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Ba(Object(r),!0).forEach((function(t){za(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Ba(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function za(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Ha(e,t,r){!function(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}(e,t),t.set(e,r)}function $a(e,t){return function(e,t){return t.get?t.get.call(e):t.value}(e,Xa(e,t,"get"))}function Xa(e,t,r){if(!t.has(e))throw new TypeError("attempted to "+r+" private field on non-instance");return t.get(e)}var Ya=new WeakMap,Ka=new WeakMap,Za=new WeakMap,Qa=new WeakMap;class Ja{constructor(){Ha(this,Ya,{writable:!0,value:{}}),Ha(this,Ka,{writable:!0,value:{}}),Ha(this,Za,{writable:!0,value:{}}),Ha(this,Qa,{writable:!0,value:{}})}getData(e){let{datasetId:t,collectionId:r,includes:n}=e;const o=$a(this,Ya)[t];return o?{datasetSize:o.datasetSize,items:o.itemIds.map((e=>ei($a(this,Ka)[r][e],this.getSchema(r),n)))}:null}getRecord(e){var t;let{collectionId:r,recordId:n,includes:o}=e;const a=null===(t=$a(this,Ka)[r])||void 0===t?void 0:t[n];return a&&ei(a,this.getSchema(r),o)}updateCollectionData(e){let{collectionId:t,data:r}=e;const{[t]:n}=$a(this,Ka),{[t]:o}=$a(this,Za),{items:a,uniqueFieldValues:i}=r;$a(this,Ka)[t]=ti(a,n),$a(this,Za)[t]=ri(i,o)}getSchema(e){return $a(this,Qa)[e]}updateStore(e){let{recordsByCollectionId:t={},recordInfosByDatasetId:r={},uniqueFieldValuesByCollection:n={}}=e;var o,a;o=Ya,a=qa(qa({},$a(this,Ya)),r),function(e,t,r){if(t.set)t.set.call(e,r);else{if(!t.writable)throw new TypeError("attempted to set read only private field");t.value=r}}(this,Xa(this,o,"set"),a);for(const[e,r]of Object.entries(t))$a(this,Ka)[e]=qa(qa({},$a(this,Ka)[e]),r);for(const[e,t]of Object.entries(n))$a(this,Za)[e]=qa(qa({},$a(this,Za)[e]),t)}getStore(){return{recordInfosByDatasetId:$a(this,Ya),recordsByCollectionId:$a(this,Ka),uniqueFieldValuesByCollection:$a(this,Za)}}hasDataset(e){return Boolean($a(this,Ya)[e])}setUniqueFieldValues(e){let{collectionId:t,fieldKey:r,data:n}=e;$a(this,Za)[t]=qa(qa({},$a(this,Za)[t]),{},{[r]:n})}getUniqueFieldValues(e){var t;let{collectionId:r,fieldKey:n}=e;return null===(t=$a(this,Za)[r])||void 0===t?void 0:t[n]}updateSchemas(e){for(const[t,r]of Object.entries(e))$a(this,Qa)[t]=qa(qa({},$a(this,Qa)[t]),r)}getSchemas(){return $a(this,Qa)}}const ei=(e,t,r)=>Object.entries(e).reduce(((e,n)=>{let[o,a]=n;return((e,t)=>{var r,n;return(null==t||null===(r=t.fields)||void 0===r||null===(n=r[e])||void 0===n?void 0:n.type)===s.FieldType.reference})(o,t)&&((e,t)=>!e||!e.includes(t))(r,o)&&Boolean(null==a?void 0:a._id)?e[o]=a._id:e[o]=a,e}),{}),ti=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return e.reduce(((e,t)=>{const r=e[t._id];return e[t._id]=r?(0,ot.mergeWith)(r,t,wo):t,e}),t)},ri=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return qa(qa({},t),e)},ni=["cause"];function oi(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function ai(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?oi(Object(r),!0).forEach((function(t){ii(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):oi(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function ii(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function si(e,t){li(e,t),t.add(e)}function ci(e,t,r){li(e,t),t.set(e,r)}function li(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}function ui(e,t,r){if(!t.has(e))throw new TypeError("attempted to get private field on non-instance");return r}function di(e,t){return function(e,t){return t.get?t.get.call(e):t.value}(e,fi(e,t,"get"))}function pi(e,t,r){return function(e,t,r){if(t.set)t.set.call(e,r);else{if(!t.writable)throw new TypeError("attempted to set read only private field");t.value=r}}(e,fi(e,t,"set"),r),r}function fi(e,t,r){if(!t.has(e))throw new TypeError("attempted to "+r+" private field on non-instance");return t.get(e)}var hi=new WeakMap,gi=new WeakMap,mi=new WeakMap,yi=new WeakMap,vi=new WeakMap,wi=new WeakMap,bi=new WeakMap,Oi=new WeakSet,Ii=new WeakSet;class Ei{constructor(){si(this,Ii),si(this,Oi),ci(this,hi,{writable:!0,value:void 0}),ci(this,gi,{writable:!0,value:void 0}),ci(this,mi,{writable:!0,value:void 0}),ci(this,yi,{writable:!0,value:void 0}),ci(this,vi,{writable:!0,value:void 0}),ci(this,wi,{writable:!0,value:void 0}),ci(this,bi,{writable:!0,value:void 0});const{logger:e,dataFetcher:t}=k;pi(this,gi,t),pi(this,hi,e),pi(this,mi,new Ja),pi(this,yi,{}),pi(this,vi,Promise.resolve())}createInitialDataRequest(e){pi(this,yi,e.reduce(((e,t)=>{let{id:r,refresh:n}=t;return n||!di(this,mi).hasDataset(r)?ai(ai({},e),{},{[r]:new q}):e}),{}));const t=Object.entries(di(this,yi)).map((e=>{let[,{promise:t}]=e;return t}));pi(this,vi,ui(this,Ii,_i).call(this,t).then((()=>pi(this,yi,{}))))}async getInitialData(e){let{datasetId:t,collectionId:r,cursorPaging:n,filter:o,sort:a,length:i,includes:s,uniqueFieldValues:c}=e;return di(this,yi)[t]&&(di(this,yi)[t].resolve({datasetId:t,collectionId:r,cursorPaging:n,filter:o,sort:a,length:i,includes:s,uniqueFieldValues:c}),await di(this,vi)),di(this,mi).getData({datasetId:t,collectionId:r,includes:s})||this.getData({datasetId:t,collectionId:r,cursorPaging:n,filter:o,sort:a,offset:0,length:i,includes:s,uniqueFieldValues:c})}async getData(e){const{collectionId:t,cursorPaging:r,offset:n,filter:o,sort:a,includes:i,length:s,datasetSize:c,uniqueFieldValues:l}=e,u=e=>!this.getUniqueFieldValues({collectionId:t,fieldKey:e}),{items:d,totalCount:p,nextCursor:f,uniqueFieldValues:h}=await di(this,gi).fetchData({collectionId:t,offset:n,filter:o,sort:a,includes:i,cursor:r?null==c?void 0:c.cursor:void 0,length:s,uniqueFieldValues:l.filter((e=>u(e)))}).catch(Ti("Data fetching failed",{datasetConfig:e}));return await di(this,wi),di(this,mi).updateCollectionData({collectionId:t,data:{items:d,uniqueFieldValues:h}}),{items:d,datasetSize:{total:p,loaded:((null==c?void 0:c.loaded)||0)+d.length,cursor:f},uniqueFieldValues:h}}async remove(e){let{collectionId:t,recordId:r}=e;return di(this,gi).remove({collectionId:t,recordId:r}).catch(Ti("Record removing failed",{collectionId:t,recordId:r}))}async save(e){let{collectionId:t,record:r,includeReferences:n}=e;return di(this,gi).save({collectionId:t,record:r,includeReferences:n}).catch(Ti("Record saving failed",{collectionId:t,record:r,includeReferences:n}))}async getSibling(e){return await di(this,gi).getSibling(e)}async loadSchemas(e){const t=di(this,mi).getSchemas(),r=e.filter((e=>!t[e]));pi(this,wi,r.length?di(this,gi).fetchSchemas(r).catch(Ti("Schema fetching failed",{collectionIds:r})):Promise.resolve({}));const n=await di(this,wi);return di(this,mi).updateSchemas(ai(ai({},t),n)),di(this,mi).getSchemas()}async setSchemas(e){di(this,mi).updateSchemas(e)}getSchemas(){return di(this,mi).getSchemas()}getRecord(e){let{collectionId:t,recordId:r,includes:n}=e;return di(this,mi).getRecord({collectionId:t,recordId:r,includes:n})}getSchema(e){return di(this,mi).getSchema(e)}hasSchema(e){return Boolean(this.getSchema(e))}getReferencedSchemas(e){const t=this.getSchema(e),r=di(this,mi).getSchemas();return(e=>e?(0,ot.flow)((e=>(0,ot.pickBy)(e,(e=>{let{referencedCollection:t}=e;return Boolean(t)}))),(e=>(0,ot.map)(e,(e=>{let{referencedCollection:t}=e;return t}))),ot.uniq,(e=>e.filter(Boolean)))(e.fields):[])(t).reduce(((e,t)=>ai(ai({},e),{},{[t]:r[t]})),{})}setCollectionData(e){let{collectionId:t,data:r}=e;r&&di(this,mi).updateCollectionData({collectionId:t,data:r})}setStore(e){e&&di(this,mi).updateStore(e)}setStaticStore(e){const{recordsByCollectionId:t,recordInfosInDatasetOrder:r,uniqueFieldValuesByCollectionId:n}=e,o=di(this,bi).find((e=>{let{type:t}=e;return t===Ar}));if(o){const{datasetId:e}=o,a={[e]:r[0]};di(this,mi).updateStore({recordsByCollectionId:t,recordInfosByDatasetId:a,uniqueFieldValuesByCollectionId:n})}}getStore(){return di(this,mi).getStore()}setUniqueFieldValues(e){let{collectionId:t,fieldKey:r,data:n}=e;return di(this,mi).setUniqueFieldValues({collectionId:t,fieldKey:r,data:n})}getUniqueFieldValues(e){let{collectionId:t,fieldKey:r}=e;return di(this,mi).getUniqueFieldValues({collectionId:t,fieldKey:r})}createSimpleFilter(e,t){return di(this,gi).createSimpleFilter(e,t)}setDatasetConfigs(e){pi(this,bi,e)}}async function Si(e){try{const{recordsByCollectionId:t,recordInfosInDatasetOrder:r,uniqueFieldValuesByCollection:n}=await di(this,hi).log(new $e("dataset/fetchPrimaryInitialData",(()=>di(this,gi).fetchBulkData(e))));return{recordsByCollectionId:t,recordInfosByDatasetId:r.reduce(((t,r,n)=>{let{itemIds:o=[],error:a,nextCursor:i,totalCount:s}=r;const c=e[n];return a&&di(this,hi).log(new Pi("Initial data fetching failed for one of the datasets",{cause:a,extra:{datasetConfig:c}})),t[c.datasetId]={itemIds:o,datasetSize:{total:s,loaded:o.length,cursor:i}},t}),{}),uniqueFieldValuesByCollection:n}}catch(t){throw new R("Initial data fetching failed",{cause:t,extra:{datasetConfigs:e}})}}async function _i(e){if(e.length){const t=await Promise.all(e),r=await ui(this,Oi,Si).call(this,t);await di(this,wi),di(this,mi).updateStore(r)}}class Pi{constructor(e,t){let{cause:r}=t,n=function(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r,n,o={},a=Object.keys(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)>=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}(t,ni);return new(A.codes.includes(r.code)?A:j)(e,ai(ai({},n),{},{cause:r,code:r.code}))}}const Ti=(e,t)=>r=>{throw new Pi(e,{cause:r,extra:t})},Ri="PRIMARY";var Ci=a(476);const Di=e=>!Array.isArray(e)&&!(0,ot.isPlainObject)(e),Ai=function e(t,r){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];return t(r)?[{path:(0,ot.clone)(n),filterExpression:r}]:Di(r)?[]:(0,ot.flatMap)(r,((r,o)=>e(t,r,n.concat(o))))},ji=e=>t=>{let{filterId:r}=t;return jt.Maybe.fromNullable(e(r)).chain((e=>{let t,{masterDataset:r,fieldName:n}=e;try{t=r.api.getCurrentItem()}catch(e){}return jt.Maybe.fromNullable(t).map((e=>{const t=e[n];return void 0===t?null:t}))}))},xi=e=>Mi(e).chain((e=>{let[t,r]=e;return"$not"===t&&(0,ot.isArray)(r)?Ni({positive:!1,filterExpression:r[0]}):jt.Maybe.Nothing()})).orElse((()=>Ni({positive:!0,filterExpression:e}))),Ni=e=>{let{positive:t,filterExpression:r}=e;return Mi(r).chain((e=>{let[r,n]=e;return Mi(n).map((e=>{let[n,o]=e;return{field:r,condition:n,value:o,positive:t}}))}))},Mi=e=>{if(!(0,ot.isPlainObject)(e))return jt.Maybe.Nothing();const t=(0,ot.entries)(e)[0];return jt.Maybe.fromNullable(t)},{stringArray:Fi,number:ki}=s.FieldType,Li=(e,t)=>(0,ot.get)(e,t),Ui=e=>{let{previousRecord:t,currentRecord:r,fieldName:n}=e;return!(0,ot.isEqual)(Li(t,n),Li(r,n))},Wi=e=>{const{properties:t,events:r,behaviors:n}=e,o={};return(0,ot.forEach)(t,((e,t)=>{let{fieldName:r}=e;o[t]=r})),(0,ot.forEach)(r,((e,t)=>{let{action:r}=e;o[t]=r})),(0,ot.forEach)(n,(e=>{let{type:t}=e;o.text=t})),o},{mediaGallery:Vi}=s.FieldType,Gi="/_api/cm-server",Bi=("".concat(Gi,"/dbsm-editor-app"),"https://static.parastorage.com/services/dbsm-editor-app/1.329.0/".concat("locale/data-binding"),"".concat(Gi,"/auto-cms"),"datetime"),qi=e=>/^\d{2}:\d{2}:\d{2}\.\d{3}$/.test(e),zi=e=>e instanceof Date&&!isNaN(e),Hi=e=>{let{time:t,date:r}=e;const[n,o]=t.split(":");return r.setHours(n),r.setMinutes(o),r.setSeconds(0),r.setMilliseconds(0),r},$i=e=>"".concat(e.toTimeString().split(" ")[0],".000"),Xi=e=>{const t=new Date(e);return zi(t)?t:(e=>{const t=new Date;return t.setHours(0),t.setMinutes(0),t.setSeconds(0),t.setMilliseconds(0),t})()},Yi=e=>String(e).padStart(2,"0"),Ki=e=>[e.getFullYear(),Yi(e.getMonth()+1),Yi(e.getDate())].join("-"),Zi=e=>null==e||"function"!=typeof e.toString?"":Array.isArray(e)?e.join(", "):e.toString(),{mediaGallery:Qi,address:Ji,date:es}=s.FieldType;function ts(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function rs(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ts(Object(r),!0).forEach((function(t){ns(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ts(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function ns(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var os=function(e){var t=function(e){var t=0;if(void 0===e||0===e.length)return t;for(var r=0;r<e.length;r++)t=(t<<5)-t+e.charCodeAt(r),t|=0;return t*=Math.sign(t),t=Math.sqrt(t),Math.floor(1e6*(t-Math.floor(t)))}(e);return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(e,r){var n=Math.ceil(t/(r+1))%16;return("x"===e?n:3&n|8).toString(16)}))},as=function(e){return void 0===e&&(e=""),e?e.toString().toLowerCase().replace(/\s+/g,"-").replace(/[^\w\-\.]+/g,"").replace(/\-\-+/g,"-").replace(/^-+/,"").replace(/-+$/,""):""};function is(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function ss(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?is(Object(r),!0).forEach((function(t){cs(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):is(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function cs(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var ls=function(e,t){switch(typeof e){case"object":return{type:"wix",data:e};case"string":return{type:"web",url:e,target:t,text:e};default:return{target:"_blank",type:"none"}}},us=function(e){void 0===e&&(e={});var t={link:e.url};return e.url&&(t.target=e.target),t},ds=function(e){return null!==/^(wix:)?(image|video)(:\/\/)/.exec(e)},ps=function(e){return ds(e)?e.split("/")[3]:e},fs=function(e){try{return ds(e)?e.split("/")[4].split("#").slice(0,-1).join("#"):"_.jpg"}catch(e){return"_.jpg"}},hs=function(e,t){return"wix:image://v1/"+(e||as(t.name))+"/"+as(t.fileName||t.name)+"#originWidth="+t.width+"&originHeight="+t.height},gs=function(e,t){return"wix:video://v1/"+(e||as(t.name))+"/"+as(t.fileName||t.name)+"#posterUri="+t.posters[0].url+"&posterWidth="+t.width+"&posterHeight="+t.height},ms=function(e){var t={},r=!1;try{var n=/\/\d*_\d*\//.exec(e);if(n&&n[0]&&n[0].length>0){var o=n[0].replace(/\//g,"").split("_").map((function(e){return Number(e)})),a=o[0],i=o[1];a>0&&i>0&&(r=!0,t={originWidth:a,originHeight:i})}}catch(e){r=!1}if(!r)try{var s=/wm_(.*)\//.exec(e);if(s&&s[0]&&s[0].length>0){var c=s[1];c.length>0&&(t.watermark=c)}}catch(e){r=!1}if(!r)try{e.split("#").pop().split("&").map((function(e){return e.split("=")})).forEach((function(e){t[e[0]]=isNaN(Number(e[1]))?String(e[1]):Number(e[1])}))}catch(e){r=!1}return t};function ys(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function vs(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ys(Object(r),!0).forEach((function(t){ws(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ys(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function ws(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const{mediaGallery:bs,documentArray:Os}=s.FieldType,{reference:Is,dateTime:Es,date:Ss}=s.FieldType,_s=e=>{let{value:t,currentValue:r,fieldType:n,fieldName:o,role:a,utils:{referenceFetcher:i}={}}=e;const s=[{converter:e=>i(e,o),condition:n===Is},{converter:e=>((e,t)=>{const r={},n={};if(qi(e))r.time=e,r.date=new Date;else{const t=Xi(e);r.date=t,r.time=$i(t)}return qi(t)?n.time=t:n.date=Xi(t),Hi(rs(rs({},r),n))})(r,e),condition:n===Es&&[ce,me,le].includes(a)},{converter:Ki,condition:n===Ss&&a===ce},{converter:e=>(e=>{let{value:t,currentValue:r=[],fieldType:n}=e;switch(n){case bs:return[...r,...t.map((e=>{let{fileUrl:t,url:r}=e;return(e=>{let{uploadedFileUrl:t}=e;const{platform:{utils:{media:r}}}=k,n=r.parseMediaItemUri(t),o=r.createMediaItemUri(n).item,a=(void 0===s&&(s=0),function(e){return!!(e.src||e.type&&e.html)}(i=vs(vs({},n),{},{src:o}))?function(e,t){var r=ms(e.src);r.width=e.width||r.originWidth||r.originalWidth||r.posterWidth||1,r.height=e.height||r.originHeight||r.originalHeight||r.posterHeight||1;var n=e.settings&&e.settings.focalPoint,o=r.watermark,a=e.imageToken||e.token||r.token,i=(e.type||"image").toLowerCase(),s=ss({itemId:as(e.slug)||(as(e.title||e.id)||os(e.src||e.html||t))+"_"+t,mediaUrl:ps(e.src),metaData:Object.assign({type:i,alt:e.alt||"",title:e.title||"",description:e.description||"",name:fs(e.src),fileName:fs(e.src),link:ls(e.link,e.target),width:r.width,height:r.height,sourceName:"private"},n?{focalPoint:n}:{},o?{watermarkStr:o}:{}),orderIndex:t},a&&{token:a});if("text"===i){var c=e.style;s.metaData.height=r.height||500,s.metaData.width=r.width||500*c.layoutRatio,s.metaData.textStyle={width:s.metaData.width,height:s.metaData.height,backgroundColor:c.fillColor},s.metaData.html=s.editorHtml=e.html}if("video"===i){var l={};e.thumbnail&&(l=ms(e.thumbnail));var u=function(e){return null!==/^.*\.(jpeg|jpg|webp|png|jpe)$/.exec(e)}(ps(e.thumbnail))?ps(e.thumbnail):r.posterUri;s.metaData.posters=[{url:u,width:l.width||r.width,height:l.height||r.height}],s.isExternal=0===e.src.indexOf("http"),s.isExternal||ds(e.src)?(s.metaData.source=e.src.indexOf("youtube.com")>0?"youtube":e.src.indexOf("vimeo.com")>0?"vimeo":"wix",s.metaData.videoUrl=e.src):s.metaData.qualities=[{width:r.width,height:r.height,quality:r.height+"p",formats:[ds(e.src)?"wix":e.src.split(/#|\?/)[0].split(".").pop().trim()]}]}return s}(i,s):function(e,t){return{itemId:os(t+"_"+(e.uri||e.alt||t)),mediaUrl:e.uri||"",metaData:{height:e.height||1,lastModified:Date.now(),link:ls(e.link,e.target),title:e.title||"",description:e.description||"",alt:e.alt||"",sourceName:"private",tags:[],width:e.width||1},orderIndex:t}}(i,s));var i,s,c,l,u,d,p;return void 0===(c=a)&&(c={}),void 0===l&&(l=!0),l?function(e){void 0===e&&(e={});var t=e.metaData||e.metadata||{},r=us(t.link)||{},n=ss({type:t.type||"image",slug:e.itemId},r),o=n.type.toLowerCase();if("text"===o){var a=t.testStyle||{};Object.assign(n,{html:t.html,style:{width:a.width,height:a.height,bgColor:a.backgroundColor}})}else Object.assign(n,{title:t.title,description:t.description,alt:t.alt}),"image"===o?Object.assign(n,ss(ss({src:hs(e.mediaUrl,t),settings:Object.assign({},t.focalPoint?{focalPoint:t.focalPoint}:{})},"imageToken"in e&&{imageToken:e.imageToken}),"token"in e&&{token:e.token})):"video"===o&&Object.assign(n,{src:gs(e.mediaUrl,t),thumbnail:t.posters[0].url});return n}(c):(d=(u=c).metaData||u.metadata||{},p=us(d.link)||{},ss({uri:u.mediaUrl,description:d.description,alt:d.alt,title:d.title,height:d.height,width:d.width},p))})({uploadedFileUrl:t||r})}))];case Os:return[...r,...t.map((e=>{let{fileUrl:t,url:r}=e;return t||r}))];default:return t[0].fileUrl||t[0].url}})({value:e,currentValue:r,fieldType:n}),condition:a===ue}],c=s.reduce(((e,t)=>{let{converter:r,condition:n}=t;return n&&e.push(r),e}),[]);return(0,ot.flow)(c)(t)},Ps=e=>{let{value:t,role:r,fieldType:n,propPath:o,componentIsInput:a,format:i,utils:{formatter:c}={}}=e;return(0,ot.flow)([e=>(e=>{let{value:t,formatter:r,fieldType:n,format:o}=e;return o?(e=>{let{value:t,formatter:r,fieldType:n,format:o}=e;if(o.type===Bi){const e=n===s.FieldType.date,a=e?new Date(t):t;return zi(a)?r?r.formatDateTime(a,o.params.dateFormat,{timeZone:e?"UTC":void 0}):e&&"string"==typeof t?t:"":t}return t})({value:t,formatter:r,fieldType:n,format:o}):t})({value:e,formatter:c,fieldType:n,format:i}),e=>((e,t)=>{let{fieldType:r,role:n,componentIsInput:o,propPath:a}=t;const i=[{converter:e=>{let{formatted:t}=e;return t},condition:e&&r===Ji&&n!==he},{converter:Zi,condition:!o&&![oe,ne,ye,be].includes(n)},{converter:e=>(e=>{let{value:t}=e;const{platform:{utils:{media:r}}}=k,n=r.parseMediaItemUri(t);if(n.error)return t;switch(n.type){case r.types.IMAGE:return r.getScaleToFillImageURL(n.mediaId,n.width,n.height,n.width,n.height,{name:n.title});case r.types.VIDEO:return"https://video.wixstatic.com/video/".concat(n.mediaId,"/file");case r.types.AUDIO:return"https://static.wixstatic.com/mp3/".concat(n.mediaId);default:return t}})({value:e}),condition:"link"===a&&ge!==n},{converter:()=>[],condition:!e&&r===Qi},{converter:$i,condition:n===me&&zi(e)},{converter:e=>{const t=new Date(e);return null!==e&&zi(t)?t:""===e||null===e?void 0:e},condition:n===ce&&r===es}],s=i.reduce(((e,t)=>{let{converter:r,condition:n}=t;return n&&e.push(r),e}),[]);return(0,ot.flow)(s)(e)})(e,{fieldType:n,role:r,componentIsInput:a,propPath:o})])(t)},{Checkbox:Ts,Dropdown:Rs}=at,Cs=e=>e.type===Ts?"checked":"value",Ds=e=>{let{component:t,connectionConfig:r,currentRecord:n,previousRecord:o,getFieldType:a,formatter:i,modeIsLivePreview:s,logger:c,PresetVerboseMessage:l}=e;if(!n)return;const{role:u,isInput:d}=t,{properties:p={}}=r,f={};Object.entries(p).forEach((e=>{let[r,{fieldName:l,format:p}]=e;try{const e=a(l).getOrElse(""),c=Ps({value:Li(n,l),role:u,componentIsInput:d,fieldType:e,propPath:r,format:p,utils:{formatter:i}});if(f[r]=c,(e=>{let{previousRecord:t,currentRecord:r,fieldName:n}=e;return(e=>!e)(t)||Ui({previousRecord:t,currentRecord:r,fieldName:n})})({currentRecord:n,previousRecord:o,fieldName:l})){if(s&&(e=>void 0===e||""===e||Array.isArray(e)&&0===e.length)(c))return;t.setValue(c,{propPath:r,fieldType:e})}}catch(e){c.log(new R("Failed setting ".concat(r),{cause:e}))}})),c.log(new l(Qe.types.COMPONENT.FILLED,{component:t,description:f}))},As=e=>{let{getConnectedComponents:t,getFieldType:r}=e;return e=>{const n=t();if(!n)return jt.Maybe.Nothing();const o=n.filter((e=>{let{role:t}=e;return t===te}));return xi(e).map((e=>{let{field:t,condition:n,value:a,positive:i}=e;const s=((e,t)=>e.map((e=>e===ki&&"string"==typeof t&&/^[+-]?(?:\d+\.?\d*|\d*\.?\d+)$/.test(t.trim())?Number(t):e===Fi&&0===(0,ot.get)(t,"length",0)?null:t)).getOrElse(t))(r(t),((e,t)=>{const{filterId:r}=e,n=t.find((e=>e.connectionConfig.filters[r]));if(!n)return;const o=Cs(n);return n.getValue({propPath:o})})(a,o));if(!s&&0!==s)return{$and:[]};const c={[t]:{[n]:s}};return i?c:{$not:[c]}}))}};var js=a(2472),xs=a(1212),Ns=a(3728);const Ms=e=>(0,js.X)(e)||(0,xs.X)(e)||Fs(e),Fs=e=>xi(e).map((e=>{let{value:t}=e;return(0,Ns.X)(t)})).getOrElse(!1),ks=e=>Ai(xs.X,e),Ls=e=>!(0,ot.isEmpty)(Ai(Ns.X,e)),{WRITE:Us}=e,Ws=[ie],Vs=[ae],Gs=(e,t,r)=>{const{readWriteType:n,deferred:o,filter:a,collectionName:i}=e,s=n===Us,c=r.some((e=>{let{role:t}=e;return t===ee})),l=t===Ar,u=Boolean(o)&&!(c||l||s),d=a&&(e=>Ls(e)||(e=>!(0,ot.isEmpty)(Ai(js.X,e)))(e)||(e=>ks(e).length>0)(e))(a),p=(e=>{let{collectionId:t,datasetHasDynamicFilter:r,datasetIsDeferred:n,datasetIsRouter:o,datasetIsWriteOnly:a}=e;return t?r||n||o||a?"REGULAR":Ri:"UNCONFIGURED"})({collectionId:i,datasetHasDynamicFilter:d,datasetIsDeferred:u,datasetIsRouter:l,datasetIsWriteOnly:s});return{sequenceType:p,datasetIsWriteOnly:s,datasetIsMaster:c,datasetIsRouter:l,datasetIsDeferred:u,datasetHasDynamicFilter:d}},Bs=e=>{const t=e.reduce(((e,t)=>{var r,n;let{config:o,role:a,compId:i}=t;const s=null==o||null===(r=o.properties)||void 0===r||null===(n=r.value)||void 0===n?void 0:n.fieldName;if(!s)return e;const c="".concat(i,"-").concat(s);return Vs.includes(a)?(e.set(c,null),e):(Ws.includes(a)&&!e.has(c)&&e.set(c,s),e)}),new Map);return(0,ot.compact)(Array.from(t.values()))},qs=/[^{}]+(?=\})/g,zs=/\{[^{}]+\}/g,Hs=/[^\dA-Za-z]/g,$s=e=>e.replace(/(\/{2,})/g,"/").replace(/^\//,""),Xs=Symbol("isPristine"),Ys=["_id"];function Ks(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Zs(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Ks(Object(r),!0).forEach((function(t){Qs(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Ks(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function Qs(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Js=e=>e._id,ec=e=>Zs(Zs({},e),{},{[Xs]:!1}),tc=(e,t)=>Zs(Zs({},e),{},{_id:t||v.v4(),[Xs]:!0}),rc=(e,t)=>e&&t&&e._id===t._id,nc=e=>(0,ot.omit)(e,[Xs]),oc={chain:e=>t=>e.matchWith({Empty:()=>e,Results:e=>{let{items:r,datasetSize:n,offset:o}=e;return t({items:r,datasetSize:n,offset:o})}}),map:e=>t=>e.matchWith({Empty:()=>e,Results:e=>{let{items:r,datasetSize:n,offset:o}=e;const{items:a=r,datasetSize:i=n,offset:s=o}=t({items:r,datasetSize:n,offset:o});return ac.Results(a,i,s)}}),filter:e=>t=>e.matchWith({Empty:()=>e,Results:r=>{let{items:n,datasetSize:o,offset:a}=r;return t({items:n,datasetSize:o,offset:a})?e:ac.Empty()}}),orElse:e=>t=>e.matchWith({Empty:()=>t(),Results:()=>e}),get:e=>()=>e.matchWith({Empty:()=>({items:[],datasetSize:{total:0,loaded:0},offset:0}),Results:e=>e}),of:()=>ic},ac=(0,jt.union)("QueryResults",{Empty:()=>({}),Results:function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return{items:e,datasetSize:t,offset:r}}},oc);function ic(e){let{items:t,datasetSize:r,offset:n}=e;return r&&Math.max(r.total,r.loaded)>0&&Array.isArray(t)?ac.Results(t,r,n):ac.Empty()}const sc={Empty:ac.Empty,Results:ac.Results,fromWixDataQueryResults:function(e,t){return e?this.of({items:e.items,datasetSize:e.datasetSize,offset:t}):ac.Empty()},of:ic};function cc(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function lc(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?cc(Object(r),!0).forEach((function(t){uc(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):cc(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function uc(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const dc=e=>t=>lc(lc({},t),e),pc=(e,t)=>r=>t(e(r))(r),fc=(e,t,r)=>{const n=new Map;return function(){for(var o=arguments.length,a=new Array(o),i=0;i<o;i++)a[i]=arguments[i];const s=t(a),c=n.get(s);if(c&&r(a,c.args))return c.result;const l=e.apply(this,a);return n.set(s,{args:a,result:l}),l}};function hc(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function gc(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?hc(Object(r),!0).forEach((function(t){mc(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):hc(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function mc(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const yc=e=>dc({records:e}),vc=e=>t=>{var r,n,o;return gc(gc({},t),{},{datasetSize:{cursor:null===(r=t.datasetSize)||void 0===r?void 0:r.cursor,total:((null===(n=t.datasetSize)||void 0===n?void 0:n.total)||0)+e,loaded:((null===(o=t.datasetSize)||void 0===o?void 0:o.loaded)||0)+e}})},wc=e=>{let{cursor:t,loaded:r,total:n}=e;return e=>gc(gc({},e),{},{datasetSize:{cursor:t,loaded:r+Ec(e),total:n+Ec(e)}})},bc=e=>gc(gc({},e),{},{numSeedRecords:e.records.length}),Oc=e=>e.matchWith({Empty:()=>wc({total:0,loaded:0}),Results:e=>{let{items:t,datasetSize:r}=e;return(0,ot.flow)(yc(t.map((e=>Js(e)))),wc(r),bc)}}),Ic=e=>t=>gc(gc({},t),{},{newRecordMarkers:e(t.newRecordMarkers)}),Ec=(e,t)=>e.newRecordMarkers.filter((e=>null==t||e<=t)).length,Sc=function(e,t){let{overwrite:r=!0,fixIndex:n=!0}=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const o=o=>{const a=e+(n?Ec(o,e):0),i=Math.max(0,a-o.records.length),s=a+(r?t.length:0);return o.records.slice(0,a).concat(new Array(i)).concat(t.map((e=>Js(e)))).concat(o.records.slice(s))};return pc(o,yc)};function _c(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Pc(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?_c(Object(r),!0).forEach((function(t){Tc(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):_c(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function Tc(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Rc=(e,t,r)=>n=>Object.assign({},e(n),...r.map((e=>({[t(e)]:e})))),Cc=(e,t,r)=>n=>Pc(Pc({},e(n)),{},{[t]:r(e(n)[t])}),Dc=(e,t)=>r=>Object.assign({},...Object.keys(e(r)).filter((e=>e!==t)).map((t=>({[t]:e(r)[t]})))),Ac=e=>dc({records:e}),jc=e=>dc({drafts:e}),xc=(0,ot.curry)(((e,t,r)=>dc({scopes:Pc(Pc({},r.scopes),{},{[e]:t})})(r))),Nc=e=>t=>t.scopes[e],Mc=e=>pc(Rc((e=>{let{records:t}=e;return t}),Js,e),Ac),Fc=e=>pc(Dc((e=>{let{drafts:t}=e;return t}),Js(e)),jc),kc=()=>jc({}),Lc=e=>e.matchWith({Empty:()=>e=>e,Results:e=>{let{items:t}=e;return t.length>0?Mc(t):e=>e}}),Uc=(e,t,r,n)=>{const o=t.records[e],a=t.drafts[e],i=(0,ot.isPlainObject)(o),s=(0,ot.isPlainObject)(a);return i&&s?(e=>{let{record:t,draft:{_id:r},includes:n,nestedFieldKeys:o}=e,a=function(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r,n,o={},a=Object.keys(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)>=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}(e.draft,Ys);const i=Object.keys(a).filter((e=>(e=>{let{record:t,draft:r,includes:n,nestedFieldKeys:o,fieldKey:a}=e;return(e=>{let{includes:t,nestedFieldKeys:r,fieldKey:n}=e;const o=null==t?void 0:t.includes(n),a=r.includes(n);return o||a})({includes:n,nestedFieldKeys:o,fieldKey:a})&&(e=>{let{record:t,draft:r,fieldKey:n}=e;return(0,ot.isPlainObject)(t[n])&&(0,ot.isPlainObject)(r[n])})({record:t,draft:r,fieldKey:a})})({record:t,draft:a,includes:n,nestedFieldKeys:o,fieldKey:e}))),s=Zs(Zs({},t),a);return i.reduce(((e,r)=>Zs(Zs({},e),{},{[r]:(0,ot.merge)({},t[r],a[r])})),s)})({record:o,draft:a,includes:r,nestedFieldKeys:n}):i?Pc({},o):s?Pc({},a):null},Wc=(0,ot.curry)(((e,t,r)=>Object.keys(r.scopes).filter((e=>t(r.scopes[e],e))).map((t=>e(r.scopes[t],t))))),Vc=(0,ot.curry)((function(e,t,r,n,o,a){let i=arguments.length>6&&void 0!==arguments[6]&&arguments[6];const{records:s,datasetSize:c}=Nc(e)(a),l=r-t,u=s.slice(t,r),d=u.reduce(((e,t)=>{const r=Uc(t,a,n,o);return null!=r?e.concat(nc(r)):e}),[]);return sc.of({items:d,datasetSize:c,offset:t}).filter(p);function p(e){let{items:t}=e;return i||t.length>=l}})),Gc=(0,ot.curry)(((e,t)=>pc((0,ot.flow)(Nc(e),t),xc(e))));function Bc(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function qc(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Bc(Object(r),!0).forEach((function(t){zc(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Bc(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function zc(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Hc=(0,ot.curry)(((e,t)=>dc({[e]:t}))),$c=e=>t=>t[e],Xc=(0,ot.curry)(((e,t)=>pc((0,ot.flow)($c(e),t),Hc(e)))),Yc=e=>{let{recordStore:t}=e;return t().fold((()=>null),(e=>e.isCursorPaging()))},Kc=e=>{let{state:t}=e;const{size:r}=cn(t);return r},Zc=e=>{let{state:t}=e;const{offset:r}=cn(t);return r},Qc=e=>{let{state:t}=e;const{size:r,numPagesToShow:n}=cn(t);return r*n},Jc=e=>{let{state:t}=e;const r=In(t);return null==r?null:r},el=e=>{let{state:t}=e;if(null==Jc({state:t}))return null;const{size:r,offset:n,numPagesToShow:o}=cn(t);return n/r+o},tl=e=>{let{recordStore:t}=e;return t().fold((()=>null),(e=>e.getDatasetSize()))},rl=e=>{let{state:t,recordStore:r}=e;const n=tl({recordStore:r});return n?Math.ceil(n.total/Kc({state:t})):null},nl=e=>{let{recordStore:t}=e;return t().fold((()=>!1),(e=>{const t=e.getDatasetSize();return e.isCursorPaging()&&!(null==t||!t.cursor)}))},ol=e=>{let{state:t}=e;const r=Jc({state:t});return null!=r&&r>0},al=e=>{let{state:t,recordStore:r}=e;if(nl({recordStore:r}))return!0;const n=tl({recordStore:r});if(!n)return!1;const o=Jc({state:t});return null!=o&&o<n.total-1},il=e=>{let{state:t}=e;const{offset:r}=cn(t);return r>0},sl=e=>{let{state:t,recordStore:r}=e;if(nl({recordStore:r}))return!0;const n=tl({recordStore:r});if(!n)return!1;const{offset:o,size:a}=cn(t);return o+a<n.total},cl=e=>{let{state:t}=e;const r=Jc({state:t});return null==r?0:r+1},ll=async e=>{let{index:t,recordStore:r}=e;await r().fold((()=>{}),(e=>e.getRecords(t,1)))},ul=["items"],dl=["items"],pl=["items"];function fl(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function hl(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?fl(Object(r),!0).forEach((function(t){gl(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):fl(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function gl(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function ml(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r,n,o={},a=Object.keys(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)>=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}const yl=e=>e===nt,vl=e=>{let[{datasetId:t}]=e;return t},wl=(e,t)=>{let[r]=e,[n]=t;return(0,ot.every)(r,((e,t)=>"filter"===t?((e,t)=>JSON.stringify(e)===JSON.stringify(t))(e,n[t]):e===n[t]))},bl=e=>{let{primaryDatasetId:t,recordStoreCache:r,refreshStoreCache:n,dataProvider:o,mainCollectionName:a,includes:i,nestedFieldKeys:c,uniqueFieldValues:l,readWriteType:u,cursorPagingRequired:d}=e;const{breadcrumbReporting:p}=k,f=()=>r[t],h=e=>{r[t]=e};((0,ot.isEmpty)(f())||n||yl(u))&&h((e=>({[e]:qc({},{records:{},drafts:{},scopes:{}})}))(a));const g=[],m=fc((e=>{let{pageSize:t,sort:r,filter:n,datasetId:m,referencedCollectionName:y,fixedRecordId:v}=e;const w=null!=y?y:a,b=JSON.stringify({filter:n,sort:r}),O=$c(w),I=Xc(w),E=(0,ot.flow)(O,Nc(b)),S=Gc(b),_=()=>o.getSchema(w),P=e=>e-e%t,T=(0,ot.memoize)((e=>{let{offset:t,length:a,datasetSize:s}=e;return o.getData({datasetId:m,length:a,collectionId:w,cursorPaging:N.isCursorPaging(),offset:t,filter:n,sort:r,includes:null!=y?void 0:i,uniqueFieldValues:l,datasetSize:s}).then((e=>({items:e.items,datasetSize:e.datasetSize,offset:t})))}),(e=>{let{offset:t,length:r,datasetSize:n}=e;return[t,r,null==n?void 0:n.cursor].join("-")})),R=(e,t,r)=>Ci(jt.Result,g.map((n=>jt.Result.try((()=>n(null!=e?nc(e):null,null!=t?nc(t):null,r)))))),C=function(e,t,r){const n=E(f()).records[r],o=Uc(n,O(f()),i,c);if(null==o)return t();{const t=function(){h((0,ot.flow)(...arguments)(f()))},u=e=>{const t=Uc(n,O(f()),i,c);return(0,ot.isEqual)(o,t)?jt.Result.Ok([]):R(o,t,e)};for(var a=arguments.length,s=new Array(a>3?a-3:0),l=3;l<a;l++)s[l-3]=arguments[l];return e({update:t,notifyIfChanged:u},o,r,...s)}},D=(e,t)=>function(r){for(var n=arguments.length,o=new Array(n>1?n-1:0),a=1;a<n;a++)o[a-1]=arguments[a];return C(e,t,r,...o)},A=(e,t)=>async function(r){for(var n=arguments.length,o=new Array(n>1?n-1:0),a=1;a<n;a++)o[a-1]=arguments[a];return C(e,t,r,...o)},j=(e,t)=>p(t,Xe.with({category:"recordStore",message:e,data:{datasetId:m,scope:b}})),x=e=>{return e&&(t=Js(e),!O(f()).records[t]);var t},N={getRecords:j("getRecords",(async(e,r)=>{const{datasetSize:n}=E(f()),o=(e=>{let{from:t,length:r,datasetSize:n,cursorPaging:o}=e;if(!n)return t+r;const{total:a,loaded:i,cursor:s}=n,c=o?s?1/0:i:a;return Math.min(t+r,c)})({from:e,length:r,datasetSize:n,cursorPaging:N.isCursorPaging()}),a=Vc(b,e,o,i,c),l=yl(u)||!n||(e=>{let{loaded:t,total:r,cursor:n}=e;return!t&&!r&&!n})(n);return a(O(f()),l).orElse((async()=>{const r=await((e,r,n)=>{const o=N.isCursorPaging()?0:P(r),a=(i=r,c=n,Math.ceil((P(i)+(c-P(i)))/t)*t);var i,c;const l=_o(_())||s.DefaultMaxPageSize[N.getPaging()],u=((e,t,r)=>{const n=e.records.slice(t,r),o=n.findIndex(d),a=((e,t)=>{if(t.length>0)for(let r=t.length-1;r>=0;r-=1)if(e(t[r]))return r;return-1})(d,n),i=p(o,t),s=p(a,r),c=Ec(e,i),l=i-c,u=s-c-l;return 0===u?jt.Maybe.Nothing():jt.Maybe.Just({offset:l,length:u});function d(e){return"string"!=typeof e}function p(t,r){return-1===t?Math.max(e.records.length,r):o+r}})(e,o,a);return d=u.map((e=>{let{offset:t,length:r}=e;return r<=l?[{offset:t,length:r}]:(0,ot.flatten)((0,ot.times)(Math.ceil(r/l),(e=>[{offset:t+e*l,length:Math.min(l,r-e*l)}])))})).getOrElse([]),N.isCursorPaging()?(async e=>{const t=[];let{datasetSize:r}=E(f());for(const{offset:n,length:o}of e){const e=await T({offset:n,length:o,datasetSize:r});if(t.push(e),r=e.datasetSize,!r.cursor)break}return t})(d):Promise.all(d.map((e=>{let{offset:t,length:r}=e;return T({offset:t,length:r})})));var d})(E(f()),e,o),n=I((0,ot.flow)(...r.map((e=>{let{items:t,datasetSize:r,offset:n}=e;return sc.fromWixDataQueryResults({items:t,datasetSize:r},n)})).map((e=>(0,ot.flow)(Lc(e),S(e.matchWith({Empty:()=>wc({total:0,loaded:0}),Results:e=>{let{items:t,datasetSize:r,offset:n}=e;return(0,ot.flow)(wc(r),t.length>0?Sc(n,t):e=>e)}}))))))),i=f();var c,l;return h(n(f())),c=O(i),l=O(f()),Object.keys(c.records).filter((e=>(0,ot.isPlainObject)(l.records[e])&&l.records[e]._updatedDate>c.records[e]._updatedDate)).forEach((e=>R(c.records[e],l.records[e]))),a(O(f()),!0)}))})),getRecordsLimitedByMaxPageSize:(e,t)=>{const r=Math.min(t,_o(_())||t);return N.getRecords(e,r)},seed:j("seed",(()=>0===E(f()).numSeedRecords?(v?o.getData({datasetId:m,length:t,collectionId:w,cursorPaging:void 0,offset:0,filter:n,sort:r,includes:null!=y?void 0:i,uniqueFieldValues:l}):o.getInitialData({datasetId:m,collectionId:w,filter:n,sort:r,includes:i,length:t,uniqueFieldValues:l})).then((e=>{const t=sc.fromWixDataQueryResults(e,0),r=I((0,ot.flow)(Lc(t),S(Oc(t))));h(r(f()))})):Promise.resolve())),getTheStore:f,getPaging:()=>(e=>{var t,r,n;let{schema:o,cursorPagingPreferred:a}=e;const i=null==o||null===(t=o.pagingMode)||void 0===t?void 0:t.includes(s.PagingMode.Offset),c=null==o||null===(r=o.pagingMode)||void 0===r?void 0:r.includes(s.PagingMode.Cursor);return 1===(null==o||null===(n=o.pagingMode)||void 0===n?void 0:n.length)&&c||i&&c&&a?s.PagingMode.Cursor:s.PagingMode.Offset})({schema:_(),cursorPagingPreferred:d}),isCursorPaging:()=>N.getPaging()===s.PagingMode.Cursor,getSeedRecords:j("getSeedRecords",(()=>Vc(b,0,E(f()).numSeedRecords,i,c,O(f()),!0))),getDatasetSize:j("getDatasetSize",(()=>E(f()).datasetSize)),getRecordById:j("getRecordById",(e=>jt.Maybe.fromNullable(O(f()).records[e]))),removeRecord:j("removeRecord",A((async(e,t,r)=>{let{update:n,notifyIfChanged:a}=e;const i=Js(t);!x(t)&&i&&await o.remove({collectionId:w,recordId:i}),T.cache.clear();const s=Wc(((e,t)=>{return Gc(t,(0,ot.flow)((n=i,pc((e=>e.records.filter((e=>e!==n))),yc)),vc(-1),Ic((r=((e,t)=>t.records.indexOf(e))(i,e),e=>e.filter((e=>e!==r))))));var r,n}),(c=i,e=>e.records.includes(c)),O(f()));var c;return n(I((0,ot.flow)((0,ot.flow)(Fc(t),(e=>pc(Dc((e=>{let{records:t}=e;return t}),e),Ac))(i)),...s))),a()}),(()=>Promise.resolve(jt.Result.Error("cannot remove record: index not found"))))),reset:j("reset",(()=>{T.cache.clear(),h(I((0,ot.flow)(xc(b,{records:[],numSeedRecords:0,newRecordMarkers:[]}),kc()))(f()))})),newRecord:j("newRecord",((e,t)=>{const r=tc(t),n=I((0,ot.flow)((e=>pc(Rc((e=>{let{drafts:t}=e;return t}),Js,[e]),jc))(r),S((0,ot.flow)(vc(1),dc({newRecordMarkers:[e]}),Sc(e,[r],{overwrite:!1,fixIndex:!1})))));return h(n(f())),R(null,r),nc(r)})),saveRecord:j("saveRecord",A((async(e,t,r)=>{let{update:n,notifyIfChanged:a}=e;const i=await o.save({collectionId:w,record:nc(t),includeReferences:!0});return n(I((0,ot.flow)((e=>Mc([e]))(i),Fc(t),S((0,ot.flow)(((e,t)=>Sc(e,[t],{fixIndex:!1}))(r,i),Ic((e=>e.filter((e=>e!==r))))))))),a(),nc(i)}),(()=>Promise.reject(new Error("cannot save record: index not found"))))),setFieldsValues:j("setFieldsValues",D(((e,t,r,n,o)=>{let{update:a,notifyIfChanged:i}=e;return Object.keys(n).length&&a(I(((e,t)=>pc(Cc((e=>{let{drafts:t}=e;return t}),e,(0,ot.flow)(ec,(e=>t=>Object.entries(e).reduce(((e,t)=>{let[r,n]=t;return(0,ot.set)(e,r,n)}),(0,ot.cloneDeep)(t)))(t))),jc))(Js(t),n))),i(o)}),(()=>jt.Result.Error("cannot update field values: index not found")))),isPristine:j("isPristine",D(((e,t)=>(e=>"boolean"!=typeof e[Xs]||e[Xs])(t)),(()=>!0))),hasDraft:j("hasDraft",D(((e,t)=>(e=>"boolean"==typeof e[Xs])(t)),(()=>!1))),isNewRecord:j("isNewRecord",D(((e,t)=>x(t)),(()=>!0))),clearDrafts:j("clearDrafts",(()=>{h(I(kc())(f()))})),resetDraft:j("resetDraft",D(((e,t,r,n)=>{let{update:o,notifyIfChanged:a}=e;return o(I(x(t)?((e,t)=>pc(Cc((e=>{let{drafts:t}=e;return t}),Js(e),(e=>tc(t,e._id))),jc))(t,n):Fc(t))),a()}),(()=>jt.Result.Error("cannot reset draft: index not found")))),hasSeedData:j("hasSeedData",(()=>E(f()).numSeedRecords>0)),getUniqueFieldValues:j("getUniqueFieldValues",(e=>o.getUniqueFieldValues({collectionId:w,fieldKey:e})))};if(O(f())||h(Hc(w,{records:{},drafts:{},scopes:{}})(f())),!O(f()).scopes[b]){const e=[];if(v){const t=o.getRecord({collectionId:w,recordId:v,includes:i})||Uc(v,O(f()),i,c),r=t?[t]:[],n=r.length>0?sc.of({items:r,offset:0,datasetSize:{loaded:r.length,total:r.length}}):sc.Empty(),a=n.matchWith({Empty:jt.Maybe.Nothing,Results:(0,ot.flow)(sc.of,jt.Maybe.Just)});(0,ot.some)(r,x)&&e.push(Lc(n)),a.fold((()=>{e.push(xc(b,{records:[],numSeedRecords:0,newRecordMarkers:[]}))}),(t=>{e.push(xc(b,Oc(t)({records:[],numSeedRecords:0,newRecordMarkers:[]})))}))}else e.push(xc(b,{records:[],numSeedRecords:0,newRecordMarkers:[]}));h(I((0,ot.flow)(...e))(f()))}return N.externalApi={getRecords:async(e,t)=>(await N.getRecords(e,t)).map((e=>{let{items:t}=e,r=ml(e,ul);return hl({items:(0,ot.cloneDeep)(t)},r)})),getSeedRecords:()=>N.getSeedRecords().map((e=>{let{items:t}=e,r=ml(e,dl);return hl({items:(0,ot.cloneDeep)(t)},r)})),getRecordsLimitedByMaxPageSize:async(e,t)=>(await N.getRecordsLimitedByMaxPageSize(e,t)).map((e=>{let{items:t}=e,r=ml(e,pl);return hl({items:(0,ot.cloneDeep)(t)},r)}))},N}),vl,wl);var y;return m.onChange=(y=g,e=>(y.push(e),()=>{const t=y.indexOf(e);t>=0&&y.splice(t,1)})),m};var Ol=a(845);const Il=(0,jt.union)("GoToIndexResult",{Record:(e,t)=>({index:e,record:t}),InvalidIndex:()=>({}),NoRecord:()=>({})}),El=function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return{type:$t,index:e,suppressRefreshView:t}},Sl=(e,t)=>({type:Gt,fieldsToUpdate:e,updateSource:t}),_l=e=>({type:ar,atIndex:e}),Pl=()=>({type:sr}),Tl=async(e,t,r,n)=>{const o=await e(n).fold((()=>sc.Empty()),(e=>e.externalApi.getRecords(t,r)));return o.get()},Rl=(e,t)=>Tl(e,Zc({state:t}),Qc({state:t})),Cl={doFetch:Tl,fetchCurrentPage:Rl,flushDraft:()=>({type:tr}),goToRecordByIndexResult:(e,t)=>({type:Zt,error:e,payload:t}),incrementNumOfPagesToShow:()=>({type:zt}),initWriteOnly:e=>e?El(0):_l(0),loadPage:e=>({type:Kt,pageNumber:e}),newRecord:_l,newRecordResult:(e,t)=>({type:ir,error:e,payload:t}),nextPage:()=>({type:Xt}),previousPage:()=>({type:Yt}),reInitWriteOnly:()=>_l(0),refresh:Pl,refreshCurrentRecord:()=>({type:Bt}),refreshCurrentView:()=>({type:qt}),refreshResult:(e,t)=>({type:Zt,error:e,payload:t}),remove:()=>({type:nr}),removeCurrentRecordResult:(e,t)=>({type:or,error:e,payload:t}),revert:()=>({type:Jt}),revertResult:(e,t)=>({type:er,error:e,payload:t}),saveRecordResult:(e,t)=>({type:rr,error:e,payload:t}),setCurrentIndex:El,setCurrentRecord:(e,t,r)=>({type:Vt,record:e,recordIndex:t,updateSource:r}),setDefaultRecord:e=>({type:Ht,record:e}),updateCurrentViewResult:(e,t)=>({type:Qt,error:e,payload:t}),updateFields:Sl,GoToIndexResult:Il},Dl=e=>({type:fr,isDatasetReady:e});var Al=a(729);const{READ:jl,WRITE:xl,READ_WRITE:Nl}=e,Ml={[jl]:"read-only",[xl]:"write-only",[Nl]:"read-write"},Fl=(e,t,r)=>{if(!un(e()))throw new D("Operation (".concat(t,r===Ar?") is not allowed because the field used to build this page's URL is empty":") not allowed on an unconfigured dataset"),{code:"OPERATION_NOT_ALLOWED"})},kl=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];const n=ln(e());if(!(0,ot.includes)(r,n))throw new D("Operation (".concat(t,") not allowed on ").concat(Ml[n]," dataset"),{code:"OPERATION_NOT_ALLOWED"})},Ll=(e,t)=>{if(e)throw new D("Operation (".concat(t,") not allowed on a dataset with non-offset paging mode"),{code:"OPERATION_NOT_ALLOWED"})},Ul=(e,t)=>{if(r=e(),Cr.isDuringSave(r.records))throw new D("Operation (".concat(t,") not allowed during save"),{code:"OPERATION_NOT_ALLOWED"});var r},Wl=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",r=arguments.length>2?arguments[2]:void 0,n=arguments.length>3?arguments[3]:void 0,o=!(arguments.length>4&&void 0!==arguments[4])||arguments[4];Fl(e,t,n),kl(e,t,r),o||Ul(e,t)},Vl=(e,t)=>{if(!(0,ot.isNumber)(t))throw new D("Parameter (".concat(e,") must be a number"),{code:"DS_INVALID_ARGUMENT"})},Gl=(e,t)=>{if(!(0,ot.isInteger)(t)||t<1)throw new D("Parameter (".concat(e,") must be a positive integer number"),{code:"DS_INVALID_ARGUMENT"})},Bl=e=>{let{index:t,datasetSize:{total:r,loaded:n}}=e;if(t<0||t>Math.max(r,n))throw new D("Invalid index",{code:"DS_INDEX_OUT_OF_RANGE"})},ql=(e,t)=>{if(!(0,ot.isFunction)(t))throw new D("The callback passed to (".concat(e,") must be a function"),{code:"DS_INVALID_ARGUMENT"})},zl=(e,t)=>{if(!dn(e()))throw new D("The dataset didn't load yet. You need to call ".concat(t," inside the onReady for the dataset."),{code:"DS_NOT_LOADED"})},Hl=e=>{if(null==Jc({state:e()}))throw new D("There is no current item",{code:"DS_NO_CURRENT_ITEM"})},$l=(e,t)=>{if(e)throw new D('The "'.concat(t,'" function cannot be called on the dataset because the dataset was selected using a repeated item scope selector.\nRead more about repeated item scope selectors: http://wix.to/94BuAAs/$w.Repeater.html#repeated-item-scope'),{code:"OPERATION_NOT_ALLOWED"})},Xl=(e,t)=>{if(e!==Ar)throw new D('"'.concat(t,'" function on the dataset is not allowed. "').concat(t,'" can only be called on a Dynamic Page Dataset.'),{code:"OPERATION_NOT_ALLOWED"})},{READ:Yl,WRITE:Kl,READ_WRITE:Zl}=e,Ql=["siteButtonRole","imageButtonRole","stylableButtonRole"],Jl=[ie,te,ve,...De],eu=e=>e.filter((e=>{let{role:t,isInput:r}=e;return r&&!Jl.includes(t)})),tu=(e,t)=>e.filter((e=>{let{role:t}=e;return(0,ot.includes)(Ql,t)})).filter((e=>{let{connectionConfig:r}=e;return(0,ot.includes)(t,(0,ot.get)(r,"events.onClick.action"))})),ru=(e,t,r,n)=>{e.enabled!==t&&(t?e.enable():e.disable(),r.log(new Xe({category:"components",message:"".concat(e.id," changed to ").concat(t?"enabled":"disabled"," (dataset: ").concat(n,")")})))};var nu=a(4786);const ou=e=>(0,ot.isEqual)(!1,e),au=e=>Kc({state:e}),iu=e=>Rn(e).shouldLoadUrl(),su=e=>Cn(e).shouldLoadUrl(),cu=async e=>{let{dataProvider:t,collectionName:r,directionTowardSibling:n,useLowerCaseDynamicPageUrl:o,dynamicPagesData:{dynamicUrl:a,userDefinedFilter:i,dynamicUrlPatternFieldsValues:s,sort:c,sortFields:l,patternFields:u}={}}=e;if(null==a||!u.length)return null;const d=await t.getSibling({collectionName:r,sort:c,sortFields:l,directionTowardSibling:n,fieldValues:s,filter:i});return d&&((e,t,r)=>"/"+$s(t).replace(zs,(t=>{const n=t.substring(1,t.length-1),o=r?String(e[n]).toLowerCase():e[n];return encodeURIComponent("".concat(o).replace(/ /g,"-"))})))(d,a,o)},lu=(e,t)=>{try{return uu(e(t))}catch(e){return du(e)}},uu=e=>({value:e,then:t=>lu(t,e),catch:()=>uu(e)}),du=e=>({error:e,then:()=>du(e),catch:t=>lu(t,e)}),pu={resolve:uu,reject:du},fu=(e,t,r)=>{var n;return t===r||(null===(n=e[t])||void 0===n?void 0:n.some((t=>fu(e,t,r))))},hu=(e,t)=>{let{repeaterId:r,itemId:n}=t;return[e,"componentId",r,"itemId",n].join("_")},gu=e=>e.split("_componentId_")[0],mu=({detailsDatasetApis:e,masterDatasetApi:t,controllerConfig:r,unsubscribeHandlers:n})=>{const{logger:o}=k;e.forEach((e=>{const a=()=>{n.push(yu({masterDatasetApi:t,masterDatasetConfig:r,detailsDatasetApi:e}))};try{n.push(t.onReady(a))}catch(e){o.log(new et(new D("The dataset cannot filter by the dynamic dataset because the field used to build this page's URL is empty",{code:"DS_EMPTY_URL_FIELD",cause:e}),"error"))}}))},yu=({masterDatasetConfig:e,masterDatasetApi:t,detailsDatasetApi:r})=>{const n=gr(e.dataset);let o,a;return n!==nt&&(o=t.onCurrentIndexChanged((()=>r.refresh()))),n!==rt&&(a=t.onItemValuesChanged((()=>r.refresh()))),()=>[o,a].forEach((e=>null==e?void 0:e()))},{richText:vu}=s.FieldType,wu={$text:e=>e.map((e=>e===vu?"html":"text")).getOrElse("text")},bu=e=>({id:e.id,role:e.role,isValidConnection:()=>!0,bind:()=>{},clear:()=>e.clear(),hide:()=>e.hide(),show:t=>e.show(t),resetUserFilter:()=>{},onRecordsLoaded:async()=>{},onCurrentViewChanged:async()=>{},onCurrentIndexChanged:async()=>{},onCurrentRecordModified:async()=>{}}),Ou=e=>!!e&&Object.values(e).some((e=>!(0,ot.isEmpty)(e))),Iu=(e,t,r)=>{const{logger:o,platform:{location:a,utils:i,executeTpaAction:s}}=k,{getState:c,getFieldType:l,wixFormatter:u,modeIsLivePreview:d,PresetVerboseMessage:p}=r,f=r=>{Ds({currentRecord:On(c()),previousRecord:r,component:e,connectionConfig:t,formatter:u,modeIsLivePreview:d,getFieldType:l,logger:o,PresetVerboseMessage:p})},h=e=>e.matchWith({Empty(){},Loading(){},Loaded({url:e}){a.navigateTo(e)}});return Object.assign(Object.assign({},bu(e)),{isValidConnection(){return Ou(t)},bind(){const{events:c,behaviors:l}=t;c&&(t=>{const{datasetApi:c,getState:l,actions:u}=r;(0,ot.forEach)(t,(({action:t,postAction:r},d)=>{e.on(d,(async()=>{try{if(t.startsWith(n.O4)){const e=c.getCurrentItem();return void await s({currentItem:e,action:t})}if("nextDynamicPage"===t)return h(Rn(l()));if("previousDynamicPage"===t)return h(Cn(l()));if("resetUserFilter"===t)return u.resetUserInputFilters();const e=await Promise.resolve(c[t]());if(r&&r.navigate){const t=((e,t)=>e.fieldName?Li(t,e.fieldName):e.linkObject?i.links.toUrl(e.linkObject):void 0)(r.navigate,e);a.navigateTo(t)}}catch(e){e instanceof T||o.log(new R(`${t} operation failed:`,{cause:e}))}}))}))})(c),l&&(t=>{const{dispatcher:n,eventListeners:{register:o}}=r;t.forEach((t=>{let r=!1;switch(t.type){case"saveSuccessFeedback":o("beforeSave",(()=>e.hide())),o("afterSave",(()=>{e.show(),r=!0})),o("currentIndexChanged",(()=>{r?r=!1:e.hide()})),o("itemValuesChanged",(()=>e.hide()));break;case"saveFailureFeedback":o("beforeSave",(()=>e.hide())),o("currentIndexChanged",(()=>e.hide())),n.subscribe("datasetSaveError",(()=>e.show()))}}))})(l),o.log(new p(Qe.types.COMPONENT.BOUND,{component:e,description:Wi(t)}))},clear(){const{getFieldType:n}=r,{properties:o}=t;(0,ot.forEach)(o,(({fieldName:t},r)=>{const o=n(t).getOrElse(""),a=(e=>e===Vi?[]:void 0)(o);e.setValue(a,{propPath:r,fieldType:o})}))},async onRecordsLoaded(){const{behaviors:t}=e.connectionConfig;f(),t&&t.forEach((t=>{"saveSuccessFeedback"===t.type&&e.hide()}))},async onCurrentViewChanged(){f()},async onCurrentIndexChanged(){f()},async onCurrentRecordModified(e){f(e)}})},Eu=(e,t)=>{return r=e,n=t,Object.defineProperties({},Object.assign(Object.assign({},Object.getOwnPropertyDescriptors(r)),Object.getOwnPropertyDescriptors(n)));var r,n},Su=e=>{const t={getValue(){return e.data},setValue(t){e.data=t},clear(){e.data=[]},onItemReady(t){e.onItemReady(t)},onItemRemoved(t){e.onItemRemoved(t)}};return Eu(Ru(e),t)},_u=e=>"onChange"in e&&("value"in e||"checked"in e),Pu=(e,t)=>{const r=t.split("."),n=r.slice(0,-1),[o]=r.slice(-1);return{obj:n.length>0?(0,ot.get)(e,n):e,prop:o}},Tu=e=>{if(!e||!e.parent)return;const{parent:t}=e;return t.type===at.Repeater?Su(t):Tu(t)},Ru=e=>{const{connectionConfig:t,uniqueId:r,type:n,role:o,id:a}=e,i=!!e.hidden,s={id:r,connectionConfig:t,nickname:a,type:n,role:o,isInput:_u(e),parentRepeater:Tu(e),getValue({propPath:t}={}){if(t){const{obj:r,prop:n}=Pu(e,t);return r[n]}},setValue(t,{propPath:r,fieldType:n}={}){if(r){const{obj:o,prop:a}=Pu(e,r);o[a]="reference"===n&&(e=>(0,ot.isObject)(e)&&(0,ot.has)(e,"_id"))(t)?t._id:t}},setOptions(t){"options"in e&&(e.options=t)},hide(){var t;e.hidden||null===(t=e.hide)||void 0===t||t.call(e)},show({ignoreInitiallyHidden:t}={ignoreInitiallyHidden:!1}){var r;!e.hidden||t&&i||null===(r=e.show)||void 0===r||r.call(e)},clear(e){s.setValue(void 0,e)},get enabled(){return!("enabled"in e)||e.enabled},enable(){"enable"in e&&!s.enabled&&e.enable()},disable(){"disable"in e&&s.enabled&&e.disable()},isValid(){return!("validity"in e)||"object"!=typeof e.validity||e.validity.valid},updateValidityIndication(){"updateValidityIndication"in e&&e.updateValidityIndication()},resetValidityIndication(){"resetValidityIndication"in e&&e.resetValidityIndication()},onChange(e){s.on("onChange",e)},on(t,r){var n;null===(n=e[t])||void 0===n||n.call(e,r)}};return"placeholder"in e&&Object.defineProperty(s,"placeholder",{get(){return e.placeholder}}),s},Cu=e=>t=>{const r=[],n=[];return(0,ot.uniq)(t.map((({role:e})=>e))).forEach((t=>{if(t!==ee)if(t!==pe)(e("@"+t)||[]).forEach((e=>{e&&r.push(e)}));else{const t=e("@pageRole")||[],[n]=Array.isArray(t)?t:[t],o=e("Document");if(o&&n){const e=new Proxy(o,{get(e,t){return"connectionConfig"===t?n.connectionConfig:"role"===t?pe:e[t]}});r.push(e)}}else(e("@"+t)||[]).forEach((e=>e&&n.push(e)))})),{components:r.map((e=>(e=>{switch(e.role){case"textRole":return(e=>{const t={setValue(t,{fieldType:r,propPath:n="text"}={}){if(r===s.FieldType.url){e.text=`<a href=${t} target="_blank" style="text-decoration: underline">${t}</a>`;const{html:r}=e;return e.text="",void(e.html=(0,ot.unescape)(r))}r!==s.FieldType.richText?e[n]=t:e.html=t},clear({fieldType:t}={}){const r=t===s.FieldType.richText||t===s.FieldType.url?"html":"text";e[r]=""}};return Eu(Ru(e),t)})(e);case de:case J:return Su(e);case se:return(e=>{const t={get nextEnabled(){return e.nextEnabled},set nextEnabled(t){e.nextEnabled=t},get previousEnabled(){return e.previousEnabled},set previousEnabled(t){e.previousEnabled=t},setValue(t){e.rows=t},getValue(){return e.rows},set rows(e){t.setValue(e)},get rows(){return e.rows},get columns(){return e.columns},clear(){e.rows=[],e.dataFetcher=void 0},set dataFetcher(t){e.dataFetcher=t},refresh(){return e.refresh()},onCellSelect(t){return e.onCellSelect(t)},onRowSelect(t){return e.onRowSelect(t)}};return Eu(Ru(e),t)})(e);case ue:return(e=>{const{logger:t}=k,r={isValid(t){const{connectionConfig:r,validity:n}=e;if(n.valid)return!0;if((0,ot.some)((0,ot.values)((0,ot.omit)(n,["valid","valueMissing"])),(e=>e)))return!1;const o=(0,ot.get)(r,"properties.value.fieldName")||"";return!(0,ot.isEmpty)(Li(t,o))},set fileType(t){e.fileType=t},get fileType(){return e.fileType},getValue(){return e.value},clear(){e.reset()},async uploadFiles(){return"function"!=typeof e.uploadFiles?(t.log(new R("uploadFiles API method is not supported by Platform")),e.startUpload().then((e=>[e]))):e.uploadFiles()}};return Eu(Ru(e),r)})(e);case we:return(e=>{const t=Ru(e),r={setValue(r,n){r?t.setValue(r,n):e.clear()}};return Eu(t,r)})(e);case re:return(e=>{e.clickAction&&(e.clickAction=e.clickAction);const t={setValue(t){e.items=t},getValue(){return e.items},clear(){e.items=[]},set currentIndex(t){try{e.galleryCapabilities.hasCurrentItem&&(e.currentIndex=t)}catch(e){}},get currentIndex(){return e.currentIndex},get clickAction(){return e.clickAction},onCurrentItemChanged(t){e.galleryCapabilities.hasCurrentItem&&e.onCurrentItemChanged((({item:e,itemIndex:r})=>t(e,r)))}};return Eu(Ru(e),t)})(e);case fe:return(e=>{const t={get currentPage(){return e.currentPage},set currentPage(t){e.currentPage=t},get totalPages(){return e.totalPages},set totalPages(t){e.totalPages=t},get nextEnabled(){return e.nextEnabled},set nextEnabled(t){e.nextEnabled=t},get previousEnabled(){return e.previousEnabled},set previousEnabled(t){e.previousEnabled=t},get navigationType(){return e.navigationType},set navigationType(t){e.navigationType=t},onNextClicked(t){e.onNextClicked(t)},onPreviousClicked(t){e.onPreviousClicked(t)}};return Eu(Ru(e),t)})(e);case ge:return(e=>{const t={setValue(t){e.location=t},getValue(){return e.location},clear(){e.markers=[]},set location(t){e.location=t},get location(){return e.location},set markers(t){e.markers=t},get markers(){return e.markers},setCenter(t){e.setCenter(t)}};return Eu(Ru(e),t)})(e);case Pe:return(e=>{const t={setValue(t){e.value=t},getValue(){return e.value},clear(){e.value=[]},setBounds(t,r){e.min=t,e.max=r}};return Eu(Ru(e),t)})(e);default:return Ru(e)}})(e))),detailsDatasetApis:n}},Du=(e,t,r)=>{const{logger:n,errorReporting:o}=k,{getState:a,getFieldType:i,actions:s,modeIsLivePreview:c,PresetVerboseMessage:l}=r,u=r=>{Ds({currentRecord:On(a()),previousRecord:r,component:e,connectionConfig:t,modeIsLivePreview:c,getFieldType:i,logger:n,PresetVerboseMessage:l})},d=()=>{const t=s.isCurrentRecordPristine(a()),r=s.isCurrentRecordNew(a());t&&r&&e.resetValidityIndication()};return Object.assign(Object.assign({},bu(e)),{isValidConnection(){return Ou(t)},bind(){(()=>{const{id:r,role:n}=e,{properties:c}=t;e.onChange(o((e=>{const t=c.checked?"checked":"value",o=c[t].fieldName,l=On(a()),u=_s({value:e.target[t],currentValue:Li(l,o),fieldType:i(o).getOrElse(""),fieldName:o,utils:{referenceFetcher:(e,t)=>s.fetchRecordById(e,t).getOrElse(e)},role:n});s.setFieldInCurrentRecordAndSynchronize(o,u,r)}),R.withMessage("Input adapter onChange - setting value to record failed")))})(),t.filters&&e.onChange(o(s.refresh,R.withMessage("Input adapter onChange - sync actions failed"))),n.log(new l(Qe.types.COMPONENT.BOUND,{component:e,description:Wi(t)}))},async onRecordsLoaded(){u(),d()},async onCurrentViewChanged(){u(),d()},async onCurrentIndexChanged(){u(),d()},async onCurrentRecordModified(e){u(e),d()}})},Au={start:0,end:0},ju=(e,{valueField:t,labelField:r,dataTransformer:n})=>{const o=n(Li(e,t));return{value:o,label:r?n(Li(e,r)):o}},xu=e=>(0,ot.get)(e,"properties.value.fieldName")||"",Nu=()=>"bolt"===k.platform.settings.env.renderer,Mu=(e,t,r)=>{const{errorReporting:n}=k,{actions:o,recordStore:a}=r,i=t.userInputFilter.fieldName;e.onChange(n((async()=>{await o.refresh();const t=a().fold((()=>jt.Maybe.Nothing()),(e=>e.getDatasetSize().total));(e=>{let{state:t,numberOfResults:r,filteredBy:n,componentType:o,fieldType:a}=e;const{logger:i}=k,s=ln(t),c=on(t);c&&i.log(new ao({id:366,collectionId:c,datasetMode:s,numberOfResults:r,filteredBy:n,componentType:o,fieldType:a}))})({filteredBy:i,numberOfResults:t,state:r.getState(),componentType:e.type,fieldType:r.getFieldType(i).getOrElse(null)})}),R.withMessage("Filter input adapter onChange failed")))},Fu=(e,t,r)=>{const{i18n:n}=k,{getState:o}=r,a=t=>{const r=Array.isArray(e.getValue({propPath:t}))?[]:Po;e.setValue(r,{propPath:t})};return Object.assign(Object.assign({},bu(e)),{bind(){const{userInputFilter:i}=t;Mu(e,t,r);const{prop:s,fieldName:c}=i,l=(e=>{var t;return null===(t=Fn(o()))||void 0===t?void 0:t.find((t=>t.fieldName===e&&Ae.includes(t.role)))})(c);l&&(e.setOptions((({component:e,prop:t,userFilterInitialData:r})=>[!Array.isArray(e.getValue({propPath:t}))&&{value:Po,label:n.t("USER_INPUT_FILTER_OPTION_RESET_ALL")},...r.options.map((e=>({value:String(e),label:String(e)})))].filter(Boolean))({component:e,prop:s,userFilterInitialData:l})),(e=>"placeholder"in e)(e)||a(s))},resetUserFilter(){const{userInputFilter:{prop:r}}=t;e.getValue({propPath:r})&&a(r)}})},ku=new Map([[de,(e,t,r)=>{const{logger:n,errorReporting:o}=k,{controllerFactory:a,controllerStore:i,PresetVerboseMessage:s}=r,c=[],l=(t,r,n)=>{const o={repeaterId:e.id,itemId:r._id},s=a.createScopedDataset({datasetScope:o,fixedItem:r});i.setController(o,s);const l=Cu(t.scoped),u=s.pageReady(l);c.push(u)},u=t=>{const r={repeaterId:e.id,itemId:t._id};i.removeController(r)},d=async()=>{const{actions:t,getState:o,modeIsLivePreview:a}=r,{items:i}=await t.fetchCurrentItems(o());a&&0===i.length||(n.log(new s(Qe.types.COMPONENT.FILLED,{component:e,description:{data:i}})),e.setValue(i),await Promise.all(c),c.splice(0))};return Object.assign(Object.assign({},bu(e)),{bind(){e.onItemReady(o(l,R.withMessage("Repeater adapter onItemReady failed"))),e.onItemRemoved(o(u,R.withMessage("Repeater adapter onItemRemoved failed"))),n.log(new s(Qe.types.COMPONENT.BOUND,{component:e}))},async onRecordsLoaded(){return d()},async onCurrentViewChanged(){d()},async onCurrentIndexChanged(){},async onCurrentRecordModified(){const{getState:t}=r,n=On(t()),o=e.getValue();if(o&&o.length>0){const t=o.map((e=>e._id===n._id?n:e));e.setValue(t)}}})}],[J,(e,t,r)=>{const{errorReporting:n}=k,{controllerFactory:o,controllerStore:a}=r,i=(t,r,n)=>{const i={repeaterId:e.id,itemId:r._id},s=o.createScopedDetailsDataset({datasetScope:i});a.setController(i,s);const c=Cu(t.scoped);s.pageReady(c)},s=t=>{const r={repeaterId:e.id,itemId:t._id};a.removeController(r)};return Object.assign(Object.assign({},bu(e)),{bind(){e.onItemReady(n(i,R.withMessage("Details repeater adapter onItemReady failed"))),e.onItemRemoved(n(s,R.withMessage("Details repeater adapter onItemRemoved failed")))}})}],[te,(e,t,r)=>{const{errorReporting:n}=k,{actions:o}=r;return Object.assign(Object.assign({},bu(e)),{isValidConnection(){return Ou(t)},bind(){e.onChange(n(o.refresh,R.withMessage("Filter input adapter onChange failed")))},resetUserFilter(){const t=Cs(e);e.setValue((e=>{switch(e.type){case Ts:return!1;case Rs:return"";default:return null}})(e),{propPath:t})}})}],[Oe,Fu],[Se,Fu],[Ee,Fu],[_e,Fu],[Ie,(e,t,r)=>{const n=()=>{e.setValue(null,{propPath:"checked"})};return Object.assign(Object.assign({},bu(e)),{bind(){Mu(e,t,r),n()},resetUserFilter(){n()}})}],[Pe,(e,t,r)=>{const{getState:n}=r,o=({firstRender:r})=>{const{userInputFilter:{fieldName:o}}=t,{min:a,max:i}=(t=>{var r;return null===(r=Fn(n()))||void 0===r?void 0:r.find((r=>r.fieldName===t&&r.role===e.role))})(o);e.setValue([a,i]),r&&e.setBounds(a,i)};return Object.assign(Object.assign({},bu(e)),{bind(){Mu(e,t,r),o({firstRender:!0})},resetUserFilter(){o({firstRender:!1})}})}],[se,(e,t,r)=>{const{logger:n,errorReporting:o}=k,{datasetApi:a,PresetVerboseMessage:i,getState:s,modeIsLivePreview:c,actions:l}=r;let u=Au;const d=e=>u=e,p=()=>d(Au),f=({fetchRows:e,logGridValue:t,disableNavigation:r=!1})=>async(n,o)=>{const{items:a,datasetSize:i}=await e(n,o-n);return t(a),{pageRows:a,totalRowsCount:r?a.length:i.total}},h=({fetchRows:t,logGridValue:r})=>async({direction:n,limit:o})=>{let{start:a,end:i}=u;"previous"===n?(i=a,a-=o):(a=i,i+=o);const{items:s,datasetSize:c}=await t(a,i-a);return d({start:a,end:i}),e.nextEnabled=!!c.cursor||i<c.loaded,e.previousEnabled=a>0,r(s),{pageRows:s,totalRowsCount:c.total||void 0}},g=t=>{const r=[],o=e.columns;(0,ot.forEach)(t,(e=>{const t={};(0,ot.forEach)(o,(r=>{t[r.label]=(0,ot.get)(e,r.dataPath)})),r.push(t)})),n.log(new i(Qe.types.COMPONENT.FILLED,{component:e,description:r}))};return Object.assign(Object.assign({},bu(e)),{bind(){l.getInitialData().chain((({items:t})=>{e.rows=t}));const t=On(s());if(c&&!t)return;const r=l.isCursorPaging(),u="bolt"===k.platform.settings.env.renderer;e.dataFetcher=u?f({fetchRows:l.fetch,logGridValue:g,disableNavigation:r}):r?{type:"directional",value:h({fetchRows:l.fetch,logGridValue:g,component:e})}:{type:"pages",value:f({fetchRows:l.fetch,logGridValue:g})},e.onCellSelect(o((({cellRowIndex:e})=>{a.setCurrentItemIndex(e)}),R.withMessage("Grid adapter onCellSelect failed"))),e.onRowSelect(o((({rowIndex:e})=>{a.setCurrentItemIndex(e)}),R.withMessage("Grid adapter onRowSelect failed"))),(()=>{const t={};e.columns.forEach((({label:e,dataPath:r,linkPath:n})=>{(r||n)&&(t[e]=Object.assign(r?{dataPath:r}:{},n?{linkPath:n}:{}))})),n.log(new i(Qe.types.COMPONENT.BOUND,{component:e,description:t}))})()},async onCurrentRecordModified(){e.refresh()},async onRecordsLoaded(){p(),e.refresh()},async onCurrentViewChanged(){p(),e.refresh()}})}],[ie,(e,t,r)=>{const{features:n,logger:o}=k,{actions:a,getFieldType:i,getSchema:s,PresetVerboseMessage:c}=r,l=async()=>{const{role:r}=e,{properties:l}=t,u=await(async(e,t)=>(e=>{const t=e[0];return 1===e.length&&""===t.label&&""===t.value?[]:e})(await(async(e,t)=>{if(i(e).map((e=>"reference"===e)).getOrElse(!1))return s().chain((r=>{const n=Eo(e,r);return s(n).map(So).map((async r=>{const{items:n}=await a.fetchAll(e),o=n.map((e=>ju(e,{valueField:"_id",labelField:r,dataTransformer:t})));return(0,ot.orderBy)(o,[e=>e.label.toLowerCase()])}))})).getOrElse(Promise.resolve([]));if(!n.dropdownOptionsDistinct){const{items:r}=await a.fetchAll(),n=r.map((r=>ju(r,{valueField:e,dataTransformer:t})));return(0,ot.uniqBy)(n,"value")}{const r=a.getUniqueFieldValues(e);if(r)return r.map((e=>{const r=t(e);return{value:r,label:r}}))}})(e,(e=>Ps({value:e,role:r})))))(l.value.fieldName);o.log(new c(Qe.types.COMPONENT.FILLED,{component:e,description:{options:u}})),e.setOptions(u)};return Object.assign(Object.assign({},bu(e)),{isValidConnection(){return Ou(t)},clear(){e.setOptions([])},bind(){(()=>{const{properties:r}=t,n={options:r.value.fieldName};o.log(new c(Qe.types.COMPONENT.BOUND,{component:e,description:n}))})()},async onRecordsLoaded(){l()},async onCurrentRecordModified(){l()}})}],[ve,(e,t,r)=>{const{logger:n}=k,{actions:o,PresetVerboseMessage:a,modeIsLivePreview:i}=r,s=async()=>{const{role:r}=e,{properties:{options:{fieldName:s}}}=t,{items:c}=await o.fetchAll(),l=c.reduce(((e,t)=>{const n=Ps({value:Li(t,s),role:r});return n&&e.push({value:n,label:n}),e}),[]);i&&0===l.length||(e.setOptions(l),n.log(new a(Qe.types.COMPONENT.FILLED,{component:e,description:{options:l}})))};return Object.assign(Object.assign({},bu(e)),{isValidConnection(){return Ou(t)},bind(){const{properties:{options:{fieldName:r}}}=t;n.log(new a(Qe.types.COMPONENT.BOUND,{component:e,description:{options:r}}))},clear(){e.setOptions([])},async onRecordsLoaded(){s()},async onCurrentRecordModified(){s()}})}],[ue,(e,t,r)=>{const{logger:n,errorReporting:o}=k,{actions:a,datasetApi:i,getState:s,getFieldType:c,PresetVerboseMessage:l}=r,u={},d=(r=!1)=>{const n=On(s()),o=xu(t),i=a.isCurrentRecordNew(s()),c=(0,ot.isEmpty)(Li(n,o));(a.isCurrentRecordPristine(s())||r)&&e.clear(),!c||i&&!r||e.updateValidityIndication()};return Object.assign(Object.assign({},bu(e)),{isValidConnection(){return Ou(t)},bind(){if(pn(s()))return;const{id:r,role:d}=e,p=xu(t),f=c(p).getOrElse("");e.onChange(o((()=>{u[r]=!0}),R.withMessage("Upload button adapter onChange failed"))),i.onBeforeSave((()=>{if(u[r]&&e.getValue().length)return e.uploadFiles().then((e=>{u[r]=!1;const t=On(s()),n=_s({value:e,currentValue:Li(t,p),fieldType:f,fieldName:p,role:d});a.setFieldInCurrentRecordAndSynchronize(p,n,r)})).catch((t=>{const r=e.getValue(),o=Array.isArray(r)&&1===r.length?r[0].name:"unknown";throw n.log(new C(`The ${o} file failed to upload. Please try again later.`,{cause:t})),t}))})),c(p).map((t=>{switch(t){case"image":e.fileType="Image";break;case"document":e.fileType="Document"}}));const{properties:h}=t;(0,ot.forEach)(h,(({fieldName:t},r)=>{n.log(new l(Qe.types.COMPONENT.BOUND,{component:e,description:{[r]:t}}))}))},async onCurrentRecordModified(r){const{id:n}=e,o=xu(t),a=On(s()),i=Ui({previousRecord:r,currentRecord:a,fieldName:o});i&&(u[n]=!1),d(i)},async onRecordsLoaded(){d()},async onCurrentViewChanged(){d()},async onCurrentIndexChanged(){d()}})}],[re,(e,t,r)=>{const{logger:n,errorReporting:o}=k,{actions:a,getState:i,getFieldType:s,modeIsLivePreview:c,wixFormatter:l,PresetVerboseMessage:u}=r,d=(e,t,r,n)=>{(0,ot.forEach)(r,(({fieldName:r,format:o},a)=>{const i=Ps({value:Li(t,r),role:n,fieldType:s(r).getOrElse(""),propPath:a,format:o,utils:{formatter:l}});e[a]=i}))},p=()=>{e.currentIndex=Jc({state:i()})},f=async()=>{const{role:r}=e,{properties:o}=t,{items:s}=await a.fetchCurrentItems(i());try{const t=s.map((e=>{const t={};return d(t,e,o,r),t})),a=t.every((({src:e})=>!e));if(c&&a)return;n.log(new u(Qe.types.COMPONENT.FILLED,{component:e,description:t})),e.setValue(t)}catch(e){if("URIError"!==e.name)throw e}p()};return Object.assign(Object.assign({},bu(e)),{isValidConnection(){return Ou(t)},bind(){e.onCurrentItemChanged(o((()=>{a.setCurrentIndex(e.currentIndex)}),R.withMessage("Gallery adapter onItemReady failed"))),(()=>{const{properties:r}=t,o={};(0,ot.forEach)(r,(({fieldName:e},t)=>{o[t]=e})),n.log(new u(Qe.types.COMPONENT.BOUND,{component:e,description:o}))})()},async onCurrentRecordModified(){const{role:r}=e,{properties:n}=t,o=On(i()),a=Jc({state:i()}),s=e.getValue()||[],c=s[a];c&&d(c,o,n,r),e.setValue(s),p()},async onRecordsLoaded(){f()},async onCurrentViewChanged(){f()},async onCurrentIndexChanged(){p()}})}],[fe,(e,t,r)=>{const{logger:n,errorReporting:o}=k,{actions:a,getState:i,PresetVerboseMessage:s}=r,c=()=>{const t=a.isCursorPaging();Nu()&&t||(t?(()=>{const t=el({state:i()});e.nextEnabled=a.hasNextPage(i()),e.previousEnabled=t>1})():(()=>{const t=el({state:i()}),r=a.getTotalPageCount(i());e.currentPage=t,r<1?e.disable():(e.enable(),e.totalPages=r)})())};return Object.assign(Object.assign({},bu(e)),{bind(){const t=({delta:e,index:t})=>{const r=el({state:i()}),n=e?r+e:t,o=Kc({state:i()}),s=c?n:(0,ot.clamp)(n,1,a.getTotalPageCount(i()));a.setCurrentIndex(((e,t)=>t*(e-1))(s,o))},r=Nu(),c=a.isCursorPaging();r&&c?(e.currentPage=1,e.disable()):c?(e.navigationType="arrowsOnly",e.onNextClicked(o((()=>t({delta:1})),R.withMessage("Pagination adapter onNextClicked failed"))),e.onPreviousClicked(o((()=>t({delta:-1})),R.withMessage("Pagination adapter onPreviousClicked failed")))):e.onChange(o((e=>t({index:e.target.currentPage})),R.withMessage("Pagination adapter onChange failed"))),n.log(new s(Qe.types.COMPONENT.BOUND,{component:e}))},async onRecordsLoaded(){c()},async onCurrentViewChanged(){c()}})}],[ge,(e,t,r)=>{const{logger:n}=k,{actions:o,getState:a,getFieldType:i,wixFormatter:s,PresetVerboseMessage:c}=r,l=(e,t={},r)=>(0,ot.reduce)(t,((t,{fieldName:n,format:o},a)=>{const c=Li(e,n);if("address"===a)return Object.assign(t,{address:(0,ot.get)(c,"formatted"),location:(0,ot.get)(c,"location")});if("link"===a&&(0,ot.isEmpty)(c))return t;const l=Ps({value:Li(e,n),role:r,fieldType:i(n).getOrElse(""),propPath:a,format:o,utils:{formatter:s}});return Object.assign(t,{[a]:l})}),{}),u=async()=>{const{role:r}=e,{properties:i}=t;try{const{items:t}=await o.fetchCurrentItems(a());e.markers=t.map((e=>l(e,i,r)))}catch(e){n.log(new R("Failed setting markers",{cause:e}))}};return Object.assign(Object.assign({},bu(e)),{isValidConnection(){return Ou(t)},bind(){(()=>{const{properties:r}=t,o={};(0,ot.forEach)(r,(({fieldName:e},t)=>{o[t]=e})),n.log(new c(Qe.types.COMPONENT.BOUND,{component:e,description:o}))})()},async onRecordsLoaded(){u()},async onCurrentViewChanged(){u()},async onCurrentIndexChanged(){const t=Jc({state:a()});e.setCenter((0,ot.get)(e,["markers",t,"location"]))},async onCurrentRecordModified(){const{properties:r}=t,{role:n}=e,o=On(a()),i=Jc({state:a()});e.markers[i]=l(o,r,n),e.setCenter((0,ot.get)(e,["markers",i,"location"]))}})}]]),Lu=({components:e,context:t})=>{const r=(({recordStore:e,dispatch:t})=>{const r={fetchRecordById:(t,r)=>e(r).fold((()=>jt.Maybe.Nothing()),(e=>e.getRecordById(t))),fetchAll:t=>(async(e,t,r,n)=>{const o=await e(n).fold((()=>sc.Empty()),(e=>e.externalApi.getRecordsLimitedByMaxPageSize(0,1e3)));return o.get()})(e,0,0,t),fetchCurrentItems:t=>Rl(e,t).catch((()=>sc.Empty().get())),fetchOne:()=>Tl(e,0,1),fetch:(t,r,n)=>Tl(e,t,r,n),getTotalPageCount:t=>rl({state:t,recordStore:e}),getInitialData:()=>e().fold((()=>sc.Empty()),(e=>e.externalApi.getSeedRecords())),setCurrentIndex:(e,r)=>t(El(e,r)),setFieldInCurrentRecordAndSynchronize:(e,r,n)=>{t(Sl({[e]:(0,ot.cloneDeep)(r)},n))},refresh:()=>t(Pl()),resetUserInputFilters:()=>{const e=n.filter((({role:e})=>e===te||De.includes(e)));e.length&&(e.forEach((e=>e.resetUserFilter())),r.refresh())},isCurrentRecordNew:t=>e().fold((()=>!1),(e=>e.isNewRecord(Jc({state:t})))),isCurrentRecordPristine:t=>e().fold((()=>!1),(e=>e.isPristine(Jc({state:t})))),isCursorPaging:()=>Yc({recordStore:e}),hasNextPage:t=>sl({state:t,recordStore:e}),getUniqueFieldValues:t=>e().fold((()=>!1),(e=>e.getUniqueFieldValues(t)))};return r})(t),n=e.map((e=>((e,t,r)=>(ku.get(e.role)||(e.isInput?Du:Iu))(e,t,r))(e,((e,t)=>jt.Maybe.fromNullable((0,ot.get)(e,"properties")).map((r=>(0,ot.mapKeys)(e.properties,((e,r)=>(0,ot.startsWith)(r,"$")?((e,t,r)=>jt.Maybe.fromNullable(wu[e]).map((e=>e(r(t.fieldName)))).getOrElse(e))(r,e,t):r)))).map((t=>(0,ot.assign)({},e,{properties:t}))).getOrElse(e))(e.connectionConfig,t.getFieldType),Object.assign(Object.assign({},t),{actions:r})))).filter((e=>e.isValidConnection()));return{bindAll:async()=>Promise.all(n.map((e=>(e.bind(),e.onRecordsLoaded())))),hideAll:()=>n.map((e=>e.hide())),showAll:()=>n.map((e=>e.show({ignoreInitiallyHidden:!0}))),clearAll:()=>n.map((e=>e.clear())),onRecordsLoaded:()=>n.map((e=>e.onRecordsLoaded())),onCurrentViewChanged:()=>n.map((e=>e.onCurrentViewChanged())),onCurrentIndexChanged:()=>n.map((e=>e.onCurrentIndexChanged())),onCurrentRecordModified:(e,t)=>n.filter((({id:e})=>!t||t!==e)).map((t=>t.onCurrentRecordModified(e)))}},Uu=(e,t)=>r=>{let{controllerConfig:n,datasetType:o,connections:a,connectionsGraph:i,isScoped:c,datasetScope:l,dataProvider:u,dependencyManager:d,firePlatformEvent:p,dynamicPagesData:f,datasetId:h,fixedRecordId:g,recordStoreService:m,updatedCompIds:y,markControllerAsRendered:v,markDatasetDataFetched:w,renderingRegularControllers:b,modeIsLivePreview:O,modeIsSSR:I,useLowerCaseDynamicPageUrl:E,schemasLoading:S,listenersByEvent:_}=r;const P=a.filter((e=>!(e=>{let{role:t}=e;return De.includes(t)})(e)||e.config)),T=!!g,{logger:x,platform:{user:N,settings:{locale:M,env:{renderer:F}},timers:{queueMicrotask:L}}}=k,{setConnectedComponents:U,getConnectedComponents:W}=(()=>{let e;return{setConnectedComponents:t=>e=t,getConnectedComponents:()=>e}})(),V=[],{store:G,subscribe:$,onIdle:X}=((e,t)=>{const{middleware:r,subscribe:n,onIdle:o}=Al.createMiddleware(),a=Rt(nn,void 0,function(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];return function(e){return function(r,n,o){var a,i=e(r,n,o),s=i.dispatch,c={getState:i.getState,dispatch:function(e){return s(e)}};return a=t.map((function(e){return e(c)})),s=Dt.apply(void 0,a)(i.dispatch),At({},i,{dispatch:s})}}}(r,((e,t)=>r=>r=>n=>(e.log(new Xe({category:"redux",message:"".concat(n.type," (dataset: ").concat(t,")"),data:(0,ot.omit)(n,"type","record")})),r(n)))(e,t)));return{store:a,subscribe:n,onIdle:o}})(x,h),Y=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:ot.noop,t=!1,r={};const n=e=>r[e]?r[e]:r[e]=[],o=function(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),o=1;o<t;o++)r[o-1]=arguments[o];return Promise.all(n(e).map((e=>e(...r))))},a=function(t){for(var r=arguments.length,n=new Array(r>1?r-1:0),a=1;a<r;a++)n[a-1]=arguments[a];return k.logger.log(new Qe(Qe.types.DS_API.TRIGGERED,{eventName:t,eventArgs:n})),e(t,...n),o(t,...n)};return{register:(e,r)=>{if(t)return ot.noop;const o=H(r);return n(e).push(o),()=>{(0,ot.remove)(n(e),(e=>e===o))}},executeHooks:o,fireEvent:a,dispose:()=>{t=!0,r={}}}}(p),{fireEvent:K}=Y;V.push(Y.dispose);const Z=new B({datasetId:gu(h),scopedDatasetId:c?h:void 0,getState:G.getState,getSchema:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:ae;return u.getSchema(e)}}),Q=Z.subscribe(_);V.push(...Q),G.dispatch((e=>{let{controllerConfig:t={},connections:r=[],isScoped:n=!1,datasetType:o}=e;return{type:lr.INIT,datasetConfig:t.dataset||{},connections:r,isScoped:n,datasetType:o}})({controllerConfig:n,connections:P,isScoped:c,datasetType:o}));const{datasetIsVirtual:ee,datasetIsReal:re,datasetIsDeferred:ne,datasetIsWriteOnly:oe,datasetCollectionName:ae,dynamicPageNavComponentsShouldBeLinked:ie}=(ce=G.getState(),{datasetIsRouter:gn(ce),datasetIsMaster:mn(ce),datasetIsVirtual:yn(ce),datasetIsReal:vn(ce),datasetIsDeferred:wn(ce),datasetIsWriteOnly:fn(ce),datasetCollectionName:on(ce),dynamicPageNavComponentsShouldBeLinked:bn(ce)});var ce;const le=an(G.getState()),de=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:ae;return jt.Maybe.fromNullable(u.getSchema(e))},pe=e=>{const t=de(ae),r=u.getReferencedSchemas(ae);return t.chain((t=>jt.Maybe.fromNullable(Io(t,r)(e))))},he=((e,t,r)=>({dataBinding:ji((e=>d.getDependencyById(e,l))),currentUser:()=>jt.Maybe.fromNullable(k.platform.user).map((e=>{let{id:t,loggedIn:r}=e;return r?t:null})),userInput:As({getConnectedComponents:t,getFieldType:r})}))(0,W,pe),ge=(e=>{let{valueResolvers:t,getConnectedComponents:r,getFieldType:n}=e;return e=>((e,t,r)=>{const n=((e,t)=>Ci(jt.Maybe,t.map((t=>{let{path:r,filterExpression:n}=t;return e(n).map((e=>({path:r,filterExpression:e})))}))))(t,Ai(e,r));return n.map((e=>t=>t.reduce(((e,t)=>{let{path:r,filterExpression:n}=t;return((e,t,r)=>(0,ot.set)(e,t,r))(e,r,n)}),(0,ot.cloneDeep)(e)))(r))})(Ms,(e=>(0,js.X)(e)?t.currentUser():(0,xs.X)(e)?t.dataBinding(e):Fs(e)?t.userInput(e):void 0),e).map((e=>{const t=r().filter((e=>{let{role:t}=e;return De.includes(t)})).map((e=>{const{userInputFilter:t}=e.connectionConfig,{prop:r,fieldName:o}=t,a=e.getValue({propPath:r});if([Po,"",!1].includes(a)||(0,ot.isEqual)(a,[])||e.role===Pe&&(0,ot.isEqual)(a,[e.min,e.max]))return null;const i=(e=>{let{value:t,fieldType:r}=e;return r===s.FieldType.number?Array.isArray(t)?t.map(Number):Number(t):t})({value:a,fieldType:n(o).getOrElse(null)});return{[o]:e.role===Pe?{$gte:i[0],$lte:i[1]}:Array.isArray(i)?{$hasSome:i}:i}})).filter(Boolean);return 0===t.length?e:{$and:[e].filter(Boolean).concat(t)}}))})({valueResolvers:he,getConnectedComponents:()=>dn(G.getState())?W():[],getFieldType:pe}),me=(e=>{let{recordStoreService:t,getFilter:r,getSort:n,getPageSize:o,datasetId:a,filterResolver:i,getSchema:s,fixedRecordId:c}=e;return e=>{const l=o();return t.chain((t=>{if(e)return jt.Result.fromMaybe(s().map((t=>Eo(e,t))),"cannot resolve referenced collection name for field ".concat(e)).map((e=>t({pageSize:l,sort:null,filter:null,datasetId:a,referencedCollectionName:e,fixedRecordId:c})));{const e=r();return jt.Result.fromMaybe(i(e).map((e=>t({pageSize:l,sort:n(),filter:e,datasetId:a,referencedCollectionName:null,fixedRecordId:c}))),"could not resolve dynamic filter")}}))}})({recordStoreService:m,getFilter:(0,ot.flow)((e=>G.getState()),an),getSort:(0,ot.flow)((e=>G.getState()),sn),getPageSize:()=>Kc({state:G.getState()}),datasetId:h,filterResolver:ge,getSchema:de,fixedRecordId:g}),ye=ie?(e=>{let{dataProvider:t,dynamicPagesData:r,collectionName:n,useLowerCaseDynamicPageUrl:o}=e;return{getNextDynamicPageUrl:()=>cu({dataProvider:t,dynamicPagesData:r,collectionName:n,directionTowardSibling:"asc",useLowerCaseDynamicPageUrl:o}),getPreviousDynamicPageUrl:()=>cu({dataProvider:t,dynamicPagesData:r,collectionName:n,directionTowardSibling:"desc",useLowerCaseDynamicPageUrl:o})}})({dataProvider:u,dynamicPagesData:f,collectionName:ae,useLowerCaseDynamicPageUrl:E}):null;ie&&($((e=>{let{getNextDynamicPageUrl:t,getPreviousDynamicPageUrl:r}=e;const n={run:t,isQueued:!0,resultActionCreator:(e,t)=>({type:zr,error:e,payload:t})},o={run:r,isQueued:!0,resultActionCreator:(e,t)=>({type:Hr,error:e,payload:t})},a=e=>{let{hasChangedToTrue:t}=e;const r=[];return t(iu)&&r.push(n),t(su)&&r.push(o),r};return e=>(0,ot.flatten)([a].map((t=>t(e))))})(ye)),G.dispatch((e=>({type:$r,connections:e}))(P)));const ve=(e=>{let{store:{dispatch:t,getState:r},recordStore:n,eventListeners:{fireEvent:o,register:a},controllerStore:i,datasetId:s,datasetType:c,isFixedItem:l,siblingDynamicPageUrlGetter:u,onIdle:d,dispatcher:p}=e;const{logger:f,errorReporting:h,breadcrumbReporting:g,verboseReporting:m}=k,y=async function(){try{await t(Cl.flushDraft());const n=(e=r(),Cr.selectLastSavedRecord(e.records)||On(r()));return(0,ot.cloneDeep)(n)}catch(e){throw p.dispatch("datasetSaveError"),e}var e},v=async function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:cl({state:r()}),o=arguments.length>1?arguments[1]:void 0;zl(r,o),Wl(r,o,[Kl,Zl],c,!1),Vl("atIndex",e),await y(),Yc({recordStore:n})&&await ll({index:e,recordStore:n}),Bl({index:e,datasetSize:tl({recordStore:n})}),await t(Cl.newRecord(e))};return e=>{const p=e?(e,t)=>h(e,C.withMessage("An error occurred in one of ".concat(t," callbacks"))):ot.identity,w={async isIdle(){await new Promise((e=>{const t=d((()=>{t(),e()}))}))},onBeforeSave:e=>(ql("onBeforeSave",e),Wl(r,"onBeforeSave",[Kl,Zl],c,!1),a("beforeSave",p(e,"beforeSave"))),onAfterSave:e=>(ql("onAfterSave",e),Wl(r,"onAfterSave",[Kl,Zl],c,!1),a("afterSave",p(e,"afterSave"))),async save(){Wl(r,"save",[Kl,Zl],c,!1);const e=await y();return fn(r())&&await t(Cl.reInitWriteOnly()),e},async getItems(e,t){Wl(r,"getItems",[Yl,Zl],c,!1),Vl("fromIndex",e),Vl("numberOfItems",t);const{items:o,offset:a,datasetSize:i}=await Cl.doFetch(n,e,t);return{items:o,totalCount:Yc({recordStore:n})?void 0:i.total,offset:a}},getTotalCount:()=>(Wl(r,"getTotalCount",[Yl,Zl],c,!1),dn(r())?(Ll(Yc({recordStore:n}),"getTotalCount"),tl({recordStore:n}).total):null),getCurrentItem:()=>{Wl(r,"getCurrentItem",[Yl,Kl,Zl],c);const e=On(r());return e?(0,ot.cloneDeep)(e):null},getCurrentItemIndex:()=>(Wl(r,"getCurrentItemIndex",[Yl,Zl],c),Jc({state:r()})),async setCurrentItemIndex(e){$l(l,"setCurrentItemIndex"),Wl(r,"setCurrentItemIndex",[Yl,Zl],c,!1),(e=>{if(!(0,ot.isInteger)(e))throw new D("Parameter (".concat(e,") must be a number"),{code:"PARAMETER_NOT_ALLOWED"})})(e),await new Promise((e=>O.onReady(e))),pn(r())||await y(),await t(Cl.setCurrentIndex(e))},setFieldValue:(e,n)=>{zl(r,"setFieldValue"),Wl(r,"setFieldValue",[Kl,Zl],c),Hl(r),t(Cl.updateFields({[e]:(0,ot.cloneDeep)(n)}))},setFieldValues:e=>{zl(r,"setFieldValues"),Wl(r,"setFieldValues",[Kl,Zl],c),Hl(r),t(Cl.updateFields((0,ot.mapValues)(e,ot.cloneDeep)))},async next(){if($l(l,"next"),zl(r,"next"),Wl(r,"next",[Yl,Zl],c,!1),pn(r())||await y(),!O.hasNext())throw new D("There are no more items in the dataset",{code:"NO_SUCH_ITEM"});const e=Jc({state:r()});return await t(Cl.setCurrentIndex(e+1)),O.getCurrentItem()},async previous(){if($l(l,"previous"),zl(r,"previous"),Wl(r,"previous",[Yl,Zl],c,!1),pn(r())||await y(),!O.hasPrevious())throw new D("This is the first item in the dataset",{code:"NO_SUCH_ITEM"});const e=Jc({state:r()});return await t(Cl.setCurrentIndex(e-1)),O.getCurrentItem()},hasNext:()=>(Wl(r,"hasNext",[Yl,Zl],c),al({state:r(),recordStore:n})),hasPrevious:()=>(Wl(r,"hasPrevious",[Yl,Zl],c),ol({state:r()})),async new(e){return v(e,"new")},async add(e){return v(e,"add")},async remove(){if(zl(r,"remove"),Wl(r,"remove",[Zl],c,!1),null==Jc({state:r()}))throw new D("Invalid index",{code:"DS_INDEX_OUT_OF_RANGE"});await t(Cl.remove())},async revert(){return zl(r,"revert"),Wl(r,"revert",[Kl,Zl],c,!1),Hl(r),t(Cl.revert())},async refresh(){zl(r,"refresh"),Wl(r,"refresh",[Yl,Kl,Zl],c,!1),await t(Cl.refresh())},onCurrentIndexChanged:e=>(ql("onCurrentIndexChanged",e),Wl(r,"onCurrentIndexChanged",[Zl,Yl],c,!1),a("currentIndexChanged",p(e,"currentIndexChanged"))),onItemValuesChanged:e=>(ql("onItemValuesChanged",e),Wl(r,"onItemValuesChanged",[Zl,Kl],c,!1),a("itemValuesChanged",p(e,"itemValuesChanged"))),onError:e=>(ql("onError",e),Wl(r,"onError",[Zl,Yl,Kl],c,!1),a("datasetError",p(e,"datasetError"))),onReady:e=>(ql("onReady",e),Wl(r,"onReady",[Yl,Kl,Zl],c,!1),dn(r())?(Promise.resolve(p(e)()),ot.noop):a("datasetReady",p(e,"datasetReady"))),async setSort(e){$l(l,"setSort"),Wl(r,"setSort",[Yl,Zl],c,!1),(e=>{if(!e||!(0,ot.isFunction)(e._build))throw new D("The given sort object is invalid",{code:"DS_INVALID_ARGUMENT"})})(e),await new Promise((e=>O.onReady(e))),pn(r())||await y();const n=h((()=>e._build()),C.withMessage("Sort building failed"));await t((e=>({type:pr,sort:e}))((0,ot.cloneDeep)(n())))},async setFilter(e){$l(l,"setFilter"),Wl(r,"setFilter",[Yl,Zl],c,!1),(e=>{if(!e||!(0,ot.isFunction)(e._build))throw new D("The given filter object is invalid",{code:"DS_INVALID_ARGUMENT"})})(e),await new Promise((e=>O.onReady(e))),pn(r())||await y();const n=h((()=>e._build()),C.withMessage("Filter building failed"));await t((e=>({type:dr,filter:e}))((0,ot.cloneDeep)(n())))},loadMore:async()=>{$l(l,"loadMore"),zl(r,"loadMore"),Wl(r,"loadMore",[Yl,Zl],c,!1),await t(Cl.incrementNumOfPagesToShow())},async nextPage(){if($l(l,"nextPage"),zl(r,"nextPage"),Wl(r,"nextPage",[Yl,Zl],c,!1),pn(r())||await y(),!O.hasNextPage())throw new D("There are no more pages in the dataset",{code:"NO_SUCH_PAGE"});await t(Cl.nextPage());const{items:e}=await Cl.fetchCurrentPage(n,r());return e},async previousPage(){if($l(l,"previousPage"),zl(r,"previousPage"),Wl(r,"previousPage",[Yl,Zl],c,!1),pn(r())||await y(),!O.hasPreviousPage())throw new D("This is the first page in the dataset",{code:"NO_SUCH_PAGE"});await t(Cl.previousPage());const{items:e}=await Cl.fetchCurrentPage(n,r());return e},hasNextPage(){return Wl(r,"hasNextPage",[Yl,Zl],c),sl({state:r(),recordStore:n})},hasPreviousPage(){return Wl(r,"hasPreviousPage",[Yl,Zl],c),il({state:r()})},getTotalPageCount(){return Wl(r,"getTotalPageCount",[Yl,Zl],c),dn(r())?(Ll(Yc({recordStore:n}),"getTotalPageCount"),rl({state:r(),recordStore:n})):null},getCurrentPageIndex(){return Wl(r,"getCurrentPageIndex",[Yl,Zl],c),el({state:r()})},async loadPage(e){Wl(r,"loadPage",[Yl,Zl],c,!1),$l(l,"loadPage"),zl(r,"loadPage"),Ll(Yc({recordStore:n}),"loadPage"),((e,t)=>{if(Gl("pageNumber",e),e>t)throw new D("Page ".concat(e," does not exist"),{code:"NO_SUCH_PAGE"})})(e,O.getTotalPageCount()),pn(r())||await y(),await t(Cl.loadPage(e));const{items:o}=await Cl.fetchCurrentPage(n,r());return o},inScope:(e,t)=>{Wl(r,"inScope",[Yl,Kl,Zl],c,!1);const n=i.getController({repeaterId:e,itemId:t});return n?n.staticExports:O},getPageSize:()=>(Wl(r,"getPageSize",[Yl,Zl],c),Kc({state:r()})),async setPageSize(e){var n;Wl(r,"setPageSize",[Yl,Zl],c,!1),Gl("size",e),await new Promise((e=>O.onReady(e))),pn(r())||await y(),await t((n={size:e},{type:lr.SET_PAGINATION_DATA,paginationData:n}))}},b=(e=>{let{datasetType:t,siblingDynamicPageUrlGetter:r}=e;const n={async getNextDynamicPage(){return null!=r?r.getNextDynamicPageUrl():null},async getPreviousDynamicPage(){return r?r.getPreviousDynamicPageUrl():null}};return(0,ot.mapValues)(n,((e,r)=>function(){return Xl(t,r),e(...arguments)}))})({datasetType:c,siblingDynamicPageUrlGetter:u}),O=Object.assign(w,b),I={};for(const e in O)I[e]=(0,ot.flow)((t=>g(t,Xe.with({category:"datasetAPI",message:"method: ".concat(e," - datasetId:").concat(s)}))),(t=>m(t,e)),(t=>{return z(t,(r=e,e=>{throw e instanceof C?f.log(new C("datasetApi '".concat(r,"' operation failed"),{cause:e})):e instanceof j?f.log(e):f.log(new R("datasetApi '".concat(r,"' operation failed"),{cause:e})),o("datasetError",r,e instanceof A?e.cause.message:e.cause||e),e.cause||e}));var r}))(O[e]);return I}})({store:G,recordStore:me,eventListeners:Y,controllerStore:t,datasetId:h,datasetType:o,isFixedItem:T,siblingDynamicPageUrlGetter:ye,onIdle:X,dispatcher:Z}),be=ve(!1);V.push(m.map((e=>e.onChange(((e,t)=>{const{logger:r}=k;return(n,o,a)=>{const i=((e,t)=>(0,ot.isNull)(e)&&(0,ot.isNull)(t))(n,o);if(i)return void r.log(new R("onChangeHandler invoked with illegal arguments",{extra:{arguments:{before:n,after:o,componentIdToExclude:a}}}));if(((e,t)=>(0,ot.isNull)(e))(n))return void t(Cl.refreshCurrentView()).catch((()=>{}));const s=On(e());if(((e,t)=>(0,ot.isNull)(t))(0,o))return rc(n,s)&&t(Cl.refreshCurrentRecord()).catch((()=>{})),void t(Cl.refreshCurrentView()).catch((()=>{}));if(((e,t)=>rc(e,t))(n,s)){const r=Jc({state:e()});t(Cl.setCurrentRecord(o,r,a)).catch((()=>{}))}}})(G.getState,G.dispatch)))).getOrElse((()=>{})));const{fetchingInitialData:Oe,resolveUserInputDependency:Ie}=(e=>{let{shouldFetchInitialData:t,recordStore:r,store:n,filter:o,datasetIsDeferred:a,modeIsSSR:i,queueMicrotask:s,datasetIsReal:c,collectionId:l,filterResolver:u,dependencyManager:d}=e;const p=()=>{const e=(a=n.getState(),qr.getUserFilterConnectionProps(a.config));var a;const i=t?(e=>{let{recordStore:t}=e;const{logger:r}=k;return t().fold((()=>Promise.resolve(jt.Maybe.Nothing())),(e=>e.hasSeedData()?(e=>e.getSeedRecords().matchWith({Empty:()=>pu.resolve(jt.Maybe.Nothing()),Results:e=>{let{items:t}=e;return pu.resolve(jt.Maybe.Just(t[0]))}}))(e):r.log(new $e("dataset/pageReady/getData",(()=>(e=>e.seed().then((()=>e.getRecords(0,1).then((e=>e.chain((e=>{let{items:t}=e;return jt.Maybe.Just(t[0])})))))).catch((e=>(r.logError(e,"Fetch initial data failed"),jt.Maybe.Nothing()))))(e))))))})({recordStore:r}):Promise.resolve();if(!(c&&(null==e?void 0:e.length)>0))return i;const s=u(o).map((async t=>{const r=await k.dataFetcher.fetchUserFilterInitialData({filter:t,collectionId:l,userFilterConnectionProps:e});n.dispatch((e=>({type:cr,userFilterInitialData:e}))(r))})).getOrElse(null);return Promise.all([s,i])},f=d.getDependencyResolutionPromise(o),h=a&&((e,t)=>{const{promise:r,resolve:n}=new q;return e||t(n),r})(i,s),{waitingForUserInput:g,resolveUserInputDependency:m}=Ls(o)&&(()=>{const{promise:e,resolve:t}=new q;return{waitingForUserInput:e,resolveUserInputDependency:t}})(),y=[f,h,g].filter((e=>Boolean(e)));return{fetchingInitialData:y.length?Promise.all(y).then(p):p(),resolveUserInputDependency:()=>m&&m()}})({dependencyManager:d,shouldFetchInitialData:n&&!oe,recordStore:me,store:G,filter:le,datasetIsDeferred:ne,modeIsSSR:I,queueMicrotask:L,datasetIsReal:re,collectionId:ae,filterResolver:ge});Oe.then((()=>{w();const e=me().fold((()=>{}),(e=>e.getSeedRecords().matchWith({Empty:()=>{},Results:e=>{let{items:t}=e;return t[0]}})));e&&G.dispatch(Cl.setCurrentRecord(e,0))})),c&&!T&&d.getDependenciesByFilter(le,l).forEach((e=>{let{masterDataset:{api:t}}=e;mu({detailsDatasetApis:[be],store:G,masterDatasetApi:t,controllerConfig:n,unsubscribeHandlers:V})}));const Ee=async function(r){N.onLogin((()=>{(()=>{const e=Jc({state:G.getState()}),t=me().fold((()=>!1),(t=>t.isPristine(e)));return t&&!oe})()&&be.refresh()}));const{components:a,detailsDatasetApis:s}=r(P),c=(e=>{let{components:t,connectionsGraph:r,updatedCompIds:n,datasetIsReal:o}=e;const a=t.filter((e=>(e=>{let{component:t,updatedCompIds:r,datasetIsReal:n,connectionsGraph:o}=e;if(r.length&&n){const{id:e}=t;return r.some((t=>fu(o,e,t)||fu(o,t,e)))}return!0})({component:e,connectionsGraph:r,updatedCompIds:n,datasetIsReal:o})));return a.some((e=>{let{role:t}=e;return t===te}))?t:a})({updatedCompIds:y,datasetIsReal:re,connectionsGraph:i,components:a});U(c);const l=((e,{datasetId:t,connectionsGraph:r,datasetIsReal:n,getDependencies:o})=>{if(!n)return e;const{isInsidePrimaryOrDetailsRepeater:a,getDetailsRepeaters:i}=(({datasetId:e,masterIds:t,connectionsGraph:r})=>{const n=n=>r[e].includes(n.id)?"PRIMARY":t.some((e=>r[e].includes(n.id)))?"DETAILS":"OTHER";return{isInsidePrimaryOrDetailsRepeater:({parentRepeater:e})=>{return!!(t=e)&&["PRIMARY","DETAILS"].includes(n(t));var t},getDetailsRepeaters:e=>{const t=[];return e.forEach((({parentRepeater:e})=>{e&&"DETAILS"===n(e)&&t.push(new Proxy(e,{get(e,t){return"role"===t?J:e[t]}}))})),(0,ot.uniqBy)(t,"uniqueId")}}})({datasetId:t,connectionsGraph:r,masterIds:o().map((e=>e.masterDatasetId))}),s=e.filter((e=>!a(e)));return s.push(...i(e)),s})(c,{datasetId:h,datasetIsReal:re,connectionsGraph:i,getDependencies:()=>d.getDependenciesByFilter(le)});if(mu({detailsDatasetApis:s,masterDatasetApi:be,dependencyManager:d,controllerConfig:n,unsubscribeHandlers:V}),re&&await S,Ie(),!un(G.getState())||!u.hasSchema(n.dataset.collectionName))return Oe.then((()=>{v(),d.resolveDependants(h),G.dispatch(Dl(!0)),K("datasetReady")})),Promise.resolve();const p=Lu({components:l,context:{connections:P,recordStore:me,dispatch:G.dispatch,getState:G.getState,datasetApi:be,eventListeners:Y,dispatcher:Z,getFieldType:pe,getSchema:de,controllerFactory:e,controllerStore:t,PresetVerboseMessage:Qe.with({collectionId:ae}),modeIsLivePreview:O,wixFormatter:I&&"bolt"===F||!M?null:nu({locale:M})}});$(((e,t,r,n,o,a,i,s)=>{const c=function(e,t,r,n,o,a,i,s){const{logger:c,errorReporting:l,breadcrumbReporting:u}=k,d=(e,t)=>u(t,Xe.with({category:"effects",message:e,data:{datasetId:o}}));function p(e,r){t.onCurrentRecordModified(r,e)}function f(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];return l(i,R.withMessage("Dataset ".concat(e," event execution failed")))(e,...r)}function h(){return Promise.all(t.onRecordsLoaded())}const g=e=>{throw new D(e,{code:"DS_OPERATION_FAILED"})};return{goToRecordByIndex:(t,r,n)=>({run:d("goToRecordByIndex",(async function(){let o;Yc({recordStore:e})&&await ll({index:r,recordStore:e});try{o=(e=>{let{recordStore:t,index:r}=e;const{total:n,loaded:o}=t().fold((e=>{throw e}),(e=>e.getDatasetSize()));return Math.max(Math.min(r,Math.max(n,o)-1),0)})({recordStore:e,index:r})}catch(e){g(e)}if(t!==o||n){const t=await(a=o,e().fold(g,(e=>e.getRecords(a,1))));return t.matchWith({Empty:()=>Cl.GoToIndexResult.NoRecord(),Results:e=>{let{items:t}=e;return Cl.GoToIndexResult.Record(o,t[0])}})}return Cl.GoToIndexResult.InvalidIndex();var a})),isQueued:!0,resultActionCreator:Cl.goToRecordByIndexResult}),setFieldsInCurrentRecord:(t,n,o)=>({run:d("setFieldsInCurrentRecord",(function(){const a=function(e,t){return(0,ot.mapValues)(t,((t,r)=>e(r).map((e=>function(e,t){switch(e){case"number":return Number(t);case"boolean":if("string"==typeof t)return"true"===t.toLowerCase()||"1"===t.toLowerCase();break;case"text":if(null!=t&&"function"==typeof t.toString)return t.toString()}return t}(e,t))).getOrElse(t)))}(r,t);return e().fold(g,(e=>e.setFieldsValues(n,a,o).fold((e=>{throw e}),(e=>{}))))})),isQueued:!1}),revertChanges:(t,r)=>({run:d("revertChanges",(function(){e().chain((e=>e.resetDraft(t,r))),p()})),isQueued:!1,resultActionCreator:Cl.revertResult}),saveRecord:(t,r)=>({run:d("saveRecord",(async function(){return await(c.log(new Qe(Qe.types.DS_API.TRIGGERED,{eventName:"beforeSave"})),n("beforeSave").then((e=>e.some(ou))).catch((e=>({error:e}))).then((e=>{if(e)throw new D("Operation cancelled by user code. ".concat((0,ot.isBoolean)(e)?"":e.error),{code:"DS_OPERATION_CANCELLED"})}))),e().fold((()=>!1),(async e=>{if(e.hasDraft(t)){!function(e){const t=a.filter((t=>!t.isValid(e)));if(t.forEach((e=>e.updateValidityIndication())),t.length)throw new D("Some of the elements validation failed",{code:"DS_VALIDATION_ERROR"})}(r);const n=await e.saveRecord(t);return f("afterSave",r,n),s.dispatch("afterSave",r,n),n}}))})),isQueued:!0,resultActionCreator:Cl.saveRecordResult}),removeCurrentRecord:t=>({run:d("removeCurrentRecord",(()=>function(t){return e().fold(g,(e=>e.removeRecord(t)))}(t))),isQueued:!0,resultActionCreator:Cl.removeCurrentRecordResult}),newRecord:(t,r)=>({run:d("newRecord",(()=>function(t,r){return e().fold(g,(e=>e.newRecord(t,r)))}(t,r))),isQueued:!0,resultActionCreator:Cl.newRecordResult}),fireEvent:function(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];return{run:d("fireEvent",(()=>f(e,...r))),isQueued:!1}},notifyIndexChange:e=>({run:d("notifyIndexChange",(()=>{t.onCurrentIndexChanged(),f("currentIndexChanged",e)})),isQueued:!1}),notifyRecordSetLoaded:()=>({run:d("notifyRecordSetLoaded",h),isQueued:!0}),updateCurrentView:e=>({run:d("updateCurrentView",(()=>Promise.all(t.onCurrentViewChanged()))),isQueued:!0,resultActionCreator:Cl.updateCurrentViewResult}),refresh:(t,r,n)=>({run:d("refresh",(async function(){return e().fold(g,(async e=>(e.reset(),n?Cl.GoToIndexResult.Record(0,e.newRecord(0,r)):e.getRecords(0,1).then((e=>e.matchWith({Empty:()=>Cl.GoToIndexResult.NoRecord(),Results:e=>{let{items:t}=e;return Cl.GoToIndexResult.Record(0,t[0])}}))))))})),isQueued:!0,resultActionCreator:Cl.refreshResult}),updateComponents:(e,t)=>({run:d("updateComponents",(()=>{p(e,t)})),isQueued:!1})}}(e,t,r,n,o,a,i,s),l=e=>{let{from:t,to:r,hasChanged:n,hasChangedToFalse:o,hasChangedToTrue:a,hasChangedToMatch:i}=e;const s=In(r),l=In(t),u=Sn(r),d=An(r),p=[];return(i(Sn,(e=>e>=0&&e!==s))||a(An))&&p.push(c.goToRecordByIndex(l,u,d)),(n(In)&&l>=0||o(Dn)&&0===s)&&p.push(c.notifyIndexChange(s)),p},u=e=>{let{from:t,to:r,hasChanged:n,hasChangedToMatch:o,hasChangedToTrue:a}=e;const i=In(r),s=On(r),l=On(t),u=[];rc(l,s)?(0,ot.isEqual)(l,s)||(u.push(c.updateComponents(Pn(r),l)),u.push(c.fireEvent("itemValuesChanged",(0,ot.cloneDeep)(l),(0,ot.cloneDeep)(s)))):null==l||null==s||n(In)||u.push(c.updateComponents());const d=_n(r);return o(_n,(e=>null!=e))&&u.push(c.setFieldsInCurrentRecord(d,i,Pn(r))),a(Nn)&&u.push(c.revertChanges(i,En(r))),a(xn)&&u.push(c.removeCurrentRecord(i)),u},d=e=>{let{to:t,hasChanged:r,hasChangedToFalse:n,hasChangedToTrue:o}=e;const a=[];return r(au)&&a.push(c.refresh(In(t),En(t),fn(t))),r(cn)&&a.push(c.notifyRecordSetLoaded()),o(Dn)&&a.push(c.refresh(In(t),En(t),fn(t))),n(Dn)&&a.push(c.notifyRecordSetLoaded()),o(jn)&&a.push(c.updateCurrentView()),a},p=e=>{let{from:t,to:r,hasChangedToTrue:n}=e;const o=In(r),a=On(r);if(n(Mn))return c.saveRecord(o,a)},f=e=>{let{from:t,to:r,hasChangedToNotNull:n}=e;const o=[];return n(Tn)&&o.push(c.newRecord(Tn(r),En(r))),o};return e=>(0,ot.flatten)([l,u,d,p,f].map((t=>t(e))))})(me,p,pe,Y.executeHooks,h,l,K,Z)),V.push(((e,t,r,n,o)=>((e,t,r,n,o)=>{let{getState:a,subscribe:i}=e;const s={new:()=>!pn(a()),save:()=>hn(a()),revert:()=>hn(a()),remove:()=>hn(a()),next:()=>al({state:a(),recordStore:o}),previous:()=>ol({state:a()}),nextPage:()=>sl({state:a(),recordStore:o}),previousPage:()=>il({state:a()}),nextDynamicPage:()=>Rn(a()).hasUrl(),previousDynamicPage:()=>Cn(a()).hasUrl(),loadMore:()=>(e=>{let{state:t,recordStore:r}=e;if(nl({recordStore:r}))return!0;const n=tl({recordStore:r});return!!n&&Zc({state:t})+Qc({state:t})<n.total})({state:a(),recordStore:o})},{inputComponents:c,linkedComponents:l}=((e,t)=>{const r=(0,ot.uniqBy)(e.filter((e=>{let{enabled:t}=e;return t})),(e=>{let{id:t}=e;return t}));return{inputComponents:eu(r),linkedComponents:tu(r,t)}})(t,Object.keys(s)),u=c.length+l.length?i((e=>{let{getState:t,inputComponents:r,linkedComponents:n,datasetId:o,logger:a,shouldEnableLinkedComponent:i}=e;return()=>{const e=t();if(!dn(e))return;const s=hn(e);r.forEach((e=>{ru(e,s,a,o)})),n.forEach((e=>{const{action:t}=e.connectionConfig.events.onClick,r=i[t]();ru(e,r,a,o)}))}})({getState:a,inputComponents:c,linkedComponents:l,datasetId:n,logger:r,shouldEnableLinkedComponent:s})):ot.noop;return u})(e,t,r,n,o))(G,l,x,h,me));const f=(e=>{const t=["value","checked"];return e.reduce(((e,r)=>{var n;const o=(null===(n=r.connectionConfig)||void 0===n?void 0:n.properties)||{};return t.forEach((t=>{(0,ot.has)(o,t)&&((e,t,r)=>{const n=(0,ot.get)(r,t),o=qi(n)&&zi(e)?Hi({time:n,date:e}):zi(n)&&qi(e)?Hi({time:e,date:n}):e;(0,ot.set)(r,t,o)})(r.getValue({propPath:t}),o[t].fieldName,e)})),e}),{})})(l.filter((e=>{let{role:t}=e;return![ue,we].includes(t)})));G.dispatch(Cl.setDefaultRecord(f)),oe&&await G.dispatch(Cl.initWriteOnly(ee)),ne&&(p.hideAll(),I&&p.clearAll());const g=Oe.then((async()=>{if(ne&&await b,!I)try{((e,t,r,n,o)=>{if(n)return;const a=on(e);if(!a)return;const i=ln(e),s=!!On(e),{logger:c,platform:{settings:{env:{editor:l}}}}=k;s&&[kn,Ln].includes(i)&&t.find((e=>{let{role:t,config:r}=e;return((e,t)=>[se,fe].includes(e)||t&&t.properties&&Object.keys(t.properties).length>0)(t,r)}))&&c.log(new ao({id:l?153:152,collectionId:a,datasetId:o,datasetType:r,datasetMode:i})),ct(ln(e),t)&&c.log(new ao({id:l?157:156,collectionId:a,datasetId:o,datasetType:r,datasetMode:i}))})(G.getState(),P,o,ee,h)}catch(e){x.log(new R("Failed to report dataset active BI",{cause:e}))}await p.bindAll(),re&&await(e=>Promise.all(e.getAll().map((e=>new Promise((t=>{e.staticExports.onReady(t)}))))))(t),ne&&p.showAll(),d.resolveDependants(h),G.dispatch(Dl(!0)),K("datasetReady")}));return ne?(v(),Promise.resolve()):(g.then(v),g)},Se=ve(!0);return{pageReady:z(ee?Ee:function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return x.log(new $e("dataset/pageReady",(()=>Ee(...t))))},(e=>x.logError(e,"Dataset pageReady callback failed",{datasetId:h}))),exports:e=>e.type===Ol.l.COMPONENT?Se.inScope(e.compId,e.additionalData.itemId):Se,staticExports:Se,dispose:()=>{V.forEach((e=>e()))},api:be}};function Wu(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Vu(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Wu(Object(r),!0).forEach((function(t){Gu(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Wu(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function Gu(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Bu=e=>ks(e).map((({filterExpression:{filterId:e}})=>e));function qu(e,t,r){if(!t.has(e))throw new TypeError("attempted to "+r+" private field on non-instance");return t.get(e)}var zu=new WeakMap;class Hu{constructor(){var e,t;t={writable:!0,value:void 0},function(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}(this,e=zu),e.set(this,t),function(e,t,r){!function(e,t,r){if(t.set)t.set.call(e,r);else{if(!t.writable)throw new TypeError("attempted to set read only private field");t.value=r}}(e,qu(e,t,"set"),r)}(this,zu,new Map)}get datasetConfigs(){return e=this,(t=qu(this,zu,"get")).get?t.get.call(e):t.value;var e,t}}function $u(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Xu(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?$u(Object(r),!0).forEach((function(t){Yu(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):$u(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function Yu(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Ku(e,t){Qu(e,t),t.add(e)}function Zu(e,t,r){Qu(e,t),t.set(e,r)}function Qu(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Ju(e,t,r){if(!t.has(e))throw new TypeError("attempted to get private field on non-instance");return r}function ed(e,t){return function(e,t){return t.get?t.get.call(e):t.value}(e,rd(e,t,"get"))}function td(e,t,r){return function(e,t,r){if(t.set)t.set.call(e,r);else{if(!t.writable)throw new TypeError("attempted to set read only private field");t.value=r}}(e,rd(e,t,"set"),r),r}function rd(e,t,r){if(!t.has(e))throw new TypeError("attempted to "+r+" private field on non-instance");return t.get(e)}var nd=new WeakMap,od=new WeakMap,ad=new WeakMap,id=new WeakMap,sd=new WeakMap,cd=new WeakMap,ld=new WeakMap,ud=new WeakSet,dd=new WeakSet,pd=new WeakSet;class fd{constructor(e){let{platform:t,dataFetcher:r,warmupCache:n,staticCache:o,features:a,listenersByEvent:i,logger:s,i18n:c,global:l}=e;Ku(this,pd),Ku(this,dd),Ku(this,ud),Zu(this,nd,{writable:!0,value:void 0}),Zu(this,od,{writable:!0,value:void 0}),Zu(this,ad,{writable:!0,value:void 0}),Zu(this,id,{writable:!0,value:void 0}),Zu(this,sd,{writable:!0,value:void 0}),Zu(this,cd,{writable:!0,value:void 0}),Zu(this,ld,{writable:!0,value:void 0});const u=new Qn(s,l);F.set({platform:t,features:a,dataFetcher:r,i18n:c,appState:new Hu,logger:u,errorReporting:ro(u),breadcrumbReporting:no(u),verboseReporting:oo(u)}),td(this,nd,new Ei),td(this,od,n),td(this,ad,o),td(this,id,a),td(this,cd,u),td(this,ld,{}),td(this,sd,i)}initializeDatasets(e){let{datasetConfigs:t,firePlatformEvent:r}=e;try{return ed(this,cd).log(new $e("databinding/createControllers",(()=>Ju(this,ud,hd).call(this,{datasetConfigs:t,firePlatformEvent:r}))))}catch(e){return ed(this,cd).logError(e,"Datasets initialisation failed"),[]}}}function hd(e){let{datasetConfigs:r,firePlatformEvent:n}=e;const{platform:{settings:{mode:{name:o,csr:a,ssr:i},env:{livePreview:s}}}}=k,c=(e=>{const r=(0,ot.values)({DATASET:Dr,ROUTER_DATASET:Ar});return e.map((e=>{const{id:n,type:o,collectionId:a,filter:i,sort:s,pageSize:c,readWriteType:l,includes:u,nested:d,deferred:p,connections:f,dataIsInvalidated:h,updatedCompIds:g,dynamicPageData:m,cursor:y}=e;r.includes(o)||k.logger.log(new R("type of controller MUST be one of ".concat(r," but is ").concat(o)));const v=(0,ot.defaults)({collectionName:a,filter:i,sort:s,includes:u,nested:d,pageSize:c,readWriteType:l,cursor:y,deferred:p,uniqueFieldValues:k.features.dropdownOptionsDistinct?Bs(f):[]},t);return{id:n,compId:n,type:o,livePreviewOptions:{shouldFetchData:h,compsIdsToReset:g},connections:f,dynamicPageData:m,config:{dataset:v,datasetStaticConfig:Gs(v,o,f)}}}))})(r),l=Ju(this,dd,gd).call(this,c),u=ed(this,id).warmupData,d=[],p=[],{resolve:f,promise:h}=new q;ed(this,nd).setSchemas(Xu(Xu({},u&&a&&ed(this,od).getSchemas()||{}),ed(this,ad).getSchemas()||{}));const g=ed(this,cd).log(new $e("databinding/loadSchemas",(()=>ed(this,nd).loadSchemas(yd(c)).then((()=>u&&i&&ed(this,od).setSchemas(ed(this,nd).getSchemas()))))));ed(this,nd).setDatasetConfigs(c.map((e=>{let{config:{dataset:{collectionName:t}},compId:r,type:n}=e;return{collectionId:t,datasetId:r,type:n}})));const m=a&&u&&ed(this,od).getDataStore();m&&ed(this,nd).setStore(Pd(m));const y=ed(this,ad).getDataStore();y&&ed(this,nd).setStaticStore(Pd(y)),ed(this,nd).createInitialDataRequest(Ju(this,pd,md).call(this,c,l));const v=c.reduce(((e,t)=>{let{compId:r,connections:n}=t;return e[r]=n.map((e=>{let{compId:t}=e;return t})),e}),{}),w=(({datasetConfigs:e})=>{const t={},r={},n=(e,n)=>{const o=r[e];if(!o)return;const a=t[o.masterDatasetId];return a?Object.assign(Object.assign({},o),{masterDataset:n?Object.assign(Object.assign({},a),{api:a.api.inScope(n.repeaterId,n.itemId)}):a}):o};return e.forEach((({id:e,connections:t})=>{t.forEach((({role:t,config:n})=>{t===ee&&Object.entries(n.filters).forEach((([t,{fieldName:n}])=>{let o;r[t]={id:t,fieldName:n,masterDatasetId:e,isResolved:!1,promise:new Promise((e=>o=e)),resolve:()=>{r[t].isResolved=!0,o()}}}))}))})),{resolveDependants:e=>Object.values(r).forEach((({id:t,masterDatasetId:n})=>{e===n&&r[t].resolve()})),getDependencyResolutionPromise:e=>{const t=Bu(e).flatMap((e=>r[e]&&!r[e].isResolved?[r[e].promise]:[]));return t.length>0?Promise.all(t):void 0},getDependencyById:n,getDependenciesByFilter:(e,t)=>Bu(e).flatMap((e=>n(e,t)||[])),registerDataset:({id:e,api:r,config:n})=>{t[e]={id:e,api:r,config:n}}}})({datasetConfigs:c}),b=c.map((e=>{let{type:t,config:r,connections:a,compId:c,livePreviewOptions:{shouldFetchData:l,compsIdsToReset:u=[]}={},dynamicPageData:f}=e;const{datasetIsRouter:y,datasetIsDeferred:b}=r.datasetStaticConfig;ed(this,cd).log(new Xe({category:"createControllers",message:"warmup data contents",data:{datasetId:c,datasetType:t,mode:o,warmupData:Boolean(m)}}));const O=(e=>{let{primaryDatasetId:t,recordStoreCache:r,refreshStoreCache:n,dataProvider:o,controllerConfig:a}=e;return jt.Result.fromNullable(a,"missing controller configuration").chain((e=>{let{dataset:t}=e;return jt.Result.fromNullable(t,"controller configuration is missing dataset object")})).chain((e=>{let{collectionName:t}=e;return jt.Result.fromNullable(t,"dataset is not connected to a collection")})).map((e=>{const i=(0,ot.get)(a,["dataset","includes"]),s=(0,ot.get)(a,["dataset","nested"]),c=(0,ot.get)(a,["dataset","cursor"]),l=(0,ot.get)(a,["dataset","readWriteType"]),u=(0,ot.get)(a,["dataset","uniqueFieldValues"]);return bl({primaryDatasetId:t,recordStoreCache:r,refreshStoreCache:n,dataProvider:o,mainCollectionName:e,includes:i,nestedFieldKeys:s,uniqueFieldValues:u,readWriteType:l,cursorPagingRequired:c})}))})({primaryDatasetId:c,recordStoreCache:ed(this,ld),refreshStoreCache:l,dataProvider:ed(this,nd),controllerConfig:r}),{promise:I,resolve:E}=new q;y||b||d.push(I);const{promise:S,resolve:_}=new q;p.push(S);const P=((e,t)=>{const r=(e=>{const t={};return{setController:(r,n)=>{let{repeaterId:o,itemId:a}=r;e.log(new Xe({category:"scopeStore",message:"adding scope",data:{componentId:o,itemId:a}})),t[o]=t[o]||{},t[o][a]=n},getController:e=>{let{repeaterId:r,itemId:n}=e;const o=t[r];return o&&o[n]},removeController:r=>{let{repeaterId:n,itemId:o}=r;e.log(new Xe({category:"scopeStore",message:"removing scope",data:{componentId:n,itemId:o}}));const a=t[n];(0,ot.get)(a,o)&&(a[o].dispose(),(0,ot.unset)(a,o))},getAll:()=>Object.values(t).reduce(((e,t)=>e.concat(Object.values(t))),[])}})(e),n={createRealDataset:()=>o(Vu(Vu({},t),{},{isScoped:!1})),createScopedDetailsDataset:e=>{let{datasetScope:r}=e;return o(Vu(Vu({},t),{},{isScoped:!0,firePlatformEvent:ot.noop,datasetId:hu(t.datasetId,r),datasetScope:r}))},createScopedDataset:e=>{let{datasetScope:r,fixedItem:n}=e;const{dataProvider:a,controllerConfig:i,dynamicPagesData:s}=t,c=(0,ot.cloneDeep)(i),l={items:[n]};c.dataset.filter=a.createSimpleFilter("_id",n._id);const{collectionName:u}=i.dataset;return a.setCollectionData({collectionId:u,data:l}),o(Vu(Vu({},t),{},{isScoped:!0,controllerConfig:c,firePlatformEvent:ot.noop,dynamicPagesData:s,datasetId:hu(t.datasetId,r),fixedRecordId:r.itemId}))}},o=Uu(n,r);return n})(ed(this,cd),{dependencyManager:w,controllerConfig:r,datasetType:t,connections:a,connectionsGraph:v,recordStoreService:O,dataProvider:ed(this,nd),firePlatformEvent:n(c),dynamicPagesData:y&&f?vd({dynamicPageData:f,items:ed(this,ad).getItems(),config:r,convertFromCustomFormat:io.PL}):void 0,datasetId:c,schemasLoading:g,listenersByEvent:ed(this,sd),updatedCompIds:u,markControllerAsRendered:_,markDatasetDataFetched:E,renderingRegularControllers:h,modeIsLivePreview:s,modeIsSSR:i,useLowerCaseDynamicPageUrl:null==f?void 0:f.lowercase}).createRealDataset();return w.registerDataset({id:c,api:P.api,config:r}),Ed(P)}));return i&&u&&d.length&&Promise.all(d).then((()=>{ed(this,od).setDataStore(_d(ed(this,nd).getStore()))})),Promise.all(p).then(f),b}function gd(e){const{appState:t}=k;return e.reduce(((e,r)=>{let{compId:n,config:{dataset:o}}=r;const a=t.datasetConfigs.get(n);return a&&!(0,ot.isEqual)(a,o)&&e.push(n),t.datasetConfigs.set(n,o),e}),[])}function md(e,t){return e.reduce(((e,r)=>{let{compId:n,config:{datasetStaticConfig:{sequenceType:o}},livePreviewOptions:{shouldFetchData:a}={}}=r;return o===Ri?[...e,{id:n,refresh:a||t.includes(n)}]:e}),[])}const yd=e=>{const t=e.reduce(((e,t)=>{let{config:{dataset:{collectionName:r}}}=t;return r?e.add(r):e}),new Set);return[...t]},vd=e=>{let{dynamicPageData:t,config:r,items:n,convertFromCustomFormat:o}=e;const{dynamicUrl:a,userDefinedFilter:i}=t,s=o(n)[0],c=(0,ot.get)(r,"dataset.sort",[])||[],l=a&&s?(u=a,{fields:(u=$s(u)).match(qs)||[],nonFields:u.replace(qs,"").split(Hs).filter((e=>!!e))}).fields:[];var u;const d=wd(c),p=(0,ot.difference)(l,d),f=bd([...c,...Od(p)]),h=[...d,...p];return{dynamicUrl:a,userDefinedFilter:i,dynamicUrlPatternFieldsValues:Id(s,h,l),sort:f,sortFields:h,patternFields:l}},wd=e=>(0,ot.flatten)(e.map((e=>Object.keys(e).map((e=>e))))),bd=e=>e.reduce(((e,t)=>Object.assign(e,t)),{}),Od=e=>e.map((e=>({[e]:"asc"}))),Id=(e,t,r)=>{const n=r.concat(t);return r.length?(0,ot.pick)(e,n):null},Ed=e=>{let{pageReady:t,exports:r,dispose:n}=e;return{pageReady:t,exports:r,dispose:n}},Sd=e=>t=>{if(t)return Xu(Xu({},t),{},{recordsByCollectionId:Object.entries(t.recordsByCollectionId).reduce(((t,r)=>{let[n,o]=r;return t[n]=e(o),t}),{})})},_d=Sd(io.ah),Pd=Sd(io.PL),Td=e=>{let{datasetId:t,record:r,schema:n,getSchema:o}=e;const a={"form-id":{value:t,keyName:""}},i=(0,ot.pickBy)(n.fields,((e,t)=>((e,t)=>{const r=e.type,n=y.includes(r),o=!!e.systemField,a=["_createdDate","_updatedDate"].includes(t||e.name);return(!o||a)&&n})(e,t)&&!function(e){return!!e.isDeleted}(e)));return(0,ot.forEach)(i,((e,n)=>{const i=function(e){let{record:t,fieldData:r,fieldName:n,getSchema:o}=e;if("reference"===r.type){const e=o(r.referencedCollection);if(!e)return;const a=Li(t[n],e.displayField);return{value:Zi(a),type:e.fields[e.displayField].type}}return{value:Zi(Li(t,n)),type:r.type}}({record:r,fieldData:e,fieldName:n,getSchema:o});if(!i)return;const{value:s,type:c}=i,{displayName:l,index:u}=e,d=((e,t)=>"".concat(e,".").concat(t))(t,n);a["field:".concat(d)]={value:s,keyName:l,index:u,valueType:c}})),a},Rd=e=>{let{automationsClientCreator:t}=e;const r=t().reportFormEventToAutomationCreator();return{afterSave:async(e,t,n)=>{let{datasetId:o,getSchema:a,getState:i}=e;const s=i(),c=a();Boolean(s.records.isForm)&&c&&await r((e=>{let{datasetId:t,getSchema:r,record:n,schema:o}=e;return{eventUTCTime:Li(n,"_updatedDate"),detailedEventPayload:Td({datasetId:t,record:n,schema:o,getSchema:r})}})({datasetId:o,record:n,schema:c,getSchema:a}))}}};var Cd=a(9102),Dd=function(e,t){return Dd=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},Dd(e,t)};function Ad(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}Dd(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}Object.create,Object.create;var jd=a(711),xd=a.n(jd);function Nd(e){return"object"===xd()(e)}function Md(e){return"array"===xd()(e)}function Fd(e){return"string"===xd()(e)}function kd(e){if(null==e||"object"!=typeof e)return e;var t=null;if(function(e){return"date"===xd()(e)}(e))t=new Date(e.getTime());else for(var r in t=e.constructor(),e)t[r]=kd(e[r]);return t}var Ld=a(7736);a(4312);var Ud=function(){return"WDE0019: Reference operation takes a string ID or an object with an ID to be connected."},Wd=function(){return"WDE0021: Invalid reference"};function Vd(e,t){return Gd(e,t)}function Gd(e,t){var r=new(t&&"WD_UNKNOWN_ERROR"!==t?qd:Error)(e);return r.code=t,r}function Bd(e){return Vd(function(e){return"WDE0025: The ".concat(e," collection does not exist. You cannot work with a collection using the Data API before it is created in the Editor.")}(e),"WD_SCHEMA_DOES_NOT_EXIST")}function qd(e){var t=new Ld.UserCodeError(e);return Object.setPrototypeOf(t,Object.getPrototypeOf(this)),Error.captureStackTrace&&Error.captureStackTrace(t,qd),t.name=Error.name,t}Object.create(Error.prototype,{constructor:{value:Error,enumerable:!1,writable:!0,configurable:!0}}),qd.prototype=Object.create(Ld.UserCodeError.prototype,{constructor:{value:qd,enumerable:!1,writable:!0,configurable:!0}});var zd=function(){function e(){this._validations=[]}return e.prototype.arityIsZero=function(e){var t=this;return this.addValidation((function(){return 0===e.length}),(function(){return e=t.operatorName,"WDE0038: Invalid ".concat(e," usage. ").concat(e," does not take parameters.");var e}))},e.prototype.arityIsOne=function(e){var t=this;return this.addValidation((function(){return 1===e.length}),(function(){return e=t.operatorName,"WDE0039: Invalid ".concat(e," usage. ").concat(e," requires one parameter.");var e}))},e.prototype.arityIsTwo=function(e){var t=this;return this.addValidation((function(){return 2===e.length}),(function(){return e=t.operatorName,"WDE0040: Invalid ".concat(e," usage. ").concat(e," requires two parameters.");var e}))},e.prototype.arityIsThree=function(e){var t=this;return this.addValidation((function(){return 3===e.length}),(function(){return e=t.operatorName,"WDE0041: Invalid ".concat(e," usage. ").concat(e," requires three parameters.");var e}))},e.prototype.arityIsAtLeastTwo=function(e){var t=this;return this.addValidation((function(){return e.length>=2}),(function(){return e=t.operatorName,"WDE0042: Invalid ".concat(e," usage. ").concat(e," requires at least two parameters.");var e}))},e.prototype.arityIsAtLeastOne=function(e){var t=this;return this.addValidation((function(){return e.length>=1}),(function(){return e=t.operatorName,"WDE0043: Invalid ".concat(e," usage. ").concat(e," requires at least one parameter.");var e}))},e.prototype.addValidation=function(e,t){return this._validations.push({predicateFn:e,messageFn:t}),this},e}();function Hd(e){return Fd(e)&&""!==e||Nd(e)&&e.hasOwnProperty("_id")}function $d(e){return Fd(e)||Nd(e)&&e.hasOwnProperty("_id")}function Xd(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Yd(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function Kd(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}function Zd(e){return t=function(e){return"WDE0026: The ".concat(e," collection was removed, so you cannot work with it. To restore its data, create a new collection with the same name.")}(e),Promise.reject(Vd(t,"WD_COLLECTION_DELETED"));var t}(function(e){function t(t){var r=e.call(this)||this;return r._invalidArguments=kd(t),r}Ad(t,e),t.prototype.validateAndAggregate=function(){var e=this,t=this._validations.every((function(t){var r=t.predicateFn,n=t.messageFn;return e._appendIfInvalid(r(),n())}));return[this._invalidArguments,t]},t.prototype._appendIfInvalid=function(e,t){return!!e||(this._invalidArguments.push(t),!1)}})(zd),function(e){function t(){return null!==e&&e.apply(this,arguments)||this}Ad(t,e),t.prototype.arity=function(e,t,r,n){return this.addValidation((function(){return t.length<=n&&t.length>=r}),(function(){return function(e,t,r,n){return"WDE0008: wixData.".concat(e," expects between ").concat(t," and ").concat(r," arguments, but was called with ").concat(n,".")}(e,r,n,t.length)}))},t.prototype._isObject=function(e,t){return this.addValidation((function(){return Nd(e)}),(function(){return function(e,t){return"WDE0004: Failed to save [".concat(e,"] into [").concat(t,"].\nItems must be JavaScript objects.")}(e,t)}))},t.prototype.item=function(e,t,r){return this._isObject(e,t).addValidation((function(){return void 0!==e._id?Fd(e._id):!r}),(function(){return"WDE0007: Invalid update. Updated object must have a string _id property."}))},t.prototype.items=function(e,t){return this.addValidation((function(){return Md(e)&&e.every((function(e){return Nd(e)&&(void 0===e._id||null===e._id||Fd(e._id))}))}),(function(){return function(e){return"WDE0005: Failed to bulk save items into [".concat(e,"].\nItems must be an array of JavaScript objects and itemIds must be strings if present.")}(t)})).addValidation((function(){return e.length<=1e3}),(function(){return function(e){return"WDE0006: Failed to bulk save items into [".concat(e,"].\nCannot insert more than 1000 items in one request")}(t)}))},t.prototype.fieldName=function(e){return this.addValidation((function(){return Fd(e)}),(function(){return"WDE0003: FieldName must be a string."}))},t.prototype.itemId=function(e){return this.addValidation((function(){return Fd(e)}),(function(){return"WDE0002: ItemId must be a string."}))},t.prototype.itemIds=function(e,t){return this.addValidation((function(){return Md(e)&&e.every((function(e){return Fd(e)}))}),(function(){return"WDE0068: Item ids must be an array of strings"})).addValidation((function(){return e.length<=1e3}),(function(){return function(e){return"WDE0069: Failed to remove items from [".concat(e,"].\nCannot remove more than 1000 items in one request")}(t)}))},t.prototype._options=function(e,t){return this.addValidation((function(){var r=Nd(e)&&t.every((function(t){return null==(r=e[t])||(n=r,"boolean"===xd()(n));var r,n}));return null==e||r}),(function(){return"WDE0018: Options must be an object with one or all of the following boolean properties: ".concat(t.join(", "),".")}))},t.prototype.referenceRemoveParameters=function(e){return this.addValidation((function(){return Md(e)&&e.every($d)}),Ud)},t.prototype.referenceParameters=function(e){return this.addValidation((function(){return Md(e)&&e.every(Hd)}),Ud)},t.prototype.referenceParameter=function(e){return this.addValidation((function(){return Hd(e)}),Ud)},t.prototype.isNonEmptyString=function(e,t){return this.addValidation((function(){return"string"==typeof e&&e.length>0}),(function(){return"WDE0094: Invalid ".concat(e=t," parameter. ").concat(e," parameter must be non-empty string.");var e}))},t.prototype.references=function(e){return this.addValidation((function(){return Md(e)&&e.every((function(e){return Fd(e.relationshipName)&&Hd(e.left)&&Hd(e.right)}))}),Wd)},t.prototype.options=function(e){return this._options(e,["suppressAuth","suppressHooks","showDrafts","consistentRead"])},t.prototype.bulkInsertOptions=function(e){return this._options(e,["suppressAuth","suppressHooks","overrideExisting"])},t.prototype.bulkUpdateOptions=function(e){return this._options(e,["suppressAuth","suppressHooks","showDrafts"])},t.prototype.bulkRemoveOptions=function(e){return this._options(e,["suppressAuth","suppressHooks","showDrafts"])},t.prototype.truncateOptions=function(e){return this._options(e,["suppressAuth"])},t.prototype.collectionName=function(e){return this.addValidation((function(){return Fd(e)}),(function(){return"WDE0001: Collection name must be a string."}))}}(function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Ad(t,e),t.prototype.validateAndReject=function(){var e=this;return Promise.resolve().then((function(){e._validations.forEach((function(e){var t=e.predicateFn,r=e.messageFn;if(!t())throw Gd(r(),"WD_VALIDATION_ERROR")}))}))},t}(zd));var Qd=function(e){function t(e,r){Xd(this,t);var n=Yd(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return Object.setPrototypeOf(n,r.prototype),n.name=r.name,Error.captureStackTrace?Error.captureStackTrace(n,r):n.stack=new Error(e).stack,n}return Kd(t,Error),t}(),Jd=function(e){function t(e){Xd(this,t);var r=Yd(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,t));return r.reason=e,r.message=e,r}return Kd(t,e),t}(Qd),ep=function(e){function t(e,r,n,o){Xd(this,t);var a=Yd(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,n,t));return a.status=e,a.responseText=r,a.requestId=o,a}return Kd(t,e),t}(Qd),tp=function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var r=[],n=!0,o=!1,a=void 0;try{for(var i,s=e[Symbol.iterator]();!(n=(i=s.next()).done)&&(r.push(i.value),!t||r.length!==t);n=!0);}catch(e){o=!0,a=e}finally{try{!n&&s.return&&s.return()}finally{if(o)throw a}}return r}(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")},rp=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),np="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},op=function(e){return"object"===(void 0===e?"undefined":np(e))&&e.message?e.message:"string"==typeof e?e:JSON.stringify(e)},ap=function(e){return e.reduce((function(e,t){return Object.assign({},e,(r={},o=t,(n=t.id)in r?Object.defineProperty(r,n,{value:o,enumerable:!0,configurable:!0,writable:!0}):r[n]=o,r));var r,n,o}),{})},ip=function(e,t){return e.endsWith(t)?e.substring(0,e.length-t.length):e},sp=function(){function e(t,r,n,o){var a=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e);var i=function(e){return e=ip(e,"/"),ip(e,"/v1/schemas")}(o&&o.baseUrl||"https://cloud-data.wix-code.com");this.signedInstance=r,this.gridAppId=n,this.mutate=function(e,r,n){return t[e](i+r,n,a._setHeaders()).then((function(e){return e.data})).catch(a._handleError)},this.retrieve=function(e){return t.get(i+e,a._setHeaders()).then((function(e){return e.data})).catch(a._handleError)}}return rp(e,null,[{key:"FailedRequestException",get:function(){return Jd}},{key:"UnsuccessfulResponseException",get:function(){return ep}}]),rp(e,[{key:"wrapWithDefaultOptions",value:function(e){return Object.assign({},e,{appId:this.gridAppId})}},{key:"formRequestUrl",value:function(e){return"/v1/schemas?"+Cd.stringify(e)}},{key:"get",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{includeDeletedCollections:!1},r=this.wrapWithDefaultOptions({includeDeleted:!0,schemaIds:e});return this.retrieve(this.formRequestUrl(r)).then((function(r){var n=tp(r.schemas,1)[0];return n&&n.isDeleted&&!t.includeDeletedCollections?Zd(e):n||Promise.reject(Bd(e))}))}},{key:"bulkGet",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{includeDeletedCollections:!1,referencedCollectionsDepth:0},r=this.wrapWithDefaultOptions({depth:t.referencedCollectionsDepth||0,includeDeleted:t.includeDeletedCollections||!1,schemaIds:e});return this.retrieve(this.formRequestUrl(r)).then((function(e){var t=e.schemas;return ap(t)}))}},{key:"list",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{includeDeletedCollections:!1},t=this.wrapWithDefaultOptions({schemaIds:[],depth:0,includeDeleted:e.includeDeletedCollections||!1});return this.retrieve(this.formRequestUrl(t)).then((function(e){var t=e.schemas;return ap(t)}))}},{key:"save",value:function(e,t){var r=this.wrapWithDefaultOptions({schemaId:e,schema:t});return this.mutate("post","/v1/schemas",r).then((function(e){return e.schemas}))}},{key:"setIsDeletedFlag",value:function(e,t){var r=this.wrapWithDefaultOptions({schemaId:e,partialSchema:{isDeleted:t}});return this.mutate("patch","/v1/schemas",r).then((function(e){return e.schemas}))}},{key:"remove",value:function(e){return this.setIsDeletedFlag(e,!0)}},{key:"restore",value:function(e){return this.setIsDeletedFlag(e,!1)}},{key:"_setHeaders",value:function(){return{headers:{authorization:this.signedInstance}}}},{key:"_handleError",value:function(e){if(!e.response)return Promise.reject(new Jd(op(e)));var t=e.response,r=t.headers["x-wix-request-id"];return Promise.reject(new ep(t.status,t.data,op(t.data),r))}}]),e}();const cp=sp,lp={SCALE_TO_FILL:"fill",SCALE_TO_FIT:"fit",STRETCH:"stretch",ORIGINAL_SIZE:"original_size",TILE:"tile",TILE_HORIZONTAL:"tile_horizontal",TILE_VERTICAL:"tile_vertical",FIT_AND_TILE:"fit_and_tile",LEGACY_STRIP_TILE:"legacy_strip_tile",LEGACY_STRIP_TILE_HORIZONTAL:"legacy_strip_tile_horizontal",LEGACY_STRIP_TILE_VERTICAL:"legacy_strip_tile_vertical",LEGACY_STRIP_SCALE_TO_FILL:"legacy_strip_fill",LEGACY_STRIP_SCALE_TO_FIT:"legacy_strip_fit",LEGACY_STRIP_FIT_AND_TILE:"legacy_strip_fit_and_tile",LEGACY_STRIP_ORIGINAL_SIZE:"legacy_strip_original_size",LEGACY_ORIGINAL_SIZE:"actual_size",LEGACY_FIT_WIDTH:"fitWidth",LEGACY_FIT_HEIGHT:"fitHeight",LEGACY_FULL:"full",LEGACY_BG_FIT_AND_TILE:"legacy_tile",LEGACY_BG_FIT_AND_TILE_HORIZONTAL:"legacy_tile_horizontal",LEGACY_BG_FIT_AND_TILE_VERTICAL:"legacy_tile_vertical",LEGACY_BG_NORMAL:"legacy_normal"},up="fit",dp="fill",pp="fill_focal",fp="crop",hp="legacy_crop",gp="legacy_fill",mp="center",yp="top_left",vp="top_right",wp="bottom",bp="bottom_left",Op="bottom_right",Ip="left",Ep="right",Sp={[mp]:{x:.5,y:.5},[yp]:{x:0,y:0},[vp]:{x:1,y:.5},top:{x:.5,y:0},[bp]:{x:0,y:1},[Op]:{x:1,y:1},[wp]:{x:.5,y:1},[Ep]:{x:1,y:.5},[Ip]:{x:0,y:.5}},_p={center:"c",top:"t",top_left:"tl",top_right:"tr",bottom:"b",bottom_left:"bl",bottom_right:"br",left:"l",right:"r"},Pp="img",Tp={AUTO:"auto",CLASSIC:"classic",SUPER:"super"},Rp={radius:"0.66",amount:"1.00",threshold:"0.01"},Cp=25e6,Dp=[1.5,2,4],Ap={HIGH:{size:196e4,quality:90,maxUpscale:1},MEDIUM:{size:36e4,quality:85,maxUpscale:1},LOW:{size:16e4,quality:80,maxUpscale:1.2},TINY:{size:0,quality:80,maxUpscale:1.4}},jp="jpg",xp="jpeg",Np="png",Mp="webp",Fp={isMobile:!1};function kp(){if("undefined"!=typeof window&&"undefined"!=typeof navigator){const t=window.matchMedia&&window.matchMedia("(max-width: 767px)").matches,r=/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent);e=t&&r,Fp.isMobile=e}var e}function Lp(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];return function(){for(var t=arguments.length,n=new Array(t),o=0;o<t;o++)n[o]=arguments[o];const a=n[n.length-1]||{},i=[e[0]];return r.forEach((function(t,r){const o=Number.isInteger(t)?n[t]:a[t];i.push(o,e[r+1])})),i.join("")}}function Up(e){return e[e.length-1]}const Wp=[Np,xp,jp,"jpe","wix_ico_mp","wix_mp"],Vp=[xp,jp,"jpe"];function Gp(e){return function(e){return Wp.includes(zp(e))}(e)&&!function(e){return/(^https?)|(^data)|(^\/\/)/.test(e)}(e)}const Bp=["/","\\","?","<",">","|","“",":",'"'].map(encodeURIComponent),qp=["\\.","\\*"];function zp(e){return(/[.]([^.]+)$/.exec(e)&&/[.]([^.]+)$/.exec(e)[1]||"").toLowerCase()}function Hp(e,t,r,n,o){let a;return a=o===dp?function(e,t,r,n){return Math.max(r/e,n/t)}(e,t,r,n):o===up?function(e,t,r,n){return Math.min(r/e,n/t)}(e,t,r,n):1,a}function $p(e,t,r,n,o,a){e=e||n.width,t=t||n.height;const{scaleFactor:i,width:s,height:c}=function(e,t,r,n,o){let a,i=r,s=n;if(a=Hp(e,t,r,n,o),o===up&&(i=e*a,s=t*a),i&&s&&i*s>Cp){const r=Math.sqrt(Cp/(i*s));i*=r,s*=r,a=Hp(e,t,i,s,o)}return{scaleFactor:a,width:i,height:s}}(e,t,n.width*o,n.height*o,r);return function(e,t,r,n,o,a,i){const{optimizedScaleFactor:s,upscaleMethodValue:c,forceUSM:l}=function(e,t,r,n){return"auto"===n?function(e,t){const r=Kp(e,t);return{optimizedScaleFactor:Ap[r].maxUpscale,upscaleMethodValue:1,forceUSM:!1}}(e,t):"super"===n?function(e){return{optimizedScaleFactor:Up(Dp),upscaleMethodValue:2,forceUSM:!(Dp.includes(e)||e>Up(Dp))}}(r):function(e,t){const r=Kp(e,t);return{optimizedScaleFactor:Ap[r].maxUpscale,upscaleMethodValue:1,forceUSM:!1}}(e,t)}(e,t,a,o);let u=r,d=n;if(a<=s)return{width:u,height:d,scaleFactor:a,upscaleMethodValue:c,forceUSM:l,cssUpscaleNeeded:!1};switch(i){case dp:u=r*(s/a),d=n*(s/a);break;case up:u=e*s,d=t*s}return{width:u,height:d,scaleFactor:s,upscaleMethodValue:c,forceUSM:l,cssUpscaleNeeded:!0}}(e,t,s,c,a,i,r)}function Xp(e){return e.alignment&&_p[e.alignment]||_p.center}function Yp(e){let t;return!e||"number"!=typeof e.x||isNaN(e.x)||"number"!=typeof e.y||isNaN(e.y)||(t={x:Zp(Math.max(0,Math.min(100,e.x))/100,2),y:Zp(Math.max(0,Math.min(100,e.y))/100,2)}),t}function Kp(e,t){const r=e*t;return r>Ap.HIGH.size?"HIGH":r>Ap.MEDIUM.size?"MEDIUM":r>Ap.LOW.size?"LOW":"TINY"}function Zp(e,t){const r=Math.pow(10,t||0);return(e*r/r).toFixed(t)}function Qp(e){return e&&e.upscaleMethod&&Tp[e.upscaleMethod.toUpperCase()]||Tp.AUTO}function Jp(e,t){const r=$p(e.src.width,e.src.height,up,t,e.devicePixelRatio,e.upscaleMethod);return{transformType:dp,width:Math.round(r.width),height:Math.round(r.height),alignment:_p.center,upscale:r.scaleFactor>1,forceUSM:r.forceUSM,scaleFactor:r.scaleFactor,cssUpscaleNeeded:r.cssUpscaleNeeded,upscaleMethodValue:r.upscaleMethodValue}}function ef(e){return{transformType:fp,x:Math.round(e.x),y:Math.round(e.y),width:Math.round(e.width),height:Math.round(e.height),upscale:!1,forceUSM:!1,scaleFactor:1,cssUpscaleNeeded:!1}}function tf(e,t,r){return"number"==typeof e&&!isNaN(e)&&0!==e&&e>=t&&e<=r}function rf(e,t,r,n){const o=function(e){var t;return null!==(t=null==e?void 0:e.isSEOBot)&&void 0!==t&&t}(n),a=function(e){return Vp.includes(zp(e))}(p=t.id)?jp:function(e){return zp(e)===Np}(p)?Np:function(e){return zp(e)===Mp}(p)?Mp:"unrecognized",i=function(e,t){const r=/\.([^.]*)$/,n=new RegExp("(".concat(Bp.concat(qp).join("|"),")"),"g");if(t&&t.length){let e=t;const o=t.match(r);return o&&Wp.includes(o[1])&&(e=t.replace(r,"")),encodeURIComponent(e).replace(n,"_")}const o=e.match(/\/(.*?)$/);return(o?o[1]:e).replace(r,"")}(t.id,t.name),s=o?1:function(e){return Math.min(e.pixelAspectRatio||1,2)}(r),c=zp(t.id),l=c,u=Gp(t.id),d={fileName:i,fileExtension:c,fileType:a,fittingType:e,preferredExtension:l,src:{id:t.id,width:t.width,height:t.height,isCropped:!1},focalPoint:{x:t.focalPoint&&t.focalPoint.x,y:t.focalPoint&&t.focalPoint.y},parts:[],devicePixelRatio:s,quality:0,upscaleMethod:Qp(n),progressive:!0,watermark:"",unsharpMask:{},filters:{},transformed:u};var p;return u&&(function(e,t,r){let n;switch(t.crop&&(n=function(e,t){const r=Math.max(0,Math.min(e.width,t.x+t.width)-Math.max(0,t.x)),n=Math.max(0,Math.min(e.height,t.y+t.height)-Math.max(0,t.y));return r&&n&&(e.width!==r||e.height!==n)?{x:Math.max(0,t.x),y:Math.max(0,t.y),width:r,height:n}:null}(t,t.crop),n&&(e.src.width=n.width,e.src.height=n.height,e.src.isCropped=!0,e.parts.push(ef(n)))),e.fittingType){case lp.SCALE_TO_FIT:case lp.LEGACY_FIT_WIDTH:case lp.LEGACY_FIT_HEIGHT:case lp.LEGACY_FULL:case lp.FIT_AND_TILE:case lp.LEGACY_BG_FIT_AND_TILE:case lp.LEGACY_BG_FIT_AND_TILE_HORIZONTAL:case lp.LEGACY_BG_FIT_AND_TILE_VERTICAL:case lp.LEGACY_BG_NORMAL:e.parts.push(Jp(e,r));break;case lp.SCALE_TO_FILL:e.parts.push(function(e,t){const r=$p(e.src.width,e.src.height,dp,t,e.devicePixelRatio,e.upscaleMethod),n=Yp(e.focalPoint);return{transformType:n?pp:dp,width:Math.round(r.width),height:Math.round(r.height),alignment:Xp(t),focalPointX:n&&n.x,focalPointY:n&&n.y,upscale:r.scaleFactor>1,forceUSM:r.forceUSM,scaleFactor:r.scaleFactor,cssUpscaleNeeded:r.cssUpscaleNeeded,upscaleMethodValue:r.upscaleMethodValue}}(e,r));break;case lp.STRETCH:e.parts.push(function(e,t){const r=Hp(e.src.width,e.src.height,t.width,t.height,dp),n=Object.assign({},t);return n.width=e.src.width*r,n.height=e.src.height*r,Jp(e,n)}(e,r));break;case lp.TILE_HORIZONTAL:case lp.TILE_VERTICAL:case lp.TILE:case lp.LEGACY_ORIGINAL_SIZE:case lp.ORIGINAL_SIZE:n=function(e,t,r,n){const o=Yp(r)||function(){return Sp[arguments.length>0&&void 0!==arguments[0]?arguments[0]:mp]}(n);return{x:Math.max(0,Math.min(e.width-t.width,o.x*e.width-t.width/2)),y:Math.max(0,Math.min(e.height-t.height,o.y*e.height-t.height/2)),width:Math.min(e.width,t.width),height:Math.min(e.height,t.height)}}(e.src,r,e.focalPoint,r.alignment),e.src.isCropped?(Object.assign(e.parts[0],n),e.src.width=n.width,e.src.height=n.height):e.parts.push(ef(n));break;case lp.LEGACY_STRIP_TILE_HORIZONTAL:case lp.LEGACY_STRIP_TILE_VERTICAL:case lp.LEGACY_STRIP_TILE:case lp.LEGACY_STRIP_ORIGINAL_SIZE:e.parts.push(function(e){return{transformType:hp,width:Math.round(e.width),height:Math.round(e.height),alignment:Xp(e),upscale:!1,forceUSM:!1,scaleFactor:1,cssUpscaleNeeded:!1}}(r));break;case lp.LEGACY_STRIP_SCALE_TO_FIT:case lp.LEGACY_STRIP_FIT_AND_TILE:e.parts.push(function(e){return{transformType:up,width:Math.round(e.width),height:Math.round(e.height),upscale:!1,forceUSM:!0,scaleFactor:1,cssUpscaleNeeded:!1}}(r));break;case lp.LEGACY_STRIP_SCALE_TO_FILL:e.parts.push(function(e){return{transformType:gp,width:Math.round(e.width),height:Math.round(e.height),alignment:Xp(e),upscale:!1,forceUSM:!0,scaleFactor:1,cssUpscaleNeeded:!1}}(r))}}(d,t,r),function(e,t){var r;t=t||{},e.quality=function(e,t){const r=e.fileType===Np;if(e.fileType===jp||r){const a=Up(e.parts),i=(n=a.width,o=a.height,Ap[Kp(n,o)].quality);let s=t.quality&&t.quality>=5&&t.quality<=90?t.quality:i;return s=r?s+5:s,s}var n,o;return 0}(e,t),e.progressive=function(e){return!1!==e.progressive}(t),e.watermark=function(e){return e.watermark}(t),e.autoEncode=null===(r=t.autoEncode)||void 0===r||r,e.unsharpMask=function(e,t){var r,n,o,a;return function(e){const t="number"==typeof(e=e||{}).radius&&!isNaN(e.radius)&&e.radius>=.1&&e.radius<=500,r="number"==typeof e.amount&&!isNaN(e.amount)&&e.amount>=0&&e.amount<=10,n="number"==typeof e.threshold&&!isNaN(e.threshold)&&e.threshold>=0&&e.threshold<=255;return t&&r&&n}(t.unsharpMask)?{radius:Zp(null===(r=t.unsharpMask)||void 0===r?void 0:r.radius,2),amount:Zp(null===(n=t.unsharpMask)||void 0===n?void 0:n.amount,2),threshold:Zp(null===(o=t.unsharpMask)||void 0===o?void 0:o.threshold,2)}:("number"!=typeof(a=(a=t.unsharpMask)||{}).radius||isNaN(a.radius)||0!==a.radius||"number"!=typeof a.amount||isNaN(a.amount)||0!==a.amount||"number"!=typeof a.threshold||isNaN(a.threshold)||0!==a.threshold)&&function(e){const t=Up(e.parts);return!(t.scaleFactor>=1)||t.forceUSM}(e)?Rp:void 0}(e,t),e.filters=function(e){const t=e.filters||{},r={};return tf(t.contrast,-100,100)&&(r.contrast=t.contrast),tf(t.brightness,-100,100)&&(r.brightness=t.brightness),tf(t.saturation,-100,100)&&(r.saturation=t.saturation),tf(t.hue,-180,180)&&(r.hue=t.hue),tf(t.blur,0,100)&&(r.blur=t.blur),r}(t)}(d,n)),d}var nf,of,af,sf,cf,lf,uf,df,pf,ff,hf,gf,mf,yf,vf,wf,bf;function Of(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}const If=Lp(nf||(nf=Of(["fit/w_",",h_",""])),"width","height"),Ef=Lp(of||(of=Of(["fill/w_",",h_",",al_",""])),"width","height","alignment"),Sf=Lp(af||(af=Of(["fill/w_",",h_",",fp_","_",""])),"width","height","focalPointX","focalPointY"),_f=Lp(sf||(sf=Of(["crop/x_",",y_",",w_",",h_",""])),"x","y","width","height"),Pf=Lp(cf||(cf=Of(["crop/w_",",h_",",al_",""])),"width","height","alignment"),Tf=Lp(lf||(lf=Of(["fill/w_",",h_",",al_",""])),"width","height","alignment"),Rf=Lp(uf||(uf=Of([",lg_",""])),"upscaleMethodValue"),Cf=Lp(df||(df=Of([",q_",""])),"quality"),Df=Lp(pf||(pf=Of([",usm_","_","_",""])),"radius","amount","threshold"),Af=Lp(ff||(ff=Of([",bl"]))),jf=Lp(hf||(hf=Of([",wm_",""])),"watermark"),xf={contrast:Lp(gf||(gf=Of([",con_",""])),"contrast"),brightness:Lp(mf||(mf=Of([",br_",""])),"brightness"),saturation:Lp(yf||(yf=Of([",sat_",""])),"saturation"),hue:Lp(vf||(vf=Of([",hue_",""])),"hue"),blur:Lp(wf||(wf=Of([",blur_",""])),"blur")},Nf=Lp(bf||(bf=Of([",enc_auto"])));function Mf(e){const t=[];e.parts.forEach((e=>{switch(e.transformType){case fp:t.push(_f(e));break;case hp:t.push(Pf(e));break;case gp:let r=Tf(e);e.upscale&&(r+=Rf(e)),t.push(r);break;case up:let n=If(e);e.upscale&&(n+=Rf(e)),t.push(n);break;case dp:let o=Ef(e);e.upscale&&(o+=Rf(e)),t.push(o);break;case pp:let a=Sf(e);e.upscale&&(a+=Rf(e)),t.push(a)}}));let r=t.join("/");return e.quality&&(r+=Cf(e)),e.unsharpMask&&(r+=Df(e.unsharpMask)),e.progressive||(r+=Af(e)),e.watermark&&(r+=jf(e)),e.filters&&(r+=Object.keys(e.filters).map((t=>xf[t](e.filters))).join("")),e.autoEncode&&"gif"!==e.fileType&&(r+=Nf(e)),"".concat(e.src.id,"/").concat("v1","/").concat(r,"/").concat(e.fileName,".").concat(e.preferredExtension)}function Ff(e,t,r){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},o=arguments.length>4?arguments[4]:void 0;return Gp(t.id)?(o=o||rf(e,t,r,n),Mf(o)):t.id}const kf={[mp]:"50% 50%",[yp]:"0% 0%",[vp]:"100% 0%",top:"50% 0%",[bp]:"0% 100%",[Op]:"100% 100%",[wp]:"50% 100%",[Ep]:"100% 50%",[Ip]:"0% 50%"};function Lf(e,t,r,n){if(function(e,t,r){return r&&t&&!function(e){return!e||!e.trim()||"none"===e.toLowerCase()}(t.id)&&Object.values(lp).includes(e)}(e,t,r)){const o=function(e,t,r){const n=Object.assign({},r),o=Fp.isMobile;switch(e){case lp.LEGACY_BG_FIT_AND_TILE:case lp.LEGACY_BG_FIT_AND_TILE_HORIZONTAL:case lp.LEGACY_BG_FIT_AND_TILE_VERTICAL:case lp.LEGACY_BG_NORMAL:const e=o?1e3:1920,r=o?1e3:1920;n.width=Math.min(e,t.width),n.height=Math.min(r,Math.round(n.width/(t.width/t.height))),n.pixelAspectRatio=1}return n}(e,t,r);return{uri:Ff(e,t,o,n||{},rf(e,t,o,n))}}return{uri:""}}Object.entries(kf).reduce(((e,t)=>{let[r,n]=t;return e[n]=r,e}),{});const Uf=/^media\//i,Wf="undefined"!=typeof window?window.devicePixelRatio:1,Vf=(e,t)=>{const r=t&&t.baseHostURL;return r?"".concat(r).concat(e):(e=>Uf.test(e)?"".concat("https://static.wixstatic.com/").concat(e):"".concat("https://static.wixstatic.com/media/").concat(e))(e)};kp(),kp();const Gf={getScaleToFitImageURL:function(e,t,r,n,o,a){const i=Lf(lp.SCALE_TO_FIT,{id:e,width:t,height:r,name:a&&a.name},{width:n,height:o,htmlTag:Pp,alignment:mp,pixelAspectRatio:Wf},a);return Vf(i.uri,a)},getScaleToFillImageURL:function(e,t,r,n,o,a){const i=Lf(lp.SCALE_TO_FILL,{id:e,width:t,height:r,name:a&&a.name,focalPoint:{x:a&&a.focalPoint&&a.focalPoint.x,y:a&&a.focalPoint&&a.focalPoint.y}},{width:n,height:o,htmlTag:Pp,alignment:mp,pixelAspectRatio:Wf},a);return Vf(i.uri,a)},getCropImageURL:function(e,t,r,n,o,a,i,s,c,l){const u=Lf(lp.SCALE_TO_FILL,{id:e,width:t,height:r,name:l&&l.name,crop:{x:n,y:o,width:a,height:i}},{width:s,height:c,htmlTag:Pp,alignment:mp,pixelAspectRatio:Wf},l);return Vf(u.uri,l)}};function Bf(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function qf(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Bf(Object(r),!0).forEach((function(t){zf(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Bf(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function zf(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Hf(e,t){Xf(e,t),t.add(e)}function $f(e,t,r){Xf(e,t),t.set(e,r)}function Xf(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Yf(e,t){return function(e,t){return t.get?t.get.call(e):t.value}(e,Qf(e,t,"get"))}function Kf(e,t,r){if(!t.has(e))throw new TypeError("attempted to get private field on non-instance");return r}function Zf(e,t,r){return function(e,t,r){if(t.set)t.set.call(e,r);else{if(!t.writable)throw new TypeError("attempted to set read only private field");t.value=r}}(e,Qf(e,t,"set"),r),r}function Qf(e,t,r){if(!t.has(e))throw new TypeError("attempted to "+r+" private field on non-instance");return t.get(e)}var Jf=new WeakMap,eh=new WeakMap,th=new WeakMap,rh=new WeakMap,nh=new WeakMap,oh=new WeakMap,ah=new WeakSet,ih=new WeakSet,sh=new WeakSet,ch=new WeakSet,lh=new WeakSet;class uh{constructor(e){let{platformUtils:t,wixSdk:r,bi:n,tpaActionImplementations:o,devMode:a,verbose:i}=e;Hf(this,lh),Hf(this,ch),Hf(this,sh),Hf(this,ih),Hf(this,ah),$f(this,Jf,{writable:!0,value:void 0}),$f(this,eh,{writable:!0,value:void 0}),$f(this,th,{writable:!0,value:void 0}),$f(this,rh,{writable:!0,value:void 0}),$f(this,nh,{writable:!0,value:void 0}),$f(this,oh,{writable:!0,value:void 0}),Zf(this,eh,Kf(this,ah,dh).call(this,{wixSdk:r,bi:n,devMode:a,verbose:i})),Zf(this,th,Kf(this,ih,ph).call(this,r.user)),Zf(this,rh,Kf(this,sh,fh).call(this,r.location,n)),Zf(this,nh,Kf(this,ch,hh).call(this,t)),Zf(this,oh,Kf(this,lh,gh).call(this,r)),Zf(this,Jf,(async e=>{let{currentItem:t,action:n}=e;const a=o[n];await a({wixSdk:r,currentItem:t})}))}get settings(){return Yf(this,eh)}get user(){return Yf(this,th)}get location(){return Yf(this,rh)}get utils(){return Yf(this,nh)}get timers(){return Yf(this,oh)}get executeTpaAction(){return Yf(this,Jf)}}function dh(e){let{wixSdk:{window:{viewMode:t,rendering:{env:r},browserLocale:n},site:{regionalSettings:o=n}},bi:{metaSiteId:a,viewerSessionId:i,viewerName:s},devMode:c,verbose:l}=e;return{metaSiteId:a,session:i,locale:o,mode:{name:r,dev:c,verbose:l,ssr:"backend"===r,csr:"backend"!==r},env:{name:t,live:"Site"===t,preview:"Preview"===t,livePreview:"Editor"===t,editor:"Preview"===t||"Editor"===t,renderer:s}}}function ph(e){return{get id(){return e.currentUser.id},get loggedIn(){return e.currentUser.loggedIn},onLogin:e.onLogin}}function fh(e,t){let{baseUrl:r,to:n}=e,{pageId:o,pageUrl:a}=t;return{pageId:o,pageUrl:a,baseUrl:r,navigateTo:n}}function hh(e){let{links:t,mediaItemUtils:r}=e;return{links:t,media:qf(qf({},r),{},{getScaleToFillImageURL:Gf.getScaleToFillImageURL})}}function gh(e){var t,r;return{queueMicrotask:(null===(t=e.environment)||void 0===t||null===(r=t.timers)||void 0===r?void 0:r.queueMicrotask)||queueMicrotask}}function mh(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function yh(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?mh(Object(r),!0).forEach((function(t){vh(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):mh(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function vh(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const wh=JSON.parse('{"USER_INPUT_FILTER_OPTION_RESET_ALL":"All"}'),bh={en:a.t(wh,2)},Oh=bh.en,Ih=e=>{var t;const r=null!==(t=bh[e])&&void 0!==t?t:Oh;return{t:e=>{var t;return null!==(t=null==r?void 0:r[e])&&void 0!==t?t:e}}};function Eh(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Sh(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Eh(Object(r),!0).forEach((function(t){Ph(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Eh(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function _h(e,t,r){!function(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}(e,t),t.set(e,r)}function Ph(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Th(e,t){return function(e,t){return t.get?t.get.call(e):t.value}(e,Ch(e,t,"get"))}function Rh(e,t,r){return function(e,t,r){if(t.set)t.set.call(e,r);else{if(!t.writable)throw new TypeError("attempted to set read only private field");t.value=r}}(e,Ch(e,t,"set"),r),r}function Ch(e,t,r){if(!t.has(e))throw new TypeError("attempted to "+r+" private field on non-instance");return t.get(e)}var Dh=new WeakMap,Ah=new WeakMap,jh=new WeakMap,xh=new WeakMap,Nh=new WeakMap,Mh=new WeakMap,Fh=new WeakMap,kh=new WeakMap;const Lh=(e,t)=>{let{instance:r,appData:n}=e;if(r&&n)return{instance:r,gridAppId:n.gridAppId};const{query:{instance:a,gridAppId:i}}=o("?".concat(t.queryParameters),!0);return{instance:a,gridAppId:i}},{initAppForPage:Uh,createControllers:Wh}=new class{constructor(){var e=this;let{verbose:t=!1,wixDataSchemasForItTests:r,getElementorySupport:a=(()=>self.elementorySupport),automationsClientCreator:i=w,tpaActionImplementations:s=n.GU}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Ph(this,"initAppForPage",(function(t,r,n){let{bi:a={},monitoring:{createMonitor:i},fedOpsLoggerFactory:s,biLoggerFactory:c,essentials:{httpClient:l,experiments:u}}=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};try{const d=new uh({platformUtils:r,wixSdk:n,bi:a,tpaActionImplementations:Th(e,kh),devMode:!1,verbose:Th(e,xh)}),{settings:p}=d,{instance:f,gridAppId:h}=Lh(t,Th(e,Mh).call(e)),{data:g,window:{warmupData:m,getRouterData:y},location:{baseUrl:v,protocol:w},site:{language:b}}=n;Rh(e,jh,y()),Rh(e,Ah,new La({fedops:{factory:s,hooks:{start:t=>{let{name:r}=t;return Th(e,Ah).log(new Xe({category:"interaction start",message:"interaction ".concat(r," started")}))},end:t=>{let{name:r,duration:n}=t;return Th(e,Ah).log(new Xe({category:"interaction end",message:"interaction ".concat(r," ended after ").concat(n," ms")}))}}},bi:{factory:c},monitor:{factory:i},verbose:{factory:()=>({log:function(){var e;return((null===(e=n.telemetry)||void 0===e?void 0:e.console)||console).verbose(...arguments)}})},console:{factory:()=>{var e;return(null===(e=n.telemetry)||void 0===e?void 0:e.console)||console}},settings:p,global:self})),Th(e,Ah).log(new $e("databinding/initAppForPage",$e.types.START));const O=Ih(b),I=new ia({experiments:u,settings:p}),E=I.fes?new fo({httpClient:l,getRequestParams:()=>({instance:f,gridAppId:h})}):new Lo({wixData:g||self.require("wix-data").default,wixDataSchemas:Th(e,Nh)||new cp(l,f,h,{baseUrl:p.env.editor?void 0:"".concat(w,"://").concat(o(v).hostname,"/_api/cloud-data/v1/schemas")})}),S=new Ko(m),_=new aa(Th(e,jh)),P=Rd({automationsClientCreator:()=>Th(e,Fh).call(e,{httpClient:l})});return Rh(e,Dh,new fd({platform:d,dataFetcher:E,warmupCache:S,staticCache:_,features:I,listenersByEvent:P,logger:Th(e,Ah),i18n:O,global:self})),Th(e,Ah).log(new $e("databinding/initAppForPage",$e.types.END)),Promise.resolve()}catch(t){return Th(e,Ah)&&Th(e,Ah).log(new R("App initialisation failed",{cause:t})),Promise.reject(t)}})),Ph(this,"createControllers",(e=>{if(!e.length)return[];const t=(n=e,o=Th(this,jh),n.map((e=>{let{compId:t,config:{dataset:{collectionName:r,filter:n,sort:a,includes:i,nested:s,pageSize:c,readWriteType:l,deferred:u,cursor:d}={}}={},type:p,connections:f,livePreviewOptions:{shouldFetchData:h,compsIdsToReset:g=[]}={}}=e;const m={id:t,type:p,collectionId:r,filter:n,sort:a,pageSize:c,readWriteType:l,includes:i,nested:s,deferred:u,connections:f,dataIsInvalidated:h,updatedCompIds:g,cursor:d};return p===Ar&&o?((e,t)=>{const{readWriteType:r}=e,{config:{dataset:{collectionName:n,filter:o,sort:a,includes:i,pageSize:s,lowercase:c}},dynamicUrl:l,userDefinedFilter:u}=t;return yh(yh({},e),{},{collectionId:n,filter:o,sort:a,includes:i,pageSize:s,readWriteType:r,dynamicPageData:{lowercase:c,dynamicUrl:l,userDefinedFilter:u}})})(m,o):m}))),r=e.reduce(((e,t)=>{let{$w:r,compId:n}=t;return e[n]=r.fireEvent,e}),{});var n,o;return Th(this,Dh).initializeDatasets({datasetConfigs:t,firePlatformEvent:e=>r[e]}).map((e=>Sh(Sh({},e),{},{pageReady:t=>e.pageReady(Cu(t))})))})),_h(this,Dh,{writable:!0,value:void 0}),_h(this,Ah,{writable:!0,value:void 0}),_h(this,jh,{writable:!0,value:void 0}),_h(this,xh,{writable:!0,value:void 0}),_h(this,Nh,{writable:!0,value:void 0}),_h(this,Mh,{writable:!0,value:void 0}),_h(this,Fh,{writable:!0,value:void 0}),_h(this,kh,{writable:!0,value:void 0}),Rh(this,Nh,r),Rh(this,Mh,a),Rh(this,Fh,i),Rh(this,xh,t),Rh(this,kh,s),{initAppForPage:this.initAppForPage,createControllers:this.createControllers}}}})(),i})()));
//# sourceMappingURL=app.js.map
}